sibujs 1.4.0 → 1.5.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 +105 -119
- package/dist/browser.cjs +53 -14
- package/dist/browser.d.cts +14 -9
- package/dist/browser.d.ts +14 -9
- package/dist/browser.js +4 -4
- package/dist/build.cjs +124 -42
- package/dist/build.d.cts +1 -1
- package/dist/build.d.ts +1 -1
- package/dist/build.js +10 -10
- package/dist/cdn.global.js +7 -7
- package/dist/chunk-5ZYQ6KDD.js +154 -0
- package/dist/chunk-6BMPXPUW.js +26 -0
- package/dist/chunk-7GRNSCFT.js +1097 -0
- package/dist/chunk-BGTHZHJ5.js +1016 -0
- package/dist/chunk-BMPL52BF.js +654 -0
- package/dist/chunk-GJPXRJ45.js +37 -0
- package/dist/chunk-JCDUJN2F.js +2779 -0
- package/dist/chunk-K4G4ZQNR.js +286 -0
- package/dist/chunk-MB6QFH3I.js +2776 -0
- package/dist/chunk-MYRV7VDM.js +742 -0
- package/dist/chunk-NZIIMDWI.js +84 -0
- package/dist/chunk-P3XWXJZU.js +282 -0
- package/dist/chunk-PDZQY43A.js +616 -0
- package/dist/chunk-RJ46C3CS.js +1293 -0
- package/dist/chunk-SFKNRVCU.js +292 -0
- package/dist/chunk-TDGZL5CU.js +365 -0
- package/dist/chunk-VAPYJN4X.js +368 -0
- package/dist/chunk-VQDZK23A.js +1023 -0
- package/dist/chunk-VQNQZCWJ.js +61 -0
- package/dist/chunk-XHK6BDAJ.js +76 -0
- package/dist/chunk-XUEEGU5O.js +409 -0
- package/dist/contracts-ey_Qh8ef.d.cts +239 -0
- package/dist/contracts-ey_Qh8ef.d.ts +239 -0
- package/dist/customElement-BL3Uo8dL.d.cts +318 -0
- package/dist/customElement-BL3Uo8dL.d.ts +318 -0
- package/dist/data.cjs +52 -11
- package/dist/data.js +6 -6
- package/dist/devtools.cjs +22 -24
- package/dist/devtools.js +26 -28
- package/dist/ecosystem.cjs +31 -6
- package/dist/ecosystem.d.cts +4 -4
- package/dist/ecosystem.d.ts +4 -4
- package/dist/ecosystem.js +7 -7
- package/dist/extras.cjs +304 -108
- package/dist/extras.d.cts +3 -3
- package/dist/extras.d.ts +3 -3
- package/dist/extras.js +19 -19
- package/dist/index.cjs +124 -42
- package/dist/index.d.cts +58 -48
- package/dist/index.d.ts +58 -48
- package/dist/index.js +10 -10
- package/dist/motion.cjs +13 -2
- package/dist/motion.d.cts +1 -1
- package/dist/motion.d.ts +1 -1
- package/dist/motion.js +3 -3
- package/dist/patterns.cjs +91 -24
- package/dist/patterns.d.cts +46 -12
- package/dist/patterns.d.ts +46 -12
- package/dist/patterns.js +5 -5
- package/dist/performance.cjs +97 -12
- package/dist/performance.d.cts +6 -1
- package/dist/performance.d.ts +6 -1
- package/dist/performance.js +5 -3
- package/dist/plugins.cjs +19 -13
- package/dist/plugins.d.cts +3 -3
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +16 -18
- package/dist/ssr.cjs +9 -0
- package/dist/ssr.d.cts +1 -1
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +7 -7
- package/dist/testing.js +2 -2
- package/dist/ui.cjs +130 -48
- package/dist/ui.d.cts +13 -16
- package/dist/ui.d.ts +13 -16
- package/dist/ui.js +6 -6
- package/dist/widgets.cjs +31 -6
- package/dist/widgets.js +5 -5
- package/package.json +1 -1
package/dist/build.cjs
CHANGED
|
@@ -1406,12 +1406,21 @@ function queueSignalNotification(signal2) {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
}
|
|
1409
|
+
var MAX_DRAIN_ITERATIONS = 1e3;
|
|
1409
1410
|
function drainNotificationQueue() {
|
|
1410
1411
|
if (notifyDepth > 0) return;
|
|
1411
1412
|
notifyDepth++;
|
|
1412
1413
|
try {
|
|
1413
1414
|
let i2 = 0;
|
|
1414
1415
|
while (i2 < pendingQueue.length) {
|
|
1416
|
+
if (i2 >= MAX_DRAIN_ITERATIONS) {
|
|
1417
|
+
if (typeof console !== "undefined") {
|
|
1418
|
+
console.error(
|
|
1419
|
+
`[SibuJS] Notification queue exceeded ${MAX_DRAIN_ITERATIONS} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`
|
|
1420
|
+
);
|
|
1421
|
+
}
|
|
1422
|
+
break;
|
|
1423
|
+
}
|
|
1415
1424
|
safeInvoke(pendingQueue[i2]);
|
|
1416
1425
|
i2++;
|
|
1417
1426
|
}
|
|
@@ -1741,7 +1750,15 @@ function dispose(node) {
|
|
|
1741
1750
|
const disposers = elementDisposers.get(current);
|
|
1742
1751
|
if (disposers) {
|
|
1743
1752
|
if (_isDev5) activeBindingCount -= disposers.length;
|
|
1744
|
-
for (const d of disposers)
|
|
1753
|
+
for (const d of disposers) {
|
|
1754
|
+
try {
|
|
1755
|
+
d();
|
|
1756
|
+
} catch (err) {
|
|
1757
|
+
if (_isDev5 && typeof console !== "undefined") {
|
|
1758
|
+
console.warn("[SibuJS] Disposer threw during cleanup:", err);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
}
|
|
1745
1762
|
elementDisposers.delete(current);
|
|
1746
1763
|
}
|
|
1747
1764
|
}
|
|
@@ -2675,19 +2692,16 @@ function Portal(nodes, target) {
|
|
|
2675
2692
|
portalContent = nodes();
|
|
2676
2693
|
container.appendChild(portalContent);
|
|
2677
2694
|
} catch (err) {
|
|
2678
|
-
|
|
2695
|
+
if (typeof console !== "undefined") {
|
|
2696
|
+
console.error("[Portal] Render error:", err);
|
|
2697
|
+
}
|
|
2679
2698
|
}
|
|
2680
2699
|
});
|
|
2681
|
-
|
|
2682
|
-
if (
|
|
2700
|
+
registerDisposer(anchor, () => {
|
|
2701
|
+
if (portalContent) {
|
|
2702
|
+
dispose(portalContent);
|
|
2683
2703
|
portalContent.remove();
|
|
2684
2704
|
portalContent = null;
|
|
2685
|
-
observer.disconnect();
|
|
2686
|
-
}
|
|
2687
|
-
});
|
|
2688
|
-
queueMicrotask(() => {
|
|
2689
|
-
if (anchor.parentNode) {
|
|
2690
|
-
observer.observe(anchor.parentNode, { childList: true });
|
|
2691
2705
|
}
|
|
2692
2706
|
});
|
|
2693
2707
|
return anchor;
|
|
@@ -3154,21 +3168,37 @@ function derived(getter, options) {
|
|
|
3154
3168
|
cs._v = getter();
|
|
3155
3169
|
}, markDirty);
|
|
3156
3170
|
const hook = globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;
|
|
3171
|
+
let evaluating = false;
|
|
3157
3172
|
function computedGetter() {
|
|
3173
|
+
if (evaluating) {
|
|
3174
|
+
throw new Error(
|
|
3175
|
+
`[SibuJS] Circular dependency detected in derived${debugName ? ` "${debugName}"` : ""}. A derived signal cannot read itself (directly or through a chain).`
|
|
3176
|
+
);
|
|
3177
|
+
}
|
|
3158
3178
|
if (trackingSuspended) {
|
|
3159
3179
|
if (cs._d) {
|
|
3160
|
-
|
|
3161
|
-
|
|
3180
|
+
evaluating = true;
|
|
3181
|
+
try {
|
|
3182
|
+
cs._d = false;
|
|
3183
|
+
cs._v = getter();
|
|
3184
|
+
} finally {
|
|
3185
|
+
evaluating = false;
|
|
3186
|
+
}
|
|
3162
3187
|
}
|
|
3163
3188
|
return cs._v;
|
|
3164
3189
|
}
|
|
3165
3190
|
recordDependency(cs);
|
|
3166
3191
|
if (cs._d) {
|
|
3167
3192
|
const oldValue = cs._v;
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3193
|
+
evaluating = true;
|
|
3194
|
+
try {
|
|
3195
|
+
track(() => {
|
|
3196
|
+
cs._d = false;
|
|
3197
|
+
cs._v = getter();
|
|
3198
|
+
}, markDirty);
|
|
3199
|
+
} finally {
|
|
3200
|
+
evaluating = false;
|
|
3201
|
+
}
|
|
3172
3202
|
if (hook && oldValue !== cs._v) {
|
|
3173
3203
|
hook.emit("computed:update", { signal: cs, oldValue, newValue: cs._v });
|
|
3174
3204
|
}
|
|
@@ -3496,21 +3526,67 @@ function deepEqual(a2, b2, seen) {
|
|
|
3496
3526
|
if (a2 == null || b2 == null) return false;
|
|
3497
3527
|
if (typeof a2 !== typeof b2) return false;
|
|
3498
3528
|
if (typeof a2 !== "object") return false;
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
if (
|
|
3502
|
-
if (
|
|
3503
|
-
|
|
3529
|
+
const objA = a2;
|
|
3530
|
+
const objB = b2;
|
|
3531
|
+
if (objA.constructor !== objB.constructor) return false;
|
|
3532
|
+
if (a2 instanceof Date) return a2.getTime() === b2.getTime();
|
|
3533
|
+
if (a2 instanceof RegExp) {
|
|
3534
|
+
const rb = b2;
|
|
3535
|
+
return a2.source === rb.source && a2.flags === rb.flags;
|
|
3536
|
+
}
|
|
3537
|
+
if (!seen) seen = /* @__PURE__ */ new Map();
|
|
3538
|
+
let peers = seen.get(objA);
|
|
3539
|
+
if (peers?.has(objB)) return true;
|
|
3540
|
+
if (!peers) {
|
|
3541
|
+
peers = /* @__PURE__ */ new Set();
|
|
3542
|
+
seen.set(objA, peers);
|
|
3543
|
+
}
|
|
3544
|
+
peers.add(objB);
|
|
3545
|
+
if (a2 instanceof Map) {
|
|
3546
|
+
const mb = b2;
|
|
3547
|
+
if (a2.size !== mb.size) return false;
|
|
3548
|
+
for (const [k, v] of a2) {
|
|
3549
|
+
if (!mb.has(k)) return false;
|
|
3550
|
+
if (!deepEqual(v, mb.get(k), seen)) return false;
|
|
3551
|
+
}
|
|
3552
|
+
return true;
|
|
3553
|
+
}
|
|
3554
|
+
if (a2 instanceof Set) {
|
|
3555
|
+
const sb = b2;
|
|
3556
|
+
if (a2.size !== sb.size) return false;
|
|
3557
|
+
for (const item of a2) {
|
|
3558
|
+
if (!sb.has(item)) return false;
|
|
3559
|
+
}
|
|
3560
|
+
return true;
|
|
3561
|
+
}
|
|
3562
|
+
if (a2 instanceof ArrayBuffer) {
|
|
3563
|
+
const viewA = new Uint8Array(a2);
|
|
3564
|
+
const viewB = new Uint8Array(b2);
|
|
3565
|
+
if (viewA.length !== viewB.length) return false;
|
|
3566
|
+
for (let i2 = 0; i2 < viewA.length; i2++) {
|
|
3567
|
+
if (viewA[i2] !== viewB[i2]) return false;
|
|
3568
|
+
}
|
|
3569
|
+
return true;
|
|
3570
|
+
}
|
|
3571
|
+
if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
|
|
3572
|
+
const ta = a2;
|
|
3573
|
+
const tb = b2;
|
|
3574
|
+
if (ta.length !== tb.length) return false;
|
|
3575
|
+
for (let i2 = 0; i2 < ta.length; i2++) {
|
|
3576
|
+
if (ta[i2] !== tb[i2]) return false;
|
|
3577
|
+
}
|
|
3578
|
+
return true;
|
|
3579
|
+
}
|
|
3504
3580
|
if (Array.isArray(a2)) {
|
|
3505
3581
|
if (!Array.isArray(b2)) return false;
|
|
3506
3582
|
if (a2.length !== b2.length) return false;
|
|
3507
3583
|
return a2.every((val, i2) => deepEqual(val, b2[i2], seen));
|
|
3508
3584
|
}
|
|
3509
|
-
const keysA = Object.keys(
|
|
3510
|
-
const keysB = Object.keys(
|
|
3585
|
+
const keysA = Object.keys(objA);
|
|
3586
|
+
const keysB = Object.keys(objB);
|
|
3511
3587
|
if (keysA.length !== keysB.length) return false;
|
|
3512
3588
|
return keysA.every(
|
|
3513
|
-
(key) => deepEqual(
|
|
3589
|
+
(key) => deepEqual(objA[key], objB[key], seen)
|
|
3514
3590
|
);
|
|
3515
3591
|
}
|
|
3516
3592
|
function deepSignal(initial) {
|
|
@@ -3570,29 +3646,35 @@ function asyncDerived(factory, initial) {
|
|
|
3570
3646
|
// src/core/rendering/lifecycle.ts
|
|
3571
3647
|
function safeCall(cb, hookName) {
|
|
3572
3648
|
try {
|
|
3573
|
-
cb();
|
|
3649
|
+
return cb();
|
|
3574
3650
|
} catch (err) {
|
|
3575
3651
|
devWarn(`${hookName}: callback threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
3652
|
+
return void 0;
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
function runMountCallback(callback, hookName, element) {
|
|
3656
|
+
const cleanup2 = safeCall(callback, hookName);
|
|
3657
|
+
if (typeof cleanup2 === "function" && element) {
|
|
3658
|
+
registerDisposer(element, cleanup2);
|
|
3576
3659
|
}
|
|
3577
3660
|
}
|
|
3578
3661
|
function onMount(callback, element) {
|
|
3579
3662
|
if (typeof document === "undefined") return;
|
|
3580
3663
|
if (element) {
|
|
3581
3664
|
if (element.isConnected) {
|
|
3582
|
-
queueMicrotask(() =>
|
|
3583
|
-
safeCall(callback, "onMount");
|
|
3584
|
-
});
|
|
3665
|
+
queueMicrotask(() => runMountCallback(callback, "onMount", element));
|
|
3585
3666
|
return;
|
|
3586
3667
|
}
|
|
3587
3668
|
const observer = new MutationObserver(() => {
|
|
3588
3669
|
if (element.isConnected) {
|
|
3589
3670
|
observer.disconnect();
|
|
3590
|
-
|
|
3671
|
+
runMountCallback(callback, "onMount", element);
|
|
3591
3672
|
}
|
|
3592
3673
|
});
|
|
3674
|
+
registerDisposer(element, () => observer.disconnect());
|
|
3593
3675
|
queueMicrotask(() => {
|
|
3594
3676
|
if (element.isConnected) {
|
|
3595
|
-
|
|
3677
|
+
runMountCallback(callback, "onMount", element);
|
|
3596
3678
|
} else {
|
|
3597
3679
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
3598
3680
|
}
|
|
@@ -3604,6 +3686,7 @@ function onMount(callback, element) {
|
|
|
3604
3686
|
}
|
|
3605
3687
|
}
|
|
3606
3688
|
function onUnmount(callback, element) {
|
|
3689
|
+
registerDisposer(element, () => safeCall(callback, "onUnmount"));
|
|
3607
3690
|
const startObserving = () => {
|
|
3608
3691
|
const observer = new MutationObserver(() => {
|
|
3609
3692
|
if (!element.isConnected) {
|
|
@@ -3612,6 +3695,7 @@ function onUnmount(callback, element) {
|
|
|
3612
3695
|
}
|
|
3613
3696
|
});
|
|
3614
3697
|
observer.observe(document.body, { childList: true, subtree: true });
|
|
3698
|
+
registerDisposer(element, () => observer.disconnect());
|
|
3615
3699
|
};
|
|
3616
3700
|
if (element.isConnected) {
|
|
3617
3701
|
startObserving();
|
|
@@ -3762,26 +3846,24 @@ function lazy(importFn) {
|
|
|
3762
3846
|
if (cached) {
|
|
3763
3847
|
return cached();
|
|
3764
3848
|
}
|
|
3765
|
-
const [_status, setStatus] = signal("loading");
|
|
3766
|
-
const [_error, setError] = signal(null);
|
|
3767
3849
|
const container = div({ class: "sibu-lazy" });
|
|
3850
|
+
let disposed = false;
|
|
3768
3851
|
importFn().then((mod) => {
|
|
3852
|
+
if (disposed) return;
|
|
3769
3853
|
cached = mod.default;
|
|
3770
3854
|
const rendered = cached();
|
|
3771
3855
|
container.replaceChildren(rendered);
|
|
3772
|
-
setStatus("loaded");
|
|
3773
3856
|
}).catch((err) => {
|
|
3857
|
+
if (disposed) return;
|
|
3774
3858
|
const errorObj = err instanceof Error ? err : new Error(String(err));
|
|
3775
|
-
|
|
3776
|
-
setStatus("error");
|
|
3777
|
-
container.replaceChildren(
|
|
3778
|
-
div({
|
|
3779
|
-
class: "sibu-lazy-error",
|
|
3780
|
-
nodes: `Failed to load component: ${errorObj.message}`
|
|
3781
|
-
})
|
|
3782
|
-
);
|
|
3859
|
+
container.replaceChildren(div("sibu-lazy-error", `Failed to load component: ${errorObj.message}`));
|
|
3783
3860
|
});
|
|
3784
|
-
container.appendChild(span(
|
|
3861
|
+
container.appendChild(span("sibu-lazy-loading", "Loading..."));
|
|
3862
|
+
const origRemove = container.remove.bind(container);
|
|
3863
|
+
container.remove = () => {
|
|
3864
|
+
disposed = true;
|
|
3865
|
+
origRemove();
|
|
3866
|
+
};
|
|
3785
3867
|
return container;
|
|
3786
3868
|
};
|
|
3787
3869
|
}
|
package/dist/build.d.cts
CHANGED
|
@@ -503,7 +503,7 @@ interface StaticAnalysisResult {
|
|
|
503
503
|
* converted to template cloning at build time.
|
|
504
504
|
*
|
|
505
505
|
* Detects patterns like:
|
|
506
|
-
* div({ class: "card", id: "main",
|
|
506
|
+
* div({ class: "card", id: "main" }, "Hello")
|
|
507
507
|
*
|
|
508
508
|
* And identifies them as candidates for:
|
|
509
509
|
* staticTemplate('<div class="card" id="main">Hello</div>')
|
package/dist/build.d.ts
CHANGED
|
@@ -503,7 +503,7 @@ interface StaticAnalysisResult {
|
|
|
503
503
|
* converted to template cloning at build time.
|
|
504
504
|
*
|
|
505
505
|
* Detects patterns like:
|
|
506
|
-
* div({ class: "card", id: "main",
|
|
506
|
+
* div({ class: "card", id: "main" }, "Hello")
|
|
507
507
|
*
|
|
508
508
|
* And identifies them as candidates for:
|
|
509
509
|
* staticTemplate('<div class="card" id="main">Hello</div>')
|
package/dist/build.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
index_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JCDUJN2F.js";
|
|
4
4
|
import "./chunk-YT6HQ6AM.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-P3XWXJZU.js";
|
|
6
|
+
import "./chunk-GJPXRJ45.js";
|
|
7
|
+
import "./chunk-6BMPXPUW.js";
|
|
8
|
+
import "./chunk-SFKNRVCU.js";
|
|
9
|
+
import "./chunk-5ZYQ6KDD.js";
|
|
10
|
+
import "./chunk-XHK6BDAJ.js";
|
|
11
11
|
import "./chunk-CMBFNA7L.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-VQNQZCWJ.js";
|
|
13
13
|
import "./chunk-EUZND3CB.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-NZIIMDWI.js";
|
|
15
|
+
import "./chunk-K4G4ZQNR.js";
|
|
16
16
|
import "./chunk-5X6PP2UK.js";
|
|
17
17
|
|
|
18
18
|
// src/build/compileTemplates.ts
|
package/dist/cdn.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var Sibu=(()=>{var _e=Object.defineProperty;var Ro=Object.getOwnPropertyDescriptor;var Oo=Object.getOwnPropertyNames;var Po=Object.prototype.hasOwnProperty;var Ye=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},Do=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Oo(t))!Po.call(e,o)&&o!==n&&_e(e,o,{get:()=>t[o],enumerable:!(r=Ro(t,o))||r.enumerable});return e};var Fo=e=>Do(_e({},"__esModule",{value:!0}),e);var di={};Ye(di,{DynamicComponent:()=>Dr,ErrorBoundary:()=>Co,ErrorDisplay:()=>we,Fragment:()=>Mr,KeepAlive:()=>Ir,Loading:()=>Ao,Portal:()=>Rr,SVG_NS:()=>k,Suspense:()=>je,__resetIdCounter:()=>Yr,a:()=>Lt,abbr:()=>Mt,action:()=>qr,address:()=>mt,area:()=>nn,array:()=>so,article:()=>ct,aside:()=>ft,asyncDerived:()=>uo,audio:()=>rn,autoResize:()=>Ur,b:()=>Rt,base:()=>Zn,batch:()=>ke,bdi:()=>Ot,bdo:()=>Pt,bindDynamic:()=>Ne,blockquote:()=>vt,body:()=>it,br:()=>Dt,button:()=>Y,canvas:()=>yn,caption:()=>En,catchError:()=>Wr,catchErrorAsync:()=>Gr,center:()=>Tr,checkLeaks:()=>nt,circle:()=>tr,cite:()=>Ft,clickOutside:()=>$r,clipPath:()=>pr,code:()=>Te,col:()=>Sn,colgroup:()=>wn,context:()=>mo,copyOnClick:()=>Kr,createId:()=>Qr,customElement:()=>Sr,data:()=>Ht,datalist:()=>On,dd:()=>Tt,deepEqual:()=>ie,deepSignal:()=>co,defer:()=>xo,defs:()=>ur,del:()=>Tn,derived:()=>Se,details:()=>Vn,dfn:()=>Bt,dialog:()=>Wn,disableSSR:()=>Ie,dispose:()=>O,div:()=>h,dl:()=>kt,dt:()=>Et,each:()=>Nr,effect:()=>P,ellipse:()=>nr,em:()=>zt,embed:()=>ln,enableSSR:()=>ze,enqueueBatchedSignal:()=>Z,fieldset:()=>Pn,figcaption:()=>St,figure:()=>wt,font:()=>kr,footer:()=>dt,form:()=>Dn,g:()=>rr,getSlot:()=>Fr,h1:()=>bt,h2:()=>gt,h3:()=>xe,h4:()=>ht,h5:()=>yt,h6:()=>xt,head:()=>ot,header:()=>lt,hr:()=>Ct,html:()=>Oe,i:()=>It,iframe:()=>dn,img:()=>on,input:()=>Fn,ins:()=>kn,isBatching:()=>Zr,isSSR:()=>X,kbd:()=>qt,label:()=>Hn,lazy:()=>$e,legend:()=>Bn,li:()=>_t,line:()=>or,linearGradient:()=>br,link:()=>Xn,longPress:()=>jr,main:()=>pt,map:()=>sn,mark:()=>$t,marker:()=>vr,marquee:()=>Er,mask:()=>fr,match:()=>zr,math:()=>hn,menu:()=>Gn,meta:()=>er,meter:()=>zn,mount:()=>_r,nav:()=>ut,nextTick:()=>ho,noscript:()=>xn,object:()=>un,ol:()=>At,on:()=>no,onCleanup:()=>fo,onMount:()=>qe,onUnmount:()=>po,optgroup:()=>In,option:()=>qn,output:()=>$n,p:()=>ye,param:()=>pn,path:()=>ir,pattern:()=>mr,picture:()=>fn,polygon:()=>sr,polyline:()=>ar,portal:()=>mn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>gr,reactiveArray:()=>ao,rect:()=>cr,ref:()=>io,registerComponent:()=>Or,registerDisposer:()=>_,resolveComponent:()=>De,rp:()=>Kt,rt:()=>Ut,ruby:()=>Vt,s:()=>Wt,samp:()=>Gt,script:()=>vn,section:()=>at,select:()=>Kn,setGlobalErrorHandler:()=>Jr,show:()=>Hr,signal:()=>E,slot:()=>Qn,small:()=>Jt,source:()=>bn,span:()=>S,stop:()=>hr,store:()=>oo,strict:()=>bo,strictEffect:()=>go,strong:()=>Qt,style:()=>z,sub:()=>Yt,summary:()=>Jn,sup:()=>Zt,svg:()=>gn,symbol:()=>xr,table:()=>Cn,tagFactory:()=>c,tbody:()=>_n,td:()=>An,template:()=>Yn,text:()=>lr,textarea:()=>Un,tfoot:()=>Nn,th:()=>Ln,thead:()=>Mn,time:()=>Xt,title:()=>st,tr:()=>Rn,track:()=>an,transition:()=>vo,trapFocus:()=>Vr,tspan:()=>dr,u:()=>en,ul:()=>Nt,unregisterComponent:()=>Pr,untracked:()=>J,use:()=>yr,var_:()=>tn,video:()=>cn,watch:()=>ro,when:()=>Br,withSSR:()=>eo,writable:()=>lo});var Ue={};Ye(Ue,{DynamicComponent:()=>Dr,ErrorBoundary:()=>Co,ErrorDisplay:()=>we,Fragment:()=>Mr,KeepAlive:()=>Ir,Loading:()=>Ao,Portal:()=>Rr,SVG_NS:()=>k,Suspense:()=>je,__resetIdCounter:()=>Yr,a:()=>Lt,abbr:()=>Mt,action:()=>qr,address:()=>mt,area:()=>nn,array:()=>so,article:()=>ct,aside:()=>ft,asyncDerived:()=>uo,audio:()=>rn,autoResize:()=>Ur,b:()=>Rt,base:()=>Zn,batch:()=>ke,bdi:()=>Ot,bdo:()=>Pt,bindDynamic:()=>Ne,blockquote:()=>vt,body:()=>it,br:()=>Dt,button:()=>Y,canvas:()=>yn,caption:()=>En,catchError:()=>Wr,catchErrorAsync:()=>Gr,center:()=>Tr,checkLeaks:()=>nt,circle:()=>tr,cite:()=>Ft,clickOutside:()=>$r,clipPath:()=>pr,code:()=>Te,col:()=>Sn,colgroup:()=>wn,context:()=>mo,copyOnClick:()=>Kr,createId:()=>Qr,customElement:()=>Sr,data:()=>Ht,datalist:()=>On,dd:()=>Tt,deepEqual:()=>ie,deepSignal:()=>co,defer:()=>xo,defs:()=>ur,del:()=>Tn,derived:()=>Se,details:()=>Vn,dfn:()=>Bt,dialog:()=>Wn,disableSSR:()=>Ie,dispose:()=>O,div:()=>h,dl:()=>kt,dt:()=>Et,each:()=>Nr,effect:()=>P,ellipse:()=>nr,em:()=>zt,embed:()=>ln,enableSSR:()=>ze,enqueueBatchedSignal:()=>Z,fieldset:()=>Pn,figcaption:()=>St,figure:()=>wt,font:()=>kr,footer:()=>dt,form:()=>Dn,g:()=>rr,getSlot:()=>Fr,h1:()=>bt,h2:()=>gt,h3:()=>xe,h4:()=>ht,h5:()=>yt,h6:()=>xt,head:()=>ot,header:()=>lt,hr:()=>Ct,html:()=>Oe,i:()=>It,iframe:()=>dn,img:()=>on,input:()=>Fn,ins:()=>kn,isBatching:()=>Zr,isSSR:()=>X,kbd:()=>qt,label:()=>Hn,lazy:()=>$e,legend:()=>Bn,li:()=>_t,line:()=>or,linearGradient:()=>br,link:()=>Xn,longPress:()=>jr,main:()=>pt,map:()=>sn,mark:()=>$t,marker:()=>vr,marquee:()=>Er,mask:()=>fr,match:()=>zr,math:()=>hn,menu:()=>Gn,meta:()=>er,meter:()=>zn,mount:()=>_r,nav:()=>ut,nextTick:()=>ho,noscript:()=>xn,object:()=>un,ol:()=>At,on:()=>no,onCleanup:()=>fo,onMount:()=>qe,onUnmount:()=>po,optgroup:()=>In,option:()=>qn,output:()=>$n,p:()=>ye,param:()=>pn,path:()=>ir,pattern:()=>mr,picture:()=>fn,polygon:()=>sr,polyline:()=>ar,portal:()=>mn,pre:()=>ve,progress:()=>jn,q:()=>jt,radialGradient:()=>gr,reactiveArray:()=>ao,rect:()=>cr,ref:()=>io,registerComponent:()=>Or,registerDisposer:()=>_,resolveComponent:()=>De,rp:()=>Kt,rt:()=>Ut,ruby:()=>Vt,s:()=>Wt,samp:()=>Gt,script:()=>vn,section:()=>at,select:()=>Kn,setGlobalErrorHandler:()=>Jr,show:()=>Hr,signal:()=>E,slot:()=>Qn,small:()=>Jt,source:()=>bn,span:()=>S,stop:()=>hr,store:()=>oo,strict:()=>bo,strictEffect:()=>go,strong:()=>Qt,style:()=>z,sub:()=>Yt,summary:()=>Jn,sup:()=>Zt,svg:()=>gn,symbol:()=>xr,table:()=>Cn,tagFactory:()=>c,tbody:()=>_n,td:()=>An,template:()=>Yn,text:()=>lr,textarea:()=>Un,tfoot:()=>Nn,th:()=>Ln,thead:()=>Mn,time:()=>Xt,title:()=>st,tr:()=>Rn,track:()=>an,transition:()=>vo,trapFocus:()=>Vr,tspan:()=>dr,u:()=>en,ul:()=>Nt,unregisterComponent:()=>Pr,untracked:()=>J,use:()=>yr,var_:()=>tn,video:()=>cn,watch:()=>ro,when:()=>Br,withSSR:()=>eo,writable:()=>lo});function A(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Ze=A();function L(e,t){if(Ze&&!e)throw new Error(`[Sibu] ${t}`)}function M(e){Ze&&console.warn(`[Sibu] ${e}`)}function q(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase();return n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:")||n.startsWith("blob:")?"":t}function Ae(e){let t=e.toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("-moz-binding")?"":e}var Ho=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function $(e){return Ho.has(e)}var Bo=A(),W=new Array(32),G=32,F=-1,B=null,zo=new WeakMap,j="__s",H=0,C=[],R=new Set;function ne(e){try{e()}catch(t){Bo&&M(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var pe=0,fe=!1;function x(e,t){t||(t=e),Xe(t),++F,F>=G&&(G*=2,W.length=G),W[F]=t,B=t;try{e()}finally{F--,B=F>=0?W[F]:null}return()=>Xe(t)}function Io(){pe===0&&(++F,F>=G&&(G*=2,W.length=G),W[F]=null,B=null,fe=!0),pe++}function qo(){pe--,pe===0&&(F--,B=F>=0?W[F]:null,fe=!1)}function J(e){Io();try{return e()}finally{qo()}}function Q(e){if(!B)return;let t=B;if(t._dep===e)return;let n=t._deps;if(n){if(n.has(e))return;n.add(e)}else if(t._dep!==void 0){let o=new Set;o.add(t._dep),o.add(e),t._deps=o,t._dep=void 0}else t._dep=e;let r=e[j];r||(r=new Set,zo.set(e,r),e[j]=r),r.add(B),r.size===1?e.__f=B:e.__f!==void 0&&(e.__f=void 0)}function et(e){let t=e[j];if(t)for(let n of t)n._c?V(n):R.has(n)||(R.add(n),C.push(n))}function tt(){if(!(H>0)){H++;try{let e=0;for(;e<C.length;)ne(C[e]),e++}finally{C.length=0,R.clear(),H--}}}function V(e){e();let t=e._sig;for(;t;){let n=t.__f;if(n){if(n._c){let i=n._sig;i._d=!0,t=i;continue}R.has(n)||(R.add(n),C.push(n));break}let r=t[j];if(!r)break;let o;for(let i of r)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&V(i)}else R.has(i)||(R.add(i),C.push(i));t=o}}function me(e){let t=e.__f;if(t){if(H>0){t._c?V(t):R.has(t)||(R.add(t),C.push(t));return}H++;try{t._c?V(t):ne(t);let r=0;for(;r<C.length;)ne(C[r]),r++}finally{C.length=0,R.clear(),H--}return}let n=e[j];if(!(!n||n.size===0)){if(H>0){for(let r of n)r._c?V(r):R.has(r)||(R.add(r),C.push(r));return}H++;try{let r=0;for(let i of n)C[r++]=i;for(let i=0;i<r;i++)C[i]._c&&V(C[i]);for(let i=0;i<r;i++)C[i]._c||R.has(C[i])||ne(C[i]);let o=r;for(;o<C.length;)ne(C[o]),o++}finally{C.length=0,R.clear(),H--}}}function Xe(e){let t=e,n=t._dep;if(n!==void 0){let o=n[j];o&&(o.delete(e),n.__f===e&&(n.__f=void 0)),t._dep=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r){let i=o[j];i&&(i.delete(e),o.__f===e&&(o.__f=void 0))}r.clear()}}var be=A();function $o(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function ge(e,t,n){if($o(t))return be&&M(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){be&&M(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?e[t]=i:i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?e[t]=t==="checked"?!!i:s:e.setAttribute(t,$(t)?q(s):s)}return x(r)}function Ne(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){be&&M(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){be&&M(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let d=String(a);(s==="value"||s==="checked")&&s in e?e[s]=s==="checked"?!!a:d:e.setAttribute(s,$(s)?q(d):d),r=s}let i=x(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var jo=A();function K(e,t){let n=[];function r(){let o;try{o=t()}catch(l){jo&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let u=n[l];u.parentNode&&u.parentNode.removeChild(u)}n.length=0;return}let i=e.parentNode;if(!i){n.length=0;return}let s;if(Array.isArray(o)){s=[];for(let l=0;l<o.length;l++){let u=o[l];u==null||typeof u=="boolean"||s.push(u instanceof Node?u:document.createTextNode(String(u)))}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a=n.length>0&&s.length>0?new Set:void 0;if(a){for(let l=0;l<s.length;l++)for(let u=0;u<n.length;u++)if(s[l]===n[u]){a.add(s[l]);break}}for(let l=0;l<n.length;l++){let u=n[l];a?.has(u)||u.parentNode&&u.parentNode.removeChild(u)}let d=e.nextSibling;for(let l=0;l<s.length;l++){let u=s[l];a?.has(u)&&u.parentNode===i?u.nextSibling!==d&&i.insertBefore(u,d):i.insertBefore(u,d)}n=s}return x(r)}var he=new WeakMap,Le=A(),re=0;function _(e,t){let n=he.get(e);n||(n=[],he.set(e,n)),n.push(t),Le&&re++}function O(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=r.childNodes;for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=he.get(o);if(i){Le&&(re-=i.length);for(let s of i)s();he.delete(o)}}}function nt(e=0){return Le?(e>0&&re>e&&M(`checkLeaks: ${re} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),re):0}var k="http://www.w3.org/2000/svg",rt=new Map;function Ko(e){let t=rt.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),rt.set(e,t)),t}function Uo(e,t){if(typeof t=="function"){let r=x(()=>{e.setAttribute("style",t())});_(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Ko(r);if(typeof o=="function"){let s=o,a=x(()=>{n.style.setProperty(i,Ae(String(s())))});_(e,a)}else n.style.setProperty(i,Ae(String(o)))}}function Vo(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=x(()=>{e.setAttribute("class",t())});_(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=x(()=>{let a="";for(let d in n){let l=n[d];(typeof l=="function"?l():l)&&(a=a?`${a} ${d}`:d)}e.setAttribute("class",a)});_(e,s)}else e.setAttribute("class",o)}function Me(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),_(e,K(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),_(e,K(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,K(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 c=(e,t)=>(n,r)=>{let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Me(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Me(o,n),o;let i=n,s=i.class;s!=null&&Vo(o,s);let a=i.id;a!=null&&(o.id=a);let d=r!==void 0?r:i.nodes;d!=null&&Me(o,d);let l=i.on;if(l)for(let m in l)o.addEventListener(m,l[m]);let u=i.style;u!=null&&Uo(o,u);let f=i.ref;f&&(f.current=o);for(let m in i)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[m];if(p==null||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")_(o,ge(o,m,p));else if(typeof p=="boolean")m in o&&(m==="checked"||m==="disabled"||m==="selected")?o[m]=p:p?o.setAttribute(m,""):o.removeAttribute(m);else{let b=String(p);o.setAttribute(m,$(m)?q(b):b)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Ri=c("html"),ot=c("head"),it=c("body"),st=c("title"),h=c("div"),S=c("span"),at=c("section"),ct=c("article"),lt=c("header"),dt=c("footer"),ut=c("nav"),pt=c("main"),ft=c("aside"),mt=c("address"),ye=c("p"),bt=c("h1"),gt=c("h2"),xe=c("h3"),ht=c("h4"),yt=c("h5"),xt=c("h6"),vt=c("blockquote"),Tt=c("dd"),kt=c("dl"),Et=c("dt"),St=c("figcaption"),wt=c("figure"),Ct=c("hr"),_t=c("li"),At=c("ol"),Nt=c("ul"),ve=c("pre"),Lt=c("a"),Mt=c("abbr"),Rt=c("b"),Ot=c("bdi"),Pt=c("bdo"),Dt=c("br"),Ft=c("cite"),Te=c("code"),Ht=c("data"),Bt=c("dfn"),zt=c("em"),It=c("i"),qt=c("kbd"),$t=c("mark"),jt=c("q"),Kt=c("rp"),Ut=c("rt"),Vt=c("ruby"),Wt=c("s"),Gt=c("samp"),Jt=c("small"),Qt=c("strong"),Yt=c("sub"),Zt=c("sup"),Xt=c("time"),en=c("u"),tn=c("var"),nn=c("area"),rn=c("audio"),on=c("img"),sn=c("map"),an=c("track"),cn=c("video"),ln=c("embed"),dn=c("iframe"),un=c("object"),pn=c("param"),fn=c("picture"),mn=c("portal"),bn=c("source"),gn=c("svg",k),hn=c("math"),yn=c("canvas"),xn=c("noscript"),vn=c("script"),Tn=c("del"),kn=c("ins"),En=c("caption"),Sn=c("col"),wn=c("colgroup"),Cn=c("table"),_n=c("tbody"),An=c("td"),Nn=c("tfoot"),Ln=c("th"),Mn=c("thead"),Rn=c("tr"),Y=c("button"),On=c("datalist"),Pn=c("fieldset"),Dn=c("form"),Fn=c("input"),Hn=c("label"),Bn=c("legend"),zn=c("meter"),In=c("optgroup"),qn=c("option"),$n=c("output"),jn=c("progress"),Kn=c("select"),Un=c("textarea"),Vn=c("details"),Wn=c("dialog"),Gn=c("menu"),Jn=c("summary"),Qn=c("slot"),Yn=c("template"),Zn=c("base"),Xn=c("link"),er=c("meta"),z=c("style"),tr=c("circle",k),nr=c("ellipse",k),rr=c("g",k),or=c("line",k),ir=c("path",k),sr=c("polygon",k),ar=c("polyline",k),cr=c("rect",k),lr=c("text",k),dr=c("tspan",k),ur=c("defs",k),pr=c("clipPath",k),fr=c("mask",k),mr=c("pattern",k),br=c("linearGradient",k),gr=c("radialGradient",k),hr=c("stop",k),yr=c("use",k),xr=c("symbol",k),vr=c("marker",k),Tr=c("center"),kr=c("font"),Er=c("marquee"),Sr=e=>c(e);var Wo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wr=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),Cr=new WeakMap;function Go(e){let t=e.length-1,n=e[0];for(let p=0;p<t;p++)n+=`\0${p}\0${e[p+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
-
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let p=r;r++;let b=0;for(;r<o&&n.charCodeAt(r)!==0;)b=b*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=t?(r=p,-1):b}function a(){let p=r;for(;r<o;){let b=n.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return n.slice(p,r)}function d(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let b=n[r];if(b==='"'||b==="'"){r++;let y=[],D=[],I="";for(;r<o&&n[r]!==b;){let ae=s();ae>=0?(y.push(I),I="",D.push(ae)):I+=n[r++]}return r<o&&r++,y.push(I),D.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:D}}let T=r;for(;r<o;){let y=n.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:n.slice(T,r)}}function l(){let p=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let b=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let T=n.slice(b,r);if(!T)break;let v=d();T.startsWith("on:")?v.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:v.idx}):v.kind==="bool"?p.push({t:4,name:T}):v.kind==="static"?p.push({t:0,name:T,value:v.value}):v.kind==="expr"?p.push({t:1,name:T,idx:v.idx}):v.kind==="mixed"&&p.push({t:2,name:T,statics:v.statics,exprs:v.exprs})}return p}function u(p){return p.replace(/\s+/g," ")}function f(p){let b="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let y=u(b);y&&p.push({t:1,value:y}),b="",p.push({t:2,idx:v})}else b+=n[r++]}let T=u(b);T&&p.push({t:1,value:T})}function m(){let p=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let b=a(),T=l();i();let v=Wo.has(b),y=n[r]==="/";if(y&&r++,r<o&&r++,v||y)p.push({t:0,el:{tag:b,svg:wr.has(b),attrs:T,children:[]}});else{let D=m();n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:wr.has(b),attrs:T,children:D}})}}else f(p);return p}return m()}function Re(e,t){let n=e.svg?document.createElementNS(k,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:n.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=t[o.idx];if(typeof s=="function")_(n,ge(n,i,s));else if(s!=null){let a=String(s);n.setAttribute(i,$(i)?q(a):a)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(t[o.exprs[s]])+o.statics[s+1];n.setAttribute(o.name,i);break}case 3:n.addEventListener(o.name,t[o.idx]);break;case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Re(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),_(n,K(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Oe(e,...t){let n=Cr.get(e);if(n||(n=Go(e),Cr.set(e,n)),n.length===1&&n[0].t===0)return Re(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Re(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),_(r,K(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let d=s[a];d instanceof Node?r.appendChild(d):d!=null&&typeof d!="boolean"&&r.appendChild(document.createTextNode(String(d)))}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 _r(e,t){if(!t)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),O(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Jo=A();function Ar(e){return typeof e=="function"?Ar(e()):e instanceof Node?e:document.createTextNode(String(e))}function Qo(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let d=e[a],l=0,u=n.length;for(;l<u;){let f=l+u>>1;e[n[f]]<d?l=f+1:u=f}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Nr(e,t,n){L(typeof e=="function","each: first argument must be a function that returns an array."),L(typeof t=="function","each: second argument must be a render function."),L(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,d=0,l=new Map,u=new Map,f=[],m=[],p=new Uint8Array(0),b=new Map,T=[],v=[],y=new Map,D=!1,I=!1,ae=n.key,Ve=()=>{let We=e(),w=We.length,ce=r.parentNode;if(!ce)return;I||(ce.insertBefore(o,r.nextSibling),I=!0),m.length<w&&(m=new Array(w));for(let g=0;g<w;g++)m[g]=ae(We[g]);let ee=m;f.length<w&&(f=new Array(w)),u.clear(),y.clear();for(let g=0;g<w;g++)y.set(ee[g],g);for(let g=0;g<w;g++){let N=ee[g],Je=l.get(N),te;if(Je!==void 0)te=Je;else{let Qe=N,Lo=()=>e()[y.get(Qe)],Mo=()=>y.get(Qe);try{te=Ar(t(Lo,Mo))}catch(Ce){Jo&&M(`each: render threw for item at index ${g} (key="${ee[g]}"): ${Ce instanceof Error?Ce.message:String(Ce)}`),te=document.createComment(`each:error:${g}`)}}u.set(N,te),f[g]=te}for(let[g,N]of l)u.has(g)||(O(N),N.parentNode&&ce.removeChild(N));if(w===0){d=0;let g=l;l=u,u=g;return}b.clear();for(let g=0;g<d;g++)b.set(a[g],g);T.length<w&&(T=new Array(w),v=new Array(w));let le=0;for(let g=0;g<w;g++){let N=b.get(ee[g]);N!==void 0&&(T[le]=g,v[le]=N,le++)}let Ge=Qo(v,le);p.length<w?p=new Uint8Array(w):p.fill(0,0,w);for(let g=0;g<Ge.length;g++)p[T[Ge[g]]]=1;let de=o;for(let g=w-1;g>=0;g--){let N=f[g];p[g]||N.nextSibling!==de&&ce.insertBefore(N,de),de=N}let ue=a===i?s:i;ue.length<w&&(ue.length=w);for(let g=0;g<w;g++)ue[g]=ee[g];a=ue,d=w;let No=l;l=u,u=No,D=!0};return x(Ve),D||queueMicrotask(()=>{!D&&r.parentNode&&Ve()}),r}function Mr(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(Lr(r));else t.appendChild(Lr(n));return t}function Lr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function Rr(e,t){let n=document.createComment("portal"),r=t||document.body,o=null;queueMicrotask(()=>{try{o=e(),r.appendChild(o)}catch(s){console.error("[Portal] Render error:",s)}});let i=new MutationObserver(()=>{!n.isConnected&&o&&(o.remove(),o=null,i.disconnect())});return queueMicrotask(()=>{n.parentNode&&i.observe(n.parentNode,{childList:!0})}),n}var Pe=new Map;function Or(e,t){Pe.set(e,t)}function Pr(e){Pe.delete(e)}function De(e){let t=Pe.get(e);return t?t():h({nodes:`[Component "${e}" not found]`})}function Dr(e){let t=h({class:"sibu-dynamic"});function n(){let r=e(),o;typeof r=="function"?o=r():o=De(r);for(let i of Array.from(t.childNodes))O(i);t.replaceChildren(o)}return x(n),t}function Fr(e,t="default"){return e?.[t]}function Hr(e,t){return x(()=>{t.style.display=e()?"":"none"}),t}function Br(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let d=e(),l=r.parentNode;if(!l||s&&d===i)return;i=d,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=d?t():n?n():null;if(u!=null){let f=u instanceof Node?u:document.createTextNode(String(u));l.insertBefore(f,r.nextSibling),o=f}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function zr(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let d=String(e()),l=r.parentNode;if(!l||s&&d===i)return;i=d,o?.parentNode&&(O(o),o.parentNode.removeChild(o),o=null);let u=t[d]||n;if(u){let f=u();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));l.insertBefore(m,r.nextSibling),o=m}}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function Ir(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??0,a,d=null,l=!1,u=()=>{let f=e(),m=r.parentNode;if(!m||l&&f===a)return;d?.parentNode&&m.removeChild(d),a=f;let p=o.get(f);if(p){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=t[f];if(!b){d=null,l=!0;return}if(p=b(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),v=o.get(T);v&&(O(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,r.nextSibling),d=p,l=!0};return x(u),l||queueMicrotask(()=>{!l&&r.parentNode&&u()}),r}function qr(e,t,n){let r=t(e,n);typeof r=="function"&&_(e,r)}var $r=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},jr=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Kr=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},Ur=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Vr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};var U=null;function Wr(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):U?U(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Gr(e,t){try{return await e()}catch(n){return t?t(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Jr(e){U=e}var Fe=0;function Qr(e="sibu"){return Fe++,`${e}-${Fe}`}function Yr(){Fe=0}var oe=0,He=new Set;function ke(e){oe++;try{return e()}finally{oe--,oe===0&&Yo()}}function Z(e){return oe===0?!1:(He.add(e),!0)}function Zr(){return oe>0}function Yo(){for(let e of He)et(e);He.clear(),tt()}var Xr=globalThis,Be=A();function E(e,t){let n={value:e},r=Be?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return Q(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let d=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,d):Object.is(d,n.value))){if(Be){let l=n.value;n.value=d;let u=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;u&&u.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:d})}else n.value=d;Z(n)||me(n)}}if(Be){let a=Xr.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var Ee=!1;function X(){return Ee}function ze(){Ee=!0}function Ie(){Ee=!1}function eo(e){let t=Ee;ze();try{return e()}finally{t||Ie()}}var to=globalThis;function no(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,J(()=>t(o,void 0));else{let i=n;n=o,J(()=>t(o,i))}}}function P(e,t){if(L(typeof e=="function","effect: argument must be a function."),X())return()=>{};let n=t?.onError,r=n?()=>{try{e()}catch(a){n(a)}}:e,o=()=>{},i=()=>{o(),o=x(r,i)};o=x(r,i);let s=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:e}),()=>{let a=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("effect:destroy",{effectFn:e}),o()}}function Se(e,t){L(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r={};r._d=!1,r._g=e;let o=()=>{r._d||(r._d=!0)};o._c=1,o._sig=r,x(()=>{r._d=!1,r._v=e()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;function s(){if(fe)return r._d&&(r._d=!1,r._v=e()),r._v;if(Q(r),r._d){let a=r._v;x(()=>{r._d=!1,r._v=e()},o),i&&a!==r._v&&i.emit("computed:update",{signal:r,oldValue:a,newValue:r._v})}return r._v}return n&&(s.__name=n,r.__name=n),s.__signal=r,i&&i.emit("computed:create",{signal:r,name:n,getter:s}),s}function ro(e,t){if(L(typeof e=="function","watch: first argument must be a getter function."),L(typeof t=="function","watch: second argument must be a callback function."),X())return()=>{};let n,r=!0;return x(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function oo(e){L(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(d=>{let[l,u]=E(e[d]);t[d]=[l,u]});let n=new Proxy({},{get(d,l){if(l in t){let u=t[l][0];return u()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let d={};return Object.keys(t).forEach(l=>{d[l]=t[l][0]()}),d};return[n,{setState:d=>{let l=r(),u=typeof d=="function"?d(l):d;Object.entries(u).forEach(([f,m])=>{f in t&&t[f][1](m)})},reset:()=>{Object.keys(e).forEach(d=>{let l=t[d][1];l(e[d])})},subscribe:d=>{let l=!0;return P(()=>{let u=r();if(l){l=!1;return}d(u)})},subscribeKey:(d,l)=>{let u,f=!0;return P(()=>{let m=t[d][0]();if(f){u=m,f=!1;return}if(!Object.is(m,u)){let p=u;u=m,l(m,p)}})},getSnapshot:r}]}function io(e){let[t,n]=E(e);return{get current(){return t()},set current(r){n(r)}}}function so(e=[]){let[t,n]=E([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(d=>{let l=[...d];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,d)=>d!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,d)=>d===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function ao(e=[]){let t=[...e],n=null,r={};function o(){n=null,Z(r)||me(r)}function i(){return Q(r),n===null&&(n=Object.freeze([...t])),n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,d=0,...l){let u=t.splice(a,d,...l);return(u.length>0||l.length>0)&&o(),u},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let d=t.findIndex(a);d!==-1&&(t.splice(d,1),o())},set(a){t=[...a],o()},update(a,d){a<0||a>=t.length||Object.is(t[a],d)||(t[a]=d,o())},updateWhere(a,d){let l=!1;for(let u=0;u<t.length;u++)if(a(t[u])){let f=d(t[u]);Object.is(t[u],f)||(t[u]=f,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let d=t.filter(a);d.length!==t.length&&(t=d,o())},map(a){let d=!1;for(let l=0;l<t.length;l++){let u=a(t[l],l);Object.is(t[l],u)||(t[l]=u,d=!0)}d&&o()},clear(){t.length!==0&&(t=[],o())}}]}function ie(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp&&t instanceof RegExp)return e.toString()===t.toString();if(n||(n=new Set),n.has(e))return!0;if(n.add(e),Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>ie(i,t[s],n));let r=Object.keys(e),o=Object.keys(t);return r.length!==o.length?!1:r.every(i=>ie(e[i],t[i],n))}function co(e){return E(e,{equals:(t,n)=>ie(t,n)})}function lo(e,t,n){return[Se(e,n),i=>{ke(()=>t(i))}]}function uo(e,t){let[n,r]=E(t),[o,i]=E(!1),[s,a]=E(null),[d,l]=E(0),u=0;return P(()=>{d();let f=++u;i(!0),a(null);let m;try{m=e()}catch(p){a(p),i(!1);return}m.then(p=>{f===u&&(r(p),i(!1))},p=>{f===u&&(a(p),i(!1))})}),{value:n,loading:o,error:s,refresh:()=>l(f=>f+1)}}function se(e,t){try{e()}catch(n){M(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`)}}function qe(e,t){if(!(typeof document>"u"))if(t){if(t.isConnected){queueMicrotask(()=>{se(e,"onMount")});return}let n=new MutationObserver(()=>{t.isConnected&&(n.disconnect(),se(e,"onMount"))});queueMicrotask(()=>{t.isConnected?se(e,"onMount"):n.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{se(e,"onMount")})}function po(e,t){let n=()=>{let r=new MutationObserver(()=>{t.isConnected||(r.disconnect(),se(e,"onUnmount"))});r.observe(document.body,{childList:!0,subtree:!0})};t.isConnected?n():qe(()=>{n()},t)}function fo(e,t){_(t,e)}function mo(e){let[t,n]=E(e);return{provide(r){n(r)},use(){return t},get(){return t()},set(r){n(r)}}}function bo(e){let t=e();return A()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[Sibu strict] second run threw:",n)}}),t}function go(e){if(!A())return P(e);let t=P(e),n=null;return queueMicrotask(()=>{try{n=P(e)}catch(r){console.warn("[Sibu strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function ho(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function xo(e){let[t,n]=E(e()),r=!1,o=t(),i=()=>{r=!1,n(o)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}))};return x(()=>{o=e(),s()}),t}var yo=16;function Zo(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:yo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,yo)}function vo(){let[e,t]=E(!1);function n(r){t(!0),Zo(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}function $e(e){let t=null;return function(){if(t)return t();let[r,o]=E("loading"),[i,s]=E(null),a=h({class:"sibu-lazy"});return e().then(d=>{t=d.default;let l=t();a.replaceChildren(l),o("loaded")}).catch(d=>{let l=d instanceof Error?d:new Error(String(d));s(l),o("error"),a.replaceChildren(h({class:"sibu-lazy-error",nodes:`Failed to load component: ${l.message}`}))}),a.appendChild(S({class:"sibu-lazy-loading",nodes:"Loading..."})),a}}function je({nodes:e,fallback:t}){let n=h({class:"sibu-suspense"}),r=t();return n.appendChild(r),queueMicrotask(()=>{try{let o=e();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),n.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||n.replaceChildren(o)}else n.replaceChildren(o)}catch{}}),n}var Xo=A(),ei=`
|
|
1
|
+
"use strict";var Sibu=(()=>{var _e=Object.defineProperty;var Po=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Fo=Object.prototype.hasOwnProperty;var Ye=(e,t)=>{for(var n in t)_e(e,n,{get:t[n],enumerable:!0})},Ho=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Do(t))!Fo.call(e,o)&&o!==n&&_e(e,o,{get:()=>t[o],enumerable:!(r=Po(t,o))||r.enumerable});return e};var Bo=e=>Ho(_e({},"__esModule",{value:!0}),e);var pi={};Ye(pi,{DynamicComponent:()=>Hr,ErrorBoundary:()=>_o,ErrorDisplay:()=>Ce,Fragment:()=>Or,KeepAlive:()=>$r,Loading:()=>Lo,Portal:()=>Pr,SVG_NS:()=>k,Suspense:()=>Ke,__resetIdCounter:()=>Zr,a:()=>Rt,abbr:()=>Ot,action:()=>qr,address:()=>gt,area:()=>on,array:()=>co,article:()=>ut,aside:()=>bt,asyncDerived:()=>fo,audio:()=>sn,autoResize:()=>Wr,b:()=>Pt,base:()=>er,batch:()=>ke,bdi:()=>Dt,bdo:()=>Ft,bindDynamic:()=>Le,blockquote:()=>kt,body:()=>at,br:()=>Ht,button:()=>X,canvas:()=>vn,caption:()=>Sn,catchError:()=>Jr,catchErrorAsync:()=>Qr,center:()=>Er,checkLeaks:()=>ot,circle:()=>rr,cite:()=>Bt,clickOutside:()=>Kr,clipPath:()=>mr,code:()=>Te,col:()=>Cn,colgroup:()=>An,context:()=>go,copyOnClick:()=>Vr,createId:()=>Yr,customElement:()=>Cr,data:()=>zt,datalist:()=>Dn,dd:()=>Et,deepEqual:()=>ee,deepSignal:()=>uo,defer:()=>To,defs:()=>fr,del:()=>En,derived:()=>we,details:()=>Gn,dfn:()=>It,dialog:()=>Jn,disableSSR:()=>Ie,dispose:()=>R,div:()=>h,dl:()=>wt,dt:()=>St,each:()=>Mr,effect:()=>P,ellipse:()=>or,em:()=>jt,embed:()=>dn,enableSSR:()=>ze,enqueueBatchedSignal:()=>Y,fieldset:()=>Fn,figcaption:()=>Ct,figure:()=>At,font:()=>wr,footer:()=>pt,form:()=>Hn,g:()=>ir,getSlot:()=>Br,h1:()=>ht,h2:()=>yt,h3:()=>xe,h4:()=>xt,h5:()=>vt,h6:()=>Tt,head:()=>st,header:()=>dt,hr:()=>_t,html:()=>Oe,i:()=>$t,iframe:()=>pn,img:()=>an,input:()=>Bn,ins:()=>wn,isBatching:()=>eo,isSSR:()=>Z,kbd:()=>qt,label:()=>zn,lazy:()=>qe,legend:()=>In,li:()=>Nt,line:()=>sr,linearGradient:()=>hr,link:()=>tr,longPress:()=>Ur,main:()=>mt,map:()=>cn,mark:()=>Kt,marker:()=>kr,marquee:()=>Sr,mask:()=>br,match:()=>jr,math:()=>xn,menu:()=>Qn,meta:()=>nr,meter:()=>jn,mount:()=>Nr,nav:()=>ft,nextTick:()=>xo,noscript:()=>Tn,object:()=>fn,ol:()=>Lt,on:()=>oo,onCleanup:()=>bo,onMount:()=>$e,onUnmount:()=>mo,optgroup:()=>$n,option:()=>qn,output:()=>Kn,p:()=>ye,param:()=>mn,path:()=>ar,pattern:()=>gr,picture:()=>bn,polygon:()=>cr,polyline:()=>lr,portal:()=>gn,pre:()=>ve,progress:()=>Un,q:()=>Ut,radialGradient:()=>yr,reactiveArray:()=>lo,rect:()=>ur,ref:()=>ao,registerComponent:()=>Dr,registerDisposer:()=>E,resolveComponent:()=>De,rp:()=>Vt,rt:()=>Wt,ruby:()=>Gt,s:()=>Jt,samp:()=>Qt,script:()=>kn,section:()=>lt,select:()=>Vn,setGlobalErrorHandler:()=>Xr,show:()=>zr,signal:()=>w,slot:()=>Yn,small:()=>Xt,source:()=>hn,span:()=>S,stop:()=>xr,store:()=>so,strict:()=>ho,strictEffect:()=>yo,strong:()=>Yt,style:()=>z,sub:()=>Zt,summary:()=>Xn,sup:()=>en,svg:()=>yn,symbol:()=>Tr,table:()=>_n,tagFactory:()=>c,tbody:()=>Nn,td:()=>Ln,template:()=>Zn,text:()=>dr,textarea:()=>Wn,tfoot:()=>Mn,th:()=>Rn,thead:()=>On,time:()=>tn,title:()=>ct,tr:()=>Pn,track:()=>ln,transition:()=>ko,trapFocus:()=>Gr,tspan:()=>pr,u:()=>nn,ul:()=>Mt,unregisterComponent:()=>Fr,untracked:()=>J,use:()=>vr,var_:()=>rn,video:()=>un,watch:()=>io,when:()=>Ir,withSSR:()=>no,writable:()=>po});var Ve={};Ye(Ve,{DynamicComponent:()=>Hr,ErrorBoundary:()=>_o,ErrorDisplay:()=>Ce,Fragment:()=>Or,KeepAlive:()=>$r,Loading:()=>Lo,Portal:()=>Pr,SVG_NS:()=>k,Suspense:()=>Ke,__resetIdCounter:()=>Zr,a:()=>Rt,abbr:()=>Ot,action:()=>qr,address:()=>gt,area:()=>on,array:()=>co,article:()=>ut,aside:()=>bt,asyncDerived:()=>fo,audio:()=>sn,autoResize:()=>Wr,b:()=>Pt,base:()=>er,batch:()=>ke,bdi:()=>Dt,bdo:()=>Ft,bindDynamic:()=>Le,blockquote:()=>kt,body:()=>at,br:()=>Ht,button:()=>X,canvas:()=>vn,caption:()=>Sn,catchError:()=>Jr,catchErrorAsync:()=>Qr,center:()=>Er,checkLeaks:()=>ot,circle:()=>rr,cite:()=>Bt,clickOutside:()=>Kr,clipPath:()=>mr,code:()=>Te,col:()=>Cn,colgroup:()=>An,context:()=>go,copyOnClick:()=>Vr,createId:()=>Yr,customElement:()=>Cr,data:()=>zt,datalist:()=>Dn,dd:()=>Et,deepEqual:()=>ee,deepSignal:()=>uo,defer:()=>To,defs:()=>fr,del:()=>En,derived:()=>we,details:()=>Gn,dfn:()=>It,dialog:()=>Jn,disableSSR:()=>Ie,dispose:()=>R,div:()=>h,dl:()=>wt,dt:()=>St,each:()=>Mr,effect:()=>P,ellipse:()=>or,em:()=>jt,embed:()=>dn,enableSSR:()=>ze,enqueueBatchedSignal:()=>Y,fieldset:()=>Fn,figcaption:()=>Ct,figure:()=>At,font:()=>wr,footer:()=>pt,form:()=>Hn,g:()=>ir,getSlot:()=>Br,h1:()=>ht,h2:()=>yt,h3:()=>xe,h4:()=>xt,h5:()=>vt,h6:()=>Tt,head:()=>st,header:()=>dt,hr:()=>_t,html:()=>Oe,i:()=>$t,iframe:()=>pn,img:()=>an,input:()=>Bn,ins:()=>wn,isBatching:()=>eo,isSSR:()=>Z,kbd:()=>qt,label:()=>zn,lazy:()=>qe,legend:()=>In,li:()=>Nt,line:()=>sr,linearGradient:()=>hr,link:()=>tr,longPress:()=>Ur,main:()=>mt,map:()=>cn,mark:()=>Kt,marker:()=>kr,marquee:()=>Sr,mask:()=>br,match:()=>jr,math:()=>xn,menu:()=>Qn,meta:()=>nr,meter:()=>jn,mount:()=>Nr,nav:()=>ft,nextTick:()=>xo,noscript:()=>Tn,object:()=>fn,ol:()=>Lt,on:()=>oo,onCleanup:()=>bo,onMount:()=>$e,onUnmount:()=>mo,optgroup:()=>$n,option:()=>qn,output:()=>Kn,p:()=>ye,param:()=>mn,path:()=>ar,pattern:()=>gr,picture:()=>bn,polygon:()=>cr,polyline:()=>lr,portal:()=>gn,pre:()=>ve,progress:()=>Un,q:()=>Ut,radialGradient:()=>yr,reactiveArray:()=>lo,rect:()=>ur,ref:()=>ao,registerComponent:()=>Dr,registerDisposer:()=>E,resolveComponent:()=>De,rp:()=>Vt,rt:()=>Wt,ruby:()=>Gt,s:()=>Jt,samp:()=>Qt,script:()=>kn,section:()=>lt,select:()=>Vn,setGlobalErrorHandler:()=>Xr,show:()=>zr,signal:()=>w,slot:()=>Yn,small:()=>Xt,source:()=>hn,span:()=>S,stop:()=>xr,store:()=>so,strict:()=>ho,strictEffect:()=>yo,strong:()=>Yt,style:()=>z,sub:()=>Zt,summary:()=>Xn,sup:()=>en,svg:()=>yn,symbol:()=>Tr,table:()=>_n,tagFactory:()=>c,tbody:()=>Nn,td:()=>Ln,template:()=>Zn,text:()=>dr,textarea:()=>Wn,tfoot:()=>Mn,th:()=>Rn,thead:()=>On,time:()=>tn,title:()=>ct,tr:()=>Pn,track:()=>ln,transition:()=>ko,trapFocus:()=>Gr,tspan:()=>pr,u:()=>nn,ul:()=>Mt,unregisterComponent:()=>Fr,untracked:()=>J,use:()=>vr,var_:()=>rn,video:()=>un,watch:()=>io,when:()=>Ir,withSSR:()=>no,writable:()=>po});function _(){return typeof globalThis.__SIBU_DEV__<"u"?!!globalThis.__SIBU_DEV__:typeof __SIBU_DEV__<"u"?__SIBU_DEV__:typeof process<"u"&&process.env?.NODE_ENV!=="production"}var Ze=_();function L(e,t){if(Ze&&!e)throw new Error(`[Sibu] ${t}`)}function M(e){Ze&&console.warn(`[Sibu] ${e}`)}function j(e){let t=e.replace(/[\x00-\x20\x7f-\x9f]+/g,"").trim();if(!t)return"";let n=t.toLowerCase();return n.startsWith("javascript:")||n.startsWith("data:")||n.startsWith("vbscript:")||n.startsWith("blob:")?"":t}function Ne(e){let t=e.toLowerCase().replace(/\s+/g,"");return t.includes("url(")||t.includes("expression(")||t.includes("javascript:")||t.includes("-moz-binding")?"":e}var zo=new Set(["href","src","action","formaction","cite","poster","background","srcset"]);function $(e){return zo.has(e)}var Io=_(),W=new Array(32),G=32,F=-1,B=null,jo=new WeakMap,q="__s",H=0,A=[],O=new Set;function re(e){try{e()}catch(t){Io&&M(`Subscriber threw during notification: ${t instanceof Error?t.message:String(t)}`)}}var de=0,pe=!1;function x(e,t){t||(t=e),tt(t),++F,F>=G&&(G*=2,W.length=G),W[F]=t,B=t;try{e()}finally{F--,B=F>=0?W[F]:null}return()=>tt(t)}function $o(){de===0&&(++F,F>=G&&(G*=2,W.length=G),W[F]=null,B=null,pe=!0),de++}function qo(){de--,de===0&&(F--,B=F>=0?W[F]:null,pe=!1)}function J(e){$o();try{return e()}finally{qo()}}function Q(e){if(!B)return;let t=B;if(t._dep===e)return;let n=t._deps;if(n){if(n.has(e))return;n.add(e)}else if(t._dep!==void 0){let o=new Set;o.add(t._dep),o.add(e),t._deps=o,t._dep=void 0}else t._dep=e;let r=e[q];r||(r=new Set,jo.set(e,r),e[q]=r),r.add(B),r.size===1?e.__f=B:e.__f!==void 0&&(e.__f=void 0)}function nt(e){let t=e[q];if(t)for(let n of t)n._c?V(n):O.has(n)||(O.add(n),A.push(n))}var et=1e3;function rt(){if(!(H>0)){H++;try{let e=0;for(;e<A.length;){if(e>=et){typeof console<"u"&&console.error(`[SibuJS] Notification queue exceeded ${et} iterations \u2014 likely an effect that writes to a signal it reads. Breaking to prevent infinite loop.`);break}re(A[e]),e++}}finally{A.length=0,O.clear(),H--}}}function V(e){e();let t=e._sig;for(;t;){let n=t.__f;if(n){if(n._c){let i=n._sig;i._d=!0,t=i;continue}O.has(n)||(O.add(n),A.push(n));break}let r=t[q];if(!r)break;let o;for(let i of r)if(i._c){i();let s=i._sig;s&&!o?o=s:s&&V(i)}else O.has(i)||(O.add(i),A.push(i));t=o}}function fe(e){let t=e.__f;if(t){if(H>0){t._c?V(t):O.has(t)||(O.add(t),A.push(t));return}H++;try{t._c?V(t):re(t);let r=0;for(;r<A.length;)re(A[r]),r++}finally{A.length=0,O.clear(),H--}return}let n=e[q];if(!(!n||n.size===0)){if(H>0){for(let r of n)r._c?V(r):O.has(r)||(O.add(r),A.push(r));return}H++;try{let r=0;for(let i of n)A[r++]=i;for(let i=0;i<r;i++)A[i]._c&&V(A[i]);for(let i=0;i<r;i++)A[i]._c||O.has(A[i])||re(A[i]);let o=r;for(;o<A.length;)re(A[o]),o++}finally{A.length=0,O.clear(),H--}}}function tt(e){let t=e,n=t._dep;if(n!==void 0){let o=n[q];o&&(o.delete(e),n.__f===e&&(n.__f=void 0)),t._dep=void 0;return}let r=t._deps;if(!(!r||r.size===0)){for(let o of r){let i=o[q];i&&(i.delete(e),o.__f===e&&(o.__f=void 0))}r.clear()}}var me=_();function Ko(e){if(e.length<3)return!1;let t=e.toLowerCase();return t[0]==="o"&&t[1]==="n"&&t.charCodeAt(2)>=97&&t.charCodeAt(2)<=122}function be(e,t,n){if(Ko(t))return me&&M(`bindAttribute: refusing to bind event-handler attribute "${t}". Use on:{ ${t.slice(2)}: fn } instead.`),()=>{};function r(){let i;try{i=n()}catch(a){me&&M(`bindAttribute: getter for "${t}" threw: ${a instanceof Error?a.message:String(a)}`);return}if(typeof i=="boolean"){t in e&&(t==="checked"||t==="disabled"||t==="selected")?e[t]=i:i?e.setAttribute(t,""):e.removeAttribute(t);return}let s=String(i);(t==="value"||t==="checked")&&t in e?e[t]=t==="checked"?!!i:s:e.setAttribute(t,$(t)?j(s):s)}return x(r)}function Le(e,t,n){let r=null;function o(){let s;try{s=typeof t=="function"?t():t}catch(l){me&&M(`bindDynamic: name getter threw: ${l instanceof Error?l.message:String(l)}`);return}let a;try{a=typeof n=="function"?n():n}catch(l){me&&M(`bindDynamic: value getter threw: ${l instanceof Error?l.message:String(l)}`);return}if((s[0]==="o"||s[0]==="O")&&(s[1]==="n"||s[1]==="N"))return;r!==null&&r!==s&&e.removeAttribute(r);let u=String(a);(s==="value"||s==="checked")&&s in e?e[s]=s==="checked"?!!a:u:e.setAttribute(s,$(s)?j(u):u),r=s}let i=x(o);return()=>{i(),r!==null&&e.removeAttribute(r)}}var Uo=_();function K(e,t){let n=[];function r(){let o;try{o=t()}catch(l){Uo&&M(`bindChildNode: getter threw: ${l instanceof Error?l.message:String(l)}`);return}if(o==null||typeof o=="boolean"){for(let l=0;l<n.length;l++){let d=n[l];d.parentNode&&d.parentNode.removeChild(d)}n.length=0;return}let i=e.parentNode;if(!i){n.length=0;return}let s;if(Array.isArray(o)){s=[];for(let l=0;l<o.length;l++){let d=o[l];d==null||typeof d=="boolean"||s.push(d instanceof Node?d:document.createTextNode(String(d)))}}else s=[o instanceof Node?o:document.createTextNode(String(o))];let a=n.length>0&&s.length>0?new Set:void 0;if(a){for(let l=0;l<s.length;l++)for(let d=0;d<n.length;d++)if(s[l]===n[d]){a.add(s[l]);break}}for(let l=0;l<n.length;l++){let d=n[l];a?.has(d)||d.parentNode&&d.parentNode.removeChild(d)}let u=e.nextSibling;for(let l=0;l<s.length;l++){let d=s[l];a?.has(d)&&d.parentNode===i?d.nextSibling!==u&&i.insertBefore(d,u):i.insertBefore(d,u)}n=s}return x(r)}var ge=new WeakMap,he=_(),oe=0;function E(e,t){let n=ge.get(e);n||(n=[],ge.set(e,n)),n.push(t),he&&oe++}function R(e){let t=[e],n=[];for(;t.length>0;){let r=t.pop();n.push(r);let o=r.childNodes;for(let i=0;i<o.length;i++)t.push(o[i])}for(let r=n.length-1;r>=0;r--){let o=n[r],i=ge.get(o);if(i){he&&(oe-=i.length);for(let s of i)try{s()}catch(a){he&&typeof console<"u"&&console.warn("[SibuJS] Disposer threw during cleanup:",a)}ge.delete(o)}}}function ot(e=0){return he?(e>0&&oe>e&&M(`checkLeaks: ${oe} active DOM bindings detected. Expected \u2264${e}. This may indicate a component was removed from the DOM without calling dispose().`),oe):0}var k="http://www.w3.org/2000/svg",it=new Map;function Vo(e){let t=it.get(e);return t!==void 0||(t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`),it.set(e,t)),t}function Wo(e,t){if(typeof t=="function"){let r=x(()=>{e.setAttribute("style",t())});E(e,r);return}if(typeof t=="string"){e.setAttribute("style",t);return}let n=e;for(let r in t){let o=t[r],i=Vo(r);if(typeof o=="function"){let s=o,a=x(()=>{n.style.setProperty(i,Ne(String(s())))});E(e,a)}else n.style.setProperty(i,Ne(String(o)))}}function Go(e,t){if(typeof t=="string"){e.setAttribute("class",t);return}if(typeof t=="function"){let i=x(()=>{e.setAttribute("class",t())});E(e,i);return}let n=t,r=!1,o="";for(let i in n){let s=n[i];if(typeof s=="function"){r=!0;break}s&&(o=o?`${o} ${i}`:i)}if(r){let s=x(()=>{let a="";for(let u in n){let l=n[u];(typeof l=="function"?l():l)&&(a=a?`${a} ${u}`:u)}e.setAttribute("class",a)});E(e,s)}else e.setAttribute("class",o)}function Me(e,t){if(typeof t=="string"){e.textContent=t;return}if(typeof t=="number"){e.textContent=String(t);return}if(!(typeof t=="boolean"||t==null)){if(typeof t=="function"){let n=document.createComment("");e.appendChild(n),E(e,K(n,t));return}if(t instanceof Node){e.appendChild(t);return}if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="function"){let o=document.createComment("");e.appendChild(o),E(e,K(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(e,K(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 c=(e,t)=>(n,r)=>{let o=t?document.createElementNS(t,e):document.createElement(e);if(n===void 0)return o;if(typeof n=="string")return r!==void 0?(o.setAttribute("class",n),Me(o,r),o):(o.textContent=n,o);if(typeof n=="number")return o.textContent=String(n),o;if(Array.isArray(n)||n instanceof Node||typeof n=="function")return Me(o,n),o;let i=n,s=i.class;s!=null&&Go(o,s);let a=i.id;a!=null&&(o.id=a);let u=r!==void 0?r:i.nodes;u!=null&&Me(o,u);let l=i.on;if(l)for(let m in l)o.addEventListener(m,l[m]);let d=i.style;d!=null&&Wo(o,d);let f=i.ref;f&&(f.current=o);for(let m in i)switch(m){case"class":case"id":case"nodes":case"on":case"style":case"ref":case"onElement":continue;default:{let p=i[m];if(p==null||m[0]==="o"&&m[1]==="n")continue;if(typeof p=="function")E(o,be(o,m,p));else if(typeof p=="boolean")m in o&&(m==="checked"||m==="disabled"||m==="selected")?o[m]=p:p?o.setAttribute(m,""):o.removeAttribute(m);else{let b=String(p);o.setAttribute(m,$(m)?j(b):b)}}}return i.onElement&&typeof i.onElement=="function"&&i.onElement(o),o};var Pi=c("html"),st=c("head"),at=c("body"),ct=c("title"),h=c("div"),S=c("span"),lt=c("section"),ut=c("article"),dt=c("header"),pt=c("footer"),ft=c("nav"),mt=c("main"),bt=c("aside"),gt=c("address"),ye=c("p"),ht=c("h1"),yt=c("h2"),xe=c("h3"),xt=c("h4"),vt=c("h5"),Tt=c("h6"),kt=c("blockquote"),Et=c("dd"),wt=c("dl"),St=c("dt"),Ct=c("figcaption"),At=c("figure"),_t=c("hr"),Nt=c("li"),Lt=c("ol"),Mt=c("ul"),ve=c("pre"),Rt=c("a"),Ot=c("abbr"),Pt=c("b"),Dt=c("bdi"),Ft=c("bdo"),Ht=c("br"),Bt=c("cite"),Te=c("code"),zt=c("data"),It=c("dfn"),jt=c("em"),$t=c("i"),qt=c("kbd"),Kt=c("mark"),Ut=c("q"),Vt=c("rp"),Wt=c("rt"),Gt=c("ruby"),Jt=c("s"),Qt=c("samp"),Xt=c("small"),Yt=c("strong"),Zt=c("sub"),en=c("sup"),tn=c("time"),nn=c("u"),rn=c("var"),on=c("area"),sn=c("audio"),an=c("img"),cn=c("map"),ln=c("track"),un=c("video"),dn=c("embed"),pn=c("iframe"),fn=c("object"),mn=c("param"),bn=c("picture"),gn=c("portal"),hn=c("source"),yn=c("svg",k),xn=c("math"),vn=c("canvas"),Tn=c("noscript"),kn=c("script"),En=c("del"),wn=c("ins"),Sn=c("caption"),Cn=c("col"),An=c("colgroup"),_n=c("table"),Nn=c("tbody"),Ln=c("td"),Mn=c("tfoot"),Rn=c("th"),On=c("thead"),Pn=c("tr"),X=c("button"),Dn=c("datalist"),Fn=c("fieldset"),Hn=c("form"),Bn=c("input"),zn=c("label"),In=c("legend"),jn=c("meter"),$n=c("optgroup"),qn=c("option"),Kn=c("output"),Un=c("progress"),Vn=c("select"),Wn=c("textarea"),Gn=c("details"),Jn=c("dialog"),Qn=c("menu"),Xn=c("summary"),Yn=c("slot"),Zn=c("template"),er=c("base"),tr=c("link"),nr=c("meta"),z=c("style"),rr=c("circle",k),or=c("ellipse",k),ir=c("g",k),sr=c("line",k),ar=c("path",k),cr=c("polygon",k),lr=c("polyline",k),ur=c("rect",k),dr=c("text",k),pr=c("tspan",k),fr=c("defs",k),mr=c("clipPath",k),br=c("mask",k),gr=c("pattern",k),hr=c("linearGradient",k),yr=c("radialGradient",k),xr=c("stop",k),vr=c("use",k),Tr=c("symbol",k),kr=c("marker",k),Er=c("center"),wr=c("font"),Sr=c("marquee"),Cr=e=>c(e);var Jo=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ar=new Set(["svg","circle","ellipse","g","line","path","polygon","polyline","rect","text","tspan","defs","clipPath","mask","pattern","linearGradient","radialGradient","stop","use","symbol","marker"]),_r=new WeakMap;function Qo(e){let t=e.length-1,n=e[0];for(let p=0;p<t;p++)n+=`\0${p}\0${e[p+1]}`;let r=0,o=n.length;function i(){for(;r<o&&(n[r]===" "||n[r]===" "||n[r]===`
|
|
2
|
+
`||n[r]==="\r");)r++}function s(){if(n.charCodeAt(r)!==0)return-1;let p=r;r++;let b=0;for(;r<o&&n.charCodeAt(r)!==0;)b=b*10+(n.charCodeAt(r)-48),r++;return r<o&&r++,b<0||b>=t?(r=p,-1):b}function a(){let p=r;for(;r<o;){let b=n.charCodeAt(r);if(b>=97&&b<=122||b>=65&&b<=90||b>=48&&b<=57||b===45)r++;else break}return n.slice(p,r)}function u(){if(i(),n[r]!=="=")return{kind:"bool"};r++,i();let p=s();if(p>=0)return{kind:"expr",idx:p};let b=n[r];if(b==='"'||b==="'"){r++;let y=[],D=[],I="";for(;r<o&&n[r]!==b;){let se=s();se>=0?(y.push(I),I="",D.push(se)):I+=n[r++]}return r<o&&r++,y.push(I),D.length===0?{kind:"static",value:y[0]}:{kind:"mixed",statics:y,exprs:D}}let T=r;for(;r<o;){let y=n.charCodeAt(r);if(y===32||y===9||y===10||y===13||y===62||y===47)break;r++}return{kind:"static",value:n.slice(T,r)}}function l(){let p=[];for(;r<o&&(i(),!(n[r]===">"||n[r]==="/"));){let b=r;for(;r<o;){let y=n.charCodeAt(r);if(y>=97&&y<=122||y>=65&&y<=90||y>=48&&y<=57||y===45||y===58||y===95||y===46)r++;else break}let T=n.slice(b,r);if(!T)break;let v=u();T.startsWith("on:")?v.kind==="expr"&&p.push({t:3,name:T.slice(3),idx:v.idx}):v.kind==="bool"?p.push({t:4,name:T}):v.kind==="static"?p.push({t:0,name:T,value:v.value}):v.kind==="expr"?p.push({t:1,name:T,idx:v.idx}):v.kind==="mixed"&&p.push({t:2,name:T,statics:v.statics,exprs:v.exprs})}return p}function d(p){return p.replace(/\s+/g," ")}function f(p){let b="";for(;r<o&&n[r]!=="<";){let v=s();if(v>=0){let y=d(b);y&&p.push({t:1,value:y}),b="",p.push({t:2,idx:v})}else b+=n[r++]}let T=d(b);T&&p.push({t:1,value:T})}function m(){let p=[];for(;r<o&&!(n[r]==="<"&&r+1<o&&n[r+1]==="/");)if(n[r]==="<"){r++;let b=a(),T=l();i();let v=Jo.has(b),y=n[r]==="/";if(y&&r++,r<o&&r++,v||y)p.push({t:0,el:{tag:b,svg:Ar.has(b),attrs:T,children:[]}});else{let D=m();n[r]==="<"&&r+1<o&&n[r+1]==="/"&&(r+=2,a(),i(),r<o&&n[r]===">"&&r++),p.push({t:0,el:{tag:b,svg:Ar.has(b),attrs:T,children:D}})}}else f(p);return p}return m()}function Re(e,t){let n=e.svg?document.createElementNS(k,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:n.setAttribute(o.name,o.value);break;case 1:{let i=o.name;if(i[0]==="o"&&i[1]==="n")break;let s=t[o.idx];if(typeof s=="function")E(n,be(n,i,s));else if(s!=null){let a=String(s);n.setAttribute(i,$(i)?j(a):a)}break}case 2:{let i=o.statics[0];for(let s=0;s<o.exprs.length;s++)i+=String(t[o.exprs[s]])+o.statics[s+1];n.setAttribute(o.name,i);break}case 3:n.addEventListener(o.name,t[o.idx]);break;case 4:n.setAttribute(o.name,"");break}}for(let r=0;r<e.children.length;r++){let o=e.children[r];switch(o.t){case 0:n.appendChild(Re(o.el,t));break;case 1:n.appendChild(document.createTextNode(o.value));break;case 2:{let i=t[o.idx];if(typeof i=="function"){let s=document.createComment("");n.appendChild(s),E(n,K(s,i))}else if(i instanceof Node)n.appendChild(i);else if(Array.isArray(i))for(let s=0;s<i.length;s++){let a=i[s];a instanceof Node?n.appendChild(a):a!=null&&typeof a!="boolean"&&n.appendChild(document.createTextNode(String(a)))}else i!=null&&typeof i!="boolean"&&n.appendChild(document.createTextNode(String(i)));break}}}return n}function Oe(e,...t){let n=_r.get(e);if(n||(n=Qo(e),_r.set(e,n)),n.length===1&&n[0].t===0)return Re(n[0].el,t);let r=document.createElement("div");for(let o=0;o<n.length;o++){let i=n[o];switch(i.t){case 0:r.appendChild(Re(i.el,t));break;case 1:r.appendChild(document.createTextNode(i.value));break;case 2:{let s=t[i.idx];if(s instanceof Node)r.appendChild(s);else if(typeof s=="function"){let a=document.createComment("bind:htm");r.appendChild(a),E(r,K(a,s))}else if(Array.isArray(s))for(let a=0;a<s.length;a++){let u=s[a];u instanceof Node?r.appendChild(u):u!=null&&typeof u!="boolean"&&r.appendChild(document.createTextNode(String(u)))}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 Nr(e,t){if(!t)throw new Error("[Sibu] mount: container element not found. Make sure the DOM element exists before calling mount().");L(typeof e=="function"||e instanceof Node,"mount: first argument must be a component function or a DOM Node.");let n=typeof performance<"u"?performance.now():0,r=typeof e=="function"?e():e,o=typeof performance<"u"?performance.now()-n:0;t.appendChild(r);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return i&&i.emit("app:init",{rootElement:r,container:t,duration:o}),{node:r,unmount(){i&&i.emit("app:unmount",{rootElement:r}),R(r),r.parentNode&&r.parentNode.removeChild(r)}}}var Xo=_();function Lr(e){return typeof e=="function"?Lr(e()):e instanceof Node?e:document.createTextNode(String(e))}function Yo(e,t){if(t===0)return[];let n=[],r=new Array(t);for(let a=0;a<t;a++){let u=e[a],l=0,d=n.length;for(;l<d;){let f=l+d>>1;e[n[f]]<u?l=f+1:d=f}n[l]=a,r[a]=l>0?n[l-1]:-1}let o=n.length,i=new Array(o),s=n[o-1];for(let a=o-1;a>=0;a--)i[a]=s,s=r[s];return i}function Mr(e,t,n){L(typeof e=="function","each: first argument must be a function that returns an array."),L(typeof t=="function","each: second argument must be a render function."),L(n&&typeof n.key=="function","each: options.key must be a function that returns a unique key per item.");let r=document.createComment("each:anchor"),o=document.createComment("each:end"),i=[],s=[],a=i,u=0,l=new Map,d=new Map,f=[],m=[],p=new Uint8Array(0),b=new Map,T=[],v=[],y=new Map,D=!1,I=!1,se=n.key,We=()=>{let Ge=e(),C=Ge.length,ae=r.parentNode;if(!ae)return;I||(ae.insertBefore(o,r.nextSibling),I=!0),m.length<C&&(m=new Array(C));for(let g=0;g<C;g++)m[g]=se(Ge[g]);let te=m;f.length<C&&(f=new Array(C)),d.clear(),y.clear();for(let g=0;g<C;g++)y.set(te[g],g);for(let g=0;g<C;g++){let N=te[g],Qe=l.get(N),ne;if(Qe!==void 0)ne=Qe;else{let Xe=N,Ro=()=>e()[y.get(Xe)],Oo=()=>y.get(Xe);try{ne=Lr(t(Ro,Oo))}catch(Ae){Xo&&M(`each: render threw for item at index ${g} (key="${te[g]}"): ${Ae instanceof Error?Ae.message:String(Ae)}`),ne=document.createComment(`each:error:${g}`)}}d.set(N,ne),f[g]=ne}for(let[g,N]of l)d.has(g)||(R(N),N.parentNode&&ae.removeChild(N));if(C===0){u=0;let g=l;l=d,d=g;return}b.clear();for(let g=0;g<u;g++)b.set(a[g],g);T.length<C&&(T=new Array(C),v=new Array(C));let ce=0;for(let g=0;g<C;g++){let N=b.get(te[g]);N!==void 0&&(T[ce]=g,v[ce]=N,ce++)}let Je=Yo(v,ce);p.length<C?p=new Uint8Array(C):p.fill(0,0,C);for(let g=0;g<Je.length;g++)p[T[Je[g]]]=1;let le=o;for(let g=C-1;g>=0;g--){let N=f[g];p[g]||N.nextSibling!==le&&ae.insertBefore(N,le),le=N}let ue=a===i?s:i;ue.length<C&&(ue.length=C);for(let g=0;g<C;g++)ue[g]=te[g];a=ue,u=C;let Mo=l;l=d,d=Mo,D=!0};return x(We),D||queueMicrotask(()=>{!D&&r.parentNode&&We()}),r}function Or(e){let t=document.createDocumentFragment();for(let n of e)if(!(n==null||typeof n=="boolean"))if(Array.isArray(n))for(let r of n)r==null||typeof r=="boolean"||t.appendChild(Rr(r));else t.appendChild(Rr(n));return t}function Rr(e){if(e==null)return document.createTextNode("");if(e instanceof Node)return e;if(typeof e=="function"){let t=e();return t instanceof Node?t:document.createTextNode(String(t??""))}return document.createTextNode(String(e))}function Pr(e,t){let n=document.createComment("portal"),r=t||document.body,o=null;return queueMicrotask(()=>{try{o=e(),r.appendChild(o)}catch(i){typeof console<"u"&&console.error("[Portal] Render error:",i)}}),E(n,()=>{o&&(R(o),o.remove(),o=null)}),n}var Pe=new Map;function Dr(e,t){Pe.set(e,t)}function Fr(e){Pe.delete(e)}function De(e){let t=Pe.get(e);return t?t():h({nodes:`[Component "${e}" not found]`})}function Hr(e){let t=h({class:"sibu-dynamic"});function n(){let r=e(),o;typeof r=="function"?o=r():o=De(r);for(let i of Array.from(t.childNodes))R(i);t.replaceChildren(o)}return x(n),t}function Br(e,t="default"){return e?.[t]}function zr(e,t){return x(()=>{t.style.display=e()?"":"none"}),t}function Ir(e,t,n){let r=document.createComment("when"),o=null,i,s=!1,a=()=>{let u=e(),l=r.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=u?t():n?n():null;if(d!=null){let f=d instanceof Node?d:document.createTextNode(String(d));l.insertBefore(f,r.nextSibling),o=f}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function jr(e,t,n){let r=document.createComment("match"),o=null,i,s=!1,a=()=>{let u=String(e()),l=r.parentNode;if(!l||s&&u===i)return;i=u,o?.parentNode&&(R(o),o.parentNode.removeChild(o),o=null);let d=t[u]||n;if(d){let f=d();if(f!=null){let m=f instanceof Node?f:document.createTextNode(String(f));l.insertBefore(m,r.nextSibling),o=m}}s=!0};return x(a),s||queueMicrotask(()=>{!s&&r.parentNode&&a()}),r}function $r(e,t,n){let r=document.createComment("keep-alive"),o=new Map,i=[],s=n?.max??0,a,u=null,l=!1,d=()=>{let f=e(),m=r.parentNode;if(!m||l&&f===a)return;u?.parentNode&&m.removeChild(u),a=f;let p=o.get(f);if(p){let b=i.indexOf(f);b!==-1&&(i.splice(b,1),i.push(f))}else{let b=t[f];if(!b){u=null,l=!0;return}if(p=b(),o.set(f,p),i.push(f),s>0&&i.length>s){let T=i.shift(),v=o.get(T);v&&(R(v),v.parentNode&&v.parentNode.removeChild(v),o.delete(T))}}m.insertBefore(p,r.nextSibling),u=p,l=!0};return x(d),l||queueMicrotask(()=>{!l&&r.parentNode&&d()}),r}function qr(e,t,n){let r=t(e,n);typeof r=="function"&&E(e,r)}var Kr=(e,t)=>{let n=r=>{e.contains(r.target)||t()};return document.addEventListener("pointerdown",n,!0),()=>document.removeEventListener("pointerdown",n,!0)},Ur=(e,t)=>{let n=t.duration??500,r=null,o=()=>{r=setTimeout(()=>{t.callback(),r=null},n)},i=()=>{r!==null&&(clearTimeout(r),r=null)};return e.addEventListener("pointerdown",o),e.addEventListener("pointerup",i),e.addEventListener("pointerleave",i),()=>{i(),e.removeEventListener("pointerdown",o),e.removeEventListener("pointerup",i),e.removeEventListener("pointerleave",i)}},Vr=(e,t)=>{let n=()=>{let r=typeof t=="function"?t():e.textContent??"";navigator.clipboard.writeText(r)};return e.addEventListener("click",n),()=>e.removeEventListener("click",n)},Wr=e=>{let t=()=>{e.style.overflow="hidden",e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return t(),e.addEventListener("input",t),()=>e.removeEventListener("input",t)},Gr=e=>{let t='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])',n=r=>{if(r.key!=="Tab")return;let o=Array.from(e.querySelectorAll(t));if(o.length===0)return;let i=o[0],s=o[o.length-1];r.shiftKey&&document.activeElement===i?(r.preventDefault(),s.focus()):!r.shiftKey&&document.activeElement===s&&(r.preventDefault(),i.focus())};return e.addEventListener("keydown",n),()=>e.removeEventListener("keydown",n)};var U=null;function Jr(e,t){try{let n=e();return n&&typeof n.then=="function"&&n.catch(r=>{t?t(r,"async"):U?U(r,"async"):console.error("Unhandled async error in Sibu.catchError:",r)}),n}catch(n){return t?t(n,"sync"):U?U(n,"sync"):console.error("Unhandled error in Sibu.catchError:",n),null}}async function Qr(e,t){try{return await e()}catch(n){return t?t(n,"async"):U?U(n,"async"):console.error("Unhandled async error in Sibu.catchErrorAsync:",n),null}}function Xr(e){U=e}var Fe=0;function Yr(e="sibu"){return Fe++,`${e}-${Fe}`}function Zr(){Fe=0}var ie=0,He=new Set;function ke(e){ie++;try{return e()}finally{ie--,ie===0&&Zo()}}function Y(e){return ie===0?!1:(He.add(e),!0)}function eo(){return ie>0}function Zo(){for(let e of He)nt(e);He.clear(),rt()}var to=globalThis,Be=_();function w(e,t){let n={value:e},r=Be?t?.name:void 0,o=t?.equals;r&&(n.__name=r);function i(){return Q(n),n.value}i.__signal=n,r&&(i.__name=r);function s(a){let u=typeof a=="function"?a(n.value):a;if(!(o?o(n.value,u):Object.is(u,n.value))){if(Be){let l=n.value;n.value=u;let d=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;d&&d.emit("signal:update",{signal:n,name:r,oldValue:l,newValue:u})}else n.value=u;Y(n)||fe(n)}}if(Be){let a=to.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("signal:create",{signal:n,name:r,getter:i,initial:e})}return[i,s]}var Ee=!1;function Z(){return Ee}function ze(){Ee=!0}function Ie(){Ee=!1}function no(e){let t=Ee;ze();try{return e()}finally{t||Ie()}}var ro=globalThis;function oo(e,t){let n,r=!0;return()=>{let o=e();if(r)r=!1,n=o,J(()=>t(o,void 0));else{let i=n;n=o,J(()=>t(o,i))}}}function P(e,t){if(L(typeof e=="function","effect: argument must be a function."),Z())return()=>{};let n=t?.onError,r=n?()=>{try{e()}catch(a){n(a)}}:e,o=()=>{},i=()=>{o(),o=x(r,i)};o=x(r,i);let s=ro.__SIBU_DEVTOOLS_GLOBAL_HOOK__;return s&&s.emit("effect:create",{effectFn:e}),()=>{let a=ro.__SIBU_DEVTOOLS_GLOBAL_HOOK__;a&&a.emit("effect:destroy",{effectFn:e}),o()}}function we(e,t){L(typeof e=="function","derived: argument must be a getter function.");let n=t?.name,r={};r._d=!1,r._g=e;let o=()=>{r._d||(r._d=!0)};o._c=1,o._sig=r,x(()=>{r._d=!1,r._v=e()},o);let i=globalThis.__SIBU_DEVTOOLS_GLOBAL_HOOK__,s=!1;function a(){if(s)throw new Error(`[SibuJS] Circular dependency detected in derived${n?` "${n}"`:""}. A derived signal cannot read itself (directly or through a chain).`);if(pe){if(r._d){s=!0;try{r._d=!1,r._v=e()}finally{s=!1}}return r._v}if(Q(r),r._d){let u=r._v;s=!0;try{x(()=>{r._d=!1,r._v=e()},o)}finally{s=!1}i&&u!==r._v&&i.emit("computed:update",{signal:r,oldValue:u,newValue:r._v})}return r._v}return n&&(a.__name=n,r.__name=n),a.__signal=r,i&&i.emit("computed:create",{signal:r,name:n,getter:a}),a}function io(e,t){if(L(typeof e=="function","watch: first argument must be a getter function."),L(typeof t=="function","watch: second argument must be a callback function."),Z())return()=>{};let n,r=!0;return x(()=>{let s=e();if(r){n=s,r=!1;return}Object.is(s,n)||(t(s,n),n=s)})}function so(e){L(e!==null&&typeof e=="object"&&!Array.isArray(e),"store: argument must be a plain object. For arrays, use array() instead.");let t={};Object.keys(e).forEach(u=>{let[l,d]=w(e[u]);t[u]=[l,d]});let n=new Proxy({},{get(u,l){if(l in t){let d=t[l][0];return d()}},set(){throw new Error("[Sibu] store: Direct mutation is not allowed. Use actions.setState() to update store properties.")}}),r=()=>{let u={};return Object.keys(t).forEach(l=>{u[l]=t[l][0]()}),u};return[n,{setState:u=>{let l=r(),d=typeof u=="function"?u(l):u;Object.entries(d).forEach(([f,m])=>{f in t&&t[f][1](m)})},reset:()=>{Object.keys(e).forEach(u=>{let l=t[u][1];l(e[u])})},subscribe:u=>{let l=!0;return P(()=>{let d=r();if(l){l=!1;return}u(d)})},subscribeKey:(u,l)=>{let d,f=!0;return P(()=>{let m=t[u][0]();if(f){d=m,f=!1;return}if(!Object.is(m,d)){let p=d;d=m,l(m,p)}})},getSnapshot:r}]}function ao(e){let[t,n]=w(e);return{get current(){return t()},set current(r){n(r)}}}function co(e=[]){let[t,n]=w([...e]);return[t,{push(...o){n(i=>[...i,...o])},pop(){let o;return n(i=>{let s=[...i];return o=s.pop(),s}),o},shift(){let o;return n(i=>{let s=[...i];return o=s.shift(),s}),o},unshift(...o){n(i=>[...o,...i])},splice(o,i=0,...s){let a=[];return n(u=>{let l=[...u];return a=l.splice(o,i,...s),l}),a},remove(o){n(i=>i.filter((s,a)=>a!==o))},removeWhere(o){n(i=>{let s=i.findIndex(o);return s===-1?i:i.filter((a,u)=>u!==s)})},set(o){n([...o])},update(o,i){n(s=>s.map((a,u)=>u===o?i:a))},updateWhere(o,i){n(s=>s.map(a=>o(a)?i(a):a))},sort(o){n(i=>[...i].sort(o))},reverse(){n(o=>[...o].reverse())},filter(o){n(i=>i.filter(o))},map(o){n(i=>i.map(o))},clear(){n([])}}]}function lo(e=[]){let t=[...e],n=null,r={};function o(){n=null,Y(r)||fe(r)}function i(){return Q(r),n===null&&(n=Object.freeze([...t])),n}return[i,{push(...a){a.length!==0&&(t.push(...a),o())},pop(){if(t.length===0)return;let a=t.pop();return o(),a},shift(){if(t.length===0)return;let a=t.shift();return o(),a},unshift(...a){a.length!==0&&(t.unshift(...a),o())},splice(a,u=0,...l){let d=t.splice(a,u,...l);return(d.length>0||l.length>0)&&o(),d},remove(a){a<0||a>=t.length||(t.splice(a,1),o())},removeWhere(a){let u=t.findIndex(a);u!==-1&&(t.splice(u,1),o())},set(a){t=[...a],o()},update(a,u){a<0||a>=t.length||Object.is(t[a],u)||(t[a]=u,o())},updateWhere(a,u){let l=!1;for(let d=0;d<t.length;d++)if(a(t[d])){let f=u(t[d]);Object.is(t[d],f)||(t[d]=f,l=!0)}l&&o()},sort(a){t.length<=1||(t.sort(a),o())},reverse(){t.length<=1||(t.reverse(),o())},filter(a){let u=t.filter(a);u.length!==t.length&&(t=u,o())},map(a){let u=!1;for(let l=0;l<t.length;l++){let d=a(t[l],l);Object.is(t[l],d)||(t[l]=d,u=!0)}u&&o()},clear(){t.length!==0&&(t=[],o())}}]}function ee(e,t,n){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!="object")return!1;let r=e,o=t;if(r.constructor!==o.constructor)return!1;if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp){let u=t;return e.source===u.source&&e.flags===u.flags}n||(n=new Map);let i=n.get(r);if(i?.has(o))return!0;if(i||(i=new Set,n.set(r,i)),i.add(o),e instanceof Map){let u=t;if(e.size!==u.size)return!1;for(let[l,d]of e)if(!u.has(l)||!ee(d,u.get(l),n))return!1;return!0}if(e instanceof Set){let u=t;if(e.size!==u.size)return!1;for(let l of e)if(!u.has(l))return!1;return!0}if(e instanceof ArrayBuffer){let u=new Uint8Array(e),l=new Uint8Array(t);if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++)if(u[d]!==l[d])return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){let u=e,l=t;if(u.length!==l.length)return!1;for(let d=0;d<u.length;d++)if(u[d]!==l[d])return!1;return!0}if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:e.every((u,l)=>ee(u,t[l],n));let s=Object.keys(r),a=Object.keys(o);return s.length!==a.length?!1:s.every(u=>ee(r[u],o[u],n))}function uo(e){return w(e,{equals:(t,n)=>ee(t,n)})}function po(e,t,n){return[we(e,n),i=>{ke(()=>t(i))}]}function fo(e,t){let[n,r]=w(t),[o,i]=w(!1),[s,a]=w(null),[u,l]=w(0),d=0;return P(()=>{u();let f=++d;i(!0),a(null);let m;try{m=e()}catch(p){a(p),i(!1);return}m.then(p=>{f===d&&(r(p),i(!1))},p=>{f===d&&(a(p),i(!1))})}),{value:n,loading:o,error:s,refresh:()=>l(f=>f+1)}}function Se(e,t){try{return e()}catch(n){M(`${t}: callback threw: ${n instanceof Error?n.message:String(n)}`);return}}function je(e,t,n){let r=Se(e,t);typeof r=="function"&&n&&E(n,r)}function $e(e,t){if(!(typeof document>"u"))if(t){if(t.isConnected){queueMicrotask(()=>je(e,"onMount",t));return}let n=new MutationObserver(()=>{t.isConnected&&(n.disconnect(),je(e,"onMount",t))});E(t,()=>n.disconnect()),queueMicrotask(()=>{t.isConnected?je(e,"onMount",t):n.observe(document.body,{childList:!0,subtree:!0})})}else queueMicrotask(()=>{Se(e,"onMount")})}function mo(e,t){E(t,()=>Se(e,"onUnmount"));let n=()=>{let r=new MutationObserver(()=>{t.isConnected||(r.disconnect(),Se(e,"onUnmount"))});r.observe(document.body,{childList:!0,subtree:!0}),E(t,()=>r.disconnect())};t.isConnected?n():$e(()=>{n()},t)}function bo(e,t){E(t,e)}function go(e){let[t,n]=w(e);return{provide(r){n(r)},use(){return t},get(){return t()},set(r){n(r)}}}function ho(e){let t=e();return _()&&queueMicrotask(()=>{try{e()}catch(n){console.warn("[Sibu strict] second run threw:",n)}}),t}function yo(e){if(!_())return P(e);let t=P(e),n=null;return queueMicrotask(()=>{try{n=P(e)}catch(r){console.warn("[Sibu strictEffect] second run threw:",r)}}),()=>{t(),n&&n()}}function xo(){return new Promise(e=>{queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(()=>e()):e()})})}function To(e){let[t,n]=w(e()),r=!1,o=t(),i=()=>{r=!1,n(o)},s=()=>{r||(r=!0,queueMicrotask(()=>{typeof requestAnimationFrame=="function"?requestAnimationFrame(i):i()}))};return x(()=>{o=e(),s()}),t}var vo=16;function ei(e){let t=globalThis;if(typeof t.requestIdleCallback=="function"){t.requestIdleCallback(e,{timeout:vo*4});return}if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>e());return}setTimeout(e,vo)}function ko(){let[e,t]=w(!1);function n(r){t(!0),ei(()=>{let o;try{o=r()}catch{t(!1);return}o&&typeof o.then=="function"?o.then(()=>t(!1),()=>t(!1)):t(!1)})}return{pending:e,start:n}}function qe(e){let t=null;return function(){if(t)return t();let r=h({class:"sibu-lazy"}),o=!1;e().then(s=>{if(o)return;t=s.default;let a=t();r.replaceChildren(a)}).catch(s=>{if(o)return;let a=s instanceof Error?s:new Error(String(s));r.replaceChildren(h("sibu-lazy-error",`Failed to load component: ${a.message}`))}),r.appendChild(S("sibu-lazy-loading","Loading..."));let i=r.remove.bind(r);return r.remove=()=>{o=!0,i()},r}}function Ke({nodes:e,fallback:t}){let n=h({class:"sibu-suspense"}),r=t();return n.appendChild(r),queueMicrotask(()=>{try{let o=e();if(o.classList.contains("sibu-lazy")){let i=new MutationObserver(()=>{o.querySelector(".sibu-lazy-loading")||(i.disconnect(),n.replaceChildren(o))});i.observe(o,{childList:!0,subtree:!0}),o.querySelector(".sibu-lazy-loading")||n.replaceChildren(o)}else n.replaceChildren(o)}catch{}}),n}var ti=_(),ni=`
|
|
3
3
|
.sibu-error-display {
|
|
4
4
|
border: 1px solid var(--sibu-err-border, #e5484d);
|
|
5
5
|
border-radius: 10px;
|
|
@@ -179,11 +179,11 @@
|
|
|
179
179
|
border: 1px solid #3a3a4e;
|
|
180
180
|
}
|
|
181
181
|
.sibu-error-display .sibu-err-btn-reload:hover { background: #2a2b40; }
|
|
182
|
-
`,
|
|
183
|
-
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function
|
|
182
|
+
`,Eo=!1;function ri(){if(Eo||typeof document>"u")return;let e=z({nodes:ni});document.head.appendChild(e),Eo=!0}function oi(e){let t=[],n=e.split(`
|
|
183
|
+
`);for(let r of n){let o=r.trim(),i=o.match(/^at\s+(?:(.+?)\s+\((.+)\)|(.+))$/);if(i){t.push({fn:i[1]||"(anonymous)",loc:i[2]||i[3]||""});continue}let s=o.match(/^(.+?)@(.+)$/);s&&t.push({fn:s[1]||"(anonymous)",loc:s[2]||""})}return t}function wo(e){if(e instanceof Error){let t=e.code??e.name??"ERROR",n=e.message||"Unknown error",r=e.stack??"",o=oi(r),i=e.cause,s=i!=null?wo(i):null;return{code:t,message:n,stack:r,frames:o,cause:s}}return{code:"NON_ERROR",message:typeof e=="string"?e:JSON.stringify(e),stack:"",frames:[],cause:null}}function ii(e,t){let n=[];if(n.push(`[${e.code}] ${e.message}`),e.stack&&(n.push(""),n.push(e.stack)),e.cause&&(n.push(""),n.push("Caused by:"),n.push(` [${e.cause.code}] ${e.cause.message}`),e.cause.stack)){let r=e.cause.stack.split(`
|
|
184
184
|
`).map(o=>` ${o}`).join(`
|
|
185
185
|
`);n.push(r)}if(t&&Object.keys(t).length>0){n.push(""),n.push("Metadata:");for(let[r,o]of Object.entries(t))n.push(` ${r}: ${String(o)}`)}return n.push(""),n.push(`At: ${new Date().toISOString()}`),typeof navigator<"u"&&navigator.userAgent&&n.push(`UA: ${navigator.userAgent}`),n.join(`
|
|
186
|
-
`)}function
|
|
186
|
+
`)}function So(e){let t=e.map((n,r)=>h({class:"sibu-err-frame",nodes:[S({class:"sibu-err-line",nodes:String(r+1)}),S({class:"sibu-err-fn",nodes:n.fn}),S({class:"sibu-err-loc",nodes:` \u2014 ${n.loc}`})]}));return ve({class:"sibu-err-stack",nodes:t})}function Co(e){return e?[h({class:"sibu-err-cause-label",nodes:"Caused by"}),h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:`[${e.code}] ${e.message}`}),S({nodes:""})]}),e.frames.length>0?So(e.frames):h({class:"sibu-err-stack",nodes:"(no stack)"})]}),...Co(e.cause)]:[]}function si(e){let t=[];for(let[r,o]of Object.entries(e)){t.push(document.createElement("dt")),t[t.length-1].textContent=r;let i=document.createElement("dd");i.textContent=o==null?"(null)":String(o),t.push(i)}let n=document.createElement("dl");n.className="sibu-err-meta";for(let r of t)n.appendChild(r);return n}function Ce(e){ri();let t=e.severity??"error",n=wo(e.error),r=e.alwaysShowDetails??ti,o=e.title??n.message,i=new Date().toISOString().replace("T"," ").slice(0,19),[s,a]=w("Copy"),u=X({class:"sibu-err-copy-btn",nodes:()=>s(),on:{click:()=>{let p=ii(n,e.metadata);typeof navigator<"u"&&navigator.clipboard&&navigator.clipboard.writeText(p).then(()=>{a("Copied!"),setTimeout(()=>a("Copy"),1500)},()=>{a("Copy failed"),setTimeout(()=>a("Copy"),1500)})}}}),l=h({class:"sibu-err-header",nodes:[Te({class:"sibu-err-icon",nodes:n.code}),xe({class:"sibu-err-title",nodes:o}),S({class:"sibu-err-timestamp",nodes:i})]}),d=[ye({class:"sibu-err-message",nodes:n.message})];r&&n.frames.length>0?d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Stack Trace"}),u]}),So(n.frames)]})):r&&d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Details"}),u]}),h({class:"sibu-err-stack",nodes:"(no stack available)"})]})),r&&d.push(...Co(n.cause)),r&&e.metadata&&Object.keys(e.metadata).length>0&&d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Metadata"})]}),si(e.metadata)]})),r&&typeof navigator<"u"&&navigator.userAgent&&d.push(h({class:"sibu-err-section",nodes:[h({class:"sibu-err-section-head",nodes:[S({nodes:"Environment"})]}),h({class:"sibu-err-meta",nodes:(()=>{let p=document.createElement("dl");p.className="sibu-err-meta";let b=[["User Agent",navigator.userAgent],["URL",typeof location<"u"?location.href:"(n/a)"],["Timestamp",new Date().toISOString()]];for(let[T,v]of b){let y=document.createElement("dt");y.textContent=T;let D=document.createElement("dd");D.textContent=v,p.appendChild(y),p.appendChild(D)}return p})()})]}));let f=[];e.onRetry&&f.push(X({class:"sibu-err-btn sibu-err-btn-retry",nodes:e.retryLabel??"Retry",on:{click:e.onRetry}})),!e.hideReload&&typeof location<"u"&&f.push(X({class:"sibu-err-btn sibu-err-btn-reload",nodes:"Reload Page",on:{click:()=>location.reload()}})),f.length>0&&d.push(h({class:"sibu-err-actions",nodes:f}));let m=h({class:"sibu-err-body",nodes:d});return h({class:"sibu-error-display","data-severity":t,nodes:[l,m]})}var ai=`
|
|
187
187
|
.sibu-error-boundary {
|
|
188
188
|
position: relative;
|
|
189
189
|
}
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
.sibu-error-fallback .sibu-error-btn-reload:hover {
|
|
338
338
|
background: #3a3a4e;
|
|
339
339
|
}
|
|
340
|
-
`,
|
|
340
|
+
`,Ao=!1;function ci(){if(!Ao&&typeof document<"u"){let e=z({nodes:ai});document.head.appendChild(e),Ao=!0}}var Ue=new WeakMap;function li(e,t,n){let r=Ue.get(e);r||(r=new Map,Ue.set(e,r));let o=t.message;return r.has(o)||r.set(o,e(t,n)),r.get(o)}function _o({nodes:e,fallback:t,onError:n,resetKeys:r}){ci();let[o,i]=w(null),s=()=>{t&&Ue.delete(t),i(null)};if(r&&r.length>0){let f=!1;P(()=>{for(let m of r)try{m()}catch{}if(!f){f=!0;return}o()!==null&&s()})}let a=f=>{let m=f instanceof Error?f:new Error(String(f));return i(m),n?.(m),m},u=(f,m)=>Ce({error:f,severity:"error",onRetry:m}),l=f=>{let m=t||u;try{return li(m,f,s)}catch(p){let b=p instanceof Error?p:new Error(String(p));return queueMicrotask(()=>{d.parentNode&&d.dispatchEvent(new CustomEvent("sibu:error-propagate",{bubbles:!0,detail:{error:b}}))}),document.createComment("error-boundary-failed")}},d=h({class:"sibu-error-boundary",nodes:()=>{let f=o();if(f)return l(f);try{let m=e();if(m&&typeof m.then=="function"){let p=h({class:"sibu-error-async"});return p.appendChild(S({class:"sibu-lazy-loading",nodes:"Loading..."})),m.then(b=>{p.replaceChildren(b)}).catch(b=>{let T=a(b);p.replaceChildren(l(T))}),p}return m}catch(m){let p=a(m);return l(p)}}});return d.addEventListener("sibu:error-propagate",f=>{if(o())return;f.stopPropagation();let p=f.detail?.error;p&&a(p)}),d}var ui=`
|
|
341
341
|
@keyframes sibu-spin {
|
|
342
342
|
to { transform: rotate(360deg); }
|
|
343
343
|
}
|
|
@@ -390,4 +390,4 @@
|
|
|
390
390
|
.sibu-loading-lg .sibu-loading-spinner { width: 40px; height: 40px; border-width: 4px; }
|
|
391
391
|
.sibu-loading-lg .sibu-loading-dot { width: 12px; height: 12px; }
|
|
392
392
|
.sibu-loading-lg .sibu-loading-dots { gap: 6px; }
|
|
393
|
-
`,
|
|
393
|
+
`,No=!1;function di(){!No&&typeof document<"u"&&(document.head.appendChild(z({nodes:ui})),No=!0)}function Lo(e={}){di();let{text:t,variant:n="spinner",size:r="md"}=e,o=r!=="md"?` sibu-loading-${r}`:"";return n==="dots"?h({class:`sibu-loading${o}`,nodes:[h({class:"sibu-loading-dots",nodes:[S({class:"sibu-loading-dot"}),S({class:"sibu-loading-dot"}),S({class:"sibu-loading-dot"})]}),t?S({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)}):h({class:`sibu-loading${o}`,nodes:[h({class:"sibu-loading-spinner"}),t?S({class:"sibu-loading-text",nodes:t}):null].filter(Boolean)})}typeof window<"u"&&(window.Sibu=Ve);return Bo(pi);})();
|