sibujs 4.14.0 → 4.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +297 -45
- package/dist/browser.js +6 -7
- package/dist/build.cjs +2189 -573
- package/dist/build.js +16 -15
- package/dist/cdn.dev.global.js +13 -12
- package/dist/cdn.full.dev.global.js +14 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-RVR5NPFL.js → chunk-2VKTFA7C.js} +1 -1
- package/dist/{chunk-7ILEHTVX.js → chunk-4AEFGRYW.js} +1 -1
- package/dist/{chunk-4TQDTWWN.js → chunk-6IV5ZRG6.js} +5 -7
- package/dist/{chunk-GVAMIU6K.js → chunk-75EAQH3U.js} +2 -2
- package/dist/{chunk-TLS4NVIB.js → chunk-7JO7DPSS.js} +4 -4
- package/dist/{chunk-SVULV7O4.js → chunk-AQH7WDSE.js} +6 -8
- package/dist/{chunk-S37PZD6I.js → chunk-BF3WBJJQ.js} +60 -10
- package/dist/{chunk-LJMX4SQ7.js → chunk-BG4BP44S.js} +3 -3
- package/dist/{chunk-N7A6FKWW.js → chunk-D44TAGCT.js} +2 -2
- package/dist/{chunk-CCKUNHVU.js → chunk-DAEXQJQA.js} +1 -1
- package/dist/chunk-DNCQDFJJ.js +22 -0
- package/dist/{chunk-BKZ5N6NK.js → chunk-DNCT2UXB.js} +4 -4
- package/dist/{chunk-BOYKGGVD.js → chunk-DRWOD7RZ.js} +4 -4
- package/dist/chunk-DS5V2PRE.js +64 -0
- package/dist/{chunk-VM2U5LEL.js → chunk-EHSJESRN.js} +595 -123
- package/dist/{chunk-MIRKTVH4.js → chunk-GFM5WWPU.js} +252 -5
- package/dist/{chunk-52XFPGSN.js → chunk-HTPOIAAL.js} +1 -1
- package/dist/{chunk-3HEX6QJQ.js → chunk-I2R5QALY.js} +2 -4
- package/dist/{chunk-4FJSAUKB.js → chunk-IUBV5WO5.js} +1 -1
- package/dist/{chunk-A454RAEK.js → chunk-KIDETDMU.js} +5 -7
- package/dist/{chunk-JTFQ7IL4.js → chunk-KPAXG5IR.js} +7 -9
- package/dist/{chunk-AE32RGWX.js → chunk-LGUXYHTZ.js} +3 -3
- package/dist/{chunk-Y4LUM2XS.js → chunk-LQWLPQOK.js} +6 -8
- package/dist/{chunk-CNPT6NKV.js → chunk-MINLMJUY.js} +48 -9
- package/dist/{chunk-BNXRWZZV.js → chunk-OURTGOJT.js} +8 -10
- package/dist/{chunk-F67F77IA.js → chunk-TQ24Y3IV.js} +2 -2
- package/dist/{chunk-2TTRW2TE.js → chunk-UM3M5PXS.js} +8 -8
- package/dist/{chunk-CJ7KS3DF.js → chunk-VSTX3XSX.js} +205 -15
- package/dist/{chunk-HQIAL7F2.js → chunk-XPDZ2LDR.js} +2 -2
- package/dist/{chunk-UUIKJJIK.js → chunk-Y7JM7GY2.js} +5 -7
- package/dist/{chunk-QS6GMWDD.js → chunk-YAFITBOK.js} +1269 -162
- package/dist/data.cjs +285 -33
- package/dist/data.js +6 -7
- package/dist/devtools.cjs +289 -39
- package/dist/devtools.js +5 -6
- package/dist/{dispose-EIHHHDC7.js → dispose-3WDBYJMH.js} +3 -1
- package/dist/ecosystem.cjs +345 -61
- package/dist/ecosystem.d.cts +1 -1
- package/dist/ecosystem.d.ts +1 -1
- package/dist/ecosystem.js +10 -10
- package/dist/extras.cjs +568 -248
- package/dist/extras.d.cts +1 -1
- package/dist/extras.d.ts +1 -1
- package/dist/extras.js +27 -27
- package/dist/index.cjs +2134 -515
- package/dist/index.d.cts +628 -211
- package/dist/index.d.ts +628 -211
- package/dist/index.js +22 -15
- package/dist/motion.cjs +286 -30
- package/dist/motion.js +4 -4
- package/dist/patterns.cjs +301 -43
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +286 -36
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +1237 -291
- package/dist/plugins.d.cts +3 -1
- package/dist/plugins.d.ts +3 -1
- package/dist/plugins.js +20 -19
- package/dist/{renderRoute-fxgsm2Ir.d.ts → renderRoute-B84MONaO.d.cts} +2 -2
- package/dist/{renderRoute-DP20XwMS.d.cts → renderRoute-_yxPuEQY.d.ts} +2 -2
- package/dist/{routeHead-CE9SV-cH.d.cts → routeHead-DLxlq15W.d.cts} +94 -0
- package/dist/{routeHead-DzVxPviY.d.ts → routeHead-w8nANZ3M.d.ts} +94 -0
- package/dist/{ssr-NECEU4X4.js → ssr-EF3IUHTE.js} +6 -6
- package/dist/ssr-dom.cjs +64 -9
- package/dist/ssr-dom.d.cts +2 -0
- package/dist/ssr-dom.d.ts +2 -0
- package/dist/ssr-dom.js +2 -1
- package/dist/ssr.cjs +850 -170
- package/dist/ssr.d.cts +5 -3
- package/dist/ssr.d.ts +5 -3
- package/dist/ssr.js +16 -15
- package/dist/{tagFactory-DkytnJws.d.cts → tagFactory-BfEh69VF.d.cts} +7 -0
- package/dist/{tagFactory-Bnd_Nph9.d.ts → tagFactory-pSYiLYyh.d.ts} +7 -0
- package/dist/testing.cjs +817 -132
- package/dist/testing.d.cts +4 -2
- package/dist/testing.d.ts +4 -2
- package/dist/testing.js +18 -17
- package/dist/track-core-0edROAF5.d.ts +187 -0
- package/dist/track-core-DN5fYLWi.d.cts +187 -0
- package/dist/ui.cjs +293 -43
- package/dist/ui.js +10 -12
- package/dist/widgets.cjs +285 -27
- package/dist/widgets.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-7ZHH77QA.js +0 -9
package/dist/cdn.full.global.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var mi=Object.defineProperty;var Ut=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Gn=(e,t)=>{for(var n in t)mi(e,n,{get:t[n],enumerable:!0})};var qn={};Gn(qn,{ClientOnly:()=>Io,DynamicComponent:()=>Vu,ErrorBoundary:()=>Au,ErrorDisplay:()=>Hn,Fragment:()=>qu,KeepAlive:()=>Ju,Loading:()=>Ru,MAX_DRAIN_TEARDOWNS:()=>Se,Portal:()=>Zu,SVG_NS:()=>H,Suspense:()=>mo,__renderParsedTemplate:()=>Jo,__resetIdCounter:()=>jo,a:()=>ia,abbr:()=>sa,action:()=>Lu,address:()=>zs,area:()=>La,array:()=>Qu,article:()=>$s,aside:()=>Fs,asyncDerived:()=>tc,audio:()=>Ma,autoResize:()=>Po,b:()=>aa,base:()=>Cl,batch:()=>W,bdi:()=>la,bdo:()=>ua,bindDynamic:()=>Gr,blockquote:()=>Gs,body:()=>Ps,br:()=>ca,button:()=>pt,canvas:()=>Ua,caption:()=>Za,catchError:()=>Mu,catchErrorAsync:()=>Ou,center:()=>Gl,checkLeaks:()=>ur,circle:()=>Nl,cite:()=>da,clickOutside:()=>Lo,clipPath:()=>jl,code:()=>Tn,col:()=>Xa,colgroup:()=>Qa,context:()=>$u,copyOnClick:()=>Oo,createId:()=>Bo,customElement:()=>Xl,data:()=>fa,datalist:()=>al,dd:()=>Ys,deepEqual:()=>it,deepSignal:()=>nc,defer:()=>xc,defs:()=>Bl,del:()=>Ga,derived:()=>Je,details:()=>vl,dfn:()=>pa,dialog:()=>xl,disableSSR:()=>ao,dispose:()=>I,div:()=>P,dl:()=>Zs,dt:()=>Xs,each:()=>zu,effect:()=>te,ellipse:()=>Rl,em:()=>ma,embed:()=>$a,enableSSR:()=>so,enhance:()=>Bt,enhanceAll:()=>fc,enqueueBatchedSignal:()=>Ue,external:()=>yu,fieldset:()=>ll,figcaption:()=>Qs,figure:()=>ea,font:()=>Yl,footer:()=>Bs,form:()=>ul,g:()=>Ll,getAction:()=>Ro,getRequestScopedCache:()=>oo,getRuntimeErrorHandler:()=>Xn,getSSRStore:()=>Oe,getSlot:()=>Xu,h1:()=>Ws,h2:()=>qs,h3:()=>xn,h4:()=>Us,h5:()=>Ks,h6:()=>Js,head:()=>Os,header:()=>Is,hr:()=>ta,html:()=>Ko,i:()=>ga,iframe:()=>Ia,img:()=>Oa,input:()=>cl,ins:()=>Ya,isBatching:()=>hu,isClient:()=>io,isSSR:()=>ee,isServer:()=>mt,kbd:()=>ba,label:()=>dl,lazy:()=>po,lazyIsland:()=>mc,legend:()=>fl,li:()=>na,line:()=>Ml,linearGradient:()=>zl,link:()=>Al,longPress:()=>Mo,main:()=>Vs,map:()=>Pa,mark:()=>ha,marker:()=>Jl,marquee:()=>Zl,mask:()=>Vl,match:()=>Hu,math:()=>qa,menu:()=>wl,meta:()=>_l,meter:()=>pl,mount:()=>Gu,mountIslands:()=>yc,nav:()=>js,nextTick:()=>Ec,noscript:()=>Ka,object:()=>Ba,ol:()=>ra,on:()=>cu,onCleanup:()=>uu,onMount:()=>Pt,onUnmount:()=>lu,optgroup:()=>ml,option:()=>gl,output:()=>bl,p:()=>vn,param:()=>ja,path:()=>Ol,pattern:()=>Fl,picture:()=>Va,polygon:()=>Pl,polyline:()=>Dl,portal:()=>Fa,pre:()=>wn,progress:()=>hl,q:()=>ya,radialGradient:()=>Wl,reactiveArray:()=>ec,rect:()=>Hl,ref:()=>rc,registerAction:()=>ot,registerComponent:()=>Iu,registerDisposer:()=>C,registerIsland:()=>gc,replaceChildrenSafely:()=>ie,reportDrainRunaway:()=>Ae,reportError:()=>L,resolveComponent:()=>ju,retrack:()=>Le,rp:()=>Sa,rt:()=>va,ruby:()=>xa,runInSSRContext:()=>lo,s:()=>wa,samp:()=>Ta,script:()=>Ja,section:()=>Hs,select:()=>yl,setGlobalErrorHandler:()=>Pu,setMaxDrainIterations:()=>Ur,setRuntimeErrorHandler:()=>Zn,show:()=>Du,signal:()=>A,slot:()=>El,small:()=>Ea,source:()=>za,span:()=>z,stop:()=>ql,store:()=>oc,strict:()=>ac,strictEffect:()=>lc,strong:()=>ka,style:()=>Fe,sub:()=>Ca,summary:()=>Tl,sup:()=>Aa,svg:()=>Wa,symbol:()=>Kl,table:()=>el,tagFactory:()=>m,takePendingError:()=>Lt,tbody:()=>tl,td:()=>nl,template:()=>kl,text:()=>$l,textarea:()=>Sl,tfoot:()=>rl,th:()=>ol,thead:()=>il,time:()=>_a,title:()=>Ds,tr:()=>sl,track:()=>Da,transition:()=>Tc,trapFocus:()=>Do,trustHTML:()=>oi,tspan:()=>Il,u:()=>Na,ul:()=>oa,unregisterComponent:()=>Bu,unregisterDisposer:()=>ut,unregisterIsland:()=>bc,untracked:()=>pe,use:()=>Ul,var_:()=>Ra,video:()=>Ha,watch:()=>ic,when:()=>In,withSSR:()=>co,writable:()=>sc});var Yn=Symbol.for("sibujs.runtime-errors.v1");function Kt(){let e=globalThis,t=e[Yn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Yn]=n,n}function Zn(e){let t=Kt(),n=t.handler;return t.handler=e,n}function Xn(){return Kt().handler}function Jt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${gi(e)}`;return new Error(t,{cause:e})}function gi(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function bi(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var hi=Symbol.for("sibujs.reactive.v1");function yi(e){let t=globalThis[hi];return t?.untracked?t.untracked(e):e()}var Si="sibu:error-propagate";function vi(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=xi(n);if(!r)return!1;try{let o=new CustomEvent(Si,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function xi(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function wi(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${bi(t)}: ${e.message}`,e)}function Ti(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function L(e,t){let n=Jt(e);yi(()=>{if(vi(n,t))return;let r=Ti();if(r){r.push({error:n,context:t});return}let o=Kt(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}wi(n,t)})}function me(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var Ce=null;function Qn(){return Ce?.s.on===!0}function er(){return Ce?.s.on?Ce.s:null}function lt(e,t){let n=Ce;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function ge(){let e=Ce;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function tr(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function X(e,t){let n=Ce;if(!e&&!n)return t();Ce=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{Ce=n}}var nr,Gt=globalThis[nr=Symbol.for("sibujs.hydration.v2")]??(globalThis[nr]={a:new Set,c:null});function ye(){return Gt.a.size>0}function Ei(){return er()?.h??Gt.c}function Yt(){let e=Ei();return e?e.open?[e]:[]:Array.from(Gt.a)}function rr(e){let t=Yt(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function ki(e){for(let t of Array.from(e.wake))t()}function or(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&ki(n)}}var be=new WeakMap,Se=1e4;function Ae(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Pe=0;function yt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var oe=[];function ir(){return yt(oe[oe.length-1])}function sr(e){return e===null&&oe.length===0?!1:(oe.push(yt(e)),!0)}function ar(){oe.pop()}function C(e,t){let n=be.get(e);n||(n=[],be.set(e,n)),n.push(t),!1;let r=yt(oe[oe.length-1]);r&&r.entries.push([e,t])}function lr(e){let t={entries:[],closed:!1},n=t.entries;oe.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=Se){Ae("rollback",s,n.length);break}let[a,l]=n.pop();if(ut(a,l)){s++;try{l()}catch(u){L(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,oe.pop()}throw i}t.closed=!0,oe.pop();let o=yt(oe[oe.length-1]);if(o){for(let i of n)be.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function ut(e,t){let n=be.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&be.delete(e),!0)}function I(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)Ci(n[r])}function Ci(e){if(!be.has(e))return;let t=0,n=!1;for(;!n;){let r=be.get(e);if(!r||r.length===0)break;let o=r.slice();be.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=Se){let s=o.slice(i),a=be.get(e);be.set(e,a?s.concat(a):s),!1,Ae("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){L(s,{phase:"cleanup",name:"disposer"})}}}}function ie(e,...t){if(ye()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;I(o),e.removeChild(o),o=i}return}}for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)I(n[r]);e.replaceChildren(...t)}function ur(e=0){return 0}function Ge(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Ai=/[A-Z]/,_i=/[A-Z]/g;function se(e){return Ai.test(e)?e.replace(_i,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function _e(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var Ni=["http:","https:","mailto:","tel:","ftp:"],Ri=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function vt(e){let t=Ge(e).trim();if(!t)return"";let n=e.replace(Ri,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Ni.indexOf(i)===-1?"":n}var Li=/^\d+(\.\d+)?[wx]$/;function Zt(e){return e===" "||e===" "||e===`
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var Ws=Object.defineProperty;var Vn=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var po=(e,t)=>{for(var n in t)Ws(e,n,{get:t[n],enumerable:!0})};var ao={};po(ao,{ClientOnly:()=>ds,DynamicComponent:()=>Md,ErrorBoundary:()=>ld,ErrorDisplay:()=>Ur,Fragment:()=>Hd,KeepAlive:()=>Bd,Loading:()=>dd,MAX_DRAIN_TEARDOWNS:()=>Oe,Portal:()=>jd,SVG_NS:()=>J,Suspense:()=>Hi,__renderParsedTemplate:()=>xs,__resetIdCounter:()=>ps,a:()=>Vl,abbr:()=>jl,action:()=>fd,address:()=>Al,area:()=>gu,array:()=>Ud,article:()=>wl,aside:()=>Cl,asyncDerived:()=>Jd,audio:()=>hu,autoResize:()=>ns,b:()=>ql,base:()=>cc,batch:()=>ee,bdi:()=>Ul,bdo:()=>Kl,bindDynamic:()=>gi,blockquote:()=>Ol,body:()=>yl,br:()=>Jl,button:()=>qt,canvas:()=>Ru,caption:()=>Du,catchError:()=>pd,catchErrorAsync:()=>md,center:()=>Oc,checkLeaks:()=>Co,circle:()=>pc,cite:()=>Gl,clickOutside:()=>Qi,clipPath:()=>Ec,code:()=>Dr,col:()=>Hu,colgroup:()=>$u,context:()=>Nd,copyOnClick:()=>ts,createId:()=>fs,customElement:()=>Hc,data:()=>Yl,datalist:()=>qu,dd:()=>Pl,deepEqual:()=>Ht,deepSignal:()=>Gd,defer:()=>mf,defs:()=>Tc,del:()=>Ou,derived:()=>ht,details:()=>oc,dfn:()=>Xl,dialog:()=>ic,disableSSR:()=>Ti,dispose:()=>j,div:()=>U,dl:()=>Dl,dt:()=>Hl,each:()=>Pd,effect:()=>se,ellipse:()=>mc,em:()=>Zl,embed:()=>wu,enableSSR:()=>xi,enhance:()=>Ln,enhanceAll:()=>of,enqueueBatchedSignal:()=>pt,external:()=>Qc,fieldset:()=>Uu,figcaption:()=>$l,figure:()=>Il,font:()=>Pc,footer:()=>Tl,form:()=>Ku,g:()=>gc,getAction:()=>Zi,getRequestScopedCache:()=>Si,getRuntimeErrorHandler:()=>ho,getSSRStore:()=>Je,getSlot:()=>qd,h1:()=>Nl,h2:()=>_l,h3:()=>Or,h4:()=>Rl,h5:()=>Ll,h6:()=>Ml,head:()=>bl,header:()=>xl,hr:()=>Bl,html:()=>ws,i:()=>Ql,iframe:()=>xu,img:()=>bu,input:()=>Ju,ins:()=>Pu,isBatching:()=>Zc,isClient:()=>wi,isSSR:()=>le,isServer:()=>xe,kbd:()=>eu,label:()=>Gu,lazy:()=>Di,lazyIsland:()=>af,legend:()=>Yu,li:()=>zl,lifecycleScope:()=>Vd,line:()=>hc,linearGradient:()=>Ac,link:()=>dc,longPress:()=>es,main:()=>kl,map:()=>yu,mark:()=>tu,marker:()=>Mc,marquee:()=>Dc,mask:()=>kc,match:()=>Ad,math:()=>_u,menu:()=>sc,meta:()=>fc,meter:()=>Xu,mount:()=>zd,mountIslands:()=>df,nav:()=>El,nextTick:()=>bf,noscript:()=>Lu,object:()=>Tu,ol:()=>Fl,on:()=>qc,onCleanup:()=>jc,onMount:()=>Tn,onUnmount:()=>Vc,optgroup:()=>Zu,option:()=>Qu,output:()=>ec,p:()=>Mr,param:()=>Eu,path:()=>bc,pattern:()=>Cc,pendingContent:()=>As,picture:()=>ku,polygon:()=>yc,polyline:()=>vc,portal:()=>Cu,pre:()=>Pr,progress:()=>tc,q:()=>nu,radialGradient:()=>Nc,reactiveArray:()=>Kd,rect:()=>Sc,ref:()=>Yd,registerAction:()=>Ot,registerComponent:()=>_d,registerDisposer:()=>D,registerIsland:()=>lf,replaceChildrenSafely:()=>Pe,reportDrainRunaway:()=>We,reportError:()=>H,resolveComponent:()=>Ld,retrack:()=>Ue,rp:()=>ru,rt:()=>ou,ruby:()=>iu,runInSSRContext:()=>Ei,s:()=>su,samp:()=>au,scopeOwner:()=>ro,script:()=>Mu,section:()=>Sl,select:()=>nc,setGlobalErrorHandler:()=>gd,setMaxDrainIterations:()=>fi,setRuntimeErrorHandler:()=>go,show:()=>Sd,signal:()=>I,slot:()=>lc,small:()=>lu,source:()=>Au,span:()=>Q,stop:()=>_c,store:()=>Xd,strict:()=>Qd,strictEffect:()=>ef,strong:()=>uu,style:()=>dt,sub:()=>cu,summary:()=>ac,sup:()=>du,svg:()=>Nu,symbol:()=>Lc,table:()=>Iu,tagFactory:()=>h,takePendingError:()=>Sn,tbody:()=>Bu,td:()=>zu,template:()=>uc,text:()=>wc,textarea:()=>rc,tfoot:()=>Fu,th:()=>Wu,thead:()=>Vu,time:()=>fu,title:()=>vl,tr:()=>ju,track:()=>vu,transition:()=>hf,trapFocus:()=>rs,trustHTML:()=>Hs,tspan:()=>xc,u:()=>pu,ul:()=>Wl,unregisterComponent:()=>Rd,unregisterDisposer:()=>Xe,unregisterIsland:()=>uf,untracked:()=>Re,use:()=>Rc,var_:()=>mu,video:()=>Su,watch:()=>no,when:()=>Xr,withSSR:()=>Ci,writable:()=>Zd});var mo=Symbol.for("sibujs.runtime-errors.v1");function jn(){let e=globalThis,t=e[mo];if(t)return t;let n={handler:null,handlerDepth:0};return e[mo]=n,n}function go(e){let t=jn(),n=t.handler;return t.handler=e,n}function ho(){return jn().handler}function qn(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Vs(e)}`;return new Error(t,{cause:e})}function Vs(e){if(typeof e=="symbol")return e.toString();try{return typeof e=="object"&&e!==null?JSON.stringify(e):String(e)}catch{return Object.prototype.toString.call(e)}}function js(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var qs=Symbol.for("sibujs.reactive.v1");function Us(e){let t=globalThis[qs];return t?.untracked?t.untracked(e):e()}var Ks="sibu:error-propagate";function Js(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Gs(n);if(!r)return!1;try{let o=new CustomEvent(Ks,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Gs(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Ys(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${js(t)}: ${e.message}`,e)}function Xs(){let e=globalThis[Symbol.for("sibujs.ssr.v1")];return e?(e.als?e.als.getStore():e.fallbackDepth>0?e.fallbackStore:void 0)?.errors:void 0}function H(e,t){let n=qn(e);Us(()=>{if(Js(n,t))return;let r=Xs();if(r){r.push({error:n,context:t});return}let o=jn(),i=o.handler;if(i&&o.handlerDepth===0){o.handlerDepth++;try{i(e instanceof Error?e:n,t);return}catch(s){if(typeof console<"u"){let a=s instanceof Error?s.message:String(s);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,s)}}finally{o.handlerDepth--}}Ys(n,t)})}function he(e,t){let n=globalThis;return n[e]??(n[e]=t())}function Ee(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var Fe=null;function bo(){return Fe?.s.on===!0}function yo(){return Fe?.s.on?Fe.s:null}function It(e,t){let n=Fe;if(n?.s.on){let r=n.s.el(e,t,n.p+(n.n++).toString(36));if(r)return r}return t?document.createElementNS(t,e):document.createElement(e)}function Me(){let e=Fe;return e?.s.on?{p:`${e.p}${(e.n++).toString(36)}.`,n:0,s:e.s}:null}function vo(e,t){if(!e?.s.on)return null;let n=typeof t;if(n!=="string"&&n!=="number")throw new TypeError(`[SibuJS] adopt: a key must be a string or a number, not ${n}`);let r=String(t).replace(/[^\w-]/g,o=>`~${o.charCodeAt(0).toString(16).padStart(4,"0")}`);return{p:`${e.p}${n==="string"?"_":"-"}${r}.`,n:0,s:e.s}}function ce(e,t){let n=Fe;if(!e&&!n)return t();Fe=e?.s.on?{p:e.p,n:0,s:e.s}:null;try{return t()}finally{Fe=n}}var So,Un=globalThis[So=Symbol.for("sibujs.hydration.v2")]??(globalThis[So]={a:new Set,c:null});function ke(){return Un.a.size>0}function Zs(){return yo()?.h??Un.c}function Kn(){let e=Zs();return e?e.open?[e]:[]:Array.from(Un.a)}function wo(e){let t=Kn(),n=t.length,r=()=>{--n<1&&e()};if(n)for(let o of t)o.done.push(r);else e()}function Qs(e){for(let t of Array.from(e.wake))t()}function xo(e,t){for(let n of e)n.pending.add(t);return()=>{for(let n of e)n.pending.delete(t)&&Qs(n)}}var Jn=he(Symbol.for("sibujs.disposers.v1"),()=>({disposers:new WeakMap,captures:[],bindings:{count:0}})),Ce=Jn.disposers,Oe=1e4;function We(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Ye=Jn.bindings;function Yt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var de=Jn.captures;function To(){return Yt(de[de.length-1])}function Eo(e){return e===null&&de.length===0?!1:(de.push(Yt(e)),!0)}function ko(){de.pop()}function D(e,t){let n=Ce.get(e);n||(n=[],Ce.set(e,n)),n.push(t),!1;let r=Yt(de[de.length-1]);r&&r.entries.push([e,t])}function yt(e){let t={entries:[],closed:!1},n=t.entries;de.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=Oe){We("rollback",s,n.length);break}let[a,l]=n.pop();if(Xe(a,l)){s++;try{l()}catch(u){H(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,de.pop()}throw i}t.closed=!0,de.pop();let o=Yt(de[de.length-1]);if(o){for(let i of n)Ce.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Xe(e,t){let n=Ce.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&Ce.delete(e),!0)}function j(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)Gn(n[r])}function Gn(e){if(!Ce.has(e))return;let t=0,n=!1;for(;!n;){let r=Ce.get(e);if(!r||r.length===0)break;let o=r.slice();Ce.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=Oe){let s=o.slice(i),a=Ce.get(e);Ce.set(e,a?s.concat(a):s),!1,We("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){H(s,{phase:"cleanup",name:"disposer"})}}}}function Pe(e,...t){if(ke()&&t.length>0&&t[0]===e.firstChild){let r=!0;for(let o=1;o<t.length&&r;o++)r=t[o-1].nextSibling===t[o];if(r){let o=t[t.length-1].nextSibling;for(;o;){let i=o.nextSibling;j(o),e.removeChild(o),o=i}return}}for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)j(n[r]);e.replaceChildren(...t)}function Yn(e,t){let n=new Set,r=()=>{if(!ke()||t.length===0||t[0]!==e.firstChild)return!1;for(let i=1;i<t.length;i++)if(t[i-1].nextSibling!==t[i])return!1;return!0},o=()=>{if(r()){let i=[];for(let s=t[t.length-1].nextSibling;s!==null;s=s.nextSibling)i.push(s);return i}for(let i=0;i<t.length;i++)t[i].parentNode?.removeChild(t[i]);return Array.from(e.childNodes)};return{teardown:()=>{let i=!1;for(let s of o())n.has(s)||(n.add(s),i=!0,j(s));return i},insert:()=>{if(!r()){e.replaceChildren(...t);return}let i=t[t.length-1];for(;i.nextSibling;)e.removeChild(i.nextSibling)}}}function Co(e=0){return 0}function vt(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var ea=/[A-Z]/,ta=/[A-Z]/g;function fe(e){return ea.test(e)?e.replace(ta,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function Ve(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var na=["http:","https:","mailto:","tel:","ftp:"],ra=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function Zt(e){let t=vt(e).trim();if(!t)return"";let n=e.replace(ra,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&na.indexOf(i)===-1?"":n}var oa=/^\d+(\.\d+)?[wx]$/;function Xn(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function ia(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Xn(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Xn(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",d=!1;for(;r<o;){let g=t[r];if(d){u+=g,g===")"&&(d=!1),r++;continue}if(Xn(g)){u&&a.push(u),u="",r++;continue}if(g===","){r++;break}g==="("&&(d=!0),u+=g,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!oa.test(a[0]))continue;let l=Zt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var sa=/[(:@\\]/;function aa(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function Ao(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function la(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
|
|
4
4
|
`||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
|
|
5
|
-
`?2:1;continue}if(
|
|
6
|
-
`?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var
|
|
7
|
-
`||e==="\r"||e==="\f"}function Tt(e){let t=0,n=e.length;for(;t<n&&De(e[t]);)t++;for(;n>t&&De(e[n-1]);)n--;return e.slice(t,n)}var ae=e=>({kind:"forbidden",reason:e});function qi(e){let t=Tt(Ge(e));if(t==="")return ae("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ae("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ae("");for(;n<t.length&&De(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ae("");for(n++;n<t.length&&De(t[n]);)n++;let o=n;for(;n<t.length&&!De(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ae("");for(;n<t.length&&De(t[n]);)n++;if(t[n]!=="=")return ae("");for(n++;n<t.length&&De(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ae("");if(s=t.slice(n+1,u),Tt(t.slice(u+1))!=="")return ae("")}else if(s=Tt(t.slice(n)),/[;,]/.test(s))return ae("");if(s==="")return ae("");let l=vt(s);return l===""?ae(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function nn(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=se(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ae(""):typeof t!="string"?{kind:"not-refresh"}:Tt(Ge(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:qi(n)}var Ui="http://www.w3.org/1999/xhtml",Ki="http://www.w3.org/2000/svg",Ji=new Set(["script","iframe","object","embed","frame","frameset"]);function yr(e){return se(e)}function Sr(e){return Ji.has(yr(e))}var Gi=new Set(["script","style"]);function vr(e){return Gi.has(yr(e))}var B={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Yi=new Set(["src","href","xlink:href","type","language"]),Zi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),rn=new WeakSet;function xr(e){return e.namespaceURI===Ui||e.namespaceURI===null}function wr(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function Xi(e){rn.has(e)||(rn.add(e),e.getAttribute("content")!==null&&nn(wr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Qi(e,t,n,r){if(!xr(e))return B.None;let o=se(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Xi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return B.None;let i=nn(wr(e,o,n));return i.kind==="forbidden"?B.MetaRefreshForbidden:i.kind!=="not-refresh"&&rn.has(e)?B.MetaRefreshReactive:B.None}function es(e,t){if(t===null||se(e)!=="attributename")return B.None;let n=Ge(t);return gr(n)||_e(n)||ct(n)?B.AnimationTarget:B.None}var Et=new WeakSet;function hr(e){if(e===null)return!1;let t=se(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function ts(e,t,n,r){if(!xr(e))return B.None;let o=se(t);return o==="href"?r==="static"||n===null?B.None:hr(e.getAttribute("rel"))?B.StylesheetSource:(Et.add(e),B.None):o==="rel"&&hr(n)&&Et.has(e)&&e.hasAttribute("href")?B.StylesheetSource:B.None}function on(e,t,n,r){let o=e.localName;return o==="meta"?Qi(e,t,n,r):o==="link"?ts(e,t,n,r):o==="script"?r==="static"||n===null?B.None:Yi.has(se(t))?B.ScriptSource:B.None:Zi.has(o)&&e.namespaceURI===Ki?es(t,n):B.None}function sn(e,t,n){e.localName!=="link"||se(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?Et.add(e):Et.delete(e))}var ns="http://www.w3.org/1999/xhtml",rs="http://www.w3.org/2000/svg",os="http://www.w3.org/1999/xlink",is="http://www.w3.org/XML/1998/namespace",ss=new Set(["checked","disabled","selected"]);function as(e){return e.namespaceURI===null||e.namespaceURI===ns}function Er(e,t,n){}function Tr(e,t,n){e[t]=n}function ls(e,t){if(e.namespaceURI!==rs)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?os:n.startsWith("xml:")?is:null}function de(e,t,n,r={}){let o=us(e,t,n,r);return e.localName==="link"&&sn(e,t,r.reactive?"reactive":"runtime"),o}function us(e,t,n,r){let o=ls(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(_e(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=on(e,t,s,r.reactive?"reactive":"runtime");if(a!==B.None)return Er(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(ct(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=as(e),u=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let b=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==b&&(o?e.setAttributeNS(o,t,b):e.setAttribute(t,b)),!0}return l&&ss.has(u)&&u in e?Tr(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&l&&(u==="value"||u==="checked")&&u in e)return Tr(e,u,u==="checked"?!!n:d),!0;let p=d===""?"":br(t,d,{element:e});return p===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===p||(o?e.setAttributeNS(o,t,p):e.setAttribute(t,p)),!0)}function an(e,t,n){if(ct(t))return!1,!1;let r=on(e,t,n,"static");return r!==B.None?(Er("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&sn(e,t,"static"),!0)}var cs=4096,ln=[];function ds(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function fs(e,t,n){let r=ln.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=ds();return o.sig=e,o.sub=t,o.epoch=n,o}function kr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,ln.length<cs&&ln.push(e)}function ps(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function Cr(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function ms(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function gs(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var fe=null,ve=null,Ne=0,Re=[],Y=new Set,bs=[];function hs(e){try{e()}catch(t){let n=e;L(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function ys(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var he=0,xe=!1;function cn(){he===0&&(ve=fe,fe=null,xe=!0),he++}function dn(){he--,he===0&&(fe=ve,ve=null,xe=!1)}function Ar(){return xe}function _r(e){cn();try{return e()}finally{dn()}}var le=null;function fn(){return le}function _t(e,t){let n=le;le=e;try{return t()}finally{le=n}}function pn(e){let t=le;return t===null?e:(...n)=>_t(t,()=>e(...n))}var Ye=null,Ss=0;function mn(e,t){let n=fe,r=0,o=null;xe&&(r=he,o=ve,he=0,ve=null,xe=!1),fe=t;let i=t;i._cap===void 0&&(i._cap=ir());let s=le;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(le=a);let l=Ye;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(Ye=i._tok);let u=++Ss;i._epoch=u,i._structDirty=!1;for(let d=i.depsHead??null;d!==null;d=d.subNext){let p=d.sig;d.prevActive=p.__activeNode??null,p.__activeNode=d}try{e()}finally{fe=n,le=s,Ye=l,r!==0&&(he=r,ve=o,xe=!0);let d=i.depsHead??null;for(;d!==null;){let p=d.subNext,g=d.sig;g.__activeNode=d.prevActive,d.prevActive=null,d.epoch!==u&&(gs(d),Cr(d),kr(d)),d=p}}}function Nr(e,t){if(!t)return gn(e);Ze(t);let n=fe,r=0,o=null;xe&&(r=he,o=ve,he=0,ve=null,xe=!1),fe=t;let i=t;i._scope===void 0&&(i._scope=le);let s=le;le=i._scope;try{e()}finally{fe=n,le=s,r!==0&&(he=r,ve=o,xe=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Ze(t))}function gn(e,t,n){return Lr(e,t,n===!0)._dispose}function Rr(e,t){let n=Lr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Ye;Ye=n._tok??null;try{return r()}finally{Ye=o}}}}function Lr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{mn(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ze(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ze(o)},o}function Mr(e){if(!fe)return;let t=fe,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=fs(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,ms(t,i),ps(n,i),t._structDirty=!0}function Ze(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Cr(n),kr(n),n=r}}var kt=1e3,Ct=1e6,At=0,He=new Set;function Or(e){let t=kt;return Number.isFinite(e)&&e>0&&(kt=Math.floor(e)),t}function Pr(e){let t=Ct;return Number.isFinite(e)&&e>0&&(Ct=Math.floor(e)),t}function vs(e){let t=e;return t._runEpoch!==At?(t._runEpoch=At,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>kt)}function xs(e){let t=e.__name??"<unnamed>";L(new Error(`subscriber "${t}" fired more than ${kt} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:t})}function ws(){L(new Error(`Notification drain exceeded ${Ct} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Dr(){let e=0;for(;e<Re.length;){if(e>=Ct){ws();break}let t=Re[e++];Y.delete(t)&&(t._owner!=null&&Y.size>0&&(Ts(t),Y.has(t))||Hr(t))}}function Ts(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;Y.has(r)&&(t=r),n=r._owner??null}if(t===null)return;Y.delete(t),Hr(t)}}function Hr(e){if(He.size>0&&He.has(e)||e._hasComputedDep===!0&&!ys(e))return;if(vs(e)){xs(e),He.add(e);return}let t=sr(e._cap??null);try{hs(e)}finally{t&&ar()}}function $r(){if(!(Ne>0)){Ne++,At++;try{Dr()}finally{Ne--,Ne===0&&(Re.length=0,Y.clear(),He.size>0&&He.clear())}}}function un(e){e();let t=e._sig;if(!t)return;let n=bs,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else Y.has(s)||(Y.add(s),Re.push(s));i=i.sigNext}}}function Ir(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?un(r):Y.has(r)||(Y.add(r),Re.push(r))),n=n.sigNext}}function Br(e){let n=e.subsHead;if(n){if(Ne>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?un(o):Y.has(o)||(Y.add(o),Re.push(o))),r=r.sigNext}return}Ne++,At++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?un(o):Y.has(o)||(Y.add(o),Re.push(o))),r=r.sigNext}Dr()}finally{Ne--,Ne===0&&(Re.length=0,Y.clear(),He.size>0&&He.clear())}}}function jr(e){return e.__sc??0}function Vr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Fr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var zr="4.14.0",Wr=Symbol.for("sibujs.reactive.v1");function ks(){let e=globalThis,t=e[Wr];if(t)return!1,t;let n={suspendTracking:cn,resumeTracking:dn,isTrackingSuspended:Ar,untracked:_r,retrack:mn,track:Nr,reactiveBinding:gn,recordDependency:Mr,cleanup:Ze,setMaxSubscriberRepeats:Or,setMaxDrainIterations:Pr,drainNotificationQueue:$r,queueSignalNotification:Ir,notifySubscribers:Br,getSubscriberCount:jr,getSubscriberDeps:Vr,forEachSubscriber:Fr,getOwnerScope:fn,runWithOwnerScope:_t,bindOwnerScope:pn,structuralBinding:Rr,version:zr};return e[Wr]=n,n}var V=ks(),$e=V.suspendTracking,Ie=V.resumeTracking,qr=V.isTrackingSuspended,pe=V.untracked,Le=V.retrack,Xe=V.track,K=V.reactiveBinding,Be=V.recordDependency,je=V.cleanup,dd=V.setMaxSubscriberRepeats,Ur=V.setMaxDrainIterations,Kr=V.drainNotificationQueue,Jr=V.queueSignalNotification,Qe=V.notifySubscribers,fd=V.getSubscriberCount,pd=V.getSubscriberDeps,md=V.forEachSubscriber,et=V.getOwnerScope??fn,Nt=V.runWithOwnerScope??_t,Q=V.bindOwnerScope??pn,Ve=V.structuralBinding??((e,t)=>({stop:V.reactiveBinding(e,t),run:n=>n()}));function dt(e,t,n){if(_e(t))return de(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){L(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}de(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return K(r,e)}function Gr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){L(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){L(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),de(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=K(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var bn=["data-focus-key","id","name"],Cs=new Set(["text","search","url","tel","password",""]);function As(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Cs.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function ft(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<bn.length;i++){let s=t.getAttribute(bn[i]);if(s){r=bn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...As(t)}}function _s(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ns(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Yr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function tt(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Yr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Ns(t,`[${e.attr}=${_s(e.value)}]`);if(s&&s.tagName===e.tag){Yr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}}function we(e,t){let n=[],r=ge();function o(){let i;try{i=X(r,t)}catch(p){L(p,{phase:"binding",name:"bindChildNode",node:e});return}let s=ft(n);if(i==null||typeof i=="boolean"){for(let p=0;p<n.length;p++){let g=n[p];I(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,tt(s,n,"bindChildNode");return}let a=e.parentNode;if(!a){n.length=0;return}let l;if(Array.isArray(i)){l=[];let p=new Set;for(let g=0;g<i.length;g++){let b=i[g];if(b==null||typeof b=="boolean")continue;let c=b instanceof Node?b:document.createTextNode(String(b));if(p.has(c)){!1;continue}p.add(c),l.push(c)}}else l=[i instanceof Node?i:document.createTextNode(String(i))];let u;if(n.length>0&&l.length>0){let p=new Set(n);u=new Set;for(let g=0;g<l.length;g++)p.has(l[g])&&u.add(l[g])}for(let p=0;p<n.length;p++){let g=n[p];u?.has(g)||(I(g),g.parentNode&&g.parentNode.removeChild(g))}let d=e;for(let p=0;p<l.length;p++){let g=l[p];d.nextSibling!==g&&a.insertBefore(g,d.nextSibling),d=g}n=l,tt(s,l,"bindChildNode")}return K(o,e,!0)}function hn(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function re(){typeof document>"u"&&hn()}var H="http://www.w3.org/2000/svg",Rs=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var yn=new Set,Zr=100,Xr=!1,Qr=new Map;function eo(e){let t=Qr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Qr.set(e,t)),t}function Ls(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=K(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",wt(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let p=a[d];if(p==null)continue;let g=eo(d);u.push(g),l.setProperty(g,xt(g,String(p),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=u},e);C(e,s);return}if(typeof t=="string"){e.setAttribute("style",wt(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=eo(r);if(typeof o=="function"){let s=o,a=K(()=>{n.style.setProperty(i,xt(i,String(s()),{element:e}))},e);C(e,a)}else n.style.setProperty(i,xt(i,String(o),{element:e}))}}function Ms(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=K(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);C(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=K(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let u=n[l];(typeof u=="function"?u():u)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);C(e,s)}else e.setAttribute("class",o)}function Sn(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),C(e,we(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),C(e,we(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),C(e,we(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function m(e,t){let n=Sr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&hn();let i=lt(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Sn(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Sn(i,r),i;let s=r,a=s.class;a!=null&&Ms(i,a);let l=s.id;typeof l=="function"?C(i,dt(i,"id",l)):l!=null&&(!1,i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Sn(i,u);let d=s.on;if(d)for(let b in d){if(!Object.hasOwn(d,b))continue;let c=d[b];typeof c=="function"?i.addEventListener(b,c):!1}let p=s.style;p!=null&&Ls(i,p);let g=s.ref;g&&(g.current=i);for(let b in s)switch(b){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,b))continue;let c=s[b];if(c==null||_e(b))continue;typeof c=="function"?C(i,dt(i,b,c)):de(i,b,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var jd=m("html"),Os=m("head"),Ps=m("body"),Ds=m("title"),P=m("div"),z=m("span"),Hs=m("section"),$s=m("article"),Is=m("header"),Bs=m("footer"),js=m("nav"),Vs=m("main"),Fs=m("aside"),zs=m("address"),vn=m("p"),Ws=m("h1"),qs=m("h2"),xn=m("h3"),Us=m("h4"),Ks=m("h5"),Js=m("h6"),Gs=m("blockquote"),Ys=m("dd"),Zs=m("dl"),Xs=m("dt"),Qs=m("figcaption"),ea=m("figure"),ta=m("hr"),na=m("li"),ra=m("ol"),oa=m("ul"),wn=m("pre"),ia=m("a"),sa=m("abbr"),aa=m("b"),la=m("bdi"),ua=m("bdo"),ca=m("br"),da=m("cite"),Tn=m("code"),fa=m("data"),pa=m("dfn"),ma=m("em"),ga=m("i"),ba=m("kbd"),ha=m("mark"),ya=m("q"),Sa=m("rp"),va=m("rt"),xa=m("ruby"),wa=m("s"),Ta=m("samp"),Ea=m("small"),ka=m("strong"),Ca=m("sub"),Aa=m("sup"),_a=m("time"),Na=m("u"),Ra=m("var"),La=m("area"),Ma=m("audio"),Oa=m("img"),Pa=m("map"),Da=m("track"),Ha=m("video"),$a=m("embed"),Ia=m("iframe"),Ba=m("object"),ja=m("param"),Va=m("picture"),Fa=m("portal"),za=m("source"),Wa=m("svg",H),qa=m("math"),Ua=m("canvas"),Ka=m("noscript"),Ja=m("script"),Ga=m("del"),Ya=m("ins"),Za=m("caption"),Xa=m("col"),Qa=m("colgroup"),el=m("table"),tl=m("tbody"),nl=m("td"),rl=m("tfoot"),ol=m("th"),il=m("thead"),sl=m("tr"),pt=m("button"),al=m("datalist"),ll=m("fieldset"),ul=m("form"),cl=m("input"),dl=m("label"),fl=m("legend"),pl=m("meter"),ml=m("optgroup"),gl=m("option"),bl=m("output"),hl=m("progress"),yl=m("select"),Sl=m("textarea"),vl=m("details"),xl=m("dialog"),wl=m("menu"),Tl=m("summary"),El=m("slot"),kl=m("template"),Cl=m("base"),Al=m("link"),_l=m("meta"),Fe=m("style"),Nl=m("circle",H),Rl=m("ellipse",H),Ll=m("g",H),Ml=m("line",H),Ol=m("path",H),Pl=m("polygon",H),Dl=m("polyline",H),Hl=m("rect",H),$l=m("text",H),Il=m("tspan",H),Bl=m("defs",H),jl=m("clipPath",H),Vl=m("mask",H),Fl=m("pattern",H),zl=m("linearGradient",H),Wl=m("radialGradient",H),ql=m("stop",H),Ul=m("use",H),Kl=m("symbol",H),Jl=m("marker",H),Gl=m("center"),Yl=m("font"),Zl=m("marquee"),Xl=e=>m(e);var to,En=globalThis[to=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[to]={hook:null,current:null});function no(e){return En.hook?En.hook(e):null}function Rt(){return En.current}var kn=Symbol.for("sibujs.ssr.v1");function Ql(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof Ut=="function"&&(n=Ut("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Me=globalThis[kn]??(globalThis[kn]=Ql()),We=Me.als,ze=Me.fallbackStore;Me.fallbackDepth??(Me.fallbackDepth=0);var ro=!1;function eu(){if(ro||We||!(typeof process<"u"&&!!process.versions?.node))return;ro=!0;let t=process.versions.node;`${t}`}function Oe(){if(We){let e=We.getStore();if(e)return e}return ze}function Cn(){return We?We.getStore()??null:Me.fallbackDepth>0?ze:null}function ee(){return Oe().ssr}function oo(e){if(!ee())return null;let t=Oe(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var tu=Symbol.for("sibujs.prerender.v1");function mt(){return Oe().ssr||globalThis[tu]!==void 0}function io(){return!mt()}function so(){Oe().ssr=!0}function ao(){Oe().ssr=!1}function lo(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(We)return We.run(t,e);eu();let n={...ze};Object.assign(ze,t),Me.fallbackDepth++;try{return e()}finally{Me.fallbackDepth--;for(let r of Object.keys(ze))r in n||delete ze[r];Object.assign(ze,n)}}function uo(e,t,n=!0){let r=Cn(),o=r?.pending,i=o||!n?[]:Yt();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:Rt()??void 0};o?.add(s);let a=or(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function co(e){let t=Oe(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var An="__sibuPendingError";function fo(e,t){let n=()=>e.parentNode?(L(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[An]=t)})}function Lt(e){let t=e,n=t[An];if(n instanceof Error)return delete t[An],n}function po(e){let t=null;return function(){if(t&&!Qn())return t();let r=P({class:"sibu-lazy"}),o=ge(),i=Rt(),s=!1,a=X(null,()=>z("sibu-lazy-loading","Loading..."));if(t){let l=t;return ie(r,X(o,()=>l())),r}return uo(e(),"lazy").then(Q(l=>{if(s)return;t=l.default;let u=t,d=()=>X(o,()=>u()),p=i?i.enter(d):d();ie(r,p)})).catch(l=>{if(s)return;let u=l instanceof Error?l:new Error(String(l));ie(r,P({class:"sibu-lazy-error"},`Failed to load component: ${u.message}`)),fo(r,u)}),ye()&&r.firstChild||r.appendChild(a),C(r,()=>{s=!0}),r}}function mo({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=ge(),o=no(n),i=p=>{ie(n,p),o?.done()},s=X(null,t);ye()&&n.firstChild?I(s):n.appendChild(s);let a=!1,l=null,u=null;C(n,()=>{a=!0,l&&(l.disconnect(),l=null),u&&!n.contains(u)&&I(u)});let d=Q(()=>{if(!a)try{let p=o?o.enter(()=>X(r,e)):X(r,e);if(u=p,p.classList.contains("sibu-lazy")){if(!p.querySelector(".sibu-lazy-loading")){i(p);return}l=new MutationObserver(()=>{if(a)return;p.querySelector(".sibu-lazy-loading")||(l?.disconnect(),l=null,i(p))}),l.observe(p,{childList:!0,subtree:!0})}else i(p)}catch(p){let g=p instanceof Error?p:new Error(String(p));fo(n,g)}});return queueMicrotask(d),n}function Ln(e,t){return()=>et()===e?t():Nt(e,t)}function Ot(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";L(n,{phase:r,name:t});return}}function _n(e,t,n,r,o){let i=Ot(e,t);if(typeof i!="function")return;let s=Ln(o,i);r()||!n.isConnected?Ot(s,"onUnmount"):bo(s,n)}var nt=new WeakMap,qe=new WeakMap,Te=new Set,Ee=new Set,rt=null,Mt=0,nu=256;function Nn(e){let t=nt.get(e);if(t){nt.delete(e),Te.delete(e);for(let n of t)try{n()}catch{}}}function Rn(e){qe.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=qe.get(e);if(n){qe.delete(e),Ee.delete(e);for(let r of n)try{r()}catch{}}})}function ru(e){if(Te.size===0||e.nodeType!==1)return;let t=e;if(Te.has(t)&&t.isConnected&&Nn(t),t.firstElementChild)for(let n of Array.from(Te))n!==t&&n.isConnected&&t.contains(n)&&Nn(n)}function ou(e){if(Ee.size===0||e.nodeType!==1)return;let t=e;if(Ee.has(t)&&!t.isConnected&&Rn(t),t.firstElementChild)for(let n of Array.from(Ee))n!==t&&!n.isConnected&&t.contains(n)&&Rn(n)}function iu(){if(Te.size>0)for(let e of Array.from(Te))e.isConnected&&Nn(e);if(Ee.size>0)for(let e of Array.from(Ee))e.isConnected||Rn(e)}function go(){rt||typeof document>"u"||(rt=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)ru(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)ou(t.removedNodes[n])}Mt+=e.length,Mt>=nu&&(Mt=0,iu()),Mn()}),rt.observe(document.body,{childList:!0,subtree:!0}))}function Mn(){rt&&Te.size===0&&Ee.size===0&&(rt.disconnect(),rt=null,Mt=0)}function su(e,t){let n=nt.get(e);return n||(n=[],nt.set(e,n)),n.push(t),Te.add(e),go(),()=>{let r=nt.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(nt.delete(e),Te.delete(e))}Mn()}}function au(e,t){let n=qe.get(e);return n||(n=[],qe.set(e,n)),n.push(t),Ee.add(e),go(),()=>{let r=qe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(qe.delete(e),Ee.delete(e))}Mn()}}function Pt(e,t){if(typeof document>"u"||ee())return;let n=et();if(e=Ln(n,e),t){let r=!1,o=()=>r;if(C(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||_n(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){_n(e,"onMount",t,o,n);return}let i=su(t,()=>{r||_n(e,"onMount",t,o,n)});C(t,i)})}else queueMicrotask(()=>{Ot(e,"onMount")})}function lu(e,t){typeof document>"u"||ee()||bo(Ln(et(),e),t)}function bo(e,t){let n=!1,r=()=>{n||(n=!0,Ot(e,"onUnmount"))};C(t,r);let o=()=>{if(n)return;let i=au(t,r);C(t,i)};t.isConnected?o():Pt(()=>{o()},t)}function uu(e,t){C(t,e)}function ue(e,t,n){try{e.emit(t,n)}catch{}}var vo=globalThis;function cu(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,pe(()=>t(o,void 0));else{let i=n;n=o,pe(()=>t(o,i))}}}var ho=100;function Dt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===et()?yo(t):Nt(n,()=>yo(t))}function yo(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){L(n,{phase:"cleanup"})}}function So(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Dt(e),Le(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=ho);e.rerunPending&&(e.rerunPending=!1,L(new Error(`effect re-requested itself ${ho}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function du(e){if(e.disposed)return;e.disposed=!0;let t=vo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Dt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{je(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function te(e,t){if(ee()&&!t?.server)return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&Dt(n),Le(n.bodyFn,o),n.rerunPending&&So(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{Le(n.bodyFn,n.subscriber),n.rerunPending&&So(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Dt(n),je(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=vo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ue(i,"effect:create",{effectFn:e}),()=>du(n)}var gt=0,On=new Set;function fu(e){gt++;try{return e()}finally{gt--,gt===0&&gu()}}function pu(e){return gt===0?!1:(On.add(e),!0)}function mu(){return gt>0}function gu(){try{for(let e of On)Jr(e)}finally{On.clear()}Kr()}var xo=Symbol.for("sibujs.reactive.batch.v1");function bu(){let e=globalThis,t=e[xo];if(t)return t;let n={batch:fu,enqueueBatchedSignal:pu,isBatching:mu};return e[xo]=n,n}var Pn=bu(),W=Pn.batch,Ue=Pn.enqueueBatchedSignal,hu=Pn.isBatching;var Dn=globalThis;function A(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Be(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(!o(l,u)){if(n.value=u,n.__v++,!1){let d=Dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ue(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}Ue(n)||Qe(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;Object.is(u,l)||(n.value=u,n.__v++,Ue(n)||Qe(n))},!1){let a=Dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ue(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function yu(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Su=`
|
|
5
|
+
`?2:1;continue}if(Ao(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Ao(e[s]);)i+=e[s],s++;s<e.length&&aa(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
6
|
+
`?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var No=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],ua=4,ca=5,da=8;function fa(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var Zn=new Set,_o=100,Ro=!1;function Xt(e,t,n){}function Lo(e){return(e.includes("\\")?la(e):e).toLowerCase().replace(/\s+/g,"")}function Qn(e){if(!sa.test(e))return-1;let t=Lo(e);for(let n=0;n<No.length;n++)if(t.includes(No[n]))return n;return-1}function Qt(e,t,n){let r=er(e,t);return r===-1?t:(Xt(t,r,{property:e,element:n?.element}),"")}function er(e,t){let n=Qn(t);if(n!==-1)return n;let r=fe(e);return r==="behavior"?ca:r==="-moz-binding"?ua:(r==="filter"||r==="-ms-filter")&&Lo(t).includes("progid:")?da:-1}function pa(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let u=s.slice(a+1).trim(),d=/!\s*important\s*$/i.exec(u);if(d&&(u=u.slice(0,d.index).trim()),u==="")continue;let g=l.startsWith("--")?l:fe(l);i.push([g,u,d!==null])}return i}function ma(e,t){let n=String(e),r=pa(n);if(r===null)return Qn(n)!==-1&&Xt(n,Qn(n),t),"";let o=[];for(let[i,s,a]of r){let l=er(i,s);if(l!==-1){Xt(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function en(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return ma(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),l=er(s,a);if(l!==-1){Xt(a,l,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var tr=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ga=new Set(["srcdoc"]);function Bt(e){return ga.has(e.toLowerCase())}function Mo(e){return tr.has(e.toLowerCase())}function ha(e){let t=e.toLowerCase();return t==="style"||tr.has(t)}function ba(e,t,n){let r=e.toLowerCase();return r==="srcset"?ia(t):tr.has(r)?Zt(t):r==="style"?en(t,n):t}function Oo(e,t,n){if(!ha(e))return t;let r=ba(e,t,n);return r===""?null:r}function Ze(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function tn(e){let t=0,n=e.length;for(;t<n&&Ze(e[t]);)t++;for(;n>t&&Ze(e[n-1]);)n--;return e.slice(t,n)}var pe=e=>({kind:"forbidden",reason:e});function ya(e){let t=tn(vt(e));if(t==="")return pe("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return pe("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return pe("");for(;n<t.length&&Ze(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return pe("");for(n++;n<t.length&&Ze(t[n]);)n++;let o=n;for(;n<t.length&&!Ze(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return pe("");for(;n<t.length&&Ze(t[n]);)n++;if(t[n]!=="=")return pe("");for(n++;n<t.length&&Ze(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return pe("");if(s=t.slice(n+1,u),tn(t.slice(u+1))!=="")return pe("")}else if(s=tn(t.slice(n)),/[;,]/.test(s))return pe("");if(s==="")return pe("");let l=Zt(s);return l===""?pe(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function nr(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=fe(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?pe(""):typeof t!="string"?{kind:"not-refresh"}:tn(vt(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:ya(n)}var va="http://www.w3.org/1999/xhtml",Sa="http://www.w3.org/2000/svg",wa=new Set(["script","iframe","object","embed","frame","frameset"]);function Do(e){return fe(e)}function Ho(e){return wa.has(Do(e))}var xa=new Set(["script","style"]);function $o(e){return xa.has(Do(e))}var G={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Ta=new Set(["src","href","xlink:href","type","language"]),Ea=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),rr=new WeakSet;function Io(e){return e.namespaceURI===va||e.namespaceURI===null}function Bo(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function ka(e){rr.has(e)||(rr.add(e),e.getAttribute("content")!==null&&nr(Bo(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ca(e,t,n,r){if(!Io(e))return G.None;let o=fe(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ka(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return G.None;let i=nr(Bo(e,o,n));return i.kind==="forbidden"?G.MetaRefreshForbidden:i.kind!=="not-refresh"&&rr.has(e)?G.MetaRefreshReactive:G.None}function Aa(e,t){if(t===null||fe(e)!=="attributename")return G.None;let n=vt(t);return Mo(n)||Ve(n)||Bt(n)?G.AnimationTarget:G.None}var nn=new WeakSet;function Po(e){if(e===null)return!1;let t=fe(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Na(e,t,n,r){if(!Io(e))return G.None;let o=fe(t);return o==="href"?r==="static"||n===null?G.None:Po(e.getAttribute("rel"))?G.StylesheetSource:(nn.add(e),G.None):o==="rel"&&Po(n)&&nn.has(e)&&e.hasAttribute("href")?G.StylesheetSource:G.None}function or(e,t,n,r){let o=e.localName;return o==="meta"?Ca(e,t,n,r):o==="link"?Na(e,t,n,r):o==="script"?r==="static"||n===null?G.None:Ta.has(fe(t))?G.ScriptSource:G.None:Ea.has(o)&&e.namespaceURI===Sa?Aa(t,n):G.None}function ir(e,t,n){e.localName!=="link"||fe(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?nn.add(e):nn.delete(e))}var _a="http://www.w3.org/1999/xhtml",Ra="http://www.w3.org/2000/svg",La="http://www.w3.org/1999/xlink",Ma="http://www.w3.org/XML/1998/namespace",Oa=new Set(["checked","disabled","selected"]);function Pa(e){return e.namespaceURI===null||e.namespaceURI===_a}function Fo(e,t,n){}function zo(e,t,n){e[t]=n}function Da(e,t){if(e.namespaceURI!==Ra)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?La:n.startsWith("xml:")?Ma:null}function be(e,t,n,r={}){let o=Ha(e,t,n,r);return e.localName==="link"&&ir(e,t,r.reactive?"reactive":"runtime"),o}function Ha(e,t,n,r){let o=Da(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Ve(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=or(e,t,s,r.reactive?"reactive":"runtime");if(a!==G.None)return Fo(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(Bt(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=Pa(e),u=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let m=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==m&&(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0}return l&&Oa.has(u)&&u in e?zo(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&l&&(u==="value"||u==="checked")&&u in e)return zo(e,u,u==="checked"?!!n:d),!0;let g=d===""?"":Oo(t,d,{element:e});return g===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===g||(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0)}function sr(e,t,n){if(Bt(t))return!1,!1;let r=or(e,t,n,"static");return r!==G.None?(Fo("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&ir(e,t,"static"),!0)}var $a=4096,lr=[];function Ia(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Ba(e,t,n){let r=lr.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Ia();return o.sig=e,o.sub=t,o.epoch=n,o}function jo(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,lr.length<$a&&lr.push(e)}function za(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function qo(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function Fa(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Wa(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var ve=null,De=null,je=0,Ne=[],ne=new Set,Va=[];function ja(e){try{e()}catch(t){let n=e;H(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function qa(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var _e=0,He=!1;function cr(){_e===0&&(De=ve,ve=null,He=!0),_e++}function dr(){_e--,_e===0&&(ve=De,De=null,He=!1)}function Uo(){return He}function Ko(e){cr();try{return e()}finally{dr()}}var me=null;function fr(){return me}function ln(e,t){let n=me;me=e;try{return t()}finally{me=n}}function pr(e){let t=me;return t===null?e:(...n)=>ln(t,()=>e(...n))}var ye=null,wt=0,zt=0,rn=1,tt=2,Qe=()=>{},qe=new Set,St=new Set,xt=new Set;function Ua(e){let t=zt;for(let n=e;n!==null;){let r=n.sub;if(r===null)return tt;r._frozen===!0&&(t=rn),n=r._owner??null}return t}var Tt=new Set,Ae=new Set,ar=!1;function Wo(){ar||Ae.size===0||(ar=!0,queueMicrotask(()=>{ar=!1;for(let e of[...Ae]){if(!Ae.has(e))continue;let t=e.check.state();if(t===tt&&Ae.delete(e),!(t===tt||t===e.last)){e.last=t;try{e.listener(t)}catch(n){H(n,{phase:"effect"})}}}}))}var Ka=Object.assign(()=>!1,{state:()=>zt,wait:e=>(e(),Qe),onEnd:()=>Qe,run:e=>e(),onChange:()=>Qe,within:()=>!1});function Jo(){let e=ye;if(e===null)return Ka;let t=()=>Ua(e),n=Object.assign(()=>t()!==zt,{state:t,wait:(r,o)=>{let i=t();if(i!==rn)return(i===zt?r:o)(),Qe;let s={check:n,onActive:r,onEnd:o};return St.add(s),()=>{St.delete(s)}},onEnd:r=>{if(t()===tt)return r(),Qe;let o={check:n,onActive:Qe,onEnd:r};return Tt.add(o),()=>{Tt.delete(o)}},run:r=>{let o=ye;ye=e.sub===null?null:e;try{return r()}finally{ye=o}},onChange:r=>{let o=t();if(o===tt)return Qe;let i={check:n,last:o,listener:r};return Ae.add(i),()=>{Ae.delete(i)}},within:r=>{let o=r.run(()=>ye);if(o===null)return!1;for(let i=e;i!==null;){if(i===o)return!0;let s=i.sub;if(s===null)return!1;i=s._owner??null}return!1}});return n}function Go(e){return xt.add(e),()=>{xt.delete(e)&&mr()}}function Yo(e){if(wt!==0&&Ga(e))return!0;if(xt.size!==0){let t=e._errorNode;if(t!=null){for(let n of xt)if(n.contains(t))return!0}}return!1}function Vo(){for(let t of Ae)t.check.state()===tt&&Ae.delete(t);let e=null;for(let t of Tt)t.check.state()===tt&&(Tt.delete(t),(e??(e=[])).push(t));if(e!==null)for(let t of e)try{t.onEnd()}catch(n){H(n,{phase:"cleanup"})}}function Ja(){for(let e of qe)(e._disposed===!0||e.depsHead==null)&&qe.delete(e)}function mr(){for(let t of qe)t._disposed===!0?qe.delete(t):Yo(t)||(qe.delete(t),ne.has(t)||(ne.add(t),Ne.push(t)));wt===0&&xt.size===0&&qe.clear();let e=null;for(let t of St)t.check.state()!==rn&&(St.delete(t),(e??(e=[])).push(t));if(e!==null){let t=e;queueMicrotask(()=>{for(let n of t){let r=n.check.state();if(r===rn)St.add(n);else try{(r===zt?n.onActive:n.onEnd)()}catch(o){H(o,{phase:"effect"})}}})}Ne.length>0&&br()}function Ga(e){for(let t=e._owner??null;t!==null;){let n=t.sub;if(n===null)return!1;if(n._frozen===!0)return!0;t=n._owner??null}return!1}var Ya=0;function gr(e,t){let n=ve,r=0,o=null;He&&(r=_e,o=De,_e=0,De=null,He=!1),ve=t;let i=t;i._cap===void 0&&(i._cap=To());let s=me;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(me=a);let l=ye;l!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=l),i._tok!=null&&(ye=i._tok);let u=++Ya;i._epoch=u,i._structDirty=!1;for(let d=i.depsHead??null;d!==null;d=d.subNext){let g=d.sig;d.prevActive=g.__activeNode??null,g.__activeNode=d}try{e()}finally{ve=n,me=s,ye=l,r!==0&&(_e=r,De=o,He=!0);let d=i.depsHead??null;for(;d!==null;){let g=d.subNext,p=d.sig;p.__activeNode=d.prevActive,d.prevActive=null,d.epoch!==u&&(Wa(d),qo(d),jo(d)),d=g}}}function Xo(e,t){if(!t)return hr(e);Et(t);let n=ve,r=0,o=null;He&&(r=_e,o=De,_e=0,De=null,He=!1),ve=t;let i=t;i._scope===void 0&&(i._scope=me);let s=me;me=i._scope;try{e()}finally{ve=n,me=s,r!==0&&(_e=r,De=o,He=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Et(t))}function hr(e,t,n){return Qo(e,t,n===!0)._dispose}function Zo(e,t){let n=Qo(e,t,!0);return{stop:n._dispose,run:r=>{let o=ye;ye=n._tok??null;try{return r()}finally{ye=o}},freeze:()=>{let r=n;r._disposed||r._frozen||(r._frozen=!0,wt++,Wo())},thaw:()=>{n._frozen&&(n._frozen=!1,wt--,Wo(),mr())}}}function Qo(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{gr(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,o._frozen=!1,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null,(Tt.size!==0||Ae.size!==0)&&Vo()),Et(o),i}return o._dispose=()=>{o._disposed=!0;let i=o._frozen===!0;i&&(o._frozen=!1,wt--),o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null,(Tt.size!==0||Ae.size!==0)&&Vo(),qe.size!==0&&Ja(),(i||St.size!==0)&&mr()),Et(o)},o}function ei(e){if(!ve)return;let t=ve,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=Ba(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Fa(t,i),za(n,i),t._structDirty=!0}function Et(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;qo(n),jo(n),n=r}}var on=1e3,sn=1e6,an=0,et=new Set;function ti(e){let t=on;return Number.isFinite(e)&&e>0&&(on=Math.floor(e)),t}function ni(e){let t=sn;return Number.isFinite(e)&&e>0&&(sn=Math.floor(e)),t}function Xa(e){let t=e;return t._runEpoch!==an?(t._runEpoch=an,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>on)}function Za(e){let t=e.__name??"<unnamed>";H(new Error(`subscriber "${t}" fired more than ${on} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:t})}function Qa(){H(new Error(`Notification drain exceeded ${sn} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function ri(){let e=0;for(;e<Ne.length;){if(e>=sn){Qa();break}let t=Ne[e++];ne.delete(t)&&(t._owner!=null&&ne.size>0&&(el(t),ne.has(t))||oi(t))}}function el(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;ne.has(r)&&(t=r),n=r._owner??null}if(t===null)return;ne.delete(t),oi(t)}}function oi(e){if((wt!==0||xt.size!==0)&&Yo(e)){qe.add(e);return}if(et.size>0&&et.has(e)||e._hasComputedDep===!0&&!qa(e))return;if(Xa(e)){Za(e),et.add(e);return}let t=Eo(e._cap??null);try{ja(e)}finally{t&&ko()}}function br(){if(!(je>0)){je++,an++;try{ri()}finally{je--,je===0&&(Ne.length=0,ne.clear(),et.size>0&&et.clear())}}}function ur(e){e();let t=e._sig;if(!t)return;let n=Va,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else ne.has(s)||(ne.add(s),Ne.push(s));i=i.sigNext}}}function ii(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?ur(r):ne.has(r)||(ne.add(r),Ne.push(r))),n=n.sigNext}}function si(e){let n=e.subsHead;if(n){if(je>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?ur(o):ne.has(o)||(ne.add(o),Ne.push(o))),r=r.sigNext}return}je++,an++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?ur(o):ne.has(o)||(ne.add(o),Ne.push(o))),r=r.sigNext}ri()}finally{je--,je===0&&(Ne.length=0,ne.clear(),et.size>0&&et.clear())}}}function ai(e){return e.__sc??0}function li(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function ui(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var ci="4.15.0",di=Symbol.for("sibujs.reactive.v1");function nl(){let e=globalThis,t=e[di];if(t)return!1,t;let n={suspendTracking:cr,resumeTracking:dr,isTrackingSuspended:Uo,untracked:Ko,retrack:gr,track:Xo,reactiveBinding:hr,recordDependency:ei,cleanup:Et,setMaxSubscriberRepeats:ti,setMaxDrainIterations:ni,drainNotificationQueue:br,queueSignalNotification:ii,notifySubscribers:si,getSubscriberCount:ai,getSubscriberDeps:li,forEachSubscriber:ui,getOwnerScope:fr,runWithOwnerScope:ln,bindOwnerScope:pr,structuralBinding:Zo,captureFrozen:Jo,holdSubtree:Go,version:ci};return e[di]=n,n}var Y=nl(),nt=Y.suspendTracking,rt=Y.resumeTracking,un=Y.isTrackingSuspended,Re=Y.untracked,Ue=Y.retrack,kt=Y.track,oe=Y.reactiveBinding,ot=Y.recordDependency,it=Y.cleanup,sp=Y.setMaxSubscriberRepeats,fi=Y.setMaxDrainIterations,pi=Y.drainNotificationQueue,mi=Y.queueSignalNotification,Ct=Y.notifySubscribers,ap=Y.getSubscriberCount,lp=Y.getSubscriberDeps,up=Y.forEachSubscriber,At=Y.getOwnerScope??fr,cn=Y.runWithOwnerScope??ln,ie=Y.bindOwnerScope??pr,Se=Y.structuralBinding??((e,t)=>({stop:Y.reactiveBinding(e,t),run:n=>n()})),we=Y.captureFrozen??(()=>Object.assign(()=>!1,{state:()=>0,wait:e=>(e(),()=>{}),onEnd:()=>()=>{},run:e=>e(),onChange:()=>()=>{},within:()=>!1})),dn=Y.holdSubtree??(()=>()=>{});function Ft(e,t,n){if(Ve(t))return be(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){H(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}be(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return oe(r,e)}function gi(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){H(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){H(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),be(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=oe(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var yr=["data-focus-key","id","name"],rl=new Set(["text","search","url","tel","password",""]);function ol(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&rl.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function fn(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<yr.length;i++){let s=t.getAttribute(yr[i]);if(s){r=yr[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...ol(t)}}function il(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function sl(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function hi(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Nt(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected&&!e.el.closest("[inert]")){hi(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=sl(t,`[${e.attr}=${il(e.value)}]`);if(s&&s.tagName===e.tag){hi(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}}var bi,vr=globalThis[bi=Symbol.for("sibujs.streamBoundary.v1")]??(globalThis[bi]={hook:null,current:null});function yi(e){return vr.hook?vr.hook(e):null}function pn(){return vr.current}var Sr=Symbol.for("sibujs.ssr.v1");function al(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,r=process.getBuiltinModule;typeof r=="function"?n=r("node:async_hooks"):typeof Vn=="function"&&(n=Vn("async_hooks")),n&&(e=new n.AsyncLocalStorage)}let t=globalThis.AsyncLocalStorage;!e&&typeof t=="function"&&(e=new t)}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Ke=globalThis[Sr]??(globalThis[Sr]=al()),at=Ke.als,st=Ke.fallbackStore;Ke.fallbackDepth??(Ke.fallbackDepth=0);var vi=!1;function ll(){if(vi||at||!(typeof process<"u"&&!!process.versions?.node))return;vi=!0;let t=process.versions.node;`${t}`}function Je(){if(at){let e=at.getStore();if(e)return e}return st}function wr(){return at?at.getStore()??null:Ke.fallbackDepth>0?st:null}function le(){return Je().ssr}function Si(e){if(!le())return null;let t=Je(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}var ul=Symbol.for("sibujs.prerender.v1");function xe(){return Je().ssr||globalThis[ul]!==void 0}function wi(){return!xe()}function xi(){Je().ssr=!0}function Ti(){Je().ssr=!1}function Ei(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0,pending:new Set,wake:null};if(at)return at.run(t,e);ll();let n={...st};Object.assign(st,t),Ke.fallbackDepth++;try{return e()}finally{Ke.fallbackDepth--;for(let r of Object.keys(st))r in n||delete st[r];Object.assign(st,n)}}function ki(e,t,n=!0){let r=wr(),o=r?.pending,i=o||!n?[]:Kn();if(!o&&i.length===0)return e;let s={label:t,since:Date.now(),boundary:pn()??void 0};o?.add(s);let a=xo(i,s),l=()=>{o?.delete(s),r?.wake?.(),a()};try{Promise.resolve(e).then(l,l)}catch{l()}return e}function Ci(e){let t=Je(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Wt=he(Symbol.for("sibujs.ranges.v1"),()=>({ends:new WeakMap,pending:new WeakMap,registrations:new Set,listeners:new Set,notice:{queued:!1,batch:[]}})),mn=Wt.ends;function ct(e,t){mn.set(e,t)}var ut=Wt.pending,xr=()=>{};function _t(e,t,n){if(n){let r=t;t=()=>{n.wait(r,xr)}}ut.set(e,!0),queueMicrotask(()=>{if(ut.get(e)===!0){if(e.parentNode===null){ut.set(e,t);return}ut.delete(e),t()}})}function Ni(e){for(let t of e){let n=ut.get(t);typeof n=="function"&&(ut.delete(t),n())}}function Tr(e){for(let t of e)if(ut.has(t))return!0;return!1}var gn=Wt.registrations,hn=Wt.listeners,lt=Wt.notice;function Ai(e){hn.size!==0&&(e!==null&<.batch.push(e),!lt.queued&&(lt.queued=!0,queueMicrotask(()=>{lt.queued=!1;let t=lt.batch;lt.batch=[];for(let n of[...hn])n(t)})))}function Er(e,t){let n={at:e,held:t,settled:!1,cancelled:!1,committed:null};gn.add(n),Ai(null);let r=(o,i)=>{n.settled||(n.settled=!0,n.cancelled=o,n.committed=i,gn.delete(n),Ai(n))};return{entry:n,done:o=>r(!1,o??null),cancel:()=>r(!0,null)}}var cl={done:xr,cancel:xr};function kr(e){if(xe())return cl;let{done:t,cancel:n}=Er(e,null);return{done:()=>t(),cancel:n}}function Cr(e,t,n){let r=e.at;if(r!==null){for(let o=0;o<t.length;o++)if(t[o]===r||t[o].contains(r))return!0;return!1}return n!==null&&e.held?.within(n)===!0}function bn(e,t){let n=[];if(gn.size===0)return n;for(let r of gn)Cr(r,e,t)&&n.push(r);return n}function _i(e){if(!e.settled||e.cancelled)return[];let t;if(e.committed!==null)t=e.committed;else{if(e.at===null)return[];e.at.nodeType===1?t=Array.from(e.at.childNodes):t=jt([e.at])}let n=[];for(let r=0;r<t.length;r++)t[r].nodeType===1&&n.push(t[r]);return n}function Ar(e){return hn.add(e),()=>{hn.delete(e)}}function Ri(){return lt.batch}function Vt(e){return mn.has(e)}function Li(e,t){ct(e,()=>{let n=e.parentNode,r=t().filter(s=>s!==null&&s.parentNode===n),o=null,i=r.length;for(let s=e.nextSibling;s!==null&&i>0;s=s.nextSibling)r.includes(s)&&(o=s,i--);return o})}function dl(e){let t=e;for(let n=mn.get(t);n!==void 0;n=mn.get(t)){let r=n();if(r===null||r===t||r.parentNode!==e.parentNode)break;t=r}return t}function jt(e){let t=[],n=new Set;for(let r of e){if(r.parentNode===null)continue;let o=dl(r),i=r,s=[r];for(;i!==o;){if(i=i.nextSibling,i===null){s=[r];break}s.push(i)}for(let a of s)n.has(a)||(n.add(a),t.push(a))}return t}function $e(e,t,n){let r=[],o=Me();function i(){let s;try{s=ce(o,t)}catch(p){H(p,{phase:"binding",name:"bindChildNode",node:e});return}let a=fn(r);if(s==null||typeof s=="boolean"){for(let p=0;p<r.length;p++){let m=r[p];j(m),m.parentNode&&m.parentNode.removeChild(m)}r.length=0,Nt(a,r,"bindChildNode");return}let l=e.parentNode;if(!l){r.length=0;return}let u;if(Array.isArray(s)){u=[];let p=new Set;for(let m=0;m<s.length;m++){let c=s[m];if(c==null||typeof c=="boolean")continue;let f=c instanceof Node?c:document.createTextNode(String(c));if(p.has(f)){!1;continue}p.add(f),u.push(f)}}else u=[s instanceof Node?s:document.createTextNode(String(s))];let d;if(r.length>0&&u.length>0){let p=new Set(r);d=new Set;for(let m=0;m<u.length;m++)p.has(u[m])&&d.add(u[m])}for(let p=0;p<r.length;p++){let m=r[p];d?.has(m)||(j(m),m.parentNode&&m.parentNode.removeChild(m))}let g=e;for(let p=0;p<u.length;p++){let m=u[p];g.nextSibling!==m&&l.insertBefore(m,g.nextSibling),g=m}r=u,Nt(a,u,"bindChildNode")}return n&&ct(e,()=>{for(let s=r.length-1;s>=0;s--)if(r[s].parentNode!==null)return r[s];return null}),oe(i,e,!0)}var Mi={cssFloat:"float"},fl=/^(webkit|moz|ms|o)-/,yn=new Map,pl=1e3;function Nr(e){let t=yn.get(e);return t!==void 0||(e.startsWith("--")?t=e:Object.hasOwn(Mi,e)?t=Mi[e]:(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),fl.test(t)&&(t=`-${t}`)),yn.size>=pl&&yn.clear(),yn.set(e,t)),t}function _r(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function ue(){typeof document>"u"&&_r()}var J="http://www.w3.org/2000/svg",ml=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Rr=new Set,Oi=100,Pi=!1;function gl(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=oe(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",en(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let g=a[d];if(g==null)continue;let p=Nr(d);u.push(p),l.setProperty(p,Qt(p,String(g),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=u},e);D(e,s);return}if(typeof t=="string"){e.setAttribute("style",en(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Nr(r);if(typeof o=="function"){let s=o,a=oe(()=>{n.style.setProperty(i,Qt(i,String(s()),{element:e}))},e);D(e,a)}else n.style.setProperty(i,Qt(i,String(o),{element:e}))}}function hl(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=oe(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);D(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=oe(()=>{let a="";for(let l in n){if(!Object.hasOwn(n,l))continue;let u=n[l];(typeof u=="function"?u():u)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);D(e,s)}else e.setAttribute("class",o)}function Lr(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),D(e,$e(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),D(e,$e(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),D(e,$e(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function h(e,t){let n=Ho(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&_r();let i=It(e,t);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Lr(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Lr(i,r),i;let s=r,a=s.class;a!=null&&hl(i,a);let l=s.id;typeof l=="function"?D(i,Ft(i,"id",l)):l!=null&&(!1,i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Lr(i,u);let d=s.on;if(d)for(let m in d){if(!Object.hasOwn(d,m))continue;let c=d[m];typeof c=="function"?i.addEventListener(m,c):!1}let g=s.style;g!=null&&gl(i,g);let p=s.ref;p&&(p.current=i);for(let m in s)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,m))continue;let c=s[m];if(c==null||Ve(m))continue;typeof c=="function"?D(i,Ft(i,m,c)):be(i,m,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Up=h("html"),bl=h("head"),yl=h("body"),vl=h("title"),U=h("div"),Q=h("span"),Sl=h("section"),wl=h("article"),xl=h("header"),Tl=h("footer"),El=h("nav"),kl=h("main"),Cl=h("aside"),Al=h("address"),Mr=h("p"),Nl=h("h1"),_l=h("h2"),Or=h("h3"),Rl=h("h4"),Ll=h("h5"),Ml=h("h6"),Ol=h("blockquote"),Pl=h("dd"),Dl=h("dl"),Hl=h("dt"),$l=h("figcaption"),Il=h("figure"),Bl=h("hr"),zl=h("li"),Fl=h("ol"),Wl=h("ul"),Pr=h("pre"),Vl=h("a"),jl=h("abbr"),ql=h("b"),Ul=h("bdi"),Kl=h("bdo"),Jl=h("br"),Gl=h("cite"),Dr=h("code"),Yl=h("data"),Xl=h("dfn"),Zl=h("em"),Ql=h("i"),eu=h("kbd"),tu=h("mark"),nu=h("q"),ru=h("rp"),ou=h("rt"),iu=h("ruby"),su=h("s"),au=h("samp"),lu=h("small"),uu=h("strong"),cu=h("sub"),du=h("sup"),fu=h("time"),pu=h("u"),mu=h("var"),gu=h("area"),hu=h("audio"),bu=h("img"),yu=h("map"),vu=h("track"),Su=h("video"),wu=h("embed"),xu=h("iframe"),Tu=h("object"),Eu=h("param"),ku=h("picture"),Cu=h("portal"),Au=h("source"),Nu=h("svg",J),_u=h("math"),Ru=h("canvas"),Lu=h("noscript"),Mu=h("script"),Ou=h("del"),Pu=h("ins"),Du=h("caption"),Hu=h("col"),$u=h("colgroup"),Iu=h("table"),Bu=h("tbody"),zu=h("td"),Fu=h("tfoot"),Wu=h("th"),Vu=h("thead"),ju=h("tr"),qt=h("button"),qu=h("datalist"),Uu=h("fieldset"),Ku=h("form"),Ju=h("input"),Gu=h("label"),Yu=h("legend"),Xu=h("meter"),Zu=h("optgroup"),Qu=h("option"),ec=h("output"),tc=h("progress"),nc=h("select"),rc=h("textarea"),oc=h("details"),ic=h("dialog"),sc=h("menu"),ac=h("summary"),lc=h("slot"),uc=h("template"),cc=h("base"),dc=h("link"),fc=h("meta"),dt=h("style"),pc=h("circle",J),mc=h("ellipse",J),gc=h("g",J),hc=h("line",J),bc=h("path",J),yc=h("polygon",J),vc=h("polyline",J),Sc=h("rect",J),wc=h("text",J),xc=h("tspan",J),Tc=h("defs",J),Ec=h("clipPath",J),kc=h("mask",J),Cc=h("pattern",J),Ac=h("linearGradient",J),Nc=h("radialGradient",J),_c=h("stop",J),Rc=h("use",J),Lc=h("symbol",J),Mc=h("marker",J),Oc=h("center"),Pc=h("font"),Dc=h("marquee"),Hc=e=>h(e);var vn=()=>{};function Ut(e,t){let n=!1,r=null,o=vn,i=()=>{n=!0,e.cancel===s&&(e.cancel=vn),o(),o=vn},s=()=>{if(n)return;i();let l=r;r=null;try{t.discard()}finally{l?.()}},a=()=>{o=vn;let l=!1;for(;!n;){let u=t.held.state();if(u===2||t.owned!==void 0&&!t.owned()){s();return}if(u===1){t.node!==null&&r===null&&(r=dn(t.node)),o=t.held.wait(a,a);return}if(r!==null){let d=r;r=null,d();continue}if(!l){l=t.teardown?.()!==!0;continue}i(),t.insert();return}};e.cancel=s,a()}var Hr="__sibuPendingError";function $r(e,t){let n=()=>e.parentNode?(H(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Hr]=t)})}function Sn(e){let t=e,n=t[Hr];if(n instanceof Error)return delete t[Hr],n}var Rt=()=>{};function Di(e){let t=null,n=o=>{let i=Se(Rt);try{return[yt(()=>i.run(o)),i]}catch(s){throw i.stop(),s}},r=(o,i)=>o.nodeType===11?()=>{Gn(o),i.stop()}:i.stop;return function(){if(t&&!bo()){let[w,N]=n(t),T=w?.nodeType;if(T===11){let L=U({class:"sibu-lazy"});return D(L,r(w,N)),L.appendChild(w),L}return typeof T=="number"&&D(w,N.stop),w}let i=U({class:"sibu-lazy"}),s=Me(),a=pn(),l=ce(null,()=>Q("sibu-lazy-loading","Loading..."));if(t){let w=t,N;try{let[T,L]=n(()=>ce(s,()=>w()));D(i,r(T,L)),N=T}catch(T){throw j(i),T}return Pe(i,N),i}let u=we(),d=ie(w=>w()),g=kr(i),p=!1,m=()=>!p,c=null,f={cancel:Rt};D(i,()=>{p=!0,f.cancel(),g.cancel();let w=c;c=null,w?.()}),ke()&&i.firstChild||i.appendChild(l);let b=(w,N,T,L,F)=>{let te=Yn(i,[w]);Ut(f,{held:u,node:w,owned:m,teardown:te.teardown,insert:()=>{T();try{te.insert()}catch(O){N(),F(O);return}p||L()},discard:()=>{N(),g.cancel()}})},y=w=>Ut(f,{held:u,node:null,owned:m,insert:()=>d(w),discard:g.cancel}),x=w=>{if(p)return;let N=w instanceof Error?w:new Error(String(w)),T=U({class:"sibu-lazy-error"},`Failed to load component: ${N.message}`);b(T,()=>j(T),Rt,()=>{g.done(),$r(i,N)},L=>{g.cancel(),H(L,{phase:"render",name:"lazy"})})},v=w=>{if(p)return;let N,T;try{let F=()=>u.run(()=>n(()=>ce(s,()=>w())));[N,T]=a?a.enter(F):F()}catch(F){x(F);return}let L=r(N,T);b(N,()=>{c===L&&(c=null),T.stop(),j(N)},()=>{c=L},()=>g.done(),x)},C;try{C=e()}catch(w){throw j(i),w}return ki(C,"lazy").then(w=>{if(p)return;t=w.default;let N=t;y(()=>v(N))},w=>{p||y(()=>x(w))}),i}}function Hi({nodes:e,fallback:t}){let n=U({class:"sibu-suspense"}),r=Me(),o=we(),i=ie(w=>w()),s=yi(n),a=kr(n),l=!1,u=()=>!l,d=null,g=null,p=null,m=()=>{let w=p;p=null,w?.stop()},c=Se(Rt),f=c,b=()=>{let w=f;f=null,w?.stop()},y={cancel:Rt};D(n,()=>{l=!0,y.cancel(),a.cancel(),d&&(d.disconnect(),d=null),g&&!n.contains(g)&&j(g),b(),m()});let x;try{x=ce(null,()=>yt(()=>c.run(t)))}catch(w){throw s?.done(),j(n),w}ke()&&n.firstChild?(j(x),b()):n.appendChild(x);let v=w=>{let N=Yn(n,[w]);Ut(y,{held:o,node:w,owned:u,teardown:()=>N.teardown()?!0:f===null?!1:(b(),!0),insert:()=>{try{N.insert()}catch(T){g===w&&(g=null),j(w),m(),a.cancel(),s?.done(),$r(n,T instanceof Error?T:new Error(String(T)));return}s?.done(),a.done()},discard:()=>{g===w&&(g=null),j(w),m(),a.cancel()}})},C=()=>{if(l)return;let w=o.run(()=>Se(Rt));p=w;let N;try{let T=()=>yt(()=>w.run(()=>ce(r,e)));N=s?s.enter(T):T()}catch(T){m();let L=T instanceof Error?T:new Error(String(T));a.cancel(),$r(n,L);return}if(g=N,l){g=null,j(N);return}if(N.classList.contains("sibu-lazy")){if(!N.querySelector(".sibu-lazy-loading")){v(N);return}d=new MutationObserver(()=>{if(l)return;N.querySelector(".sibu-lazy-loading")||(d?.disconnect(),d=null,v(N))}),d.observe(N,{childList:!0,subtree:!0})}else v(N)};return queueMicrotask(()=>{Ut(y,{held:o,node:null,owned:u,insert:()=>i(C),discard:a.cancel})}),n}function Fr(e,t){return()=>At()===e?t():cn(e,t)}function xn(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";H(n,{phase:r,name:t});return}}function Ir(e,t,n,r,o){let i=xn(e,t);if(typeof i!="function")return;let s=Fr(o,i);r()||!n.isConnected?xn(s,"onUnmount"):Ii(s,n)}var Lt=new WeakMap,ft=new WeakMap,Ie=new Set,Be=new Set,Mt=null,wn=0,$c=256;function Br(e){let t=Lt.get(e);if(t){Lt.delete(e),Ie.delete(e);for(let n of t)try{n()}catch{}}}function zr(e){ft.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=ft.get(e);if(n){ft.delete(e),Be.delete(e);for(let r of n)try{r()}catch{}}})}function Ic(e){if(Ie.size===0||e.nodeType!==1)return;let t=e;if(Ie.has(t)&&t.isConnected&&Br(t),t.firstElementChild)for(let n of Array.from(Ie))n!==t&&n.isConnected&&t.contains(n)&&Br(n)}function Bc(e){if(Be.size===0||e.nodeType!==1)return;let t=e;if(Be.has(t)&&!t.isConnected&&zr(t),t.firstElementChild)for(let n of Array.from(Be))n!==t&&!n.isConnected&&t.contains(n)&&zr(n)}function zc(){if(Ie.size>0)for(let e of Array.from(Ie))e.isConnected&&Br(e);if(Be.size>0)for(let e of Array.from(Be))e.isConnected||zr(e)}function $i(){Mt||typeof document>"u"||(Mt=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Ic(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Bc(t.removedNodes[n])}wn+=e.length,wn>=$c&&(wn=0,zc()),Wr()}),Mt.observe(document.body,{childList:!0,subtree:!0}))}function Wr(){Mt&&Ie.size===0&&Be.size===0&&(Mt.disconnect(),Mt=null,wn=0)}function Fc(e,t){let n=Lt.get(e);return n||(n=[],Lt.set(e,n)),n.push(t),Ie.add(e),$i(),()=>{let r=Lt.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Lt.delete(e),Ie.delete(e))}Wr()}}function Wc(e,t){let n=ft.get(e);return n||(n=[],ft.set(e,n)),n.push(t),Be.add(e),$i(),()=>{let r=ft.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(ft.delete(e),Be.delete(e))}Wr()}}function Tn(e,t){if(typeof document>"u"||le())return;let n=At();if(e=Fr(n,e),t){let r=!1,o=()=>r;if(D(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||Ir(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){Ir(e,"onMount",t,o,n);return}let i=Fc(t,()=>{r||Ir(e,"onMount",t,o,n)});D(t,i)})}else queueMicrotask(()=>{xn(e,"onMount")})}function Vc(e,t){typeof document>"u"||le()||Ii(Fr(At(),e),t)}function Ii(e,t){let n=!1,r=()=>{n||(n=!0,xn(e,"onUnmount"))};D(t,r);let o=()=>{if(n)return;let i=Wc(t,r);D(t,i)};t.isConnected?o():Tn(()=>{o()},t)}function jc(e,t){D(t,e)}function ge(e,t,n){try{e.emit(t,n)}catch{}}var Wi=globalThis;function qc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Re(()=>t(o,void 0));else{let i=n;n=o,Re(()=>t(o,i))}}}var Bi=100;function En(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===At()?zi(t):cn(n,()=>zi(t))}function zi(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){H(n,{phase:"cleanup"})}}function Fi(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&En(e),Ue(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Bi);e.rerunPending&&(e.rerunPending=!1,H(new Error(`effect re-requested itself ${Bi}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Uc(e){if(e.disposed)return;e.disposed=!0;let t=Wi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&En(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{it(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function se(e,t){if(le()&&!t?.server)return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&En(n),Ue(n.bodyFn,o),n.rerunPending&&Fi(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{Ue(n.bodyFn,n.subscriber),n.rerunPending&&Fi(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&En(n),it(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Wi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ge(i,"effect:create",{effectFn:e}),()=>Uc(n)}var Kt=0,Vr=new Set;function Kc(e){Kt++;try{return e()}finally{Kt--,Kt===0&&Yc()}}function Jc(e){return Kt===0?!1:(Vr.add(e),!0)}function Gc(){return Kt>0}function Yc(){try{for(let e of Vr)mi(e)}finally{Vr.clear()}pi()}var Vi=Symbol.for("sibujs.reactive.batch.v1");function Xc(){let e=globalThis,t=e[Vi];if(t)return t;let n={batch:Kc,enqueueBatchedSignal:Jc,isBatching:Gc};return e[Vi]=n,n}var jr=Xc(),ee=jr.batch,pt=jr.enqueueBatchedSignal,Zc=jr.isBatching;var qr=globalThis;function I(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return ot(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(!o(l,u)){if(n.value=u,n.__v++,!1){let d=qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ge(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}pt(n)||Ct(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;Object.is(u,l)||(n.value=u,n.__v++,pt(n)||Ct(n))},!1){let a=qr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ge(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Qc(e){let[t,n]=I(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var ed=`
|
|
8
8
|
.sibu-error-display {
|
|
9
9
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
10
10
|
border-radius: 10px;
|
|
@@ -185,11 +185,11 @@
|
|
|
185
185
|
border: 1px solid #3a3a4e;
|
|
186
186
|
}
|
|
187
187
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
188
|
-
`,
|
|
189
|
-
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function
|
|
188
|
+
`,ji=!1;function td(){if(ji||typeof document>"u")return;let e=dt({nodes:ed});document.head.appendChild(e),ji=!0}function nd(e){let t=[],n=e.split(`
|
|
189
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function qi(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=nd(r),i=e.cause,s=i!=null?qi(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function rd(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
190
190
|
`).map(s=>` ${s}`).join(`
|
|
191
191
|
`);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
192
|
-
`)}function
|
|
192
|
+
`)}function Ui(e){let t=e.map((n,r)=>U({class:"sibu-err-frame",nodes:[Q({class:"sibu-err-line",nodes:String(r+1)}),Q({class:"sibu-err-fn",nodes:n.fn}),Q({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Pr({class:"sibu-err-stack",nodes:t})}function Ki(e){return e?[U({class:"sibu-err-cause-label",nodes:"Caused by"}),U({class:"sibu-err-section",nodes:[U({class:"sibu-err-section-head",nodes:[Q({nodes:`[${e.code}] ${e.message}`}),Q({nodes:""})]}),e.frames.length>0?Ui(e.frames):U({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Ki(e.cause)]:[]}function od(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function Ur(e){td();let t=e.severity??"error",n=qi(e.error),r=e.alwaysShowDetails??Ee(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=I("Copy"),l=qt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=rd(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(m).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=U({class:"sibu-err-header",nodes:[Dr({class:"sibu-err-icon",nodes:n.code}),Or({class:"sibu-err-title",nodes:o}),l,Q({class:"sibu-err-timestamp",nodes:i})]}),d=[Mr({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(U({class:"sibu-err-section",nodes:[U({class:"sibu-err-section-head",nodes:[Q({nodes:"Stack Trace"})]}),Ui(n.frames)]})),r&&d.push(...Ki(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(U({class:"sibu-err-section",nodes:[U({class:"sibu-err-section-head",nodes:[Q({nodes:"Metadata"})]}),od(e.metadata)]}));let g=[];e.onRetry&&g.push(qt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(qt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),g.length>0&&d.push(U({class:"sibu-err-actions",nodes:g}));let p=U({class:"sibu-err-body",nodes:d});return U({class:"sibu-error-display","data-severity":t,nodes:[u,p]})}var id=`
|
|
193
193
|
.sibu-error-boundary {
|
|
194
194
|
position: relative;
|
|
195
195
|
}
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
344
344
|
background: #3a3a4e;
|
|
345
345
|
}
|
|
346
|
-
`,
|
|
346
|
+
`,sd=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Ji=!1;function ad(){if(!Ji&&typeof document<"u"){let e=dt({nodes:id});document.head.appendChild(e),Ji=!0}}function ld(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;ad();let[a,l]=I(null),u=()=>{g(),l(null)},d=null,g=()=>{if(!d)return;let v=d;d=null,v()},p=v=>{let C=new Array(v.length);for(let w=0;w<v.length;w++)try{C[w]=v[w]()}catch(N){H(N,{phase:"effect",name:"ErrorBoundary.resetKeys"}),C[w]=sd}return C},m=()=>{let v=s;if(!v||v.length===0)return;g();let C=null;d=se(()=>{let w=p(v);if(C===null){C=w;return}let N=w.length!==C.length;if(!N){for(let T=0;T<w.length;T++)if(!Object.is(w[T],C[T])){N=!0;break}}C=w,N&&u()})},c=v=>{let C=qn(v);if(l(C),m(),i)try{i(C)}catch(w){H(w,{phase:"render",name:"ErrorBoundary onError callback"})}return C},f=(v,C)=>Ur({error:v,severity:"error",onRetry:C}),b=v=>{let C=o||f;try{return C(v,u)}catch(w){return queueMicrotask(()=>{H(w,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=U({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return b(v);try{let C=n();if(C&&typeof C.then=="function"){let w=U({class:"sibu-error-async"});w.appendChild(Q({class:"sibu-lazy-loading",nodes:"Loading..."}));let N=!1;return D(w,()=>{N=!0}),C.then(T=>{if(N){j(T);return}Pe(w,T)}).catch(ie(T=>{if(N)return;let L=c(T);Pe(w,b(L))})),w}return C}catch(C){let w=c(C);return b(w)}}}),x=v=>{if(a())return;let w=v.detail?.error;w&&(v.preventDefault(),v.stopPropagation(),c(w))};return y.addEventListener("sibu:error-propagate",x),Tn(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),C=[],w=v.currentNode;for(;w;){let N=Sn(w);N&&C.push(N),w=v.nextNode()}if(C.length===1)c(C[0]);else if(C.length>1){let N=globalThis.AggregateError;c(N?new N(C,`${C.length} pre-mount errors caught by ErrorBoundary`):new Error(C.map(T=>T.message).join("; ")))}},y),D(y,()=>{g(),y.removeEventListener("sibu:error-propagate",x)}),y}var ud=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,5 +396,5 @@
|
|
|
396
396
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
397
397
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
398
398
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
399
|
-
`,Ao=!1;function Nu(){!Ao&&typeof document<"u"&&(document.head.appendChild(Fe({nodes:_u})),Ao=!0)}function Ru(e={}){Nu();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-dots"},[z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"}),z({class:"sibu-loading-dot"})]),t?z({class:"sibu-loading-text"},t):null]):P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-spinner"}),t?z({class:"sibu-loading-text"},t):null])}var $n=Symbol.for("sibujs.actions.v1"),No=globalThis[$n]??(globalThis[$n]=new Map);function ot(e,t){No.set(e,t)}function Ro(e){return No.get(e)}function Lu(e,t,n){let r=typeof t=="string"?Ro(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&C(e,o)}var Lo=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},_o=["pointerup","pointerleave","pointercancel"],Mo=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let u=l.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of _o)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of _o)e.removeEventListener(l,a)}},Oo=(e,t)=>{let n=o=>L(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},Po=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Do=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};ot("clickOutside",Lo);ot("longPress",Mo);ot("copyOnClick",Oo);ot("autoResize",Po);ot("trapFocus",Do);function Ht(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var Ke=null;function Mu(e,t){try{let n=e(),r=Ht(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Ke?Ke(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Ke?Ke(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Ou(e,t){try{return await e()}catch(n){return t?t(n,"async"):Ke?Ke(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Pu(e){Ke=e}function Du(e,t){let n=typeof t=="function"?t():t;return C(n,K(()=>{n.style.display=e()?"":"none"},n)),n}function Ho(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function $o(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,l=r.has(s),u=!a&&!l;return r.add(s),l&&void 0,t.nextSibling!==s&&e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function $t(e,t){t&&I(e),e.parentNode?.removeChild(e)}function In(e,t,n,r){re(),Ho(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=ge(),l=null,u,d=!1,p=!1,g=new WeakSet,b=!1,c=()=>{if(p)return;let h=e(),y=s.parentNode;if(!y||d&&Object.is(h,u))return;u=h;let v=l?ft([l]):null;l?.parentNode&&($t(l,b),l=null);let S=h?t:o!==void 0?o:null,x=pe(()=>X(a,()=>$o(y,s,S,g,"when")));l=x.node,b=x.owned,tt(v,l?[l]:[],"when",i),d=!0},f=Ve(c,s);return C(s,()=>{p=!0,f.stop(),l&&$t(l,b),l=null}),d||queueMicrotask(Q(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Hu(e,t,n,r){re(),Ho(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=ge(),l=null,u,d=!1,p=!1,g=new WeakSet,b=!1,c=()=>{if(p)return;let h=String(e()),y=s.parentNode;if(!y||d&&h===u)return;u=h;let v=l?ft([l]):null;l?.parentNode&&($t(l,b),l=null);let S=Object.hasOwn(t,h)?t[h]:o,x=pe(()=>X(a,()=>$o(y,s,S??null,g,"match")));l=x.node,b=x.owned,tt(v,l?[l]:[],"match",i),d=!0},f=Ve(c,s);return C(s,()=>{p=!0,f.stop(),l&&$t(l,b),l=null}),d||queueMicrotask(Q(()=>{!p&&!d&&s.parentNode&&f.run(c)})),s}function Io(e,t={}){let n=mt(),[r,o]=A(!n&&!ye());return!n&&!r()&&rr(()=>o(!0)),In(r,e,t.fallback)}function $u(e){let[t,n]=A(e),r=i=>{!!1||!ee()||(`${i}`,void 0)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let l=s();return!1,l}finally{n(a)}}}}var Bn=Symbol.for("sibujs.createId.v1"),jn=globalThis[Bn]??(globalThis[Bn]={n:0});function Bo(e="sibu"){let t=Cn();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(jn.n++,`${e}-${jn.n}`)}function jo(){jn.n=0}function bt(e,t){let n=globalThis;return n[e]??(n[e]=t())}var It=bt(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Vo=bt(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function Fo(){let[e,t]=Vo;t(pe(e)+1)}function Iu(e,t){It.set(e,t),Fo()}function Bu(e){It.delete(e)&&Fo()}function ju(e){let t=It.get(e);return t?t():P(`[Component "${e}" not found]`)}function Vu(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Vo[0](),a=It.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=pe(()=>a?a():P(`[Component "${s}" not found]`));r=l,ie(t,u)}let i=K(o,t,!0);return C(t,i),t}function zo(e){return typeof e=="function"?zo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Fu(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],u=0,d=n.length;for(;u<d;){let p=u+d>>1;e[n[p]]<l?u=p+1:d=p}n[u]=a,r[a]=u>0?n[u-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function zu(e,t,n){n&&n.key,re();let r=document.createComment("each:anchor"),o=ge(),i=document.createComment("each:end"),s=[],a=[],l=s,u=0,d=new Map,p=new Map,g=[],b=[],c=[],f=0,h=[],y=[],v=new Uint8Array(0),S=new Map,x=[],E=[],D=new Map,$=!1,q=!1,ne=!1,zt=n.key,_=()=>{if(ne)return;let O=e(),k=O.length,F=r.parentNode;if(!F)return;if(!q){let T=ye()?Wu(r):null;T?F.replaceChild(i,T):F.insertBefore(i,r.nextSibling),q=!0}y.length<k&&(y=new Array(k));for(let T=0;T<k;T++)y[T]=zt(O[T]);let ce=y;h.length<k&&(h=new Array(k)),p.clear(),D.clear();for(let T=0;T<k;T++)!1,D.set(ce[T],T);f=0;for(let T=0;T<k;T++){let G=ce[T],Un=d.get(G),at;if(Un!==void 0)at=Un,g[f]=at,b[f]=O[T],c[f]=T,f++;else{let[Kn,ci]=A(O[T]),[Jn,di]=A(T),qt;try{$e();try{qt=zo(X(tr(o,G),()=>t(Kn,Jn)))}finally{Ie()}}catch(fi){let pi=ce[T];qt=document.createComment(`each:error:${T}`),queueMicrotask(()=>{L(fi,{phase:"render",name:`each row (key="${String(pi)}")`,node:r.parentNode?r:void 0})})}at={node:qt,item:Kn,setItem:ci,index:Jn,setIndex:di}}p.set(G,at),h[T]=at.node}for(let[T,G]of d)p.has(T)||(I(G.node),G.node.parentNode&&F.removeChild(G.node));if(k===0){u=0;let T=d;d=p,p=T,$=!0,f=0;return}S.clear();for(let T=0;T<u;T++)S.set(l[T],T);x.length<k&&(x=new Array(k),E=new Array(k));let Z=0;for(let T=0;T<k;T++){let G=S.get(ce[T]);G!==void 0&&(x[Z]=T,E[Z]=G,Z++)}let U=Fu(E,Z);v.length<k?v=new Uint8Array(k):v.fill(0,0,k);for(let T=0;T<U.length;T++)v[x[U[T]]]=1;let J=i;for(let T=k-1;T>=0;T--){let G=h[T];v[T]||G.nextSibling!==J&&F.insertBefore(G,J),J=G}let ke=l===s?a:s;ke.length<k&&(ke.length=k);for(let T=0;T<k;T++)ke[T]=ce[T];l=ke,u=k;let Wt=d;d=p,p=Wt,$=!0,w()};function w(){if(f===0)return;let O=f;f=0,W(()=>{for(let k=0;k<O;k++){let F=g[k];F.setItem(b[k]),F.setIndex(c[k]),g[k]=void 0,b[k]=void 0}})}let N=Ve(_),R=N.stop;return C(r,()=>{if(!ne){ne=!0,R();for(let O of d.values())I(O.node),O.node.parentNode?.removeChild(O.node);i.parentNode&&i.parentNode.removeChild(i),q=!1,d.clear(),p.clear(),D.clear(),S.clear(),u=0,g.length=0,b.length=0,c.length=0,f=0}}),$||queueMicrotask(Q(()=>{!$&&!ne&&r.parentNode&&N.run(_)})),r}function Wu(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function qu(e){re();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||Wo(t,r);else Wo(t,n);return t}function Wo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),C(n,we(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Uu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),qo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Uo=new WeakMap;function Ku(e){let t=e.length-1,n=e[0];for(let b=0;b<t;b++)n+=`\0${b}\0${e[b+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let b=r;r++;let c=0;for(;r<o&&n.charCodeAt(r)!==0;)c=c*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,c<0||c>=t?(r=b,-1):c}function a(){let b=r;for(;r<o;){let c=n.charCodeAt(r);if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45)r++;else break}return n.slice(b,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let b=s();if(b>=0)return{kind:"expr",idx:b};let c=n[r];if(c==='"'||c==="'"){r++;let f=[],h=[],y="";for(;r<o&&n[r]!==c;){let v=s();v>=0?(f.push(y),y="",h.push(v)):y+=n[r++]}return r<o&&r++,f.push(y),h.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:h}}{let f=[],h=[],y="";for(;r<o;){let v=n.charCodeAt(r);if(v===32||v===9||v===10||v===13||v===62)break;let S=s();S>=0?(f.push(y),y="",h.push(S)):y+=n[r++]}return f.push(y),h.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:h}}}function u(){let b=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let c=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let f=n.slice(c,r);if(!f)break;let h=l();f.startsWith("on:")?h.kind==="expr"&&b.push({t:3,name:f.slice(3),idx:h.idx}):h.kind==="bool"?b.push({t:4,name:f}):h.kind==="static"?b.push({t:0,name:f,value:h.value}):h.kind==="expr"?b.push({t:1,name:f,idx:h.idx}):h.kind==="mixed"&&b.push({t:2,name:f,statics:h.statics,exprs:h.exprs})}return b}function d(b){return b.replace(/\s+/g," ")}function p(b){let c="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=d(c);y&&b.push({t:1,value:y}),c="",b.push({t:2,idx:h})}else c+=n[r++]}let f=d(c);f&&b.push({t:1,value:f})}function g(){let b=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let c=n[r+1];if(c==="!"){if(n.startsWith("<!--",r)){let S=n.indexOf("-->",r+4);r=S===-1?o:S+3}else if(n.startsWith("<![CDATA[",r)){let S=n.indexOf("]]>",r+9);r=S===-1?o:S+3}else{let S=n.indexOf(">",r);r=S===-1?o:S+1}continue}if(c==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(c>="a"&&c<="z")&&!(c>="A"&&c<="Z")){b.push({t:1,value:"<"}),r++;continue}r++;let f=a(),h=u();i();let y=Uu.has(f),v=n[r]==="/";if(v&&r++,r<o&&r++,y||v)b.push({t:0,el:{tag:f,svg:qo.has(f),attrs:h,children:[]}});else{let S=g();if(vr(f)){for(let x=0;x<S.length;x++)if(S[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),b.push({t:0,el:{tag:f,svg:qo.has(f),attrs:h,children:S}})}}else p(b);return b}return g()}function Vn(e,t){let n=lt(e.tag,e.svg?H:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:an(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?C(n,dt(n,i,s)):de(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}de(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:an(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Vn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),C(n,we(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Ko(e,...t){let n=Uo.get(e);return n||(n=Ku(e),Uo.set(e,n)),Go(n,t)}function Jo(e,t){return Go(e,t)}function Go(e,t){if(re(),e.length===1&&e[0].t===0)return Vn(e[0].el,t);let n=lt("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Vn(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),C(n,we(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function Ju(e,t,n){re();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&me()&&void 0;let a,l=null,u=!1,d=!1,p=()=>{if(d)return;let c=e(),f=r.parentNode;if(!f||u&&c===a)return;l?.parentNode&&f.removeChild(l),a=c;let h=o.get(c);if(h){let y=i.indexOf(c);y!==-1&&(i.splice(y,1),i.push(c))}else{let y=t[c];if(!y){l=null,u=!0;return}if(h=y(),h.nodeType===11){let v=document.createElement("div");v.style.display="contents",v.appendChild(h),h=v}if(o.set(c,h),i.push(c),s>0&&i.length>s){let v=i.shift(),S=o.get(v);S&&(I(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(v))}}f.insertBefore(h,r.nextSibling),l=h,u=!0},g=Ve(p),b=g.stop;return u||queueMicrotask(Q(()=>{!u&&r.parentNode&&g.run(p)})),C(r,()=>{d=!0,b();for(let c of o.values())I(c),c.parentNode&&c.parentNode.removeChild(c);o.clear(),i.length=0,l=null}),r}function Gu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=d=>{if(d instanceof DocumentFragment){let p=document.createComment(""),g=document.createComment("");d.insertBefore(p,d.firstChild),d.appendChild(g),o={start:p,end:g}}t.appendChild(d)},s;typeof e=="function"?s=lr(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&ue(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&ue(l,"app:unmount",{rootElement:s}),u){Yu(u.start,u.end);return}I(s),s.parentNode?.removeChild(s)}}}function Yu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=Se;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){Ae("mount",Se,1);return}I(a),a.parentNode===n&&n.removeChild(a)}s||L(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function Zu(e,t){re();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=Q(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{L(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),C(n,()=>{i=!0,o&&(I(o),o.remove(),o=null)}),n}function Xu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Yo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Qu(e=[]){let[t,n]=A([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=Yo(l,o,i),s.length===0&&i.length<=1?a:l}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function ec(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ue(r)||Qe(r)}function i(){if(Be(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let u=Yo(t,a,l);return(u.length>0||l.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let u=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let p=l(t[d]);Object.is(t[d],p)||(t[d]=p,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let u=0;u<t.length;u++){let d=a(t[u],u);Object.is(t[u],d)||(t[u]=d,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function tc(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[l,u]=A(0),d=0,p=!1,g=null,b=()=>{if(g===null)return;let f=g;g=null;try{f.abort()}catch{}},c=te(()=>{if(l(),p)return;b();let f=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,W(()=>{i(!0),a(null)});let y=()=>p||f!==d,v;try{v=e({signal:h?h.signal:void 0})}catch(S){if(y())return;W(()=>{a(S),i(!1)});return}v.then(S=>{y()||(g=null,W(()=>{r(S),i(!1)}))},S=>{y()||(g=null,W(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{p||u(f=>f+1)},dispose:()=>{p||(p=!0,c(),b())}}}function it(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,u]of e)if(!a.has(l)||!it(u,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>it(a,t[l],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&it(e.cause,a.cause,n)&&Zo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Zo(r,o,n)}function Zo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&it(e[i],t[i],n))}function nc(e){return A(e,{equals:(t,n)=>it(t,n)})}function Je(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let u=()=>{let c=e();o._v=r&&o._init&&r(o._v,c)?o._v:c,o._d=!1,o._init=!0};try{Xe(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,je(l),c}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,p=()=>{if(!o._d||s||a!==void 0)return;let c=o._v;i=!0;try{Le(u,l),Object.is(c,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&je(l)}d&&!s&&!Object.is(c,o._v)&&ue(d,"computed:update",{signal:o,oldValue:c,newValue:o._v})};o._validate=p;let g=()=>{let{error:c}=a;throw a=void 0,s&&(o._d=!1),c};function b(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return qr()||s?(o._d&&(p(),a!==void 0&&g()),o._v):(o._d&&(p(),a!==void 0&&(Be(o),g())),Be(o),o._v)}return n&&(b.__name=n,o.__name=n),b.__signal=o,b.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,je(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:b})}catch{}},d&&ue(d,"computed:create",{signal:o,name:n,getter:b}),b}function rc(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function Xo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function oc(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,d]=A(e[l]);Xo(t,l,[u,d])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let d=t[u][0];return d()}return Reflect.get(l,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(u=>{Xo(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;W(()=>{Object.entries(d).forEach(([p,g])=>{Object.hasOwn(t,p)&&t[p][1](g)})})},reset:()=>{W(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return te(()=>{let d=r();if(u){u=!1;return}$e();try{l(d)}finally{Ie()}})},subscribeKey:(l,u)=>{let d,p=!0;return te(()=>{let g=t[l][0]();if(p){d=g,p=!1;return}if(!Object.is(g,d)){let b=d;d=g,$e();try{u(g,b)}finally{Ie()}}})},getSnapshot:r}]}function ic(e,t){if(ee())return()=>{};let n,r=!0;return Xe(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,$e();try{t(s,a)}finally{Ie()}}})}function sc(e,t,n){return[Je(e,n),i=>{W(()=>t(i))}]}function ac(e){let t=e();return me()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function lc(e){if(!me())return te(e);let t=te(e),n=null;return queueMicrotask(()=>{try{n=te(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Qo(e,t){return ee()?()=>{}:K(e,t)}var Fn="data-sibu-enhanced",zn=new WeakMap;function ei(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=Se){let i=r.length-o+e.length;e.length=0,Ae(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var ti=["text","attr","class","show","on","cleanup"];function ni(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function ht(e,t){return Qo(t,e)}function uc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value}function cc(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function dc(e,t,n,r){let o=`ctx.each[${r}]`;if(me())for(let i of Object.keys(n))ti.includes(i),`${o}${i}${ti.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Bt(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(Fn)==="true")return me()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?!0:!1,l=(g,b,c)=>{if(a(g))return;let f=ni(n,b);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(b)} not found under`,n);return}c(f)},u={root:n,ref:g=>ni(n,g),refs:g=>{let b=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(b))}catch{return[]}},on:(g,b,c,f)=>{l("on",g,h=>{let y=v=>c(v,h);h.addEventListener(b,y,f),r.push(()=>h.removeEventListener(b,y,f))})},text:(g,b)=>{l("text",g,c=>{r.push(ht(c,()=>{let f=b(),h=f==null?"":String(f);c.textContent!==h&&(c.textContent=h)}))})},attr:(g,b,c)=>{l("attr",g,f=>{r.push(ht(f,()=>{let h=c(),y=h==null?null:String(h);de(f,b,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,b,c)=>{l("classed",g,f=>{r.push(ht(f,()=>{f.classList.toggle(b,!!c())}))})},show:(g,b)=>{l("show",g,c=>{let f=c.hidden;r.push(ht(c,()=>{c.hidden=!b()})),r.push(()=>{c.hidden=f})})},model:(g,b,c)=>{l("model",g,f=>{let h=f,[y,v]=b,S=c?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(ht(f,()=>{cc(h,y())}));let x=()=>v(uc(h));h.addEventListener(S,x),r.push(()=>h.removeEventListener(S,x))})},each:(g,b)=>{if(a("each"))return;let c=typeof g=="string"?u.refs(g):Array.from(g);for(let f=0;f<c.length;f++){let h=c[f],y=b(h,f);y!=null&&dc(u,h,y,f)}},cleanup:g=>{a("cleanup")||r.push(g)}},d;try{d=t(u);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,b=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw ei(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let p=()=>{i||(i=!0,zn.get(n)===o&&(zn.delete(n),n.removeAttribute(Fn)),ut(n,p),ei(r,"enhance"),s=!0)};return C(n,p),zn.set(n,o),n.setAttribute(Fn,"true"),p}function fc(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Bt(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var pc=/^[A-Za-z0-9_-]+$/,ri=Symbol.for("sibujs.islands.lazy"),jt=bt(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function mc(e){return e[ri]=!0,e}function gc(e,t){if(!pc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);jt.set(e,t)}function bc(e){jt.delete(e)}async function hc(e){if(typeof e=="function"&&e[ri]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function yc(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!jt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let d=jt.get(s);d&&hc(d).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Bt(i,p);if(o){g();return}r.push(g),i.setAttribute("data-sibu-hydrated","true")}catch(g){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,g)}}}).catch(p=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,p)})},u=i.getAttribute("data-sibu-load")||"load";n.push(Sc(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Sc(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}var vc=new Set(["__proto__","constructor","prototype"]);function Wn(e){return vc.has(e)}function Vt(e){let t={};for(let n of Object.keys(e))Wn(n)||(t[n]=e[n]);return t}function oi(e){return e}var Bm=1024*1024;function xc(e){let[t,n]=A(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=Xe(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var ii=16;function wc(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:ii*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ii)}function Tc(){let[e,t]=A(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),L(l,{phase:"async",name:"transition"})};wc(()=>{try{let l=Ht(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Ec(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Ft={};Gn(Ft,{RenderProp:()=>Dc,assertType:()=>zc,compose:()=>Pc,createGuard:()=>Wc,createSlots:()=>$c,defineComponent:()=>Ic,defineSlottedComponent:()=>Bc,defineStrictComponent:()=>Fc,globalStore:()=>Lc,machine:()=>kc,optimistic:()=>Ac,optimisticList:()=>_c,persisted:()=>Cc,timeline:()=>Nc,validateProps:()=>ui,validators:()=>Vc,withBoundary:()=>Hc,withDefaults:()=>Oc,withProps:()=>jc,withWrapper:()=>Mc});function st(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function kc(e){let[t,n]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],l=!1;function u(){l=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{l=!1}}function d(f){let h=st(e.states,i);if(!h?.on)return;let y=st(h.on,f);if(!y)return;let v,S,x;typeof y=="string"?v=y:(v=y.target,S=y.guard,x=y.action);let E=s;if(S&&!S(E))return;h.exit&&h.exit(E);let D=E;if(x){let q=x(E);D={...E,...Vt(q)}}i=v,s=D,W(()=>{x&&o(D),n(v)});let $=st(e.states,v);$?.entry&&$.entry(s)}function p(f){a.push(f),!l&&u()}let g=st(e.states,e.initial);if(g?.entry){l=!0;try{g.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&u()}function b(f){return t()===f}function c(f){let h=t(),y=st(e.states,h);if(!y?.on)return!1;let v=st(y.on,f);return v?typeof v=="string"?!0:v.guard?v.guard(r()):!0:!1}return{state:t,context:r,send:p,matches:b,can:c}}function Cc(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,v)=>Wn(y)?void 0:v,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,l=n.decrypt,u=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){l&&(y=l(y));let v=s(y);d=n.validate&&!n.validate(v)?t:v}}catch{}let[p,g]=A(d),b=!1,c=te(()=>{let y=p();if(!b)try{let v=o(y);a&&(v=a(v)),r?.setItem(e,v)}catch{}}),f=null;return u&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){b=!0;try{g(t)}finally{b=!1}return}try{let v=y.newValue;l&&(v=l(v));let S=s(v);if(n.validate&&!n.validate(S))return;b=!0;try{g(S)}finally{b=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(g,"dispose",{value:()=>{c(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[p,g]}function Ac(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(l,u){let d=++s,p=t();n(l),i++,o(!0);try{let g=await u();s===d&&n(g)}catch{s===d&&n(p)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function _c(e){let t=0,n=0,r=0,o=new Map,i=[];for(let _ of e){let w={id:t++,key:n++,base:_,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(_){let w=_.claims;return w.length>0?w[w.length-1].value:_.base}function a(_,w){let N=_.claims;for(let R=N.length-1;R>=0;R--)if(N[R].opId<w)return N[R].value;return _.base}function l(_,w,N){let R={opId:w,value:N,settled:!1},j=_.claims,O=j.length;for(;O>0&&j[O-1].opId>w;)O--;return j.splice(O,0,R),R}function u(_,w){let N=_.claims.indexOf(w);N!==-1&&_.claims.splice(N,1)}function d(_){let w=_.claims,N=0;for(;N<w.length&&w[N].settled;)_.base=w[N].value,N++;N>0&&w.splice(0,N)}let[p,g]=A(i.map(_=>s(o.get(_)))),[b,c]=A(!1),f=0,h=new Set;function y(){let _=new Array(i.length);for(let w=0;w<i.length;w++)_[w]=s(o.get(i[w]));return _}function v(_){W(()=>{let w=!1;try{w=_()}finally{c(f>0),w&&g(y())}})}function S(_){let w=o.get(_);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(N=>N!==_),!0)}function x(_){let w=[];for(let k of _){let F=o.get(k);!F||F.visible||h.has(k)||w.push(k)}if(w.length===0)return!1;let N=new Array(i.length+w.length),R=0,j=0,O=0;for(;R<i.length&&j<w.length;){let k=o.get(i[R]).key,F=o.get(w[j]).key;N[O++]=k<=F?i[R++]:w[j++]}for(;R<i.length;)N[O++]=i[R++];for(;j<w.length;)N[O++]=w[j++];for(let k of w)o.get(k).visible=!0;return i=N,!0}function E(_){for(let w of _){let N=o.get(w);N&&N.refs++}}function D(_){for(let w of _){let N=o.get(w);N&&(N.refs--,N.refs<=0&&!N.visible&&(o.delete(w),h.delete(w)))}}function $(_){if(D(_),f--,f<=0&&(f=0,h.clear(),o.size!==i.length))for(let[w,N]of o)N.visible||o.delete(w)}async function q(_,w){let N=++r,R={id:t++,key:n++,base:_,claims:[],visible:!1,refs:1},j=l(R,N,_);v(()=>(o.set(R.id,R),R.visible=!0,i=[...i,R.id],f++,!0));let O,k=!1;try{O=await w()}catch{k=!0}v(()=>{try{if(k)return h.add(R.id),u(R,j),S(R.id);let F=s(R);return j.value=O,j.settled=!0,d(R),R.visible&&!Object.is(F,s(R))}finally{$([R.id])}})}async function ne(_,w){let N=++r,R=[];for(let O of i)_(a(o.get(O),N))&&R.push(O);v(()=>{if(E(R),f++,R.length===0)return!1;let O=new Set(R);for(let k of R){let F=o.get(k);F&&(F.visible=!1)}return i=i.filter(k=>!O.has(k)),!0});let j=!1;try{await w()}catch{j=!0}v(()=>{try{if(!j){for(let O of R)h.add(O);return!1}return x(R)}finally{$(R)}})}async function zt(_,w,N){let R=++r,j=[];for(let Z of i){let U=o.get(Z),J=a(U,R);_(J)&&j.push({row:U,nextValue:{...J,...w}})}let O=j.map(Z=>Z.row.id),k=[];v(()=>{E(O),f++;let Z=!1;for(let U of j){let J=s(U.row);k.push(l(U.row,R,U.nextValue)),U.row.visible&&!Object.is(J,s(U.row))&&(Z=!0)}return Z});let F,ce=!1;try{F=await N()}catch{ce=!0}v(()=>{try{let Z=!1;for(let U=0;U<k.length;U++){let J=j[U].row,ke=k[U],Wt=s(J);ce?u(J,ke):(ke.value=F,ke.settled=!0),d(J),J.visible&&!Object.is(Wt,s(J))&&(Z=!0)}return Z}finally{$(O)}})}return{items:p,pending:b,add:q,remove:ne,update:zt}}function Nc(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=A([e]),[o,i]=A(0),s=Je(()=>n()[o()]),a=Je(()=>o()>0),l=Je(()=>o()<n().length-1);function u(f){let h=s(),y=typeof f=="function"?f(h):f;if(Object.is(y,h))return;let v=n(),S=o(),x=v.slice(0,S+1);x.push(y),W(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(S+1))})}function d(){a()&&i(o()-1)}function p(){l()&&i(o()+1)}function g(){W(()=>{r([e]),i(0)})}function b(f){let h=n();f>=0&&f<h.length&&i(f)}function c(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:u,undo:d,redo:p,canUndo:a,canRedo:l,history:n,index:o,reset:g,jumpTo:b,dispose:c}}var ai=Promise.prototype.then;function si(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(ai,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function li(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(c){return{promise:Promise.reject(c),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((c,f)=>{n=c,r=f}),i="invoking",s,a=[],l=c=>{if(i=c,c!=="invoking")for(let f of a.splice(0))f()},u=c=>{n(c),l("fulfilled")},d=c=>{r(c),l("rejected")},p=c=>{if(c===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(c===null||typeof c!="object"&&typeof c!="function"){u(c);return}let f;try{f=c.then}catch(h){d(h);return}if(typeof f!="function"){u(c);return}g(c,f)},g=(c,f)=>{f===ai?(s=c,l("native")):l("invoking"),queueMicrotask(()=>{let h=!1,y=S=>{h||(h=!0,p(S))},v=S=>{h||(h=!0,d(S))};try{Reflect.apply(f,c,[y,v])}catch(S){v(S)}!h&&i==="invoking"&&l("pending")})};return g(e,t),{promise:o,failedEarly:!1,probe:(c,f)=>{let h=()=>{i==="native"?si(s,c,f):(i==="rejected"?c:f)()};i==="native"?si(s,c,f):i==="invoking"?a.push(h):queueMicrotask(i==="rejected"?c:f)}}}function Rc(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function Lc(e){let t=Rc(e.state),[n,r]=A({...t}),o=new Map,i=e.middleware||[];function s(c){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(c)}catch(h){L(h,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function u(c,f=!0){if(a.push(c),l)return;l=!0;let h,y=!1;try{let v=!0,S=0;for(;S<a.length;){let x=a[S];a[S++]=void 0;try{x()}catch(E){v&&f?(y=!0,h=E):L(E,{phase:"event",name:"globalStore(dispatch)"})}v=!1}}finally{a.length=0,l=!1}if(y)throw h}function d(c,f){let h=e.actions[c];if(!h)throw new Error(`Unknown action: ${String(c)}`);let y=()=>{let v=n(),S=h(v,f),x=Vt(S);r({...v,...x}),s(n())};u(()=>{if(i.length===0){y();return}let v=S=>{if(S>=i.length){y();return}let x=!1,E=!1,D=!0,$=()=>{if(E&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,D){v(S+1);return}let ne=()=>u(()=>v(S+1),!1);if(!q){ne();return}q.probe(()=>{E=!0,!1},ne)},q=null;try{q=li(i[S](n(),String(c),f,$))}catch(ne){throw E=!0,ne}finally{D=!1}q&&(q.failedEarly&&(E=!0),q.promise.then(void 0,ne=>{E=!0,L(ne,{phase:"async",name:"globalStore(middleware)"})}))};v(0)})}function p(c){return()=>c(n())}function g(c){let f=o.get(c);f||(f={callback:c,active:!0},o.set(c,f));let h=f;return()=>{o.get(c)===h&&(h.active=!1,o.delete(c))}}function b(){u(()=>{r({...t}),s(n())})}return{getState:n,select:p,dispatch:d,subscribe:g,reset:b}}function Mc(e,t){return n=>t(e,n)}function Oc(e,t){return n=>e({...t,...n})}function Pc(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Dc(e){return e.render(e.data())}function Hc(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function $c(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function Ic(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Bc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function jc(e,t){return n=>e(t(n))}var Vc={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function ui(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function Fc(e){return t=>{let n=ui(t,e.props);return e.setup(n)}}function zc(e,t,n){}function Wc(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...Ft,...qn,patterns:Ft});})();
|
|
399
|
+
`,Gi=!1;function cd(){!Gi&&typeof document<"u"&&(document.head.appendChild(dt({nodes:ud})),Gi=!0)}function dd(e={}){cd();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?U({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[U({class:"sibu-loading-dots"},[Q({class:"sibu-loading-dot"}),Q({class:"sibu-loading-dot"}),Q({class:"sibu-loading-dot"})]),t?Q({class:"sibu-loading-text"},t):null]):U({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[U({class:"sibu-loading-spinner"}),t?Q({class:"sibu-loading-text"},t):null])}var Kr=Symbol.for("sibujs.actions.v1"),Xi=globalThis[Kr]??(globalThis[Kr]=new Map);function Ot(e,t){Xi.set(e,t)}function Zi(e){return Xi.get(e)}function fd(e,t,n){let r=typeof t=="string"?Zi(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&D(e,o)}var Qi=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},Yi=["pointerup","pointerleave","pointercancel"],es=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=l=>{let u=l.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=l=>{r!==null&&l.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let l of Yi)e.addEventListener(l,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let l of Yi)e.removeEventListener(l,a)}},ts=(e,t)=>{let n=o=>H(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},ns=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},rs=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Ot("clickOutside",Qi);Ot("longPress",es);Ot("copyOnClick",ts);Ot("autoResize",ns);Ot("trapFocus",rs);function Pt(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var mt=null;function pd(e,t){try{let n=e(),r=Pt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):mt?mt(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):mt?mt(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function md(e,t){try{return await e()}catch(n){return t?t(n,"async"):mt?mt(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function gd(e){mt=e}var An=5e3;function Le(){return typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now()}var Jr=50,hd=1,os=["transitionend","transitioncancel","animationend","animationcancel"];function Cn(e,t){return(e?.trim()?e:t).split(",").map(n=>n.trim())}function kn(e){return Cn(e,"0s").map(t=>(Number.parseFloat(t)||0)*(t.endsWith("ms")?1:1e3))}function bd(e){if(typeof getComputedStyle!="function")return null;let t=getComputedStyle(e);if(t.display==="none")return null;let n={total:0,transitions:new Map,animations:new Map,pending:0},r=(o,i,s,a,l)=>{for(let u=0;u<i.length;u++){let d=s[u%s.length];if(i[u]==="none"||d<=0)continue;let g=l[u%l.length],p=g==="infinite"?Number.POSITIVE_INFINITY:Number.parseFloat(g)||1;n.total=Math.max(n.total,a[u%a.length]+d*p),o.set(i[u],(o.get(i[u])??0)+1),n.pending++}};return r(n.transitions,Cn(t.transitionProperty,"all"),kn(t.transitionDuration),kn(t.transitionDelay),["1"]),r(n.animations,Cn(t.animationName,"none"),kn(t.animationDuration),kn(t.animationDelay),Cn(t.animationIterationCount,"1")),n.total<=hd?null:n}function yd(e,t){if(typeof t!="string"||t==="")return e.keys().next().value;if(e.has(t))return t;for(let n of e.keys())if(t.startsWith(`${n}-`))return n;return e.has("all")?"all":void 0}function vd(e,t){for(let n of e)if(n!==t&&n.contains(t))return!0;return!1}function Gr(e,t,n,r,o,i,s=0){let a=Math.min(typeof r=="number"&&r>=0?r:An,An),l=[];for(let T=0;T<e.length;T++)e[T].nodeType===1&&l.push(e[T]);let u=!1,d=null,g=[],p=T=>{if(!u){u=!0,d!==null&&clearTimeout(d);for(let L=0;L<g.length;L++)g[L]();T&&o()}},m=T=>H(T,{phase:"async",name:i,node:l[0]});if(n){let T;try{T=n(e)}catch(F){m(F)}let L=Pt(T);return L===null?(o(),null):(L.then(()=>p(!0),F=>{m(F),p(!0)}),d=setTimeout(()=>p(!0),a),{cancel:()=>p(!1)})}let c=s>0;if(!t||l.length===0&&!c)return o(),null;for(let T=0;T<l.length;T++)l[T].classList.add(t);g.push(()=>{for(let T=0;T<l.length;T++)l[T].classList.remove(t)});let f=Le()+a,b=0,y=T=>{let L=Math.min(T,f);d!==null&&L<=b||(d!==null&&clearTimeout(d),b=L,d=setTimeout(()=>p(!0),Math.max(0,L-Le())))},x=0,v=new Set,C=T=>{let L=bd(T);if(L===null)return-1;let F=typeof T.getAnimations=="function"?T.getAnimations():null;if(F!==null){if(F.length===0)return-1;x++,v.add(T);let M=F.length,q=()=>{M===0||--M!==0||(v.delete(T),!u&&--x===0&&!c&&p(!0))};for(let S of F)S.finished.then(q,q);return L.total}x++,v.add(T);let te=!1,O=null,R=()=>{te||(te=!0,O!==null&&clearTimeout(O),v.delete(T),!u&&--x===0&&!c&&p(!0))},$=M=>{if(M.target!==T||te||L.pending===0)return;let q=M.type==="transitionend"||M.type==="transitioncancel",S=q?L.transitions:L.animations,k=yd(S,M[q?"propertyName":"animationName"]);if(k===void 0)return;let E=S.get(k)-1;E>0?S.set(k,E):S.delete(k),--L.pending===0&&R()};for(let M of os)T.addEventListener(M,$);return Number.isFinite(L.total)&&(O=setTimeout(R,L.total+Jr)),g.push(()=>{O!==null&&clearTimeout(O);for(let M of os)T.removeEventListener(M,$)}),L.total},w=-1;for(let T=0;T<l.length;T++)w=Math.max(w,C(l[T]));if(x===0&&!c)return p(!0),null;x>0&&y(Le()+w+Jr);let N=()=>{c=!1,!u&&x===0&&p(!0)};if(c){y(Le()+s);let T=setTimeout(N,Math.max(0,Math.min(Le()+s,f)-Le()));g.push(()=>clearTimeout(T))}return{cancel:()=>p(!1),close:N,add:T=>{if(!u)for(let L=0;L<T.length;L++){let F=T[L];if(l.includes(F)||vd(v,F))continue;F.classList.add(t),l.push(F);let te=C(F);te>=0&&y(Le()+te+Jr)}}}}function Sd(e,t){let n=typeof t=="function"?t():t;return D(n,oe(()=>{n.style.display=e()?"":"none"},n)),n}function as(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}var is=new WeakMap,ls=new WeakMap,Yr=new WeakMap,wd=8,ae=()=>{};function xd(e,t,n){let r=typeof e=="function"?e():e;if(r==null||typeof r=="boolean")return null;let o=r instanceof Node?r:document.createTextNode(String(r)),i=o===e,s=t.has(o),a=!i&&!s;t.add(o),s&&void 0;let l;o.nodeType===11?o.firstChild?(l=Array.from(o.childNodes),is.set(o,l)):l=is.get(o)??[]:l=[o];let u=a?void 0:Yr.get(o),d=u?.firstChild?Array.from(u.childNodes):!a&&l.every(g=>g.parentNode===null)&&ls.get(o)||Td(l);return d.length===0&&!a?null:{source:o,starts:l,nodes:d,owned:a,owner:null,phase:null,restore:null,unhold:null,waiting:!1,released:!1,inserting:!1}}function Td(e){return e.some(Vt)?[...new Set(e.flatMap(t=>t.parentNode===null?[t]:jt([t])))]:e}function gt(e){let t=e.starts;if(t.length===1&&(!Vt(t[0])||t[0].parentNode===null))return;let n=jt(t);e.nodes=e.owned&&e.inserting?[...new Set([...e.nodes,...n])]:n,e.owned||ls.set(e.source,e.nodes)}function Ed(e,t,n){let r=e;for(let o=0;o<t.length;o++){if(!n())return!1;let i=e.parentNode;if(i===null)return!1;let s=t[o];r.parentNode!==i&&(r=e),r.nextSibling!==s&&i.insertBefore(s,r.nextSibling),r=s}return n()}function Dt(e){if(e.released)return;e.released=!0,gt(e),e.phase!==null&&(e.phase.cancel(),e.phase=null),e.restore!==null&&(e.restore(),e.restore=null);let t=e.nodes,n;!e.owned&&(e.source.nodeType===11||e.starts.some(Vt))&&(n=Yr.get(e.source),n===void 0&&Yr.set(e.source,n=document.createDocumentFragment()));for(let r=0;r<t.length;r++){let o=t[r];e.owned&&j(o),n!==void 0?n.appendChild(o):o.parentNode?.removeChild(o)}e.owned&&e.source.nodeType===11&&j(e.source),e.owner!==null&&(e.owned?e.owner.stop():e.owner.thaw?.(),e.owner=null),e.unhold!==null&&(e.unhold(),e.unhold=null)}function kd(e,t){let n=[],r=new Set,o=l=>{for(let u=0;u<l.length;u++){if(l[u].nodeType!==1||r.has(l[u]))continue;let d=l[u];r.add(d),n.push([d,d.getAttribute("inert"),d.getAttribute("aria-hidden")]),d.setAttribute("inert",""),d.setAttribute("aria-hidden","true")}},i=typeof document<"u"?document.activeElement:null;o(e.nodes);let s=n.length;for(let l=0;l<s;l++){let u=n[l][0];if(i&&(u===i||u.contains(i))){i.blur?.();break}}let a=us(e,l=>{let u=n.length;o(l),n.length>u&&t(n.slice(u).map(d=>d[0]))});return()=>{a();for(let l=0;l<n.length;l++){let[u,d,g]=n[l];d===null?u.removeAttribute("inert"):u.setAttribute("inert",d),g===null?u.removeAttribute("aria-hidden"):u.setAttribute("aria-hidden",g)}}}function us(e,t){let n=e.nodes[0]?.parentNode;if(!n||typeof MutationObserver!="function"||!e.starts.some(Vt))return ae;let r=new Set(e.nodes),o=new MutationObserver(()=>{gt(e);let i=[];for(let s of e.nodes)r.has(s)||(r.add(s),s.nodeType===1&&i.push(s));i.length>0&&t(i)});return o.observe(n,{childList:!0}),()=>o.disconnect()}function Cd(e){let t=Le()+e,n={expired:!1,remaining:()=>n.expired?0:Math.max(0,Math.min(e,t-Le())),onExpire:null,stop:()=>{clearTimeout(r),n.onExpire=null}},r=setTimeout(()=>{n.expired=!0;let o=n.onExpire;n.onExpire=null,o?.()},e);return n}function ss(e,t){if(typeof MutationObserver!="function")return null;let n=new MutationObserver(t),r=new Set,o=()=>{let i=e.nodes[0]?.parentNode;i&&!r.has(i)&&(r.add(i),n.observe(i,{childList:!0}));for(let s of e.nodes)s.nodeType!==1||r.has(s)||(r.add(s),n.observe(s,{childList:!0,subtree:!0}))};return o(),{refresh:o,stop:()=>{n.disconnect(),r.clear()}}}function cs(e,t,n,r){let o=r?.focus,i=r?.transition!==void 0&&!xe()?r.transition:void 0,s=document.createComment(e),a=Me(),l=we(),u=null,d,g=!1,p=!1,m=new WeakSet,c=[],f=!1,b=null,y=ae,x=(S,k)=>{let E=Se(ae,s),P=K=>E.run(()=>Re(()=>ce(a,K))),A;try{A=P(()=>xd(S,m,e))}catch(K){throw E.stop(),K}if(A===null)return E.stop(),null;let B=A.owned;if(B&&(A.owner=E),p||!k()||u!==null)return Dt(A),B||E.stop(),null;let z=null;if(i){for(let K=0;K<c.length;K++)if(c[K].source===A.source){z=c.splice(K,1)[0],A.owner=z.owner,z.owner=null;break}}u=A,A.inserting=!0;let W=!1;try{if(z!==null){let Z=z;Z.phase!==null&&Z.phase.cancel(),Z.phase=null,Z.restore!==null&&Z.restore(),Z.restore=null;let _=Z.unhold;Z.unhold=null,A.owner?.thaw?.(),_?.(),A.released||gt(A)}let K=()=>!p&&k()&&u===A&&!A.released;W=K()&&P(()=>Ed(s,A.nodes,K))}catch(K){throw A.inserting=!1,u===A&&(u=null),Dt(A),B||E.stop(),K}return A.inserting=!1,W&&P(()=>Ni(A.nodes)),B||E.stop(),u===A&&!A.released&&k()?A:null},v=(S,k,E,P=ae)=>{let A=!0,B=null,z=()=>{A&&(A=!1,P())},W={cancel:()=>{z(),B?.cancel()}};return S.phase=W,B=k(()=>{!A||S.phase!==W||(A=!1,S.phase=null,E())}),A&&S.phase===W&&!S.released&&!p&&B!==null?(W.add=B.add,W.close=B.close,W):(z(),S.phase===W&&(S.phase=null),B?.cancel(),null)},C=S=>{if(S.waiting=!1,S.released||p)return;let k=i;v(S,E=>Gr(S.nodes,k.leaveClass,k.leave,k.maxDuration,E,`${e}(leave)`),()=>T(S))},w=()=>{for(let S of[...c]){if(p)return;S.waiting&&C(S)}},N=S=>{if(S.released)return;let k=i;S.phase!==null&&(S.phase.cancel(),S.phase=null),gt(S),S.owner!==null&&(S.owner.freeze?.(),S.unhold=dn({contains:P=>S.nodes.some(A=>A===P||A.contains(P))}));let E=kd(S,P=>S.phase?.add?.(P));if(S.released){E();return}if(S.restore=E,k.mode==="in-out"){w(),S.waiting=!0,c.push(S);return}c.push(S),C(S)},T=S=>{let k=c.indexOf(S);k!==-1&&c.splice(k,1),Dt(S),f&&c.length===0&&!p&&O()},L=(S,k)=>{if(k())return;let E=i,P=u;P!==null&&(!S||E.appear===!0)&&(F(P),k()||P.phase!==null)||E.mode==="in-out"&&w()},F=S=>{let k=i,E=typeof k.waitForContent=="number"&&k.waitForContent>0?k.waitForContent:0,P=E>0?Cd(Math.min(E,An)):null,A=()=>k.enter===void 0||P===null||P.expired||bn(S.nodes,S.owner).length===0;if(!l()&&!Tr(S.nodes)&&A()){te(S,P);return}let B=!1,z=!1,W=ae,K=ae,Z=null,_=0,X=()=>{W(),W=ae,K(),K=ae,Z?.stop(),Z=null,P!==null&&(P.onExpire=null)},Te={cancel:()=>{B=!0,X(),P?.stop()}};S.phase=Te;let re=()=>{if(!(B||p||u!==S||S.phase!==Te)){if(l()){W(),W=l.wait(re,ae);return}if(gt(S),Tr(S.nodes)&&++_<wd){queueMicrotask(re);return}if(!A()){z?Z?.refresh():(z=!0,K=Ar(()=>{_=0,re()}),Z=ss(S,re),P.onExpire=re);return}X(),S.phase=null,te(S,P)}};l()?re():queueMicrotask(re)},te=(S,k)=>{let E=i,P=E.enter===void 0&&k!==null&&!k.expired?k.remaining():0,A=P>0?bn(S.nodes,S.owner):[];A.length===0&&k?.stop();let B=ae,z=v(S,Te=>Gr(S.nodes,E.enterClass,E.enter,E.maxDuration,Te,`${e}(enter)`,A.length>0?P:0),()=>{B(),E.mode==="in-out"&&!p&&w()},()=>B()),W=z?.add;if(z===null||W===void 0){k?.stop();return}let K=us(S,W),Z=ae,_=null,X=()=>{Z(),Z=ae,_?.stop(),_=null,k?.stop()};if(A.length>0){let Te=k,re=Dn=>{if(Te.expired||Z===ae){X();return}gt(S);let Hn=ze=>S.nodes.some(Ge=>Ge===ze||Ge.contains(ze));for(let ze of Dn){if(ze.cancelled||!Cr(ze,S.nodes,S.owner))continue;let Ge=_i(ze).filter(Hn);Ge.length>0&&W(Ge)}bn(S.nodes,S.owner).length===0?(X(),z.close?.()):_?.refresh()};Z=Ar(re),_=ss(S,()=>re(Ri())),Te.onExpire=X}B=()=>{K(),X()}},O=ie(()=>{if(p||!f)return;if(l()){y(),y=l.wait(()=>{y=ae,f&&!p&&O()},ae);return}f=!1;let S=b;b=null;let k=$,E=()=>p||k!==R;if(E()||!s.parentNode||u!==null)return;let P;try{P=q.run(()=>x(n(d),()=>!E()))}catch(A){H(A,{phase:"render",name:e,node:s});return}E()||(Nt(S,P!==null?P.nodes:[],e,o),L(!1,E))}),R=0,$=0,M=()=>{if(p)return;let S=t();if(!s.parentNode||g&&Object.is(S,d))return;d=S;let k=!g;g=!0;let E=++R,P=()=>p||E!==R;u!==null&>(u);let A=u!==null?fn(u.nodes):null;if(u!==null){let z=u;if(i?N(z):Dt(z),u===z&&(u=null),P())return}let B=n(S);if(i?.mode==="out-in"&&c.length>0){let z=!1;for(let W=0;W<c.length&&!z;W++)z=c[W].source===B;if(!z){f=!0,$=E,b??(b=A);return}}f=!1,x(B,()=>!P()),!P()&&(Nt(A,u!==null?u.nodes:[],e,o),i&&L(k,P))},q=Se(M,s);return ct(s,()=>{for(let S=0;S<=c.length;S++){let k=S<c.length?c[S]:u;if(k===null)break;let E=jt(k.starts);if(E.length>0)return E[E.length-1]}return null}),D(s,()=>{p=!0,f=!1,b=null,y(),y=ae,q.stop(),u!==null&&Dt(u),u=null;let S=c.splice(0);for(let k=0;k<S.length;k++)Dt(S[k])}),g||_t(s,ie(()=>{!p&&!g&&s.parentNode&&q.run(M)}),l),s}function Xr(e,t,n,r){ue(),as(n)&&(r=n,n=void 0);let o=n;return cs("when",e,i=>i?t:o!==void 0?o:null,r)}function Ad(e,t,n,r){ue(),as(n)&&(r=n,n=void 0);let o=n;return cs("match",()=>String(e()),i=>Object.hasOwn(t,i)?t[i]:o??null,r)}function ds(e,t={}){let n=xe(),[r,o]=I(!n&&!ke());return!n&&!r()&&wo(()=>o(!0)),Xr(r,e,t.fallback)}function Nd(e){let[t,n]=I(e),r=i=>{!!1||!le()||(`${i}`,void 0)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let l=s();return!1,l}finally{n(a)}}}}var Zr=Symbol.for("sibujs.createId.v1"),Qr=globalThis[Zr]??(globalThis[Zr]={n:0});function fs(e="sibu"){let t=wr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Qr.n++,`${e}-${Qr.n}`)}function ps(){Qr.n=0}var Nn=he(Symbol.for("sibujs.components.registry.v1"),()=>new Map),ms=he(Symbol.for("sibujs.components.registryVersion.v1"),()=>I(0));function gs(){let[e,t]=ms;t(Re(e)+1)}function _d(e,t){Nn.set(e,t),gs()}function Rd(e){Nn.delete(e)&&gs()}function Ld(e){let t=Nn.get(e);return t?t():U(`[Component "${e}" not found]`)}function Md(e){let t=U({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(ms[0](),a=Nn.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=Re(()=>a?a():U(`[Component "${s}" not found]`));r=l,Pe(t,u)}let i=oe(o,t,!0);return D(t,i),t}function bs(e){return typeof e=="function"?bs(e()):e instanceof Node?e:document.createTextNode(String(e))}function Od(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],u=0,d=n.length;for(;u<d;){let g=u+d>>1;e[n[g]]<l?u=g+1:d=g}n[u]=a,r[a]=u>0?n[u-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}var _n=null,eo=new Set;function hs(e){let t=e.__signal,n=e;return n.peek=()=>t.value,n}function Pd(e,t,n){n&&n.key,ue();let r=document.createComment("each:anchor"),o=Me(),i=document.createComment("each:end"),s=[],a=[],l=s,u=0,d=new Map,g=new Map,p=[],m=[],c=[],f=0,b=[],y=[],x=new Uint8Array(0),v=new Map,C=[],w=[],N=new Map,T=!1,L=!1,F=!1,te=n.key,O=()=>{if(F)return;let k=e(),E=k.length,P=r.parentNode;if(!P)return;if(!L){let _=ke()?Dd(r):null;_?P.replaceChild(i,_):P.insertBefore(i,r.nextSibling),L=!0}y.length<E&&(y=new Array(E));for(let _=0;_<E;_++)y[_]=te(k[_]);let A=y;b.length<E&&(b=new Array(E)),g.clear(),N.clear();for(let _=0;_<E;_++)!1,N.set(A[_],_);f=0;for(let _=0;_<E;_++){let X=A[_],Te=d.get(X),re;if(Te!==void 0)re=Te,p[f]=re,m[f]=k[_],c[f]=_,f++;else{let[Dn,Hn]=I(k[_]),[ze,Ge]=I(_),$n=hs(Dn),In=hs(ze),Bn=null,lo=$n,uo=In,co=null;let zn;try{nt(),co=_n,_n=Bn;try{zn=bs(ce(vo(o,X),()=>t(lo,uo)))}finally{rt(),_n=co}}catch(bt){let Gt=A[_];zn=document.createComment(`each:error:${_}`),queueMicrotask(()=>{H(bt,{phase:"render",name:`each row (key="${String(Gt)}")`,node:r.parentNode?r:void 0})})}re={node:zn,item:$n,setItem:Hn,index:In,setIndex:Ge,reads:Bn}}g.set(X,re),b[_]=re.node}for(let[_,X]of d)g.has(_)||(j(X.node),X.node.parentNode&&P.removeChild(X.node));if(E===0){u=0;let _=d;d=g,g=_,T=!0,f=0;return}v.clear();for(let _=0;_<u;_++)v.set(l[_],_);C.length<E&&(C=new Array(E),w=new Array(E));let B=0;for(let _=0;_<E;_++){let X=v.get(A[_]);X!==void 0&&(C[B]=_,w[B]=X,B++)}let z=Od(w,B);x.length<E?x=new Uint8Array(E):x.fill(0,0,E);for(let _=0;_<z.length;_++)x[C[z[_]]]=1;let W=i;for(let _=E-1;_>=0;_--){let X=b[_];x[_]||X.nextSibling!==W&&P.insertBefore(X,W),W=X}let K=l===s?a:s;K.length<E&&(K.length=E);for(let _=0;_<E;_++)K[_]=A[_];l=K,u=E;let Z=d;d=g,g=Z,T=!0,R()};function R(){if(f===0)return;let k=f;f=0,ee(()=>{for(let E=0;E<k;E++){let P=p[E];P.reads!==null&&$(P,m[E],c[E]),P.setItem(m[E]),P.setIndex(c[E]),p[E]=void 0,m[E]=void 0}})}function $(k,E,P){}let M=Se(O,r),q=M.stop;if(D(r,()=>{if(!F){F=!0,q();for(let k of d.values())j(k.node),k.node.parentNode?.removeChild(k.node);i.parentNode&&i.parentNode.removeChild(i),L=!1,d.clear(),g.clear(),N.clear(),v.clear(),u=0,p.length=0,m.length=0,c.length=0,f=0}}),ct(r,()=>L?i:null),!T){let k=we();_t(r,ie(()=>{!T&&!F&&r.parentNode&&M.run(O)}),k)}return r}function Dd(e){let t=0;for(let n=e.nextSibling;n;n=n.nextSibling){if(n.nodeType!==8)continue;let r=n.data;if(r==="each:anchor")t++;else if(r==="each:end"){if(t===0)return n;t--}}return null}function Hd(e){ue();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||ys(t,r);else ys(t,n);return t}function ys(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),D(n,$e(n,t,!0));return}e.appendChild(document.createTextNode(String(t)))}var $d=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),vs=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Ss=new WeakMap;function Id(e){let t=e.length-1,n=e[0];for(let m=0;m<t;m++)n+=`\0${m}\0${e[m+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let m=r;r++;let c=0;for(;r<o&&n.charCodeAt(r)!==0;)c=c*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,c<0||c>=t?(r=m,-1):c}function a(){let m=r;for(;r<o;){let c=n.charCodeAt(r);if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45)r++;else break}return n.slice(m,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let c=n[r];if(c==='"'||c==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==c;){let x=s();x>=0?(f.push(y),y="",b.push(x)):y+=n[r++]}return r<o&&r++,f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}{let f=[],b=[],y="";for(;r<o;){let x=n.charCodeAt(r);if(x===32||x===9||x===10||x===13||x===62)break;let v=s();v>=0?(f.push(y),y="",b.push(v)):y+=n[r++]}return f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}}function u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let c=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let f=n.slice(c,r);if(!f)break;let b=l();f.startsWith("on:")?b.kind==="expr"&&m.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?m.push({t:4,name:f}):b.kind==="static"?m.push({t:0,name:f,value:b.value}):b.kind==="expr"?m.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&m.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return m}function d(m){return m.replace(/\s+/g," ")}function g(m){let c="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=d(c);y&&m.push({t:1,value:y}),c="",m.push({t:2,idx:b})}else c+=n[r++]}let f=d(c);f&&m.push({t:1,value:f})}function p(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let c=n[r+1];if(c==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(c==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(c>="a"&&c<="z")&&!(c>="A"&&c<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=u();i();let y=$d.has(f),x=n[r]==="/";if(x&&r++,r<o&&r++,y||x)m.push({t:0,el:{tag:f,svg:vs.has(f),attrs:b,children:[]}});else{let v=p();if($o(f)){for(let C=0;C<v.length;C++)if(v[C].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),m.push({t:0,el:{tag:f,svg:vs.has(f),attrs:b,children:v}})}}else g(m);return m}return p()}function to(e,t){let n=It(e.tag,e.svg?J:void 0);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:sr(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?D(n,Ft(n,i,s)):be(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}be(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:sr(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(to(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),D(n,$e(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function ws(e,...t){let n=Ss.get(e);return n||(n=Id(e),Ss.set(e,n)),Ts(n,t)}function xs(e,t){return Ts(e,t)}function Ts(e,t){if(ue(),e.length===1&&e[0].t===0)return to(e[0].el,t);let n=It("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(to(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),D(n,$e(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function Bd(e,t,n){ue();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&Ee()&&void 0;let a,l=null,u=!1,d=!1,g=()=>{if(d)return;let c=e(),f=r.parentNode;if(!f||u&&c===a)return;l?.parentNode&&f.removeChild(l),a=c;let b=o.get(c);if(b){let y=i.indexOf(c);y!==-1&&(i.splice(y,1),i.push(c))}else{let y=t[c];if(!y){l=null,u=!0;return}if(b=y(),b.nodeType===11){let x=document.createElement("div");x.style.display="contents",x.appendChild(b),b=x}if(o.set(c,b),i.push(c),s>0&&i.length>s){let x=i.shift(),v=o.get(x);v&&(j(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(x))}}f.insertBefore(b,r.nextSibling),l=b,u=!0},p=Se(g,r);Li(r,()=>[l]);let m=p.stop;if(!u){let c=we();_t(r,ie(()=>{!u&&r.parentNode&&p.run(g)}),c)}return D(r,()=>{d=!0,m();for(let c of o.values())j(c),c.parentNode&&c.parentNode.removeChild(c);o.clear(),i.length=0,l=null}),r}function zd(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=d=>{if(d instanceof DocumentFragment){let g=document.createComment(""),p=document.createComment("");d.insertBefore(g,d.firstChild),d.appendChild(p),o={start:g,end:p}}t.appendChild(d)},s;typeof e=="function"?s=yt(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&ge(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&ge(l,"app:unmount",{rootElement:s}),u){Fd(u.start,u.end);return}j(s),s.parentNode?.removeChild(s)}}}function Fd(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=Oe;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){We("mount",Oe,1);return}j(a),a.parentNode===n&&n.removeChild(a)}s||H(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function no(e,t){if(le())return()=>{};let n,r=!0;return kt(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,nt();try{t(s,a)}finally{rt()}}})}var Wd=["active","paused","ended"],Es=2,Rn=()=>{},ks=he(Symbol.for("sibujs.lifecycleScope.owners.v1"),()=>new WeakMap);function ro(e){return ks.get(e)}function Vd(){let e=we(),t=ie(s=>s()),n=()=>e.state()===Es,r=s=>{let a=!1,l=null,u=Rn,d=Rn,g=()=>{if(a)return;a=!0,u(),d();let c=l;l=null,c?.()},p=()=>{if(u=Rn,a||(d=e.onEnd(g),a))return;let c;try{c=e.run(()=>t(s))}catch(f){throw a=!0,d(),d=Rn,f}a?c():l=c},m=e.state();return m===Es?a=!0:m===1?u=e.wait(p,g):p(),g},o=(s,a)=>e.onChange(l=>{l===s&&e.run(()=>t(a))}),i={state:()=>Wd[e.state()],own:r,onPause:s=>o(1,s),onResume:s=>o(0,s),effect:(s,a)=>r(()=>se(l=>{n()||s(l)},a)),watch:(s,a)=>r(()=>no(s,(l,u)=>{n()||a(l,u)}))};return ks.set(i,e),i}var Cs={done:()=>{},cancel:()=>{},settled:!0};function As(e){if(xe())return Cs;let t=typeof e.nodeType=="number",n=t?null:ro(e)??null;if(!t&&(n===null||n.state()===2))return Cs;let{entry:r,done:o,cancel:i}=Er(t?e:null,n),s=()=>{},a=()=>{r.settled||(s(),i())};return t?(D(e,a),s=()=>{Xe(e,a)}):s=n.onEnd(a),{done:l=>{r.settled||(s(),o(l===void 0?null:typeof l.nodeType=="number"?[l]:[...l]))},cancel:a,get settled(){return r.settled}}}function jd(e,t){ue();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=ie(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{H(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),D(n,()=>{i=!0,o&&(j(o),o.remove(),o=null)}),n}function qd(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Ns(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Ud(e=[]){let[t,n]=I([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=Ns(l,o,i),s.length===0&&i.length<=1?a:l}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function Kd(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,pt(r)||Ct(r)}function i(){if(ot(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let u=Ns(t,a,l);return(u.length>0||l.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let u=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let g=l(t[d]);Object.is(t[d],g)||(t[d]=g,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let u=0;u<t.length;u++){let d=a(t[u],u);Object.is(t[u],d)||(t[u]=d,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Jd(e,t){let[n,r]=I(t),[o,i]=I(!1),[s,a]=I(null),[l,u]=I(0),d=0,g=!1,p=null,m=()=>{if(p===null)return;let f=p;p=null;try{f.abort()}catch{}},c=se(()=>{if(l(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;p=b,ee(()=>{i(!0),a(null)});let y=()=>g||f!==d,x;try{x=e({signal:b?b.signal:void 0})}catch(v){if(y())return;ee(()=>{a(v),i(!1)});return}x.then(v=>{y()||(p=null,ee(()=>{r(v),i(!1)}))},v=>{y()||(p=null,ee(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(f=>f+1)},dispose:()=>{g||(g=!0,c(),m())}}}function Ht(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,u]of e)if(!a.has(l)||!Ht(u,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Ht(a,t[l],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&Ht(e.cause,a.cause,n)&&_s(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:_s(r,o,n)}function _s(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&Ht(e[i],t[i],n))}function Gd(e){return I(e,{equals:(t,n)=>Ht(t,n)})}function ht(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let u=()=>{let c=e();o._v=r&&o._init&&r(o._v,c)?o._v:c,o._d=!1,o._init=!0};try{kt(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,it(l),c}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let c=o._v;i=!0;try{Ue(u,l),Object.is(c,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&it(l)}d&&!s&&!Object.is(c,o._v)&&ge(d,"computed:update",{signal:o,oldValue:c,newValue:o._v})};o._validate=g;let p=()=>{let{error:c}=a;throw a=void 0,s&&(o._d=!1),c};function m(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return un()||s?(o._d&&(g(),a!==void 0&&p()),o._v):(o._d&&(g(),a!==void 0&&(ot(o),p())),ot(o),o._v)}return n&&(m.__name=n,o.__name=n),m.__signal=o,m.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,it(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&ge(d,"computed:create",{signal:o,name:n,getter:m}),m}function Yd(e){let[t,n]=I(e);return{get current(){return t()},set current(r){n(r)}}}function Rs(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Xd(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,d]=I(e[l]);Rs(t,l,[u,d])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let d=t[u][0];return d()}return Reflect.get(l,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(u=>{Rs(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;ee(()=>{Object.entries(d).forEach(([g,p])=>{Object.hasOwn(t,g)&&t[g][1](p)})})},reset:()=>{ee(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return se(()=>{let d=r();if(u){u=!1;return}nt();try{l(d)}finally{rt()}})},subscribeKey:(l,u)=>{let d,g=!0;return se(()=>{let p=t[l][0]();if(g){d=p,g=!1;return}if(!Object.is(p,d)){let m=d;d=p,nt();try{u(p,m)}finally{rt()}}})},getSnapshot:r}]}function Zd(e,t,n){return[ht(e,n),i=>{ee(()=>t(i))}]}function Qd(e){let t=e();return Ee()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function ef(e){if(!Ee())return se(e);let t=se(e),n=null;return queueMicrotask(()=>{try{n=se(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Ls(e,t){return le()?()=>{}:oe(e,t)}var oo="data-sibu-enhanced",io=new WeakMap;function Ms(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=Oe){let i=r.length-o+e.length;e.length=0,We(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Os=["text","attr","class","show","on","cleanup"];function Ps(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function Jt(e,t){return Ls(t,e)}function tf(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value}function nf(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function rf(e,t,n,r){let o=`ctx.each[${r}]`;if(Ee())for(let i of Object.keys(n))Os.includes(i),`${o}${i}${Os.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Ln(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(oo)==="true")return Ee()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=p=>s?!0:!1,l=(p,m,c)=>{if(a(p))return;let f=Ps(n,m);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}c(f)},u={root:n,ref:p=>Ps(n,p),refs:p=>{let m=p.startsWith("@")?`[data-ref="${p.slice(1)}"]`:p;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(p,m,c,f)=>{l("on",p,b=>{let y=x=>c(x,b);b.addEventListener(m,y,f),r.push(()=>b.removeEventListener(m,y,f))})},text:(p,m)=>{l("text",p,c=>{r.push(Jt(c,()=>{let f=m(),b=f==null?"":String(f);c.textContent!==b&&(c.textContent=b)}))})},attr:(p,m,c)=>{l("attr",p,f=>{r.push(Jt(f,()=>{let b=c(),y=b==null?null:String(b);be(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(p,m,c)=>{l("classed",p,f=>{r.push(Jt(f,()=>{f.classList.toggle(m,!!c())}))})},show:(p,m)=>{l("show",p,c=>{let f=c.hidden;r.push(Jt(c,()=>{c.hidden=!m()})),r.push(()=>{c.hidden=f})})},model:(p,m,c)=>{l("model",p,f=>{let b=f,[y,x]=m,v=c?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(Jt(f,()=>{nf(b,y())}));let C=()=>x(tf(b));b.addEventListener(v,C),r.push(()=>b.removeEventListener(v,C))})},each:(p,m)=>{if(a("each"))return;let c=typeof p=="string"?u.refs(p):Array.from(p);for(let f=0;f<c.length;f++){let b=c[f],y=m(b,f);y!=null&&rf(u,b,y,f)}},cleanup:p=>{a("cleanup")||r.push(p)}},d;try{d=t(u);let p=d;if(p&&typeof p.then=="function")throw p.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(p){throw Ms(r,"enhance"),s=!0,p}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,io.get(n)===o&&(io.delete(n),n.removeAttribute(oo)),Xe(n,g),Ms(r,"enhance"),s=!0)};return D(n,g),io.set(n,o),n.setAttribute(oo,"true"),g}function of(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Ln(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var sf=/^[A-Za-z0-9_-]+$/,Ds=Symbol.for("sibujs.islands.lazy"),Mn=he(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function af(e){return e[Ds]=!0,e}function lf(e,t){if(!sf.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Mn.set(e,t)}function uf(e){Mn.delete(e)}async function cf(e){if(typeof e=="function"&&e[Ds]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function df(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!Mn.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let d=Mn.get(s);d&&cf(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let p=Ln(i,g);if(o){p();return}r.push(p),i.setAttribute("data-sibu-hydrated","true")}catch(p){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,p)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,g)})},u=i.getAttribute("data-sibu-load")||"load";n.push(ff(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function ff(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}var pf=new Set(["__proto__","constructor","prototype"]);function so(e){return pf.has(e)}function On(e){let t={};for(let n of Object.keys(e))so(n)||(t[n]=e[n]);return t}function Hs(e){return e}var ab=1024*1024;function mf(e){let[t,n]=I(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=kt(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var $s=16;function gf(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:$s*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,$s)}function hf(){let[e,t]=I(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),H(l,{phase:"async",name:"transition"})};gf(()=>{try{let l=Pt(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function bf(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Pn={};po(Pn,{RenderProp:()=>Nf,assertType:()=>Hf,compose:()=>Af,createGuard:()=>$f,createSlots:()=>Rf,defineComponent:()=>Lf,defineSlottedComponent:()=>Mf,defineStrictComponent:()=>Df,globalStore:()=>Ef,machine:()=>yf,optimistic:()=>Sf,optimisticList:()=>wf,persisted:()=>vf,timeline:()=>xf,validateProps:()=>Fs,validators:()=>Pf,withBoundary:()=>_f,withDefaults:()=>Cf,withProps:()=>Of,withWrapper:()=>kf});function $t(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function yf(e){let[t,n]=I(e.initial),[r,o]=I(e.context||{}),i=e.initial,s=r(),a=[],l=!1;function u(){l=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{l=!1}}function d(f){let b=$t(e.states,i);if(!b?.on)return;let y=$t(b.on,f);if(!y)return;let x,v,C;typeof y=="string"?x=y:(x=y.target,v=y.guard,C=y.action);let w=s;if(v&&!v(w))return;b.exit&&b.exit(w);let N=w;if(C){let L=C(w);N={...w,...On(L)}}i=x,s=N,ee(()=>{C&&o(N),n(x)});let T=$t(e.states,x);T?.entry&&T.entry(s)}function g(f){a.push(f),!l&&u()}let p=$t(e.states,e.initial);if(p?.entry){l=!0;try{p.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&u()}function m(f){return t()===f}function c(f){let b=t(),y=$t(e.states,b);if(!y?.on)return!1;let x=$t(y.on,f);return x?typeof x=="string"?!0:x.guard?x.guard(r()):!0:!1}return{state:t,context:r,send:g,matches:m,can:c}}function vf(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,x)=>so(y)?void 0:x,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,l=n.decrypt,u=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){l&&(y=l(y));let x=s(y);d=n.validate&&!n.validate(x)?t:x}}catch{}let[g,p]=I(d),m=!1,c=se(()=>{let y=g();if(!m)try{let x=o(y);a&&(x=a(x)),r?.setItem(e,x)}catch{}}),f=null;return u&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){m=!0;try{p(t)}finally{m=!1}return}try{let x=y.newValue;l&&(x=l(x));let v=s(x);if(n.validate&&!n.validate(v))return;m=!0;try{p(v)}finally{m=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(p,"dispose",{value:()=>{c(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[g,p]}function Sf(e){let[t,n]=I(e),[r,o]=I(!1),i=0,s=0;async function a(l,u){let d=++s,g=t();n(l),i++,o(!0);try{let p=await u();s===d&&n(p)}catch{s===d&&n(g)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function wf(e){let t=0,n=0,r=0,o=new Map,i=[];for(let O of e){let R={id:t++,key:n++,base:O,claims:[],visible:!0,refs:0};o.set(R.id,R),i.push(R.id)}function s(O){let R=O.claims;return R.length>0?R[R.length-1].value:O.base}function a(O,R){let $=O.claims;for(let M=$.length-1;M>=0;M--)if($[M].opId<R)return $[M].value;return O.base}function l(O,R,$){let M={opId:R,value:$,settled:!1},q=O.claims,S=q.length;for(;S>0&&q[S-1].opId>R;)S--;return q.splice(S,0,M),M}function u(O,R){let $=O.claims.indexOf(R);$!==-1&&O.claims.splice($,1)}function d(O){let R=O.claims,$=0;for(;$<R.length&&R[$].settled;)O.base=R[$].value,$++;$>0&&R.splice(0,$)}let[g,p]=I(i.map(O=>s(o.get(O)))),[m,c]=I(!1),f=0,b=new Set;function y(){let O=new Array(i.length);for(let R=0;R<i.length;R++)O[R]=s(o.get(i[R]));return O}function x(O){ee(()=>{let R=!1;try{R=O()}finally{c(f>0),R&&p(y())}})}function v(O){let R=o.get(O);return!R||!R.visible?!1:(R.visible=!1,i=i.filter($=>$!==O),!0)}function C(O){let R=[];for(let k of O){let E=o.get(k);!E||E.visible||b.has(k)||R.push(k)}if(R.length===0)return!1;let $=new Array(i.length+R.length),M=0,q=0,S=0;for(;M<i.length&&q<R.length;){let k=o.get(i[M]).key,E=o.get(R[q]).key;$[S++]=k<=E?i[M++]:R[q++]}for(;M<i.length;)$[S++]=i[M++];for(;q<R.length;)$[S++]=R[q++];for(let k of R)o.get(k).visible=!0;return i=$,!0}function w(O){for(let R of O){let $=o.get(R);$&&$.refs++}}function N(O){for(let R of O){let $=o.get(R);$&&($.refs--,$.refs<=0&&!$.visible&&(o.delete(R),b.delete(R)))}}function T(O){if(N(O),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[R,$]of o)$.visible||o.delete(R)}async function L(O,R){let $=++r,M={id:t++,key:n++,base:O,claims:[],visible:!1,refs:1},q=l(M,$,O);x(()=>(o.set(M.id,M),M.visible=!0,i=[...i,M.id],f++,!0));let S,k=!1;try{S=await R()}catch{k=!0}x(()=>{try{if(k)return b.add(M.id),u(M,q),v(M.id);let E=s(M);return q.value=S,q.settled=!0,d(M),M.visible&&!Object.is(E,s(M))}finally{T([M.id])}})}async function F(O,R){let $=++r,M=[];for(let S of i)O(a(o.get(S),$))&&M.push(S);x(()=>{if(w(M),f++,M.length===0)return!1;let S=new Set(M);for(let k of M){let E=o.get(k);E&&(E.visible=!1)}return i=i.filter(k=>!S.has(k)),!0});let q=!1;try{await R()}catch{q=!0}x(()=>{try{if(!q){for(let S of M)b.add(S);return!1}return C(M)}finally{T(M)}})}async function te(O,R,$){let M=++r,q=[];for(let A of i){let B=o.get(A),z=a(B,M);O(z)&&q.push({row:B,nextValue:{...z,...R}})}let S=q.map(A=>A.row.id),k=[];x(()=>{w(S),f++;let A=!1;for(let B of q){let z=s(B.row);k.push(l(B.row,M,B.nextValue)),B.row.visible&&!Object.is(z,s(B.row))&&(A=!0)}return A});let E,P=!1;try{E=await $()}catch{P=!0}x(()=>{try{let A=!1;for(let B=0;B<k.length;B++){let z=q[B].row,W=k[B],K=s(z);P?u(z,W):(W.value=E,W.settled=!0),d(z),z.visible&&!Object.is(K,s(z))&&(A=!0)}return A}finally{T(S)}})}return{items:g,pending:m,add:L,remove:F,update:te}}function xf(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=I([e]),[o,i]=I(0),s=ht(()=>n()[o()]),a=ht(()=>o()>0),l=ht(()=>o()<n().length-1);function u(f){let b=s(),y=typeof f=="function"?f(b):f;if(Object.is(y,b))return;let x=n(),v=o(),C=x.slice(0,v+1);C.push(y),ee(()=>{C.length>t?(C.shift(),r(C),i(C.length-1)):(r(C),i(v+1))})}function d(){a()&&i(o()-1)}function g(){l()&&i(o()+1)}function p(){ee(()=>{r([e]),i(0)})}function m(f){let b=n();f>=0&&f<b.length&&i(f)}function c(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:u,undo:d,redo:g,canUndo:a,canRedo:l,history:n,index:o,reset:p,jumpTo:m,dispose:c}}var Bs=Promise.prototype.then;function Is(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(Bs,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function zs(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(c){return{promise:Promise.reject(c),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((c,f)=>{n=c,r=f}),i="invoking",s,a=[],l=c=>{if(i=c,c!=="invoking")for(let f of a.splice(0))f()},u=c=>{n(c),l("fulfilled")},d=c=>{r(c),l("rejected")},g=c=>{if(c===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(c===null||typeof c!="object"&&typeof c!="function"){u(c);return}let f;try{f=c.then}catch(b){d(b);return}if(typeof f!="function"){u(c);return}p(c,f)},p=(c,f)=>{f===Bs?(s=c,l("native")):l("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,g(v))},x=v=>{b||(b=!0,d(v))};try{Reflect.apply(f,c,[y,x])}catch(v){x(v)}!b&&i==="invoking"&&l("pending")})};return p(e,t),{promise:o,failedEarly:!1,probe:(c,f)=>{let b=()=>{i==="native"?Is(s,c,f):(i==="rejected"?c:f)()};i==="native"?Is(s,c,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?c:f)}}}function Tf(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function Ef(e){let t=Tf(e.state),[n,r]=I({...t}),o=new Map,i=e.middleware||[];function s(c){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(c)}catch(b){H(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function u(c,f=!0){if(a.push(c),l)return;l=!0;let b,y=!1;try{let x=!0,v=0;for(;v<a.length;){let C=a[v];a[v++]=void 0;try{C()}catch(w){x&&f?(y=!0,b=w):H(w,{phase:"event",name:"globalStore(dispatch)"})}x=!1}}finally{a.length=0,l=!1}if(y)throw b}function d(c,f){let b=e.actions[c];if(!b)throw new Error(`Unknown action: ${String(c)}`);let y=()=>{let x=n(),v=b(x,f),C=On(v);r({...x,...C}),s(n())};u(()=>{if(i.length===0){y();return}let x=v=>{if(v>=i.length){y();return}let C=!1,w=!1,N=!0,T=()=>{if(w&&!C){!1,C=!0;return}if(C){!1;return}if(C=!0,N){x(v+1);return}let F=()=>u(()=>x(v+1),!1);if(!L){F();return}L.probe(()=>{w=!0,!1},F)},L=null;try{L=zs(i[v](n(),String(c),f,T))}catch(F){throw w=!0,F}finally{N=!1}L&&(L.failedEarly&&(w=!0),L.promise.then(void 0,F=>{w=!0,H(F,{phase:"async",name:"globalStore(middleware)"})}))};x(0)})}function g(c){return()=>c(n())}function p(c){let f=o.get(c);f||(f={callback:c,active:!0},o.set(c,f));let b=f;return()=>{o.get(c)===b&&(b.active=!1,o.delete(c))}}function m(){u(()=>{r({...t}),s(n())})}return{getState:n,select:g,dispatch:d,subscribe:p,reset:m}}function kf(e,t){return n=>t(e,n)}function Cf(e,t){return n=>e({...t,...n})}function Af(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function Nf(e){return e.render(e.data())}function _f(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function Rf(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function Lf(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Mf(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Of(e,t){return n=>e(t(n))}var Pf={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function Fs(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function Df(e){return t=>{let n=Fs(t,e.props);return e.setup(n)}}function Hf(e,t,n){}function $f(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...Pn,...ao,patterns:Pn});})();
|