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