sibujs 4.12.0 → 4.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +71 -18
- package/dist/browser.js +4 -4
- package/dist/build.cjs +6618 -6178
- package/dist/build.d.cts +554 -415
- package/dist/build.d.ts +554 -415
- package/dist/build.js +2091 -1735
- package/dist/cdn.dev.global.js +12 -12
- package/dist/cdn.full.dev.global.js +13 -13
- package/dist/cdn.full.global.js +12 -12
- package/dist/cdn.global.js +12 -12
- package/dist/{chunk-WFRQ6D7H.js → chunk-22OPSWMF.js} +1 -1
- package/dist/{chunk-ZJCHY2IB.js → chunk-2NC56RGY.js} +1 -1
- package/dist/{chunk-NB7TFSJE.js → chunk-2O6JJCUR.js} +4 -4
- package/dist/{chunk-B2Y5BJSP.js → chunk-4UTGDVSA.js} +70 -16
- package/dist/{chunk-NAVLCP4S.js → chunk-5RIBLY2N.js} +4 -4
- package/dist/{chunk-T5O2CUHV.js → chunk-5XUGJM3J.js} +1 -1
- package/dist/{chunk-HXT2RNH5.js → chunk-ADZHPN2B.js} +1 -1
- package/dist/chunk-B36ADEIR.js +21 -0
- package/dist/{chunk-DFZL3AX7.js → chunk-C73VBPEF.js} +9 -5
- package/dist/{chunk-WH4U2VUE.js → chunk-CPQKWCJ2.js} +13 -5
- package/dist/{chunk-LEUEKK4G.js → chunk-EU7T7EB3.js} +2 -2
- package/dist/{chunk-QLG5IK7F.js → chunk-G3Z2FEBR.js} +4 -4
- package/dist/{chunk-ZPY2UAKM.js → chunk-J4X7ICH4.js} +3 -3
- package/dist/{chunk-XX4BRMWF.js → chunk-K4LNUT5L.js} +1 -1
- package/dist/{chunk-CI4W6XAU.js → chunk-KC62VURU.js} +3 -3
- package/dist/chunk-N5TBYXHW.js +17 -0
- package/dist/{chunk-653KGQS2.js → chunk-OIKD7YDY.js} +2 -2
- package/dist/{chunk-LYTUTXQP.js → chunk-PBJYCE2Z.js} +46 -4
- package/dist/{chunk-EMB5PG7V.js → chunk-QC3NP47A.js} +1 -1
- package/dist/{chunk-IHA62NGJ.js → chunk-QKFVMIAV.js} +1 -1
- package/dist/{chunk-LXBMVGVB.js → chunk-QZ47OZ25.js} +3 -3
- package/dist/{chunk-ZTYCCBU3.js → chunk-VFPLWUT7.js} +44 -26
- package/dist/{chunk-RK7EPQPG.js → chunk-YFTBCCVH.js} +1 -1
- package/dist/data.cjs +71 -18
- package/dist/data.js +5 -5
- package/dist/datePicker-DxuxWpgF.d.cts +285 -0
- package/dist/datePicker-DxuxWpgF.d.ts +285 -0
- package/dist/devtools.cjs +71 -18
- package/dist/devtools.js +4 -4
- package/dist/ecosystem.cjs +82 -21
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +131 -23
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +21 -20
- package/dist/index.cjs +115 -37
- package/dist/index.d.cts +59 -5
- package/dist/index.d.ts +59 -5
- package/dist/index.js +10 -10
- package/dist/motion.cjs +69 -16
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +71 -18
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +69 -16
- package/dist/performance.js +4 -4
- package/dist/plugins.cjs +1421 -996
- package/dist/plugins.d.cts +132 -3
- package/dist/plugins.d.ts +132 -3
- package/dist/plugins.js +262 -11
- package/dist/routeMiddleware-B1sp4P7a.d.ts +688 -0
- package/dist/routeMiddleware-CedQTsLK.d.cts +688 -0
- package/dist/ssr.cjs +3607 -3524
- package/dist/ssr.d.cts +20 -671
- package/dist/ssr.d.ts +20 -671
- package/dist/ssr.js +15 -7
- package/dist/testing.cjs +71 -18
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +78 -18
- package/dist/ui.js +8 -7
- package/dist/widgets.cjs +1352 -952
- package/dist/widgets.d.cts +100 -268
- package/dist/widgets.d.ts +100 -268
- package/dist/widgets.js +316 -7
- package/package.json +9 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||e==="\r"||e==="\f"}function
|
|
1
|
+
"use strict";(()=>{var Go=Object.defineProperty;var jt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Bn=(e,t)=>{for(var n in t)Go(e,n,{get:t[n],enumerable:!0})};var Dn={};Bn(Dn,{DynamicComponent:()=>yl,ErrorBoundary:()=>rl,ErrorDisplay:()=>Cn,Fragment:()=>xl,KeepAlive:()=>El,Loading:()=>sl,MAX_DRAIN_TEARDOWNS:()=>ve,Portal:()=>Cl,SVG_NS:()=>I,Suspense:()=>jr,__renderParsedTemplate:()=>Ao,__resetIdCounter:()=>yo,a:()=>$s,abbr:()=>Hs,action:()=>al,address:()=>Ss,area:()=>ua,array:()=>Nl,article:()=>ms,aside:()=>vs,asyncDerived:()=>Ll,audio:()=>la,autoResize:()=>go,b:()=>Is,base:()=>ru,batch:()=>U,bdi:()=>Bs,bdo:()=>Vs,bindDynamic:()=>Or,blockquote:()=>_s,body:()=>ds,br:()=>js,button:()=>dt,canvas:()=>Ta,caption:()=>Aa,catchError:()=>ul,catchErrorAsync:()=>ll,center:()=>_u,checkLeaks:()=>Kn,circle:()=>su,cite:()=>Fs,clickOutside:()=>fo,clipPath:()=>hu,code:()=>bn,col:()=>Na,colgroup:()=>Ra,context:()=>dl,copyOnClick:()=>mo,createId:()=>ho,customElement:()=>Nu,data:()=>zs,datalist:()=>Ia,dd:()=>Cs,deepEqual:()=>rt,deepSignal:()=>Ml,defer:()=>Xl,defs:()=>bu,del:()=>_a,derived:()=>Ue,details:()=>Xa,dfn:()=>Ws,dialog:()=>Za,disableSSR:()=>Gr,dispose:()=>F,div:()=>P,dl:()=>As,dt:()=>Ns,each:()=>Sl,effect:()=>te,ellipse:()=>au,em:()=>qs,embed:()=>ma,enableSSR:()=>Kr,enhance:()=>$t,enhanceAll:()=>Fl,enqueueBatchedSignal:()=>We,external:()=>Gu,fieldset:()=>Ba,figcaption:()=>Rs,figure:()=>Ls,font:()=>Cu,footer:()=>bs,form:()=>Va,g:()=>uu,getAction:()=>co,getRequestScopedCache:()=>Ur,getRuntimeErrorHandler:()=>Fn,getSSRStore:()=>ze,getSlot:()=>Al,h1:()=>xs,h2:()=>ws,h3:()=>mn,h4:()=>Ts,h5:()=>Es,h6:()=>ks,head:()=>cs,header:()=>gs,hr:()=>Ms,html:()=>Co,i:()=>Us,iframe:()=>ga,img:()=>ca,input:()=>ja,ins:()=>Ca,isBatching:()=>Ku,isSSR:()=>me,kbd:()=>Ks,label:()=>Fa,lazy:()=>Vr,lazyIsland:()=>Wl,legend:()=>za,li:()=>Os,line:()=>lu,linearGradient:()=>Su,link:()=>ou,longPress:()=>po,main:()=>ys,map:()=>da,mark:()=>Gs,marker:()=>ku,marquee:()=>Au,mask:()=>yu,match:()=>ml,math:()=>wa,menu:()=>Qa,meta:()=>iu,meter:()=>Wa,mount:()=>kl,mountIslands:()=>Gl,nav:()=>hs,nextTick:()=>ec,noscript:()=>Ea,object:()=>ba,ol:()=>Ps,on:()=>Vu,onCleanup:()=>Hu,onMount:()=>Lt,onUnmount:()=>$u,optgroup:()=>qa,option:()=>Ua,output:()=>Ka,p:()=>pn,param:()=>ha,path:()=>cu,pattern:()=>vu,picture:()=>ya,polygon:()=>du,polyline:()=>fu,portal:()=>va,pre:()=>gn,progress:()=>Ga,q:()=>Js,radialGradient:()=>xu,reactiveArray:()=>Rl,rect:()=>pu,ref:()=>Ol,registerAction:()=>nt,registerComponent:()=>gl,registerDisposer:()=>_,registerIsland:()=>ql,replaceChildrenSafely:()=>re,reportDrainRunaway:()=>ke,reportError:()=>M,resolveComponent:()=>hl,retrack:()=>Ne,rp:()=>Ys,rt:()=>Xs,ruby:()=>Zs,runInSSRContext:()=>Jr,s:()=>Qs,samp:()=>ea,script:()=>ka,section:()=>ps,select:()=>Ja,setGlobalErrorHandler:()=>cl,setMaxDrainIterations:()=>Rr,setRuntimeErrorHandler:()=>jn,show:()=>fl,signal:()=>A,slot:()=>tu,small:()=>ta,source:()=>Sa,span:()=>q,stop:()=>wu,store:()=>Pl,strict:()=>Hl,strictEffect:()=>Il,strong:()=>na,style:()=>Ve,sub:()=>ra,summary:()=>eu,sup:()=>oa,svg:()=>xa,symbol:()=>Eu,table:()=>La,tagFactory:()=>p,takePendingError:()=>At,tbody:()=>Ma,td:()=>Oa,template:()=>nu,text:()=>mu,textarea:()=>Ya,tfoot:()=>Pa,th:()=>Da,thead:()=>$a,time:()=>ia,title:()=>fs,tr:()=>Ha,track:()=>fa,transition:()=>Ql,trapFocus:()=>bo,trustHTML:()=>Io,tspan:()=>gu,u:()=>sa,ul:()=>Ds,unregisterComponent:()=>bl,unregisterDisposer:()=>at,unregisterIsland:()=>Ul,untracked:()=>pe,use:()=>Tu,var_:()=>aa,video:()=>pa,watch:()=>Dl,when:()=>pl,withSSR:()=>Yr,writable:()=>$l});var Vn=Symbol.for("sibujs.runtime-errors.v1");function Ft(){let e=globalThis,t=e[Vn];if(t)return t;let n={handler:null,handlerDepth:0};return e[Vn]=n,n}function jn(e){let t=Ft(),n=t.handler;return t.handler=e,n}function Fn(){return Ft().handler}function zt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${Jo(e)}`;return new Error(t,{cause:e})}function Jo(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 Yo(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var Xo=Symbol.for("sibujs.reactive.v1");function Zo(e){let t=globalThis[Xo];return t?.untracked?t.untracked(e):e()}var Qo="sibu:error-propagate";function ei(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=ti(n);if(!r)return!1;try{let o=new CustomEvent(Qo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function ti(e){let n=e;for(;n;){if(n.nodeType===1&&typeof n.dispatchEvent=="function")return n;n=n.parentNode}let r=e;return typeof r.dispatchEvent=="function"?r:null}function ni(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Yo(t)}: ${e.message}`,e)}function M(e,t){let n=zt(e);Zo(()=>{if(ei(n,t))return;let r=Ft(),o=r.handler;if(o&&r.handlerDepth===0){r.handlerDepth++;try{o(e instanceof Error?e:n,t);return}catch(i){if(typeof console<"u"){let s=i instanceof Error?i.message:String(i);console.error(`[SibuJS] runtime error handler itself threw: ${s}`,i)}}finally{r.handlerDepth--}}ni(n,t)})}function be(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!0}function j(e,t){if(!e)throw new Error(`[SibuJS] ${t}`)}function ne(e){{let t=e();t&&console.warn(`[SibuJS] ${t}`)}}function D(e){console.warn(`[SibuJS] ${e}`)}var he=new WeakMap,ve=1e4;function ke(e,t,n){typeof console>"u"||console.error(`[SibuJS ${e}] runaway cleanup: stopped after running ${t} teardowns with ${n} still queued. Cleanup production did not stabilize before the teardown safety ceiling was reached \u2014 the remaining work was NOT run.`,{executed:t,remaining:n})}var Me=0;function bt(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var se=[];function zn(){return bt(se[se.length-1])}function Wn(e){return e===null&&se.length===0?!1:(se.push(bt(e)),!0)}function qn(){se.pop()}function _(e,t){let n=he.get(e);n||(n=[],he.set(e,n)),n.push(t),Me++;let r=bt(se[se.length-1]);r&&r.entries.push([e,t])}function Un(e){let t={entries:[],closed:!1},n=t.entries;se.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=ve){ke("rollback",s,n.length);break}let[a,u]=n.pop();if(at(a,u)){s++;try{u()}catch(l){M(l,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,se.pop()}throw i}t.closed=!0,se.pop();let o=bt(se[se.length-1]);if(o){for(let i of n)he.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function at(e,t){let n=he.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),Me--,n.length===0&&he.delete(e),!0)}function F(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=Array.from(r.childNodes);for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--)ri(n[r])}function ri(e){if(!he.has(e))return;let t=0,n=!1;for(;!n;){let r=he.get(e);if(!r||r.length===0)break;let o=r.slice();he.delete(e),Me-=o.length;for(let i=0;i<o.length;i++){if(t>=ve){let s=o.slice(i),a=he.get(e);he.set(e,a?s.concat(a):s),Me+=s.length,ke("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){M(s,{phase:"cleanup",name:"disposer"})}}}}function re(e,...t){for(let r=0;r<t.length;r++){let o=t[r];o.parentNode?.removeChild(o)}let n=Array.from(e.childNodes);for(let r=0;r<n.length;r++)F(n[r]);e.replaceChildren(...t)}function Kn(e=0){return e>0&&Me>e&&D(`checkLeaks: ${Me} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),Me}function Ke(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var oi=/[A-Z]/,ii=/[A-Z]/g;function ae(e){return oi.test(e)?e.replace(ii,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function _e(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}var si=["http:","https:","mailto:","tel:","ftp:"],ai=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function yt(e){let t=Ke(e).trim();if(!t)return"";let n=e.replace(ai,"");if(t.length>=2&&(t[0]==="\\"||t[0]==="/")&&(t[1]==="\\"||t[1]==="/")&&(t[0]==="\\"||t[1]==="\\"))return"";let r=t.toLowerCase(),o=-1;for(let s=0;s<r.length;s++){let a=r.charCodeAt(s);if(a===58){o=s;break}if(a===47||a===63||a===35)break}if(o===-1)return n;let i=r.slice(0,o+1);return/^[a-z][a-z0-9+.-]*:$/.test(i)&&si.indexOf(i)===-1?"":n}var ui=/^\d+(\.\d+)?[wx]$/;function Wt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function li(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Wt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Wt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let l="",c=!1;for(;r<o;){let m=t[r];if(c){l+=m,m===")"&&(c=!1),r++;continue}if(Wt(m)){l&&a.push(l),l="",r++;continue}if(m===","){r++;break}m==="("&&(c=!0),l+=m,r++}l&&a.push(l)}if(s===""||a.length>1||a.length===1&&!ui.test(a[0]))continue;let u=yt(s);u&&(u.startsWith(",")||u.endsWith(",")||n.push(a.length===1?`${u} ${a[0]}`:u))}return n.join(", ")}var ci=/[(:@\\]/;function di(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function Gn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function fi(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r!=="\\"){t+=r;continue}if(n+1>=e.length)break;let o=e[n+1];if(o===`
|
|
4
4
|
`||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
|
|
5
|
-
`?2:1;continue}if(
|
|
6
|
-
`?2:1);let a=Number.parseInt(i,16),
|
|
7
|
-
`||e==="\r"||e==="\f"}function yt(e){let t=0,n=e.length;for(;t<n&&Oe(e[t]);)t++;for(;n>t&&Oe(e[n-1]);)n--;return e.slice(t,n)}var ae=e=>({kind:"forbidden",reason:e});function gi(e){let t=yt(Ue(e));if(t==="")return ae("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ae("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ae("unparseable delay");for(;n<t.length&&Oe(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ae("unexpected text after delay");for(n++;n<t.length&&Oe(t[n]);)n++;let o=n;for(;n<t.length&&!Oe(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ae(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Oe(t[n]);)n++;if(t[n]!=="=")return ae("missing '=' after url");for(n++;n<t.length&&Oe(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let l=t.indexOf(a,n+1);if(l===-1)return ae("unterminated quoted destination");if(s=t.slice(n+1,l),yt(t.slice(l+1))!=="")return ae("trailing text after quoted destination")}else if(s=yt(t.slice(n)),/[;,]/.test(s))return ae("multiple refresh assignments");if(s==="")return ae("empty destination");let c=gt(s);return c===""?ae("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:c}}function Ut(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=se(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ae(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:yt(Ue(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:gi(n)}var bi="http://www.w3.org/1999/xhtml",hi="http://www.w3.org/2000/svg",yi=new Set(["script","iframe","object","embed","frame","frameset"]);function Qn(e){return se(e)}function er(e){return yi.has(Qn(e))}var vi=new Set(["script","style"]);function tr(e){return vi.has(Qn(e))}var B={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Si=new Set(["src","href","xlink:href","type","language"]),xi=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Kt=new WeakSet;function nr(e){return e.namespaceURI===bi||e.namespaceURI===null}function rr(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function wi(e){Kt.has(e)||(Kt.add(e),e.getAttribute("content")!==null&&Ut(rr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ti(e,t,n,r){if(!nr(e))return B.None;let o=se(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&wi(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return B.None;let i=Ut(rr(e,o,n));return i.kind==="forbidden"?B.MetaRefreshForbidden:i.kind!=="not-refresh"&&Kt.has(e)?B.MetaRefreshReactive:B.None}function Ei(e,t){if(t===null||se(e)!=="attributename")return B.None;let n=Ue(t);return Yn(n)||Ae(n)||it(n)?B.AnimationTarget:B.None}var vt=new WeakSet;function Zn(e){if(e===null)return!1;let t=se(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function ki(e,t,n,r){if(!nr(e))return B.None;let o=se(t);return o==="href"?r==="static"||n===null?B.None:Zn(e.getAttribute("rel"))?B.StylesheetSource:(vt.add(e),B.None):o==="rel"&&Zn(n)&&vt.has(e)&&e.hasAttribute("href")?B.StylesheetSource:B.None}function Gt(e,t,n,r){let o=e.localName;return o==="meta"?Ti(e,t,n,r):o==="link"?ki(e,t,n,r):o==="script"?r==="static"||n===null?B.None:Si.has(se(t))?B.ScriptSource:B.None:xi.has(o)&&e.namespaceURI===hi?Ei(t,n):B.None}function Jt(e,t,n){e.localName!=="link"||se(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?vt.add(e):vt.delete(e))}var Ci="http://www.w3.org/1999/xhtml",Ai="http://www.w3.org/2000/svg",_i="http://www.w3.org/1999/xlink",Ni="http://www.w3.org/XML/1998/namespace",Ri=new Set(["checked","disabled","selected"]);function Li(e){return e.namespaceURI===null||e.namespaceURI===Ci}function ir(e,t,n){te(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function or(e,t,n){e[t]=n}function Mi(e,t){if(e.namespaceURI!==Ai)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?_i:n.startsWith("xml:")?Ni:null}function de(e,t,n,r={}){let o=Oi(e,t,n,r);return e.localName==="link"&&Jt(e,t,r.reactive?"reactive":"runtime"),o}function Oi(e,t,n,r){let o=Mi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(Ae(t))return P(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Gt(e,t,s,r.reactive?"reactive":"runtime");if(a!==B.None)return ir(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(it(t))return P(`${r.label??"setSafeAttribute"}: refusing to set "${t}". 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(t),!1;let c=Li(e),l=c?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let m=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==m&&(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0}return c&&Ri.has(l)&&l in e?or(e,l,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&c&&(l==="value"||l==="checked")&&l in e)return or(e,l,l==="checked"?!!n:d),!0;let g=d===""?"":Xn(t,d,{element:e});return g===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===g||(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0)}function Yt(e,t,n){if(it(t))return P(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Gt(e,t,n,"static");return r!==B.None?(ir("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Jt(e,t,"static"),!0)}var Pi=4096,Xt=[];function Di(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function $i(e,t,n){let r=Xt.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Di();return o.sig=e,o.sub=t,o.epoch=n,o}function sr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Xt.length<Pi&&Xt.push(e)}function Hi(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function ar(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function Ii(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Bi(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var pe=null,xe=null,_e=0,Ne=[],fe=new Set,Vi=[];function ji(e){try{e()}catch(t){let n=e;L(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Fi(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var ve=0,we=!1;function Qt(){ve===0&&(xe=pe,pe=null,we=!0),ve++}function en(){ve--,ve===0&&(pe=xe,xe=null,we=!1)}function cr(){return we}function lr(e){Qt();try{return e()}finally{en()}}var ce=null;function tn(){return ce}function Tt(e,t){let n=ce;ce=e;try{return t()}finally{ce=n}}function nn(e){let t=ce;return t===null?e:(...n)=>Tt(t,()=>e(...n))}var zi=0;function rn(e,t){let n=pe,r=0,o=null;we&&(r=ve,o=xe,ve=0,xe=null,we=!1),pe=t;let i=t;i._cap===void 0&&(i._cap=Vn());let s=ce;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(ce=a);let c=++zi;i._epoch=c,i._structDirty=!1;for(let l=i.depsHead??null;l!==null;l=l.subNext){let d=l.sig;l.prevActive=d.__activeNode??null,d.__activeNode=l}try{e()}finally{pe=n,ce=s,r!==0&&(ve=r,xe=o,we=!0);let l=i.depsHead??null;for(;l!==null;){let d=l.subNext,g=l.sig;g.__activeNode=l.prevActive,l.prevActive=null,l.epoch!==c&&(Bi(l),ar(l),sr(l)),l=d}}}function ur(e,t){if(!t)return on(e);Ke(t);let n=pe,r=0,o=null;we&&(r=ve,o=xe,ve=0,xe=null,we=!1),pe=t;let i=t;i._scope===void 0&&(i._scope=ce);let s=ce;ce=i._scope;try{e()}finally{pe=n,ce=s,r!==0&&(ve=r,xe=o,we=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Ke(t))}function on(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{rn(e,r)}finally{o._reentrant=!1}}},r=n;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=t;try{n()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Ke(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Ke(r)})}function dr(e){if(!pe)return;let t=pe,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=$i(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,Ii(t,i),Hi(n,i),t._structDirty=!0}function Ke(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;ar(n),sr(n),n=r}}var St=1e3,xt=1e6,wt=0,Pe=new Set;function fr(e){let t=St;return Number.isFinite(e)&&e>0&&(St=Math.floor(e)),t}function pr(e){let t=xt;return Number.isFinite(e)&&e>0&&(xt=Math.floor(e)),t}function Wi(e){let t=e;return t._runEpoch!==wt?(t._runEpoch=wt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>St)}function qi(e){let t=e.__name??"<unnamed>";L(new Error(`subscriber "${t}" fired more than ${St} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:t})}function Ui(){L(new Error(`Notification drain exceeded ${xt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function mr(){let e=0;for(;e<Ne.length;){if(e>=xt){Ui();break}let t=Ne[e++];if(fe.delete(t),Pe.size>0&&Pe.has(t)||t._hasComputedDep===!0&&!Fi(t))continue;if(Wi(t)){qi(t),Pe.add(t);continue}let n=jn(t._cap??null);try{ji(t)}finally{n&&Fn()}}}function gr(){if(!(_e>0)){_e++,wt++;try{mr()}finally{_e--,_e===0&&(Ne.length=0,fe.clear(),Pe.size>0&&Pe.clear())}}}function Zt(e){e();let t=e._sig;if(!t)return;let n=Vi,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else fe.has(s)||(fe.add(s),Ne.push(s));i=i.sigNext}}}function br(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?Zt(r):fe.has(r)||(fe.add(r),Ne.push(r))),n=n.sigNext}}function hr(e){let n=e.subsHead;if(n){if(_e>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):fe.has(o)||(fe.add(o),Ne.push(o))),r=r.sigNext}return}_e++,wt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?Zt(o):fe.has(o)||(fe.add(o),Ne.push(o))),r=r.sigNext}mr()}finally{_e--,_e===0&&(Ne.length=0,fe.clear(),Pe.size>0&&Pe.clear())}}}function yr(e){return e.__sc??0}function vr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function Sr(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var xr="4.12.0",wr=Symbol.for("sibujs.reactive.v1");function Gi(){let e=globalThis,t=e[wr];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,P(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${xr}). 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.`)),t;let n={suspendTracking:Qt,resumeTracking:en,isTrackingSuspended:cr,untracked:lr,retrack:rn,track:ur,reactiveBinding:on,recordDependency:dr,cleanup:Ke,setMaxSubscriberRepeats:fr,setMaxDrainIterations:pr,drainNotificationQueue:gr,queueSignalNotification:br,notifySubscribers:hr,getSubscriberCount:yr,getSubscriberDeps:vr,forEachSubscriber:Sr,getOwnerScope:tn,runWithOwnerScope:Tt,bindOwnerScope:nn,version:xr};return e[wr]=n,n}var z=Gi(),De=z.suspendTracking,$e=z.resumeTracking,Tr=z.isTrackingSuspended,me=z.untracked,Re=z.retrack,le=z.track,Y=z.reactiveBinding,He=z.recordDependency,Ie=z.cleanup,Ou=z.setMaxSubscriberRepeats,Er=z.setMaxDrainIterations,kr=z.drainNotificationQueue,Cr=z.queueSignalNotification,Ge=z.notifySubscribers,Pu=z.getSubscriberCount,Du=z.getSubscriberDeps,$u=z.forEachSubscriber,Je=z.getOwnerScope??tn,Et=z.runWithOwnerScope??Tt,Z=z.bindOwnerScope??nn;function st(e,t,n){if(Ae(t))return de(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){L(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}de(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return Y(r,e)}function Ar(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(c){L(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(c){L(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),de(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=Y(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var sn=["data-focus-key","id","name"],Ji=new Set(["text","search","url","tel","password",""]);function Yi(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Ji.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 at(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<sn.length;i++){let s=t.getAttribute(sn[i]);if(s){r=sn[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Yi(t)}}function Xi(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Zi(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let c=0;c<a.length;c++)r++,n??(n=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function _r(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Ye(e,t,n){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){_r(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Zi(t,`[${e.attr}=${Xi(e.value)}]`);if(i&&i.tagName===e.tag){_r(i,e);return}o=s>1}te(()=>{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`${n}: 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 Te(e,t){let n=[];function r(){let o;try{o=t()}catch(d){L(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=at(n);if(o==null||typeof o=="boolean"){for(let d=0;d<n.length;d++){let g=n[d];F(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,Ye(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let d=new Set;for(let g=0;g<o.length;g++){let h=o[g];if(h==null||typeof h=="boolean")continue;let m=h instanceof Node?h:document.createTextNode(String(h));if(d.has(m)){P("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}d.add(m),a.push(m)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(n.length>0&&a.length>0){let d=new Set(n);c=new Set;for(let g=0;g<a.length;g++)d.has(a[g])&&c.add(a[g])}for(let d=0;d<n.length;d++){let g=n[d];c?.has(g)||(F(g),g.parentNode&&g.parentNode.removeChild(g))}let l=e;for(let d=0;d<a.length;d++){let g=a[d];l.nextSibling!==g&&s.insertBefore(g,l.nextSibling),l=g}n=a,Ye(i,a,"bindChildNode")}return Y(r,e)}function an(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function re(){typeof document>"u"&&an()}var I="http://www.w3.org/2000/svg",Qi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var cn=new Set,Nr=100,Rr=!1,Lr=new Map;function Mr(e){let t=Lr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Lr.set(e,t)),t}function es(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=Y(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",ht(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let g=a[d];if(g==null)continue;let h=Mr(d);l.push(h),c.setProperty(h,bt(h,String(g),{element:e}))}for(let d=0;d<o.length;d++)l.indexOf(o[d])===-1&&c.removeProperty(o[d]);o=l},e);A(e,s);return}if(typeof t=="string"){e.setAttribute("style",ht(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Mr(r);if(typeof o=="function"){let s=o,a=Y(()=>{n.style.setProperty(i,bt(i,String(s()),{element:e}))},e);A(e,a)}else n.style.setProperty(i,bt(i,String(o),{element:e}))}}function ts(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=Y(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);A(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=Y(()=>{let a="";for(let c in n){if(!Object.hasOwn(n,c))continue;let l=n[c];(typeof l=="function"?l():l)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);A(e,s)}else e.setAttribute("class",o)}function ln(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),A(e,Te(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),A(e,Te(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),A(e,Te(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,t){let n=er(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&an();let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),ln(i,o),i):(te(()=>{let m=r.trim().split(/\s+/);if(m.length<2)return"";let u=0;for(let b=0;b<m.length;b++){let y=m[b];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&u++}if(u<2)return"";let f=`${e}|${r}`;return cn.has(f)?"":cn.size>=Nr?Rr?"":(Rr=!0,`tagFactory: ${Nr} 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.`):(cn.add(f),`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 ln(i,r),i;let s=r,a=s.class;a!=null&&ts(i,a);let c=s.id;typeof c=="function"?A(i,st(i,"id",c)):c!=null&&(typeof c=="string"&&Qi.has(c.toLowerCase())&&P(`tagFactory: element id="${c}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=c);let l=o!==void 0?o:s.nodes;l!=null&&ln(i,l);let d=s.on;if(d)for(let m in d){if(!Object.hasOwn(d,m))continue;let u=d[m];typeof u=="function"?i.addEventListener(m,u):P(`tagFactory: on.${m} handler is not a function (got ${typeof u}). Event listener was not attached.`)}let g=s.style;g!=null&&es(i,g);let h=s.ref;h&&(h.current=i);for(let m in s)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,m))continue;let u=s[m];if(u==null||Ae(m))continue;typeof u=="function"?A(i,st(i,m,u)):de(i,m,u,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var ld=p("html"),ns=p("head"),rs=p("body"),os=p("title"),O=p("div"),W=p("span"),is=p("section"),ss=p("article"),as=p("header"),cs=p("footer"),ls=p("nav"),us=p("main"),ds=p("aside"),fs=p("address"),un=p("p"),ps=p("h1"),ms=p("h2"),dn=p("h3"),gs=p("h4"),bs=p("h5"),hs=p("h6"),ys=p("blockquote"),vs=p("dd"),Ss=p("dl"),xs=p("dt"),ws=p("figcaption"),Ts=p("figure"),Es=p("hr"),ks=p("li"),Cs=p("ol"),As=p("ul"),fn=p("pre"),_s=p("a"),Ns=p("abbr"),Rs=p("b"),Ls=p("bdi"),Ms=p("bdo"),Os=p("br"),Ps=p("cite"),pn=p("code"),Ds=p("data"),$s=p("dfn"),Hs=p("em"),Is=p("i"),Bs=p("kbd"),Vs=p("mark"),js=p("q"),Fs=p("rp"),zs=p("rt"),Ws=p("ruby"),qs=p("s"),Us=p("samp"),Ks=p("small"),Gs=p("strong"),Js=p("sub"),Ys=p("sup"),Xs=p("time"),Zs=p("u"),Qs=p("var"),ea=p("area"),ta=p("audio"),na=p("img"),ra=p("map"),oa=p("track"),ia=p("video"),sa=p("embed"),aa=p("iframe"),ca=p("object"),la=p("param"),ua=p("picture"),da=p("portal"),fa=p("source"),pa=p("svg",I),ma=p("math"),ga=p("canvas"),ba=p("noscript"),ha=p("script"),ya=p("del"),va=p("ins"),Sa=p("caption"),xa=p("col"),wa=p("colgroup"),Ta=p("table"),Ea=p("tbody"),ka=p("td"),Ca=p("tfoot"),Aa=p("th"),_a=p("thead"),Na=p("tr"),ct=p("button"),Ra=p("datalist"),La=p("fieldset"),Ma=p("form"),Oa=p("input"),Pa=p("label"),Da=p("legend"),$a=p("meter"),Ha=p("optgroup"),Ia=p("option"),Ba=p("output"),Va=p("progress"),ja=p("select"),Fa=p("textarea"),za=p("details"),Wa=p("dialog"),qa=p("menu"),Ua=p("summary"),Ka=p("slot"),Ga=p("template"),Ja=p("base"),Ya=p("link"),Xa=p("meta"),Be=p("style"),Za=p("circle",I),Qa=p("ellipse",I),ec=p("g",I),tc=p("line",I),nc=p("path",I),rc=p("polygon",I),oc=p("polyline",I),ic=p("rect",I),sc=p("text",I),ac=p("tspan",I),cc=p("defs",I),lc=p("clipPath",I),uc=p("mask",I),dc=p("pattern",I),fc=p("linearGradient",I),pc=p("radialGradient",I),mc=p("stop",I),gc=p("use",I),bc=p("symbol",I),hc=p("marker",I),yc=p("center"),vc=p("font"),Sc=p("marquee"),xc=e=>p(e);var mn="__sibuPendingError";function Or(e,t){let n=()=>e.parentNode?(L(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[mn]=t)})}function kt(e){let t=e,n=t[mn];if(n instanceof Error)return delete t[mn],n}function Pr(e){let t=null;return function(){if(t)return t();let r=O({class:"sibu-lazy"}),o=!1;return e().then(Z(i=>{if(o)return;t=i.default;let s=t();ne(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));ne(r,O({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Or(r,s)}),r.appendChild(W("sibu-lazy-loading","Loading...")),A(r,()=>{o=!0}),r}}function Dr({nodes:e,fallback:t}){let n=O({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;A(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&F(s)});let a=Z(()=>{if(!o)try{let c=e();if(s=c,c.classList.contains("sibu-lazy")){if(!c.querySelector(".sibu-lazy-loading")){ne(n,c);return}i=new MutationObserver(()=>{if(o)return;c.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,ne(n,c))}),i.observe(c,{childList:!0,subtree:!0})}else ne(n,c)}catch(c){let l=c instanceof Error?c:new Error(String(c));Or(n,l)}});return queueMicrotask(a),n}function yn(e,t){return()=>Je()===e?t():Et(e,t)}function At(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";L(n,{phase:r,name:t});return}}function gn(e,t,n,r,o){let i=At(e,t);if(typeof i!="function")return;let s=yn(o,i);r()||!n.isConnected?At(s,"onUnmount"):Hr(s,n)}var Xe=new WeakMap,Ve=new WeakMap,Ee=new Set,ke=new Set,Ze=null,Ct=0,wc=256;function bn(e){let t=Xe.get(e);if(t){Xe.delete(e),Ee.delete(e);for(let n of t)try{n()}catch{}}}function hn(e){Ve.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=Ve.get(e);if(n){Ve.delete(e),ke.delete(e);for(let r of n)try{r()}catch{}}})}function Tc(e){if(Ee.size===0||e.nodeType!==1)return;let t=e;if(Ee.has(t)&&t.isConnected&&bn(t),t.firstElementChild)for(let n of Array.from(Ee))n!==t&&n.isConnected&&t.contains(n)&&bn(n)}function Ec(e){if(ke.size===0||e.nodeType!==1)return;let t=e;if(ke.has(t)&&!t.isConnected&&hn(t),t.firstElementChild)for(let n of Array.from(ke))n!==t&&!n.isConnected&&t.contains(n)&&hn(n)}function kc(){if(Ee.size>0)for(let e of Array.from(Ee))e.isConnected&&bn(e);if(ke.size>0)for(let e of Array.from(ke))e.isConnected||hn(e)}function $r(){Ze||typeof document>"u"||(Ze=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Tc(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Ec(t.removedNodes[n])}Ct+=e.length,Ct>=wc&&(Ct=0,kc()),vn()}),Ze.observe(document.body,{childList:!0,subtree:!0}))}function vn(){Ze&&Ee.size===0&&ke.size===0&&(Ze.disconnect(),Ze=null,Ct=0)}function Cc(e,t){let n=Xe.get(e);return n||(n=[],Xe.set(e,n)),n.push(t),Ee.add(e),$r(),()=>{let r=Xe.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Xe.delete(e),Ee.delete(e))}vn()}}function Ac(e,t){let n=Ve.get(e);return n||(n=[],Ve.set(e,n)),n.push(t),ke.add(e),$r(),()=>{let r=Ve.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(Ve.delete(e),ke.delete(e))}vn()}}function _t(e,t){if(typeof document>"u")return;let n=Je();if(e=yn(n,e),t){let r=!1,o=()=>r;if(A(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||gn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){gn(e,"onMount",t,o,n);return}let i=Cc(t,()=>{r||gn(e,"onMount",t,o,n)});A(t,i)})}else queueMicrotask(()=>{At(e,"onMount")})}function _c(e,t){typeof document>"u"||Hr(yn(Je(),e),t)}function Hr(e,t){let n=!1,r=()=>{n||(n=!0,At(e,"onUnmount"))};A(t,r);let o=()=>{if(n)return;let i=Ac(t,r);A(t,i)};t.isConnected?o():_t(()=>{o()},t)}function Nc(e,t){A(t,e)}function ue(e,t,n){try{e.emit(t,n)}catch{}}var Sn=Symbol.for("sibujs.ssr.v1");function Rc(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof It=="function"&&(t=It("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Le=globalThis[Sn]??(globalThis[Sn]=Rc()),je=Le.als,Q=Le.fallbackStore;Le.fallbackDepth??(Le.fallbackDepth=0);var Ir=!1;function Lc(){if(Ir||je||!(typeof process<"u"&&!!process.versions?.node))return;Ir=!0;let t=process.versions.node;P(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). 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 Fe(){if(je){let e=je.getStore();if(e)return e}return Q}function Br(){return je?je.getStore()??null:Le.fallbackDepth>0?Q:null}function ge(){return Fe().ssr}function Vr(e){if(!ge())return null;let t=Fe(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function jr(){Fe().ssr=!0}function Fr(){Fe().ssr=!1}function zr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(je)return je.run(t,e);Lc();let n=Q.ssr,r=Q.suspenseIdCounter,o=Q.idCounter,i=Q.locale;Q.ssr=!0,Q.suspenseIdCounter=0,Q.idCounter=0,Q.locale=void 0,Le.fallbackDepth++;try{return e()}finally{Le.fallbackDepth--,Q.ssr=n,Q.suspenseIdCounter=r,Q.idCounter=o,Q.locale=i}}function Wr(e){let t=Fe(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Gr=globalThis;function Mc(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,me(()=>t(o,void 0));else{let i=n;n=o,me(()=>t(o,i))}}}var qr=100;function Nt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Je()?Ur(t):Et(n,()=>Ur(t))}function Ur(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){L(n,{phase:"cleanup"})}}function Kr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Nt(e),Re(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=qr);e.rerunPending&&(e.rerunPending=!1,L(new Error(`effect re-requested itself ${qr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function Oc(e){if(e.disposed)return;e.disposed=!0;let t=Gr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Nt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ie(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function ee(e,t){if(j(typeof e=="function","effect: argument must be a function."),ge())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&Nt(n),Re(n.bodyFn,o),n.rerunPending&&Kr(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{Re(n.bodyFn,n.subscriber),n.rerunPending&&Kr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Nt(n),Ie(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Gr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ue(i,"effect:create",{effectFn:e}),()=>Oc(n)}var lt=0,xn=new Set;function Pc(e){lt++;try{return e()}finally{lt--,lt===0&&Hc()}}function Dc(e){return lt===0?!1:(xn.add(e),!0)}function $c(){return lt>0}function Hc(){try{for(let e of xn)Cr(e)}finally{xn.clear()}kr()}var Jr=Symbol.for("sibujs.reactive.batch.v1");function Ic(){let e=globalThis,t=e[Jr];if(t)return t;let n={batch:Pc,enqueueBatchedSignal:Dc,isBatching:$c};return e[Jr]=n,n}var wn=Ic(),q=wn.batch,ze=wn.enqueueBatchedSignal,Bc=wn.isBatching;var Tn=globalThis;function N(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return He(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let c=n.value,l=typeof a=="function"?a(c):a;if(!o(c,l)){if(n.value=l,n.__v++,!0){let d=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ue(d,"signal:update",{signal:n,name:r,oldValue:c,newValue:l})}ze(n)||Ge(n)}}:s=a=>{let c=n.value,l=typeof a=="function"?a(c):a;if(Object.is(l,c))return;n.value=l,n.__v++;let d=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&ue(d,"signal:update",{signal:n,name:r,oldValue:c,newValue:l}),ze(n)||Ge(n)},!0){let a=Tn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ue(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Vc(e){let[t,n]=N(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var jc=`
|
|
5
|
+
`?2:1;continue}if(Gn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Gn(e[s]);)i+=e[s],s++;s<e.length&&di(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
6
|
+
`?2:1);let a=Number.parseInt(i,16),u=a===0||a>1114111||a>=55296&&a<=57343;t+=u?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var Jn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],pi=4,mi=5,gi=8;function bi(e){if(!e)return"an element";let t=e.tagName.toLowerCase(),n=e.getAttribute("id");n&&(t+=`#${n}`);let r=e.getAttribute("class");return r&&(t+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${t}>`}var qt=new Set,Yn=100,Xn=!1;function ht(e,t,n){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","image() fetches its string argument as a URL, the same exfiltration channel as url()","src() fetches its string argument as a URL, the same exfiltration channel as url()"],o=n?.property?`${n.property}: ${e}`:e,i=bi(n?.element),s=`${i}|${o}`;return qt.has(s)?"":qt.size>=Yn?Xn?"":(Xn=!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.`):(qt.add(s),`style declaration "${o}" was dropped by the style sanitizer on ${i} \u2014 ${r[t]}. 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 Zn(e){return(e.includes("\\")?fi(e):e).toLowerCase().replace(/\s+/g,"")}function Ut(e){if(!ci.test(e))return-1;let t=Zn(e);for(let n=0;n<Jn.length;n++)if(t.includes(Jn[n]))return n;return-1}function vt(e,t,n){let r=Kt(e,t);return r===-1?t:(ht(t,r,{property:e,element:n?.element}),"")}function Kt(e,t){let n=Ut(t);if(n!==-1)return n;let r=ae(e);return r==="behavior"?mi:r==="-moz-binding"?pi:(r==="filter"||r==="-ms-filter")&&Zn(t).includes("progid:")?gi:-1}function hi(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let u=e.indexOf("*/",s+2);if(u===-1)return null;s=u+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let u=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(u))continue;let l=s.slice(a+1).trim(),c=/!\s*important\s*$/i.exec(l);if(c&&(l=l.slice(0,c.index).trim()),l==="")continue;let m=u.startsWith("--")?u:ae(u);i.push([m,l,c!==null])}return i}function yi(e,t){let n=String(e),r=hi(n);if(r===null)return Ut(n)!==-1&&ht(n,Ut(n),t),"";let o=[];for(let[i,s,a]of r){let u=Kt(i,s);if(u!==-1){ht(s,u,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function St(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return yi(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),u=Kt(s,a);if(u!==-1){ht(a,u,{property:s,element:t?.element});continue}let l=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${l?` !${l}`:""}`)}return o.join("; ")}var Gt=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),vi=new Set(["srcdoc"]);function ut(e){return vi.has(e.toLowerCase())}function Qn(e){return Gt.has(e.toLowerCase())}function Si(e){let t=e.toLowerCase();return t==="style"||Gt.has(t)}function xi(e,t,n){let r=e.toLowerCase();return r==="srcset"?li(t):Gt.has(r)?yt(t):r==="style"?St(t,n):t}function er(e,t,n){if(!Si(e))return t;let r=xi(e,t,n);return r===""?null:r}function Oe(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function xt(e){let t=0,n=e.length;for(;t<n&&Oe(e[t]);)t++;for(;n>t&&Oe(e[n-1]);)n--;return e.slice(t,n)}var ue=e=>({kind:"forbidden",reason:e});function wi(e){let t=xt(Ke(e));if(t==="")return ue("empty content");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ue("missing or non-numeric delay");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ue("unparseable delay");for(;n<t.length&&Oe(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ue("unexpected text after delay");for(n++;n<t.length&&Oe(t[n]);)n++;let o=n;for(;n<t.length&&!Oe(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ue(`unsupported refresh key ${JSON.stringify(i)}`);for(;n<t.length&&Oe(t[n]);)n++;if(t[n]!=="=")return ue("missing '=' after url");for(n++;n<t.length&&Oe(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let l=t.indexOf(a,n+1);if(l===-1)return ue("unterminated quoted destination");if(s=t.slice(n+1,l),xt(t.slice(l+1))!=="")return ue("trailing text after quoted destination")}else if(s=xt(t.slice(n)),/[;,]/.test(s))return ue("multiple refresh assignments");if(s==="")return ue("empty destination");let u=yt(s);return u===""?ue("destination uses a disallowed protocol"):{kind:"allowed",delay:r,destination:s,sanitizedDestination:u}}function Jt(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=ae(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ue(`duplicate case-insensitive attribute ${JSON.stringify(r)}`):typeof t!="string"?{kind:"not-refresh"}:xt(Ke(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:wi(n)}var Ti="http://www.w3.org/1999/xhtml",Ei="http://www.w3.org/2000/svg",ki=new Set(["script","iframe","object","embed","frame","frameset"]);function nr(e){return ae(e)}function rr(e){return ki.has(nr(e))}var _i=new Set(["script","style"]);function or(e){return _i.has(nr(e))}var B={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},Ci=new Set(["src","href","xlink:href","type","language"]),Ai=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Yt=new WeakSet;function ir(e){return e.namespaceURI===Ti||e.namespaceURI===null}function sr(e,t,n){let r=new Map,o=e.attributes;for(let i=0;i<o.length;i++){let s=o[i];s.name!==t&&r.set(s.name,s.value)}return t!==null&&n!==null&&r.set(t,n),r}function Ni(e){Yt.has(e)||(Yt.add(e),e.getAttribute("content")!==null&&Jt(sr(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function Ri(e,t,n,r){if(!ir(e))return B.None;let o=ae(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&Ni(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return B.None;let i=Jt(sr(e,o,n));return i.kind==="forbidden"?B.MetaRefreshForbidden:i.kind!=="not-refresh"&&Yt.has(e)?B.MetaRefreshReactive:B.None}function Li(e,t){if(t===null||ae(e)!=="attributename")return B.None;let n=Ke(t);return Qn(n)||_e(n)||ut(n)?B.AnimationTarget:B.None}var wt=new WeakSet;function tr(e){if(e===null)return!1;let t=ae(e);if(!t.includes("stylesheet"))return!1;let n=t.split(/[\t\n\f\r ]+/);for(let r=0;r<n.length;r++)if(n[r]==="stylesheet")return!0;return!1}function Mi(e,t,n,r){if(!ir(e))return B.None;let o=ae(t);return o==="href"?r==="static"||n===null?B.None:tr(e.getAttribute("rel"))?B.StylesheetSource:(wt.add(e),B.None):o==="rel"&&tr(n)&&wt.has(e)&&e.hasAttribute("href")?B.StylesheetSource:B.None}function Xt(e,t,n,r){let o=e.localName;return o==="meta"?Ri(e,t,n,r):o==="link"?Mi(e,t,n,r):o==="script"?r==="static"||n===null?B.None:Ci.has(ae(t))?B.ScriptSource:B.None:Ai.has(o)&&e.namespaceURI===Ei?Li(t,n):B.None}function Zt(e,t,n){e.localName!=="link"||ae(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?wt.add(e):wt.delete(e))}var Oi="http://www.w3.org/1999/xhtml",Pi="http://www.w3.org/2000/svg",Di="http://www.w3.org/1999/xlink",$i="http://www.w3.org/XML/1998/namespace",Hi=new Set(["checked","disabled","selected"]);function Ii(e){return e.namespaceURI===null||e.namespaceURI===Oi}function ur(e,t,n){ne(()=>`${e}: refusing "${t}" in this element's context \u2014 ${["",'the element would become a <meta http-equiv="refresh"> directive the shared refresh policy forbids (a destination outside the URL allowlist, or a directive too malformed to read unambiguously)',"a <meta> whose http-equiv or content is reactive may never carry a refresh directive: a browser schedules the navigation as soon as the directive is valid, and nothing can withdraw it when the state changes back","a runtime value may not choose the program a <script> runs; name the script in static template source, or load it through Head({ script }) as an explicit trust decision","an SVG animation may not target a URL, event-handler or nested-document attribute; its to / values would be written into that attribute without passing the URL policy",'a runtime-chosen href may not become an applied <link rel="stylesheet">: a well-formed URL is not a trusted stylesheet. Name the stylesheet in static template source, or load a runtime-chosen one through Head({ link }) as an explicit trust decision'][n]}. The write was not performed.`)}function ar(e,t,n){e[t]=n}function Bi(e,t){if(e.namespaceURI!==Pi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?Di:n.startsWith("xml:")?$i:null}function de(e,t,n,r={}){let o=Vi(e,t,n,r);return e.localName==="link"&&Zt(e,t,r.reactive?"reactive":"runtime"),o}function Vi(e,t,n,r){let o=Bi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(_e(t))return D(`${r.label??"setSafeAttribute"}: refusing to set event-handler attribute "${t}". Its value would be evaluated as JavaScript. Use on:{ ${t.slice(2)}: fn } instead.`),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Xt(e,t,s,r.reactive?"reactive":"runtime");if(a!==B.None)return ur(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(ut(t))return D(`${r.label??"setSafeAttribute"}: refusing to set "${t}". 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(t),!1;let u=Ii(e),l=u?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let g=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==g&&(o?e.setAttributeNS(o,t,g):e.setAttribute(t,g)),!0}return u&&Hi.has(l)&&l in e?ar(e,l,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let c=String(n);if(r.syncValueProperty!==!1&&u&&(l==="value"||l==="checked")&&l in e)return ar(e,l,l==="checked"?!!n:c),!0;let m=c===""?"":er(t,c,{element:e});return m===null?(o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0):((o?e.getAttributeNS(o,i):e.getAttribute(t))===m||(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0)}function Qt(e,t,n){if(ut(t))return D(`html: refusing static attribute "${t}" \u2014 the browser parses it as a nested document.`),!1;let r=Xt(e,t,n,"static");return r!==B.None?(ur("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Zt(e,t,"static"),!0)}var ji=4096,en=[];function Fi(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function zi(e,t,n){let r=en.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Fi();return o.sig=e,o.sub=t,o.epoch=n,o}function lr(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,en.length<ji&&en.push(e)}function Wi(e,t){let n=e.subsHead??null;t.sigPrev=null,t.sigNext=n,n?n.sigPrev=t:e.subsTail=t,e.subsHead=t,e.__sc=(e.__sc??0)+1}function cr(e){let t=e.sig;if(!t)return;let n=e.sigPrev,r=e.sigNext;n?n.sigNext=r:t.subsHead=r,r?r.sigPrev=n:t.subsTail=n,t.__sc=(t.__sc??1)-1,t.__activeNode===e&&(t.__activeNode=e.prevActive),t.__sc===0&&(t.subsHead=null,t.subsTail=null)}function qi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Ui(e){let t=e.sub;if(!t)return;let n=e.subPrev,r=e.subNext;n?n.subNext=r:t.depsHead=r,r?r.subPrev=n:t.depsTail=n}var fe=null,Se=null,Ce=0,Ae=[],X=new Set,Ki=[];function Gi(e){try{e()}catch(t){let n=e;M(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function Ji(e){let t=e.depsHead??null;if(t===null)return!0;for(;t!==null;){let n=t.sig;if(n===null)return!0;if(n._d===!0&&n._validate!==void 0)try{n._validate()}catch{return!0}if(t.depVersion!==n.__v)return!0;t=t.subNext}return!1}var ye=0,xe=!1;function nn(){ye===0&&(Se=fe,fe=null,xe=!0),ye++}function rn(){ye--,ye===0&&(fe=Se,Se=null,xe=!1)}function dr(){return xe}function fr(e){nn();try{return e()}finally{rn()}}var le=null;function on(){return le}function _t(e,t){let n=le;le=e;try{return t()}finally{le=n}}function sn(e){let t=le;return t===null?e:(...n)=>_t(t,()=>e(...n))}var Ge=null,Yi=0;function an(e,t){let n=fe,r=0,o=null;xe&&(r=ye,o=Se,ye=0,Se=null,xe=!1),fe=t;let i=t;i._cap===void 0&&(i._cap=zn());let s=le;s!==null&&!i._epoch&&i._scope===void 0&&(i._scope=s);let a=i._scope===void 0?null:i._scope;a!==s&&(le=a);let u=Ge;u!==null&&!i._epoch&&!i._c&&i._owner==null&&(i._owner=u),i._tok!=null&&(Ge=i._tok);let l=++Yi;i._epoch=l,i._structDirty=!1;for(let c=i.depsHead??null;c!==null;c=c.subNext){let m=c.sig;c.prevActive=m.__activeNode??null,m.__activeNode=c}try{e()}finally{fe=n,le=s,Ge=u,r!==0&&(ye=r,Se=o,xe=!0);let c=i.depsHead??null;for(;c!==null;){let m=c.subNext,h=c.sig;h.__activeNode=c.prevActive,c.prevActive=null,c.epoch!==l&&(Ui(c),cr(c),lr(c)),c=m}}}function pr(e,t){if(!t)return un(e);Je(t);let n=fe,r=0,o=null;xe&&(r=ye,o=Se,ye=0,Se=null,xe=!1),fe=t;let i=t;i._scope===void 0&&(i._scope=le);let s=le;le=i._scope;try{e()}finally{fe=n,le=s,r!==0&&(ye=r,Se=o,xe=!0);for(let a=i.depsHead??null;a!==null;a=a.subNext){let u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null}}return i._dispose??(i._dispose=()=>Je(t))}function un(e,t,n){return gr(e,t,n===!0)._dispose}function mr(e,t){let n=gr(e,t,!0);return{stop:n._dispose,run:r=>{let o=Ge;Ge=n._tok??null;try{return r()}finally{Ge=o}}}}function gr(e,t,n){let r=()=>{let i=o;if(!(i._disposed||i._reentrant)){i._reentrant=!0;try{an(e,o)}finally{i._reentrant=!1}}},o=r;o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._runEpoch=0,o._runs=0,o._reentrant=!1,o._disposed=!1,o._errorPhase="binding",o._errorNode=t,o._tok=null,o._owner=null,n&&(o._tok={sub:o});try{r()}catch(i){throw o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Je(o),i}return o._dispose=()=>{o._disposed=!0,o._errorNode=void 0,o._tok!=null&&(o._tok.sub=null),Je(o)},o}function br(e){if(!fe)return;let t=fe,n=e,r=t._epoch??0,o=n.__activeNode??null;if(o!==null&&o.sub===t){o.epoch=r,o.depVersion=n.__v??Number.NaN;return}n._validate!==void 0&&(t._hasComputedDep=!0);let i=zi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,qi(t,i),Wi(n,i),t._structDirty=!0}function Je(e){let t=e;t._owner!=null&&(t._owner=null);let n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;cr(n),lr(n),n=r}}var Tt=1e3,Et=1e6,kt=0,Pe=new Set;function hr(e){let t=Tt;return Number.isFinite(e)&&e>0&&(Tt=Math.floor(e)),t}function yr(e){let t=Et;return Number.isFinite(e)&&e>0&&(Et=Math.floor(e)),t}function Xi(e){let t=e;return t._runEpoch!==kt?(t._runEpoch=kt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>Tt)}function Zi(e){let t=e.__name??"<unnamed>";M(new Error(`subscriber "${t}" fired more than ${Tt} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:t})}function Qi(){M(new Error(`Notification drain exceeded ${Et} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function vr(){let e=0;for(;e<Ae.length;){if(e>=Et){Qi();break}let t=Ae[e++];X.delete(t)&&(t._owner!=null&&X.size>0&&(es(t),X.has(t))||Sr(t))}}function es(e){for(;;){let t=null;for(let n=e._owner??null;n!==null;){let r=n.sub;if(r===null)break;X.has(r)&&(t=r),n=r._owner??null}if(t===null)return;X.delete(t),Sr(t)}}function Sr(e){if(Pe.size>0&&Pe.has(e)||e._hasComputedDep===!0&&!Ji(e))return;if(Xi(e)){Zi(e),Pe.add(e);return}let t=Wn(e._cap??null);try{Gi(e)}finally{t&&qn()}}function xr(){if(!(Ce>0)){Ce++,kt++;try{vr()}finally{Ce--,Ce===0&&(Ae.length=0,X.clear(),Pe.size>0&&Pe.clear())}}}function tn(e){e();let t=e._sig;if(!t)return;let n=Ki,r=n.length;for(n.push(t);n.length>r;){let i=n.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,n.push(a)):s()}else X.has(s)||(X.add(s),Ae.push(s));i=i.sigNext}}}function wr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?tn(r):X.has(r)||(X.add(r),Ae.push(r))),n=n.sigNext}}function Tr(e){let n=e.subsHead;if(n){if(Ce>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?tn(o):X.has(o)||(X.add(o),Ae.push(o))),r=r.sigNext}return}Ce++,kt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?tn(o):X.has(o)||(X.add(o),Ae.push(o))),r=r.sigNext}vr()}finally{Ce--,Ce===0&&(Ae.length=0,X.clear(),Pe.size>0&&Pe.clear())}}}function Er(e){return e.__sc??0}function kr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function _r(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var Cr="4.13.1",Ar=Symbol.for("sibujs.reactive.v1");function ns(){let e=globalThis,t=e[Ar];if(t)return!t.__dupWarned&&(t.__dupWarned=!0,D(`Multiple instances of the reactive runtime detected on this page (active: ${t.version}, duplicate: ${Cr}). 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.`)),t;let n={suspendTracking:nn,resumeTracking:rn,isTrackingSuspended:dr,untracked:fr,retrack:an,track:pr,reactiveBinding:un,recordDependency:br,cleanup:Je,setMaxSubscriberRepeats:hr,setMaxDrainIterations:yr,drainNotificationQueue:xr,queueSignalNotification:wr,notifySubscribers:Tr,getSubscriberCount:Er,getSubscriberDeps:kr,forEachSubscriber:_r,getOwnerScope:on,runWithOwnerScope:_t,bindOwnerScope:sn,structuralBinding:mr,version:Cr};return e[Ar]=n,n}var z=ns(),De=z.suspendTracking,$e=z.resumeTracking,Nr=z.isTrackingSuspended,pe=z.untracked,Ne=z.retrack,Ye=z.track,J=z.reactiveBinding,He=z.recordDependency,Ie=z.cleanup,jc=z.setMaxSubscriberRepeats,Rr=z.setMaxDrainIterations,Lr=z.drainNotificationQueue,Mr=z.queueSignalNotification,Xe=z.notifySubscribers,Fc=z.getSubscriberCount,zc=z.getSubscriberDeps,Wc=z.forEachSubscriber,Ze=z.getOwnerScope??on,Ct=z.runWithOwnerScope??_t,Q=z.bindOwnerScope??sn,Be=z.structuralBinding??((e,t)=>({stop:z.reactiveBinding(e,t),run:n=>n()}));function lt(e,t,n){if(_e(t))return de(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){M(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}de(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return J(r,e)}function Or(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(u){M(u,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(u){M(u,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),de(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=J(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var ln=["data-focus-key","id","name"],rs=new Set(["text","search","url","tel","password",""]);function os(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&rs.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 ct(e){if(e.length===0||typeof document>"u")return null;let t=document.activeElement;if(!t||t===document.body)return null;let n=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===t||s.nodeType===1&&s.contains(t)){n=!0;break}}if(!n)return null;let r=null,o=null;for(let i=0;i<ln.length;i++){let s=t.getAttribute(ln[i]);if(s){r=ln[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...os(t)}}function is(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function ss(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let u=0;u<a.length;u++)r++,n??(n=a[u]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function Pr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function Qe(e,t,n,r){if(!e||typeof document>"u"||r==="discard")return;let o=document.activeElement;if(o===e.el||o&&o!==document.body&&o!==document.documentElement)return;if(e.el.isConnected){Pr(e.el,e);return}let i=!1;if(e.attr&&e.value){let{el:s,count:a}=ss(t,`[${e.attr}=${is(e.value)}]`);if(s&&s.tagName===e.tag){Pr(s,e);return}i=a>1}if(r!==void 0&&typeof r=="object"){let s=typeof r.restoreTo=="function"?r.restoreTo():r.restoreTo;if(s?.isConnected&&(s.focus(),document.activeElement===s))return}ne(()=>{let s=e.attr?` (${e.attr}="${e.value}")`:"",a=i?`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`${n}: a reactive rebuild discarded the focused element <${e.tag.toLowerCase()}>${s} and could not re-establish it, so focus fell back to <body>. An in-progress edit ends here, and an in-progress IME composition is lost outright \u2014 a composition belongs to the DOM node, so it cannot survive the node being destroyed. ${a}, or stop the rebuild from happening: key the subtree with match(() => shapeKey(), { \u2026 }) so it is re-created only when the shape actually changes, and drive the rest with reactive attributes and text children, which mutate nodes in place instead of replacing them. If dropping focus is INTENDED here (closing a panel, say), pass { focus: "discard" } to when()/match() to silence this, or { focus: { restoreTo: element } } to send focus somewhere other than <body>.`})}function we(e,t){let n=[];function r(){let o;try{o=t()}catch(c){M(c,{phase:"binding",name:"bindChildNode",node:e});return}let i=ct(n);if(o==null||typeof o=="boolean"){for(let c=0;c<n.length;c++){let m=n[c];F(m),m.parentNode&&m.parentNode.removeChild(m)}n.length=0,Qe(i,n,"bindChildNode");return}let s=e.parentNode;if(!s){n.length=0;return}let a;if(Array.isArray(o)){a=[];let c=new Set;for(let m=0;m<o.length;m++){let h=o[m];if(h==null||typeof h=="boolean")continue;let g=h instanceof Node?h:document.createTextNode(String(h));if(c.has(g)){D("bindChildNode: duplicate node reference in array \u2014 only the first occurrence is rendered.");continue}c.add(g),a.push(g)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let u;if(n.length>0&&a.length>0){let c=new Set(n);u=new Set;for(let m=0;m<a.length;m++)c.has(a[m])&&u.add(a[m])}for(let c=0;c<n.length;c++){let m=n[c];u?.has(m)||(F(m),m.parentNode&&m.parentNode.removeChild(m))}let l=e;for(let c=0;c<a.length;c++){let m=a[c];l.nextSibling!==m&&s.insertBefore(m,l.nextSibling),l=m}n=a,Qe(i,a,"bindChildNode")}return J(r,e,!0)}function cn(){throw new Error('[SibuJS] renderToString needs a DOM: register happy-dom or jsdom globals first. There is no global `document`, and SibuJS builds live DOM nodes, on the server too. For example: import { GlobalRegistrator } from "@happy-dom/global-registrator"; GlobalRegistrator.register(); See SSR in AGENTS.md \xA710.')}function oe(){typeof document>"u"&&cn()}var I="http://www.w3.org/2000/svg",as=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var dn=new Set,Dr=100,$r=!1,Hr=new Map;function Ir(e){let t=Hr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),Hr.set(e,t)),t}function us(e,t){if(typeof t=="function"){let r=t,o=[],i=!1,s=J(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",St(String(a),{element:e}));return}let u=e.style;i&&(e.removeAttribute("style"),i=!1);let l=[];for(let c in a){if(!Object.hasOwn(a,c))continue;let m=a[c];if(m==null)continue;let h=Ir(c);l.push(h),u.setProperty(h,vt(h,String(m),{element:e}))}for(let c=0;c<o.length;c++)l.indexOf(o[c])===-1&&u.removeProperty(o[c]);o=l},e);_(e,s);return}if(typeof t=="string"){e.setAttribute("style",St(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=Ir(r);if(typeof o=="function"){let s=o,a=J(()=>{n.style.setProperty(i,vt(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,vt(i,String(o),{element:e}))}}function ls(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=J(()=>{let s=t();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);_(e,i);return}let n=t,r=!1,o="";for(let i in n){if(!Object.hasOwn(n,i))continue;let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=J(()=>{let a="";for(let u in n){if(!Object.hasOwn(n,u))continue;let l=n[u];(typeof l=="function"?l():l)&&(a=a?`${a} ${u}`:u)}e.setAttribute("class",a)},e);_(e,s)}else e.setAttribute("class",o)}function fn(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(e,we(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),_(e,we(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),_(e,we(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,t){let n=rr(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);typeof document>"u"&&cn();let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),fn(i,o),i):(ne(()=>{let g=r.trim().split(/\s+/);if(g.length<2)return"";let d=0;for(let b=0;b<g.length;b++){let y=g[b];if(!/^-?[A-Za-z_][A-Za-z0-9_:/.-]*$/.test(y))return"";/[-:/0-9]/.test(y)&&d++}if(d<2)return"";let f=`${e}|${r}`;return dn.has(f)?"":dn.size>=Dr?$r?"":($r=!0,`tagFactory: ${Dr} 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.`):(dn.add(f),`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 fn(i,r),i;let s=r,a=s.class;a!=null&&ls(i,a);let u=s.id;typeof u=="function"?_(i,lt(i,"id",u)):u!=null&&(typeof u=="string"&&as.has(u.toLowerCase())&&D(`tagFactory: element id="${u}" matches a common global and may cause DOM clobbering. Avoid setting ids from untrusted input.`),i.id=u);let l=o!==void 0?o:s.nodes;l!=null&&fn(i,l);let c=s.on;if(c)for(let g in c){if(!Object.hasOwn(c,g))continue;let d=c[g];typeof d=="function"?i.addEventListener(g,d):D(`tagFactory: on.${g} handler is not a function (got ${typeof d}). Event listener was not attached.`)}let m=s.style;m!=null&&us(i,m);let h=s.ref;h&&(h.current=i);for(let g in s)switch(g){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{if(!Object.hasOwn(s,g))continue;let d=s[g];if(d==null||_e(g))continue;typeof d=="function"?_(i,lt(i,g,d)):de(i,g,d,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var hd=p("html"),cs=p("head"),ds=p("body"),fs=p("title"),P=p("div"),q=p("span"),ps=p("section"),ms=p("article"),gs=p("header"),bs=p("footer"),hs=p("nav"),ys=p("main"),vs=p("aside"),Ss=p("address"),pn=p("p"),xs=p("h1"),ws=p("h2"),mn=p("h3"),Ts=p("h4"),Es=p("h5"),ks=p("h6"),_s=p("blockquote"),Cs=p("dd"),As=p("dl"),Ns=p("dt"),Rs=p("figcaption"),Ls=p("figure"),Ms=p("hr"),Os=p("li"),Ps=p("ol"),Ds=p("ul"),gn=p("pre"),$s=p("a"),Hs=p("abbr"),Is=p("b"),Bs=p("bdi"),Vs=p("bdo"),js=p("br"),Fs=p("cite"),bn=p("code"),zs=p("data"),Ws=p("dfn"),qs=p("em"),Us=p("i"),Ks=p("kbd"),Gs=p("mark"),Js=p("q"),Ys=p("rp"),Xs=p("rt"),Zs=p("ruby"),Qs=p("s"),ea=p("samp"),ta=p("small"),na=p("strong"),ra=p("sub"),oa=p("sup"),ia=p("time"),sa=p("u"),aa=p("var"),ua=p("area"),la=p("audio"),ca=p("img"),da=p("map"),fa=p("track"),pa=p("video"),ma=p("embed"),ga=p("iframe"),ba=p("object"),ha=p("param"),ya=p("picture"),va=p("portal"),Sa=p("source"),xa=p("svg",I),wa=p("math"),Ta=p("canvas"),Ea=p("noscript"),ka=p("script"),_a=p("del"),Ca=p("ins"),Aa=p("caption"),Na=p("col"),Ra=p("colgroup"),La=p("table"),Ma=p("tbody"),Oa=p("td"),Pa=p("tfoot"),Da=p("th"),$a=p("thead"),Ha=p("tr"),dt=p("button"),Ia=p("datalist"),Ba=p("fieldset"),Va=p("form"),ja=p("input"),Fa=p("label"),za=p("legend"),Wa=p("meter"),qa=p("optgroup"),Ua=p("option"),Ka=p("output"),Ga=p("progress"),Ja=p("select"),Ya=p("textarea"),Xa=p("details"),Za=p("dialog"),Qa=p("menu"),eu=p("summary"),tu=p("slot"),nu=p("template"),ru=p("base"),ou=p("link"),iu=p("meta"),Ve=p("style"),su=p("circle",I),au=p("ellipse",I),uu=p("g",I),lu=p("line",I),cu=p("path",I),du=p("polygon",I),fu=p("polyline",I),pu=p("rect",I),mu=p("text",I),gu=p("tspan",I),bu=p("defs",I),hu=p("clipPath",I),yu=p("mask",I),vu=p("pattern",I),Su=p("linearGradient",I),xu=p("radialGradient",I),wu=p("stop",I),Tu=p("use",I),Eu=p("symbol",I),ku=p("marker",I),_u=p("center"),Cu=p("font"),Au=p("marquee"),Nu=e=>p(e);var hn="__sibuPendingError";function Br(e,t){let n=()=>e.parentNode?(M(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[hn]=t)})}function At(e){let t=e,n=t[hn];if(n instanceof Error)return delete t[hn],n}function Vr(e){let t=null;return function(){if(t)return t();let r=P({class:"sibu-lazy"}),o=!1;return e().then(Q(i=>{if(o)return;t=i.default;let s=t();re(r,s)})).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));re(r,P({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Br(r,s)}),r.appendChild(q("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function jr({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;_(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&F(s)});let a=Q(()=>{if(!o)try{let u=e();if(s=u,u.classList.contains("sibu-lazy")){if(!u.querySelector(".sibu-lazy-loading")){re(n,u);return}i=new MutationObserver(()=>{if(o)return;u.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,re(n,u))}),i.observe(u,{childList:!0,subtree:!0})}else re(n,u)}catch(u){let l=u instanceof Error?u:new Error(String(u));Br(n,l)}});return queueMicrotask(a),n}function xn(e,t){return()=>Ze()===e?t():Ct(e,t)}function Rt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";M(n,{phase:r,name:t});return}}function yn(e,t,n,r,o){let i=Rt(e,t);if(typeof i!="function")return;let s=xn(o,i);r()||!n.isConnected?Rt(s,"onUnmount"):zr(s,n)}var et=new WeakMap,je=new WeakMap,Te=new Set,Ee=new Set,tt=null,Nt=0,Ru=256;function vn(e){let t=et.get(e);if(t){et.delete(e),Te.delete(e);for(let n of t)try{n()}catch{}}}function Sn(e){je.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=je.get(e);if(n){je.delete(e),Ee.delete(e);for(let r of n)try{r()}catch{}}})}function Lu(e){if(Te.size===0||e.nodeType!==1)return;let t=e;if(Te.has(t)&&t.isConnected&&vn(t),t.firstElementChild)for(let n of Array.from(Te))n!==t&&n.isConnected&&t.contains(n)&&vn(n)}function Mu(e){if(Ee.size===0||e.nodeType!==1)return;let t=e;if(Ee.has(t)&&!t.isConnected&&Sn(t),t.firstElementChild)for(let n of Array.from(Ee))n!==t&&!n.isConnected&&t.contains(n)&&Sn(n)}function Ou(){if(Te.size>0)for(let e of Array.from(Te))e.isConnected&&vn(e);if(Ee.size>0)for(let e of Array.from(Ee))e.isConnected||Sn(e)}function Fr(){tt||typeof document>"u"||(tt=new MutationObserver(e=>{for(let t of e)if(t.type==="childList"){if(t.addedNodes.length>0)for(let n=0;n<t.addedNodes.length;n++)Lu(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)Mu(t.removedNodes[n])}Nt+=e.length,Nt>=Ru&&(Nt=0,Ou()),wn()}),tt.observe(document.body,{childList:!0,subtree:!0}))}function wn(){tt&&Te.size===0&&Ee.size===0&&(tt.disconnect(),tt=null,Nt=0)}function Pu(e,t){let n=et.get(e);return n||(n=[],et.set(e,n)),n.push(t),Te.add(e),Fr(),()=>{let r=et.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(et.delete(e),Te.delete(e))}wn()}}function Du(e,t){let n=je.get(e);return n||(n=[],je.set(e,n)),n.push(t),Ee.add(e),Fr(),()=>{let r=je.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(je.delete(e),Ee.delete(e))}wn()}}function Lt(e,t){if(typeof document>"u")return;let n=Ze();if(e=xn(n,e),t){let r=!1,o=()=>r;if(_(t,()=>{r=!0}),t.isConnected){queueMicrotask(()=>{r||yn(e,"onMount",t,o,n)});return}queueMicrotask(()=>{if(r)return;if(t.isConnected){yn(e,"onMount",t,o,n);return}let i=Pu(t,()=>{r||yn(e,"onMount",t,o,n)});_(t,i)})}else queueMicrotask(()=>{Rt(e,"onMount")})}function $u(e,t){typeof document>"u"||zr(xn(Ze(),e),t)}function zr(e,t){let n=!1,r=()=>{n||(n=!0,Rt(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=Du(t,r);_(t,i)};t.isConnected?o():Lt(()=>{o()},t)}function Hu(e,t){_(t,e)}function ce(e,t,n){try{e.emit(t,n)}catch{}}var Tn=Symbol.for("sibujs.ssr.v1");function Iu(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let t=null,n=process.getBuiltinModule;typeof n=="function"?t=n("node:async_hooks"):typeof jt=="function"&&(t=jt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var Re=globalThis[Tn]??(globalThis[Tn]=Iu()),Fe=Re.als,ee=Re.fallbackStore;Re.fallbackDepth??(Re.fallbackDepth=0);var Wr=!1;function Bu(){if(Wr||Fe||!(typeof process<"u"&&!!process.versions?.node))return;Wr=!0;let t=process.versions.node;D(`SSR request isolation is UNAVAILABLE on this runtime (Node ${t}). 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 ze(){if(Fe){let e=Fe.getStore();if(e)return e}return ee}function qr(){return Fe?Fe.getStore()??null:Re.fallbackDepth>0?ee:null}function me(){return ze().ssr}function Ur(e){if(!me())return null;let t=ze(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Kr(){ze().ssr=!0}function Gr(){ze().ssr=!1}function Jr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Fe)return Fe.run(t,e);Bu();let n=ee.ssr,r=ee.suspenseIdCounter,o=ee.idCounter,i=ee.locale;ee.ssr=!0,ee.suspenseIdCounter=0,ee.idCounter=0,ee.locale=void 0,Re.fallbackDepth++;try{return e()}finally{Re.fallbackDepth--,ee.ssr=n,ee.suspenseIdCounter=r,ee.idCounter=o,ee.locale=i}}function Yr(e){let t=ze(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var eo=globalThis;function Vu(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,pe(()=>t(o,void 0));else{let i=n;n=o,pe(()=>t(o,i))}}}var Xr=100;function Mt(e){let t=e.userCleanups;if(t.length===0)return;e.userCleanups=[];let n=e.subscriber._scope??null;n===Ze()?Zr(t):Ct(n,()=>Zr(t))}function Zr(e){for(let t=e.length-1;t>=0;t--)try{e[t]()}catch(n){M(n,{phase:"cleanup"})}}function Qr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&Mt(e),Ne(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Xr);e.rerunPending&&(e.rerunPending=!1,M(new Error(`effect re-requested itself ${Xr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function ju(e){if(e.disposed)return;e.disposed=!0;let t=eo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&Mt(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Ie(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function te(e,t){if(j(typeof e=="function","effect: argument must be a function."),me())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&Mt(n),Ne(n.bodyFn,o),n.rerunPending&&Qr(n)}finally{n.running=!1,n.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,n.subscriber=o,n.running=!0;try{Ne(n.bodyFn,n.subscriber),n.rerunPending&&Qr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&Mt(n),Ie(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=eo.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&ce(i,"effect:create",{effectFn:e}),()=>ju(n)}var ft=0,En=new Set;function Fu(e){ft++;try{return e()}finally{ft--,ft===0&&qu()}}function zu(e){return ft===0?!1:(En.add(e),!0)}function Wu(){return ft>0}function qu(){try{for(let e of En)Mr(e)}finally{En.clear()}Lr()}var to=Symbol.for("sibujs.reactive.batch.v1");function Uu(){let e=globalThis,t=e[to];if(t)return t;let n={batch:Fu,enqueueBatchedSignal:zu,isBatching:Wu};return e[to]=n,n}var kn=Uu(),U=kn.batch,We=kn.enqueueBatchedSignal,Ku=kn.isBatching;var _n=globalThis;function A(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=t?.name,o=t?.equals;r&&(n.__name=r);function i(){return He(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let u=n.value,l=typeof a=="function"?a(u):a;if(!o(u,l)){if(n.value=l,n.__v++,!0){let c=_n.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ce(c,"signal:update",{signal:n,name:r,oldValue:u,newValue:l})}We(n)||Xe(n)}}:s=a=>{let u=n.value,l=typeof a=="function"?a(u):a;if(Object.is(l,u))return;n.value=l,n.__v++;let c=_n.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ce(c,"signal:update",{signal:n,name:r,oldValue:u,newValue:l}),We(n)||Xe(n)},!0){let a=_n.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&ce(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function Gu(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var Ju=`
|
|
8
8
|
.sibu-error-display {
|
|
9
9
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
10
10
|
border-radius: 10px;
|
|
@@ -185,11 +185,11 @@
|
|
|
185
185
|
border: 1px solid #3a3a4e;
|
|
186
186
|
}
|
|
187
187
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
188
|
-
`,
|
|
189
|
-
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function
|
|
188
|
+
`,no=!1;function Yu(){if(no||typeof document>"u")return;let e=Ve({nodes:Ju});document.head.appendChild(e),no=!0}function Xu(e){let t=[],n=e.split(`
|
|
189
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function ro(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=Xu(r),i=e.cause,s=i!=null?ro(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function Zu(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
190
190
|
`).map(s=>` ${s}`).join(`
|
|
191
191
|
`);r.push(i)}o=o.cause}if(t&&Object.keys(t).length>0){r.push(""),r.push("Metadata:");for(let[i,s]of Object.entries(t))r.push(` ${i}: ${String(s)}`)}return r.push(""),r.push("Environment:"),r.push(` Timestamp: ${new Date().toISOString()}`),typeof location<"u"&&r.push(` URL: ${location.href}`),typeof navigator<"u"&&navigator.userAgent&&r.push(` User Agent: ${navigator.userAgent}`),r.join(`
|
|
192
|
-
`)}function
|
|
192
|
+
`)}function oo(e){let t=e.map((n,r)=>P({class:"sibu-err-frame",nodes:[q({class:"sibu-err-line",nodes:String(r+1)}),q({class:"sibu-err-fn",nodes:n.fn}),q({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return gn({class:"sibu-err-stack",nodes:t})}function io(e){return e?[P({class:"sibu-err-cause-label",nodes:"Caused by"}),P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[q({nodes:`[${e.code}] ${e.message}`}),q({nodes:""})]}),e.frames.length>0?oo(e.frames):P({class:"sibu-err-stack",nodes:"(no stack)"})]}),...io(e.cause)]:[]}function Qu(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function Cn(e){Yu();let t=e.severity??"error",n=ro(e.error),r=e.alwaysShowDetails??be(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=A("Copy"),u=dt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let g=Zu(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(g).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=P({class:"sibu-err-header",nodes:[bn({class:"sibu-err-icon",nodes:n.code}),mn({class:"sibu-err-title",nodes:o}),u,q({class:"sibu-err-timestamp",nodes:i})]}),c=[pn({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&c.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[q({nodes:"Stack Trace"})]}),oo(n.frames)]})),r&&c.push(...io(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&c.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[q({nodes:"Metadata"})]}),Qu(e.metadata)]}));let m=[];e.onRetry&&m.push(dt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&m.push(dt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),m.length>0&&c.push(P({class:"sibu-err-actions",nodes:m}));let h=P({class:"sibu-err-body",nodes:c});return P({class:"sibu-error-display","data-severity":t,nodes:[l,h]})}var el=`
|
|
193
193
|
.sibu-error-boundary {
|
|
194
194
|
position: relative;
|
|
195
195
|
}
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
344
344
|
background: #3a3a4e;
|
|
345
345
|
}
|
|
346
|
-
`,
|
|
346
|
+
`,tl=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),so=!1;function nl(){if(!so&&typeof document<"u"){let e=Ve({nodes:el});document.head.appendChild(e),so=!0}}function rl(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;nl();let[a,u]=A(null),l=()=>{m(),u(null)},c=null,m=()=>{if(!c)return;let v=c;c=null,v()},h=v=>{let x=new Array(v.length);for(let T=0;T<v.length;T++)try{x[T]=v[T]()}catch($){M($,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[T]=tl}return x},g=()=>{let v=s;if(!v||v.length===0)return;m();let x=null;c=te(()=>{let T=h(v);if(x===null){x=T;return}let $=T.length!==x.length;if(!$){for(let V=0;V<T.length;V++)if(!Object.is(T[V],x[V])){$=!0;break}}x=T,$&&l()})},d=v=>{let x=zt(v);if(u(x),g(),i)try{i(x)}catch(T){M(T,{phase:"render",name:"ErrorBoundary onError callback"})}return x},f=(v,x)=>Cn({error:v,severity:"error",onRetry:x}),b=v=>{let x=o||f;try{return x(v,l)}catch(T){return queueMicrotask(()=>{M(T,{phase:"render",name:"ErrorBoundary fallback",node:y.parentNode?y:void 0})}),document.createComment("error-boundary-failed")}},y=P({class:"sibu-error-boundary",nodes:()=>{let v=a();if(v)return b(v);try{let x=n();if(x&&typeof x.then=="function"){let T=P({class:"sibu-error-async"});T.appendChild(q({class:"sibu-lazy-loading",nodes:"Loading..."}));let $=!1;return _(T,()=>{$=!0}),x.then(V=>{if($){F(V);return}re(T,V)}).catch(Q(V=>{if($)return;let G=d(V);re(T,b(G))})),T}return x}catch(x){let T=d(x);return b(T)}}}),S=v=>{if(a())return;let T=v.detail?.error;T&&(v.preventDefault(),v.stopPropagation(),d(T))};return y.addEventListener("sibu:error-propagate",S),Lt(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],T=v.currentNode;for(;T;){let $=At(T);$&&x.push($),T=v.nextNode()}if(x.length===1)d(x[0]);else if(x.length>1){let $=globalThis.AggregateError;d($?new $(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(V=>V.message).join("; ")))}},y),_(y,()=>{m(),y.removeEventListener("sibu:error-propagate",S)}),y}var ol=`
|
|
347
347
|
@keyframes sibu-spin {
|
|
348
348
|
to { transform: rotate(360deg); }
|
|
349
349
|
}
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
397
397
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
398
398
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
399
|
-
`,to=!1;function Xc(){!to&&typeof document<"u"&&(document.head.appendChild(Be({nodes:Yc})),to=!0)}function Zc(e={}){Xc();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?O({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[O({class:"sibu-loading-dots"},[W({class:"sibu-loading-dot"}),W({class:"sibu-loading-dot"}),W({class:"sibu-loading-dot"})]),t?W({class:"sibu-loading-text"},t):null]):O({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[O({class:"sibu-loading-spinner"}),t?W({class:"sibu-loading-text"},t):null])}var kn=Symbol.for("sibujs.actions.v1"),ro=globalThis[kn]??(globalThis[kn]=new Map);function Qe(e,t){ro.set(e,t)}function oo(e){return ro.get(e)}function Qc(e,t,n){let r=typeof t=="string"?oo(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&A(e,o)}var io=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},no=["pointerup","pointerleave","pointercancel"],so=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=c=>{let l=c.pointerId;r!==null&&l!==o||(i(),o=l,r=setTimeout(()=>{r=null,t.callback()},n))},a=c=>{r!==null&&c.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let c of no)e.addEventListener(c,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let c of no)e.removeEventListener(c,a)}},ao=(e,t)=>{let n=o=>L(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},co=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},lo=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Qe("clickOutside",io);Qe("longPress",so);Qe("copyOnClick",ao);Qe("autoResize",co);Qe("trapFocus",lo);function Rt(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var We=null;function el(e,t){try{let n=e(),r=Rt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):We?We(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):We?We(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function tl(e,t){try{return await e()}catch(n){return t?t(n,"async"):We?We(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function nl(e){We=e}function rl(e){let[t,n]=N(e),r=i=>{!!0||!ge()||P(`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=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let c=s();return c!==null&&typeof c?.then=="function"&&P("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{n(a)}}}}var Cn=Symbol.for("sibujs.createId.v1"),An=globalThis[Cn]??(globalThis[Cn]={n:0});function uo(e="sibu"){let t=Br();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(An.n++,`${e}-${An.n}`)}function fo(){An.n=0}function ol(e,t){let n=typeof t=="function"?t():t;return A(n,Y(()=>{n.style.display=e()?"":"none"},n)),n}function po(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,c=r.has(s),l=!a&&!c;return r.add(s),c&&te(()=>`${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,t.nextSibling),{node:s,owned:l}}function Lt(e,t){t&&F(e),e.parentNode?.removeChild(e)}function il(e,t,n){re();let r=document.createComment("when"),o=null,i,s=!1,a=!1,c=new WeakSet,l=!1,d=()=>{if(a)return;let h=e(),m=r.parentNode;if(!m||s&&Object.is(h,i))return;i=h;let u=o?at([o]):null;o?.parentNode&&(Lt(o,l),o=null);let f=h?t:n!==void 0?n:null,b=me(()=>po(m,r,f,c,"when"));o=b.node,l=b.owned,Ye(u,o?[o]:[],"when"),s=!0},g=Y(d,r);return A(r,()=>{a=!0,g(),o&&Lt(o,l),o=null}),s||queueMicrotask(Z(()=>{!a&&!s&&r.parentNode&&d()})),r}function sl(e,t,n){re();let r=document.createComment("match"),o=null,i,s=!1,a=!1,c=new WeakSet,l=!1,d=()=>{if(a)return;let h=String(e()),m=r.parentNode;if(!m||s&&h===i)return;i=h;let u=o?at([o]):null;o?.parentNode&&(Lt(o,l),o=null);let f=Object.hasOwn(t,h)?t[h]:n,b=me(()=>po(m,r,f??null,c,"match"));o=b.node,l=b.owned,Ye(u,o?[o]:[],"match"),s=!0},g=Y(d,r);return A(r,()=>{a=!0,g(),o&&Lt(o,l),o=null}),s||queueMicrotask(Z(()=>{!a&&!s&&r.parentNode&&d()})),r}function ut(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Mt=ut(Symbol.for("sibujs.components.registry.v1"),()=>new Map),mo=ut(Symbol.for("sibujs.components.registryVersion.v1"),()=>N(0));function go(){let[e,t]=mo;t(me(e)+1)}function al(e,t){Mt.set(e,t),go()}function cl(e){Mt.delete(e)&&go()}function ll(e){let t=Mt.get(e);return t?t():O(`[Component "${e}" not found]`)}function ul(e){let t=O({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(mo[0](),a=Mt.get(s));let c=a??`missing:${s}`;if(c===r)return;let l=me(()=>a?a():O(`[Component "${s}" not found]`));r=c,ne(t,l)}let i=le(o);return A(t,i),t}function bo(e){return typeof e=="function"?bo(e()):e instanceof Node?e:document.createTextNode(String(e))}function dl(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let c=e[a],l=0,d=n.length;for(;l<d;){let g=l+d>>1;e[n[g]]<c?l=g+1:d=g}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function fl(e,t,n){j(typeof e=="function","each: first argument must be a function that returns an array."),j(typeof t=="function","each: second argument must be a render function."),j(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),re();let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,c=0,l=new Map,d=new Map,g=[],h=[],m=[],u=0,f=[],b=[],y=new Uint8Array(0),S=new Map,v=[],x=[],E=new Map,D=!1,V=!1,K=!1,be=n.key,ft=()=>{if(K)return;let k=e(),C=k.length,$=r.parentNode;if(!$)return;V||($.insertBefore(o,r.nextSibling),V=!0),b.length<C&&(b=new Array(C));for(let T=0;T<C;T++)b[T]=be(k[T]);let H=b;f.length<C&&(f=new Array(C)),d.clear(),E.clear();for(let T=0;T<C;T++)E.has(H[T])&&P(`each: duplicate key "${String(H[T])}" at index ${T} (first seen at ${E.get(H[T])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),E.set(H[T],T);u=0;for(let T=0;T<C;T++){let J=H[T],On=l.get(J),rt;if(On!==void 0)rt=On,g[u]=rt,h[u]=k[T],m[u]=T,u++;else{let[Pn,Ho]=N(k[T]),[Dn,Io]=N(T),Ht;try{De();try{Ht=bo(t(Pn,Dn))}finally{$e()}}catch(Bo){let Vo=H[T];Ht=document.createComment(`each:error:${T}`),queueMicrotask(()=>{L(Bo,{phase:"render",name:`each row (key="${String(Vo)}")`,node:r.parentNode?r:void 0})})}rt={node:Ht,item:Pn,setItem:Ho,index:Dn,setIndex:Io}}d.set(J,rt),f[T]=rt.node}for(let[T,J]of l)d.has(T)||(F(J.node),J.node.parentNode&&$.removeChild(J.node));if(C===0){c=0;let T=l;l=d,d=T,D=!0,u=0;return}S.clear();for(let T=0;T<c;T++)S.set(a[T],T);v.length<C&&(v=new Array(C),x=new Array(C));let G=0;for(let T=0;T<C;T++){let J=S.get(H[T]);J!==void 0&&(v[G]=T,x[G]=J,G++)}let nt=dl(x,G);y.length<C?y=new Uint8Array(C):y.fill(0,0,C);for(let T=0;T<nt.length;T++)y[v[nt[T]]]=1;let X=o;for(let T=C-1;T>=0;T--){let J=f[T];y[T]||J.nextSibling!==X&&$.insertBefore(J,X),X=J}let U=a===i?s:i;U.length<C&&(U.length=C);for(let T=0;T<C;T++)U[T]=H[T];a=U,c=C;let oe=l;l=d,d=oe,D=!0,R()};function R(){if(u===0)return;let k=u;u=0,q(()=>{for(let C=0;C<k;C++){let $=g[C];$.setItem(h[C]),$.setIndex(m[C]),g[C]=void 0,h[C]=void 0}})}let w=le(ft);return A(r,()=>{if(!K){K=!0,w();for(let k of l.values())F(k.node),k.node.parentNode?.removeChild(k.node);o.parentNode&&o.parentNode.removeChild(o),V=!1,l.clear(),d.clear(),E.clear(),S.clear(),c=0,g.length=0,h.length=0,m.length=0,u=0}}),D||queueMicrotask(Z(()=>{!D&&!K&&r.parentNode&&ft()})),r}function pl(e){re();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||ho(t,r);else ho(t,n);return t}function ho(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),A(n,Te(n,t));return}e.appendChild(document.createTextNode(String(t)))}var ml=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),yo=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),vo=new WeakMap;function gl(e){let t=e.length-1,n=e[0];for(let m=0;m<t;m++)n+=`\0${m}\0${e[m+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let m=r;r++;let u=0;for(;r<o&&n.charCodeAt(r)!==0;)u=u*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,u<0||u>=t?(r=m,-1):u}function a(){let m=r;for(;r<o;){let u=n.charCodeAt(r);if(u>=97&&u<=122||u>=65&&u<=90||u>=48&&u<=57||u===45)r++;else break}return n.slice(m,r)}function c(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let u=n[r];if(u==='"'||u==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==u;){let S=s();S>=0?(f.push(y),y="",b.push(S)):y+=n[r++]}return r<o&&r++,f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}{let f=[],b=[],y="";for(;r<o;){let S=n.charCodeAt(r);if(S===32||S===9||S===10||S===13||S===62)break;let v=s();v>=0?(f.push(y),y="",b.push(v)):y+=n[r++]}return f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}}function l(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let u=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let f=n.slice(u,r);if(!f)break;let b=c();f.startsWith("on:")?b.kind==="expr"&&m.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?m.push({t:4,name:f}):b.kind==="static"?m.push({t:0,name:f,value:b.value}):b.kind==="expr"?m.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&m.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return m}function d(m){return m.replace(/\s+/g," ")}function g(m){let u="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=d(u);y&&m.push({t:1,value:y}),u="",m.push({t:2,idx:b})}else u+=n[r++]}let f=d(u);f&&m.push({t:1,value:f})}function h(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let u=n[r+1];if(u==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(u==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(u>="a"&&u<="z")&&!(u>="A"&&u<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=l();i();let y=ml.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:f,svg:yo.has(f),attrs:b,children:[]}});else{let v=h();if(tr(f)){for(let x=0;x<v.length;x++)if(v[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),m.push({t:0,el:{tag:f,svg:yo.has(f),attrs:b,children:v}})}}else g(m);return m}return h()}function _n(e,t){let n=e.svg?document.createElementNS(I,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:Yt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?A(n,st(n,i,s)):de(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}de(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):P(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:Yt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(_n(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),A(n,Te(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function So(e,...t){let n=vo.get(e);return n||(n=gl(e),vo.set(e,n)),wo(n,t)}function xo(e,t){return wo(e,t)}function wo(e,t){if(re(),e.length===1&&e[0].t===0)return _n(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(_n(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),A(n,Te(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function bl(e,t,n){re();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&he()&&P("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,c=null,l=!1,d=!1,g=()=>{if(d)return;let m=e(),u=r.parentNode;if(!u||l&&m===a)return;c?.parentNode&&u.removeChild(c),a=m;let f=o.get(m);if(f){let b=i.indexOf(m);b!==-1&&(i.splice(b,1),i.push(m))}else{let b=t[m];if(!b){c=null,l=!0;return}if(f=b(),f.nodeType===11){let y=document.createElement("div");y.style.display="contents",y.appendChild(f),f=y}if(o.set(m,f),i.push(m),s>0&&i.length>s){let y=i.shift(),S=o.get(y);S&&(F(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(y))}}u.insertBefore(f,r.nextSibling),c=f,l=!0},h=le(g);return l||queueMicrotask(Z(()=>{!l&&r.parentNode&&g()})),A(r,()=>{d=!0,h();for(let m of o.values())F(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,c=null}),r}function hl(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");j(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=d=>{if(d instanceof DocumentFragment){let g=document.createComment(""),h=document.createComment("");d.insertBefore(g,d.firstChild),d.appendChild(h),o={start:g,end:h}}t.appendChild(d)},s;typeof e=="function"?s=zn(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&ue(c,"app:init",{rootElement:s,container:t,duration:a});let l=o;return{node:s,unmount(){if(c&&ue(c,"app:unmount",{rootElement:s}),l){yl(l.start,l.end);return}F(s),s.parentNode?.removeChild(s)}}}function yl(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=Se;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){Ce("mount",Se,1);return}F(a),a.parentNode===n&&n.removeChild(a)}s||L(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function vl(e,t){re();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=Z(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{L(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),A(n,()=>{i=!0,o&&(F(o),o.remove(),o=null)}),n}function Sl(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function To(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function xl(e=[]){let[t,n]=N([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let c=[...a];return s=To(c,o,i),s.length===0&&i.length<=1?a:c}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function wl(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,ze(r)||Ge(r)}function i(){if(He(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...c){let l=To(t,a,c);return(l.length>0||c.length>1)&&o(),l},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let c=t.findIndex(a);c!==-1&&(t.splice(c,1),o())},set(a){t=[...a],o()},update(a,c){a<0||a>=t.length||Object.is(t[a],c)||(t[a]=c,o())},updateWhere(a,c){let l=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let g=c(t[d]);Object.is(t[d],g)||(t[d]=g,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let c=t.filter(a);c.length!==t.length&&(t=c,o())},map(a){let c=!1;for(let l=0;l<t.length;l++){let d=a(t[l],l);Object.is(t[l],d)||(t[l]=d,c=!0)}c&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Tl(e,t){let[n,r]=N(t),[o,i]=N(!1),[s,a]=N(null),[c,l]=N(0),d=0,g=!1,h=null,m=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},u=ee(()=>{if(c(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;h=b,q(()=>{i(!0),a(null)});let y=()=>g||f!==d,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;q(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,q(()=>{r(v),i(!1)}))},v=>{y()||(h=null,q(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||l(f=>f+1)},dispose:()=>{g||(g=!0,u(),m())}}}function et(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[c,l]of e)if(!a.has(c)||!et(l,a.get(c),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let c of e)if(!a.has(c))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),c=new Uint8Array(t);if(a.length!==c.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==c[l])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,c=t;if(a.length!==c.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==c[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,c)=>et(a,t[c],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&et(e.cause,a.cause,n)&&Eo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Eo(r,o,n)}function Eo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&et(e[i],t[i],n))}function El(e){return N(e,{equals:(t,n)=>et(t,n)})}function qe(e,t){j(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let l=()=>{let u=e();o._v=r&&o._init&&r(o._v,u)?o._v:u,o._d=!1,o._init=!0};try{le(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(u){throw s=!0,Ie(c),u}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let u=o._v;i=!0;try{Re(l,c),Object.is(u,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ie(c)}d&&!s&&!Object.is(u,o._v)&&ue(d,"computed:update",{signal:o,oldValue:u,newValue:o._v})};o._validate=g;let h=()=>{let{error:u}=a;throw a=void 0,s&&(o._d=!1),u};function m(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Tr()||s?(o._d&&(g(),a!==void 0&&h()),o._v):(o._d&&(g(),a!==void 0&&(He(o),h())),He(o),o._v)}return n&&(m.__name=n,o.__name=n),m.__signal=o,m.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ie(c);let u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(u)try{u.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&ue(d,"computed:create",{signal:o,name:n,getter:m}),m}function kl(e){let[t,n]=N(e);return{get current(){return t()},set current(r){n(r)}}}function ko(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Cl(e){j(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(c=>{let[l,d]=N(e[c]);ko(t,c,[l,d])});let n=new Proxy({},{get(c,l){if(typeof l=="string"&&Object.hasOwn(t,l)){let d=t[l][0];return d()}return Reflect.get(c,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(t).forEach(l=>{ko(c,l,t[l][0]())}),c};return[n,{setState:c=>{let l=r(),d=typeof c=="function"?c(l):c;q(()=>{Object.entries(d).forEach(([g,h])=>{Object.hasOwn(t,g)&&t[g][1](h)})})},reset:()=>{q(()=>{Object.keys(e).forEach(c=>{let l=t[c][1];l(e[c])})})},subscribe:c=>{let l=!0;return ee(()=>{let d=r();if(l){l=!1;return}De();try{c(d)}finally{$e()}})},subscribeKey:(c,l)=>{let d,g=!0;return ee(()=>{let h=t[c][0]();if(g){d=h,g=!1;return}if(!Object.is(h,d)){let m=d;d=h,De();try{l(h,m)}finally{$e()}}})},getSnapshot:r}]}function Al(e,t){if(j(typeof e=="function","watch: first argument must be a getter function."),j(typeof t=="function","watch: second argument must be a callback function."),ge())return()=>{};let n,r=!0;return le(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,De();try{t(s,a)}finally{$e()}}})}function _l(e,t,n){return[qe(e,n),i=>{q(()=>t(i))}]}function Nl(e){let t=e();return he()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Rl(e){if(!he())return ee(e);let t=ee(e),n=null;return queueMicrotask(()=>{try{n=ee(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Co(e,t){return ge()?()=>{}:Y(e,t)}var Nn="data-sibu-enhanced",Rn=new WeakMap;function Ao(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=Se){let i=r.length-o+e.length;e.length=0,Ce(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var _o=["text","attr","class","show","on","cleanup"];function No(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function dt(e,t){return Co(t,e)}function Ll(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value}function Ml(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function Ol(e,t,n,r){let o=`ctx.each[${r}]`;if(he())for(let i of Object.keys(n))j(_o.includes(i),`${o}: unknown binding "${i}". Expected one of: ${_o.join(", ")}.`);if(n.text!==void 0&&(j(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];j(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];j(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(j(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];j(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(j(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function Ot(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(Nn)==="true")return he()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=h=>s?(te(()=>`enhance: ctx.${h}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,c=(h,m,u)=>{if(a(h))return;let f=No(n,m);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}u(f)},l={root:n,ref:h=>No(n,h),refs:h=>{let m=h.startsWith("@")?`[data-ref="${h.slice(1)}"]`:h;try{return Array.from(n.querySelectorAll(m))}catch{return[]}},on:(h,m,u,f)=>{c("on",h,b=>{let y=S=>u(S,b);b.addEventListener(m,y,f),r.push(()=>b.removeEventListener(m,y,f))})},text:(h,m)=>{c("text",h,u=>{r.push(dt(u,()=>{let f=m(),b=f==null?"":String(f);u.textContent!==b&&(u.textContent=b)}))})},attr:(h,m,u)=>{c("attr",h,f=>{r.push(dt(f,()=>{let b=u(),y=b==null?null:String(b);de(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,m,u)=>{c("classed",h,f=>{r.push(dt(f,()=>{f.classList.toggle(m,!!u())}))})},show:(h,m)=>{c("show",h,u=>{let f=u.hidden;r.push(dt(u,()=>{u.hidden=!m()})),r.push(()=>{u.hidden=f})})},model:(h,m,u)=>{c("model",h,f=>{let b=f,[y,S]=m,v=u?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(dt(f,()=>{Ml(b,y())}));let x=()=>S(Ll(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,m)=>{if(a("each"))return;j(typeof m=="function","ctx.each: second argument must be a function.");let u=typeof h=="string"?l.refs(h):Array.from(h);for(let f=0;f<u.length;f++){let b=u[f],y=m(b,f);y!=null&&Ol(l,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},d;try{d=t(l);let h=d;if(h&&typeof h.then=="function")throw h.then(void 0,m=>{te(()=>`enhance: the promise returned by the setup also rejected: ${String(m)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(h){throw Ao(r,"enhance"),s=!0,h}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,Rn.get(n)===o&&(Rn.delete(n),n.removeAttribute(Nn)),ot(n,g),Ao(r,"enhance"),s=!0)};return A(n,g),Rn.set(n,o),n.setAttribute(Nn,"true"),g}function Pl(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Ot(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var Dl=/^[A-Za-z0-9_-]+$/,Ro=Symbol.for("sibujs.islands.lazy"),Pt=ut(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function $l(e){return e[Ro]=!0,e}function Hl(e,t){if(!Dl.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Pt.set(e,t)}function Il(e){Pt.delete(e)}async function Bl(e){if(typeof e=="function"&&e[Ro]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Vl(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!Pt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,c=()=>{if(a||o)return;a=!0;let d=Pt.get(s);d&&Bl(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Ot(i,g);if(o){h();return}r.push(h),i.setAttribute("data-sibu-hydrated","true")}catch(h){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,h)}}}).catch(g=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,g)})},l=i.getAttribute("data-sibu-load")||"load";n.push(jl(l,i,c,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function jl(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}var Fl=new Set(["__proto__","constructor","prototype"]);function Ln(e){return Fl.has(e)}function Dt(e){let t={};for(let n of Object.keys(e))Ln(n)||(t[n]=e[n]);return t}function Lo(e){return e}var Zp=1024*1024;function zl(e){let[t,n]=N(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=le(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,c())},l}var Mo=16;function Wl(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Mo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Mo)}function ql(){let[e,t]=N(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=c=>{s(),L(c,{phase:"async",name:"transition"})};Wl(()=>{try{let c=Rt(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function Ul(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var $t={};$n($t,{RenderProp:()=>ru,assertType:()=>du,compose:()=>nu,createGuard:()=>fu,createSlots:()=>iu,defineComponent:()=>su,defineSlottedComponent:()=>au,defineStrictComponent:()=>uu,globalStore:()=>Ql,machine:()=>Kl,optimistic:()=>Jl,optimisticList:()=>Yl,persisted:()=>Gl,timeline:()=>Xl,validateProps:()=>$o,validators:()=>lu,withBoundary:()=>ou,withDefaults:()=>tu,withProps:()=>cu,withWrapper:()=>eu});function tt(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Kl(e){let[t,n]=N(e.initial),[r,o]=N(e.context||{}),i=e.initial,s=r(),a=[],c=!1;function l(){c=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{c=!1}}function d(f){let b=tt(e.states,i);if(!b?.on)return;let y=tt(b.on,f);if(!y)return;let S,v,x;typeof y=="string"?S=y:(S=y.target,v=y.guard,x=y.action);let E=s;if(v&&!v(E))return;b.exit&&b.exit(E);let D=E;if(x){let K=x(E);D={...E,...Dt(K)}}i=S,s=D,q(()=>{x&&o(D),n(S)});let V=tt(e.states,S);V?.entry&&V.entry(s)}function g(f){a.push(f),!c&&l()}let h=tt(e.states,e.initial);if(h?.entry){c=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{c=!1}a.length>0&&l()}function m(f){return t()===f}function u(f){let b=t(),y=tt(e.states,b);if(!y?.on)return!1;let S=tt(y.on,f);return S?typeof S=="string"?!0:S.guard?S.guard(r()):!0:!1}return{state:t,context:r,send:g,matches:m,can:u}}function Gl(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,S)=>Ln(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,c=n.decrypt,l=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){c&&(y=c(y));let S=s(y);d=n.validate&&!n.validate(S)?t:S}}catch{}let[g,h]=N(d),m=!1,u=ee(()=>{let y=g();if(!m)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return l&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){m=!0;try{h(t)}finally{m=!1}return}try{let S=y.newValue;c&&(S=c(S));let v=s(S);if(n.validate&&!n.validate(v))return;m=!0;try{h(v)}finally{m=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(h,"dispose",{value:()=>{u(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[g,h]}function Jl(e){let[t,n]=N(e),[r,o]=N(!1),i=0,s=0;async function a(c,l){let d=++s,g=t();n(c),i++,o(!0);try{let h=await l();s===d&&n(h)}catch{s===d&&n(g)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function Yl(e){let t=0,n=0,r=0,o=new Map,i=[];for(let R of e){let w={id:t++,key:n++,base:R,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(R){let w=R.claims;return w.length>0?w[w.length-1].value:R.base}function a(R,w){let M=R.claims;for(let k=M.length-1;k>=0;k--)if(M[k].opId<w)return M[k].value;return R.base}function c(R,w,M){let k={opId:w,value:M,settled:!1},C=R.claims,$=C.length;for(;$>0&&C[$-1].opId>w;)$--;return C.splice($,0,k),k}function l(R,w){let M=R.claims.indexOf(w);M!==-1&&R.claims.splice(M,1)}function d(R){let w=R.claims,M=0;for(;M<w.length&&w[M].settled;)R.base=w[M].value,M++;M>0&&w.splice(0,M)}let[g,h]=N(i.map(R=>s(o.get(R)))),[m,u]=N(!1),f=0,b=new Set;function y(){let R=new Array(i.length);for(let w=0;w<i.length;w++)R[w]=s(o.get(i[w]));return R}function S(R){q(()=>{let w=!1;try{w=R()}finally{u(f>0),w&&h(y())}})}function v(R){let w=o.get(R);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(M=>M!==R),!0)}function x(R){let w=[];for(let H of R){let G=o.get(H);!G||G.visible||b.has(H)||w.push(H)}if(w.length===0)return!1;let M=new Array(i.length+w.length),k=0,C=0,$=0;for(;k<i.length&&C<w.length;){let H=o.get(i[k]).key,G=o.get(w[C]).key;M[$++]=H<=G?i[k++]:w[C++]}for(;k<i.length;)M[$++]=i[k++];for(;C<w.length;)M[$++]=w[C++];for(let H of w)o.get(H).visible=!0;return i=M,!0}function E(R){for(let w of R){let M=o.get(w);M&&M.refs++}}function D(R){for(let w of R){let M=o.get(w);M&&(M.refs--,M.refs<=0&&!M.visible&&(o.delete(w),b.delete(w)))}}function V(R){if(D(R),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[w,M]of o)M.visible||o.delete(w)}async function K(R,w){let M=++r,k={id:t++,key:n++,base:R,claims:[],visible:!1,refs:1},C=c(k,M,R);S(()=>(o.set(k.id,k),k.visible=!0,i=[...i,k.id],f++,!0));let $,H=!1;try{$=await w()}catch{H=!0}S(()=>{try{if(H)return b.add(k.id),l(k,C),v(k.id);let G=s(k);return C.value=$,C.settled=!0,d(k),k.visible&&!Object.is(G,s(k))}finally{V([k.id])}})}async function be(R,w){let M=++r,k=[];for(let $ of i)R(a(o.get($),M))&&k.push($);S(()=>{if(E(k),f++,k.length===0)return!1;let $=new Set(k);for(let H of k){let G=o.get(H);G&&(G.visible=!1)}return i=i.filter(H=>!$.has(H)),!0});let C=!1;try{await w()}catch{C=!0}S(()=>{try{if(!C){for(let $ of k)b.add($);return!1}return x(k)}finally{V(k)}})}async function ft(R,w,M){let k=++r,C=[];for(let X of i){let U=o.get(X),oe=a(U,k);R(oe)&&C.push({row:U,nextValue:{...oe,...w}})}let $=C.map(X=>X.row.id),H=[];S(()=>{E($),f++;let X=!1;for(let U of C){let oe=s(U.row);H.push(c(U.row,k,U.nextValue)),U.row.visible&&!Object.is(oe,s(U.row))&&(X=!0)}return X});let G,nt=!1;try{G=await M()}catch{nt=!0}S(()=>{try{let X=!1;for(let U=0;U<H.length;U++){let oe=C[U].row,T=H[U],J=s(oe);nt?l(oe,T):(T.value=G,T.settled=!0),d(oe),oe.visible&&!Object.is(J,s(oe))&&(X=!0)}return X}finally{V($)}})}return{items:g,pending:m,add:K,remove:be,update:ft}}function Xl(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=N([e]),[o,i]=N(0),s=qe(()=>n()[o()]),a=qe(()=>o()>0),c=qe(()=>o()<n().length-1);function l(f){let b=s(),y=typeof f=="function"?f(b):f;if(Object.is(y,b))return;let S=n(),v=o(),x=S.slice(0,v+1);x.push(y),q(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function d(){a()&&i(o()-1)}function g(){c()&&i(o()+1)}function h(){q(()=>{r([e]),i(0)})}function m(f){let b=n();f>=0&&f<b.length&&i(f)}function u(){s.dispose(),a.dispose(),c.dispose()}return{value:s,set:l,undo:d,redo:g,canUndo:a,canRedo:c,history:n,index:o,reset:h,jumpTo:m,dispose:u}}var Po=Promise.prototype.then;function Oo(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(Po,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Do(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(u){return{promise:Promise.reject(u),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((u,f)=>{n=u,r=f}),i="invoking",s,a=[],c=u=>{if(i=u,u!=="invoking")for(let f of a.splice(0))f()},l=u=>{n(u),c("fulfilled")},d=u=>{r(u),c("rejected")},g=u=>{if(u===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(u===null||typeof u!="object"&&typeof u!="function"){l(u);return}let f;try{f=u.then}catch(b){d(b);return}if(typeof f!="function"){l(u);return}h(u,f)},h=(u,f)=>{f===Po?(s=u,c("native")):c("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,g(v))},S=v=>{b||(b=!0,d(v))};try{Reflect.apply(f,u,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&c("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(u,f)=>{let b=()=>{i==="native"?Oo(s,u,f):(i==="rejected"?u:f)()};i==="native"?Oo(s,u,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?u:f)}}}function Zl(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function Ql(e){let t=Zl(e.state),[n,r]=N({...t}),o=new Map,i=e.middleware||[];function s(u){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(u)}catch(b){L(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],c=!1;function l(u,f=!0){if(a.push(u),c)return;c=!0;let b,y=!1;try{let S=!0,v=0;for(;v<a.length;){let x=a[v];a[v++]=void 0;try{x()}catch(E){S&&f?(y=!0,b=E):L(E,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,c=!1}if(y)throw b}function d(u,f){let b=e.actions[u];if(!b)throw new Error(`Unknown action: ${String(u)}`);let y=()=>{let S=n(),v=b(S,f),x=Dt(v);r({...S,...x}),s(n())};l(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,E=!1,D=!0,V=()=>{if(E&&!x){P(`globalStore: middleware ${v} next() called after it failed for "${String(u)}"; ignored.`),x=!0;return}if(x){P(`globalStore: middleware ${v} next() called more than once for "${String(u)}"; ignored.`);return}if(x=!0,D){S(v+1);return}let be=()=>l(()=>S(v+1),!1);if(!K){be();return}K.probe(()=>{E=!0,P(`globalStore: middleware ${v} next() called after it failed for "${String(u)}"; ignored.`)},be)},K=null;try{K=Do(i[v](n(),String(u),f,V))}catch(be){throw E=!0,be}finally{D=!1}K&&(K.failedEarly&&(E=!0),K.promise.then(void 0,be=>{E=!0,L(be,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function g(u){return()=>u(n())}function h(u){let f=o.get(u);f||(f={callback:u,active:!0},o.set(u,f));let b=f;return()=>{o.get(u)===b&&(b.active=!1,o.delete(u))}}function m(){l(()=>{r({...t}),s(n())})}return{getState:n,select:g,dispatch:d,subscribe:h,reset:m}}function eu(e,t){return n=>t(e,n)}function tu(e,t){return n=>e({...t,...n})}function nu(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function ru(e){return e.render(e.data())}function ou(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function iu(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function su(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function au(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function cu(e,t){return n=>e(t(n))}var lu={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function $o(e,t){let n={...e};{let r=[];for(let[o,i]of Object.entries(t)){let s=typeof i=="function"?{type:i}:i;if(n[o]===void 0&&s.default!==void 0&&(n[o]=typeof s.default=="function"?s.default():s.default),s.required&&n[o]==null){r.push(`Prop '${o}' is required`);continue}if(n[o]!=null){if(s.type){let a=s.type(n[o],o);a!==!0&&r.push(a)}if(s.validator){let a=s.validator(n[o],o);a!==!0&&r.push(a)}}}return r.length>0&&P(`Prop validation errors:
|
|
399
|
+
`,ao=!1;function il(){!ao&&typeof document<"u"&&(document.head.appendChild(Ve({nodes:ol})),ao=!0)}function sl(e={}){il();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-dots"},[q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"}),q({class:"sibu-loading-dot"})]),t?q({class:"sibu-loading-text"},t):null]):P({class:`sibu-loading${o}`,role:"status","aria-live":"polite","aria-label":t?void 0:"Loading"},[P({class:"sibu-loading-spinner"}),t?q({class:"sibu-loading-text"},t):null])}var An=Symbol.for("sibujs.actions.v1"),lo=globalThis[An]??(globalThis[An]=new Map);function nt(e,t){lo.set(e,t)}function co(e){return lo.get(e)}function al(e,t,n){let r=typeof t=="string"?co(t):t;if(!r)throw new Error(`[SibuJS] No action registered under the name "${t}". Register it with registerAction() before applying it by name.`);let o=r(e,n);typeof o=="function"&&_(e,o)}var fo=(e,t)=>{let n=e.ownerDocument,r=o=>{let i=o.target;typeof i?.nodeType=="number"&&e.contains(i)||t()};return n.addEventListener("pointerdown",r,!0),()=>n.removeEventListener("pointerdown",r,!0)},uo=["pointerup","pointerleave","pointercancel"],po=(e,t)=>{let n=t.duration??500,r=null,o,i=()=>{r!==null&&(clearTimeout(r),r=null)},s=u=>{let l=u.pointerId;r!==null&&l!==o||(i(),o=l,r=setTimeout(()=>{r=null,t.callback()},n))},a=u=>{r!==null&&u.pointerId===o&&i()};e.addEventListener("pointerdown",s);for(let u of uo)e.addEventListener(u,a);return()=>{i(),e.removeEventListener("pointerdown",s);for(let u of uo)e.removeEventListener(u,a)}},mo=(e,t)=>{let n=o=>M(o,{phase:"async",name:"copyOnClick",node:e}),r=()=>{try{let o=typeof t=="function"?t():e.textContent??"";Promise.resolve(navigator.clipboard.writeText(o)).catch(n)}catch(o){n(o)}};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)},go=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},bo=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1],a=e.ownerDocument.activeElement;r.shiftKey&&a===i?(r.preventDefault(),s.focus()):!r.shiftKey&&a===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};nt("clickOutside",fo);nt("longPress",po);nt("copyOnClick",mo);nt("autoResize",go);nt("trapFocus",bo);function Ot(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(n){return Promise.reject(n)}return typeof t!="function"?null:new Promise((n,r)=>{queueMicrotask(()=>{try{Reflect.apply(t,e,[n,r])}catch(o){r(o)}})})}var qe=null;function ul(e,t){try{let n=e(),r=Ot(n);return r&&r.then(void 0,o=>{t?t(o,"async"):qe?qe(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):qe?qe(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function ll(e,t){try{return await e()}catch(n){return t?t(n,"async"):qe?qe(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function cl(e){qe=e}function dl(e){let[t,n]=A(e),r=i=>{!!0||!me()||D(`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=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let u=s();return u!==null&&typeof u?.then=="function"&&D("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."),u}finally{n(a)}}}}var Nn=Symbol.for("sibujs.createId.v1"),Rn=globalThis[Nn]??(globalThis[Nn]={n:0});function ho(e="sibu"){let t=qr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(Rn.n++,`${e}-${Rn.n}`)}function yo(){Rn.n=0}function fl(e,t){let n=typeof t=="function"?t():t;return _(n,J(()=>{n.style.display=e()?"":"none"},n)),n}function vo(e){return typeof e=="object"&&e!==null&&!(e instanceof Node)}function So(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,u=r.has(s),l=!a&&!u;return r.add(s),u&&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,t.nextSibling),{node:s,owned:l}}function Pt(e,t){t&&F(e),e.parentNode?.removeChild(e)}function pl(e,t,n,r){oe(),vo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("when"),a=null,u,l=!1,c=!1,m=new WeakSet,h=!1,g=()=>{if(c)return;let f=e(),b=s.parentNode;if(!b||l&&Object.is(f,u))return;u=f;let y=a?ct([a]):null;a?.parentNode&&(Pt(a,h),a=null);let S=f?t:o!==void 0?o:null,v=pe(()=>So(b,s,S,m,"when"));a=v.node,h=v.owned,Qe(y,a?[a]:[],"when",i),l=!0},d=Be(g,s);return _(s,()=>{c=!0,d.stop(),a&&Pt(a,h),a=null}),l||queueMicrotask(Q(()=>{!c&&!l&&s.parentNode&&d.run(g)})),s}function ml(e,t,n,r){oe(),vo(n)&&(r=n,n=void 0);let o=n,i=r?.focus,s=document.createComment("match"),a=null,u,l=!1,c=!1,m=new WeakSet,h=!1,g=()=>{if(c)return;let f=String(e()),b=s.parentNode;if(!b||l&&f===u)return;u=f;let y=a?ct([a]):null;a?.parentNode&&(Pt(a,h),a=null);let S=Object.hasOwn(t,f)?t[f]:o,v=pe(()=>So(b,s,S??null,m,"match"));a=v.node,h=v.owned,Qe(y,a?[a]:[],"match",i),l=!0},d=Be(g,s);return _(s,()=>{c=!0,d.stop(),a&&Pt(a,h),a=null}),l||queueMicrotask(Q(()=>{!c&&!l&&s.parentNode&&d.run(g)})),s}function pt(e,t){let n=globalThis;return n[e]??(n[e]=t())}var Dt=pt(Symbol.for("sibujs.components.registry.v1"),()=>new Map),xo=pt(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function wo(){let[e,t]=xo;t(pe(e)+1)}function gl(e,t){Dt.set(e,t),wo()}function bl(e){Dt.delete(e)&&wo()}function hl(e){let t=Dt.get(e);return t?t():P(`[Component "${e}" not found]`)}function yl(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(xo[0](),a=Dt.get(s));let u=a??`missing:${s}`;if(u===r)return;let l=pe(()=>a?a():P(`[Component "${s}" not found]`));r=u,re(t,l)}let i=J(o,t,!0);return _(t,i),t}function To(e){return typeof e=="function"?To(e()):e instanceof Node?e:document.createTextNode(String(e))}function vl(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let u=e[a],l=0,c=n.length;for(;l<c;){let m=l+c>>1;e[n[m]]<u?l=m+1:c=m}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Sl(e,t,n){j(typeof e=="function","each: first argument must be a function that returns an array."),j(typeof t=="function","each: second argument must be a render function."),j(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item."),oe();let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,u=0,l=new Map,c=new Map,m=[],h=[],g=[],d=0,f=[],b=[],y=new Uint8Array(0),S=new Map,v=[],x=[],T=new Map,$=!1,V=!1,G=!1,ge=n.key,gt=()=>{if(G)return;let O=e(),k=O.length,H=r.parentNode;if(!H)return;V||(H.insertBefore(o,r.nextSibling),V=!0),b.length<k&&(b=new Array(k));for(let E=0;E<k;E++)b[E]=ge(O[E]);let W=b;f.length<k&&(f=new Array(k)),c.clear(),T.clear();for(let E=0;E<k;E++)T.has(W[E])&&D(`each: duplicate key "${String(W[E])}" at index ${E} (first seen at ${T.get(W[E])}). Keys must be unique \u2014 duplicates cause rows to be dropped or mis-ordered.`),T.set(W[E],E);d=0;for(let E=0;E<k;E++){let Z=W[E],$n=l.get(Z),st;if($n!==void 0)st=$n,m[d]=st,h[d]=O[E],g[d]=E,d++;else{let[Hn,Wo]=A(O[E]),[In,qo]=A(E),Vt;try{De();try{Vt=To(t(Hn,In))}finally{$e()}}catch(Uo){let Ko=W[E];Vt=document.createComment(`each:error:${E}`),queueMicrotask(()=>{M(Uo,{phase:"render",name:`each row (key="${String(Ko)}")`,node:r.parentNode?r:void 0})})}st={node:Vt,item:Hn,setItem:Wo,index:In,setIndex:qo}}c.set(Z,st),f[E]=st.node}for(let[E,Z]of l)c.has(E)||(F(Z.node),Z.node.parentNode&&H.removeChild(Z.node));if(k===0){u=0;let E=l;l=c,c=E,$=!0,d=0;return}S.clear();for(let E=0;E<u;E++)S.set(a[E],E);v.length<k&&(v=new Array(k),x=new Array(k));let Le=0;for(let E=0;E<k;E++){let Z=S.get(W[E]);Z!==void 0&&(v[Le]=E,x[Le]=Z,Le++)}let ie=vl(x,Le);y.length<k?y=new Uint8Array(k):y.fill(0,0,k);for(let E=0;E<ie.length;E++)y[v[ie[E]]]=1;let K=o;for(let E=k-1;E>=0;E--){let Z=f[E];y[E]||Z.nextSibling!==K&&H.insertBefore(Z,K),K=Z}let Y=a===i?s:i;Y.length<k&&(Y.length=k);for(let E=0;E<k;E++)Y[E]=W[E];a=Y,u=k;let it=l;l=c,c=it,$=!0,N()};function N(){if(d===0)return;let O=d;d=0,U(()=>{for(let k=0;k<O;k++){let H=m[k];H.setItem(h[k]),H.setIndex(g[k]),m[k]=void 0,h[k]=void 0}})}let w=Be(gt),R=w.stop;return _(r,()=>{if(!G){G=!0,R();for(let O of l.values())F(O.node),O.node.parentNode?.removeChild(O.node);o.parentNode&&o.parentNode.removeChild(o),V=!1,l.clear(),c.clear(),T.clear(),S.clear(),u=0,m.length=0,h.length=0,g.length=0,d=0}}),$||queueMicrotask(Q(()=>{!$&&!G&&r.parentNode&&w.run(gt)})),r}function xl(e){oe();let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||Eo(t,r);else Eo(t,n);return t}function Eo(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(n,we(n,t));return}e.appendChild(document.createTextNode(String(t)))}var wl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ko=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),_o=new WeakMap;function Tl(e){let t=e.length-1,n=e[0];for(let g=0;g<t;g++)n+=`\0${g}\0${e[g+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let g=r;r++;let d=0;for(;r<o&&n.charCodeAt(r)!==0;)d=d*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,d<0||d>=t?(r=g,-1):d}function a(){let g=r;for(;r<o;){let d=n.charCodeAt(r);if(d>=97&&d<=122||d>=65&&d<=90||d>=48&&d<=57||d===45)r++;else break}return n.slice(g,r)}function u(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let g=s();if(g>=0)return{kind:"expr",idx:g};let d=n[r];if(d==='"'||d==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==d;){let S=s();S>=0?(f.push(y),y="",b.push(S)):y+=n[r++]}return r<o&&r++,f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}{let f=[],b=[],y="";for(;r<o;){let S=n.charCodeAt(r);if(S===32||S===9||S===10||S===13||S===62)break;let v=s();v>=0?(f.push(y),y="",b.push(v)):y+=n[r++]}return f.push(y),b.length===0?{kind:"static",value:f[0]}:{kind:"mixed",statics:f,exprs:b}}}function l(){let g=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let d=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let f=n.slice(d,r);if(!f)break;let b=u();f.startsWith("on:")?b.kind==="expr"&&g.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?g.push({t:4,name:f}):b.kind==="static"?g.push({t:0,name:f,value:b.value}):b.kind==="expr"?g.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&g.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return g}function c(g){return g.replace(/\s+/g," ")}function m(g){let d="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=c(d);y&&g.push({t:1,value:y}),d="",g.push({t:2,idx:b})}else d+=n[r++]}let f=c(d);f&&g.push({t:1,value:f})}function h(){let g=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let d=n[r+1];if(d==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(d==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(d>="a"&&d<="z")&&!(d>="A"&&d<="Z")){g.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=l();i();let y=wl.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)g.push({t:0,el:{tag:f,svg:ko.has(f),attrs:b,children:[]}});else{let v=h();if(or(f)){for(let x=0;x<v.length;x++)if(v[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${f}> (raw-text context). Build the content separately and append it as a Node.`)}n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),g.push({t:0,el:{tag:f,svg:ko.has(f),attrs:b,children:v}})}}else m(g);return g}return h()}function Ln(e,t){let n=e.svg?document.createElementNS(I,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:Qt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,lt(n,i,s)):de(n,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=t[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}de(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):D(`html: on:${o.name} handler is not a function (got ${typeof i}). Event listener was not attached.`);break}case 4:Qt(n,o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Ln(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),_(n,we(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Co(e,...t){let n=_o.get(e);return n||(n=Tl(e),_o.set(e,n)),No(n,t)}function Ao(e,t){return No(e,t)}function No(e,t){if(oe(),e.length===1&&e[0].t===0)return Ln(e[0].el,t);let n=document.createElement("div");for(let r=0;r<e.length;r++){let o=e[r];switch(o.t){case 0:n.appendChild(Ln(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(i instanceof Node)n.appendChild(i);else if(typeof i=="function"){let s=document.createComment("bind:htm");n.appendChild(s),_(n,we(s,i))}else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n.childNodes.length===1&&n.firstChild instanceof Element?n.firstChild:n}function El(e,t,n){oe();let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&be()&&D("KeepAlive: unbounded cache (max: 0). Cached subtrees will never be evicted \u2014 set `max` to bound memory.");let a,u=null,l=!1,c=!1,m=()=>{if(c)return;let d=e(),f=r.parentNode;if(!f||l&&d===a)return;u?.parentNode&&f.removeChild(u),a=d;let b=o.get(d);if(b){let y=i.indexOf(d);y!==-1&&(i.splice(y,1),i.push(d))}else{let y=t[d];if(!y){u=null,l=!0;return}if(b=y(),b.nodeType===11){let S=document.createElement("div");S.style.display="contents",S.appendChild(b),b=S}if(o.set(d,b),i.push(d),s>0&&i.length>s){let S=i.shift(),v=o.get(S);v&&(F(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(S))}}f.insertBefore(b,r.nextSibling),u=b,l=!0},h=Be(m),g=h.stop;return l||queueMicrotask(Q(()=>{!l&&r.parentNode&&h.run(m)})),_(r,()=>{c=!0,g();for(let d of o.values())F(d),d.parentNode&&d.parentNode.removeChild(d);o.clear(),i.length=0,u=null}),r}function kl(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");j(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=c=>{if(c instanceof DocumentFragment){let m=document.createComment(""),h=document.createComment("");c.insertBefore(m,c.firstChild),c.appendChild(h),o={start:m,end:h}}t.appendChild(c)},s;typeof e=="function"?s=Un(()=>{let c=e();return i(c),c}):(s=e,i(s));let a=n()-r,u=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&ce(u,"app:init",{rootElement:s,container:t,duration:a});let l=o;return{node:s,unmount(){if(u&&ce(u,"app:unmount",{rootElement:s}),l){_l(l.start,l.end);return}F(s),s.parentNode?.removeChild(s)}}}function _l(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=ve;for(let a=e.nextSibling;a&&a!==t;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==n||t.parentNode!==n?s=!1:(e.previousSibling!==o||t.nextSibling!==i)&&(o=e.previousSibling,i=t.nextSibling,s=!!(e.compareDocumentPosition(t)&4));let a=e.nextSibling;if(!s||a===t)break;if(r--<=0){ke("mount",ve,1);return}F(a),a.parentNode===n&&n.removeChild(a)}s||M(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function Cl(e,t){oe();let n=document.createComment("portal"),r=t||document.body,o=null,i=!1,s=Q(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(a){queueMicrotask(()=>{M(a,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}});return queueMicrotask(s),_(n,()=>{i=!0,o&&(F(o),o.remove(),o=null)}),n}function Al(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function Ro(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function Nl(e=[]){let[t,n]=A([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let u=[...a];return s=Ro(u,o,i),s.length===0&&i.length<=1?a:u}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,u)=>u!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,u)=>u===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function Rl(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,We(r)||Xe(r)}function i(){if(He(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...u){let l=Ro(t,a,u);return(l.length>0||u.length>1)&&o(),l},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let u=t.findIndex(a);u!==-1&&(t.splice(u,1),o())},set(a){t=[...a],o()},update(a,u){a<0||a>=t.length||Object.is(t[a],u)||(t[a]=u,o())},updateWhere(a,u){let l=!1;for(let c=0;c<t.length;c++)if(a(t[c])){let m=u(t[c]);Object.is(t[c],m)||(t[c]=m,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let u=t.filter(a);u.length!==t.length&&(t=u,o())},map(a){let u=!1;for(let l=0;l<t.length;l++){let c=a(t[l],l);Object.is(t[l],c)||(t[l]=c,u=!0)}u&&o()},clear(){t.length!==0&&(t=[],o())}}]}function Ll(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[u,l]=A(0),c=0,m=!1,h=null,g=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},d=te(()=>{if(u(),m)return;g();let f=++c,b=typeof AbortController<"u"?new AbortController:null;h=b,U(()=>{i(!0),a(null)});let y=()=>m||f!==c,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;U(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,U(()=>{r(v),i(!1)}))},v=>{y()||(h=null,U(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{m||l(f=>f+1)},dispose:()=>{m||(m=!0,d(),g())}}}function rt(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[u,l]of e)if(!a.has(u)||!rt(l,a.get(u),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let u of e)if(!a.has(u))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),u=new Uint8Array(t);if(a.length!==u.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==u[l])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,u=t;if(a.length!==u.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!==u[l])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,u)=>rt(a,t[u],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&rt(e.cause,a.cause,n)&&Lo(r,o,n)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Lo(r,o,n)}function Lo(e,t,n){let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(t,i)&&rt(e[i],t[i],n))}function Ml(e){return A(e,{equals:(t,n)=>rt(t,n)})}function Ue(e,t){j(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,u=()=>{o._d||s||(o._d=!0)};u._c=1,u._sig=o;let l=()=>{let d=e();o._v=r&&o._init&&r(o._v,d)?o._v:d,o._d=!1,o._init=!0};try{Ye(()=>{o._v=e(),o._d=!1,o._init=!0},u)}catch(d){throw s=!0,Ie(u),d}let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,m=()=>{if(!o._d||s||a!==void 0)return;let d=o._v;i=!0;try{Ne(l,u),Object.is(d,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ie(u)}c&&!s&&!Object.is(d,o._v)&&ce(c,"computed:update",{signal:o,oldValue:d,newValue:o._v})};o._validate=m;let h=()=>{let{error:d}=a;throw a=void 0,s&&(o._d=!1),d};function g(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return Nr()||s?(o._d&&(m(),a!==void 0&&h()),o._v):(o._d&&(m(),a!==void 0&&(He(o),h())),He(o),o._v)}return n&&(g.__name=n,o.__name=n),g.__signal=o,g.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ie(u);let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(d)try{d.emit("computed:destroy",{signal:o,getter:g})}catch{}},c&&ce(c,"computed:create",{signal:o,name:n,getter:g}),g}function Ol(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function Mo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Pl(e){j(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t=Object.create(null);Object.keys(e).forEach(u=>{let[l,c]=A(e[u]);Mo(t,u,[l,c])});let n=new Proxy({},{get(u,l){if(typeof l=="string"&&Object.hasOwn(t,l)){let c=t[l][0];return c()}return Reflect.get(u,l)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let u={};return Object.keys(t).forEach(l=>{Mo(u,l,t[l][0]())}),u};return[n,{setState:u=>{let l=r(),c=typeof u=="function"?u(l):u;U(()=>{Object.entries(c).forEach(([m,h])=>{Object.hasOwn(t,m)&&t[m][1](h)})})},reset:()=>{U(()=>{Object.keys(e).forEach(u=>{let l=t[u][1];l(e[u])})})},subscribe:u=>{let l=!0;return te(()=>{let c=r();if(l){l=!1;return}De();try{u(c)}finally{$e()}})},subscribeKey:(u,l)=>{let c,m=!0;return te(()=>{let h=t[u][0]();if(m){c=h,m=!1;return}if(!Object.is(h,c)){let g=c;c=h,De();try{l(h,g)}finally{$e()}}})},getSnapshot:r}]}function Dl(e,t){if(j(typeof e=="function","watch: first argument must be a getter function."),j(typeof t=="function","watch: second argument must be a callback function."),me())return()=>{};let n,r=!0;return Ye(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,De();try{t(s,a)}finally{$e()}}})}function $l(e,t,n){return[Ue(e,n),i=>{U(()=>t(i))}]}function Hl(e){let t=e();return be()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function Il(e){if(!be())return te(e);let t=te(e),n=null;return queueMicrotask(()=>{try{n=te(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function Oo(e,t){return me()?()=>{}:J(e,t)}var Mn="data-sibu-enhanced",On=new WeakMap;function Po(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=ve){let i=r.length-o+e.length;e.length=0,ke(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var Do=["text","attr","class","show","on","cleanup"];function $o(e,t){if(t==null)return e;if(typeof t!="string")return t;let n=t.startsWith("@")?`[data-ref="${t.slice(1)}"]`:t;try{return e.querySelector(n)}catch{return null}}function mt(e,t){return Oo(t,e)}function Bl(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value}function Vl(e,t){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!t;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(t)?t.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let n=t==null?"":String(t);e.value!==n&&(e.value=n)}function jl(e,t,n,r){let o=`ctx.each[${r}]`;if(be())for(let i of Object.keys(n))j(Do.includes(i),`${o}: unknown binding "${i}". Expected one of: ${Do.join(", ")}.`);if(n.text!==void 0&&(j(typeof n.text=="function",`${o}: "text" must be a function returning the value.`),e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];j(typeof s=="function",`${o}: attr["${i}"] must be a function returning the value.`),e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];j(typeof s=="function",`${o}: class["${i}"] must be a function returning a boolean.`),e.classed(t,i,s)}if(n.show!==void 0&&(j(typeof n.show=="function",`${o}: "show" must be a function returning a boolean.`),e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];j(typeof s=="function",`${o}: on["${String(i)}"] must be a function.`),e.on(t,i,s)}n.cleanup!==void 0&&(j(typeof n.cleanup=="function",`${o}: "cleanup" must be a function.`),e.cleanup(n.cleanup))}function $t(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(Mn)==="true")return be()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",n),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=h=>s?(ne(()=>`enhance: ctx.${h}() was called after this enhancement was rolled back or disposed, so it was ignored. The setup is still running past the point where its transaction ended \u2014 usually an async setup continuing after an await, or a callback it queued before it threw. Registrations made now would belong to nothing: the root carries no enhancement marker and the disposer has already run, so nothing could ever release them.`),!0):!1,u=(h,g,d)=>{if(a(h))return;let f=$o(n,g);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(g)} not found under`,n);return}d(f)},l={root:n,ref:h=>$o(n,h),refs:h=>{let g=h.startsWith("@")?`[data-ref="${h.slice(1)}"]`:h;try{return Array.from(n.querySelectorAll(g))}catch{return[]}},on:(h,g,d,f)=>{u("on",h,b=>{let y=S=>d(S,b);b.addEventListener(g,y,f),r.push(()=>b.removeEventListener(g,y,f))})},text:(h,g)=>{u("text",h,d=>{r.push(mt(d,()=>{let f=g(),b=f==null?"":String(f);d.textContent!==b&&(d.textContent=b)}))})},attr:(h,g,d)=>{u("attr",h,f=>{r.push(mt(f,()=>{let b=d(),y=b==null?null:String(b);de(f,g,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,g,d)=>{u("classed",h,f=>{r.push(mt(f,()=>{f.classList.toggle(g,!!d())}))})},show:(h,g)=>{u("show",h,d=>{let f=d.hidden;r.push(mt(d,()=>{d.hidden=!g()})),r.push(()=>{d.hidden=f})})},model:(h,g,d)=>{u("model",h,f=>{let b=f,[y,S]=g,v=d?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(mt(f,()=>{Vl(b,y())}));let x=()=>S(Bl(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,g)=>{if(a("each"))return;j(typeof g=="function","ctx.each: second argument must be a function.");let d=typeof h=="string"?l.refs(h):Array.from(h);for(let f=0;f<d.length;f++){let b=d[f],y=g(b,f);y!=null&&jl(l,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},c;try{c=t(l);let h=c;if(h&&typeof h.then=="function")throw h.then(void 0,g=>{ne(()=>`enhance: the promise returned by the setup also rejected: ${String(g)}`)}),new Error("[SibuJS enhance] the setup returned a promise, so its work did not complete inside the enhancement transaction. If it is a lazy import, register it as lazyIsland(() => import(\u2026)): an unwrapped loader is called as a setup, so its module is fetched but the setup it resolves to is discarded. If it is an async setup, make it synchronous \u2014 this enhancement has been rolled back, and ctx registrations made after this point are ignored.")}catch(h){throw Po(r,"enhance"),s=!0,h}typeof c=="function"&&r.push(c);let m=()=>{i||(i=!0,On.get(n)===o&&(On.delete(n),n.removeAttribute(Mn)),at(n,m),Po(r,"enhance"),s=!0)};return _(n,m),On.set(n,o),n.setAttribute(Mn,"true"),m}function Fl(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push($t(r,t))}catch(r){for(let o=n.length-1;o>=0;o--)try{n[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw n.length=0,r}return()=>{for(let r of n.splice(0))r()}}var zl=/^[A-Za-z0-9_-]+$/,Ho=Symbol.for("sibujs.islands.lazy"),Ht=pt(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Wl(e){return e[Ho]=!0,e}function ql(e,t){if(!zl.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);Ht.set(e,t)}function Ul(e){Ht.delete(e)}async function Kl(e){if(typeof e=="function"&&e[Ho]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Gl(e=typeof document<"u"?document:null,t={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let n=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!Ht.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,u=()=>{if(a||o)return;a=!0;let c=Ht.get(s);c&&Kl(c).then(m=>{if(!o){if(!m){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=$t(i,m);if(o){h();return}r.push(h),i.setAttribute("data-sibu-hydrated","true")}catch(h){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,h)}}}).catch(m=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,m)})},l=i.getAttribute("data-sibu-load")||"load";n.push(Jl(l,i,u,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function Jl(e,t,n,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(n);return()=>cancelIdleCallback(i)}let o=setTimeout(n,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(n),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),n())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(t),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),n()},s=()=>{for(let a of o)t.removeEventListener(a,i)};for(let a of o)t.addEventListener(a,i,{passive:!0});return s}case"media":{let o=t.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(n),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(n),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),n())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(n),()=>{}}}var Yl=new Set(["__proto__","constructor","prototype"]);function Pn(e){return Yl.has(e)}function It(e){let t={};for(let n of Object.keys(e))Pn(n)||(t[n]=e[n]);return t}function Io(e){return e}var sm=1024*1024;function Xl(e){let[t,n]=A(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},u=Ye(()=>{i=e(),a()}),l=(()=>t());return l.dispose=()=>{o||(o=!0,u())},l}var Bo=16;function Zl(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:Bo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Bo)}function Ql(){let[e,t]=A(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=u=>{s(),M(u,{phase:"async",name:"transition"})};Zl(()=>{try{let u=Ot(o());u?u.then(s,a):s()}catch(u){a(u)}})}return{pending:e,start:r}}function ec(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var Bt={};Bn(Bt,{RenderProp:()=>dc,assertType:()=>vc,compose:()=>cc,createGuard:()=>Sc,createSlots:()=>pc,defineComponent:()=>mc,defineSlottedComponent:()=>gc,defineStrictComponent:()=>yc,globalStore:()=>ac,machine:()=>tc,optimistic:()=>rc,optimisticList:()=>oc,persisted:()=>nc,timeline:()=>ic,validateProps:()=>zo,validators:()=>hc,withBoundary:()=>fc,withDefaults:()=>lc,withProps:()=>bc,withWrapper:()=>uc});function ot(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function tc(e){let[t,n]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],u=!1;function l(){u=!0;try{for(;a.length>0;)c(a.shift())}catch(f){throw a.length=0,f}finally{u=!1}}function c(f){let b=ot(e.states,i);if(!b?.on)return;let y=ot(b.on,f);if(!y)return;let S,v,x;typeof y=="string"?S=y:(S=y.target,v=y.guard,x=y.action);let T=s;if(v&&!v(T))return;b.exit&&b.exit(T);let $=T;if(x){let G=x(T);$={...T,...It(G)}}i=S,s=$,U(()=>{x&&o($),n(S)});let V=ot(e.states,S);V?.entry&&V.entry(s)}function m(f){a.push(f),!u&&l()}let h=ot(e.states,e.initial);if(h?.entry){u=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{u=!1}a.length>0&&l()}function g(f){return t()===f}function d(f){let b=t(),y=ot(e.states,b);if(!y?.on)return!1;let S=ot(y.on,f);return S?typeof S=="string"?!0:S.guard?S.guard(r()):!0:!1}return{state:t,context:r,send:m,matches:g,can:d}}function nc(e,t,n={}){let r=(()=>{try{return n.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=n.serialize||JSON.stringify,i=(y,S)=>Pn(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,u=n.decrypt,l=n.session?!1:n.syncTabs??!0,c=t;try{let y=r?r.getItem(e):null;if(y!==null){u&&(y=u(y));let S=s(y);c=n.validate&&!n.validate(S)?t:S}}catch{}let[m,h]=A(c),g=!1,d=te(()=>{let y=m();if(!g)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return l&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){g=!0;try{h(t)}finally{g=!1}return}try{let S=y.newValue;u&&(S=u(S));let v=s(S);if(n.validate&&!n.validate(v))return;g=!0;try{h(v)}finally{g=!1}}catch{}}},window.addEventListener("storage",f)),Object.defineProperty(h,"dispose",{value:()=>{d(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[m,h]}function rc(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(u,l){let c=++s,m=t();n(u),i++,o(!0);try{let h=await l();s===c&&n(h)}catch{s===c&&n(m)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:t,pending:r,update:a}}function oc(e){let t=0,n=0,r=0,o=new Map,i=[];for(let N of e){let w={id:t++,key:n++,base:N,claims:[],visible:!0,refs:0};o.set(w.id,w),i.push(w.id)}function s(N){let w=N.claims;return w.length>0?w[w.length-1].value:N.base}function a(N,w){let R=N.claims;for(let L=R.length-1;L>=0;L--)if(R[L].opId<w)return R[L].value;return N.base}function u(N,w,R){let L={opId:w,value:R,settled:!1},O=N.claims,k=O.length;for(;k>0&&O[k-1].opId>w;)k--;return O.splice(k,0,L),L}function l(N,w){let R=N.claims.indexOf(w);R!==-1&&N.claims.splice(R,1)}function c(N){let w=N.claims,R=0;for(;R<w.length&&w[R].settled;)N.base=w[R].value,R++;R>0&&w.splice(0,R)}let[m,h]=A(i.map(N=>s(o.get(N)))),[g,d]=A(!1),f=0,b=new Set;function y(){let N=new Array(i.length);for(let w=0;w<i.length;w++)N[w]=s(o.get(i[w]));return N}function S(N){U(()=>{let w=!1;try{w=N()}finally{d(f>0),w&&h(y())}})}function v(N){let w=o.get(N);return!w||!w.visible?!1:(w.visible=!1,i=i.filter(R=>R!==N),!0)}function x(N){let w=[];for(let H of N){let W=o.get(H);!W||W.visible||b.has(H)||w.push(H)}if(w.length===0)return!1;let R=new Array(i.length+w.length),L=0,O=0,k=0;for(;L<i.length&&O<w.length;){let H=o.get(i[L]).key,W=o.get(w[O]).key;R[k++]=H<=W?i[L++]:w[O++]}for(;L<i.length;)R[k++]=i[L++];for(;O<w.length;)R[k++]=w[O++];for(let H of w)o.get(H).visible=!0;return i=R,!0}function T(N){for(let w of N){let R=o.get(w);R&&R.refs++}}function $(N){for(let w of N){let R=o.get(w);R&&(R.refs--,R.refs<=0&&!R.visible&&(o.delete(w),b.delete(w)))}}function V(N){if($(N),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[w,R]of o)R.visible||o.delete(w)}async function G(N,w){let R=++r,L={id:t++,key:n++,base:N,claims:[],visible:!1,refs:1},O=u(L,R,N);S(()=>(o.set(L.id,L),L.visible=!0,i=[...i,L.id],f++,!0));let k,H=!1;try{k=await w()}catch{H=!0}S(()=>{try{if(H)return b.add(L.id),l(L,O),v(L.id);let W=s(L);return O.value=k,O.settled=!0,c(L),L.visible&&!Object.is(W,s(L))}finally{V([L.id])}})}async function ge(N,w){let R=++r,L=[];for(let k of i)N(a(o.get(k),R))&&L.push(k);S(()=>{if(T(L),f++,L.length===0)return!1;let k=new Set(L);for(let H of L){let W=o.get(H);W&&(W.visible=!1)}return i=i.filter(H=>!k.has(H)),!0});let O=!1;try{await w()}catch{O=!0}S(()=>{try{if(!O){for(let k of L)b.add(k);return!1}return x(L)}finally{V(L)}})}async function gt(N,w,R){let L=++r,O=[];for(let ie of i){let K=o.get(ie),Y=a(K,L);N(Y)&&O.push({row:K,nextValue:{...Y,...w}})}let k=O.map(ie=>ie.row.id),H=[];S(()=>{T(k),f++;let ie=!1;for(let K of O){let Y=s(K.row);H.push(u(K.row,L,K.nextValue)),K.row.visible&&!Object.is(Y,s(K.row))&&(ie=!0)}return ie});let W,Le=!1;try{W=await R()}catch{Le=!0}S(()=>{try{let ie=!1;for(let K=0;K<H.length;K++){let Y=O[K].row,it=H[K],E=s(Y);Le?l(Y,it):(it.value=W,it.settled=!0),c(Y),Y.visible&&!Object.is(E,s(Y))&&(ie=!0)}return ie}finally{V(k)}})}return{items:m,pending:g,add:G,remove:ge,update:gt}}function ic(e,t=100){if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${t}`);let[n,r]=A([e]),[o,i]=A(0),s=Ue(()=>n()[o()]),a=Ue(()=>o()>0),u=Ue(()=>o()<n().length-1);function l(f){let b=s(),y=typeof f=="function"?f(b):f;if(Object.is(y,b))return;let S=n(),v=o(),x=S.slice(0,v+1);x.push(y),U(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function c(){a()&&i(o()-1)}function m(){u()&&i(o()+1)}function h(){U(()=>{r([e]),i(0)})}function g(f){let b=n();f>=0&&f<b.length&&i(f)}function d(){s.dispose(),a.dispose(),u.dispose()}return{value:s,set:l,undo:c,redo:m,canUndo:a,canRedo:u,history:n,index:o,reset:h,jumpTo:g,dispose:d}}var jo=Promise.prototype.then;function Vo(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(jo,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Fo(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(d){return{promise:Promise.reject(d),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((d,f)=>{n=d,r=f}),i="invoking",s,a=[],u=d=>{if(i=d,d!=="invoking")for(let f of a.splice(0))f()},l=d=>{n(d),u("fulfilled")},c=d=>{r(d),u("rejected")},m=d=>{if(d===o){c(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(d===null||typeof d!="object"&&typeof d!="function"){l(d);return}let f;try{f=d.then}catch(b){c(b);return}if(typeof f!="function"){l(d);return}h(d,f)},h=(d,f)=>{f===jo?(s=d,u("native")):u("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,m(v))},S=v=>{b||(b=!0,c(v))};try{Reflect.apply(f,d,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&u("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(d,f)=>{let b=()=>{i==="native"?Vo(s,d,f):(i==="rejected"?d:f)()};i==="native"?Vo(s,d,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?d:f)}}}function sc(e){if(typeof structuredClone=="function")return structuredClone(e);let t=new WeakSet,n=r=>{if(r===null||typeof r!="object")return r;if(t.has(r))throw new Error("deepClone: circular reference");if(t.add(r),r instanceof Date)return new Date(r.getTime());if(r instanceof Map){let i=new Map;for(let[s,a]of r)i.set(n(s),n(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(n(s));return i}if(Array.isArray(r))return r.map(n);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=n(r[i]));return o};return n(e)}function ac(e){let t=sc(e.state),[n,r]=A({...t}),o=new Map,i=e.middleware||[];function s(d){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(d)}catch(b){M(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],u=!1;function l(d,f=!0){if(a.push(d),u)return;u=!0;let b,y=!1;try{let S=!0,v=0;for(;v<a.length;){let x=a[v];a[v++]=void 0;try{x()}catch(T){S&&f?(y=!0,b=T):M(T,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,u=!1}if(y)throw b}function c(d,f){let b=e.actions[d];if(!b)throw new Error(`Unknown action: ${String(d)}`);let y=()=>{let S=n(),v=b(S,f),x=It(v);r({...S,...x}),s(n())};l(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,T=!1,$=!0,V=()=>{if(T&&!x){D(`globalStore: middleware ${v} next() called after it failed for "${String(d)}"; ignored.`),x=!0;return}if(x){D(`globalStore: middleware ${v} next() called more than once for "${String(d)}"; ignored.`);return}if(x=!0,$){S(v+1);return}let ge=()=>l(()=>S(v+1),!1);if(!G){ge();return}G.probe(()=>{T=!0,D(`globalStore: middleware ${v} next() called after it failed for "${String(d)}"; ignored.`)},ge)},G=null;try{G=Fo(i[v](n(),String(d),f,V))}catch(ge){throw T=!0,ge}finally{$=!1}G&&(G.failedEarly&&(T=!0),G.promise.then(void 0,ge=>{T=!0,M(ge,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function m(d){return()=>d(n())}function h(d){let f=o.get(d);f||(f={callback:d,active:!0},o.set(d,f));let b=f;return()=>{o.get(d)===b&&(b.active=!1,o.delete(d))}}function g(){l(()=>{r({...t}),s(n())})}return{getState:n,select:m,dispatch:c,subscribe:h,reset:g}}function uc(e,t){return n=>t(e,n)}function lc(e,t){return n=>e({...t,...n})}function cc(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function dc(e){return e.render(e.data())}function fc(e,t){return n=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=t(n);r.appendChild(o)}catch(o){let i=document.createElement("div");i.setAttribute("data-sibu-boundary-error",e),i.style.cssText="color: red; border: 1px solid red; padding: 8px; margin: 4px;",i.textContent=`[${e}] ${o instanceof Error?o.message:String(o)}`,r.appendChild(i)}return r}}function pc(e){return{renderSlot(t,n){let r=Object.hasOwn(e,t)?e[t]:void 0;if(r){let o=r();if(Array.isArray(o)){let i=document.createElement("div");i.style.display="contents";for(let s of o)i.appendChild(s);return i}return o}return n?n():null},hasSlot(t){return Object.hasOwn(e,t)}}}function mc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function gc(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function bc(e,t){return n=>e(t(n))}var hc={string:((e,t)=>typeof e=="string"||`${t} must be a string, got ${typeof e}`),number:((e,t)=>typeof e=="number"||`${t} must be a number, got ${typeof e}`),boolean:((e,t)=>typeof e=="boolean"||`${t} must be a boolean, got ${typeof e}`),function:((e,t)=>typeof e=="function"||`${t} must be a function, got ${typeof e}`),object:((e,t)=>typeof e=="object"&&e!==null||`${t} must be an object`),array:((e,t)=>Array.isArray(e)||`${t} must be an array`),required:((e,t)=>e!=null||`${t} is required`),oneOf:(...e)=>(t,n)=>e.includes(t)||`${n} must be one of: ${e.join(", ")}`,instanceOf:e=>(t,n)=>t instanceof e||`${n} must be an instance of ${e.name}`,arrayOf:e=>(t,n)=>{if(!Array.isArray(t))return`${n} must be an array`;for(let r=0;r<t.length;r++){let o=e(t[r],`${n}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(t,n)=>{if(typeof t!="object"||t===null)return`${n} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(t[r],`${n}.${r}`);if(i!==!0)return i}return!0},optional:e=>(t,n)=>t==null?!0:e(t,n),range:(e,t)=>(n,r)=>typeof n!="number"?`${r} must be a number`:n>=e&&n<=t||`${r} must be between ${e} and ${t}`,pattern:e=>(t,n)=>typeof t!="string"?`${n} must be a string`:e.test(t)||`${n} must match pattern ${e}`};function zo(e,t){let n={...e};{let r=[];for(let[o,i]of Object.entries(t)){let s=typeof i=="function"?{type:i}:i;if(n[o]===void 0&&s.default!==void 0&&(n[o]=typeof s.default=="function"?s.default():s.default),s.required&&n[o]==null){r.push(`Prop '${o}' is required`);continue}if(n[o]!=null){if(s.type){let a=s.type(n[o],o);a!==!0&&r.push(a)}if(s.validator){let a=s.validator(n[o],o);a!==!0&&r.push(a)}}}return r.length>0&&D(`Prop validation errors:
|
|
401
401
|
${r.map(o=>` - ${o}`).join(`
|
|
402
|
-
`)}`),n}for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function
|
|
402
|
+
`)}`),n}for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function yc(e){return t=>{let n=zo(t,e.props);return e.setup(n)}}function vc(e,t,n){{let r=t(e,n||"value");if(r!==!0)throw new TypeError(`[SibuJS Contract] ${r}`)}}function Sc(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...Bt,...Dn,patterns:Bt});})();
|