sibujs 4.7.0 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +45 -4
- package/dist/browser.d.cts +23 -0
- package/dist/browser.d.ts +23 -0
- package/dist/browser.js +6 -5
- package/dist/build.cjs +513 -78
- package/dist/build.d.cts +22 -8
- package/dist/build.d.ts +22 -8
- package/dist/build.js +68 -21
- package/dist/cdn.dev.global.js +15 -13
- package/dist/cdn.full.dev.global.js +15 -13
- package/dist/cdn.full.global.js +14 -12
- package/dist/cdn.global.js +14 -12
- package/dist/chunk-3ACAAQIN.js +224 -0
- package/dist/{chunk-DKXRACVN.js → chunk-44MTL7ED.js} +6 -6
- package/dist/{chunk-3QWBSL5R.js → chunk-4WMSTZ7J.js} +8 -5
- package/dist/{chunk-H3SRKIYX.js → chunk-62BDYGAG.js} +8 -0
- package/dist/{chunk-BSY63EM6.js → chunk-C5PEWEGH.js} +20 -5
- package/dist/{chunk-BC2SECJD.js → chunk-C7AA2CZX.js} +1 -1
- package/dist/{chunk-SLM3IA34.js → chunk-CZPRSWSS.js} +1 -1
- package/dist/{chunk-FQRUXCEE.js → chunk-DSID757X.js} +1 -1
- package/dist/{chunk-ZVL7TY4K.js → chunk-EGUQLBHE.js} +22 -8
- package/dist/{chunk-2INLLLMZ.js → chunk-EXXSN3BW.js} +202 -26
- package/dist/{chunk-HURREPU2.js → chunk-FC6KCJSA.js} +87 -150
- package/dist/{chunk-Z3OHK6QT.js → chunk-GSGNX35Q.js} +5 -5
- package/dist/{chunk-XYV3EDB7.js → chunk-J3YQ457H.js} +37 -20
- package/dist/{chunk-VZSG24LS.js → chunk-JUTFX2RM.js} +18 -10
- package/dist/{chunk-RUSSKG6G.js → chunk-KJ3UKABJ.js} +1 -1
- package/dist/{chunk-UNWRJRKC.js → chunk-LI4W3U6C.js} +1 -1
- package/dist/{chunk-FNJXNGYZ.js → chunk-O6TRVMJI.js} +58 -6
- package/dist/{chunk-7LUJQAOJ.js → chunk-Q5J2LVKH.js} +1 -1
- package/dist/{chunk-4AWA2PVD.js → chunk-QGMSESDD.js} +10 -5
- package/dist/{chunk-XZR4PXRE.js → chunk-RGLPEBDE.js} +13 -10
- package/dist/{chunk-JWKYU5GV.js → chunk-TQQUN4WR.js} +1 -1
- package/dist/{chunk-WOLJZUFQ.js → chunk-UCNP3HVM.js} +12 -8
- package/dist/{chunk-WEQ3DMVL.js → chunk-V3LHZSU5.js} +1 -1
- package/dist/{chunk-UOL2ECCS.js → chunk-VWT3VXPL.js} +18 -12
- package/dist/{chunk-2BPG2XDA.js → chunk-ZVLHNEEL.js} +17 -35
- package/dist/{customElement-MmInOW1U.d.ts → customElement-pYDKUzWl.d.cts} +11 -3
- package/dist/{customElement-MmInOW1U.d.cts → customElement-pYDKUzWl.d.ts} +11 -3
- package/dist/data.cjs +9 -2
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.js +5 -5
- package/dist/ecosystem.cjs +400 -37
- package/dist/ecosystem.js +9 -8
- package/dist/extras.cjs +621 -252
- package/dist/extras.d.cts +2 -2
- package/dist/extras.d.ts +2 -2
- package/dist/extras.js +24 -23
- package/dist/index.cjs +464 -70
- package/dist/index.d.cts +28 -2
- package/dist/index.d.ts +28 -2
- package/dist/index.js +16 -12
- package/dist/motion.cjs +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +10 -7
- package/dist/patterns.js +6 -6
- package/dist/performance.cjs +31 -2
- package/dist/performance.d.cts +12 -2
- package/dist/performance.d.ts +12 -2
- package/dist/performance.js +8 -6
- package/dist/plugins.cjs +558 -231
- package/dist/plugins.d.cts +8 -3
- package/dist/plugins.d.ts +8 -3
- package/dist/plugins.js +22 -28
- package/dist/{ssr-XOTUASDO.js → ssr-5OWAH3U2.js} +4 -2
- package/dist/{ssr-Bli9XRW5.d.ts → ssr-C8hgIAw7.d.cts} +6 -0
- package/dist/{ssr-Bli9XRW5.d.cts → ssr-C8hgIAw7.d.ts} +6 -0
- package/dist/ssr.cjs +457 -131
- package/dist/ssr.d.cts +55 -5
- package/dist/ssr.d.ts +55 -5
- package/dist/ssr.js +11 -9
- package/dist/testing.cjs +3 -3
- package/dist/testing.js +4 -4
- package/dist/ui.cjs +608 -240
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +9 -8
- package/dist/widgets.cjs +1 -1
- package/dist/widgets.js +7 -7
- package/package.json +5 -4
package/dist/cdn.full.global.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`||e==="\r"||e==="\f"}function
|
|
3
|
-
`||
|
|
4
|
-
|
|
5
|
-
`?2:1);let a=Number.parseInt(i,16),c=a===0||a>1114111||a>=55296&&a<=57343;n+=c?"\uFFFD":String.fromCodePoint(a),t=s-1;continue}n+=o,t+=1}return n}var pn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid"];function bo(e){if(!e)return"an element";let n=e.tagName.toLowerCase(),t=e.getAttribute("id");t&&(n+=`#${t}`);let r=e.getAttribute("class");return r&&(n+=`.${r.trim().split(/\s+/).slice(0,3).join(".")}`),`<${n}>`}var St=new Set,mn=100,gn=!1;function hn(e,n,t){}function xt(e){if(!po.test(e))return-1;let t=(e.includes("\\")?go(e):e).toLowerCase().replace(/\s+/g,"");for(let r=0;r<pn.length;r++)if(t.includes(pn[r]))return r;return-1}function Ke(e,n){let t=xt(e);return t===-1?e:(hn(e,t,n),"")}function tt(e,n){let t=String(e);if(t.trim()==="")return"";if(typeof document>"u")return Ke(t,n)===""?"":t;let r=document.createElement("div");try{r.style.cssText=t}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),c=xt(a);if(c===-1&&(c=xt(`${s}:${a}`)),c!==-1){hn(a,c,{property:s,element:n?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var ho=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),yo=new Set(["srcdoc"]);function yn(e){return yo.has(e.toLowerCase())}function vn(e,n,t){let r=e.toLowerCase();return r==="srcset"?fo(n):ho.has(r)?bn(n):r==="style"?tt(n,t):n}var vo="http://www.w3.org/1999/xhtml",So="http://www.w3.org/2000/svg",xo="http://www.w3.org/1999/xlink",To="http://www.w3.org/XML/1998/namespace",wo=new Set(["checked","disabled","selected"]);function Eo(e){return e.namespaceURI===null||e.namespaceURI===vo}function Sn(e,n,t){e[n]=t}function ko(e,n){if(e.namespaceURI!==So)return null;let t=n.toLowerCase();return t.startsWith("xlink:")?xo:t.startsWith("xml:")?To:null}function ne(e,n,t,r={}){let o=ko(e,n),i=o?n.slice(n.indexOf(":")+1):n;if($e(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;if(t==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0;if(yn(n))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(n),!1;let s=Eo(e),a=s?n.toLowerCase():n;if(typeof t=="boolean"){if(n.length>5&&n.slice(0,5).toLowerCase()==="aria-"){let h=t?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(n))!==h&&(o?e.setAttributeNS(o,n,h):e.setAttribute(n,h)),!0}return s&&wo.has(a)&&a in e?Sn(e,a,t):t?o?e.setAttributeNS(o,n,""):e.setAttribute(n,""):o?e.removeAttributeNS(o,i):e.removeAttribute(n),!0}let c=String(t);if(r.syncValueProperty!==!1&&s&&(a==="value"||a==="checked")&&a in e)return Sn(e,a,a==="checked"?!!t:c),!0;let u=vn(n,c,{element:e});return(o?e.getAttributeNS(o,i):e.getAttribute(n))===u||(o?e.setAttributeNS(o,n,u):e.setAttribute(n,u)),!0}var _o=4096,Tt=[];function Co(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function Ao(e,n,t){let r=Tt.pop();if(r)return r.sig=e,r.sub=n,r.epoch=t,r;let o=Co();return o.sig=e,o.sub=n,o.epoch=t,o}function xn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Tt.length<_o&&Tt.push(e)}function No(e,n){let t=e.subsHead??null;n.sigPrev=null,n.sigNext=t,t?t.sigPrev=n:e.subsTail=n,e.subsHead=n,e.__sc=(e.__sc??0)+1}function Tn(e){let n=e.sig;if(!n)return;let t=e.sigPrev,r=e.sigNext;t?t.sigNext=r:n.subsHead=r,r?r.sigPrev=t:n.subsTail=t,n.__sc=(n.__sc??1)-1,n.__activeNode===e&&(n.__activeNode=e.prevActive),n.__sc===0&&(n.subsHead=null,n.subsTail=null)}function Ro(e,n){let t=e.depsTail??null;n.subPrev=t,n.subNext=null,t?t.subNext=n:e.depsHead=n,e.depsTail=n}function Lo(e){let n=e.sub;if(!n)return;let t=e.subPrev,r=e.subNext;t?t.subNext=r:n.depsHead=r,r?r.subPrev=t:n.depsTail=t}var oe=null,fe=null,ye=0,ve=[],re=new Set,Mo=[];function Po(e){try{e()}catch(n){let t=e;R(n,{phase:t._errorPhase??"effect",name:t.__name,node:t._errorNode})}}function Do(e){let n=e.depsHead??null;if(n===null)return!0;for(;n!==null;){let t=n.sig;if(t===null)return!0;if(t._d===!0&&t._validate!==void 0)try{t._validate()}catch{return!0}if(n.depVersion!==t.__v)return!0;n=n.subNext}return!1}var ue=0,pe=!1;function Et(){ue===0&&(fe=oe,oe=null,pe=!0),ue++}function kt(){ue--,ue===0&&(oe=fe,fe=null,pe=!1)}function wn(){return pe}function En(e){Et();try{return e()}finally{kt()}}var $o=0;function _t(e,n){let t=oe,r=0,o=null;pe&&(r=ue,o=fe,ue=0,fe=null,pe=!1),oe=n;let i=n;i._cap===void 0&&(i._cap=an());let s=++$o;i._epoch=s,i._structDirty=!1;for(let a=i.depsHead??null;a!==null;a=a.subNext){let c=a.sig;a.prevActive=c.__activeNode??null,c.__activeNode=a}try{e()}finally{oe=t,r!==0&&(ue=r,fe=o,pe=!0);let a=i.depsHead??null;for(;a!==null;){let c=a.subNext,u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null,a.epoch!==s&&(Lo(a),Tn(a),xn(a)),a=c}}}function kn(e,n){if(!n)return Ct(e);Oe(n);let t=oe,r=0,o=null;pe&&(r=ue,o=fe,ue=0,fe=null,pe=!1),oe=n;try{e()}finally{oe=t,r!==0&&(ue=r,fe=o,pe=!0);let s=n;for(let a=s.depsHead??null;a!==null;a=a.subNext){let c=a.sig;c.__activeNode=a.prevActive,a.prevActive=null}}let i=n;return i._dispose??(i._dispose=()=>Oe(n))}function Ct(e,n){let t=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{_t(e,r)}finally{o._reentrant=!1}}},r=t;r.depsHead=null,r.depsTail=null,r._epoch=0,r._structDirty=!1,r._hasComputedDep=!1,r._runEpoch=0,r._runs=0,r._reentrant=!1,r._disposed=!1,r._errorPhase="binding",r._errorNode=n;try{t()}catch(o){throw r._disposed=!0,r._errorNode=void 0,Oe(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,Oe(r)})}function _n(e){if(!oe)return;let n=oe,t=e,r=n._epoch??0,o=t.__activeNode??null;if(o!==null&&o.sub===n){o.epoch=r,o.depVersion=t.__v??Number.NaN;return}t._validate!==void 0&&(n._hasComputedDep=!0);let i=Ao(e,n,r);i.depVersion=t.__v??Number.NaN,i.prevActive=o,t.__activeNode=i,Ro(n,i),No(t,i),n._structDirty=!0}function Oe(e){let n=e,t=n.depsHead??null;for(n.depsHead=null,n.depsTail=null;t;){let r=t.subNext;Tn(t),xn(t),t=r}}var nt=1e3,rt=1e6,ot=0,we=new Set;function Cn(e){let n=nt;return Number.isFinite(e)&&e>0&&(nt=Math.floor(e)),n}function An(e){let n=rt;return Number.isFinite(e)&&e>0&&(rt=Math.floor(e)),n}function Oo(e){let n=e;return n._runEpoch!==ot?(n._runEpoch=ot,n._runs=1,!1):(n._runs=(n._runs??0)+1,n._runs>nt)}function Ho(e){let n=e.__name??"<unnamed>";R(new Error(`subscriber "${n}" fired more than ${nt} times \u2014 likely a write-reads-self cycle between effects/signals. This subscriber is quarantined for the rest of this update; other pending work still runs.`),{phase:"scheduler",name:n})}function Io(){R(new Error(`Notification drain exceeded ${rt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function Nn(){let e=0;for(;e<ve.length;){if(e>=rt){Io();break}let n=ve[e++];if(re.delete(n),we.size>0&&we.has(n)||n._hasComputedDep===!0&&!Do(n))continue;if(Oo(n)){Ho(n),we.add(n);continue}let t=cn(n._cap??null);try{Po(n)}finally{t&&ln()}}}function Rn(){if(!(ye>0)){ye++,ot++;try{Nn()}finally{ye--,ye===0&&(ve.length=0,re.clear(),we.size>0&&we.clear())}}}function wt(e){e();let n=e._sig;if(!n)return;let t=Mo,r=t.length;for(t.push(n);t.length>r;){let i=t.pop().subsHead??null;for(;i;){let s=i.sub;if(s)if(s._c){let a=s._sig;a?(!a._d||a._f===!0)&&(a._d=!0,a._f=!1,t.push(a)):s()}else re.has(s)||(re.add(s),ve.push(s));i=i.sigNext}}}function Ln(e){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&(r._c?wt(r):re.has(r)||(re.add(r),ve.push(r))),t=t.sigNext}}function Mn(e){let t=e.subsHead;if(t){if(ye>0){let r=t;for(;r;){let o=r.sub;o&&(o._c?wt(o):re.has(o)||(re.add(o),ve.push(o))),r=r.sigNext}return}ye++,ot++;try{let r=t;for(;r;){let o=r.sub;o&&(o._c?wt(o):re.has(o)||(re.add(o),ve.push(o))),r=r.sigNext}Nn()}finally{ye--,ye===0&&(ve.length=0,re.clear(),we.size>0&&we.clear())}}}function Pn(e){return e.__sc??0}function Dn(e){let n=e,t=[],r=n.depsHead??null;for(;r;)r.sig&&t.push(r.sig),r=r.subNext;return t}function $n(e,n){let t=e.subsHead??null;for(;t;){let r=t.sub;r&&n(r),t=t.sigNext}}var On="4.7.0",Hn=Symbol.for("sibujs.reactive.v1");function Vo(){let e=globalThis,n=e[Hn];if(n)return!1,n;let t={suspendTracking:Et,resumeTracking:kt,isTrackingSuspended:wn,untracked:En,retrack:_t,track:kn,reactiveBinding:Ct,recordDependency:_n,cleanup:Oe,setMaxSubscriberRepeats:Cn,setMaxDrainIterations:An,drainNotificationQueue:Rn,queueSignalNotification:Ln,notifySubscribers:Mn,getSubscriberCount:Pn,getSubscriberDeps:Dn,forEachSubscriber:$n,version:On};return e[Hn]=t,t}var W=Vo(),Ee=W.suspendTracking,ke=W.resumeTracking,In=W.isTrackingSuspended,ie=W.untracked,Se=W.retrack,ee=W.track,U=W.reactiveBinding,_e=W.recordDependency,Ce=W.cleanup,hl=W.setMaxSubscriberRepeats,Bn=W.setMaxDrainIterations,Vn=W.drainNotificationQueue,jn=W.queueSignalNotification,He=W.notifySubscribers,yl=W.getSubscriberCount,vl=W.getSubscriberDeps,Sl=W.forEachSubscriber;function Ue(e,n,t){if($e(n))return ne(e,n,"",{label:`bindAttribute("${n}")`}),()=>{};function r(){let o;try{o=t()}catch(i){R(i,{phase:"binding",name:`bindAttribute("${n}")`,node:e});return}ne(e,n,o,{label:`bindAttribute("${n}")`})}return U(r,e)}function Fn(e,n,t){let r=null;function o(){let s;try{s=typeof n=="function"?n():n}catch(c){R(c,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof t=="function"?t():t}catch(c){R(c,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ne(e,s,a,{label:"bindDynamic"})&&(r=s)}let i=U(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var At=["data-focus-key","id","name"],jo=new Set(["text","search","url","tel","password",""]);function Fo(e){let n=e.tagName;if(!(n==="TEXTAREA"||n==="INPUT"&&jo.has(e.type.toLowerCase())))return{start:null,end:null,direction:null};let r=e;return{start:r.selectionStart,end:r.selectionEnd,direction:r.selectionDirection}}function Je(e){if(e.length===0||typeof document>"u")return null;let n=document.activeElement;if(!n||n===document.body)return null;let t=!1;for(let i=0;i<e.length;i++){let s=e[i];if(s===n||s.nodeType===1&&s.contains(n)){t=!0;break}}if(!t)return null;let r=null,o=null;for(let i=0;i<At.length;i++){let s=n.getAttribute(At[i]);if(s){r=At[i],o=s;break}}return{el:n,attr:r,value:o,tag:n.tagName,...Fo(n)}}function zo(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function qo(e,n){let t=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(n)&&(r++,t??(t=s));let a=s.querySelectorAll(n);for(let c=0;c<a.length;c++)r++,t??(t=a[c]);if(r>1)return{el:null,count:r}}return r===1?{el:t,count:r}:{el:null,count:r}}function zn(e,n){if(e.focus(),n.start!==null&&typeof e.setSelectionRange=="function"){let t=e,r=t.value.length,o=Math.min(n.start,r),i=Math.min(n.end??o,r);t.setSelectionRange(o,i,n.direction??"none")}}function Ie(e,n,t){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){zn(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=qo(n,`[${e.attr}=${zo(e.value)}]`);if(i&&i.tagName===e.tag){zn(i,e);return}o=s>1}}function me(e,n){let t=[];function r(){let o;try{o=n()}catch(f){R(f,{phase:"binding",name:"bindChildNode",node:e});return}let i=Je(t);if(o==null||typeof o=="boolean"){for(let f=0;f<t.length;f++){let h=t[f];I(h),h.parentNode&&h.parentNode.removeChild(h)}t.length=0,Ie(i,t,"bindChildNode");return}let s=e.parentNode;if(!s){t.length=0;return}let a;if(Array.isArray(o)){a=[];let f=new Set;for(let h=0;h<o.length;h++){let b=o[h];if(b==null||typeof b=="boolean")continue;let m=b instanceof Node?b:document.createTextNode(String(b));if(f.has(m)){!1;continue}f.add(m),a.push(m)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let c;if(t.length>0&&a.length>0){let f=new Set(t);c=new Set;for(let h=0;h<a.length;h++)f.has(a[h])&&c.add(a[h])}for(let f=0;f<t.length;f++){let h=t[f];c?.has(h)||(I(h),h.parentNode&&h.parentNode.removeChild(h))}let u=e;for(let f=0;f<a.length;f++){let h=a[f];u.nextSibling!==h&&s.insertBefore(h,u.nextSibling),u=h}t=a,Ie(i,a,"bindChildNode")}return U(r,e)}var O="http://www.w3.org/2000/svg",Wo=new Set(["script","iframe","object","embed","frame","frameset"]);function Ko(e){return Wo.has(e.toLowerCase())}var Uo=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Nt=new Set,qn=100,Wn=!1,Kn=new Map;function Un(e){let n=Kn.get(e);return n!==void 0||(n=e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Kn.set(e,n)),n}function Jo(e,n){if(typeof n=="function"){let r=n,o=[],i=!1,s=U(()=>{let a=r();if(a===null||typeof a!="object"){o=[],i=!0,e.setAttribute("style",tt(String(a),{element:e}));return}let c=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let f in a){let h=a[f];if(h==null)continue;let b=Un(f);u.push(b),c.setProperty(b,Ke(String(h),{property:b,element:e}))}for(let f=0;f<o.length;f++)u.indexOf(o[f])===-1&&c.removeProperty(o[f]);o=u},e);C(e,s);return}if(typeof n=="string"){e.setAttribute("style",tt(n,{element:e}));return}let t=e;for(let r in n){let o=n[r],i=Un(r);if(typeof o=="function"){let s=o,a=U(()=>{t.style.setProperty(i,Ke(String(s()),{property:i,element:e}))},e);C(e,a)}else t.style.setProperty(i,Ke(String(o),{property:i,element:e}))}}function Go(e,n){if(typeof n=="string"){e.setAttribute("class",n);return}if(typeof n=="function"){let i=U(()=>{let s=n();s==null||s===!1?e.removeAttribute("class"):e.setAttribute("class",s)},e);C(e,i);return}let t=n,r=!1,o="";for(let i in t){let s=t[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=U(()=>{let a="";for(let c in t){let u=t[c];(typeof u=="function"?u():u)&&(a=a?`${a} ${c}`:c)}e.setAttribute("class",a)},e);C(e,s)}else e.setAttribute("class",o)}function Rt(e,n){if(typeof n=="string"){e.textContent=n;return}if(typeof n=="number"){e.textContent=String(n);return}if(!(typeof n=="boolean"||n==null)){if(typeof n=="function"){let t=document.createComment("");e.appendChild(t),C(e,me(t,n));return}if(n instanceof Node){e.appendChild(n);return}if(Array.isArray(n))for(let t=0;t<n.length;t++){let r=n[t];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),C(e,me(o,r))}else if(r instanceof Node)e.appendChild(r);else if(Array.isArray(r))for(let o=0;o<r.length;o++){let i=r[o];if(typeof i=="function"){let s=document.createComment("");e.appendChild(s),C(e,me(s,i))}else i instanceof Node?e.appendChild(i):i!=null&&typeof i!="boolean"&&e.appendChild(document.createTextNode(String(i)))}else r!=null&&typeof r!="boolean"&&e.appendChild(document.createTextNode(String(r)))}}}function p(e,n){let t=Ko(e);return(r,o)=>{if(t)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=n?document.createElementNS(n,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Rt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Rt(i,r),i;let s=r,a=s.class;a!=null&&Go(i,a);let c=s.id;typeof c=="function"?C(i,Ue(i,"id",c)):c!=null&&(!1,i.id=c);let u=o!==void 0?o:s.nodes;u!=null&&Rt(i,u);let f=s.on;if(f)for(let m in f){let l=f[m];typeof l=="function"?i.addEventListener(m,l):!1}let h=s.style;h!=null&&Jo(i,h);let b=s.ref;b&&(b.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:{let l=s[m];if(l==null||$e(m))continue;typeof l=="function"?C(i,Ue(i,m,l)):ne(i,m,l,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var jl=p("html"),Yo=p("head"),Xo=p("body"),Zo=p("title"),M=p("div"),V=p("span"),Qo=p("section"),ei=p("article"),ti=p("header"),ni=p("footer"),ri=p("nav"),oi=p("main"),ii=p("aside"),si=p("address"),Lt=p("p"),ai=p("h1"),ci=p("h2"),Mt=p("h3"),li=p("h4"),ui=p("h5"),di=p("h6"),fi=p("blockquote"),pi=p("dd"),mi=p("dl"),gi=p("dt"),bi=p("figcaption"),hi=p("figure"),yi=p("hr"),vi=p("li"),Si=p("ol"),xi=p("ul"),Pt=p("pre"),Ti=p("a"),wi=p("abbr"),Ei=p("b"),ki=p("bdi"),_i=p("bdo"),Ci=p("br"),Ai=p("cite"),Dt=p("code"),Ni=p("data"),Ri=p("dfn"),Li=p("em"),Mi=p("i"),Pi=p("kbd"),Di=p("mark"),$i=p("q"),Oi=p("rp"),Hi=p("rt"),Ii=p("ruby"),Bi=p("s"),Vi=p("samp"),ji=p("small"),Fi=p("strong"),zi=p("sub"),qi=p("sup"),Wi=p("time"),Ki=p("u"),Ui=p("var"),Ji=p("area"),Gi=p("audio"),Yi=p("img"),Xi=p("map"),Zi=p("track"),Qi=p("video"),es=p("embed"),ts=p("iframe"),ns=p("object"),rs=p("param"),os=p("picture"),is=p("portal"),ss=p("source"),as=p("svg",O),cs=p("math"),ls=p("canvas"),us=p("noscript"),ds=p("script"),fs=p("del"),ps=p("ins"),ms=p("caption"),gs=p("col"),bs=p("colgroup"),hs=p("table"),ys=p("tbody"),vs=p("td"),Ss=p("tfoot"),xs=p("th"),Ts=p("thead"),ws=p("tr"),Ge=p("button"),Es=p("datalist"),ks=p("fieldset"),_s=p("form"),Cs=p("input"),As=p("label"),Ns=p("legend"),Rs=p("meter"),Ls=p("optgroup"),Ms=p("option"),Ps=p("output"),Ds=p("progress"),$s=p("select"),Os=p("textarea"),Hs=p("details"),Is=p("dialog"),Bs=p("menu"),Vs=p("summary"),js=p("slot"),Fs=p("template"),zs=p("base"),qs=p("link"),Ws=p("meta"),Ae=p("style"),Ks=p("circle",O),Us=p("ellipse",O),Js=p("g",O),Gs=p("line",O),Ys=p("path",O),Xs=p("polygon",O),Zs=p("polyline",O),Qs=p("rect",O),ea=p("text",O),ta=p("tspan",O),na=p("defs",O),ra=p("clipPath",O),oa=p("mask",O),ia=p("pattern",O),sa=p("linearGradient",O),aa=p("radialGradient",O),ca=p("stop",O),la=p("use",O),ua=p("symbol",O),da=p("marker",O),fa=p("center"),pa=p("font"),ma=p("marquee"),ga=e=>p(e);var $t="__sibuPendingError";function Jn(e,n){let t=()=>e.parentNode?(R(n,{phase:"render",name:"lazy",node:e}),!0):!1;t()||queueMicrotask(()=>{t()||(e[$t]=n)})}function it(e){let n=e,t=n[$t];if(t instanceof Error)return delete n[$t],t}function Gn(e){let n=null;return function(){if(n)return n();let r=M({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;n=i.default;let s=n();X(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));X(r,M({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Jn(r,s)}),r.appendChild(V("sibu-lazy-loading","Loading...")),C(r,()=>{o=!0}),r}}function Yn({nodes:e,fallback:n}){let t=M({class:"sibu-suspense"}),r=n();t.appendChild(r);let o=!1,i=null,s=null;return C(t,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!t.contains(s)&&I(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){X(t,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,X(t,a))}),i.observe(a,{childList:!0,subtree:!0})}else X(t,a)}catch(a){let c=a instanceof Error?a:new Error(String(a));Jn(t,c)}}),t}function at(e,n){try{return e()}catch(t){let r=n.toLowerCase().includes("unmount")?"cleanup":"effect";R(t,{phase:r,name:n});return}}function Ot(e,n,t,r){let o=at(e,n);typeof o=="function"&&(r()||!t.isConnected?at(o,"onUnmount"):Zn(o,t))}var Be=new WeakMap,Ne=new WeakMap,ge=new Set,be=new Set,Ve=null,st=0,ba=256;function Ht(e){let n=Be.get(e);if(n){Be.delete(e),ge.delete(e);for(let t of n)try{t()}catch{}}}function It(e){Ne.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let t=Ne.get(e);if(t){Ne.delete(e),be.delete(e);for(let r of t)try{r()}catch{}}})}function ha(e){if(ge.size===0||e.nodeType!==1)return;let n=e;if(ge.has(n)&&n.isConnected&&Ht(n),n.firstElementChild)for(let t of Array.from(ge))t!==n&&t.isConnected&&n.contains(t)&&Ht(t)}function ya(e){if(be.size===0||e.nodeType!==1)return;let n=e;if(be.has(n)&&!n.isConnected&&It(n),n.firstElementChild)for(let t of Array.from(be))t!==n&&!t.isConnected&&n.contains(t)&&It(t)}function va(){if(ge.size>0)for(let e of Array.from(ge))e.isConnected&&Ht(e);if(be.size>0)for(let e of Array.from(be))e.isConnected||It(e)}function Xn(){Ve||typeof document>"u"||(Ve=new MutationObserver(e=>{for(let n of e)if(n.type==="childList"){if(n.addedNodes.length>0)for(let t=0;t<n.addedNodes.length;t++)ha(n.addedNodes[t]);if(n.removedNodes.length>0)for(let t=0;t<n.removedNodes.length;t++)ya(n.removedNodes[t])}st+=e.length,st>=ba&&(st=0,va()),Bt()}),Ve.observe(document.body,{childList:!0,subtree:!0}))}function Bt(){Ve&&ge.size===0&&be.size===0&&(Ve.disconnect(),Ve=null,st=0)}function Sa(e,n){let t=Be.get(e);return t||(t=[],Be.set(e,t)),t.push(n),ge.add(e),Xn(),()=>{let r=Be.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Be.delete(e),ge.delete(e))}Bt()}}function xa(e,n){let t=Ne.get(e);return t||(t=[],Ne.set(e,t)),t.push(n),be.add(e),Xn(),()=>{let r=Ne.get(e);if(r){let o=r.indexOf(n);o!==-1&&r.splice(o,1),r.length===0&&(Ne.delete(e),be.delete(e))}Bt()}}function ct(e,n){if(!(typeof document>"u"))if(n){let t=!1,r=()=>t;if(C(n,()=>{t=!0}),n.isConnected){queueMicrotask(()=>{t||Ot(e,"onMount",n,r)});return}queueMicrotask(()=>{if(t)return;if(n.isConnected){Ot(e,"onMount",n,r);return}let o=Sa(n,()=>{t||Ot(e,"onMount",n,r)});C(n,o)})}else queueMicrotask(()=>{at(e,"onMount")})}function Zn(e,n){if(typeof document>"u")return;let t=!1,r=()=>{t||(t=!0,at(e,"onUnmount"))};C(n,r);let o=()=>{if(t)return;let i=xa(n,r);C(n,i)};n.isConnected?o():ct(()=>{o()},n)}function Ta(e,n){C(n,e)}function te(e,n,t){try{e.emit(n,t)}catch{}}var Vt=Symbol.for("sibujs.ssr.v1");function wa(){let e=null;try{if(typeof process<"u"&&process.versions&&process.versions.node){let n=null,t=process.getBuiltinModule;typeof t=="function"?n=t("node:async_hooks"):typeof ht=="function"&&(n=ht("async_hooks")),n&&(e=new n.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var xe=globalThis[Vt]??(globalThis[Vt]=wa()),Re=xe.als,G=xe.fallbackStore;xe.fallbackDepth??(xe.fallbackDepth=0);var Qn=!1;function Ea(){if(Qn||Re||!(typeof process<"u"&&!!process.versions?.node))return;Qn=!0;let n=process.versions.node;`${n}`}function Le(){if(Re){let e=Re.getStore();if(e)return e}return G}function er(){return Re?Re.getStore()??null:xe.fallbackDepth>0?G:null}function se(){return Le().ssr}function tr(e){if(!se())return null;let n=Le(),t=n.caches??(n.caches=new Map),r=t.get(e);return r||(r=new Map,t.set(e,r)),r}function nr(){Le().ssr=!0}function rr(){Le().ssr=!1}function or(e){let n={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Re)return Re.run(n,e);Ea();let t=G.ssr,r=G.suspenseIdCounter,o=G.idCounter,i=G.locale;G.ssr=!0,G.suspenseIdCounter=0,G.idCounter=0,G.locale=void 0,xe.fallbackDepth++;try{return e()}finally{xe.fallbackDepth--,G.ssr=t,G.suspenseIdCounter=r,G.idCounter=o,G.locale=i}}function ir(e){let n=Le(),t=n.ssr;n.ssr=!0;try{return e()}finally{t||(n.ssr=!1)}}var cr=globalThis;function ka(e,n){let t,r=!0;return()=>{let o=e();if(r)r=!1,t=o,ie(()=>n(o,void 0));else{let i=t;t=o,ie(()=>n(o,i))}}}var sr=100;function lt(e){let n=e.userCleanups;if(n.length!==0){e.userCleanups=[];for(let t=n.length-1;t>=0;t--)try{n[t]()}catch(r){R(r,{phase:"cleanup"})}}}function ar(e){let n=1;do e.rerunPending=!1,e.userCleanups.length>0&<(e),Se(e.bodyFn,e.subscriber);while(e.rerunPending&&++n<=sr);e.rerunPending&&(e.rerunPending=!1,R(new Error(`effect re-requested itself ${sr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function _a(e){if(e.disposed)return;e.disposed=!0;let n=cr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(n)try{n.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&<(e)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",t)}try{Ce(e.subscriber)}catch(t){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",t)}}function Y(e,n){if(se())return()=>{};let t={fn:e,onError:n?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};t.onCleanup=s=>{t.userCleanups.push(s)};let r=t.onError;t.bodyFn=r?()=>{try{t.fn(t.onCleanup)}catch(s){r(s)}}:()=>{t.fn(t.onCleanup)};let o=(()=>{if(!t.disposed){if(t.running){t.rerunPending=!0;return}t.running=!0;try{t.rerunPending=!1,t.userCleanups.length>0&<(t),Se(t.bodyFn,o),t.rerunPending&&ar(t)}finally{t.running=!1,t.rerunPending=!1}}});o.depsHead=null,o.depsTail=null,o._epoch=0,o._structDirty=!1,o._hasComputedDep=!1,o._errorPhase="effect",o._runEpoch=0,o._runs=0,t.subscriber=o,t.running=!0;try{Se(t.bodyFn,t.subscriber),t.rerunPending&&ar(t)}catch(s){throw t.disposed=!0,t.userCleanups.length>0&<(t),Ce(t.subscriber),s}finally{t.running=!1,t.rerunPending=!1}let i=cr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&te(i,"effect:create",{effectFn:e}),()=>_a(t)}var Ye=0,jt=new Set;function Ca(e){Ye++;try{return e()}finally{Ye--,Ye===0&&Ra()}}function Aa(e){return Ye===0?!1:(jt.add(e),!0)}function Na(){return Ye>0}function Ra(){try{for(let e of jt)jn(e)}finally{jt.clear()}Vn()}var lr=Symbol.for("sibujs.reactive.batch.v1");function La(){let e=globalThis,n=e[lr];if(n)return n;let t={batch:Ca,enqueueBatchedSignal:Aa,isBatching:Na};return e[lr]=t,t}var Ft=La(),j=Ft.batch,Me=Ft.enqueueBatchedSignal,Ma=Ft.isBatching;var zt=globalThis;function A(e,n){let t={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=n?.equals;r&&(t.__name=r);function i(){return _e(t),t.value}i.__signal=t,r&&(i.__name=r);let s;if(o?s=a=>{let c=t.value,u=typeof a=="function"?a(c):a;if(!o(c,u)){if(t.value=u,t.__v++,!1){let f=zt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;f&&te(f,"signal:update",{signal:t,name:r,oldValue:c,newValue:u})}Me(t)||He(t)}}:s=a=>{let c=t.value,u=typeof a=="function"?a(c):a;Object.is(u,c)||(t.value=u,t.__v++,Me(t)||He(t))},!1){let a=zt.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&te(a,"signal:create",{signal:t,name:r,getter:i,initial:e})}return[i,s]}function Pa(e){let[n,t]=A(0,e?.name?{name:e.name}:void 0);return{track(){n()},invalidate(){t(r=>r+1)}}}var Da=`
|
|
1
|
+
"use strict";(()=>{var Co=Object.defineProperty;var Nt=(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 wn=(e,t)=>{for(var n in t)Co(e,n,{get:t[n],enumerable:!0})};var vn={};wn(vn,{DynamicComponent:()=>Jl,ErrorBoundary:()=>Pl,ErrorDisplay:()=>dn,Fragment:()=>Zl,KeepAlive:()=>eu,Loading:()=>$l,MAX_DRAIN_TEARDOWNS:()=>me,Portal:()=>ru,SVG_NS:()=>I,Suspense:()=>Tr,__renderParsedTemplate:()=>io,__resetIdCounter:()=>Yr,a:()=>ps,abbr:()=>ms,action:()=>Il,address:()=>Zi,area:()=>Bs,array:()=>iu,article:()=>qi,aside:()=>Yi,asyncDerived:()=>au,audio:()=>Vs,autoResize:()=>Kr,b:()=>gs,base:()=>Da,batch:()=>F,bdi:()=>bs,bdo:()=>hs,bindDynamic:()=>mr,blockquote:()=>rs,body:()=>Fi,br:()=>ys,button:()=>tt,canvas:()=>ea,caption:()=>ia,catchError:()=>Hl,catchErrorAsync:()=>Bl,center:()=>rl,checkLeaks:()=>Ln,circle:()=>Ia,cite:()=>vs,clickOutside:()=>Wr,clipPath:()=>Ja,code:()=>en,col:()=>sa,colgroup:()=>aa,context:()=>jl,copyOnClick:()=>Ur,createId:()=>Gr,customElement:()=>sl,data:()=>Ss,datalist:()=>ga,dd:()=>os,deepEqual:()=>Ke,deepSignal:()=>lu,defer:()=>_u,defs:()=>Ka,del:()=>ra,derived:()=>Be,details:()=>Aa,dfn:()=>xs,dialog:()=>Na,disableSSR:()=>Nr,dispose:()=>V,div:()=>P,dl:()=>is,dt:()=>ss,each:()=>Yl,effect:()=>Z,ellipse:()=>Ha,em:()=>Ts,embed:()=>qs,enableSSR:()=>Ar,enhance:()=>Et,enhanceAll:()=>yu,enqueueBatchedSignal:()=>Ie,external:()=>El,fieldset:()=>ba,figcaption:()=>as,figure:()=>ls,font:()=>ol,footer:()=>Ki,form:()=>ha,g:()=>Ba,getAction:()=>zr,getRequestScopedCache:()=>_r,getRuntimeErrorHandler:()=>Cn,getSSRStore:()=>$e,getSlot:()=>ou,h1:()=>Xi,h2:()=>Qi,h3:()=>Xt,h4:()=>es,h5:()=>ts,h6:()=>ns,head:()=>ji,header:()=>Ui,hr:()=>us,html:()=>oo,i:()=>ws,iframe:()=>Us,img:()=>js,input:()=>ya,ins:()=>oa,isBatching:()=>wl,isSSR:()=>ue,kbd:()=>Es,label:()=>va,lazy:()=>xr,lazyIsland:()=>Su,legend:()=>Sa,li:()=>cs,line:()=>Va,linearGradient:()=>Za,link:()=>Oa,longPress:()=>qr,main:()=>Gi,map:()=>Fs,mark:()=>ks,marker:()=>nl,marquee:()=>il,mask:()=>Ga,match:()=>Wl,math:()=>Qs,menu:()=>Ra,meta:()=>$a,meter:()=>xa,mount:()=>tu,mountIslands:()=>Eu,nav:()=>Ji,nextTick:()=>Ru,noscript:()=>ta,object:()=>Ks,ol:()=>ds,on:()=>bl,onCleanup:()=>pl,onMount:()=>vt,onUnmount:()=>Er,optgroup:()=>Ta,option:()=>wa,output:()=>Ea,p:()=>Zt,param:()=>Js,path:()=>ja,pattern:()=>Ya,picture:()=>Gs,polygon:()=>Fa,polyline:()=>za,portal:()=>Ys,pre:()=>Qt,progress:()=>ka,q:()=>Cs,radialGradient:()=>Xa,reactiveArray:()=>su,rect:()=>Wa,ref:()=>uu,registerAction:()=>Ue,registerComponent:()=>ql,registerDisposer:()=>_,registerIsland:()=>xu,replaceChildrenSafely:()=>X,reportDrainRunaway:()=>Se,reportError:()=>R,resolveComponent:()=>Kl,retrack:()=>Ee,rp:()=>_s,rt:()=>As,ruby:()=>Ns,runInSSRContext:()=>Rr,s:()=>Rs,samp:()=>Ls,script:()=>na,section:()=>Wi,select:()=>Ca,setGlobalErrorHandler:()=>Vl,setMaxDrainIterations:()=>dr,setRuntimeErrorHandler:()=>kn,show:()=>Fl,signal:()=>A,slot:()=>Ma,small:()=>Ms,source:()=>Zs,span:()=>j,stop:()=>Qa,store:()=>cu,strict:()=>pu,strictEffect:()=>mu,strong:()=>Ps,style:()=>Pe,sub:()=>Ds,summary:()=>La,sup:()=>Os,svg:()=>Xs,symbol:()=>tl,table:()=>la,tagFactory:()=>p,takePendingError:()=>bt,tbody:()=>ua,td:()=>ca,template:()=>Pa,text:()=>qa,textarea:()=>_a,tfoot:()=>da,th:()=>fa,thead:()=>pa,time:()=>$s,title:()=>zi,tr:()=>ma,track:()=>zs,transition:()=>Nu,trapFocus:()=>Jr,trustHTML:()=>bo,tspan:()=>Ua,u:()=>Is,ul:()=>fs,unregisterComponent:()=>Ul,unregisterDisposer:()=>Ze,unregisterIsland:()=>Tu,untracked:()=>le,use:()=>el,var_:()=>Hs,video:()=>Ws,watch:()=>du,when:()=>zl,withSSR:()=>Lr,writable:()=>fu});var En=Symbol.for("sibujs.runtime-errors.v1");function Rt(){let e=globalThis,t=e[En];if(t)return t;let n={handler:null,handlerDepth:0};return e[En]=n,n}function kn(e){let t=Rt(),n=t.handler;return t.handler=e,n}function Cn(){return Rt().handler}function Lt(e){if(e instanceof Error)return e;let t=typeof e=="string"?e:`Non-Error value thrown: ${_o(e)}`;return new Error(t,{cause:e})}function _o(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 Ao(e){return e.name?`${e.phase} "${e.name}"`:e.phase}var No=Symbol.for("sibujs.reactive.v1");function Ro(e){let t=globalThis[No];return t?.untracked?t.untracked(e):e()}var Lo="sibu:error-propagate";function Mo(e,t){let n=t.node;if(!n||typeof CustomEvent>"u")return!1;let r=Po(n);if(!r)return!1;try{let o=new CustomEvent(Lo,{bubbles:!0,cancelable:!0,detail:{error:e,context:t}});return r.dispatchEvent(o)===!1}catch{return!1}}function Po(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 Do(e,t){typeof console>"u"||console.error(`[SibuJS] Uncaught error during ${Ao(t)}: ${e.message}`,e)}function R(e,t){let n=Lt(e);Ro(()=>{if(Mo(n,t))return;let r=Rt(),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--}}Do(n,t)})}function de(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:!1}var fe=new WeakMap,me=1e4;function Se(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 Ce=0;function st(e){let t=e;for(;t?.closed;)t=t.forwardTo;return t??null}var ee=[];function _n(){return st(ee[ee.length-1])}function An(e){return e===null&&ee.length===0?!1:(ee.push(st(e)),!0)}function Nn(){ee.pop()}function _(e,t){let n=fe.get(e);n||(n=[],fe.set(e,n)),n.push(t),!1;let r=st(ee[ee.length-1]);r&&r.entries.push([e,t])}function Rn(e){let t={entries:[],closed:!1},n=t.entries;ee.push(t);let r;try{r=e()}catch(i){let s=0;try{for(;n.length>0;){if(s>=me){Se("rollback",s,n.length);break}let[a,l]=n.pop();if(Ze(a,l)){s++;try{l()}catch(u){R(u,{phase:"cleanup",name:"disposer"})}}}}finally{t.closed=!0,n.length=0,ee.pop()}throw i}t.closed=!0,ee.pop();let o=st(ee[ee.length-1]);if(o){for(let i of n)fe.get(i[0])?.includes(i[1])&&o.entries.push(i);t.forwardTo=o}return n.length=0,r}function Ze(e,t){let n=fe.get(e);if(!n)return!1;let r=n.indexOf(t);return r===-1?!1:(n.splice(r,1),!1,n.length===0&&fe.delete(e),!0)}function V(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--)Oo(n[r])}function Oo(e){if(!fe.has(e))return;let t=0,n=!1;for(;!n;){let r=fe.get(e);if(!r||r.length===0)break;let o=r.slice();fe.delete(e),!1;for(let i=0;i<o.length;i++){if(t>=me){let s=o.slice(i),a=fe.get(e);fe.set(e,a?s.concat(a):s),!1,Se("dispose",t,s.length+(a?.length??0)),n=!0;break}t++;try{o[i]()}catch(s){R(s,{phase:"cleanup",name:"disposer"})}}}}function X(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++)V(n[r]);e.replaceChildren(...t)}function Ln(e=0){return 0}function Ve(e){return e.replace(/[\x00-\x20\x7f-\x9f]+/g,"")}var $o=/[A-Z]/,Io=/[A-Z]/g;function te(e){return $o.test(e)?e.replace(Io,t=>String.fromCharCode(t.charCodeAt(0)+32)):e}function xe(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 Ho=["http:","https:","mailto:","tel:","ftp:"],Bo=/^[\x00-\x20\x7f-\x9f]+|[\x00-\x20\x7f-\x9f]+$/g;function lt(e){let t=Ve(e).trim();if(!t)return"";let n=e.replace(Bo,"");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)&&Ho.indexOf(i)===-1?"":n}var Vo=/^\d+(\.\d+)?[wx]$/;function Mt(e){return e===" "||e===" "||e===`
|
|
2
|
+
`||e==="\r"||e==="\f"}function jo(e){let t=String(e),n=[],r=0,o=t.length;for(;r<o;){for(;r<o&&(Mt(t[r])||t[r]===",");)r++;if(r>=o)break;let i=r;for(;r<o&&!Mt(t[r]);)r++;let s=t.slice(i,r),a=[];if(s.endsWith(","))s=s.replace(/,+$/,"");else{let u="",d=!1;for(;r<o;){let g=t[r];if(d){u+=g,g===")"&&(d=!1),r++;continue}if(Mt(g)){u&&a.push(u),u="",r++;continue}if(g===","){r++;break}g==="("&&(d=!0),u+=g,r++}u&&a.push(u)}if(s===""||a.length>1||a.length===1&&!Vo.test(a[0]))continue;let l=lt(s);l&&(l.startsWith(",")||l.endsWith(",")||n.push(a.length===1?`${l} ${a[0]}`:l))}return n.join(", ")}var Fo=/[(:@\\]/;function zo(e){return e===" "||e===" "||e===`
|
|
3
|
+
`||e==="\r"||e==="\f"}function Mn(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"}function Wo(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
|
+
`||o==="\f"){n+=1;continue}if(o==="\r"){n+=e[n+2]===`
|
|
5
|
+
`?2:1;continue}if(Mn(o)){let i="",s=n+1;for(;s<e.length&&i.length<6&&Mn(e[s]);)i+=e[s],s++;s<e.length&&zo(e[s])&&(s+=e[s]==="\r"&&e[s+1]===`
|
|
6
|
+
`?2:1);let a=Number.parseInt(i,16),l=a===0||a>1114111||a>=55296&&a<=57343;t+=l?"\uFFFD":String.fromCodePoint(a),n=s-1;continue}t+=o,n+=1}return t}var Pn=["url(","expression(","javascript:","vbscript:","-moz-binding","behavior:","@import","image-set(","filter:progid","image(","src("],qo=4,Uo=5,Ko=8;function Jo(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 Pt=new Set,Dn=100,On=!1;function at(e,t,n){}function $n(e){return(e.includes("\\")?Wo(e):e).toLowerCase().replace(/\s+/g,"")}function Dt(e){if(!Fo.test(e))return-1;let t=$n(e);for(let n=0;n<Pn.length;n++)if(t.includes(Pn[n]))return n;return-1}function ut(e,t,n){let r=Ot(e,t);return r===-1?t:(at(t,r,{property:e,element:n?.element}),"")}function Ot(e,t){let n=Dt(t);if(n!==-1)return n;let r=te(e);return r==="behavior"?Uo:r==="-moz-binding"?qo:(r==="filter"||r==="-ms-filter")&&$n(t).includes("progid:")?Ko:-1}function Go(e){let t=[],n="",r=0,o="";for(let s=0;s<e.length;s++){let a=e[s];if(o){n+=a,a==="\\"&&s+1<e.length?n+=e[++s]:a===o&&(o="");continue}if(a==="\\"){n+=a,s+1<e.length&&(n+=e[++s]);continue}if(a==="/"&&e[s+1]==="*"){let l=e.indexOf("*/",s+2);if(l===-1)return null;s=l+1;continue}if(a==='"'||a==="'")o=a;else if(a==="("||a==="[")r++;else if(a===")"||a==="]"){if(--r<0)return null}else{if(a==="{"||a==="}")return null;if(a===";"&&r===0){t.push(n),n="";continue}}n+=a}if(o||r!==0)return null;t.push(n);let i=[];for(let s of t){let a=s.indexOf(":");if(a===-1)continue;let l=s.slice(0,a).trim();if(!/^(--[\w-]+|-?[a-zA-Z_][\w-]*)$/.test(l))continue;let u=s.slice(a+1).trim(),d=/!\s*important\s*$/i.exec(u);if(d&&(u=u.slice(0,d.index).trim()),u==="")continue;let g=l.startsWith("--")?l:te(l);i.push([g,u,d!==null])}return i}function Yo(e,t){let n=String(e),r=Go(n);if(r===null)return Dt(n)!==-1&&at(n,Dt(n),t),"";let o=[];for(let[i,s,a]of r){let l=Ot(i,s);if(l!==-1){at(s,l,{property:i,element:t?.element});continue}o.push(`${i}: ${s}${a?" !important":""}`)}return o.join("; ")}function ct(e,t){let n=String(e);if(n.trim()==="")return"";if(typeof document>"u")return Yo(n,t);let r=document.createElement("div");try{r.style.cssText=n}catch{return""}let o=[];for(let i=0;i<r.style.length;i++){let s=r.style[i],a=r.style.getPropertyValue(s),l=Ot(s,a);if(l!==-1){at(a,l,{property:s,element:t?.element});continue}let u=r.style.getPropertyPriority(s);o.push(`${s}: ${a}${u?` !${u}`:""}`)}return o.join("; ")}var $t=new Set(["href","xlink:href","src","action","formaction","formtarget","cite","poster","background","srcset","ping","data","manifest"]),Zo=new Set(["srcdoc"]);function Xe(e){return Zo.has(e.toLowerCase())}function In(e){return $t.has(e.toLowerCase())}function Xo(e){let t=e.toLowerCase();return t==="style"||$t.has(t)}function Qo(e,t,n){let r=e.toLowerCase();return r==="srcset"?jo(t):$t.has(r)?lt(t):r==="style"?ct(t,n):t}function Hn(e,t,n){if(!Xo(e))return t;let r=Qo(e,t,n);return r===""?null:r}function _e(e){return e===" "||e===" "||e===`
|
|
7
|
+
`||e==="\r"||e==="\f"}function dt(e){let t=0,n=e.length;for(;t<n&&_e(e[t]);)t++;for(;n>t&&_e(e[n-1]);)n--;return e.slice(t,n)}var ne=e=>({kind:"forbidden",reason:e});function ei(e){let t=dt(Ve(e));if(t==="")return ne("");let n=0;for(;n<t.length&&t[n]>="0"&&t[n]<="9";)n++;if(n===0)return ne("");let r=Number.parseInt(t.slice(0,n),10);if(!Number.isFinite(r))return ne("");for(;n<t.length&&_e(t[n]);)n++;if(n===t.length)return{kind:"delay-only",delay:r};if(t[n]!==";"&&t[n]!==",")return ne("");for(n++;n<t.length&&_e(t[n]);)n++;let o=n;for(;n<t.length&&!_e(t[n])&&t[n]!=="=";)n++;let i=t.slice(o,n).toLowerCase();if(i!=="url")return ne("");for(;n<t.length&&_e(t[n]);)n++;if(t[n]!=="=")return ne("");for(n++;n<t.length&&_e(t[n]);)n++;let s,a=t[n];if(a==='"'||a==="'"){let u=t.indexOf(a,n+1);if(u===-1)return ne("");if(s=t.slice(n+1,u),dt(t.slice(u+1))!=="")return ne("")}else if(s=dt(t.slice(n)),/[;,]/.test(s))return ne("");if(s==="")return ne("");let l=lt(s);return l===""?ne(""):{kind:"allowed",delay:r,destination:s,sanitizedDestination:l}}function It(e){let t,n,r,o=new Set;for(let[i,s]of e){let a=te(i);o.has(a)&&(r=a),o.add(a),a==="http-equiv"?t=s:a==="content"&&(n=s)}return r!==void 0?ne(""):typeof t!="string"?{kind:"not-refresh"}:dt(Ve(t)).toLowerCase()!=="refresh"?{kind:"not-refresh"}:typeof n!="string"?{kind:"not-refresh"}:ei(n)}var ti="http://www.w3.org/1999/xhtml",ni="http://www.w3.org/2000/svg",ri=new Set(["script","iframe","object","embed","frame","frameset"]);function Vn(e){return te(e)}function jn(e){return ri.has(Vn(e))}var oi=new Set(["script","style"]);function Fn(e){return oi.has(Vn(e))}var H={None:0,MetaRefreshForbidden:1,MetaRefreshReactive:2,ScriptSource:3,AnimationTarget:4,StylesheetSource:5},ii=new Set(["src","href","xlink:href","type","language"]),si=new Set(["animate","set","animateMotion","animateTransform","animateColor"]),Ht=new WeakSet;function zn(e){return e.namespaceURI===ti||e.namespaceURI===null}function Wn(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 ai(e){Ht.has(e)||(Ht.add(e),e.getAttribute("content")!==null&&It(Wn(e,null,null)).kind!=="not-refresh"&&e.removeAttribute("content"))}function li(e,t,n,r){if(!zn(e))return H.None;let o=te(t);if(o!=="http-equiv"&&o!=="content"||(r==="reactive"&&ai(e),n===null)||o==="content"&&!e.hasAttribute("http-equiv"))return H.None;let i=It(Wn(e,o,n));return i.kind==="forbidden"?H.MetaRefreshForbidden:i.kind!=="not-refresh"&&Ht.has(e)?H.MetaRefreshReactive:H.None}function ui(e,t){if(t===null||te(e)!=="attributename")return H.None;let n=Ve(t);return In(n)||xe(n)||Xe(n)?H.AnimationTarget:H.None}var ft=new WeakSet;function Bn(e){if(e===null)return!1;let t=te(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 ci(e,t,n,r){if(!zn(e))return H.None;let o=te(t);return o==="href"?r==="static"||n===null?H.None:Bn(e.getAttribute("rel"))?H.StylesheetSource:(ft.add(e),H.None):o==="rel"&&Bn(n)&&ft.has(e)&&e.hasAttribute("href")?H.StylesheetSource:H.None}function Bt(e,t,n,r){let o=e.localName;return o==="meta"?li(e,t,n,r):o==="link"?ci(e,t,n,r):o==="script"?r==="static"||n===null?H.None:ii.has(te(t))?H.ScriptSource:H.None:si.has(o)&&e.namespaceURI===ni?ui(t,n):H.None}function Vt(e,t,n){e.localName!=="link"||te(t)!=="href"||(n!=="static"&&e.hasAttribute("href")?ft.add(e):ft.delete(e))}var di="http://www.w3.org/1999/xhtml",fi="http://www.w3.org/2000/svg",pi="http://www.w3.org/1999/xlink",mi="http://www.w3.org/XML/1998/namespace",gi=new Set(["checked","disabled","selected"]);function bi(e){return e.namespaceURI===null||e.namespaceURI===di}function Un(e,t,n){}function qn(e,t,n){e[t]=n}function hi(e,t){if(e.namespaceURI!==fi)return null;let n=t.toLowerCase();return n.startsWith("xlink:")?pi:n.startsWith("xml:")?mi:null}function ie(e,t,n,r={}){let o=yi(e,t,n,r);return e.localName==="link"&&Vt(e,t,r.reactive?"reactive":"runtime"),o}function yi(e,t,n,r){let o=hi(e,t),i=o?t.slice(t.indexOf(":")+1):t;if(xe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let s=n==null||n===!1?null:n===!0?"":String(n),a=Bt(e,t,s,r.reactive?"reactive":"runtime");if(a!==H.None)return Un(r.label??"setSafeAttribute",t,a),o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;if(n==null)return o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0;if(Xe(t))return!1,o?e.removeAttributeNS(o,i):e.removeAttribute(t),!1;let l=bi(e),u=l?t.toLowerCase():t;if(typeof n=="boolean"){if(t.length>5&&t.slice(0,5).toLowerCase()==="aria-"){let m=n?"true":"false";return(o?e.getAttributeNS(o,i):e.getAttribute(t))!==m&&(o?e.setAttributeNS(o,t,m):e.setAttribute(t,m)),!0}return l&&gi.has(u)&&u in e?qn(e,u,n):n?o?e.setAttributeNS(o,t,""):e.setAttribute(t,""):o?e.removeAttributeNS(o,i):e.removeAttribute(t),!0}let d=String(n);if(r.syncValueProperty!==!1&&l&&(u==="value"||u==="checked")&&u in e)return qn(e,u,u==="checked"?!!n:d),!0;let g=d===""?"":Hn(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 jt(e,t,n){if(Xe(t))return!1,!1;let r=Bt(e,t,n,"static");return r!==H.None?(Un("html (static attribute)",t,r),!1):(e.setAttribute(t,n),e.localName==="link"&&Vt(e,t,"static"),!0)}var vi=4096,Ft=[];function Si(){return{sig:null,sub:null,epoch:0,depVersion:0,sigPrev:null,sigNext:null,subPrev:null,subNext:null,prevActive:null}}function xi(e,t,n){let r=Ft.pop();if(r)return r.sig=e,r.sub=t,r.epoch=n,r;let o=Si();return o.sig=e,o.sub=t,o.epoch=n,o}function Kn(e){e.sig=null,e.sub=null,e.sigPrev=null,e.sigNext=null,e.subPrev=null,e.subNext=null,e.prevActive=null,Ft.length<vi&&Ft.push(e)}function Ti(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 Jn(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 wi(e,t){let n=e.depsTail??null;t.subPrev=n,t.subNext=null,n?n.subNext=t:e.depsHead=t,e.depsTail=t}function Ei(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 ae=null,ge=null,Te=0,we=[],se=new Set,ki=[];function Ci(e){try{e()}catch(t){let n=e;R(t,{phase:n._errorPhase??"effect",name:n.__name,node:n._errorNode})}}function _i(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 pe=0,be=!1;function Wt(){pe===0&&(ge=ae,ae=null,be=!0),pe++}function qt(){pe--,pe===0&&(ae=ge,ge=null,be=!1)}function Gn(){return be}function Yn(e){Wt();try{return e()}finally{qt()}}var Ai=0;function Ut(e,t){let n=ae,r=0,o=null;be&&(r=pe,o=ge,pe=0,ge=null,be=!1),ae=t;let i=t;i._cap===void 0&&(i._cap=_n());let s=++Ai;i._epoch=s,i._structDirty=!1;for(let a=i.depsHead??null;a!==null;a=a.subNext){let l=a.sig;a.prevActive=l.__activeNode??null,l.__activeNode=a}try{e()}finally{ae=n,r!==0&&(pe=r,ge=o,be=!0);let a=i.depsHead??null;for(;a!==null;){let l=a.subNext,u=a.sig;u.__activeNode=a.prevActive,a.prevActive=null,a.epoch!==s&&(Ei(a),Jn(a),Kn(a)),a=l}}}function Zn(e,t){if(!t)return Kt(e);je(t);let n=ae,r=0,o=null;be&&(r=pe,o=ge,pe=0,ge=null,be=!1),ae=t;try{e()}finally{ae=n,r!==0&&(pe=r,ge=o,be=!0);let s=t;for(let a=s.depsHead??null;a!==null;a=a.subNext){let l=a.sig;l.__activeNode=a.prevActive,a.prevActive=null}}let i=t;return i._dispose??(i._dispose=()=>je(t))}function Kt(e,t){let n=()=>{let o=r;if(!(o._disposed||o._reentrant)){o._reentrant=!0;try{Ut(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,je(r),o}return r._dispose??(r._dispose=()=>{r._disposed=!0,r._errorNode=void 0,je(r)})}function Xn(e){if(!ae)return;let t=ae,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=xi(e,t,r);i.depVersion=n.__v??Number.NaN,i.prevActive=o,n.__activeNode=i,wi(t,i),Ti(n,i),t._structDirty=!0}function je(e){let t=e,n=t.depsHead??null;for(t.depsHead=null,t.depsTail=null;n;){let r=n.subNext;Jn(n),Kn(n),n=r}}var pt=1e3,mt=1e6,gt=0,Ae=new Set;function Qn(e){let t=pt;return Number.isFinite(e)&&e>0&&(pt=Math.floor(e)),t}function er(e){let t=mt;return Number.isFinite(e)&&e>0&&(mt=Math.floor(e)),t}function Ni(e){let t=e;return t._runEpoch!==gt?(t._runEpoch=gt,t._runs=1,!1):(t._runs=(t._runs??0)+1,t._runs>pt)}function Ri(e){let t=e.__name??"<unnamed>";R(new Error(`subscriber "${t}" fired more than ${pt} 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 Li(){R(new Error(`Notification drain exceeded ${mt} iterations \u2014 absolute safety net tripped. Breaking to prevent infinite loop.`),{phase:"scheduler"})}function tr(){let e=0;for(;e<we.length;){if(e>=mt){Li();break}let t=we[e++];if(se.delete(t),Ae.size>0&&Ae.has(t)||t._hasComputedDep===!0&&!_i(t))continue;if(Ni(t)){Ri(t),Ae.add(t);continue}let n=An(t._cap??null);try{Ci(t)}finally{n&&Nn()}}}function nr(){if(!(Te>0)){Te++,gt++;try{tr()}finally{Te--,Te===0&&(we.length=0,se.clear(),Ae.size>0&&Ae.clear())}}}function zt(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 se.has(s)||(se.add(s),we.push(s));i=i.sigNext}}}function rr(e){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&(r._c?zt(r):se.has(r)||(se.add(r),we.push(r))),n=n.sigNext}}function or(e){let n=e.subsHead;if(n){if(Te>0){let r=n;for(;r;){let o=r.sub;o&&(o._c?zt(o):se.has(o)||(se.add(o),we.push(o))),r=r.sigNext}return}Te++,gt++;try{let r=n;for(;r;){let o=r.sub;o&&(o._c?zt(o):se.has(o)||(se.add(o),we.push(o))),r=r.sigNext}tr()}finally{Te--,Te===0&&(we.length=0,se.clear(),Ae.size>0&&Ae.clear())}}}function ir(e){return e.__sc??0}function sr(e){let t=e,n=[],r=t.depsHead??null;for(;r;)r.sig&&n.push(r.sig),r=r.subNext;return n}function ar(e,t){let n=e.subsHead??null;for(;n;){let r=n.sub;r&&t(r),n=n.sigNext}}var lr="4.8.0",ur=Symbol.for("sibujs.reactive.v1");function Pi(){let e=globalThis,t=e[ur];if(t)return!1,t;let n={suspendTracking:Wt,resumeTracking:qt,isTrackingSuspended:Gn,untracked:Yn,retrack:Ut,track:Zn,reactiveBinding:Kt,recordDependency:Xn,cleanup:je,setMaxSubscriberRepeats:Qn,setMaxDrainIterations:er,drainNotificationQueue:nr,queueSignalNotification:rr,notifySubscribers:or,getSubscriberCount:ir,getSubscriberDeps:sr,forEachSubscriber:ar,version:lr};return e[ur]=n,n}var U=Pi(),Ne=U.suspendTracking,Re=U.resumeTracking,cr=U.isTrackingSuspended,le=U.untracked,Ee=U.retrack,re=U.track,J=U.reactiveBinding,Le=U.recordDependency,Me=U.cleanup,pc=U.setMaxSubscriberRepeats,dr=U.setMaxDrainIterations,fr=U.drainNotificationQueue,pr=U.queueSignalNotification,Fe=U.notifySubscribers,mc=U.getSubscriberCount,gc=U.getSubscriberDeps,bc=U.forEachSubscriber;function Qe(e,t,n){if(xe(t))return ie(e,t,"",{label:`bindAttribute("${t}")`}),()=>{};function r(){let o;try{o=n()}catch(i){R(i,{phase:"binding",name:`bindAttribute("${t}")`,node:e});return}ie(e,t,o,{label:`bindAttribute("${t}")`,reactive:!0})}return J(r,e)}function mr(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){R(l,{phase:"binding",name:"bindDynamic (name getter)",node:e});return}let a;try{a=typeof n=="function"?n():n}catch(l){R(l,{phase:"binding",name:"bindDynamic (value getter)",node:e});return}r!==null&&r!==s&&(e.removeAttribute(r),r=null),ie(e,s,a,{label:"bindDynamic",reactive:!0})&&(r=s)}let i=J(o,e);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Jt=["data-focus-key","id","name"],Di=new Set(["text","search","url","tel","password",""]);function Oi(e){let t=e.tagName;if(!(t==="TEXTAREA"||t==="INPUT"&&Di.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 et(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<Jt.length;i++){let s=t.getAttribute(Jt[i]);if(s){r=Jt[i],o=s;break}}return{el:t,attr:r,value:o,tag:t.tagName,...Oi(t)}}function $i(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function Ii(e,t){let n=null,r=0;for(let o=0;o<e.length;o++){let i=e[o];if(i.nodeType!==1)continue;let s=i;s.matches(t)&&(r++,n??(n=s));let a=s.querySelectorAll(t);for(let l=0;l<a.length;l++)r++,n??(n=a[l]);if(r>1)return{el:null,count:r}}return r===1?{el:n,count:r}:{el:null,count:r}}function gr(e,t){if(e.focus(),t.start!==null&&typeof e.setSelectionRange=="function"){let n=e,r=n.value.length,o=Math.min(t.start,r),i=Math.min(t.end??o,r);n.setSelectionRange(o,i,t.direction??"none")}}function ze(e,t,n){if(!e||typeof document>"u")return;let r=document.activeElement;if(r===e.el||r&&r!==document.body&&r!==document.documentElement)return;if(e.el.isConnected){gr(e.el,e);return}let o=!1;if(e.attr&&e.value){let{el:i,count:s}=Ii(t,`[${e.attr}=${$i(e.value)}]`);if(i&&i.tagName===e.tag){gr(i,e);return}o=s>1}}function he(e,t){let n=[];function r(){let o;try{o=t()}catch(d){R(d,{phase:"binding",name:"bindChildNode",node:e});return}let i=et(n);if(o==null||typeof o=="boolean"){for(let d=0;d<n.length;d++){let g=n[d];V(g),g.parentNode&&g.parentNode.removeChild(g)}n.length=0,ze(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)){!1;continue}d.add(m),a.push(m)}}else a=[o instanceof Node?o:document.createTextNode(String(o))];let l;if(n.length>0&&a.length>0){let d=new Set(n);l=new Set;for(let g=0;g<a.length;g++)d.has(a[g])&&l.add(a[g])}for(let d=0;d<n.length;d++){let g=n[d];l?.has(g)||(V(g),g.parentNode&&g.parentNode.removeChild(g))}let u=e;for(let d=0;d<a.length;d++){let g=a[d];u.nextSibling!==g&&s.insertBefore(g,u.nextSibling),u=g}n=a,ze(i,a,"bindChildNode")}return J(r,e)}var I="http://www.w3.org/2000/svg",Hi=new Set(["config","location","history","document","window","navigator","name","top","parent","self","frames"]);var Gt=new Set,br=100,hr=!1,yr=new Map;function vr(e){let t=yr.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),yr.set(e,t)),t}function Bi(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",ct(String(a),{element:e}));return}let l=e.style;i&&(e.removeAttribute("style"),i=!1);let u=[];for(let d in a){if(!Object.hasOwn(a,d))continue;let g=a[d];if(g==null)continue;let h=vr(d);u.push(h),l.setProperty(h,ut(h,String(g),{element:e}))}for(let d=0;d<o.length;d++)u.indexOf(o[d])===-1&&l.removeProperty(o[d]);o=u},e);_(e,s);return}if(typeof t=="string"){e.setAttribute("style",ct(t,{element:e}));return}let n=e;for(let r in t){if(!Object.hasOwn(t,r))continue;let o=t[r],i=vr(r);if(typeof o=="function"){let s=o,a=J(()=>{n.style.setProperty(i,ut(i,String(s()),{element:e}))},e);_(e,a)}else n.style.setProperty(i,ut(i,String(o),{element:e}))}}function Vi(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 l in n){if(!Object.hasOwn(n,l))continue;let u=n[l];(typeof u=="function"?u():u)&&(a=a?`${a} ${l}`:l)}e.setAttribute("class",a)},e);_(e,s)}else e.setAttribute("class",o)}function Yt(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(e,he(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,he(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,he(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=jn(e);return(r,o)=>{if(n)throw new Error(`tagFactory: refusing to create <${e}> \u2014 tag is blocked for security reasons.`);let i=t?document.createElementNS(t,e):document.createElement(e);if(r===void 0)return i;if(typeof r=="string")return o!==void 0?(i.setAttribute("class",r),Yt(i,o),i):(i.textContent=r,i);if(typeof r=="number")return i.textContent=String(r),i;if(Array.isArray(r)||r instanceof Node||typeof r=="function")return Yt(i,r),i;let s=r,a=s.class;a!=null&&Vi(i,a);let l=s.id;typeof l=="function"?_(i,Qe(i,"id",l)):l!=null&&(!1,i.id=l);let u=o!==void 0?o:s.nodes;u!=null&&Yt(i,u);let d=s.on;if(d)for(let m in d){if(!Object.hasOwn(d,m))continue;let c=d[m];typeof c=="function"?i.addEventListener(m,c):!1}let g=s.style;g!=null&&Bi(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 c=s[m];if(c==null||xe(m))continue;typeof c=="function"?_(i,Qe(i,m,c)):ie(i,m,c,{syncValueProperty:!1,label:"tagFactory"})}}return typeof s.onElement=="function"&&s.onElement(i),i}}var Hc=p("html"),ji=p("head"),Fi=p("body"),zi=p("title"),P=p("div"),j=p("span"),Wi=p("section"),qi=p("article"),Ui=p("header"),Ki=p("footer"),Ji=p("nav"),Gi=p("main"),Yi=p("aside"),Zi=p("address"),Zt=p("p"),Xi=p("h1"),Qi=p("h2"),Xt=p("h3"),es=p("h4"),ts=p("h5"),ns=p("h6"),rs=p("blockquote"),os=p("dd"),is=p("dl"),ss=p("dt"),as=p("figcaption"),ls=p("figure"),us=p("hr"),cs=p("li"),ds=p("ol"),fs=p("ul"),Qt=p("pre"),ps=p("a"),ms=p("abbr"),gs=p("b"),bs=p("bdi"),hs=p("bdo"),ys=p("br"),vs=p("cite"),en=p("code"),Ss=p("data"),xs=p("dfn"),Ts=p("em"),ws=p("i"),Es=p("kbd"),ks=p("mark"),Cs=p("q"),_s=p("rp"),As=p("rt"),Ns=p("ruby"),Rs=p("s"),Ls=p("samp"),Ms=p("small"),Ps=p("strong"),Ds=p("sub"),Os=p("sup"),$s=p("time"),Is=p("u"),Hs=p("var"),Bs=p("area"),Vs=p("audio"),js=p("img"),Fs=p("map"),zs=p("track"),Ws=p("video"),qs=p("embed"),Us=p("iframe"),Ks=p("object"),Js=p("param"),Gs=p("picture"),Ys=p("portal"),Zs=p("source"),Xs=p("svg",I),Qs=p("math"),ea=p("canvas"),ta=p("noscript"),na=p("script"),ra=p("del"),oa=p("ins"),ia=p("caption"),sa=p("col"),aa=p("colgroup"),la=p("table"),ua=p("tbody"),ca=p("td"),da=p("tfoot"),fa=p("th"),pa=p("thead"),ma=p("tr"),tt=p("button"),ga=p("datalist"),ba=p("fieldset"),ha=p("form"),ya=p("input"),va=p("label"),Sa=p("legend"),xa=p("meter"),Ta=p("optgroup"),wa=p("option"),Ea=p("output"),ka=p("progress"),Ca=p("select"),_a=p("textarea"),Aa=p("details"),Na=p("dialog"),Ra=p("menu"),La=p("summary"),Ma=p("slot"),Pa=p("template"),Da=p("base"),Oa=p("link"),$a=p("meta"),Pe=p("style"),Ia=p("circle",I),Ha=p("ellipse",I),Ba=p("g",I),Va=p("line",I),ja=p("path",I),Fa=p("polygon",I),za=p("polyline",I),Wa=p("rect",I),qa=p("text",I),Ua=p("tspan",I),Ka=p("defs",I),Ja=p("clipPath",I),Ga=p("mask",I),Ya=p("pattern",I),Za=p("linearGradient",I),Xa=p("radialGradient",I),Qa=p("stop",I),el=p("use",I),tl=p("symbol",I),nl=p("marker",I),rl=p("center"),ol=p("font"),il=p("marquee"),sl=e=>p(e);var tn="__sibuPendingError";function Sr(e,t){let n=()=>e.parentNode?(R(t,{phase:"render",name:"lazy",node:e}),!0):!1;n()||queueMicrotask(()=>{n()||(e[tn]=t)})}function bt(e){let t=e,n=t[tn];if(n instanceof Error)return delete t[tn],n}function xr(e){let t=null;return function(){if(t)return t();let r=P({class:"sibu-lazy"}),o=!1;return e().then(i=>{if(o)return;t=i.default;let s=t();X(r,s)}).catch(i=>{if(o)return;let s=i instanceof Error?i:new Error(String(i));X(r,P({class:"sibu-lazy-error"},`Failed to load component: ${s.message}`)),Sr(r,s)}),r.appendChild(j("sibu-lazy-loading","Loading...")),_(r,()=>{o=!0}),r}}function Tr({nodes:e,fallback:t}){let n=P({class:"sibu-suspense"}),r=t();n.appendChild(r);let o=!1,i=null,s=null;return _(n,()=>{o=!0,i&&(i.disconnect(),i=null),s&&!n.contains(s)&&V(s)}),queueMicrotask(()=>{if(!o)try{let a=e();if(s=a,a.classList.contains("sibu-lazy")){if(!a.querySelector(".sibu-lazy-loading")){X(n,a);return}i=new MutationObserver(()=>{if(o)return;a.querySelector(".sibu-lazy-loading")||(i?.disconnect(),i=null,X(n,a))}),i.observe(a,{childList:!0,subtree:!0})}else X(n,a)}catch(a){let l=a instanceof Error?a:new Error(String(a));Sr(n,l)}}),n}function yt(e,t){try{return e()}catch(n){let r=t.toLowerCase().includes("unmount")?"cleanup":"effect";R(n,{phase:r,name:t});return}}function nn(e,t,n,r){let o=yt(e,t);typeof o=="function"&&(r()||!n.isConnected?yt(o,"onUnmount"):Er(o,n))}var We=new WeakMap,De=new WeakMap,ye=new Set,ve=new Set,qe=null,ht=0,al=256;function rn(e){let t=We.get(e);if(t){We.delete(e),ye.delete(e);for(let n of t)try{n()}catch{}}}function on(e){De.get(e)&&queueMicrotask(()=>{if(e.isConnected)return;let n=De.get(e);if(n){De.delete(e),ve.delete(e);for(let r of n)try{r()}catch{}}})}function ll(e){if(ye.size===0||e.nodeType!==1)return;let t=e;if(ye.has(t)&&t.isConnected&&rn(t),t.firstElementChild)for(let n of Array.from(ye))n!==t&&n.isConnected&&t.contains(n)&&rn(n)}function ul(e){if(ve.size===0||e.nodeType!==1)return;let t=e;if(ve.has(t)&&!t.isConnected&&on(t),t.firstElementChild)for(let n of Array.from(ve))n!==t&&!n.isConnected&&t.contains(n)&&on(n)}function cl(){if(ye.size>0)for(let e of Array.from(ye))e.isConnected&&rn(e);if(ve.size>0)for(let e of Array.from(ve))e.isConnected||on(e)}function wr(){qe||typeof document>"u"||(qe=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++)ll(t.addedNodes[n]);if(t.removedNodes.length>0)for(let n=0;n<t.removedNodes.length;n++)ul(t.removedNodes[n])}ht+=e.length,ht>=al&&(ht=0,cl()),sn()}),qe.observe(document.body,{childList:!0,subtree:!0}))}function sn(){qe&&ye.size===0&&ve.size===0&&(qe.disconnect(),qe=null,ht=0)}function dl(e,t){let n=We.get(e);return n||(n=[],We.set(e,n)),n.push(t),ye.add(e),wr(),()=>{let r=We.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(We.delete(e),ye.delete(e))}sn()}}function fl(e,t){let n=De.get(e);return n||(n=[],De.set(e,n)),n.push(t),ve.add(e),wr(),()=>{let r=De.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1),r.length===0&&(De.delete(e),ve.delete(e))}sn()}}function vt(e,t){if(!(typeof document>"u"))if(t){let n=!1,r=()=>n;if(_(t,()=>{n=!0}),t.isConnected){queueMicrotask(()=>{n||nn(e,"onMount",t,r)});return}queueMicrotask(()=>{if(n)return;if(t.isConnected){nn(e,"onMount",t,r);return}let o=dl(t,()=>{n||nn(e,"onMount",t,r)});_(t,o)})}else queueMicrotask(()=>{yt(e,"onMount")})}function Er(e,t){if(typeof document>"u")return;let n=!1,r=()=>{n||(n=!0,yt(e,"onUnmount"))};_(t,r);let o=()=>{if(n)return;let i=fl(t,r);_(t,i)};t.isConnected?o():vt(()=>{o()},t)}function pl(e,t){_(t,e)}function oe(e,t,n){try{e.emit(t,n)}catch{}}var an=Symbol.for("sibujs.ssr.v1");function ml(){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 Nt=="function"&&(t=Nt("async_hooks")),t&&(e=new t.AsyncLocalStorage)}}catch{e=null}return{als:e,fallbackStore:{ssr:!1,suspenseIdCounter:0,locale:void 0},fallbackDepth:0}}var ke=globalThis[an]??(globalThis[an]=ml()),Oe=ke.als,Y=ke.fallbackStore;ke.fallbackDepth??(ke.fallbackDepth=0);var kr=!1;function gl(){if(kr||Oe||!(typeof process<"u"&&!!process.versions?.node))return;kr=!0;let t=process.versions.node;`${t}`}function $e(){if(Oe){let e=Oe.getStore();if(e)return e}return Y}function Cr(){return Oe?Oe.getStore()??null:ke.fallbackDepth>0?Y:null}function ue(){return $e().ssr}function _r(e){if(!ue())return null;let t=$e(),n=t.caches??(t.caches=new Map),r=n.get(e);return r||(r=new Map,n.set(e,r)),r}function Ar(){$e().ssr=!0}function Nr(){$e().ssr=!1}function Rr(e){let t={ssr:!0,suspenseIdCounter:0,idCounter:0,locale:void 0};if(Oe)return Oe.run(t,e);gl();let n=Y.ssr,r=Y.suspenseIdCounter,o=Y.idCounter,i=Y.locale;Y.ssr=!0,Y.suspenseIdCounter=0,Y.idCounter=0,Y.locale=void 0,ke.fallbackDepth++;try{return e()}finally{ke.fallbackDepth--,Y.ssr=n,Y.suspenseIdCounter=r,Y.idCounter=o,Y.locale=i}}function Lr(e){let t=$e(),n=t.ssr;t.ssr=!0;try{return e()}finally{n||(t.ssr=!1)}}var Dr=globalThis;function bl(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,le(()=>t(o,void 0));else{let i=n;n=o,le(()=>t(o,i))}}}var Mr=100;function St(e){let t=e.userCleanups;if(t.length!==0){e.userCleanups=[];for(let n=t.length-1;n>=0;n--)try{t[n]()}catch(r){R(r,{phase:"cleanup"})}}}function Pr(e){let t=1;do e.rerunPending=!1,e.userCleanups.length>0&&St(e),Ee(e.bodyFn,e.subscriber);while(e.rerunPending&&++t<=Mr);e.rerunPending&&(e.rerunPending=!1,R(new Error(`effect re-requested itself ${Mr}+ times \u2014 likely a write-reads-self cycle. Breaking to prevent infinite loop.`),{phase:"effect"}))}function hl(e){if(e.disposed)return;e.disposed=!0;let t=Dr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(t)try{t.emit("effect:destroy",{effectFn:e.fn})}catch{}try{e.userCleanups.length>0&&St(e)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] onCleanup threw during dispose:",n)}try{Me(e.subscriber)}catch(n){typeof console<"u"&&console.warn("[SibuJS effect] dispose threw:",n)}}function Z(e,t){if(ue())return()=>{};let n={fn:e,onError:t?.onError,userCleanups:[],running:!1,rerunPending:!1,disposed:!1,onCleanup:null,subscriber:null,bodyFn:null};n.onCleanup=s=>{n.userCleanups.push(s)};let r=n.onError;n.bodyFn=r?()=>{try{n.fn(n.onCleanup)}catch(s){r(s)}}:()=>{n.fn(n.onCleanup)};let o=(()=>{if(!n.disposed){if(n.running){n.rerunPending=!0;return}n.running=!0;try{n.rerunPending=!1,n.userCleanups.length>0&&St(n),Ee(n.bodyFn,o),n.rerunPending&&Pr(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{Ee(n.bodyFn,n.subscriber),n.rerunPending&&Pr(n)}catch(s){throw n.disposed=!0,n.userCleanups.length>0&&St(n),Me(n.subscriber),s}finally{n.running=!1,n.rerunPending=!1}let i=Dr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&oe(i,"effect:create",{effectFn:e}),()=>hl(n)}var nt=0,ln=new Set;function yl(e){nt++;try{return e()}finally{nt--,nt===0&&xl()}}function vl(e){return nt===0?!1:(ln.add(e),!0)}function Sl(){return nt>0}function xl(){try{for(let e of ln)pr(e)}finally{ln.clear()}fr()}var Or=Symbol.for("sibujs.reactive.batch.v1");function Tl(){let e=globalThis,t=e[Or];if(t)return t;let n={batch:yl,enqueueBatchedSignal:vl,isBatching:Sl};return e[Or]=n,n}var un=Tl(),F=un.batch,Ie=un.enqueueBatchedSignal,wl=un.isBatching;var cn=globalThis;function A(e,t){let n={value:e,__v:0,__sc:0,subsHead:null,subsTail:null,__activeNode:null,__name:void 0,_d:!1,_validate:void 0},r=void 0,o=t?.equals;r&&(n.__name=r);function i(){return Le(n),n.value}i.__signal=n,r&&(i.__name=r);let s;if(o?s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;if(!o(l,u)){if(n.value=u,n.__v++,!1){let d=cn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&oe(d,"signal:update",{signal:n,name:r,oldValue:l,newValue:u})}Ie(n)||Fe(n)}}:s=a=>{let l=n.value,u=typeof a=="function"?a(l):a;Object.is(u,l)||(n.value=u,n.__v++,Ie(n)||Fe(n))},!1){let a=cn.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&oe(a,"signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}function El(e){let[t,n]=A(0,e?.name?{name:e.name}:void 0);return{track(){t()},invalidate(){n(r=>r+1)}}}var kl=`
|
|
6
8
|
.sibu-error-display {
|
|
7
9
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
8
10
|
border-radius: 10px;
|
|
@@ -183,11 +185,11 @@
|
|
|
183
185
|
border: 1px solid #3a3a4e;
|
|
184
186
|
}
|
|
185
187
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
186
|
-
|
|
187
|
-
`);for(let r of
|
|
188
|
+
`,$r=!1;function Cl(){if($r||typeof document>"u")return;let e=Pe({nodes:kl});document.head.appendChild(e),$r=!0}function _l(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 Ir(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=_l(r),i=e.cause,s=i!=null?Ir(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 Al(e,t,n){let r=[];r.push(n),r.push(`[${e.code}] ${e.message}`),e.stack&&(r.push(""),r.push("Stack Trace:"),r.push(e.stack));let o=e.cause;for(;o;){if(r.push(""),r.push("Caused by:"),r.push(` [${o.code}] ${o.message}`),o.stack){let i=o.stack.split(`
|
|
188
190
|
`).map(s=>` ${s}`).join(`
|
|
189
|
-
`);r.push(i)}o=o.cause}if(
|
|
190
|
-
`)}function
|
|
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 Hr(e){let t=e.map((n,r)=>P({class:"sibu-err-frame",nodes:[j({class:"sibu-err-line",nodes:String(r+1)}),j({class:"sibu-err-fn",nodes:n.fn}),j({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return Qt({class:"sibu-err-stack",nodes:t})}function Br(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:[j({nodes:`[${e.code}] ${e.message}`}),j({nodes:""})]}),e.frames.length>0?Hr(e.frames):P({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Br(e.cause)]:[]}function Nl(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 dn(e){Cl();let t=e.severity??"error",n=Ir(e.error),r=e.alwaysShowDetails??de(),o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=A("Copy"),l=tt({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let m=Al(n,e.metadata,o);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(m).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),u=P({class:"sibu-err-header",nodes:[en({class:"sibu-err-icon",nodes:n.code}),Xt({class:"sibu-err-title",nodes:o}),l,j({class:"sibu-err-timestamp",nodes:i})]}),d=[Zt({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0&&d.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[j({nodes:"Stack Trace"})]}),Hr(n.frames)]})),r&&d.push(...Br(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(P({class:"sibu-err-section",nodes:[P({class:"sibu-err-section-head",nodes:[j({nodes:"Metadata"})]}),Nl(e.metadata)]}));let g=[];e.onRetry&&g.push(tt({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&g.push(tt({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),g.length>0&&d.push(P({class:"sibu-err-actions",nodes:g}));let h=P({class:"sibu-err-body",nodes:d});return P({class:"sibu-error-display","data-severity":t,nodes:[u,h]})}var Rl=`
|
|
191
193
|
.sibu-error-boundary {
|
|
192
194
|
position: relative;
|
|
193
195
|
}
|
|
@@ -341,7 +343,7 @@
|
|
|
341
343
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
342
344
|
background: #3a3a4e;
|
|
343
345
|
}
|
|
344
|
-
`,
|
|
346
|
+
`,Ll=Symbol("sibujs.ErrorBoundary.resetKeyThrew"),Vr=!1;function Ml(){if(!Vr&&typeof document<"u"){let e=Pe({nodes:Rl});document.head.appendChild(e),Vr=!0}}function Pl(e,t){let n=typeof e=="function"?e:t,r=typeof e=="function"?{}:e,{fallback:o,onError:i,resetKeys:s}=r;Ml();let[a,l]=A(null),u=()=>{g(),l(null)},d=null,g=()=>{if(!d)return;let v=d;d=null,v()},h=v=>{let x=new Array(v.length);for(let E=0;E<v.length;E++)try{x[E]=v[E]()}catch(D){R(D,{phase:"effect",name:"ErrorBoundary.resetKeys"}),x[E]=Ll}return x},m=()=>{let v=s;if(!v||v.length===0)return;g();let x=null;d=Z(()=>{let E=h(v);if(x===null){x=E;return}let D=E.length!==x.length;if(!D){for(let B=0;B<E.length;B++)if(!Object.is(E[B],x[B])){D=!0;break}}x=E,D&&u()})},c=v=>{let x=Lt(v);if(l(x),m(),i)try{i(x)}catch(E){R(E,{phase:"render",name:"ErrorBoundary onError callback"})}return x},f=(v,x)=>dn({error:v,severity:"error",onRetry:x}),b=v=>{let x=o||f;try{return x(v,u)}catch(E){return queueMicrotask(()=>{R(E,{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 E=P({class:"sibu-error-async"});E.appendChild(j({class:"sibu-lazy-loading",nodes:"Loading..."}));let D=!1;return _(E,()=>{D=!0}),x.then(B=>{if(D){V(B);return}X(E,B)}).catch(B=>{if(D)return;let W=c(B);X(E,b(W))}),E}return x}catch(x){let E=c(x);return b(E)}}}),S=v=>{if(a())return;let E=v.detail?.error;E&&(v.preventDefault(),v.stopPropagation(),c(E))};return y.addEventListener("sibu:error-propagate",S),vt(()=>{let v=document.createTreeWalker(y,NodeFilter.SHOW_ELEMENT),x=[],E=v.currentNode;for(;E;){let D=bt(E);D&&x.push(D),E=v.nextNode()}if(x.length===1)c(x[0]);else if(x.length>1){let D=globalThis.AggregateError;c(D?new D(x,`${x.length} pre-mount errors caught by ErrorBoundary`):new Error(x.map(B=>B.message).join("; ")))}},y),_(y,()=>{g(),y.removeEventListener("sibu:error-propagate",S)}),y}var Dl=`
|
|
345
347
|
@keyframes sibu-spin {
|
|
346
348
|
to { transform: rotate(360deg); }
|
|
347
349
|
}
|
|
@@ -394,5 +396,5 @@
|
|
|
394
396
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
395
397
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
396
398
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
397
|
-
`,
|
|
398
|
-
`||t[r]==="\r");)r++}function s(){if(t.charCodeAt(r)!==0)return-1;let m=r;r++;let l=0;for(;r<o&&t.charCodeAt(r)!==0;)l=l*10+(t.charCodeAt(r)-48),r++;return r<o&&r++,l<0||l>=n?(r=m,-1):l}function a(){let m=r;for(;r<o;){let l=t.charCodeAt(r);if(l>=97&&l<=122||l>=65&&l<=90||l>=48&&l<=57||l===45)r++;else break}return t.slice(m,r)}function c(){if(i(),t[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let l=t[r];if(l==='"'||l==="'"){r++;let d=[],g=[],y="";for(;r<o&&t[r]!==l;){let S=s();S>=0?(d.push(y),y="",g.push(S)):y+=t[r++]}return r<o&&r++,d.push(y),g.length===0?{kind:"static",value:d[0]}:{kind:"mixed",statics:d,exprs:g}}{let d=[],g=[],y="";for(;r<o;){let S=t.charCodeAt(r);if(S===32||S===9||S===10||S===13||S===62)break;let v=s();v>=0?(d.push(y),y="",g.push(v)):y+=t[r++]}return d.push(y),g.length===0?{kind:"static",value:d[0]}:{kind:"mixed",statics:d,exprs:g}}}function u(){let m=[];for(;r<o&&(i(),!(t[r]===">"||t[r]==="/"));){let l=r;for(;r<o;){let y=t.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let d=t.slice(l,r);if(!d)break;let g=c();d.startsWith("on:")?g.kind==="expr"&&m.push({t:3,name:d.slice(3),idx:g.idx}):g.kind==="bool"?m.push({t:4,name:d}):g.kind==="static"?m.push({t:0,name:d,value:g.value}):g.kind==="expr"?m.push({t:1,name:d,idx:g.idx}):g.kind==="mixed"&&m.push({t:2,name:d,statics:g.statics,exprs:g.exprs})}return m}function f(m){return m.replace(/\s+/g," ")}function h(m){let l="";for(;r<o&&t[r]!=="<";){let g=s();if(g>=0){let y=f(l);y&&m.push({t:1,value:y}),l="",m.push({t:2,idx:g})}else l+=t[r++]}let d=f(l);d&&m.push({t:1,value:d})}function b(){let m=[];for(;r<o&&!(t[r]==="<"&&r+1<o&&t[r+1]==="/");)if(t[r]==="<"){let l=t[r+1];if(l==="!"){if(t.startsWith("<!--",r)){let v=t.indexOf("-->",r+4);r=v===-1?o:v+3}else if(t.startsWith("<![CDATA[",r)){let v=t.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=t.indexOf(">",r);r=v===-1?o:v+1}continue}if(l==="?"){let v=t.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(l>="a"&&l<="z")&&!(l>="A"&&l<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let d=a(),g=u();i();let y=cc.has(d),S=t[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:d,svg:Rr.has(d),attrs:g,children:[]}});else{let v=b();if(ac.has(d.toLowerCase())){for(let x=0;x<v.length;x++)if(v[x].t===2)throw new Error(`html: dynamic \${...} expressions are not allowed inside <${d}> (raw-text context). Build the content separately and append it as a Node.`)}t[r]==="<"&&r+1<o&&t[r+1]==="/"&&(r+=2,a(),i(),r<o&&t[r]===">"&&r++),m.push({t:0,el:{tag:d,svg:Rr.has(d),attrs:g,children:v}})}}else h(m);return m}return b()}function Jt(e,n){let t=e.svg?document.createElementNS(O,e.tag):document.createElement(e.tag);for(let r=0;r<e.attrs.length;r++){let o=e.attrs[r];switch(o.t){case 0:t.setAttribute(o.name,o.value);break;case 1:{let i=o.name,s=n[o.idx];typeof s=="function"?C(t,Ue(t,i,s)):ne(t,i,s,{syncValueProperty:!1,label:"html"});break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++){let a=n[o.exprs[s]];i+=(a==null?"":String(a))+o.statics[s+1]}ne(t,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=n[o.idx];typeof i=="function"?t.addEventListener(o.name,i):!1;break}case 4:t.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:t.appendChild(Jt(o.el,n));break;case 1:t.appendChild(document.createTextNode(o.value));break;case 2:{let i=n[o.idx];if(typeof i=="function"){let s=document.createComment("");t.appendChild(s),C(t,me(s,i))}else if(i instanceof Node)t.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?t.appendChild(a):a!=null&&typeof a!="boolean"&&t.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&t.appendChild(document.createTextNode(String(i)));break}}}return t}function Mr(e,...n){let t=Lr.get(e);if(t||(t=lc(e),Lr.set(e,t)),t.length===1&&t[0].t===0)return Jt(t[0].el,n);let r=document.createElement("div");for(let o=0;o<t.length;o++){let i=t[o];switch(i.t){case 0:r.appendChild(Jt(i.el,n));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=n[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),C(r,me(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let c=s[a];c instanceof Node?r.appendChild(c):c!=null&&typeof c!="boolean"&&r.appendChild(document.createTextNode(String(c)))}else s!=null&&typeof s!="boolean"&&r.appendChild(document.createTextNode(String(s)));break}}}return r.childNodes.length===1&&r.firstChild instanceof Element?r.firstChild:r}function uc(e,n,t){let r=document.createComment("keep-alive"),o=new Map,i=[],s=t?.max??10;s===0&&ce()&&void 0;let a,c=null,u=!1,f=!1,h=()=>{if(f)return;let m=e(),l=r.parentNode;if(!l||u&&m===a)return;c?.parentNode&&l.removeChild(c),a=m;let d=o.get(m);if(d){let g=i.indexOf(m);g!==-1&&(i.splice(g,1),i.push(m))}else{let g=n[m];if(!g){c=null,u=!0;return}if(d=g(),d instanceof DocumentFragment){let y=document.createElement("div");y.style.display="contents",y.appendChild(d),d=y}if(o.set(m,d),i.push(m),s>0&&i.length>s){let y=i.shift(),S=o.get(y);S&&(I(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(y))}}l.insertBefore(d,r.nextSibling),c=d,u=!0},b=ee(h);return u||queueMicrotask(()=>{!u&&r.parentNode&&h()}),C(r,()=>{f=!0,b();for(let m of o.values())I(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,c=null}),r}function dc(e,n){if(!n)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let t=()=>typeof performance<"u"?performance.now():0,r=t(),o=null,i=f=>{if(f instanceof DocumentFragment){let h=document.createComment(""),b=document.createComment("");f.insertBefore(h,f.firstChild),f.appendChild(b),o={start:h,end:b}}n.appendChild(f)},s;typeof e=="function"?s=un(()=>{let f=e();return i(f),f}):(s=e,i(s));let a=t()-r,c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;c&&te(c,"app:init",{rootElement:s,container:n,duration:a});let u=o;return{node:s,unmount(){if(c&&te(c,"app:unmount",{rootElement:s}),u){fc(u.start,u.end);return}I(s),s.parentNode?.removeChild(s)}}}function fc(e,n){let t=e.parentNode;if(!t&&!n.parentNode)return;let r=de;for(let a=e.nextSibling;a&&a!==n;a=a.nextSibling)r++;let o=e,i=null,s=!0;for(;;){e.parentNode!==t||n.parentNode!==t?s=!1:(e.previousSibling!==o||n.nextSibling!==i)&&(o=e.previousSibling,i=n.nextSibling,s=!!(e.compareDocumentPosition(n)&4));let a=e.nextSibling;if(!s||a===n)break;if(r--<=0){he("mount",de,1);return}I(a),a.parentNode===t&&t.removeChild(a)}s||R(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),n.parentNode?.removeChild(n)}function pc(e,n){let t=document.createComment("portal"),r=n||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{R(s,{phase:"render",name:"Portal",node:t.parentNode?t:void 0})})}}),C(t,()=>{i=!0,o&&(I(o),o.remove(),o=null)}),t}function mc(e,n="default"){if(e==null||!Object.hasOwn(e,n))return;let t=e[n];return typeof t=="function"?t:void 0}function Pr(e,n,t){return t.length===0?e.splice(n):e.splice(n,...t)}function gc(e=[]){let[n,t]=A([...e]);return[n,{push(...o){t(i=>[...i,...o])},pop(){let o;return t(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return t(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){t(i=>[...o,...i])},splice(o,...i){let s=[];return t(a=>{let c=[...a];return s=Pr(c,o,i),s.length===0&&i.length<=1?a:c}),s},remove(o){t(i=>i.filter((s,a)=>a!==o))},removeWhere(o){t(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,c)=>c!==s)})},set(o){t([...o])},update(o,i){t(s=>s.map((a,c)=>c===o?i:a))},updateWhere(o,i){t(s=>s.map(a=>o(a)?i(a):a))},sort(o){t(i=>[...i].sort(o))},reverse(){t(o=>[...o].reverse())},filter(o){t(i=>i.filter(o))},map(o){t(i=>i.map(o))},clear(){t([])}}]}function bc(e=[]){let n=[...e],t=null,r={__v:0};function o(){t=null,r.__v++,Me(r)||He(r)}function i(){if(_e(r),t===null){let a=n.slice();t=Object.freeze(a)}return t}return[i,{push(...a){a.length!==0&&(n.push(...a),o())},pop(){if(n.length===0)return;let a=n.pop();return o(),a},shift(){if(n.length===0)return;let a=n.shift();return o(),a},unshift(...a){a.length!==0&&(n.unshift(...a),o())},splice(a,...c){let u=Pr(n,a,c);return(u.length>0||c.length>1)&&o(),u},remove(a){a<0||a>=n.length||(n.splice(a,1),o())},removeWhere(a){let c=n.findIndex(a);c!==-1&&(n.splice(c,1),o())},set(a){n=[...a],o()},update(a,c){a<0||a>=n.length||Object.is(n[a],c)||(n[a]=c,o())},updateWhere(a,c){let u=!1;for(let f=0;f<n.length;f++)if(a(n[f])){let h=c(n[f]);Object.is(n[f],h)||(n[f]=h,u=!0)}u&&o()},sort(a){n.length<=1||(n.sort(a),o())},reverse(){n.length<=1||(n.reverse(),o())},filter(a){let c=n.filter(a);c.length!==n.length&&(n=c,o())},map(a){let c=!1;for(let u=0;u<n.length;u++){let f=a(n[u],u);Object.is(n[u],f)||(n[u]=f,c=!0)}c&&o()},clear(){n.length!==0&&(n=[],o())}}]}function hc(e,n){let[t,r]=A(n),[o,i]=A(!1),[s,a]=A(null),[c,u]=A(0),f=0,h=!1,b=null,m=()=>{if(b===null)return;let d=b;b=null;try{d.abort()}catch{}},l=Y(()=>{if(c(),h)return;m();let d=++f,g=typeof AbortController<"u"?new AbortController:null;b=g,j(()=>{i(!0),a(null)});let y=()=>h||d!==f,S;try{S=e({signal:g?g.signal:void 0})}catch(v){if(y())return;j(()=>{a(v),i(!1)});return}S.then(v=>{y()||(b=null,j(()=>{r(v),i(!1)}))},v=>{y()||(b=null,j(()=>{a(v),i(!1)}))})});return{value:t,loading:o,error:s,refresh:()=>{h||u(d=>d+1)},dispose:()=>{h||(h=!0,l(),m())}}}function Fe(e,n,t){if(Object.is(e,n))return!0;if(e==null||n==null||typeof e!=typeof n||typeof e!="object")return!1;let r=e,o=n;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===n.getTime();if(e instanceof RegExp){let a=n;return e.source===a.source&&e.flags===a.flags}t||(t=new Map);let i=t.get(r);if(i?.has(o))return!0;if(i||(i=new Set,t.set(r,i)),i.add(o),e instanceof Map){let a=n;if(e.size!==a.size)return!1;for(let[c,u]of e)if(!a.has(c)||!Fe(u,a.get(c),t))return!1;return!0}if(e instanceof Set){let a=n;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(n);if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(e instanceof DataView){if(!(n instanceof DataView)||e.byteLength!==n.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==n.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){let a=e,c=n;if(a.length!==c.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==c[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(n)||e.length!==n.length?!1:e.every((a,c)=>Fe(a,n[c],t));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),n.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===n.href;if(e instanceof Error){let a=n;return e.name===a.name&&e.message===a.message&&Fe(e.cause,a.cause,t)&&Dr(r,o,t)}let s=Object.getPrototypeOf(r);return s!==Object.prototype&&s!==null?!1:Dr(r,o,t)}function Dr(e,n,t){let r=Object.keys(e),o=Object.keys(n);return r.length!==o.length?!1:r.every(i=>Object.hasOwn(n,i)&&Fe(e[i],n[i],t))}function yc(e){return A(e,{equals:(n,t)=>Fe(n,t)})}function De(e,n){let t=n?.name,r=n?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,c=()=>{o._d||s||(o._d=!0)};c._c=1,c._sig=o;let u=()=>{let l=e();o._v=r&&o._init&&r(o._v,l)?o._v:l,o._d=!1,o._init=!0};try{ee(()=>{o._v=e(),o._d=!1,o._init=!0},c)}catch(l){throw s=!0,Ce(c),l}let f=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,h=()=>{if(!o._d||s||a!==void 0)return;let l=o._v;i=!0;try{Se(u,c),Object.is(l,o._v)||o.__v++}catch(d){a={error:d},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Ce(c)}f&&!s&&!Object.is(l,o._v)&&te(f,"computed:update",{signal:o,oldValue:l,newValue:o._v})};o._validate=h;let b=()=>{let{error:l}=a;throw a=void 0,s&&(o._d=!1),l};function m(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${t?` "${t}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return In()||s?(o._d&&(h(),a!==void 0&&b()),o._v):(o._d&&(h(),a!==void 0&&(_e(o),b())),_e(o),o._v)}return t&&(m.__name=t,o.__name=t),m.__signal=o,m.dispose=()=>{if(s)return;s=!0,o._d=a!==void 0,Ce(c);let l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(l)try{l.emit("computed:destroy",{signal:o,getter:m})}catch{}},f&&te(f,"computed:create",{signal:o,name:t,getter:m}),m}function vc(e){let[n,t]=A(e);return{get current(){return n()},set current(r){t(r)}}}function $r(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function Sc(e){e!==null&&typeof e=="object"&&Array.isArray(e);let n=Object.create(null);Object.keys(e).forEach(c=>{let[u,f]=A(e[c]);$r(n,c,[u,f])});let t=new Proxy({},{get(c,u){if(typeof u=="string"&&Object.hasOwn(n,u)){let f=n[u][0];return f()}return Reflect.get(c,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let c={};return Object.keys(n).forEach(u=>{$r(c,u,n[u][0]())}),c};return[t,{setState:c=>{let u=r(),f=typeof c=="function"?c(u):c;j(()=>{Object.entries(f).forEach(([h,b])=>{Object.hasOwn(n,h)&&n[h][1](b)})})},reset:()=>{j(()=>{Object.keys(e).forEach(c=>{let u=n[c][1];u(e[c])})})},subscribe:c=>{let u=!0;return Y(()=>{let f=r();if(u){u=!1;return}Ee();try{c(f)}finally{ke()}})},subscribeKey:(c,u)=>{let f,h=!0;return Y(()=>{let b=n[c][0]();if(h){f=b,h=!1;return}if(!Object.is(b,f)){let m=f;f=b,Ee();try{u(b,m)}finally{ke()}}})},getSnapshot:r}]}function xc(e,n){if(se())return()=>{};let t,r=!0;return ee(()=>{let s=e();if(r){t=s,r=!1;return}if(!Object.is(s,t)){let a=t;t=s,Ee();try{n(s,a)}finally{ke()}}})}function Tc(e,n,t){return[De(e,t),i=>{j(()=>n(i))}]}function wc(e){let n=e();return ce()&&queueMicrotask(()=>{try{e()}catch(t){console.warn("[SibuJS strict] second run threw:",t)}}),n}function Ec(e){if(!ce())return Y(e);let n=Y(e),t=null;return queueMicrotask(()=>{try{t=Y(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{n(),t&&t()}}function Or(e,n){return se()?()=>{}:U(e,n)}var Gt="data-sibu-enhanced",Yt=new WeakMap;function Hr(e,n){let t=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(t>=de){let i=r.length-o+e.length;e.length=0,he(n,t,i);return}t++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${n}] teardown error:`,i)}}}}var Ir=["text","attr","class","show","on","cleanup"];function Br(e,n){if(n==null)return e;if(typeof n!="string")return n;let t=n.startsWith("@")?`[data-ref="${n.slice(1)}"]`:n;try{return e.querySelector(t)}catch{return null}}function Ze(e,n){return Or(n,e)}function kc(e){if(e instanceof HTMLInputElement){if(e.type==="checkbox")return e.checked;if(e.type==="number"||e.type==="range")return e.value===""?null:Number(e.value)}return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,n=>n.value):e.value}function _c(e,n){if(e instanceof HTMLInputElement&&e.type==="checkbox"){e.checked=!!n;return}if(e instanceof HTMLSelectElement&&e.multiple){let r=Array.isArray(n)?n.map(String):[];for(let o of Array.from(e.options))o.selected=r.includes(o.value);return}let t=n==null?"":String(n);e.value!==t&&(e.value=t)}function Cc(e,n,t,r){let o=`ctx.each[${r}]`;if(ce())for(let i of Object.keys(t))Ir.includes(i),`${o}${i}${Ir.join(", ")}`;if(t.text!==void 0&&(t.text,`${o}`,e.text(n,t.text)),t.attr!==void 0)for(let i of Object.keys(t.attr)){let s=t.attr[i];`${o}${i}`,e.attr(n,i,s)}if(t.class!==void 0)for(let i of Object.keys(t.class)){let s=t.class[i];`${o}${i}`,e.classed(n,i,s)}if(t.show!==void 0&&(t.show,`${o}`,e.show(n,t.show)),t.on!==void 0)for(let i of Object.keys(t.on)){let s=t.on[i];`${o}${String(i)}`,e.on(n,i,s)}t.cleanup!==void 0&&(t.cleanup,`${o}`,e.cleanup(t.cleanup))}function ft(e,n){let t=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!t)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(t.getAttribute(Gt)==="true")return ce()&&typeof console<"u"&&console.warn("[SibuJS enhance] element is already enhanced; ignoring re-enhance.",t),()=>{};let r=[],o=Symbol("sibujs.enhance"),i=!1,s=!1,a=b=>s?!0:!1,c=(b,m,l)=>{if(a(b))return;let d=Br(t,m);if(!d){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,t);return}l(d)},u={root:t,ref:b=>Br(t,b),refs:b=>{let m=b.startsWith("@")?`[data-ref="${b.slice(1)}"]`:b;try{return Array.from(t.querySelectorAll(m))}catch{return[]}},on:(b,m,l,d)=>{c("on",b,g=>{let y=S=>l(S,g);g.addEventListener(m,y,d),r.push(()=>g.removeEventListener(m,y,d))})},text:(b,m)=>{c("text",b,l=>{r.push(Ze(l,()=>{let d=m(),g=d==null?"":String(d);l.textContent!==g&&(l.textContent=g)}))})},attr:(b,m,l)=>{c("attr",b,d=>{r.push(Ze(d,()=>{let g=l(),y=g==null?null:String(g);ne(d,m,y,{syncValueProperty:!1,label:"enhance attr()"})}))})},classed:(b,m,l)=>{c("classed",b,d=>{r.push(Ze(d,()=>{d.classList.toggle(m,!!l())}))})},show:(b,m)=>{c("show",b,l=>{let d=l.hidden;r.push(Ze(l,()=>{l.hidden=!m()})),r.push(()=>{l.hidden=d})})},model:(b,m,l)=>{c("model",b,d=>{let g=d,[y,S]=m,v=l?.event??(g instanceof HTMLSelectElement||g instanceof HTMLInputElement&&(g.type==="checkbox"||g.type==="radio")?"change":"input");r.push(Ze(d,()=>{_c(g,y())}));let x=()=>S(kc(g));g.addEventListener(v,x),r.push(()=>g.removeEventListener(v,x))})},each:(b,m)=>{if(a("each"))return;let l=typeof b=="string"?u.refs(b):Array.from(b);for(let d=0;d<l.length;d++){let g=l[d],y=m(g,d);y!=null&&Cc(u,g,y,d)}},cleanup:b=>{a("cleanup")||r.push(b)}},f;try{f=n(u);let b=f;if(b&&typeof b.then=="function")throw b.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(b){throw Hr(r,"enhance"),s=!0,b}typeof f=="function"&&r.push(f);let h=()=>{i||(i=!0,Yt.get(t)===o&&(Yt.delete(t),t.removeAttribute(Gt)),We(t,h),Hr(r,"enhance"),s=!0)};return C(t,h),Yt.set(t,o),t.setAttribute(Gt,"true"),h}function Ac(e,n){if(typeof document>"u")return()=>{};let t=[];try{for(let r of Array.from(document.querySelectorAll(e)))t.push(ft(r,n))}catch(r){for(let o=t.length-1;o>=0;o--)try{t[o]()}catch(i){typeof console<"u"&&console.error("[SibuJS enhanceAll] rollback error:",i)}throw t.length=0,r}return()=>{for(let r of t.splice(0))r()}}var Nc=/^[A-Za-z0-9_-]+$/,Vr=Symbol.for("sibujs.islands.lazy"),pt=Xe(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Rc(e){return e[Vr]=!0,e}function Lc(e,n){if(!Nc.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);pt.set(e,n)}function Mc(e){pt.delete(e)}async function Pc(e){if(typeof e=="function"&&e[Vr]){let n=await e(),t=n.default??n;return typeof t=="function"?t:null}return e}function Dc(e=typeof document<"u"?document:null,n={}){if(!e||typeof e.querySelectorAll!="function")return()=>{};let t=[],r=[],o=!1;for(let i of Array.from(e.querySelectorAll("[data-sibu-island]"))){if(i.getAttribute("data-sibu-enhanced")==="true")continue;let s=i.getAttribute("data-sibu-island")??"";if(!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 f=pt.get(s);f&&Pc(f).then(h=>{if(!o){if(!h){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let b=ft(i,h);if(o){b();return}r.push(b),i.setAttribute("data-sibu-hydrated","true")}catch(b){typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to mount:`,b)}}}).catch(h=>{typeof console<"u"&&console.error(`[SibuJS islands] "${s}" failed to load:`,h)})},u=i.getAttribute("data-sibu-load")||"load";t.push($c(u,i,c,n))}return()=>{o=!0;for(let i of t.splice(0))i();for(let i of r.splice(0))i()}}function $c(e,n,t,r){switch(e){case"idle":{if(typeof requestIdleCallback<"u"){let i=requestIdleCallback(t);return()=>cancelIdleCallback(i)}let o=setTimeout(t,1);return()=>clearTimeout(o)}case"visible":{if(typeof IntersectionObserver>"u")return queueMicrotask(t),()=>{};let o=new IntersectionObserver(i=>{for(let s of i)s.isIntersecting&&(o.disconnect(),t())},{rootMargin:r.rootMargin,threshold:r.threshold});return o.observe(n),()=>o.disconnect()}case"interaction":{let o=["pointerdown","focusin","keydown","touchstart"],i=()=>{s(),t()},s=()=>{for(let a of o)n.removeEventListener(a,i)};for(let a of o)n.addEventListener(a,i,{passive:!0});return s}case"media":{let o=n.getAttribute("data-sibu-media")||"(min-width: 0px)";if(typeof matchMedia>"u")return queueMicrotask(t),()=>{};let i=matchMedia(o);if(i.matches)return queueMicrotask(t),()=>{};let s=()=>{i.matches&&(i.removeEventListener("change",s),t())};return i.addEventListener("change",s),()=>i.removeEventListener("change",s)}default:return queueMicrotask(t),()=>{}}}function jr(e){return e}var df=1024*1024;function Oc(e){let[n,t]=A(e()),r=!1,o=!1,i=n(),s=()=>{r=!1,!o&&t(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},c=ee(()=>{i=e(),a()}),u=(()=>n());return u.dispose=()=>{o||(o=!0,c())},u}var Fr=16;function Hc(e){let n=globalThis;if(typeof n.requestIdleCallback=="function"){n.requestIdleCallback(e,{timeout:Fr*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,Fr)}function Ic(){let[e,n]=A(!1),t=0;function r(o){t++,n(!0);let i=!1,s=()=>{i||(i=!0,t--,t===0&&n(!1))},a=c=>{s(),R(c,{phase:"async",name:"transition"})};Hc(()=>{try{let c=ut(o());c?c.then(s,a):s()}catch(c){a(c)}})}return{pending:e,start:r}}function Bc(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var gt={};nn(gt,{RenderProp:()=>Xc,assertType:()=>il,compose:()=>Yc,createGuard:()=>sl,createSlots:()=>Qc,defineComponent:()=>el,defineSlottedComponent:()=>tl,defineStrictComponent:()=>ol,globalStore:()=>Uc,machine:()=>jc,optimistic:()=>zc,optimisticList:()=>qc,persisted:()=>Fc,timeline:()=>Wc,validateProps:()=>Kr,validators:()=>rl,withBoundary:()=>Zc,withDefaults:()=>Gc,withProps:()=>nl,withWrapper:()=>Jc});var Vc=new Set(["__proto__","constructor","prototype"]);function Zt(e){return Vc.has(e)}function mt(e){let n={};for(let t of Object.keys(e))Zt(t)||(n[t]=e[t]);return n}function jc(e){let[n,t]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],c=!1;function u(){c=!0;try{for(;a.length>0;)f(a.shift())}catch(d){throw a.length=0,d}finally{c=!1}}function f(d){let g=e.states[i];if(!g?.on)return;let y=g.on[d];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;g.exit&&g.exit(E);let P=E;if(x){let z=x(E);P={...E,...mt(z)}}i=S,s=P,j(()=>{x&&o(P),t(S)});let H=e.states[S];H?.entry&&H.entry(s)}function h(d){a.push(d),!c&&u()}let b=e.states[e.initial];if(b?.entry){c=!0;try{b.entry(s)}catch(d){throw a.length=0,d}finally{c=!1}a.length>0&&u()}function m(d){return n()===d}function l(d){let g=n(),y=e.states[g];if(!y?.on)return!1;let S=y.on[d];return S?typeof S=="string"?!0:S.guard?S.guard(r()):!0:!1}return{state:n,context:r,send:h,matches:m,can:l}}function Fc(e,n,t={}){let r=(()=>{try{return t.session?typeof sessionStorage<"u"?sessionStorage:null:typeof localStorage<"u"?localStorage:null}catch{return null}})(),o=t.serialize||JSON.stringify,i=(y,S)=>Zt(y)?void 0:S,s=t.deserialize||(y=>JSON.parse(y,i)),a=t.encrypt,c=t.decrypt,u=t.session?!1:t.syncTabs??!0,f=n;try{let y=r?r.getItem(e):null;if(y!==null){c&&(y=c(y));let S=s(y);f=t.validate&&!t.validate(S)?n:S}}catch{}let[h,b]=A(f),m=!1,l=Y(()=>{let y=h();if(!m)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),d=null;return u&&r&&typeof window<"u"&&(d=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){m=!0;try{b(n)}finally{m=!1}return}try{let S=y.newValue;c&&(S=c(S));let v=s(S);if(t.validate&&!t.validate(v))return;m=!0;try{b(v)}finally{m=!1}}catch{}}},window.addEventListener("storage",d)),Object.defineProperty(b,"dispose",{value:()=>{l(),d&&typeof window<"u"&&(window.removeEventListener("storage",d),d=null)},enumerable:!1,writable:!1,configurable:!1}),[h,b]}function zc(e){let[n,t]=A(e),[r,o]=A(!1),i=0,s=0;async function a(c,u){let f=++s,h=n();t(c),i++,o(!0);try{let b=await u();s===f&&t(b)}catch{s===f&&t(h)}finally{i--,i<=0&&(i=0,o(!1))}}return{value:n,pending:r,update:a}}function qc(e){let n=0,t=0,r=0,o=new Map,i=[];for(let N of e){let T={id:n++,key:t++,base:N,claims:[],visible:!0,refs:0};o.set(T.id,T),i.push(T.id)}function s(N){let T=N.claims;return T.length>0?T[T.length-1].value:N.base}function a(N,T){let L=N.claims;for(let k=L.length-1;k>=0;k--)if(L[k].opId<T)return L[k].value;return N.base}function c(N,T,L){let k={opId:T,value:L,settled:!1},_=N.claims,D=_.length;for(;D>0&&_[D-1].opId>T;)D--;return _.splice(D,0,k),k}function u(N,T){let L=N.claims.indexOf(T);L!==-1&&N.claims.splice(L,1)}function f(N){let T=N.claims,L=0;for(;L<T.length&&T[L].settled;)N.base=T[L].value,L++;L>0&&T.splice(0,L)}let[h,b]=A(i.map(N=>s(o.get(N)))),[m,l]=A(!1),d=0,g=new Set;function y(){let N=new Array(i.length);for(let T=0;T<i.length;T++)N[T]=s(o.get(i[T]));return N}function S(N){j(()=>{let T=!1;try{T=N()}finally{l(d>0),T&&b(y())}})}function v(N){let T=o.get(N);return!T||!T.visible?!1:(T.visible=!1,i=i.filter(L=>L!==N),!0)}function x(N){let T=[];for(let $ of N){let q=o.get($);!q||q.visible||g.has($)||T.push($)}if(T.length===0)return!1;let L=new Array(i.length+T.length),k=0,_=0,D=0;for(;k<i.length&&_<T.length;){let $=o.get(i[k]).key,q=o.get(T[_]).key;L[D++]=$<=q?i[k++]:T[_++]}for(;k<i.length;)L[D++]=i[k++];for(;_<T.length;)L[D++]=T[_++];for(let $ of T)o.get($).visible=!0;return i=L,!0}function E(N){for(let T of N){let L=o.get(T);L&&L.refs++}}function P(N){for(let T of N){let L=o.get(T);L&&(L.refs--,L.refs<=0&&!L.visible&&(o.delete(T),g.delete(T)))}}function H(N){if(P(N),d--,d<=0&&(d=0,g.clear(),o.size!==i.length))for(let[T,L]of o)L.visible||o.delete(T)}async function z(N,T){let L=++r,k={id:n++,key:t++,base:N,claims:[],visible:!1,refs:1},_=c(k,L,N);S(()=>(o.set(k.id,k),k.visible=!0,i=[...i,k.id],d++,!0));let D,$=!1;try{D=await T()}catch{$=!0}S(()=>{try{if($)return g.add(k.id),u(k,_),v(k.id);let q=s(k);return _.value=D,_.settled=!0,f(k),k.visible&&!Object.is(q,s(k))}finally{H([k.id])}})}async function ae(N,T){let L=++r,k=[];for(let D of i)N(a(o.get(D),L))&&k.push(D);S(()=>{if(E(k),d++,k.length===0)return!1;let D=new Set(k);for(let $ of k){let q=o.get($);q&&(q.visible=!1)}return i=i.filter($=>!D.has($)),!0});let _=!1;try{await T()}catch{_=!0}S(()=>{try{if(!_){for(let D of k)g.add(D);return!1}return x(k)}finally{H(k)}})}async function Qe(N,T,L){let k=++r,_=[];for(let J of i){let F=o.get(J),Z=a(F,k);N(Z)&&_.push({row:F,nextValue:{...Z,...T}})}let D=_.map(J=>J.row.id),$=[];S(()=>{E(D),d++;let J=!1;for(let F of _){let Z=s(F.row);$.push(c(F.row,k,F.nextValue)),F.row.visible&&!Object.is(Z,s(F.row))&&(J=!0)}return J});let q,ze=!1;try{q=await L()}catch{ze=!0}S(()=>{try{let J=!1;for(let F=0;F<$.length;F++){let Z=_[F].row,w=$[F],K=s(Z);ze?u(Z,w):(w.value=q,w.settled=!0),f(Z),Z.visible&&!Object.is(K,s(Z))&&(J=!0)}return J}finally{H(D)}})}return{items:h,pending:m,add:z,remove:ae,update:Qe}}function Wc(e,n=100){if(!Number.isSafeInteger(n)||n<1)throw new RangeError(`[timeline] maxHistory must be a positive safe integer, got ${n}`);let[t,r]=A([e]),[o,i]=A(0),s=De(()=>t()[o()]),a=De(()=>o()>0),c=De(()=>o()<t().length-1);function u(d){let g=s(),y=typeof d=="function"?d(g):d;if(Object.is(y,g))return;let S=t(),v=o(),x=S.slice(0,v+1);x.push(y),j(()=>{x.length>n?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function f(){a()&&i(o()-1)}function h(){c()&&i(o()+1)}function b(){j(()=>{r([e]),i(0)})}function m(d){let g=t();d>=0&&d<g.length&&i(d)}function l(){s.dispose(),a.dispose(),c.dispose()}return{value:s,set:u,undo:f,redo:h,canUndo:a,canRedo:c,history:t,index:o,reset:b,jumpTo:m,dispose:l}}var qr=Promise.prototype.then;function zr(e,n,t){let r=!1,o=i=>{r||(r=!0,(i?n:t)())};try{Reflect.apply(qr,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function Wr(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let n;try{n=e.then}catch(l){return{promise:Promise.reject(l),failedEarly:!0,probe:d=>queueMicrotask(d)}}if(typeof n!="function")return null;let t,r,o=new Promise((l,d)=>{t=l,r=d}),i="invoking",s,a=[],c=l=>{if(i=l,l!=="invoking")for(let d of a.splice(0))d()},u=l=>{t(l),c("fulfilled")},f=l=>{r(l),c("rejected")},h=l=>{if(l===o){f(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(l===null||typeof l!="object"&&typeof l!="function"){u(l);return}let d;try{d=l.then}catch(g){f(g);return}if(typeof d!="function"){u(l);return}b(l,d)},b=(l,d)=>{d===qr?(s=l,c("native")):c("invoking"),queueMicrotask(()=>{let g=!1,y=v=>{g||(g=!0,h(v))},S=v=>{g||(g=!0,f(v))};try{Reflect.apply(d,l,[y,S])}catch(v){S(v)}!g&&i==="invoking"&&c("pending")})};return b(e,n),{promise:o,failedEarly:!1,probe:(l,d)=>{let g=()=>{i==="native"?zr(s,l,d):(i==="rejected"?l:d)()};i==="native"?zr(s,l,d):i==="invoking"?a.push(g):queueMicrotask(i==="rejected"?l:d)}}}function Kc(e){if(typeof structuredClone=="function")return structuredClone(e);let n=new WeakSet,t=r=>{if(r===null||typeof r!="object")return r;if(n.has(r))throw new Error("deepClone: circular reference");if(n.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(t(s),t(a));return i}if(r instanceof Set){let i=new Set;for(let s of r)i.add(t(s));return i}if(Array.isArray(r))return r.map(t);let o={};for(let i of Object.keys(r))i!=="__proto__"&&(o[i]=t(r[i]));return o};return t(e)}function Uc(e){let n=Kc(e.state),[t,r]=A({...n}),o=new Map,i=e.middleware||[];function s(l){if(o.size!==0){for(let d of Array.from(o.values()))if(d.active)try{d.callback(l)}catch(g){R(g,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],c=!1;function u(l,d=!0){if(a.push(l),c)return;c=!0;let g,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&&d?(y=!0,g=E):R(E,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,c=!1}if(y)throw g}function f(l,d){let g=e.actions[l];if(!g)throw new Error(`Unknown action: ${String(l)}`);let y=()=>{let S=t(),v=g(S,d),x=mt(v);r({...S,...x}),s(t())};u(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,E=!1,P=!0,H=()=>{if(E&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,P){S(v+1);return}let ae=()=>u(()=>S(v+1),!1);if(!z){ae();return}z.probe(()=>{E=!0,!1},ae)},z=null;try{z=Wr(i[v](t(),String(l),d,H))}catch(ae){throw E=!0,ae}finally{P=!1}z&&(z.failedEarly&&(E=!0),z.promise.then(void 0,ae=>{E=!0,R(ae,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function h(l){return()=>l(t())}function b(l){let d=o.get(l);d||(d={callback:l,active:!0},o.set(l,d));let g=d;return()=>{o.get(l)===g&&(g.active=!1,o.delete(l))}}function m(){u(()=>{r({...n}),s(t())})}return{getState:t,select:h,dispatch:f,subscribe:b,reset:m}}function Jc(e,n){return t=>n(e,t)}function Gc(e,n){return t=>e({...n,...t})}function Yc(...e){return n=>e.reduceRight((t,r)=>r(t),n)}function Xc(e){return e.render(e.data())}function Zc(e,n){return t=>{let r=document.createElement("div");r.setAttribute("data-sibu-boundary",e);try{let o=n(t);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 Qc(e){return{renderSlot(n,t){let r=Object.hasOwn(e,n)?e[n]: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 t?t():null},hasSlot(n){return Object.hasOwn(e,n)}}}function el(e){let{defaults:n,setup:t}=e;return r=>{let o=n?{...n,...r}:r;return t(o)}}function tl(e){let{defaults:n,setup:t}=e;return r=>{let o=n?{...n,...r}:r;return t(o)}}function nl(e,n){return t=>e(n(t))}var rl={string:((e,n)=>typeof e=="string"||`${n} must be a string, got ${typeof e}`),number:((e,n)=>typeof e=="number"||`${n} must be a number, got ${typeof e}`),boolean:((e,n)=>typeof e=="boolean"||`${n} must be a boolean, got ${typeof e}`),function:((e,n)=>typeof e=="function"||`${n} must be a function, got ${typeof e}`),object:((e,n)=>typeof e=="object"&&e!==null||`${n} must be an object`),array:((e,n)=>Array.isArray(e)||`${n} must be an array`),required:((e,n)=>e!=null||`${n} is required`),oneOf:(...e)=>(n,t)=>e.includes(n)||`${t} must be one of: ${e.join(", ")}`,instanceOf:e=>(n,t)=>n instanceof e||`${t} must be an instance of ${e.name}`,arrayOf:e=>(n,t)=>{if(!Array.isArray(n))return`${t} must be an array`;for(let r=0;r<n.length;r++){let o=e(n[r],`${t}[${r}]`);if(o!==!0)return o}return!0},shape:e=>(n,t)=>{if(typeof n!="object"||n===null)return`${t} must be an object`;for(let[r,o]of Object.entries(e)){let i=o(n[r],`${t}.${r}`);if(i!==!0)return i}return!0},optional:e=>(n,t)=>n==null?!0:e(n,t),range:(e,n)=>(t,r)=>typeof t!="number"?`${r} must be a number`:t>=e&&t<=n||`${r} must be between ${e} and ${n}`,pattern:e=>(n,t)=>typeof n!="string"?`${t} must be a string`:e.test(n)||`${t} must match pattern ${e}`};function Kr(e,n){let t={...e};for(let[r,o]of Object.entries(n)){if(typeof o=="function")continue;let i=o.default;t[r]===void 0&&i!==void 0&&(t[r]=typeof i=="function"?i():i)}return t}function ol(e){return n=>{let t=Kr(n,e.props);return e.setup(t)}}function il(e,n,t){}function sl(e){return n=>e(n,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={...gt,...Xt,patterns:gt});})();
|
|
399
|
+
`,jr=!1;function Ol(){!jr&&typeof document<"u"&&(document.head.appendChild(Pe({nodes:Dl})),jr=!0)}function $l(e={}){Ol();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"},[j({class:"sibu-loading-dot"}),j({class:"sibu-loading-dot"}),j({class:"sibu-loading-dot"})]),t?j({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?j({class:"sibu-loading-text"},t):null])}var fn=Symbol.for("sibujs.actions.v1"),Fr=globalThis[fn]??(globalThis[fn]=new Map);function Ue(e,t){Fr.set(e,t)}function zr(e){return Fr.get(e)}function Il(e,t,n){let r=typeof t=="string"?zr(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 Wr=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},qr=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Ur=(e,t)=>{let n=o=>R(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)},Kr=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)},Jr=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];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};Ue("clickOutside",Wr);Ue("longPress",qr);Ue("copyOnClick",Ur);Ue("autoResize",Kr);Ue("trapFocus",Jr);function xt(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 He=null;function Hl(e,t){try{let n=e(),r=xt(n);return r&&r.then(void 0,o=>{t?t(o,"async"):He?He(o,"async"):console.error("Unhandled async error in Sibu.catchError:",o)}),n}catch(n){return t?t(n,"sync"):He?He(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Bl(e,t){try{return await e()}catch(n){return t?t(n,"async"):He?He(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Vl(e){He=e}function jl(e){let[t,n]=A(e),r=i=>{!!1||!ue()||(`${i}`,void 0)};return{provide(i){r("provide");let s=t();return n(i),()=>n(s)},use(){return t},get(){return t()},set(i){r("set"),n(i)},withContext(i,s){r("withContext");let a=t();n(i);try{let l=s();return!1,l}finally{n(a)}}}}var pn=Symbol.for("sibujs.createId.v1"),mn=globalThis[pn]??(globalThis[pn]={n:0});function Gr(e="sibu"){let t=Cr();return t?(t.idCounter=(t.idCounter??0)+1,`${e}-${t.idCounter}`):(mn.n++,`${e}-${mn.n}`)}function Yr(){mn.n=0}function Fl(e,t){let n=typeof t=="function"?t():t;return _(n,J(()=>{n.style.display=e()?"":"none"},n)),n}function Zr(e,t,n,r,o){let i=typeof n=="function"?n():n;if(i==null||typeof i=="boolean")return{node:null,owned:!1};let s=i instanceof Node?i:document.createTextNode(String(i)),a=s===n,l=r.has(s),u=!a&&!l;return r.add(s),l&&void 0,e.insertBefore(s,t.nextSibling),{node:s,owned:u}}function Tt(e,t){t&&V(e),e.parentNode?.removeChild(e)}function zl(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=!1,l=new WeakSet,u=!1,d=()=>{if(a)return;let h=e(),m=r.parentNode;if(!m||s&&Object.is(h,i))return;i=h;let c=o?et([o]):null;o?.parentNode&&(Tt(o,u),o=null);let f=h?t:n!==void 0?n:null,b=le(()=>Zr(m,r,f,l,"when"));o=b.node,u=b.owned,ze(c,o?[o]:[],"when"),s=!0},g=J(d,r);return _(r,()=>{a=!0,g(),o&&Tt(o,u),o=null}),s||queueMicrotask(()=>{!a&&!s&&r.parentNode&&d()}),r}function Wl(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=!1,l=new WeakSet,u=!1,d=()=>{if(a)return;let h=String(e()),m=r.parentNode;if(!m||s&&h===i)return;i=h;let c=o?et([o]):null;o?.parentNode&&(Tt(o,u),o=null);let f=Object.hasOwn(t,h)?t[h]:n,b=le(()=>Zr(m,r,f??null,l,"match"));o=b.node,u=b.owned,ze(c,o?[o]:[],"match"),s=!0},g=J(d,r);return _(r,()=>{a=!0,g(),o&&Tt(o,u),o=null}),s||queueMicrotask(()=>{!a&&!s&&r.parentNode&&d()}),r}function rt(e,t){let n=globalThis;return n[e]??(n[e]=t())}var wt=rt(Symbol.for("sibujs.components.registry.v1"),()=>new Map),Xr=rt(Symbol.for("sibujs.components.registryVersion.v1"),()=>A(0));function Qr(){let[e,t]=Xr;t(le(e)+1)}function ql(e,t){wt.set(e,t),Qr()}function Ul(e){wt.delete(e)&&Qr()}function Kl(e){let t=wt.get(e);return t?t():P(`[Component "${e}" not found]`)}function Jl(e){let t=P({class:"sibu-dynamic"}),r={};function o(){let s=e(),a;typeof s=="function"?a=s:(Xr[0](),a=wt.get(s));let l=a??`missing:${s}`;if(l===r)return;let u=le(()=>a?a():P(`[Component "${s}" not found]`));r=l,X(t,u)}let i=re(o);return _(t,i),t}function eo(e){return typeof e=="function"?eo(e()):e instanceof Node?e:document.createTextNode(String(e))}function Gl(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let l=e[a],u=0,d=n.length;for(;u<d;){let g=u+d>>1;e[n[g]]<l?u=g+1:d=g}n[u]=a,r[a]=u>0?n[u-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Yl(e,t,n){n&&n.key;let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,l=0,u=new Map,d=new Map,g=[],h=[],m=[],c=0,f=[],b=[],y=new Uint8Array(0),S=new Map,v=[],x=[],E=new Map,D=!1,B=!1,W=!1,ce=n.key,it=()=>{if(W)return;let k=e(),C=k.length,O=r.parentNode;if(!O)return;B||(O.insertBefore(o,r.nextSibling),B=!0),b.length<C&&(b=new Array(C));for(let w=0;w<C;w++)b[w]=ce(k[w]);let $=b;f.length<C&&(f=new Array(C)),d.clear(),E.clear();for(let w=0;w<C;w++)!1,E.set($[w],w);c=0;for(let w=0;w<C;w++){let K=$[w],Sn=u.get(K),Ye;if(Sn!==void 0)Ye=Sn,g[c]=Ye,h[c]=k[w],m[c]=w,c++;else{let[xn,To]=A(k[w]),[Tn,wo]=A(w),At;try{Ne();try{At=eo(t(xn,Tn))}finally{Re()}}catch(Eo){let ko=$[w];At=document.createComment(`each:error:${w}`),queueMicrotask(()=>{R(Eo,{phase:"render",name:`each row (key="${String(ko)}")`,node:r.parentNode?r:void 0})})}Ye={node:At,item:xn,setItem:To,index:Tn,setIndex:wo}}d.set(K,Ye),f[w]=Ye.node}for(let[w,K]of u)d.has(w)||(V(K.node),K.node.parentNode&&O.removeChild(K.node));if(C===0){l=0;let w=u;u=d,d=w,D=!0,c=0;return}S.clear();for(let w=0;w<l;w++)S.set(a[w],w);v.length<C&&(v=new Array(C),x=new Array(C));let q=0;for(let w=0;w<C;w++){let K=S.get($[w]);K!==void 0&&(v[q]=w,x[q]=K,q++)}let Ge=Gl(x,q);y.length<C?y=new Uint8Array(C):y.fill(0,0,C);for(let w=0;w<Ge.length;w++)y[v[Ge[w]]]=1;let G=o;for(let w=C-1;w>=0;w--){let K=f[w];y[w]||K.nextSibling!==G&&O.insertBefore(K,G),G=K}let z=a===i?s:i;z.length<C&&(z.length=C);for(let w=0;w<C;w++)z[w]=$[w];a=z,l=C;let Q=u;u=d,d=Q,D=!0,N()};function N(){if(c===0)return;let k=c;c=0,F(()=>{for(let C=0;C<k;C++){let O=g[C];O.setItem(h[C]),O.setIndex(m[C]),g[C]=void 0,h[C]=void 0}})}let T=re(it);return _(r,()=>{if(!W){W=!0,T();for(let k of u.values())V(k.node),k.node.parentNode?.removeChild(k.node);o.parentNode&&o.parentNode.removeChild(o),B=!1,u.clear(),d.clear(),E.clear(),S.clear(),l=0,g.length=0,h.length=0,m.length=0,c=0}}),D||queueMicrotask(()=>{!D&&!W&&r.parentNode&&it()}),r}function Zl(e){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"||to(t,r);else to(t,n);return t}function to(e,t){if(t instanceof Node){e.appendChild(t);return}if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(n,he(n,t));return}e.appendChild(document.createTextNode(String(t)))}var Xl=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),no=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),ro=new WeakMap;function Ql(e){let t=e.length-1,n=e[0];for(let m=0;m<t;m++)n+=`\0${m}\0${e[m+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
400
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let m=r;r++;let c=0;for(;r<o&&n.charCodeAt(r)!==0;)c=c*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,c<0||c>=t?(r=m,-1):c}function a(){let m=r;for(;r<o;){let c=n.charCodeAt(r);if(c>=97&&c<=122||c>=65&&c<=90||c>=48&&c<=57||c===45)r++;else break}return n.slice(m,r)}function l(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let m=s();if(m>=0)return{kind:"expr",idx:m};let c=n[r];if(c==='"'||c==="'"){r++;let f=[],b=[],y="";for(;r<o&&n[r]!==c;){let 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 u(){let m=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let c=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let f=n.slice(c,r);if(!f)break;let b=l();f.startsWith("on:")?b.kind==="expr"&&m.push({t:3,name:f.slice(3),idx:b.idx}):b.kind==="bool"?m.push({t:4,name:f}):b.kind==="static"?m.push({t:0,name:f,value:b.value}):b.kind==="expr"?m.push({t:1,name:f,idx:b.idx}):b.kind==="mixed"&&m.push({t:2,name:f,statics:b.statics,exprs:b.exprs})}return m}function d(m){return m.replace(/\s+/g," ")}function g(m){let c="";for(;r<o&&n[r]!=="<";){let b=s();if(b>=0){let y=d(c);y&&m.push({t:1,value:y}),c="",m.push({t:2,idx:b})}else c+=n[r++]}let f=d(c);f&&m.push({t:1,value:f})}function h(){let m=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){let c=n[r+1];if(c==="!"){if(n.startsWith("<!--",r)){let v=n.indexOf("-->",r+4);r=v===-1?o:v+3}else if(n.startsWith("<![CDATA[",r)){let v=n.indexOf("]]>",r+9);r=v===-1?o:v+3}else{let v=n.indexOf(">",r);r=v===-1?o:v+1}continue}if(c==="?"){let v=n.indexOf(">",r);r=v===-1?o:v+1;continue}if(!(c>="a"&&c<="z")&&!(c>="A"&&c<="Z")){m.push({t:1,value:"<"}),r++;continue}r++;let f=a(),b=u();i();let y=Xl.has(f),S=n[r]==="/";if(S&&r++,r<o&&r++,y||S)m.push({t:0,el:{tag:f,svg:no.has(f),attrs:b,children:[]}});else{let v=h();if(Fn(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:no.has(f),attrs:b,children:v}})}}else g(m);return m}return h()}function gn(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:jt(n,o.name,o.value);break;case 1:{let i=o.name,s=t[o.idx];typeof s=="function"?_(n,Qe(n,i,s)):ie(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]}ie(n,o.name,i,{syncValueProperty:!1,label:"html"});break}case 3:{let i=t[o.idx];typeof i=="function"?n.addEventListener(o.name,i):!1;break}case 4:jt(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(gn(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,he(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 oo(e,...t){let n=ro.get(e);return n||(n=Ql(e),ro.set(e,n)),so(n,t)}function io(e,t){return so(e,t)}function so(e,t){if(e.length===1&&e[0].t===0)return gn(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(gn(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,he(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 eu(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??10;s===0&&de()&&void 0;let a,l=null,u=!1,d=!1,g=()=>{if(d)return;let m=e(),c=r.parentNode;if(!c||u&&m===a)return;l?.parentNode&&c.removeChild(l),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){l=null,u=!0;return}if(f=b(),f instanceof DocumentFragment){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&&(V(S),S.parentNode&&S.parentNode.removeChild(S),o.delete(y))}}c.insertBefore(f,r.nextSibling),l=f,u=!0},h=re(g);return u||queueMicrotask(()=>{!u&&r.parentNode&&g()}),_(r,()=>{d=!0,h();for(let m of o.values())V(m),m.parentNode&&m.parentNode.removeChild(m);o.clear(),i.length=0,l=null}),r}function tu(e,t){if(!t)throw new Error("[SibuJS mount] container element not found. Make sure the DOM element exists before calling mount().");typeof e=="function"||e instanceof Node;let n=()=>typeof performance<"u"?performance.now():0,r=n(),o=null,i=d=>{if(d instanceof DocumentFragment){let g=document.createComment(""),h=document.createComment("");d.insertBefore(g,d.firstChild),d.appendChild(h),o={start:g,end:h}}t.appendChild(d)},s;typeof e=="function"?s=Rn(()=>{let d=e();return i(d),d}):(s=e,i(s));let a=n()-r,l=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;l&&oe(l,"app:init",{rootElement:s,container:t,duration:a});let u=o;return{node:s,unmount(){if(l&&oe(l,"app:unmount",{rootElement:s}),u){nu(u.start,u.end);return}V(s),s.parentNode?.removeChild(s)}}}function nu(e,t){let n=e.parentNode;if(!n&&!t.parentNode)return;let r=me;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){Se("mount",me,1);return}V(a),a.parentNode===n&&n.removeChild(a)}s||R(new Error("[SibuJS mount] fragment markers lost"),{phase:"cleanup",name:"mount"}),e.parentNode?.removeChild(e),t.parentNode?.removeChild(t)}function ru(e,t){let n=document.createComment("portal"),r=t||document.body,o=null,i=!1;return queueMicrotask(()=>{if(!i)try{o=e(),r.appendChild(o)}catch(s){queueMicrotask(()=>{R(s,{phase:"render",name:"Portal",node:n.parentNode?n:void 0})})}}),_(n,()=>{i=!0,o&&(V(o),o.remove(),o=null)}),n}function ou(e,t="default"){if(e==null||!Object.hasOwn(e,t))return;let n=e[t];return typeof n=="function"?n:void 0}function ao(e,t,n){return n.length===0?e.splice(t):e.splice(t,...n)}function iu(e=[]){let[t,n]=A([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,...i){let s=[];return n(a=>{let l=[...a];return s=ao(l,o,i),s.length===0&&i.length<=1?a:l}),s},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,l)=>l!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,l)=>l===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function su(e=[]){let t=[...e],n=null,r={__v:0};function o(){n=null,r.__v++,Ie(r)||Fe(r)}function i(){if(Le(r),n===null){let a=t.slice();n=Object.freeze(a)}return n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,...l){let u=ao(t,a,l);return(u.length>0||l.length>1)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let l=t.findIndex(a);l!==-1&&(t.splice(l,1),o())},set(a){t=[...a],o()},update(a,l){a<0||a>=t.length||Object.is(t[a],l)||(t[a]=l,o())},updateWhere(a,l){let u=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let g=l(t[d]);Object.is(t[d],g)||(t[d]=g,u=!0)}u&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let l=t.filter(a);l.length!==t.length&&(t=l,o())},map(a){let l=!1;for(let u=0;u<t.length;u++){let d=a(t[u],u);Object.is(t[u],d)||(t[u]=d,l=!0)}l&&o()},clear(){t.length!==0&&(t=[],o())}}]}function au(e,t){let[n,r]=A(t),[o,i]=A(!1),[s,a]=A(null),[l,u]=A(0),d=0,g=!1,h=null,m=()=>{if(h===null)return;let f=h;h=null;try{f.abort()}catch{}},c=Z(()=>{if(l(),g)return;m();let f=++d,b=typeof AbortController<"u"?new AbortController:null;h=b,F(()=>{i(!0),a(null)});let y=()=>g||f!==d,S;try{S=e({signal:b?b.signal:void 0})}catch(v){if(y())return;F(()=>{a(v),i(!1)});return}S.then(v=>{y()||(h=null,F(()=>{r(v),i(!1)}))},v=>{y()||(h=null,F(()=>{a(v),i(!1)}))})});return{value:n,loading:o,error:s,refresh:()=>{g||u(f=>f+1)},dispose:()=>{g||(g=!0,c(),m())}}}function Ke(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let a=t;return e.source===a.source&&e.flags===a.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let a=t;if(e.size!==a.size)return!1;for(let[l,u]of e)if(!a.has(l)||!Ke(u,a.get(l),n))return!1;return!0}if(e instanceof Set){let a=t;if(e.size!==a.size)return!1;for(let l of e)if(!a.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let a=new Uint8Array(e),l=new Uint8Array(t);if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(e instanceof DataView){if(!(t instanceof DataView)||e.byteLength!==t.byteLength)return!1;for(let a=0;a<e.byteLength;a++)if(e.getUint8(a)!==t.getUint8(a))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let a=e,l=t;if(a.length!==l.length)return!1;for(let u=0;u<a.length;u++)if(a[u]!==l[u])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((a,l)=>Ke(a,t[l],n));if(e instanceof Number||e instanceof String||e instanceof Boolean)return Object.is(e.valueOf(),t.valueOf());if(typeof URL<"u"&&e instanceof URL)return e.href===t.href;if(e instanceof Error){let a=t;return e.name===a.name&&e.message===a.message&&Ke(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)&&Ke(e[i],t[i],n))}function lu(e){return A(e,{equals:(t,n)=>Ke(t,n)})}function Be(e,t){let n=t?.name,r=t?.equals,o={};o._d=!1,o._init=!1,o._f=!1,o._g=e,o.__v=0;let i=!1,s=!1,a,l=()=>{o._d||s||(o._d=!0)};l._c=1,l._sig=o;let u=()=>{let c=e();o._v=r&&o._init&&r(o._v,c)?o._v:c,o._d=!1,o._init=!0};try{re(()=>{o._v=e(),o._d=!1,o._init=!0},l)}catch(c){throw s=!0,Me(l),c}let d=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,g=()=>{if(!o._d||s||a!==void 0)return;let c=o._v;i=!0;try{Ee(u,l),Object.is(c,o._v)||o.__v++}catch(f){a={error:f},o.__v++,s?o._d=!0:o._f=!0}finally{i=!1,s&&Me(l)}d&&!s&&!Object.is(c,o._v)&&oe(d,"computed:update",{signal:o,oldValue:c,newValue:o._v})};o._validate=g;let h=()=>{let{error:c}=a;throw a=void 0,s&&(o._d=!1),c};function m(){if(i)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);return cr()||s?(o._d&&(g(),a!==void 0&&h()),o._v):(o._d&&(g(),a!==void 0&&(Le(o),h())),Le(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,Me(l);let c=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;if(c)try{c.emit("computed:destroy",{signal:o,getter:m})}catch{}},d&&oe(d,"computed:create",{signal:o,name:n,getter:m}),m}function uu(e){let[t,n]=A(e);return{get current(){return t()},set current(r){n(r)}}}function uo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function cu(e){e!==null&&typeof e=="object"&&Array.isArray(e);let t=Object.create(null);Object.keys(e).forEach(l=>{let[u,d]=A(e[l]);uo(t,l,[u,d])});let n=new Proxy({},{get(l,u){if(typeof u=="string"&&Object.hasOwn(t,u)){let d=t[u][0];return d()}return Reflect.get(l,u)},set(){throw new Error("[SibuJS store] Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let l={};return Object.keys(t).forEach(u=>{uo(l,u,t[u][0]())}),l};return[n,{setState:l=>{let u=r(),d=typeof l=="function"?l(u):l;F(()=>{Object.entries(d).forEach(([g,h])=>{Object.hasOwn(t,g)&&t[g][1](h)})})},reset:()=>{F(()=>{Object.keys(e).forEach(l=>{let u=t[l][1];u(e[l])})})},subscribe:l=>{let u=!0;return Z(()=>{let d=r();if(u){u=!1;return}Ne();try{l(d)}finally{Re()}})},subscribeKey:(l,u)=>{let d,g=!0;return Z(()=>{let h=t[l][0]();if(g){d=h,g=!1;return}if(!Object.is(h,d)){let m=d;d=h,Ne();try{u(h,m)}finally{Re()}}})},getSnapshot:r}]}function du(e,t){if(ue())return()=>{};let n,r=!0;return re(()=>{let s=e();if(r){n=s,r=!1;return}if(!Object.is(s,n)){let a=n;n=s,Ne();try{t(s,a)}finally{Re()}}})}function fu(e,t,n){return[Be(e,n),i=>{F(()=>t(i))}]}function pu(e){let t=e();return de()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[SibuJS strict] second run threw:",n)}}),t}function mu(e){if(!de())return Z(e);let t=Z(e),n=null;return queueMicrotask(()=>{try{n=Z(e)}catch(r){console.warn("[SibuJS strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function co(e,t){return ue()?()=>{}:J(e,t)}var bn="data-sibu-enhanced",hn=new WeakMap;function fo(e,t){let n=0;for(;e.length>0;){let r=e.splice(0);for(let o=0;o<r.length;o++){if(n>=me){let i=r.length-o+e.length;e.length=0,Se(t,n,i);return}n++;try{r[o]()}catch(i){typeof console<"u"&&console.error(`[SibuJS ${t}] teardown error:`,i)}}}}var po=["text","attr","class","show","on","cleanup"];function mo(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 ot(e,t){return co(t,e)}function gu(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 bu(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 hu(e,t,n,r){let o=`ctx.each[${r}]`;if(de())for(let i of Object.keys(n))po.includes(i),`${o}${i}${po.join(", ")}`;if(n.text!==void 0&&(n.text,`${o}`,e.text(t,n.text)),n.attr!==void 0)for(let i of Object.keys(n.attr)){let s=n.attr[i];`${o}${i}`,e.attr(t,i,s)}if(n.class!==void 0)for(let i of Object.keys(n.class)){let s=n.class[i];`${o}${i}`,e.classed(t,i,s)}if(n.show!==void 0&&(n.show,`${o}`,e.show(t,n.show)),n.on!==void 0)for(let i of Object.keys(n.on)){let s=n.on[i];`${o}${String(i)}`,e.on(t,i,s)}n.cleanup!==void 0&&(n.cleanup,`${o}`,e.cleanup(n.cleanup))}function Et(e,t){let n=typeof e=="string"?typeof document<"u"?document.querySelector(e):null:e;if(!n)return typeof console<"u"&&console.warn(`[SibuJS enhance] no element matched ${JSON.stringify(e)} \u2014 nothing enhanced.`),()=>{};if(n.getAttribute(bn)==="true")return de()&&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?!0:!1,l=(h,m,c)=>{if(a(h))return;let f=mo(n,m);if(!f){typeof console<"u"&&console.warn(`[SibuJS enhance] target ${JSON.stringify(m)} not found under`,n);return}c(f)},u={root:n,ref:h=>mo(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,c,f)=>{l("on",h,b=>{let y=S=>c(S,b);b.addEventListener(m,y,f),r.push(()=>b.removeEventListener(m,y,f))})},text:(h,m)=>{l("text",h,c=>{r.push(ot(c,()=>{let f=m(),b=f==null?"":String(f);c.textContent!==b&&(c.textContent=b)}))})},attr:(h,m,c)=>{l("attr",h,f=>{r.push(ot(f,()=>{let b=c(),y=b==null?null:String(b);ie(f,m,y,{syncValueProperty:!1,label:"enhance attr()",reactive:!0})}))})},classed:(h,m,c)=>{l("classed",h,f=>{r.push(ot(f,()=>{f.classList.toggle(m,!!c())}))})},show:(h,m)=>{l("show",h,c=>{let f=c.hidden;r.push(ot(c,()=>{c.hidden=!m()})),r.push(()=>{c.hidden=f})})},model:(h,m,c)=>{l("model",h,f=>{let b=f,[y,S]=m,v=c?.event??(b instanceof HTMLSelectElement||b instanceof HTMLInputElement&&(b.type==="checkbox"||b.type==="radio")?"change":"input");r.push(ot(f,()=>{bu(b,y())}));let x=()=>S(gu(b));b.addEventListener(v,x),r.push(()=>b.removeEventListener(v,x))})},each:(h,m)=>{if(a("each"))return;let c=typeof h=="string"?u.refs(h):Array.from(h);for(let f=0;f<c.length;f++){let b=c[f],y=m(b,f);y!=null&&hu(u,b,y,f)}},cleanup:h=>{a("cleanup")||r.push(h)}},d;try{d=t(u);let h=d;if(h&&typeof h.then=="function")throw h.then(void 0,m=>{}),new Error("[SibuJS enhance] setup returned a promise")}catch(h){throw fo(r,"enhance"),s=!0,h}typeof d=="function"&&r.push(d);let g=()=>{i||(i=!0,hn.get(n)===o&&(hn.delete(n),n.removeAttribute(bn)),Ze(n,g),fo(r,"enhance"),s=!0)};return _(n,g),hn.set(n,o),n.setAttribute(bn,"true"),g}function yu(e,t){if(typeof document>"u")return()=>{};let n=[];try{for(let r of Array.from(document.querySelectorAll(e)))n.push(Et(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 vu=/^[A-Za-z0-9_-]+$/,go=Symbol.for("sibujs.islands.lazy"),kt=rt(Symbol.for("sibujs.islands.registry.v1"),()=>new Map);function Su(e){return e[go]=!0,e}function xu(e,t){if(!vu.test(e))throw new Error(`[SibuJS islands] name must match [A-Za-z0-9_-]+ (got: ${JSON.stringify(e.slice(0,32))})`);kt.set(e,t)}function Tu(e){kt.delete(e)}async function wu(e){if(typeof e=="function"&&e[go]){let t=await e(),n=t.default??t;return typeof n=="function"?n:null}return e}function Eu(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(!kt.has(s)){typeof console<"u"&&console.warn(`[SibuJS islands] no island registered for "${s}" \u2014 skipping. Call registerIsland("${s}", ...).`);continue}let a=!1,l=()=>{if(a||o)return;a=!0;let d=kt.get(s);d&&wu(d).then(g=>{if(!o){if(!g){typeof console<"u"&&console.warn(`[SibuJS islands] "${s}" loader produced no setup.`);return}try{let h=Et(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)})},u=i.getAttribute("data-sibu-load")||"load";n.push(ku(u,i,l,t))}return()=>{o=!0;for(let i of n.splice(0))i();for(let i of r.splice(0))i()}}function ku(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 Cu=new Set(["__proto__","constructor","prototype"]);function yn(e){return Cu.has(e)}function Ct(e){let t={};for(let n of Object.keys(e))yn(n)||(t[n]=e[n]);return t}function bo(e){return e}var cp=1024*1024;function _u(e){let[t,n]=A(e()),r=!1,o=!1,i=t(),s=()=>{r=!1,!o&&n(i)},a=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(s):s()}))},l=re(()=>{i=e(),a()}),u=(()=>t());return u.dispose=()=>{o||(o=!0,l())},u}var ho=16;function Au(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:ho*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,ho)}function Nu(){let[e,t]=A(!1),n=0;function r(o){n++,t(!0);let i=!1,s=()=>{i||(i=!0,n--,n===0&&t(!1))},a=l=>{s(),R(l,{phase:"async",name:"transition"})};Au(()=>{try{let l=xt(o());l?l.then(s,a):s()}catch(l){a(l)}})}return{pending:e,start:r}}function Ru(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}var _t={};wn(_t,{RenderProp:()=>ju,assertType:()=>Gu,compose:()=>Vu,createGuard:()=>Yu,createSlots:()=>zu,defineComponent:()=>Wu,defineSlottedComponent:()=>qu,defineStrictComponent:()=>Ju,globalStore:()=>Iu,machine:()=>Lu,optimistic:()=>Pu,optimisticList:()=>Du,persisted:()=>Mu,timeline:()=>Ou,validateProps:()=>xo,validators:()=>Ku,withBoundary:()=>Fu,withDefaults:()=>Bu,withProps:()=>Uu,withWrapper:()=>Hu});function Je(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Lu(e){let[t,n]=A(e.initial),[r,o]=A(e.context||{}),i=e.initial,s=r(),a=[],l=!1;function u(){l=!0;try{for(;a.length>0;)d(a.shift())}catch(f){throw a.length=0,f}finally{l=!1}}function d(f){let b=Je(e.states,i);if(!b?.on)return;let y=Je(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 W=x(E);D={...E,...Ct(W)}}i=S,s=D,F(()=>{x&&o(D),n(S)});let B=Je(e.states,S);B?.entry&&B.entry(s)}function g(f){a.push(f),!l&&u()}let h=Je(e.states,e.initial);if(h?.entry){l=!0;try{h.entry(s)}catch(f){throw a.length=0,f}finally{l=!1}a.length>0&&u()}function m(f){return t()===f}function c(f){let b=t(),y=Je(e.states,b);if(!y?.on)return!1;let S=Je(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:c}}function Mu(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)=>yn(y)?void 0:S,s=n.deserialize||(y=>JSON.parse(y,i)),a=n.encrypt,l=n.decrypt,u=n.session?!1:n.syncTabs??!0,d=t;try{let y=r?r.getItem(e):null;if(y!==null){l&&(y=l(y));let S=s(y);d=n.validate&&!n.validate(S)?t:S}}catch{}let[g,h]=A(d),m=!1,c=Z(()=>{let y=g();if(!m)try{let S=o(y);a&&(S=a(S)),r?.setItem(e,S)}catch{}}),f=null;return u&&r&&typeof window<"u"&&(f=y=>{if(!(y.storageArea!==r||y.key!==e)){if(y.newValue===null){m=!0;try{h(t)}finally{m=!1}return}try{let S=y.newValue;l&&(S=l(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:()=>{c(),f&&typeof window<"u"&&(window.removeEventListener("storage",f),f=null)},enumerable:!1,writable:!1,configurable:!1}),[g,h]}function Pu(e){let[t,n]=A(e),[r,o]=A(!1),i=0,s=0;async function a(l,u){let d=++s,g=t();n(l),i++,o(!0);try{let h=await u();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 Du(e){let t=0,n=0,r=0,o=new Map,i=[];for(let N of e){let T={id:t++,key:n++,base:N,claims:[],visible:!0,refs:0};o.set(T.id,T),i.push(T.id)}function s(N){let T=N.claims;return T.length>0?T[T.length-1].value:N.base}function a(N,T){let L=N.claims;for(let k=L.length-1;k>=0;k--)if(L[k].opId<T)return L[k].value;return N.base}function l(N,T,L){let k={opId:T,value:L,settled:!1},C=N.claims,O=C.length;for(;O>0&&C[O-1].opId>T;)O--;return C.splice(O,0,k),k}function u(N,T){let L=N.claims.indexOf(T);L!==-1&&N.claims.splice(L,1)}function d(N){let T=N.claims,L=0;for(;L<T.length&&T[L].settled;)N.base=T[L].value,L++;L>0&&T.splice(0,L)}let[g,h]=A(i.map(N=>s(o.get(N)))),[m,c]=A(!1),f=0,b=new Set;function y(){let N=new Array(i.length);for(let T=0;T<i.length;T++)N[T]=s(o.get(i[T]));return N}function S(N){F(()=>{let T=!1;try{T=N()}finally{c(f>0),T&&h(y())}})}function v(N){let T=o.get(N);return!T||!T.visible?!1:(T.visible=!1,i=i.filter(L=>L!==N),!0)}function x(N){let T=[];for(let $ of N){let q=o.get($);!q||q.visible||b.has($)||T.push($)}if(T.length===0)return!1;let L=new Array(i.length+T.length),k=0,C=0,O=0;for(;k<i.length&&C<T.length;){let $=o.get(i[k]).key,q=o.get(T[C]).key;L[O++]=$<=q?i[k++]:T[C++]}for(;k<i.length;)L[O++]=i[k++];for(;C<T.length;)L[O++]=T[C++];for(let $ of T)o.get($).visible=!0;return i=L,!0}function E(N){for(let T of N){let L=o.get(T);L&&L.refs++}}function D(N){for(let T of N){let L=o.get(T);L&&(L.refs--,L.refs<=0&&!L.visible&&(o.delete(T),b.delete(T)))}}function B(N){if(D(N),f--,f<=0&&(f=0,b.clear(),o.size!==i.length))for(let[T,L]of o)L.visible||o.delete(T)}async function W(N,T){let L=++r,k={id:t++,key:n++,base:N,claims:[],visible:!1,refs:1},C=l(k,L,N);S(()=>(o.set(k.id,k),k.visible=!0,i=[...i,k.id],f++,!0));let O,$=!1;try{O=await T()}catch{$=!0}S(()=>{try{if($)return b.add(k.id),u(k,C),v(k.id);let q=s(k);return C.value=O,C.settled=!0,d(k),k.visible&&!Object.is(q,s(k))}finally{B([k.id])}})}async function ce(N,T){let L=++r,k=[];for(let O of i)N(a(o.get(O),L))&&k.push(O);S(()=>{if(E(k),f++,k.length===0)return!1;let O=new Set(k);for(let $ of k){let q=o.get($);q&&(q.visible=!1)}return i=i.filter($=>!O.has($)),!0});let C=!1;try{await T()}catch{C=!0}S(()=>{try{if(!C){for(let O of k)b.add(O);return!1}return x(k)}finally{B(k)}})}async function it(N,T,L){let k=++r,C=[];for(let G of i){let z=o.get(G),Q=a(z,k);N(Q)&&C.push({row:z,nextValue:{...Q,...T}})}let O=C.map(G=>G.row.id),$=[];S(()=>{E(O),f++;let G=!1;for(let z of C){let Q=s(z.row);$.push(l(z.row,k,z.nextValue)),z.row.visible&&!Object.is(Q,s(z.row))&&(G=!0)}return G});let q,Ge=!1;try{q=await L()}catch{Ge=!0}S(()=>{try{let G=!1;for(let z=0;z<$.length;z++){let Q=C[z].row,w=$[z],K=s(Q);Ge?u(Q,w):(w.value=q,w.settled=!0),d(Q),Q.visible&&!Object.is(K,s(Q))&&(G=!0)}return G}finally{B(O)}})}return{items:g,pending:m,add:W,remove:ce,update:it}}function Ou(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=Be(()=>n()[o()]),a=Be(()=>o()>0),l=Be(()=>o()<n().length-1);function u(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),F(()=>{x.length>t?(x.shift(),r(x),i(x.length-1)):(r(x),i(v+1))})}function d(){a()&&i(o()-1)}function g(){l()&&i(o()+1)}function h(){F(()=>{r([e]),i(0)})}function m(f){let b=n();f>=0&&f<b.length&&i(f)}function c(){s.dispose(),a.dispose(),l.dispose()}return{value:s,set:u,undo:d,redo:g,canUndo:a,canRedo:l,history:n,index:o,reset:h,jumpTo:m,dispose:c}}var vo=Promise.prototype.then;function yo(e,t,n){let r=!1,o=i=>{r||(r=!0,(i?t:n)())};try{Reflect.apply(vo,e,[void 0,()=>o(!0)])}catch{queueMicrotask(()=>o(!0));return}queueMicrotask(()=>o(!1))}function So(e){if(e===null||typeof e!="object"&&typeof e!="function")return null;let t;try{t=e.then}catch(c){return{promise:Promise.reject(c),failedEarly:!0,probe:f=>queueMicrotask(f)}}if(typeof t!="function")return null;let n,r,o=new Promise((c,f)=>{n=c,r=f}),i="invoking",s,a=[],l=c=>{if(i=c,c!=="invoking")for(let f of a.splice(0))f()},u=c=>{n(c),l("fulfilled")},d=c=>{r(c),l("rejected")},g=c=>{if(c===o){d(new TypeError("adopt: a thenable resolved to its own adoption"));return}if(c===null||typeof c!="object"&&typeof c!="function"){u(c);return}let f;try{f=c.then}catch(b){d(b);return}if(typeof f!="function"){u(c);return}h(c,f)},h=(c,f)=>{f===vo?(s=c,l("native")):l("invoking"),queueMicrotask(()=>{let b=!1,y=v=>{b||(b=!0,g(v))},S=v=>{b||(b=!0,d(v))};try{Reflect.apply(f,c,[y,S])}catch(v){S(v)}!b&&i==="invoking"&&l("pending")})};return h(e,t),{promise:o,failedEarly:!1,probe:(c,f)=>{let b=()=>{i==="native"?yo(s,c,f):(i==="rejected"?c:f)()};i==="native"?yo(s,c,f):i==="invoking"?a.push(b):queueMicrotask(i==="rejected"?c:f)}}}function $u(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 Iu(e){let t=$u(e.state),[n,r]=A({...t}),o=new Map,i=e.middleware||[];function s(c){if(o.size!==0){for(let f of Array.from(o.values()))if(f.active)try{f.callback(c)}catch(b){R(b,{phase:"event",name:"globalStore(subscribe)"})}}}let a=[],l=!1;function u(c,f=!0){if(a.push(c),l)return;l=!0;let b,y=!1;try{let 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):R(E,{phase:"event",name:"globalStore(dispatch)"})}S=!1}}finally{a.length=0,l=!1}if(y)throw b}function d(c,f){let b=e.actions[c];if(!b)throw new Error(`Unknown action: ${String(c)}`);let y=()=>{let S=n(),v=b(S,f),x=Ct(v);r({...S,...x}),s(n())};u(()=>{if(i.length===0){y();return}let S=v=>{if(v>=i.length){y();return}let x=!1,E=!1,D=!0,B=()=>{if(E&&!x){!1,x=!0;return}if(x){!1;return}if(x=!0,D){S(v+1);return}let ce=()=>u(()=>S(v+1),!1);if(!W){ce();return}W.probe(()=>{E=!0,!1},ce)},W=null;try{W=So(i[v](n(),String(c),f,B))}catch(ce){throw E=!0,ce}finally{D=!1}W&&(W.failedEarly&&(E=!0),W.promise.then(void 0,ce=>{E=!0,R(ce,{phase:"async",name:"globalStore(middleware)"})}))};S(0)})}function g(c){return()=>c(n())}function h(c){let f=o.get(c);f||(f={callback:c,active:!0},o.set(c,f));let b=f;return()=>{o.get(c)===b&&(b.active=!1,o.delete(c))}}function m(){u(()=>{r({...t}),s(n())})}return{getState:n,select:g,dispatch:d,subscribe:h,reset:m}}function Hu(e,t){return n=>t(e,n)}function Bu(e,t){return n=>e({...t,...n})}function Vu(...e){return t=>e.reduceRight((n,r)=>r(n),t)}function ju(e){return e.render(e.data())}function Fu(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 zu(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 Wu(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function qu(e){let{defaults:t,setup:n}=e;return r=>{let o=t?{...t,...r}:r;return n(o)}}function Uu(e,t){return n=>e(t(n))}var Ku={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 xo(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(typeof o=="function")continue;let i=o.default;n[r]===void 0&&i!==void 0&&(n[r]=typeof i=="function"?i():i)}return n}function Ju(e){return t=>{let n=xo(t,e.props);return e.setup(n)}}function Gu(e,t,n){}function Yu(e){return t=>e(t,"value")===!0}typeof globalThis<"u"&&(globalThis.Sibu={..._t,...vn,patterns:_t});})();
|