create-buntui 0.1.0-alpha.3 → 0.1.0-alpha.4

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.
Files changed (39) hide show
  1. package/dist/main.js +4 -0
  2. package/package.json +8 -9
  3. package/templates/basic/package.json +3 -3
  4. package/templates/basic/src/apps/main/main.ts +12 -0
  5. package/templates/basic/src/shared/runApp.ts +14 -0
  6. package/templates/full/README.md +14 -12
  7. package/templates/full/package.json +3 -3
  8. package/templates/full/src/{components → apps/main/components}/BoxDemo.vue +5 -5
  9. package/templates/full/src/apps/main/main.ts +12 -0
  10. package/templates/full/src/shared/runApp.ts +14 -0
  11. package/templates/sfc/README.md +5 -3
  12. package/templates/sfc/package.json +3 -3
  13. package/templates/sfc/src/apps/main/main.ts +12 -0
  14. package/templates/sfc/src/shared/runApp.ts +14 -0
  15. package/dist/buntui.so +0 -0
  16. package/dist/index.js +0 -7
  17. package/templates/basic/scripts/build.ts +0 -65
  18. package/templates/basic/src/dev.ts +0 -27
  19. package/templates/basic/src/main.ts +0 -15
  20. package/templates/full/scripts/build.ts +0 -66
  21. package/templates/full/src/dev.ts +0 -40
  22. package/templates/full/src/main.ts +0 -21
  23. package/templates/sfc/scripts/build.ts +0 -66
  24. package/templates/sfc/src/dev.ts +0 -40
  25. package/templates/sfc/src/main.ts +0 -21
  26. /package/templates/basic/src/{App.vue → apps/main/App.vue} +0 -0
  27. /package/templates/full/src/{App.vue → apps/main/App.vue} +0 -0
  28. /package/templates/full/src/{components → apps/main/components}/ButtonDemo.vue +0 -0
  29. /package/templates/full/src/{components → apps/main/components}/CheckboxDemo.vue +0 -0
  30. /package/templates/full/src/{components → apps/main/components}/InputDemo.vue +0 -0
  31. /package/templates/full/src/{components → apps/main/components}/ProgressDemo.vue +0 -0
  32. /package/templates/full/src/{components → apps/main/components}/RadioDemo.vue +0 -0
  33. /package/templates/full/src/{components → apps/main/components}/ScrollBoxDemo.vue +0 -0
  34. /package/templates/full/src/{components → apps/main/components}/SelectDemo.vue +0 -0
  35. /package/templates/full/src/{components → apps/main/components}/SwitchDemo.vue +0 -0
  36. /package/templates/full/src/{components → apps/main/components}/TableDemo.vue +0 -0
  37. /package/templates/full/src/{components → apps/main/components}/TextDemo.vue +0 -0
  38. /package/templates/full/src/{components → apps/main/components}/TextareaDemo.vue +0 -0
  39. /package/templates/sfc/src/{App.vue → apps/main/App.vue} +0 -0
package/dist/main.js ADDED
@@ -0,0 +1,4 @@
1
+ // @bun
2
+ var d4=Object.create;var{getPrototypeOf:o4,defineProperty:v0,getOwnPropertyNames:_1,getOwnPropertyDescriptor:y4}=Object,Z1=Object.prototype.hasOwnProperty;function Q1(x){return this[x]}var p4,r4,J1=(x,h,F)=>{var B=x!=null&&typeof x==="object";if(B){var $=h?p4??=new WeakMap:r4??=new WeakMap,N=$.get(x);if(N)return N}F=x!=null?d4(o4(x)):{};let _=h||!x||!x.__esModule?v0(F,"default",{value:x,enumerable:!0}):F;for(let Z of _1(x))if(!Z1.call(_,Z))v0(_,Z,{get:Q1.bind(x,Z),enumerable:!0});if(B)$.set(x,_);return _},ox=(x)=>{var h=(N1??=new WeakMap).get(x),F;if(h)return h;if(h=v0({},"__esModule",{value:!0}),x&&typeof x==="object"||typeof x==="function"){for(var B of _1(x))if(!Z1.call(h,B))v0(h,B,{get:Q1.bind(x,B),enumerable:!(F=y4(x,B))||F.enumerable})}return N1.set(x,h),h},N1,U1=(x,h)=>()=>(h||x((h={exports:{}}).exports,h),h.exports);var v4=(x)=>x;function l4(x,h){this[x]=v4.bind(null,h)}var yx=(x,h)=>{for(var F in h)v0(x,F,{get:h[F],enumerable:!0,configurable:!0,set:l4.bind(h,F)})};var a=(x,h)=>()=>(x&&(h=x(x=0)),h);var l0=import.meta.require;function q1(x={}){let h=x.arch??64,F=h===64?8:4,B=0;function $(N){let _=0;if(typeof N==="number")_=N;else if(N==="pointer")_=F;else if(N==="bool")_=1;else{let G=Number.parseInt(N.slice(1),10);_=Math.ceil(G/8)}let Z=Math.min(_,F),Q=(Z-B%Z)%Z;B+=Q;let U=B;return B+=_,U}return{get currentOffset(){return B},get arch(){return h},mark:$}}function px(x){let h=a4.encode(x),F=new Uint8Array(h.length+1);return F.set(h),F[h.length]=0,F}var a4,rx;var jx=a(()=>{a4=new TextEncoder("utf-8");rx={False:0,True:1}});function z1(x){return Number(x)}var G1,h0;var a0=a(()=>{jx();G1=class G1{#h;constructor(x,h,F){this.#h=new globalThis.DataView(x,h,F)}get byteLength(){return this.#h.byteLength}getFloat32(x,h){return this.#h.getFloat32(x,h)}getFloat64(x,h){return this.#h.getFloat64(x,h)}getInt8(x){return this.#h.getInt8(x)}getInt16(x,h){return this.#h.getInt16(x,h)}getInt32(x,h){return this.#h.getInt32(x,h)}getUint8(x){return this.#h.getUint8(x)}getUint16(x,h){return this.#h.getUint16(x,h)}getUint32(x,h){return this.#h.getUint32(x,h)}setFloat32(x,h,F){this.#h.setFloat32(x,h,F)}setFloat64(x,h,F){this.#h.setFloat64(x,h,F)}setInt8(x,h){this.#h.setInt8(x,h)}setInt16(x,h,F){this.#h.setInt16(x,h,F)}setInt32(x,h,F){this.#h.setInt32(x,h,F)}setUint8(x,h){this.#h.setUint8(x,h)}setUint16(x,h,F){this.#h.setUint16(x,h,F)}setUint32(x,h,F){this.#h.setUint32(x,h,F)}getBigInt64(x,h){return this.#h.getBigInt64(x,h)}getBigUint64(x,h){return this.#h.getBigUint64(x,h)}setBigInt64(x,h,F){this.#h.setBigInt64(x,h,F)}setBigUint64(x,h,F){this.#h.setBigUint64(x,h,F)}getFloat16(x,h){return this.#h.getFloat16(x,h)}setFloat16(x,h,F){this.#h.setFloat16(x,h,F)}setPointer(x,h){this.#h.setBigUint64(x,BigInt(h),!0)}getPointer(x){return z1(Number(this.#h.getBigUint64(x,!0)))}getBool(x){let h=this.#h.getUint8(x);if(h!==1&&h!==0)throw Error(`Invalid boolean value: ${h}`);return h!==0}setBool(x,h){this.#h.setUint8(x,h?rx.True:rx.False)}get[Symbol.toStringTag](){return this.#h[Symbol.toStringTag]}};h0=G1});class lx{key;shiftKey;ctrlKey;altKey;metaKey;repeat;charCode;constructor(x){let h=new h0(x),F=h.getUint8(0);this.charCode=h.getUint16(1,!0);let B=h.getUint8(3);if(this.shiftKey=(F&nx)===nx,this.ctrlKey=(F&Ax)===Ax,this.altKey=(F&Cx)===Cx,this.metaKey=(F&Yx)===Yx,this.repeat=(F&I1)===I1,B>0){let $=new Uint8Array(x,4,B);this.key=new TextDecoder("utf-8").decode($)}else this.key=void 0}}class S0{static LEFT_MOUSE_BUTTON=0;static MIDDLE_MOUSE_BUTTON=1;static RIGHT_MOUSE_BUTTON=2;button;buttons;x;y;isRelease;shiftKey;ctrlKey;altKey;metaKey;constructor(x){let h=new h0(x),F=h.getUint8(0),B=h.getUint8(1);this.shiftKey=(F&nx)===nx,this.ctrlKey=(F&Ax)===Ax,this.altKey=(F&Cx)===Cx,this.metaKey=(F&Yx)===Yx,this.x=h.getUint16(4,!0)-1,this.y=h.getUint16(6,!0)-1,this.button=(B&K1)===K1?h.getUint8(2):void 0,this.buttons=(B&D1)===D1?h.getUint8(3):void 0,this.isRelease=(B&j1)===j1}}class ex{rows;cols;constructor(x){let h=new h0(x);this.rows=h.getUint16(0,!0),this.cols=h.getUint16(2,!0)}}var nx=1,Ax=2,Cx=4,Yx=8,I1=16,K1=1,D1=2,j1=16,W,ax;var e0=a(()=>{a0();W={KeyboardEvent:1,MouseEvent:2,WheelEvent:3,TermResizeEvent:4};ax=class ax extends S0{wheelDeltaY;constructor(x){super(x);let h=new h0(x);this.wheelDeltaY=h.getInt8(8)}}});function A1(x){xh=x}function Xx(x){if(!xh){if(!n1)console.warn("[buntui] ptr() called without FFI initialization. This is expected in browser environments. Returning 0."),n1=!0;return 0}return xh(x)}var xh,n1=!1;var Y1,X1,E1,t3,w3,xx,L1;var Ex=a(()=>{Y1=(()=>{if(typeof setImmediate==="function")return setImmediate;return(x)=>setTimeout(x,0)})(),X1=(()=>{if(typeof clearImmediate==="function")return clearImmediate;return(x)=>{clearTimeout(x)}})(),E1={schedule:(x)=>Y1(x),cancel(x){X1(x)}},t3=(()=>{if(typeof requestAnimationFrame==="function")return requestAnimationFrame;return(x)=>setTimeout(x,0)})(),w3=(()=>{if(typeof cancelAnimationFrame==="function")return cancelAnimationFrame;return(x)=>{clearTimeout(x)}})(),xx=Y1,L1=X1});import P1 from"process";import x6 from"fs";import{suffix as h6}from"bun:ffi";function B6(){try{let x=l0(`@buntui/native-${F6}`);if(x6.existsSync(x.binaryPath))return x.binaryPath}catch{}return}function M1(){return B6()??""}var y3,F6;var H1=a(()=>{y3=`buntui.${h6}`,F6=`${P1.platform}-${P1.arch}`});import s0 from"path";import hx from"fs";import hh from"process";import{CString as x9,suffix as $6}from"bun:ffi";function c1(){if(d)return d;let x=`buntui.${$6}`,h=hh.platform==="win32"?"":"lib",F=hh.platform==="win32"?"bin":"lib",B=`${h}${x}`,$=hh.env.BUNTUI_DLL;if($)return d=s0.resolve($),d;let N=M1();if(hx.existsSync(N))return d=N,d;let _=s0.resolve(s0.dirname(Bun.main),x);if(hx.existsSync(_))return d=_,d;let Z=s0.resolve(import.meta.dir,x);if(hx.existsSync(Z))return d=Z,d;let Q=s0.resolve(import.meta.dir,"..","..","..","packages","native","zig-out","bin",x);if(hx.existsSync(Q))return d=Q,d;let U=s0.resolve(import.meta.dir,"..","..","..","packages","native","zig-out",F,B);if(hx.existsSync(U))return d=U,d;throw Error(`Cannot find native library: ${x}. Set BUNTUI_DLL env or ensure the binary is in the search path.`)}var d;var i1=a(()=>{H1()});var b1={};yx(b1,{NativeBackend:()=>W1});import{dlopen as N6,FFIType as t,toArrayBuffer as f1}from"bun:ffi";function Z6(){return N6(c1(),{setupLogger:{returns:t.void,args:[t.cstring,t.cstring,t.u8,t.u8]},startApp:{returns:t.void,args:[]},stopApp:{returns:t.void,args:[]},detectTermSize:{returns:t.void,args:[t.pointer]},renderDrawList:{returns:t.void,args:[t.pointer,t.pointer,t.uint64_t]},event_bus_poll:{args:[],returns:t.ptr},event_bus_commit:{args:[],returns:t.void}}).symbols}function g0(){return m1??=Z6(),m1}class W1{#h=!1;setupLogger(x,h,F,B){let $=Fh(F);g0().setupLogger(px(x),px(h),$,B?1:0)}startApp(){g0().startApp()}stopApp(){g0().stopApp()}detectTermSize(x){g0().detectTermSize(x.ptr)}renderDrawList(x,h){g0().renderDrawList(x.ptr,h.ptr,h.byteLength)}startEvents(x){this.#h=!0;let h=g0(),F=()=>{if(!this.#h)return;let B=h.event_bus_poll();if(B!==null)try{let $=f1(B,0,16),N=new h0($),_=N.getUint32(0,!0),Z=N.getUint32(4,!0),Q=f1(B,16,Z),U=_6.get(_);if(!U)throw M.logWarning(`Unknown event type: ${_}`),Error(`Unknown event type: ${_}`);let G=new U(Q);x(_,G)}catch($){M.logError(`Event parse error: ${Q6($)}`)}finally{h.event_bus_commit()}xx(F)};F()}stopEvents(){this.#h=!1}}function Q6(x){if(x instanceof Error)return x.stack??x.message;return String(x)}var _6,m1;var R1=a(()=>{i1();jx();a0();Fx();e0();Ex();_6=new Map([[W.KeyboardEvent,lx],[W.MouseEvent,S0],[W.WheelEvent,ax],[W.TermResizeEvent,ex]])});var T1={};yx(T1,{FileLogSink:()=>O1});import Lx from"fs";import J6 from"path";function U6(){let x=new Date,h=x.getTime();if(h===V1)return Bh;let F=x.getFullYear(),B=x.getMonth()+1,$=x.getDate(),N=x.getHours(),_=x.getMinutes(),Z=x.getSeconds();V1=h;let Q=(U)=>String(U).padStart(2,"0");return Bh=`[${F}-${Q(B)}-${Q($)} ${Q(N)}:${Q(_)}:${Q(Z)}]`,Bh}class O1{#h="";init(x,h,F){if(this.#h=J6.resolve(x,h),!Lx.existsSync(x))Lx.mkdirSync(x,{recursive:!0});if(F)Lx.writeFileSync(this.#h,"")}write(x,h){Lx.appendFileSync(this.#h,`${U6()} ${x}: ${h}
3
+ `)}}var Bh="",V1=0;var S1=()=>{};function Bx(){return l0("process")}function $h(){let{NativeBackend:x}=(R1(),ox(b1));return new x}function Nh(){return l0("path").dirname(Bun.main)}function _h(x,h,F){let{FileLogSink:B}=(S1(),ox(T1)),$=new B;return $.init(x,h,F),$}var q6;var s1=a(()=>{({ptr:q6}=l0("bun:ffi"));A1(q6)});var Zh=a(()=>{s1()});function Fh(x){switch(x){case"debug":return g1;case"info":return Qh;case"warning":return t1;case"error":return w1}}class k1{#h;#x;#F;#B;#$;constructor(){this.#h=console.log.bind(console),this.#x=console.error.bind(console),this.#F=console.warn.bind(console),this.#B=console.info.bind(console),this.#$=console.debug.bind(console)}write(x,h){let B=`${`[${new Date().toISOString()}]`} ${x}: ${h}`;switch(x){case"error":{this.#x(B);break}case"warning":{this.#F(B);break}case"info":{this.#B(B);break}case"debug":{this.#$(B);break}default:this.#h(B)}}}class u1{#h=new k1;#x=Qh;#F=[];#B=!1;#$;init(x){this.#x=Fh(x.logLevel),this.#h=_h(x.logFileDir,x.frontendLogName,x.clearLog),this.#B=!0;let h=()=>{if(!this.#B)return;try{while(this.#F.length>0){let F=this.#F.shift();if(F)F()}}finally{this.#$=xx(h)}};this.#$=xx(h)}setSink(x){this.#h=x}deinit(){if(this.#B=!1,this.#$!==void 0)L1(this.#$),this.#$=void 0;for(let x of this.#F)x();this.#F.length=0}logDebug(x){if(this.#x===g1)this.#F.push(()=>{this.#h.write("debug",x)})}logInfo(x){if(this.#x<=Qh)this.#F.push(()=>{this.#h.write("info",x)})}logWarning(x){if(this.#x<=t1)this.#F.push(()=>{this.#h.write("warning",x)})}logError(x){if(this.#x<=w1)this.#F.push(()=>{this.#h.write("error",x)})}}var g1=0,Qh=1,t1=2,w1=3,M;var Fx=a(()=>{Ex();Zh();M=new u1});var RF={};yx(RF,{SystemClipboard:()=>bF});import WF from"process";import{spawnSync as u0}from"child_process";class bF{read(){try{let{platform:x}=WF;if(x==="win32"){let h=u0("powershell",["-command","Get-Clipboard"],{encoding:"utf8",timeout:3000,windowsHide:!0});if(h.status===0&&h.stdout)return h.stdout.replace(/\r?\n$/v,"")}else if(x==="darwin"){let h=u0("pbpaste",{encoding:"utf8",timeout:3000});if(h.status===0&&h.stdout)return h.stdout}else{let h=u0("xclip",["-selection","clipboard","-o"],{encoding:"utf8",timeout:3000});if(h.status===0&&h.stdout)return h.stdout}}catch{}return""}write(x){try{let{platform:h}=WF;if(h==="win32")u0("clip",{input:x,timeout:3000,windowsHide:!0});else if(h==="darwin")u0("pbcopy",{input:x,timeout:3000});else u0("xclip",["-selection","clipboard"],{input:x,timeout:3000})}catch{}}}var VF=()=>{};var z4=U1((q4)=>{Object.defineProperty(q4,"__esModule",{value:!0});function y(x){let h=Object.create(null);for(let F of x.split(","))h[F]=1;return(F)=>(F in h)}var h2=Object.freeze({}),F2=Object.freeze([]),B2=()=>{},$2=()=>!1,N2=(x)=>x.charCodeAt(0)===111&&x.charCodeAt(1)===110&&(x.charCodeAt(2)>122||x.charCodeAt(2)<97),_2=(x)=>x.startsWith("onUpdate:"),Z2=Object.assign,Q2=(x,h)=>{let F=x.indexOf(h);if(F>-1)x.splice(F,1)},J2=Object.prototype.hasOwnProperty,U2=(x,h)=>J2.call(x,h),b0=Array.isArray,eF=(x)=>R0(x)==="[object Map]",x4=(x)=>R0(x)==="[object Set]",Vh=(x)=>R0(x)==="[object Date]",q2=(x)=>R0(x)==="[object RegExp]",_x=(x)=>typeof x==="function",Z0=(x)=>typeof x==="string",Zx=(x)=>typeof x==="symbol",M0=(x)=>x!==null&&typeof x==="object",z2=(x)=>{return(M0(x)||_x(x))&&_x(x.then)&&_x(x.catch)},Oh=Object.prototype.toString,R0=(x)=>Oh.call(x),G2=(x)=>{return R0(x).slice(8,-1)},h4=(x)=>R0(x)==="[object Object]",I2=(x)=>Z0(x)&&x!=="NaN"&&x[0]!=="-"&&""+parseInt(x,10)===x,K2=y(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),D2=y("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),mx=(x)=>{let h=Object.create(null);return(F)=>{return h[F]||(h[F]=x(F))}},j2=/-\w/g,n2=mx((x)=>{return x.replace(j2,(h)=>h.slice(1).toUpperCase())}),A2=/\B([A-Z])/g,F4=mx((x)=>x.replace(A2,"-$1").toLowerCase()),B4=mx((x)=>{return x.charAt(0).toUpperCase()+x.slice(1)}),C2=mx((x)=>{return x?`on${B4(x)}`:""}),Y2=(x,h)=>!Object.is(x,h),X2=(x,...h)=>{for(let F=0;F<x.length;F++)x[F](...h)},E2=(x,h,F,B=!1)=>{Object.defineProperty(x,h,{configurable:!0,enumerable:!1,writable:B,value:F})},L2=(x)=>{let h=parseFloat(x);return isNaN(h)?x:h},P2=(x)=>{let h=Z0(x)?Number(x):NaN;return isNaN(h)?x:h},lF,M2=()=>{return lF||(lF=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{})},H2=/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;function c2(x){return H2.test(x)?`__props.${x}`:`__props[${JSON.stringify(x)}]`}function i2(x,h){return x+JSON.stringify(h,(F,B)=>typeof B==="function"?B.toString():B)}var f2={TEXT:1,"1":"TEXT",CLASS:2,"2":"CLASS",STYLE:4,"4":"STYLE",PROPS:8,"8":"PROPS",FULL_PROPS:16,"16":"FULL_PROPS",NEED_HYDRATION:32,"32":"NEED_HYDRATION",STABLE_FRAGMENT:64,"64":"STABLE_FRAGMENT",KEYED_FRAGMENT:128,"128":"KEYED_FRAGMENT",UNKEYED_FRAGMENT:256,"256":"UNKEYED_FRAGMENT",NEED_PATCH:512,"512":"NEED_PATCH",DYNAMIC_SLOTS:1024,"1024":"DYNAMIC_SLOTS",DEV_ROOT_FRAGMENT:2048,"2048":"DEV_ROOT_FRAGMENT",CACHED:-1,"-1":"CACHED",BAIL:-2,"-2":"BAIL"},m2={[1]:"TEXT",[2]:"CLASS",[4]:"STYLE",[8]:"PROPS",[16]:"FULL_PROPS",[32]:"NEED_HYDRATION",[64]:"STABLE_FRAGMENT",[128]:"KEYED_FRAGMENT",[256]:"UNKEYED_FRAGMENT",[512]:"NEED_PATCH",[1024]:"DYNAMIC_SLOTS",[2048]:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},W2={ELEMENT:1,"1":"ELEMENT",FUNCTIONAL_COMPONENT:2,"2":"FUNCTIONAL_COMPONENT",STATEFUL_COMPONENT:4,"4":"STATEFUL_COMPONENT",TEXT_CHILDREN:8,"8":"TEXT_CHILDREN",ARRAY_CHILDREN:16,"16":"ARRAY_CHILDREN",SLOTS_CHILDREN:32,"32":"SLOTS_CHILDREN",TELEPORT:64,"64":"TELEPORT",SUSPENSE:128,"128":"SUSPENSE",COMPONENT_SHOULD_KEEP_ALIVE:256,"256":"COMPONENT_SHOULD_KEEP_ALIVE",COMPONENT_KEPT_ALIVE:512,"512":"COMPONENT_KEPT_ALIVE",COMPONENT:6,"6":"COMPONENT"},b2={STABLE:1,"1":"STABLE",DYNAMIC:2,"2":"DYNAMIC",FORWARDED:3,"3":"FORWARDED"},R2={[1]:"STABLE",[2]:"DYNAMIC",[3]:"FORWARDED"},V2="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",$4=y(V2),O2=$4,aF=2;function T2(x,h=0,F=x.length){if(h=Math.max(0,Math.min(h,x.length)),F=Math.max(0,Math.min(F,x.length)),h>F)return"";let B=x.split(/(\r?\n)/),$=B.filter((Z,Q)=>Q%2===1);B=B.filter((Z,Q)=>Q%2===0);let N=0,_=[];for(let Z=0;Z<B.length;Z++)if(N+=B[Z].length+($[Z]&&$[Z].length||0),N>=h){for(let Q=Z-aF;Q<=Z+aF||F>N;Q++){if(Q<0||Q>=B.length)continue;let U=Q+1;_.push(`${U}${" ".repeat(Math.max(3-String(U).length,0))}| ${B[Q]}`);let G=B[Q].length,z=$[Q]&&$[Q].length||0;if(Q===Z){let D=h-(N-(G+z)),A=Math.max(1,F>N?G-D:F-h);_.push(" | "+" ".repeat(D)+"^".repeat(A))}else if(Q>Z){if(F>N){let D=Math.max(Math.min(F-N,G),1);_.push(" | "+"^".repeat(D))}N+=G+z}}break}return _.join(`
4
+ `)}function Th(x){if(b0(x)){let h={};for(let F=0;F<x.length;F++){let B=x[F],$=Z0(B)?N4(B):Th(B);if($)for(let N in $)h[N]=$[N]}return h}else if(Z0(x)||M0(x))return x}var S2=/;(?![^(]*\))/g,s2=/:([^]+)/,g2=/\/\*[^]*?\*\//g;function N4(x){let h={};return x.replace(g2,"").split(S2).forEach((F)=>{if(F){let B=F.split(s2);B.length>1&&(h[B[0].trim()]=B[1].trim())}}),h}function t2(x){if(!x)return"";if(Z0(x))return x;let h="";for(let F in x){let B=x[F];if(Z0(B)||typeof B==="number"){let $=F.startsWith("--")?F:F4(F);h+=`${$}:${B};`}}return h}function Sh(x){let h="";if(Z0(x))h=x;else if(b0(x))for(let F=0;F<x.length;F++){let B=Sh(x[F]);if(B)h+=B+" "}else if(M0(x)){for(let F in x)if(x[F])h+=F+" "}return h.trim()}function w2(x){if(!x)return null;let{class:h,style:F}=x;if(h&&!Z0(h))x.class=Sh(h);if(F)x.style=Th(F);return x}var k2="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",u2="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",d2="annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics",o2="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",y2=y(k2),p2=y(u2),r2=y(d2),v2=y(o2),_4="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",l2=y(_4),a2=y(_4+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function e2(x){return!!x||x===""}var xB=/[>/="'\u0009\u000a\u000c\u0020]/,bh={};function hB(x){if(bh.hasOwnProperty(x))return bh[x];let h=xB.test(x);if(h)console.error(`unsafe attribute name: ${x}`);return bh[x]=!h}var FB={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},BB=y("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),$B=y("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan"),NB=y("accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns");function _B(x){if(x==null)return!1;let h=typeof x;return h==="string"||h==="number"||h==="boolean"}var ZB=/["'&<>]/;function QB(x){let h=""+x,F=ZB.exec(h);if(!F)return h;let B="",$,N,_=0;for(N=F.index;N<h.length;N++){switch(h.charCodeAt(N)){case 34:$="&quot;";break;case 38:$="&amp;";break;case 39:$="&#39;";break;case 60:$="&lt;";break;case 62:$="&gt;";break;default:continue}if(_!==N)B+=h.slice(_,N);_=N+1,B+=$}return _!==N?B+h.slice(_,N):B}var JB=/^-?>|<!--|-->|--!>|<!-$/g;function UB(x){return x.replace(JB,"")}var Z4=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function qB(x,h){return x.replace(Z4,(F)=>h?F==='"'?"\\\\\\\"":`\\\\${F}`:`\\${F}`)}function zB(x,h){if(x.length!==h.length)return!1;let F=!0;for(let B=0;F&&B<x.length;B++)F=Wx(x[B],h[B]);return F}function Wx(x,h){if(x===h)return!0;let F=Vh(x),B=Vh(h);if(F||B)return F&&B?x.getTime()===h.getTime():!1;if(F=Zx(x),B=Zx(h),F||B)return x===h;if(F=b0(x),B=b0(h),F||B)return F&&B?zB(x,h):!1;if(F=M0(x),B=M0(h),F||B){if(!F||!B)return!1;let $=Object.keys(x).length,N=Object.keys(h).length;if($!==N)return!1;for(let _ in x){let Z=x.hasOwnProperty(_),Q=h.hasOwnProperty(_);if(Z&&!Q||!Z&&Q||!Wx(x[_],h[_]))return!1}}return String(x)===String(h)}function GB(x,h){return x.findIndex((F)=>Wx(F,h))}var Q4=(x)=>{return!!(x&&x.__v_isRef===!0)},J4=(x)=>{return Z0(x)?x:x==null?"":b0(x)||M0(x)&&(x.toString===Oh||!_x(x.toString))?Q4(x)?J4(x.value):JSON.stringify(x,U4,2):String(x)},U4=(x,h)=>{if(Q4(h))return U4(x,h.value);else if(eF(h))return{[`Map(${h.size})`]:[...h.entries()].reduce((F,[B,$],N)=>{return F[Rh(B,N)+" =>"]=$,F},{})};else if(x4(h))return{[`Set(${h.size})`]:[...h.values()].map((F)=>Rh(F))};else if(Zx(h))return Rh(h);else if(M0(h)&&!b0(h)&&!h4(h))return String(h);return h},Rh=(x,h="")=>{var F;return Zx(x)?`Symbol(${(F=x.description)!=null?F:h})`:x};function IB(x){if(x==null)return"initial";if(typeof x==="string")return x===""?" ":x;if(typeof x!=="number"||!Number.isFinite(x))console.warn("[Vue warn] Invalid value used for CSS binding. Expected a string or a finite number but received:",x);return String(x)}q4.EMPTY_ARR=F2;q4.EMPTY_OBJ=h2;q4.NO=$2;q4.NOOP=B2;q4.PatchFlagNames=m2;q4.PatchFlags=f2;q4.ShapeFlags=W2;q4.SlotFlags=b2;q4.camelize=n2;q4.capitalize=B4;q4.cssVarNameEscapeSymbolsRE=Z4;q4.def=E2;q4.escapeHtml=QB;q4.escapeHtmlComment=UB;q4.extend=Z2;q4.genCacheKey=i2;q4.genPropsAccessExp=c2;q4.generateCodeFrame=T2;q4.getEscapedCssVarName=qB;q4.getGlobalThis=M2;q4.hasChanged=Y2;q4.hasOwn=U2;q4.hyphenate=F4;q4.includeBooleanAttr=e2;q4.invokeArrayFns=X2;q4.isArray=b0;q4.isBooleanAttr=a2;q4.isBuiltInDirective=D2;q4.isDate=Vh;q4.isFunction=_x;q4.isGloballyAllowed=$4;q4.isGloballyWhitelisted=O2;q4.isHTMLTag=y2;q4.isIntegerKey=I2;q4.isKnownHtmlAttr=BB;q4.isKnownMathMLAttr=NB;q4.isKnownSvgAttr=$B;q4.isMap=eF;q4.isMathMLTag=r2;q4.isModelListener=_2;q4.isObject=M0;q4.isOn=N2;q4.isPlainObject=h4;q4.isPromise=z2;q4.isRegExp=q2;q4.isRenderableAttrValue=_B;q4.isReservedProp=K2;q4.isSSRSafeAttrName=hB;q4.isSVGTag=p2;q4.isSet=x4;q4.isSpecialBooleanAttr=l2;q4.isString=Z0;q4.isSymbol=Zx;q4.isVoidTag=v2;q4.looseEqual=Wx;q4.looseIndexOf=GB;q4.looseToNumber=L2;q4.makeMap=y;q4.normalizeClass=Sh;q4.normalizeCssVarValue=IB;q4.normalizeProps=w2;q4.normalizeStyle=Th;q4.objectToString=Oh;q4.parseStringStyle=N4;q4.propsToAttrMap=FB;q4.remove=Q2;q4.slotFlagsText=R2;q4.stringifyStyle=t2;q4.toDisplayString=J4;q4.toHandlerKey=C2;q4.toNumber=P2;q4.toRawType=G2;q4.toTypeString=R0});var h1=U1((S4)=>{Object.defineProperty(S4,"__esModule",{value:!0});var I=z4();function o(x,...h){console.warn(`[Vue warn] ${x}`,...h)}var b;class uh{constructor(x=!1){if(this.detached=x,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!x&&b)if(b.active)this.parent=b,this.index=(b.scopes||(b.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let x,h;if(this.scopes)for(x=0,h=this.scopes.length;x<h;x++)this.scopes[x].pause();for(x=0,h=this.effects.length;x<h;x++)this.effects[x].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let x,h;if(this.scopes)for(x=0,h=this.scopes.length;x<h;x++)this.scopes[x].resume();for(x=0,h=this.effects.length;x<h;x++)this.effects[x].resume()}}}run(x){if(this._active){let h=b;try{return b=this,x()}finally{b=h}}else if(this._warnOnRun)o("cannot run an inactive effect scope.")}on(){if(++this._on===1)this.prevScope=b,b=this}off(){if(this._on>0&&--this._on===0){if(b===this)b=this.prevScope;else{let x=b;while(x){if(x.prevScope===this){x.prevScope=this.prevScope;break}x=x.prevScope}}this.prevScope=void 0}}stop(x){if(this._active){this._active=!1;let h,F;for(h=0,F=this.effects.length;h<F;h++)this.effects[h].stop();this.effects.length=0;for(h=0,F=this.cleanups.length;h<F;h++)this.cleanups[h]();if(this.cleanups.length=0,this.scopes){for(h=0,F=this.scopes.length;h<F;h++)this.scopes[h].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!x){let B=this.parent.scopes.pop();if(B&&B!==this)this.parent.scopes[this.index]=B,B.index=this.index}this.parent=void 0}}}function R8(x){return new uh(x)}function D4(){return b}function V8(x,h=!1){if(b)b.cleanups.push(x);else if(!h)o("onScopeDispose() is called when there is no active effect scope to be associated with.")}var Y,O8={ACTIVE:1,"1":"ACTIVE",RUNNING:2,"2":"RUNNING",TRACKING:4,"4":"TRACKING",NOTIFIED:8,"8":"NOTIFIED",DIRTY:16,"16":"DIRTY",ALLOW_RECURSE:32,"32":"ALLOW_RECURSE",PAUSED:64,"64":"PAUSED",EVALUATED:128,"128":"EVALUATED"},sh=new WeakSet;class d0{constructor(x){if(this.fn=x,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,b)if(b.active)b.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,sh.has(this))sh.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))n4(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,G4(this),A4(this);let x=Y,h=p;Y=this,p=!0;try{return this.fn()}finally{if(Y!==this)o("Active effect was not restored correctly - this is likely a Vue internal bug.");C4(this),Y=x,p=h,this.flags&=-3}}stop(){if(this.flags&1){for(let x=this.deps;x;x=x.nextDep)yh(x);this.deps=this.depsTail=void 0,G4(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)sh.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(wh(this))this.run()}get dirty(){return wh(this)}}var j4=0,Jx,Ux;function n4(x,h=!1){if(x.flags|=8,h){x.next=Ux,Ux=x;return}x.next=Jx,Jx=x}function dh(){j4++}function oh(){if(--j4>0)return;if(Ux){let h=Ux;Ux=void 0;while(h){let F=h.next;h.next=void 0,h.flags&=-9,h=F}}let x;while(Jx){let h=Jx;Jx=void 0;while(h){let F=h.next;if(h.next=void 0,h.flags&=-9,h.flags&1)try{h.trigger()}catch(B){if(!x)x=B}h=F}}if(x)throw x}function A4(x){for(let h=x.deps;h;h=h.nextDep)h.version=-1,h.prevActiveLink=h.dep.activeLink,h.dep.activeLink=h}function C4(x){let h,F=x.depsTail,B=F;while(B){let $=B.prevDep;if(B.version===-1){if(B===F)F=$;yh(B),T8(B)}else h=B;B.dep.activeLink=B.prevActiveLink,B.prevActiveLink=void 0,B=$}x.deps=h,x.depsTail=F}function wh(x){for(let h=x.deps;h;h=h.nextDep)if(h.dep.version!==h.version||h.dep.computed&&(Y4(h.dep.computed)||h.dep.version!==h.version))return!0;if(x._dirty)return!0;return!1}function Y4(x){if(x.flags&4&&!(x.flags&16))return;if(x.flags&=-17,x.globalVersion===qx)return;if(x.globalVersion=qx,!x.isSSR&&x.flags&128&&(!x.deps&&!x._dirty||!wh(x)))return;x.flags|=2;let h=x.dep,F=Y,B=p;Y=x,p=!0;try{A4(x);let $=x.fn(x._value);if(h.version===0||I.hasChanged($,x._value))x.flags|=128,x._value=$,h.version++}catch($){throw h.version++,$}finally{Y=F,p=B,C4(x),x.flags&=-3}}function yh(x,h=!1){let{dep:F,prevSub:B,nextSub:$}=x;if(B)B.nextSub=$,x.prevSub=void 0;if($)$.prevSub=B,x.nextSub=void 0;if(F.subsHead===x)F.subsHead=$;if(F.subs===x){if(F.subs=B,!B&&F.computed){F.computed.flags&=-5;for(let N=F.computed.deps;N;N=N.nextDep)yh(N,!0)}}if(!h&&!--F.sc&&F.map)F.map.delete(F.key)}function T8(x){let{prevDep:h,nextDep:F}=x;if(h)h.nextDep=F,x.prevDep=void 0;if(F)F.prevDep=h,x.nextDep=void 0}function S8(x,h){if(x.effect instanceof d0)x=x.effect.fn;let F=new d0(x);if(h)I.extend(F,h);try{F.run()}catch($){throw F.stop(),$}let B=F.run.bind(F);return B.effect=F,B}function s8(x){x.effect.stop()}var p=!0,ph=[];function rh(){ph.push(p),p=!1}function g8(){ph.push(p),p=!0}function vh(){let x=ph.pop();p=x===void 0?!0:x}function t8(x,h=!1){if(Y instanceof d0)Y.cleanup=x;else if(!h)o("onEffectCleanup() was called when there was no active effect to associate with.")}function G4(x){let{cleanup:h}=x;if(x.cleanup=void 0,h){let F=Y;Y=void 0;try{h()}finally{Y=F}}}var qx=0;class X4{constructor(x,h){this.sub=x,this.dep=h,this.version=h.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class zx{constructor(x){this.computed=x,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0,this.subsHead=void 0}track(x){if(!Y||!p||Y===this.computed)return;let h=this.activeLink;if(h===void 0||h.sub!==Y){if(h=this.activeLink=new X4(Y,this),!Y.deps)Y.deps=Y.depsTail=h;else h.prevDep=Y.depsTail,Y.depsTail.nextDep=h,Y.depsTail=h;E4(h)}else if(h.version===-1){if(h.version=this.version,h.nextDep){let F=h.nextDep;if(F.prevDep=h.prevDep,h.prevDep)h.prevDep.nextDep=F;if(h.prevDep=Y.depsTail,h.nextDep=void 0,Y.depsTail.nextDep=h,Y.depsTail=h,Y.deps===h)Y.deps=F}}if(Y.onTrack)Y.onTrack(I.extend({effect:Y},x));return h}trigger(x){this.version++,qx++,this.notify(x)}notify(x){dh();try{for(let h=this.subsHead;h;h=h.nextSub)if(h.sub.onTrigger&&!(h.sub.flags&8))h.sub.onTrigger(I.extend({effect:h.sub},x));for(let h=this.subs;h;h=h.prevSub)if(h.sub.notify())h.sub.dep.notify()}finally{oh()}}}function E4(x){if(x.dep.sc++,x.sub.flags&4){let h=x.dep.computed;if(h&&!x.dep.subs){h.flags|=20;for(let B=h.deps;B;B=B.nextDep)E4(B)}let F=x.dep.subs;if(F!==x){if(x.prevSub=F,F)F.nextSub=x}if(x.dep.subsHead===void 0)x.dep.subsHead=x;x.dep.subs=x}}var Ox=new WeakMap,c0=Symbol("Object iterate"),Tx=Symbol("Map keys iterate"),o0=Symbol("Array iterate");function k(x,h,F){if(p&&Y){let B=Ox.get(x);if(!B)Ox.set(x,B=new Map);let $=B.get(F);if(!$)B.set(F,$=new zx),$.map=B,$.key=F;$.track({target:x,type:h,key:F})}}function I0(x,h,F,B,$,N){let _=Ox.get(x);if(!_){qx++;return}let Z=(Q)=>{if(Q)Q.trigger({target:x,type:h,key:F,newValue:B,oldValue:$,oldTarget:N})};if(dh(),h==="clear")_.forEach(Z);else{let Q=I.isArray(x),U=Q&&I.isIntegerKey(F);if(Q&&F==="length"){let G=Number(B);_.forEach((z,D)=>{if(D==="length"||D===o0||!I.isSymbol(D)&&D>=G)Z(z)})}else{if(F!==void 0||_.has(void 0))Z(_.get(F));if(U)Z(_.get(o0));switch(h){case"add":if(!Q){if(Z(_.get(c0)),I.isMap(x))Z(_.get(Tx))}else if(U)Z(_.get("length"));break;case"delete":if(!Q){if(Z(_.get(c0)),I.isMap(x))Z(_.get(Tx))}break;case"set":if(I.isMap(x))Z(_.get(c0));break}}}oh()}function w8(x,h){let F=Ox.get(x);return F&&F.get(h)}function V0(x){let h=X(x);if(h===x)return h;return k(h,"iterate",o0),r(x)?h:h.map(J0)}function gx(x){return k(x=X(x),"iterate",o0),x}function Q0(x,h){if(D0(x))return O0(x)?y0(J0(h)):y0(h);return J0(h)}var k8={__proto__:null,[Symbol.iterator](){return gh(this,Symbol.iterator,(x)=>Q0(this,x))},concat(...x){return V0(this).concat(...x.map((h)=>I.isArray(h)?V0(h):h))},entries(){return gh(this,"entries",(x)=>{return x[1]=Q0(this,x[1]),x})},every(x,h){return G0(this,"every",x,h,void 0,arguments)},filter(x,h){return G0(this,"filter",x,h,(F)=>F.map((B)=>Q0(this,B)),arguments)},find(x,h){return G0(this,"find",x,h,(F)=>Q0(this,F),arguments)},findIndex(x,h){return G0(this,"findIndex",x,h,void 0,arguments)},findLast(x,h){return G0(this,"findLast",x,h,(F)=>Q0(this,F),arguments)},findLastIndex(x,h){return G0(this,"findLastIndex",x,h,void 0,arguments)},forEach(x,h){return G0(this,"forEach",x,h,void 0,arguments)},includes(...x){return th(this,"includes",x)},indexOf(...x){return th(this,"indexOf",x)},join(x){return V0(this).join(x)},lastIndexOf(...x){return th(this,"lastIndexOf",x)},map(x,h){return G0(this,"map",x,h,void 0,arguments)},pop(){return Qx(this,"pop")},push(...x){return Qx(this,"push",x)},reduce(x,...h){return I4(this,"reduce",x,h)},reduceRight(x,...h){return I4(this,"reduceRight",x,h)},shift(){return Qx(this,"shift")},some(x,h){return G0(this,"some",x,h,void 0,arguments)},splice(...x){return Qx(this,"splice",x)},toReversed(){return V0(this).toReversed()},toSorted(x){return V0(this).toSorted(x)},toSpliced(...x){return V0(this).toSpliced(...x)},unshift(...x){return Qx(this,"unshift",x)},values(){return gh(this,"values",(x)=>Q0(this,x))}};function gh(x,h,F){let B=gx(x),$=B[h]();if(B!==x&&!r(x))$._next=$.next,$.next=()=>{let N=$._next();if(!N.done)N.value=F(N.value);return N};return $}var u8=Array.prototype;function G0(x,h,F,B,$,N){let _=gx(x),Z=_!==x&&!r(x),Q=_[h];if(Q!==u8[h]){let z=Q.apply(x,N);return Z?J0(z):z}let U=F;if(_!==x){if(Z)U=function(z,D){return F.call(this,Q0(x,z),D,x)};else if(F.length>2)U=function(z,D){return F.call(this,z,D,x)}}let G=Q.call(_,U,B);return Z&&$?$(G):G}function I4(x,h,F,B){let $=gx(x),N=$!==x&&!r(x),_=F,Z=!1;if($!==x){if(N)Z=B.length===0,_=function(U,G,z){if(Z)Z=!1,U=Q0(x,U);return F.call(this,U,Q0(x,G),z,x)};else if(F.length>3)_=function(U,G,z){return F.call(this,U,G,z,x)}}let Q=$[h](_,...B);return Z?Q0(x,Q):Q}function th(x,h,F){let B=X(x);k(B,"iterate",o0);let $=B[h](...F);if(($===-1||$===!1)&&kx(F[0]))return F[0]=X(F[0]),B[h](...F);return $}function Qx(x,h,F=[]){rh(),dh();let B=X(x)[h].apply(x,F);return oh(),vh(),B}var d8=I.makeMap("__proto__,__v_isRef,__isVue"),L4=new Set(Object.getOwnPropertyNames(Symbol).filter((x)=>x!=="arguments"&&x!=="caller").map((x)=>Symbol[x]).filter(I.isSymbol));function o8(x){if(!I.isSymbol(x))x=String(x);let h=X(this);return k(h,"has",x),h.hasOwnProperty(x)}class lh{constructor(x=!1,h=!1){this._isReadonly=x,this._isShallow=h}get(x,h,F){if(h==="__v_skip")return x.__v_skip;let B=this._isReadonly,$=this._isShallow;if(h==="__v_isReactive")return!B;else if(h==="__v_isReadonly")return B;else if(h==="__v_isShallow")return $;else if(h==="__v_raw"){if(F===(B?$?c4:H4:$?M4:P4).get(x)||Object.getPrototypeOf(x)===Object.getPrototypeOf(F))return x;return}let N=I.isArray(x);if(!B){let Z;if(N&&(Z=k8[h]))return Z;if(h==="hasOwnProperty")return o8}let _=Reflect.get(x,h,s(x)?x:F);if(I.isSymbol(h)?L4.has(h):d8(h))return _;if(!B)k(x,"get",h);if($)return _;if(s(_)){let Z=N&&I.isIntegerKey(h)?_:_.value;return B&&I.isObject(Z)?Sx(Z):Z}if(I.isObject(_))return B?Sx(_):x1(_);return _}}class ah extends lh{constructor(x=!1){super(!1,x)}set(x,h,F,B){let $=x[h],N=I.isArray(x)&&I.isIntegerKey(h);if(!this._isShallow){let Q=D0($);if(!r(F)&&!D0(F))$=X($),F=X(F);if(!N&&s($)&&!s(F))if(Q)return o(`Set operation on key "${String(h)}" failed: target is readonly.`,x[h]),!0;else return $.value=F,!0}let _=N?Number(h)<x.length:I.hasOwn(x,h),Z=Reflect.set(x,h,F,s(x)?x:B);if(x===X(B)){if(!_)I0(x,"add",h,F);else if(I.hasChanged(F,$))I0(x,"set",h,F,$)}return Z}deleteProperty(x,h){let F=I.hasOwn(x,h),B=x[h],$=Reflect.deleteProperty(x,h);if($&&F)I0(x,"delete",h,void 0,B);return $}has(x,h){let F=Reflect.has(x,h);if(!I.isSymbol(h)||!L4.has(h))k(x,"has",h);return F}ownKeys(x){return k(x,"iterate",I.isArray(x)?"length":c0),Reflect.ownKeys(x)}}class eh extends lh{constructor(x=!1){super(!0,x)}set(x,h){return o(`Set operation on key "${String(h)}" failed: target is readonly.`,x),!0}deleteProperty(x,h){return o(`Delete operation on key "${String(h)}" failed: target is readonly.`,x),!0}}var y8=new ah,p8=new eh,r8=new ah(!0),v8=new eh(!0),kh=(x)=>x,bx=(x)=>Reflect.getPrototypeOf(x);function l8(x,h,F){return function(...B){let $=this.__v_raw,N=X($),_=I.isMap(N),Z=x==="entries"||x===Symbol.iterator&&_,Q=x==="keys"&&_,U=$[x](...B),G=F?kh:h?y0:J0;return!h&&k(N,"iterate",Q?Tx:c0),I.extend(Object.create(U),{next(){let{value:z,done:D}=U.next();return D?{value:z,done:D}:{value:Z?[G(z[0]),G(z[1])]:G(z),done:D}}})}}function Rx(x){return function(...h){{let F=h[0]?`on key "${h[0]}" `:"";o(`${I.capitalize(x)} operation ${F}failed: target is readonly.`,X(this))}return x==="delete"?!1:x==="clear"?void 0:this}}function a8(x,h){let F={get($){let N=this.__v_raw,_=X(N),Z=X($);if(!x){if(I.hasChanged($,Z))k(_,"get",$);k(_,"get",Z)}let{has:Q}=bx(_),U=h?kh:x?y0:J0;if(Q.call(_,$))return U(N.get($));else if(Q.call(_,Z))return U(N.get(Z));else if(N!==_)N.get($)},get size(){let $=this.__v_raw;return!x&&k(X($),"iterate",c0),$.size},has($){let N=this.__v_raw,_=X(N),Z=X($);if(!x){if(I.hasChanged($,Z))k(_,"has",$);k(_,"has",Z)}return $===Z?N.has($):N.has($)||N.has(Z)},forEach($,N){let _=this,Z=_.__v_raw,Q=X(Z),U=h?kh:x?y0:J0;return!x&&k(Q,"iterate",c0),Z.forEach((G,z)=>{return $.call(N,U(G),U(z),_)})}};return I.extend(F,x?{add:Rx("add"),set:Rx("set"),delete:Rx("delete"),clear:Rx("clear")}:{add($){let N=X(this),_=bx(N),Z=X($),Q=!h&&!r($)&&!D0($)?Z:$;if(!(_.has.call(N,Q)||I.hasChanged($,Q)&&_.has.call(N,$)||I.hasChanged(Z,Q)&&_.has.call(N,Z)))N.add(Q),I0(N,"add",Q,Q);return this},set($,N){if(!h&&!r(N)&&!D0(N))N=X(N);let _=X(this),{has:Z,get:Q}=bx(_),U=Z.call(_,$);if(!U)$=X($),U=Z.call(_,$);else K4(_,Z,$);let G=Q.call(_,$);if(_.set($,N),!U)I0(_,"add",$,N);else if(I.hasChanged(N,G))I0(_,"set",$,N,G);return this},delete($){let N=X(this),{has:_,get:Z}=bx(N),Q=_.call(N,$);if(!Q)$=X($),Q=_.call(N,$);else K4(N,_,$);let U=Z?Z.call(N,$):void 0,G=N.delete($);if(Q)I0(N,"delete",$,void 0,U);return G},clear(){let $=X(this),N=$.size!==0,_=I.isMap($)?new Map($):new Set($),Z=$.clear();if(N)I0($,"clear",void 0,void 0,_);return Z}}),["keys","values","entries",Symbol.iterator].forEach(($)=>{F[$]=l8($,x,h)}),F}function tx(x,h){let F=a8(x,h);return(B,$,N)=>{if($==="__v_isReactive")return!x;else if($==="__v_isReadonly")return x;else if($==="__v_raw")return B;return Reflect.get(I.hasOwn(F,$)&&$ in B?F:B,$,N)}}var e8={get:tx(!1,!1)},x7={get:tx(!1,!0)},h7={get:tx(!0,!1)},F7={get:tx(!0,!0)};function K4(x,h,F){let B=X(F);if(B!==F&&h.call(x,B)){let $=I.toRawType(x);o(`Reactive ${$} contains both the raw and reactive versions of the same object${$==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var P4=new WeakMap,M4=new WeakMap,H4=new WeakMap,c4=new WeakMap;function B7(x){switch(x){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function x1(x){if(D0(x))return x;return wx(x,!1,y8,e8,P4)}function $7(x){return wx(x,!1,r8,x7,M4)}function Sx(x){return wx(x,!0,p8,h7,H4)}function N7(x){return wx(x,!0,v8,F7,c4)}function wx(x,h,F,B,$){if(!I.isObject(x))return o(`value cannot be made ${h?"readonly":"reactive"}: ${String(x)}`),x;if(x.__v_raw&&!(h&&x.__v_isReactive))return x;if(x.__v_skip||!Object.isExtensible(x))return x;let N=$.get(x);if(N)return N;let _=B7(I.toRawType(x));if(_===0)return x;let Z=new Proxy(x,_===2?B:F);return $.set(x,Z),Z}function O0(x){if(D0(x))return O0(x.__v_raw);return!!(x&&x.__v_isReactive)}function D0(x){return!!(x&&x.__v_isReadonly)}function r(x){return!!(x&&x.__v_isShallow)}function kx(x){return x?!!x.__v_raw:!1}function X(x){let h=x&&x.__v_raw;return h?X(h):x}function _7(x){if(!I.hasOwn(x,"__v_skip")&&Object.isExtensible(x))I.def(x,"__v_skip",!0);return x}var J0=(x)=>I.isObject(x)?x1(x):x,y0=(x)=>I.isObject(x)?Sx(x):x;function s(x){return x?x.__v_isRef===!0:!1}function i4(x){return f4(x,!1)}function Z7(x){return f4(x,!0)}function f4(x,h){if(s(x))return x;return new m4(x,h)}class m4{constructor(x,h){this.dep=new zx,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=h?x:X(x),this._value=h?x:J0(x),this.__v_isShallow=h}get value(){return this.dep.track({target:this,type:"get",key:"value"}),this._value}set value(x){let h=this._rawValue,F=this.__v_isShallow||r(x)||D0(x);if(x=F?x:X(x),I.hasChanged(x,h))this._rawValue=x,this._value=F?x:J0(x),this.dep.trigger({target:this,type:"set",key:"value",newValue:x,oldValue:h})}}function Q7(x){if(x.dep)x.dep.trigger({target:x,type:"set",key:"value",newValue:x._value})}function ux(x){return s(x)?x.value:x}function J7(x){return I.isFunction(x)?x():ux(x)}var U7={get:(x,h,F)=>h==="__v_raw"?x:ux(Reflect.get(x,h,F)),set:(x,h,F,B)=>{let $=x[h];if(s($)&&!s(F))return $.value=F,!0;else return Reflect.set(x,h,F,B)}};function q7(x){return O0(x)?x:new Proxy(x,U7)}class W4{constructor(x){this.__v_isRef=!0,this._value=void 0;let h=this.dep=new zx,{get:F,set:B}=x(h.track.bind(h),h.trigger.bind(h));this._get=F,this._set=B}get value(){return this._value=this._get()}set value(x){this._set(x)}}function z7(x){return new W4(x)}function G7(x){if(!kx(x))o("toRefs() expects a reactive object but received a plain one.");let h=I.isArray(x)?Array(x.length):{};for(let F in x)h[F]=V4(x,F);return h}class b4{constructor(x,h,F){this._object=x,this._defaultValue=F,this.__v_isRef=!0,this._value=void 0,this._key=I.isSymbol(h)?h:String(h),this._raw=X(x);let B=!0,$=x;if(!I.isArray(x)||I.isSymbol(this._key)||!I.isIntegerKey(this._key))do B=!kx($)||r($);while(B&&($=$.__v_raw));this._shallow=B}get value(){let x=this._object[this._key];if(this._shallow)x=ux(x);return this._value=x===void 0?this._defaultValue:x}set value(x){if(this._shallow&&s(this._raw[this._key])){let h=this._object[this._key];if(s(h)){h.value=x;return}}this._object[this._key]=x}get dep(){return w8(this._raw,this._key)}}class R4{constructor(x){this._getter=x,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function I7(x,h,F){if(s(x))return x;else if(I.isFunction(x))return new R4(x);else if(I.isObject(x)&&arguments.length>1)return V4(x,h,F);else return i4(x)}function V4(x,h,F){return new b4(x,h,F)}class O4{constructor(x,h,F){this.fn=x,this.setter=h,this._value=void 0,this.dep=new zx(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qx-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!h,this.isSSR=F}notify(){if(this.flags|=16,!(this.flags&8)&&Y!==this)return n4(this,!0),!0}get value(){let x=this.dep.track({target:this,type:"get",key:"value"});if(Y4(this),x)x.version=this.dep.version;return this._value}set value(x){if(this.setter)this.setter(x);else o("Write operation failed: computed value is readonly")}}function K7(x,h,F=!1){let B,$;if(I.isFunction(x))B=x;else B=x.get,$=x.set;let N=new O4(B,$,F);if(h&&!F)N.onTrack=h.onTrack,N.onTrigger=h.onTrigger;return N}var D7={GET:"get",HAS:"has",ITERATE:"iterate"},j7={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},n7={SKIP:"__v_skip",IS_REACTIVE:"__v_isReactive",IS_READONLY:"__v_isReadonly",IS_SHALLOW:"__v_isShallow",RAW:"__v_raw",IS_REF:"__v_isRef"},A7={WATCH_GETTER:2,"2":"WATCH_GETTER",WATCH_CALLBACK:3,"3":"WATCH_CALLBACK",WATCH_CLEANUP:4,"4":"WATCH_CLEANUP"},Vx={},sx=new WeakMap,H0=void 0;function C7(){return H0}function T4(x,h=!1,F=H0){if(F){let B=sx.get(F);if(!B)sx.set(F,B=[]);B.push(x)}else if(!h)o("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Y7(x,h,F=I.EMPTY_OBJ){let{immediate:B,deep:$,once:N,scheduler:_,augmentJob:Z,call:Q}=F,U=(n)=>{(F.onWarn||o)("Invalid watch source: ",n,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},G=(n)=>{if($)return n;if(r(n)||$===!1||$===0)return K0(n,1);return K0(n)},z,D,A,E,j=!1,H=!1;if(s(x))D=()=>x.value,j=r(x);else if(O0(x))D=()=>G(x),j=!0;else if(I.isArray(x))H=!0,j=x.some((n)=>O0(n)||r(n)),D=()=>x.map((n)=>{if(s(n))return n.value;else if(O0(n))return G(n);else if(I.isFunction(n))return Q?Q(n,2):n();else U(n)});else if(I.isFunction(x))if(h)D=Q?()=>Q(x,2):x;else D=()=>{if(A){rh();try{A()}finally{vh()}}let n=H0;H0=z;try{return Q?Q(x,3,[E]):x(E)}finally{H0=n}};else D=I.NOOP,U(x);if(h&&$){let n=D,P=$===!0?1/0:$;D=()=>K0(n(),P)}let L=D4(),i=()=>{if(z.stop(),L&&L.active)I.remove(L.effects,z)};if(N&&h){let n=h;h=(...P)=>{n(...P),i()}}let C=H?Array(x.length).fill(Vx):Vx,c=(n)=>{if(!(z.flags&1)||!z.dirty&&!n)return;if(h){let P=z.run();if($||j||(H?P.some((u,R)=>I.hasChanged(u,C[R])):I.hasChanged(P,C))){if(A)A();let u=H0;H0=z;try{let R=[P,C===Vx?void 0:H&&C[0]===Vx?[]:C,E];C=P,Q?Q(h,3,R):h(...R)}finally{H0=u}}}else z.run()};if(Z)Z(c);if(z=new d0(D),z.scheduler=_?()=>_(c,!1):c,E=(n)=>T4(n,!1,z),A=z.onStop=()=>{let n=sx.get(z);if(n){if(Q)Q(n,4);else for(let P of n)P();sx.delete(z)}},z.onTrack=F.onTrack,z.onTrigger=F.onTrigger,h)if(B)c(!0);else C=z.run();else if(_)_(c.bind(null,!0),!0);else z.run();return i.pause=z.pause.bind(z),i.resume=z.resume.bind(z),i.stop=i,i}function K0(x,h=1/0,F){if(h<=0||!I.isObject(x)||x.__v_skip)return x;if(F=F||new Map,(F.get(x)||0)>=h)return x;if(F.set(x,h),h--,s(x))K0(x.value,h,F);else if(I.isArray(x))for(let B=0;B<x.length;B++)K0(x[B],h,F);else if(I.isSet(x)||I.isMap(x))x.forEach((B)=>{K0(B,h,F)});else if(I.isPlainObject(x)){for(let B in x)K0(x[B],h,F);for(let B of Object.getOwnPropertySymbols(x))if(Object.prototype.propertyIsEnumerable.call(x,B))K0(x[B],h,F)}return x}S4.ARRAY_ITERATE_KEY=o0;S4.EffectFlags=O8;S4.EffectScope=uh;S4.ITERATE_KEY=c0;S4.MAP_KEY_ITERATE_KEY=Tx;S4.ReactiveEffect=d0;S4.ReactiveFlags=n7;S4.TrackOpTypes=D7;S4.TriggerOpTypes=j7;S4.WatchErrorCodes=A7;S4.computed=K7;S4.customRef=z7;S4.effect=S8;S4.effectScope=R8;S4.enableTracking=g8;S4.getCurrentScope=D4;S4.getCurrentWatcher=C7;S4.isProxy=kx;S4.isReactive=O0;S4.isReadonly=D0;S4.isRef=s;S4.isShallow=r;S4.markRaw=_7;S4.onEffectCleanup=t8;S4.onScopeDispose=V8;S4.onWatcherCleanup=T4;S4.pauseTracking=rh;S4.proxyRefs=q7;S4.reactive=x1;S4.reactiveReadArray=V0;S4.readonly=Sx;S4.ref=i4;S4.resetTracking=vh;S4.shallowReactive=$7;S4.shallowReadArray=gx;S4.shallowReadonly=N7;S4.shallowRef=Z7;S4.stop=s8;S4.toRaw=X;S4.toReactive=J0;S4.toReadonly=y0;S4.toRef=I7;S4.toRefs=G7;S4.toValue=J7;S4.track=k;S4.traverse=K0;S4.trigger=I0;S4.triggerRef=Q7;S4.unref=ux;S4.watch=Y7});import $1 from"process";e0();jx();a0();var e4={Fixed:0,Auto:1},E0=q1(),f=Object.freeze({tick:E0.mark("u64"),x:E0.mark("u16"),y:E0.mark("u16"),rows:E0.mark("u16"),cols:E0.mark("u16"),resizeBehavior:E0.mark("u8"),debugMode:E0.mark("u8")});class C1{#h;#x;constructor(){this.#h=new ArrayBuffer(E0.currentOffset);let x=new h0(this.#h);this.#x=x,x.setBigUint64(f.tick,0n,!0),x.setUint16(f.x,0,!0),x.setUint16(f.y,0,!0),x.setUint16(f.rows,0,!0),x.setUint16(f.cols,0,!0),x.setUint8(f.resizeBehavior,e4.Auto),x.setBool(f.debugMode,!1)}get ptr(){return Xx(this.#h)}get tick(){return this.#x.getBigUint64(f.tick,!0)}get x(){return this.#x.getUint16(f.x,!0)}set x(x){this.#x.setUint16(f.x,x,!0)}get y(){return this.#x.getUint16(f.y,!0)}set y(x){this.#x.setUint16(f.y,x,!0)}get rows(){return this.#x.getUint16(f.rows,!0)}set rows(x){this.#x.setUint16(f.rows,x,!0)}get cols(){return this.#x.getUint16(f.cols,!0)}set cols(x){this.#x.setUint16(f.cols,x,!0)}get resizeBehavior(){return this.#x.getUint8(f.resizeBehavior)}set resizeBehavior(x){this.#x.setUint8(f.resizeBehavior,x)}get debugMode(){return this.#x.getBool(f.debugMode)}set debugMode(x){this.#x.setBool(f.debugMode,x)}}var S=new C1;Fx();class d1{#h={};#x;on(x,h){this.#h[x]||=[],this.#h[x].push(h)}off(x,h){let F=this.#h[x];if(F){let B=F.indexOf(h);if(B!==-1)F.splice(B,1)}}attach(x){this.#x=x}start(){if(!this.#x)throw Error("EventBus: no backend attached. Call attach() before start().");this.#x.startEvents(this.#F)}stop(){this.#x?.stopEvents(),this.#x=void 0}#F=(x,h)=>{let F=this.#h[x];if(F)for(let B of F)B(h)}}var O=new d1;var z6=0n;function o1(){return++z6}var G6={black:0,silver:12632256,gray:8421504,white:16777215,maroon:8388608,red:16711680,purple:8388736,fuchsia:16711935,green:32768,lime:65280,olive:8421376,yellow:16776960,navy:128,blue:255,teal:32896,aqua:65535,orange:16753920,aliceblue:15792383,antiquewhite:16444375,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,blanchedalmond:16772045,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,limegreen:3329330,linen:16445670,magenta:16711935,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,oldlace:16643558,olivedrab:7048739,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,whitesmoke:16119285,yellowgreen:10145074},I6=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/vi,K6=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([01]?\.?\d*)\s*\)$/vi,D6=/^#([\da-f])([\da-f])([\da-f])$/vi,j6=/^#([\da-f]{6})$/vi,n6=/^#([\da-f]{6})([\da-f]{2})$/vi;function y1(x,h,F){let B=Number.parseInt(x,10),$=Number.parseInt(h,10),N=Number.parseInt(F,10);if(B>255||$>255||N>255)return;return B<<16|$<<8|N}function A6(x){let h=x.trim();if(h.startsWith("#")){let N=n6.exec(h);if(N?.[1]&&N[2]){let Q=Number.parseInt(N[1],16),U=Number.parseInt(N[2],16);return Q<<8|U}let _=j6.exec(h);if(_?.[1])return Number.parseInt(_[1],16)<<8|255;let Z=D6.exec(h);if(Z?.[1]&&Z[2]&&Z[3]){let Q=Number.parseInt(Z[1],16),U=Number.parseInt(Z[2],16),G=Number.parseInt(Z[3],16);return((Q<<4|Q)<<16|(U<<4|U)<<8|(G<<4|G))<<8|255}return}let F=K6.exec(h);if(F){let N=y1(F[1],F[2],F[3]);if(N===void 0)return;let _=Number.parseFloat(F[4]),Z=Math.round(_*255);return N<<8|Z}let B=I6.exec(h);if(B){let N=y1(B[1],B[2],B[3]);if(N===void 0)return;return N<<8|255}let $=G6[h.toLowerCase()];if($!==void 0)return $<<8|255;return}function p1(x){return A6(x)}function q(x){if(typeof x==="number")return x;let h=p1(x.trim());if(h===void 0)throw Error(`Invalid color: ${x}`);return h>>>0}function $x(x){return"handleKey"in x&&"focus"in x&&"blur"in x&&"acceptsFocus"in x}var C6=["background","surface","surfaceHover","surfaceFocused","surfacePressed","surfaceDisabled","text","textMuted","border","borderFocused","accent","accentHover","selectionBg","selectionFg","shadow","scrollbar","scrollbarTrack","progressFill","progressTrack","success","successMuted","danger","dangerMuted","warning","placeholder"],Y6=["normal","focused","pressed","disabled"];function Nx(x){if(!x.name||typeof x.name!=="string")throw TypeError("defineTheme: theme.name must be a non-empty string");if(!x.colors||typeof x.colors!=="object")throw TypeError("defineTheme: theme.colors must be an object");let h=C6.filter((B)=>!(B in x.colors));if(h.length>0)throw TypeError(`defineTheme: missing color keys: ${h.join(", ")}`);if(!x.borderStyle||typeof x.borderStyle!=="object")throw TypeError("defineTheme: theme.borderStyle must be an object");let F=Y6.filter((B)=>!(B in x.borderStyle));if(F.length>0)throw TypeError(`defineTheme: missing borderStyle keys: ${F.join(", ")}`);return x}function J(x,h,F,B=255){return(x<<24|h<<16|F<<8|B)>>>0}var Px={normal:"solid",focused:"solid",pressed:"bold",disabled:"dashed"},X6={background:J(30,32,48),surface:J(34,36,54),surfaceHover:J(47,51,77),surfaceFocused:J(47,51,77),surfacePressed:J(57,75,112),surfaceDisabled:J(25,27,41),text:J(200,211,245),textMuted:J(99,109,166),border:J(59,66,97),borderFocused:J(130,170,255),accent:J(130,170,255),accentHover:J(101,188,255),selectionBg:J(62,104,215,128),selectionFg:J(200,211,245),shadow:0,scrollbar:J(99,109,166),scrollbarTrack:J(47,51,77),progressFill:J(130,170,255),progressTrack:J(47,51,77),success:J(79,214,190),successMuted:J(43,74,78,128),danger:J(255,117,127),dangerMuted:J(74,43,48,128),warning:J(255,199,119),placeholder:J(99,109,166)},r1=Nx({name:"tokyo-night-moon",colors:X6,borderStyle:Px}),E6={background:J(31,35,53),surface:J(36,40,59),surfaceHover:J(41,46,66),surfaceFocused:J(41,46,66),surfacePressed:J(57,75,112),surfaceDisabled:J(27,30,45),text:J(192,202,245),textMuted:J(86,95,137),border:J(59,66,97),borderFocused:J(122,162,247),accent:J(122,162,247),accentHover:J(42,195,222),selectionBg:J(61,89,161,128),selectionFg:J(192,202,245),shadow:0,scrollbar:J(86,95,137),scrollbarTrack:J(41,46,66),progressFill:J(122,162,247),progressTrack:J(41,46,66),success:J(158,206,106),successMuted:J(43,74,46,128),danger:J(247,118,142),dangerMuted:J(74,43,48,128),warning:J(224,175,104),placeholder:J(86,95,137)},b9=Nx({name:"tokyo-night-storm",colors:E6,borderStyle:Px}),L6={background:J(35,33,54),surface:J(42,39,63),surfaceHover:J(57,53,82),surfaceFocused:J(57,53,82),surfacePressed:J(68,65,90),surfaceDisabled:J(31,29,48),text:J(224,222,244),textMuted:J(110,106,134),border:J(57,53,82),borderFocused:J(196,167,231),accent:J(196,167,231),accentHover:J(235,188,186),selectionBg:J(62,143,176,102),selectionFg:J(224,222,244),shadow:0,scrollbar:J(110,106,134),scrollbarTrack:J(57,53,82),progressFill:J(196,167,231),progressTrack:J(57,53,82),success:J(156,207,216),successMuted:J(43,74,78,128),danger:J(235,111,146),dangerMuted:J(74,43,56,128),warning:J(246,193,119),placeholder:J(110,106,134)},R9=Nx({name:"rose-pine-moon",colors:L6,borderStyle:Px}),P6={background:J(250,244,237),surface:J(255,250,243),surfaceHover:J(242,233,225),surfaceFocused:J(242,233,225),surfacePressed:J(223,218,217),surfaceDisabled:J(244,237,232),text:J(70,66,97),textMuted:J(152,147,165),border:J(206,202,205),borderFocused:J(144,122,169),accent:J(144,122,169),accentHover:J(196,167,231),selectionBg:J(40,105,131,68),selectionFg:J(70,66,97),shadow:0,scrollbar:J(121,117,147),scrollbarTrack:J(242,233,225),progressFill:J(144,122,169),progressTrack:J(242,233,225),success:J(86,148,159),successMuted:J(86,148,159,77),danger:J(180,99,122),dangerMuted:J(180,99,122,77),warning:J(234,157,52),placeholder:J(152,147,165)},V9=Nx({name:"rose-pine-dawn",colors:P6,borderStyle:Px}),M6={background:255,surface:J(26,26,26),surfaceHover:J(51,51,51),surfaceFocused:J(38,38,38),surfacePressed:J(64,64,64),surfaceDisabled:J(18,18,18),text:J(255,255,255),textMuted:J(170,170,170),border:J(128,128,128),borderFocused:J(255,255,0),accent:J(0,255,255),accentHover:J(128,255,255),selectionBg:J(0,85,170),selectionFg:J(255,255,255),shadow:0,scrollbar:J(204,204,204),scrollbarTrack:J(51,51,51),progressFill:J(0,255,0),progressTrack:J(51,51,51),success:J(0,255,0),successMuted:J(0,68,0),danger:J(255,0,0),dangerMuted:J(68,0,0),warning:J(255,255,0),placeholder:J(128,128,128)},H6={normal:"solid",focused:"bold",pressed:"bold",disabled:"none"},O9=Nx({name:"high-contrast",colors:M6,borderStyle:H6});var v1=r1,Jh=new Set;function F0(){return v1}function l1(x){v1=x;for(let h of Jh)h(x)}function Mx(x){return Jh.add(x),()=>{Jh.delete(x)}}function a1(x,h,F,B){switch(x.type){case"absolute":return c6(x,F,B);case"anchor":return i6(x,h,F,B);case"center":return f6(h,F,B);case"corner":return m6(x,h,F,B)}}function c6(x,h,F){return{x:Hx(x.x,0,h-1),y:Hx(x.y,0,F-1)}}function i6(x,h,F,B){let{anchor:$,placement:N,offset:_=0}=x,Z=$.rect,Q=h.width,U=h.height,G=N,z=_;if(x.edgeClamp)G=W6({placement:N,anchorRect:Z,widgetWidth:Q,widgetHeight:U,offset:z,termCols:F,termRows:B});let D,A;switch(G){case"bottom":{D=Z.x,A=Z.y+Z.height+_;break}case"top":{D=Z.x,A=Z.y-U-_;break}case"right":{D=Z.x+Z.width+_,A=Z.y;break}case"left":{D=Z.x-Q-_,A=Z.y;break}}return{x:Hx(D,0,Math.max(0,F-Q)),y:Hx(A,0,Math.max(0,B-U))}}function f6(x,h,F){return{x:Math.max(0,Math.floor((h-x.width)/2)),y:Math.max(0,Math.floor((F-x.height)/2))}}function m6(x,h,F,B){let $=x.margin??0,{width:N,height:_}=h;switch(x.corner){case"top-left":return{x:$,y:$};case"top-right":return{x:Math.max(0,F-N-$),y:$};case"bottom-left":return{x:$,y:Math.max(0,B-_-$)};case"bottom-right":return{x:Math.max(0,F-N-$),y:Math.max(0,B-_-$)}}}function W6(x){let{placement:h,anchorRect:F,widgetWidth:B,widgetHeight:$,offset:N,termCols:_,termRows:Z}=x;switch(h){case"bottom":{let Q=Z-F.y-F.height-N,U=F.y-N;if(Q<$&&U>=$)return"top";break}case"top":{let Q=F.y-N,U=Z-F.y-F.height-N;if(Q<$&&U>=$)return"bottom";break}case"right":{let Q=_-F.x-F.width-N,U=F.x-N;if(Q<B&&U>=B)return"left";break}case"left":{let Q=F.x-N,U=_-F.x-F.width-N;if(Q<B&&U>=B)return"right";break}}return h}function Hx(x,h,F){return Math.max(h,Math.min(F,x))}var b6=100,R6=170;class Uh{#h;#x;#F=[];#B;#$;constructor(x){this.#h=x?.baseZIndex??b6,this.#x=x?.backdropRgba??R6,this.#$=this.#h}setFocusManager(x){this.#B=x}open(x,h){let F={widget:x,handle:void 0,options:h??{},zIndex:this.#$++,previousZIndex:x.zIndex,previousPortal:x.portal,savedFocus:void 0},B=new e1(x,()=>{this.#_(F)});if(F.handle=B,x.setPortal(!0),x.setZIndex(F.zIndex),F.options.positionStrategy)this.#Q(x,F.options.positionStrategy);if(F.options.trapFocus&&this.#B)F.savedFocus=this.#B.focusedWidget,this.#B.pushFocusScope(x);return this.#F.push(F),B}close(x){let h=this.#F.findIndex((F)=>F.handle===x);if(h!==-1)this.#_(this.#F[h])}closeAll(){while(this.#F.length>0)this.#_(this.#F.at(-1))}getTopOverlay(){return this.#F.at(-1)?.widget}getBackdropEntries(){let x=[];for(let h of this.#F)if(h.options.backdrop&&h.widget.visible){let F=h.options.backdropRgba??this.#x;x.push({zIndex:h.zIndex,draw(B){let $=S.cols,N=S.rows;B.drawRect({x:0,y:0,width:$,height:N,bgRgba:F})}})}return x}#_(x){let h=this.#F.indexOf(x);if(h===-1)return;if(this.#F.splice(h,1),x.widget.setPortal(x.previousPortal),x.widget.setZIndex(x.previousZIndex),x.options.trapFocus&&this.#B){if(this.#B.popFocusScope(),x.savedFocus?.acceptsFocus)this.#B.focusWidget(x.savedFocus)}V6(x.handle)}#Q(x,h){let F=S.cols,B=S.rows,{width:$,height:N}=x.rect,{x:_,y:Z}=a1(h,{width:$,height:N},F,B);x.updateRect({x:_,y:Z})}}class e1{#h;#x;#F=[];#B=!1;constructor(x,h){this.#h=x,this.#x=h}get widget(){return this.#h}get closed(){return this.#B}close(){if(!this.#B)this.#x()}onClosed(x){if(this.#B){x();return}this.#F.push(x)}fireClosed(){this.#B=!0;for(let x of this.#F)x();this.#F.length=0}}function V6(x){x.fireClosed()}class xF{#h;#x;#F;#B;#$=new Set;#_=new Map;#Q=[];#U=void 0;#J=new Uh;constructor(x){if(this.#h=o1(),this.#x=x?.visible??!1,this.#F=this.#E(x?.bgHexRgb??F0().colors.background),x?.bgHexRgb===void 0)this.#B=Mx((h)=>{this.#F=q(h.colors.background)})}get id(){return this.#h}get bgHexRgb(){return this.#F>>8}get visible(){return this.#x}getOverlayManager(){return this.#J}mount(x){return this.#$.add(x),this.#q(),x.mounted(),this}unmount(x){return this.#$.delete(x),this.#q(),x.unmounted(),this}setBgRgb(x,h,F){this.#F=typeof x==="number"&&h!==void 0&&F!==void 0?q(`rgb(${x},${h},${F})`):this.#E(x)}setVisible(x){this.#x=x}update(x){for(let h of this.#Q)h(x);for(let h of this.#$)if(h.visible)h.update(x)}emitDrawCommands(x){let h=S.cols,F=S.rows;for(let _ of this.#$)if(_.hasPercentLayout)_.resolveLayout(h,F);x.setBackground(this.#F),x.setSynchronizedUpdate(!0),x.hideCursor();let B=this.#n(),$=this.#J.getBackdropEntries(),N=[];for(let _ of this.#$)N.push({kind:"widget",zIndex:_.zIndex,widget:_});for(let _ of B)N.push({kind:"widget",zIndex:_.zIndex,widget:_});for(let _ of $)N.push({kind:"backdrop",zIndex:_.zIndex,draw:_.draw});N.sort((_,Z)=>_.zIndex-Z.zIndex);for(let _ of N)if(_.kind==="widget"){if(_.widget.visible)_.widget.emitDrawCommands(x)}else _.draw(x)}hitTest(x){let{x:h,y:F}=x;for(let B of this.#G())if(B.visible&&B.containsPoint(h,F))return this.#K(B,h,F);return}getFocusableWidgets(){return this.#j()}clearWidgets(){for(let x of this.#$)x.unmounted();this.#$.clear(),this.#Q.length=0,this.#q()}destroy(){this.#B?.(),this.#B=void 0;for(let x of this.#$)this.unmount(x);this.#_.clear(),this.#Q.length=0}onTick(x){this.#Q.push(x);let h=!1;return()=>{if(h)return;h=!0;let F=this.#Q.indexOf(x);if(F!==-1)this.#Q.splice(F,1)}}offTick(x){let h=this.#Q.indexOf(x);if(h!==-1)this.#Q.splice(h,1)}on(x,h){let F=this.#_.get(x)??[];F.push(h),this.#_.set(x,F)}off(x,h){let F=this.#_.get(x);if(!F)return;let B=F.indexOf(h);if(B!==-1)F.splice(B,1)}emitLifecycle(x){let h=this.#_.get(x);if(!h)return;for(let F of h)F()}#q(){this.#U=void 0}#G(){let x=[...this.#$,...this.#n()];return this.#U=x.toReversed().toSorted((h,F)=>F.zIndex-h.zIndex),this.#U}#K(x,h,F){let{children:B}=x;if(B.length>0){let $=B.toSorted((N,_)=>_.zIndex-N.zIndex);for(let N of $)if(N.visible&&N.containsPoint(h,F))return this.#K(N,h,F)}return x}#j(){let x=[];for(let h of this.#$)this.#N(h,x);return x.toSorted((h,F)=>{let B=h.tabIndex,$=F.tabIndex;if(B!==void 0&&$!==void 0)return B-$;if(B!==void 0)return-1;if($!==void 0)return 1;return 0})}#N(x,h){if(!x.visible)return;if($x(x)&&x.acceptsFocus)h.push(x);for(let F of x.children)this.#N(F,h)}#E(x){if(typeof x==="object")return q(`rgb(${x.r},${x.g},${x.b})`);return q(x)}#n(){let x=[];for(let h of this.#$){if(!h.visible)continue;this.#A(h,x)}return x}#A(x,h){for(let F of x.children){if(!F.visible)continue;if(F.portal)h.push(F);this.#A(F,h)}}}var hF=xF;Zh();e0();var O6=/^\d+(\.\d+)?%$/v;function U0(x){return typeof x==="string"&&O6.test(x)}function FF(x,h,F,B){let $={};if(U0(x))$.x=x;if(U0(h))$.y=h;if(U0(F))$.width=F;if(U0(B))$.height=B;if($.x===void 0&&$.y===void 0&&$.width===void 0&&$.height===void 0)return;return $}class f0{#h=0;#x=!1;#F=!0;#B=!1;#$=void 0;#_=null;#Q=new Map;#U=[];#J=void 0;#q=!1;#G=[];get hasPercentLayout(){return this.#J!==void 0}setPercentSpec(x){this.#J=x}clearPositionPercentSpec(){if(!this.#J)return;if(delete this.#J.x,delete this.#J.y,this.#J.width===void 0&&this.#J.height===void 0)this.#J=void 0}resolveLayout(x,h){if(!this.#J)return;let F={},B=this.#J;if(B.x!==void 0)F.x=this.#K(B.x,x);if(B.y!==void 0)F.y=this.#K(B.y,h);if(B.width!==void 0)F.width=this.#K(B.width,x);if(B.height!==void 0)F.height=this.#K(B.height,h);if(Object.keys(F).length>0)this.updateRect(F)}get referenceCount(){return this.#h}get draggable(){return this.#x}get portal(){return this.#B}get visible(){return this.#F}get children(){return this.#U}get parent(){return this.#_}closest(x){if(x(this))return this;return this.#_?.closest(x)}get zIndex(){return this.#$??0}get rect(){return{x:0,y:0,width:0,height:0}}setDraggable(x){this.#x=x}setZIndex(x){this.#$=x}setPortal(x){this.#B=x}setVisible(x){this.#F=x}addChild(x){this.#U.push(x),x.#_=this,x.mounted()}removeChild(x){let h=this.#U.indexOf(x);if(h!==-1)this.#U.splice(h,1),x.#_=null,x.unmounted()}updateRect(x){}containsPoint(x,h){let{x:F,y:B,width:$,height:N}=this.rect;return x>=F&&x<F+$&&h>=B&&h<B+N}on(x,h){let F=this.#Q.get(x);if(!F)F=new Set,this.#Q.set(x,F);F.add(h)}off(x,h){this.#Q.get(x)?.delete(h)}dispatch(x,h){this.#q=!1,this.#j(x,h,!1)}stopPropagation(){this.#q=!0}dispatchKeyEvent(x){this.dispatch("key",x)}mounted(){this.#h++}unmounted(){if(this.#h--,this.#h<=0){for(let x of this.#G)x();this.#G.length=0,this.#Q.clear()}}addCleanup(x){this.#G.push(x)}intrinsicSize(){return}update(x){}getZIndexOverride(){return this.#$}initRect(x,h,F,B,$){let N=FF(x,h,F,B);if(N)this.setPercentSpec(N);return{x:U0(x)?0:x??$?.x??0,y:U0(h)?0:h??$?.y??0,width:U0(F)?0:F??$?.width??0,height:U0(B)?0:B??$?.height??0}}propagatePositionDelta(x,h){if(x===0&&h===0)return;for(let F of this.#U)F.updateRect({x:F.rect.x+x,y:F.rect.y+h})}renderChildren(x){for(let h of this.#U)if(h.visible&&!h.portal)h.emitDrawCommands(x)}#K(x,h){let F=Number.parseFloat(x);return Math.max(0,Math.floor(F/100*h))}#j(x,h,F){if(F)return;let B=this.#Q.get(x);if(B)for(let $ of B)$(h);if(this.#_)this.#_.#j(x,h,this.#q)}}class m extends f0{static setFocusRequestCallback(x){m.#x=x}static#h=new Set(["click","mousedown","mouseup","mouseover","mousemove","contextmenu"]);static#x;#F=!1;#B=!1;#$=!1;#_;constructor(){super();this.on("mouseover",()=>{this.#$=!0}),this.on("mouseout",()=>{this.#$=!1})}get acceptsFocus(){return!this.#B}get tabIndex(){return this.#_}get focused(){return this.#F}get hovered(){return this.#$}get disabled(){return this.#B}focus(){if(this.#F)return;if(m.#x)m.#x(this);this.#F=!0,this.dispatch("focus",void 0)}blur(){this.#F=!1,this.#$=!1,this.dispatch("blur",void 0)}setDisabled(x){if(this.#B=x,this.#B&&this.#F)this.blur()}setTabIndex(x){this.#_=x}dispatch(x,h){if(this.#B&&m.#h.has(x))return;super.dispatch(x,h)}unmounted(){if(this.#F)this.blur();super.unmounted()}handleKey(x){if(!this.acceptsFocus||x.key===void 0)return;this.dispatchKeyEvent(x),this.handleActiveKey(x)}}var T6={normal:"normal",focused:"focused",pressed:"pressed",disabled:"disabled"};function e(x){let h=F0(),F={};for(let[B,$]of Object.entries(x))F[B]=BF(h,String($));return F}function BF(x,h){if(h.startsWith("border.")){let F=T6[h.slice(7)];if(F!==void 0)return x.borderStyle[F];return}return x.colors[h]}function w(x,h,F,B){let $=Object.fromEntries(Object.entries(h).filter(([_])=>F[_]===void 0));if(Object.keys($).length===0)return;let N=Mx((_)=>{let Z={};for(let[Q,U]of Object.entries($))Z[Q]=BF(_,String(U));B(Z)});x.addCleanup(N)}var T={SetBackground:1,SetCursor:2,PushClip:3,PopClip:4,SetEntityId:5,DrawRect:16,DrawText:17,DrawBorder:18,DrawShadow:19,DrawFill:20,DrawChar:21,DrawLine:22,SetTitle:32,ShowCursor:33,HideCursor:34,SetCursorMode:35,BeginSync:48,EndSync:49},q0={Top:1,Right:2,Bottom:4,Left:8,All:15};var S6={"blinking-block":1,block:2,"blinking-underscore":3,underscore:4,"blinking-ibeam":5,ibeam:6};function $F(x){if(typeof x==="string")return S6[x]??1;return x}var NF=8,qh=8,_F=21570,ZF=1;var QF={bold:1,dim:2,italic:4,underline:8,slowblink:16,rapidblink:32,reverse:64,hidden:128,crossedout:256,fraktur:512,overline:1024};function t0(x){if(x===void 0)return 0;if(typeof x==="number")return x;if(Array.isArray(x)){let h=0;for(let F of x)h|=QF[F]??0;return h}return QF[x]??0}var s6={none:0,solid:1,double:2,rounded:3,bold:4,dashed:5,dotted:6,outsetbold:7,outsetdouble:8};function V(x){if(typeof x==="string")return s6[x]??0;return x}var g6={horizontal:0,vertical:1};function zh(x){if(typeof x==="string")return g6[x]??1;return x}var w0={Start:0,Center:1,End:2,Stretch:3},t6={start:0,center:1,end:2,stretch:3};function Gh(x){if(typeof x==="string")return t6[x]??3;return x}function JF(x){if(typeof x==="boolean")return{borderTop:x,borderRight:x,borderBottom:x,borderLeft:x};if(typeof x==="number"){let _=x!==0;return{borderTop:_,borderRight:_,borderBottom:_,borderLeft:_}}if(x==="true"||x==="1")return{borderTop:!0,borderRight:!0,borderBottom:!0,borderLeft:!0};if(x==="false"||x==="0"||x==="")return{borderTop:!1,borderRight:!1,borderBottom:!1,borderLeft:!1};let h=x.split(/\s+/v),F,B,$,N;switch(h.length){case 1:{let _=h[0]!=="0";F=_,B=_,$=_,N=_;break}case 2:{let _=h[0]!=="0",Z=h[1]!=="0";F=_,$=_,B=Z,N=Z;break}case 3:{F=h[0]!=="0",B=h[1]!=="0",$=h[2]!=="0",N=B;break}default:{F=h[0]!=="0",B=h[1]!=="0",$=h[2]!=="0",N=h[3]!=="0";break}}return{borderTop:F,borderRight:B,borderBottom:$,borderLeft:N}}function w6(x){let h=F0(),F=x.border===void 0?void 0:JF(x.border);return{colorBorder:q(x.colorBorder??h.colors.border),borderStyle:V(x.borderStyle??"none"),borderTop:x.borderTop??F?.borderTop??!1,borderRight:x.borderRight??F?.borderRight??!1,borderBottom:x.borderBottom??F?.borderBottom??!1,borderLeft:x.borderLeft??F?.borderLeft??!1}}class Ih extends f0{#h;#x;#F;#B;#$;#_;#Q;#U;#J;#q=[];constructor(x){super();this.#h=this.initRect(x.x,x.y,x.width,x.height,{width:32,height:3});let h=F0();if(this.#x={colorFg:q(x.colorFg??h.colors.text),colorBg:q(x.colorBg??h.colors.background)},this.#F={styleZIndex:x.styleZIndex??0,styleModifier:t0(x.styleModifier)},this.#B=w6(x),this.#$={shadowOffsetX:x.shadowOffsetX??0,shadowOffsetY:x.shadowOffsetY??0,colorShadow:q(x.colorShadow??0),shadowCovered:x.shadowCovered??!1},this.#_={paddingTop:x.paddingTop??0,paddingRight:x.paddingRight??0,paddingBottom:x.paddingBottom??0,paddingLeft:x.paddingLeft??0},this.#Q=zh(x.direction??"vertical"),this.#U=x.gap??0,this.#J=Gh(x.align??"stretch"),x.draggable)this.setDraggable(!0)}get rect(){return this.#h}get color(){return this.#x}get style(){return this.#F}get border(){return this.#B}get shadow(){return this.#$}get padding(){return this.#_}get zIndex(){return this.getZIndexOverride()??this.#F.styleZIndex}updateRect(x){let h=this.#h.x,F=this.#h.y;if(Object.assign(this.#h,x),x.x!==void 0||x.y!==void 0)this.propagatePositionDelta(this.#h.x-h,this.#h.y-F)}updateColor(x){if(x.colorFg!==void 0)this.#x.colorFg=q(x.colorFg);if(x.colorBg!==void 0)this.#x.colorBg=q(x.colorBg)}updateThemeColors(x){if(this.updateColor({colorFg:x.colorFg===void 0?void 0:q(x.colorFg),colorBg:x.colorBg===void 0?void 0:q(x.colorBg)}),x.colorBorder!==void 0)this.updateBorder({colorBorder:q(x.colorBorder)})}updateStyle(x){if(x.styleModifier!==void 0)this.#F.styleModifier=t0(x.styleModifier);if(x.styleZIndex!==void 0)this.#F.styleZIndex=x.styleZIndex}updateBorder(x){if(x.colorBorder!==void 0)this.#B.colorBorder=q(x.colorBorder);if(x.borderStyle!==void 0)this.#B.borderStyle=V(x.borderStyle);if(x.border!==void 0){let{borderTop:h,borderRight:F,borderBottom:B,borderLeft:$}=JF(x.border);this.#B.borderTop=h,this.#B.borderRight=F,this.#B.borderBottom=B,this.#B.borderLeft=$}if(x.borderTop!==void 0)this.#B.borderTop=x.borderTop;if(x.borderRight!==void 0)this.#B.borderRight=x.borderRight;if(x.borderBottom!==void 0)this.#B.borderBottom=x.borderBottom;if(x.borderLeft!==void 0)this.#B.borderLeft=x.borderLeft}updateShadow(x){if(x.colorShadow!==void 0)this.#$.colorShadow=q(x.colorShadow);if(x.shadowOffsetX!==void 0)this.#$.shadowOffsetX=x.shadowOffsetX;if(x.shadowOffsetY!==void 0)this.#$.shadowOffsetY=x.shadowOffsetY;if(x.shadowCovered!==void 0)this.#$.shadowCovered=x.shadowCovered}updatePadding(x){Object.assign(this.#_,x)}setDirection(x){this.#Q=zh(x)}setGap(x){this.#U=x}setAlign(x){this.#J=Gh(x)}addChild(x){super.addChild(x),this.#q.push(x)}removeChild(x){super.removeChild(x);let h=this.#q.indexOf(x);if(h!==-1)this.#q.splice(h,1)}intrinsicSize(){if(this.#q.length===0)return;let x=0,h=0;for(let N of this.#q){let _=N.intrinsicSize();if(!_)return;let Z=this.#Q===1?_.height:_.width,Q=this.#Q===1?_.width:_.height;if(x+=Z,Q>h)h=Q}let F=Math.max(0,this.#q.length-1)*this.#U;x+=F;let B=this.#B.borderStyle===0?0:(this.#B.borderLeft?1:0)+(this.#B.borderRight?1:0),$=this.#B.borderStyle===0?0:(this.#B.borderTop?1:0)+(this.#B.borderBottom?1:0);if(this.#Q===1)return{width:h+this.#_.paddingLeft+this.#_.paddingRight+B,height:x+this.#_.paddingTop+this.#_.paddingBottom+$};return{width:x+this.#_.paddingLeft+this.#_.paddingRight+B,height:h+this.#_.paddingTop+this.#_.paddingBottom+$}}emitDrawCommands(x){this.#j();let{x:h,y:F,width:B,height:$}=this.#h,{colorBg:N}=this.#x,{colorBorder:_,borderStyle:Z,borderTop:Q,borderRight:U,borderBottom:G,borderLeft:z}=this.#B;if(x.pushClip(h,F,B,$),x.drawRect({x:h,y:F,width:B,height:$,bgRgba:N}),Z!==0){let c=(Q?q0.Top:0)|(U?q0.Right:0)|(G?q0.Bottom:0)|(z?q0.Left:0);x.drawBorder({x:h,y:F,width:B,height:$,colorRgba:_,style:Z,sides:c})}let D=Z===0?0:(z?1:0)+(U?1:0),A=Z===0?0:(Q?1:0)+(G?1:0),{paddingTop:E,paddingLeft:j}=this.#_,H=h+j+(Z!==0&&z?1:0),L=F+E+(Z!==0&&Q?1:0),i=B-j-this.#_.paddingRight-D,C=$-E-this.#_.paddingBottom-A;x.pushClip(H,L,i,C),this.renderChildren(x),x.popClip(),x.popClip()}#G(x,h){let F=x.intrinsicSize();if(h)return F?.height??x.rect.height;return F?.width??x.rect.width}#K(x,h,F){let B=x.intrinsicSize(),$;$=F?B?.width??x.rect.width:B?.height??x.rect.height;let N;switch(this.#J){case w0.Start:{N=0;break}case w0.Center:{N=Math.floor((h-$)/2);break}case w0.End:{N=h-$;break}case w0.Stretch:{N=0,$=h;break}}return{crossPos:N,crossExtent:$}}#j(){let x=this.#Q,h=this.#q;if(h.length===0)return;let{x:F,y:B,width:$,height:N}=this.#h,{paddingTop:_,paddingLeft:Z}=this.#_,Q=this.#B.borderStyle===0?0:(this.#B.borderLeft?1:0)+(this.#B.borderRight?1:0),U=this.#B.borderStyle===0?0:(this.#B.borderTop?1:0)+(this.#B.borderBottom?1:0),G=Z+this.#_.paddingRight+Q,z=_+this.#_.paddingBottom+U,D=F+Z+(this.#B.borderStyle!==0&&this.#B.borderLeft?1:0),A=B+_+(this.#B.borderStyle!==0&&this.#B.borderTop?1:0),E=$-G,j=N-z,H=x===1,L=H?E:j,i=this.#J===w0.Stretch,C=0;for(let c of h){if(c.hasPercentLayout)c.resolveLayout(E,j);let n=this.#G(c,H),{crossPos:P,crossExtent:u}=this.#K(c,L,H),R=H?{x:D+P,y:A+C,width:i?L:u,height:n}:{x:D+C,y:A+P,width:n,height:i?L:u};c.updateRect(R),C+=n+this.#U}}}var UF={colorFg:"text",colorBg:"background",colorBorder:"border"};function k6(){return{x:0,y:0,width:32,height:3,border:!0,borderStyle:"solid",...e(UF)}}function z0(x={}){let h=new Ih({...k6(),...x});return w(h,UF,x??{},(F)=>{h.updateThemeColors(F)}),h}function cx(x,h,F){let B=Math.max(0,h-x),$=x/h,N=Math.max(1,Math.round($*x)),_=x-N,Z=B>0?Math.round(F/B*_):0;return{thumbSize:N,thumbOffset:Z,scrollableRange:_,maxScroll:B}}function qF(x){let{buffer:h,x:F,trackY:B,trackHeight:$,geometry:N,thumbColor:_,trackColor:Z}=x,{thumbSize:Q,thumbOffset:U}=N;for(let G=0;G<$;G++){let z=G>=U&&G<U+Q;h.drawChar({x:F,y:B+G,char:z?9608:9474,fgRgba:z?_:Z,bgRgba:0})}}function zF(x,h,F){if(x!==F.x)return{type:"none"};if(h<F.trackY||h>=F.trackY+F.trackHeight)return{type:"none"};if(h>=F.thumbY&&h<F.thumbY+F.thumbSize)return{type:"thumb"};if(h<F.thumbY)return{type:"track-above"};return{type:"track-below"}}function GF(x,h,F){if(F.scrollableRange<=0)return h;return h+Math.round(x/F.scrollableRange*F.maxScroll)}class Kh extends m{#h;#x=0;#F=!0;#B=[];#$;#_;#Q;#U;#J;#q;#G=!1;#K=0;#j=0;#N=!1;#E=0;#n=0;constructor(x){super();this.#h=this.initRect(x.x,x.y,x.width,x.height,{width:20,height:10}),this.#$=z0({x:this.#h.x,y:this.#h.y,width:this.#h.width,height:this.#h.height,colorBg:x.colorBg,colorBorder:x.colorBorder,borderStyle:x.borderStyle,borderTop:x.borderTop,borderRight:x.borderRight,borderBottom:x.borderBottom,borderLeft:x.borderLeft,colorShadow:x.colorShadow,shadowOffsetX:x.shadowOffsetX,shadowOffsetY:x.shadowOffsetY,shadowCovered:x.shadowCovered,paddingTop:x.paddingTop,paddingRight:x.paddingRight,paddingBottom:x.paddingBottom,paddingLeft:x.paddingLeft}),this.#_=x.gap??0,this.#Q=x.scrollSpeed??3,this.#U=x.alwaysShowScrollbar??!1;let h=F0();this.#J=q(x.colorScrollbar??h.colors.scrollbar),this.#q=q(x.colorScrollbarTrack??h.colors.scrollbarTrack),this.on("wheel",(F)=>{this.scrollBy(F.wheelDeltaY*this.#Q)}),this.on("mousedown",(F)=>{let B=this.#z();switch((B?zF(F.x,F.y,B):{type:"none"}).type){case"thumb":{this.#N=!0,this.#E=F.y,this.#n=this.#x;break}case"track-above":{this.scrollBy(-this.#A().height);break}case"track-below":{this.scrollBy(this.#A().height);break}case"none":{this.#G=!0,this.#K=F.y,this.#j=this.#x;break}}}),this.on("mousemove",(F)=>{if(this.#N){if((F.buttons??0)===0){this.#N=!1;return}let $=F.y-this.#E,N=this.#A(),_=cx(N.height,this.#X(),this.#n);this.scrollTo(GF($,this.#n,_));return}if(!this.#G)return;if((F.buttons??0)===0){this.#G=!1;return}let B=F.y-this.#K;this.scrollTo(this.#j+B)}),this.on("mouseup",()=>{this.#G=!1,this.#N=!1})}get rect(){return this.#h}get scrollOffsetY(){return this.#x}get maxScrollY(){return this.#Y()}handleActiveKey(x){let h=x.key,F=this.#A();switch(h){case"ArrowUp":{this.scrollBy(-1);break}case"ArrowDown":{this.scrollBy(1);break}case"PageUp":{this.scrollBy(-F.height);break}case"PageDown":{this.scrollBy(F.height);break}case"Home":{this.scrollTo(0);break}case"End":{this.scrollTo(this.#Y());break}default:break}}scrollTo(x){let h=Math.max(0,Math.min(x,this.#Y()));if(h!==this.#x)this.#x=h,this.#F=!0,this.dispatch("scroll",{scrollOffsetY:h,maxScrollY:this.#Y()})}scrollToTop(){this.scrollTo(0)}scrollToBottom(){this.scrollTo(this.#Y())}scrollBy(x){this.scrollTo(this.#x+x)}scrollIntoView(x){let h=this.#B.indexOf(x);if(h===-1)return;let F=this.#A(),B=0;for(let Q=0;Q<h;Q++){let U=this.#B[Q],G=U.intrinsicSize();B+=(G?.height??U.rect.height)+this.#_}let $=this.#B[h],_=$.intrinsicSize()?.height??$.rect.height,Z=B+_;if(B<this.#x)this.scrollTo(B);else if(Z>this.#x+F.height)this.scrollTo(Z-F.height)}updateRect(x){let h=this.#h.x,F=this.#h.y;Object.assign(this.#h,x),this.#F=!0,this.#$.updateRect({x:this.#h.x,y:this.#h.y,width:this.#h.width,height:this.#h.height}),this.propagatePositionDelta(this.#h.x-h,this.#h.y-F)}updateThemeColors(x){if(x.colorBg!==void 0)this.updateColor({colorBg:q(x.colorBg)});if(x.colorBorder!==void 0)this.updateBorder({colorBorder:q(x.colorBorder)});if(x.colorScrollbar!==void 0)this.setColorScrollbar(q(x.colorScrollbar));if(x.colorScrollbarTrack!==void 0)this.setColorScrollbarTrack(q(x.colorScrollbarTrack))}updateColor(x){this.#$.updateColor(x)}updateBorder(x){this.#$.updateBorder(x),this.#F=!0}updateShadow(x){this.#$.updateShadow(x)}updatePadding(x){this.#$.updatePadding(x),this.#F=!0}setGap(x){this.#_=x,this.#F=!0}setAlwaysShowScrollbar(x){this.#U=x}setColorScrollbar(x){this.#J=q(x)}setColorScrollbarTrack(x){this.#q=q(x)}addChild(x){super.addChild(x),this.#B.push(x),this.#F=!0}removeChild(x){super.removeChild(x);let h=this.#B.indexOf(x);if(h!==-1)this.#B.splice(h,1);this.#F=!0}intrinsicSize(){return}emitDrawCommands(x){if(this.#F)this.#Z();let{x:h,y:F,width:B,height:$}=this.#h;x.pushClip(h,F,B,$),this.#$.emitDrawCommands(x);let N=this.#A();x.pushClip(N.x,N.y,N.width,N.height);for(let _ of this.#B){if(!_.visible)continue;let{x:Z,y:Q,width:U,height:G}=_.rect;if(Q+G<=N.y||Q>=N.y+N.height)continue;if(Z>=N.x+N.width||Z+U<=N.x)continue;_.emitDrawCommands(x)}x.popClip(),this.#D(x),x.popClip()}#A(){let{x,y:h,width:F,height:B}=this.#h,{paddingTop:$,paddingLeft:N,paddingRight:_,paddingBottom:Z}=this.#$.padding,{borderTop:Q,borderRight:U,borderBottom:G,borderLeft:z}=this.#$.border,D=(z?1:0)+(U?1:0),A=(Q?1:0)+(G?1:0),E=x+N+(z?1:0),j=h+$+(Q?1:0),H=F-N-_-D-1,L=B-$-Z-A;return{x:E,y:j,width:H,height:L}}#X(){let x=0;for(let h of this.#B){let F=h.intrinsicSize();x+=F?.height??h.rect.height}return x+=Math.max(0,this.#B.length-1)*this.#_,x}#Y(){let x=this.#A();return Math.max(0,this.#X()-x.height)}#Z(){let x=this.#B;if(x.length===0){this.#F=!1;return}let h=this.#A(),F=0;for(let B of x){let N=B.intrinsicSize()?.height??B.rect.height,_=h.y+F-this.#x;B.updateRect({x:h.x,y:_,width:h.width,height:N}),F+=N+this.#_}this.#F=!1}#D(x){if(this.#Y()===0&&!this.#U)return;let F=this.#A(),B=this.#X();if(B<=0)return;let $=cx(F.height,B,this.#x);qF({buffer:x,x:F.x+F.width,trackY:F.y,trackHeight:F.height,geometry:$,thumbColor:this.#J,trackColor:this.#q})}#z(){if(this.#Y()===0&&!this.#U)return;let h=this.#A(),F=this.#X();if(F<=0)return;let B=cx(h.height,F,this.#x);return{x:h.x+h.width,trackY:h.y,trackHeight:h.height,thumbY:h.y+B.thumbOffset,thumbSize:B.thumbSize}}}class Dh{#h;#x;#F;#B=[];constructor(x){this.#F=x}start(x){m.setFocusRequestCallback((h)=>{this.focusWidget(h)}),this.#x=(h)=>{if(this.#h&&!this.#h.acceptsFocus)this.#h=void 0;if(h.key==="Tab"&&!h.ctrlKey&&!h.altKey&&!h.metaKey){this.#Q(h.shiftKey?-1:1);return}if(this.#h){this.#h.handleKey(h);return}x?.(h)},O.on(W.KeyboardEvent,this.#x)}stop(){if(m.setFocusRequestCallback(void 0),this.#x)O.off(W.KeyboardEvent,this.#x),this.#x=void 0;this.blurWidget()}focusWidget(x){if(x===this.#h)return;if(!x.acceptsFocus)return;if(this.#h)this.#h.blur();this.#h=x,x.focus(),this.#_(x)}blurWidget(){if(this.#h)this.#h.blur(),this.#h=void 0}get focusedWidget(){return this.#h}getFocusableWidgets(){let x=this.#F()?.getFocusableWidgets()??[];if(this.#B.length===0)return x;let h=this.#B.at(-1);return x.filter((F)=>this.#$(F,h))}pushFocusScope(x){this.#B.push(x)}popFocusScope(){this.#B.pop()}#$(x,h){let F=x;while(F){if(F===h)return!0;F=F.parent}return!1}#_(x){let h=x.parent;while(h){if(h instanceof Kh)h.scrollIntoView(x);h=h.parent}}#Q(x){let h=this.getFocusableWidgets();if(h.length===0)return;let F;if(this.#h){let B=h.indexOf(this.#h);if(B===-1)F=x===1?0:h.length-1;else F=(B+x+h.length)%h.length}else F=x===1?0:h.length-1;for(let B=0;B<h.length;B++){let $=(F+x*B+h.length)%h.length;if(h[$].acceptsFocus){this.focusWidget(h[$]);return}}}}e0();class jh{#h;#x;#F;#B=!1;#$=0;#_=0;#Q;#U;#J;#q;constructor(x,h){this.#J=x,this.#q=h}start(){this.#Q=(x)=>{let h=this.#J();if(!h)return;if(x.button===void 0){let F=h.hitTest(x);if(F!==this.#F){if(this.#F)this.#F.dispatch("mouseout",x);if(this.#F=F,this.#F)this.#F.dispatch("mouseover",x)}else if(this.#F)this.#F.dispatch("mousemove",x);if(this.#h&&x.buttons&&x.buttons>0){let B=this.#x;if(B){if(!this.#B)this.#B=!0,B.clearPositionPercentSpec(),B.dispatch("dragstart",x);let{x:$,y:N}=x,_=$-this.#$,Z=N-this.#_,Q=B.rect.x,U=B.rect.y;if(B.updateRect({x:_,y:Z}),_!==Q)B.dispatch("update:x",{x:_});if(Z!==U)B.dispatch("update:y",{y:Z});B.dispatch("drag",x)}else this.#h.dispatch("mousemove",x)}return}if(x.button===S0.RIGHT_MOUSE_BUTTON){if(!x.isRelease)this.#h=h.hitTest(x);else if(this.#h){if(h.hitTest(x)===this.#h)this.#h.dispatch("contextmenu",x);this.#h=void 0}return}if(!x.isRelease){let F=h.hitTest(x);if(this.#h=F,F){if(F.dispatch("mousedown",x),this.#x=F.closest(($)=>$.draggable),this.#x)this.#$=x.x-this.#x.rect.x,this.#_=x.y-this.#x.rect.y;let B=F.closest(($)=>$x($));if(B&&$x(B))this.#q.focusWidget(B);else this.#q.blurWidget()}else this.#x=void 0,this.#q.blurWidget();return}if(this.#B){this.#x?.dispatch("dragend",x),this.#B=!1,this.#x=void 0,this.#h=void 0;return}if(this.#h){if(this.#h.dispatch("mouseup",x),h.hitTest(x)===this.#h)this.#h.dispatch("click",x);this.#h=void 0,this.#x=void 0}},O.on(W.MouseEvent,this.#Q),this.#U=(x)=>{let h=this.#J();if(!h)return;let F=h.hitTest(x);if(F)F.dispatch("wheel",x)},O.on(W.WheelEvent,this.#U)}stop(){if(this.#Q)O.off(W.MouseEvent,this.#Q),this.#Q=void 0;if(this.#U)O.off(W.WheelEvent,this.#U),this.#U=void 0;this.resetState()}resetState(){if(this.#F)this.#F.dispatch("mouseout",{button:void 0,buttons:void 0,x:0,y:0,isRelease:!1,shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1});this.#h=void 0,this.#x=void 0,this.#F=void 0,this.#B=!1}}a0();var IF=new TextEncoder;class nh{#h;#x;#F=0;#B=!1;constructor(x=65536){this.#h=new ArrayBuffer(x),this.#x=new h0(this.#h)}get ptr(){return Xx(this.#h)}get byteLength(){return this.#F}get buffer(){return this.#h}reset(){this.#F=0,this.#B=!1,this.#x.setUint16(0,_F,!0),this.#x.setUint8(2,ZF),this.#x.setUint8(3,0),this.#x.setUint32(4,0,!0),this.#F=NF}finish(){let x=this.#B?1:0;this.#x.setUint8(3,x)}setSynchronizedUpdate(x){this.#B=x}setBackground(x){this.#$(T.SetBackground,0,4),this.#x.setUint32(this.#F,x,!0),this.#F+=4}setCursor(x,h){this.#$(T.SetCursor,0,4),this.#x.setInt16(this.#F,x,!0),this.#x.setInt16(this.#F+2,h,!0),this.#F+=4}pushClip(x,h,F,B){this.#$(T.PushClip,0,8),this.#x.setInt16(this.#F,x,!0),this.#x.setInt16(this.#F+2,h,!0),this.#x.setInt16(this.#F+4,F,!0),this.#x.setInt16(this.#F+6,B,!0),this.#F+=8}popClip(){this.#$(T.PopClip,0,0)}setEntityId(x){this.#$(T.SetEntityId,0,8),this.#x.setBigUint64(this.#F,x,!0),this.#F+=8}drawRect({x,y:h,width:F,height:B,bgRgba:$,fillChar:N=32,fontStyle:_=0}){this.#$(T.DrawRect,0,16);let Z=this.#F;this.#x.setInt16(Z,x,!0),this.#x.setInt16(Z+2,h,!0),this.#x.setInt16(Z+4,F,!0),this.#x.setInt16(Z+6,B,!0),this.#x.setUint32(Z+8,$,!0),this.#x.setUint16(Z+12,N,!0),this.#x.setUint16(Z+14,_,!0),this.#F=Z+16}drawText({x,y:h,text:F,fgRgba:B,bgRgba:$,fontStyle:N=0}){let _=IF.encode(F),Z=_.length;this.#$(T.DrawText,0,16+Z);let Q=this.#F;this.#x.setInt16(Q,x,!0),this.#x.setInt16(Q+2,h,!0),this.#x.setUint32(Q+4,B,!0),this.#x.setUint32(Q+8,$,!0),this.#x.setUint16(Q+12,N,!0),this.#x.setUint16(Q+14,Z,!0),new Uint8Array(this.#h).set(_,Q+16),this.#F=Q+16+Z}drawBorder({x,y:h,width:F,height:B,colorRgba:$,style:N,sides:_}){this.#$(T.DrawBorder,0,16);let Z=this.#F;this.#x.setInt16(Z,x,!0),this.#x.setInt16(Z+2,h,!0),this.#x.setInt16(Z+4,F,!0),this.#x.setInt16(Z+6,B,!0),this.#x.setUint32(Z+8,$,!0),this.#x.setUint8(Z+12,N),this.#x.setUint8(Z+13,_),this.#x.setUint16(Z+14,0,!0),this.#F=Z+16}drawShadow({x,y:h,width:F,height:B,offsetX:$,offsetY:N,colorRgba:_}){this.#$(T.DrawShadow,0,16);let Z=this.#F;this.#x.setInt16(Z,x,!0),this.#x.setInt16(Z+2,h,!0),this.#x.setInt16(Z+4,F,!0),this.#x.setInt16(Z+6,B,!0),this.#x.setInt16(Z+8,$,!0),this.#x.setInt16(Z+10,N,!0),this.#x.setUint32(Z+12,_,!0),this.#F=Z+16}drawFill({x,y:h,width:F,height:B,rgba:$}){this.#$(T.DrawFill,0,12);let N=this.#F;this.#x.setInt16(N,x,!0),this.#x.setInt16(N+2,h,!0),this.#x.setInt16(N+4,F,!0),this.#x.setInt16(N+6,B,!0),this.#x.setUint32(N+8,$,!0),this.#F=N+12}drawChar({x,y:h,char:F,fgRgba:B,bgRgba:$,fontStyle:N=0,wide:_=!1}){let Z=_?1:0;this.#$(T.DrawChar,Z,16);let Q=this.#F;this.#x.setInt16(Q,x,!0),this.#x.setInt16(Q+2,h,!0),this.#x.setUint32(Q+4,B,!0),this.#x.setUint32(Q+8,$,!0),this.#x.setUint16(Q+12,F,!0),this.#x.setUint16(Q+14,N,!0),this.#F=Q+16}drawLine({x,y:h,length:F,direction:B,colorRgba:$,lineStyle:N}){this.#$(T.DrawLine,0,16);let _=this.#F;this.#x.setInt16(_,x,!0),this.#x.setInt16(_+2,h,!0),this.#x.setUint16(_+4,F,!0),this.#x.setUint16(_+6,B,!0),this.#x.setUint32(_+8,$,!0),this.#x.setUint8(_+12,N),this.#F=_+16}setTitle(x){let h=IF.encode(x);this.#$(T.SetTitle,0,2+h.length),this.#x.setUint16(this.#F,h.length,!0),new Uint8Array(this.#h).set(h,this.#F+2),this.#F+=2+h.length}showCursor(){this.#$(T.ShowCursor,0,0)}hideCursor(){this.#$(T.HideCursor,0,0)}setCursorMode(x){this.#$(T.SetCursorMode,0,1),this.#x.setUint8(this.#F,x),this.#F+=1}#$(x,h,F){let B=qh+F;if(this.#F+B>this.#h.byteLength)throw Error(`DrawListBuffer overflow: need ${B} bytes at cursor ${this.#F}, buffer size ${this.#h.byteLength}`);let $=this.#F;this.#x.setUint16($,x,!0),this.#x.setUint16($+2,h,!0),this.#x.setUint32($+4,F,!0),this.#F=$+qh}}Fx();Ex();var u6=60,d6=30;class Ah{#h=new nh;#x;#F;#B;#$;#_;#Q;#U=!1;#J;#q=0;#G=0;#K=0;constructor(x,h,F,B){this.#x=x,this.#F=h,this.#B=F,this.#$=1000/(B?.tickRate??u6),this.#_=1000/(B?.renderRate??d6),this.#Q=B?.scheduler??E1}start(){this.#U=!0,this.#q=performance.now(),this.#K=this.#q,this.#G=0;let x=()=>{if(!this.#U)return;try{let h=this.#x();if(h?.visible){let F=performance.now(),B=F-this.#q;this.#q=F,this.#G+=B;while(this.#G>=this.#$)h.update(this.#$),this.#G-=this.#$;if(F-this.#K>=this.#_)this.#h.reset(),h.emitDrawCommands(this.#h),this.#h.finish(),this.#F.renderDrawList(this.#B,this.#h),this.#K=F}}catch(h){M.logError(`Render loop error: ${o6(h)}`)}this.#J=this.#Q.schedule(x)};this.#J=this.#Q.schedule(x)}stop(){if(this.#U=!1,this.#J!==void 0)this.#Q.cancel(this.#J),this.#J=void 0}}function o6(x){if(x instanceof Error)return x.stack??x.message;return String(x)}var KF,DF,jF;function nF(x,h){let F=[],B=[];KF=x,DF=F,jF=B;let $=h();DF=void 0,KF=void 0,jF=void 0;for(let _ of B)_();let N=F;return()=>{for(let _ of N)_();$?.()}}class YF{#h;#x;#F;#B=[];#$=void 0;#_;#Q;#U;#J=new Map;constructor(x){this.#F=x?.backend??$h();let h=x?.logLevel??"info",F=x?.logFilePath??Nh(),B=x?.backendLogName??"buntui-backend.log",$=x?.frontendLogName??"buntui-frontend.log",N=x?.clearLog??!1;this.#F.setupLogger(F,B,h,N),this.#h=x?.debugMode??!1,this.#x=x?.quitOnQ??!1,M.init({logFileDir:F,logLevel:h,clearLog:N,frontendLogName:$,backendLogName:B});let _=()=>this.#$;this.#_=new Dh(_),this.#Q=new jh(_,this.#_),this.#U=new Ah(_,this.#F,S,{tickRate:x?.tickRate,renderRate:x?.renderRate,scheduler:x?.scheduler}),AF(this)}start(){if(y6(),this.#h)O.on(W.KeyboardEvent,(x)=>{M.logDebug(`keyboard event: ${JSON.stringify(x)}`)}),O.on(W.WheelEvent,(x)=>{M.logDebug(`wheel event: ${JSON.stringify(x)}`)}),O.on(W.MouseEvent,(x)=>{M.logDebug(`mouse event: ${JSON.stringify(x)}`)});this.#_.start(),O.on(W.KeyboardEvent,(x)=>{if(this.#x&&(x.key==="q"||x.key==="Q"))setTimeout(()=>{this.stop()})}),O.attach(this.#F),O.on(W.TermResizeEvent,()=>{this.#F.detectTermSize(S),M.logInfo(`Terminal resized: ${S.rows}x${S.cols}`)}),this.#Q.start(),this.#F.startApp(),O.start(),this.#F.detectTermSize(S),M.logInfo(`TUI_CONTEXT_INSTANCE.scale: ${S.rows} ${S.cols}`),this.#U.start()}get focusedWidget(){return this.#_.focusedWidget}focusWidget(x){this.#_.focusWidget(x)}blurWidget(){this.#_.blurWidget()}dispose(){this.#U.stop(),this.#Q.stop(),this.#_.stop(),HF(),MF(),AF(void 0),this.#$?.destroy(),this.#F.stopApp(),O.stop(),M.logInfo("TUI application stopped"),M.deinit()}[Symbol.dispose](){this.dispose()}async[Symbol.asyncDispose](){this.dispose()}stop(){this.dispose(),Bx()?.exit(0)}setTheme(x){l1(x)}createScene(x,h){let F=new hF(h),B=x;if(typeof B.setup==="function"){let $=B.setup,N=nF(F,()=>$(F));this.#J.set(F.id,N)}if(this.#B.push(F),F.visible)this.activateScene(F);return F}destroyScene(x){let h=typeof x==="bigint"?x:x.id,F=this.#B.find(($)=>$.id===h);if(!F)return;let B=this.#J.get(h);if(B)B(),this.#J.delete(h);if(F.destroy(),this.#B=this.#B.filter(($)=>$.id!==h),this.#$===F){this.#$=void 0,this.#_.blurWidget(),this.#Q.resetState();let $=this.#B.at(-1);if($)this.activateScene($)}}switchScene(x){if(!this.#B.some((h)=>h.id===x.id))return;this.activateScene(x)}activateScene(x){if(this.#$===x)return;if(this.#$)this.#$.setVisible(!1),this.#_.blurWidget(),this.#Q.resetState(),this.#$.emitLifecycle("exit");this.#$=x,x.setVisible(!0),x.emitLifecycle("enter")}}var XF;function AF(x){XF=x}var{log:EF,error:LF,warn:PF}=console,k0=[];function y6(){console.log=(...x)=>{let h=x.map((F)=>Ch(F)).join(" ");M.logInfo(h),k0.push({level:"log",message:h})},console.error=(...x)=>{let h=x.map((F)=>Ch(F)).join(" ");M.logError(h),k0.push({level:"error",message:h})},console.warn=(...x)=>{let h=x.map((F)=>Ch(F)).join(" ");M.logWarning(h),k0.push({level:"warn",message:h})}}function MF(){for(let{level:x,message:h}of k0)switch(x){case"error":{LF(h);break}case"warn":{PF(h);break}case"log":{EF(h);break}}k0.length=0}function HF(){console.log=EF,console.error=LF,console.warn=PF}function Ch(x){if(x instanceof Error)return x.stack??x.message;if(typeof x==="object"&&x!==null)try{return JSON.stringify(x)}catch{return"[object]"}return String(x)}function CF(x){let h=x instanceof Error?x.stack??x.message:String(x);M.logError(`Unhandled error: ${h}`),k0.push({level:"error",message:h}),HF(),MF(),setTimeout(()=>{XF?.dispose(),Bx()?.exit(1)})}{let x=Bx();x?.on("unhandledRejection",CF),x?.on("uncaughtException",CF)}var cF=YF;function Yh(x){return new cF(x)}function m0(x){let h=x.codePointAt(0);if(h<32||h===127)return 0;if(h>=19968&&h<=40959||h>=13312&&h<=19903||h>=12288&&h<=12351||h>=12352&&h<=12447||h>=12448&&h<=12543||h>=44032&&h<=55215||h>=65281&&h<=65376||h>=63744&&h<=64255||h>=11904&&h<=12255||h>=12544&&h<=12687||h>=12800&&h<=13311||h>=65072&&h<=65103||h>=9728&&h<=10175||h>=127744&&h<=129535)return 2;return 1}function N0(x){let h=0;for(let F of x)h+=m0(F);return h}function L0(x,h){let F=0,B=0;for(let $ of x){let N=m0($);if(F+N>h)break;F+=N,B++}return x.slice(0,B)}class ix extends f0{#h;#x;#F;#B;#$;#_;#Q;#U=0;#J=0;#q=!1;#G=0;#K=!0;constructor(x){super();this.#h=this.initRect(x.x,x.y,x.width,x.height,{width:32,height:1});let h=F0();this.#x={colorFg:q(x.colorFg??h.colors.text),colorBg:q(x.colorBg??0)},this.#F={styleZIndex:x.styleZIndex??0,styleModifier:t0(x.styleModifier)},this.#B=x.value,this.#$=x.overflow??"marquee",this.#_=x.scrollSpeed??4,this.#Q=x.scrollPauseMs??1000}get rect(){return this.#h}updateRect(x){Object.assign(this.#h,x)}get color(){return this.#x}updateThemeColors(x){this.updateColor({colorFg:x.colorFg===void 0?void 0:q(x.colorFg)})}updateColor(x){if(x.colorFg!==void 0)this.#x.colorFg=q(x.colorFg);if(x.colorBg!==void 0)this.#x.colorBg=q(x.colorBg)}get style(){return this.#F}updateStyle(x){if(x.styleModifier!==void 0)this.#F.styleModifier=t0(x.styleModifier);if(x.styleZIndex!==void 0)this.#F.styleZIndex=x.styleZIndex}get zIndex(){return this.getZIndexOverride()??this.#F.styleZIndex}get value(){return this.#B}updateValue(x){this.#B=x,this.#U=0,this.#J=0,this.#q=!1,this.#K=!0}setScrollSpeed(x){this.#_=x}setScrollPauseMs(x){this.#Q=x}intrinsicSize(){return{width:N0(this.#B),height:1}}unmounted(){super.unmounted(),this.#G=0}emitDrawCommands(x){let{x:h,y:F,width:B,height:$}=this.#h,{colorFg:N,colorBg:_}=this.#x;if(x.pushClip(h,F,B,$),_!==0)x.drawRect({x:h,y:F,width:B,height:$,bgRgba:_});if(this.#B.length>0)if(this.#$==="marquee")this.#j(x,{x:h,y:F,visibleWidth:B,fgRgba:N});else x.drawText({x:h,y:F,text:this.#B,fgRgba:N,bgRgba:0});x.popClip()}#j(x,{x:h,y:F,visibleWidth:B,fgRgba:$}){let N=N0(this.#B);if(N<=B){x.drawText({x:h,y:F,text:this.#B,fgRgba:$,bgRgba:0});return}let _=Date.now();if(this.#G===0)this.#G=_;let Z=_-this.#G;if(this.#G=_,this.#K)this.#K=!1,this.#J=this.#Q;let Q=0,U=[...this.#B];for(let L=U.length-1;L>=0;L--){let i=U[L],C=m0(i);if(Q+C>B)break;Q+=C}let G=Math.max(N-B,N-Q);if(this.#J>0){if(this.#J-=Z,this.#J<0){if(this.#J=0,this.#q)this.#q=!1,this.#U=0,this.#J=this.#Q}}else{let L=this.#_*Z/1000;if(this.#U+=L,this.#U>=G)this.#U=G,this.#J=this.#Q,this.#q=!0}let z=Math.floor(this.#U),D=0,A=0;for(let L of this.#B){let i=m0(L);if(A+i>z)break;A+=i,D++}let E=B-(A-z),j=L0(this.#B.slice(D),E),H=h+A-z;x.drawText({x:H,y:F,text:j,fgRgba:$,bgRgba:0})}}var iF={x:0,y:0,width:32,height:1,value:""},fF={colorFg:"text"};function P0(x){if(typeof x==="string"){let F=new ix({...iF,value:x});return w(F,fF,{},(B)=>{F.updateThemeColors(B)}),F}let h=new ix({...iF,...x});return w(h,fF,x,(F)=>{h.updateThemeColors(F)}),h}var mF=[["Normal","normal"],["Hovered","hovered"],["Focused","focused"],["Selected","selected"],["Pressed","pressed"],["Disabled","disabled"],["Active","active"],["Unfocused","normal"]],p6={colorFg:"fg",colorBg:"bg",colorCross:"cross",colorCheck:"check",colorDim:"dim",colorTrack:"track",colorFill:"fill",colorBorder:"colorBorder"};function _0(x,h){let F=x;for(let[B,$]of Object.entries(h)){if($===void 0)continue;for(let[N,_]of mF){if(!B.endsWith(N))continue;let Z=B.slice(0,-N.length),Q=p6[Z];if(Q===void 0)break;let U=F[_];if(U!==void 0)U[Q]=q($);break}if(B.startsWith("borderStyle"))for(let[N,_]of mF){if(!B.endsWith(N))continue;let Z=F[_];if(Z!==void 0&&"borderStyle"in Z)Z.borderStyle=V($);break}}}function x0(x,h){if(h.disabled&&x.disabled)return x.disabled;if(h.pressed&&x.pressed)return x.pressed;if(h.selected&&x.selected)return x.selected;if(h.hovered&&x.hovered)return x.hovered;if(h.focused&&x.focused)return x.focused;if(h.active&&x.active)return x.active;return x.normal}var OF;function fx(){return OF??=r6(),OF}function r6(){if(typeof navigator<"u"&&"clipboard"in navigator)return{read(){return""},write(h){navigator.clipboard.writeText(h)}};return new((VF(),ox(RF))).SystemClipboard}function v6(x,h){let F=0,B=0;for(let $ of x){let N=m0($);if(F+N>h)break;F+=N,B++}return B}var l6=0,a6=1,e6=2,x2=3;function B0(x){if(x<=32)return a6;if(x>=19968&&x<=40959||x>=13312&&x<=19903||x>=12288&&x<=12351||x>=65280&&x<=65519)return x2;if(x>=33&&x<=47||x>=58&&x<=64||x>=91&&x<=96||x>=123&&x<=126)return e6;return l6}var TF={colorFgNormal:"text",colorBgNormal:"surface",colorFgFocused:"text",colorBgFocused:"surface",colorBorderUnfocused:"border",colorBorderFocused:"borderFocused",colorBorderDisabled:"border",borderStyle:"border.normal",colorPlaceholder:"placeholder",colorSelectionBg:"selectionBg",colorSelectionFg:"selectionFg",colorFgDisabled:"textMuted",colorBgDisabled:"surfaceDisabled"};function SF(){return{x:0,y:0,width:32,height:3,placeholder:"",value:"",maxLength:0,label:"",readonly:!1,disabled:!1,...e(TF)}}class Xh extends m{#h;#x;#F;#B;#$;#_;#Q;#U;#J;#q;#G;#K;#j;#N;#E;#n;#A;#X;#Y;#Z=0;#D=0;#z;#i=!1;#f=0;#T=0;#S=-1;#R="blinking-ibeam";#M=[];#m=[];constructor(x={}){super();let h={...SF(),...x},F=this.initRect(h.x,h.y,h.width,h.height);this.#h=F.x,this.#x=F.y,this.#F=F.width,this.#B=F.height,this.#$={normal:{fg:q(h.colorFgNormal),bg:q(h.colorBgNormal),colorBorder:q(h.colorBorderUnfocused)},focused:{fg:q(h.colorFgFocused),bg:q(h.colorBgFocused),colorBorder:q(h.colorBorderFocused)},disabled:{fg:q(h.colorFgDisabled),bg:q(h.colorBgDisabled),colorBorder:q(h.colorBorderDisabled)}},this.#_=V(h.borderStyle??"solid"),this.#Q=h.maxLength??0,this.#U=h.placeholder??"",this.#J=q(h.colorPlaceholder),this.#q=q(h.colorSelectionBg),this.#G=q(h.colorSelectionFg),this.#K=h.label??"",this.#j=h.readonly??!1,this.#E=(h.type??"text")==="password",this.#n=(h.type??"text")==="number",this.#A=h.min??0,this.#X=h.max??100,this.#Y=h.step??1,this.#N=h.value??"",this.#Z=this.#N.length,this.setDisabled(h.disabled??!1),this.on("mousedown",(B)=>{if(this.disabled)return;if(this.#n){let _=this.#h+this.#F-2;if(B.x===_){let Z=this.#x+1;if(B.y===Z){this.#V();return}if(this.#B===3&&B.y===Z+1){this.#O();return}}}let $=this.#s(B),N=Date.now();if(N-this.#T<300&&$===this.#S)this.#f++;else this.#f=1;if(this.#T=N,this.#S=$,this.#f>=3){this.#z=0,this.#Z=this.#N.length,this.#i=!0,this.#I();return}if(this.#f===2){let[_,Z]=this.#w($);this.#z=_,this.#Z=Z,this.#i=!0,this.#I();return}if(B.shiftKey){if(this.#z===void 0)this.#z=this.#Z}else this.#z=$;this.#Z=$,this.#i=!0,this.#I()}),this.on("mousemove",(B)=>{if(!this.#i)return;if(!B.buttons||B.buttons===0)return;let $=B.x,N=this.#h+1,_=this.#n?this.#h+this.#F-3:this.#h+this.#F-1;if($<N&&this.#D>0){this.#D--,this.#Z=this.#D;return}if($>=_&&this.#Z<this.#N.length){this.#Z++,this.#I();return}let Z=this.#s(B);if(Z!==this.#Z)this.#Z=Z,this.#I()}),this.on("mouseup",()=>{this.#i=!1}),this.on("wheel",(B)=>{if(this.disabled||!this.#n)return;if(B.wheelDeltaY>0)this.#V();else if(B.wheelDeltaY<0)this.#O()})}get value(){return this.#N}get readonly(){return this.#j}setReadonly(x){this.#j=x}setLabel(x){this.#K=x}setMaxLength(x){this.#Q=x}setPlaceholder(x){this.#U=x}setMin(x){this.#A=x}setMax(x){this.#X=x}setStep(x){this.#Y=x}updateColor(x){if(x.colorFg!==void 0){let h=q(x.colorFg);this.#$.normal.fg=h,this.#$.focused.fg=h}if(x.colorBg!==void 0){let h=q(x.colorBg);this.#$.normal.bg=h,this.#$.focused.bg=h}}updateBorder(x){if(x.borderStyle!==void 0)this.#_=V(x.borderStyle)}updateValue(x){this.#N=x,this.#Z=Math.min(this.#Z,this.#N.length),this.#z=void 0,this.#I()}get acceptsFocus(){return super.acceptsFocus}blur(){if(this.#n)this.#g();this.#z=void 0,super.blur()}handleActiveKey(x){let h=x.key;if(h.length===1&&!x.ctrlKey&&!x.altKey&&!x.metaKey){if(!this.#j)if(this.#n)this.#_0(h);else this.#b(h);return}if(x.ctrlKey&&this.#x0(h,x))return;if(this.#n){if(h==="ArrowUp"){this.#V();return}if(h==="ArrowDown"){this.#O();return}}switch(h){case"Backspace":{if(!this.#j)if(x.ctrlKey)this.#k();else this.#d();break}case"Delete":{if(!this.#j)if(x.ctrlKey)this.#u();else this.#o();break}case"ArrowLeft":{if(x.ctrlKey)this.#r(x);else this.#y(x);break}case"ArrowRight":{if(x.ctrlKey)this.#v(x);else this.#p(x);break}case"Home":{this.#l(x);break}case"End":{this.#a(x);break}case"Escape":break;case"Insert":{this.#t();break}case"Enter":{if(this.#n)this.#g();this.#z=void 0,this.dispatch("submit",{value:this.#N});break}default:break}}updateRect(x){if(x.x!==void 0)this.#h=x.x;if(x.y!==void 0)this.#x=x.y;if(x.width!==void 0)this.#F=x.width;if(x.height!==void 0)this.#B=x.height}updateThemeColors(x){if(_0(this.#$,x),x.borderStyle!==void 0)this.#_=V(x.borderStyle);if(x.colorPlaceholder!==void 0)this.#J=q(x.colorPlaceholder);if(x.colorSelectionBg!==void 0)this.#q=q(x.colorSelectionBg);if(x.colorSelectionFg!==void 0)this.#G=q(x.colorSelectionFg)}emitDrawCommands(x){if(this.#F<=0||this.#B<=0)return;x.pushClip(this.#h,this.#x,this.#F,this.#B);let h=x0(this.#$,{disabled:this.disabled,focused:this.focused});x.drawRect({x:this.#h,y:this.#x,width:this.#F,height:this.#B,bgRgba:h.bg});let F=this.#h+1,B=this.#x+1,$=this.#n?this.#F-4:this.#F-2;if(this.#N.length>0){let N=this.#L(),_=this.#N.slice(this.#D),Z=this.#H(_),Q=L0(Z,$),U=this.#D+[...Q].length;if(N===void 0)x.drawText({x:F,y:B,text:Q,fgRgba:h.fg,bgRgba:0});else{let G=Math.max(N.start,this.#D),z=Math.min(N.end,U),D=F;if(G>this.#D){let A=this.#H(this.#N.slice(this.#D,G)),E=L0(A,$-(D-F));x.drawText({x:D,y:B,text:E,fgRgba:h.fg,bgRgba:0}),D+=N0(E)}if(z>G){let A=$-(D-F),E=this.#H(this.#N.slice(G,z)),j=L0(E,A);x.drawText({x:D,y:B,text:j,fgRgba:this.#G,bgRgba:this.#q}),D+=N0(j)}if(z<U){let A=$-(D-F);if(A>0){let E=this.#H(this.#N.slice(z,U)),j=L0(E,A);x.drawText({x:D,y:B,text:j,fgRgba:h.fg,bgRgba:0})}}}}else if(this.#U.length>0)x.drawText({x:F,y:B,text:this.#U.slice(0,$),fgRgba:this.#J,bgRgba:0});if(this.#_!==0){if(x.drawBorder({x:this.#h,y:this.#x,width:this.#F,height:this.#B,colorRgba:h.colorBorder,style:this.#_,sides:q0.All}),this.#K.length>0){let N=this.#n?this.#F-4:this.#F-2,_=L0(this.#K,N);x.drawText({x:this.#h+1,y:this.#x,text:_,fgRgba:h.fg,bgRgba:h.bg})}}if(this.#n){let N=this.#h+this.#F-2,_=this.#x+1;if(x.drawChar({x:N,y:_,char:9650,fgRgba:h.fg,bgRgba:h.bg}),this.#B>=3)x.drawChar({x:N,y:_+1,char:9660,fgRgba:h.fg,bgRgba:h.bg})}if(this.focused&&!this.disabled){let N=this.#H(this.#N.slice(this.#D,this.#Z)),_=F+N0(N);x.setCursor(_,B),x.setCursorMode($F(this.#R)),x.showCursor()}x.popClip()}get rect(){return{x:this.#h,y:this.#x,width:this.#F,height:this.#B}}intrinsicSize(){return{width:this.#F,height:this.#B}}getSelection(){let x=this.#L();if(x===void 0)return;return{start:x.start,end:x.end,text:this.#N.slice(x.start,x.end)}}select(){this.#z=0,this.#Z=this.#N.length,this.#I()}setSelectionRange(x,h){let F=Math.max(0,Math.min(x,this.#N.length)),B=Math.max(0,Math.min(h,this.#N.length));this.#z=Math.min(F,B),this.#Z=Math.max(F,B),this.#I()}#t(){let x=["blinking-ibeam","blinking-block","blinking-underscore","ibeam","block","underscore"],h=x.indexOf(this.#R);this.#R=x[(h+1)%x.length]}#H(x){if(!this.#E)return x;return"\u2022".repeat([...x].length)}#W(x,h){return this.#H(this.#N.slice(x,h))}#L(){if(this.#z===void 0||this.#z===this.#Z)return;return this.#z<this.#Z?{start:this.#z,end:this.#Z}:{start:this.#Z,end:this.#z}}#P(){let x=this.#L();if(x===void 0)return!1;return this.#N=this.#N.slice(0,x.start)+this.#N.slice(x.end),this.#Z=x.start,this.#z=void 0,this.#I(),this.dispatch("input",{value:this.#N}),!0}#I(){let x=this.#n?this.#F-4:this.#F-2;if(x<=0)return;if(this.#Z<this.#D)this.#D=this.#Z;if(N0(this.#W(this.#D,this.#Z))>=x){while(this.#D<this.#Z)if(this.#D++,N0(this.#W(this.#D,this.#Z))<x)break}while(this.#D>0){let F=this.#D-1;if(N0(this.#W(F))<=x)this.#D=F;else break}}#s(x){let h=x.x-this.#h-1,F=this.#n?this.#F-4:this.#F-2;if(h<0||h>=F)return this.#Z;let B=this.#W(this.#D);return Math.max(0,Math.min(this.#N.length,this.#D+v6(B,h)))}#w(x){let{length:h}=this.#N;if(h===0)return[0,0];let F=Math.min(x,h-1),B=F,$=F,N=B0(this.#N.codePointAt(F));while(B>0&&B0(this.#N.codePointAt(B-1))===N)B--;while($<h&&B0(this.#N.codePointAt($))===N)$++;return[B,$]}#b(x){if(this.#Q===0||this.#N.length<this.#Q||this.#L()!==void 0){if(this.#C(),this.#P(),this.#Q===0||this.#N.length<this.#Q)this.#N=this.#N.slice(0,this.#Z)+x+this.#N.slice(this.#Z),this.#Z++;this.#I(),this.dispatch("input",{value:this.#N})}}#k(){if(this.#L()!==void 0){this.#C(),this.#P();return}if(this.#Z<=0)return;this.#C();let x=this.#Z,h=B0(this.#N.codePointAt(x-1));x--;while(x>0&&B0(this.#N.codePointAt(x-1))===h)x--;this.#N=this.#N.slice(0,x)+this.#N.slice(this.#Z),this.#Z=x,this.#I(),this.dispatch("input",{value:this.#N})}#u(){if(this.#L()!==void 0){this.#C(),this.#P();return}let{length:x}=this.#N;if(this.#Z>=x)return;this.#C();let h=this.#Z,F=B0(this.#N.codePointAt(h));h++;while(h<x&&B0(this.#N.codePointAt(h))===F)h++;this.#N=this.#N.slice(0,this.#Z)+this.#N.slice(h),this.#I(),this.dispatch("input",{value:this.#N})}#d(){if(this.#L()!==void 0){this.#C(),this.#P();return}if(this.#Z>0)this.#C(),this.#N=this.#N.slice(0,this.#Z-1)+this.#N.slice(this.#Z),this.#Z--,this.#I(),this.dispatch("input",{value:this.#N})}#o(){if(this.#L()!==void 0){this.#C(),this.#P();return}if(this.#Z<this.#N.length)this.#C(),this.#N=this.#N.slice(0,this.#Z)+this.#N.slice(this.#Z+1),this.#I(),this.dispatch("input",{value:this.#N})}#c(x){if(x.shiftKey){if(this.#z===void 0)this.#z=this.#Z}else this.#z=void 0}#y(x){if(this.#c(x),this.#Z>0)this.#Z--,this.#I()}#p(x){if(this.#c(x),this.#Z<this.#N.length)this.#Z++,this.#I()}#r(x){if(this.#c(x),this.#Z<=0)return;let h=this.#Z,F=B0(this.#N.codePointAt(h-1));h--;while(h>0&&B0(this.#N.codePointAt(h-1))===F)h--;this.#Z=h,this.#I()}#v(x){this.#c(x);let{length:h}=this.#N;if(this.#Z>=h)return;let F=this.#Z,B=B0(this.#N.codePointAt(F));F++;while(F<h&&B0(this.#N.codePointAt(F))===B)F++;this.#Z=F,this.#I()}#l(x){this.#c(x),this.#Z=0,this.#D=0}#a(x){this.#c(x),this.#Z=this.#N.length,this.#I()}#e(x){if(x.ctrlKey&&!x.altKey&&!x.metaKey&&this.#N.length>0)this.#z=0,this.#Z=this.#N.length,this.#I()}#x0(x,h){if(x==="a")return this.#e(h),!0;if(x==="c")return this.#h0(),!0;if(x==="z"){if(!this.#j)this.#$0();return!0}if(x==="y"){if(!this.#j)this.#N0();return!0}if(x==="v"){if(!this.#j)this.#B0();return!0}if(x==="x"){if(!this.#j)this.#F0();return!0}return!1}#h0(){let x=this.getSelection();if(x===void 0)return;fx().write(x.text),this.dispatch("copy",{text:x.text})}#F0(){let x=this.getSelection();if(x===void 0)return;this.#C(),fx().write(x.text),this.#P(),this.dispatch("cut",{text:x.text})}#B0(){let x=fx().read();if(x.length===0)return;if(this.#n){let B="";for(let $ of x)if($>="0"&&$<="9")B+=$;else if($==="."&&!this.#N.includes(".")&&!B.includes("."))B+=$;else if($==="-"&&B.length===0&&this.#Z===0&&!this.#N.includes("-"))B+=$;if(x=B,x.length===0)return}if(this.#C(),this.#P(),this.#Q>0&&this.#N.length>=this.#Q)return;let h=this.#Q===0?x.length:this.#Q-this.#N.length,F=x.slice(0,h);this.#N=this.#N.slice(0,this.#Z)+F+this.#N.slice(this.#Z),this.#Z+=[...F].length,this.#I(),this.dispatch("paste",{text:F}),this.dispatch("input",{value:this.#N})}#C(){if(this.#M.length>=100)this.#M.shift();this.#M.push({value:this.#N,cursorPos:this.#Z,selectionAnchor:this.#z}),this.#m.length=0}#$0(){if(this.#M.length===0)return;this.#m.push({value:this.#N,cursorPos:this.#Z,selectionAnchor:this.#z});let x=this.#M.pop();this.#N=x.value,this.#Z=x.cursorPos,this.#z=x.selectionAnchor,this.#I(),this.dispatch("undo",{value:this.#N}),this.dispatch("input",{value:this.#N})}#N0(){if(this.#m.length===0)return;this.#M.push({value:this.#N,cursorPos:this.#Z,selectionAnchor:this.#z});let x=this.#m.pop();this.#N=x.value,this.#Z=x.cursorPos,this.#z=x.selectionAnchor,this.#I(),this.dispatch("redo",{value:this.#N}),this.dispatch("input",{value:this.#N})}#_0(x){if(x>="0"&&x<="9")this.#b(x);else if(x==="-"&&this.#Z===0&&!this.#N.includes("-"))this.#b(x);else if(x==="."&&!this.#N.includes("."))this.#b(x)}#V(){let x=Number.parseFloat(this.#N),h=Number.isNaN(x)?this.#A:x,F=Math.min(this.#X,h+this.#Y),B=String(F);if(B!==this.#N)this.#C(),this.#N=B,this.#Z=this.#N.length,this.#z=void 0,this.#I(),this.dispatch("input",{value:this.#N}),this.dispatch("change",{value:F})}#O(){let x=Number.parseFloat(this.#N),h=Number.isNaN(x)?this.#X:x,F=Math.max(this.#A,h-this.#Y),B=String(F);if(B!==this.#N)this.#C(),this.#N=B,this.#Z=this.#N.length,this.#z=void 0,this.#I(),this.dispatch("input",{value:this.#N}),this.dispatch("change",{value:F})}#g(){let x=Number.parseFloat(this.#N);if(Number.isNaN(x))this.#N=String(this.#A);else{let h=Math.max(this.#A,Math.min(this.#X,x));this.#N=String(h)}this.#Z=this.#N.length,this.#z=void 0,this.#I()}}function Eh(x){let h=new Xh({...SF(),...x});return w(h,TF,x??{},(F)=>{h.updateThemeColors(F)}),h}var sF={colorFgNormal:"text",colorBgNormal:"surface",colorBorderNormal:"border",borderStyleNormal:"border.normal",colorFgFocused:"text",colorBgFocused:"surfaceFocused",colorBorderFocused:"borderFocused",borderStyleFocused:"border.focused",colorFgHovered:"text",colorBgHovered:"surfaceHover",colorBorderHovered:"border",borderStyleHovered:"border.normal",colorFgPressed:"text",colorBgPressed:"surfacePressed",colorBorderPressed:"borderFocused",borderStylePressed:"border.pressed",colorFgDisabled:"textMuted",colorBgDisabled:"surfaceDisabled",colorBorderDisabled:"surfaceFocused",borderStyleDisabled:"border.disabled"};function gF(){return{x:0,y:0,width:10,height:3,value:"",...e(sF),disabled:!1}}class Lh extends m{#h;#x;#F=!1;#B;constructor(x={}){super();let h={...gF(),...x};this.#h=this.initRect(h.x,h.y,h.width,h.height),this.#x=h.value,this.setDisabled(h.disabled),this.#B={normal:{fg:q(h.colorFgNormal),bg:q(h.colorBgNormal),colorBorder:q(h.colorBorderNormal),borderStyle:V(h.borderStyleNormal)},focused:{fg:q(h.colorFgFocused),bg:q(h.colorBgFocused),colorBorder:q(h.colorBorderFocused),borderStyle:V(h.borderStyleFocused)},hovered:{fg:q(h.colorFgHovered),bg:q(h.colorBgHovered),colorBorder:q(h.colorBorderHovered),borderStyle:V(h.borderStyleHovered)},pressed:{fg:q(h.colorFgPressed),bg:q(h.colorBgPressed),colorBorder:q(h.colorBorderPressed),borderStyle:V(h.borderStylePressed)},disabled:{fg:q(h.colorFgDisabled),bg:q(h.colorBgDisabled),colorBorder:q(h.colorBorderDisabled),borderStyle:V(h.borderStyleDisabled)}},this.on("mousedown",()=>{this.#F=!0}),this.on("mouseup",()=>{this.#F=!1})}blur(){this.#F=!1,super.blur()}handleActiveKey(x){if(x.key==="Enter"||x.key===" ")this.dispatch("click",void 0)}get value(){return this.#x}updateValue(x){this.#x=x}updateNormalStyle(x){if(x.colorFgNormal!==void 0)this.#B.normal.fg=q(x.colorFgNormal);if(x.colorBgNormal!==void 0)this.#B.normal.bg=q(x.colorBgNormal);if(x.colorBorderNormal!==void 0)this.#B.normal.colorBorder=q(x.colorBorderNormal);if(x.borderStyleNormal!==void 0)this.#B.normal.borderStyle=V(x.borderStyleNormal)}updateHoveredStyle(x){if(x.colorFgHovered!==void 0)this.#B.hovered.fg=q(x.colorFgHovered);if(x.colorBgHovered!==void 0)this.#B.hovered.bg=q(x.colorBgHovered);if(x.colorBorderHovered!==void 0)this.#B.hovered.colorBorder=q(x.colorBorderHovered);if(x.borderStyleHovered!==void 0)this.#B.hovered.borderStyle=V(x.borderStyleHovered)}updatePressedStyle(x){if(x.colorFgPressed!==void 0)this.#B.pressed.fg=q(x.colorFgPressed);if(x.colorBgPressed!==void 0)this.#B.pressed.bg=q(x.colorBgPressed);if(x.colorBorderPressed!==void 0)this.#B.pressed.colorBorder=q(x.colorBorderPressed);if(x.borderStylePressed!==void 0)this.#B.pressed.borderStyle=V(x.borderStylePressed)}get rect(){return this.#h}intrinsicSize(){return{width:this.#h.width,height:this.#h.height}}updateRect(x){Object.assign(this.#h,x)}emitDrawCommands(x){let{x:h,y:F,width:B,height:$}=this.#h;if(B<=0||$<=0)return;x.pushClip(h,F,B,$);let N=x0(this.#B,{disabled:this.disabled,pressed:this.#F,hovered:this.hovered,focused:this.focused});if(x.drawRect({x:h,y:F,width:B,height:$,bgRgba:N.bg}),this.#x.length>0){let _=B-2,Z=$-2,Q=h+1+Math.max(0,Math.floor((_-this.#x.length)/2)),U=F+1+Math.floor(Z/2),G=this.#x.slice(0,Math.max(0,_));x.drawText({x:Q,y:U,text:G,fgRgba:N.fg,bgRgba:0})}if(N.borderStyle!==0)x.drawBorder({x:h,y:F,width:B,height:$,colorRgba:N.colorBorder,style:N.borderStyle,sides:q0.All});x.popClip()}updateThemeColors(x){_0(this.#B,x)}}function W0(x){let h=new Lh({...gF(),...x});return w(h,sF,x??{},(F)=>{h.updateThemeColors(F)}),h}var tF={colorFgNormal:"text",colorBgNormal:"surface",colorFgHovered:"text",colorBgHovered:"surfaceHover",colorFgFocused:"text",colorBgFocused:"surfaceFocused",colorFgDisabled:"textMuted",colorBgDisabled:"surfaceDisabled"};function wF(){return{x:0,y:0,width:10,height:1,label:"",checked:!1,indeterminate:!1,disabled:!1,...e(tF)}}class Ph extends m{#h;#x;#F;#B;#$;constructor(x={}){super();let h={...wF(),...x};this.#h=this.initRect(h.x,h.y,h.width,h.height),this.#x=h.label,this.#F=h.checked,this.#B=h.indeterminate??!1,this.setDisabled(h.disabled),this.#$={normal:{fg:q(h.colorFgNormal),bg:q(h.colorBgNormal)},hovered:{fg:q(h.colorFgHovered),bg:q(h.colorBgHovered)},focused:{fg:q(h.colorFgFocused),bg:q(h.colorBgFocused)},disabled:{fg:q(h.colorFgDisabled),bg:q(h.colorBgDisabled)}},this.on("click",()=>{this.#_()})}get checked(){return this.#F}get indeterminate(){return this.#B}get label(){return this.#x}get rect(){return this.#h}intrinsicSize(){return{width:this.#h.width,height:this.#h.height}}handleActiveKey(x){if(x.key==="Enter"||x.key===" ")this.#_()}setChecked(x){this.#F=x}setIndeterminate(x){this.#B=x}setLabel(x){this.#x=x}updateRect(x){Object.assign(this.#h,x)}updateThemeColors(x){_0(this.#$,x)}emitDrawCommands(x){let{x:h,y:F,width:B,height:$}=this.#h;if(B<=0||$<=0)return;x.pushClip(h,F,B,$);let{fg:N,bg:_}=x0(this.#$,{disabled:this.disabled,focused:this.focused,hovered:this.hovered});x.drawRect({x:h,y:F,width:B,height:$,bgRgba:_});let Z=this.#B?"[-]":this.#F?"[\u2713]":"[ ]",Q=F+Math.floor($/2);if(x.drawText({x:h,y:Q,text:Z,fgRgba:N,bgRgba:0}),this.#x.length>0){let U=h+Z.length+1,G=B-Z.length-1;if(G>0){let z=this.#x.slice(0,Math.max(0,G));x.drawText({x:U,y:Q,text:z,fgRgba:N,bgRgba:0})}}x.popClip()}#_(){if(this.#B)this.#B=!1,this.#F=!0;else this.#F=!this.#F;this.dispatch("change",{checked:this.#F,indeterminate:this.#B})}}function Mh(x){let h=new Ph({...wF(),...x});return w(h,tF,x??{},(F)=>{h.updateThemeColors(F)}),h}var kF={colorFgNormal:"text",colorBgNormal:"surface",colorFgFocused:"text",colorBgFocused:"surfaceHover",colorFgDisabled:"textMuted",colorBgDisabled:"surfaceDisabled",colorFgSelected:"accent",colorBgSelected:"surfaceFocused"};function uF(){return{x:0,y:0,width:20,height:3,options:[],value:-1,disabled:!1,...e(kF)}}class Hh extends m{#h;#x;#F;#B=-1;#$=-1;#_;constructor(x={}){super();let h={...uF(),...x};this.#h=this.initRect(h.x,h.y,h.width,h.height),this.#x=h.options,this.#F=h.value,this.setDisabled(h.disabled),this.#_={normal:{fg:q(h.colorFgNormal),bg:q(h.colorBgNormal)},focused:{fg:q(h.colorFgFocused),bg:q(h.colorBgFocused)},disabled:{fg:q(h.colorFgDisabled),bg:q(h.colorBgDisabled)},selected:{fg:q(h.colorFgSelected),bg:q(h.colorBgSelected)}},this.on("mousedown",(F)=>{let B=F.y-this.#h.y;if(B>=0&&B<this.#x.length)this.#B=B,this.#Q(this.#B)}),this.on("mouseover",(F)=>{let B=F.y-this.#h.y;if(B>=0&&B<this.#x.length)this.#B=B}),this.on("mousemove",(F)=>{let B=F.y-this.#h.y;if(B>=0&&B<this.#x.length)this.#B=B}),this.on("mouseout",()=>{this.#B=-1})}handleActiveKey(x){if(this.#x.length===0)return;if(x.key==="ArrowUp"){if(this.#$<=0)this.#$=this.#x.length-1;else this.#$--;return}if(x.key==="ArrowDown"){this.#$=(this.#$+1)%this.#x.length;return}if(x.key==="Home"){this.#$=0;return}if(x.key==="End"){this.#$=this.#x.length-1;return}if((x.key==="Enter"||x.key===" ")&&this.#$>=0)this.#Q(this.#$)}get value(){return this.#F}get selectedLabel(){if(this.#F<0||this.#F>=this.#x.length)return"";return this.#x[this.#F]??""}updateValue(x){this.#F=x}get options(){return this.#x}setOptions(x){if(this.#x=x,this.#F>=x.length)this.#F=-1;if(this.#B>=x.length)this.#B=Math.max(0,x.length-1);if(this.#$>=x.length)this.#$=Math.max(0,x.length-1)}get rect(){return this.#h}intrinsicSize(){return{width:this.#h.width,height:this.#h.height}}updateRect(x){Object.assign(this.#h,x)}updateThemeColors(x){_0(this.#_,x)}emitDrawCommands(x){let{x:h,y:F,width:B,height:$}=this.#h;if(B<=0||$<=0)return;x.pushClip(h,F,B,$);let N=x0(this.#_,{disabled:this.disabled});x.drawRect({x:h,y:F,width:B,height:$,bgRgba:N.bg});let _=Math.min(this.#x.length,$);for(let Z=0;Z<_;Z++){let Q=this.#x[Z],U=Z===this.#F,G=Z===this.#B,z=Z===this.#$,D=F+Z,A=U?"(\u25CF)":"( )",E=x0(this.#_,{disabled:this.disabled,selected:U,hovered:G,focused:z});if(E.bg!==0)x.drawRect({x:h,y:D,width:B,height:1,bgRgba:E.bg});let j=B-A.length-1,H=j>0?Q.slice(0,Math.max(0,j)):"",L=`${A} ${H}`;x.drawText({x:h,y:D,text:L,fgRgba:E.fg,bgRgba:0})}x.popClip()}#Q(x){this.#F=x,this.dispatch("change",{value:this.#F,label:this.#x[this.#F]??""})}}function ch(x){let h=new Hh({...uF(),...x});return w(h,kF,x??{},(F)=>{h.updateThemeColors(F)}),h}var dF={colorFgNormal:"textMuted",colorBgNormal:"surface",colorFgActive:"text",colorBgActive:"surfaceFocused",colorFgFocused:"accent",colorBgFocused:"surfaceHover",colorFgDisabled:"textMuted",colorBgDisabled:"surfaceDisabled",colorFgSeparator:"border"};function oF(){return{x:0,y:0,width:0,height:1,options:[],value:void 0,disabled:!1,...e(dF)}}class ih extends m{#h;#x;#F;#B=-1;#$;#_;constructor(x={}){super();let h={...oF(),...x};if(this.#h=this.initRect(h.x,h.y,h.width,h.height),this.#x=h.options,this.setDisabled(h.disabled),h.value===void 0)this.#F=this.#x.length>0?0:-1;else this.#F=this.#x.indexOf(h.value);this.#$={normal:{fg:q(h.colorFgNormal),bg:q(h.colorBgNormal)},active:{fg:q(h.colorFgActive),bg:q(h.colorBgActive)},focused:{fg:q(h.colorFgFocused),bg:q(h.colorBgFocused)},disabled:{fg:q(h.colorFgDisabled),bg:q(h.colorBgDisabled)}},this.#_=q(h.colorFgSeparator),this.on("mousedown",(F)=>{let B=this.#J(F.x);if(B>=0)this.#q(B)}),this.on("mousemove",(F)=>{this.#B=this.#J(F.x)}),this.on("mouseover",(F)=>{this.#B=this.#J(F.x)}),this.on("mouseout",()=>{this.#B=-1})}blur(){this.#B=-1,super.blur()}handleActiveKey(x){if(this.#x.length===0||this.#F<0)return;if(x.key==="ArrowLeft"){let h=(this.#F-1+this.#x.length)%this.#x.length;this.#q(h);return}if(x.key==="ArrowRight"){let h=(this.#F+1)%this.#x.length;this.#q(h);return}if(x.key==="Home"){this.#q(0);return}if(x.key==="End")this.#q(this.#x.length-1)}get value(){return this.#F>=0?this.#x[this.#F]:void 0}get activeLabel(){if(this.#F<0||this.#F>=this.#x.length)return"";return String(this.#x[this.#F])}updateValue(x){let h=this.#x.indexOf(x);if(h!==-1)this.#F=h}intrinsicSize(){if(this.#x.length===0)return{width:0,height:this.#h.height};let x=this.#U();if(x.length===0)return{width:0,height:this.#h.height};let h=x.at(-1);return{width:h.x+h.width-this.#h.x,height:this.#h.height}}get options(){return this.#x}setOptions(x){let h=this.#F>=0?this.#x[this.#F]:void 0;if(this.#x=x,h===void 0)this.#F=x.length>0?0:-1;else{let F=x.indexOf(h);this.#F=F===-1?x.length>0?0:-1:F}}get rect(){return{x:this.#h.x,y:this.#h.y,width:this.#Q(),height:this.#h.height}}updateRect(x){Object.assign(this.#h,x)}containsPoint(x,h){let F=this.#Q();return x>=this.#h.x&&x<this.#h.x+F&&h>=this.#h.y&&h<this.#h.y+this.#h.height}updateThemeColors(x){if(_0(this.#$,x),x.colorFgSeparator!==void 0)this.#_=q(x.colorFgSeparator)}emitDrawCommands(x){let{x:h,y:F,height:B}=this.#h,$=this.#Q();if($<=0||B<=0||this.#x.length===0)return;x.pushClip(h,F,$,B);let N=x0(this.#$,{disabled:this.disabled});x.drawRect({x:h,y:F,width:$,height:B,bgRgba:N.bg});let _=this.#U();for(let Z=0;Z<_.length;Z++){let{x:Q,width:U,label:G}=_[Z],z=Z===this.#F,D=Z===this.#B,A=x0(this.#$,{disabled:this.disabled,focused:z?this.focused:D,active:z&&!this.focused});if(A.bg!==N.bg)x.drawRect({x:Q,y:F,width:U,height:B,bgRgba:A.bg});let j=` ${G} `.slice(0,Math.max(0,U));if(x.drawText({x:Q,y:F,text:j,fgRgba:A.fg,bgRgba:0}),Z<_.length-1){let H=Q+U,L=this.disabled?N.fg:this.#_;x.drawText({x:H,y:F,text:"\u2502",fgRgba:L,bgRgba:0})}}x.popClip()}#Q(){if(this.#h.width>0)return this.#h.width;return this.intrinsicSize()?.width??0}#U(){let x=[],h=this.#h.x;for(let F of this.#x){let B=String(F),$=B.length+2;x.push({x:h,width:$,label:B}),h+=$+1}return x}#J(x){let h=this.#U();for(let[F,B]of h.entries()){let{x:$,width:N}=B;if(x>=$&&x<$+N)return F}return-1}#q(x){if(x===this.#F)return;this.#F=x,this.dispatch("change",{value:this.#x[this.#F],label:String(this.#x[this.#F])})}}function fh(x){let h=new ih({...oF(),...x});return w(h,dF,x??{},(F)=>{h.updateThemeColors(F)}),h}Fx();var mh,yF;function pF(x){mh=x}function Wh(){if(!mh)throw Error("App not initialized");return mh}function rF(x){yF=x}function vF(){return yF}var K=J1(h1(),1),i0=J1(h1(),1);import Ix from"process";import $0 from"fs";import Gx from"path";import n3 from"fs";function s4(x){let h=n3.readFileSync(x,"utf-8"),F=JSON.parse(h);if(typeof F==="object"&&F!==null&&"version"in F){let{version:B}=F;if(typeof B==="string")return B}return}function g4(...x){let h=[Gx.resolve(import.meta.dir,"..","..",...x),Gx.resolve(import.meta.dir,"..",...x)];for(let F of h)if($0.existsSync(F))return F;return h[0]}function A3(x){return g4("templates",x)}function t4(x,h,F){let B=$0.readdirSync(x,{withFileTypes:!0});for(let $ of B){let N=Gx.join(x,$.name),_=Gx.join(h,$.name);if($.isDirectory())$0.mkdirSync(_,{recursive:!0}),t4(N,_,F);else{let Q=$0.readFileSync(N,"utf-8");for(let[U,G]of Object.entries(F))Q=Q.replaceAll(`{{${U}}}`,G);$0.writeFileSync(_,Q,"utf-8")}}}function w4(x,h,F="basic"){let B=Gx.resolve(h,x);if($0.existsSync(B))throw Error(`Directory already exists: ${B}`);let $=A3(F);if(!$0.existsSync($))throw Error(`Template not found: ${F}`);$0.mkdirSync(B,{recursive:!0});let N=s4(g4("package.json")),_={name:x,version:N??"latest"};try{t4($,B,_)}catch(Z){throw $0.rmSync(B,{recursive:!0,force:!0}),Z}return B}function F1(x){if($0.existsSync(x))$0.rmSync(x,{recursive:!0,force:!0})}import C3 from"process";import Y3 from"fs";import X3 from"path";var E3=new Set(["con","prn","aux","nul","com1","com2","com3","com4","com5","com6","com7","com8","com9","lpt1","lpt2","lpt3","lpt4","lpt5","lpt6","lpt7","lpt8","lpt9"]),L3=/^(@[a-z\d][-a-z\d]*\/)?[a-z\d][-a-z\d_]*$/;function B1(x,h){let F=x.trim();if(!F)return"Project name is required";if(F.includes("..")||F.includes("/")||F.includes("\\"))return String.raw`Project name must not contain "..", "/", or "\"`;if(F.startsWith(".")||F.startsWith("-"))return"Project name must start with a letter or number";if(!L3.test(F))return"Project name must be a valid npm package name (lowercase, letters, digits, hyphens, underscores)";let $=F.split("/").at(-1)??F;if(C3.platform==="win32"&&E3.has($.toLowerCase()))return`"${$}" is a reserved name on Windows`;let N=X3.resolve(h,F);if(Y3.existsSync(N))return`Directory already exists: ${F}`;return}function P3(x,h){let F=h??x,B=["basic","sfc","full"],$=["A minimal starting point with Box, Text, Button, and a clock demo.","SFC compiler + HMR hot reload + dev server setup.","All core widgets showcase with tabbed navigation and theme support."],N=i0.ref("Template"),_=i0.ref(vF()??"my-buntui-app"),Z=i0.ref(0),Q=i0.ref(!0),U=i0.ref(!1),G=i0.computed(()=>$[Z.value]??"");function z(){let l=_.value.trim(),dx=B1(l,Ix.cwd());if(dx){M.logError(dx);return}N.value="Features"}function D(){N.value="Template"}async function A(){if(U.value)return;let l=_.value.trim();if(B1(l,Ix.cwd())){N.value="Template";return}let u4=B[Z.value]??"basic";U.value=!0;let T0="";try{if(T0=w4(l,Ix.cwd(),u4),Q.value)await Bun.spawn(["git","init"],{cwd:T0,stdout:"ignore",stderr:"ignore"}).exited;let Dx=await Bun.spawn(["bun","install"],{cwd:T0,stdout:"inherit",stderr:"inherit"}).exited;if(Dx!==0){F1(T0),M.logError(`bun install failed (exit code ${Dx})`),U.value=!1;return}setTimeout(()=>{Wh().dispose(),Ix.exit(0)},800)}catch(Kx){if(T0)F1(T0);let Dx=Kx instanceof Error?Kx.message:String(Kx);M.logError(Dx),U.value=!1}}function E(){Wh().dispose(),Ix.exit(0)}let j=z0({x:"25%",width:"50%",colorBorder:"rgb(122, 162, 247)",borderStyle:"rounded",colorShadow:"rgb(10, 10, 18)",y:1,height:24,paddingTop:1,paddingBottom:1,paddingLeft:2,paddingRight:2,shadowOffsetX:2,shadowOffsetY:1});K.effect(()=>{j.updateRect({y:1})}),K.effect(()=>{j.updateRect({height:24})}),K.effect(()=>{j.updatePadding({paddingTop:1})}),K.effect(()=>{j.updatePadding({paddingBottom:1})}),K.effect(()=>{j.updatePadding({paddingLeft:2})}),K.effect(()=>{j.updatePadding({paddingRight:2})}),K.effect(()=>{j.updateShadow({shadowOffsetX:2})}),K.effect(()=>{j.updateShadow({shadowOffsetY:1})});let H=P0({width:"100%",value:"Create Buntui App",colorFg:"rgb(122, 162, 247)",styleModifier:"bold",height:1});K.effect(()=>{H.updateRect({height:1})}),j.addChild(H);let L=fh({width:"100%",height:1,options:["Template","Features"],value:K.unref(N)});K.effect(()=>{L.updateRect({height:1})}),K.effect(()=>{L.setOptions(["Template","Features"])}),K.effect(()=>{L.updateValue(K.unref(N))}),L.on("change",(l)=>{N.value=l.value}),j.addChild(L);let i=P0({width:"100%",overflow:"clip",height:1,value:"\u2500".repeat(40)});K.effect(()=>{i.updateRect({height:1})}),K.effect(()=>{i.updateValue("\u2500".repeat(40))}),j.addChild(i);let C=null,c=null,n=null,P=null,u=null,R=null,j0=null,n0=null,p0=null;K.effect(()=>{if(K.unref(N)==="Template"){if(!C)C=z0({width:"100%",direction:"vertical",border:!1,gap:1}),c=Eh({width:"100%",placeholder:"my-buntui-app",label:"Project name",value:K.unref(_)}),n=P0({width:"100%",value:"Template:",height:1}),P=ch({width:"100%",height:3,options:["Basic","SFC","Full"],value:K.unref(Z)}),u=P0({width:"100%",overflow:"clip",height:1,value:K.unref(G)}),R=z0({width:"100%",direction:"horizontal",align:"center",height:3,border:!1,gap:2}),j0=W0({value:"Next \u2192",colorFgNormal:"rgb(26, 27, 38)",colorBgNormal:"rgb(122, 162, 247)",colorBorderNormal:"rgb(122, 162, 247)",borderStyleNormal:"rounded",colorFgFocused:"rgb(26, 27, 38)",colorBgFocused:"rgb(157, 122, 247)",colorBorderFocused:"rgb(157, 122, 247)",borderStyleFocused:"rounded",colorFgPressed:"rgb(26, 27, 38)",colorBgPressed:"rgb(91, 110, 181)",colorBorderPressed:"rgb(91, 110, 181)",borderStylePressed:"rounded",width:12,height:3}),n0=W0({value:"Cancel",borderStyleNormal:"rounded",borderStyleFocused:"rounded",borderStylePressed:"rounded",width:12,height:3}),p0=P0({width:"100%",value:"Tab/\u2191\u2193 navigate \xB7 Enter next \xB7 Esc cancel",height:1}),C.addChild(c),C.addChild(n),C.addChild(P),C.addChild(u),C.addChild(R),R.addChild(j0),R.addChild(n0),C.addChild(p0),c.on("input",(l)=>{_.value=l.value}),c.on("submit",z),P.on("change",(l)=>{Z.value=l.value}),j0.on("click",z),n0.on("click",E),j.addChild(C)}else if(C)j.removeChild(C),C=null,c=null,n=null,P=null,u=null,R=null,j0=null,n0=null,p0=null}),K.effect(()=>{if(C)C.updateBorder({border:!1})}),K.effect(()=>{if(C)C.setGap(1)}),K.effect(()=>{if(c)c.updateValue(K.unref(_))}),K.effect(()=>{if(n)n.updateRect({height:1})}),K.effect(()=>{if(P)P.updateRect({height:3})}),K.effect(()=>{if(P)P.setOptions(["Basic","SFC","Full"])}),K.effect(()=>{if(P)P.updateValue(K.unref(Z))}),K.effect(()=>{if(u)u.updateRect({height:1})}),K.effect(()=>{if(u)u.updateValue(K.unref(G))}),K.effect(()=>{if(R)R.updateRect({height:3})}),K.effect(()=>{if(R)R.updateBorder({border:!1})}),K.effect(()=>{if(R)R.setGap(2)}),K.effect(()=>{if(j0)j0.updateRect({width:12})}),K.effect(()=>{if(j0)j0.updateRect({height:3})}),K.effect(()=>{if(n0)n0.updateRect({width:12})}),K.effect(()=>{if(n0)n0.updateRect({height:3})}),K.effect(()=>{if(p0)p0.updateRect({height:1})});let g=null,A0=null,v=null,C0=null,Y0=null,X0=null,r0=null;return K.effect(()=>{if(K.unref(N)==="Features"){if(!g)g=z0({width:"100%",direction:"vertical",border:!1,gap:1,paddingTop:1}),A0=Mh({width:"100%",label:"Initialize git repository",height:1,checked:K.unref(Q)}),v=z0({width:"100%",direction:"horizontal",align:"center",height:3,border:!1,gap:2}),C0=W0({value:"\u2190 Back",borderStyleNormal:"rounded",borderStyleFocused:"rounded",borderStylePressed:"rounded",width:12,height:3}),Y0=W0({value:"Create",colorFgNormal:"rgb(26, 27, 38)",colorBgNormal:"rgb(122, 162, 247)",colorBorderNormal:"rgb(122, 162, 247)",borderStyleNormal:"rounded",colorFgFocused:"rgb(26, 27, 38)",colorBgFocused:"rgb(157, 122, 247)",colorBorderFocused:"rgb(157, 122, 247)",borderStyleFocused:"rounded",colorFgPressed:"rgb(26, 27, 38)",colorBgPressed:"rgb(91, 110, 181)",colorBorderPressed:"rgb(91, 110, 181)",borderStylePressed:"rounded",width:12,height:3}),X0=W0({value:"Cancel",borderStyleNormal:"rounded",borderStyleFocused:"rounded",borderStylePressed:"rounded",width:12,height:3}),r0=P0({width:"100%",value:"Tab navigate \xB7 Space toggle \xB7 Esc back",height:1}),g.addChild(A0),g.addChild(v),v.addChild(C0),v.addChild(Y0),v.addChild(X0),g.addChild(r0),A0.on("change",(l)=>{Q.value=l.checked}),C0.on("click",D),Y0.on("click",A),X0.on("click",E),j.addChild(g)}else if(g)j.removeChild(g),g=null,A0=null,v=null,C0=null,Y0=null,X0=null,r0=null}),K.effect(()=>{if(g)g.updateBorder({border:!1})}),K.effect(()=>{if(g)g.setGap(1)}),K.effect(()=>{if(g)g.updatePadding({paddingTop:1})}),K.effect(()=>{if(A0)A0.updateRect({height:1})}),K.effect(()=>{if(A0)A0.setChecked(K.unref(Q))}),K.effect(()=>{if(v)v.updateRect({height:3})}),K.effect(()=>{if(v)v.updateBorder({border:!1})}),K.effect(()=>{if(v)v.setGap(2)}),K.effect(()=>{if(C0)C0.updateRect({width:12})}),K.effect(()=>{if(C0)C0.updateRect({height:3})}),K.effect(()=>{if(Y0)Y0.updateRect({width:12})}),K.effect(()=>{if(Y0)Y0.updateRect({height:3})}),K.effect(()=>{if(X0)X0.updateRect({width:12})}),K.effect(()=>{if(X0)X0.updateRect({height:3})}),K.effect(()=>{if(r0)r0.updateRect({height:1})}),F.mount(j),()=>{F.unmount(j)}}var k4={setup:P3};var k_="App.vue";function M3(x){let F=$1.argv.slice(2)[0];$1.on("SIGINT",()=>{$1.exit(0)});let B=Yh({logLevel:"info",clearLog:!0,logFilePath:x?.logFilePath});return pF(B),rF(F),B.createScene(k4,{visible:!0}),B.start(),{app:B,scene:void 0}}if(import.meta.main)M3();export{M3 as run,k_ as ENTRY};
package/package.json CHANGED
@@ -1,29 +1,28 @@
1
1
  {
2
2
  "name": "create-buntui",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/AlphaFoxz/buntui.git",
7
7
  "directory": "packages/create-buntui"
8
8
  },
9
9
  "bin": {
10
- "create-buntui": "./dist/index.js"
10
+ "create-buntui": "./dist/main.js"
11
11
  },
12
12
  "files": [
13
13
  "dist/",
14
14
  "templates/"
15
15
  ],
16
16
  "scripts": {
17
- "build": "bun run ./scripts/build.ts",
18
- "dev": "bun --preload @buntui/compiler/vue-plugin ./src/index.ts"
17
+ "dev": "buntui dev",
18
+ "build": "buntui build"
19
19
  },
20
20
  "dependencies": {
21
- "@buntui/core": "^0.1.0-alpha.3"
21
+ "@buntui/cli": "^0.1.0-alpha.4",
22
+ "@buntui/core": "^0.1.0-alpha.4",
23
+ "@vue/reactivity": "^3.5.35"
22
24
  },
23
25
  "devDependencies": {
24
- "@buntui/compiler": "^0.1.0-alpha.3",
25
- "@buntui/native": "^0.1.0-alpha.3",
26
- "@vue/reactivity": "^3.5.34",
27
- "@types/bun": "^1.3.14"
26
+ "@types/bun": "1.3.14"
28
27
  }
29
28
  }
@@ -3,12 +3,12 @@
3
3
  "version": "0.0.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
- "dev": "bun --preload @buntui/compiler/vue-plugin src/dev.ts",
7
- "build": "bun run ./scripts/build.ts"
6
+ "dev": "buntui dev",
7
+ "build": "buntui build"
8
8
  },
9
9
  "dependencies": {
10
+ "@buntui/cli": "{{version}}",
10
11
  "@buntui/core": "{{version}}",
11
- "@buntui/compiler": "{{version}}",
12
12
  "@buntui/native": "{{version}}",
13
13
  "@vue/reactivity": "^3.5.34"
14
14
  },
@@ -0,0 +1,12 @@
1
+ import {runApp} from '../../shared/runApp.ts';
2
+ import App from './App.vue';
3
+
4
+ export const ENTRY = 'App.vue';
5
+
6
+ export function run(options?: {logFilePath?: string}) {
7
+ return runApp(App, options);
8
+ }
9
+
10
+ if (import.meta.main) {
11
+ run();
12
+ }
@@ -0,0 +1,14 @@
1
+ import {createApp, type TuiSFCModule} from '@buntui/core';
2
+
3
+ export function runApp(vueComponent: TuiSFCModule, options: {logFilePath?: string} = {}) {
4
+ const app = createApp({
5
+ logLevel: 'info',
6
+ clearLog: true,
7
+ tickRate: 120,
8
+ renderRate: 60,
9
+ ...options,
10
+ });
11
+ const scene = app.createScene(vueComponent, {bgHexRgb: 0x1A_1B_26, visible: true});
12
+ app.start();
13
+ return {app, scene};
14
+ }
@@ -24,16 +24,18 @@ The built output is in `dist/`.
24
24
 
25
25
  ```
26
26
  src/
27
- main.ts Production entry
28
- dev.ts Dev server with HMR
29
- App.vue Root SFC with tabbed widget demos
30
- components/
31
- BoxDemo.vue Box layout demos
32
- ButtonDemo.vue Button interaction demos
33
- InputDemo.vue Text input demos
34
- CheckboxDemo.vue Checkbox toggle demos
35
- SwitchDemo.vue Switch toggle demos
36
- ProgressDemo.vue Progress bar demos
37
- RadioDemo.vue Radio group selection demos
38
- TextDemo.vue Text display demos
27
+ apps/main/ App entry point
28
+ App.vue Root SFC with tabbed widget demos
29
+ main.ts Production & dev entry
30
+ components/
31
+ BoxDemo.vue Box layout demos
32
+ ButtonDemo.vue Button interaction demos
33
+ InputDemo.vue Text input demos
34
+ CheckboxDemo.vue Checkbox toggle demos
35
+ SwitchDemo.vue Switch toggle demos
36
+ ProgressDemo.vue Progress bar demos
37
+ RadioDemo.vue Radio group selection demos
38
+ TextDemo.vue Text display demos
39
+ shared/
40
+ runApp.ts App bootstrap helper
39
41
  ```
@@ -3,17 +3,17 @@
3
3
  "version": "0.0.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
- "dev": "bun --preload @buntui/compiler/vue-plugin src/dev.ts",
7
- "build": "bun run ./scripts/build.ts"
6
+ "dev": "buntui dev",
7
+ "build": "buntui build"
8
8
  },
9
9
  "dependencies": {
10
10
  "@buntui/core": "{{version}}",
11
- "@buntui/compiler": "{{version}}",
12
11
  "@buntui/native": "{{version}}",
13
12
  "@buntui/extensions": "{{version}}",
14
13
  "@vue/reactivity": "^3.5.34"
15
14
  },
16
15
  "devDependencies": {
16
+ "@buntui/cli": "{{version}}",
17
17
  "@types/bun": "latest",
18
18
  "vue": "^3.5.34",
19
19
  "vue-tsc": "^3.2.8"
@@ -6,7 +6,7 @@
6
6
  :y="4"
7
7
  :width="30"
8
8
  :height="6"
9
- borderColor="rgba(137,180,250,1)"
9
+ colorBorder="rgba(137,180,250,1)"
10
10
  borderStyle="rounded"
11
11
  direction="vertical"
12
12
  :gap="1"
@@ -22,7 +22,7 @@
22
22
  :y="4"
23
23
  :width="30"
24
24
  :height="6"
25
- borderColor="rgba(166,227,161,1)"
25
+ colorBorder="rgba(166,227,161,1)"
26
26
  borderStyle="double"
27
27
  direction="vertical"
28
28
  :gap="1"
@@ -38,7 +38,7 @@
38
38
  :y="11"
39
39
  :width="30"
40
40
  :height="3"
41
- borderColor="rgba(250,179,135,1)"
41
+ colorBorder="rgba(250,179,135,1)"
42
42
  borderStyle="solid"
43
43
  direction="horizontal"
44
44
  :gap="2"
@@ -53,7 +53,7 @@
53
53
  :y="11"
54
54
  :width="30"
55
55
  :height="3"
56
- borderColor="rgba(243,139,168,1)"
56
+ colorBorder="rgba(243,139,168,1)"
57
57
  borderStyle="dashed"
58
58
  direction="horizontal"
59
59
  :gap="2"
@@ -69,7 +69,7 @@
69
69
  :y="15"
70
70
  :width="20"
71
71
  :height="3"
72
- borderColor="rgba(203,166,245,1)"
72
+ colorBorder="rgba(203,166,245,1)"
73
73
  borderStyle="rounded"
74
74
  >
75
75
  <Text value="Drag me!" />
@@ -0,0 +1,12 @@
1
+ import {runApp} from '../../shared/runApp.ts';
2
+ import App from './App.vue';
3
+
4
+ export const ENTRY = 'App.vue';
5
+
6
+ export function run(options?: {logFilePath?: string}) {
7
+ return runApp(App, options);
8
+ }
9
+
10
+ if (import.meta.main) {
11
+ run();
12
+ }
@@ -0,0 +1,14 @@
1
+ import {createApp, type TuiSFCModule} from '@buntui/core';
2
+
3
+ export function runApp(vueComponent: TuiSFCModule, options: {logFilePath?: string} = {}) {
4
+ const app = createApp({
5
+ logLevel: 'info',
6
+ clearLog: true,
7
+ tickRate: 60,
8
+ renderRate: 24,
9
+ ...options,
10
+ });
11
+ const scene = app.createScene(vueComponent, {bgHexRgb: 0x1A_1B_26, visible: true});
12
+ app.start();
13
+ return {app, scene};
14
+ }
@@ -22,7 +22,9 @@ The built output is in `dist/`.
22
22
 
23
23
  ```
24
24
  src/
25
- main.ts Production entry
26
- dev.ts Dev server with HMR
27
- App.vue Root SFC component
25
+ apps/main/ App entry point
26
+ App.vue Root SFC component
27
+ main.ts Production & dev entry
28
+ shared/
29
+ runApp.ts App bootstrap helper
28
30
  ```
@@ -3,17 +3,17 @@
3
3
  "version": "0.0.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
- "dev": "bun --preload @buntui/compiler/vue-plugin src/dev.ts",
7
- "build": "bun run ./scripts/build.ts"
6
+ "dev": "buntui dev",
7
+ "build": "buntui build"
8
8
  },
9
9
  "dependencies": {
10
10
  "@buntui/core": "{{version}}",
11
- "@buntui/compiler": "{{version}}",
12
11
  "@buntui/native": "{{version}}",
13
12
  "@buntui/extensions": "{{version}}",
14
13
  "@vue/reactivity": "^3.5.34"
15
14
  },
16
15
  "devDependencies": {
16
+ "@buntui/cli": "{{version}}",
17
17
  "@types/bun": "latest",
18
18
  "vue": "^3.5.34",
19
19
  "vue-tsc": "^3.2.8"
@@ -0,0 +1,12 @@
1
+ import {runApp} from '../../shared/runApp.ts';
2
+ import App from './App.vue';
3
+
4
+ export const ENTRY = 'App.vue';
5
+
6
+ export function run(options?: {logFilePath?: string}) {
7
+ return runApp(App, options);
8
+ }
9
+
10
+ if (import.meta.main) {
11
+ run();
12
+ }
@@ -0,0 +1,14 @@
1
+ import {createApp, type TuiSFCModule} from '@buntui/core';
2
+
3
+ export function runApp(vueComponent: TuiSFCModule, options: {logFilePath?: string} = {}) {
4
+ const app = createApp({
5
+ logLevel: 'info',
6
+ clearLog: true,
7
+ tickRate: 60,
8
+ renderRate: 24,
9
+ ...options,
10
+ });
11
+ const scene = app.createScene(vueComponent, {bgHexRgb: 0x1A_1B_26, visible: true});
12
+ app.start();
13
+ return {app, scene};
14
+ }
package/dist/buntui.so DELETED
Binary file