sibujs 4.1.0 → 4.2.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/README.md +24 -0
- package/dist/browser.cjs +13 -21
- package/dist/browser.js +6 -6
- package/dist/build.cjs +278 -104
- package/dist/build.js +15 -15
- package/dist/cdn.dev.global.js +398 -0
- package/dist/cdn.global.js +10 -10
- package/dist/{chunk-DCDS2PQ6.js → chunk-2LOYNGBY.js} +2 -2
- package/dist/{chunk-VPP2FONR.js → chunk-2WLZ6757.js} +17 -10
- package/dist/{chunk-IM7N5WR4.js → chunk-3VTSPNC5.js} +2 -2
- package/dist/{chunk-TIRZCERI.js → chunk-5DXA2J44.js} +1 -1
- package/dist/{chunk-I3VI34DP.js → chunk-6ZGI3RBE.js} +149 -33
- package/dist/{chunk-D3SZ4LVS.js → chunk-7ALC7KGE.js} +5 -6
- package/dist/{chunk-PFTDGEPZ.js → chunk-7VEC3UD2.js} +3 -3
- package/dist/{chunk-KSOEJGFO.js → chunk-BMYYZWHX.js} +3 -3
- package/dist/{chunk-LOFZHP6V.js → chunk-BNKV4REK.js} +7 -8
- package/dist/{chunk-5GJ5RTHA.js → chunk-FOWBJZDL.js} +7 -8
- package/dist/{chunk-FB7KQXZI.js → chunk-GDUNQCCW.js} +4 -4
- package/dist/{chunk-UFSQEO7P.js → chunk-HECVW343.js} +7 -8
- package/dist/{chunk-SHDVWATN.js → chunk-HJEPKZ2O.js} +7 -8
- package/dist/{chunk-ANGSYNPX.js → chunk-HZEBO22J.js} +57 -37
- package/dist/{chunk-5INI7D2L.js → chunk-IXKSNWV5.js} +74 -11
- package/dist/{chunk-DAKLOMKS.js → chunk-KE4KWRDY.js} +3 -3
- package/dist/{chunk-AW6HPJ3L.js → chunk-KKLW7YWL.js} +1 -1
- package/dist/{chunk-BMSN6NWQ.js → chunk-NEYWS4EX.js} +6 -6
- package/dist/{chunk-HYCCIYNS.js → chunk-NIOYEGBQ.js} +13 -14
- package/dist/{chunk-4U7KD3RY.js → chunk-OUWAIXIK.js} +3 -3
- package/dist/{chunk-MRAMKDHQ.js → chunk-P3DHXBR6.js} +1 -1
- package/dist/{chunk-FMHIQNMP.js → chunk-QCFLDD7C.js} +5 -5
- package/dist/{chunk-DHDZ7IVN.js → chunk-QKRPLZ2V.js} +7 -8
- package/dist/{chunk-4RH6D7GR.js → chunk-QL4UREZO.js} +6 -6
- package/dist/{chunk-XIHMS2Y6.js → chunk-SF3TB4K6.js} +8 -8
- package/dist/{chunk-XSZRJW76.js → chunk-XZ2N525U.js} +6 -6
- package/dist/{customElement-CKLoO63w.d.ts → customElement-CNZxEB9G.d.cts} +77 -0
- package/dist/{customElement-CKLoO63w.d.cts → customElement-CNZxEB9G.d.ts} +77 -0
- package/dist/data.cjs +15 -24
- package/dist/data.js +9 -9
- package/dist/devtools.cjs +18 -22
- package/dist/devtools.d.cts +1 -1
- package/dist/devtools.d.ts +1 -1
- package/dist/devtools.js +8 -8
- package/dist/{dispose-4FZ6OFXR.js → dispose-46BOMMQJ.js} +2 -2
- package/dist/ecosystem.cjs +222 -67
- package/dist/ecosystem.js +11 -11
- package/dist/extras.cjs +243 -86
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +25 -25
- package/dist/index.cjs +272 -98
- package/dist/index.d.cts +154 -33
- package/dist/index.d.ts +154 -33
- package/dist/index.js +15 -15
- package/dist/{introspect-RjLfIFpL.d.cts → introspect-D5xF-0Es.d.cts} +7 -0
- package/dist/{introspect-DOZfmC-4.d.ts → introspect-rSBIxEQi.d.ts} +7 -0
- package/dist/motion.cjs +13 -22
- package/dist/motion.js +5 -5
- package/dist/patterns.cjs +16 -24
- package/dist/patterns.d.cts +8 -0
- package/dist/patterns.d.ts +8 -0
- package/dist/patterns.js +7 -7
- package/dist/performance.cjs +16 -27
- package/dist/performance.js +9 -9
- package/dist/plugins.cjs +260 -86
- package/dist/plugins.d.cts +92 -0
- package/dist/plugins.d.ts +92 -0
- package/dist/plugins.js +18 -17
- package/dist/{ssr-JFP5535P.js → ssr-Y7XOEPEN.js} +5 -5
- package/dist/ssr.cjs +233 -79
- package/dist/ssr.js +12 -12
- package/dist/testing.cjs +11 -19
- package/dist/testing.js +5 -5
- package/dist/ui.cjs +98 -43
- package/dist/ui.d.cts +7 -1
- package/dist/ui.d.ts +7 -1
- package/dist/ui.js +10 -10
- package/dist/widgets.cjs +13 -21
- package/dist/widgets.d.cts +8 -0
- package/dist/widgets.d.ts +8 -0
- package/dist/widgets.js +9 -9
- package/package.json +5 -2
package/dist/build.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-HZEBO22J.js";
|
|
4
|
+
import "./chunk-P3DHXBR6.js";
|
|
5
|
+
import "./chunk-NIOYEGBQ.js";
|
|
6
|
+
import "./chunk-BMYYZWHX.js";
|
|
7
7
|
import "./chunk-CCSJMTRN.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-FOWBJZDL.js";
|
|
9
|
+
import "./chunk-6ZGI3RBE.js";
|
|
10
|
+
import "./chunk-HJEPKZ2O.js";
|
|
11
|
+
import "./chunk-2LOYNGBY.js";
|
|
12
|
+
import "./chunk-IXKSNWV5.js";
|
|
13
13
|
import "./chunk-7ZHH77QA.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-7VEC3UD2.js";
|
|
15
|
+
import "./chunk-5DXA2J44.js";
|
|
16
|
+
import "./chunk-QKRPLZ2V.js";
|
|
17
|
+
import "./chunk-HECVW343.js";
|
|
18
|
+
import "./chunk-7ALC7KGE.js";
|
|
19
|
+
import "./chunk-2WLZ6757.js";
|
|
20
20
|
|
|
21
21
|
// src/build/compileTemplates.ts
|
|
22
22
|
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"use strict";var Sibu=(()=>{var it=Object.defineProperty;var Fs=Object.getOwnPropertyDescriptor;var zs=Object.getOwnPropertyNames;var Vs=Object.prototype.hasOwnProperty;var st=(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 pn=(e,n)=>{for(var t in n)it(e,t,{get:n[t],enumerable:!0})},qs=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of zs(n))!Vs.call(e,o)&&o!==t&&it(e,o,{get:()=>n[o],enumerable:!(r=Fs(n,o))||r.enumerable});return e};var Ws=e=>qs(it({},"__esModule",{value:!0}),e);var Ec={};pn(Ec,{DynamicComponent:()=>Zi,ErrorBoundary:()=>$i,ErrorDisplay:()=>tt,Fragment:()=>ts,KeepAlive:()=>os,Loading:()=>Oi,MAX_DRAIN_TEARDOWNS:()=>Ce,Portal:()=>ss,SVG_NS:()=>N,Suspense:()=>Ct,__resetIdCounter:()=>Wi,a:()=>Tr,abbr:()=>Er,action:()=>Pi,address:()=>sr,area:()=>Jr,array:()=>cs,article:()=>er,aside:()=>ir,asyncDerived:()=>ls,audio:()=>Gr,autoResize:()=>Gt,b:()=>wr,base:()=>Wo,batch:()=>F,bdi:()=>kr,bdo:()=>_r,bindDynamic:()=>Tt,blockquote:()=>fr,body:()=>Zn,br:()=>Ar,button:()=>Ee,canvas:()=>uo,caption:()=>go,catchError:()=>Bi,catchErrorAsync:()=>Fi,center:()=>pi,checkLeaks:()=>gn,circle:()=>Uo,cite:()=>Cr,clickOutside:()=>Kt,clipPath:()=>oi,code:()=>Qe,col:()=>bo,colgroup:()=>ho,context:()=>Vi,copyOnClick:()=>Jt,createId:()=>qi,customElement:()=>bi,data:()=>Nr,datalist:()=>ko,dd:()=>pr,deepEqual:()=>_e,deepSignal:()=>ds,defer:()=>Ns,defs:()=>ri,del:()=>po,derived:()=>nt,details:()=>Po,dfn:()=>Lr,dialog:()=>Bo,disableSSR:()=>It,dispose:()=>H,div:()=>k,dl:()=>mr,dt:()=>gr,each:()=>Qi,effect:()=>V,ellipse:()=>Jo,em:()=>Rr,embed:()=>eo,enableSSR:()=>Ot,enhance:()=>Pe,enhanceAll:()=>Ss,enqueueBatchedSignal:()=>ae,external:()=>Ci,fieldset:()=>_o,figcaption:()=>br,figure:()=>hr,font:()=>mi,footer:()=>nr,form:()=>Ao,g:()=>Go,getAction:()=>jt,getRequestScopedCache:()=>Dt,getRuntimeErrorHandler:()=>ut,getSSRStore:()=>se,getSlot:()=>as,h1:()=>ar,h2:()=>cr,h3:()=>Ze,h4:()=>ur,h5:()=>lr,h6:()=>dr,head:()=>Yn,header:()=>tr,hr:()=>yr,html:()=>nn,i:()=>Mr,iframe:()=>to,img:()=>Yr,input:()=>Co,ins:()=>mo,isBatching:()=>Ai,isSSR:()=>W,kbd:()=>Hr,label:()=>No,lazy:()=>At,lazyIsland:()=>ws,legend:()=>Lo,li:()=>vr,line:()=>Yo,linearGradient:()=>ai,link:()=>jo,longPress:()=>Ut,main:()=>or,map:()=>Zr,mark:()=>$r,marker:()=>fi,marquee:()=>gi,mask:()=>ii,match:()=>Ji,math:()=>co,menu:()=>Fo,meta:()=>Ko,meter:()=>Ro,mount:()=>is,mountIslands:()=>As,nav:()=>rr,nextTick:()=>Rs,noscript:()=>lo,object:()=>no,ol:()=>xr,on:()=>ki,onCleanup:()=>xi,onMount:()=>$e,onUnmount:()=>vi,optgroup:()=>Mo,option:()=>Ho,output:()=>$o,p:()=>Ye,param:()=>ro,path:()=>Zo,pattern:()=>si,picture:()=>oo,polygon:()=>Xo,polyline:()=>Qo,portal:()=>io,pre:()=>Xe,progress:()=>Do,q:()=>Dr,radialGradient:()=>ci,reactiveArray:()=>us,rect:()=>ei,ref:()=>fs,registerAction:()=>me,registerComponent:()=>Gi,registerDisposer:()=>S,registerIsland:()=>ks,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>Ne,reportError:()=>_,resolveComponent:()=>en,retrack:()=>X,rp:()=>Or,rt:()=>Ir,ruby:()=>Pr,runInSSRContext:()=>Pt,s:()=>Br,samp:()=>Fr,script:()=>fo,section:()=>Qn,select:()=>Oo,setGlobalErrorHandler:()=>zi,setMaxDrainIterations:()=>St,setRuntimeErrorHandler:()=>ct,show:()=>ji,signal:()=>C,slot:()=>Vo,small:()=>zr,source:()=>so,span:()=>$,stop:()=>ui,store:()=>ps,strict:()=>bs,strictEffect:()=>hs,strong:()=>Vr,style:()=>ie,sub:()=>qr,summary:()=>zo,sup:()=>Wr,svg:()=>ao,symbol:()=>di,table:()=>yo,tagFactory:()=>l,takePendingError:()=>He,tbody:()=>vo,td:()=>xo,template:()=>qo,text:()=>ti,textarea:()=>Io,tfoot:()=>So,th:()=>To,thead:()=>Eo,time:()=>jr,title:()=>Xn,tr:()=>wo,track:()=>Xr,transition:()=>Ls,trapFocus:()=>Yt,trustHTML:()=>sn,tspan:()=>ni,u:()=>Kr,ul:()=>Sr,unregisterComponent:()=>Yi,unregisterDisposer:()=>Ve,unregisterIsland:()=>_s,untracked:()=>ve,use:()=>li,var_:()=>Ur,video:()=>Qr,watch:()=>ms,when:()=>Ui,withSSR:()=>Bt,writable:()=>gs});var an={};pn(an,{DynamicComponent:()=>Zi,ErrorBoundary:()=>$i,ErrorDisplay:()=>tt,Fragment:()=>ts,KeepAlive:()=>os,Loading:()=>Oi,MAX_DRAIN_TEARDOWNS:()=>Ce,Portal:()=>ss,SVG_NS:()=>N,Suspense:()=>Ct,__resetIdCounter:()=>Wi,a:()=>Tr,abbr:()=>Er,action:()=>Pi,address:()=>sr,area:()=>Jr,array:()=>cs,article:()=>er,aside:()=>ir,asyncDerived:()=>ls,audio:()=>Gr,autoResize:()=>Gt,b:()=>wr,base:()=>Wo,batch:()=>F,bdi:()=>kr,bdo:()=>_r,bindDynamic:()=>Tt,blockquote:()=>fr,body:()=>Zn,br:()=>Ar,button:()=>Ee,canvas:()=>uo,caption:()=>go,catchError:()=>Bi,catchErrorAsync:()=>Fi,center:()=>pi,checkLeaks:()=>gn,circle:()=>Uo,cite:()=>Cr,clickOutside:()=>Kt,clipPath:()=>oi,code:()=>Qe,col:()=>bo,colgroup:()=>ho,context:()=>Vi,copyOnClick:()=>Jt,createId:()=>qi,customElement:()=>bi,data:()=>Nr,datalist:()=>ko,dd:()=>pr,deepEqual:()=>_e,deepSignal:()=>ds,defer:()=>Ns,defs:()=>ri,del:()=>po,derived:()=>nt,details:()=>Po,dfn:()=>Lr,dialog:()=>Bo,disableSSR:()=>It,dispose:()=>H,div:()=>k,dl:()=>mr,dt:()=>gr,each:()=>Qi,effect:()=>V,ellipse:()=>Jo,em:()=>Rr,embed:()=>eo,enableSSR:()=>Ot,enhance:()=>Pe,enhanceAll:()=>Ss,enqueueBatchedSignal:()=>ae,external:()=>Ci,fieldset:()=>_o,figcaption:()=>br,figure:()=>hr,font:()=>mi,footer:()=>nr,form:()=>Ao,g:()=>Go,getAction:()=>jt,getRequestScopedCache:()=>Dt,getRuntimeErrorHandler:()=>ut,getSSRStore:()=>se,getSlot:()=>as,h1:()=>ar,h2:()=>cr,h3:()=>Ze,h4:()=>ur,h5:()=>lr,h6:()=>dr,head:()=>Yn,header:()=>tr,hr:()=>yr,html:()=>nn,i:()=>Mr,iframe:()=>to,img:()=>Yr,input:()=>Co,ins:()=>mo,isBatching:()=>Ai,isSSR:()=>W,kbd:()=>Hr,label:()=>No,lazy:()=>At,lazyIsland:()=>ws,legend:()=>Lo,li:()=>vr,line:()=>Yo,linearGradient:()=>ai,link:()=>jo,longPress:()=>Ut,main:()=>or,map:()=>Zr,mark:()=>$r,marker:()=>fi,marquee:()=>gi,mask:()=>ii,match:()=>Ji,math:()=>co,menu:()=>Fo,meta:()=>Ko,meter:()=>Ro,mount:()=>is,mountIslands:()=>As,nav:()=>rr,nextTick:()=>Rs,noscript:()=>lo,object:()=>no,ol:()=>xr,on:()=>ki,onCleanup:()=>xi,onMount:()=>$e,onUnmount:()=>vi,optgroup:()=>Mo,option:()=>Ho,output:()=>$o,p:()=>Ye,param:()=>ro,path:()=>Zo,pattern:()=>si,picture:()=>oo,polygon:()=>Xo,polyline:()=>Qo,portal:()=>io,pre:()=>Xe,progress:()=>Do,q:()=>Dr,radialGradient:()=>ci,reactiveArray:()=>us,rect:()=>ei,ref:()=>fs,registerAction:()=>me,registerComponent:()=>Gi,registerDisposer:()=>S,registerIsland:()=>ks,replaceChildrenSafely:()=>z,reportDrainRunaway:()=>Ne,reportError:()=>_,resolveComponent:()=>en,retrack:()=>X,rp:()=>Or,rt:()=>Ir,ruby:()=>Pr,runInSSRContext:()=>Pt,s:()=>Br,samp:()=>Fr,script:()=>fo,section:()=>Qn,select:()=>Oo,setGlobalErrorHandler:()=>zi,setMaxDrainIterations:()=>St,setRuntimeErrorHandler:()=>ct,show:()=>ji,signal:()=>C,slot:()=>Vo,small:()=>zr,source:()=>so,span:()=>$,stop:()=>ui,store:()=>ps,strict:()=>bs,strictEffect:()=>hs,strong:()=>Vr,style:()=>ie,sub:()=>qr,summary:()=>zo,sup:()=>Wr,svg:()=>ao,symbol:()=>di,table:()=>yo,tagFactory:()=>l,takePendingError:()=>He,tbody:()=>vo,td:()=>xo,template:()=>qo,text:()=>ti,textarea:()=>Io,tfoot:()=>So,th:()=>To,thead:()=>Eo,time:()=>jr,title:()=>Xn,tr:()=>wo,track:()=>Xr,transition:()=>Ls,trapFocus:()=>Yt,trustHTML:()=>sn,tspan:()=>ni,u:()=>Kr,ul:()=>Sr,unregisterComponent:()=>Yi,unregisterDisposer:()=>Ve,unregisterIsland:()=>_s,untracked:()=>ve,use:()=>li,var_:()=>Ur,video:()=>Qr,watch:()=>ms,when:()=>Ui,withSSR:()=>Bt,writable:()=>gs});var mn=Symbol.for("sibujs.runtime-errors.v1");function at(){let e=globalThis,n=e[mn];if(n)return n;let t={handler:null,handlerDepth:0};return e[mn]=t,t}function ct(e){let n=at(),t=n.handler;return n.handler=e,t}function ut(){return at().handler}function lt(e){if(e instanceof Error)return e;let n=typeof e=="string"?e:`Non-Error value thrown: ${js(e)}`;return new Error(n,{cause:e})}function js(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 Ks(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Us=Symbol.for("sibujs.reactive.v1");function Js(e){let n=globalThis[Us];return n?.untracked?n.untracked(e):e()}var Gs="sibu:error-propagate";function Ys(e,n){let t=n.node;if(!t||typeof CustomEvent>"u")return!1;let r=Zs(t);if(!r)return!1;try{let o=new CustomEvent(Gs,{bubbles:!0,cancelable:!0,detail:{error:e,context:n}});return r.dispatchEvent(o)===!1}catch{return!1}}function Zs(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 Xs(e,n){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Ks(n)}: ${e.message}`,e)}function _(e,n){let t=lt(e);Js(()=>{if(Ys(t,n))return;let r=at(),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 s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}Xs(t,n)})}function G(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function R(e,n){if(!e)throw new Error(`[SibuJS] ${n}`)}function ne(e){{let n=e();n&&console.warn(`[SibuJS] ${n}`)}}function M(e){console.warn(`[SibuJS] ${e}`)}var Z=new WeakMap,Ce=1e4;function Ne(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 ue=0;function S(e,n){let t=Z.get(e);t||(t=[],Z.set(e,t)),t.push(n),ue++}function Ve(e,n){let t=Z.get(e);if(!t)return;let r=t.indexOf(n);r!==-1&&(t.splice(r,1),ue--,t.length===0&&Z.delete(e))}function H(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--){let o=t[r];if(Z.has(o)){let i=0,s=!1;for(;!s;){let a=Z.get(o);if(!a||a.length===0)break;let c=a.slice();Z.delete(o),ue-=c.length;for(let d=0;d<c.length;d++){if(i>=Ce){let u=c.slice(d),f=Z.get(o);Z.set(o,f?u.concat(f):u),ue+=u.length,Ne("dispose",i,u.length+(f?.length??0)),s=!0;break}i++;try{c[d]()}catch(u){_(u,{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++)H(t[r]);e.replaceChildren(...n)}function gn(e=0){return e>0&&ue>e&&M(`checkLeaks: ${ue} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),ue}function Qs(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}function he(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 ea=["http:","https:","mailto:","tel:","ftp:"],ta=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function xn(e){let n=Qs(e).trim();if(!n)return"";let t=e.replace(ta,""),r=n.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return t;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&ea.indexOf(i)===-1?"":t}var na=/^\s+\d+(\.\d+)?[wx]$/;function ra(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&&!na.test(i[2]))continue;let s=xn(i[1]);s&&t.push(i[2]?`${s}${i[2]}`:s)}return t.join(", ")}var oa=/[(:@\\]/;function ia(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function bn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function sa(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
|
+
`||o==="\f"){t+=1;continue}if(o==="\r"){t+=e[t+2]===`
|
|
4
|
+
`?2:1;continue}if(bn(o)){let i="",s=t+1;for(;s<e.length&&i.length<6&&bn(e[s]);)i+=e[s],s++;s<e.length&&ia(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
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 hn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function aa(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 dt=new Set,yn=100,vn=!1;function Sn(e,n,t){ne(()=>{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=aa(t?.element),s=`${i}|${o}`;return dt.has(s)?"":dt.size>=yn?vn?"":(vn=!0,`${yn} 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.`):(dt.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 ft(e){if(!oa.test(e))return-1;let t=(e.includes("\\")?sa(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<hn.length;r++)if(t.includes(hn[r]))return r;return-1}function qe(e,n){let t=ft(e);return t===-1?e:(Sn(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=ft(a);if(c===-1&&(c=ft(`${s}:${a}`)),c!==-1){Sn(a,c,{property:s,element:n?.element});continue}let d=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${d?` !${d}`:""}`)}return o.join("; ")}var ca=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),ua=new Set(["srcdoc"]);function Tn(e){return ua.has(e.toLowerCase())}function En(e,n,t){let r=e.toLowerCase();return r==="srcset"?ra(n):ca.has(r)?xn(n):r==="style"?We(n,t):n}var la="http://www.w3.org/1999/xhtml",da="http://www.w3.org/2000/svg",fa="http://www.w3.org/1999/xlink",pa="http://www.w3.org/XML/1998/namespace",ma=new Set(["checked","disabled","selected"]);function ga(e){return e.namespaceURI===null||e.namespaceURI===la}function wn(e,n,t){e[n]=t}function ba(e,n){if(e.namespaceURI!==da)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?fa:t.startsWith("xml:")?pa:null}function j(e,n,t,r={}){let o=ba(e,n),i=o?n.slice(n.indexOf(":")+1):n;if(he(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=ga(e),a=s?n.toLowerCase():n;if(typeof t=="boolean")return s&&ma.has(a)&&a in e?wn(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 wn(e,a,a==="checked"?!!t:c),!0;let d=En(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===d||(o?e.setAttributeNS(o,n,d):e.setAttribute(n,d)),!0}var ha=4096,pt=[];function ya(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function va(e,n,t){let r=pt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=ya();return o.sig=e,o.sub=n,o.epoch=t,o}function kn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,pt.length<ha&&pt.push(e)}function xa(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 _n(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 Sa(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function Ta(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,mt=null,re=0,oe=[],K=new Set,Ea=[];function wa(e){try{e()}catch(n){let t=e;_(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function ka(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 je=0,bt=!1;function ht(){je===0&&(mt=U,U=null,bt=!0),je++}function yt(){je--,je===0&&(U=mt,mt=null,bt=!1)}function An(){return bt}function Cn(e){ht();try{return e()}finally{yt()}}var _a=0;function vt(e,n){let t=U;U=n;let r=n,o=++_a;r._epoch=o,r._structDirty=!1;for(let i=r.depsHead??null;i!==null;i=i.subNext){let s=i.sig;i.prevActive=s.__activeNode??null,s.__activeNode=i}try{e()}finally{U=t;let i=r.depsHead??null;for(;i!==null;){let s=i.subNext,a=i.sig;a.__activeNode=i.prevActive,i.prevActive=null,i.epoch!==o&&(Ta(i),_n(i),kn(i)),i=s}}}function Nn(e,n){if(!n)return xt(e);ye(n);let t=U;U=n;try{e()}finally{U=t;let o=n;for(let i=o.depsHead??null;i!==null;i=i.subNext){let s=i.sig;s.__activeNode=i.prevActive,i.prevActive=null}}let r=n;return r._dispose??(r._dispose=()=>ye(n))}function xt(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{vt(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,ye(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,ye(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=va(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,Sa(n,i),xa(t,i),n._structDirty=!0}function ye(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;_n(t),kn(t),t=r}}var Ke=1e3,Ue=1e6,Je=0,le=new Set;function Rn(e){let n=Ke;return Number.isFinite(e)&&e>0&&(Ke=Math.floor(e)),n}function Mn(e){let n=Ue;return Number.isFinite(e)&&e>0&&(Ue=Math.floor(e)),n}function Aa(e){let n=e;return n._runEpoch!==Je?(n._runEpoch=Je,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>Ke)}function Ca(e){let n=e.__name??"<unnamed>";_(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 Na(){_(new Error(`Notification drain exceeded ${Ue} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Hn(){let e=0;for(;e<oe.length;){if(e>=Ue){Na();break}let n=oe[e++];if(K.delete(n),!(le.size>0&&le.has(n))&&!(n._hasComputedDep===!0&&!ka(n))){if(Aa(n)){Ca(n),le.add(n);continue}wa(n)}}}function $n(){if(!(re>0)){re++,Je++;try{Hn()}finally{re--,re===0&&(oe.length=0,K.clear(),le.size>0&&le.clear())}}}function gt(e){e();let n=e._sig;if(!n)return;let t=Ea,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._d=!0,t.push(a)):s()}else K.has(s)||(K.add(s),oe.push(s));i=i.sigNext}}}function Dn(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?gt(r):K.has(r)||(K.add(r),oe.push(r))),t=t.sigNext}}function On(e){let t=e.subsHead;if(t){if(re>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?gt(o):K.has(o)||(K.add(o),oe.push(o))),r=r.sigNext}return}re++,Je++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?gt(o):K.has(o)||(K.add(o),oe.push(o))),r=r.sigNext}Hn()}finally{re--,re===0&&(oe.length=0,K.clear(),le.size>0&&le.clear())}}}function In(e){return e.__sc??0}function Pn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function Bn(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var Fn="4.2.0",zn=Symbol.for("sibujs.reactive.v1");function Ra(){let e=globalThis,n=e[zn];if(n)return!n.__dupWarned&&(n.__dupWarned=!0,M(`Multiple instances of the reactive runtime detected on this page (active: ${n.version}, duplicate: ${Fn}). 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:ht,resumeTracking:yt,isTrackingSuspended:An,untracked:Cn,retrack:vt,track:Nn,reactiveBinding:xt,recordDependency:Ln,cleanup:ye,setMaxSubscriberRepeats:Rn,setMaxDrainIterations:Mn,drainNotificationQueue:$n,queueSignalNotification:Dn,notifySubscribers:On,getSubscriberCount:In,getSubscriberDeps:Pn,forEachSubscriber:Bn,version:Fn};return e[zn]=t,t}var O=Ra(),Le=O.suspendTracking,Re=O.resumeTracking,Vn=O.isTrackingSuspended,ve=O.untracked,X=O.retrack,I=O.track,q=O.reactiveBinding,xe=O.recordDependency,qn=O.cleanup,Pc=O.setMaxSubscriberRepeats,St=O.setMaxDrainIterations,Wn=O.drainNotificationQueue,jn=O.queueSignalNotification,Se=O.notifySubscribers,Bc=O.getSubscriberCount,Fc=O.getSubscriberDeps,zc=O.forEachSubscriber;function Ge(e,n,t){if(he(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 q(r,e)}function Tt(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=q(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Et=["data-focus-key","id","name"],Ma=new Set(["text","search","url","tel","password",""]);function Ha(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&Ma.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<Et.length;i++){let s=n.getAttribute(Et[i]);if(s){r=Et[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...Ha(n)}}function $a(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Da(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 Kn(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 Te(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){Kn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Da(n,`[${e.attr}=${$a(e.value)}]`);if(i&&i.tagName===e.tag){Kn(i,e);return}o=s>1}ne(()=>{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 de(e,n){let t=[];function r(){let o;try{o=n()}catch(u){_(u,{phase:"binding",name:"bindChildNode",node:e});return}let i=Me(t);if(o==null||typeof o=="boolean"){for(let u=0;u<t.length;u++){let f=t[u];H(f),f.parentNode&&f.parentNode.removeChild(f)}t.length=0,Te(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let u=new Set;for(let f=0;f<o.length;f++){let g=o[f];if(g==null||typeof g=="boolean")continue;let p=g instanceof Node?g:document.createTextNode(String(g));if(u.has(p)){M("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}u.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 u=new Set(t);c=new Set;for(let f=0;f<a.length;f++)u.has(a[f])&&c.add(a[f])}for(let u=0;u<t.length;u++){let f=t[u];c?.has(f)||(H(f),f.parentNode&&f.parentNode.removeChild(f))}let d=e;for(let u=0;u<a.length;u++){let f=a[u];d.nextSibling!==f&&s.insertBefore(f,d.nextSibling),d=f}t=a,Te(i,a,"bindChildNode")}return q(r,e)}var N="http://www.w3.org/2000/svg",Oa=new Set(["script","iframe","object","embed","frame","frameset"]);function Ia(e){return Oa.has(e.toLowerCase())}var Pa=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var wt=new Set,Un=100,Jn=!1,Gn=new Map;function Ba(e){let n=Gn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Gn.set(e,n)),n}function Fa(e,n){if(typeof n=="function"){let r=q(()=>{e.setAttribute("style",We(String(n()),{element:e}))},e);S(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=Ba(r);if(typeof o=="function"){let s=o,a=q(()=>{t.style.setProperty(i,qe(String(s()),{property:i,element:e}))},e);S(e,a)}else t.style.setProperty(i,qe(String(o),{property:i,element:e}))}}function za(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=q(()=>{e.setAttribute("class",n())},e);S(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=q(()=>{let a="";for(let c in t){let d=t[c];(typeof d=="function"?d():d)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);S(e,s)}else e.setAttribute("class",o)}function kt(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),S(e,de(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),S(e,de(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),S(e,de(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 l=(e,n)=>{let t=Ia(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),kt(i,o),i):(ne(()=>{let p=r.trim().split(/\s+/);if(p.length<2)return"";let m=0;for(let x=0;x<p.length;x++){let h=p[x];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(h))return"";/[-:/0-9]/.test(h)&&m++}if(m<2)return"";let b=`${e}|${r}`;return wt.has(b)?"":wt.size>=Un?Jn?"":(Jn=!0,`tagFactory: ${Un} 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.`):(wt.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 kt(i,r),i;let s=r,a=s.class;a!=null&&za(i,a);let c=s.id;c!=null&&(typeof c=="string"&&Pa.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 d=o!==void 0?o:s.nodes;d!=null&&kt(i,d);let u=s.on;if(u)for(let p in u){let m=u[p];typeof m=="function"?i.addEventListener(p,m):M(`tagFactory: on.${p} handler is not a function (got ${typeof m}). Event listener was not attached.`)}let f=s.style;f!=null&&Fa(i,f);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 m=s[p];if(m==null||he(p))continue;typeof m=="function"?S(i,Ge(i,p,m)):j(i,p,m,{syncValueProperty:!1,label:"tagFactory"})}}return s.onElement&&typeof s.onElement=="function"&&s.onElement(i),i}};var du=l("html"),Yn=l("head"),Zn=l("body"),Xn=l("title"),k=l("div"),$=l("span"),Qn=l("section"),er=l("article"),tr=l("header"),nr=l("footer"),rr=l("nav"),or=l("main"),ir=l("aside"),sr=l("address"),Ye=l("p"),ar=l("h1"),cr=l("h2"),Ze=l("h3"),ur=l("h4"),lr=l("h5"),dr=l("h6"),fr=l("blockquote"),pr=l("dd"),mr=l("dl"),gr=l("dt"),br=l("figcaption"),hr=l("figure"),yr=l("hr"),vr=l("li"),xr=l("ol"),Sr=l("ul"),Xe=l("pre"),Tr=l("a"),Er=l("abbr"),wr=l("b"),kr=l("bdi"),_r=l("bdo"),Ar=l("br"),Cr=l("cite"),Qe=l("code"),Nr=l("data"),Lr=l("dfn"),Rr=l("em"),Mr=l("i"),Hr=l("kbd"),$r=l("mark"),Dr=l("q"),Or=l("rp"),Ir=l("rt"),Pr=l("ruby"),Br=l("s"),Fr=l("samp"),zr=l("small"),Vr=l("strong"),qr=l("sub"),Wr=l("sup"),jr=l("time"),Kr=l("u"),Ur=l("var"),Jr=l("area"),Gr=l("audio"),Yr=l("img"),Zr=l("map"),Xr=l("track"),Qr=l("video"),eo=l("embed"),to=l("iframe"),no=l("object"),ro=l("param"),oo=l("picture"),io=l("portal"),so=l("source"),ao=l("svg",N),co=l("math"),uo=l("canvas"),lo=l("noscript"),fo=l("script"),po=l("del"),mo=l("ins"),go=l("caption"),bo=l("col"),ho=l("colgroup"),yo=l("table"),vo=l("tbody"),xo=l("td"),So=l("tfoot"),To=l("th"),Eo=l("thead"),wo=l("tr"),Ee=l("button"),ko=l("datalist"),_o=l("fieldset"),Ao=l("form"),Co=l("input"),No=l("label"),Lo=l("legend"),Ro=l("meter"),Mo=l("optgroup"),Ho=l("option"),$o=l("output"),Do=l("progress"),Oo=l("select"),Io=l("textarea"),Po=l("details"),Bo=l("dialog"),Fo=l("menu"),zo=l("summary"),Vo=l("slot"),qo=l("template"),Wo=l("base"),jo=l("link"),Ko=l("meta"),ie=l("style"),Uo=l("circle",N),Jo=l("ellipse",N),Go=l("g",N),Yo=l("line",N),Zo=l("path",N),Xo=l("polygon",N),Qo=l("polyline",N),ei=l("rect",N),ti=l("text",N),ni=l("tspan",N),ri=l("defs",N),oi=l("clipPath",N),ii=l("mask",N),si=l("pattern",N),ai=l("linearGradient",N),ci=l("radialGradient",N),ui=l("stop",N),li=l("use",N),di=l("symbol",N),fi=l("marker",N),pi=l("center"),mi=l("font"),gi=l("marquee"),bi=e=>l(e);var _t="__sibuPendingError";function hi(e,n){let t=()=>e.parentNode?(_(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[_t]=n)})}function He(e){let n=e,t=n[_t];if(t instanceof Error)return delete n[_t],t}function At(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}`)),hi(r,s)}),r.appendChild($("sibu-lazy-loading","Loading...")),S(r,()=>{o=!0}),r}}function Ct({nodes:e,fallback:n}){let t=k({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return S(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));hi(t,c)}}),t}function Mt(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";_(t,{phase:r,name:n});return}}function Nt(e,n,t){let r=Mt(e,n);typeof r=="function"&&t&&S(t,r)}var we=new WeakMap,fe=new WeakMap,Q=new Set,ee=new Set,ke=null,et=0,Va=256;function Lt(e){let n=we.get(e);if(n){we.delete(e),Q.delete(e);for(let t of n)try{t()}catch{}}}function Rt(e){fe.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=fe.get(e);if(t){fe.delete(e),ee.delete(e);for(let r of t)try{r()}catch{}}})}function qa(e){if(Q.size===0||e.nodeType!==1)return;let n=e;if(Q.has(n)&&n.isConnected&&Lt(n),n.firstElementChild)for(let t of Array.from(Q))t!==n&&t.isConnected&&n.contains(t)&&Lt(t)}function Wa(e){if(ee.size===0||e.nodeType!==1)return;let n=e;if(ee.has(n)&&!n.isConnected&&Rt(n),n.firstElementChild)for(let t of Array.from(ee))t!==n&&!t.isConnected&&n.contains(t)&&Rt(t)}function ja(){if(Q.size>0)for(let e of Array.from(Q))e.isConnected&&Lt(e);if(ee.size>0)for(let e of Array.from(ee))e.isConnected||Rt(e)}function yi(){ke||typeof document>"u"||(ke=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++)qa(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)Wa(n.removedNodes[t])}et+=e.length,et>=Va&&(et=0,ja()),Ht()}),ke.observe(document.body,{childList:!0,subtree:!0}))}function Ht(){ke&&Q.size===0&&ee.size===0&&(ke.disconnect(),ke=null,et=0)}function Ka(e,n){let t=we.get(e);return t||(t=[],we.set(e,t)),t.push(n),Q.add(e),yi(),()=>{let r=we.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(we.delete(e),Q.delete(e))}Ht()}}function Ua(e,n){let t=fe.get(e);return t||(t=[],fe.set(e,t)),t.push(n),ee.add(e),yi(),()=>{let r=fe.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(fe.delete(e),ee.delete(e))}Ht()}}function $e(e,n){if(!(typeof document>"u"))if(n){let t=!1;if(S(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||Nt(e,"onMount",n)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){Nt(e,"onMount",n);return}let r=Ka(n,()=>{t||Nt(e,"onMount",n)});S(n,r)})}else queueMicrotask(()=>{Mt(e,"onMount")})}function vi(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,Mt(e,"onUnmount"))};S(n,r);let o=()=>{if(t)return;let i=Ua(n,r);S(n,i)};n.isConnected?o():$e(()=>{o()},n)}function xi(e,n){S(n,e)}var $t=Symbol.for("sibujs.ssr.v1");function Ja(){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 st=="function"&&(n=st("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var pe=globalThis[$t]??(globalThis[$t]=Ja()),De=pe.als,Y=pe.fallbackStore;pe.fallbackDepth??(pe.fallbackDepth=0);var Si=!1;function Ga(){if(Si||De||!(typeof process<"u"&&!!process.versions?.node))return;Si=!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 se(){if(De){let e=De.getStore();if(e)return e}return Y}function W(){return se().ssr}function Dt(e){if(!W())return null;let n=se(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function Ot(){se().ssr=!0}function It(){se().ssr=!1}function Pt(e){let n={ssr:!0,suspenseIdCounter:0,locale:void 0};if(De)return De.run(n,e);Ga();let t=Y.ssr,r=Y.suspenseIdCounter,o=Y.locale;Y.ssr=!0,Y.suspenseIdCounter=0,Y.locale=void 0,pe.fallbackDepth++;try{return e()}finally{pe.fallbackDepth--,Y.ssr=t,Y.suspenseIdCounter=r,Y.locale=o}}function Bt(e){let n=se(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var wi=globalThis;function ki(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,ve(()=>n(o,void 0));else{let i=t;t=o,ve(()=>n(o,i))}}}var Ti=100;function Ft(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 Ei(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&&Ft(e),X(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=Ti);e.rerunPending&&(e.rerunPending=!1,_(new Error(`effect re-requested itself ${Ti}+ 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=wi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Ft(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{qn(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function V(e,n){if(R(typeof e=="function","effect: argument must be a function."),W())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&&Ft(t),X(t.bodyFn,o),t.rerunPending&&Ei(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{X(t.bodyFn,t.subscriber),t.rerunPending&&Ei(t)}finally{t.running=!1,t.rerunPending=!1}let i=wi.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("effect:create",{effectFn:e}),()=>Ya(t)}var Oe=0,zt=new Set;function Za(e){Oe++;try{return e()}finally{Oe--,Oe===0&&ec()}}function Xa(e){return Oe===0?!1:(zt.add(e),!0)}function Qa(){return Oe>0}function ec(){try{for(let e of zt)jn(e)}finally{zt.clear()}Wn()}var _i=Symbol.for("sibujs.reactive.batch.v1");function tc(){let e=globalThis,n=e[_i];if(n)return n;let t={batch:Za,enqueueBatchedSignal:Xa,isBatching:Qa};return e[_i]=t,t}var Vt=tc(),F=Vt.batch,ae=Vt.enqueueBatchedSignal,Ai=Vt.isBatching;var qt=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 xe(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,d=typeof a=="function"?a(c):a;if(!o(c,d)){if(t.value=d,t.__v++,!0){let u=qt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:d})}ae(t)||Se(t)}}:s=a=>{let c=t.value,d=typeof a=="function"?a(c):a;if(Object.is(d,c))return;t.value=d,t.__v++;let u=qt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:t,name:r,oldValue:c,newValue:d}),ae(t)||Se(t)},!0){let a=qt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function Ci(e){let[n,t]=C(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var nc=`
|
|
6
|
+
.sibu-error-display {
|
|
7
|
+
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
8
|
+
border-radius: 10px;
|
|
9
|
+
margin: 12px 0;
|
|
10
|
+
background: #0f0f1a;
|
|
11
|
+
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
|
|
12
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
13
|
+
color: #e5e7eb;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
}
|
|
16
|
+
.sibu-error-display[data-severity="warning"] { --sibu-err-border: #d97706; --sibu-err-accent: #d97706; }
|
|
17
|
+
.sibu-error-display[data-severity="info"] { --sibu-err-border: #3b82f6; --sibu-err-accent: #3b82f6; }
|
|
18
|
+
.sibu-error-display { --sibu-err-accent: #e5484d; }
|
|
19
|
+
|
|
20
|
+
.sibu-error-display .sibu-err-header {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 10px;
|
|
24
|
+
padding: 12px 18px;
|
|
25
|
+
background: var(--sibu-err-accent);
|
|
26
|
+
color: white;
|
|
27
|
+
user-select: none;
|
|
28
|
+
}
|
|
29
|
+
.sibu-error-display .sibu-err-icon {
|
|
30
|
+
font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
font-size: 1.05em;
|
|
33
|
+
padding: 2px 8px;
|
|
34
|
+
background: rgba(0, 0, 0, 0.22);
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
letter-spacing: 0.02em;
|
|
37
|
+
}
|
|
38
|
+
.sibu-error-display .sibu-err-title {
|
|
39
|
+
margin: 0;
|
|
40
|
+
font-size: 0.98em;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
flex: 1;
|
|
43
|
+
text-overflow: ellipsis;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
white-space: nowrap;
|
|
46
|
+
}
|
|
47
|
+
.sibu-error-display .sibu-err-timestamp {
|
|
48
|
+
font-size: 0.75em;
|
|
49
|
+
opacity: 0.85;
|
|
50
|
+
font-family: 'SF Mono', 'JetBrains Mono', monospace;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.sibu-error-display .sibu-err-body {
|
|
54
|
+
padding: 16px 18px;
|
|
55
|
+
}
|
|
56
|
+
.sibu-error-display .sibu-err-message {
|
|
57
|
+
font-family: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;
|
|
58
|
+
margin: 0 0 14px;
|
|
59
|
+
color: #fecaca;
|
|
60
|
+
word-break: break-word;
|
|
61
|
+
font-size: 0.9em;
|
|
62
|
+
line-height: 1.55;
|
|
63
|
+
padding: 10px 12px;
|
|
64
|
+
background: rgba(229, 72, 77, 0.08);
|
|
65
|
+
border-left: 3px solid var(--sibu-err-accent);
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.sibu-error-display .sibu-err-section {
|
|
70
|
+
margin-top: 14px;
|
|
71
|
+
border-radius: 6px;
|
|
72
|
+
border: 1px solid #2a2a3e;
|
|
73
|
+
background: #0a0a14;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
}
|
|
76
|
+
.sibu-error-display .sibu-err-section-head {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: space-between;
|
|
80
|
+
padding: 6px 12px;
|
|
81
|
+
background: #16162a;
|
|
82
|
+
border-bottom: 1px solid #2a2a3e;
|
|
83
|
+
font-size: 0.72em;
|
|
84
|
+
color: #8b8fa3;
|
|
85
|
+
text-transform: uppercase;
|
|
86
|
+
letter-spacing: 0.08em;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
}
|
|
89
|
+
.sibu-error-display .sibu-err-copy-btn {
|
|
90
|
+
background: rgba(0, 0, 0, 0.22);
|
|
91
|
+
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
92
|
+
border-radius: 4px;
|
|
93
|
+
color: rgba(255, 255, 255, 0.85);
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
padding: 2px 10px;
|
|
96
|
+
font-size: 0.78em;
|
|
97
|
+
font-family: inherit;
|
|
98
|
+
transition: all 0.12s ease;
|
|
99
|
+
flex-shrink: 0;
|
|
100
|
+
}
|
|
101
|
+
.sibu-error-display .sibu-err-copy-btn:hover {
|
|
102
|
+
background: rgba(0, 0, 0, 0.35);
|
|
103
|
+
color: white;
|
|
104
|
+
border-color: rgba(255, 255, 255, 0.3);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.sibu-error-display .sibu-err-stack {
|
|
108
|
+
margin: 0;
|
|
109
|
+
padding: 10px 12px;
|
|
110
|
+
overflow-x: auto;
|
|
111
|
+
font-family: 'SF Mono', 'JetBrains Mono', monospace;
|
|
112
|
+
font-size: 0.8em;
|
|
113
|
+
line-height: 1.7;
|
|
114
|
+
}
|
|
115
|
+
.sibu-error-display .sibu-err-frame {
|
|
116
|
+
display: flex;
|
|
117
|
+
gap: 10px;
|
|
118
|
+
padding: 1px 0;
|
|
119
|
+
}
|
|
120
|
+
.sibu-error-display .sibu-err-line {
|
|
121
|
+
display: inline-block;
|
|
122
|
+
min-width: 2.2ch;
|
|
123
|
+
color: #4b5066;
|
|
124
|
+
text-align: right;
|
|
125
|
+
user-select: none;
|
|
126
|
+
flex-shrink: 0;
|
|
127
|
+
}
|
|
128
|
+
.sibu-error-display .sibu-err-fn {
|
|
129
|
+
color: #7dd3fc;
|
|
130
|
+
font-weight: 500;
|
|
131
|
+
}
|
|
132
|
+
.sibu-error-display .sibu-err-loc {
|
|
133
|
+
color: #6b7280;
|
|
134
|
+
white-space: nowrap;
|
|
135
|
+
}
|
|
136
|
+
.sibu-error-display .sibu-err-cause-label {
|
|
137
|
+
margin: 12px 0 6px;
|
|
138
|
+
color: #a0a3b8;
|
|
139
|
+
font-size: 0.75em;
|
|
140
|
+
text-transform: uppercase;
|
|
141
|
+
letter-spacing: 0.05em;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.sibu-error-display .sibu-err-meta {
|
|
145
|
+
margin: 0;
|
|
146
|
+
padding: 10px 12px;
|
|
147
|
+
font-family: 'SF Mono', 'JetBrains Mono', monospace;
|
|
148
|
+
font-size: 0.78em;
|
|
149
|
+
color: #a0a3b8;
|
|
150
|
+
display: grid;
|
|
151
|
+
grid-template-columns: minmax(120px, auto) 1fr;
|
|
152
|
+
gap: 4px 16px;
|
|
153
|
+
}
|
|
154
|
+
.sibu-error-display .sibu-err-meta dt { color: #6b7280; }
|
|
155
|
+
.sibu-error-display .sibu-err-meta dd { margin: 0; color: #d1d5db; word-break: break-word; }
|
|
156
|
+
|
|
157
|
+
.sibu-error-display .sibu-err-actions {
|
|
158
|
+
display: flex;
|
|
159
|
+
gap: 8px;
|
|
160
|
+
margin-top: 16px;
|
|
161
|
+
}
|
|
162
|
+
.sibu-error-display .sibu-err-btn {
|
|
163
|
+
display: inline-flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
gap: 6px;
|
|
166
|
+
padding: 8px 18px;
|
|
167
|
+
border: none;
|
|
168
|
+
border-radius: 6px;
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
font-size: 13px;
|
|
171
|
+
font-weight: 500;
|
|
172
|
+
transition: all 0.12s ease;
|
|
173
|
+
font-family: inherit;
|
|
174
|
+
}
|
|
175
|
+
.sibu-error-display .sibu-err-btn-retry {
|
|
176
|
+
background: var(--sibu-err-accent);
|
|
177
|
+
color: white;
|
|
178
|
+
}
|
|
179
|
+
.sibu-error-display .sibu-err-btn-retry:hover { filter: brightness(1.1); }
|
|
180
|
+
.sibu-error-display .sibu-err-btn-reload {
|
|
181
|
+
background: #1f2133;
|
|
182
|
+
color: #d1d5db;
|
|
183
|
+
border: 1px solid #3a3a4e;
|
|
184
|
+
}
|
|
185
|
+
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
186
|
+
`,Ni=!1;function rc(){if(Ni||typeof document>"u")return;let e=ie({nodes:nc});document.head.appendChild(e),Ni=!0}function oc(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 s=o.match(/^(.+?)@(.+)$/);s&&n.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return n}function Li(e){if(e instanceof Error){let n=e.code??e.name??"ERROR",t=e.message||"Unknown error",r=e.stack??"",o=oc(r),i=e.cause,s=i!=null?Li(i):null;return{code:n,message:t,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function ic(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(s=>` ${s}`).join(`
|
|
189
|
+
`);r.push(i)}o=o.cause}if(n&&Object.keys(n).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(n))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
190
|
+
`)}function Ri(e){let n=e.map((t,r)=>k({class:"sibu-err-frame",nodes:[$({class:"sibu-err-line",nodes:String(r+1)}),$({class:"sibu-err-fn",nodes:t.fn}),$({class:"sibu-err-loc",nodes:` \u2014 ${t.loc}`})]}));return Xe({class:"sibu-err-stack",nodes:n})}function Mi(e){return e?[k({class:"sibu-err-cause-label",nodes:"Caused by"}),k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[$({nodes:`[${e.code}] ${e.message}`}),$({nodes:""})]}),e.frames.length>0?Ri(e.frames):k({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Mi(e.cause)]:[]}function sc(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 tt(e){rc();let n=e.severity??"error",t=Li(e.error),r=e.alwaysShowDetails??G(),o=e.title??t.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=C("Copy"),c=Ee({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let p=ic(t,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(p).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),d=k({class:"sibu-err-header",nodes:[Qe({class:"sibu-err-icon",nodes:t.code}),Ze({class:"sibu-err-title",nodes:o}),c,$({class:"sibu-err-timestamp",nodes:i})]}),u=[Ye({class:"sibu-err-message",nodes:t.message})];r&&t.frames.length>0&&u.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[$({nodes:"Stack Trace"})]}),Ri(t.frames)]})),r&&u.push(...Mi(t.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&u.push(k({class:"sibu-err-section",nodes:[k({class:"sibu-err-section-head",nodes:[$({nodes:"Metadata"})]}),sc(e.metadata)]}));let f=[];e.onRetry&&f.push(Ee({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(Ee({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&u.push(k({class:"sibu-err-actions",nodes:f}));let g=k({class:"sibu-err-body",nodes:u});return k({class:"sibu-error-display","data-severity":n,nodes:[d,g]})}var ac=`
|
|
191
|
+
.sibu-error-boundary {
|
|
192
|
+
position: relative;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.sibu-error-fallback {
|
|
196
|
+
border: 1px solid #e5484d;
|
|
197
|
+
border-radius: 8px;
|
|
198
|
+
padding: 0;
|
|
199
|
+
margin: 10px 0;
|
|
200
|
+
background: #1a1a2e;
|
|
201
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
|
|
202
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
203
|
+
color: #e1e1e6;
|
|
204
|
+
overflow: hidden;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.sibu-error-fallback .sibu-error-header {
|
|
208
|
+
display: flex;
|
|
209
|
+
align-items: center;
|
|
210
|
+
gap: 8px;
|
|
211
|
+
padding: 12px 16px;
|
|
212
|
+
background: #e5484d;
|
|
213
|
+
color: white;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.sibu-error-fallback .sibu-error-title {
|
|
217
|
+
margin: 0;
|
|
218
|
+
font-size: 0.95em;
|
|
219
|
+
font-weight: 600;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.sibu-error-fallback .sibu-error-source {
|
|
223
|
+
margin-left: auto;
|
|
224
|
+
font-size: 0.8em;
|
|
225
|
+
opacity: 0.9;
|
|
226
|
+
font-family: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.sibu-error-fallback .sibu-error-body {
|
|
230
|
+
padding: 16px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.sibu-error-fallback .sibu-error-message {
|
|
234
|
+
font-family: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
|
|
235
|
+
margin: 0 0 12px 0;
|
|
236
|
+
color: #f1a9a0;
|
|
237
|
+
word-break: break-word;
|
|
238
|
+
font-size: 0.9em;
|
|
239
|
+
line-height: 1.5;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.sibu-error-fallback .sibu-error-stack-container {
|
|
243
|
+
position: relative;
|
|
244
|
+
margin: 0 0 12px 0;
|
|
245
|
+
border-radius: 6px;
|
|
246
|
+
border: 1px solid #2a2a3e;
|
|
247
|
+
background: #12121f;
|
|
248
|
+
overflow: hidden;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.sibu-error-fallback .sibu-error-stack-label {
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: space-between;
|
|
255
|
+
padding: 6px 12px;
|
|
256
|
+
background: #1e1e32;
|
|
257
|
+
border-bottom: 1px solid #2a2a3e;
|
|
258
|
+
font-size: 0.75em;
|
|
259
|
+
color: #888;
|
|
260
|
+
text-transform: uppercase;
|
|
261
|
+
letter-spacing: 0.05em;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.sibu-error-fallback .sibu-error-copy-btn {
|
|
265
|
+
background: transparent;
|
|
266
|
+
border: 1px solid #3a3a4e;
|
|
267
|
+
border-radius: 4px;
|
|
268
|
+
color: #888;
|
|
269
|
+
cursor: pointer;
|
|
270
|
+
padding: 2px 8px;
|
|
271
|
+
font-size: 1em;
|
|
272
|
+
transition: all 0.15s ease;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.sibu-error-fallback .sibu-error-copy-btn:hover {
|
|
276
|
+
background: #2a2a3e;
|
|
277
|
+
color: #ccc;
|
|
278
|
+
border-color: #4a4a5e;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.sibu-error-fallback .sibu-error-stack pre {
|
|
282
|
+
margin: 0;
|
|
283
|
+
padding: 12px;
|
|
284
|
+
overflow-x: auto;
|
|
285
|
+
font-family: 'SF Mono', 'Fira Code', 'Roboto Mono', monospace;
|
|
286
|
+
font-size: 0.82em;
|
|
287
|
+
line-height: 1.6;
|
|
288
|
+
color: #a0a0b0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.sibu-error-fallback .sibu-error-stack .sibu-line-num {
|
|
292
|
+
display: inline-block;
|
|
293
|
+
width: 3ch;
|
|
294
|
+
margin-right: 12px;
|
|
295
|
+
color: #555;
|
|
296
|
+
text-align: right;
|
|
297
|
+
user-select: none;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.sibu-error-fallback .sibu-error-stack .sibu-stack-fn {
|
|
301
|
+
color: #7ec8e3;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.sibu-error-fallback .sibu-error-stack .sibu-stack-loc {
|
|
305
|
+
color: #666;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.sibu-error-fallback .sibu-error-actions {
|
|
309
|
+
display: flex;
|
|
310
|
+
gap: 8px;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.sibu-error-fallback .sibu-error-btn {
|
|
314
|
+
display: inline-flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
gap: 6px;
|
|
317
|
+
padding: 8px 18px;
|
|
318
|
+
border: none;
|
|
319
|
+
border-radius: 6px;
|
|
320
|
+
cursor: pointer;
|
|
321
|
+
font-size: 13px;
|
|
322
|
+
font-weight: 500;
|
|
323
|
+
transition: all 0.15s ease;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.sibu-error-fallback .sibu-error-btn-retry {
|
|
327
|
+
background: #e5484d;
|
|
328
|
+
color: white;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.sibu-error-fallback .sibu-error-btn-retry:hover {
|
|
332
|
+
background: #d13438;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.sibu-error-fallback .sibu-error-btn-reload {
|
|
336
|
+
background: #2a2a3e;
|
|
337
|
+
color: #ccc;
|
|
338
|
+
border: 1px solid #3a3a4e;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
342
|
+
background: #3a3a4e;
|
|
343
|
+
}
|
|
344
|
+
`,cc=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Hi=!1;function uc(){if(!Hi&&typeof document<"u"){let e=ie({nodes:ac});document.head.appendChild(e),Hi=!0}}function $i(e,n){let t=typeof e=="function"?e:n,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;uc();let[a,c]=C(null),d=()=>{f(),c(null)},u=null,f=()=>{if(!u)return;let y=u;u=null,y()},g=y=>{let T=new Array(y.length);for(let E=0;E<y.length;E++)try{T[E]=y[E]()}catch(D){_(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),T[E]=cc}return T},p=()=>{let y=s;if(!y||y.length===0)return;f();let T=null;u=V(()=>{let E=g(y);if(T===null){T=E;return}let D=E.length!==T.length;if(!D){for(let P=0;P<E.length;P++)if(!Object.is(E[P],T[P])){D=!0;break}}T=E,D&&d()})},m=y=>{let T=lt(y);if(c(T),p(),i)try{i(T)}catch(E){_(E,{phase:"render",name:"ErrorBoundary onError callback"})}return T},b=(y,T)=>tt({error:y,severity:"error",onRetry:T}),x=y=>{let T=o||b;try{return T(y,d)}catch(E){return queueMicrotask(()=>{_(E,{phase:"render",name:"ErrorBoundary fallback",node:h.parentNode?h:void 0})}),document.createComment("error-boundary-failed")}},h=k({class:"sibu-error-boundary",nodes:()=>{let y=a();if(y)return x(y);try{let T=t();if(T&&typeof T.then=="function"){let E=k({class:"sibu-error-async"});E.appendChild($({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return S(E,()=>{D=!0}),T.then(P=>{if(D){H(P);return}z(E,P)}).catch(P=>{if(D)return;let be=m(P);z(E,x(be))}),E}return T}catch(T){let E=m(T);return x(E)}}}),w=y=>{if(a())return;let E=y.detail?.error;E&&(y.preventDefault(),y.stopPropagation(),m(E))};return h.addEventListener("sibu:error-propagate",w),$e(()=>{let y=document.createTreeWalker(h,NodeFilter.SHOW_ELEMENT),T=[],E=y.currentNode;for(;E;){let D=He(E);D&&T.push(D),E=y.nextNode()}if(T.length===1)m(T[0]);else if(T.length>1){let D=globalThis.AggregateError;m(D?new D(T,`${T.length} pre-mount errors caught by ErrorBoundary`):new Error(T.map(P=>P.message).join("; ")))}},h),S(h,()=>{f(),h.removeEventListener("sibu:error-propagate",w)}),h}var lc=`
|
|
345
|
+
@keyframes sibu-spin {
|
|
346
|
+
to { transform: rotate(360deg); }
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
@keyframes sibu-pulse {
|
|
350
|
+
0%, 100% { opacity: 1; }
|
|
351
|
+
50% { opacity: 0.4; }
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.sibu-loading {
|
|
355
|
+
display: flex;
|
|
356
|
+
align-items: center;
|
|
357
|
+
justify-content: center;
|
|
358
|
+
padding: 20px;
|
|
359
|
+
gap: 10px;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.sibu-loading-spinner {
|
|
363
|
+
width: 24px;
|
|
364
|
+
height: 24px;
|
|
365
|
+
border: 3px solid #e0e0e0;
|
|
366
|
+
border-top-color: #3b82f6;
|
|
367
|
+
border-radius: 50%;
|
|
368
|
+
animation: sibu-spin 0.8s linear infinite;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.sibu-loading-dots {
|
|
372
|
+
display: flex;
|
|
373
|
+
gap: 4px;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.sibu-loading-dot {
|
|
377
|
+
width: 8px;
|
|
378
|
+
height: 8px;
|
|
379
|
+
border-radius: 50%;
|
|
380
|
+
background-color: #3b82f6;
|
|
381
|
+
animation: sibu-pulse 1.2s ease-in-out infinite;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.sibu-loading-dot:nth-child(2) { animation-delay: 0.2s; }
|
|
385
|
+
.sibu-loading-dot:nth-child(3) { animation-delay: 0.4s; }
|
|
386
|
+
|
|
387
|
+
.sibu-loading-text {
|
|
388
|
+
color: #6b7280;
|
|
389
|
+
font-size: 14px;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.sibu-loading-sm .sibu-loading-spinner { width: 16px; height: 16px; border-width: 2px; }
|
|
393
|
+
.sibu-loading-sm .sibu-loading-dot { width: 6px; height: 6px; }
|
|
394
|
+
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
395
|
+
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
396
|
+
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
397
|
+
`,Di=!1;function dc(){!Di&&typeof document<"u"&&(document.head.appendChild(ie({nodes:lc})),Di=!0)}function Oi(e={}){dc();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 Wt=Symbol.for("sibujs.actions.v1"),Ii=globalThis[Wt]??(globalThis[Wt]=new Map);function me(e,n){Ii.set(e,n)}function jt(e){return Ii.get(e)}function Pi(e,n,t){let r=typeof n=="string"?jt(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"&&S(e,o)}var Kt=(e,n)=>{let t=r=>{e.contains(r.target)||n()};return document.addEventListener("pointerdown",t,!0),()=>document.removeEventListener("pointerdown",t,!0)},Ut=(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)}},Jt=(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)},Gt=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)},Yt=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)};me("clickOutside",Kt);me("longPress",Ut);me("copyOnClick",Jt);me("autoResize",Gt);me("trapFocus",Yt);var ge=null;function Bi(e,n){try{let t=e();return t&&typeof t.then=="function"&&t.catch(r=>{n?n(r,"async"):ge?ge(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),t}catch(t){return n?n(t,"sync"):ge?ge(t,"sync"):console.error("Unhandled error in Sibu.catchError:",t),null}}async function Fi(e,n){try{return await e()}catch(t){return n?n(t,"async"):ge?ge(t,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",t),null}}function zi(e){ge=e}function Vi(e){let[n,t]=C(e),r=i=>{!!0||!W()||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 Zt=Symbol.for("sibujs.createId.v1"),Xt=globalThis[Zt]??(globalThis[Zt]={n:0});function qi(e="sibu"){return Xt.n++,`${e}-${Xt.n}`}function Wi(){Xt.n=0}function ji(e,n){let t=typeof n=="function"?n():n;return S(t,I(()=>{t.style.display=e()?"":"none"})),t}function Ki(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),d=!a&&!c;return r.add(s),c&&ne(()=>`${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:d}}function Ui(e,n,t){let r=document.createComment("when"),o=null,i,s=!1,a=new WeakSet,c=!1,d=()=>{let u=e(),f=r.parentNode;if(!f||s&&u===i)return;i=u;let g=o?Me([o]):null;o?.parentNode&&(c&&H(o),o.parentNode.removeChild(o),o=null);let m=Ki(f,r,u?n:t!==void 0?t:null,a,"when");o=m.node,c=m.owned,Te(g,o?[o]:[],"when"),s=!0};return S(r,I(d)),s||queueMicrotask(()=>{!s&&r.parentNode&&d()}),r}function Ji(e,n,t){let r=document.createComment("match"),o=null,i,s=!1,a=new WeakSet,c=!1,d=()=>{let u=String(e()),f=r.parentNode;if(!f||s&&u===i)return;i=u;let g=o?Me([o]):null;o?.parentNode&&(c&&H(o),o.parentNode.removeChild(o),o=null);let p=Object.hasOwn(n,u)?n[u]:t,m=Ki(f,r,p??null,a,"match");o=m.node,c=m.owned,Te(g,o?[o]:[],"match"),s=!0};return S(r,I(d)),s||queueMicrotask(()=>{!s&&r.parentNode&&d()}),r}var Qt=new Map;function Gi(e,n){Qt.set(e,n)}function Yi(e){Qt.delete(e)}function en(e){let n=Qt.get(e);return n?n():k({nodes:`[Component "${e}" not found]`})}function Zi(e){let n=k({class:"sibu-dynamic"});function t(){let o=e(),i;typeof o=="function"?i=o():i=en(o),z(n,i)}let r=I(t);return S(n,r),n}function Xi(e){return typeof e=="function"?Xi(e()):e instanceof Node?e:document.createTextNode(String(e))}function fc(e,n){if(n===0)return[];let t=[],r=new Array(n);for(let a=0;a<n;a++){let c=e[a],d=0,u=t.length;for(;d<u;){let f=d+u>>1;e[t[f]]<c?d=f+1:u=f}t[d]=a,r[a]=d>0?t[d-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 Qi(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,d=new Map,u=new Map,f=[],g=[],p=[],m=0,b=[],x=[],h=new Uint8Array(0),w=new Map,y=[],T=[],E=new Map,D=!1,P=!1,be=!1,Ms=t.key,cn=()=>{if(be)return;let J=e(),A=J.length,ce=r.parentNode;if(!ce)return;P||(ce.insertBefore(o,r.nextSibling),P=!0),x.length<A&&(x=new Array(A));for(let v=0;v<A;v++)x[v]=Ms(J[v]);let te=x;b.length<A&&(b=new Array(A)),u.clear(),E.clear();for(let v=0;v<A;v++)E.has(te[v])&&M(`each: duplicate key "${String(te[v])}" at index ${v} (first seen at ${E.get(te[v])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(te[v],v);m=0;for(let v=0;v<A;v++){let B=te[v],ln=d.get(B),Ae;if(ln!==void 0)Ae=ln,f[m]=Ae,g[m]=J[v],p[m]=v,m++;else{let[dn,Os]=C(J[v]),[fn,Is]=C(v),ot;try{ot=Xi(n(dn,fn))}catch(Ps){let Bs=te[v];ot=document.createComment(`each:error:${v}`),queueMicrotask(()=>{_(Ps,{phase:"render",name:`each row (key="${String(Bs)}")`,node:r.parentNode?r:void 0})})}Ae={node:ot,item:dn,setItem:Os,index:fn,setIndex:Is}}u.set(B,Ae),b[v]=Ae.node}for(let[v,B]of d)u.has(v)||(H(B.node),B.node.parentNode&&ce.removeChild(B.node));if(A===0){c=0;let v=d;d=u,u=v,D=!0,m=0;return}w.clear();for(let v=0;v<c;v++)w.set(a[v],v);y.length<A&&(y=new Array(A),T=new Array(A));let Be=0;for(let v=0;v<A;v++){let B=w.get(te[v]);B!==void 0&&(y[Be]=v,T[Be]=B,Be++)}let un=fc(T,Be);h.length<A?h=new Uint8Array(A):h.fill(0,0,A);for(let v=0;v<un.length;v++)h[y[un[v]]]=1;let Fe=o;for(let v=A-1;v>=0;v--){let B=b[v];h[v]||B.nextSibling!==Fe&&ce.insertBefore(B,Fe),Fe=B}let ze=a===i?s:i;ze.length<A&&(ze.length=A);for(let v=0;v<A;v++)ze[v]=te[v];a=ze,c=A;let Ds=d;d=u,u=Ds,D=!0,Hs()};function Hs(){if(m===0)return;let J=m;m=0,F(()=>{for(let A=0;A<J;A++){let ce=f[A];ce.setItem(g[A]),ce.setIndex(p[A]),f[A]=void 0,g[A]=void 0}})}let $s=I(cn);return S(r,()=>{if(!be){be=!0,$s();for(let J of d.values())H(J.node),J.node.parentNode?.removeChild(J.node);o.parentNode&&o.parentNode.removeChild(o),P=!1,d.clear(),u.clear(),E.clear(),w.clear(),c=0,f.length=0,g.length=0,p.length=0,m=0}}),D||queueMicrotask(()=>{!D&&!be&&r.parentNode&&cn()}),r}function ts(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(es(r));else n.appendChild(es(t));return n}function es(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 pc=new Set(["script","style"]),mc=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ns=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),rs=new WeakMap;function gc(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 m=0;for(;r<o&&t.charCodeAt(r)!==0;)m=m*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,m<0||m>=n?(r=p,-1):m}function a(){let p=r;for(;r<o;){let m=t.charCodeAt(r);if(m>=97&&m<=122||m>=65&&m<=90||m>=48&&m<=57||m===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 m=t[r];if(m==='"'||m==="'"){r++;let b=[],x=[],h="";for(;r<o&&t[r]!==m;){let w=s();w>=0?(b.push(h),h="",x.push(w)):h+=t[r++]}return r<o&&r++,b.push(h),x.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:x}}{let b=[],x=[],h="";for(;r<o;){let w=t.charCodeAt(r);if(w===32||w===9||w===10||w===13||w===62)break;let y=s();y>=0?(b.push(h),h="",x.push(y)):h+=t[r++]}return b.push(h),x.length===0?{kind:"static",value:b[0]}:{kind:"mixed",statics:b,exprs:x}}}function d(){let p=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let m=r;for(;r<o;){let h=t.charCodeAt(r);if(h>=97&&h<=122||h>=65&&h<=90||h>=48&&h<=57||h===45||h===58||h===95||h===46)r++;else break}let b=t.slice(m,r);if(!b)break;let x=c();b.startsWith("on:")?x.kind==="expr"&&p.push({t:3,name:b.slice(3),idx:x.idx}):x.kind==="bool"?p.push({t:4,name:b}):x.kind==="static"?p.push({t:0,name:b,value:x.value}):x.kind==="expr"?p.push({t:1,name:b,idx:x.idx}):x.kind==="mixed"&&p.push({t:2,name:b,statics:x.statics,exprs:x.exprs})}return p}function u(p){return p.replace(/\s+/g," ")}function f(p){let m="";for(;r<o&&t[r]!=="<";){let x=s();if(x>=0){let h=u(m);h&&p.push({t:1,value:h}),m="",p.push({t:2,idx:x})}else m+=t[r++]}let b=u(m);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 m=t[r+1];if(m==="!"){if(t.startsWith("<!--",r)){let y=t.indexOf("-->",r+4);r=y===-1?o:y+3}else if(t.startsWith("<![CDATA[",r)){let y=t.indexOf("]]>",r+9);r=y===-1?o:y+3}else{let y=t.indexOf(">",r);r=y===-1?o:y+1}continue}if(m==="?"){let y=t.indexOf(">",r);r=y===-1?o:y+1;continue}if(!(m>="a"&&m<="z")&&!(m>="A"&&m<="Z")){p.push({t:1,value:"<"}),r++;continue}r++;let b=a(),x=d();i();let h=mc.has(b),w=t[r]==="/";if(w&&r++,r<o&&r++,h||w)p.push({t:0,el:{tag:b,svg:ns.has(b),attrs:x,children:[]}});else{let y=g();if(pc.has(b.toLowerCase())){for(let T=0;T<y.length;T++)if(y[T].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:ns.has(b),attrs:x,children:y}})}}else f(p);return p}return g()}function tn(e,n){let t=e.svg?document.createElementNS(N,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"?S(t,Ge(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(tn(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),S(t,de(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 nn(e,...n){let t=rs.get(e);if(t||(t=gc(e),rs.set(e,t)),t.length===1&&t[0].t===0)return tn(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(tn(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),S(r,de(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 os(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&G()&&M("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,d=!1,u=!1,f=()=>{if(u)return;let p=e(),m=r.parentNode;if(!m||d&&p===a)return;c?.parentNode&&m.removeChild(c),a=p;let b=o.get(p);if(b){let x=i.indexOf(p);x!==-1&&(i.splice(x,1),i.push(p))}else{let x=n[p];if(!x){c=null,d=!0;return}if(b=x(),b instanceof DocumentFragment){let h=document.createElement("div");h.style.display="contents",h.appendChild(b),b=h}if(o.set(p,b),i.push(p),s>0&&i.length>s){let h=i.shift(),w=o.get(h);w&&(H(w),w.parentNode&&w.parentNode.removeChild(w),o.delete(h))}}m.insertBefore(b,r.nextSibling),c=b,d=!0},g=I(f);return d||queueMicrotask(()=>{!d&&r.parentNode&&f()}),S(r,()=>{u=!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 is(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 ss(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})})}}),S(t,()=>{i=!0,o&&(H(o),o.remove(),o=null)}),t}function as(e,n="default"){return e?.[n]}function cs(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 d=[...c];return a=d.splice(o,i,...s),d}),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 us(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,ae(r)||Se(r)}function i(){if(xe(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,...d){let u=n.splice(a,c,...d);return(u.length>0||d.length>0)&&o(),u},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 d=!1;for(let u=0;u<n.length;u++)if(a(n[u])){let f=c(n[u]);Object.is(n[u],f)||(n[u]=f,d=!0)}d&&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 d=0;d<n.length;d++){let u=a(n[d],d);Object.is(n[d],u)||(n[d]=u,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function ls(e,n){let[t,r]=C(n),[o,i]=C(!1),[s,a]=C(null),[c,d]=C(0),u=0,f=!1,g=null,p=()=>{if(g===null)return;let b=g;g=null;try{b.abort()}catch{}},m=V(()=>{if(c(),f)return;p();let b=++u,x=typeof AbortController<"u"?new AbortController:null;g=x,F(()=>{i(!0),a(null)});let h=()=>f||b!==u,w;try{w=e({signal:x?x.signal:void 0})}catch(y){if(h())return;F(()=>{a(y),i(!1)});return}w.then(y=>{h()||(g=null,F(()=>{r(y),i(!1)}))},y=>{h()||(g=null,F(()=>{a(y),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{f||d(b=>b+1)},dispose:()=>{f||(f=!0,m(),p())}}}function _e(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[d,u]of e)if(!c.has(d)||!_e(u,c.get(d),t))return!1;return!0}if(e instanceof Set){let c=n;if(e.size!==c.size)return!1;for(let d of e)if(!c.has(d))return!1;return!0}if(e instanceof ArrayBuffer){let c=new Uint8Array(e),d=new Uint8Array(n);if(c.length!==d.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==d[u])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,d=n;if(c.length!==d.length)return!1;for(let u=0;u<c.length;u++)if(c[u]!==d[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((c,d)=>_e(c,n[d],t));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(c=>Object.hasOwn(o,c)&&_e(r[c],o[c],t))}function ds(e){return C(e,{equals:(n,t)=>_e(n,t)})}function nt(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._g=e,o.__v=0;let i=()=>{o._d||(o._d=!0)};i._c=1,i._sig=o;let s=()=>{let f=e();o._v=r&&o._init&&r(o._v,f)?o._v:f,o._d=!1,o._init=!0};I(()=>{let f=!0;try{o._v=e(),o._d=!1,o._init=!0,f=!1}finally{f&&(o._d=!0)}},i);let a=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,c=!1,d=()=>{if(!o._d)return;let f=o._v;c=!0;try{X(s,i),Object.is(f,o._v)||o.__v++}finally{c=!1}a&&!Object.is(f,o._v)&&a.emit("computed:update",{signal:o,oldValue:f,newValue:o._v})};o._validate=d;function u(){if(c)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Vn()?(o._d&&d(),o._v):(o._d&&d(),xe(o),o._v)}return t&&(u.__name=t,o.__name=t),u.__signal=o,a&&a.emit("computed:create",{signal:o,name:t,getter:u}),u}function fs(e){let[n,t]=C(e);return{get current(){return n()},set current(r){t(r)}}}function ps(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[d,u]=C(e[c]);n[c]=[d,u]});let t=new Proxy({},{get(c,d){if(typeof d=="string"&&Object.hasOwn(n,d)){let u=n[d][0];return u()}return Reflect.get(c,d)},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(d=>{c[d]=n[d][0]()}),c};return[t,{setState:c=>{let d=r(),u=typeof c=="function"?c(d):c;F(()=>{Object.entries(u).forEach(([f,g])=>{Object.hasOwn(n,f)&&n[f][1](g)})})},reset:()=>{F(()=>{Object.keys(e).forEach(c=>{let d=n[c][1];d(e[c])})})},subscribe:c=>{let d=!0;return V(()=>{let u=r();if(d){d=!1;return}Le();try{c(u)}finally{Re()}})},subscribeKey:(c,d)=>{let u,f=!0;return V(()=>{let g=n[c][0]();if(f){u=g,f=!1;return}if(!Object.is(g,u)){let p=u;u=g,Le();try{d(g,p)}finally{Re()}}})},getSnapshot:r}]}function ms(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."),W())return()=>{};let t,r=!0;return I(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Le();try{n(s,a)}finally{Re()}}})}function gs(e,n,t){return[nt(e,t),i=>{F(()=>n(i))}]}function bs(e){let n=e();return G()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function hs(e){if(!G())return V(e);let n=V(e),t=null;return queueMicrotask(()=>{try{t=V(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}var rn="data-sibu-enhanced",on=new WeakMap;function ys(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=Ce){let i=r.length-o+e.length;e.length=0,Ne(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var vs=["text","attr","class","show","on","cleanup"];function xs(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 Ie(e,n){return W()?()=>{}:q(n,e)}function bc(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 hc(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 yc(e,n,t,r){let o=`ctx.each[${r}]`;if(G())for(let i of Object.keys(t))R(vs.includes(i),`${o}: unknown binding "${i}". Expected one of: ${vs.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 Pe(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(rn)==="true")return G()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=(u,f)=>{let g=xs(t,u);if(!g){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(u)} not found under`,t);return}f(g)},a={root:t,ref:u=>xs(t,u),refs:u=>{let f=u.startsWith("@")?`[data-ref="${u.slice(1)}"]`:u;try{return Array.from(t.querySelectorAll(f))}catch{return[]}},on:(u,f,g,p)=>{s(u,m=>{let b=x=>g(x,m);m.addEventListener(f,b,p),r.push(()=>m.removeEventListener(f,b,p))})},text:(u,f)=>{s(u,g=>{r.push(Ie(g,()=>{let p=f(),m=p==null?"":String(p);g.textContent!==m&&(g.textContent=m)}))})},attr:(u,f,g)=>{s(u,p=>{r.push(Ie(p,()=>{let m=g(),b=m==null?null:String(m);j(p,f,b,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(u,f,g)=>{s(u,p=>{r.push(Ie(p,()=>{p.classList.toggle(f,!!g())}))})},show:(u,f)=>{s(u,g=>{let p=g.hidden;r.push(Ie(g,()=>{g.hidden=!f()})),r.push(()=>{g.hidden=p})})},model:(u,f,g)=>{s(u,p=>{let m=p,[b,x]=f,h=g?.event??(m instanceof HTMLSelectElement||m instanceof HTMLInputElement&&(m.type==="checkbox"||m.type==="radio")?"change":"input");r.push(Ie(p,()=>{hc(m,b())}));let w=()=>x(bc(m));m.addEventListener(h,w),r.push(()=>m.removeEventListener(h,w))})},each:(u,f)=>{R(typeof f=="function","ctx.each: second argument must be a function.");let g=typeof u=="string"?a.refs(u):Array.from(u);for(let p=0;p<g.length;p++){let m=g[p],b=f(m,p);b!=null&&yc(a,m,b,p)}},cleanup:u=>{r.push(u)}},c;try{c=n(a)}catch(u){throw ys(r,"enhance"),u}typeof c=="function"&&r.push(c);let d=()=>{i||(i=!0,on.get(t)===o&&(on.delete(t),t.removeAttribute(rn)),Ve(t,d),ys(r,"enhance"))};return S(t,d),on.set(t,o),t.setAttribute(rn,"true"),d}function Ss(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(Pe(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 Ts(e,n){let t=globalThis;return t[e]??(t[e]=n())}var vc=/^[A-Za-z0-9_-]+$/,Es=Symbol.for("sibujs.islands.lazy"),rt=Ts(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function ws(e){return e[Es]=!0,e}function ks(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))})`);rt.set(e,n)}function _s(e){rt.delete(e)}async function xc(e){if(typeof e=="function"&&e[Es]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function As(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(!rt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let u=rt.get(s);u&&xc(u).then(f=>{if(!o){if(!f){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let g=Pe(i,f);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(f=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,f)})},d=i.getAttribute("data-sibu-load")||"load";t.push(Sc(d,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function Sc(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 sn(e){return e}var wd=1024*1024;function Ns(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=I(()=>{i=e(),a()}),d=(()=>n());return d.dispose=()=>{o||(o=!0,c())},d}var Cs=16;function Tc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Cs*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Cs)}function Ls(){let[e,n]=C(!1);function t(r){n(!0),Tc(()=>{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 Rs(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}typeof window<"u"&&(window.Sibu=an);return Ws(Ec);})();
|