sibujs 4.12.0 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/browser.cjs +71 -18
  2. package/dist/browser.js +4 -4
  3. package/dist/build.cjs +6618 -6178
  4. package/dist/build.d.cts +554 -415
  5. package/dist/build.d.ts +554 -415
  6. package/dist/build.js +2091 -1735
  7. package/dist/cdn.dev.global.js +12 -12
  8. package/dist/cdn.full.dev.global.js +13 -13
  9. package/dist/cdn.full.global.js +12 -12
  10. package/dist/cdn.global.js +12 -12
  11. package/dist/{chunk-WFRQ6D7H.js → chunk-22OPSWMF.js} +1 -1
  12. package/dist/{chunk-ZJCHY2IB.js → chunk-2NC56RGY.js} +1 -1
  13. package/dist/{chunk-NB7TFSJE.js → chunk-2O6JJCUR.js} +4 -4
  14. package/dist/{chunk-B2Y5BJSP.js → chunk-4UTGDVSA.js} +70 -16
  15. package/dist/{chunk-NAVLCP4S.js → chunk-5RIBLY2N.js} +4 -4
  16. package/dist/{chunk-T5O2CUHV.js → chunk-5XUGJM3J.js} +1 -1
  17. package/dist/{chunk-HXT2RNH5.js → chunk-ADZHPN2B.js} +1 -1
  18. package/dist/chunk-B36ADEIR.js +21 -0
  19. package/dist/{chunk-DFZL3AX7.js → chunk-C73VBPEF.js} +9 -5
  20. package/dist/{chunk-WH4U2VUE.js → chunk-CPQKWCJ2.js} +13 -5
  21. package/dist/{chunk-LEUEKK4G.js → chunk-EU7T7EB3.js} +2 -2
  22. package/dist/{chunk-QLG5IK7F.js → chunk-G3Z2FEBR.js} +4 -4
  23. package/dist/{chunk-ZPY2UAKM.js → chunk-J4X7ICH4.js} +3 -3
  24. package/dist/{chunk-XX4BRMWF.js → chunk-K4LNUT5L.js} +1 -1
  25. package/dist/{chunk-CI4W6XAU.js → chunk-KC62VURU.js} +3 -3
  26. package/dist/chunk-N5TBYXHW.js +17 -0
  27. package/dist/{chunk-653KGQS2.js → chunk-OIKD7YDY.js} +2 -2
  28. package/dist/{chunk-LYTUTXQP.js → chunk-PBJYCE2Z.js} +46 -4
  29. package/dist/{chunk-EMB5PG7V.js → chunk-QC3NP47A.js} +1 -1
  30. package/dist/{chunk-IHA62NGJ.js → chunk-QKFVMIAV.js} +1 -1
  31. package/dist/{chunk-LXBMVGVB.js → chunk-QZ47OZ25.js} +3 -3
  32. package/dist/{chunk-ZTYCCBU3.js → chunk-VFPLWUT7.js} +44 -26
  33. package/dist/{chunk-RK7EPQPG.js → chunk-YFTBCCVH.js} +1 -1
  34. package/dist/data.cjs +71 -18
  35. package/dist/data.js +5 -5
  36. package/dist/datePicker-DxuxWpgF.d.cts +285 -0
  37. package/dist/datePicker-DxuxWpgF.d.ts +285 -0
  38. package/dist/devtools.cjs +71 -18
  39. package/dist/devtools.js +4 -4
  40. package/dist/ecosystem.cjs +82 -21
  41. package/dist/ecosystem.js +7 -7
  42. package/dist/extras.cjs +131 -23
  43. package/dist/extras.d.cts +2 -2
  44. package/dist/extras.d.ts +2 -2
  45. package/dist/extras.js +21 -20
  46. package/dist/index.cjs +115 -37
  47. package/dist/index.d.cts +59 -5
  48. package/dist/index.d.ts +59 -5
  49. package/dist/index.js +10 -10
  50. package/dist/motion.cjs +69 -16
  51. package/dist/motion.js +3 -3
  52. package/dist/patterns.cjs +71 -18
  53. package/dist/patterns.js +5 -5
  54. package/dist/performance.cjs +69 -16
  55. package/dist/performance.js +4 -4
  56. package/dist/plugins.cjs +1421 -996
  57. package/dist/plugins.d.cts +132 -3
  58. package/dist/plugins.d.ts +132 -3
  59. package/dist/plugins.js +262 -11
  60. package/dist/routeMiddleware-B1sp4P7a.d.ts +688 -0
  61. package/dist/routeMiddleware-CedQTsLK.d.cts +688 -0
  62. package/dist/ssr.cjs +3607 -3524
  63. package/dist/ssr.d.cts +20 -671
  64. package/dist/ssr.d.ts +20 -671
  65. package/dist/ssr.js +15 -7
  66. package/dist/testing.cjs +71 -18
  67. package/dist/testing.js +2 -2
  68. package/dist/ui.cjs +78 -18
  69. package/dist/ui.js +8 -7
  70. package/dist/widgets.cjs +1352 -952
  71. package/dist/widgets.d.cts +100 -268
  72. package/dist/widgets.d.ts +100 -268
  73. package/dist/widgets.js +316 -7
  74. package/package.json +9 -1
@@ -1,10 +1,10 @@
1
- "use strict";(()=>{var Co=Object.defineProperty;var wt=(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 No=(e,t)=>{for(var n in t)Co(e,n,{get:t[n],enumerable:!0})};var yn={};No(yn,{DynamicComponent:()=>Zc,ErrorBoundary:()=>$c,ErrorDisplay:()=>un,Fragment:()=>tl,KeepAlive:()=>ol,Loading:()=>Fc,MAX_DRAIN_TEARDOWNS:()=>se,Portal:()=>al,SVG_NS:()=>R,Suspense:()=>Er,__renderParsedTemplate:()=>ao,__resetIdCounter:()=>Zr,a:()=>bs,abbr:()=>hs,action:()=>zc,address:()=>es,area:()=>Vs,array:()=>ll,article:()=>Gi,aside:()=>Qi,asyncDerived:()=>dl,audio:()=>js,autoResize:()=>Jr,b:()=>ys,base:()=>$a,batch:()=>j,bdi:()=>Ss,bdo:()=>vs,bindDynamic:()=>mr,blockquote:()=>ss,body:()=>Wi,br:()=>xs,button:()=>Ge,canvas:()=>ra,caption:()=>ca,catchError:()=>Vc,catchErrorAsync:()=>jc,center:()=>sc,checkLeaks:()=>Ln,circle:()=>Fa,cite:()=>Es,clickOutside:()=>Ur,clipPath:()=>Xa,code:()=>Zt,col:()=>la,colgroup:()=>ua,context:()=>Wc,copyOnClick:()=>Gr,createId:()=>Xr,customElement:()=>lc,data:()=>Ts,datalist:()=>ya,dd:()=>as,deepEqual:()=>Ve,deepSignal:()=>fl,defer:()=>Rl,defs:()=>Ya,del:()=>sa,derived:()=>gn,details:()=>La,dfn:()=>ws,dialog:()=>Ma,disableSSR:()=>Nr,dispose:()=>M,div:()=>_,dl:()=>cs,dt:()=>ls,each:()=>el,effect:()=>Y,ellipse:()=>za,em:()=>ks,embed:()=>Gs,enableSSR:()=>Cr,enhance:()=>xt,enhanceAll:()=>El,enqueueBatchedSignal:()=>Le,external:()=>Cc,fieldset:()=>Sa,figcaption:()=>us,figure:()=>ds,font:()=>ac,footer:()=>Yi,form:()=>va,g:()=>Va,getAction:()=>Wr,getRequestScopedCache:()=>_r,getRuntimeErrorHandler:()=>An,getSSRStore:()=>Re,getSlot:()=>cl,h1:()=>ts,h2:()=>ns,h3:()=>Yt,h4:()=>rs,h5:()=>os,h6:()=>is,head:()=>qi,header:()=>Ji,hr:()=>fs,html:()=>so,i:()=>As,iframe:()=>Js,img:()=>qs,input:()=>xa,ins:()=>aa,isBatching:()=>_c,isSSR:()=>te,kbd:()=>_s,label:()=>Ea,lazy:()=>xr,lazyIsland:()=>wl,legend:()=>Ta,li:()=>ps,line:()=>ja,linearGradient:()=>ec,link:()=>Pa,longPress:()=>Kr,main:()=>Zi,map:()=>Ws,mark:()=>Cs,marker:()=>ic,marquee:()=>cc,mask:()=>Za,match:()=>Gc,math:()=>na,menu:()=>Oa,meta:()=>Ba,meter:()=>wa,mount:()=>il,mountIslands:()=>Cl,nav:()=>Xi,nextTick:()=>Ol,noscript:()=>oa,object:()=>Ys,ol:()=>ms,on:()=>vc,onCleanup:()=>hc,onMount:()=>bt,onUnmount:()=>bc,optgroup:()=>ka,option:()=>Aa,output:()=>_a,p:()=>Jt,param:()=>Xs,path:()=>qa,pattern:()=>Qa,picture:()=>Zs,polygon:()=>Wa,polyline:()=>Ua,portal:()=>Qs,pre:()=>Xt,progress:()=>Ca,q:()=>Ns,radialGradient:()=>tc,reactiveArray:()=>ul,rect:()=>Ka,ref:()=>pl,registerAction:()=>ze,registerComponent:()=>Jc,registerDisposer:()=>x,registerIsland:()=>kl,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>pe,reportError:()=>w,resolveComponent:()=>Xc,retrack:()=>he,rp:()=>Rs,rt:()=>Ls,ruby:()=>Ms,runInSSRContext:()=>Rr,s:()=>Os,samp:()=>Ds,script:()=>ia,section:()=>Ki,select:()=>Na,setGlobalErrorHandler:()=>qc,setMaxDrainIterations:()=>dr,setRuntimeErrorHandler:()=>kn,show:()=>Uc,signal:()=>C,slot:()=>Ha,small:()=>Hs,source:()=>ea,span:()=>H,stop:()=>nc,store:()=>ml,strict:()=>hl,strictEffect:()=>yl,strong:()=>Is,style:()=>_e,sub:()=>$s,summary:()=>Da,sup:()=>Ps,svg:()=>ta,symbol:()=>oc,table:()=>da,tagFactory:()=>d,takePendingError:()=>pt,tbody:()=>fa,td:()=>pa,template:()=>Ia,text:()=>Ga,textarea:()=>Ra,tfoot:()=>ma,th:()=>ga,thead:()=>ba,time:()=>Bs,title:()=>Ui,tr:()=>ha,track:()=>Us,transition:()=>Ml,trapFocus:()=>Yr,trustHTML:()=>yo,tspan:()=>Ja,u:()=>Fs,ul:()=>gs,unregisterComponent:()=>Yc,unregisterDisposer:()=>qe,unregisterIsland:()=>Al,untracked:()=>ee,use:()=>rc,var_:()=>zs,video:()=>Ks,watch:()=>gl,when:()=>Kc,withSSR:()=>Lr,writable:()=>bl});var wn=Symbol.for("sibujs.runtime-errors.v1");function kt(){let e=globalThis,t=e[wn];if(t)return t;let n={handler:null,handlerDepth:0};return e[wn]=n,n}function kn(e){let t=kt(),n=t.handler;return t.handler=e,n}function An(){return kt().handler}function At(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Ro(e)}`;return new Error(t,{cause:e})}function Ro(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 Lo(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Mo=Symbol.for("sibujs.reactive.v1");function Oo(e){let t=globalThis[Mo];return t?.untracked?t.untracked(e):e()}var Do="sibu:error-propagate";function Ho(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Io(n);if(!r)return!1;try{let o=new CustomEvent(Do,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Io(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 $o(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Lo(t)}: ${e.message}`,e)}function w(e,t){let n=At(e);Oo(()=>{if(Ho(n,t))return;let r=kt(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}$o(n,t)})}function re(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var oe=new WeakMap,se=1e4;function pe(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 ve=0;function tt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var q=[];function _n(){return tt(q[q.length-1])}function Cn(e){return e===null&&q.length===0?!1:(q.push(tt(e)),!0)}function Nn(){q.pop()}function x(e,t){let n=oe.get(e);n||(n=[],oe.set(e,n)),n.push(t),!1;let r=tt(q[q.length-1]);r&&r.entries.push([e,t])}function Rn(e){let t={entries:[],closed:!1},n=t.entries;q.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=se){pe("rollback",s,n.length);break}let[a,c]=n.pop();if(qe(a,c)){s++;try{c()}catch(l){w(l,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,q.pop()}throw i}t.closed=!0,q.pop();let o=tt(q[q.length-1]);if(o){for(let i of n)oe.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function qe(e,t){let n=oe.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&oe.delete(e),!0)}function M(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--)Po(n[r])}function Po(e){if(!oe.has(e))return;let t=0,n=!1;for(;!n;){let r=oe.get(e);if(!r||r.length===0)break;let o=r.slice();oe.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=se){let s=o.slice(i),a=oe.get(e);oe.set(e,a?s.concat(a):s),!1,pe("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){w(s,{phase:"cleanup",name:"disposer"})}}}}function z(e,...t){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++)M(n[r]);e.replaceChildren(...t)}function Ln(e=0){return 0}function De(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Bo=/[A-Z]/,Fo=/[A-Z]/g;function W(e){return Bo.test(e)?e.replace(Fo,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function me(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 zo=["http:","https:","mailto:","tel:","ftp:"],Vo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function rt(e){let t=De(e).trim();if(!t)return"";let n=e.replace(Vo,"");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)&&zo.indexOf(i)===-1?"":n}var jo=/^\d+(\.\d+)?[wx]$/;function _t(e){return e===" "||e===" "||e===`
2
- `||e==="\r"||e==="\f"}function qo(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(_t(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!_t(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let l="",u=!1;for(;r<o;){let m=t[r];if(u){l+=m,m===")"&&(u=!1),r++;continue}if(_t(m)){l&&a.push(l),l="",r++;continue}if(m===","){r++;break}m==="("&&(u=!0),l+=m,r++}l&&a.push(l)}if(s===""||a.length>1||a.length===1&&!jo.test(a[0]))continue;let c=rt(s);c&&(c.startsWith(",")||c.endsWith(",")||n.push(a.length===1?`${c} ${a[0]}`:c))}return n.join(", ")}var Wo=/[(:@\\]/;function Uo(e){return e===" "||e===" "||e===`
3
- `||e==="\r"||e==="\f"}function Mn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Ko(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===`
1
+ "use strict";(()=>{var Ho=Object.defineProperty;var _t=(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 Io=(e,t)=>{for(var n in t)Ho(e,n,{get:t[n],enumerable:!0})};var vn={};Io(vn,{DynamicComponent:()=>su,ErrorBoundary:()=>qc,ErrorDisplay:()=>fn,Fragment:()=>uu,KeepAlive:()=>fu,Loading:()=>Gc,MAX_DRAIN_TEARDOWNS:()=>ie,Portal:()=>gu,SVG_NS:()=>R,Suspense:()=>Cr,__renderParsedTemplate:()=>go,__resetIdCounter:()=>oo,a:()=>ws,abbr:()=>ks,action:()=>Jc,address:()=>cs,area:()=>Ys,array:()=>hu,article:()=>ns,aside:()=>as,asyncDerived:()=>Su,audio:()=>Xs,autoResize:()=>to,b:()=>_s,base:()=>qa,batch:()=>j,bdi:()=>As,bdo:()=>Cs,bindDynamic:()=>vr,blockquote:()=>ms,body:()=>Qi,br:()=>Ns,button:()=>Ye,canvas:()=>da,caption:()=>ba,catchError:()=>Yc,catchErrorAsync:()=>Xc,center:()=>mc,checkLeaks:()=>Dn,circle:()=>Ga,cite:()=>Rs,clickOutside:()=>Zr,clipPath:()=>ic,code:()=>en,col:()=>ha,colgroup:()=>ya,context:()=>Qc,copyOnClick:()=>eo,createId:()=>ro,customElement:()=>hc,data:()=>Ls,datalist:()=>_a,dd:()=>gs,deepEqual:()=>je,deepSignal:()=>vu,defer:()=>$u,defs:()=>oc,del:()=>ma,derived:()=>hn,details:()=>Ba,dfn:()=>Ms,dialog:()=>Fa,disableSSR:()=>Hr,dispose:()=>M,div:()=>A,dl:()=>bs,dt:()=>hs,each:()=>cu,effect:()=>Y,ellipse:()=>Ja,em:()=>Os,embed:()=>na,enableSSR:()=>Dr,enhance:()=>Tt,enhanceAll:()=>Ru,enqueueBatchedSignal:()=>Le,external:()=>Ic,fieldset:()=>Aa,figcaption:()=>ys,figure:()=>Ss,font:()=>gc,footer:()=>os,form:()=>Ca,g:()=>Ya,getAction:()=>Xr,getRequestScopedCache:()=>Or,getRuntimeErrorHandler:()=>Nn,getSSRStore:()=>Re,getSlot:()=>bu,h1:()=>us,h2:()=>ls,h3:()=>Zt,h4:()=>ds,h5:()=>fs,h6:()=>ps,head:()=>Zi,header:()=>rs,hr:()=>vs,html:()=>mo,i:()=>Ds,iframe:()=>ra,img:()=>Zs,input:()=>Na,ins:()=>ga,isBatching:()=>Hc,isSSR:()=>ee,kbd:()=>Hs,label:()=>Ra,lazy:()=>Ar,lazyIsland:()=>Mu,legend:()=>La,li:()=>xs,line:()=>Xa,linearGradient:()=>cc,link:()=>Ua,longPress:()=>Qr,main:()=>ss,map:()=>Qs,mark:()=>Is,marker:()=>pc,marquee:()=>bc,mask:()=>sc,match:()=>nu,math:()=>la,menu:()=>za,meta:()=>Ka,meter:()=>Ma,mount:()=>pu,mountIslands:()=>Iu,nav:()=>is,nextTick:()=>zu,noscript:()=>fa,object:()=>oa,ol:()=>Es,on:()=>Cc,onCleanup:()=>kc,onMount:()=>yt,onUnmount:()=>wc,optgroup:()=>Oa,option:()=>Da,output:()=>Ha,p:()=>Xt,param:()=>ia,path:()=>Za,pattern:()=>ac,picture:()=>sa,polygon:()=>Qa,polyline:()=>ec,portal:()=>aa,pre:()=>Qt,progress:()=>Ia,q:()=>Ps,radialGradient:()=>uc,reactiveArray:()=>yu,rect:()=>tc,ref:()=>xu,registerAction:()=>We,registerComponent:()=>ru,registerDisposer:()=>x,registerIsland:()=>Ou,replaceChildrenSafely:()=>V,reportDrainRunaway:()=>fe,reportError:()=>k,resolveComponent:()=>iu,retrack:()=>be,rp:()=>$s,rt:()=>Bs,ruby:()=>Fs,runInSSRContext:()=>Ir,s:()=>zs,samp:()=>Vs,script:()=>pa,section:()=>ts,select:()=>Pa,setGlobalErrorHandler:()=>Zc,setMaxDrainIterations:()=>hr,setRuntimeErrorHandler:()=>Cn,show:()=>eu,signal:()=>C,slot:()=>Wa,small:()=>Ws,source:()=>ca,span:()=>H,stop:()=>lc,store:()=>Eu,strict:()=>ku,strictEffect:()=>_u,strong:()=>js,style:()=>Ae,sub:()=>qs,summary:()=>Va,sup:()=>Us,svg:()=>ua,symbol:()=>fc,table:()=>Sa,tagFactory:()=>d,takePendingError:()=>gt,tbody:()=>va,td:()=>xa,template:()=>ja,text:()=>nc,textarea:()=>$a,tfoot:()=>Ea,th:()=>Ta,thead:()=>wa,time:()=>Ks,title:()=>es,tr:()=>ka,track:()=>ea,transition:()=>Fu,trapFocus:()=>no,trustHTML:()=>ko,tspan:()=>rc,u:()=>Gs,ul:()=>Ts,unregisterComponent:()=>ou,unregisterDisposer:()=>Ue,unregisterIsland:()=>Du,untracked:()=>Q,use:()=>dc,var_:()=>Js,video:()=>ta,watch:()=>Tu,when:()=>tu,withSSR:()=>Pr,writable:()=>wu});var An=Symbol.for("sibujs.runtime-errors.v1");function At(){let e=globalThis,t=e[An];if(t)return t;let n={handler:null,handlerDepth:0};return e[An]=n,n}function Cn(e){let t=At(),n=t.handler;return t.handler=e,n}function Nn(){return At().handler}function Ct(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Po(e)}`;return new Error(t,{cause:e})}function Po(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 $o(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Bo=Symbol.for("sibujs.reactive.v1");function Fo(e){let t=globalThis[Bo];return t?.untracked?t.untracked(e):e()}var zo="sibu:error-propagate";function Vo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Wo(n);if(!r)return!1;try{let o=new CustomEvent(zo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Wo(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 jo(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${$o(t)}: ${e.message}`,e)}function k(e,t){let n=Ct(e);Fo(()=>{if(Vo(n,t))return;let r=At(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}jo(n,t)})}function ne(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var re=new WeakMap,ie=1e4;function fe(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 Se=0;function rt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var q=[];function Rn(){return rt(q[q.length-1])}function Ln(e){return e===null&&q.length===0?!1:(q.push(rt(e)),!0)}function Mn(){q.pop()}function x(e,t){let n=re.get(e);n||(n=[],re.set(e,n)),n.push(t),!1;let r=rt(q[q.length-1]);r&&r.entries.push([e,t])}function On(e){let t={entries:[],closed:!1},n=t.entries;q.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ie){fe("rollback",s,n.length);break}let[a,c]=n.pop();if(Ue(a,c)){s++;try{c()}catch(u){k(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,q.pop()}throw i}t.closed=!0,q.pop();let o=rt(q[q.length-1]);if(o){for(let i of n)re.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Ue(e,t){let n=re.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&re.delete(e),!0)}function M(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--)qo(n[r])}function qo(e){if(!re.has(e))return;let t=0,n=!1;for(;!n;){let r=re.get(e);if(!r||r.length===0)break;let o=r.slice();re.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=ie){let s=o.slice(i),a=re.get(e);re.set(e,a?s.concat(a):s),!1,fe("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){k(s,{phase:"cleanup",name:"disposer"})}}}}function V(e,...t){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++)M(n[r]);e.replaceChildren(...t)}function Dn(e=0){return 0}function De(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var Uo=/[A-Z]/,Ko=/[A-Z]/g;function U(e){return Uo.test(e)?e.replace(Ko,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function pe(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 Go=["http:","https:","mailto:","tel:","ftp:"],Jo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function it(e){let t=De(e).trim();if(!t)return"";let n=e.replace(Jo,"");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)&&Go.indexOf(i)===-1?"":n}var Yo=/^\d+(\.\d+)?[wx]$/;function Nt(e){return e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"}function Xo(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Nt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Nt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",l=!1;for(;r<o;){let p=t[r];if(l){u+=p,p===")"&&(l=!1),r++;continue}if(Nt(p)){u&&a.push(u),u="",r++;continue}if(p===","){r++;break}p==="("&&(l=!0),u+=p,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!Yo.test(a[0]))continue;let c=it(s);c&&(c.startsWith(",")||c.endsWith(",")||n.push(a.length===1?`${c} ${a[0]}`:c))}return n.join(", ")}var Zo=/[(:@\\]/;function Qo(e){return e===" "||e===" "||e===`
3
+ `||e==="\r"||e==="\f"}function Hn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function ei(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(Mn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Mn(e[s]);)i+=e[s],s++;s<e.length&&Uo(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
- `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;t+=c?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var On=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],Go=4,Jo=5,Yo=8;function Xo(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 Ct=new Set,Dn=100,Hn=!1;function nt(e,t,n){}function In(e){return(e.includes("\\")?Ko(e):e).toLowerCase().replace(/\s+/g,"")}function Nt(e){if(!Wo.test(e))return-1;let t=In(e);for(let n=0;n<On.length;n++)if(t.includes(On[n]))return n;return-1}function ot(e,t,n){let r=Rt(e,t);return r===-1?t:(nt(t,r,{property:e,element:n?.element}),"")}function Rt(e,t){let n=Nt(t);if(n!==-1)return n;let r=W(e);return r==="behavior"?Jo:r==="-moz-binding"?Go:(r==="filter"||r==="-ms-filter")&&In(t).includes("progid:")?Yo:-1}function Zo(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 c=e.indexOf("*/",s+2);if(c===-1)return null;s=c+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 c=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let l=s.slice(a+1).trim(),u=/!\s*important\s*$/i.exec(l);if(u&&(l=l.slice(0,u.index).trim()),l==="")continue;let m=c.startsWith("--")?c:W(c);i.push([m,l,u!==null])}return i}function Qo(e,t){let n=String(e),r=Zo(n);if(r===null)return Nt(n)!==-1&&nt(n,Nt(n),t),"";let o=[];for(let[i,s,a]of r){let c=Rt(i,s);if(c!==-1){nt(s,c,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function it(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Qo(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),c=Rt(s,a);if(c!==-1){nt(a,c,{property:s,element:t?.element});continue}let l=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${l?` !${l}`:""}`)}return o.join("; ")}var Lt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ei=new Set(["srcdoc"]);function We(e){return ei.has(e.toLowerCase())}function $n(e){return Lt.has(e.toLowerCase())}function ti(e){let t=e.toLowerCase();return t==="style"||Lt.has(t)}function ni(e,t,n){let r=e.toLowerCase();return r==="srcset"?qo(t):Lt.has(r)?rt(t):r==="style"?it(t,n):t}function Pn(e,t,n){if(!ti(e))return t;let r=ni(e,t,n);return r===""?null:r}function xe(e){return e===" "||e===" "||e===`
7
- `||e==="\r"||e==="\f"}function st(e){let t=0,n=e.length;for(;t<n&&xe(e[t]);)t++;for(;n>t&&xe(e[n-1]);)n--;return e.slice(t,n)}var U=e=>({kind:"forbidden",reason:e});function ri(e){let t=st(De(e));if(t==="")return U("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return U("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return U("");for(;n<t.length&&xe(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return U("");for(n++;n<t.length&&xe(t[n]);)n++;let o=n;for(;n<t.length&&!xe(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return U("");for(;n<t.length&&xe(t[n]);)n++;if(t[n]!=="=")return U("");for(n++;n<t.length&&xe(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let l=t.indexOf(a,n+1);if(l===-1)return U("");if(s=t.slice(n+1,l),st(t.slice(l+1))!=="")return U("")}else if(s=st(t.slice(n)),/[;,]/.test(s))return U("");if(s==="")return U("");let c=rt(s);return c===""?U(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Mt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=W(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?U(""):typeof t!="string"?{kind:"not-refresh"}:st(De(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:ri(n)}var oi="http://www.w3.org/1999/xhtml",ii="http://www.w3.org/2000/svg",si=new Set(["script","iframe","object","embed","frame","frameset"]);function Fn(e){return W(e)}function zn(e){return si.has(Fn(e))}var ai=new Set(["script","style"]);function Vn(e){return ai.has(Fn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},ci=new Set(["src","href","xlink:href","type","language"]),li=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Ot=new WeakSet;function jn(e){return e.namespaceURI===oi||e.namespaceURI===null}function qn(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 ui(e){Ot.has(e)||(Ot.add(e),e.getAttribute("content")!==null&&Mt(qn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function di(e,t,n,r){if(!jn(e))return L.None;let o=W(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ui(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=Mt(qn(e,o,n));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&Ot.has(e)?L.MetaRefreshReactive:L.None}function fi(e,t){if(t===null||W(e)!=="attributename")return L.None;let n=De(t);return $n(n)||me(n)||We(n)?L.AnimationTarget:L.None}var at=new WeakSet;function Bn(e){if(e===null)return!1;let t=W(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 pi(e,t,n,r){if(!jn(e))return L.None;let o=W(t);return o==="href"?r==="static"||n===null?L.None:Bn(e.getAttribute("rel"))?L.StylesheetSource:(at.add(e),L.None):o==="rel"&&Bn(n)&&at.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function Dt(e,t,n,r){let o=e.localName;return o==="meta"?di(e,t,n,r):o==="link"?pi(e,t,n,r):o==="script"?r==="static"||n===null?L.None:ci.has(W(t))?L.ScriptSource:L.None:li.has(o)&&e.namespaceURI===ii?fi(t,n):L.None}function Ht(e,t,n){e.localName!=="link"||W(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?at.add(e):at.delete(e))}var mi="http://www.w3.org/1999/xhtml",gi="http://www.w3.org/2000/svg",bi="http://www.w3.org/1999/xlink",hi="http://www.w3.org/XML/1998/namespace",yi=new Set(["checked","disabled","selected"]);function Si(e){return e.namespaceURI===null||e.namespaceURI===mi}function Un(e,t,n){}function Wn(e,t,n){e[t]=n}function vi(e,t){if(e.namespaceURI!==gi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?bi:n.startsWith("xml:")?hi:null}function X(e,t,n,r={}){let o=xi(e,t,n,r);return e.localName==="link"&&Ht(e,t,r.reactive?"reactive":"runtime"),o}function xi(e,t,n,r){let o=vi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(me(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Dt(e,t,s,r.reactive?"reactive":"runtime");if(a!==L.None)return Un(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(We(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=Si(e),l=c?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let f=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==f&&(o?e.setAttributeNS(o,t,f):e.setAttribute(t,f)),!0}return c&&yi.has(l)&&l in e?Wn(e,l,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let u=String(n);if(r.syncValueProperty!==!1&&c&&(l==="value"||l==="checked")&&l in e)return Wn(e,l,l==="checked"?!!n:u),!0;let m=u===""?"":Pn(t,u,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===m||(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0)}function It(e,t,n){if(We(t))return!1,!1;let r=Dt(e,t,n,"static");return r!==L.None?(Un("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Ht(e,t,"static"),!0)}var Ei=4096,$t=[];function Ti(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function wi(e,t,n){let r=$t.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Ti();return o.sig=e,o.sub=t,o.epoch=n,o}function Kn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,$t.length<Ei&&$t.push(e)}function ki(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 Gn(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 Ai(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function _i(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 Q=null,ae=null,ge=0,be=[],Z=new Set,Ci=[];function Ni(e){try{e()}catch(t){let n=e;w(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ri(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 ie=0,ce=!1;function Bt(){ie===0&&(ae=Q,Q=null,ce=!0),ie++}function Ft(){ie--,ie===0&&(Q=ae,ae=null,ce=!1)}function Jn(){return ce}function Yn(e){Bt();try{return e()}finally{Ft()}}var K=null;function zt(){return K}function dt(e,t){let n=K;K=e;try{return t()}finally{K=n}}function Vt(e){let t=K;return t===null?e:(...n)=>dt(t,()=>e(...n))}var Li=0;function jt(e,t){let n=Q,r=0,o=null;ce&&(r=ie,o=ae,ie=0,ae=null,ce=!1),Q=t;let i=t;i._cap===void 0&&(i._cap=_n());let s=K;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(K=a);let c=++Li;i._epoch=c,i._structDirty=!1;for(let l=i.depsHead??null;l!==null;l=l.subNext){let u=l.sig;l.prevActive=u.__activeNode??null,u.__activeNode=l}try{e()}finally{Q=n,K=s,r!==0&&(ie=r,ae=o,ce=!0);let l=i.depsHead??null;for(;l!==null;){let u=l.subNext,m=l.sig;m.__activeNode=l.prevActive,l.prevActive=null,l.epoch!==c&&(_i(l),Gn(l),Kn(l)),l=u}}}function Xn(e,t){if(!t)return qt(e);He(t);let n=Q,r=0,o=null;ce&&(r=ie,o=ae,ie=0,ae=null,ce=!1),Q=t;let i=t;i._scope===void 0&&(i._scope=K);let s=K;K=i._scope;try{e()}finally{Q=n,K=s,r!==0&&(ie=r,ae=o,ce=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>He(t))}function qt(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{jt(e,r)}finally{o._reentrant=!1}}},r=n;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=t;try{n()}catch(o){throw r._disposed=!0,r._errorNode=void 0,He(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,He(r)})}function Zn(e){if(!Q)return;let t=Q,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=wi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Ai(t,i),ki(n,i),t._structDirty=!0}function He(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Gn(n),Kn(n),n=r}}var ct=1e3,lt=1e6,ut=0,Ee=new Set;function Qn(e){let t=ct;return Number.isFinite(e)&&e>0&&(ct=Math.floor(e)),t}function er(e){let t=lt;return Number.isFinite(e)&&e>0&&(lt=Math.floor(e)),t}function Mi(e){let t=e;return t._runEpoch!==ut?(t._runEpoch=ut,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>ct)}function Oi(e){let t=e.__name??"<unnamed>";w(new Error(`subscriber "${t}" fired more than ${ct} 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 Di(){w(new Error(`Notification drain exceeded ${lt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function tr(){let e=0;for(;e<be.length;){if(e>=lt){Di();break}let t=be[e++];if(Z.delete(t),Ee.size>0&&Ee.has(t)||t._hasComputedDep===!0&&!Ri(t))continue;if(Mi(t)){Oi(t),Ee.add(t);continue}let n=Cn(t._cap??null);try{Ni(t)}finally{n&&Nn()}}}function nr(){if(!(ge>0)){ge++,ut++;try{tr()}finally{ge--,ge===0&&(be.length=0,Z.clear(),Ee.size>0&&Ee.clear())}}}function Pt(e){e();let t=e._sig;if(!t)return;let n=Ci,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 Z.has(s)||(Z.add(s),be.push(s));i=i.sigNext}}}function rr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Pt(r):Z.has(r)||(Z.add(r),be.push(r))),n=n.sigNext}}function or(e){let n=e.subsHead;if(n){if(ge>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Pt(o):Z.has(o)||(Z.add(o),be.push(o))),r=r.sigNext}return}ge++,ut++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Pt(o):Z.has(o)||(Z.add(o),be.push(o))),r=r.sigNext}tr()}finally{ge--,ge===0&&(be.length=0,Z.clear(),Ee.size>0&&Ee.clear())}}}function ir(e){return e.__sc??0}function sr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function ar(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var cr="4.12.0",lr=Symbol.for("sibujs.reactive.v1");function Ii(){let e=globalThis,t=e[lr];if(t)return!1,t;let n={suspendTracking:Bt,resumeTracking:Ft,isTrackingSuspended:Jn,untracked:Yn,retrack:jt,track:Xn,reactiveBinding:qt,recordDependency:Zn,cleanup:He,setMaxSubscriberRepeats:Qn,setMaxDrainIterations:er,drainNotificationQueue:nr,queueSignalNotification:rr,notifySubscribers:or,getSubscriberCount:ir,getSubscriberDeps:sr,forEachSubscriber:ar,getOwnerScope:zt,runWithOwnerScope:dt,bindOwnerScope:Vt,version:cr};return e[lr]=n,n}var D=Ii(),Te=D.suspendTracking,we=D.resumeTracking,ur=D.isTrackingSuspended,ee=D.untracked,he=D.retrack,G=D.track,I=D.reactiveBinding,ke=D.recordDependency,Ae=D.cleanup,Xl=D.setMaxSubscriberRepeats,dr=D.setMaxDrainIterations,fr=D.drainNotificationQueue,pr=D.queueSignalNotification,Ie=D.notifySubscribers,Zl=D.getSubscriberCount,Ql=D.getSubscriberDeps,eu=D.forEachSubscriber,$e=D.getOwnerScope??zt,ft=D.runWithOwnerScope??dt,B=D.bindOwnerScope??Vt;function Ue(e,t,n){if(me(t))return X(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}X(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return I(r,e)}function mr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){w(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){w(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),X(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=I(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Wt=["data-focus-key","id","name"],$i=new Set(["text","search","url","tel","password",""]);function Pi(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&$i.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 Ke(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<Wt.length;i++){let s=t.getAttribute(Wt[i]);if(s){r=Wt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Pi(t)}}function Bi(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Fi(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 c=0;c<a.length;c++)r++,n??(n=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function gr(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 Pe(e,t,n){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){gr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Fi(t,`[${e.attr}=${Bi(e.value)}]`);if(i&&i.tagName===e.tag){gr(i,e);return}o=s>1}}function le(e,t){let n=[];function r(){let o;try{o=t()}catch(u){w(u,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ke(n);if(o==null||typeof o=="boolean"){for(let u=0;u<n.length;u++){let m=n[u];M(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Pe(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let u=new Set;for(let m=0;m<o.length;m++){let g=o[m];if(g==null||typeof g=="boolean")continue;let f=g instanceof Node?g:document.createTextNode(String(g));if(u.has(f)){!1;continue}u.add(f),a.push(f)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(n.length>0&&a.length>0){let u=new Set(n);c=new Set;for(let m=0;m<a.length;m++)u.has(a[m])&&c.add(a[m])}for(let u=0;u<n.length;u++){let m=n[u];c?.has(m)||(M(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let u=0;u<a.length;u++){let m=a[u];l.nextSibling!==m&&s.insertBefore(m,l.nextSibling),l=m}n=a,Pe(i,a,"bindChildNode")}return I(r,e)}function Ut(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function V(){typeof document>"u"&&Ut()}var R="http://www.w3.org/2000/svg",zi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Kt=new Set,br=100,hr=!1,yr=new Map;function Sr(e){let t=yr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),yr.set(e,t)),t}function Vi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=I(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",it(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let u in a){if(!Object.hasOwn(a,u))continue;let m=a[u];if(m==null)continue;let g=Sr(u);l.push(g),c.setProperty(g,ot(g,String(m),{element:e}))}for(let u=0;u<o.length;u++)l.indexOf(o[u])===-1&&c.removeProperty(o[u]);o=l},e);x(e,s);return}if(typeof t=="string"){e.setAttribute("style",it(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Sr(r);if(typeof o=="function"){let s=o,a=I(()=>{n.style.setProperty(i,ot(i,String(s()),{element:e}))},e);x(e,a)}else n.style.setProperty(i,ot(i,String(o),{element:e}))}}function ji(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=I(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);x(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=I(()=>{let a="";for(let c in n){if(!Object.hasOwn(n,c))continue;let l=n[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);x(e,s)}else e.setAttribute("class",o)}function Gt(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),x(e,le(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),x(e,le(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),x(e,le(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 d(e,t){let n=zn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&Ut();let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Gt(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 Gt(i,r),i;let s=r,a=s.class;a!=null&&ji(i,a);let c=s.id;typeof c=="function"?x(i,Ue(i,"id",c)):c!=null&&(!1,i.id=c);let l=o!==void 0?o:s.nodes;l!=null&&Gt(i,l);let u=s.on;if(u)for(let f in u){if(!Object.hasOwn(u,f))continue;let p=u[f];typeof p=="function"?i.addEventListener(f,p):!1}let m=s.style;m!=null&&Vi(i,m);let g=s.ref;g&&(g.current=i);for(let f in s)switch(f){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,f))continue;let p=s[f];if(p==null||me(f))continue;typeof p=="function"?x(i,Ue(i,f,p)):X(i,f,p,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var wu=d("html"),qi=d("head"),Wi=d("body"),Ui=d("title"),_=d("div"),H=d("span"),Ki=d("section"),Gi=d("article"),Ji=d("header"),Yi=d("footer"),Xi=d("nav"),Zi=d("main"),Qi=d("aside"),es=d("address"),Jt=d("p"),ts=d("h1"),ns=d("h2"),Yt=d("h3"),rs=d("h4"),os=d("h5"),is=d("h6"),ss=d("blockquote"),as=d("dd"),cs=d("dl"),ls=d("dt"),us=d("figcaption"),ds=d("figure"),fs=d("hr"),ps=d("li"),ms=d("ol"),gs=d("ul"),Xt=d("pre"),bs=d("a"),hs=d("abbr"),ys=d("b"),Ss=d("bdi"),vs=d("bdo"),xs=d("br"),Es=d("cite"),Zt=d("code"),Ts=d("data"),ws=d("dfn"),ks=d("em"),As=d("i"),_s=d("kbd"),Cs=d("mark"),Ns=d("q"),Rs=d("rp"),Ls=d("rt"),Ms=d("ruby"),Os=d("s"),Ds=d("samp"),Hs=d("small"),Is=d("strong"),$s=d("sub"),Ps=d("sup"),Bs=d("time"),Fs=d("u"),zs=d("var"),Vs=d("area"),js=d("audio"),qs=d("img"),Ws=d("map"),Us=d("track"),Ks=d("video"),Gs=d("embed"),Js=d("iframe"),Ys=d("object"),Xs=d("param"),Zs=d("picture"),Qs=d("portal"),ea=d("source"),ta=d("svg",R),na=d("math"),ra=d("canvas"),oa=d("noscript"),ia=d("script"),sa=d("del"),aa=d("ins"),ca=d("caption"),la=d("col"),ua=d("colgroup"),da=d("table"),fa=d("tbody"),pa=d("td"),ma=d("tfoot"),ga=d("th"),ba=d("thead"),ha=d("tr"),Ge=d("button"),ya=d("datalist"),Sa=d("fieldset"),va=d("form"),xa=d("input"),Ea=d("label"),Ta=d("legend"),wa=d("meter"),ka=d("optgroup"),Aa=d("option"),_a=d("output"),Ca=d("progress"),Na=d("select"),Ra=d("textarea"),La=d("details"),Ma=d("dialog"),Oa=d("menu"),Da=d("summary"),Ha=d("slot"),Ia=d("template"),$a=d("base"),Pa=d("link"),Ba=d("meta"),_e=d("style"),Fa=d("circle",R),za=d("ellipse",R),Va=d("g",R),ja=d("line",R),qa=d("path",R),Wa=d("polygon",R),Ua=d("polyline",R),Ka=d("rect",R),Ga=d("text",R),Ja=d("tspan",R),Ya=d("defs",R),Xa=d("clipPath",R),Za=d("mask",R),Qa=d("pattern",R),ec=d("linearGradient",R),tc=d("radialGradient",R),nc=d("stop",R),rc=d("use",R),oc=d("symbol",R),ic=d("marker",R),sc=d("center"),ac=d("font"),cc=d("marquee"),lc=e=>d(e);var Qt="__sibuPendingError";function vr(e,t){let n=()=>e.parentNode?(w(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[Qt]=t)})}function pt(e){let t=e,n=t[Qt];if(n instanceof Error)return delete t[Qt],n}function xr(e){let t=null;return function(){if(t)return t();let r=_({class:"sibu-lazy"}),o=!1;return e().then(B(i=>{if(o)return;t=i.default;let s=t();z(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));z(r,_({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),vr(r,s)}),r.appendChild(H("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function Er({nodes:e,fallback:t}){let n=_({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;x(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&M(s)});let a=B(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){z(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,z(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else z(n,c)}catch(c){let l=c instanceof Error?c:new Error(String(c));vr(n,l)}});return queueMicrotask(a),n}function rn(e,t){return()=>$e()===e?t():ft(e,t)}function gt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";w(n,{phase:r,name:t});return}}function en(e,t,n,r,o){let i=gt(e,t);if(typeof i!="function")return;let s=rn(o,i);r()||!n.isConnected?gt(s,"onUnmount"):wr(s,n)}var Be=new WeakMap,Ce=new WeakMap,ue=new Set,de=new Set,Fe=null,mt=0,uc=256;function tn(e){let t=Be.get(e);if(t){Be.delete(e),ue.delete(e);for(let n of t)try{n()}catch{}}}function nn(e){Ce.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ce.get(e);if(n){Ce.delete(e),de.delete(e);for(let r of n)try{r()}catch{}}})}function dc(e){if(ue.size===0||e.nodeType!==1)return;let t=e;if(ue.has(t)&&t.isConnected&&tn(t),t.firstElementChild)for(let n of Array.from(ue))n!==t&&n.isConnected&&t.contains(n)&&tn(n)}function fc(e){if(de.size===0||e.nodeType!==1)return;let t=e;if(de.has(t)&&!t.isConnected&&nn(t),t.firstElementChild)for(let n of Array.from(de))n!==t&&!n.isConnected&&t.contains(n)&&nn(n)}function pc(){if(ue.size>0)for(let e of Array.from(ue))e.isConnected&&tn(e);if(de.size>0)for(let e of Array.from(de))e.isConnected||nn(e)}function Tr(){Fe||typeof document>"u"||(Fe=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++)dc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)fc(t.removedNodes[n])}mt+=e.length,mt>=uc&&(mt=0,pc()),on()}),Fe.observe(document.body,{childList:!0,subtree:!0}))}function on(){Fe&&ue.size===0&&de.size===0&&(Fe.disconnect(),Fe=null,mt=0)}function mc(e,t){let n=Be.get(e);return n||(n=[],Be.set(e,n)),n.push(t),ue.add(e),Tr(),()=>{let r=Be.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Be.delete(e),ue.delete(e))}on()}}function gc(e,t){let n=Ce.get(e);return n||(n=[],Ce.set(e,n)),n.push(t),de.add(e),Tr(),()=>{let r=Ce.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ce.delete(e),de.delete(e))}on()}}function bt(e,t){if(typeof document>"u")return;let n=$e();if(e=rn(n,e),t){let r=!1,o=()=>r;if(x(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||en(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){en(e,"onMount",t,o,n);return}let i=mc(t,()=>{r||en(e,"onMount",t,o,n)});x(t,i)})}else queueMicrotask(()=>{gt(e,"onMount")})}function bc(e,t){typeof document>"u"||wr(rn($e(),e),t)}function wr(e,t){let n=!1,r=()=>{n||(n=!0,gt(e,"onUnmount"))};x(t,r);let o=()=>{if(n)return;let i=gc(t,r);x(t,i)};t.isConnected?o():bt(()=>{o()},t)}function hc(e,t){x(t,e)}function J(e,t,n){try{e.emit(t,n)}catch{}}var sn=Symbol.for("sibujs.ssr.v1");function yc(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof wt=="function"&&(t=wt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ye=globalThis[sn]??(globalThis[sn]=yc()),Ne=ye.als,F=ye.fallbackStore;ye.fallbackDepth??(ye.fallbackDepth=0);var kr=!1;function Sc(){if(kr||Ne||!(typeof process<"u"&&!!process.versions?.node))return;kr=!0;let t=process.versions.node;`${t}`}function Re(){if(Ne){let e=Ne.getStore();if(e)return e}return F}function Ar(){return Ne?Ne.getStore()??null:ye.fallbackDepth>0?F:null}function te(){return Re().ssr}function _r(e){if(!te())return null;let t=Re(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Cr(){Re().ssr=!0}function Nr(){Re().ssr=!1}function Rr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ne)return Ne.run(t,e);Sc();let n=F.ssr,r=F.suspenseIdCounter,o=F.idCounter,i=F.locale;F.ssr=!0,F.suspenseIdCounter=0,F.idCounter=0,F.locale=void 0,ye.fallbackDepth++;try{return e()}finally{ye.fallbackDepth--,F.ssr=n,F.suspenseIdCounter=r,F.idCounter=o,F.locale=i}}function Lr(e){let t=Re(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Hr=globalThis;function vc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,ee(()=>t(o,void 0));else{let i=n;n=o,ee(()=>t(o,i))}}}var Mr=100;function ht(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===$e()?Or(t):ft(n,()=>Or(t))}function Or(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){w(n,{phase:"cleanup"})}}function Dr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&ht(e),he(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Mr);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${Mr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function xc(e){if(e.disposed)return;e.disposed=!0;let t=Hr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&ht(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ae(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Y(e,t){if(te())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&&ht(n),he(n.bodyFn,o),n.rerunPending&&Dr(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{he(n.bodyFn,n.subscriber),n.rerunPending&&Dr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&ht(n),Ae(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Hr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&J(i,"effect:create",{effectFn:e}),()=>xc(n)}var Je=0,an=new Set;function Ec(e){Je++;try{return e()}finally{Je--,Je===0&&kc()}}function Tc(e){return Je===0?!1:(an.add(e),!0)}function wc(){return Je>0}function kc(){try{for(let e of an)pr(e)}finally{an.clear()}fr()}var Ir=Symbol.for("sibujs.reactive.batch.v1");function Ac(){let e=globalThis,t=e[Ir];if(t)return t;let n={batch:Ec,enqueueBatchedSignal:Tc,isBatching:wc};return e[Ir]=n,n}var cn=Ac(),j=cn.batch,Le=cn.enqueueBatchedSignal,_c=cn.isBatching;var ln=globalThis;function C(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 ke(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let c=n.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(n.value=l,n.__v++,!1){let u=ln.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&J(u,"signal:update",{signal:n,name:r,oldValue:c,newValue:l})}Le(n)||Ie(n)}}:s=a=>{let c=n.value,l=typeof a=="function"?a(c):a;Object.is(l,c)||(n.value=l,n.__v++,Le(n)||Ie(n))},!1){let a=ln.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&J(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Cc(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Nc=`
5
+ `?2:1;continue}if(Hn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Hn(e[s]);)i+=e[s],s++;s<e.length&&Qo(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
6
+ `?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;t+=c?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var In=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],ti=4,ni=5,ri=8;function oi(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 Rt=new Set,Pn=100,$n=!1;function ot(e,t,n){}function Bn(e){return(e.includes("\\")?ei(e):e).toLowerCase().replace(/\s+/g,"")}function Lt(e){if(!Zo.test(e))return-1;let t=Bn(e);for(let n=0;n<In.length;n++)if(t.includes(In[n]))return n;return-1}function st(e,t,n){let r=Mt(e,t);return r===-1?t:(ot(t,r,{property:e,element:n?.element}),"")}function Mt(e,t){let n=Lt(t);if(n!==-1)return n;let r=U(e);return r==="behavior"?ni:r==="-moz-binding"?ti:(r==="filter"||r==="-ms-filter")&&Bn(t).includes("progid:")?ri:-1}function ii(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 c=e.indexOf("*/",s+2);if(c===-1)return null;s=c+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 c=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(c))continue;let u=s.slice(a+1).trim(),l=/!\s*important\s*$/i.exec(u);if(l&&(u=u.slice(0,l.index).trim()),u==="")continue;let p=c.startsWith("--")?c:U(c);i.push([p,u,l!==null])}return i}function si(e,t){let n=String(e),r=ii(n);if(r===null)return Lt(n)!==-1&&ot(n,Lt(n),t),"";let o=[];for(let[i,s,a]of r){let c=Mt(i,s);if(c!==-1){ot(s,c,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function at(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return si(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),c=Mt(s,a);if(c!==-1){ot(a,c,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var Ot=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ai=new Set(["srcdoc"]);function Ke(e){return ai.has(e.toLowerCase())}function Fn(e){return Ot.has(e.toLowerCase())}function ci(e){let t=e.toLowerCase();return t==="style"||Ot.has(t)}function ui(e,t,n){let r=e.toLowerCase();return r==="srcset"?Xo(t):Ot.has(r)?it(t):r==="style"?at(t,n):t}function zn(e,t,n){if(!ci(e))return t;let r=ui(e,t,n);return r===""?null:r}function ve(e){return e===" "||e===" "||e===`
7
+ `||e==="\r"||e==="\f"}function ct(e){let t=0,n=e.length;for(;t<n&&ve(e[t]);)t++;for(;n>t&&ve(e[n-1]);)n--;return e.slice(t,n)}var K=e=>({kind:"forbidden",reason:e});function li(e){let t=ct(De(e));if(t==="")return K("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return K("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return K("");for(;n<t.length&&ve(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return K("");for(n++;n<t.length&&ve(t[n]);)n++;let o=n;for(;n<t.length&&!ve(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return K("");for(;n<t.length&&ve(t[n]);)n++;if(t[n]!=="=")return K("");for(n++;n<t.length&&ve(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return K("");if(s=t.slice(n+1,u),ct(t.slice(u+1))!=="")return K("")}else if(s=ct(t.slice(n)),/[;,]/.test(s))return K("");if(s==="")return K("");let c=it(s);return c===""?K(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Dt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=U(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?K(""):typeof t!="string"?{kind:"not-refresh"}:ct(De(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:li(n)}var di="http://www.w3.org/1999/xhtml",fi="http://www.w3.org/2000/svg",pi=new Set(["script","iframe","object","embed","frame","frameset"]);function Wn(e){return U(e)}function jn(e){return pi.has(Wn(e))}var mi=new Set(["script","style"]);function qn(e){return mi.has(Wn(e))}var L={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},gi=new Set(["src","href","xlink:href","type","language"]),bi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Ht=new WeakSet;function Un(e){return e.namespaceURI===di||e.namespaceURI===null}function Kn(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 hi(e){Ht.has(e)||(Ht.add(e),e.getAttribute("content")!==null&&Dt(Kn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function yi(e,t,n,r){if(!Un(e))return L.None;let o=U(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&hi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return L.None;let i=Dt(Kn(e,o,n));return i.kind==="forbidden"?L.MetaRefreshForbidden:i.kind!=="not-refresh"&&Ht.has(e)?L.MetaRefreshReactive:L.None}function Si(e,t){if(t===null||U(e)!=="attributename")return L.None;let n=De(t);return Fn(n)||pe(n)||Ke(n)?L.AnimationTarget:L.None}var ut=new WeakSet;function Vn(e){if(e===null)return!1;let t=U(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 vi(e,t,n,r){if(!Un(e))return L.None;let o=U(t);return o==="href"?r==="static"||n===null?L.None:Vn(e.getAttribute("rel"))?L.StylesheetSource:(ut.add(e),L.None):o==="rel"&&Vn(n)&&ut.has(e)&&e.hasAttribute("href")?L.StylesheetSource:L.None}function It(e,t,n,r){let o=e.localName;return o==="meta"?yi(e,t,n,r):o==="link"?vi(e,t,n,r):o==="script"?r==="static"||n===null?L.None:gi.has(U(t))?L.ScriptSource:L.None:bi.has(o)&&e.namespaceURI===fi?Si(t,n):L.None}function Pt(e,t,n){e.localName!=="link"||U(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?ut.add(e):ut.delete(e))}var xi="http://www.w3.org/1999/xhtml",Ei="http://www.w3.org/2000/svg",Ti="http://www.w3.org/1999/xlink",wi="http://www.w3.org/XML/1998/namespace",ki=new Set(["checked","disabled","selected"]);function _i(e){return e.namespaceURI===null||e.namespaceURI===xi}function Jn(e,t,n){}function Gn(e,t,n){e[t]=n}function Ai(e,t){if(e.namespaceURI!==Ei)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Ti:n.startsWith("xml:")?wi:null}function X(e,t,n,r={}){let o=Ci(e,t,n,r);return e.localName==="link"&&Pt(e,t,r.reactive?"reactive":"runtime"),o}function Ci(e,t,n,r){let o=Ai(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(pe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=It(e,t,s,r.reactive?"reactive":"runtime");if(a!==L.None)return Jn(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(Ke(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let c=_i(e),u=c?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 c&&ki.has(u)&&u in e?Gn(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let l=String(n);if(r.syncValueProperty!==!1&&c&&(u==="value"||u==="checked")&&u in e)return Gn(e,u,u==="checked"?!!n:l),!0;let p=l===""?"":zn(t,l,{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 $t(e,t,n){if(Ke(t))return!1,!1;let r=It(e,t,n,"static");return r!==L.None?(Jn("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Pt(e,t,"static"),!0)}var Ni=4096,Bt=[];function Ri(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Li(e,t,n){let r=Bt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Ri();return o.sig=e,o.sub=t,o.epoch=n,o}function Yn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Bt.length<Ni&&Bt.push(e)}function Mi(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 Xn(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 Oi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Di(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 Z=null,se=null,me=0,ge=[],$=new Set,Hi=[];function Ii(e){try{e()}catch(t){let n=e;k(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Pi(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 oe=0,ae=!1;function zt(){oe===0&&(se=Z,Z=null,ae=!0),oe++}function Vt(){oe--,oe===0&&(Z=se,se=null,ae=!1)}function Zn(){return ae}function Qn(e){zt();try{return e()}finally{Vt()}}var G=null;function Wt(){return G}function pt(e,t){let n=G;G=e;try{return t()}finally{G=n}}function jt(e){let t=G;return t===null?e:(...n)=>pt(t,()=>e(...n))}var He=null,$i=0;function qt(e,t){let n=Z,r=0,o=null;ae&&(r=oe,o=se,oe=0,se=null,ae=!1),Z=t;let i=t;i._cap===void 0&&(i._cap=Rn());let s=G;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(G=a);let c=He;c!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=c),i._tok!=null&&(He=i._tok);let u=++$i;i._epoch=u,i._structDirty=!1;for(let l=i.depsHead??null;l!==null;l=l.subNext){let p=l.sig;l.prevActive=p.__activeNode??null,p.__activeNode=l}try{e()}finally{Z=n,G=s,He=c,r!==0&&(oe=r,se=o,ae=!0);let l=i.depsHead??null;for(;l!==null;){let p=l.subNext,g=l.sig;g.__activeNode=l.prevActive,l.prevActive=null,l.epoch!==u&&(Di(l),Xn(l),Yn(l)),l=p}}}function er(e,t){if(!t)return Ut(e);Ie(t);let n=Z,r=0,o=null;ae&&(r=oe,o=se,oe=0,se=null,ae=!1),Z=t;let i=t;i._scope===void 0&&(i._scope=G);let s=G;G=i._scope;try{e()}finally{Z=n,G=s,r!==0&&(oe=r,se=o,ae=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Ie(t))}function Ut(e,t,n){return nr(e,t,n===!0)._dispose}function tr(e,t){let n=nr(e,t,!0);return{stop:n._dispose,run:r=>{let o=He;He=n._tok??null;try{return r()}finally{He=o}}}}function nr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{qt(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),Ie(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Ie(o)},o}function rr(e){if(!Z)return;let t=Z,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=Li(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Oi(t,i),Mi(n,i),t._structDirty=!0}function Ie(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;Xn(n),Yn(n),n=r}}var lt=1e3,dt=1e6,ft=0,xe=new Set;function or(e){let t=lt;return Number.isFinite(e)&&e>0&&(lt=Math.floor(e)),t}function ir(e){let t=dt;return Number.isFinite(e)&&e>0&&(dt=Math.floor(e)),t}function Bi(e){let t=e;return t._runEpoch!==ft?(t._runEpoch=ft,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>lt)}function Fi(e){let t=e.__name??"<unnamed>";k(new Error(`subscriber "${t}" fired more than ${lt} 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 zi(){k(new Error(`Notification drain exceeded ${dt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function sr(){let e=0;for(;e<ge.length;){if(e>=dt){zi();break}let t=ge[e++];$.delete(t)&&(t._owner!=null&&$.size>0&&(Vi(t),$.has(t))||ar(t))}}function Vi(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;$.has(r)&&(t=r),n=r._owner??null}if(t===null)return;$.delete(t),ar(t)}}function ar(e){if(xe.size>0&&xe.has(e)||e._hasComputedDep===!0&&!Pi(e))return;if(Bi(e)){Fi(e),xe.add(e);return}let t=Ln(e._cap??null);try{Ii(e)}finally{t&&Mn()}}function cr(){if(!(me>0)){me++,ft++;try{sr()}finally{me--,me===0&&(ge.length=0,$.clear(),xe.size>0&&xe.clear())}}}function Ft(e){e();let t=e._sig;if(!t)return;let n=Hi,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 $.has(s)||($.add(s),ge.push(s));i=i.sigNext}}}function ur(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Ft(r):$.has(r)||($.add(r),ge.push(r))),n=n.sigNext}}function lr(e){let n=e.subsHead;if(n){if(me>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Ft(o):$.has(o)||($.add(o),ge.push(o))),r=r.sigNext}return}me++,ft++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Ft(o):$.has(o)||($.add(o),ge.push(o))),r=r.sigNext}sr()}finally{me--,me===0&&(ge.length=0,$.clear(),xe.size>0&&xe.clear())}}}function dr(e){return e.__sc??0}function fr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function pr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var mr="4.13.1",gr=Symbol.for("sibujs.reactive.v1");function ji(){let e=globalThis,t=e[gr];if(t)return!1,t;let n={suspendTracking:zt,resumeTracking:Vt,isTrackingSuspended:Zn,untracked:Qn,retrack:qt,track:er,reactiveBinding:Ut,recordDependency:rr,cleanup:Ie,setMaxSubscriberRepeats:or,setMaxDrainIterations:ir,drainNotificationQueue:cr,queueSignalNotification:ur,notifySubscribers:lr,getSubscriberCount:dr,getSubscriberDeps:fr,forEachSubscriber:pr,getOwnerScope:Wt,runWithOwnerScope:pt,bindOwnerScope:jt,structuralBinding:tr,version:mr};return e[gr]=n,n}var O=ji(),Ee=O.suspendTracking,Te=O.resumeTracking,br=O.isTrackingSuspended,Q=O.untracked,be=O.retrack,Pe=O.track,I=O.reactiveBinding,we=O.recordDependency,ke=O.cleanup,il=O.setMaxSubscriberRepeats,hr=O.setMaxDrainIterations,yr=O.drainNotificationQueue,Sr=O.queueSignalNotification,$e=O.notifySubscribers,sl=O.getSubscriberCount,al=O.getSubscriberDeps,cl=O.forEachSubscriber,Be=O.getOwnerScope??Wt,mt=O.runWithOwnerScope??pt,F=O.bindOwnerScope??jt,_e=O.structuralBinding??((e,t)=>({stop:O.reactiveBinding(e,t),run:n=>n()}));function Ge(e,t,n){if(pe(t))return X(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){k(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}X(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return I(r,e)}function vr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){k(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){k(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),X(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=I(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Kt=["data-focus-key","id","name"],qi=new Set(["text","search","url","tel","password",""]);function Ui(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&qi.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 Je(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<Kt.length;i++){let s=t.getAttribute(Kt[i]);if(s){r=Kt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Ui(t)}}function Ki(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Gi(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 c=0;c<a.length;c++)r++,n??(n=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function xr(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 Fe(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){xr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=Gi(t,`[${e.attr}=${Ki(e.value)}]`);if(s&&s.tagName===e.tag){xr(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 ce(e,t){let n=[];function r(){let o;try{o=t()}catch(l){k(l,{phase:"binding",name:"bindChildNode",node:e});return}let i=Je(n);if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let p=n[l];M(p),p.parentNode&&p.parentNode.removeChild(p)}n.length=0,Fe(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let l=new Set;for(let p=0;p<o.length;p++){let g=o[p];if(g==null||typeof g=="boolean")continue;let m=g instanceof Node?g:document.createTextNode(String(g));if(l.has(m)){!1;continue}l.add(m),a.push(m)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(n.length>0&&a.length>0){let l=new Set(n);c=new Set;for(let p=0;p<a.length;p++)l.has(a[p])&&c.add(a[p])}for(let l=0;l<n.length;l++){let p=n[l];c?.has(p)||(M(p),p.parentNode&&p.parentNode.removeChild(p))}let u=e;for(let l=0;l<a.length;l++){let p=a[l];u.nextSibling!==p&&s.insertBefore(p,u.nextSibling),u=p}n=a,Fe(i,a,"bindChildNode")}return I(r,e,!0)}function Gt(){throw new Error("[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first.")}function W(){typeof document>"u"&&Gt()}var R="http://www.w3.org/2000/svg",Ji=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Jt=new Set,Er=100,Tr=!1,wr=new Map;function kr(e){let t=wr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),wr.set(e,t)),t}function Yi(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=I(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",at(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let l in a){if(!Object.hasOwn(a,l))continue;let p=a[l];if(p==null)continue;let g=kr(l);u.push(g),c.setProperty(g,st(g,String(p),{element:e}))}for(let l=0;l<o.length;l++)u.indexOf(o[l])===-1&&c.removeProperty(o[l]);o=u},e);x(e,s);return}if(typeof t=="string"){e.setAttribute("style",at(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=kr(r);if(typeof o=="function"){let s=o,a=I(()=>{n.style.setProperty(i,st(i,String(s()),{element:e}))},e);x(e,a)}else n.style.setProperty(i,st(i,String(o),{element:e}))}}function Xi(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=I(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);x(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=I(()=>{let a="";for(let c in n){if(!Object.hasOwn(n,c))continue;let u=n[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);x(e,s)}else e.setAttribute("class",o)}function Yt(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),x(e,ce(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),x(e,ce(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),x(e,ce(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 d(e,t){let n=jn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&Gt();let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Yt(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 Yt(i,r),i;let s=r,a=s.class;a!=null&&Xi(i,a);let c=s.id;typeof c=="function"?x(i,Ge(i,"id",c)):c!=null&&(!1,i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Yt(i,u);let l=s.on;if(l)for(let m in l){if(!Object.hasOwn(l,m))continue;let f=l[m];typeof f=="function"?i.addEventListener(m,f):!1}let p=s.style;p!=null&&Yi(i,p);let g=s.ref;g&&(g.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 f=s[m];if(f==null||pe(m))continue;typeof f=="function"?x(i,Ge(i,m,f)):X(i,m,f,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Ml=d("html"),Zi=d("head"),Qi=d("body"),es=d("title"),A=d("div"),H=d("span"),ts=d("section"),ns=d("article"),rs=d("header"),os=d("footer"),is=d("nav"),ss=d("main"),as=d("aside"),cs=d("address"),Xt=d("p"),us=d("h1"),ls=d("h2"),Zt=d("h3"),ds=d("h4"),fs=d("h5"),ps=d("h6"),ms=d("blockquote"),gs=d("dd"),bs=d("dl"),hs=d("dt"),ys=d("figcaption"),Ss=d("figure"),vs=d("hr"),xs=d("li"),Es=d("ol"),Ts=d("ul"),Qt=d("pre"),ws=d("a"),ks=d("abbr"),_s=d("b"),As=d("bdi"),Cs=d("bdo"),Ns=d("br"),Rs=d("cite"),en=d("code"),Ls=d("data"),Ms=d("dfn"),Os=d("em"),Ds=d("i"),Hs=d("kbd"),Is=d("mark"),Ps=d("q"),$s=d("rp"),Bs=d("rt"),Fs=d("ruby"),zs=d("s"),Vs=d("samp"),Ws=d("small"),js=d("strong"),qs=d("sub"),Us=d("sup"),Ks=d("time"),Gs=d("u"),Js=d("var"),Ys=d("area"),Xs=d("audio"),Zs=d("img"),Qs=d("map"),ea=d("track"),ta=d("video"),na=d("embed"),ra=d("iframe"),oa=d("object"),ia=d("param"),sa=d("picture"),aa=d("portal"),ca=d("source"),ua=d("svg",R),la=d("math"),da=d("canvas"),fa=d("noscript"),pa=d("script"),ma=d("del"),ga=d("ins"),ba=d("caption"),ha=d("col"),ya=d("colgroup"),Sa=d("table"),va=d("tbody"),xa=d("td"),Ea=d("tfoot"),Ta=d("th"),wa=d("thead"),ka=d("tr"),Ye=d("button"),_a=d("datalist"),Aa=d("fieldset"),Ca=d("form"),Na=d("input"),Ra=d("label"),La=d("legend"),Ma=d("meter"),Oa=d("optgroup"),Da=d("option"),Ha=d("output"),Ia=d("progress"),Pa=d("select"),$a=d("textarea"),Ba=d("details"),Fa=d("dialog"),za=d("menu"),Va=d("summary"),Wa=d("slot"),ja=d("template"),qa=d("base"),Ua=d("link"),Ka=d("meta"),Ae=d("style"),Ga=d("circle",R),Ja=d("ellipse",R),Ya=d("g",R),Xa=d("line",R),Za=d("path",R),Qa=d("polygon",R),ec=d("polyline",R),tc=d("rect",R),nc=d("text",R),rc=d("tspan",R),oc=d("defs",R),ic=d("clipPath",R),sc=d("mask",R),ac=d("pattern",R),cc=d("linearGradient",R),uc=d("radialGradient",R),lc=d("stop",R),dc=d("use",R),fc=d("symbol",R),pc=d("marker",R),mc=d("center"),gc=d("font"),bc=d("marquee"),hc=e=>d(e);var tn="__sibuPendingError";function _r(e,t){let n=()=>e.parentNode?(k(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[tn]=t)})}function gt(e){let t=e,n=t[tn];if(n instanceof Error)return delete t[tn],n}function Ar(e){let t=null;return function(){if(t)return t();let r=A({class:"sibu-lazy"}),o=!1;return e().then(F(i=>{if(o)return;t=i.default;let s=t();V(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));V(r,A({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),_r(r,s)}),r.appendChild(H("sibu-lazy-loading","Loading...")),x(r,()=>{o=!0}),r}}function Cr({nodes:e,fallback:t}){let n=A({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;x(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&M(s)});let a=F(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){V(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,V(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else V(n,c)}catch(c){let u=c instanceof Error?c:new Error(String(c));_r(n,u)}});return queueMicrotask(a),n}function sn(e,t){return()=>Be()===e?t():mt(e,t)}function ht(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";k(n,{phase:r,name:t});return}}function nn(e,t,n,r,o){let i=ht(e,t);if(typeof i!="function")return;let s=sn(o,i);r()||!n.isConnected?ht(s,"onUnmount"):Rr(s,n)}var ze=new WeakMap,Ce=new WeakMap,ue=new Set,le=new Set,Ve=null,bt=0,yc=256;function rn(e){let t=ze.get(e);if(t){ze.delete(e),ue.delete(e);for(let n of t)try{n()}catch{}}}function on(e){Ce.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ce.get(e);if(n){Ce.delete(e),le.delete(e);for(let r of n)try{r()}catch{}}})}function Sc(e){if(ue.size===0||e.nodeType!==1)return;let t=e;if(ue.has(t)&&t.isConnected&&rn(t),t.firstElementChild)for(let n of Array.from(ue))n!==t&&n.isConnected&&t.contains(n)&&rn(n)}function vc(e){if(le.size===0||e.nodeType!==1)return;let t=e;if(le.has(t)&&!t.isConnected&&on(t),t.firstElementChild)for(let n of Array.from(le))n!==t&&!n.isConnected&&t.contains(n)&&on(n)}function xc(){if(ue.size>0)for(let e of Array.from(ue))e.isConnected&&rn(e);if(le.size>0)for(let e of Array.from(le))e.isConnected||on(e)}function Nr(){Ve||typeof document>"u"||(Ve=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++)Sc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)vc(t.removedNodes[n])}bt+=e.length,bt>=yc&&(bt=0,xc()),an()}),Ve.observe(document.body,{childList:!0,subtree:!0}))}function an(){Ve&&ue.size===0&&le.size===0&&(Ve.disconnect(),Ve=null,bt=0)}function Ec(e,t){let n=ze.get(e);return n||(n=[],ze.set(e,n)),n.push(t),ue.add(e),Nr(),()=>{let r=ze.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(ze.delete(e),ue.delete(e))}an()}}function Tc(e,t){let n=Ce.get(e);return n||(n=[],Ce.set(e,n)),n.push(t),le.add(e),Nr(),()=>{let r=Ce.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ce.delete(e),le.delete(e))}an()}}function yt(e,t){if(typeof document>"u")return;let n=Be();if(e=sn(n,e),t){let r=!1,o=()=>r;if(x(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||nn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){nn(e,"onMount",t,o,n);return}let i=Ec(t,()=>{r||nn(e,"onMount",t,o,n)});x(t,i)})}else queueMicrotask(()=>{ht(e,"onMount")})}function wc(e,t){typeof document>"u"||Rr(sn(Be(),e),t)}function Rr(e,t){let n=!1,r=()=>{n||(n=!0,ht(e,"onUnmount"))};x(t,r);let o=()=>{if(n)return;let i=Tc(t,r);x(t,i)};t.isConnected?o():yt(()=>{o()},t)}function kc(e,t){x(t,e)}function J(e,t,n){try{e.emit(t,n)}catch{}}var cn=Symbol.for("sibujs.ssr.v1");function _c(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof _t=="function"&&(t=_t("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var he=globalThis[cn]??(globalThis[cn]=_c()),Ne=he.als,z=he.fallbackStore;he.fallbackDepth??(he.fallbackDepth=0);var Lr=!1;function Ac(){if(Lr||Ne||!(typeof process<"u"&&!!process.versions?.node))return;Lr=!0;let t=process.versions.node;`${t}`}function Re(){if(Ne){let e=Ne.getStore();if(e)return e}return z}function Mr(){return Ne?Ne.getStore()??null:he.fallbackDepth>0?z:null}function ee(){return Re().ssr}function Or(e){if(!ee())return null;let t=Re(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Dr(){Re().ssr=!0}function Hr(){Re().ssr=!1}function Ir(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Ne)return Ne.run(t,e);Ac();let n=z.ssr,r=z.suspenseIdCounter,o=z.idCounter,i=z.locale;z.ssr=!0,z.suspenseIdCounter=0,z.idCounter=0,z.locale=void 0,he.fallbackDepth++;try{return e()}finally{he.fallbackDepth--,z.ssr=n,z.suspenseIdCounter=r,z.idCounter=o,z.locale=i}}function Pr(e){let t=Re(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var zr=globalThis;function Cc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,Q(()=>t(o,void 0));else{let i=n;n=o,Q(()=>t(o,i))}}}var $r=100;function St(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Be()?Br(t):mt(n,()=>Br(t))}function Br(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){k(n,{phase:"cleanup"})}}function Fr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&St(e),be(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=$r);e.rerunPending&&(e.rerunPending=!1,k(new Error(`effect re-requested itself ${$r}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Nc(e){if(e.disposed)return;e.disposed=!0;let t=zr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&St(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{ke(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Y(e,t){if(ee())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&&St(n),be(n.bodyFn,o),n.rerunPending&&Fr(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{be(n.bodyFn,n.subscriber),n.rerunPending&&Fr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&St(n),ke(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=zr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&J(i,"effect:create",{effectFn:e}),()=>Nc(n)}var Xe=0,un=new Set;function Rc(e){Xe++;try{return e()}finally{Xe--,Xe===0&&Oc()}}function Lc(e){return Xe===0?!1:(un.add(e),!0)}function Mc(){return Xe>0}function Oc(){try{for(let e of un)Sr(e)}finally{un.clear()}yr()}var Vr=Symbol.for("sibujs.reactive.batch.v1");function Dc(){let e=globalThis,t=e[Vr];if(t)return t;let n={batch:Rc,enqueueBatchedSignal:Lc,isBatching:Mc};return e[Vr]=n,n}var ln=Dc(),j=ln.batch,Le=ln.enqueueBatchedSignal,Hc=ln.isBatching;var dn=globalThis;function C(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 we(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(n.value=u,n.__v++,!1){let l=dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&J(l,"signal:update",{signal:n,name:r,oldValue:c,newValue:u})}Le(n)||$e(n)}}:s=a=>{let c=n.value,u=typeof a=="function"?a(c):a;Object.is(u,c)||(n.value=u,n.__v++,Le(n)||$e(n))},!1){let a=dn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&J(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Ic(e){let[t,n]=C(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Pc=`
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
- `,$r=!1;function Rc(){if($r||typeof document>"u")return;let e=_e({nodes:Nc});document.head.appendChild(e),$r=!0}function Lc(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 Pr(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Lc(r),i=e.cause,s=i!=null?Pr(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 Mc(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(`
188
+ `,Wr=!1;function $c(){if(Wr||typeof document>"u")return;let e=Ae({nodes:Pc});document.head.appendChild(e),Wr=!0}function Bc(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 jr(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Bc(r),i=e.cause,s=i!=null?jr(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 Fc(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 Br(e){let t=e.map((n,r)=>_({class:"sibu-err-frame",nodes:[H({class:"sibu-err-line",nodes:String(r+1)}),H({class:"sibu-err-fn",nodes:n.fn}),H({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Xt({class:"sibu-err-stack",nodes:t})}function Fr(e){return e?[_({class:"sibu-err-cause-label",nodes:"Caused by"}),_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:`[${e.code}] ${e.message}`}),H({nodes:""})]}),e.frames.length>0?Br(e.frames):_({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Fr(e.cause)]:[]}function Oc(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 un(e){Rc();let t=e.severity??"error",n=Pr(e.error),r=e.alwaysShowDetails??re(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=Ge({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let f=Mc(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(f).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=_({class:"sibu-err-header",nodes:[Zt({class:"sibu-err-icon",nodes:n.code}),Yt({class:"sibu-err-title",nodes:o}),c,H({class:"sibu-err-timestamp",nodes:i})]}),u=[Jt({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:"Stack Trace"})]}),Br(n.frames)]})),r&&u.push(...Fr(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[H({nodes:"Metadata"})]}),Oc(e.metadata)]}));let m=[];e.onRetry&&m.push(Ge({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(Ge({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&u.push(_({class:"sibu-err-actions",nodes:m}));let g=_({class:"sibu-err-body",nodes:u});return _({class:"sibu-error-display","data-severity":t,nodes:[l,g]})}var Dc=`
192
+ `)}function qr(e){let t=e.map((n,r)=>A({class:"sibu-err-frame",nodes:[H({class:"sibu-err-line",nodes:String(r+1)}),H({class:"sibu-err-fn",nodes:n.fn}),H({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Qt({class:"sibu-err-stack",nodes:t})}function Ur(e){return e?[A({class:"sibu-err-cause-label",nodes:"Caused by"}),A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[H({nodes:`[${e.code}] ${e.message}`}),H({nodes:""})]}),e.frames.length>0?qr(e.frames):A({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Ur(e.cause)]:[]}function zc(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 fn(e){$c();let t=e.severity??"error",n=jr(e.error),r=e.alwaysShowDetails??ne(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=Ye({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=Fc(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=A({class:"sibu-err-header",nodes:[en({class:"sibu-err-icon",nodes:n.code}),Zt({class:"sibu-err-title",nodes:o}),c,H({class:"sibu-err-timestamp",nodes:i})]}),l=[Xt({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&l.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[H({nodes:"Stack Trace"})]}),qr(n.frames)]})),r&&l.push(...Ur(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&l.push(A({class:"sibu-err-section",nodes:[A({class:"sibu-err-section-head",nodes:[H({nodes:"Metadata"})]}),zc(e.metadata)]}));let p=[];e.onRetry&&p.push(Ye({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&p.push(Ye({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),p.length>0&&l.push(A({class:"sibu-err-actions",nodes:p}));let g=A({class:"sibu-err-body",nodes:l});return A({class:"sibu-error-display","data-severity":t,nodes:[u,g]})}var Vc=`
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
- `,Hc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),zr=!1;function Ic(){if(!zr&&typeof document<"u"){let e=_e({nodes:Dc});document.head.appendChild(e),zr=!0}}function $c(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Ic();let[a,c]=C(null),l=()=>{m(),c(null)},u=null,m=()=>{if(!u)return;let S=u;u=null,S()},g=S=>{let E=new Array(S.length);for(let T=0;T<S.length;T++)try{E[T]=S[T]()}catch(O){w(O,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[T]=Hc}return E},f=()=>{let S=s;if(!S||S.length===0)return;m();let E=null;u=Y(()=>{let T=g(S);if(E===null){E=T;return}let O=T.length!==E.length;if(!O){for(let $=0;$<T.length;$++)if(!Object.is(T[$],E[$])){O=!0;break}}E=T,O&&l()})},p=S=>{let E=At(S);if(c(E),f(),i)try{i(E)}catch(T){w(T,{phase:"render",name:"ErrorBoundary onError callback"})}return E},b=(S,E)=>un({error:S,severity:"error",onRetry:E}),h=S=>{let E=o||b;try{return E(S,l)}catch(T){return queueMicrotask(()=>{w(T,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=_({class:"sibu-error-boundary",nodes:()=>{let S=a();if(S)return h(S);try{let E=n();if(E&&typeof E.then=="function"){let T=_({class:"sibu-error-async"});T.appendChild(H({class:"sibu-lazy-loading",nodes:"Loading..."}));let O=!1;return x(T,()=>{O=!0}),E.then($=>{if(O){M($);return}z(T,$)}).catch(B($=>{if(O)return;let Oe=p($);z(T,h(Oe))})),T}return E}catch(E){let T=p(E);return h(T)}}}),k=S=>{if(a())return;let T=S.detail?.error;T&&(S.preventDefault(),S.stopPropagation(),p(T))};return y.addEventListener("sibu:error-propagate",k),bt(()=>{let S=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),E=[],T=S.currentNode;for(;T;){let O=pt(T);O&&E.push(O),T=S.nextNode()}if(E.length===1)p(E[0]);else if(E.length>1){let O=globalThis.AggregateError;p(O?new O(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map($=>$.message).join("; ")))}},y),x(y,()=>{m(),y.removeEventListener("sibu:error-propagate",k)}),y}var Pc=`
346
+ `,Wc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Kr=!1;function jc(){if(!Kr&&typeof document<"u"){let e=Ae({nodes:Vc});document.head.appendChild(e),Kr=!0}}function qc(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;jc();let[a,c]=C(null),u=()=>{p(),c(null)},l=null,p=()=>{if(!l)return;let y=l;l=null,y()},g=y=>{let E=new Array(y.length);for(let w=0;w<y.length;w++)try{E[w]=y[w]()}catch(D){k(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),E[w]=Wc}return E},m=()=>{let y=s;if(!y||y.length===0)return;p();let E=null;l=Y(()=>{let w=g(y);if(E===null){E=w;return}let D=w.length!==E.length;if(!D){for(let P=0;P<w.length;P++)if(!Object.is(w[P],E[P])){D=!0;break}}E=w,D&&u()})},f=y=>{let E=Ct(y);if(c(E),m(),i)try{i(E)}catch(w){k(w,{phase:"render",name:"ErrorBoundary onError callback"})}return E},b=(y,E)=>fn({error:y,severity:"error",onRetry:E}),h=y=>{let E=o||b;try{return E(y,u)}catch(w){return queueMicrotask(()=>{k(w,{phase:"render",name:"ErrorBoundary fallback",node:S.parentNode?S:void 0})}),document.createComment("error-boundary-failed")}},S=A({class:"sibu-error-boundary",nodes:()=>{let y=a();if(y)return h(y);try{let E=n();if(E&&typeof E.then=="function"){let w=A({class:"sibu-error-async"});w.appendChild(H({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return x(w,()=>{D=!0}),E.then(P=>{if(D){M(P);return}V(w,P)}).catch(F(P=>{if(D)return;let Oe=f(P);V(w,h(Oe))})),w}return E}catch(E){let w=f(E);return h(w)}}}),T=y=>{if(a())return;let w=y.detail?.error;w&&(y.preventDefault(),y.stopPropagation(),f(w))};return S.addEventListener("sibu:error-propagate",T),yt(()=>{let y=document.createTreeWalker(S,NodeFilter.SHOW_ELEMENT),E=[],w=y.currentNode;for(;w;){let D=gt(w);D&&E.push(D),w=y.nextNode()}if(E.length===1)f(E[0]);else if(E.length>1){let D=globalThis.AggregateError;f(D?new D(E,`${E.length} pre-mount errors caught by ErrorBoundary`):new Error(E.map(P=>P.message).join("; ")))}},S),x(S,()=>{p(),S.removeEventListener("sibu:error-propagate",T)}),S}var Uc=`
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
- `,Vr=!1;function Bc(){!Vr&&typeof document<"u"&&(document.head.appendChild(_e({nodes:Pc})),Vr=!0)}function Fc(e={}){Bc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-dots"},[H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"})]),t?H({class:"sibu-loading-text"},t):null]):_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[_({class:"sibu-loading-spinner"}),t?H({class:"sibu-loading-text"},t):null])}var dn=Symbol.for("sibujs.actions.v1"),qr=globalThis[dn]??(globalThis[dn]=new Map);function ze(e,t){qr.set(e,t)}function Wr(e){return qr.get(e)}function zc(e,t,n){let r=typeof t=="string"?Wr(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"&&x(e,o)}var Ur=(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)},jr=["pointerup","pointerleave","pointercancel"],Kr=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=c=>{let l=c.pointerId;r!==null&&l!==o||(i(),o=l,r=setTimeout(()=>{r=null,t.callback()},n))},a=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let c of jr)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of jr)e.removeEventListener(c,a)}},Gr=(e,t)=>{let n=o=>w(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)},Jr=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)},Yr=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)};ze("clickOutside",Ur);ze("longPress",Kr);ze("copyOnClick",Gr);ze("autoResize",Jr);ze("trapFocus",Yr);function yt(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 Me=null;function Vc(e,t){try{let n=e(),r=yt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Me?Me(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Me?Me(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function jc(e,t){try{return await e()}catch(n){return t?t(n,"async"):Me?Me(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function qc(e){Me=e}function Wc(e){let[t,n]=C(e),r=i=>{!!1||!te()||(`${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 c=s();return!1,c}finally{n(a)}}}}var fn=Symbol.for("sibujs.createId.v1"),pn=globalThis[fn]??(globalThis[fn]={n:0});function Xr(e="sibu"){let t=Ar();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(pn.n++,`${e}-${pn.n}`)}function Zr(){pn.n=0}function Uc(e,t){let n=typeof t=="function"?t():t;return x(n,I(()=>{n.style.display=e()?"":"none"},n)),n}function Qr(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,c=r.has(s),l=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,t.nextSibling),{node:s,owned:l}}function St(e,t){t&&M(e),e.parentNode?.removeChild(e)}function Kc(e,t,n){V();let r=document.createComment("when"),o=null,i,s=!1,a=!1,c=new WeakSet,l=!1,u=()=>{if(a)return;let g=e(),f=r.parentNode;if(!f||s&&Object.is(g,i))return;i=g;let p=o?Ke([o]):null;o?.parentNode&&(St(o,l),o=null);let b=g?t:n!==void 0?n:null,h=ee(()=>Qr(f,r,b,c,"when"));o=h.node,l=h.owned,Pe(p,o?[o]:[],"when"),s=!0},m=I(u,r);return x(r,()=>{a=!0,m(),o&&St(o,l),o=null}),s||queueMicrotask(B(()=>{!a&&!s&&r.parentNode&&u()})),r}function Gc(e,t,n){V();let r=document.createComment("match"),o=null,i,s=!1,a=!1,c=new WeakSet,l=!1,u=()=>{if(a)return;let g=String(e()),f=r.parentNode;if(!f||s&&g===i)return;i=g;let p=o?Ke([o]):null;o?.parentNode&&(St(o,l),o=null);let b=Object.hasOwn(t,g)?t[g]:n,h=ee(()=>Qr(f,r,b??null,c,"match"));o=h.node,l=h.owned,Pe(p,o?[o]:[],"match"),s=!0},m=I(u,r);return x(r,()=>{a=!0,m(),o&&St(o,l),o=null}),s||queueMicrotask(B(()=>{!a&&!s&&r.parentNode&&u()})),r}function Ye(e,t){let n=globalThis;return n[e]??(n[e]=t())}var vt=Ye(Symbol.for("sibujs.components.registry.v1"),()=>new Map),eo=Ye(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function to(){let[e,t]=eo;t(ee(e)+1)}function Jc(e,t){vt.set(e,t),to()}function Yc(e){vt.delete(e)&&to()}function Xc(e){let t=vt.get(e);return t?t():_(`[Component "${e}" not found]`)}function Zc(e){let t=_({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(eo[0](),a=vt.get(s));let c=a??`missing:${s}`;if(c===r)return;let l=ee(()=>a?a():_(`[Component "${s}" not found]`));r=c,z(t,l)}let i=G(o);return x(t,i),t}function no(e){return typeof e=="function"?no(e()):e instanceof Node?e:document.createTextNode(String(e))}function Qc(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],l=0,u=n.length;for(;l<u;){let m=l+u>>1;e[n[m]]<c?l=m+1:u=m}n[l]=a,r[a]=l>0?n[l-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 el(e,t,n){n&&n.key,V();let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,u=new Map,m=[],g=[],f=[],p=0,b=[],h=[],y=new Uint8Array(0),k=new Map,S=[],E=[],T=new Map,O=!1,$=!1,Oe=!1,vo=n.key,Sn=()=>{if(Oe)return;let ne=e(),N=ne.length,Se=r.parentNode;if(!Se)return;$||(Se.insertBefore(o,r.nextSibling),$=!0),h.length<N&&(h=new Array(N));for(let v=0;v<N;v++)h[v]=vo(ne[v]);let fe=h;b.length<N&&(b=new Array(N)),u.clear(),T.clear();for(let v=0;v<N;v++)!1,T.set(fe[v],v);p=0;for(let v=0;v<N;v++){let P=fe[v],xn=l.get(P),je;if(xn!==void 0)je=xn,m[p]=je,g[p]=ne[v],f[p]=v,p++;else{let[En,wo]=C(ne[v]),[Tn,ko]=C(v),Tt;try{Te();try{Tt=no(t(En,Tn))}finally{we()}}catch(Ao){let _o=fe[v];Tt=document.createComment(`each:error:${v}`),queueMicrotask(()=>{w(Ao,{phase:"render",name:`each row (key="${String(_o)}")`,node:r.parentNode?r:void 0})})}je={node:Tt,item:En,setItem:wo,index:Tn,setIndex:ko}}u.set(P,je),b[v]=je.node}for(let[v,P]of l)u.has(v)||(M(P.node),P.node.parentNode&&Se.removeChild(P.node));if(N===0){c=0;let v=l;l=u,u=v,O=!0,p=0;return}k.clear();for(let v=0;v<c;v++)k.set(a[v],v);S.length<N&&(S=new Array(N),E=new Array(N));let Ze=0;for(let v=0;v<N;v++){let P=k.get(fe[v]);P!==void 0&&(S[Ze]=v,E[Ze]=P,Ze++)}let vn=Qc(E,Ze);y.length<N?y=new Uint8Array(N):y.fill(0,0,N);for(let v=0;v<vn.length;v++)y[S[vn[v]]]=1;let Qe=o;for(let v=N-1;v>=0;v--){let P=b[v];y[v]||P.nextSibling!==Qe&&Se.insertBefore(P,Qe),Qe=P}let et=a===i?s:i;et.length<N&&(et.length=N);for(let v=0;v<N;v++)et[v]=fe[v];a=et,c=N;let To=l;l=u,u=To,O=!0,xo()};function xo(){if(p===0)return;let ne=p;p=0,j(()=>{for(let N=0;N<ne;N++){let Se=m[N];Se.setItem(g[N]),Se.setIndex(f[N]),m[N]=void 0,g[N]=void 0}})}let Eo=G(Sn);return x(r,()=>{if(!Oe){Oe=!0,Eo();for(let ne of l.values())M(ne.node),ne.node.parentNode?.removeChild(ne.node);o.parentNode&&o.parentNode.removeChild(o),$=!1,l.clear(),u.clear(),T.clear(),k.clear(),c=0,m.length=0,g.length=0,f.length=0,p=0}}),O||queueMicrotask(B(()=>{!O&&!Oe&&r.parentNode&&Sn()})),r}function tl(e){V();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"||ro(t,r);else ro(t,n);return t}function ro(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(n,le(n,t));return}e.appendChild(document.createTextNode(String(t)))}var nl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),oo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),io=new WeakMap;function rl(e){let t=e.length-1,n=e[0];for(let f=0;f<t;f++)n+=`\0${f}\0${e[f+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 f=r;r++;let p=0;for(;r<o&&n.charCodeAt(r)!==0;)p=p*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,p<0||p>=t?(r=f,-1):p}function a(){let f=r;for(;r<o;){let p=n.charCodeAt(r);if(p>=97&&p<=122||p>=65&&p<=90||p>=48&&p<=57||p===45)r++;else break}return n.slice(f,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let f=s();if(f>=0)return{kind:"expr",idx:f};let p=n[r];if(p==='"'||p==="'"){r++;let b=[],h=[],y="";for(;r<o&&n[r]!==p;){let k=s();k>=0?(b.push(y),y="",h.push(k)):y+=n[r++]}return r<o&&r++,b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],y="";for(;r<o;){let k=n.charCodeAt(r);if(k===32||k===9||k===10||k===13||k===62)break;let S=s();S>=0?(b.push(y),y="",h.push(S)):y+=n[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let f=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let p=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 b=n.slice(p,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&f.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?f.push({t:4,name:b}):h.kind==="static"?f.push({t:0,name:b,value:h.value}):h.kind==="expr"?f.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&f.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return f}function u(f){return f.replace(/\s+/g," ")}function m(f){let p="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let y=u(p);y&&f.push({t:1,value:y}),p="",f.push({t:2,idx:h})}else p+=n[r++]}let b=u(p);b&&f.push({t:1,value:b})}function g(){let f=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let p=n[r+1];if(p==="!"){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(p==="?"){let S=n.indexOf(">",r);r=S===-1?o:S+1;continue}if(!(p>="a"&&p<="z")&&!(p>="A"&&p<="Z")){f.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=l();i();let y=nl.has(b),k=n[r]==="/";if(k&&r++,r<o&&r++,y||k)f.push({t:0,el:{tag:b,svg:oo.has(b),attrs:h,children:[]}});else{let S=g();if(Vn(b)){for(let E=0;E<S.length;E++)if(S[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (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++),f.push({t:0,el:{tag:b,svg:oo.has(b),attrs:h,children:S}})}}else m(f);return f}return g()}function mn(e,t){let n=e.svg?document.createElementNS(R,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:It(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?x(n,Ue(n,i,s)):X(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]}X(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:It(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(mn(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),x(n,le(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 so(e,...t){let n=io.get(e);return n||(n=rl(e),io.set(e,n)),co(n,t)}function ao(e,t){return co(e,t)}function co(e,t){if(V(),e.length===1&&e[0].t===0)return mn(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(mn(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),x(n,le(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 ol(e,t,n){V();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&re()&&void 0;let a,c=null,l=!1,u=!1,m=()=>{if(u)return;let f=e(),p=r.parentNode;if(!p||l&&f===a)return;c?.parentNode&&p.removeChild(c),a=f;let b=o.get(f);if(b){let h=i.indexOf(f);h!==-1&&(i.splice(h,1),i.push(f))}else{let h=t[f];if(!h){c=null,l=!0;return}if(b=h(),b.nodeType===11){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(f,b),i.push(f),s>0&&i.length>s){let y=i.shift(),k=o.get(y);k&&(M(k),k.parentNode&&k.parentNode.removeChild(k),o.delete(y))}}p.insertBefore(b,r.nextSibling),c=b,l=!0},g=G(m);return l||queueMicrotask(B(()=>{!l&&r.parentNode&&m()})),x(r,()=>{u=!0,g();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function il(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=u=>{if(u instanceof DocumentFragment){let m=document.createComment(""),g=document.createComment("");u.insertBefore(m,u.firstChild),u.appendChild(g),o={start:m,end:g}}t.appendChild(u)},s;typeof e=="function"?s=Rn(()=>{let u=e();return i(u),u}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&J(c,"app:init",{rootElement:s,container:t,duration:a});let l=o;return{node:s,unmount(){if(c&&J(c,"app:unmount",{rootElement:s}),l){sl(l.start,l.end);return}M(s),s.parentNode?.removeChild(s)}}}function sl(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){pe("mount",se,1);return}M(a),a.parentNode===n&&n.removeChild(a)}s||w(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function al(e,t){V();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=B(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{w(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),x(n,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),n}function cl(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function lo(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function ll(e=[]){let[t,n]=C([...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 c=[...a];return s=lo(c,o,i),s.length===0&&i.length<=1?a:c}),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,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===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 ul(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Le(r)||Ie(r)}function i(){if(ke(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,...c){let l=lo(t,a,c);return(l.length>0||c.length>1)&&o(),l},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let l=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let m=c(t[u]);Object.is(t[u],m)||(t[u]=m,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let l=0;l<t.length;l++){let u=a(t[l],l);Object.is(t[l],u)||(t[l]=u,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function dl(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),u=0,m=!1,g=null,f=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},p=Y(()=>{if(c(),m)return;f();let b=++u,h=typeof AbortController<"u"?new AbortController:null;g=h,j(()=>{i(!0),a(null)});let y=()=>m||b!==u,k;try{k=e({signal:h?h.signal:void 0})}catch(S){if(y())return;j(()=>{a(S),i(!1)});return}k.then(S=>{y()||(g=null,j(()=>{r(S),i(!1)}))},S=>{y()||(g=null,j(()=>{a(S),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{m||l(b=>b+1)},dispose:()=>{m||(m=!0,p(),f())}}}function Ve(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[c,l]of e)if(!a.has(c)||!Ve(l,a.get(c),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(t);if(a.length!==c.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==c[l])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,c=t;if(a.length!==c.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==c[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,c)=>Ve(a,t[c],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&&Ve(e.cause,a.cause,n)&&uo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:uo(r,o,n)}function uo(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)&&Ve(e[i],t[i],n))}function fl(e){return C(e,{equals:(t,n)=>Ve(t,n)})}function gn(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,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let l=()=>{let p=e();o._v=r&&o._init&&r(o._v,p)?o._v:p,o._d=!1,o._init=!0};try{G(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(p){throw s=!0,Ae(c),p}let u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let p=o._v;i=!0;try{he(l,c),Object.is(p,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ae(c)}u&&!s&&!Object.is(p,o._v)&&J(u,"computed:update",{signal:o,oldValue:p,newValue:o._v})};o._validate=m;let g=()=>{let{error:p}=a;throw a=void 0,s&&(o._d=!1),p};function f(){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 ur()||s?(o._d&&(m(),a!==void 0&&g()),o._v):(o._d&&(m(),a!==void 0&&(ke(o),g())),ke(o),o._v)}return n&&(f.__name=n,o.__name=n),f.__signal=o,f.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ae(c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(p)try{p.emit("computed:destroy",{signal:o,getter:f})}catch{}},u&&J(u,"computed:create",{signal:o,name:n,getter:f}),f}function pl(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function fo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ml(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(c=>{let[l,u]=C(e[c]);fo(t,c,[l,u])});let n=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(t,l)){let u=t[l][0];return u()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(l=>{fo(c,l,t[l][0]())}),c};return[n,{setState:c=>{let l=r(),u=typeof c=="function"?c(l):c;j(()=>{Object.entries(u).forEach(([m,g])=>{Object.hasOwn(t,m)&&t[m][1](g)})})},reset:()=>{j(()=>{Object.keys(e).forEach(c=>{let l=t[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return Y(()=>{let u=r();if(l){l=!1;return}Te();try{c(u)}finally{we()}})},subscribeKey:(c,l)=>{let u,m=!0;return Y(()=>{let g=t[c][0]();if(m){u=g,m=!1;return}if(!Object.is(g,u)){let f=u;u=g,Te();try{l(g,f)}finally{we()}}})},getSnapshot:r}]}function gl(e,t){if(te())return()=>{};let n,r=!0;return G(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Te();try{t(s,a)}finally{we()}}})}function bl(e,t,n){return[gn(e,n),i=>{j(()=>t(i))}]}function hl(e){let t=e();return re()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function yl(e){if(!re())return Y(e);let t=Y(e),n=null;return queueMicrotask(()=>{try{n=Y(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function po(e,t){return te()?()=>{}:I(e,t)}var bn="data-sibu-enhanced",hn=new WeakMap;function mo(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,pe(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var go=["text","attr","class","show","on","cleanup"];function bo(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 Xe(e,t){return po(t,e)}function Sl(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 vl(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 xl(e,t,n,r){let o=`ctx.each[${r}]`;if(re())for(let i of Object.keys(n))go.includes(i),`${o}${i}${go.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 xt(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(bn)==="true")return re()&&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,c=(g,f,p)=>{if(a(g))return;let b=bo(n,f);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(f)} not found under`,n);return}p(b)},l={root:n,ref:g=>bo(n,g),refs:g=>{let f=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(f))}catch{return[]}},on:(g,f,p,b)=>{c("on",g,h=>{let y=k=>p(k,h);h.addEventListener(f,y,b),r.push(()=>h.removeEventListener(f,y,b))})},text:(g,f)=>{c("text",g,p=>{r.push(Xe(p,()=>{let b=f(),h=b==null?"":String(b);p.textContent!==h&&(p.textContent=h)}))})},attr:(g,f,p)=>{c("attr",g,b=>{r.push(Xe(b,()=>{let h=p(),y=h==null?null:String(h);X(b,f,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,f,p)=>{c("classed",g,b=>{r.push(Xe(b,()=>{b.classList.toggle(f,!!p())}))})},show:(g,f)=>{c("show",g,p=>{let b=p.hidden;r.push(Xe(p,()=>{p.hidden=!f()})),r.push(()=>{p.hidden=b})})},model:(g,f,p)=>{c("model",g,b=>{let h=b,[y,k]=f,S=p?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Xe(b,()=>{vl(h,y())}));let E=()=>k(Sl(h));h.addEventListener(S,E),r.push(()=>h.removeEventListener(S,E))})},each:(g,f)=>{if(a("each"))return;let p=typeof g=="string"?l.refs(g):Array.from(g);for(let b=0;b<p.length;b++){let h=p[b],y=f(h,b);y!=null&&xl(l,h,y,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},u;try{u=t(l);let g=u;if(g&&typeof g.then=="function")throw g.then(void 0,f=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw mo(r,"enhance"),s=!0,g}typeof u=="function"&&r.push(u);let m=()=>{i||(i=!0,hn.get(n)===o&&(hn.delete(n),n.removeAttribute(bn)),qe(n,m),mo(r,"enhance"),s=!0)};return x(n,m),hn.set(n,o),n.setAttribute(bn,"true"),m}function El(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(xt(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 Tl=/^[A-Za-z0-9_-]+$/,ho=Symbol.for("sibujs.islands.lazy"),Et=Ye(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function wl(e){return e[ho]=!0,e}function kl(e,t){if(!Tl.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Et.set(e,t)}function Al(e){Et.delete(e)}async function _l(e){if(typeof e=="function"&&e[ho]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Cl(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(!Et.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let u=Et.get(s);u&&_l(u).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=xt(i,m);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(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,m)})},l=i.getAttribute("data-sibu-load")||"load";n.push(Nl(l,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Nl(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),()=>{}}}function yo(e){return e}var ip=1024*1024;function Rl(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=G(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,c())},l}var So=16;function Ll(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:So*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,So)}function Ml(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=c=>{s(),w(c,{phase:"async",name:"transition"})};Ll(()=>{try{let c=yt(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function Ol(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...yn});})();
399
+ `,Gr=!1;function Kc(){!Gr&&typeof document<"u"&&(document.head.appendChild(Ae({nodes:Uc})),Gr=!0)}function Gc(e={}){Kc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-dots"},[H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"}),H({class:"sibu-loading-dot"})]),t?H({class:"sibu-loading-text"},t):null]):A({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[A({class:"sibu-loading-spinner"}),t?H({class:"sibu-loading-text"},t):null])}var pn=Symbol.for("sibujs.actions.v1"),Yr=globalThis[pn]??(globalThis[pn]=new Map);function We(e,t){Yr.set(e,t)}function Xr(e){return Yr.get(e)}function Jc(e,t,n){let r=typeof t=="string"?Xr(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"&&x(e,o)}var Zr=(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)},Jr=["pointerup","pointerleave","pointercancel"],Qr=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=c=>{let u=c.pointerId;r!==null&&u!==o||(i(),o=u,r=setTimeout(()=>{r=null,t.callback()},n))},a=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let c of Jr)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of Jr)e.removeEventListener(c,a)}},eo=(e,t)=>{let n=o=>k(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)},to=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)},no=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)};We("clickOutside",Zr);We("longPress",Qr);We("copyOnClick",eo);We("autoResize",to);We("trapFocus",no);function vt(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 Me=null;function Yc(e,t){try{let n=e(),r=vt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):Me?Me(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):Me?Me(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Xc(e,t){try{return await e()}catch(n){return t?t(n,"async"):Me?Me(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Zc(e){Me=e}function Qc(e){let[t,n]=C(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 c=s();return!1,c}finally{n(a)}}}}var mn=Symbol.for("sibujs.createId.v1"),gn=globalThis[mn]??(globalThis[mn]={n:0});function ro(e="sibu"){let t=Mr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(gn.n++,`${e}-${gn.n}`)}function oo(){gn.n=0}function eu(e,t){let n=typeof t=="function"?t():t;return x(n,I(()=>{n.style.display=e()?"":"none"},n)),n}function io(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function so(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,c=r.has(s),u=!a&&!c;return r.add(s),c&&void 0,e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function xt(e,t){t&&M(e),e.parentNode?.removeChild(e)}function tu(e,t,n,r){W(),io(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=null,c,u=!1,l=!1,p=new WeakSet,g=!1,m=()=>{if(l)return;let b=e(),h=s.parentNode;if(!h||u&&Object.is(b,c))return;c=b;let S=a?Je([a]):null;a?.parentNode&&(xt(a,g),a=null);let T=b?t:o!==void 0?o:null,y=Q(()=>so(h,s,T,p,"when"));a=y.node,g=y.owned,Fe(S,a?[a]:[],"when",i),u=!0},f=_e(m,s);return x(s,()=>{l=!0,f.stop(),a&&xt(a,g),a=null}),u||queueMicrotask(F(()=>{!l&&!u&&s.parentNode&&f.run(m)})),s}function nu(e,t,n,r){W(),io(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=null,c,u=!1,l=!1,p=new WeakSet,g=!1,m=()=>{if(l)return;let b=String(e()),h=s.parentNode;if(!h||u&&b===c)return;c=b;let S=a?Je([a]):null;a?.parentNode&&(xt(a,g),a=null);let T=Object.hasOwn(t,b)?t[b]:o,y=Q(()=>so(h,s,T??null,p,"match"));a=y.node,g=y.owned,Fe(S,a?[a]:[],"match",i),u=!0},f=_e(m,s);return x(s,()=>{l=!0,f.stop(),a&&xt(a,g),a=null}),u||queueMicrotask(F(()=>{!l&&!u&&s.parentNode&&f.run(m)})),s}function Ze(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Et=Ze(Symbol.for("sibujs.components.registry.v1"),()=>new Map),ao=Ze(Symbol.for("sibujs.components.registryVersion.v1"),()=>C(0));function co(){let[e,t]=ao;t(Q(e)+1)}function ru(e,t){Et.set(e,t),co()}function ou(e){Et.delete(e)&&co()}function iu(e){let t=Et.get(e);return t?t():A(`[Component "${e}" not found]`)}function su(e){let t=A({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(ao[0](),a=Et.get(s));let c=a??`missing:${s}`;if(c===r)return;let u=Q(()=>a?a():A(`[Component "${s}" not found]`));r=c,V(t,u)}let i=I(o,t,!0);return x(t,i),t}function uo(e){return typeof e=="function"?uo(e()):e instanceof Node?e:document.createTextNode(String(e))}function au(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],u=0,l=n.length;for(;u<l;){let p=u+l>>1;e[n[p]]<c?u=p+1:l=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 cu(e,t,n){n&&n.key,W();let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,u=new Map,l=new Map,p=[],g=[],m=[],f=0,b=[],h=[],S=new Uint8Array(0),T=new Map,y=[],E=[],w=new Map,D=!1,P=!1,Oe=!1,Ao=n.key,xn=()=>{if(Oe)return;let te=e(),N=te.length,ye=r.parentNode;if(!ye)return;P||(ye.insertBefore(o,r.nextSibling),P=!0),h.length<N&&(h=new Array(N));for(let v=0;v<N;v++)h[v]=Ao(te[v]);let de=h;b.length<N&&(b=new Array(N)),l.clear(),w.clear();for(let v=0;v<N;v++)!1,w.set(de[v],v);f=0;for(let v=0;v<N;v++){let B=de[v],wn=u.get(B),qe;if(wn!==void 0)qe=wn,p[f]=qe,g[f]=te[v],m[f]=v,f++;else{let[kn,Lo]=C(te[v]),[_n,Mo]=C(v),kt;try{Ee();try{kt=uo(t(kn,_n))}finally{Te()}}catch(Oo){let Do=de[v];kt=document.createComment(`each:error:${v}`),queueMicrotask(()=>{k(Oo,{phase:"render",name:`each row (key="${String(Do)}")`,node:r.parentNode?r:void 0})})}qe={node:kt,item:kn,setItem:Lo,index:_n,setIndex:Mo}}l.set(B,qe),b[v]=qe.node}for(let[v,B]of u)l.has(v)||(M(B.node),B.node.parentNode&&ye.removeChild(B.node));if(N===0){c=0;let v=u;u=l,l=v,D=!0,f=0;return}T.clear();for(let v=0;v<c;v++)T.set(a[v],v);y.length<N&&(y=new Array(N),E=new Array(N));let et=0;for(let v=0;v<N;v++){let B=T.get(de[v]);B!==void 0&&(y[et]=v,E[et]=B,et++)}let Tn=au(E,et);S.length<N?S=new Uint8Array(N):S.fill(0,0,N);for(let v=0;v<Tn.length;v++)S[y[Tn[v]]]=1;let tt=o;for(let v=N-1;v>=0;v--){let B=b[v];S[v]||B.nextSibling!==tt&&ye.insertBefore(B,tt),tt=B}let nt=a===i?s:i;nt.length<N&&(nt.length=N);for(let v=0;v<N;v++)nt[v]=de[v];a=nt,c=N;let Ro=u;u=l,l=Ro,D=!0,Co()};function Co(){if(f===0)return;let te=f;f=0,j(()=>{for(let N=0;N<te;N++){let ye=p[N];ye.setItem(g[N]),ye.setIndex(m[N]),p[N]=void 0,g[N]=void 0}})}let En=_e(xn),No=En.stop;return x(r,()=>{if(!Oe){Oe=!0,No();for(let te of u.values())M(te.node),te.node.parentNode?.removeChild(te.node);o.parentNode&&o.parentNode.removeChild(o),P=!1,u.clear(),l.clear(),w.clear(),T.clear(),c=0,p.length=0,g.length=0,m.length=0,f=0}}),D||queueMicrotask(F(()=>{!D&&!Oe&&r.parentNode&&En.run(xn)})),r}function uu(e){W();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"||lo(t,r);else lo(t,n);return t}function lo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),x(n,ce(n,t));return}e.appendChild(document.createTextNode(String(t)))}var lu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),fo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),po=new WeakMap;function du(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 f=0;for(;r<o&&n.charCodeAt(r)!==0;)f=f*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,f<0||f>=t?(r=m,-1):f}function a(){let m=r;for(;r<o;){let f=n.charCodeAt(r);if(f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||f===45)r++;else break}return n.slice(m,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let f=n[r];if(f==='"'||f==="'"){r++;let b=[],h=[],S="";for(;r<o&&n[r]!==f;){let T=s();T>=0?(b.push(S),S="",h.push(T)):S+=n[r++]}return r<o&&r++,b.push(S),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}{let b=[],h=[],S="";for(;r<o;){let T=n.charCodeAt(r);if(T===32||T===9||T===10||T===13||T===62)break;let y=s();y>=0?(b.push(S),S="",h.push(y)):S+=n[r++]}return b.push(S),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let f=r;for(;r<o;){let S=n.charCodeAt(r);if(S>=97&&S<=122||S>=65&&S<=90||S>=48&&S<=57||S===45||S===58||S===95||S===46)r++;else break}let b=n.slice(f,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&m.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?m.push({t:4,name:b}):h.kind==="static"?m.push({t:0,name:b,value:h.value}):h.kind==="expr"?m.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&m.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return m}function l(m){return m.replace(/\s+/g," ")}function p(m){let f="";for(;r<o&&n[r]!=="<";){let h=s();if(h>=0){let S=l(f);S&&m.push({t:1,value:S}),f="",m.push({t:2,idx:h})}else f+=n[r++]}let b=l(f);b&&m.push({t:1,value:b})}function g(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let f=n[r+1];if(f==="!"){if(n.startsWith("<!--",r)){let y=n.indexOf("-->",r+4);r=y===-1?o:y+3}else if(n.startsWith("<![CDATA[",r)){let y=n.indexOf("]]>",r+9);r=y===-1?o:y+3}else{let y=n.indexOf(">",r);r=y===-1?o:y+1}continue}if(f==="?"){let y=n.indexOf(">",r);r=y===-1?o:y+1;continue}if(!(f>="a"&&f<="z")&&!(f>="A"&&f<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=u();i();let S=lu.has(b),T=n[r]==="/";if(T&&r++,r<o&&r++,S||T)m.push({t:0,el:{tag:b,svg:fo.has(b),attrs:h,children:[]}});else{let y=g();if(qn(b)){for(let E=0;E<y.length;E++)if(y[E].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${b}> (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:b,svg:fo.has(b),attrs:h,children:y}})}}else p(m);return m}return g()}function bn(e,t){let n=e.svg?document.createElementNS(R,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:$t(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?x(n,Ge(n,i,s)):X(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]}X(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:$t(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(bn(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),x(n,ce(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 mo(e,...t){let n=po.get(e);return n||(n=du(e),po.set(e,n)),bo(n,t)}function go(e,t){return bo(e,t)}function bo(e,t){if(W(),e.length===1&&e[0].t===0)return bn(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(bn(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),x(n,ce(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 fu(e,t,n){W();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&ne()&&void 0;let a,c=null,u=!1,l=!1,p=()=>{if(l)return;let f=e(),b=r.parentNode;if(!b||u&&f===a)return;c?.parentNode&&b.removeChild(c),a=f;let h=o.get(f);if(h){let S=i.indexOf(f);S!==-1&&(i.splice(S,1),i.push(f))}else{let S=t[f];if(!S){c=null,u=!0;return}if(h=S(),h.nodeType===11){let T=document.createElement("div");T.style.display="contents",T.appendChild(h),h=T}if(o.set(f,h),i.push(f),s>0&&i.length>s){let T=i.shift(),y=o.get(T);y&&(M(y),y.parentNode&&y.parentNode.removeChild(y),o.delete(T))}}b.insertBefore(h,r.nextSibling),c=h,u=!0},g=_e(p),m=g.stop;return u||queueMicrotask(F(()=>{!u&&r.parentNode&&g.run(p)})),x(r,()=>{l=!0,m();for(let f of o.values())M(f),f.parentNode&&f.parentNode.removeChild(f);o.clear(),i.length=0,c=null}),r}function pu(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=l=>{if(l instanceof DocumentFragment){let p=document.createComment(""),g=document.createComment("");l.insertBefore(p,l.firstChild),l.appendChild(g),o={start:p,end:g}}t.appendChild(l)},s;typeof e=="function"?s=On(()=>{let l=e();return i(l),l}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&J(c,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(c&&J(c,"app:unmount",{rootElement:s}),u){mu(u.start,u.end);return}M(s),s.parentNode?.removeChild(s)}}}function mu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ie;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){fe("mount",ie,1);return}M(a),a.parentNode===n&&n.removeChild(a)}s||k(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function gu(e,t){W();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=F(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{k(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),x(n,()=>{i=!0,o&&(M(o),o.remove(),o=null)}),n}function bu(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function ho(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function hu(e=[]){let[t,n]=C([...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 c=[...a];return s=ho(c,o,i),s.length===0&&i.length<=1?a:c}),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,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===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 yu(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Le(r)||$e(r)}function i(){if(we(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,...c){let u=ho(t,a,c);return(u.length>0||c.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let u=!1;for(let l=0;l<t.length;l++)if(a(t[l])){let p=c(t[l]);Object.is(t[l],p)||(t[l]=p,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let u=0;u<t.length;u++){let l=a(t[u],u);Object.is(t[u],l)||(t[u]=l,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Su(e,t){let[n,r]=C(t),[o,i]=C(!1),[s,a]=C(null),[c,u]=C(0),l=0,p=!1,g=null,m=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},f=Y(()=>{if(c(),p)return;m();let b=++l,h=typeof AbortController<"u"?new AbortController:null;g=h,j(()=>{i(!0),a(null)});let S=()=>p||b!==l,T;try{T=e({signal:h?h.signal:void 0})}catch(y){if(S())return;j(()=>{a(y),i(!1)});return}T.then(y=>{S()||(g=null,j(()=>{r(y),i(!1)}))},y=>{S()||(g=null,j(()=>{a(y),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{p||u(b=>b+1)},dispose:()=>{p||(p=!0,f(),m())}}}function je(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[c,u]of e)if(!a.has(c)||!je(u,a.get(c),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(t);if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[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,c=t;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,c)=>je(a,t[c],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&&je(e.cause,a.cause,n)&&yo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:yo(r,o,n)}function yo(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)&&je(e[i],t[i],n))}function vu(e){return C(e,{equals:(t,n)=>je(t,n)})}function hn(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,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};try{Pe(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(f){throw s=!0,ke(c),f}let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,p=()=>{if(!o._d||s||a!==void 0)return;let f=o._v;i=!0;try{be(u,c),Object.is(f,o._v)||o.__v++}catch(b){a={error:b},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&ke(c)}l&&!s&&!Object.is(f,o._v)&&J(l,"computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=p;let g=()=>{let{error:f}=a;throw a=void 0,s&&(o._d=!1),f};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 br()||s?(o._d&&(p(),a!==void 0&&g()),o._v):(o._d&&(p(),a!==void 0&&(we(o),g())),we(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,ke(c);let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(f)try{f.emit("computed:destroy",{signal:o,getter:m})}catch{}},l&&J(l,"computed:create",{signal:o,name:n,getter:m}),m}function xu(e){let[t,n]=C(e);return{get current(){return t()},set current(r){n(r)}}}function So(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Eu(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(c=>{let[u,l]=C(e[c]);So(t,c,[u,l])});let n=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let l=t[u][0];return l()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(u=>{So(c,u,t[u][0]())}),c};return[n,{setState:c=>{let u=r(),l=typeof c=="function"?c(u):c;j(()=>{Object.entries(l).forEach(([p,g])=>{Object.hasOwn(t,p)&&t[p][1](g)})})},reset:()=>{j(()=>{Object.keys(e).forEach(c=>{let u=t[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return Y(()=>{let l=r();if(u){u=!1;return}Ee();try{c(l)}finally{Te()}})},subscribeKey:(c,u)=>{let l,p=!0;return Y(()=>{let g=t[c][0]();if(p){l=g,p=!1;return}if(!Object.is(g,l)){let m=l;l=g,Ee();try{u(g,m)}finally{Te()}}})},getSnapshot:r}]}function Tu(e,t){if(ee())return()=>{};let n,r=!0;return Pe(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ee();try{t(s,a)}finally{Te()}}})}function wu(e,t,n){return[hn(e,n),i=>{j(()=>t(i))}]}function ku(e){let t=e();return ne()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function _u(e){if(!ne())return Y(e);let t=Y(e),n=null;return queueMicrotask(()=>{try{n=Y(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function vo(e,t){return ee()?()=>{}:I(e,t)}var yn="data-sibu-enhanced",Sn=new WeakMap;function xo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ie){let i=r.length-o+e.length;e.length=0,fe(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Eo=["text","attr","class","show","on","cleanup"];function To(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 Qe(e,t){return vo(t,e)}function Au(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 Cu(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 Nu(e,t,n,r){let o=`ctx.each[${r}]`;if(ne())for(let i of Object.keys(n))Eo.includes(i),`${o}${i}${Eo.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 Tt(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(yn)==="true")return ne()&&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,c=(g,m,f)=>{if(a(g))return;let b=To(n,m);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}f(b)},u={root:n,ref:g=>To(n,g),refs:g=>{let m=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(g,m,f,b)=>{c("on",g,h=>{let S=T=>f(T,h);h.addEventListener(m,S,b),r.push(()=>h.removeEventListener(m,S,b))})},text:(g,m)=>{c("text",g,f=>{r.push(Qe(f,()=>{let b=m(),h=b==null?"":String(b);f.textContent!==h&&(f.textContent=h)}))})},attr:(g,m,f)=>{c("attr",g,b=>{r.push(Qe(b,()=>{let h=f(),S=h==null?null:String(h);X(b,m,S,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(g,m,f)=>{c("classed",g,b=>{r.push(Qe(b,()=>{b.classList.toggle(m,!!f())}))})},show:(g,m)=>{c("show",g,f=>{let b=f.hidden;r.push(Qe(f,()=>{f.hidden=!m()})),r.push(()=>{f.hidden=b})})},model:(g,m,f)=>{c("model",g,b=>{let h=b,[S,T]=m,y=f?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Qe(b,()=>{Cu(h,S())}));let E=()=>T(Au(h));h.addEventListener(y,E),r.push(()=>h.removeEventListener(y,E))})},each:(g,m)=>{if(a("each"))return;let f=typeof g=="string"?u.refs(g):Array.from(g);for(let b=0;b<f.length;b++){let h=f[b],S=m(h,b);S!=null&&Nu(u,h,S,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},l;try{l=t(u);let g=l;if(g&&typeof g.then=="function")throw g.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(g){throw xo(r,"enhance"),s=!0,g}typeof l=="function"&&r.push(l);let p=()=>{i||(i=!0,Sn.get(n)===o&&(Sn.delete(n),n.removeAttribute(yn)),Ue(n,p),xo(r,"enhance"),s=!0)};return x(n,p),Sn.set(n,o),n.setAttribute(yn,"true"),p}function Ru(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Tt(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 Lu=/^[A-Za-z0-9_-]+$/,wo=Symbol.for("sibujs.islands.lazy"),wt=Ze(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Mu(e){return e[wo]=!0,e}function Ou(e,t){if(!Lu.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);wt.set(e,t)}function Du(e){wt.delete(e)}async function Hu(e){if(typeof e=="function"&&e[wo]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Iu(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(!wt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let l=wt.get(s);l&&Hu(l).then(p=>{if(!o){if(!p){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Tt(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(Pu(u,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Pu(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),()=>{}}}function ko(e){return e}var pp=1024*1024;function $u(e){let[t,n]=C(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=Pe(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,c())},u}var _o=16;function Bu(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:_o*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,_o)}function Fu(){let[e,t]=C(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=c=>{s(),k(c,{phase:"async",name:"transition"})};Bu(()=>{try{let c=vt(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function zu(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...vn});})();
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-7XHATCIH.js";
5
5
  import {
6
6
  reactiveBinding
7
- } from "./chunk-B2Y5BJSP.js";
7
+ } from "./chunk-4UTGDVSA.js";
8
8
 
9
9
  // src/core/rendering/createId.ts
10
10
  var COUNTER_KEY = /* @__PURE__ */ Symbol.for("sibujs.createId.v1");
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-5HZXGZ6T.js";
4
4
  import {
5
5
  signal
6
- } from "./chunk-IHA62NGJ.js";
6
+ } from "./chunk-QKFVMIAV.js";
7
7
  import {
8
8
  registerDisposer,
9
9
  reportError
@@ -6,7 +6,7 @@ import {
6
6
  import {
7
7
  div,
8
8
  span
9
- } from "./chunk-T5O2CUHV.js";
9
+ } from "./chunk-5XUGJM3J.js";
10
10
  import {
11
11
  STATIC_VALUE_RESOLVER,
12
12
  planHeadElementEntry,
@@ -17,17 +17,17 @@ import {
17
17
  } from "./chunk-7ZHH77QA.js";
18
18
  import {
19
19
  effect
20
- } from "./chunk-EMB5PG7V.js";
20
+ } from "./chunk-QC3NP47A.js";
21
21
  import {
22
22
  sanitizeUrl
23
23
  } from "./chunk-EXXSN3BW.js";
24
24
  import {
25
25
  batch,
26
26
  signal
27
- } from "./chunk-IHA62NGJ.js";
27
+ } from "./chunk-QKFVMIAV.js";
28
28
  import {
29
29
  bindOwnerScope
30
- } from "./chunk-B2Y5BJSP.js";
30
+ } from "./chunk-4UTGDVSA.js";
31
31
  import {
32
32
  registerDisposer,
33
33
  replaceChildrenSafely,