@jasonshimmy/custom-elements-runtime 0.2.3 → 0.2.5
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 +14 -14
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +994 -940
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +14 -14
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/runtime/component.d.ts +8 -0
- package/dist/runtime/helpers.d.ts +8 -0
- package/dist/runtime/template-compiler.d.ts +1 -0
- package/dist/runtime/types.d.ts +7 -4
- package/dist/runtime/vdom.d.ts +2 -16
- package/dist/runtime/watchers.d.ts +0 -4
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function vt(e, t) {
|
|
2
|
+
return fe(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function xt(e, t) {
|
|
5
5
|
return e.map((r, o) => {
|
|
6
6
|
const n = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${o}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return fe(t(r, o), `each-${n}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function Oe() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function Re() {
|
|
|
17
17
|
return e.push([!0, t]), this;
|
|
18
18
|
},
|
|
19
19
|
done() {
|
|
20
|
-
return
|
|
20
|
+
return Pe(...e);
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Pe(...e) {
|
|
25
25
|
for (let t = 0; t < e.length; t++) {
|
|
26
26
|
const [r, o] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [fe(o, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [fe([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function fe(e, t) {
|
|
32
32
|
const r = e ? Array.isArray(e) ? e.filter(Boolean) : [e].filter(Boolean) : [];
|
|
33
33
|
return {
|
|
34
34
|
tag: "#anchor",
|
|
@@ -36,7 +36,7 @@ function te(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class G extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,9 +44,8 @@ class U extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return G.instance || (G.instance = new G()), G.instance;
|
|
48
48
|
}
|
|
49
|
-
// Enhanced emit method with better typing and event storm protection
|
|
50
49
|
/**
|
|
51
50
|
* Emit a global event with optional data. Includes event storm protection.
|
|
52
51
|
* @param eventName - Name of the event
|
|
@@ -56,20 +55,18 @@ class U extends EventTarget {
|
|
|
56
55
|
const o = Date.now(), n = this.eventCounters.get(t);
|
|
57
56
|
if (!n || o - n.window > 1e3)
|
|
58
57
|
this.eventCounters.set(t, { count: 1, window: o });
|
|
59
|
-
else if (n.count++, n.count > 50 &&
|
|
60
|
-
console.warn(`Blocking further "${t}" events to prevent infinite loop`);
|
|
58
|
+
else if (n.count++, n.count > 50 && n.count > 100)
|
|
61
59
|
return;
|
|
62
|
-
}
|
|
63
60
|
this.dispatchEvent(new CustomEvent(t, {
|
|
64
61
|
detail: r,
|
|
65
62
|
bubbles: !1,
|
|
66
63
|
// Global events don't need to bubble
|
|
67
64
|
cancelable: !0
|
|
68
65
|
}));
|
|
69
|
-
const
|
|
70
|
-
|
|
66
|
+
const i = this.handlers[t];
|
|
67
|
+
i && i.forEach((s) => {
|
|
71
68
|
try {
|
|
72
|
-
|
|
69
|
+
s(r);
|
|
73
70
|
} catch (a) {
|
|
74
71
|
console.error(`Error in global event handler for "${t}":`, a);
|
|
75
72
|
}
|
|
@@ -115,8 +112,8 @@ class U extends EventTarget {
|
|
|
115
112
|
*/
|
|
116
113
|
once(t, r) {
|
|
117
114
|
return new Promise((o) => {
|
|
118
|
-
const n = this.on(t, (
|
|
119
|
-
n(), r(
|
|
115
|
+
const n = this.on(t, (i) => {
|
|
116
|
+
n(), r(i), o(i);
|
|
120
117
|
});
|
|
121
118
|
});
|
|
122
119
|
}
|
|
@@ -160,8 +157,8 @@ class U extends EventTarget {
|
|
|
160
157
|
this.eventCounters.clear();
|
|
161
158
|
}
|
|
162
159
|
}
|
|
163
|
-
const
|
|
164
|
-
function
|
|
160
|
+
const re = G.getInstance(), wt = (e, t) => re.emit(e, t), kt = (e, t) => re.on(e, t), $t = (e, t) => re.off(e, t), _t = (e, t) => re.once(e, t), St = (e, t, r) => re.listen(e, t, r);
|
|
161
|
+
function $e(e) {
|
|
165
162
|
let t = { ...e };
|
|
166
163
|
const r = [];
|
|
167
164
|
function o(a) {
|
|
@@ -170,19 +167,19 @@ function we(e) {
|
|
|
170
167
|
function n() {
|
|
171
168
|
return t;
|
|
172
169
|
}
|
|
173
|
-
function
|
|
174
|
-
const
|
|
175
|
-
t = { ...t, ...
|
|
170
|
+
function i(a) {
|
|
171
|
+
const f = typeof a == "function" ? a(t) : a;
|
|
172
|
+
t = { ...t, ...f }, s();
|
|
176
173
|
}
|
|
177
|
-
function
|
|
174
|
+
function s() {
|
|
178
175
|
r.forEach((a) => a(t));
|
|
179
176
|
}
|
|
180
|
-
return { subscribe: o, getState: n, setState:
|
|
177
|
+
return { subscribe: o, getState: n, setState: i };
|
|
181
178
|
}
|
|
182
|
-
function
|
|
179
|
+
function J(e) {
|
|
183
180
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
184
181
|
}
|
|
185
|
-
function
|
|
182
|
+
function H(e) {
|
|
186
183
|
return typeof e == "string" ? e.replace(
|
|
187
184
|
/[&<>"']/g,
|
|
188
185
|
(t) => ({
|
|
@@ -194,247 +191,242 @@ function pe(e) {
|
|
|
194
191
|
})[t]
|
|
195
192
|
) : e;
|
|
196
193
|
}
|
|
197
|
-
function
|
|
194
|
+
function N(e, t) {
|
|
195
|
+
return typeof t == "string" ? t.split(".").reduce((r, o) => r?.[o], e) : t;
|
|
196
|
+
}
|
|
197
|
+
function se(e, t, r) {
|
|
198
|
+
const o = String(t).split("."), n = o.pop();
|
|
199
|
+
if (!n) return;
|
|
200
|
+
const i = o.reduce((s, a) => (s[a] == null && (s[a] = {}), s[a]), e);
|
|
201
|
+
i[n] = r;
|
|
202
|
+
}
|
|
203
|
+
function Ne(e, t, r) {
|
|
198
204
|
if (r)
|
|
199
205
|
for (const [o, n] of Object.entries(r)) {
|
|
200
|
-
let
|
|
201
|
-
if (Array.isArray(n) ? (
|
|
202
|
-
callback:
|
|
203
|
-
options:
|
|
204
|
-
oldValue:
|
|
205
|
-
}),
|
|
206
|
+
let i, s = {};
|
|
207
|
+
if (Array.isArray(n) ? (i = n[0], s = n[1] || {}) : i = n, t.set(o, {
|
|
208
|
+
callback: i,
|
|
209
|
+
options: s,
|
|
210
|
+
oldValue: N(e, o)
|
|
211
|
+
}), s.immediate)
|
|
206
212
|
try {
|
|
207
|
-
const a =
|
|
208
|
-
|
|
213
|
+
const a = N(e, o);
|
|
214
|
+
i(a, void 0, e);
|
|
209
215
|
} catch (a) {
|
|
210
216
|
console.error(`Error in immediate watcher for "${o}":`, a);
|
|
211
217
|
}
|
|
212
218
|
}
|
|
213
219
|
}
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
return l.length !== f.length ? !1 : l.every((p) => n(i[p], a[p]));
|
|
225
|
-
}, s = t.get(r);
|
|
226
|
-
if (s && !n(o, s.oldValue))
|
|
220
|
+
function Me(e, t, r, o) {
|
|
221
|
+
const n = (s, a) => {
|
|
222
|
+
if (s === a) return !0;
|
|
223
|
+
if (typeof s != typeof a || typeof s != "object" || s === null || a === null) return !1;
|
|
224
|
+
if (Array.isArray(s) && Array.isArray(a))
|
|
225
|
+
return s.length !== a.length ? !1 : s.every((d, m) => n(d, a[m]));
|
|
226
|
+
const f = Object.keys(s), u = Object.keys(a);
|
|
227
|
+
return f.length !== u.length ? !1 : f.every((d) => n(s[d], a[d]));
|
|
228
|
+
}, i = t.get(r);
|
|
229
|
+
if (i && !n(o, i.oldValue))
|
|
227
230
|
try {
|
|
228
|
-
|
|
229
|
-
} catch (
|
|
230
|
-
console.error(`Error in watcher for "${r}":`,
|
|
231
|
+
i.callback(o, i.oldValue, e), i.oldValue = o;
|
|
232
|
+
} catch (s) {
|
|
233
|
+
console.error(`Error in watcher for "${r}":`, s);
|
|
231
234
|
}
|
|
232
|
-
for (const [
|
|
233
|
-
if (a.options.deep && r.startsWith(
|
|
235
|
+
for (const [s, a] of t.entries())
|
|
236
|
+
if (a.options.deep && r.startsWith(s + "."))
|
|
234
237
|
try {
|
|
235
|
-
const
|
|
236
|
-
n(
|
|
237
|
-
} catch (
|
|
238
|
-
console.error(`Error in deep watcher for "${
|
|
238
|
+
const f = N(e, s);
|
|
239
|
+
n(f, a.oldValue) || (a.callback(f, a.oldValue, e), a.oldValue = f);
|
|
240
|
+
} catch (f) {
|
|
241
|
+
console.error(`Error in deep watcher for "${s}":`, f);
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
|
-
function
|
|
244
|
+
function We(e, t, r) {
|
|
242
245
|
if (!t.props) return;
|
|
243
|
-
function o(n,
|
|
244
|
-
return
|
|
246
|
+
function o(n, i) {
|
|
247
|
+
return i === Boolean ? n === "true" : i === Number ? Number(n) : n;
|
|
245
248
|
}
|
|
246
|
-
Object.entries(t.props).forEach(([n,
|
|
247
|
-
if (
|
|
249
|
+
Object.entries(t.props).forEach(([n, i]) => {
|
|
250
|
+
if (i.type === Function && typeof e[n] == "function")
|
|
248
251
|
r[n] = e[n];
|
|
249
252
|
else {
|
|
250
|
-
const
|
|
251
|
-
|
|
253
|
+
const s = e.getAttribute(J(n));
|
|
254
|
+
s !== null ? r[n] = H(o(s, i.type)) : "default" in i && i.default !== void 0 && (r[n] = H(i.default));
|
|
252
255
|
}
|
|
253
256
|
});
|
|
254
257
|
}
|
|
255
|
-
function
|
|
258
|
+
function qe(e, t, r, o) {
|
|
256
259
|
e.onConnected && !r && (e.onConnected(t), o(!0));
|
|
257
260
|
}
|
|
258
|
-
function
|
|
259
|
-
e.onDisconnected && e.onDisconnected(t), r.forEach((
|
|
261
|
+
function De(e, t, r, o, n, i, s, a) {
|
|
262
|
+
e.onDisconnected && e.onDisconnected(t), r.forEach((f) => f()), o(), n(), i(!1), s(null), a(!1);
|
|
260
263
|
}
|
|
261
|
-
function
|
|
264
|
+
function Ie(e, t, r, o, n) {
|
|
262
265
|
e.onAttributeChanged && e.onAttributeChanged(t, r, o, n);
|
|
263
266
|
}
|
|
264
|
-
function
|
|
267
|
+
function V(e, t) {
|
|
265
268
|
if (t && e instanceof HTMLElement) {
|
|
266
269
|
for (const r in t)
|
|
267
270
|
t[r] === e && delete t[r];
|
|
268
271
|
for (const r of Array.from(e.childNodes))
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
function
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
const h = s._state || s;
|
|
285
|
-
return I(h, e);
|
|
286
|
-
}, y = p();
|
|
287
|
-
let c = "text";
|
|
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
|
-
if (Array.isArray(y)) {
|
|
291
|
-
const h = i?.getAttribute("value") || o?.value || "", u = y.includes(h);
|
|
292
|
-
i && i.checked !== u && (r.checked = u);
|
|
293
|
-
} else {
|
|
294
|
-
const h = i?.getAttribute("true-value") || !0, u = y === h;
|
|
295
|
-
i && i.checked !== u && (r.checked = u);
|
|
272
|
+
V(r, t);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function He(e, t, r, o, n, i, s, a) {
|
|
276
|
+
if (!i) return;
|
|
277
|
+
const f = t.includes("lazy"), u = t.includes("trim"), d = t.includes("number"), m = () => N(i._state || i, e), l = m();
|
|
278
|
+
let h = "text";
|
|
279
|
+
s instanceof HTMLInputElement ? h = o?.type || s.type || "text" : s instanceof HTMLSelectElement ? h = "select" : s instanceof HTMLTextAreaElement && (h = "textarea");
|
|
280
|
+
const w = s instanceof HTMLInputElement || s instanceof HTMLTextAreaElement || s instanceof HTMLSelectElement, v = w ? h === "checkbox" || h === "radio" ? "checked" : "value" : a ?? "modelValue";
|
|
281
|
+
if (h === "checkbox")
|
|
282
|
+
if (Array.isArray(l))
|
|
283
|
+
r[v] = l.includes(String(s?.getAttribute("value") ?? o?.value ?? ""));
|
|
284
|
+
else {
|
|
285
|
+
const x = s?.getAttribute("true-value") ?? !0;
|
|
286
|
+
r[v] = l === x;
|
|
296
287
|
}
|
|
297
|
-
else if (
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
const h = i, u = Array.isArray(y) ? y : [];
|
|
288
|
+
else if (h === "radio")
|
|
289
|
+
r[v] = l === (o?.value ?? "");
|
|
290
|
+
else if (h === "select")
|
|
291
|
+
if (s && s.hasAttribute("multiple") && s instanceof HTMLSelectElement) {
|
|
292
|
+
const x = Array.isArray(l) ? l.map(String) : [];
|
|
303
293
|
setTimeout(() => {
|
|
304
|
-
Array.from(
|
|
305
|
-
|
|
306
|
-
g.selected !== b && (g.selected = b);
|
|
294
|
+
Array.from(s.options).forEach((c) => {
|
|
295
|
+
c.selected = x.includes(c.value);
|
|
307
296
|
});
|
|
308
|
-
}, 0);
|
|
297
|
+
}, 0), r[v] = Array.isArray(l) ? l : [];
|
|
309
298
|
} else
|
|
310
|
-
|
|
311
|
-
i instanceof HTMLSelectElement && i.value !== String(y) && (i.value = String(y));
|
|
312
|
-
}, 0);
|
|
299
|
+
r[v] = l;
|
|
313
300
|
else {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
301
|
+
r[v] = l;
|
|
302
|
+
try {
|
|
303
|
+
const x = J(v);
|
|
304
|
+
o && (o[x] = l);
|
|
305
|
+
} catch {
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
const b = f || h === "checkbox" || h === "radio" || h === "select" ? "change" : "input", y = (x) => {
|
|
309
|
+
if (x.isComposing || n._isComposing || x.isTrusted === !1) return;
|
|
310
|
+
const c = x.target;
|
|
311
|
+
if (!c || c._modelUpdating) return;
|
|
312
|
+
let g = c.value;
|
|
313
|
+
if (h === "checkbox") {
|
|
314
|
+
const C = m();
|
|
315
|
+
if (Array.isArray(C)) {
|
|
316
|
+
const S = c.getAttribute("value") ?? "", A = Array.from(C);
|
|
317
|
+
if (c.checked)
|
|
318
|
+
A.includes(S) || A.push(S);
|
|
328
319
|
else {
|
|
329
|
-
const
|
|
330
|
-
|
|
320
|
+
const T = A.indexOf(S);
|
|
321
|
+
T > -1 && A.splice(T, 1);
|
|
331
322
|
}
|
|
332
|
-
|
|
323
|
+
g = A;
|
|
333
324
|
} else {
|
|
334
|
-
const
|
|
335
|
-
|
|
325
|
+
const S = c.getAttribute("true-value") ?? !0, A = c.getAttribute("false-value") ?? !1;
|
|
326
|
+
g = c.checked ? S : A;
|
|
336
327
|
}
|
|
337
|
-
else if (
|
|
338
|
-
|
|
339
|
-
else if (
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
);
|
|
344
|
-
} else if (l && (b = b.trim()), f) {
|
|
345
|
-
const $ = Number(b);
|
|
346
|
-
isNaN($) || (b = $);
|
|
328
|
+
} else if (h === "radio")
|
|
329
|
+
g = c.getAttribute("value") ?? c.value;
|
|
330
|
+
else if (h === "select" && c.multiple)
|
|
331
|
+
g = Array.from(c.selectedOptions).map((C) => C.value);
|
|
332
|
+
else if (u && typeof g == "string" && (g = g.trim()), d) {
|
|
333
|
+
const C = Number(g);
|
|
334
|
+
isNaN(C) || (g = C);
|
|
347
335
|
}
|
|
348
|
-
const
|
|
349
|
-
if (Array.isArray(
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
}
|
|
336
|
+
const p = i._state || i, _ = N(p, e);
|
|
337
|
+
if (Array.isArray(g) && Array.isArray(_) ? JSON.stringify([...g].sort()) !== JSON.stringify([..._].sort()) : g !== _) {
|
|
338
|
+
c._modelUpdating = !0;
|
|
339
|
+
try {
|
|
340
|
+
se(p, e, g), i._requestRender && i._requestRender();
|
|
341
|
+
} finally {
|
|
342
|
+
setTimeout(() => c._modelUpdating = !1, 0);
|
|
343
|
+
}
|
|
354
344
|
}
|
|
355
345
|
};
|
|
356
|
-
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
346
|
+
w ? n[b] = y : n[`update:${J(v)}`] = (x) => {
|
|
347
|
+
const c = i._state || i, g = x.detail !== void 0 ? x.detail : x.target?.value, p = N(c, e);
|
|
348
|
+
(Array.isArray(g) && Array.isArray(p) ? JSON.stringify([...g].sort()) !== JSON.stringify([...p].sort()) : g !== p) && (se(c, e, g), i._requestRender && i._requestRender());
|
|
349
|
+
}, (h === "text" || h === "textarea") && (n.compositionstart = (() => n._isComposing = !0), n.compositionend = (x) => {
|
|
350
|
+
n._isComposing = !1;
|
|
351
|
+
const c = x.target;
|
|
352
|
+
c && setTimeout(() => {
|
|
353
|
+
const g = c.value, p = i._state || i, _ = N(p, e);
|
|
354
|
+
let E = g;
|
|
355
|
+
if (u && (E = E.trim()), d) {
|
|
356
|
+
const S = Number(E);
|
|
357
|
+
isNaN(S) || (E = S);
|
|
358
|
+
}
|
|
359
|
+
if (Array.isArray(E) && Array.isArray(_) ? JSON.stringify([...E].sort()) !== JSON.stringify([..._].sort()) : E !== _) {
|
|
360
|
+
c._modelUpdating = !0;
|
|
361
|
+
try {
|
|
362
|
+
se(p, e, E), i._requestRender && i._requestRender();
|
|
363
|
+
} finally {
|
|
364
|
+
setTimeout(() => c._modelUpdating = !1, 0);
|
|
373
365
|
}
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
}
|
|
366
|
+
}
|
|
367
|
+
}, 0);
|
|
368
|
+
});
|
|
378
369
|
}
|
|
379
|
-
function
|
|
380
|
-
|
|
370
|
+
function Le(e) {
|
|
371
|
+
const t = e.slice(2);
|
|
372
|
+
return t ? t.charAt(0).toLowerCase() + t.slice(1) : "";
|
|
381
373
|
}
|
|
382
|
-
function
|
|
374
|
+
function Fe(e, t, r, o) {
|
|
383
375
|
if (o) {
|
|
384
376
|
if (typeof e == "object" && e !== null)
|
|
385
|
-
for (const [n,
|
|
386
|
-
t[n] =
|
|
377
|
+
for (const [n, i] of Object.entries(e))
|
|
378
|
+
t[n] = i;
|
|
387
379
|
else if (typeof e == "string")
|
|
388
380
|
try {
|
|
389
381
|
const n = JSON.parse(e);
|
|
390
382
|
if (typeof n == "object" && n !== null) {
|
|
391
|
-
for (const [
|
|
392
|
-
t[
|
|
383
|
+
for (const [i, s] of Object.entries(n))
|
|
384
|
+
t[i] = s;
|
|
393
385
|
return;
|
|
394
386
|
}
|
|
395
387
|
} catch {
|
|
396
|
-
const n =
|
|
388
|
+
const n = N(o, e);
|
|
397
389
|
r[e] = n;
|
|
398
390
|
}
|
|
399
391
|
}
|
|
400
392
|
}
|
|
401
|
-
function
|
|
393
|
+
function Ke(e, t, r) {
|
|
402
394
|
if (!r) return;
|
|
403
|
-
const o =
|
|
395
|
+
const o = N(r, e), n = t.style || "", i = o ? "" : "none";
|
|
404
396
|
if (n) {
|
|
405
|
-
const
|
|
406
|
-
(
|
|
397
|
+
const s = n.split(";").filter(Boolean), a = s.findIndex(
|
|
398
|
+
(f) => f.trim().startsWith("display:")
|
|
407
399
|
);
|
|
408
|
-
a >= 0 ?
|
|
400
|
+
a >= 0 ? s[a] = `display: ${i}` : s.push(`display: ${i}`), t.style = s.join("; ");
|
|
409
401
|
} else
|
|
410
|
-
t.style = `display: ${
|
|
402
|
+
t.style = `display: ${i}`;
|
|
411
403
|
}
|
|
412
|
-
function
|
|
404
|
+
function Ue(e, t, r) {
|
|
413
405
|
if (!r) return;
|
|
414
|
-
const o =
|
|
406
|
+
const o = N(r, e);
|
|
415
407
|
let n = [];
|
|
416
408
|
typeof o == "string" ? n = [o] : Array.isArray(o) ? n = o.filter(Boolean) : typeof o == "object" && (n = Object.entries(o).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
417
|
-
const
|
|
418
|
-
|
|
409
|
+
const i = t.class || "", s = i ? `${i} ${n.join(" ")}`.trim() : n.join(" ");
|
|
410
|
+
s && (t.class = s);
|
|
419
411
|
}
|
|
420
|
-
function
|
|
412
|
+
function Ve(e, t, r) {
|
|
421
413
|
let o;
|
|
422
414
|
if (typeof e == "string") {
|
|
423
415
|
if (!r) return;
|
|
424
|
-
o =
|
|
416
|
+
o = N(r, e);
|
|
425
417
|
} else
|
|
426
418
|
o = e;
|
|
427
419
|
let n = "";
|
|
428
420
|
if (typeof o == "string")
|
|
429
421
|
n = o;
|
|
430
422
|
else if (o && typeof o == "object") {
|
|
431
|
-
const
|
|
432
|
-
for (const [a,
|
|
433
|
-
if (
|
|
434
|
-
const
|
|
423
|
+
const s = [];
|
|
424
|
+
for (const [a, f] of Object.entries(o))
|
|
425
|
+
if (f != null && f !== "") {
|
|
426
|
+
const u = a.replace(
|
|
435
427
|
/[A-Z]/g,
|
|
436
|
-
(
|
|
437
|
-
),
|
|
428
|
+
(l) => `-${l.toLowerCase()}`
|
|
429
|
+
), d = [
|
|
438
430
|
"width",
|
|
439
431
|
"height",
|
|
440
432
|
"top",
|
|
@@ -460,359 +452,391 @@ function Ue(e, t, r) {
|
|
|
460
452
|
"min-height",
|
|
461
453
|
"max-height"
|
|
462
454
|
];
|
|
463
|
-
let
|
|
464
|
-
typeof
|
|
455
|
+
let m = String(f);
|
|
456
|
+
typeof f == "number" && d.includes(u) && (m = `${f}px`), s.push(`${u}: ${m}`);
|
|
465
457
|
}
|
|
466
|
-
n =
|
|
467
|
-
}
|
|
468
|
-
const
|
|
469
|
-
t.style =
|
|
470
|
-
}
|
|
471
|
-
function
|
|
472
|
-
const n = {},
|
|
473
|
-
for (const [a,
|
|
474
|
-
const { value:
|
|
458
|
+
n = s.join("; ") + (s.length > 0 ? ";" : "");
|
|
459
|
+
}
|
|
460
|
+
const i = t.style || "";
|
|
461
|
+
t.style = i + (i && !i.endsWith(";") ? "; " : "") + n;
|
|
462
|
+
}
|
|
463
|
+
function Re(e, t, r, o) {
|
|
464
|
+
const n = {}, i = { ...o || {} }, s = {};
|
|
465
|
+
for (const [a, f] of Object.entries(e)) {
|
|
466
|
+
const { value: u, modifiers: d, arg: m } = f;
|
|
467
|
+
if (a === "model" || a.startsWith("model:")) {
|
|
468
|
+
const l = a.split(":"), h = l.length > 1 ? l[1] : m;
|
|
469
|
+
He(
|
|
470
|
+
typeof u == "string" ? u : String(u),
|
|
471
|
+
d,
|
|
472
|
+
n,
|
|
473
|
+
i,
|
|
474
|
+
s,
|
|
475
|
+
t,
|
|
476
|
+
r,
|
|
477
|
+
h
|
|
478
|
+
);
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
475
481
|
switch (a) {
|
|
476
|
-
case "model":
|
|
477
|
-
qe(
|
|
478
|
-
typeof f == "string" ? f : String(f),
|
|
479
|
-
p,
|
|
480
|
-
n,
|
|
481
|
-
s,
|
|
482
|
-
i,
|
|
483
|
-
t,
|
|
484
|
-
r
|
|
485
|
-
);
|
|
486
|
-
break;
|
|
487
482
|
case "bind":
|
|
488
|
-
|
|
483
|
+
Fe(u, n, i, t);
|
|
489
484
|
break;
|
|
490
485
|
case "show":
|
|
491
|
-
|
|
486
|
+
Ke(u, i, t);
|
|
492
487
|
break;
|
|
493
488
|
case "class":
|
|
494
|
-
|
|
489
|
+
Ue(u, i, t);
|
|
495
490
|
break;
|
|
496
491
|
case "style":
|
|
497
|
-
|
|
492
|
+
Ve(u, i, t);
|
|
498
493
|
break;
|
|
499
494
|
}
|
|
500
495
|
}
|
|
501
|
-
return { props: n, attrs:
|
|
496
|
+
return { props: n, attrs: i, listeners: s };
|
|
502
497
|
}
|
|
503
|
-
function
|
|
498
|
+
function ke(e, t) {
|
|
504
499
|
if (Array.isArray(e)) {
|
|
505
|
-
const
|
|
506
|
-
return e.map((
|
|
507
|
-
if (!
|
|
508
|
-
let a =
|
|
500
|
+
const i = /* @__PURE__ */ new Set();
|
|
501
|
+
return e.map((s) => {
|
|
502
|
+
if (!s || typeof s != "object") return s;
|
|
503
|
+
let a = s.props?.key ?? s.key;
|
|
509
504
|
if (!a) {
|
|
510
|
-
const
|
|
511
|
-
a =
|
|
505
|
+
const m = s.tag || "node", l = s.props?.attrs?.id ?? s.props?.attrs?.name ?? s.props?.attrs?.["data-key"] ?? "";
|
|
506
|
+
a = l ? `${t}:${m}:${l}` : `${t}:${m}`;
|
|
512
507
|
}
|
|
513
|
-
let
|
|
514
|
-
for (;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
let
|
|
518
|
-
return Array.isArray(
|
|
508
|
+
let f = a, u = 1;
|
|
509
|
+
for (; i.has(f); )
|
|
510
|
+
f = `${a}#${u++}`;
|
|
511
|
+
i.add(f);
|
|
512
|
+
let d = s.children;
|
|
513
|
+
return Array.isArray(d) && (d = ke(d, f)), { ...s, key: f, children: d };
|
|
519
514
|
});
|
|
520
515
|
}
|
|
521
516
|
const r = e;
|
|
522
517
|
let o = r.props?.key ?? r.key ?? t, n = r.children;
|
|
523
|
-
return Array.isArray(n) && (n =
|
|
518
|
+
return Array.isArray(n) && (n = ke(n, o)), { ...r, key: o, children: n };
|
|
524
519
|
}
|
|
525
|
-
function
|
|
526
|
-
const n = r.directives ?? {},
|
|
520
|
+
function Je(e, t, r, o) {
|
|
521
|
+
const n = r.directives ?? {}, i = Re(
|
|
527
522
|
n,
|
|
528
523
|
o,
|
|
529
524
|
e,
|
|
530
525
|
r.attrs
|
|
531
|
-
),
|
|
526
|
+
), s = {
|
|
532
527
|
...t.props,
|
|
533
528
|
...r.props,
|
|
534
|
-
...
|
|
529
|
+
...i.props
|
|
535
530
|
}, a = {
|
|
536
531
|
...t.attrs,
|
|
537
532
|
...r.attrs,
|
|
538
|
-
...
|
|
539
|
-
},
|
|
540
|
-
for (const
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
543
|
-
if (
|
|
533
|
+
...i.attrs
|
|
534
|
+
}, f = t.props ?? {}, u = s;
|
|
535
|
+
for (const l in { ...f, ...u }) {
|
|
536
|
+
const h = f[l], w = u[l];
|
|
537
|
+
if (h !== w) {
|
|
538
|
+
if (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement))
|
|
544
539
|
e.value !== w && (e.value = w ?? "");
|
|
545
|
-
else if (
|
|
540
|
+
else if (l === "checked" && e instanceof HTMLInputElement)
|
|
546
541
|
e.checked = !!w;
|
|
547
|
-
else if (
|
|
548
|
-
const
|
|
549
|
-
typeof
|
|
550
|
-
} else w == null || w === !1
|
|
542
|
+
else if (l.startsWith("on") && typeof w == "function") {
|
|
543
|
+
const $ = Le(l);
|
|
544
|
+
typeof h == "function" && e.removeEventListener($, h), e.addEventListener($, w);
|
|
545
|
+
} else if (w == null || w === !1)
|
|
546
|
+
e.removeAttribute(l);
|
|
547
|
+
else if ((r?.isCustomElement ?? t?.isCustomElement ?? !1) || l in e)
|
|
548
|
+
try {
|
|
549
|
+
e[l] = w;
|
|
550
|
+
} catch {
|
|
551
|
+
}
|
|
552
|
+
}
|
|
551
553
|
}
|
|
552
|
-
for (const [
|
|
553
|
-
|
|
554
|
+
for (const [l, h] of Object.entries(
|
|
555
|
+
i.listeners || {}
|
|
554
556
|
))
|
|
555
|
-
e.addEventListener(
|
|
556
|
-
const
|
|
557
|
-
for (const
|
|
558
|
-
const
|
|
559
|
-
|
|
557
|
+
e.addEventListener(l, h);
|
|
558
|
+
const d = t.attrs ?? {}, m = a;
|
|
559
|
+
for (const l in { ...d, ...m }) {
|
|
560
|
+
const h = d[l], w = m[l];
|
|
561
|
+
h !== w && (w == null || w === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(w)));
|
|
560
562
|
}
|
|
561
563
|
}
|
|
562
|
-
function
|
|
564
|
+
function M(e, t, r) {
|
|
563
565
|
if (typeof e == "string")
|
|
564
566
|
return document.createTextNode(e);
|
|
565
567
|
if (e.tag === "#text") {
|
|
566
|
-
const
|
|
568
|
+
const m = document.createTextNode(
|
|
567
569
|
typeof e.children == "string" ? e.children : ""
|
|
568
570
|
);
|
|
569
|
-
return e.key != null && (
|
|
571
|
+
return e.key != null && (m.key = e.key), m;
|
|
570
572
|
}
|
|
571
573
|
if (e.tag === "#anchor") {
|
|
572
|
-
const
|
|
573
|
-
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
for (const
|
|
577
|
-
const
|
|
578
|
-
|
|
574
|
+
const m = e, l = Array.isArray(m.children) ? m.children : [], h = document.createTextNode(""), w = document.createTextNode("");
|
|
575
|
+
m.key != null && (h.key = `${m.key}:start`, w.key = `${m.key}:end`), m._startNode = h, m._endNode = w;
|
|
576
|
+
const $ = document.createDocumentFragment();
|
|
577
|
+
$.appendChild(h);
|
|
578
|
+
for (const v of l) {
|
|
579
|
+
const b = M(v, t);
|
|
580
|
+
$.appendChild(b);
|
|
579
581
|
}
|
|
580
|
-
return
|
|
582
|
+
return $.appendChild(w), $;
|
|
581
583
|
}
|
|
582
584
|
const o = document.createElement(e.tag);
|
|
583
585
|
e.key != null && (o.key = e.key);
|
|
584
|
-
const { props: n = {}, attrs:
|
|
586
|
+
const { props: n = {}, attrs: i = {}, directives: s = {} } = e.props ?? {}, a = Re(s, t, o, i), f = {
|
|
585
587
|
...n,
|
|
586
588
|
...a.props
|
|
587
|
-
},
|
|
588
|
-
...
|
|
589
|
+
}, u = {
|
|
590
|
+
...i,
|
|
589
591
|
...a.attrs
|
|
590
592
|
};
|
|
591
|
-
for (const
|
|
592
|
-
const
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
typeof
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
}
|
|
593
|
+
for (const m in u) {
|
|
594
|
+
const l = u[m];
|
|
595
|
+
typeof m != "string" || /\[object Object\]/.test(m) || (typeof l == "boolean" ? l && o.setAttribute(m, "") : l != null && o.setAttribute(m, l));
|
|
596
|
+
}
|
|
597
|
+
for (const m in f) {
|
|
598
|
+
const l = f[m];
|
|
599
|
+
if (!(typeof m != "string" || /\[object Object\]/.test(m)))
|
|
600
|
+
if (m === "value" && (o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement))
|
|
601
|
+
o.value = l ?? "";
|
|
602
|
+
else if (m === "checked" && o instanceof HTMLInputElement)
|
|
603
|
+
o.checked = !!l;
|
|
604
|
+
else if (m.startsWith("on") && typeof l == "function")
|
|
605
|
+
o.addEventListener(Le(m), l);
|
|
606
|
+
else {
|
|
607
|
+
if (m.startsWith("on") && l === void 0)
|
|
608
|
+
continue;
|
|
609
|
+
if (l == null || l === !1)
|
|
610
|
+
o.removeAttribute(m);
|
|
611
|
+
else if ((e.props?.isCustomElement ?? !1) || m in o)
|
|
612
|
+
try {
|
|
613
|
+
o[m] = l;
|
|
614
|
+
} catch {
|
|
615
|
+
}
|
|
616
|
+
}
|
|
616
617
|
}
|
|
617
|
-
for (const [
|
|
618
|
+
for (const [m, l] of Object.entries(
|
|
618
619
|
a.listeners || {}
|
|
619
620
|
))
|
|
620
|
-
o.addEventListener(
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
621
|
+
o.addEventListener(m, l);
|
|
622
|
+
const d = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
623
|
+
typeof e != "string" && d && r && (r[d] = o);
|
|
624
|
+
try {
|
|
625
|
+
if (typeof o._applyProps == "function")
|
|
626
|
+
try {
|
|
627
|
+
o._applyProps(o._cfg);
|
|
628
|
+
} catch {
|
|
629
|
+
}
|
|
630
|
+
typeof o.requestRender == "function" ? o.requestRender() : typeof o._render == "function" && o._render(o._cfg);
|
|
631
|
+
} catch {
|
|
632
|
+
}
|
|
633
|
+
if (Array.isArray(e.children))
|
|
634
|
+
for (const m of e.children)
|
|
635
|
+
o.appendChild(M(m, t, r));
|
|
625
636
|
else typeof e.children == "string" && (o.textContent = e.children);
|
|
626
637
|
return o;
|
|
627
638
|
}
|
|
628
|
-
function
|
|
639
|
+
function Ze(e, t, r, o, n) {
|
|
629
640
|
if (typeof r == "string") {
|
|
630
641
|
e.textContent !== r && (e.textContent = r);
|
|
631
642
|
return;
|
|
632
643
|
}
|
|
633
644
|
if (!Array.isArray(r)) return;
|
|
634
|
-
const
|
|
635
|
-
for (const
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
for (const
|
|
639
|
-
const w =
|
|
640
|
-
w != null &&
|
|
641
|
-
}
|
|
642
|
-
const
|
|
643
|
-
let
|
|
644
|
-
function
|
|
645
|
-
let
|
|
646
|
-
for (;
|
|
647
|
-
|
|
648
|
-
}
|
|
649
|
-
function
|
|
650
|
-
const
|
|
651
|
-
let
|
|
652
|
-
for (;
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
if (
|
|
656
|
-
const
|
|
657
|
-
for (const C of
|
|
658
|
-
C && C.key != null &&
|
|
659
|
-
for (const C of
|
|
660
|
-
const
|
|
661
|
-
|
|
645
|
+
const i = Array.from(e.childNodes), s = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
646
|
+
for (const h of s)
|
|
647
|
+
h && h.key != null && a.set(h.key, h);
|
|
648
|
+
const f = /* @__PURE__ */ new Map();
|
|
649
|
+
for (const h of i) {
|
|
650
|
+
const w = h.key;
|
|
651
|
+
w != null && f.set(w, h);
|
|
652
|
+
}
|
|
653
|
+
const u = /* @__PURE__ */ new Set();
|
|
654
|
+
let d = e.firstChild;
|
|
655
|
+
function m(h, w) {
|
|
656
|
+
let $ = h;
|
|
657
|
+
for (; $ && (u.add($), $ !== w); )
|
|
658
|
+
$ = $.nextSibling;
|
|
659
|
+
}
|
|
660
|
+
function l(h, w, $, v) {
|
|
661
|
+
const b = [];
|
|
662
|
+
let y = h.nextSibling;
|
|
663
|
+
for (; y && y !== w; )
|
|
664
|
+
b.push(y), y = y.nextSibling;
|
|
665
|
+
const x = Array.isArray($) ? $ : [];
|
|
666
|
+
if (v.some((g) => g && g.key != null) || x.some((g) => g && g.key != null)) {
|
|
667
|
+
const g = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
668
|
+
for (const C of x)
|
|
669
|
+
C && C.key != null && g.set(C.key, C);
|
|
670
|
+
for (const C of b) {
|
|
671
|
+
const S = C.key;
|
|
672
|
+
S != null && p.set(S, C);
|
|
662
673
|
}
|
|
663
|
-
const
|
|
664
|
-
let
|
|
665
|
-
for (const C of
|
|
666
|
-
let
|
|
667
|
-
if (C.key != null &&
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
674
|
+
const _ = /* @__PURE__ */ new Set();
|
|
675
|
+
let E = h.nextSibling;
|
|
676
|
+
for (const C of v) {
|
|
677
|
+
let S;
|
|
678
|
+
if (C.key != null && p.has(C.key)) {
|
|
679
|
+
const A = g.get(C.key);
|
|
680
|
+
S = ae(
|
|
681
|
+
p.get(C.key),
|
|
682
|
+
A,
|
|
672
683
|
C,
|
|
673
684
|
o
|
|
674
|
-
),
|
|
685
|
+
), _.add(S), S !== E && e.contains(S) && e.insertBefore(S, E);
|
|
675
686
|
} else
|
|
676
|
-
|
|
677
|
-
|
|
687
|
+
S = M(C, o), e.insertBefore(S, E), _.add(S);
|
|
688
|
+
E = S.nextSibling;
|
|
678
689
|
}
|
|
679
|
-
for (const C of
|
|
680
|
-
|
|
690
|
+
for (const C of b)
|
|
691
|
+
!_.has(C) && e.contains(C) && e.removeChild(C);
|
|
681
692
|
} else {
|
|
682
|
-
const
|
|
683
|
-
|
|
684
|
-
|
|
693
|
+
const g = Math.min(
|
|
694
|
+
x.length,
|
|
695
|
+
v.length
|
|
685
696
|
);
|
|
686
|
-
for (let
|
|
687
|
-
const
|
|
688
|
-
C !==
|
|
697
|
+
for (let p = 0; p < g; p++) {
|
|
698
|
+
const _ = x[p], E = v[p], C = ae(b[p], _, E, o);
|
|
699
|
+
C !== b[p] && (e.insertBefore(C, b[p]), e.removeChild(b[p]));
|
|
689
700
|
}
|
|
690
|
-
for (let
|
|
691
|
-
e.insertBefore(
|
|
692
|
-
for (let
|
|
693
|
-
e.removeChild(
|
|
701
|
+
for (let p = g; p < v.length; p++)
|
|
702
|
+
e.insertBefore(M(v[p], o), w);
|
|
703
|
+
for (let p = g; p < b.length; p++)
|
|
704
|
+
e.removeChild(b[p]);
|
|
694
705
|
}
|
|
695
706
|
}
|
|
696
|
-
for (const
|
|
707
|
+
for (const h of r) {
|
|
697
708
|
let w;
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
let
|
|
701
|
-
const
|
|
702
|
-
if (
|
|
703
|
-
e.insertBefore(
|
|
704
|
-
for (const
|
|
705
|
-
e.insertBefore(
|
|
706
|
-
e.insertBefore(
|
|
709
|
+
if (h.tag === "#anchor") {
|
|
710
|
+
const $ = h.key, v = `${$}:start`, b = `${$}:end`;
|
|
711
|
+
let y = f.get(v), x = f.get(b);
|
|
712
|
+
const c = Array.isArray(h.children) ? h.children : [];
|
|
713
|
+
if (y || (y = document.createTextNode(""), y.key = v), x || (x = document.createTextNode(""), x.key = b), h._startNode = y, h._endNode = x, !e.contains(y) || !e.contains(x)) {
|
|
714
|
+
e.insertBefore(y, d);
|
|
715
|
+
for (const g of c)
|
|
716
|
+
e.insertBefore(M(g, o), d);
|
|
717
|
+
e.insertBefore(x, d);
|
|
707
718
|
} else
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
a.get(
|
|
712
|
-
|
|
719
|
+
l(
|
|
720
|
+
y,
|
|
721
|
+
x,
|
|
722
|
+
a.get($)?.children,
|
|
723
|
+
c
|
|
713
724
|
);
|
|
714
|
-
y
|
|
725
|
+
m(y, x), d = x.nextSibling;
|
|
715
726
|
continue;
|
|
716
727
|
}
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
719
|
-
w =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
728
|
+
if (h.key != null && f.has(h.key)) {
|
|
729
|
+
const $ = a.get(h.key);
|
|
730
|
+
w = ae(
|
|
731
|
+
f.get(h.key),
|
|
732
|
+
$,
|
|
733
|
+
h,
|
|
723
734
|
o,
|
|
724
735
|
n
|
|
725
|
-
),
|
|
736
|
+
), u.add(w), w !== d && e.contains(w) && (d && !e.contains(d) && (d = null), e.insertBefore(w, d));
|
|
726
737
|
} else
|
|
727
|
-
w =
|
|
728
|
-
|
|
738
|
+
w = M(h, o, n), d && !e.contains(d) && (d = null), e.insertBefore(w, d), u.add(w);
|
|
739
|
+
d = w.nextSibling;
|
|
729
740
|
}
|
|
730
|
-
for (const
|
|
731
|
-
!
|
|
741
|
+
for (const h of i)
|
|
742
|
+
!u.has(h) && e.contains(h) && (V(h, n), e.removeChild(h));
|
|
732
743
|
}
|
|
733
|
-
function
|
|
734
|
-
if (t && typeof t != "string" && t.props?.ref && n &&
|
|
744
|
+
function ae(e, t, r, o, n) {
|
|
745
|
+
if (t && typeof t != "string" && t.props?.ref && n && V(e, n), t === r) return e;
|
|
735
746
|
if (typeof r == "string") {
|
|
736
747
|
if (e.nodeType === Node.TEXT_NODE)
|
|
737
748
|
return e.textContent !== r && (e.textContent = r), e;
|
|
738
749
|
{
|
|
739
|
-
const
|
|
740
|
-
return e.parentNode?.replaceChild(
|
|
750
|
+
const s = document.createTextNode(r);
|
|
751
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
741
752
|
}
|
|
742
753
|
}
|
|
743
754
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
for (const
|
|
749
|
-
const
|
|
750
|
-
|
|
755
|
+
const s = r, a = Array.isArray(s.children) ? s.children : [], f = s._startNode ?? document.createTextNode(""), u = s._endNode ?? document.createTextNode("");
|
|
756
|
+
s.key != null && (f.key = `${s.key}:start`, u.key = `${s.key}:end`), s._startNode = f, s._endNode = u;
|
|
757
|
+
const d = document.createDocumentFragment();
|
|
758
|
+
d.appendChild(f);
|
|
759
|
+
for (const m of a) {
|
|
760
|
+
const l = M(m, o);
|
|
761
|
+
d.appendChild(l);
|
|
751
762
|
}
|
|
752
|
-
return
|
|
763
|
+
return d.appendChild(u), e.parentNode?.replaceChild(d, e), f;
|
|
753
764
|
}
|
|
754
765
|
if (!r) {
|
|
755
|
-
|
|
756
|
-
const
|
|
757
|
-
return e.parentNode?.replaceChild(
|
|
766
|
+
V(e, n);
|
|
767
|
+
const s = document.createComment("removed");
|
|
768
|
+
return e.parentNode?.replaceChild(s, e), s;
|
|
758
769
|
}
|
|
759
770
|
if (!t || typeof t == "string") {
|
|
760
|
-
|
|
761
|
-
const
|
|
762
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
771
|
+
V(e, n);
|
|
772
|
+
const s = M(r, o, n);
|
|
773
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
763
774
|
}
|
|
764
775
|
if (r.tag === "#anchor") {
|
|
765
|
-
const
|
|
766
|
-
r.key != null && (a.key = `${r.key}:start`,
|
|
767
|
-
const
|
|
768
|
-
|
|
769
|
-
for (const
|
|
770
|
-
|
|
771
|
-
return
|
|
776
|
+
const s = Array.isArray(r.children) ? r.children : [], a = r._startNode ?? document.createTextNode(""), f = r._endNode ?? document.createTextNode("");
|
|
777
|
+
r.key != null && (a.key = `${r.key}:start`, f.key = `${r.key}:end`), r._startNode = a, r._endNode = f;
|
|
778
|
+
const u = document.createDocumentFragment();
|
|
779
|
+
u.appendChild(a);
|
|
780
|
+
for (const d of s)
|
|
781
|
+
u.appendChild(M(d, o));
|
|
782
|
+
return u.appendChild(f), e.parentNode?.replaceChild(u, e), a;
|
|
772
783
|
}
|
|
773
784
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
774
|
-
const
|
|
775
|
-
return
|
|
785
|
+
const s = e;
|
|
786
|
+
return Je(s, t.props || {}, r.props || {}, o), Ze(s, t.children, r.children, o, n), typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = s), s;
|
|
776
787
|
}
|
|
777
|
-
|
|
778
|
-
const
|
|
779
|
-
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] =
|
|
788
|
+
V(e, n);
|
|
789
|
+
const i = M(r, o, n);
|
|
790
|
+
return typeof r != "string" && r.props?.ref && n && (n[r.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
|
|
780
791
|
}
|
|
781
|
-
function
|
|
792
|
+
function Ye(e, t, r, o) {
|
|
782
793
|
let n;
|
|
783
794
|
Array.isArray(t) ? t.length === 1 ? (n = t[0], n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })) : n = { tag: "div", key: "__root__", children: t } : (n = t, n && typeof n == "object" && n.key == null && (n = { ...n, key: "__root__" })), n && typeof n == "object" && n.tag === "#anchor" && (n = {
|
|
784
795
|
tag: "div",
|
|
785
796
|
key: "__anchor_root__",
|
|
786
797
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
787
798
|
children: [n]
|
|
788
|
-
}), n =
|
|
789
|
-
const
|
|
799
|
+
}), n = ke(n, String(n.key ?? "root"));
|
|
800
|
+
const i = e._prevVNode ?? null, s = e._prevDom ?? e.firstChild ?? null;
|
|
790
801
|
let a;
|
|
791
|
-
|
|
792
|
-
const
|
|
793
|
-
for (let
|
|
794
|
-
const
|
|
795
|
-
|
|
796
|
-
}
|
|
797
|
-
|
|
802
|
+
i && s ? typeof i != "string" && typeof n != "string" && i.tag === n.tag && i.key === n.key ? a = ae(s, i, n, r, o) : (a = M(n, r, o), e.replaceChild(a, s)) : (a = M(n, r, o), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
803
|
+
const f = [];
|
|
804
|
+
for (let u = 0; u < e.childNodes.length; u++) {
|
|
805
|
+
const d = e.childNodes[u];
|
|
806
|
+
d !== a && d.nodeName !== "STYLE" && (V(d, o), f.push(d));
|
|
807
|
+
}
|
|
808
|
+
f.forEach((u) => e.removeChild(u)), e._prevVNode = n, e._prevDom = a;
|
|
809
|
+
}
|
|
810
|
+
function he(e) {
|
|
811
|
+
if (typeof e == "string") return H(e);
|
|
812
|
+
if (e.tag === "#text")
|
|
813
|
+
return typeof e.children == "string" ? H(e.children) : "";
|
|
814
|
+
if (e.tag === "#anchor")
|
|
815
|
+
return (Array.isArray(e.children) ? e.children.filter(Boolean) : []).map(he).join("");
|
|
816
|
+
let t = "";
|
|
817
|
+
e.props && e.props.attrs && (t = Object.entries(e.props.attrs).map(([n, i]) => ` ${n}="${H(String(i))}"`).join(""));
|
|
818
|
+
let r = "";
|
|
819
|
+
e.props && (r = Object.entries(e.props).filter(([n]) => n !== "attrs" && n !== "directives" && n !== "ref" && n !== "key").map(([n, i]) => ` ${n}="${H(String(i))}"`).join(""));
|
|
820
|
+
const o = Array.isArray(e.children) ? e.children.filter(Boolean).map(he).join("") : typeof e.children == "string" ? H(e.children) : e.children ? he(e.children) : "";
|
|
821
|
+
return `<${e.tag}${t}${r}>${o}</${e.tag}>`;
|
|
798
822
|
}
|
|
799
|
-
function
|
|
823
|
+
function ze(e, ...t) {
|
|
800
824
|
let r = "";
|
|
801
825
|
for (let o = 0; o < e.length; o++)
|
|
802
826
|
r += e[o], o < t.length && (r += t[o]);
|
|
803
827
|
return r;
|
|
804
828
|
}
|
|
805
|
-
function
|
|
829
|
+
function Be(e) {
|
|
806
830
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
807
831
|
}
|
|
808
|
-
let
|
|
809
|
-
function
|
|
810
|
-
return
|
|
832
|
+
let oe = null;
|
|
833
|
+
function _e() {
|
|
834
|
+
return oe || (oe = new CSSStyleSheet(), oe.replaceSync(Be(Qe))), oe;
|
|
811
835
|
}
|
|
812
|
-
function
|
|
836
|
+
function Ge(e) {
|
|
813
837
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
814
838
|
}
|
|
815
|
-
const
|
|
839
|
+
const Qe = ze`
|
|
816
840
|
:host, *, ::before, ::after {
|
|
817
841
|
all: isolate;
|
|
818
842
|
box-sizing: border-box;
|
|
@@ -870,7 +894,7 @@ const Ye = je`
|
|
|
870
894
|
sup { top: -.5em }
|
|
871
895
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
872
896
|
[hidden] { display: none }
|
|
873
|
-
`,
|
|
897
|
+
`, Xe = {
|
|
874
898
|
gray: {
|
|
875
899
|
50: "var(--color-gray-50, #f9fafb)",
|
|
876
900
|
100: "var(--color-gray-100, #f3f4f6)",
|
|
@@ -1007,7 +1031,7 @@ const Ye = je`
|
|
|
1007
1031
|
black: { DEFAULT: "var(--color-black, #000000)" },
|
|
1008
1032
|
transparent: { DEFAULT: "var(--color-transparent, transparent)" },
|
|
1009
1033
|
current: { DEFAULT: "var(--color-current, currentColor)" }
|
|
1010
|
-
},
|
|
1034
|
+
}, ge = {
|
|
1011
1035
|
/* Display */
|
|
1012
1036
|
block: "display:block;",
|
|
1013
1037
|
inline: "display:inline;",
|
|
@@ -1184,7 +1208,7 @@ const Ye = je`
|
|
|
1184
1208
|
"z-30": "z-index:30;",
|
|
1185
1209
|
"z-40": "z-index:40;",
|
|
1186
1210
|
"z-50": "z-index:50;"
|
|
1187
|
-
},
|
|
1211
|
+
}, et = "0.25rem", Se = {
|
|
1188
1212
|
m: ["margin"],
|
|
1189
1213
|
mx: ["margin-inline"],
|
|
1190
1214
|
my: ["margin-block"],
|
|
@@ -1216,34 +1240,34 @@ const Ye = je`
|
|
|
1216
1240
|
"gap-x": ["column-gap"],
|
|
1217
1241
|
"gap-y": ["row-gap"]
|
|
1218
1242
|
};
|
|
1219
|
-
function
|
|
1243
|
+
function P(e, t) {
|
|
1220
1244
|
let r = 0, o = 0;
|
|
1221
1245
|
for (let n = 0; n < e.length; n++) {
|
|
1222
|
-
const
|
|
1223
|
-
if (
|
|
1224
|
-
else if (
|
|
1225
|
-
else if (
|
|
1226
|
-
else if (
|
|
1227
|
-
else if (r === 0 && o === 0 && (
|
|
1246
|
+
const i = e[n];
|
|
1247
|
+
if (i === "[") r++;
|
|
1248
|
+
else if (i === "]" && r > 0) r--;
|
|
1249
|
+
else if (i === "(") o++;
|
|
1250
|
+
else if (i === ")" && o > 0) o--;
|
|
1251
|
+
else if (r === 0 && o === 0 && (i === ">" || i === "+" || i === "~" || i === " "))
|
|
1228
1252
|
return e.slice(0, n) + t + e.slice(n);
|
|
1229
1253
|
}
|
|
1230
1254
|
return e + t;
|
|
1231
1255
|
}
|
|
1232
|
-
const
|
|
1256
|
+
const tt = {
|
|
1233
1257
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1234
1258
|
after: (e, t) => `${e}::after{${t}}`,
|
|
1235
|
-
hover: (e, t) => `${
|
|
1236
|
-
focus: (e, t) => `${
|
|
1237
|
-
active: (e, t) => `${
|
|
1238
|
-
disabled: (e, t) => `${
|
|
1239
|
-
visited: (e, t) => `${
|
|
1240
|
-
checked: (e, t) => `${
|
|
1241
|
-
first: (e, t) => `${
|
|
1242
|
-
last: (e, t) => `${
|
|
1243
|
-
odd: (e, t) => `${
|
|
1244
|
-
even: (e, t) => `${
|
|
1245
|
-
"focus-within": (e, t) => `${
|
|
1246
|
-
"focus-visible": (e, t) => `${
|
|
1259
|
+
hover: (e, t) => `${P(e, ":hover")}{${t}}`,
|
|
1260
|
+
focus: (e, t) => `${P(e, ":focus")}{${t}}`,
|
|
1261
|
+
active: (e, t) => `${P(e, ":active")}{${t}}`,
|
|
1262
|
+
disabled: (e, t) => `${P(e, ":disabled")}{${t}}`,
|
|
1263
|
+
visited: (e, t) => `${P(e, ":visited")}{${t}}`,
|
|
1264
|
+
checked: (e, t) => `${P(e, ":checked")}{${t}}`,
|
|
1265
|
+
first: (e, t) => `${P(e, ":first-child")}{${t}}`,
|
|
1266
|
+
last: (e, t) => `${P(e, ":last-child")}{${t}}`,
|
|
1267
|
+
odd: (e, t) => `${P(e, ":nth-child(odd)")}{${t}}`,
|
|
1268
|
+
even: (e, t) => `${P(e, ":nth-child(even)")}{${t}}`,
|
|
1269
|
+
"focus-within": (e, t) => `${P(e, ":focus-within")}{${t}}`,
|
|
1270
|
+
"focus-visible": (e, t) => `${P(e, ":focus-visible")}{${t}}`,
|
|
1247
1271
|
"group-hover": (e, t) => `.group:hover ${e}{${t}}`,
|
|
1248
1272
|
"group-focus": (e, t) => `.group:focus ${e}{${t}}`,
|
|
1249
1273
|
"group-active": (e, t) => `.group:active ${e}{${t}}`,
|
|
@@ -1252,7 +1276,7 @@ const Ge = {
|
|
|
1252
1276
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1253
1277
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1254
1278
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1255
|
-
},
|
|
1279
|
+
}, ye = {
|
|
1256
1280
|
// Responsive
|
|
1257
1281
|
sm: "(min-width:640px)",
|
|
1258
1282
|
md: "(min-width:768px)",
|
|
@@ -1261,24 +1285,24 @@ const Ge = {
|
|
|
1261
1285
|
"2xl": "(min-width:1536px)",
|
|
1262
1286
|
// Dark mode (now plain string)
|
|
1263
1287
|
dark: "(prefers-color-scheme: dark)"
|
|
1264
|
-
},
|
|
1265
|
-
function
|
|
1288
|
+
}, me = ["sm", "md", "lg", "xl", "2xl"];
|
|
1289
|
+
function be(e) {
|
|
1266
1290
|
const t = e.startsWith("-"), o = (t ? e.slice(1) : e).split("-");
|
|
1267
1291
|
if (o.length < 2) return null;
|
|
1268
|
-
const n = o.slice(0, -1).join("-"),
|
|
1269
|
-
if (Number.isNaN(
|
|
1292
|
+
const n = o.slice(0, -1).join("-"), i = o[o.length - 1], s = parseFloat(i);
|
|
1293
|
+
if (Number.isNaN(s) || !Se[n]) return null;
|
|
1270
1294
|
const a = t ? "-" : "";
|
|
1271
|
-
return
|
|
1295
|
+
return Se[n].map((f) => `${f}:calc(${a}${et} * ${s});`).join("");
|
|
1272
1296
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const t = e.replace("#", ""), r = parseInt(t, 16), o = r >> 16 & 255, n = r >> 8 & 255,
|
|
1275
|
-
return `${o} ${n} ${
|
|
1297
|
+
function Ce(e) {
|
|
1298
|
+
const t = e.replace("#", ""), r = parseInt(t, 16), o = r >> 16 & 255, n = r >> 8 & 255, i = r & 255;
|
|
1299
|
+
return `${o} ${n} ${i}`;
|
|
1276
1300
|
}
|
|
1277
|
-
function
|
|
1301
|
+
function rt(e) {
|
|
1278
1302
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1279
1303
|
if (!t) return null;
|
|
1280
|
-
const [, r, o, n = "DEFAULT"] = t,
|
|
1281
|
-
return
|
|
1304
|
+
const [, r, o, n = "DEFAULT"] = t, i = Xe[o]?.[n];
|
|
1305
|
+
return i ? `${{
|
|
1282
1306
|
bg: "background-color",
|
|
1283
1307
|
decoration: "text-decoration-color",
|
|
1284
1308
|
text: "color",
|
|
@@ -1290,49 +1314,49 @@ function et(e) {
|
|
|
1290
1314
|
placeholder: "placeholder-color",
|
|
1291
1315
|
fill: "fill-color",
|
|
1292
1316
|
stroke: "stroke-color"
|
|
1293
|
-
}[r]}:${
|
|
1317
|
+
}[r]}:${i};` : null;
|
|
1294
1318
|
}
|
|
1295
|
-
function
|
|
1319
|
+
function nt(e) {
|
|
1296
1320
|
const [t, r] = e.split("/");
|
|
1297
1321
|
if (!r) return { base: t };
|
|
1298
1322
|
const o = parseInt(r, 10);
|
|
1299
1323
|
return isNaN(o) || o < 0 || o > 100 ? { base: t } : { base: t, opacity: o / 100 };
|
|
1300
1324
|
}
|
|
1301
|
-
function
|
|
1302
|
-
const { base: t, opacity: r } =
|
|
1325
|
+
function ve(e) {
|
|
1326
|
+
const { base: t, opacity: r } = nt(e), o = rt(t);
|
|
1303
1327
|
if (o) {
|
|
1304
1328
|
if (r !== void 0) {
|
|
1305
|
-
const
|
|
1306
|
-
if (
|
|
1307
|
-
const
|
|
1308
|
-
return o.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1329
|
+
const i = /#([0-9a-f]{6})/i.exec(o);
|
|
1330
|
+
if (i) {
|
|
1331
|
+
const s = Ce(i[0]);
|
|
1332
|
+
return o.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1309
1333
|
}
|
|
1310
1334
|
}
|
|
1311
1335
|
return o;
|
|
1312
1336
|
}
|
|
1313
|
-
const n =
|
|
1337
|
+
const n = le(t);
|
|
1314
1338
|
if (n && r !== void 0) {
|
|
1315
|
-
const
|
|
1316
|
-
if (
|
|
1317
|
-
const
|
|
1318
|
-
return n.replace(/#([0-9a-f]{6})/i, `rgb(${
|
|
1339
|
+
const i = /#([0-9a-f]{6})/i.exec(n);
|
|
1340
|
+
if (i) {
|
|
1341
|
+
const s = Ce(i[0]);
|
|
1342
|
+
return n.replace(/#([0-9a-f]{6})/i, `rgb(${s} / ${r})`);
|
|
1319
1343
|
}
|
|
1320
1344
|
}
|
|
1321
1345
|
return n;
|
|
1322
1346
|
}
|
|
1323
|
-
function
|
|
1347
|
+
function xe(e) {
|
|
1324
1348
|
const t = /^opacity-(\d{1,3})$/.exec(e);
|
|
1325
1349
|
if (!t) return null;
|
|
1326
1350
|
const r = parseInt(t[1], 10);
|
|
1327
1351
|
return r < 0 || r > 100 ? null : `opacity:${r / 100};`;
|
|
1328
1352
|
}
|
|
1329
|
-
function
|
|
1353
|
+
function le(e) {
|
|
1330
1354
|
if (e.startsWith("[") && e.endsWith("]") && !e.includes("-[")) {
|
|
1331
1355
|
const n = e.slice(1, -1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);
|
|
1332
1356
|
if (n) {
|
|
1333
|
-
const
|
|
1334
|
-
let
|
|
1335
|
-
return
|
|
1357
|
+
const i = n[1].trim();
|
|
1358
|
+
let s = n[2].trim();
|
|
1359
|
+
return s = s.replace(/url\('\s*([^']*?)\s*'\)/g, 'url("$1")'), s = s.replace(/^'([^']*)'$/g, '"$1"'), `${i}:${s};`;
|
|
1336
1360
|
}
|
|
1337
1361
|
return null;
|
|
1338
1362
|
}
|
|
@@ -1341,7 +1365,7 @@ function G(e) {
|
|
|
1341
1365
|
const o = e.slice(0, t);
|
|
1342
1366
|
let n = e.slice(t + 2, -1);
|
|
1343
1367
|
n = n.replace(/_/g, " ");
|
|
1344
|
-
const
|
|
1368
|
+
const i = {
|
|
1345
1369
|
bg: "background-color",
|
|
1346
1370
|
text: "color",
|
|
1347
1371
|
shadow: "box-shadow",
|
|
@@ -1385,12 +1409,12 @@ function G(e) {
|
|
|
1385
1409
|
};
|
|
1386
1410
|
if (o === "rotate")
|
|
1387
1411
|
return `transform:rotate(${n});`;
|
|
1388
|
-
const
|
|
1389
|
-
if (
|
|
1412
|
+
const s = i[o] ?? o.replace(/_/g, "-");
|
|
1413
|
+
if (s && n) return `${s}:${n};`;
|
|
1390
1414
|
}
|
|
1391
1415
|
return null;
|
|
1392
1416
|
}
|
|
1393
|
-
function
|
|
1417
|
+
function ot(e) {
|
|
1394
1418
|
if (e.startsWith("[") && e.endsWith("]")) {
|
|
1395
1419
|
const r = e.slice(1, -1);
|
|
1396
1420
|
return r.includes("&") ? r : e;
|
|
@@ -1402,10 +1426,10 @@ function rt(e) {
|
|
|
1402
1426
|
}
|
|
1403
1427
|
return null;
|
|
1404
1428
|
}
|
|
1405
|
-
function
|
|
1429
|
+
function it(e) {
|
|
1406
1430
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1407
1431
|
}
|
|
1408
|
-
function
|
|
1432
|
+
function st(e) {
|
|
1409
1433
|
const t = /class\s*=\s*(['"])(.*?)\1/g, r = [];
|
|
1410
1434
|
let o;
|
|
1411
1435
|
for (; o = t.exec(e); ) {
|
|
@@ -1414,32 +1438,32 @@ function ot(e) {
|
|
|
1414
1438
|
}
|
|
1415
1439
|
return r.filter(Boolean);
|
|
1416
1440
|
}
|
|
1417
|
-
const
|
|
1418
|
-
function
|
|
1419
|
-
const t = Date.now(), r =
|
|
1420
|
-
if (r && t - r.timestamp <
|
|
1421
|
-
const o =
|
|
1422
|
-
function
|
|
1423
|
-
const
|
|
1424
|
-
if (
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1427
|
-
}
|
|
1428
|
-
function
|
|
1429
|
-
const
|
|
1430
|
-
return
|
|
1431
|
-
}
|
|
1432
|
-
function
|
|
1433
|
-
const
|
|
1434
|
-
let
|
|
1435
|
-
for (let
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1441
|
+
const Ee = /* @__PURE__ */ new Map(), at = 16;
|
|
1442
|
+
function lt(e) {
|
|
1443
|
+
const t = Date.now(), r = Ee.get(e);
|
|
1444
|
+
if (r && t - r.timestamp < at) return r.css;
|
|
1445
|
+
const o = st(e), n = new Set(o), i = [], s = [], a = [], f = [], u = {};
|
|
1446
|
+
function d(v, b = !1) {
|
|
1447
|
+
const y = (b ? "dark|" : "") + v;
|
|
1448
|
+
if (y in u) return u[y];
|
|
1449
|
+
const x = w(v, b);
|
|
1450
|
+
return u[y] = x, x;
|
|
1451
|
+
}
|
|
1452
|
+
function m(v) {
|
|
1453
|
+
const b = v.some((x) => me.includes(x)), y = v.includes("dark");
|
|
1454
|
+
return v.length === 0 ? 1 : !b && !y ? 2 : b && !y ? 3 : 4;
|
|
1455
|
+
}
|
|
1456
|
+
function l(v) {
|
|
1457
|
+
const b = [];
|
|
1458
|
+
let y = "", x = 0, c = 0;
|
|
1459
|
+
for (let g = 0; g < v.length; g++) {
|
|
1460
|
+
const p = v[g];
|
|
1461
|
+
p === "[" ? x++ : p === "]" && x > 0 ? x-- : p === "(" ? c++ : p === ")" && c > 0 && c--, p === ":" && x === 0 && c === 0 ? (b.push(y), y = "") : y += p;
|
|
1438
1462
|
}
|
|
1439
|
-
return
|
|
1463
|
+
return y && b.push(y), b;
|
|
1440
1464
|
}
|
|
1441
|
-
function
|
|
1442
|
-
switch (
|
|
1465
|
+
function h(v) {
|
|
1466
|
+
switch (v) {
|
|
1443
1467
|
case "hover":
|
|
1444
1468
|
return ":hover";
|
|
1445
1469
|
case "focus":
|
|
@@ -1468,207 +1492,210 @@ function st(e) {
|
|
|
1468
1492
|
return null;
|
|
1469
1493
|
}
|
|
1470
1494
|
}
|
|
1471
|
-
function w(
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
const
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
W = M;
|
|
1495
|
+
function w(v, b = !1) {
|
|
1496
|
+
const y = l(v);
|
|
1497
|
+
let x = !1;
|
|
1498
|
+
const c = y.find((k) => (k.startsWith("!") && (x = !0, k = k.slice(1)), ge[k] || be(k) || xe(k) || ve(k) || le(k)));
|
|
1499
|
+
if (!c) return null;
|
|
1500
|
+
const g = c.replace(/^!/, ""), p = ge[g] ?? be(g) ?? xe(g) ?? ve(g) ?? le(g);
|
|
1501
|
+
if (!p) return null;
|
|
1502
|
+
const _ = y.indexOf(c);
|
|
1503
|
+
let E = _ >= 0 ? y.slice(0, _) : [];
|
|
1504
|
+
b && (E = E.filter((k) => k !== "dark"));
|
|
1505
|
+
const C = `.${it(v)}`, S = "__SUBJECT__", A = x ? p.replace(/;$/, " !important;") : p;
|
|
1506
|
+
let T = S;
|
|
1507
|
+
const Q = [];
|
|
1508
|
+
for (const k of E)
|
|
1509
|
+
k.startsWith("group-") ? (T = `.group:${k.slice(6)} ${T}`, Q.push(k)) : k.startsWith("peer-") && (T = T.replace(S, `.peer:${k.slice(5)}~${S}`), Q.push(k));
|
|
1510
|
+
E = E.filter((k) => !Q.includes(k));
|
|
1511
|
+
const X = [], de = [];
|
|
1512
|
+
let q = null;
|
|
1513
|
+
for (const k of E) {
|
|
1514
|
+
if (k === "dark" || me.includes(k)) continue;
|
|
1515
|
+
const B = ot(k);
|
|
1516
|
+
if (B) {
|
|
1517
|
+
q = B;
|
|
1495
1518
|
continue;
|
|
1496
1519
|
}
|
|
1497
|
-
const
|
|
1498
|
-
if (
|
|
1499
|
-
|
|
1520
|
+
const z = h(k);
|
|
1521
|
+
if (z) {
|
|
1522
|
+
q ? de.push(z) : X.push(z);
|
|
1500
1523
|
continue;
|
|
1501
1524
|
}
|
|
1502
|
-
const
|
|
1503
|
-
typeof
|
|
1525
|
+
const O = tt[k];
|
|
1526
|
+
typeof O == "function" && (T = O(T, A).split("{")[0]);
|
|
1504
1527
|
}
|
|
1505
|
-
function
|
|
1506
|
-
if (!
|
|
1507
|
-
let
|
|
1508
|
-
if (
|
|
1509
|
-
let
|
|
1510
|
-
for (;
|
|
1511
|
-
for (;
|
|
1512
|
-
const
|
|
1513
|
-
if (
|
|
1514
|
-
return
|
|
1528
|
+
function I(k, B) {
|
|
1529
|
+
if (!B) return k;
|
|
1530
|
+
let z = 0, O = 0;
|
|
1531
|
+
if (k.length && (k[0] === ">" || k[0] === "+" || k[0] === "~" || k[0] === " ")) {
|
|
1532
|
+
let j = 1;
|
|
1533
|
+
for (; j < k.length && k[j] === " "; ) j++;
|
|
1534
|
+
for (; j < k.length; j++) {
|
|
1535
|
+
const R = k[j];
|
|
1536
|
+
if (R === "[" ? z++ : R === "]" && z > 0 ? z-- : R === "(" ? O++ : R === ")" && O > 0 && O--, z === 0 && O === 0 && (k[j] === ">" || k[j] === "+" || k[j] === "~" || k[j] === " "))
|
|
1537
|
+
return k.slice(0, j) + B + k.slice(j);
|
|
1515
1538
|
}
|
|
1516
|
-
return
|
|
1539
|
+
return k + B;
|
|
1517
1540
|
}
|
|
1518
|
-
for (let
|
|
1519
|
-
const
|
|
1520
|
-
if (
|
|
1521
|
-
return
|
|
1541
|
+
for (let j = 0; j < k.length; j++) {
|
|
1542
|
+
const R = k[j];
|
|
1543
|
+
if (R === "[" ? z++ : R === "]" && z > 0 ? z-- : R === "(" ? O++ : R === ")" && O > 0 && O--, z === 0 && O === 0 && (R === ">" || R === "+" || R === "~" || R === " "))
|
|
1544
|
+
return k.slice(0, j) + B + k.slice(j);
|
|
1522
1545
|
}
|
|
1523
|
-
return
|
|
1546
|
+
return k + B;
|
|
1524
1547
|
}
|
|
1525
|
-
const
|
|
1526
|
-
if (
|
|
1527
|
-
if (
|
|
1528
|
-
const
|
|
1529
|
-
if (
|
|
1530
|
-
|
|
1548
|
+
const Z = X.join(""), F = de.join("");
|
|
1549
|
+
if (q)
|
|
1550
|
+
if (q.includes("&")) {
|
|
1551
|
+
const k = q.indexOf("&"), B = q.slice(0, k), z = q.slice(k + 1), O = S + Z, j = T;
|
|
1552
|
+
if (X.length === 0)
|
|
1553
|
+
T = j.replace(S, B + O + F + z);
|
|
1531
1554
|
else {
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1555
|
+
const R = I(z, F);
|
|
1556
|
+
T = j.replace(S, B + O + R);
|
|
1534
1557
|
}
|
|
1535
1558
|
} else
|
|
1536
|
-
|
|
1559
|
+
T = T.replace(S, `${q}${S + Z}`), F && (T = T.replace(S, `${S}${F}`));
|
|
1537
1560
|
else
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
let
|
|
1541
|
-
const
|
|
1542
|
-
return
|
|
1543
|
-
}
|
|
1544
|
-
for (const
|
|
1545
|
-
const
|
|
1546
|
-
(
|
|
1561
|
+
T = S + Z + F;
|
|
1562
|
+
T = T.replace(new RegExp(S, "g"), C);
|
|
1563
|
+
let L = `${T}{${A}}`;
|
|
1564
|
+
const K = E.filter((k) => me.includes(k)), D = K.length ? K[K.length - 1] : null, ne = E.includes("dark");
|
|
1565
|
+
return b && D ? L = `@media (prefers-color-scheme: dark) and ${ye[D]}{${L}}` : b ? L = `@media (prefers-color-scheme: dark){${L}}` : ne && D ? L = `@media (prefers-color-scheme: dark) and ${ye[D]}{${L}}` : ne ? L = `@media (prefers-color-scheme: dark){${L}}` : D && (L = `@media ${ye[D]}{${L}}`), L;
|
|
1566
|
+
}
|
|
1567
|
+
for (const v of n) {
|
|
1568
|
+
const b = l(v), y = b.find(
|
|
1569
|
+
(p) => ge[p] || be(p) || xe(p) || ve(p) || le(p)
|
|
1547
1570
|
);
|
|
1548
|
-
if (!
|
|
1549
|
-
const
|
|
1550
|
-
if (
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1571
|
+
if (!y) continue;
|
|
1572
|
+
const x = b.indexOf(y), c = x >= 0 ? b.slice(0, x) : [], g = m(c);
|
|
1573
|
+
if (g === 4) {
|
|
1574
|
+
const p = d(v, !0);
|
|
1575
|
+
p && f.push(p);
|
|
1553
1576
|
} else {
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1577
|
+
const p = d(v);
|
|
1578
|
+
p && (g === 1 ? i.push(p) : g === 2 ? s.push(p) : g === 3 && a.push(p));
|
|
1556
1579
|
}
|
|
1557
1580
|
}
|
|
1558
|
-
const
|
|
1559
|
-
return
|
|
1581
|
+
const $ = [...i, ...s, ...a, ...f].join("");
|
|
1582
|
+
return Ee.set(e, { css: $, timestamp: t }), $;
|
|
1560
1583
|
}
|
|
1561
|
-
const
|
|
1562
|
-
function
|
|
1584
|
+
const te = [];
|
|
1585
|
+
function ct(e, t, r, o, n, i, s, a) {
|
|
1563
1586
|
if (e) {
|
|
1564
|
-
|
|
1587
|
+
te.push(r);
|
|
1565
1588
|
try {
|
|
1566
1589
|
if (t.loadingTemplate && r.isLoading) {
|
|
1567
|
-
|
|
1590
|
+
Y(e, t.loadingTemplate(r), r, o, n);
|
|
1568
1591
|
return;
|
|
1569
1592
|
}
|
|
1570
1593
|
if (t.errorTemplate && r.hasError) {
|
|
1571
|
-
r.error instanceof Error &&
|
|
1594
|
+
r.error instanceof Error && Y(e, t.errorTemplate(r.error, r), r, o, n);
|
|
1572
1595
|
return;
|
|
1573
1596
|
}
|
|
1574
|
-
const
|
|
1575
|
-
if (
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
}).catch((
|
|
1579
|
-
|
|
1580
|
-
}), t.loadingTemplate &&
|
|
1597
|
+
const f = t.render(r);
|
|
1598
|
+
if (f instanceof Promise) {
|
|
1599
|
+
i(!0), f.then((u) => {
|
|
1600
|
+
i(!1), s(null), Y(e, u, r, o, n), a(e.innerHTML);
|
|
1601
|
+
}).catch((u) => {
|
|
1602
|
+
i(!1), s(u), t.errorTemplate && Y(e, t.errorTemplate(u, r), r, o, n);
|
|
1603
|
+
}), t.loadingTemplate && Y(e, t.loadingTemplate(r), r, o, n);
|
|
1581
1604
|
return;
|
|
1582
1605
|
}
|
|
1583
|
-
|
|
1606
|
+
Y(e, f, r, o, n), a(e.innerHTML);
|
|
1584
1607
|
} finally {
|
|
1585
|
-
|
|
1608
|
+
te.pop();
|
|
1586
1609
|
}
|
|
1587
1610
|
}
|
|
1588
1611
|
}
|
|
1589
|
-
function
|
|
1590
|
-
e && (
|
|
1612
|
+
function Y(e, t, r, o, n) {
|
|
1613
|
+
e && (Ye(
|
|
1591
1614
|
e,
|
|
1592
1615
|
Array.isArray(t) ? t : [t],
|
|
1593
1616
|
r,
|
|
1594
1617
|
o
|
|
1595
1618
|
), n(e.innerHTML));
|
|
1596
1619
|
}
|
|
1597
|
-
function
|
|
1598
|
-
if (
|
|
1620
|
+
function ft(e, t, r, o, n, i, s) {
|
|
1621
|
+
if (i !== null && clearTimeout(i), Date.now() - t < 16) {
|
|
1599
1622
|
if (n(r + 1), r > 10) {
|
|
1600
|
-
|
|
1623
|
+
s(null);
|
|
1601
1624
|
return;
|
|
1602
1625
|
}
|
|
1603
1626
|
} else
|
|
1604
1627
|
n(0);
|
|
1605
|
-
const
|
|
1606
|
-
o(Date.now()), e(),
|
|
1628
|
+
const f = setTimeout(() => {
|
|
1629
|
+
o(Date.now()), e(), s(null);
|
|
1607
1630
|
}, 0);
|
|
1608
|
-
|
|
1631
|
+
s(f);
|
|
1609
1632
|
}
|
|
1610
|
-
function
|
|
1633
|
+
function ut(e, t, r, o, n, i) {
|
|
1611
1634
|
if (!e) return;
|
|
1612
|
-
const
|
|
1613
|
-
if (!t.style && (!
|
|
1614
|
-
|
|
1635
|
+
const s = lt(o);
|
|
1636
|
+
if (!t.style && (!s || s.trim() === "")) {
|
|
1637
|
+
i(null), e.adoptedStyleSheets = [_e()];
|
|
1615
1638
|
return;
|
|
1616
1639
|
}
|
|
1617
1640
|
let a = "";
|
|
1618
1641
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1619
|
-
let
|
|
1620
|
-
${
|
|
1642
|
+
let f = Ge(`${a}
|
|
1643
|
+
${s}
|
|
1621
1644
|
`);
|
|
1622
|
-
|
|
1623
|
-
let
|
|
1624
|
-
|
|
1645
|
+
f = Be(f);
|
|
1646
|
+
let u = n;
|
|
1647
|
+
u || (u = new CSSStyleSheet()), (u.cssRules.length === 0 || u.toString() !== f) && u.replaceSync(f), e.adoptedStyleSheets = [_e(), u], i(u);
|
|
1648
|
+
}
|
|
1649
|
+
const ue = /* @__PURE__ */ new Map(), Ae = Symbol.for("cer.registry");
|
|
1650
|
+
if (typeof window < "u") {
|
|
1651
|
+
const e = globalThis;
|
|
1652
|
+
e[Ae] || (e[Ae] = ue);
|
|
1625
1653
|
}
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
let o = me(e);
|
|
1654
|
+
function Te(e, t, r) {
|
|
1655
|
+
let o = J(e);
|
|
1629
1656
|
o.includes("-") || (o = `cer-${o}`);
|
|
1630
1657
|
let n;
|
|
1631
|
-
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (
|
|
1632
|
-
console.error(`[${o}] Error:`,
|
|
1658
|
+
typeof t == "function" ? n = { ...r, render: t } : n = t, typeof n.onError != "function" && (n.onError = (i, s) => {
|
|
1659
|
+
console.error(`[${o}] Error:`, i, s);
|
|
1633
1660
|
});
|
|
1634
1661
|
try {
|
|
1635
|
-
const
|
|
1662
|
+
const i = /* @__PURE__ */ new Set([
|
|
1636
1663
|
"refs",
|
|
1637
1664
|
"requestRender",
|
|
1638
1665
|
"error",
|
|
1639
1666
|
"hasError",
|
|
1640
1667
|
"isLoading",
|
|
1641
1668
|
"emit"
|
|
1642
|
-
]),
|
|
1669
|
+
]), s = [];
|
|
1643
1670
|
if (n.state && typeof n.state == "object" && Object.keys(n.state).forEach((a) => {
|
|
1644
|
-
|
|
1671
|
+
i.has(a) && s.push(a);
|
|
1645
1672
|
}), n.props && typeof n.props == "object" && Object.keys(n.props).forEach((a) => {
|
|
1646
|
-
|
|
1673
|
+
i.has(a) && s.push(a);
|
|
1647
1674
|
}), n.computed && typeof n.computed == "object" && Object.keys(n.computed).forEach((a) => {
|
|
1648
|
-
|
|
1649
|
-
}),
|
|
1650
|
-
const a = Array.from(new Set(
|
|
1675
|
+
i.has(a) && s.push(a);
|
|
1676
|
+
}), s.length > 0) {
|
|
1677
|
+
const a = Array.from(new Set(s));
|
|
1651
1678
|
console.warn(
|
|
1652
1679
|
`[${o}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`
|
|
1653
1680
|
);
|
|
1654
1681
|
}
|
|
1655
1682
|
} catch {
|
|
1656
1683
|
}
|
|
1657
|
-
if (
|
|
1684
|
+
if (ue.set(o, n), typeof window < "u")
|
|
1658
1685
|
if (!customElements.get(o))
|
|
1659
|
-
customElements.define(o,
|
|
1686
|
+
customElements.define(o, dt(o, n));
|
|
1660
1687
|
else
|
|
1661
1688
|
try {
|
|
1662
|
-
document.querySelectorAll(o).forEach((
|
|
1689
|
+
document.querySelectorAll(o).forEach((i) => {
|
|
1663
1690
|
try {
|
|
1664
|
-
typeof
|
|
1691
|
+
typeof i._cfg < "u" && (i._cfg = n), typeof i._render == "function" && i._render(n);
|
|
1665
1692
|
} catch {
|
|
1666
1693
|
}
|
|
1667
1694
|
});
|
|
1668
1695
|
} catch {
|
|
1669
1696
|
}
|
|
1670
1697
|
}
|
|
1671
|
-
function
|
|
1698
|
+
function dt(e, t) {
|
|
1672
1699
|
if (!t.render)
|
|
1673
1700
|
throw new Error(
|
|
1674
1701
|
"Component must have a render function"
|
|
@@ -1712,7 +1739,7 @@ function ft(e, t) {
|
|
|
1712
1739
|
_templateLoading = !1;
|
|
1713
1740
|
_templateError = null;
|
|
1714
1741
|
constructor() {
|
|
1715
|
-
super(), this.attachShadow({ mode: "open" }), this._cfg =
|
|
1742
|
+
super(), this.attachShadow({ mode: "open" }), this._cfg = ue.get(e) || t;
|
|
1716
1743
|
const r = this._initContext(t);
|
|
1717
1744
|
Object.defineProperty(r, "refs", {
|
|
1718
1745
|
value: this._refs,
|
|
@@ -1724,13 +1751,13 @@ function ft(e, t) {
|
|
|
1724
1751
|
writable: !1,
|
|
1725
1752
|
enumerable: !1,
|
|
1726
1753
|
configurable: !1
|
|
1727
|
-
}), this.context = r,
|
|
1728
|
-
value: (n,
|
|
1754
|
+
}), this.context = r, Object.defineProperty(this.context, "emit", {
|
|
1755
|
+
value: (n, i, s) => {
|
|
1729
1756
|
const a = new CustomEvent(n, {
|
|
1730
|
-
detail:
|
|
1757
|
+
detail: i,
|
|
1731
1758
|
bubbles: !0,
|
|
1732
1759
|
composed: !0,
|
|
1733
|
-
...
|
|
1760
|
+
...s || {}
|
|
1734
1761
|
});
|
|
1735
1762
|
return this.dispatchEvent(a), !a.defaultPrevented;
|
|
1736
1763
|
},
|
|
@@ -1738,15 +1765,15 @@ function ft(e, t) {
|
|
|
1738
1765
|
enumerable: !1,
|
|
1739
1766
|
configurable: !1
|
|
1740
1767
|
});
|
|
1741
|
-
const o =
|
|
1768
|
+
const o = ue.get(e) || t;
|
|
1742
1769
|
Object.keys(o).forEach((n) => {
|
|
1743
|
-
const
|
|
1744
|
-
typeof
|
|
1770
|
+
const i = o[n];
|
|
1771
|
+
typeof i == "function" && (this.context[n] = (...s) => i(...s, this.context));
|
|
1745
1772
|
}), this._applyComputed(o), this._initializing = !1, this._initWatchers(o), this._render(o);
|
|
1746
1773
|
}
|
|
1747
1774
|
connectedCallback() {
|
|
1748
1775
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1749
|
-
|
|
1776
|
+
this._applyProps(t), qe(
|
|
1750
1777
|
t,
|
|
1751
1778
|
this.context,
|
|
1752
1779
|
this._mounted,
|
|
@@ -1758,7 +1785,7 @@ function ft(e, t) {
|
|
|
1758
1785
|
}
|
|
1759
1786
|
disconnectedCallback() {
|
|
1760
1787
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1761
|
-
|
|
1788
|
+
De(
|
|
1762
1789
|
t,
|
|
1763
1790
|
this.context,
|
|
1764
1791
|
this._listeners,
|
|
@@ -1782,7 +1809,7 @@ function ft(e, t) {
|
|
|
1782
1809
|
}
|
|
1783
1810
|
attributeChangedCallback(r, o, n) {
|
|
1784
1811
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1785
|
-
this._applyProps(t),
|
|
1812
|
+
this._applyProps(t), Ie(
|
|
1786
1813
|
t,
|
|
1787
1814
|
r,
|
|
1788
1815
|
o,
|
|
@@ -1792,15 +1819,15 @@ function ft(e, t) {
|
|
|
1792
1819
|
});
|
|
1793
1820
|
}
|
|
1794
1821
|
static get observedAttributes() {
|
|
1795
|
-
return t.props ? Object.keys(t.props).map(
|
|
1822
|
+
return t.props ? Object.keys(t.props).map(J) : [];
|
|
1796
1823
|
}
|
|
1797
1824
|
_applyComputed(r) {
|
|
1798
1825
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1799
1826
|
r.computed && Object.entries(r.computed).forEach(([o, n]) => {
|
|
1800
1827
|
Object.defineProperty(this.context, o, {
|
|
1801
1828
|
get: () => {
|
|
1802
|
-
const
|
|
1803
|
-
return
|
|
1829
|
+
const i = n(this.context);
|
|
1830
|
+
return H(i);
|
|
1804
1831
|
},
|
|
1805
1832
|
enumerable: !0
|
|
1806
1833
|
});
|
|
@@ -1810,7 +1837,7 @@ function ft(e, t) {
|
|
|
1810
1837
|
// --- Render ---
|
|
1811
1838
|
_render(r) {
|
|
1812
1839
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1813
|
-
|
|
1840
|
+
ct(
|
|
1814
1841
|
this.shadowRoot,
|
|
1815
1842
|
r,
|
|
1816
1843
|
this.context,
|
|
@@ -1833,7 +1860,7 @@ function ft(e, t) {
|
|
|
1833
1860
|
}
|
|
1834
1861
|
_requestRender() {
|
|
1835
1862
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1836
|
-
|
|
1863
|
+
ft(
|
|
1837
1864
|
() => this._render(this._cfg),
|
|
1838
1865
|
this._lastRenderTime,
|
|
1839
1866
|
this._renderCount,
|
|
@@ -1853,7 +1880,7 @@ function ft(e, t) {
|
|
|
1853
1880
|
// --- Style ---
|
|
1854
1881
|
_applyStyle(r, o) {
|
|
1855
1882
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1856
|
-
|
|
1883
|
+
ut(
|
|
1857
1884
|
this.shadowRoot,
|
|
1858
1885
|
r,
|
|
1859
1886
|
this.context,
|
|
@@ -1880,11 +1907,11 @@ function ft(e, t) {
|
|
|
1880
1907
|
// --- State, props, computed ---
|
|
1881
1908
|
_initContext(r) {
|
|
1882
1909
|
try {
|
|
1883
|
-
let o = function(
|
|
1884
|
-
return Array.isArray(
|
|
1885
|
-
get(a,
|
|
1886
|
-
const
|
|
1887
|
-
return typeof
|
|
1910
|
+
let o = function(i, s = "") {
|
|
1911
|
+
return Array.isArray(i) ? new Proxy(i, {
|
|
1912
|
+
get(a, f, u) {
|
|
1913
|
+
const d = Reflect.get(a, f, u);
|
|
1914
|
+
return typeof d == "function" && typeof f == "string" && [
|
|
1888
1915
|
"push",
|
|
1889
1916
|
"pop",
|
|
1890
1917
|
"shift",
|
|
@@ -1892,44 +1919,44 @@ function ft(e, t) {
|
|
|
1892
1919
|
"splice",
|
|
1893
1920
|
"sort",
|
|
1894
1921
|
"reverse"
|
|
1895
|
-
].includes(
|
|
1896
|
-
const
|
|
1922
|
+
].includes(f) ? function(...l) {
|
|
1923
|
+
const h = d.apply(a, l);
|
|
1897
1924
|
if (!n._initializing) {
|
|
1898
|
-
const w =
|
|
1925
|
+
const w = s || "root";
|
|
1899
1926
|
n._triggerWatchers(w, a), n._render(r);
|
|
1900
1927
|
}
|
|
1901
|
-
return
|
|
1902
|
-
} :
|
|
1928
|
+
return h;
|
|
1929
|
+
} : d;
|
|
1903
1930
|
},
|
|
1904
|
-
set(a,
|
|
1905
|
-
if (a[
|
|
1906
|
-
const
|
|
1907
|
-
n._triggerWatchers(
|
|
1931
|
+
set(a, f, u) {
|
|
1932
|
+
if (a[f] = u, !n._initializing) {
|
|
1933
|
+
const d = s ? `${s}.${String(f)}` : String(f);
|
|
1934
|
+
n._triggerWatchers(d, u), n._render(r);
|
|
1908
1935
|
}
|
|
1909
1936
|
return !0;
|
|
1910
1937
|
},
|
|
1911
|
-
deleteProperty(a,
|
|
1912
|
-
if (delete a[
|
|
1913
|
-
const
|
|
1914
|
-
n._triggerWatchers(
|
|
1938
|
+
deleteProperty(a, f) {
|
|
1939
|
+
if (delete a[f], !n._initializing) {
|
|
1940
|
+
const u = s ? `${s}.${String(f)}` : String(f);
|
|
1941
|
+
n._triggerWatchers(u, void 0), n._render(r);
|
|
1915
1942
|
}
|
|
1916
1943
|
return !0;
|
|
1917
1944
|
}
|
|
1918
|
-
}) :
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1921
|
-
}), new Proxy(
|
|
1922
|
-
set(a,
|
|
1923
|
-
const
|
|
1924
|
-
return a[
|
|
1925
|
-
|
|
1926
|
-
a[
|
|
1945
|
+
}) : i && typeof i == "object" ? (Object.keys(i).forEach((a) => {
|
|
1946
|
+
const f = s ? `${s}.${a}` : a;
|
|
1947
|
+
i[a] = o(i[a], f);
|
|
1948
|
+
}), new Proxy(i, {
|
|
1949
|
+
set(a, f, u) {
|
|
1950
|
+
const d = s ? `${s}.${String(f)}` : String(f);
|
|
1951
|
+
return a[f] = o(u, d), n._initializing || (n._triggerWatchers(
|
|
1952
|
+
d,
|
|
1953
|
+
a[f]
|
|
1927
1954
|
), n._render(r)), !0;
|
|
1928
1955
|
},
|
|
1929
|
-
get(a,
|
|
1930
|
-
return Reflect.get(a,
|
|
1956
|
+
get(a, f, u) {
|
|
1957
|
+
return Reflect.get(a, f, u);
|
|
1931
1958
|
}
|
|
1932
|
-
})) :
|
|
1959
|
+
})) : i;
|
|
1933
1960
|
};
|
|
1934
1961
|
const n = this;
|
|
1935
1962
|
return o({ ...r.state });
|
|
@@ -1939,7 +1966,7 @@ function ft(e, t) {
|
|
|
1939
1966
|
}
|
|
1940
1967
|
_initWatchers(r) {
|
|
1941
1968
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1942
|
-
|
|
1969
|
+
Ne(
|
|
1943
1970
|
this.context,
|
|
1944
1971
|
this._watchers,
|
|
1945
1972
|
r.watch || {}
|
|
@@ -1947,12 +1974,12 @@ function ft(e, t) {
|
|
|
1947
1974
|
});
|
|
1948
1975
|
}
|
|
1949
1976
|
_triggerWatchers(r, o) {
|
|
1950
|
-
|
|
1977
|
+
Me(this.context, this._watchers, r, o);
|
|
1951
1978
|
}
|
|
1952
1979
|
_applyProps(r) {
|
|
1953
1980
|
this._runLogicWithinErrorBoundary(r, () => {
|
|
1954
1981
|
try {
|
|
1955
|
-
|
|
1982
|
+
We(this, r, this.context);
|
|
1956
1983
|
} catch (o) {
|
|
1957
1984
|
this._hasError = !0, r.onError && r.onError(o, this.context), r.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = r.errorFallback(o, this.context));
|
|
1958
1985
|
}
|
|
@@ -1960,102 +1987,103 @@ function ft(e, t) {
|
|
|
1960
1987
|
}
|
|
1961
1988
|
};
|
|
1962
1989
|
}
|
|
1963
|
-
function
|
|
1990
|
+
function ee(e, t = {}, r, o) {
|
|
1964
1991
|
const n = o ?? t.key;
|
|
1965
1992
|
return { tag: e, key: n, props: t, children: r };
|
|
1966
1993
|
}
|
|
1967
|
-
function
|
|
1994
|
+
function ce(e) {
|
|
1968
1995
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1969
1996
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
1997
|
+
function ie(e) {
|
|
1998
|
+
return typeof e == "object" && e !== null && "tag" in e && !ce(e);
|
|
1972
1999
|
}
|
|
1973
|
-
function
|
|
2000
|
+
function pt(e, t) {
|
|
1974
2001
|
return e.key != null ? e : { ...e, key: t };
|
|
1975
2002
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const o = {}, n = {},
|
|
2003
|
+
function ht(e, t = [], r = {}) {
|
|
2004
|
+
const o = {}, n = {}, i = {}, s = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
1978
2005
|
let a;
|
|
1979
|
-
for (; a =
|
|
1980
|
-
const
|
|
1981
|
-
let
|
|
1982
|
-
|
|
1983
|
-
const
|
|
1984
|
-
if (
|
|
1985
|
-
const [w, ...
|
|
1986
|
-
if (
|
|
1987
|
-
const
|
|
1988
|
-
|
|
1989
|
-
value:
|
|
1990
|
-
modifiers:
|
|
2006
|
+
for (; a = s.exec(e); ) {
|
|
2007
|
+
const f = a[1], u = a[2], d = (a[4] || a[6]) ?? "", m = d.match(/^{{(\d+)}}$/);
|
|
2008
|
+
let l = m ? t[Number(m[1])] ?? null : d;
|
|
2009
|
+
m || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
2010
|
+
const h = ["model", "bind", "show", "class", "style"];
|
|
2011
|
+
if (f === ":") {
|
|
2012
|
+
const [w, $] = u.split(":"), [v, ...b] = w.split(".");
|
|
2013
|
+
if (h.includes(v)) {
|
|
2014
|
+
const y = [...b], x = v === "model" && $ ? `model:${$}` : v;
|
|
2015
|
+
i[x] = {
|
|
2016
|
+
value: l,
|
|
2017
|
+
modifiers: y,
|
|
2018
|
+
arg: $
|
|
1991
2019
|
};
|
|
1992
2020
|
} else
|
|
1993
|
-
n[
|
|
1994
|
-
} else if (
|
|
1995
|
-
const w = "on" +
|
|
1996
|
-
o[w] = typeof
|
|
1997
|
-
} else
|
|
1998
|
-
}
|
|
1999
|
-
return { props: o, attrs: n, directives:
|
|
2000
|
-
}
|
|
2001
|
-
function
|
|
2002
|
-
const o =
|
|
2003
|
-
function
|
|
2004
|
-
return
|
|
2005
|
-
}
|
|
2006
|
-
let
|
|
2007
|
-
for (let
|
|
2008
|
-
|
|
2009
|
-
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,
|
|
2010
|
-
let
|
|
2011
|
-
function
|
|
2012
|
-
!
|
|
2013
|
-
if (
|
|
2014
|
-
const
|
|
2021
|
+
n[u] = l;
|
|
2022
|
+
} else if (f === "@") {
|
|
2023
|
+
const w = "on" + u.charAt(0).toUpperCase() + u.slice(1);
|
|
2024
|
+
o[w] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
2025
|
+
} else u === "ref" ? o.ref = l : n[u] = l;
|
|
2026
|
+
}
|
|
2027
|
+
return { props: o, attrs: n, directives: i };
|
|
2028
|
+
}
|
|
2029
|
+
function gt(e, t, r) {
|
|
2030
|
+
const o = te.length > 0 ? te[te.length - 1] : void 0, n = r ?? o;
|
|
2031
|
+
function i(c, g) {
|
|
2032
|
+
return ee("#text", {}, c, g);
|
|
2033
|
+
}
|
|
2034
|
+
let s = "";
|
|
2035
|
+
for (let c = 0; c < e.length; c++)
|
|
2036
|
+
s += e[c], c < t.length && (s += `{{${c}}}`);
|
|
2037
|
+
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, f = [];
|
|
2038
|
+
let u, d = [], m = null, l = {}, h, w = 0, $ = [];
|
|
2039
|
+
function v(c) {
|
|
2040
|
+
!c || typeof c != "object" || ce(c) || (c.props || c.attrs ? (c.props && (l.props || (l.props = {}), Object.assign(l.props, c.props)), c.attrs && (l.attrs || (l.attrs = {}), Object.keys(c.attrs).forEach((g) => {
|
|
2041
|
+
if (g === "style" && l.attrs.style) {
|
|
2042
|
+
const p = l.attrs.style.replace(
|
|
2015
2043
|
/;?\s*$/,
|
|
2016
2044
|
""
|
|
2017
|
-
),
|
|
2018
|
-
|
|
2019
|
-
} else if (
|
|
2020
|
-
const
|
|
2021
|
-
.../* @__PURE__ */ new Set([...
|
|
2045
|
+
), _ = c.attrs.style.replace(/^;?\s*/, "");
|
|
2046
|
+
l.attrs.style = p + "; " + _;
|
|
2047
|
+
} else if (g === "class" && l.attrs.class) {
|
|
2048
|
+
const p = l.attrs.class.trim().split(/\s+/).filter(Boolean), _ = c.attrs.class.trim().split(/\s+/).filter(Boolean), E = [
|
|
2049
|
+
.../* @__PURE__ */ new Set([...p, ..._])
|
|
2022
2050
|
];
|
|
2023
|
-
|
|
2051
|
+
l.attrs.class = E.join(" ");
|
|
2024
2052
|
} else
|
|
2025
|
-
|
|
2026
|
-
}))) : (
|
|
2027
|
-
}
|
|
2028
|
-
function
|
|
2029
|
-
const
|
|
2030
|
-
if (
|
|
2031
|
-
const
|
|
2032
|
-
let
|
|
2033
|
-
|
|
2034
|
-
...
|
|
2035
|
-
key:
|
|
2036
|
-
children:
|
|
2053
|
+
l.attrs[g] = c.attrs[g];
|
|
2054
|
+
}))) : (l.props || (l.props = {}), Object.assign(l.props, c)));
|
|
2055
|
+
}
|
|
2056
|
+
function b(c, g) {
|
|
2057
|
+
const p = m ? d : $;
|
|
2058
|
+
if (ce(c)) {
|
|
2059
|
+
const _ = c.key ?? g;
|
|
2060
|
+
let E = c.children;
|
|
2061
|
+
p.push({
|
|
2062
|
+
...c,
|
|
2063
|
+
key: _,
|
|
2064
|
+
children: E
|
|
2037
2065
|
});
|
|
2038
2066
|
return;
|
|
2039
2067
|
}
|
|
2040
|
-
if (
|
|
2041
|
-
|
|
2068
|
+
if (ie(c)) {
|
|
2069
|
+
p.push(pt(c, void 0));
|
|
2042
2070
|
return;
|
|
2043
2071
|
}
|
|
2044
|
-
if (Array.isArray(
|
|
2045
|
-
if (
|
|
2046
|
-
for (let
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2072
|
+
if (Array.isArray(c)) {
|
|
2073
|
+
if (c.length === 0) return;
|
|
2074
|
+
for (let _ = 0; _ < c.length; _++) {
|
|
2075
|
+
const E = c[_];
|
|
2076
|
+
ce(E) || ie(E) || Array.isArray(E) ? b(E, `${g}-${_}`) : E !== null && typeof E == "object" ? v(E) : p.push(i(String(E), `${g}-${_}`));
|
|
2049
2077
|
}
|
|
2050
2078
|
return;
|
|
2051
2079
|
}
|
|
2052
|
-
if (
|
|
2053
|
-
|
|
2080
|
+
if (c !== null && typeof c == "object") {
|
|
2081
|
+
v(c);
|
|
2054
2082
|
return;
|
|
2055
2083
|
}
|
|
2056
|
-
|
|
2084
|
+
p.push(i(String(c), g));
|
|
2057
2085
|
}
|
|
2058
|
-
const
|
|
2086
|
+
const y = /* @__PURE__ */ new Set([
|
|
2059
2087
|
"area",
|
|
2060
2088
|
"base",
|
|
2061
2089
|
"br",
|
|
@@ -2071,232 +2099,257 @@ function pt(e, t, r) {
|
|
|
2071
2099
|
"track",
|
|
2072
2100
|
"wbr"
|
|
2073
2101
|
]);
|
|
2074
|
-
for (;
|
|
2075
|
-
if (
|
|
2076
|
-
const
|
|
2077
|
-
props:
|
|
2078
|
-
attrs:
|
|
2102
|
+
for (; u = a.exec(s); )
|
|
2103
|
+
if (u[1]) {
|
|
2104
|
+
const c = u[1], g = u[0][1] === "/", p = u[0][u[0].length - 2] === "/" || y.has(c), {
|
|
2105
|
+
props: _,
|
|
2106
|
+
attrs: E,
|
|
2079
2107
|
directives: C
|
|
2080
|
-
} =
|
|
2081
|
-
for (const
|
|
2082
|
-
for (const
|
|
2083
|
-
if (Object.keys(C).
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
c
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
+
} = ht(u[2] || "", t, n), S = { props: {}, attrs: {} };
|
|
2109
|
+
for (const A in _) S.props[A] = _[A];
|
|
2110
|
+
for (const A in E) S.attrs[A] = E[A];
|
|
2111
|
+
if (C && Object.keys(C).some((A) => A === "model" || A.startsWith("model:")))
|
|
2112
|
+
try {
|
|
2113
|
+
const A = Symbol.for("cer.registry"), T = globalThis[A], Q = !!(T && typeof T.has == "function" && T.has(c)), X = !!(n && (n.__customElements instanceof Set && n.__customElements.has(c) || Array.isArray(n.__isCustomElements) && n.__isCustomElements.includes(c)));
|
|
2114
|
+
if (!!(c.includes("-") || X || Q))
|
|
2115
|
+
for (const I of Object.keys(C)) {
|
|
2116
|
+
if (I !== "model" && !I.startsWith("model:")) continue;
|
|
2117
|
+
const Z = C[I], F = Z.arg ?? (I.includes(":") ? I.split(":", 2)[1] : void 0), L = Z.value, K = F ?? "modelValue", D = N, ne = se, k = n ? n._state || n : void 0;
|
|
2118
|
+
let B;
|
|
2119
|
+
typeof L == "string" && n ? B = D(k, L) : B = L, S.props[K] = B;
|
|
2120
|
+
try {
|
|
2121
|
+
const j = J(K);
|
|
2122
|
+
S.attrs || (S.attrs = {}), B !== void 0 && (S.attrs[j] = B);
|
|
2123
|
+
} catch {
|
|
2124
|
+
}
|
|
2125
|
+
S.isCustomElement = !0;
|
|
2126
|
+
const z = `update:${J(K)}`, O = "on" + z.charAt(0).toUpperCase() + z.slice(1);
|
|
2127
|
+
S.props[O] = function(j) {
|
|
2128
|
+
const R = j.detail !== void 0 ? j.detail : j.target ? j.target.value : void 0;
|
|
2129
|
+
if (!k) return;
|
|
2130
|
+
const pe = D(k, typeof L == "string" ? L : String(L));
|
|
2131
|
+
(Array.isArray(R) && Array.isArray(pe) ? JSON.stringify([...R].sort()) !== JSON.stringify([...pe].sort()) : R !== pe) && (ne(k, typeof L == "string" ? L : String(L), R), n?.requestRender ? n.requestRender() : n?._requestRender && n._requestRender());
|
|
2132
|
+
}, delete C[I];
|
|
2133
|
+
}
|
|
2134
|
+
} catch {
|
|
2135
|
+
}
|
|
2136
|
+
if (Object.keys(C).length > 0 && (S.directives = { ...C }), g) {
|
|
2137
|
+
const A = ee(
|
|
2138
|
+
m,
|
|
2139
|
+
l,
|
|
2140
|
+
d.length === 1 && ie(d[0]) && d[0].tag === "#text" ? typeof d[0].children == "string" ? d[0].children : "" : d.length ? d : void 0,
|
|
2141
|
+
h
|
|
2142
|
+
), T = f.pop();
|
|
2143
|
+
T ? (m = T.tag, l = T.props, h = T.key, d = T.children, d.push(A)) : ($.push(A), m = null, l = {}, h = void 0, d = []);
|
|
2144
|
+
} else p ? m ? d.push(ee(c, S, void 0, void 0)) : $.push(ee(c, S, void 0, void 0)) : (m && f.push({
|
|
2145
|
+
tag: m,
|
|
2146
|
+
props: l,
|
|
2147
|
+
children: d,
|
|
2148
|
+
key: h
|
|
2149
|
+
}), m = c, l = S, d = []);
|
|
2150
|
+
} else if (typeof u[3] < "u") {
|
|
2151
|
+
const c = Number(u[3]), g = t[c], p = `interp-${c}`;
|
|
2152
|
+
b(g, p);
|
|
2153
|
+
} else if (u[4]) {
|
|
2154
|
+
const c = u[4], g = m ? d : $, p = c.split(/({{\d+}})/);
|
|
2155
|
+
for (const _ of p) {
|
|
2156
|
+
if (!_) continue;
|
|
2157
|
+
const E = _.match(/^{{(\d+)}}$/);
|
|
2158
|
+
if (E) {
|
|
2159
|
+
const C = Number(E[1]), S = t[C], A = `interp-${C}`;
|
|
2160
|
+
b(S, A);
|
|
2108
2161
|
} else {
|
|
2109
2162
|
const C = `text-${w++}`;
|
|
2110
|
-
|
|
2163
|
+
g.push(i(_, C));
|
|
2111
2164
|
}
|
|
2112
2165
|
}
|
|
2113
2166
|
}
|
|
2114
|
-
const
|
|
2115
|
-
return
|
|
2167
|
+
const x = $.filter((c) => ie(c) && c.tag === "#text" ? typeof c.children == "string" && c.children.trim() !== "" : !0);
|
|
2168
|
+
return x.length === 1 ? x[0] : x.length > 1 ? x : ee("div", {}, "", "fallback-root");
|
|
2116
2169
|
}
|
|
2117
|
-
function
|
|
2170
|
+
function U(e, ...t) {
|
|
2118
2171
|
const r = t[t.length - 1], o = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2119
|
-
return
|
|
2172
|
+
return gt(e, t, o);
|
|
2120
2173
|
}
|
|
2121
|
-
const
|
|
2174
|
+
const je = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, W = (e, t) => {
|
|
2122
2175
|
for (const r of e) {
|
|
2123
|
-
const o = [], n = r.path.replace(/:[^/]+/g, (a) => (o.push(a.slice(1)), "([^/]+)")),
|
|
2124
|
-
if (
|
|
2176
|
+
const o = [], n = r.path.replace(/:[^/]+/g, (a) => (o.push(a.slice(1)), "([^/]+)")), i = new RegExp(`^${n}$`), s = t.match(i);
|
|
2177
|
+
if (s) {
|
|
2125
2178
|
const a = {};
|
|
2126
|
-
return o.forEach((
|
|
2127
|
-
a[
|
|
2179
|
+
return o.forEach((f, u) => {
|
|
2180
|
+
a[f] = s[u + 1];
|
|
2128
2181
|
}), { route: r, params: a };
|
|
2129
2182
|
}
|
|
2130
2183
|
}
|
|
2131
2184
|
return { route: null, params: {} };
|
|
2132
|
-
},
|
|
2133
|
-
async function
|
|
2185
|
+
}, we = {};
|
|
2186
|
+
async function yt(e) {
|
|
2134
2187
|
if (e.component) return e.component;
|
|
2135
2188
|
if (e.load) {
|
|
2136
|
-
if (
|
|
2189
|
+
if (we[e.path]) return we[e.path];
|
|
2137
2190
|
try {
|
|
2138
2191
|
const t = await e.load();
|
|
2139
|
-
return
|
|
2192
|
+
return we[e.path] = t.default, t.default;
|
|
2140
2193
|
} catch {
|
|
2141
2194
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2142
2195
|
}
|
|
2143
2196
|
}
|
|
2144
2197
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2145
2198
|
}
|
|
2146
|
-
function
|
|
2199
|
+
function mt(e) {
|
|
2147
2200
|
const { routes: t, base: r = "", initialUrl: o } = e;
|
|
2148
|
-
let n,
|
|
2149
|
-
const
|
|
2150
|
-
const
|
|
2151
|
-
if (
|
|
2201
|
+
let n, i, s, a, f, u, d;
|
|
2202
|
+
const m = async ($, v) => {
|
|
2203
|
+
const b = t.find((y) => W([y], $.path).route !== null);
|
|
2204
|
+
if (b?.beforeEnter)
|
|
2152
2205
|
try {
|
|
2153
|
-
const
|
|
2154
|
-
return typeof
|
|
2155
|
-
} catch (
|
|
2156
|
-
return console.error("beforeEnter error",
|
|
2206
|
+
const y = await b.beforeEnter($, v);
|
|
2207
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2208
|
+
} catch (y) {
|
|
2209
|
+
return console.error("beforeEnter error", y), !1;
|
|
2157
2210
|
}
|
|
2158
2211
|
return !0;
|
|
2159
|
-
},
|
|
2160
|
-
const
|
|
2161
|
-
if (
|
|
2212
|
+
}, l = async ($, v) => {
|
|
2213
|
+
const b = t.find((y) => W([y], $.path).route !== null);
|
|
2214
|
+
if (b?.onEnter)
|
|
2162
2215
|
try {
|
|
2163
|
-
const
|
|
2164
|
-
return typeof
|
|
2165
|
-
} catch (
|
|
2166
|
-
return console.error("onEnter error",
|
|
2216
|
+
const y = await b.onEnter($, v);
|
|
2217
|
+
return typeof y == "string" ? (await w(y, !0), !1) : y !== !1;
|
|
2218
|
+
} catch (y) {
|
|
2219
|
+
return console.error("onEnter error", y), !1;
|
|
2167
2220
|
}
|
|
2168
2221
|
return !0;
|
|
2169
|
-
},
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2222
|
+
}, h = ($, v) => {
|
|
2223
|
+
const b = t.find((y) => W([y], $.path).route !== null);
|
|
2224
|
+
if (b?.afterEnter)
|
|
2172
2225
|
try {
|
|
2173
|
-
|
|
2174
|
-
} catch (
|
|
2175
|
-
console.error("afterEnter error",
|
|
2226
|
+
b.afterEnter($, v);
|
|
2227
|
+
} catch (y) {
|
|
2228
|
+
console.error("afterEnter error", y);
|
|
2176
2229
|
}
|
|
2177
|
-
}, w = async (
|
|
2230
|
+
}, w = async ($, v = !1) => {
|
|
2178
2231
|
try {
|
|
2179
|
-
const
|
|
2180
|
-
path:
|
|
2232
|
+
const b = {
|
|
2233
|
+
path: $.replace(r, "") || "/",
|
|
2181
2234
|
query: {}
|
|
2182
|
-
},
|
|
2183
|
-
if (!
|
|
2184
|
-
const
|
|
2185
|
-
path:
|
|
2186
|
-
params:
|
|
2187
|
-
query:
|
|
2235
|
+
}, y = W(t, b.path);
|
|
2236
|
+
if (!y) throw new Error(`No route found for ${b.path}`);
|
|
2237
|
+
const x = s.getState(), c = {
|
|
2238
|
+
path: b.path,
|
|
2239
|
+
params: y.params,
|
|
2240
|
+
query: b.query
|
|
2188
2241
|
};
|
|
2189
|
-
if (!await
|
|
2190
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2191
|
-
} catch (
|
|
2192
|
-
console.error("Navigation error:",
|
|
2242
|
+
if (!await m(c, x) || !await l(c, x)) return;
|
|
2243
|
+
typeof window < "u" && typeof document < "u" && (v ? window.history.replaceState({}, "", r + $) : window.history.pushState({}, "", r + $)), s.setState(c), h(c, x);
|
|
2244
|
+
} catch (b) {
|
|
2245
|
+
console.error("Navigation error:", b);
|
|
2193
2246
|
}
|
|
2194
2247
|
};
|
|
2195
2248
|
if (typeof window < "u" && typeof document < "u") {
|
|
2196
2249
|
n = () => {
|
|
2197
|
-
const
|
|
2198
|
-
return { path:
|
|
2199
|
-
},
|
|
2200
|
-
const
|
|
2201
|
-
|
|
2202
|
-
path:
|
|
2203
|
-
params:
|
|
2204
|
-
query:
|
|
2205
|
-
}), a = async (
|
|
2206
|
-
const
|
|
2207
|
-
await w(
|
|
2208
|
-
}, window.addEventListener("popstate", () => a(!0)),
|
|
2250
|
+
const v = new URL(window.location.href), b = v.pathname.replace(r, "") || "/", y = je(v.search);
|
|
2251
|
+
return { path: b, query: y };
|
|
2252
|
+
}, i = n();
|
|
2253
|
+
const $ = W(t, i.path);
|
|
2254
|
+
s = $e({
|
|
2255
|
+
path: i.path,
|
|
2256
|
+
params: $.params,
|
|
2257
|
+
query: i.query
|
|
2258
|
+
}), a = async (v = !1) => {
|
|
2259
|
+
const b = n();
|
|
2260
|
+
await w(b.path, v);
|
|
2261
|
+
}, window.addEventListener("popstate", () => a(!0)), f = (v) => w(v, !1), u = (v) => w(v, !0), d = () => window.history.back();
|
|
2209
2262
|
} else {
|
|
2210
2263
|
n = () => {
|
|
2211
|
-
const
|
|
2212
|
-
return { path:
|
|
2213
|
-
},
|
|
2214
|
-
const
|
|
2215
|
-
|
|
2216
|
-
path:
|
|
2217
|
-
params:
|
|
2218
|
-
query:
|
|
2264
|
+
const b = new URL(o || "/", "http://localhost"), y = b.pathname.replace(r, "") || "/", x = je(b.search);
|
|
2265
|
+
return { path: y, query: x };
|
|
2266
|
+
}, i = n();
|
|
2267
|
+
const $ = W(t, i.path);
|
|
2268
|
+
s = $e({
|
|
2269
|
+
path: i.path,
|
|
2270
|
+
params: $.params,
|
|
2271
|
+
query: i.query
|
|
2219
2272
|
}), a = async () => {
|
|
2220
|
-
const
|
|
2221
|
-
await
|
|
2273
|
+
const b = n();
|
|
2274
|
+
await v(b.path);
|
|
2222
2275
|
};
|
|
2223
|
-
const
|
|
2276
|
+
const v = async (b) => {
|
|
2224
2277
|
try {
|
|
2225
|
-
const
|
|
2226
|
-
path:
|
|
2278
|
+
const y = {
|
|
2279
|
+
path: b.replace(r, "") || "/",
|
|
2227
2280
|
query: {}
|
|
2228
|
-
},
|
|
2229
|
-
if (!
|
|
2230
|
-
const
|
|
2231
|
-
path:
|
|
2232
|
-
params:
|
|
2233
|
-
query:
|
|
2234
|
-
},
|
|
2235
|
-
if (
|
|
2281
|
+
}, x = W(t, y.path);
|
|
2282
|
+
if (!x) throw new Error(`No route found for ${y.path}`);
|
|
2283
|
+
const c = s.getState(), g = {
|
|
2284
|
+
path: y.path,
|
|
2285
|
+
params: x.params,
|
|
2286
|
+
query: y.query
|
|
2287
|
+
}, p = t.find((_) => W([_], g.path).route !== null);
|
|
2288
|
+
if (p?.beforeEnter)
|
|
2236
2289
|
try {
|
|
2237
|
-
const
|
|
2238
|
-
if (typeof
|
|
2239
|
-
await
|
|
2290
|
+
const _ = await p.beforeEnter(g, c);
|
|
2291
|
+
if (typeof _ == "string") {
|
|
2292
|
+
await v(_);
|
|
2240
2293
|
return;
|
|
2241
2294
|
}
|
|
2242
|
-
if (
|
|
2295
|
+
if (_ === !1) return;
|
|
2243
2296
|
} catch {
|
|
2244
2297
|
return;
|
|
2245
2298
|
}
|
|
2246
|
-
if (
|
|
2299
|
+
if (p?.onEnter)
|
|
2247
2300
|
try {
|
|
2248
|
-
const
|
|
2249
|
-
if (typeof
|
|
2250
|
-
await
|
|
2301
|
+
const _ = await p.onEnter(g, c);
|
|
2302
|
+
if (typeof _ == "string") {
|
|
2303
|
+
await v(_);
|
|
2251
2304
|
return;
|
|
2252
2305
|
}
|
|
2253
|
-
if (
|
|
2306
|
+
if (_ === !1) return;
|
|
2254
2307
|
} catch {
|
|
2255
2308
|
return;
|
|
2256
2309
|
}
|
|
2257
|
-
if (
|
|
2310
|
+
if (s.setState(g), p?.afterEnter)
|
|
2258
2311
|
try {
|
|
2259
|
-
|
|
2312
|
+
p.afterEnter(g, c);
|
|
2260
2313
|
} catch {
|
|
2261
2314
|
}
|
|
2262
2315
|
} catch {
|
|
2263
2316
|
}
|
|
2264
2317
|
};
|
|
2265
|
-
|
|
2318
|
+
f = async (b) => v(b), u = async (b) => v(b), d = () => {
|
|
2266
2319
|
};
|
|
2267
2320
|
}
|
|
2268
2321
|
return {
|
|
2269
|
-
store:
|
|
2270
|
-
push:
|
|
2271
|
-
replace:
|
|
2272
|
-
back:
|
|
2273
|
-
subscribe:
|
|
2274
|
-
matchRoute: (
|
|
2275
|
-
getCurrent: () =>
|
|
2276
|
-
resolveRouteComponent:
|
|
2322
|
+
store: s,
|
|
2323
|
+
push: f,
|
|
2324
|
+
replace: u,
|
|
2325
|
+
back: d,
|
|
2326
|
+
subscribe: s.subscribe,
|
|
2327
|
+
matchRoute: ($) => W(t, $),
|
|
2328
|
+
getCurrent: () => s.getState(),
|
|
2329
|
+
resolveRouteComponent: yt
|
|
2277
2330
|
};
|
|
2278
2331
|
}
|
|
2279
|
-
function
|
|
2280
|
-
return
|
|
2332
|
+
function Ct(e, t) {
|
|
2333
|
+
return W(e, t);
|
|
2281
2334
|
}
|
|
2282
|
-
function
|
|
2283
|
-
const t =
|
|
2284
|
-
return
|
|
2335
|
+
function Et(e) {
|
|
2336
|
+
const t = mt(e);
|
|
2337
|
+
return Te("router-view", {
|
|
2285
2338
|
async render() {
|
|
2286
|
-
if (!t) return
|
|
2339
|
+
if (!t) return U`<div>Router not initialized.</div>`;
|
|
2287
2340
|
const r = t.getCurrent(), { path: o } = r, n = t.matchRoute(o);
|
|
2288
|
-
if (!n.route) return
|
|
2341
|
+
if (!n.route) return U`<div>Not found</div>`;
|
|
2289
2342
|
try {
|
|
2290
|
-
const
|
|
2291
|
-
if (typeof
|
|
2292
|
-
return { tag:
|
|
2293
|
-
if (typeof
|
|
2294
|
-
const
|
|
2343
|
+
const i = await t.resolveRouteComponent(n.route);
|
|
2344
|
+
if (typeof i == "string")
|
|
2345
|
+
return { tag: i, props: {}, children: [] };
|
|
2346
|
+
if (typeof i == "function") {
|
|
2347
|
+
const s = i(), a = s instanceof Promise ? await s : s;
|
|
2295
2348
|
return typeof a == "string" ? { tag: a, props: {}, children: [] } : a;
|
|
2296
2349
|
}
|
|
2297
|
-
return
|
|
2350
|
+
return U`<div>Invalid route component</div>`;
|
|
2298
2351
|
} catch {
|
|
2299
|
-
return
|
|
2352
|
+
return U`<div>Invalid route component</div>`;
|
|
2300
2353
|
}
|
|
2301
2354
|
},
|
|
2302
2355
|
onConnected(r) {
|
|
@@ -2304,7 +2357,7 @@ function St(e) {
|
|
|
2304
2357
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2305
2358
|
});
|
|
2306
2359
|
}
|
|
2307
|
-
}),
|
|
2360
|
+
}), Te("router-link", {
|
|
2308
2361
|
state: {},
|
|
2309
2362
|
props: {
|
|
2310
2363
|
to: { type: String, default: "" },
|
|
@@ -2317,7 +2370,7 @@ function St(e) {
|
|
|
2317
2370
|
disabled: { type: Boolean, default: !1 },
|
|
2318
2371
|
external: { type: Boolean, default: !1 },
|
|
2319
2372
|
class: { type: String, default: "" },
|
|
2320
|
-
style: { type: String, default:
|
|
2373
|
+
style: { type: String, default: ze`
|
|
2321
2374
|
[aria-disabled="true"] {
|
|
2322
2375
|
pointer-events: none;
|
|
2323
2376
|
opacity: 0.5;
|
|
@@ -2326,32 +2379,32 @@ function St(e) {
|
|
|
2326
2379
|
},
|
|
2327
2380
|
style: (r) => r.style,
|
|
2328
2381
|
render: (r) => {
|
|
2329
|
-
const o = t.getCurrent(), n = r.to,
|
|
2330
|
-
for (const
|
|
2331
|
-
const
|
|
2332
|
-
...
|
|
2382
|
+
const o = t.getCurrent(), n = r.to, i = r.exact, s = r.exactActiveClass, a = r.activeClass, f = r.ariaCurrentValue, u = r.tag, d = r.disabled, m = r.external, l = o.path === n, h = i ? l : o && typeof o.path == "string" ? o.path.startsWith(n) : !1, w = l ? `aria-current="${f}"` : "", $ = (r.class || "").split(/\s+/).filter(Boolean), v = {};
|
|
2383
|
+
for (const g of $) v[g] = !0;
|
|
2384
|
+
const b = {
|
|
2385
|
+
...v,
|
|
2333
2386
|
// Also include the configurable names (may duplicate the above)
|
|
2334
|
-
[a]:
|
|
2335
|
-
[
|
|
2336
|
-
},
|
|
2337
|
-
return
|
|
2338
|
-
${
|
|
2387
|
+
[a]: h,
|
|
2388
|
+
[s]: l
|
|
2389
|
+
}, y = u === "button", x = d ? y ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", c = m && (u === "a" || !u) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2390
|
+
return U`
|
|
2391
|
+
${Oe().when(y, U`
|
|
2339
2392
|
<button
|
|
2340
2393
|
part="button"
|
|
2341
|
-
:class="${
|
|
2394
|
+
:class="${b}"
|
|
2342
2395
|
${w}
|
|
2343
|
-
${
|
|
2344
|
-
${
|
|
2396
|
+
${x}
|
|
2397
|
+
${c}
|
|
2345
2398
|
@click="navigate"
|
|
2346
2399
|
><slot></slot></button>
|
|
2347
|
-
`).otherwise(
|
|
2400
|
+
`).otherwise(U`
|
|
2348
2401
|
<a
|
|
2349
2402
|
part="link"
|
|
2350
2403
|
href="${n}"
|
|
2351
|
-
:class="${
|
|
2404
|
+
:class="${b}"
|
|
2352
2405
|
${w}
|
|
2353
|
-
${
|
|
2354
|
-
${
|
|
2406
|
+
${x}
|
|
2407
|
+
${c}
|
|
2355
2408
|
@click="navigate"
|
|
2356
2409
|
><slot></slot></a>
|
|
2357
2410
|
`).done()}
|
|
@@ -2367,25 +2420,26 @@ function St(e) {
|
|
|
2367
2420
|
}), t;
|
|
2368
2421
|
}
|
|
2369
2422
|
export {
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2423
|
+
G as GlobalEventBus,
|
|
2424
|
+
Te as component,
|
|
2425
|
+
$e as createStore,
|
|
2426
|
+
ze as css,
|
|
2427
|
+
xt as each,
|
|
2428
|
+
wt as emit,
|
|
2429
|
+
re as eventBus,
|
|
2430
|
+
U as html,
|
|
2431
|
+
Et as initRouter,
|
|
2432
|
+
St as listen,
|
|
2433
|
+
Oe as match,
|
|
2434
|
+
W as matchRoute,
|
|
2435
|
+
Ct as matchRouteSSR,
|
|
2436
|
+
$t as off,
|
|
2437
|
+
kt as on,
|
|
2438
|
+
_t as once,
|
|
2439
|
+
je as parseQuery,
|
|
2440
|
+
he as renderToString,
|
|
2441
|
+
yt as resolveRouteComponent,
|
|
2442
|
+
mt as useRouter,
|
|
2443
|
+
vt as when
|
|
2390
2444
|
};
|
|
2391
2445
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|