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