@jasonshimmy/custom-elements-runtime 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/custom-elements-runtime.cjs.js +4 -4
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +114 -113
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +4 -4
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ function te(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class U extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +44,7 @@ class K extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return U.instance || (U.instance = new U()), U.instance;
|
|
48
48
|
}
|
|
49
49
|
// Enhanced emit method with better typing and event storm protection
|
|
50
50
|
/**
|
|
@@ -160,8 +160,8 @@ class K extends EventTarget {
|
|
|
160
160
|
this.eventCounters.clear();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const Z =
|
|
164
|
-
function
|
|
163
|
+
const Z = U.getInstance(), bt = (e, t) => Z.emit(e, t), vt = (e, t) => Z.on(e, t), wt = (e, t) => Z.off(e, t), xt = (e, t) => Z.once(e, t), kt = (e, t, r) => Z.listen(e, t, r);
|
|
164
|
+
function we(e) {
|
|
165
165
|
let t = { ...e };
|
|
166
166
|
const r = [];
|
|
167
167
|
function o(a) {
|
|
@@ -272,7 +272,7 @@ function q(e, t) {
|
|
|
272
272
|
function I(e, t) {
|
|
273
273
|
return typeof t == "string" ? t.split(".").reduce((r, o) => r?.[o], e) : t;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function xe(e, t, r) {
|
|
276
276
|
const o = t.split("."), n = o.pop();
|
|
277
277
|
if (!n) return;
|
|
278
278
|
const s = o.reduce((i, a) => (a in i || (i[a] = {}), i[a]), e);
|
|
@@ -285,8 +285,8 @@ function qe(e, t, r, o, n, s, i) {
|
|
|
285
285
|
return I(h, e);
|
|
286
286
|
}, y = p();
|
|
287
287
|
let c = "text";
|
|
288
|
-
const
|
|
289
|
-
if (i instanceof HTMLInputElement ? c =
|
|
288
|
+
const x = o?.type;
|
|
289
|
+
if (i instanceof HTMLInputElement ? c = x || i.type || "text" : i instanceof HTMLSelectElement ? c = "select" : i instanceof HTMLTextAreaElement && (c = "textarea"), c === "checkbox")
|
|
290
290
|
if (Array.isArray(y)) {
|
|
291
291
|
const h = i?.getAttribute("value") || o?.value || "", u = y.includes(h);
|
|
292
292
|
i && i.checked !== u && (r.checked = u);
|
|
@@ -314,7 +314,7 @@ function qe(e, t, r, o, n, s, i) {
|
|
|
314
314
|
const h = String(y ?? "");
|
|
315
315
|
(!i || i.value !== h) && (r.value = y);
|
|
316
316
|
}
|
|
317
|
-
const
|
|
317
|
+
const w = a || c === "checkbox" || c === "radio" || c === "select" ? "change" : "input", k = (h) => {
|
|
318
318
|
if (h.isComposing || n._isComposing || h.isTrusted === !1) return;
|
|
319
319
|
const u = h.target;
|
|
320
320
|
if (u._modelUpdating) return;
|
|
@@ -348,12 +348,12 @@ function qe(e, t, r, o, n, s, i) {
|
|
|
348
348
|
const d = s._state || s, v = I(d, e);
|
|
349
349
|
if (Array.isArray(b) && Array.isArray(v) ? JSON.stringify([...b].sort()) !== JSON.stringify([...v].sort()) : b !== v) {
|
|
350
350
|
const $ = h.target;
|
|
351
|
-
$._modelUpdating = !0,
|
|
351
|
+
$._modelUpdating = !0, xe(d, e, b), setTimeout(() => {
|
|
352
352
|
$._modelUpdating = !1;
|
|
353
353
|
}, 0), s._requestRender && s._requestRender();
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
if (n[
|
|
356
|
+
if (n[w] = k, c === "text" || c === "textarea") {
|
|
357
357
|
const h = () => {
|
|
358
358
|
n._isComposing = !0;
|
|
359
359
|
}, u = (g) => {
|
|
@@ -369,7 +369,7 @@ function qe(e, t, r, o, n, s, i) {
|
|
|
369
369
|
const v = s._state || s, m = I(v, e);
|
|
370
370
|
(Array.isArray(d) && Array.isArray(m) ? JSON.stringify([...d].sort()) !== JSON.stringify([...m].sort()) : d !== m) && (b && (b._modelUpdating = !0, setTimeout(() => {
|
|
371
371
|
b._modelUpdating = !1;
|
|
372
|
-
}, 0)),
|
|
372
|
+
}, 0)), xe(v, e, d), s._requestRender && s._requestRender());
|
|
373
373
|
}
|
|
374
374
|
}, 0);
|
|
375
375
|
};
|
|
@@ -417,7 +417,7 @@ function Fe(e, t, r) {
|
|
|
417
417
|
const s = t.class || "", i = s ? `${s} ${n.join(" ")}`.trim() : n.join(" ");
|
|
418
418
|
i && (t.class = i);
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Ue(e, t, r) {
|
|
421
421
|
let o;
|
|
422
422
|
if (typeof e == "string") {
|
|
423
423
|
if (!r) return;
|
|
@@ -494,7 +494,7 @@ function Te(e, t, r, o) {
|
|
|
494
494
|
Fe(f, s, t);
|
|
495
495
|
break;
|
|
496
496
|
case "style":
|
|
497
|
-
|
|
497
|
+
Ue(f, s, t);
|
|
498
498
|
break;
|
|
499
499
|
}
|
|
500
500
|
}
|
|
@@ -522,7 +522,7 @@ function ge(e, t) {
|
|
|
522
522
|
let o = r.props?.key ?? r.key ?? t, n = r.children;
|
|
523
523
|
return Array.isArray(n) && (n = ge(n, o)), { ...r, key: o, children: n };
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function Ke(e, t, r, o) {
|
|
526
526
|
const n = r.directives ?? {}, s = Te(
|
|
527
527
|
n,
|
|
528
528
|
o,
|
|
@@ -538,25 +538,25 @@ function Ue(e, t, r, o) {
|
|
|
538
538
|
...s.attrs
|
|
539
539
|
}, l = t.props ?? {}, f = i;
|
|
540
540
|
for (const c in { ...l, ...f }) {
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
541
|
+
const x = l[c], w = f[c];
|
|
542
|
+
if (x !== w)
|
|
543
543
|
if (c === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
544
|
-
e.value !==
|
|
544
|
+
e.value !== w && (e.value = w ?? "");
|
|
545
545
|
else if (c === "checked" && e instanceof HTMLInputElement)
|
|
546
|
-
e.checked = !!
|
|
547
|
-
else if (c.startsWith("on") && typeof
|
|
546
|
+
e.checked = !!w;
|
|
547
|
+
else if (c.startsWith("on") && typeof w == "function") {
|
|
548
548
|
const k = Ae(c);
|
|
549
|
-
typeof
|
|
550
|
-
} else
|
|
549
|
+
typeof x == "function" && e.removeEventListener(k, x), e.addEventListener(k, w);
|
|
550
|
+
} else w == null || w === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(w));
|
|
551
551
|
}
|
|
552
|
-
for (const [c,
|
|
552
|
+
for (const [c, x] of Object.entries(
|
|
553
553
|
s.listeners || {}
|
|
554
554
|
))
|
|
555
|
-
e.addEventListener(c,
|
|
555
|
+
e.addEventListener(c, x);
|
|
556
556
|
const p = t.attrs ?? {}, y = a;
|
|
557
557
|
for (const c in { ...p, ...y }) {
|
|
558
|
-
const
|
|
559
|
-
|
|
558
|
+
const x = p[c], w = y[c];
|
|
559
|
+
x !== w && (w == null || w === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(w)));
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
562
|
function P(e, t, r) {
|
|
@@ -569,15 +569,15 @@ function P(e, t, r) {
|
|
|
569
569
|
return e.key != null && (y.key = e.key), y;
|
|
570
570
|
}
|
|
571
571
|
if (e.tag === "#anchor") {
|
|
572
|
-
const y = e, c = Array.isArray(y.children) ? y.children : [],
|
|
573
|
-
y.key != null && (
|
|
572
|
+
const y = e, c = Array.isArray(y.children) ? y.children : [], x = document.createTextNode(""), w = document.createTextNode("");
|
|
573
|
+
y.key != null && (x.key = `${y.key}:start`, w.key = `${y.key}:end`), y._startNode = x, y._endNode = w;
|
|
574
574
|
const k = document.createDocumentFragment();
|
|
575
|
-
k.appendChild(
|
|
575
|
+
k.appendChild(x);
|
|
576
576
|
for (const h of c) {
|
|
577
577
|
const u = P(h, t);
|
|
578
578
|
k.appendChild(u);
|
|
579
579
|
}
|
|
580
|
-
return k.appendChild(
|
|
580
|
+
return k.appendChild(w), k;
|
|
581
581
|
}
|
|
582
582
|
const o = document.createElement(e.tag);
|
|
583
583
|
e.key != null && (o.key = e.key);
|
|
@@ -632,24 +632,24 @@ function Ve(e, t, r, o, n) {
|
|
|
632
632
|
}
|
|
633
633
|
if (!Array.isArray(r)) return;
|
|
634
634
|
const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
635
|
-
for (const
|
|
636
|
-
|
|
635
|
+
for (const x of i)
|
|
636
|
+
x && x.key != null && a.set(x.key, x);
|
|
637
637
|
const l = /* @__PURE__ */ new Map();
|
|
638
|
-
for (const
|
|
639
|
-
const
|
|
640
|
-
|
|
638
|
+
for (const x of s) {
|
|
639
|
+
const w = x.key;
|
|
640
|
+
w != null && l.set(w, x);
|
|
641
641
|
}
|
|
642
642
|
const f = /* @__PURE__ */ new Set();
|
|
643
643
|
let p = e.firstChild;
|
|
644
|
-
function y(
|
|
645
|
-
let k =
|
|
646
|
-
for (; k && (f.add(k), k !==
|
|
644
|
+
function y(x, w) {
|
|
645
|
+
let k = x;
|
|
646
|
+
for (; k && (f.add(k), k !== w); )
|
|
647
647
|
k = k.nextSibling;
|
|
648
648
|
}
|
|
649
|
-
function c(
|
|
649
|
+
function c(x, w, k, h) {
|
|
650
650
|
const u = [];
|
|
651
|
-
let g =
|
|
652
|
-
for (; g && g !==
|
|
651
|
+
let g = x.nextSibling;
|
|
652
|
+
for (; g && g !== w; )
|
|
653
653
|
u.push(g), g = g.nextSibling;
|
|
654
654
|
const b = Array.isArray(k) ? k : [];
|
|
655
655
|
if (h.some((v) => v && v.key != null) || b.some((v) => v && v.key != null)) {
|
|
@@ -661,7 +661,7 @@ function Ve(e, t, r, o, n) {
|
|
|
661
661
|
E != null && m.set(E, C);
|
|
662
662
|
}
|
|
663
663
|
const $ = /* @__PURE__ */ new Set();
|
|
664
|
-
let _ =
|
|
664
|
+
let _ = x.nextSibling;
|
|
665
665
|
for (const C of h) {
|
|
666
666
|
let E;
|
|
667
667
|
if (C.key != null && m.has(C.key)) {
|
|
@@ -688,18 +688,18 @@ function Ve(e, t, r, o, n) {
|
|
|
688
688
|
C !== u[m] && (e.insertBefore(C, u[m]), e.removeChild(u[m]));
|
|
689
689
|
}
|
|
690
690
|
for (let m = v; m < h.length; m++)
|
|
691
|
-
e.insertBefore(P(h[m], o),
|
|
691
|
+
e.insertBefore(P(h[m], o), w);
|
|
692
692
|
for (let m = v; m < u.length; m++)
|
|
693
693
|
e.removeChild(u[m]);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
for (const
|
|
697
|
-
let
|
|
698
|
-
if (
|
|
699
|
-
const k =
|
|
696
|
+
for (const x of r) {
|
|
697
|
+
let w;
|
|
698
|
+
if (x.tag === "#anchor") {
|
|
699
|
+
const k = x.key, h = `${k}:start`, u = `${k}:end`;
|
|
700
700
|
let g = l.get(h), b = l.get(u);
|
|
701
|
-
const d = Array.isArray(
|
|
702
|
-
if (g || (g = document.createTextNode(""), g.key = h), b || (b = document.createTextNode(""), b.key = u),
|
|
701
|
+
const d = Array.isArray(x.children) ? x.children : [];
|
|
702
|
+
if (g || (g = document.createTextNode(""), g.key = h), b || (b = document.createTextNode(""), b.key = u), x._startNode = g, x._endNode = b, !e.contains(g) || !e.contains(b)) {
|
|
703
703
|
e.insertBefore(g, p);
|
|
704
704
|
for (const v of d)
|
|
705
705
|
e.insertBefore(P(v, o), p);
|
|
@@ -714,21 +714,21 @@ function Ve(e, t, r, o, n) {
|
|
|
714
714
|
y(g, b), p = b.nextSibling;
|
|
715
715
|
continue;
|
|
716
716
|
}
|
|
717
|
-
if (
|
|
718
|
-
const k = a.get(
|
|
719
|
-
|
|
720
|
-
l.get(
|
|
717
|
+
if (x.key != null && l.has(x.key)) {
|
|
718
|
+
const k = a.get(x.key);
|
|
719
|
+
w = X(
|
|
720
|
+
l.get(x.key),
|
|
721
721
|
k,
|
|
722
|
-
|
|
722
|
+
x,
|
|
723
723
|
o,
|
|
724
724
|
n
|
|
725
|
-
), f.add(
|
|
725
|
+
), f.add(w), w !== p && e.contains(w) && (p && !e.contains(p) && (p = null), e.insertBefore(w, p));
|
|
726
726
|
} else
|
|
727
|
-
|
|
728
|
-
p =
|
|
727
|
+
w = P(x, o, n), p && !e.contains(p) && (p = null), e.insertBefore(w, p), f.add(w);
|
|
728
|
+
p = w.nextSibling;
|
|
729
729
|
}
|
|
730
|
-
for (const
|
|
731
|
-
!f.has(
|
|
730
|
+
for (const x of s)
|
|
731
|
+
!f.has(x) && e.contains(x) && (q(x, n), e.removeChild(x));
|
|
732
732
|
}
|
|
733
733
|
function X(e, t, r, o, n) {
|
|
734
734
|
if (t && typeof t != "string" && t.props?.ref && n && q(e, n), t === r) return e;
|
|
@@ -772,7 +772,7 @@ function X(e, t, r, o, n) {
|
|
|
772
772
|
}
|
|
773
773
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
774
774
|
const i = e;
|
|
775
|
-
return
|
|
775
|
+
return Ke(i, t.props || {}, r.props || {}, o), Ve(i, t.children, r.children, o, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = i), i;
|
|
776
776
|
}
|
|
777
777
|
q(e, n);
|
|
778
778
|
const s = P(r, o, n);
|
|
@@ -1004,7 +1004,9 @@ const Ye = je`
|
|
|
1004
1004
|
900: "var(--color-rose-900, #881337)"
|
|
1005
1005
|
},
|
|
1006
1006
|
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
1007
|
-
black: { DEFAULT: "var(--color-black, #000000)" }
|
|
1007
|
+
black: { DEFAULT: "var(--color-black, #000000)" },
|
|
1008
|
+
transparent: { DEFAULT: "var(--color-transparent, transparent)" },
|
|
1009
|
+
current: { DEFAULT: "var(--color-current, currentColor)" }
|
|
1008
1010
|
}, se = {
|
|
1009
1011
|
/* Display */
|
|
1010
1012
|
block: "display:block;",
|
|
@@ -1109,12 +1111,6 @@ const Ye = je`
|
|
|
1109
1111
|
"rounded-md": "border-radius:0.375rem;",
|
|
1110
1112
|
"rounded-lg": "border-radius:0.5rem;",
|
|
1111
1113
|
"rounded-full": "border-radius:9999px;",
|
|
1112
|
-
/* Ring (box-shadow for focus) */
|
|
1113
|
-
"ring-0": "box-shadow:none;",
|
|
1114
|
-
"ring-1": "box-shadow:0 0 0 1px rgba(59,130,246,0.5);",
|
|
1115
|
-
"ring-2": "box-shadow:0 0 0 2px rgba(59,130,246,0.5);",
|
|
1116
|
-
"ring-4": "box-shadow:0 0 0 4px rgba(59,130,246,0.5);",
|
|
1117
|
-
"ring-8": "box-shadow:0 0 0 8px rgba(59,130,246,0.5);",
|
|
1118
1114
|
/* Shadow and effects */
|
|
1119
1115
|
"shadow-none": "box-shadow:0 0 #0000;",
|
|
1120
1116
|
"shadow-xs": "box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);",
|
|
@@ -1123,8 +1119,6 @@ const Ye = je`
|
|
|
1123
1119
|
"shadow-lg": "box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);",
|
|
1124
1120
|
"shadow-xl": "box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);",
|
|
1125
1121
|
"shadow-2xl": "box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",
|
|
1126
|
-
/* Transitions */
|
|
1127
|
-
transition: "transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",
|
|
1128
1122
|
/* Text Overflow & Whitespace */
|
|
1129
1123
|
truncate: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",
|
|
1130
1124
|
/* Visibility */
|
|
@@ -1175,10 +1169,14 @@ const Ye = je`
|
|
|
1175
1169
|
"line-clamp-2": "display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1176
1170
|
"line-clamp-3": "display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1177
1171
|
"line-clamp-4": "display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",
|
|
1178
|
-
/*
|
|
1172
|
+
/* Transitions */
|
|
1173
|
+
transition: "transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;",
|
|
1174
|
+
"transition-all": "transition-property:all;",
|
|
1179
1175
|
"transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
|
|
1176
|
+
"transition-shadow": "transition-property:box-shadow;",
|
|
1180
1177
|
"transition-opacity": "transition-property:opacity;",
|
|
1181
1178
|
"transition-transform": "transition-property:transform;",
|
|
1179
|
+
"transition-none": "transition-property:none;",
|
|
1182
1180
|
/* Z-index */
|
|
1183
1181
|
"z-0": "z-index:0;",
|
|
1184
1182
|
"z-10": "z-index:10;",
|
|
@@ -1346,6 +1344,7 @@ function G(e) {
|
|
|
1346
1344
|
const s = {
|
|
1347
1345
|
bg: "background-color",
|
|
1348
1346
|
text: "color",
|
|
1347
|
+
shadow: "box-shadow",
|
|
1349
1348
|
p: "padding",
|
|
1350
1349
|
px: "padding-inline",
|
|
1351
1350
|
py: "padding-block",
|
|
@@ -1364,7 +1363,9 @@ function G(e) {
|
|
|
1364
1363
|
"border-r": "border-right",
|
|
1365
1364
|
"border-x": "border-inline",
|
|
1366
1365
|
"border-y": "border-block",
|
|
1367
|
-
|
|
1366
|
+
transition: "transition-property",
|
|
1367
|
+
ease: "transition-timing-function",
|
|
1368
|
+
delay: "transition-delay",
|
|
1368
1369
|
duration: "transition-duration",
|
|
1369
1370
|
list: "list-style",
|
|
1370
1371
|
break: "word-break",
|
|
@@ -1378,7 +1379,6 @@ function G(e) {
|
|
|
1378
1379
|
basis: "flex-basis",
|
|
1379
1380
|
tracking: "letter-spacing",
|
|
1380
1381
|
scroll: "scroll-behavior",
|
|
1381
|
-
delay: "transition-delay",
|
|
1382
1382
|
weight: "font-weight",
|
|
1383
1383
|
leading: "line-height",
|
|
1384
1384
|
z: "z-index"
|
|
@@ -1422,7 +1422,7 @@ function st(e) {
|
|
|
1422
1422
|
function p(h, u = !1) {
|
|
1423
1423
|
const g = (u ? "dark|" : "") + h;
|
|
1424
1424
|
if (g in f) return f[g];
|
|
1425
|
-
const b =
|
|
1425
|
+
const b = w(h, u);
|
|
1426
1426
|
return f[g] = b, b;
|
|
1427
1427
|
}
|
|
1428
1428
|
function y(h) {
|
|
@@ -1438,7 +1438,7 @@ function st(e) {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
return g && u.push(g), u;
|
|
1440
1440
|
}
|
|
1441
|
-
function
|
|
1441
|
+
function x(h) {
|
|
1442
1442
|
switch (h) {
|
|
1443
1443
|
case "hover":
|
|
1444
1444
|
return ":hover";
|
|
@@ -1468,10 +1468,11 @@ function st(e) {
|
|
|
1468
1468
|
return null;
|
|
1469
1469
|
}
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1471
|
+
function w(h, u = !1) {
|
|
1472
1472
|
const g = c(h);
|
|
1473
1473
|
(h.includes("mask-image") || h.includes("sm: hover") || h.includes("sm:hover") || h.includes("mask.svg")) && console.error("DEBUG generateRule:", h, g);
|
|
1474
|
-
let b = !1
|
|
1474
|
+
let b = !1;
|
|
1475
|
+
const d = g.find((S) => (S.startsWith("!") && (b = !0, S = S.slice(1)), se[S] || le(S) || ue(S) || fe(S) || G(S)));
|
|
1475
1476
|
if (!d) return null;
|
|
1476
1477
|
const v = d.replace(/^!/, ""), m = se[v] ?? le(v) ?? ue(v) ?? fe(v) ?? G(v);
|
|
1477
1478
|
if (!m) return null;
|
|
@@ -1493,7 +1494,7 @@ function st(e) {
|
|
|
1493
1494
|
W = M;
|
|
1494
1495
|
continue;
|
|
1495
1496
|
}
|
|
1496
|
-
const L =
|
|
1497
|
+
const L = x(S);
|
|
1497
1498
|
if (L) {
|
|
1498
1499
|
W ? be.push(L) : ne.push(L);
|
|
1499
1500
|
continue;
|
|
@@ -1521,20 +1522,20 @@ function st(e) {
|
|
|
1521
1522
|
}
|
|
1522
1523
|
return S + M;
|
|
1523
1524
|
}
|
|
1524
|
-
const oe = ne.join(""),
|
|
1525
|
+
const oe = ne.join(""), K = be.join("");
|
|
1525
1526
|
if (W)
|
|
1526
1527
|
if (W.includes("&")) {
|
|
1527
1528
|
const S = W.indexOf("&"), M = W.slice(0, S), L = W.slice(S + 1), R = E + oe, T = A;
|
|
1528
1529
|
if (ne.length === 0)
|
|
1529
|
-
A = T.replace(E, M + R +
|
|
1530
|
+
A = T.replace(E, M + R + K + L);
|
|
1530
1531
|
else {
|
|
1531
|
-
const z = ze(L,
|
|
1532
|
+
const z = ze(L, K);
|
|
1532
1533
|
A = T.replace(E, M + R + z);
|
|
1533
1534
|
}
|
|
1534
1535
|
} else
|
|
1535
|
-
A = A.replace(E, `${W}${E + oe}`),
|
|
1536
|
+
A = A.replace(E, `${W}${E + oe}`), K && (A = A.replace(E, `${E}${K}`));
|
|
1536
1537
|
else
|
|
1537
|
-
A = E + oe +
|
|
1538
|
+
A = E + oe + K;
|
|
1538
1539
|
A = A.replace(new RegExp(E, "g"), C);
|
|
1539
1540
|
let O = `${A}{${j}}`;
|
|
1540
1541
|
const ie = _.filter((S) => ce.includes(S)), H = ie.length ? ie[ie.length - 1] : null, ve = _.includes("dark");
|
|
@@ -1892,12 +1893,12 @@ function ft(e, t) {
|
|
|
1892
1893
|
"sort",
|
|
1893
1894
|
"reverse"
|
|
1894
1895
|
].includes(l) ? function(...c) {
|
|
1895
|
-
const
|
|
1896
|
+
const x = p.apply(a, c);
|
|
1896
1897
|
if (!n._initializing) {
|
|
1897
|
-
const
|
|
1898
|
-
n._triggerWatchers(
|
|
1898
|
+
const w = i || "root";
|
|
1899
|
+
n._triggerWatchers(w, a), n._render(r);
|
|
1899
1900
|
}
|
|
1900
|
-
return
|
|
1901
|
+
return x;
|
|
1901
1902
|
} : p;
|
|
1902
1903
|
},
|
|
1903
1904
|
set(a, l, f) {
|
|
@@ -1979,20 +1980,20 @@ function dt(e, t = [], r = {}) {
|
|
|
1979
1980
|
const l = a[1], f = a[2], p = (a[4] || a[6]) ?? "", y = p.match(/^{{(\d+)}}$/);
|
|
1980
1981
|
let c = y ? t[Number(y[1])] ?? null : p;
|
|
1981
1982
|
y || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c)));
|
|
1982
|
-
const
|
|
1983
|
+
const x = ["model", "bind", "show", "class", "style"];
|
|
1983
1984
|
if (l === ":") {
|
|
1984
|
-
const [
|
|
1985
|
-
if (
|
|
1985
|
+
const [w, ...k] = f.split(".");
|
|
1986
|
+
if (x.includes(w)) {
|
|
1986
1987
|
const h = [...k];
|
|
1987
|
-
s[
|
|
1988
|
+
s[w] = {
|
|
1988
1989
|
value: c,
|
|
1989
1990
|
modifiers: h
|
|
1990
1991
|
};
|
|
1991
1992
|
} else
|
|
1992
1993
|
n[f] = c;
|
|
1993
1994
|
} else if (l === "@") {
|
|
1994
|
-
const
|
|
1995
|
-
o[
|
|
1995
|
+
const w = "on" + f.charAt(0).toUpperCase() + f.slice(1);
|
|
1996
|
+
o[w] = typeof c == "function" ? c : typeof r[c] == "function" ? r[c] : void 0;
|
|
1996
1997
|
} else f === "ref" ? o.ref = c : n[f] = c;
|
|
1997
1998
|
}
|
|
1998
1999
|
return { props: o, attrs: n, directives: s };
|
|
@@ -2006,7 +2007,7 @@ function pt(e, t, r) {
|
|
|
2006
2007
|
for (let d = 0; d < e.length; d++)
|
|
2007
2008
|
i += e[d], d < t.length && (i += `{{${d}}}`);
|
|
2008
2009
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, l = [];
|
|
2009
|
-
let f, p = [], y = null, c = {},
|
|
2010
|
+
let f, p = [], y = null, c = {}, x, w = 0, k = [];
|
|
2010
2011
|
function h(d) {
|
|
2011
2012
|
!d || typeof d != "object" || ee(d) || (d.props || d.attrs ? (d.props && (c.props || (c.props = {}), Object.assign(c.props, d.props)), d.attrs && (c.attrs || (c.attrs = {}), Object.keys(d.attrs).forEach((v) => {
|
|
2012
2013
|
if (v === "style" && c.attrs.style) {
|
|
@@ -2084,14 +2085,14 @@ function pt(e, t, r) {
|
|
|
2084
2085
|
y,
|
|
2085
2086
|
c,
|
|
2086
2087
|
p.length === 1 && Q(p[0]) && p[0].tag === "#text" ? typeof p[0].children == "string" ? p[0].children : "" : p.length ? p : void 0,
|
|
2087
|
-
|
|
2088
|
+
x
|
|
2088
2089
|
), A = l.pop();
|
|
2089
|
-
A ? (y = A.tag, c = A.props,
|
|
2090
|
+
A ? (y = A.tag, c = A.props, x = A.key, p = A.children, p.push(j)) : (k.push(j), y = null, c = {}, x = void 0, p = []);
|
|
2090
2091
|
} else m ? y ? p.push(V(d, E, void 0, void 0)) : k.push(V(d, E, void 0, void 0)) : (y && l.push({
|
|
2091
2092
|
tag: y,
|
|
2092
2093
|
props: c,
|
|
2093
2094
|
children: p,
|
|
2094
|
-
key:
|
|
2095
|
+
key: x
|
|
2095
2096
|
}), y = d, c = E, p = []);
|
|
2096
2097
|
} else if (typeof f[3] < "u") {
|
|
2097
2098
|
const d = Number(f[3]), v = t[d], m = `interp-${d}`;
|
|
@@ -2105,7 +2106,7 @@ function pt(e, t, r) {
|
|
|
2105
2106
|
const C = Number(_[1]), E = t[C], j = `interp-${C}`;
|
|
2106
2107
|
u(E, j);
|
|
2107
2108
|
} else {
|
|
2108
|
-
const C = `text-${
|
|
2109
|
+
const C = `text-${w++}`;
|
|
2109
2110
|
v.push(s($, C));
|
|
2110
2111
|
}
|
|
2111
2112
|
}
|
|
@@ -2150,7 +2151,7 @@ function gt(e) {
|
|
|
2150
2151
|
if (u?.beforeEnter)
|
|
2151
2152
|
try {
|
|
2152
2153
|
const g = await u.beforeEnter(k, h);
|
|
2153
|
-
return typeof g == "string" ? (await
|
|
2154
|
+
return typeof g == "string" ? (await w(g, !0), !1) : g !== !1;
|
|
2154
2155
|
} catch (g) {
|
|
2155
2156
|
return console.error("beforeEnter error", g), !1;
|
|
2156
2157
|
}
|
|
@@ -2160,12 +2161,12 @@ function gt(e) {
|
|
|
2160
2161
|
if (u?.onEnter)
|
|
2161
2162
|
try {
|
|
2162
2163
|
const g = await u.onEnter(k, h);
|
|
2163
|
-
return typeof g == "string" ? (await
|
|
2164
|
+
return typeof g == "string" ? (await w(g, !0), !1) : g !== !1;
|
|
2164
2165
|
} catch (g) {
|
|
2165
2166
|
return console.error("onEnter error", g), !1;
|
|
2166
2167
|
}
|
|
2167
2168
|
return !0;
|
|
2168
|
-
},
|
|
2169
|
+
}, x = (k, h) => {
|
|
2169
2170
|
const u = t.find((g) => N([g], k.path).route !== null);
|
|
2170
2171
|
if (u?.afterEnter)
|
|
2171
2172
|
try {
|
|
@@ -2173,7 +2174,7 @@ function gt(e) {
|
|
|
2173
2174
|
} catch (g) {
|
|
2174
2175
|
console.error("afterEnter error", g);
|
|
2175
2176
|
}
|
|
2176
|
-
},
|
|
2177
|
+
}, w = async (k, h = !1) => {
|
|
2177
2178
|
try {
|
|
2178
2179
|
const u = {
|
|
2179
2180
|
path: k.replace(r, "") || "/",
|
|
@@ -2186,7 +2187,7 @@ function gt(e) {
|
|
|
2186
2187
|
query: u.query
|
|
2187
2188
|
};
|
|
2188
2189
|
if (!await y(d, b) || !await c(d, b)) return;
|
|
2189
|
-
typeof window < "u" && typeof document < "u" && (h ? window.history.replaceState({}, "", r + k) : window.history.pushState({}, "", r + k)), i.setState(d),
|
|
2190
|
+
typeof window < "u" && typeof document < "u" && (h ? window.history.replaceState({}, "", r + k) : window.history.pushState({}, "", r + k)), i.setState(d), x(d, b);
|
|
2190
2191
|
} catch (u) {
|
|
2191
2192
|
console.error("Navigation error:", u);
|
|
2192
2193
|
}
|
|
@@ -2197,21 +2198,21 @@ function gt(e) {
|
|
|
2197
2198
|
return { path: u, query: g };
|
|
2198
2199
|
}, s = n();
|
|
2199
2200
|
const k = N(t, s.path);
|
|
2200
|
-
i =
|
|
2201
|
+
i = we({
|
|
2201
2202
|
path: s.path,
|
|
2202
2203
|
params: k.params,
|
|
2203
2204
|
query: s.query
|
|
2204
2205
|
}), a = async (h = !1) => {
|
|
2205
2206
|
const u = n();
|
|
2206
|
-
await
|
|
2207
|
-
}, window.addEventListener("popstate", () => a(!0)), l = (h) =>
|
|
2207
|
+
await w(u.path, h);
|
|
2208
|
+
}, window.addEventListener("popstate", () => a(!0)), l = (h) => w(h, !1), f = (h) => w(h, !0), p = () => window.history.back();
|
|
2208
2209
|
} else {
|
|
2209
2210
|
n = () => {
|
|
2210
2211
|
const u = new URL(o || "/", "http://localhost"), g = u.pathname.replace(r, "") || "/", b = Ee(u.search);
|
|
2211
2212
|
return { path: g, query: b };
|
|
2212
2213
|
}, s = n();
|
|
2213
2214
|
const k = N(t, s.path);
|
|
2214
|
-
i =
|
|
2215
|
+
i = we({
|
|
2215
2216
|
path: s.path,
|
|
2216
2217
|
params: k.params,
|
|
2217
2218
|
query: s.query
|
|
@@ -2325,12 +2326,12 @@ function St(e) {
|
|
|
2325
2326
|
},
|
|
2326
2327
|
style: (r) => r.style,
|
|
2327
2328
|
render: (r) => {
|
|
2328
|
-
const o = t.getCurrent(), n = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, l = r.ariaCurrentValue, f = r.tag, p = r.disabled, y = r.external, c = o.path === n,
|
|
2329
|
+
const o = t.getCurrent(), n = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, l = r.ariaCurrentValue, f = r.tag, p = r.disabled, y = r.external, c = o.path === n, x = s ? c : o && typeof o.path == "string" ? o.path.startsWith(n) : !1, w = c ? `aria-current="${l}"` : "", k = (r.class || "").split(/\s+/).filter(Boolean), h = {};
|
|
2329
2330
|
for (const v of k) h[v] = !0;
|
|
2330
2331
|
const u = {
|
|
2331
2332
|
...h,
|
|
2332
2333
|
// Also include the configurable names (may duplicate the above)
|
|
2333
|
-
[a]:
|
|
2334
|
+
[a]: x,
|
|
2334
2335
|
[i]: c
|
|
2335
2336
|
}, g = f === "button", b = p ? g ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", d = y && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2336
2337
|
return D`
|
|
@@ -2338,7 +2339,7 @@ function St(e) {
|
|
|
2338
2339
|
<button
|
|
2339
2340
|
part="button"
|
|
2340
2341
|
:class="${u}"
|
|
2341
|
-
${
|
|
2342
|
+
${w}
|
|
2342
2343
|
${b}
|
|
2343
2344
|
${d}
|
|
2344
2345
|
@click="navigate"
|
|
@@ -2348,7 +2349,7 @@ function St(e) {
|
|
|
2348
2349
|
part="link"
|
|
2349
2350
|
href="${n}"
|
|
2350
2351
|
:class="${u}"
|
|
2351
|
-
${
|
|
2352
|
+
${w}
|
|
2352
2353
|
${b}
|
|
2353
2354
|
${d}
|
|
2354
2355
|
@click="navigate"
|
|
@@ -2366,9 +2367,9 @@ function St(e) {
|
|
|
2366
2367
|
}), t;
|
|
2367
2368
|
}
|
|
2368
2369
|
export {
|
|
2369
|
-
|
|
2370
|
+
U as GlobalEventBus,
|
|
2370
2371
|
Ce as component,
|
|
2371
|
-
|
|
2372
|
+
we as createStore,
|
|
2372
2373
|
je as css,
|
|
2373
2374
|
mt as each,
|
|
2374
2375
|
bt as emit,
|
|
@@ -2379,9 +2380,9 @@ export {
|
|
|
2379
2380
|
Re as match,
|
|
2380
2381
|
N as matchRoute,
|
|
2381
2382
|
$t as matchRouteSSR,
|
|
2382
|
-
|
|
2383
|
+
wt as off,
|
|
2383
2384
|
vt as on,
|
|
2384
|
-
|
|
2385
|
+
xt as once,
|
|
2385
2386
|
Ee as parseQuery,
|
|
2386
2387
|
ht as resolveRouteComponent,
|
|
2387
2388
|
gt as useRouter,
|