sibujs 4.5.0 → 4.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +309 -129
- package/dist/browser.d.cts +46 -14
- package/dist/browser.d.ts +46 -14
- package/dist/browser.js +8 -6
- package/dist/build.cjs +184 -72
- package/dist/build.js +15 -16
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +11 -11
- package/dist/cdn.full.global.js +10 -10
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-IXKSNWV5.js → chunk-2INLLLMZ.js} +1 -1
- package/dist/chunk-3ISI6ACU.js +44 -0
- package/dist/{chunk-ONOHFDLG.js → chunk-47M47FOM.js} +3 -3
- package/dist/chunk-5HZXGZ6T.js +24 -0
- package/dist/{chunk-KKLW7YWL.js → chunk-5MT6SJ3P.js} +275 -144
- package/dist/{chunk-UGRX3S57.js → chunk-5Q4R7HCL.js} +12 -3
- package/dist/{chunk-S373NSMK.js → chunk-7GQCWFOE.js} +150 -59
- package/dist/{chunk-FTIR4QW2.js → chunk-7NCARGJW.js} +6 -8
- package/dist/{chunk-5DXA2J44.js → chunk-7XHATCIH.js} +5 -2
- package/dist/{chunk-VZKNK2V7.js → chunk-AIF3Z2T7.js} +296 -38
- package/dist/{chunk-4PMLNECI.js → chunk-BAAG6ZTI.js} +98 -29
- package/dist/{chunk-XZZOBQAY.js → chunk-D33YTSX5.js} +2 -2
- package/dist/{chunk-TBYTO6BS.js → chunk-DKGBBKOF.js} +136 -80
- package/dist/{chunk-NIOYEGBQ.js → chunk-HURREPU2.js} +27 -13
- package/dist/{chunk-GW3SCCZG.js → chunk-HYXDKS4N.js} +153 -110
- package/dist/chunk-J6FW5TV6.js +233 -0
- package/dist/{chunk-PCT43HW3.js → chunk-JSXPZCET.js} +1 -1
- package/dist/chunk-NYNYSPK7.js +318 -0
- package/dist/{chunk-RJE2BNI4.js → chunk-ORMZXBKQ.js} +108 -45
- package/dist/{chunk-OMJJM3KM.js → chunk-OXUY2A6L.js} +287 -130
- package/dist/{chunk-3JZ4L5TJ.js → chunk-PK6FK2G2.js} +181 -66
- package/dist/{chunk-RBTPLM32.js → chunk-QE4TTDU3.js} +2 -2
- package/dist/{chunk-2DCGACUU.js → chunk-SXXVZMKZ.js} +251 -66
- package/dist/{chunk-R25EFXXC.js → chunk-TUCPL2HB.js} +3 -3
- package/dist/{chunk-7LN645I6.js → chunk-UZQ6ALFS.js} +3 -3
- package/dist/{chunk-KEISJXBU.js → chunk-VVWPJ543.js} +6 -8
- package/dist/{chunk-RIXRAYIU.js → chunk-XC4MEKGA.js} +3 -3
- package/dist/{chunk-B3WHI2QA.js → chunk-XRRZKZYX.js} +55 -31
- package/dist/{contracts-DBdg9J_a.d.cts → contracts-DRIuclVT.d.cts} +10 -2
- package/dist/{contracts-DBdg9J_a.d.ts → contracts-DRIuclVT.d.ts} +10 -2
- package/dist/{customElement-OB9CIsc5.d.cts → customElement-MmInOW1U.d.cts} +21 -0
- package/dist/{customElement-OB9CIsc5.d.ts → customElement-MmInOW1U.d.ts} +21 -0
- package/dist/data.cjs +213 -117
- package/dist/data.d.cts +47 -9
- package/dist/data.d.ts +47 -9
- package/dist/data.js +12 -9
- package/dist/devtools.cjs +81 -57
- package/dist/devtools.js +7 -8
- package/dist/dispose-GEIG2KOF.js +28 -0
- package/dist/ecosystem.cjs +309 -104
- package/dist/ecosystem.d.cts +19 -3
- package/dist/ecosystem.d.ts +19 -3
- package/dist/ecosystem.js +12 -12
- package/dist/extras.cjs +2133 -863
- package/dist/extras.d.cts +10 -9
- package/dist/extras.d.ts +10 -9
- package/dist/extras.js +39 -28
- package/dist/index.cjs +184 -72
- package/dist/index.d.cts +22 -5
- package/dist/index.d.ts +22 -5
- package/dist/index.js +24 -27
- package/dist/motion.cjs +107 -41
- package/dist/motion.js +5 -5
- package/dist/patterns.cjs +317 -39
- package/dist/patterns.d.cts +27 -9
- package/dist/patterns.d.ts +27 -9
- package/dist/patterns.js +8 -8
- package/dist/performance.cjs +308 -216
- package/dist/performance.d.cts +2 -2
- package/dist/performance.d.ts +2 -2
- package/dist/performance.js +8 -9
- package/dist/plugin-DVgSnTfK.d.cts +112 -0
- package/dist/plugin-DVgSnTfK.d.ts +112 -0
- package/dist/plugins.cjs +549 -202
- package/dist/plugins.d.cts +3 -3
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +35 -23
- package/dist/signal-EotCj4hS.d.cts +110 -0
- package/dist/signal-EotCj4hS.d.ts +110 -0
- package/dist/{ssr-BiPRdZ6n.d.cts → ssr-Bli9XRW5.d.cts} +5 -0
- package/dist/{ssr-BiPRdZ6n.d.ts → ssr-Bli9XRW5.d.ts} +5 -0
- package/dist/{ssr-Y7XOEPEN.js → ssr-XOTUASDO.js} +4 -5
- package/dist/ssr.cjs +176 -72
- package/dist/ssr.d.cts +9 -3
- package/dist/ssr.d.ts +9 -3
- package/dist/ssr.js +11 -12
- package/dist/{startup-BMpaiMhP.d.ts → startup-BLfSeL15.d.cts} +73 -22
- package/dist/{startup-BMpaiMhP.d.cts → startup-BLfSeL15.d.ts} +73 -22
- package/dist/{tagFactory-DVoDpHye.d.ts → tagFactory-DFstCLQV.d.cts} +2 -100
- package/dist/{tagFactory-DVoDpHye.d.cts → tagFactory-DkaNVUNV.d.ts} +2 -100
- package/dist/testing.cjs +2484 -2185
- package/dist/testing.d.cts +56 -5
- package/dist/testing.d.ts +56 -5
- package/dist/testing.js +580 -307
- package/dist/ui.cjs +707 -317
- package/dist/ui.d.cts +40 -7
- package/dist/ui.d.ts +40 -7
- package/dist/ui.js +151 -56
- package/dist/widgets.cjs +246 -278
- package/dist/widgets.js +9 -10
- package/package.json +1 -1
- package/dist/chunk-2WLZ6757.js +0 -149
- package/dist/chunk-CCSJMTRN.js +0 -15
- package/dist/chunk-QKRPLZ2V.js +0 -108
- package/dist/chunk-VUF4ALSW.js +0 -60
- package/dist/chunk-WWV3SJ3L.js +0 -131
- package/dist/dispose-46BOMMQJ.js +0 -19
- package/dist/plugin-D30wlGW5.d.cts +0 -71
- package/dist/plugin-D30wlGW5.d.ts +0 -71
package/dist/cdn.dev.global.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var Fr=Object.defineProperty;var ot=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var zr=(e,n)=>{for(var t in n)Fr(e,t,{get:n[t],enumerable:!0})};var qt={};zr(qt,{DynamicComponent:()=>Ja,ErrorBoundary:()=>Ha,ErrorDisplay:()=>Ht,Fragment:()=>Za,KeepAlive:()=>tc,Loading:()=>Ia,MAX_DRAIN_TEARDOWNS:()=>De,Portal:()=>rc,SVG_NS:()=>L,Suspense:()=>Fn,__resetIdCounter:()=>pr,a:()=>pi,abbr:()=>mi,action:()=>Pa,address:()=>Zo,area:()=>Bi,array:()=>ic,article:()=>Wo,aside:()=>Yo,asyncDerived:()=>ac,audio:()=>Fi,autoResize:()=>lr,b:()=>gi,base:()=>Hs,batch:()=>V,bdi:()=>bi,bdo:()=>hi,bindDynamic:()=>Dn,blockquote:()=>ri,body:()=>Vo,br:()=>yi,button:()=>Pe,canvas:()=>es,caption:()=>is,catchError:()=>Ba,catchErrorAsync:()=>Fa,center:()=>ra,checkLeaks:()=>tn,circle:()=>Is,cite:()=>vi,clickOutside:()=>ar,clipPath:()=>Js,code:()=>Tt,col:()=>ss,colgroup:()=>as,context:()=>Va,copyOnClick:()=>ur,createId:()=>fr,customElement:()=>sa,data:()=>xi,datalist:()=>gs,dd:()=>oi,deepEqual:()=>Re,deepSignal:()=>cc,defer:()=>_c,defs:()=>Ks,del:()=>rs,derived:()=>Ft,details:()=>Cs,dfn:()=>Si,dialog:()=>Ns,disableSSR:()=>Un,dispose:()=>D,div:()=>_,dl:()=>ii,dt:()=>si,each:()=>Ya,effect:()=>j,ellipse:()=>Ps,em:()=>Ti,embed:()=>Wi,enableSSR:()=>Wn,enhance:()=>tt,enhanceAll:()=>yc,enqueueBatchedSignal:()=>Se,external:()=>ka,fieldset:()=>bs,figcaption:()=>ai,figure:()=>ci,font:()=>oa,footer:()=>Ko,form:()=>hs,g:()=>Bs,getAction:()=>sr,getRequestScopedCache:()=>jn,getRuntimeErrorHandler:()=>Zt,getSSRStore:()=>xe,getSlot:()=>oc,h1:()=>Xo,h2:()=>Qo,h3:()=>xt,h4:()=>ei,h5:()=>ti,h6:()=>ni,head:()=>zo,header:()=>Uo,hr:()=>ui,html:()=>xr,i:()=>Ei,iframe:()=>Ui,img:()=>zi,input:()=>ys,ins:()=>os,isBatching:()=>wa,isSSR:()=>G,kbd:()=>wi,label:()=>vs,lazy:()=>Bn,lazyIsland:()=>xc,legend:()=>xs,li:()=>li,line:()=>Fs,linearGradient:()=>Zs,link:()=>Os,longPress:()=>cr,main:()=>Go,map:()=>Vi,mark:()=>ki,marker:()=>na,marquee:()=>ia,mask:()=>Gs,match:()=>Wa,math:()=>Qi,menu:()=>Ls,meta:()=>$s,meter:()=>Ss,mount:()=>nc,mountIslands:()=>wc,nav:()=>Jo,nextTick:()=>Nc,noscript:()=>ts,object:()=>Ki,ol:()=>di,on:()=>ha,onCleanup:()=>ma,onMount:()=>Qe,onUnmount:()=>pa,optgroup:()=>Ts,option:()=>Es,output:()=>ws,p:()=>vt,param:()=>Ji,path:()=>zs,pattern:()=>Ys,picture:()=>Gi,polygon:()=>Vs,polyline:()=>qs,portal:()=>Yi,pre:()=>St,progress:()=>ks,q:()=>_i,radialGradient:()=>Xs,reactiveArray:()=>sc,rect:()=>js,ref:()=>uc,registerAction:()=>Le,registerComponent:()=>Ua,registerDisposer:()=>T,registerIsland:()=>Sc,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>He,reportError:()=>w,resolveComponent:()=>gr,retrack:()=>ae,rp:()=>Ai,rt:()=>Ci,ruby:()=>Ni,runInSSRContext:()=>Kn,s:()=>Li,samp:()=>Ri,script:()=>ns,section:()=>jo,select:()=>_s,setGlobalErrorHandler:()=>za,setMaxDrainIterations:()=>Ln,setRuntimeErrorHandler:()=>Yt,show:()=>qa,signal:()=>C,slot:()=>Ms,small:()=>Mi,source:()=>Zi,span:()=>O,stop:()=>Qs,store:()=>lc,strict:()=>pc,strictEffect:()=>mc,strong:()=>Di,style:()=>he,sub:()=>Hi,summary:()=>Rs,sup:()=>Oi,svg:()=>Xi,symbol:()=>ta,table:()=>cs,tagFactory:()=>u,takePendingError:()=>Ze,tbody:()=>us,td:()=>ls,template:()=>Ds,text:()=>Ws,textarea:()=>As,tfoot:()=>ds,th:()=>fs,thead:()=>ps,time:()=>$i,title:()=>qo,tr:()=>ms,track:()=>qi,transition:()=>Cc,trapFocus:()=>dr,trustHTML:()=>Nr,tspan:()=>Us,u:()=>Ii,ul:()=>fi,unregisterComponent:()=>Ka,unregisterDisposer:()=>je,unregisterIsland:()=>Tc,untracked:()=>Oe,use:()=>ea,var_:()=>Pi,video:()=>ji,watch:()=>dc,when:()=>ja,withSSR:()=>Jn,writable:()=>fc});var Gt=Symbol.for("sibujs.runtime-errors.v1");function it(){let e=globalThis,n=e[Gt];if(n)return n;let t={handler:null,handlerDepth:0};return e[Gt]=t,t}function Yt(e){let n=it(),t=n.handler;return n.handler=e,t}function Zt(){return it().handler}function st(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${Vr(e)}`;return new Error(n,{cause:e})}function Vr(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 qr(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var jr=Symbol.for("sibujs.reactive.v1");function Wr(e){let n=globalThis[jr];return n?.untracked?n.untracked(e):e()}var Ur="sibu:error-propagate";function Kr(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=Jr(t);if(!r)return!1;try{let o=new CustomEvent(Ur,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function Jr(e){let t=e;for(;t;){if(t.nodeType===1&&typeof t.dispatchEvent=="function")return t;t=t.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function Gr(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${qr(n)}: ${e.message}`,e)}function w(e,n){let t=st(e);Wr(()=>{if(Kr(t,n))return;let r=it(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:t,n);return}catch(i){if(typeof console<"u"){let a=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${a}`,i)}}finally{r.handlerDepth--}}Gr(t,n)})}function Z(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function R(e,n){if(!e)throw new Error(`[SibuJS] ${n}`)}function W(e){{let n=e();n&&console.warn(`[SibuJS] ${n}`)}}function M(e){console.warn(`[SibuJS] ${e}`)}var Q=new WeakMap,De=1e4;function He(e,n,t){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${n} teardowns with ${t} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:n,remaining:t})}var le=0;function at(e){let n=e;for(;n?.closed;)n=n.forwardTo;return n??null}var de=[];function Xt(){return at(de[de.length-1])}function Qt(e){return e===null&&de.length===0?!1:(de.push(at(e)),!0)}function en(){de.pop()}function T(e,n){let t=Q.get(e);t||(t=[],Q.set(e,t)),t.push(n),le++;let r=at(de[de.length-1]);r&&r.entries.push([e,n])}function je(e,n){let t=Q.get(e);if(!t)return!1;let r=t.indexOf(n);return r===-1?!1:(t.splice(r,1),le--,t.length===0&&Q.delete(e),!0)}function D(e){let n=[e],t=[];for(;n.length>0;){let r=n.pop();t.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)n.push(o[i])}for(let r=t.length-1;r>=0;r--)Yr(t[r])}function Yr(e){if(!Q.has(e))return;let n=0,t=!1;for(;!t;){let r=Q.get(e);if(!r||r.length===0)break;let o=r.slice();Q.delete(e),le-=o.length;for(let i=0;i<o.length;i++){if(n>=De){let a=o.slice(i),s=Q.get(e);Q.set(e,s?a.concat(s):a),le+=a.length,He("dispose",n,a.length+(s?.length??0)),t=!0;break}n++;try{o[i]()}catch(a){w(a,{phase:"cleanup",name:"disposer"})}}}}function z(e,...n){for(let r=0;r<n.length;r++){let o=n[r];o.parentNode?.removeChild(o)}let t=Array.from(e.childNodes);for(let r=0;r<t.length;r++)D(t[r]);e.replaceChildren(...n)}function tn(e=0){return e>0&&le>e&&M(`checkLeaks: ${le} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),le}function Zr(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function we(e){if(e.length<3)return!1;let n=e.toLowerCase();return n[0]==="o"&&n[1]==="n"&&n.charCodeAt(2)>=97&&n.charCodeAt(2)<=122}var Xr=["http:","https:","mailto:","tel:","ftp:"],Qr=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function an(e){let n=Zr(e).trim();if(!n)return"";let t=e.replace(Qr,""),r=n.toLowerCase(),o=-1;for(let a=0;a<r.length;a++){let s=r.charCodeAt(a);if(s===58){o=a;break}if(s===47||s===63||s===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&Xr.indexOf(i)===-1?"":t}var eo=/^\s+\d+(\.\d+)?[wx]$/;function to(e){let n=e.split(","),t=[];for(let r=0;r<n.length;r++){let o=n[r].trim();if(!o)continue;let i=o.match(/^(\S+)(\s+.+)?$/);if(!i||i[2]!==void 0&&!eo.test(i[2]))continue;let a=an(i[1]);a&&t.push(i[2]?`${a}${i[2]}`:a)}return t.join(", ")}var no=/[(:@\\]/;function ro(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function nn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function oo(e){let n="";for(let t=0;t<e.length;t++){let r=e[t];if(r!=="\\"){n+=r;continue}if(t+1>=e.length)break;let o=e[t+1];if(o===`
|
|
3
3
|
`||o==="\f"){t+=1;continue}if(o==="\r"){t+=e[t+2]===`
|
|
4
|
-
`?2:1;continue}if(
|
|
5
|
-
`?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var Yt=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function jr(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var it=new Set,Zt=100,Xt=!1;function en(e,n,t){W(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters"],o=t?.property?`${t.property}: ${e}`:e,i=jr(t?.element),s=`${i}|${o}`;return it.has(s)?"":it.size>=Zt?Xt?"":(Xt=!0,`${Zt} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(it.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[n]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function st(e){if(!Vr.test(e))return-1;let t=(e.includes("\\")?Wr(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<Yt.length;r++)if(t.includes(Yt[r]))return r;return-1}function qe(e,n){let t=st(e);return t===-1?e:(en(e,t,n),"")}function We(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return qe(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=st(a);if(c===-1&&(c=st(`${s}:${a}`)),c!==-1){en(a,c,{property:s,element:n?.element});continue}let l=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${l?` !${l}`:""}`)}return o.join("; ")}var Kr=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Ur=new Set(["srcdoc"]);function tn(e){return Ur.has(e.toLowerCase())}function nn(e,n,t){let r=e.toLowerCase();return r==="srcset"?zr(n):Kr.has(r)?Qt(n):r==="style"?We(n,t):n}var Jr="http://www.w3.org/1999/xhtml",Gr="http://www.w3.org/2000/svg",Yr="http://www.w3.org/1999/xlink",Zr="http://www.w3.org/XML/1998/namespace",Xr=new Set(["checked","disabled","selected"]);function Qr(e){return e.namespaceURI===null||e.namespaceURI===Jr}function rn(e,n,t){e[n]=t}function eo(e,n){if(e.namespaceURI!==Gr)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?Yr:t.startsWith("xml:")?Zr:null}function j(e,n,t,r={}){let o=eo(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(Te(n))return M(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${n}". Its value would be evaluated as JavaScript. Use on:{ ${n.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(tn(n))return M(`${r.label??"setSafeAttribute"}: refusing to set "${n}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=Qr(e),a=s?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let m=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==m&&(o?e.setAttributeNS(o,n,m):e.setAttribute(n,m)),!0}return s&&Xr.has(a)&&a in e?rn(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return rn(e,a,a==="checked"?!!t:c),!0;let l=nn(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===l||(o?e.setAttributeNS(o,n,l):e.setAttribute(n,l)),!0}var to=4096,at=[];function no(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function ro(e,n,t){let r=at.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=no();return o.sig=e,o.sub=n,o.epoch=t,o}function on(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,at.length<to&&at.push(e)}function oo(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function sn(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function io(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function so(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var U=null,ee=null,ie=0,se=[],K=new Set,ao=[];function co(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function uo(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var Z=0,te=!1;function ut(){Z===0&&(ee=U,U=null,te=!0),Z++}function lt(){Z--,Z===0&&(U=ee,ee=null,te=!1)}function an(){return te}function cn(e){ut();try{return e()}finally{lt()}}var lo=0;function dt(e,n){let t=U,r=0,o=null;te&&(r=Z,o=ee,Z=0,ee=null,te=!1),U=n;let i=n,s=++lo;i._epoch=s,i._structDirty=!1;for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;a.prevActive=c.__activeNode??null,c.__activeNode=a}try{e()}finally{U=t,r!==0&&(Z=r,ee=o,te=!0);let a=i.depsHead??null;for(;a!==null;){let c=a.subNext,l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null,a.epoch!==s&&(so(a),sn(a),on(a)),a=c}}}function un(e,n){if(!n)return ft(e);Ee(n);let t=U,r=0,o=null;te&&(r=Z,o=ee,Z=0,ee=null,te=!1),U=n;try{e()}finally{U=t,r!==0&&(Z=r,ee=o,te=!0);let s=n;for(let a=s.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>Ee(n))}function ft(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{dt(e,r)}finally{o._reentrant=!1}}},r=t;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=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Ee(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Ee(r)})}function ln(e){if(!U)return;let n=U,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=ro(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,io(n,i),oo(t,i),n._structDirty=!0}function Ee(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;sn(t),on(t),t=r}}var je=1e3,Ke=1e6,Ue=0,le=new Set;function dn(e){let n=je;return Number.isFinite(e)&&e>0&&(je=Math.floor(e)),n}function fn(e){let n=Ke;return Number.isFinite(e)&&e>0&&(Ke=Math.floor(e)),n}function fo(e){let n=e;return n._runEpoch!==Ue?(n._runEpoch=Ue,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>je)}function po(e){let n=e.__name??"<unnamed>";_(new Error(`subscriber "${n}" fired more than ${je} 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:n})}function mo(){_(new Error(`Notification drain exceeded ${Ke} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function pn(){let e=0;for(;e<se.length;){if(e>=Ke){mo();break}let n=se[e++];if(K.delete(n),!(le.size>0&&le.has(n))&&!(n._hasComputedDep===!0&&!uo(n))){if(fo(n)){po(n),le.add(n);continue}co(n)}}}function mn(){if(!(ie>0)){ie++,Ue++;try{pn()}finally{ie--,ie===0&&(se.length=0,K.clear(),le.size>0&&le.clear())}}}function ct(e){e();let n=e._sig;if(!n)return;let t=ao,r=t.length;for(t.push(n);t.length>r;){let i=t.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,t.push(a)):s()}else K.has(s)||(K.add(s),se.push(s));i=i.sigNext}}}function gn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?ct(r):K.has(r)||(K.add(r),se.push(r))),t=t.sigNext}}function bn(e){let t=e.subsHead;if(t){if(ie>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?ct(o):K.has(o)||(K.add(o),se.push(o))),r=r.sigNext}return}ie++,Ue++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?ct(o):K.has(o)||(K.add(o),se.push(o))),r=r.sigNext}pn()}finally{ie--,ie===0&&(se.length=0,K.clear(),le.size>0&&le.clear())}}}function hn(e){return e.__sc??0}function yn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function vn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var xn="4.5.0",Sn=Symbol.for("sibujs.reactive.v1");function bo(){let e=globalThis,n=e[Sn];if(n)return!n.__dupWarned&&(n.__dupWarned=!0,M(`Multiple instances of the reactive runtime detected on this page (active: ${n.version}, duplicate: ${xn}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),n;let t={suspendTracking:ut,resumeTracking:lt,isTrackingSuspended:an,untracked:cn,retrack:dt,track:un,reactiveBinding:ft,recordDependency:ln,cleanup:Ee,setMaxSubscriberRepeats:dn,setMaxDrainIterations:fn,drainNotificationQueue:mn,queueSignalNotification:gn,notifySubscribers:bn,getSubscriberCount:hn,getSubscriberDeps:yn,forEachSubscriber:vn,version:xn};return e[Sn]=t,t}var I=bo(),de=I.suspendTracking,fe=I.resumeTracking,Tn=I.isTrackingSuspended,Le=I.untracked,ae=I.retrack,V=I.track,O=I.reactiveBinding,pe=I.recordDependency,Re=I.cleanup,Mc=I.setMaxSubscriberRepeats,En=I.setMaxDrainIterations,wn=I.drainNotificationQueue,kn=I.queueSignalNotification,we=I.notifySubscribers,Hc=I.getSubscriberCount,Dc=I.getSubscriberDeps,$c=I.forEachSubscriber;function Je(e,n,t){if(Te(n))return j(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){_(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}j(e,n,o,{label:`bindAttribute("${n}")`})}return O(r,e)}function _n(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){_(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){_(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),j(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=O(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var pt=["data-focus-key","id","name"],ho=new Set(["text","search","url","tel","password",""]);function yo(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&ho.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 Me(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<pt.length;i++){let s=n.getAttribute(pt[i]);if(s){r=pt[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...yo(n)}}function vo(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function xo(e,n){let t=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(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function An(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function ke(e,n,t){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){An(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=xo(n,`[${e.attr}=${vo(e.value)}]`);if(i&&i.tagName===e.tag){An(i,e);return}o=s>1}W(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",s=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${t}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${s}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function me(e,n){let t=[];function r(){let o;try{o=n()}catch(d){_(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=Me(t);if(o==null||typeof o=="boolean"){for(let d=0;d<t.length;d++){let m=t[d];H(m),m.parentNode&&m.parentNode.removeChild(m)}t.length=0,ke(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let d=new Set;for(let m=0;m<o.length;m++){let g=o[m];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(d.has(p)){M("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}d.add(p),a.push(p)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let d=new Set(t);c=new Set;for(let m=0;m<a.length;m++)d.has(a[m])&&c.add(a[m])}for(let d=0;d<t.length;d++){let m=t[d];c?.has(m)||(H(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let d=0;d<a.length;d++){let m=a[d];l.nextSibling!==m&&s.insertBefore(m,l.nextSibling),l=m}t=a,ke(i,a,"bindChildNode")}return O(r,e)}var L="http://www.w3.org/2000/svg",So=new Set(["script","iframe","object","embed","frame","frameset"]);function To(e){return So.has(e.toLowerCase())}var Eo=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var mt=new Set,Cn=100,Nn=!1,Ln=new Map;function wo(e){let n=Ln.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ln.set(e,n)),n}function ko(e,n){if(typeof n=="function"){let r=O(()=>{e.setAttribute("style",We(String(n()),{element:e}))},e);T(e,r);return}if(typeof n=="string"){e.setAttribute("style",We(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=wo(r);if(typeof o=="function"){let s=o,a=O(()=>{t.style.setProperty(i,qe(String(s()),{property:i,element:e}))},e);T(e,a)}else t.style.setProperty(i,qe(String(o),{property:i,element:e}))}}function _o(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=O(()=>{e.setAttribute("class",n())},e);T(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=O(()=>{let a="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);T(e,s)}else e.setAttribute("class",o)}function gt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),T(e,me(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),T(e,me(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),T(e,me(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)))}}}var u=(e,n)=>{let t=To(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,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):(W(()=>{let p=r.trim().split(/\s+/);if(p.length<2)return"";let f=0;for(let h=0;h<p.length;h++){let y=p[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&f++}if(f<2)return"";let b=`${e}|${r}`;return mt.has(b)?"":mt.size>=Cn?Nn?"":(Nn=!0,`tagFactory: ${Cn} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(mt.add(b),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),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&&_o(i,a);let c=s.id;c!=null&&(typeof c=="string"&&Eo.has(c.toLowerCase())&&M(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let l=o!==void 0?o:s.nodes;l!=null&>(i,l);let d=s.on;if(d)for(let p in d){let f=d[p];typeof f=="function"?i.addEventListener(p,f):M(`tagFactory: on.${p} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let m=s.style;m!=null&&ko(i,m);let g=s.ref;g&&(g.current=i);for(let p in s)switch(p){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=s[p];if(f==null||Te(p))continue;typeof f=="function"?T(i,Je(i,p,f)):j(i,p,f,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var iu=u("html"),Ao=u("head"),Co=u("body"),No=u("title"),k=u("div"),$=u("span"),Lo=u("section"),Ro=u("article"),Mo=u("header"),Ho=u("footer"),Do=u("nav"),$o=u("main"),Io=u("aside"),Oo=u("address"),bt=u("p"),Po=u("h1"),Bo=u("h2"),ht=u("h3"),Fo=u("h4"),zo=u("h5"),Vo=u("h6"),qo=u("blockquote"),Wo=u("dd"),jo=u("dl"),Ko=u("dt"),Uo=u("figcaption"),Jo=u("figure"),Go=u("hr"),Yo=u("li"),Zo=u("ol"),Xo=u("ul"),yt=u("pre"),Qo=u("a"),ei=u("abbr"),ti=u("b"),ni=u("bdi"),ri=u("bdo"),oi=u("br"),ii=u("cite"),vt=u("code"),si=u("data"),ai=u("dfn"),ci=u("em"),ui=u("i"),li=u("kbd"),di=u("mark"),fi=u("q"),pi=u("rp"),mi=u("rt"),gi=u("ruby"),bi=u("s"),hi=u("samp"),yi=u("small"),vi=u("strong"),xi=u("sub"),Si=u("sup"),Ti=u("time"),Ei=u("u"),wi=u("var"),ki=u("area"),_i=u("audio"),Ai=u("img"),Ci=u("map"),Ni=u("track"),Li=u("video"),Ri=u("embed"),Mi=u("iframe"),Hi=u("object"),Di=u("param"),$i=u("picture"),Ii=u("portal"),Oi=u("source"),Pi=u("svg",L),Bi=u("math"),Fi=u("canvas"),zi=u("noscript"),Vi=u("script"),qi=u("del"),Wi=u("ins"),ji=u("caption"),Ki=u("col"),Ui=u("colgroup"),Ji=u("table"),Gi=u("tbody"),Yi=u("td"),Zi=u("tfoot"),Xi=u("th"),Qi=u("thead"),es=u("tr"),He=u("button"),ts=u("datalist"),ns=u("fieldset"),rs=u("form"),os=u("input"),is=u("label"),ss=u("legend"),as=u("meter"),cs=u("optgroup"),us=u("option"),ls=u("output"),ds=u("progress"),fs=u("select"),ps=u("textarea"),ms=u("details"),gs=u("dialog"),bs=u("menu"),hs=u("summary"),ys=u("slot"),vs=u("template"),xs=u("base"),Ss=u("link"),Ts=u("meta"),ge=u("style"),Es=u("circle",L),ws=u("ellipse",L),ks=u("g",L),_s=u("line",L),As=u("path",L),Cs=u("polygon",L),Ns=u("polyline",L),Ls=u("rect",L),Rs=u("text",L),Ms=u("tspan",L),Hs=u("defs",L),Ds=u("clipPath",L),$s=u("mask",L),Is=u("pattern",L),Os=u("linearGradient",L),Ps=u("radialGradient",L),Bs=u("stop",L),Fs=u("use",L),zs=u("symbol",L),Vs=u("marker",L),qs=u("center"),Ws=u("font"),js=u("marquee"),Ks=e=>u(e);var xt="__sibuPendingError";function Rn(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[xt]=n)})}function Ge(e){let n=e,t=n[xt];if(t instanceof Error)return delete n[xt],t}function Mn(e){let n=null;return function(){if(n)return n();let r=k({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();z(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));z(r,k({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Rn(r,s)}),r.appendChild($("sibu-lazy-loading","Loading...")),T(r,()=>{o=!0}),r}}function Hn({nodes:e,fallback:n}){let t=k({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return T(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&H(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){z(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,z(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else z(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));Rn(t,c)}}),t}function wt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function St(e,n,t){let r=wt(e,n);typeof r=="function"&&t&&T(t,r)}var _e=new WeakMap,be=new WeakMap,ne=new Set,re=new Set,Ae=null,Ye=0,Us=256;function Tt(e){let n=_e.get(e);if(n){_e.delete(e),ne.delete(e);for(let t of n)try{t()}catch{}}}function Et(e){be.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=be.get(e);if(t){be.delete(e),re.delete(e);for(let r of t)try{r()}catch{}}})}function Js(e){if(ne.size===0||e.nodeType!==1)return;let n=e;if(ne.has(n)&&n.isConnected&&Tt(n),n.firstElementChild)for(let t of Array.from(ne))t!==n&&t.isConnected&&n.contains(t)&&Tt(t)}function Gs(e){if(re.size===0||e.nodeType!==1)return;let n=e;if(re.has(n)&&!n.isConnected&&Et(n),n.firstElementChild)for(let t of Array.from(re))t!==n&&!t.isConnected&&n.contains(t)&&Et(t)}function Ys(){if(ne.size>0)for(let e of Array.from(ne))e.isConnected&&Tt(e);if(re.size>0)for(let e of Array.from(re))e.isConnected||Et(e)}function Dn(){Ae||typeof document>"u"||(Ae=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)Js(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Gs(n.removedNodes[t])}Ye+=e.length,Ye>=Us&&(Ye=0,Ys()),kt()}),Ae.observe(document.body,{childList:!0,subtree:!0}))}function kt(){Ae&&ne.size===0&&re.size===0&&(Ae.disconnect(),Ae=null,Ye=0)}function Zs(e,n){let t=_e.get(e);return t||(t=[],_e.set(e,t)),t.push(n),ne.add(e),Dn(),()=>{let r=_e.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(_e.delete(e),ne.delete(e))}kt()}}function Xs(e,n){let t=be.get(e);return t||(t=[],be.set(e,t)),t.push(n),re.add(e),Dn(),()=>{let r=be.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(be.delete(e),re.delete(e))}kt()}}function Ze(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(T(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||St(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){St(e,"onMount",n);return}let r=Zs(n,()=>{t||St(e,"onMount",n)});T(n,r)})}else queueMicrotask(()=>{wt(e,"onMount")})}function Qs(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,wt(e,"onUnmount"))};T(n,r);let o=()=>{if(t)return;let i=Xs(n,r);T(n,i)};n.isConnected?o():Ze(()=>{o()},n)}function ea(e,n){T(n,e)}var _t=Symbol.for("sibujs.ssr.v1");function ta(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof tt=="function"&&(n=tt("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var he=globalThis[_t]??(globalThis[_t]=ta()),De=he.als,X=he.fallbackStore;he.fallbackDepth??(he.fallbackDepth=0);var $n=!1;function na(){if($n||De||!(typeof process<"u"&&!!process.versions?.node))return;$n=!0;let n=process.versions.node;M(`SSR request isolation is UNAVAILABLE on this runtime (Node ${n}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function ye(){if(De){let e=De.getStore();if(e)return e}return X}function J(){return ye().ssr}function In(e){if(!J())return null;let n=ye(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function On(){ye().ssr=!0}function Pn(){ye().ssr=!1}function Bn(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(De)return De.run(n,e);na();let t=X.ssr,r=X.suspenseIdCounter,o=X.locale;X.ssr=!0,X.suspenseIdCounter=0,X.locale=void 0,he.fallbackDepth++;try{return e()}finally{he.fallbackDepth--,X.ssr=t,X.suspenseIdCounter=r,X.locale=o}}function Fn(e){let n=ye(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var qn=globalThis;function ra(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,Le(()=>n(o,void 0));else{let i=t;t=o,Le(()=>n(o,i))}}}var zn=100;function At(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){_(r,{phase:"cleanup"})}}}function Vn(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&At(e),ae(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=zn);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${zn}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function oa(e){if(e.disposed)return;e.disposed=!0;let n=qn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&At(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Re(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function q(e,n){if(R(typeof e=="function","effect: argument must be a function."),J())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&At(t),ae(t.bodyFn,o),t.rerunPending&&Vn(t)}finally{t.running=!1,t.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,t.subscriber=o,t.running=!0;try{ae(t.bodyFn,t.subscriber),t.rerunPending&&Vn(t)}finally{t.running=!1,t.rerunPending=!1}let i=qn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>oa(t)}var $e=0,Ct=new Set;function ia(e){$e++;try{return e()}finally{$e--,$e===0&&ca()}}function sa(e){return $e===0?!1:(Ct.add(e),!0)}function aa(){return $e>0}function ca(){try{for(let e of Ct)kn(e)}finally{Ct.clear()}wn()}var Wn=Symbol.for("sibujs.reactive.batch.v1");function ua(){let e=globalThis,n=e[Wn];if(n)return n;let t={batch:ia,enqueueBatchedSignal:sa,isBatching:aa};return e[Wn]=t,t}var Nt=ua(),F=Nt.batch,ve=Nt.enqueueBatchedSignal,la=Nt.isBatching;var Lt=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=n?.name,o=n?.equals;r&&(t.__name=r);function i(){return pe(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(t.value=l,t.__v++,!0){let d=Lt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}ve(t)||we(t)}}:s=a=>{let c=t.value,l=typeof a=="function"?a(c):a;if(Object.is(l,c))return;t.value=l,t.__v++;let d=Lt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l}),ve(t)||we(t)},!0){let a=Lt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function da(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var fa=`
|
|
4
|
+
`?2:1;continue}if(nn(o)){let i="",a=t+1;for(;a<e.length&&i.length<6&&nn(e[a]);)i+=e[a],a++;a<e.length&&ro(e[a])&&(a+=e[a]==="\r"&&e[a+1]===`
|
|
5
|
+
`?2:1);let s=Number.parseInt(i,16),c=s===0||s>1114111||s>=55296&&s<=57343;n+=c?"\uFFFD":String.fromCodePoint(s),t=a-1;continue}n+=o,t+=1}return n}var rn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function io(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var ct=new Set,on=100,sn=!1;function cn(e,n,t){W(()=>{let r=["url() in an inline style is an exfiltration channel: the browser fetches it immediately and the URL's path or query can carry page data off-origin","expression() executes arbitrary script in legacy engines","the javascript: scheme executes script","the vbscript: scheme executes script","-moz-binding loads and runs remote XBL","behavior: loads and runs a remote HTC script","@import pulls in a remote stylesheet","image-set() fetches remote images, the same exfiltration channel as url()","filter:progid activates legacy scriptable filters"],o=t?.property?`${t.property}: ${e}`:e,i=io(t?.element),a=`${i}|${o}`;return ct.has(a)?"":ct.size>=on?sn?"":(sn=!0,`${on} distinct dropped style declarations have been reported; suppressing further ones for the rest of this session so they cannot flood the console. The declarations are still dropped \u2014 only the reporting stops. Fix the reported ones and reload to see any that remain.`):(ct.add(a),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[n]}. The element renders without it, which usually looks like a missing image rather than an error. Sanctioned alternatives: for a content image use an <img> element (or a <picture>); for decoration, put the rule in a stylesheet and set a class instead \u2014 stylesheet CSS is not sanitized, only inline style attributes are. If this declaration is not yours, it came from untrusted data and the drop just prevented an exfiltration.`)})}function ut(e){if(!no.test(e))return-1;let t=(e.includes("\\")?oo(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<rn.length;r++)if(t.includes(rn[r]))return r;return-1}function We(e,n){let t=ut(e);return t===-1?e:(cn(e,t,n),"")}function Ue(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return We(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let a=r.style[i],s=r.style.getPropertyValue(a),c=ut(s);if(c===-1&&(c=ut(`${a}:${s}`)),c!==-1){cn(s,c,{property:a,element:n?.element});continue}let l=r.style.getPropertyPriority(a);o.push(`${a}: ${s}${l?` !${l}`:""}`)}return o.join("; ")}var so=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ao=new Set(["srcdoc"]);function un(e){return ao.has(e.toLowerCase())}function ln(e,n,t){let r=e.toLowerCase();return r==="srcset"?to(n):so.has(r)?an(n):r==="style"?Ue(n,t):n}var co="http://www.w3.org/1999/xhtml",uo="http://www.w3.org/2000/svg",lo="http://www.w3.org/1999/xlink",fo="http://www.w3.org/XML/1998/namespace",po=new Set(["checked","disabled","selected"]);function mo(e){return e.namespaceURI===null||e.namespaceURI===co}function dn(e,n,t){e[n]=t}function go(e,n){if(e.namespaceURI!==uo)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?lo:t.startsWith("xml:")?fo:null}function U(e,n,t,r={}){let o=go(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(we(n))return M(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${n}". Its value would be evaluated as JavaScript. Use on:{ ${n.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(un(n))return M(`${r.label??"setSafeAttribute"}: refusing to set "${n}". The browser parses this attribute as a nested HTML document, so a generic string value cannot be made safe \u2014 attribute escaping is undone before the parse. Build the frame's content another way.`),o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let a=mo(e),s=a?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let g=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==g&&(o?e.setAttributeNS(o,n,g):e.setAttribute(n,g)),!0}return a&&po.has(s)&&s in e?dn(e,s,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let c=String(t);if(r.syncValueProperty!==!1&&a&&(s==="value"||s==="checked")&&s in e)return dn(e,s,s==="checked"?!!t:c),!0;let l=ln(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===l||(o?e.setAttributeNS(o,n,l):e.setAttribute(n,l)),!0}var bo=4096,lt=[];function ho(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function yo(e,n,t){let r=lt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=ho();return o.sig=e,o.sub=n,o.epoch=t,o}function fn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,lt.length<bo&<.push(e)}function vo(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function pn(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function xo(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function So(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var J=null,ee=null,ie=0,se=[],K=new Set,To=[];function Eo(e){try{e()}catch(n){let t=e;w(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function wo(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var X=0,te=!1;function ft(){X===0&&(ee=J,J=null,te=!0),X++}function pt(){X--,X===0&&(J=ee,ee=null,te=!1)}function mn(){return te}function gn(e){ft();try{return e()}finally{pt()}}var ko=0;function mt(e,n){let t=J,r=0,o=null;te&&(r=X,o=ee,X=0,ee=null,te=!1),J=n;let i=n;i._cap===void 0&&(i._cap=Xt());let a=++ko;i._epoch=a,i._structDirty=!1;for(let s=i.depsHead??null;s!==null;s=s.subNext){let c=s.sig;s.prevActive=c.__activeNode??null,c.__activeNode=s}try{e()}finally{J=t,r!==0&&(X=r,ee=o,te=!0);let s=i.depsHead??null;for(;s!==null;){let c=s.subNext,l=s.sig;l.__activeNode=s.prevActive,s.prevActive=null,s.epoch!==a&&(So(s),pn(s),fn(s)),s=c}}}function bn(e,n){if(!n)return gt(e);ke(n);let t=J,r=0,o=null;te&&(r=X,o=ee,X=0,ee=null,te=!1),J=n;try{e()}finally{J=t,r!==0&&(X=r,ee=o,te=!0);let a=n;for(let s=a.depsHead??null;s!==null;s=s.subNext){let c=s.sig;c.__activeNode=s.prevActive,s.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>ke(n))}function gt(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{mt(e,r)}finally{o._reentrant=!1}}},r=t;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=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,ke(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,ke(r)})}function hn(e){if(!J)return;let n=J,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=yo(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,xo(n,i),vo(t,i),n._structDirty=!0}function ke(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;pn(t),fn(t),t=r}}var Ke=1e3,Je=1e6,Ge=0,fe=new Set;function yn(e){let n=Ke;return Number.isFinite(e)&&e>0&&(Ke=Math.floor(e)),n}function vn(e){let n=Je;return Number.isFinite(e)&&e>0&&(Je=Math.floor(e)),n}function _o(e){let n=e;return n._runEpoch!==Ge?(n._runEpoch=Ge,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>Ke)}function Ao(e){let n=e.__name??"<unnamed>";w(new Error(`subscriber "${n}" fired more than ${Ke} 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:n})}function Co(){w(new Error(`Notification drain exceeded ${Je} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function xn(){let e=0;for(;e<se.length;){if(e>=Je){Co();break}let n=se[e++];if(K.delete(n),fe.size>0&&fe.has(n)||n._hasComputedDep===!0&&!wo(n))continue;if(_o(n)){Ao(n),fe.add(n);continue}let t=Qt(n._cap??null);try{Eo(n)}finally{t&&en()}}}function Sn(){if(!(ie>0)){ie++,Ge++;try{xn()}finally{ie--,ie===0&&(se.length=0,K.clear(),fe.size>0&&fe.clear())}}}function dt(e){e();let n=e._sig;if(!n)return;let t=To,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let a=i.sub;if(a)if(a._c){let s=a._sig;s?(!s._d||s._f===!0)&&(s._d=!0,s._f=!1,t.push(s)):a()}else K.has(a)||(K.add(a),se.push(a));i=i.sigNext}}}function Tn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?dt(r):K.has(r)||(K.add(r),se.push(r))),t=t.sigNext}}function En(e){let t=e.subsHead;if(t){if(ie>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?dt(o):K.has(o)||(K.add(o),se.push(o))),r=r.sigNext}return}ie++,Ge++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?dt(o):K.has(o)||(K.add(o),se.push(o))),r=r.sigNext}xn()}finally{ie--,ie===0&&(se.length=0,K.clear(),fe.size>0&&fe.clear())}}}function wn(e){return e.__sc??0}function kn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function _n(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var An="4.6.0",Cn=Symbol.for("sibujs.reactive.v1");function Lo(){let e=globalThis,n=e[Cn];if(n)return!n.__dupWarned&&(n.__dupWarned=!0,M(`Multiple instances of the reactive runtime detected on this page (active: ${n.version}, duplicate: ${An}). Reactivity is NOT broken and no bundler configuration is required: every copy routes through the first one via a global registry, so signal writes still reach subscribers registered by any copy. This is only a SIZE issue \u2014 the duplicate copy's bytes are downloaded and parsed for nothing. If you want them back, de-duplicate sibujs in your bundler (Vite: resolve.dedupe: ['sibujs']). Mismatched VERSIONS above are worth fixing regardless, since only the first one loaded is used.`)),n;let t={suspendTracking:ft,resumeTracking:pt,isTrackingSuspended:mn,untracked:gn,retrack:mt,track:bn,reactiveBinding:gt,recordDependency:hn,cleanup:ke,setMaxSubscriberRepeats:yn,setMaxDrainIterations:vn,drainNotificationQueue:Sn,queueSignalNotification:Tn,notifySubscribers:En,getSubscriberCount:wn,getSubscriberDeps:kn,forEachSubscriber:_n,version:An};return e[Cn]=t,t}var $=Lo(),pe=$.suspendTracking,me=$.resumeTracking,Nn=$.isTrackingSuspended,Oe=$.untracked,ae=$.retrack,q=$.track,I=$.reactiveBinding,ge=$.recordDependency,$e=$.cleanup,Wc=$.setMaxSubscriberRepeats,Ln=$.setMaxDrainIterations,Rn=$.drainNotificationQueue,Mn=$.queueSignalNotification,_e=$.notifySubscribers,Uc=$.getSubscriberCount,Kc=$.getSubscriberDeps,Jc=$.forEachSubscriber;function Ye(e,n,t){if(we(n))return U(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){w(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}U(e,n,o,{label:`bindAttribute("${n}")`})}return I(r,e)}function Dn(e,n,t){let r=null;function o(){let a;try{a=typeof n=="function"?n():n}catch(c){w(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let s;try{s=typeof t=="function"?t():t}catch(c){w(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==a&&(e.removeAttribute(r),r=null),U(e,a,s,{label:"bindDynamic"})&&(r=a)}let i=I(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var bt=["data-focus-key","id","name"],Ro=new Set(["text","search","url","tel","password",""]);function Mo(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&Ro.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 Ie(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let a=e[i];if(a===n||a.nodeType===1&&a.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<bt.length;i++){let a=n.getAttribute(bt[i]);if(a){r=bt[i],o=a;break}}return{el:n,attr:r,value:o,tag:n.tagName,...Mo(n)}}function Do(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ho(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let a=i;a.matches(n)&&(r++,t??(t=a));let s=a.querySelectorAll(n);for(let c=0;c<s.length;c++)r++,t??(t=s[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function Hn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function Ae(e,n,t){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){Hn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:a}=Ho(n,`[${e.attr}=${Do(e.value)}]`);if(i&&i.tagName===e.tag){Hn(i,e);return}o=a>1}W(()=>{let i=e.attr?` (${e.attr}="${e.value}")`:"",a=o?`several elements in the rebuilt subtree share ${e.attr}="${e.value}", so there is no way to tell which one the user was in \u2014 a shared name (a radio group) identifies a GROUP, not a control. Add a unique id or data-focus-key to each`:"no element in the rebuilt subtree carries the same identity. Give it a stable id, name, or data-focus-key that the rebuild reproduces";return`${t}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${i} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them.`})}function be(e,n){let t=[];function r(){let o;try{o=n()}catch(p){w(p,{phase:"binding",name:"bindChildNode",node:e});return}let i=Ie(t);if(o==null||typeof o=="boolean"){for(let p=0;p<t.length;p++){let g=t[p];D(g),g.parentNode&&g.parentNode.removeChild(g)}t.length=0,Ae(i,t,"bindChildNode");return}let a=e.parentNode;if(!a){t.length=0;return}let s;if(Array.isArray(o)){s=[];let p=new Set;for(let g=0;g<o.length;g++){let m=o[g];if(m==null||typeof m=="boolean")continue;let d=m instanceof Node?m:document.createTextNode(String(m));if(p.has(d)){M("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}p.add(d),s.push(d)}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&s.length>0){let p=new Set(t);c=new Set;for(let g=0;g<s.length;g++)p.has(s[g])&&c.add(s[g])}for(let p=0;p<t.length;p++){let g=t[p];c?.has(g)||(D(g),g.parentNode&&g.parentNode.removeChild(g))}let l=e;for(let p=0;p<s.length;p++){let g=s[p];l.nextSibling!==g&&a.insertBefore(g,l.nextSibling),l=g}t=s,Ae(i,s,"bindChildNode")}return I(r,e)}var L="http://www.w3.org/2000/svg",Oo=new Set(["script","iframe","object","embed","frame","frameset"]);function $o(e){return Oo.has(e.toLowerCase())}var Io=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var ht=new Set,On=100,$n=!1,In=new Map;function Po(e){let n=In.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),In.set(e,n)),n}function Bo(e,n){if(typeof n=="function"){let r=I(()=>{e.setAttribute("style",Ue(String(n()),{element:e}))},e);T(e,r);return}if(typeof n=="string"){e.setAttribute("style",Ue(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Po(r);if(typeof o=="function"){let a=o,s=I(()=>{t.style.setProperty(i,We(String(a()),{property:i,element:e}))},e);T(e,s)}else t.style.setProperty(i,We(String(o),{property:i,element:e}))}}function Fo(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=I(()=>{e.setAttribute("class",n())},e);T(e,i);return}let t=n,r=!1,o="";for(let i in t){let a=t[i];if(typeof a=="function"){r=!0;break}a&&(o=o?`${o} ${i}`:i)}if(r){let a=I(()=>{let s="";for(let c in t){let l=t[c];(typeof l=="function"?l():l)&&(s=s?`${s} ${c}`:c)}e.setAttribute("class",s)},e);T(e,a)}else e.setAttribute("class",o)}function yt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),T(e,be(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),T(e,be(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 a=document.createComment("");e.appendChild(a),T(e,be(a,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)))}}}var u=(e,n)=>{let t=$o(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,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):(W(()=>{let d=r.trim().split(/\s+/);if(d.length<2)return"";let f=0;for(let h=0;h<d.length;h++){let y=d[h];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&f++}if(f<2)return"";let b=`${e}|${r}`;return ht.has(b)?"":ht.size>=On?$n?"":($n=!0,`tagFactory: ${On} distinct lone-string class warnings have been reported; suppressing further ones for the rest of this session so they cannot flood the console. Fix the reported ones and reload to see any that remain.`):(ht.add(b),`tagFactory: lone string "${r}" looks like a class list but is being rendered as TEXT. For a class, use ${e}({ class: "${r}" }) \u2014 or ${e}("${r}", children) to set the class AND add children.`)}),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 a=r,s=a.class;s!=null&&Fo(i,s);let c=a.id;c!=null&&(typeof c=="string"&&Io.has(c.toLowerCase())&&M(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let l=o!==void 0?o:a.nodes;l!=null&&yt(i,l);let p=a.on;if(p)for(let d in p){let f=p[d];typeof f=="function"?i.addEventListener(d,f):M(`tagFactory: on.${d} handler is not a function (got ${typeof f}). Event listener was not attached.`)}let g=a.style;g!=null&&Bo(i,g);let m=a.ref;m&&(m.current=i);for(let d in a)switch(d){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let f=a[d];if(f==null||we(d))continue;typeof f=="function"?T(i,Ye(i,d,f)):U(i,d,f,{syncValueProperty:!1,label:"tagFactory"})}}return a.onElement&&typeof a.onElement=="function"&&a.onElement(i),i}};var yu=u("html"),zo=u("head"),Vo=u("body"),qo=u("title"),_=u("div"),O=u("span"),jo=u("section"),Wo=u("article"),Uo=u("header"),Ko=u("footer"),Jo=u("nav"),Go=u("main"),Yo=u("aside"),Zo=u("address"),vt=u("p"),Xo=u("h1"),Qo=u("h2"),xt=u("h3"),ei=u("h4"),ti=u("h5"),ni=u("h6"),ri=u("blockquote"),oi=u("dd"),ii=u("dl"),si=u("dt"),ai=u("figcaption"),ci=u("figure"),ui=u("hr"),li=u("li"),di=u("ol"),fi=u("ul"),St=u("pre"),pi=u("a"),mi=u("abbr"),gi=u("b"),bi=u("bdi"),hi=u("bdo"),yi=u("br"),vi=u("cite"),Tt=u("code"),xi=u("data"),Si=u("dfn"),Ti=u("em"),Ei=u("i"),wi=u("kbd"),ki=u("mark"),_i=u("q"),Ai=u("rp"),Ci=u("rt"),Ni=u("ruby"),Li=u("s"),Ri=u("samp"),Mi=u("small"),Di=u("strong"),Hi=u("sub"),Oi=u("sup"),$i=u("time"),Ii=u("u"),Pi=u("var"),Bi=u("area"),Fi=u("audio"),zi=u("img"),Vi=u("map"),qi=u("track"),ji=u("video"),Wi=u("embed"),Ui=u("iframe"),Ki=u("object"),Ji=u("param"),Gi=u("picture"),Yi=u("portal"),Zi=u("source"),Xi=u("svg",L),Qi=u("math"),es=u("canvas"),ts=u("noscript"),ns=u("script"),rs=u("del"),os=u("ins"),is=u("caption"),ss=u("col"),as=u("colgroup"),cs=u("table"),us=u("tbody"),ls=u("td"),ds=u("tfoot"),fs=u("th"),ps=u("thead"),ms=u("tr"),Pe=u("button"),gs=u("datalist"),bs=u("fieldset"),hs=u("form"),ys=u("input"),vs=u("label"),xs=u("legend"),Ss=u("meter"),Ts=u("optgroup"),Es=u("option"),ws=u("output"),ks=u("progress"),_s=u("select"),As=u("textarea"),Cs=u("details"),Ns=u("dialog"),Ls=u("menu"),Rs=u("summary"),Ms=u("slot"),Ds=u("template"),Hs=u("base"),Os=u("link"),$s=u("meta"),he=u("style"),Is=u("circle",L),Ps=u("ellipse",L),Bs=u("g",L),Fs=u("line",L),zs=u("path",L),Vs=u("polygon",L),qs=u("polyline",L),js=u("rect",L),Ws=u("text",L),Us=u("tspan",L),Ks=u("defs",L),Js=u("clipPath",L),Gs=u("mask",L),Ys=u("pattern",L),Zs=u("linearGradient",L),Xs=u("radialGradient",L),Qs=u("stop",L),ea=u("use",L),ta=u("symbol",L),na=u("marker",L),ra=u("center"),oa=u("font"),ia=u("marquee"),sa=e=>u(e);var Et="__sibuPendingError";function Pn(e,n){let t=()=>e.parentNode?(w(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[Et]=n)})}function Ze(e){let n=e,t=n[Et];if(t instanceof Error)return delete n[Et],t}function Bn(e){let n=null;return function(){if(n)return n();let r=_({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let a=n();z(r,a)}).catch(i=>{if(o)return;let a=i instanceof Error?i:new Error(String(i));z(r,_({class:"sibu-lazy-error"},`Failed to load component: ${a.message}`)),Pn(r,a)}),r.appendChild(O("sibu-lazy-loading","Loading...")),T(r,()=>{o=!0}),r}}function Fn({nodes:e,fallback:n}){let t=_({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,a=null;return T(t,()=>{o=!0,i&&(i.disconnect(),i=null),a&&!t.contains(a)&&D(a)}),queueMicrotask(()=>{if(!o)try{let s=e();if(a=s,s.classList.contains("sibu-lazy")){if(!s.querySelector(".sibu-lazy-loading")){z(t,s);return}i=new MutationObserver(()=>{if(o)return;s.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,z(t,s))}),i.observe(s,{childList:!0,subtree:!0})}else z(t,s)}catch(s){let c=s instanceof Error?s:new Error(String(s));Pn(t,c)}}),t}function At(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";w(t,{phase:r,name:n});return}}function wt(e,n,t){let r=At(e,n);typeof r=="function"&&t&&T(t,r)}var Ce=new WeakMap,ye=new WeakMap,ne=new Set,re=new Set,Ne=null,Xe=0,aa=256;function kt(e){let n=Ce.get(e);if(n){Ce.delete(e),ne.delete(e);for(let t of n)try{t()}catch{}}}function _t(e){ye.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=ye.get(e);if(t){ye.delete(e),re.delete(e);for(let r of t)try{r()}catch{}}})}function ca(e){if(ne.size===0||e.nodeType!==1)return;let n=e;if(ne.has(n)&&n.isConnected&&kt(n),n.firstElementChild)for(let t of Array.from(ne))t!==n&&t.isConnected&&n.contains(t)&&kt(t)}function ua(e){if(re.size===0||e.nodeType!==1)return;let n=e;if(re.has(n)&&!n.isConnected&&_t(n),n.firstElementChild)for(let t of Array.from(re))t!==n&&!t.isConnected&&n.contains(t)&&_t(t)}function la(){if(ne.size>0)for(let e of Array.from(ne))e.isConnected&&kt(e);if(re.size>0)for(let e of Array.from(re))e.isConnected||_t(e)}function zn(){Ne||typeof document>"u"||(Ne=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)ca(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)ua(n.removedNodes[t])}Xe+=e.length,Xe>=aa&&(Xe=0,la()),Ct()}),Ne.observe(document.body,{childList:!0,subtree:!0}))}function Ct(){Ne&&ne.size===0&&re.size===0&&(Ne.disconnect(),Ne=null,Xe=0)}function da(e,n){let t=Ce.get(e);return t||(t=[],Ce.set(e,t)),t.push(n),ne.add(e),zn(),()=>{let r=Ce.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Ce.delete(e),ne.delete(e))}Ct()}}function fa(e,n){let t=ye.get(e);return t||(t=[],ye.set(e,t)),t.push(n),re.add(e),zn(),()=>{let r=ye.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(ye.delete(e),re.delete(e))}Ct()}}function Qe(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(T(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||wt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){wt(e,"onMount",n);return}let r=da(n,()=>{t||wt(e,"onMount",n)});T(n,r)})}else queueMicrotask(()=>{At(e,"onMount")})}function pa(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,At(e,"onUnmount"))};T(n,r);let o=()=>{if(t)return;let i=fa(n,r);T(n,i)};n.isConnected?o():Qe(()=>{o()},n)}function ma(e,n){T(n,e)}var Nt=Symbol.for("sibujs.ssr.v1");function ga(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof ot=="function"&&(n=ot("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ce=globalThis[Nt]??(globalThis[Nt]=ga()),ve=ce.als,F=ce.fallbackStore;ce.fallbackDepth??(ce.fallbackDepth=0);var Vn=!1;function ba(){if(Vn||ve||!(typeof process<"u"&&!!process.versions?.node))return;Vn=!0;let n=process.versions.node;M(`SSR request isolation is UNAVAILABLE on this runtime (Node ${n}). AsyncLocalStorage could not be loaded, so concurrent requests share one SSR store: request state and the query cache can bleed between them. Node >= 22.3 is required for isolated SSR under ESM; the CommonJS build works on older versions. A fully synchronous render is unaffected.`)}function xe(){if(ve){let e=ve.getStore();if(e)return e}return F}function qn(){return ve?ve.getStore()??null:ce.fallbackDepth>0?F:null}function G(){return xe().ssr}function jn(e){if(!G())return null;let n=xe(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Wn(){xe().ssr=!0}function Un(){xe().ssr=!1}function Kn(e){let n={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(ve)return ve.run(n,e);ba();let t=F.ssr,r=F.suspenseIdCounter,o=F.idCounter,i=F.locale;F.ssr=!0,F.suspenseIdCounter=0,F.idCounter=0,F.locale=void 0,ce.fallbackDepth++;try{return e()}finally{ce.fallbackDepth--,F.ssr=t,F.suspenseIdCounter=r,F.idCounter=o,F.locale=i}}function Jn(e){let n=xe(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var Zn=globalThis;function ha(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,Oe(()=>n(o,void 0));else{let i=t;t=o,Oe(()=>n(o,i))}}}var Gn=100;function Lt(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){w(r,{phase:"cleanup"})}}}function Yn(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&Lt(e),ae(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Gn);e.rerunPending&&(e.rerunPending=!1,w(new Error(`effect re-requested itself ${Gn}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function ya(e){if(e.disposed)return;e.disposed=!0;let n=Zn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Lt(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{$e(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function j(e,n){if(R(typeof e=="function","effect: argument must be a function."),G())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=a=>{t.userCleanups.push(a)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(a){r(a)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&&Lt(t),ae(t.bodyFn,o),t.rerunPending&&Yn(t)}finally{t.running=!1,t.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,t.subscriber=o,t.running=!0;try{ae(t.bodyFn,t.subscriber),t.rerunPending&&Yn(t)}finally{t.running=!1,t.rerunPending=!1}let i=Zn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>ya(t)}var Be=0,Rt=new Set;function va(e){Be++;try{return e()}finally{Be--,Be===0&&Ta()}}function xa(e){return Be===0?!1:(Rt.add(e),!0)}function Sa(){return Be>0}function Ta(){try{for(let e of Rt)Mn(e)}finally{Rt.clear()}Rn()}var Xn=Symbol.for("sibujs.reactive.batch.v1");function Ea(){let e=globalThis,n=e[Xn];if(n)return n;let t={batch:va,enqueueBatchedSignal:xa,isBatching:Sa};return e[Xn]=t,t}var Mt=Ea(),V=Mt.batch,Se=Mt.enqueueBatchedSignal,wa=Mt.isBatching;var Dt=globalThis;function C(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=n?.name,o=n?.equals;r&&(t.__name=r);function i(){return ge(t),t.value}i.__signal=t,r&&(i.__name=r);let a;if(o?a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;if(!o(c,l)){if(t.value=l,t.__v++,!0){let p=Dt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;p&&p.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l})}Se(t)||_e(t)}}:a=s=>{let c=t.value,l=typeof s=="function"?s(c):s;if(Object.is(l,c))return;t.value=l,t.__v++;let p=Dt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;p&&p.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:l}),Se(t)||_e(t)},!0){let s=Dt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;s&&s.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,a]}function ka(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var _a=`
|
|
6
6
|
.sibu-error-display {
|
|
7
7
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
8
8
|
border-radius: 10px;
|
|
@@ -183,11 +183,11 @@
|
|
|
183
183
|
border: 1px solid #3a3a4e;
|
|
184
184
|
}
|
|
185
185
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
186
|
-
`,
|
|
187
|
-
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let
|
|
188
|
-
`).map(
|
|
189
|
-
`);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,
|
|
190
|
-
`)}function
|
|
186
|
+
`,Qn=!1;function Aa(){if(Qn||typeof document>"u")return;let e=he({nodes:_a});document.head.appendChild(e),Qn=!0}function Ca(e){let n=[],t=e.split(`
|
|
187
|
+
`);for(let r of t){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){n.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let a=o.match(/^(.+?)@(.+)$/);a&&n.push({fn:a[1]||"(anonymous)",loc:a[2]||""})}return n}function er(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=Ca(r),i=e.cause,a=i!=null?er(i):null;return{code:n,message:t,stack:r,frames:o,cause:a}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Na(e,n,t){let r=[];r.push(t),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
|
+
`).map(a=>` ${a}`).join(`
|
|
189
|
+
`);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,a]of Object.entries(n))r.push(` ${i}: ${String(a)}`)}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(`
|
|
190
|
+
`)}function tr(e){let n=e.map((t,r)=>_({class:"sibu-err-frame",nodes:[O({class:"sibu-err-line",nodes:String(r+1)}),O({class:"sibu-err-fn",nodes:t.fn}),O({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return St({class:"sibu-err-stack",nodes:n})}function nr(e){return e?[_({class:"sibu-err-cause-label",nodes:"Caused by"}),_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[O({nodes:`[${e.code}] ${e.message}`}),O({nodes:""})]}),e.frames.length>0?tr(e.frames):_({class:"sibu-err-stack",nodes:"(no stack)"})]}),...nr(e.cause)]:[]}function La(e){let n=[];for(let[r,o]of Object.entries(e)){n.push(document.createElement("dt")),n[n.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),n.push(i)}let t=document.createElement("dl");t.className="sibu-err-meta";for(let r of n)t.appendChild(r);return t}function Ht(e){Aa();let n=e.severity??"error",t=er(e.error),r=e.alwaysShowDetails??Z(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[a,s]=C("Copy"),c=Pe({class:"sibu-err-copy-btn",nodes:()=>a(),on:{click:()=>{let d=Na(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(d).then(()=>{s("Copied!"),setTimeout(()=>s("Copy"),1500)},()=>{s("Copy failed"),setTimeout(()=>s("Copy"),1500)})}}}),l=_({class:"sibu-err-header",nodes:[Tt({class:"sibu-err-icon",nodes:t.code}),xt({class:"sibu-err-title",nodes:o}),c,O({class:"sibu-err-timestamp",nodes:i})]}),p=[vt({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&p.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[O({nodes:"Stack Trace"})]}),tr(t.frames)]})),r&&p.push(...nr(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&p.push(_({class:"sibu-err-section",nodes:[_({class:"sibu-err-section-head",nodes:[O({nodes:"Metadata"})]}),La(e.metadata)]}));let g=[];e.onRetry&&g.push(Pe({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(Pe({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),g.length>0&&p.push(_({class:"sibu-err-actions",nodes:g}));let m=_({class:"sibu-err-body",nodes:p});return _({class:"sibu-error-display","data-severity":n,nodes:[l,m]})}var Ra=`
|
|
191
191
|
.sibu-error-boundary {
|
|
192
192
|
position: relative;
|
|
193
193
|
}
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
342
342
|
background: #3a3a4e;
|
|
343
343
|
}
|
|
344
|
-
`,
|
|
344
|
+
`,Ma=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),rr=!1;function Da(){if(!rr&&typeof document<"u"){let e=he({nodes:Ra});document.head.appendChild(e),rr=!0}}function Ha(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:a}=r;Da();let[s,c]=C(null),l=()=>{g(),c(null)},p=null,g=()=>{if(!p)return;let v=p;p=null,v()},m=v=>{let S=new Array(v.length);for(let E=0;E<v.length;E++)try{S[E]=v[E]()}catch(H){w(H,{phase:"effect",name:"ErrorBoundary.resetKeys"}),S[E]=Ma}return S},d=()=>{let v=a;if(!v||v.length===0)return;g();let S=null;p=j(()=>{let E=m(v);if(S===null){S=E;return}let H=E.length!==S.length;if(!H){for(let P=0;P<E.length;P++)if(!Object.is(E[P],S[P])){H=!0;break}}S=E,H&&l()})},f=v=>{let S=st(v);if(c(S),d(),i)try{i(S)}catch(E){w(E,{phase:"render",name:"ErrorBoundary onError callback"})}return S},b=(v,S)=>Ht({error:v,severity:"error",onRetry:S}),h=v=>{let S=o||b;try{return S(v,l)}catch(E){return queueMicrotask(()=>{w(E,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=_({class:"sibu-error-boundary",nodes:()=>{let v=s();if(v)return h(v);try{let S=t();if(S&&typeof S.then=="function"){let E=_({class:"sibu-error-async"});E.appendChild(O({class:"sibu-lazy-loading",nodes:"Loading..."}));let H=!1;return T(E,()=>{H=!0}),S.then(P=>{if(H){D(P);return}z(E,P)}).catch(P=>{if(H)return;let Ee=f(P);z(E,h(Ee))}),E}return S}catch(S){let E=f(S);return h(E)}}}),k=v=>{if(s())return;let E=v.detail?.error;E&&(v.preventDefault(),v.stopPropagation(),f(E))};return y.addEventListener("sibu:error-propagate",k),Qe(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),S=[],E=v.currentNode;for(;E;){let H=Ze(E);H&&S.push(H),E=v.nextNode()}if(S.length===1)f(S[0]);else if(S.length>1){let H=globalThis.AggregateError;f(H?new H(S,`${S.length} pre-mount errors caught by ErrorBoundary`):new Error(S.map(P=>P.message).join("; ")))}},y),T(y,()=>{g(),y.removeEventListener("sibu:error-propagate",k)}),y}var Oa=`
|
|
345
345
|
@keyframes sibu-spin {
|
|
346
346
|
to { transform: rotate(360deg); }
|
|
347
347
|
}
|
|
@@ -394,5 +394,5 @@
|
|
|
394
394
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
395
395
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
396
396
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
397
|
-
`,Yn=!1;function Ta(){!Yn&&typeof document<"u"&&(document.head.appendChild(ge({nodes:Sa})),Yn=!0)}function Ea(e={}){Ta();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-dots",nodes:[$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"}),$({class:"sibu-loading-dot"})]}),n?$({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):k({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[k({class:"sibu-loading-spinner"}),n?$({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var Mt=Symbol.for("sibujs.actions.v1"),Zn=globalThis[Mt]??(globalThis[Mt]=new Map);function Ce(e,n){Zn.set(e,n)}function Xn(e){return Zn.get(e)}function wa(e,n,t){let r=typeof n=="string"?Xn(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&T(e,o)}var Qn=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},er=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},tr=(e,n)=>{let t=()=>{let r=typeof n=="function"?n():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)},nr=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},rr=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};Ce("clickOutside",Qn);Ce("longPress",er);Ce("copyOnClick",tr);Ce("autoResize",nr);Ce("trapFocus",rr);var xe=null;function ka(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):xe?xe(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):xe?xe(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function _a(e,n){try{return await e()}catch(t){return n?n(t,"async"):xe?xe(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function Aa(e){xe=e}function Ca(e){let[n,t]=C(e),r=i=>{!!0||!J()||M(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};return{provide(i){r("provide");let s=n();return t(i),()=>t(s)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,s){r("withContext");let a=n();t(i);try{let c=s();return c!==null&&typeof c?.then=="function"&&M("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{t(a)}}}}var Ht=Symbol.for("sibujs.createId.v1"),Dt=globalThis[Ht]??(globalThis[Ht]={n:0});function Na(e="sibu"){return Dt.n++,`${e}-${Dt.n}`}function La(){Dt.n=0}function Ra(e,n){let t=typeof n=="function"?n():n;return T(t,O(()=>{t.style.display=e()?"":"none"},t)),t}function or(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===t,c=r.has(s),l=!a&&!c;return r.add(s),c&&W(()=>`${o}: ${a?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(s,n.nextSibling),{node:s,owned:l}}function Ma(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=new WeakSet,c=!1,l=()=>{let d=e(),m=r.parentNode;if(!m||s&&d===i)return;i=d;let g=o?Me([o]):null;o?.parentNode&&(c&&H(o),o.parentNode.removeChild(o),o=null);let f=or(m,r,d?n:t!==void 0?t:null,a,"when");o=f.node,c=f.owned,ke(g,o?[o]:[],"when"),s=!0};return T(r,O(l,r)),s||queueMicrotask(()=>{!s&&r.parentNode&&l()}),r}function Ha(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=new WeakSet,c=!1,l=()=>{let d=String(e()),m=r.parentNode;if(!m||s&&d===i)return;i=d;let g=o?Me([o]):null;o?.parentNode&&(c&&H(o),o.parentNode.removeChild(o),o=null);let p=Object.hasOwn(n,d)?n[d]:t,f=or(m,r,p??null,a,"match");o=f.node,c=f.owned,ke(g,o?[o]:[],"match"),s=!0};return T(r,O(l,r)),s||queueMicrotask(()=>{!s&&r.parentNode&&l()}),r}var $t=new Map;function Da(e,n){$t.set(e,n)}function $a(e){$t.delete(e)}function ir(e){let n=$t.get(e);return n?n():k({nodes:`[Component "${e}" not found]`})}function Ia(e){let n=k({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=ir(o),z(n,i)}let r=V(t);return T(n,r),n}function sr(e){return typeof e=="function"?sr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Oa(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],l=0,d=t.length;for(;l<d;){let m=l+d>>1;e[t[m]]<c?l=m+1:d=m}t[l]=a,r[a]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),s=t[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Pa(e,n,t){R(typeof e=="function","each: first argument must be a function that returns an array."),R(typeof n=="function","each: second argument must be a render function."),R(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,d=new Map,m=[],g=[],p=[],f=0,b=[],h=[],y=new Uint8Array(0),w=new Map,v=[],S=[],E=new Map,D=!1,P=!1,Se=!1,yr=t.key,zt=()=>{if(Se)return;let G=e(),A=G.length,ce=r.parentNode;if(!ce)return;P||(ce.insertBefore(o,r.nextSibling),P=!0),h.length<A&&(h=new Array(A));for(let x=0;x<A;x++)h[x]=yr(G[x]);let oe=h;b.length<A&&(b=new Array(A)),d.clear(),E.clear();for(let x=0;x<A;x++)E.has(oe[x])&&M(`each: duplicate key "${String(oe[x])}" at index ${x} (first seen at ${E.get(oe[x])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(oe[x],x);f=0;for(let x=0;x<A;x++){let B=oe[x],qt=l.get(B),Ne;if(qt!==void 0)Ne=qt,m[f]=Ne,g[f]=G[x],p[f]=x,f++;else{let[Wt,Tr]=C(G[x]),[jt,Er]=C(x),et;try{de();try{et=sr(n(Wt,jt))}finally{fe()}}catch(wr){let kr=oe[x];et=document.createComment(`each:error:${x}`),queueMicrotask(()=>{_(wr,{phase:"render",name:`each row (key="${String(kr)}")`,node:r.parentNode?r:void 0})})}Ne={node:et,item:Wt,setItem:Tr,index:jt,setIndex:Er}}d.set(B,Ne),b[x]=Ne.node}for(let[x,B]of l)d.has(x)||(H(B.node),B.node.parentNode&&ce.removeChild(B.node));if(A===0){c=0;let x=l;l=d,d=x,D=!0,f=0;return}w.clear();for(let x=0;x<c;x++)w.set(a[x],x);v.length<A&&(v=new Array(A),S=new Array(A));let Pe=0;for(let x=0;x<A;x++){let B=w.get(oe[x]);B!==void 0&&(v[Pe]=x,S[Pe]=B,Pe++)}let Vt=Oa(S,Pe);y.length<A?y=new Uint8Array(A):y.fill(0,0,A);for(let x=0;x<Vt.length;x++)y[v[Vt[x]]]=1;let Be=o;for(let x=A-1;x>=0;x--){let B=b[x];y[x]||B.nextSibling!==Be&&ce.insertBefore(B,Be),Be=B}let Fe=a===i?s:i;Fe.length<A&&(Fe.length=A);for(let x=0;x<A;x++)Fe[x]=oe[x];a=Fe,c=A;let Sr=l;l=d,d=Sr,D=!0,vr()};function vr(){if(f===0)return;let G=f;f=0,F(()=>{for(let A=0;A<G;A++){let ce=m[A];ce.setItem(g[A]),ce.setIndex(p[A]),m[A]=void 0,g[A]=void 0}})}let xr=V(zt);return T(r,()=>{if(!Se){Se=!0,xr();for(let G of l.values())H(G.node),G.node.parentNode?.removeChild(G.node);o.parentNode&&o.parentNode.removeChild(o),P=!1,l.clear(),d.clear(),E.clear(),w.clear(),c=0,m.length=0,g.length=0,p.length=0,f=0}}),D||queueMicrotask(()=>{!D&&!Se&&r.parentNode&&zt()}),r}function Ba(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(ar(r));else n.appendChild(ar(t));return n}function ar(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}var Fa=new Set(["script","style"]),za=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),cr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),ur=new WeakMap;function Va(e){let n=e.length-1,t=e[0];for(let p=0;p<n;p++)t+=`\0${p}\0${e[p+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
398
|
-
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let p=r;r++;let f=0;for(;r<o&&t.charCodeAt(r)!==0;)f=f*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,f<0||f>=n?(r=p,-1):f}function a(){let p=r;for(;r<o;){let f=t.charCodeAt(r);if(f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||f===45)r++;else break}return t.slice(p,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let f=t[r];if(f==='"'||f==="'"){r++;let b=[],h=[],y="";for(;r<o&&t[r]!==f;){let w=s();w>=0?(b.push(y),y="",h.push(w)):y+=t[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 w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let v=s();v>=0?(b.push(y),y="",h.push(v)):y+=t[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let p=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let f=r;for(;r<o;){let y=t.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=t.slice(f,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&p.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?p.push({t:4,name:b}):h.kind==="static"?p.push({t:0,name:b,value:h.value}):h.kind==="expr"?p.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&p.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function m(p){let f="";for(;r<o&&t[r]!=="<";){let h=s();if(h>=0){let y=d(f);y&&p.push({t:1,value:y}),f="",p.push({t:2,idx:h})}else f+=t[r++]}let b=d(f);b&&p.push({t:1,value:b})}function g(){let p=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let f=t[r+1];if(f==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(f==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(f>="a"&&f<="z")&&!(f>="A"&&f<="Z")){p.push({t:1,value:"<"}),r++;continue}r++;let b=a(),h=l();i();let y=za.has(b),w=t[r]==="/";if(w&&r++,r<o&&r++,y||w)p.push({t:0,el:{tag:b,svg:cr.has(b),attrs:h,children:[]}});else{let v=g();if(Fa.has(b.toLowerCase())){for(let S=0;S<v.length;S++)if(v[S].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.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:cr.has(b),attrs:h,children:v}})}}else m(p);return p}return g()}function It(e,n){let t=e.svg?document.createElementNS(L,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.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?T(t,Je(t,i,s)):j(t,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=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}j(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):M(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(It(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),T(t,me(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function lr(e,...n){let t=ur.get(e);if(t||(t=Va(e),ur.set(e,t)),t.length===1&&t[0].t===0)return It(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(It(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),T(r,me(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function qa(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&Y()&&M("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,l=!1,d=!1,m=()=>{if(d)return;let p=e(),f=r.parentNode;if(!f||l&&p===a)return;c?.parentNode&&f.removeChild(c),a=p;let b=o.get(p);if(b){let h=i.indexOf(p);h!==-1&&(i.splice(h,1),i.push(p))}else{let h=n[p];if(!h){c=null,l=!0;return}if(b=h(),b instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(p,b),i.push(p),s>0&&i.length>s){let y=i.shift(),w=o.get(y);w&&(H(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(y))}}f.insertBefore(b,r.nextSibling),c=b,l=!0},g=V(m);return l||queueMicrotask(()=>{!l&&r.parentNode&&m()}),T(r,()=>{d=!0,g();for(let p of o.values())H(p),p.parentNode&&p.parentNode.removeChild(p);o.clear(),i.length=0,c=null}),r}function Wa(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");R(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),H(r),r.parentNode&&r.parentNode.removeChild(r)}}}function ja(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{_(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),T(t,()=>{i=!0,o&&(H(o),o.remove(),o=null)}),t}function Ka(e,n="default"){return e?.[n]}function Ua(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return t(c=>{let l=[...c];return a=l.splice(o,i,...s),l}),a},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function Ja(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,ve(r)||we(r)}function i(){if(pe(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,c=0,...l){let d=n.splice(a,c,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<n.length;d++)if(a(n[d])){let m=c(n[d]);Object.is(n[d],m)||(n[d]=m,l=!0)}l&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let l=0;l<n.length;l++){let d=a(n[l],l);Object.is(n[l],d)||(n[l]=d,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function Ga(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,l]=C(0),d=0,m=!1,g=null,p=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},f=q(()=>{if(c(),m)return;p();let b=++d,h=typeof AbortController<"u"?new AbortController:null;g=h,F(()=>{i(!0),a(null)});let y=()=>m||b!==d,w;try{w=e({signal:h?h.signal:void 0})}catch(v){if(y())return;F(()=>{a(v),i(!1)});return}w.then(v=>{y()||(g=null,F(()=>{r(v),i(!1)}))},v=>{y()||(g=null,F(()=>{a(v),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{m||l(b=>b+1)},dispose:()=>{m||(m=!0,f(),p())}}}function Ie(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let c=n;return e.source===c.source&&e.flags===c.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let c=n;if(e.size!==c.size)return!1;for(let[l,d]of e)if(!c.has(l)||!Ie(d,c.get(l),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let l of e)if(!c.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),l=new Uint8Array(n);if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let c=0;c<e.byteLength;c++)if(e.getUint8(c)!==n.getUint8(c))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let c=e,l=n;if(c.length!==l.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,l)=>Ie(c,n[l],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&Ie(r[c],o[c],t))}function Ya(e){return C(e,{equals:(n,t)=>Ie(n,t)})}function Ot(e,n){R(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.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 f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};V(()=>{let f=!0;try{o._v=e(),o._d=!1,o._init=!0,f=!1}finally{f&&(o._d=!0)}},c);let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let f=o._v;i=!0;try{ae(l,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&&Re(c)}d&&!s&&!Object.is(f,o._v)&&d.emit("computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=m;let g=()=>{let{error:f}=a;throw a=void 0,s&&(o._d=!1),f};function p(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Tn()||s?(o._d&&(m(),a!==void 0&&g()),o._v):(o._d&&(m(),a!==void 0&&(pe(o),g())),pe(o),o._v)}return t&&(p.__name=t,o.__name=t),p.__signal=o,p.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Re(c);let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(f)try{f.emit("computed:destroy",{signal:o,getter:p})}catch{}},d&&d.emit("computed:create",{signal:o,name:t,getter:p}),p}function Za(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function Xa(e){R(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n={};Object.keys(e).forEach(c=>{let[l,d]=C(e[c]);n[c]=[l,d]});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let d=n[l][0];return d()}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(n).forEach(l=>{c[l]=n[l][0]()}),c};return[t,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;F(()=>{Object.entries(d).forEach(([m,g])=>{Object.hasOwn(n,m)&&n[m][1](g)})})},reset:()=>{F(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return q(()=>{let d=r();if(l){l=!1;return}de();try{c(d)}finally{fe()}})},subscribeKey:(c,l)=>{let d,m=!0;return q(()=>{let g=n[c][0]();if(m){d=g,m=!1;return}if(!Object.is(g,d)){let p=d;d=g,de();try{l(g,p)}finally{fe()}}})},getSnapshot:r}]}function Qa(e,n){if(R(typeof e=="function","watch: first argument must be a getter function."),R(typeof n=="function","watch: second argument must be a callback function."),J())return()=>{};let t,r=!0;return V(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,de();try{n(s,a)}finally{fe()}}})}function ec(e,n,t){return[Ot(e,t),i=>{F(()=>n(i))}]}function tc(e){let n=e();return Y()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function nc(e){if(!Y())return q(e);let n=q(e),t=null;return queueMicrotask(()=>{try{t=q(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var Pt="data-sibu-enhanced",Bt=new WeakMap;function dr(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=ze){let i=r.length-o+e.length;e.length=0,Ve(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var fr=["text","attr","class","show","on","cleanup"];function pr(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Oe(e,n){return J()?()=>{}:O(n,e)}function rc(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,n=>n.value):e.value}function oc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function ic(e,n,t,r){let o=`ctx.each[${r}]`;if(Y())for(let i of Object.keys(t))R(fr.includes(i),`${o}: unknown binding "${i}". Expected one of: ${fr.join(", ")}.`);if(t.text!==void 0&&(R(typeof t.text=="function",`${o}: "text" must be a function returning the value.`),e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];R(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];R(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(n,i,s)}if(t.show!==void 0&&(R(typeof t.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];R(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(n,i,s)}t.cleanup!==void 0&&(R(typeof t.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(t.cleanup))}function Xe(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(Pt)==="true")return Y()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=g=>s?(W(()=>`enhance: ctx.${g}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,c=(g,p,f)=>{if(a(g))return;let b=pr(t,p);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(p)} not found under`,t);return}f(b)},l={root:t,ref:g=>pr(t,g),refs:g=>{let p=g.startsWith("@")?`[data-ref="${g.slice(1)}"]`:g;try{return Array.from(t.querySelectorAll(p))}catch{return[]}},on:(g,p,f,b)=>{c("on",g,h=>{let y=w=>f(w,h);h.addEventListener(p,y,b),r.push(()=>h.removeEventListener(p,y,b))})},text:(g,p)=>{c("text",g,f=>{r.push(Oe(f,()=>{let b=p(),h=b==null?"":String(b);f.textContent!==h&&(f.textContent=h)}))})},attr:(g,p,f)=>{c("attr",g,b=>{r.push(Oe(b,()=>{let h=f(),y=h==null?null:String(h);j(b,p,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(g,p,f)=>{c("classed",g,b=>{r.push(Oe(b,()=>{b.classList.toggle(p,!!f())}))})},show:(g,p)=>{c("show",g,f=>{let b=f.hidden;r.push(Oe(f,()=>{f.hidden=!p()})),r.push(()=>{f.hidden=b})})},model:(g,p,f)=>{c("model",g,b=>{let h=b,[y,w]=p,v=f?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Oe(b,()=>{oc(h,y())}));let S=()=>w(rc(h));h.addEventListener(v,S),r.push(()=>h.removeEventListener(v,S))})},each:(g,p)=>{if(a("each"))return;R(typeof p=="function","ctx.each: second argument must be a function.");let f=typeof g=="string"?l.refs(g):Array.from(g);for(let b=0;b<f.length;b++){let h=f[b],y=p(h,b);y!=null&&ic(l,h,y,b)}},cleanup:g=>{a("cleanup")||r.push(g)}},d;try{d=n(l);let g=d;if(g&&typeof g.then=="function")throw g.then(void 0,p=>{W(()=>`enhance: the promise returned by the setup also rejected: ${String(p)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(g){throw dr(r,"enhance"),s=!0,g}typeof d=="function"&&r.push(d);let m=()=>{i||(i=!0,Bt.get(t)===o&&(Bt.delete(t),t.removeAttribute(Pt)),ot(t,m),dr(r,"enhance"),s=!0)};return T(t,m),Bt.set(t,o),t.setAttribute(Pt,"true"),m}function sc(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(Xe(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}function mr(e,n){let t=globalThis;return t[e]??(t[e]=n())}var ac=/^[A-Za-z0-9_-]+$/,gr=Symbol.for("sibujs.islands.lazy"),Qe=mr(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function cc(e){return e[gr]=!0,e}function uc(e,n){if(!ac.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Qe.set(e,n)}function lc(e){Qe.delete(e)}async function dc(e){if(typeof e=="function"&&e[gr]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function fc(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],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(!Qe.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 d=Qe.get(s);d&&dc(d).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Xe(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";t.push(pc(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function pc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function br(e){return e}var vd=1024*1024;function mc(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=V(()=>{i=e(),a()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var hr=16;function gc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:hr*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,hr)}function bc(){let[e,n]=C(!1);function t(r){n(!0),gc(()=>{let o;try{o=r()}catch{n(!1);return}o&&typeof o.then=="function"?o.then(()=>n(!1),()=>n(!1)):n(!1)})}return{pending:e,start:t}}function hc(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...Ft});})();
|
|
397
|
+
`,or=!1;function $a(){!or&&typeof document<"u"&&(document.head.appendChild(he({nodes:Oa})),or=!0)}function Ia(e={}){$a();let{text:n,variant:t="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return t==="dots"?_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[_({class:"sibu-loading-dots",nodes:[O({class:"sibu-loading-dot"}),O({class:"sibu-loading-dot"}),O({class:"sibu-loading-dot"})]}),n?O({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)}):_({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":n?void 0:"Loading",nodes:[_({class:"sibu-loading-spinner"}),n?O({class:"sibu-loading-text",nodes:n}):null].filter(Boolean)})}var Ot=Symbol.for("sibujs.actions.v1"),ir=globalThis[Ot]??(globalThis[Ot]=new Map);function Le(e,n){ir.set(e,n)}function sr(e){return ir.get(e)}function Pa(e,n,t){let r=typeof n=="string"?sr(n):n;if(!r)throw new Error(`[SibuJS] No action registered under the name "${n}". Register it with registerAction() before applying it by name.`);let o=r(e,t);typeof o=="function"&&T(e,o)}var ar=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},cr=(e,n)=>{let t=n.duration??500,r=null,o=()=>{r=setTimeout(()=>{n.callback(),r=null},t)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},ur=(e,n)=>{let t=o=>w(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof n=="function"?n():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(t)}catch(o){t(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},lr=e=>{let n=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),()=>e.removeEventListener("input",n)},dr=e=>{let n='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',t=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(n));if(o.length===0)return;let i=o[0],a=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),a.focus()):!r.shiftKey&&document.activeElement===a&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)};Le("clickOutside",ar);Le("longPress",cr);Le("copyOnClick",ur);Le("autoResize",lr);Le("trapFocus",dr);var Te=null;function Ba(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):Te?Te(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):Te?Te(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Fa(e,n){try{return await e()}catch(t){return n?n(t,"async"):Te?Te(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function za(e){Te=e}function Va(e){let[n,t]=C(e),r=i=>{!!0||!G()||M(`context.${i}() called during SSR. SibuJS context() is application-global \u2014 it is NOT isolated per request, so a concurrent request can observe this value. Do not use context() for request-specific SSR data; pass it explicitly or use request-scoped storage instead.`)};return{provide(i){r("provide");let a=n();return t(i),()=>t(a)},use(){return n},get(){return n()},set(i){r("set"),t(i)},withContext(i,a){r("withContext");let s=n();t(i);try{let c=a();return c!==null&&typeof c?.then=="function"&&M("context.withContext() received an async callback. Scoping is synchronous only \u2014 the previous value is restored as soon as the callback returns its promise, so anything after an `await` runs outside the scope."),c}finally{t(s)}}}}var $t=Symbol.for("sibujs.createId.v1"),It=globalThis[$t]??(globalThis[$t]={n:0});function fr(e="sibu"){let n=qn();return n?(n.idCounter=(n.idCounter??0)+1,`${e}-${n.idCounter}`):(It.n++,`${e}-${It.n}`)}function pr(){It.n=0}function qa(e,n){let t=typeof n=="function"?n():n;return T(t,I(()=>{t.style.display=e()?"":"none"},t)),t}function mr(e,n,t,r,o){let i=typeof t=="function"?t():t;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let a=i instanceof Node?i:document.createTextNode(String(i)),s=a===t,c=r.has(a),l=!s&&!c;return r.add(a),c&&W(()=>`${o}: ${s?"a branch was given as an element rather than a function":"a branch factory returned a node it had already returned"}, so the SAME node is being re-attached \u2014 any state it accumulated while detached (input value, scroll position, classes set imperatively) comes back with it. Its reactive bindings are left intact rather than disposed, because the node is not this directive's to tear down. Return a FRESH node per call (\`() => div(\u2026)\`) for rebuild semantics, or keep this form deliberately when the reuse is what you want.`),e.insertBefore(a,n.nextSibling),{node:a,owned:l}}function ja(e,n,t){let r=document.createComment("when"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,p=()=>{if(s)return;let m=e(),d=r.parentNode;if(!d||a&&m===i)return;i=m;let f=o?Ie([o]):null;o?.parentNode&&(l&&D(o),o.parentNode.removeChild(o),o=null);let h=mr(d,r,m?n:t!==void 0?t:null,c,"when");o=h.node,l=h.owned,Ae(f,o?[o]:[],"when"),a=!0},g=I(p,r);return T(r,()=>{s=!0,g()}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&p()}),r}function Wa(e,n,t){let r=document.createComment("match"),o=null,i,a=!1,s=!1,c=new WeakSet,l=!1,p=()=>{if(s)return;let m=String(e()),d=r.parentNode;if(!d||a&&m===i)return;i=m;let f=o?Ie([o]):null;o?.parentNode&&(l&&D(o),o.parentNode.removeChild(o),o=null);let b=Object.hasOwn(n,m)?n[m]:t,h=mr(d,r,b??null,c,"match");o=h.node,l=h.owned,Ae(f,o?[o]:[],"match"),a=!0},g=I(p,r);return T(r,()=>{s=!0,g()}),a||queueMicrotask(()=>{!s&&!a&&r.parentNode&&p()}),r}function et(e,n){let t=globalThis;return t[e]??(t[e]=n())}var Pt=et(Symbol.for("sibujs.components.registry.v1"),()=>new Map);function Ua(e,n){Pt.set(e,n)}function Ka(e){Pt.delete(e)}function gr(e){let n=Pt.get(e);return n?n():_(`[Component "${e}" not found]`)}function Ja(e){let n=_({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=gr(o),z(n,i)}let r=q(t);return T(n,r),n}function br(e){return typeof e=="function"?br(e()):e instanceof Node?e:document.createTextNode(String(e))}function Ga(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let s=0;s<n;s++){let c=e[s],l=0,p=t.length;for(;l<p;){let g=l+p>>1;e[t[g]]<c?l=g+1:p=g}t[l]=s,r[s]=l>0?t[l-1]:-1}let o=t.length,i=new Array(o),a=t[o-1];for(let s=o-1;s>=0;s--)i[s]=a,a=r[a];return i}function Ya(e,n,t){R(typeof e=="function","each: first argument must be a function that returns an array."),R(typeof n=="function","each: second argument must be a render function."),R(t&&typeof t.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],a=[],s=i,c=0,l=new Map,p=new Map,g=[],m=[],d=[],f=0,b=[],h=[],y=new Uint8Array(0),k=new Map,v=[],S=[],E=new Map,H=!1,P=!1,Ee=!1,Mr=t.key,jt=()=>{if(Ee)return;let Y=e(),A=Y.length,ue=r.parentNode;if(!ue)return;P||(ue.insertBefore(o,r.nextSibling),P=!0),h.length<A&&(h=new Array(A));for(let x=0;x<A;x++)h[x]=Mr(Y[x]);let oe=h;b.length<A&&(b=new Array(A)),p.clear(),E.clear();for(let x=0;x<A;x++)E.has(oe[x])&&M(`each: duplicate key "${String(oe[x])}" at index ${x} (first seen at ${E.get(oe[x])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(oe[x],x);f=0;for(let x=0;x<A;x++){let B=oe[x],Ut=l.get(B),Me;if(Ut!==void 0)Me=Ut,g[f]=Me,m[f]=Y[x],d[f]=x,f++;else{let[Kt,$r]=C(Y[x]),[Jt,Ir]=C(x),rt;try{pe();try{rt=br(n(Kt,Jt))}finally{me()}}catch(Pr){let Br=oe[x];rt=document.createComment(`each:error:${x}`),queueMicrotask(()=>{w(Pr,{phase:"render",name:`each row (key="${String(Br)}")`,node:r.parentNode?r:void 0})})}Me={node:rt,item:Kt,setItem:$r,index:Jt,setIndex:Ir}}p.set(B,Me),b[x]=Me.node}for(let[x,B]of l)p.has(x)||(D(B.node),B.node.parentNode&&ue.removeChild(B.node));if(A===0){c=0;let x=l;l=p,p=x,H=!0,f=0;return}k.clear();for(let x=0;x<c;x++)k.set(s[x],x);v.length<A&&(v=new Array(A),S=new Array(A));let ze=0;for(let x=0;x<A;x++){let B=k.get(oe[x]);B!==void 0&&(v[ze]=x,S[ze]=B,ze++)}let Wt=Ga(S,ze);y.length<A?y=new Uint8Array(A):y.fill(0,0,A);for(let x=0;x<Wt.length;x++)y[v[Wt[x]]]=1;let Ve=o;for(let x=A-1;x>=0;x--){let B=b[x];y[x]||B.nextSibling!==Ve&&ue.insertBefore(B,Ve),Ve=B}let qe=s===i?a:i;qe.length<A&&(qe.length=A);for(let x=0;x<A;x++)qe[x]=oe[x];s=qe,c=A;let Or=l;l=p,p=Or,H=!0,Dr()};function Dr(){if(f===0)return;let Y=f;f=0,V(()=>{for(let A=0;A<Y;A++){let ue=g[A];ue.setItem(m[A]),ue.setIndex(d[A]),g[A]=void 0,m[A]=void 0}})}let Hr=q(jt);return T(r,()=>{if(!Ee){Ee=!0,Hr();for(let Y of l.values())D(Y.node),Y.node.parentNode?.removeChild(Y.node);o.parentNode&&o.parentNode.removeChild(o),P=!1,l.clear(),p.clear(),E.clear(),k.clear(),c=0,g.length=0,m.length=0,d.length=0,f=0}}),H||queueMicrotask(()=>{!H&&!Ee&&r.parentNode&&jt()}),r}function Za(e){let n=document.createDocumentFragment();for(let t of e)if(!(t==null||typeof t=="boolean"))if(Array.isArray(t))for(let r of t)r==null||typeof r=="boolean"||n.appendChild(hr(r));else n.appendChild(hr(t));return n}function hr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let n=e();return n instanceof Node?n:document.createTextNode(String(n??""))}return document.createTextNode(String(e))}var Xa=new Set(["script","style"]),Qa=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),yr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),vr=new WeakMap;function ec(e){let n=e.length-1,t=e[0];for(let d=0;d<n;d++)t+=`\0${d}\0${e[d+1]}`;let r=0,o=t.length;function i(){for(;r<o&&(t[r]===" "||t[r]===" "||t[r]===`
|
|
398
|
+
`||t[r]==="\r");)r++}function a(){if(t.charCodeAt(r)!==0)return-1;let d=r;r++;let f=0;for(;r<o&&t.charCodeAt(r)!==0;)f=f*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,f<0||f>=n?(r=d,-1):f}function s(){let d=r;for(;r<o;){let f=t.charCodeAt(r);if(f>=97&&f<=122||f>=65&&f<=90||f>=48&&f<=57||f===45)r++;else break}return t.slice(d,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let d=a();if(d>=0)return{kind:"expr",idx:d};let f=t[r];if(f==='"'||f==="'"){r++;let b=[],h=[],y="";for(;r<o&&t[r]!==f;){let k=a();k>=0?(b.push(y),y="",h.push(k)):y+=t[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=t.charCodeAt(r);if(k===32||k===9||k===10||k===13||k===62)break;let v=a();v>=0?(b.push(y),y="",h.push(v)):y+=t[r++]}return b.push(y),h.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:h}}}function l(){let d=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let f=r;for(;r<o;){let y=t.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=t.slice(f,r);if(!b)break;let h=c();b.startsWith("on:")?h.kind==="expr"&&d.push({t:3,name:b.slice(3),idx:h.idx}):h.kind==="bool"?d.push({t:4,name:b}):h.kind==="static"?d.push({t:0,name:b,value:h.value}):h.kind==="expr"?d.push({t:1,name:b,idx:h.idx}):h.kind==="mixed"&&d.push({t:2,name:b,statics:h.statics,exprs:h.exprs})}return d}function p(d){return d.replace(/\s+/g," ")}function g(d){let f="";for(;r<o&&t[r]!=="<";){let h=a();if(h>=0){let y=p(f);y&&d.push({t:1,value:y}),f="",d.push({t:2,idx:h})}else f+=t[r++]}let b=p(f);b&&d.push({t:1,value:b})}function m(){let d=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let f=t[r+1];if(f==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(f==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(f>="a"&&f<="z")&&!(f>="A"&&f<="Z")){d.push({t:1,value:"<"}),r++;continue}r++;let b=s(),h=l();i();let y=Qa.has(b),k=t[r]==="/";if(k&&r++,r<o&&r++,y||k)d.push({t:0,el:{tag:b,svg:yr.has(b),attrs:h,children:[]}});else{let v=m();if(Xa.has(b.toLowerCase())){for(let S=0;S<v.length;S++)if(v[S].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.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,s(),i(),r<o&&t[r]===">"&&r++),d.push({t:0,el:{tag:b,svg:yr.has(b),attrs:h,children:v}})}}else g(d);return d}return m()}function Bt(e,n){let t=e.svg?document.createElementNS(L,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.setAttribute(o.name,o.value);break;case 1:{let i=o.name,a=n[o.idx];typeof a=="function"?T(t,Ye(t,i,a)):U(t,i,a,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let a=0;a<o.exprs.length;a++){let s=n[o.exprs[a]];i+=(s==null?"":String(s))+o.statics[a+1]}U(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):M(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Bt(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let a=document.createComment("");t.appendChild(a),T(t,be(a,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let a=0;a<i.length;a++){let s=i[a];s instanceof Node?t.appendChild(s):s!=null&&typeof s!="boolean"&&t.appendChild(document.createTextNode(String(s)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function xr(e,...n){let t=vr.get(e);if(t||(t=ec(e),vr.set(e,t)),t.length===1&&t[0].t===0)return Bt(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Bt(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let a=n[i.idx];if(a instanceof Node)r.appendChild(a);else if(typeof a=="function"){let s=document.createComment("bind:htm");r.appendChild(s),T(r,be(s,a))}else if(Array.isArray(a))for(let s=0;s<a.length;s++){let c=a[s];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else a!=null&&typeof a!="boolean"&&r.appendChild(document.createTextNode(String(a)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function tc(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],a=t?.max??10;a===0&&Z()&&M("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let s,c=null,l=!1,p=!1,g=()=>{if(p)return;let d=e(),f=r.parentNode;if(!f||l&&d===s)return;c?.parentNode&&f.removeChild(c),s=d;let b=o.get(d);if(b){let h=i.indexOf(d);h!==-1&&(i.splice(h,1),i.push(d))}else{let h=n[d];if(!h){c=null,l=!0;return}if(b=h(),b instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(b),b=y}if(o.set(d,b),i.push(d),a>0&&i.length>a){let y=i.shift(),k=o.get(y);k&&(D(k),k.parentNode&&k.parentNode.removeChild(k),o.delete(y))}}f.insertBefore(b,r.nextSibling),c=b,l=!0},m=q(g);return l||queueMicrotask(()=>{!l&&r.parentNode&&g()}),T(r,()=>{p=!0,m();for(let d of o.values())D(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,c=null}),r}function nc(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");R(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let t=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-t:0;n.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:n,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),D(r),r.parentNode&&r.parentNode.removeChild(r)}}}function rc(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{w(a,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),T(t,()=>{i=!0,o&&(D(o),o.remove(),o=null)}),t}function oc(e,n="default"){if(e==null||!Object.hasOwn(e,n))return;let t=e[n];return typeof t=="function"?t:void 0}function Sr(e,n,t){return t.length===0?e.splice(n):e.splice(n,...t)}function ic(e=[]){let[n,t]=C([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let a=[...i];return o=a.pop(),a}),o},shift(){let o;return t(i=>{let a=[...i];return o=a.shift(),a}),o},unshift(...o){t(i=>[...o,...i])},splice(o,...i){let a=[];return t(s=>{let c=[...s];return a=Sr(c,o,i),a.length===0&&i.length<=1?s:c}),a},remove(o){t(i=>i.filter((a,s)=>s!==o))},removeWhere(o){t(i=>{let a=i.findIndex(o);return a===-1?i:i.filter((s,c)=>c!==a)})},set(o){t([...o])},update(o,i){t(a=>a.map((s,c)=>c===o?i:s))},updateWhere(o,i){t(a=>a.map(s=>o(s)?i(s):s))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function sc(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,Se(r)||_e(r)}function i(){if(ge(r),t===null){let s=n.slice();t=Object.freeze(s)}return t}return[i,{push(...s){s.length!==0&&(n.push(...s),o())},pop(){if(n.length===0)return;let s=n.pop();return o(),s},shift(){if(n.length===0)return;let s=n.shift();return o(),s},unshift(...s){s.length!==0&&(n.unshift(...s),o())},splice(s,...c){let l=Sr(n,s,c);return(l.length>0||c.length>1)&&o(),l},remove(s){s<0||s>=n.length||(n.splice(s,1),o())},removeWhere(s){let c=n.findIndex(s);c!==-1&&(n.splice(c,1),o())},set(s){n=[...s],o()},update(s,c){s<0||s>=n.length||Object.is(n[s],c)||(n[s]=c,o())},updateWhere(s,c){let l=!1;for(let p=0;p<n.length;p++)if(s(n[p])){let g=c(n[p]);Object.is(n[p],g)||(n[p]=g,l=!0)}l&&o()},sort(s){n.length<=1||(n.sort(s),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(s){let c=n.filter(s);c.length!==n.length&&(n=c,o())},map(s){let c=!1;for(let l=0;l<n.length;l++){let p=s(n[l],l);Object.is(n[l],p)||(n[l]=p,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function ac(e,n){let[t,r]=C(n),[o,i]=C(!1),[a,s]=C(null),[c,l]=C(0),p=0,g=!1,m=null,d=()=>{if(m===null)return;let b=m;m=null;try{b.abort()}catch{}},f=j(()=>{if(c(),g)return;d();let b=++p,h=typeof AbortController<"u"?new AbortController:null;m=h,V(()=>{i(!0),s(null)});let y=()=>g||b!==p,k;try{k=e({signal:h?h.signal:void 0})}catch(v){if(y())return;V(()=>{s(v),i(!1)});return}k.then(v=>{y()||(m=null,V(()=>{r(v),i(!1)}))},v=>{y()||(m=null,V(()=>{s(v),i(!1)}))})});return{value:t,loading:o,error:a,refresh:()=>{g||l(b=>b+1)},dispose:()=>{g||(g=!0,f(),d())}}}function Re(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let s=n;return e.source===s.source&&e.flags===s.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let s=n;if(e.size!==s.size)return!1;for(let[c,l]of e)if(!s.has(c)||!Re(l,s.get(c),t))return!1;return!0}if(e instanceof Set){let s=n;if(e.size!==s.size)return!1;for(let c of e)if(!s.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let s=new Uint8Array(e),c=new Uint8Array(n);if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let s=0;s<e.byteLength;s++)if(e.getUint8(s)!==n.getUint8(s))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let s=e,c=n;if(s.length!==c.length)return!1;for(let l=0;l<s.length;l++)if(s[l]!==c[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((s,c)=>Re(s,n[c],t));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),n.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===n.href;if(e instanceof Error){let s=n;return e.name===s.name&&e.message===s.message&&Re(e.cause,s.cause,t)&&Tr(r,o,t)}let a=Object.getPrototypeOf(r);return a!==Object.prototype&&a!==null?!1:Tr(r,o,t)}function Tr(e,n,t){let r=Object.keys(e),o=Object.keys(n);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(n,i)&&Re(e[i],n[i],t))}function cc(e){return C(e,{equals:(n,t)=>Re(n,t)})}function Ft(e,n){R(typeof e=="function","derived: argument must be a getter function.");let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,a=!1,s,c=()=>{o._d||a||(o._d=!0)};c._c=1,c._sig=o;let l=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};q(()=>{let f=!0;try{o._v=e(),o._d=!1,o._init=!0,f=!1}finally{f&&(o._d=!0)}},c);let p=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||a||s!==void 0)return;let f=o._v;i=!0;try{ae(l,c),Object.is(f,o._v)||o.__v++}catch(b){s={error:b},o.__v++,a?o._d=!0:o._f=!0}finally{i=!1,a&&$e(c)}p&&!a&&!Object.is(f,o._v)&&p.emit("computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=g;let m=()=>{let{error:f}=s;throw s=void 0,a&&(o._d=!1),f};function d(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Nn()||a?(o._d&&(g(),s!==void 0&&m()),o._v):(o._d&&(g(),s!==void 0&&(ge(o),m())),ge(o),o._v)}return t&&(d.__name=t,o.__name=t),d.__signal=o,d.dispose=()=>{if(a)return;a=!0,o._d=s!==void 0,$e(c);let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(f)try{f.emit("computed:destroy",{signal:o,getter:d})}catch{}},p&&p.emit("computed:create",{signal:o,name:t,getter:d}),d}function uc(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function Er(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function lc(e){R(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let n=Object.create(null);Object.keys(e).forEach(c=>{let[l,p]=C(e[c]);Er(n,c,[l,p])});let t=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(n,l)){let p=n[l][0];return p()}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(n).forEach(l=>{Er(c,l,n[l][0]())}),c};return[t,{setState:c=>{let l=r(),p=typeof c=="function"?c(l):c;V(()=>{Object.entries(p).forEach(([g,m])=>{Object.hasOwn(n,g)&&n[g][1](m)})})},reset:()=>{V(()=>{Object.keys(e).forEach(c=>{let l=n[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return j(()=>{let p=r();if(l){l=!1;return}pe();try{c(p)}finally{me()}})},subscribeKey:(c,l)=>{let p,g=!0;return j(()=>{let m=n[c][0]();if(g){p=m,g=!1;return}if(!Object.is(m,p)){let d=p;p=m,pe();try{l(m,d)}finally{me()}}})},getSnapshot:r}]}function dc(e,n){if(R(typeof e=="function","watch: first argument must be a getter function."),R(typeof n=="function","watch: second argument must be a callback function."),G())return()=>{};let t,r=!0;return q(()=>{let a=e();if(r){t=a,r=!1;return}if(!Object.is(a,t)){let s=t;t=a,pe();try{n(a,s)}finally{me()}}})}function fc(e,n,t){return[Ft(e,t),i=>{V(()=>n(i))}]}function pc(e){let n=e();return Z()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function mc(e){if(!Z())return j(e);let n=j(e),t=null;return queueMicrotask(()=>{try{t=j(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function wr(e,n){return G()?()=>{}:I(e,n)}var zt="data-sibu-enhanced",Vt=new WeakMap;function kr(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=De){let i=r.length-o+e.length;e.length=0,He(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var _r=["text","attr","class","show","on","cleanup"];function Ar(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Fe(e,n){return wr(n,e)}function gc(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,n=>n.value):e.value}function bc(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function hc(e,n,t,r){let o=`ctx.each[${r}]`;if(Z())for(let i of Object.keys(t))R(_r.includes(i),`${o}: unknown binding "${i}". Expected one of: ${_r.join(", ")}.`);if(t.text!==void 0&&(R(typeof t.text=="function",`${o}: "text" must be a function returning the value.`),e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let a=t.attr[i];R(typeof a=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(n,i,a)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let a=t.class[i];R(typeof a=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(n,i,a)}if(t.show!==void 0&&(R(typeof t.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let a=t.on[i];R(typeof a=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(n,i,a)}t.cleanup!==void 0&&(R(typeof t.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(t.cleanup))}function tt(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(zt)==="true")return Z()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,a=!1,s=m=>a?(W(()=>`enhance: ctx.${m}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,c=(m,d,f)=>{if(s(m))return;let b=Ar(t,d);if(!b){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(d)} not found under`,t);return}f(b)},l={root:t,ref:m=>Ar(t,m),refs:m=>{let d=m.startsWith("@")?`[data-ref="${m.slice(1)}"]`:m;try{return Array.from(t.querySelectorAll(d))}catch{return[]}},on:(m,d,f,b)=>{c("on",m,h=>{let y=k=>f(k,h);h.addEventListener(d,y,b),r.push(()=>h.removeEventListener(d,y,b))})},text:(m,d)=>{c("text",m,f=>{r.push(Fe(f,()=>{let b=d(),h=b==null?"":String(b);f.textContent!==h&&(f.textContent=h)}))})},attr:(m,d,f)=>{c("attr",m,b=>{r.push(Fe(b,()=>{let h=f(),y=h==null?null:String(h);U(b,d,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(m,d,f)=>{c("classed",m,b=>{r.push(Fe(b,()=>{b.classList.toggle(d,!!f())}))})},show:(m,d)=>{c("show",m,f=>{let b=f.hidden;r.push(Fe(f,()=>{f.hidden=!d()})),r.push(()=>{f.hidden=b})})},model:(m,d,f)=>{c("model",m,b=>{let h=b,[y,k]=d,v=f?.event??(h instanceof HTMLSelectElement||h instanceof HTMLInputElement&&(h.type==="checkbox"||h.type==="radio")?"change":"input");r.push(Fe(b,()=>{bc(h,y())}));let S=()=>k(gc(h));h.addEventListener(v,S),r.push(()=>h.removeEventListener(v,S))})},each:(m,d)=>{if(s("each"))return;R(typeof d=="function","ctx.each: second argument must be a function.");let f=typeof m=="string"?l.refs(m):Array.from(m);for(let b=0;b<f.length;b++){let h=f[b],y=d(h,b);y!=null&&hc(l,h,y,b)}},cleanup:m=>{s("cleanup")||r.push(m)}},p;try{p=n(l);let m=p;if(m&&typeof m.then=="function")throw m.then(void 0,d=>{W(()=>`enhance: the promise returned by the setup also rejected: ${String(d)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(m){throw kr(r,"enhance"),a=!0,m}typeof p=="function"&&r.push(p);let g=()=>{i||(i=!0,Vt.get(t)===o&&(Vt.delete(t),t.removeAttribute(zt)),je(t,g),kr(r,"enhance"),a=!0)};return T(t,g),Vt.set(t,o),t.setAttribute(zt,"true"),g}function yc(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(tt(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}var vc=/^[A-Za-z0-9_-]+$/,Cr=Symbol.for("sibujs.islands.lazy"),nt=et(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function xc(e){return e[Cr]=!0,e}function Sc(e,n){if(!vc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);nt.set(e,n)}function Tc(e){nt.delete(e)}async function Ec(e){if(typeof e=="function"&&e[Cr]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function wc(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let a=i.getAttribute("data-sibu-island")??"";if(!nt.has(a)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${a}" \u2014 skipping. Call registerIsland("${a}", ...).`);continue}let s=!1,c=()=>{if(s||o)return;s=!0;let p=nt.get(a);p&&Ec(p).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${a}" loader produced no setup.`);return}try{let m=tt(i,g);if(o){m();return}r.push(m),i.setAttribute("data-sibu-hydrated","true")}catch(m){typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to mount:`,m)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${a}" failed to load:`,g)})},l=i.getAttribute("data-sibu-load")||"load";t.push(kc(l,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function kc(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let a of i)a.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{a(),t()},a=()=>{for(let s of o)n.removeEventListener(s,i)};for(let s of o)n.addEventListener(s,i,{passive:!0});return a}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let a=()=>{i.matches&&(i.removeEventListener("change",a),t())};return i.addEventListener("change",a),()=>i.removeEventListener("change",a)}default:return queueMicrotask(t),()=>{}}}function Nr(e){return e}var Id=1024*1024;function Lr(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let n;try{n=e.then}catch(t){return Promise.reject(t)}return typeof n!="function"?null:new Promise((t,r)=>{queueMicrotask(()=>{try{Reflect.apply(n,e,[t,r])}catch(o){r(o)}})})}function _c(e){let[n,t]=C(e()),r=!1,o=!1,i=n(),a=()=>{r=!1,!o&&t(i)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(a):a()}))},c=q(()=>{i=e(),s()}),l=(()=>n());return l.dispose=()=>{o||(o=!0,c())},l}var Rr=16;function Ac(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Rr*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Rr)}function Cc(){let[e,n]=C(!1),t=0;function r(o){t++,n(!0);let i=!1,a=()=>{i||(i=!0,t--,t===0&&n(!1))},s=c=>{a(),w(c,{phase:"async",name:"transition"})};Ac(()=>{try{let c=Lr(o());c?c.then(a,s):a()}catch(c){s(c)}})}return{pending:e,start:r}}function Nc(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof globalThis<"u"&&(globalThis.Sibu={...qt});})();
|