@jasonshimmy/custom-elements-runtime 0.1.11 → 0.1.13
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 +11 -11
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +634 -663
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +11 -11
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/runtime/template-compiler.d.ts +1 -1
- package/dist/runtime/vdom.d.ts +86 -6
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function Ze(e, t) {
|
|
2
|
+
return F(e ? t : [], "when-block");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function Xe(e, t) {
|
|
5
5
|
return e.map((r, n) => {
|
|
6
6
|
const o = typeof r == "object" ? r?.key ?? r?.id ?? `idx-${n}` : String(r);
|
|
7
|
-
return
|
|
7
|
+
return F(t(r, n), `each-${o}`);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function de() {
|
|
11
11
|
const e = [];
|
|
12
12
|
return {
|
|
13
13
|
when(t, r) {
|
|
@@ -17,18 +17,18 @@ function $e() {
|
|
|
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, n] = e[t];
|
|
27
|
-
if (r) return [
|
|
27
|
+
if (r) return [F(n, `whenChain-branch-${t}`)];
|
|
28
28
|
}
|
|
29
|
-
return [
|
|
29
|
+
return [F([], "whenChain-empty")];
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function F(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 Y(e, t) {
|
|
|
36
36
|
children: r
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
class
|
|
39
|
+
class N extends EventTarget {
|
|
40
40
|
handlers = {};
|
|
41
41
|
static instance;
|
|
42
42
|
eventCounters = /* @__PURE__ */ new Map();
|
|
@@ -44,7 +44,7 @@ class D extends EventTarget {
|
|
|
44
44
|
* Returns the singleton instance of GlobalEventBus
|
|
45
45
|
*/
|
|
46
46
|
static getInstance() {
|
|
47
|
-
return
|
|
47
|
+
return N.instance || (N.instance = new N()), N.instance;
|
|
48
48
|
}
|
|
49
49
|
// Enhanced emit method with better typing and event storm protection
|
|
50
50
|
/**
|
|
@@ -160,8 +160,8 @@ class D extends EventTarget {
|
|
|
160
160
|
this.eventCounters.clear();
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
const
|
|
164
|
-
function
|
|
163
|
+
const P = N.getInstance(), Ye = (e, t) => P.emit(e, t), Ge = (e, t) => P.on(e, t), et = (e, t) => P.off(e, t), tt = (e, t) => P.once(e, t), rt = (e, t, r) => P.listen(e, t, r);
|
|
164
|
+
function ee(e) {
|
|
165
165
|
let t = { ...e };
|
|
166
166
|
const r = [];
|
|
167
167
|
function n(a) {
|
|
@@ -179,10 +179,10 @@ function ce(e) {
|
|
|
179
179
|
}
|
|
180
180
|
return { subscribe: n, getState: o, setState: s };
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function G(e) {
|
|
183
183
|
return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function Z(e) {
|
|
186
186
|
return typeof e == "string" ? e.replace(
|
|
187
187
|
/[&<>"']/g,
|
|
188
188
|
(t) => ({
|
|
@@ -194,34 +194,34 @@ function oe(e) {
|
|
|
194
194
|
})[t]
|
|
195
195
|
) : e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function he(e, t, r) {
|
|
198
198
|
if (r)
|
|
199
199
|
for (const [n, o] of Object.entries(r)) {
|
|
200
200
|
let s, i = {};
|
|
201
201
|
if (Array.isArray(o) ? (s = o[0], i = o[1] || {}) : s = o, t.set(n, {
|
|
202
202
|
callback: s,
|
|
203
203
|
options: i,
|
|
204
|
-
oldValue:
|
|
204
|
+
oldValue: X(e, n)
|
|
205
205
|
}), i.immediate)
|
|
206
206
|
try {
|
|
207
|
-
const a =
|
|
207
|
+
const a = X(e, n);
|
|
208
208
|
s(a, void 0, e);
|
|
209
209
|
} catch (a) {
|
|
210
210
|
console.error(`Error in immediate watcher for "${n}":`, a);
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function X(e, t) {
|
|
215
215
|
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function ge(e, t, r, n) {
|
|
218
218
|
const o = (i, a) => {
|
|
219
219
|
if (i === a) return !0;
|
|
220
220
|
if (typeof i != typeof a || typeof i != "object" || i === null || a === null) return !1;
|
|
221
221
|
if (Array.isArray(i) && Array.isArray(a))
|
|
222
|
-
return i.length !== a.length ? !1 : i.every((
|
|
222
|
+
return i.length !== a.length ? !1 : i.every((h, p) => o(h, a[p]));
|
|
223
223
|
const c = Object.keys(i), f = Object.keys(a);
|
|
224
|
-
return c.length !== f.length ? !1 : c.every((
|
|
224
|
+
return c.length !== f.length ? !1 : c.every((h) => o(i[h], a[h]));
|
|
225
225
|
}, s = t.get(r);
|
|
226
226
|
if (s && !o(n, s.oldValue))
|
|
227
227
|
try {
|
|
@@ -232,13 +232,13 @@ function Ce(e, t, r, n) {
|
|
|
232
232
|
for (const [i, a] of t.entries())
|
|
233
233
|
if (a.options.deep && r.startsWith(i + "."))
|
|
234
234
|
try {
|
|
235
|
-
const c =
|
|
235
|
+
const c = X(e, i);
|
|
236
236
|
o(c, a.oldValue) || (a.callback(c, a.oldValue, e), a.oldValue = c);
|
|
237
237
|
} catch (c) {
|
|
238
238
|
console.error(`Error in deep watcher for "${i}":`, c);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function ye(e, t, r) {
|
|
242
242
|
if (!t.props) return;
|
|
243
243
|
function n(o, s) {
|
|
244
244
|
return s === Boolean ? o === "true" : s === Number ? Number(o) : o;
|
|
@@ -247,150 +247,157 @@ function Ae(e, t, r) {
|
|
|
247
247
|
if (s.type === Function && typeof e[o] == "function")
|
|
248
248
|
r[o] = e[o];
|
|
249
249
|
else {
|
|
250
|
-
const i = e.getAttribute(
|
|
251
|
-
i !== null ? r[o] =
|
|
250
|
+
const i = e.getAttribute(G(o));
|
|
251
|
+
i !== null ? r[o] = Z(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = Z(s.default));
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function me(e, t, r, n) {
|
|
256
256
|
e.onConnected && !r && (e.onConnected(t), n(!0));
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function be(e, t, r, n, o, s, i, a) {
|
|
259
259
|
e.onDisconnected && e.onDisconnected(t), r.forEach((c) => c()), n(), o(), s(!1), i(null), a(!1);
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function ve(e, t, r, n, o) {
|
|
262
262
|
e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
|
|
263
263
|
}
|
|
264
|
-
function
|
|
264
|
+
function j(e, t) {
|
|
265
265
|
if (t && e instanceof HTMLElement) {
|
|
266
266
|
for (const r in t)
|
|
267
267
|
t[r] === e && delete t[r];
|
|
268
268
|
for (const r of Array.from(e.childNodes))
|
|
269
|
-
|
|
269
|
+
j(r, t);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
return t.split(".").reduce((r, n) => r?.[n], e);
|
|
272
|
+
function R(e, t) {
|
|
273
|
+
return typeof t == "string" ? t.split(".").reduce((r, n) => r?.[n], e) : t;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function te(e, t, r) {
|
|
276
276
|
const n = t.split("."), o = n.pop();
|
|
277
277
|
if (!o) return;
|
|
278
278
|
const s = n.reduce((i, a) => (a in i || (i[a] = {}), i[a]), e);
|
|
279
279
|
s[o] = r;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function xe(e, t, r, n, o, s, i) {
|
|
282
282
|
if (!s) return;
|
|
283
|
-
const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"),
|
|
284
|
-
const
|
|
285
|
-
return
|
|
286
|
-
},
|
|
283
|
+
const a = t.includes("lazy"), c = t.includes("trim"), f = t.includes("number"), h = () => {
|
|
284
|
+
const g = s._state || s;
|
|
285
|
+
return R(g, e);
|
|
286
|
+
}, p = h();
|
|
287
287
|
let l = "text";
|
|
288
|
-
const
|
|
289
|
-
if (i instanceof HTMLInputElement ? l =
|
|
290
|
-
if (Array.isArray(
|
|
291
|
-
const
|
|
292
|
-
i && i.checked !==
|
|
288
|
+
const x = n?.type;
|
|
289
|
+
if (i instanceof HTMLInputElement ? l = x || i.type || "text" : i instanceof HTMLSelectElement ? l = "select" : i instanceof HTMLTextAreaElement && (l = "textarea"), l === "checkbox")
|
|
290
|
+
if (Array.isArray(p)) {
|
|
291
|
+
const g = i?.getAttribute("value") || n?.value || "", u = p.includes(g);
|
|
292
|
+
i && i.checked !== u && (r.checked = u);
|
|
293
293
|
} else {
|
|
294
|
-
const
|
|
295
|
-
i && i.checked !==
|
|
294
|
+
const g = i?.getAttribute("true-value") || !0, u = p === g;
|
|
295
|
+
i && i.checked !== u && (r.checked = u);
|
|
296
296
|
}
|
|
297
297
|
else if (l === "radio") {
|
|
298
|
-
const
|
|
299
|
-
i && i.checked !==
|
|
298
|
+
const g = n?.value || "", u = p === g;
|
|
299
|
+
i && i.checked !== u && (r.checked = u);
|
|
300
300
|
} else if (l === "select")
|
|
301
301
|
if (i && i.hasAttribute("multiple")) {
|
|
302
|
-
const
|
|
302
|
+
const g = i, u = Array.isArray(p) ? p : [];
|
|
303
303
|
setTimeout(() => {
|
|
304
|
-
Array.from(
|
|
305
|
-
const
|
|
306
|
-
|
|
304
|
+
Array.from(g.options).forEach((m) => {
|
|
305
|
+
const v = u.includes(m.value);
|
|
306
|
+
m.selected !== v && (m.selected = v);
|
|
307
307
|
});
|
|
308
308
|
}, 0);
|
|
309
309
|
} else
|
|
310
310
|
setTimeout(() => {
|
|
311
|
-
i instanceof HTMLSelectElement && i.value !== String(
|
|
311
|
+
i instanceof HTMLSelectElement && i.value !== String(p) && (i.value = String(p));
|
|
312
312
|
}, 0);
|
|
313
313
|
else {
|
|
314
|
-
const
|
|
315
|
-
(!i || i.value !==
|
|
316
|
-
}
|
|
317
|
-
const y = a || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input",
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
let
|
|
314
|
+
const g = String(p ?? "");
|
|
315
|
+
(!i || i.value !== g) && (r.value = p);
|
|
316
|
+
}
|
|
317
|
+
const y = a || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", b = (g) => {
|
|
318
|
+
if (g.isComposing || o._isComposing || g.isTrusted === !1) return;
|
|
319
|
+
const u = g.target;
|
|
320
|
+
if (u._modelUpdating) return;
|
|
321
|
+
const m = h();
|
|
322
|
+
let v = u.value;
|
|
323
323
|
if (l === "checkbox")
|
|
324
|
-
if (Array.isArray(
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
327
|
-
|
|
324
|
+
if (Array.isArray(m)) {
|
|
325
|
+
const w = u.getAttribute("value") || "", _ = [...m];
|
|
326
|
+
if (u.checked)
|
|
327
|
+
_.includes(w) || _.push(w);
|
|
328
328
|
else {
|
|
329
|
-
const
|
|
330
|
-
|
|
329
|
+
const S = _.indexOf(w);
|
|
330
|
+
S > -1 && _.splice(S, 1);
|
|
331
331
|
}
|
|
332
|
-
|
|
332
|
+
v = _;
|
|
333
333
|
} else {
|
|
334
|
-
const
|
|
335
|
-
|
|
334
|
+
const w = u.getAttribute("true-value") || !0, _ = u.getAttribute("false-value") || !1;
|
|
335
|
+
v = u.checked ? w : _;
|
|
336
336
|
}
|
|
337
337
|
else if (l === "radio")
|
|
338
|
-
|
|
339
|
-
else if (l === "select" &&
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
(
|
|
338
|
+
v = u.getAttribute("value") || u.value;
|
|
339
|
+
else if (l === "select" && u.multiple) {
|
|
340
|
+
const w = u;
|
|
341
|
+
v = Array.from(w.selectedOptions).map(
|
|
342
|
+
(_) => _.value
|
|
343
343
|
);
|
|
344
|
-
} else if (c && (
|
|
345
|
-
const
|
|
346
|
-
isNaN(
|
|
344
|
+
} else if (c && (v = v.trim()), f) {
|
|
345
|
+
const w = Number(v);
|
|
346
|
+
isNaN(w) || (v = w);
|
|
347
347
|
}
|
|
348
|
-
const
|
|
349
|
-
if (Array.isArray(
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
348
|
+
const d = s._state || s, $ = R(d, e);
|
|
349
|
+
if (Array.isArray(v) && Array.isArray($) ? JSON.stringify([...v].sort()) !== JSON.stringify([...$].sort()) : v !== $) {
|
|
350
|
+
const w = g.target;
|
|
351
|
+
w._modelUpdating = !0, te(d, e, v), setTimeout(() => {
|
|
352
|
+
w._modelUpdating = !1;
|
|
353
353
|
}, 0), s._requestRender && s._requestRender();
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
|
-
if (o[y] =
|
|
357
|
-
const
|
|
356
|
+
if (o[y] = b, l === "text" || l === "textarea") {
|
|
357
|
+
const g = () => {
|
|
358
358
|
o._isComposing = !0;
|
|
359
|
-
},
|
|
359
|
+
}, u = (m) => {
|
|
360
360
|
o._isComposing = !1;
|
|
361
|
-
const
|
|
361
|
+
const v = m.target;
|
|
362
362
|
setTimeout(() => {
|
|
363
|
-
if (
|
|
364
|
-
let
|
|
365
|
-
if (c && (
|
|
366
|
-
const
|
|
367
|
-
isNaN(
|
|
363
|
+
if (v) {
|
|
364
|
+
let d = v.value;
|
|
365
|
+
if (c && (d = d.trim()), f) {
|
|
366
|
+
const _ = Number(d);
|
|
367
|
+
isNaN(_) || (d = _);
|
|
368
368
|
}
|
|
369
|
-
const $ = s._state || s,
|
|
370
|
-
(Array.isArray(
|
|
371
|
-
|
|
372
|
-
}, 0)),
|
|
369
|
+
const $ = s._state || s, k = R($, e);
|
|
370
|
+
(Array.isArray(d) && Array.isArray(k) ? JSON.stringify([...d].sort()) !== JSON.stringify([...k].sort()) : d !== k) && (v && (v._modelUpdating = !0, setTimeout(() => {
|
|
371
|
+
v._modelUpdating = !1;
|
|
372
|
+
}, 0)), te($, e, d), s._requestRender && s._requestRender());
|
|
373
373
|
}
|
|
374
374
|
}, 0);
|
|
375
375
|
};
|
|
376
|
-
o.compositionstart =
|
|
376
|
+
o.compositionstart = g, o.compositionend = u;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
if (n)
|
|
381
|
-
|
|
382
|
-
const o
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
379
|
+
function we(e, t, r, n) {
|
|
380
|
+
if (n) {
|
|
381
|
+
if (typeof e == "object" && e !== null)
|
|
382
|
+
for (const [o, s] of Object.entries(e))
|
|
383
|
+
t[o] = s;
|
|
384
|
+
else if (typeof e == "string")
|
|
385
|
+
try {
|
|
386
|
+
const o = JSON.parse(e);
|
|
387
|
+
if (typeof o == "object" && o !== null) {
|
|
388
|
+
for (const [s, i] of Object.entries(o))
|
|
389
|
+
t[s] = i;
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
} catch {
|
|
393
|
+
const o = R(n, e);
|
|
394
|
+
r[e] = o;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
390
397
|
}
|
|
391
|
-
function
|
|
398
|
+
function ke(e, t, r) {
|
|
392
399
|
if (!r) return;
|
|
393
|
-
const n =
|
|
400
|
+
const n = R(r, e), o = t.style || "", s = n ? "" : "none";
|
|
394
401
|
if (o) {
|
|
395
402
|
const i = o.split(";").filter(Boolean), a = i.findIndex(
|
|
396
403
|
(c) => c.trim().startsWith("display:")
|
|
@@ -399,19 +406,19 @@ function ze(e, t, r) {
|
|
|
399
406
|
} else
|
|
400
407
|
t.style = `display: ${s}`;
|
|
401
408
|
}
|
|
402
|
-
function
|
|
409
|
+
function $e(e, t, r) {
|
|
403
410
|
if (!r) return;
|
|
404
|
-
const n =
|
|
411
|
+
const n = R(r, e);
|
|
405
412
|
let o = [];
|
|
406
|
-
typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).
|
|
413
|
+
typeof n == "string" ? o = [n] : Array.isArray(n) ? o = n.filter(Boolean) : typeof n == "object" && (o = Object.entries(n).filter(([, a]) => !!a).flatMap(([a]) => a.split(/\s+/).filter(Boolean)));
|
|
407
414
|
const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
|
|
408
415
|
i && (t.class = i);
|
|
409
416
|
}
|
|
410
|
-
function
|
|
417
|
+
function _e(e, t, r) {
|
|
411
418
|
let n;
|
|
412
419
|
if (typeof e == "string") {
|
|
413
420
|
if (!r) return;
|
|
414
|
-
n =
|
|
421
|
+
n = R(r, e);
|
|
415
422
|
} else
|
|
416
423
|
n = e;
|
|
417
424
|
let o = "";
|
|
@@ -424,7 +431,7 @@ function Ne(e, t, r) {
|
|
|
424
431
|
const f = a.replace(
|
|
425
432
|
/[A-Z]/g,
|
|
426
433
|
(l) => `-${l.toLowerCase()}`
|
|
427
|
-
),
|
|
434
|
+
), h = [
|
|
428
435
|
"width",
|
|
429
436
|
"height",
|
|
430
437
|
"top",
|
|
@@ -450,23 +457,23 @@ function Ne(e, t, r) {
|
|
|
450
457
|
"min-height",
|
|
451
458
|
"max-height"
|
|
452
459
|
];
|
|
453
|
-
let
|
|
454
|
-
typeof c == "number" &&
|
|
460
|
+
let p = String(c);
|
|
461
|
+
typeof c == "number" && h.includes(f) && (p = `${c}px`), i.push(`${f}: ${p}`);
|
|
455
462
|
}
|
|
456
463
|
o = i.join("; ") + (i.length > 0 ? ";" : "");
|
|
457
464
|
}
|
|
458
465
|
const s = t.style || "";
|
|
459
466
|
t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
|
|
460
467
|
}
|
|
461
|
-
function
|
|
468
|
+
function ce(e, t, r, n) {
|
|
462
469
|
const o = {}, s = { ...n || {} }, i = {};
|
|
463
470
|
for (const [a, c] of Object.entries(e)) {
|
|
464
|
-
const { value: f, modifiers:
|
|
471
|
+
const { value: f, modifiers: h } = c;
|
|
465
472
|
switch (a) {
|
|
466
473
|
case "model":
|
|
467
|
-
|
|
474
|
+
xe(
|
|
468
475
|
typeof f == "string" ? f : String(f),
|
|
469
|
-
|
|
476
|
+
h,
|
|
470
477
|
o,
|
|
471
478
|
s,
|
|
472
479
|
i,
|
|
@@ -475,45 +482,45 @@ function be(e, t, r, n) {
|
|
|
475
482
|
);
|
|
476
483
|
break;
|
|
477
484
|
case "bind":
|
|
478
|
-
|
|
485
|
+
we(f, o, s, t);
|
|
479
486
|
break;
|
|
480
487
|
case "show":
|
|
481
|
-
|
|
488
|
+
ke(f, s, t);
|
|
482
489
|
break;
|
|
483
490
|
case "class":
|
|
484
|
-
|
|
491
|
+
$e(f, s, t);
|
|
485
492
|
break;
|
|
486
493
|
case "style":
|
|
487
|
-
|
|
494
|
+
_e(f, s, t);
|
|
488
495
|
break;
|
|
489
496
|
}
|
|
490
497
|
}
|
|
491
498
|
return { props: o, attrs: s, listeners: i };
|
|
492
499
|
}
|
|
493
|
-
function
|
|
500
|
+
function Y(e, t) {
|
|
494
501
|
if (Array.isArray(e)) {
|
|
495
502
|
const s = /* @__PURE__ */ new Set();
|
|
496
503
|
return e.map((i) => {
|
|
497
504
|
if (!i || typeof i != "object") return i;
|
|
498
505
|
let a = i.props?.key ?? i.key;
|
|
499
506
|
if (!a) {
|
|
500
|
-
const
|
|
501
|
-
a = l ? `${t}:${
|
|
507
|
+
const p = i.tag || "node", l = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
|
|
508
|
+
a = l ? `${t}:${p}:${l}` : `${t}:${p}`;
|
|
502
509
|
}
|
|
503
510
|
let c = a, f = 1;
|
|
504
511
|
for (; s.has(c); )
|
|
505
512
|
c = `${a}#${f++}`;
|
|
506
513
|
s.add(c);
|
|
507
|
-
let
|
|
508
|
-
return Array.isArray(
|
|
514
|
+
let h = i.children;
|
|
515
|
+
return Array.isArray(h) && (h = Y(h, c)), { ...i, key: c, children: h };
|
|
509
516
|
});
|
|
510
517
|
}
|
|
511
518
|
const r = e;
|
|
512
519
|
let n = r.props?.key ?? r.key ?? t, o = r.children;
|
|
513
|
-
return Array.isArray(o) && (o =
|
|
520
|
+
return Array.isArray(o) && (o = Y(o, n)), { ...r, key: n, children: o };
|
|
514
521
|
}
|
|
515
|
-
function
|
|
516
|
-
const o = r.directives ?? {}, s =
|
|
522
|
+
function Se(e, t, r, n) {
|
|
523
|
+
const o = r.directives ?? {}, s = ce(
|
|
517
524
|
o,
|
|
518
525
|
n,
|
|
519
526
|
e,
|
|
@@ -528,184 +535,192 @@ function Me(e, t, r, n) {
|
|
|
528
535
|
...s.attrs
|
|
529
536
|
}, c = t.props ?? {}, f = i;
|
|
530
537
|
for (const l in { ...c, ...f }) {
|
|
531
|
-
const
|
|
532
|
-
|
|
538
|
+
const x = c[l], y = f[l];
|
|
539
|
+
x !== y && (l === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== y && (e.value = y ?? "") : l === "checked" && e instanceof HTMLInputElement ? e.checked = !!y : l.startsWith("on") && typeof y == "function" ? (typeof x == "function" && e.removeEventListener(l.slice(2).toLowerCase(), x), e.addEventListener(l.slice(2).toLowerCase(), y)) : y == null || y === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(y)));
|
|
533
540
|
}
|
|
534
|
-
for (const [l,
|
|
541
|
+
for (const [l, x] of Object.entries(
|
|
535
542
|
s.listeners || {}
|
|
536
543
|
))
|
|
537
|
-
e.addEventListener(l,
|
|
538
|
-
const
|
|
539
|
-
for (const l in { ...
|
|
540
|
-
const
|
|
541
|
-
|
|
544
|
+
e.addEventListener(l, x);
|
|
545
|
+
const h = t.attrs ?? {}, p = a;
|
|
546
|
+
for (const l in { ...h, ...p }) {
|
|
547
|
+
const x = h[l], y = p[l];
|
|
548
|
+
x !== y && (y == null || y === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(y)));
|
|
542
549
|
}
|
|
543
550
|
}
|
|
544
|
-
function
|
|
551
|
+
function A(e, t, r) {
|
|
545
552
|
if (typeof e == "string")
|
|
546
553
|
return document.createTextNode(e);
|
|
547
554
|
if (e.tag === "#text") {
|
|
548
|
-
const
|
|
555
|
+
const p = document.createTextNode(
|
|
549
556
|
typeof e.children == "string" ? e.children : ""
|
|
550
557
|
);
|
|
551
|
-
return e.key != null && (
|
|
558
|
+
return e.key != null && (p.key = e.key), p;
|
|
552
559
|
}
|
|
553
560
|
if (e.tag === "#anchor") {
|
|
554
|
-
const
|
|
555
|
-
|
|
556
|
-
const
|
|
557
|
-
|
|
558
|
-
for (const
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
+
const p = e, l = Array.isArray(p.children) ? p.children : [], x = document.createTextNode(""), y = document.createTextNode("");
|
|
562
|
+
p.key != null && (x.key = `${p.key}:start`, y.key = `${p.key}:end`), p._startNode = x, p._endNode = y;
|
|
563
|
+
const b = document.createDocumentFragment();
|
|
564
|
+
b.appendChild(x);
|
|
565
|
+
for (const g of l) {
|
|
566
|
+
const u = A(g, t);
|
|
567
|
+
b.appendChild(u);
|
|
561
568
|
}
|
|
562
|
-
return
|
|
569
|
+
return b.appendChild(y), b;
|
|
563
570
|
}
|
|
564
571
|
const n = document.createElement(e.tag);
|
|
565
572
|
e.key != null && (n.key = e.key);
|
|
566
|
-
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a =
|
|
573
|
+
const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, a = ce(i, t, n, s), c = {
|
|
567
574
|
...o,
|
|
568
575
|
...a.props
|
|
569
576
|
}, f = {
|
|
570
577
|
...s,
|
|
571
578
|
...a.attrs
|
|
572
579
|
};
|
|
573
|
-
for (const
|
|
574
|
-
const l = f[
|
|
575
|
-
typeof
|
|
580
|
+
for (const p in f) {
|
|
581
|
+
const l = f[p];
|
|
582
|
+
if (typeof p != "string" || /\[object Object\]/.test(p)) {
|
|
583
|
+
typeof window < "u" && window.console && console.warn("Skipping invalid attribute key:", p, l);
|
|
584
|
+
continue;
|
|
585
|
+
}
|
|
586
|
+
typeof l == "boolean" ? l && n.setAttribute(p, "") : l != null && n.setAttribute(p, l);
|
|
576
587
|
}
|
|
577
|
-
for (const
|
|
578
|
-
const l = c[
|
|
579
|
-
if (
|
|
588
|
+
for (const p in c) {
|
|
589
|
+
const l = c[p];
|
|
590
|
+
if (typeof p != "string" || /\[object Object\]/.test(p)) {
|
|
591
|
+
typeof window < "u" && window.console && console.warn("Skipping invalid prop key:", p, l);
|
|
592
|
+
continue;
|
|
593
|
+
}
|
|
594
|
+
if (p === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
|
|
580
595
|
n.value = l ?? "";
|
|
581
|
-
else if (
|
|
596
|
+
else if (p === "checked" && n instanceof HTMLInputElement)
|
|
582
597
|
n.checked = !!l;
|
|
583
|
-
else if (
|
|
584
|
-
n.addEventListener(
|
|
598
|
+
else if (p.startsWith("on") && typeof l == "function")
|
|
599
|
+
n.addEventListener(p.slice(2).toLowerCase(), l);
|
|
585
600
|
else {
|
|
586
|
-
if (
|
|
601
|
+
if (p.startsWith("on") && l === void 0)
|
|
587
602
|
continue;
|
|
588
|
-
l == null || l === !1 ? n.removeAttribute(
|
|
603
|
+
l == null || l === !1 ? n.removeAttribute(p) : n.setAttribute(p, String(l));
|
|
589
604
|
}
|
|
590
605
|
}
|
|
591
|
-
for (const [
|
|
606
|
+
for (const [p, l] of Object.entries(
|
|
592
607
|
a.listeners || {}
|
|
593
608
|
))
|
|
594
|
-
n.addEventListener(
|
|
595
|
-
const
|
|
596
|
-
if (typeof e != "string" &&
|
|
597
|
-
for (const
|
|
598
|
-
n.appendChild(
|
|
609
|
+
n.addEventListener(p, l);
|
|
610
|
+
const h = e.props?.ref ?? (e.props?.props && e.props.props.ref);
|
|
611
|
+
if (typeof e != "string" && h && r && (r[h] = n), Array.isArray(e.children))
|
|
612
|
+
for (const p of e.children)
|
|
613
|
+
n.appendChild(A(p, t, r));
|
|
599
614
|
else typeof e.children == "string" && (n.textContent = e.children);
|
|
600
615
|
return n;
|
|
601
616
|
}
|
|
602
|
-
function
|
|
617
|
+
function Ce(e, t, r, n, o) {
|
|
603
618
|
if (typeof r == "string") {
|
|
604
619
|
e.textContent !== r && (e.textContent = r);
|
|
605
620
|
return;
|
|
606
621
|
}
|
|
607
622
|
if (!Array.isArray(r)) return;
|
|
608
623
|
const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], a = /* @__PURE__ */ new Map();
|
|
609
|
-
for (const
|
|
610
|
-
|
|
624
|
+
for (const x of i)
|
|
625
|
+
x && x.key != null && a.set(x.key, x);
|
|
611
626
|
const c = /* @__PURE__ */ new Map();
|
|
612
|
-
for (const
|
|
613
|
-
const y =
|
|
614
|
-
y != null && c.set(y,
|
|
627
|
+
for (const x of s) {
|
|
628
|
+
const y = x.key;
|
|
629
|
+
y != null && c.set(y, x);
|
|
615
630
|
}
|
|
616
631
|
const f = /* @__PURE__ */ new Set();
|
|
617
|
-
let
|
|
618
|
-
function
|
|
619
|
-
let
|
|
620
|
-
for (;
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
function l(
|
|
624
|
-
const
|
|
625
|
-
let
|
|
626
|
-
for (;
|
|
627
|
-
|
|
628
|
-
const
|
|
629
|
-
if (
|
|
630
|
-
const $ = /* @__PURE__ */ new Map(),
|
|
631
|
-
for (const
|
|
632
|
-
|
|
633
|
-
for (const
|
|
634
|
-
const
|
|
635
|
-
|
|
632
|
+
let h = e.firstChild;
|
|
633
|
+
function p(x, y) {
|
|
634
|
+
let b = x;
|
|
635
|
+
for (; b && (f.add(b), b !== y); )
|
|
636
|
+
b = b.nextSibling;
|
|
637
|
+
}
|
|
638
|
+
function l(x, y, b, g) {
|
|
639
|
+
const u = [];
|
|
640
|
+
let m = x.nextSibling;
|
|
641
|
+
for (; m && m !== y; )
|
|
642
|
+
u.push(m), m = m.nextSibling;
|
|
643
|
+
const v = Array.isArray(b) ? b : [];
|
|
644
|
+
if (g.some(($) => $ && $.key != null) || v.some(($) => $ && $.key != null)) {
|
|
645
|
+
const $ = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
|
|
646
|
+
for (const S of v)
|
|
647
|
+
S && S.key != null && $.set(S.key, S);
|
|
648
|
+
for (const S of u) {
|
|
649
|
+
const C = S.key;
|
|
650
|
+
C != null && k.set(C, S);
|
|
636
651
|
}
|
|
637
|
-
const
|
|
638
|
-
let
|
|
639
|
-
for (const
|
|
640
|
-
let
|
|
641
|
-
if (
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
652
|
+
const w = /* @__PURE__ */ new Set();
|
|
653
|
+
let _ = x.nextSibling;
|
|
654
|
+
for (const S of g) {
|
|
655
|
+
let C;
|
|
656
|
+
if (S.key != null && k.has(S.key)) {
|
|
657
|
+
const E = $.get(S.key);
|
|
658
|
+
C = H(
|
|
659
|
+
k.get(S.key),
|
|
660
|
+
E,
|
|
661
|
+
S,
|
|
647
662
|
n
|
|
648
|
-
),
|
|
663
|
+
), w.add(C), C !== _ && e.contains(C) && e.insertBefore(C, _);
|
|
649
664
|
} else
|
|
650
|
-
|
|
651
|
-
|
|
665
|
+
C = A(S, n), e.insertBefore(C, _), w.add(C);
|
|
666
|
+
_ = C.nextSibling;
|
|
652
667
|
}
|
|
653
|
-
for (const
|
|
654
|
-
!
|
|
668
|
+
for (const S of u)
|
|
669
|
+
!w.has(S) && e.contains(S) && e.removeChild(S);
|
|
655
670
|
} else {
|
|
656
671
|
const $ = Math.min(
|
|
657
|
-
|
|
658
|
-
|
|
672
|
+
v.length,
|
|
673
|
+
g.length
|
|
659
674
|
);
|
|
660
|
-
for (let
|
|
661
|
-
const
|
|
662
|
-
|
|
675
|
+
for (let k = 0; k < $; k++) {
|
|
676
|
+
const w = v[k], _ = g[k], S = H(u[k], w, _, n);
|
|
677
|
+
S !== u[k] && (e.insertBefore(S, u[k]), e.removeChild(u[k]));
|
|
663
678
|
}
|
|
664
|
-
for (let
|
|
665
|
-
e.insertBefore(
|
|
666
|
-
for (let
|
|
667
|
-
e.removeChild(
|
|
679
|
+
for (let k = $; k < g.length; k++)
|
|
680
|
+
e.insertBefore(A(g[k], n), y);
|
|
681
|
+
for (let k = $; k < u.length; k++)
|
|
682
|
+
e.removeChild(u[k]);
|
|
668
683
|
}
|
|
669
684
|
}
|
|
670
|
-
for (const
|
|
685
|
+
for (const x of r) {
|
|
671
686
|
let y;
|
|
672
|
-
if (
|
|
673
|
-
const
|
|
674
|
-
let
|
|
675
|
-
const
|
|
676
|
-
if (
|
|
677
|
-
e.insertBefore(
|
|
678
|
-
for (const $ of
|
|
679
|
-
e.insertBefore(
|
|
680
|
-
e.insertBefore(
|
|
687
|
+
if (x.tag === "#anchor") {
|
|
688
|
+
const b = x.key, g = `${b}:start`, u = `${b}:end`;
|
|
689
|
+
let m = c.get(g), v = c.get(u);
|
|
690
|
+
const d = Array.isArray(x.children) ? x.children : [];
|
|
691
|
+
if (m || (m = document.createTextNode(""), m.key = g), v || (v = document.createTextNode(""), v.key = u), x._startNode = m, x._endNode = v, !e.contains(m) || !e.contains(v)) {
|
|
692
|
+
e.insertBefore(m, h);
|
|
693
|
+
for (const $ of d)
|
|
694
|
+
e.insertBefore(A($, n), h);
|
|
695
|
+
e.insertBefore(v, h);
|
|
681
696
|
} else
|
|
682
697
|
l(
|
|
698
|
+
m,
|
|
683
699
|
v,
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
u
|
|
700
|
+
a.get(b)?.children,
|
|
701
|
+
d
|
|
687
702
|
);
|
|
688
|
-
|
|
703
|
+
p(m, v), h = v.nextSibling;
|
|
689
704
|
continue;
|
|
690
705
|
}
|
|
691
|
-
if (
|
|
692
|
-
const
|
|
693
|
-
y =
|
|
694
|
-
c.get(
|
|
695
|
-
m,
|
|
706
|
+
if (x.key != null && c.has(x.key)) {
|
|
707
|
+
const b = a.get(x.key);
|
|
708
|
+
y = H(
|
|
709
|
+
c.get(x.key),
|
|
696
710
|
b,
|
|
711
|
+
x,
|
|
697
712
|
n,
|
|
698
713
|
o
|
|
699
|
-
), f.add(y), y !==
|
|
714
|
+
), f.add(y), y !== h && e.contains(y) && (h && !e.contains(h) && (h = null), e.insertBefore(y, h));
|
|
700
715
|
} else
|
|
701
|
-
y =
|
|
702
|
-
|
|
716
|
+
y = A(x, n, o), h && !e.contains(h) && (h = null), e.insertBefore(y, h), f.add(y);
|
|
717
|
+
h = y.nextSibling;
|
|
703
718
|
}
|
|
704
|
-
for (const
|
|
705
|
-
!f.has(
|
|
719
|
+
for (const x of s)
|
|
720
|
+
!f.has(x) && e.contains(x) && (j(x, o), e.removeChild(x));
|
|
706
721
|
}
|
|
707
|
-
function
|
|
708
|
-
if (t && typeof t != "string" && t.props?.ref && o &&
|
|
722
|
+
function H(e, t, r, n, o) {
|
|
723
|
+
if (t && typeof t != "string" && t.props?.ref && o && j(e, o), t === r) return e;
|
|
709
724
|
if (typeof r == "string") {
|
|
710
725
|
if (e.nodeType === Node.TEXT_NODE)
|
|
711
726
|
return e.textContent !== r && (e.textContent = r), e;
|
|
@@ -717,22 +732,22 @@ function Q(e, t, r, n, o) {
|
|
|
717
732
|
if (r && typeof r != "string" && r.tag === "#anchor") {
|
|
718
733
|
const i = r, a = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), f = i._endNode ?? document.createTextNode("");
|
|
719
734
|
i.key != null && (c.key = `${i.key}:start`, f.key = `${i.key}:end`), i._startNode = c, i._endNode = f;
|
|
720
|
-
const
|
|
721
|
-
|
|
722
|
-
for (const
|
|
723
|
-
const l =
|
|
724
|
-
|
|
735
|
+
const h = document.createDocumentFragment();
|
|
736
|
+
h.appendChild(c);
|
|
737
|
+
for (const p of a) {
|
|
738
|
+
const l = A(p, n);
|
|
739
|
+
h.appendChild(l);
|
|
725
740
|
}
|
|
726
|
-
return
|
|
741
|
+
return h.appendChild(f), e.parentNode?.replaceChild(h, e), c;
|
|
727
742
|
}
|
|
728
743
|
if (!r) {
|
|
729
|
-
|
|
744
|
+
j(e, o);
|
|
730
745
|
const i = document.createComment("removed");
|
|
731
746
|
return e.parentNode?.replaceChild(i, e), i;
|
|
732
747
|
}
|
|
733
748
|
if (!t || typeof t == "string") {
|
|
734
|
-
|
|
735
|
-
const i =
|
|
749
|
+
j(e, o);
|
|
750
|
+
const i = A(r, n, o);
|
|
736
751
|
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
|
|
737
752
|
}
|
|
738
753
|
if (r.tag === "#anchor") {
|
|
@@ -740,53 +755,53 @@ function Q(e, t, r, n, o) {
|
|
|
740
755
|
r.key != null && (a.key = `${r.key}:start`, c.key = `${r.key}:end`), r._startNode = a, r._endNode = c;
|
|
741
756
|
const f = document.createDocumentFragment();
|
|
742
757
|
f.appendChild(a);
|
|
743
|
-
for (const
|
|
744
|
-
f.appendChild(
|
|
758
|
+
for (const h of i)
|
|
759
|
+
f.appendChild(A(h, n));
|
|
745
760
|
return f.appendChild(c), e.parentNode?.replaceChild(f, e), a;
|
|
746
761
|
}
|
|
747
762
|
if (typeof t != "string" && typeof r != "string" && t.tag === r.tag && t.key === r.key) {
|
|
748
763
|
const i = e;
|
|
749
|
-
return
|
|
764
|
+
return Se(i, t.props || {}, r.props || {}, n), Ce(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
|
|
750
765
|
}
|
|
751
|
-
|
|
752
|
-
const s =
|
|
766
|
+
j(e, o);
|
|
767
|
+
const s = A(r, n, o);
|
|
753
768
|
return typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
|
|
754
769
|
}
|
|
755
|
-
function
|
|
770
|
+
function Ee(e, t, r, n) {
|
|
756
771
|
let o;
|
|
757
772
|
Array.isArray(t) ? t.length === 1 ? (o = t[0], o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })) : o = { tag: "div", key: "__root__", children: t } : (o = t, o && typeof o == "object" && o.key == null && (o = { ...o, key: "__root__" })), o && typeof o == "object" && o.tag === "#anchor" && (o = {
|
|
758
773
|
tag: "div",
|
|
759
774
|
key: "__anchor_root__",
|
|
760
775
|
props: { attrs: { "data-anchor-block-root": "", key: "__anchor_root__" } },
|
|
761
776
|
children: [o]
|
|
762
|
-
}), o =
|
|
777
|
+
}), o = Y(o, String(o.key ?? "root"));
|
|
763
778
|
const s = e._prevVNode ?? null, i = e._prevDom ?? e.firstChild ?? null;
|
|
764
779
|
let a;
|
|
765
|
-
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a =
|
|
780
|
+
s && i ? typeof s != "string" && typeof o != "string" && s.tag === o.tag && s.key === o.key ? a = H(i, s, o, r, n) : (a = A(o, r, n), e.replaceChild(a, i)) : (a = A(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(a));
|
|
766
781
|
const c = [];
|
|
767
782
|
for (let f = 0; f < e.childNodes.length; f++) {
|
|
768
|
-
const
|
|
769
|
-
|
|
783
|
+
const h = e.childNodes[f];
|
|
784
|
+
h !== a && h.nodeName !== "STYLE" && (j(h, n), c.push(h));
|
|
770
785
|
}
|
|
771
786
|
c.forEach((f) => e.removeChild(f)), e._prevVNode = o, e._prevDom = a;
|
|
772
787
|
}
|
|
773
|
-
function
|
|
788
|
+
function fe(e, ...t) {
|
|
774
789
|
let r = "";
|
|
775
790
|
for (let n = 0; n < e.length; n++)
|
|
776
791
|
r += e[n], n < t.length && (r += t[n]);
|
|
777
792
|
return r;
|
|
778
793
|
}
|
|
779
|
-
function
|
|
794
|
+
function ue(e) {
|
|
780
795
|
return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
|
|
781
796
|
}
|
|
782
|
-
let
|
|
783
|
-
function
|
|
784
|
-
return
|
|
797
|
+
let W = null;
|
|
798
|
+
function re() {
|
|
799
|
+
return W || (W = new CSSStyleSheet(), W.replaceSync(ue(Te))), W;
|
|
785
800
|
}
|
|
786
|
-
function
|
|
801
|
+
function Ae(e) {
|
|
787
802
|
return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi, "").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/expression\s*\([^)]*\)/gi, "");
|
|
788
803
|
}
|
|
789
|
-
const
|
|
804
|
+
const Te = fe`
|
|
790
805
|
:host, *, ::before, ::after {
|
|
791
806
|
all: isolate;
|
|
792
807
|
box-sizing: border-box;
|
|
@@ -844,7 +859,7 @@ const De = ve`
|
|
|
844
859
|
sup { top: -.5em }
|
|
845
860
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
846
861
|
[hidden] { display: none }
|
|
847
|
-
`,
|
|
862
|
+
`, Le = {
|
|
848
863
|
gray: {
|
|
849
864
|
50: "var(--color-gray-50, #f9fafb)",
|
|
850
865
|
100: "var(--color-gray-100, #f3f4f6)",
|
|
@@ -979,7 +994,7 @@ const De = ve`
|
|
|
979
994
|
},
|
|
980
995
|
white: { DEFAULT: "var(--color-white, #ffffff)" },
|
|
981
996
|
black: { DEFAULT: "var(--color-black, #000000)" }
|
|
982
|
-
},
|
|
997
|
+
}, K = {
|
|
983
998
|
/* Display */
|
|
984
999
|
block: "display:block;",
|
|
985
1000
|
inline: "display:inline;",
|
|
@@ -1153,7 +1168,7 @@ const De = ve`
|
|
|
1153
1168
|
"transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
|
|
1154
1169
|
"transition-opacity": "transition-property:opacity;",
|
|
1155
1170
|
"transition-transform": "transition-property:transform;"
|
|
1156
|
-
},
|
|
1171
|
+
}, je = "0.25rem", ne = {
|
|
1157
1172
|
m: ["margin"],
|
|
1158
1173
|
mx: ["margin-inline"],
|
|
1159
1174
|
my: ["margin-block"],
|
|
@@ -1184,7 +1199,7 @@ const De = ve`
|
|
|
1184
1199
|
gap: ["gap"],
|
|
1185
1200
|
"gap-x": ["column-gap"],
|
|
1186
1201
|
"gap-y": ["row-gap"]
|
|
1187
|
-
},
|
|
1202
|
+
}, Re = {
|
|
1188
1203
|
// State variants
|
|
1189
1204
|
before: (e, t) => `${e}::before{${t}}`,
|
|
1190
1205
|
after: (e, t) => `${e}::after{${t}}`,
|
|
@@ -1210,7 +1225,7 @@ const De = ve`
|
|
|
1210
1225
|
"peer-focus": (e, t) => `.peer:focus ~ ${e}{${t}}`,
|
|
1211
1226
|
"peer-checked": (e, t) => `.peer:checked ~ ${e}{${t}}`,
|
|
1212
1227
|
"peer-disabled": (e, t) => `.peer:disabled ~ ${e}{${t}}`
|
|
1213
|
-
},
|
|
1228
|
+
}, oe = {
|
|
1214
1229
|
// Responsive
|
|
1215
1230
|
sm: "(min-width:640px)",
|
|
1216
1231
|
md: "(min-width:768px)",
|
|
@@ -1219,23 +1234,23 @@ const De = ve`
|
|
|
1219
1234
|
"2xl": "(min-width:1536px)",
|
|
1220
1235
|
// Dark mode (now plain string)
|
|
1221
1236
|
dark: "(prefers-color-scheme: dark)"
|
|
1222
|
-
},
|
|
1223
|
-
function
|
|
1237
|
+
}, U = ["sm", "md", "lg", "xl", "2xl"];
|
|
1238
|
+
function V(e) {
|
|
1224
1239
|
const t = e.startsWith("-"), n = (t ? e.slice(1) : e).split("-");
|
|
1225
1240
|
if (n.length < 2) return null;
|
|
1226
1241
|
const o = n.slice(0, -1).join("-"), s = n[n.length - 1], i = parseFloat(s);
|
|
1227
|
-
if (Number.isNaN(i) || !
|
|
1242
|
+
if (Number.isNaN(i) || !ne[o]) return null;
|
|
1228
1243
|
const a = t ? "-" : "";
|
|
1229
|
-
return
|
|
1244
|
+
return ne[o].map((c) => `${c}:calc(${a}${je} * ${i});`).join("");
|
|
1230
1245
|
}
|
|
1231
|
-
function
|
|
1246
|
+
function ie(e) {
|
|
1232
1247
|
const t = e.replace("#", ""), r = parseInt(t, 16), n = r >> 16 & 255, o = r >> 8 & 255, s = r & 255;
|
|
1233
1248
|
return `${n} ${o} ${s}`;
|
|
1234
1249
|
}
|
|
1235
|
-
function
|
|
1250
|
+
function ze(e) {
|
|
1236
1251
|
const t = /^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
|
|
1237
1252
|
if (!t) return null;
|
|
1238
|
-
const [, r, n, o = "DEFAULT"] = t, s =
|
|
1253
|
+
const [, r, n, o = "DEFAULT"] = t, s = Le[n]?.[o];
|
|
1239
1254
|
return s ? `${{
|
|
1240
1255
|
bg: "background-color",
|
|
1241
1256
|
decoration: "text-decoration-color",
|
|
@@ -1250,35 +1265,35 @@ function Fe(e) {
|
|
|
1250
1265
|
stroke: "stroke-color"
|
|
1251
1266
|
}[r]}:${s};` : null;
|
|
1252
1267
|
}
|
|
1253
|
-
function
|
|
1268
|
+
function Be(e) {
|
|
1254
1269
|
const [t, r] = e.split("/");
|
|
1255
1270
|
if (!r) return { base: t };
|
|
1256
1271
|
const n = parseInt(r, 10);
|
|
1257
1272
|
return isNaN(n) || n < 0 || n > 100 ? { base: t } : { base: t, opacity: n / 100 };
|
|
1258
1273
|
}
|
|
1259
|
-
function
|
|
1260
|
-
const { base: t, opacity: r } =
|
|
1274
|
+
function J(e) {
|
|
1275
|
+
const { base: t, opacity: r } = Be(e), n = ze(t);
|
|
1261
1276
|
if (n) {
|
|
1262
1277
|
if (r !== void 0) {
|
|
1263
1278
|
const s = /#([0-9a-f]{6})/i.exec(n);
|
|
1264
1279
|
if (s) {
|
|
1265
|
-
const i =
|
|
1280
|
+
const i = ie(s[0]);
|
|
1266
1281
|
return n.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1267
1282
|
}
|
|
1268
1283
|
}
|
|
1269
1284
|
return n;
|
|
1270
1285
|
}
|
|
1271
|
-
const o =
|
|
1286
|
+
const o = q(t);
|
|
1272
1287
|
if (o && r !== void 0) {
|
|
1273
1288
|
const s = /#([0-9a-f]{6})/i.exec(o);
|
|
1274
1289
|
if (s) {
|
|
1275
|
-
const i =
|
|
1290
|
+
const i = ie(s[0]);
|
|
1276
1291
|
return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${r})`);
|
|
1277
1292
|
}
|
|
1278
1293
|
}
|
|
1279
1294
|
return o;
|
|
1280
1295
|
}
|
|
1281
|
-
function
|
|
1296
|
+
function q(e) {
|
|
1282
1297
|
const t = e.indexOf("-["), r = e.endsWith("]");
|
|
1283
1298
|
if (t > 0 && r) {
|
|
1284
1299
|
const n = e.slice(0, t);
|
|
@@ -1328,13 +1343,13 @@ function Z(e) {
|
|
|
1328
1343
|
}
|
|
1329
1344
|
return null;
|
|
1330
1345
|
}
|
|
1331
|
-
function
|
|
1346
|
+
function Ne(e) {
|
|
1332
1347
|
return e.startsWith("[") && e.endsWith("]") ? e : e.indexOf("-[") > 0 && e.endsWith("]") ? e.replace(/_/g, "-") : null;
|
|
1333
1348
|
}
|
|
1334
|
-
function
|
|
1349
|
+
function Me(e) {
|
|
1335
1350
|
return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
|
|
1336
1351
|
}
|
|
1337
|
-
function
|
|
1352
|
+
function Oe(e) {
|
|
1338
1353
|
const t = /class\s*=\s*["']([^"']+)["']/g, r = [];
|
|
1339
1354
|
let n;
|
|
1340
1355
|
for (; n = t.exec(e); ) {
|
|
@@ -1343,100 +1358,100 @@ function Je(e) {
|
|
|
1343
1358
|
}
|
|
1344
1359
|
return r.filter(Boolean);
|
|
1345
1360
|
}
|
|
1346
|
-
const
|
|
1347
|
-
function
|
|
1348
|
-
const t = Date.now(), r =
|
|
1349
|
-
if (r && t - r.timestamp <
|
|
1350
|
-
const n =
|
|
1351
|
-
function
|
|
1352
|
-
const
|
|
1353
|
-
if (
|
|
1354
|
-
const
|
|
1355
|
-
return f[
|
|
1356
|
-
}
|
|
1357
|
-
function
|
|
1358
|
-
const
|
|
1359
|
-
return y.length === 0 ? 1 : !
|
|
1360
|
-
}
|
|
1361
|
-
function l(y,
|
|
1362
|
-
const
|
|
1363
|
-
(
|
|
1361
|
+
const se = /* @__PURE__ */ new Map(), Pe = 16;
|
|
1362
|
+
function We(e) {
|
|
1363
|
+
const t = Date.now(), r = se.get(e);
|
|
1364
|
+
if (r && t - r.timestamp < Pe) return r.css;
|
|
1365
|
+
const n = Oe(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
|
|
1366
|
+
function h(y, b = !1) {
|
|
1367
|
+
const g = (b ? "dark|" : "") + y;
|
|
1368
|
+
if (g in f) return f[g];
|
|
1369
|
+
const u = l(y, b);
|
|
1370
|
+
return f[g] = u, u;
|
|
1371
|
+
}
|
|
1372
|
+
function p(y) {
|
|
1373
|
+
const b = y.some((u) => U.includes(u)), g = y.includes("dark");
|
|
1374
|
+
return y.length === 0 ? 1 : !b && !g ? 2 : b && !g ? 3 : 4;
|
|
1375
|
+
}
|
|
1376
|
+
function l(y, b = !1) {
|
|
1377
|
+
const g = y.split(":"), u = g.find(
|
|
1378
|
+
(C) => K[C] || V(C) || J(C) || q(C)
|
|
1364
1379
|
);
|
|
1365
|
-
if (!
|
|
1366
|
-
const
|
|
1367
|
-
if (!
|
|
1368
|
-
let
|
|
1369
|
-
const $ =
|
|
1370
|
-
let
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
for (const
|
|
1374
|
-
const
|
|
1375
|
-
if (
|
|
1376
|
-
|
|
1380
|
+
if (!u) return null;
|
|
1381
|
+
const m = K[u] ?? V(u) ?? J(u) ?? q(u);
|
|
1382
|
+
if (!m) return null;
|
|
1383
|
+
let v = `.${Me(y)}`, d = m;
|
|
1384
|
+
const $ = g.indexOf(u);
|
|
1385
|
+
let k = $ >= 0 ? g.slice(0, $) : [];
|
|
1386
|
+
b && (k = k.filter((C) => C !== "dark"));
|
|
1387
|
+
const w = k.filter((C) => U.includes(C)), _ = w.length ? w[w.length - 1] : null;
|
|
1388
|
+
for (const C of k) {
|
|
1389
|
+
const E = Ne(C);
|
|
1390
|
+
if (E) {
|
|
1391
|
+
v = `${E}${v}`;
|
|
1377
1392
|
continue;
|
|
1378
1393
|
}
|
|
1379
|
-
if (
|
|
1380
|
-
const
|
|
1381
|
-
typeof
|
|
1394
|
+
if (U.includes(C)) continue;
|
|
1395
|
+
const L = Re[C];
|
|
1396
|
+
typeof L == "function" && (v = L(v, d).replace(/\{.*$/, ""));
|
|
1382
1397
|
}
|
|
1383
|
-
let
|
|
1384
|
-
return
|
|
1398
|
+
let S = `${v}{${d}}`;
|
|
1399
|
+
return b && _ ? S = `@media (prefers-color-scheme: dark) and ${oe[_]}{${S}}` : b ? S = `@media (prefers-color-scheme: dark){${S}}` : _ && (S = `@media ${oe[_]}{${S}}`), S;
|
|
1385
1400
|
}
|
|
1386
1401
|
for (const y of o) {
|
|
1387
|
-
const
|
|
1388
|
-
(
|
|
1402
|
+
const b = y.split(":"), g = b.find(
|
|
1403
|
+
(d) => K[d] || V(d) || J(d) || q(d)
|
|
1389
1404
|
);
|
|
1390
|
-
if (!
|
|
1391
|
-
const
|
|
1392
|
-
if (
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1405
|
+
if (!g) continue;
|
|
1406
|
+
const u = b.indexOf(g), m = u >= 0 ? b.slice(0, u) : [], v = p(m);
|
|
1407
|
+
if (v === 4) {
|
|
1408
|
+
const d = h(y, !0);
|
|
1409
|
+
d && c.push(d);
|
|
1395
1410
|
} else {
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1411
|
+
const d = h(y);
|
|
1412
|
+
d && (v === 1 ? s.push(d) : v === 2 ? i.push(d) : v === 3 && a.push(d));
|
|
1398
1413
|
}
|
|
1399
1414
|
}
|
|
1400
|
-
const
|
|
1401
|
-
return
|
|
1415
|
+
const x = [...s, ...i, ...a, ...c].join("");
|
|
1416
|
+
return se.set(e, { css: x, timestamp: t }), x;
|
|
1402
1417
|
}
|
|
1403
|
-
const
|
|
1404
|
-
function
|
|
1418
|
+
const O = [];
|
|
1419
|
+
function De(e, t, r, n, o, s, i, a) {
|
|
1405
1420
|
if (e) {
|
|
1406
|
-
|
|
1421
|
+
O.push(r);
|
|
1407
1422
|
try {
|
|
1408
1423
|
if (t.loadingTemplate && r.isLoading) {
|
|
1409
|
-
|
|
1424
|
+
z(e, t.loadingTemplate(r), r, n, o);
|
|
1410
1425
|
return;
|
|
1411
1426
|
}
|
|
1412
1427
|
if (t.errorTemplate && r.hasError) {
|
|
1413
|
-
r.error instanceof Error &&
|
|
1428
|
+
r.error instanceof Error && z(e, t.errorTemplate(r.error, r), r, n, o);
|
|
1414
1429
|
return;
|
|
1415
1430
|
}
|
|
1416
1431
|
const c = t.render(r);
|
|
1417
1432
|
if (c instanceof Promise) {
|
|
1418
1433
|
s(!0), c.then((f) => {
|
|
1419
|
-
s(!1), i(null),
|
|
1434
|
+
s(!1), i(null), z(e, f, r, n, o), a(e.innerHTML);
|
|
1420
1435
|
}).catch((f) => {
|
|
1421
|
-
s(!1), i(f), t.errorTemplate &&
|
|
1422
|
-
}), t.loadingTemplate &&
|
|
1436
|
+
s(!1), i(f), t.errorTemplate && z(e, t.errorTemplate(f, r), r, n, o);
|
|
1437
|
+
}), t.loadingTemplate && z(e, t.loadingTemplate(r), r, n, o);
|
|
1423
1438
|
return;
|
|
1424
1439
|
}
|
|
1425
|
-
|
|
1440
|
+
z(e, c, r, n, o), a(e.innerHTML);
|
|
1426
1441
|
} finally {
|
|
1427
|
-
|
|
1442
|
+
O.pop();
|
|
1428
1443
|
}
|
|
1429
1444
|
}
|
|
1430
1445
|
}
|
|
1431
|
-
function
|
|
1432
|
-
e && (
|
|
1446
|
+
function z(e, t, r, n, o) {
|
|
1447
|
+
e && (Ee(
|
|
1433
1448
|
e,
|
|
1434
1449
|
Array.isArray(t) ? t : [t],
|
|
1435
1450
|
r,
|
|
1436
1451
|
n
|
|
1437
1452
|
), o(e.innerHTML));
|
|
1438
1453
|
}
|
|
1439
|
-
function
|
|
1454
|
+
function He(e, t, r, n, o, s, i) {
|
|
1440
1455
|
if (s !== null && clearTimeout(s), Date.now() - t < 16) {
|
|
1441
1456
|
if (o(r + 1), r > 10) {
|
|
1442
1457
|
console.warn("Potential infinite render loop detected. Skipping render."), i(null);
|
|
@@ -1449,32 +1464,32 @@ function Ye(e, t, r, n, o, s, i) {
|
|
|
1449
1464
|
}, 0);
|
|
1450
1465
|
i(c);
|
|
1451
1466
|
}
|
|
1452
|
-
function
|
|
1467
|
+
function qe(e, t, r, n, o, s) {
|
|
1453
1468
|
if (!e) return;
|
|
1454
|
-
const i =
|
|
1469
|
+
const i = We(n);
|
|
1455
1470
|
if (!t.style && (!i || i.trim() === "")) {
|
|
1456
|
-
s(null), e.adoptedStyleSheets = [
|
|
1471
|
+
s(null), e.adoptedStyleSheets = [re()];
|
|
1457
1472
|
return;
|
|
1458
1473
|
}
|
|
1459
1474
|
let a = "";
|
|
1460
1475
|
t.style && (typeof t.style == "string" ? a = t.style : typeof t.style == "function" && (a = t.style(r)));
|
|
1461
|
-
let c =
|
|
1476
|
+
let c = Ae(`${a}
|
|
1462
1477
|
${i}
|
|
1463
1478
|
`);
|
|
1464
|
-
c =
|
|
1479
|
+
c = ue(c);
|
|
1465
1480
|
let f = o;
|
|
1466
|
-
f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [
|
|
1481
|
+
f || (f = new CSSStyleSheet()), (f.cssRules.length === 0 || f.toString() !== c) && f.replaceSync(c), e.adoptedStyleSheets = [re(), f], s(f);
|
|
1467
1482
|
}
|
|
1468
|
-
const
|
|
1469
|
-
function
|
|
1470
|
-
let n =
|
|
1483
|
+
const Ie = /* @__PURE__ */ new Map();
|
|
1484
|
+
function ae(e, t, r) {
|
|
1485
|
+
let n = G(e);
|
|
1471
1486
|
n.includes("-") || (n = `cer-${n}`);
|
|
1472
1487
|
let o;
|
|
1473
1488
|
typeof t == "function" ? o = { ...r, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
|
|
1474
1489
|
console.error(`[${n}] Error:`, s, i);
|
|
1475
|
-
}),
|
|
1490
|
+
}), Ie.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, Fe(o));
|
|
1476
1491
|
}
|
|
1477
|
-
function
|
|
1492
|
+
function Fe(e) {
|
|
1478
1493
|
if (!e.render)
|
|
1479
1494
|
throw new Error(
|
|
1480
1495
|
"Component must have a render function"
|
|
@@ -1561,7 +1576,7 @@ function tt(e) {
|
|
|
1561
1576
|
}
|
|
1562
1577
|
connectedCallback() {
|
|
1563
1578
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1564
|
-
|
|
1579
|
+
me(
|
|
1565
1580
|
e,
|
|
1566
1581
|
this.context,
|
|
1567
1582
|
this._mounted,
|
|
@@ -1573,7 +1588,7 @@ function tt(e) {
|
|
|
1573
1588
|
}
|
|
1574
1589
|
disconnectedCallback() {
|
|
1575
1590
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1576
|
-
|
|
1591
|
+
be(
|
|
1577
1592
|
e,
|
|
1578
1593
|
this.context,
|
|
1579
1594
|
this._listeners,
|
|
@@ -1597,7 +1612,7 @@ function tt(e) {
|
|
|
1597
1612
|
}
|
|
1598
1613
|
attributeChangedCallback(t, r, n) {
|
|
1599
1614
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
1600
|
-
this._applyProps(e),
|
|
1615
|
+
this._applyProps(e), ve(
|
|
1601
1616
|
e,
|
|
1602
1617
|
t,
|
|
1603
1618
|
r,
|
|
@@ -1607,7 +1622,7 @@ function tt(e) {
|
|
|
1607
1622
|
});
|
|
1608
1623
|
}
|
|
1609
1624
|
static get observedAttributes() {
|
|
1610
|
-
return e.props ? Object.keys(e.props).map(
|
|
1625
|
+
return e.props ? Object.keys(e.props).map(G) : [];
|
|
1611
1626
|
}
|
|
1612
1627
|
_applyComputed(t) {
|
|
1613
1628
|
this._runLogicWithinErrorBoundary(e, () => {
|
|
@@ -1615,7 +1630,7 @@ function tt(e) {
|
|
|
1615
1630
|
Object.defineProperty(this.context, r, {
|
|
1616
1631
|
get: () => {
|
|
1617
1632
|
const o = n(this.context);
|
|
1618
|
-
return
|
|
1633
|
+
return Z(o);
|
|
1619
1634
|
},
|
|
1620
1635
|
enumerable: !0
|
|
1621
1636
|
});
|
|
@@ -1625,7 +1640,7 @@ function tt(e) {
|
|
|
1625
1640
|
// --- Render ---
|
|
1626
1641
|
_render(t) {
|
|
1627
1642
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1628
|
-
|
|
1643
|
+
De(
|
|
1629
1644
|
this.shadowRoot,
|
|
1630
1645
|
t,
|
|
1631
1646
|
this.context,
|
|
@@ -1648,7 +1663,7 @@ function tt(e) {
|
|
|
1648
1663
|
}
|
|
1649
1664
|
_requestRender() {
|
|
1650
1665
|
this._runLogicWithinErrorBoundary(this._cfg, () => {
|
|
1651
|
-
|
|
1666
|
+
He(
|
|
1652
1667
|
() => this._render(this._cfg),
|
|
1653
1668
|
this._lastRenderTime,
|
|
1654
1669
|
this._renderCount,
|
|
@@ -1668,7 +1683,7 @@ function tt(e) {
|
|
|
1668
1683
|
// --- Style ---
|
|
1669
1684
|
_applyStyle(t, r) {
|
|
1670
1685
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1671
|
-
|
|
1686
|
+
qe(
|
|
1672
1687
|
this.shadowRoot,
|
|
1673
1688
|
t,
|
|
1674
1689
|
this.context,
|
|
@@ -1707,11 +1722,11 @@ function tt(e) {
|
|
|
1707
1722
|
"splice",
|
|
1708
1723
|
"sort",
|
|
1709
1724
|
"reverse"
|
|
1710
|
-
].includes(a) ? function(...
|
|
1711
|
-
const l = f.apply(i,
|
|
1725
|
+
].includes(a) ? function(...p) {
|
|
1726
|
+
const l = f.apply(i, p);
|
|
1712
1727
|
if (!n._initializing) {
|
|
1713
|
-
const
|
|
1714
|
-
n._triggerWatchers(
|
|
1728
|
+
const x = s || "root";
|
|
1729
|
+
n._triggerWatchers(x, i), n._render(t);
|
|
1715
1730
|
}
|
|
1716
1731
|
return l;
|
|
1717
1732
|
} : f;
|
|
@@ -1754,7 +1769,7 @@ function tt(e) {
|
|
|
1754
1769
|
}
|
|
1755
1770
|
_initWatchers(t) {
|
|
1756
1771
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1757
|
-
|
|
1772
|
+
he(
|
|
1758
1773
|
this.context,
|
|
1759
1774
|
this._watchers,
|
|
1760
1775
|
t.watch || {}
|
|
@@ -1762,12 +1777,12 @@ function tt(e) {
|
|
|
1762
1777
|
});
|
|
1763
1778
|
}
|
|
1764
1779
|
_triggerWatchers(t, r) {
|
|
1765
|
-
|
|
1780
|
+
ge(this.context, this._watchers, t, r);
|
|
1766
1781
|
}
|
|
1767
1782
|
_applyProps(t) {
|
|
1768
1783
|
this._runLogicWithinErrorBoundary(t, () => {
|
|
1769
1784
|
try {
|
|
1770
|
-
|
|
1785
|
+
ye(this, t, this.context);
|
|
1771
1786
|
} catch (r) {
|
|
1772
1787
|
this._hasError = !0, t.onError && t.onError(r, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(r, this.context));
|
|
1773
1788
|
}
|
|
@@ -1775,107 +1790,102 @@ function tt(e) {
|
|
|
1775
1790
|
}
|
|
1776
1791
|
};
|
|
1777
1792
|
}
|
|
1778
|
-
function
|
|
1793
|
+
function M(e, t = {}, r, n) {
|
|
1779
1794
|
const o = n ?? t.key;
|
|
1780
1795
|
return { tag: e, key: o, props: t, children: r };
|
|
1781
1796
|
}
|
|
1782
|
-
function
|
|
1797
|
+
function I(e) {
|
|
1783
1798
|
return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
|
|
1784
1799
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return typeof e == "object" && e !== null && "tag" in e && !
|
|
1800
|
+
function D(e) {
|
|
1801
|
+
return typeof e == "object" && e !== null && "tag" in e && !I(e);
|
|
1787
1802
|
}
|
|
1788
|
-
function
|
|
1803
|
+
function Ke(e, t) {
|
|
1789
1804
|
return e.key != null ? e : { ...e, key: t };
|
|
1790
1805
|
}
|
|
1791
|
-
function
|
|
1806
|
+
function Ue(e, t = [], r = {}) {
|
|
1792
1807
|
const n = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
|
|
1793
1808
|
let a;
|
|
1794
1809
|
for (; a = i.exec(e); ) {
|
|
1795
|
-
const c = a[1], f = a[2],
|
|
1796
|
-
let l =
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
const b =
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
}
|
|
1813
|
-
s[b] = {
|
|
1814
|
-
value: h,
|
|
1815
|
-
modifiers: d
|
|
1816
|
-
};
|
|
1810
|
+
const c = a[1], f = a[2], h = (a[4] || a[6]) ?? "", p = h.match(/^{{(\d+)}}$/);
|
|
1811
|
+
let l = p ? t[Number(p[1])] ?? null : h;
|
|
1812
|
+
p || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l)));
|
|
1813
|
+
const x = ["model", "bind", "show", "class", "style"];
|
|
1814
|
+
if (c === ":") {
|
|
1815
|
+
const [y, ...b] = f.split(".");
|
|
1816
|
+
if (x.includes(y)) {
|
|
1817
|
+
const g = [...b];
|
|
1818
|
+
s[y] = {
|
|
1819
|
+
value: l,
|
|
1820
|
+
modifiers: g
|
|
1821
|
+
};
|
|
1822
|
+
} else
|
|
1823
|
+
o[f] = l;
|
|
1824
|
+
} else if (c === "@") {
|
|
1825
|
+
const y = "on" + f.charAt(0).toUpperCase() + f.slice(1);
|
|
1826
|
+
n[y] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
|
|
1817
1827
|
} else f === "ref" ? n.ref = l : o[f] = l;
|
|
1818
1828
|
}
|
|
1819
1829
|
return { props: n, attrs: o, directives: s };
|
|
1820
1830
|
}
|
|
1821
|
-
function
|
|
1822
|
-
const n =
|
|
1823
|
-
function s(
|
|
1824
|
-
return
|
|
1831
|
+
function Ve(e, t, r) {
|
|
1832
|
+
const n = O.length > 0 ? O[O.length - 1] : void 0, o = r ?? n;
|
|
1833
|
+
function s(d, $) {
|
|
1834
|
+
return M("#text", {}, d, $);
|
|
1825
1835
|
}
|
|
1826
1836
|
let i = "";
|
|
1827
|
-
for (let
|
|
1828
|
-
i += e[
|
|
1837
|
+
for (let d = 0; d < e.length; d++)
|
|
1838
|
+
i += e[d], d < t.length && (i += `{{${d}}}`);
|
|
1829
1839
|
const a = /<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g, c = [];
|
|
1830
|
-
let f,
|
|
1831
|
-
function
|
|
1832
|
-
!
|
|
1840
|
+
let f, h = [], p = null, l = {}, x, y = 0, b = [];
|
|
1841
|
+
function g(d) {
|
|
1842
|
+
!d || typeof d != "object" || I(d) || (d.props || d.attrs ? (d.props && (l.props || (l.props = {}), Object.assign(l.props, d.props)), d.attrs && (l.attrs || (l.attrs = {}), Object.keys(d.attrs).forEach(($) => {
|
|
1833
1843
|
if ($ === "style" && l.attrs.style) {
|
|
1834
|
-
const
|
|
1844
|
+
const k = l.attrs.style.replace(
|
|
1835
1845
|
/;?\s*$/,
|
|
1836
1846
|
""
|
|
1837
|
-
),
|
|
1838
|
-
l.attrs.style =
|
|
1847
|
+
), w = d.attrs.style.replace(/^;?\s*/, "");
|
|
1848
|
+
l.attrs.style = k + "; " + w;
|
|
1839
1849
|
} else if ($ === "class" && l.attrs.class) {
|
|
1840
|
-
const
|
|
1841
|
-
.../* @__PURE__ */ new Set([...
|
|
1850
|
+
const k = l.attrs.class.trim().split(/\s+/).filter(Boolean), w = d.attrs.class.trim().split(/\s+/).filter(Boolean), _ = [
|
|
1851
|
+
.../* @__PURE__ */ new Set([...k, ...w])
|
|
1842
1852
|
];
|
|
1843
|
-
l.attrs.class =
|
|
1853
|
+
l.attrs.class = _.join(" ");
|
|
1844
1854
|
} else
|
|
1845
|
-
l.attrs[$] =
|
|
1846
|
-
}))) : (l.props || (l.props = {}), Object.assign(l.props,
|
|
1847
|
-
}
|
|
1848
|
-
function d
|
|
1849
|
-
const
|
|
1850
|
-
if (
|
|
1851
|
-
const
|
|
1852
|
-
let
|
|
1853
|
-
|
|
1854
|
-
...
|
|
1855
|
-
key:
|
|
1856
|
-
children:
|
|
1855
|
+
l.attrs[$] = d.attrs[$];
|
|
1856
|
+
}))) : (l.props || (l.props = {}), Object.assign(l.props, d)));
|
|
1857
|
+
}
|
|
1858
|
+
function u(d, $) {
|
|
1859
|
+
const k = p ? h : b;
|
|
1860
|
+
if (I(d)) {
|
|
1861
|
+
const w = d.key ?? $;
|
|
1862
|
+
let _ = d.children;
|
|
1863
|
+
k.push({
|
|
1864
|
+
...d,
|
|
1865
|
+
key: w,
|
|
1866
|
+
children: _
|
|
1857
1867
|
});
|
|
1858
1868
|
return;
|
|
1859
1869
|
}
|
|
1860
|
-
if (
|
|
1861
|
-
|
|
1870
|
+
if (D(d)) {
|
|
1871
|
+
k.push(Ke(d, void 0));
|
|
1862
1872
|
return;
|
|
1863
1873
|
}
|
|
1864
|
-
if (Array.isArray(
|
|
1865
|
-
if (
|
|
1866
|
-
for (let
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1874
|
+
if (Array.isArray(d)) {
|
|
1875
|
+
if (d.length === 0) return;
|
|
1876
|
+
for (let w = 0; w < d.length; w++) {
|
|
1877
|
+
const _ = d[w];
|
|
1878
|
+
I(_) || D(_) || Array.isArray(_) ? u(_, `${$}-${w}`) : _ !== null && typeof _ == "object" ? g(_) : k.push(s(String(_), `${$}-${w}`));
|
|
1869
1879
|
}
|
|
1870
1880
|
return;
|
|
1871
1881
|
}
|
|
1872
|
-
if (
|
|
1873
|
-
|
|
1882
|
+
if (d !== null && typeof d == "object") {
|
|
1883
|
+
g(d);
|
|
1874
1884
|
return;
|
|
1875
1885
|
}
|
|
1876
|
-
|
|
1886
|
+
k.push(s(String(d), $));
|
|
1877
1887
|
}
|
|
1878
|
-
const
|
|
1888
|
+
const m = /* @__PURE__ */ new Set([
|
|
1879
1889
|
"area",
|
|
1880
1890
|
"base",
|
|
1881
1891
|
"br",
|
|
@@ -1893,133 +1903,52 @@ function ot(e, t, r) {
|
|
|
1893
1903
|
]);
|
|
1894
1904
|
for (; f = a.exec(i); )
|
|
1895
1905
|
if (f[1]) {
|
|
1896
|
-
const
|
|
1897
|
-
props:
|
|
1898
|
-
attrs:
|
|
1899
|
-
directives:
|
|
1900
|
-
} =
|
|
1901
|
-
for (const
|
|
1902
|
-
for (const
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
for (const [E, j] of Object.entries(T.value))
|
|
1907
|
-
typeof j == "boolean" ? k.attrs[E] = j : j != null && (k.attrs[E] = String(j));
|
|
1908
|
-
else T.value != null && (k.attrs[A] = String(T.value));
|
|
1909
|
-
if (["show", "class", "style"].includes(A) && (k.directives || (k.directives = {}), k.directives[A] = T), A === "show") {
|
|
1910
|
-
const E = !!T.value;
|
|
1911
|
-
k.attrs.style = (k.attrs.style || "") + (E ? "" : "; display: none !important");
|
|
1912
|
-
} else if (A === "class") {
|
|
1913
|
-
const E = T.value;
|
|
1914
|
-
let j = [];
|
|
1915
|
-
if (typeof E == "string")
|
|
1916
|
-
j = E.split(/\s+/).filter(Boolean);
|
|
1917
|
-
else if (Array.isArray(E)) {
|
|
1918
|
-
for (const z of E)
|
|
1919
|
-
if (typeof z == "string")
|
|
1920
|
-
j.push(...z.split(/\s+/).filter(Boolean));
|
|
1921
|
-
else if (z && typeof z == "object")
|
|
1922
|
-
for (const [R, V] of Object.entries(z))
|
|
1923
|
-
V && j.push(...R.split(/\s+/).filter(Boolean));
|
|
1924
|
-
} else if (E && typeof E == "object")
|
|
1925
|
-
for (const [z, R] of Object.entries(E))
|
|
1926
|
-
R && j.push(...z.split(/\s+/).filter(Boolean));
|
|
1927
|
-
const H = k.attrs.class || "", q = [
|
|
1928
|
-
.../* @__PURE__ */ new Set([
|
|
1929
|
-
...H.split(/\s+/).filter(Boolean),
|
|
1930
|
-
...j
|
|
1931
|
-
])
|
|
1932
|
-
];
|
|
1933
|
-
k.attrs.class = q.join(" ");
|
|
1934
|
-
} else if (A === "style") {
|
|
1935
|
-
const E = T.value;
|
|
1936
|
-
let j = "";
|
|
1937
|
-
if (typeof E == "string")
|
|
1938
|
-
j = E;
|
|
1939
|
-
else if (E && typeof E == "object") {
|
|
1940
|
-
const q = [];
|
|
1941
|
-
for (const [z, R] of Object.entries(E))
|
|
1942
|
-
if (R != null && R !== "") {
|
|
1943
|
-
const V = z.replace(
|
|
1944
|
-
/[A-Z]/g,
|
|
1945
|
-
(ke) => `-${ke.toLowerCase()}`
|
|
1946
|
-
), we = [
|
|
1947
|
-
"width",
|
|
1948
|
-
"height",
|
|
1949
|
-
"top",
|
|
1950
|
-
"right",
|
|
1951
|
-
"bottom",
|
|
1952
|
-
"left",
|
|
1953
|
-
"margin",
|
|
1954
|
-
"margin-top",
|
|
1955
|
-
"margin-right",
|
|
1956
|
-
"margin-bottom",
|
|
1957
|
-
"margin-left",
|
|
1958
|
-
"padding",
|
|
1959
|
-
"padding-top",
|
|
1960
|
-
"padding-right",
|
|
1961
|
-
"padding-bottom",
|
|
1962
|
-
"padding-left",
|
|
1963
|
-
"font-size",
|
|
1964
|
-
"line-height",
|
|
1965
|
-
"border-width",
|
|
1966
|
-
"border-radius",
|
|
1967
|
-
"min-width",
|
|
1968
|
-
"max-width",
|
|
1969
|
-
"min-height",
|
|
1970
|
-
"max-height"
|
|
1971
|
-
];
|
|
1972
|
-
let le = String(R);
|
|
1973
|
-
typeof R == "number" && we.includes(V) && (le = `${R}px`), q.push(`${V}: ${le}`);
|
|
1974
|
-
}
|
|
1975
|
-
j = q.join("; ") + (q.length > 0 ? ";" : "");
|
|
1976
|
-
}
|
|
1977
|
-
const H = k.attrs.style || "";
|
|
1978
|
-
k.attrs.style = H + (H && !H.endsWith(";") ? "; " : "") + j;
|
|
1979
|
-
}
|
|
1980
|
-
}
|
|
1981
|
-
const B = {};
|
|
1982
|
-
for (const [A, T] of Object.entries(C))
|
|
1983
|
-
["bind", "show", "class", "style"].includes(A) || (B[A] = T);
|
|
1984
|
-
if (Object.keys(B).length > 0 && (k.directives = B), $) {
|
|
1985
|
-
const A = I(
|
|
1986
|
-
g,
|
|
1906
|
+
const d = f[1], $ = f[0][1] === "/", k = f[0][f[0].length - 2] === "/" || m.has(d), {
|
|
1907
|
+
props: w,
|
|
1908
|
+
attrs: _,
|
|
1909
|
+
directives: S
|
|
1910
|
+
} = Ue(f[2] || "", t, o), C = { props: {}, attrs: {} };
|
|
1911
|
+
for (const E in w) C.props[E] = w[E];
|
|
1912
|
+
for (const E in _) C.attrs[E] = _[E];
|
|
1913
|
+
if (Object.keys(S).length > 0 && (C.directives = { ...S }), $) {
|
|
1914
|
+
const E = M(
|
|
1915
|
+
p,
|
|
1987
1916
|
l,
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
),
|
|
1991
|
-
|
|
1992
|
-
} else
|
|
1993
|
-
tag:
|
|
1917
|
+
h.length === 1 && D(h[0]) && h[0].tag === "#text" ? typeof h[0].children == "string" ? h[0].children : "" : h.length ? h : void 0,
|
|
1918
|
+
x
|
|
1919
|
+
), L = c.pop();
|
|
1920
|
+
L ? (p = L.tag, l = L.props, x = L.key, h = L.children, h.push(E)) : (b.push(E), p = null, l = {}, x = void 0, h = []);
|
|
1921
|
+
} else k ? p ? h.push(M(d, C, void 0, void 0)) : b.push(M(d, C, void 0, void 0)) : (p && c.push({
|
|
1922
|
+
tag: p,
|
|
1994
1923
|
props: l,
|
|
1995
|
-
children:
|
|
1996
|
-
key:
|
|
1997
|
-
}),
|
|
1924
|
+
children: h,
|
|
1925
|
+
key: x
|
|
1926
|
+
}), p = d, l = C, h = []);
|
|
1998
1927
|
} else if (typeof f[3] < "u") {
|
|
1999
|
-
const
|
|
2000
|
-
|
|
1928
|
+
const d = Number(f[3]), $ = t[d], k = `interp-${d}`;
|
|
1929
|
+
u($, k);
|
|
2001
1930
|
} else if (f[4]) {
|
|
2002
|
-
const
|
|
2003
|
-
for (const
|
|
2004
|
-
if (!
|
|
2005
|
-
const
|
|
2006
|
-
if (
|
|
2007
|
-
const
|
|
2008
|
-
|
|
1931
|
+
const d = f[4], $ = p ? h : b, k = d.split(/({{\d+}})/);
|
|
1932
|
+
for (const w of k) {
|
|
1933
|
+
if (!w) continue;
|
|
1934
|
+
const _ = w.match(/^{{(\d+)}}$/);
|
|
1935
|
+
if (_) {
|
|
1936
|
+
const S = Number(_[1]), C = t[S], E = `interp-${S}`;
|
|
1937
|
+
u(C, E);
|
|
2009
1938
|
} else {
|
|
2010
|
-
const
|
|
2011
|
-
$.push(s(
|
|
1939
|
+
const S = `text-${y++}`;
|
|
1940
|
+
$.push(s(w, S));
|
|
2012
1941
|
}
|
|
2013
1942
|
}
|
|
2014
1943
|
}
|
|
2015
|
-
const
|
|
2016
|
-
return
|
|
1944
|
+
const v = b.filter((d) => D(d) && d.tag === "#text" ? typeof d.children == "string" && d.children.trim() !== "" : !0);
|
|
1945
|
+
return v.length === 1 ? v[0] : v.length > 1 ? v : M("div", {}, "", "fallback-root");
|
|
2017
1946
|
}
|
|
2018
|
-
function
|
|
1947
|
+
function B(e, ...t) {
|
|
2019
1948
|
const r = t[t.length - 1], n = typeof r == "object" && r && !Array.isArray(r) ? r : void 0;
|
|
2020
|
-
return
|
|
1949
|
+
return Ve(e, t, n);
|
|
2021
1950
|
}
|
|
2022
|
-
const
|
|
1951
|
+
const le = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, T = (e, t) => {
|
|
2023
1952
|
for (const r of e) {
|
|
2024
1953
|
const n = [], o = r.path.replace(/:[^/]+/g, (a) => (n.push(a.slice(1)), "([^/]+)")), s = new RegExp(`^${o}$`), i = t.match(s);
|
|
2025
1954
|
if (i) {
|
|
@@ -2030,133 +1959,176 @@ const me = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new
|
|
|
2030
1959
|
}
|
|
2031
1960
|
}
|
|
2032
1961
|
return { route: null, params: {} };
|
|
2033
|
-
},
|
|
2034
|
-
async function
|
|
1962
|
+
}, Q = {};
|
|
1963
|
+
async function Je(e) {
|
|
2035
1964
|
if (e.component) return e.component;
|
|
2036
1965
|
if (e.load) {
|
|
2037
|
-
if (
|
|
1966
|
+
if (Q[e.path]) return Q[e.path];
|
|
2038
1967
|
try {
|
|
2039
1968
|
const t = await e.load();
|
|
2040
|
-
return
|
|
1969
|
+
return Q[e.path] = t.default, t.default;
|
|
2041
1970
|
} catch {
|
|
2042
1971
|
throw new Error(`Failed to load component for route: ${e.path}`);
|
|
2043
1972
|
}
|
|
2044
1973
|
}
|
|
2045
1974
|
throw new Error(`No component or loader defined for route: ${e.path}`);
|
|
2046
1975
|
}
|
|
2047
|
-
function
|
|
1976
|
+
function Qe(e) {
|
|
2048
1977
|
const { routes: t, base: r = "", initialUrl: n } = e;
|
|
2049
|
-
let o, s, i, a, c, f,
|
|
2050
|
-
const
|
|
2051
|
-
const
|
|
2052
|
-
if (
|
|
1978
|
+
let o, s, i, a, c, f, h;
|
|
1979
|
+
const p = async (b, g) => {
|
|
1980
|
+
const u = t.find((m) => T([m], b.path).route !== null);
|
|
1981
|
+
if (u?.beforeEnter)
|
|
2053
1982
|
try {
|
|
2054
|
-
const
|
|
2055
|
-
return typeof
|
|
2056
|
-
} catch (
|
|
2057
|
-
return console.error("beforeEnter error",
|
|
1983
|
+
const m = await u.beforeEnter(b, g);
|
|
1984
|
+
return typeof m == "string" ? (await y(m, !0), !1) : m !== !1;
|
|
1985
|
+
} catch (m) {
|
|
1986
|
+
return console.error("beforeEnter error", m), !1;
|
|
2058
1987
|
}
|
|
2059
1988
|
return !0;
|
|
2060
|
-
}, l = async (
|
|
2061
|
-
const
|
|
2062
|
-
if (
|
|
1989
|
+
}, l = async (b, g) => {
|
|
1990
|
+
const u = t.find((m) => T([m], b.path).route !== null);
|
|
1991
|
+
if (u?.onEnter)
|
|
2063
1992
|
try {
|
|
2064
|
-
const
|
|
2065
|
-
return typeof
|
|
2066
|
-
} catch (
|
|
2067
|
-
return console.error("onEnter error",
|
|
1993
|
+
const m = await u.onEnter(b, g);
|
|
1994
|
+
return typeof m == "string" ? (await y(m, !0), !1) : m !== !1;
|
|
1995
|
+
} catch (m) {
|
|
1996
|
+
return console.error("onEnter error", m), !1;
|
|
2068
1997
|
}
|
|
2069
1998
|
return !0;
|
|
2070
|
-
},
|
|
2071
|
-
const
|
|
2072
|
-
if (
|
|
1999
|
+
}, x = (b, g) => {
|
|
2000
|
+
const u = t.find((m) => T([m], b.path).route !== null);
|
|
2001
|
+
if (u?.afterEnter)
|
|
2073
2002
|
try {
|
|
2074
|
-
|
|
2075
|
-
} catch (
|
|
2076
|
-
console.error("afterEnter error",
|
|
2003
|
+
u.afterEnter(b, g);
|
|
2004
|
+
} catch (m) {
|
|
2005
|
+
console.error("afterEnter error", m);
|
|
2077
2006
|
}
|
|
2078
|
-
}, y = async (
|
|
2007
|
+
}, y = async (b, g = !1) => {
|
|
2079
2008
|
try {
|
|
2080
|
-
const
|
|
2081
|
-
path:
|
|
2009
|
+
const u = {
|
|
2010
|
+
path: b.replace(r, "") || "/",
|
|
2082
2011
|
query: {}
|
|
2083
|
-
},
|
|
2084
|
-
if (!
|
|
2085
|
-
const
|
|
2086
|
-
path:
|
|
2087
|
-
params:
|
|
2088
|
-
query:
|
|
2012
|
+
}, m = T(t, u.path);
|
|
2013
|
+
if (!m) throw new Error(`No route found for ${u.path}`);
|
|
2014
|
+
const v = i.getState(), d = {
|
|
2015
|
+
path: u.path,
|
|
2016
|
+
params: m.params,
|
|
2017
|
+
query: u.query
|
|
2089
2018
|
};
|
|
2090
|
-
if (!await
|
|
2091
|
-
typeof window < "u" && typeof document < "u" && (
|
|
2092
|
-
} catch (
|
|
2093
|
-
console.error("Navigation error:",
|
|
2019
|
+
if (!await p(d, v) || !await l(d, v)) return;
|
|
2020
|
+
typeof window < "u" && typeof document < "u" && (g ? window.history.replaceState({}, "", r + b) : window.history.pushState({}, "", r + b)), i.setState(d), x(d, v);
|
|
2021
|
+
} catch (u) {
|
|
2022
|
+
console.error("Navigation error:", u);
|
|
2094
2023
|
}
|
|
2095
2024
|
};
|
|
2096
2025
|
if (typeof window < "u" && typeof document < "u") {
|
|
2097
2026
|
o = () => {
|
|
2098
|
-
const
|
|
2099
|
-
return { path:
|
|
2027
|
+
const g = new URL(window.location.href), u = g.pathname.replace(r, "") || "/", m = le(g.search);
|
|
2028
|
+
return { path: u, query: m };
|
|
2100
2029
|
}, s = o();
|
|
2101
|
-
const
|
|
2102
|
-
i =
|
|
2030
|
+
const b = T(t, s.path);
|
|
2031
|
+
i = ee({
|
|
2103
2032
|
path: s.path,
|
|
2104
|
-
params:
|
|
2033
|
+
params: b.params,
|
|
2105
2034
|
query: s.query
|
|
2106
|
-
}), a = async (
|
|
2107
|
-
const
|
|
2108
|
-
await y(
|
|
2109
|
-
}, window.addEventListener("popstate", () => a(!0)), c = (
|
|
2035
|
+
}), a = async (g = !1) => {
|
|
2036
|
+
const u = o();
|
|
2037
|
+
await y(u.path, g);
|
|
2038
|
+
}, window.addEventListener("popstate", () => a(!0)), c = (g) => y(g, !1), f = (g) => y(g, !0), h = () => window.history.back();
|
|
2110
2039
|
} else {
|
|
2111
2040
|
o = () => {
|
|
2112
|
-
const
|
|
2113
|
-
return { path:
|
|
2041
|
+
const u = new URL(n || "/", "http://localhost"), m = u.pathname.replace(r, "") || "/", v = le(u.search);
|
|
2042
|
+
return { path: m, query: v };
|
|
2114
2043
|
}, s = o();
|
|
2115
|
-
const
|
|
2116
|
-
i =
|
|
2044
|
+
const b = T(t, s.path);
|
|
2045
|
+
i = ee({
|
|
2117
2046
|
path: s.path,
|
|
2118
|
-
params:
|
|
2047
|
+
params: b.params,
|
|
2119
2048
|
query: s.query
|
|
2120
2049
|
}), a = async () => {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
}
|
|
2050
|
+
const u = o();
|
|
2051
|
+
await g(u.path);
|
|
2052
|
+
};
|
|
2053
|
+
const g = async (u) => {
|
|
2054
|
+
try {
|
|
2055
|
+
const m = {
|
|
2056
|
+
path: u.replace(r, "") || "/",
|
|
2057
|
+
query: {}
|
|
2058
|
+
}, v = T(t, m.path);
|
|
2059
|
+
if (!v) throw new Error(`No route found for ${m.path}`);
|
|
2060
|
+
const d = i.getState(), $ = {
|
|
2061
|
+
path: m.path,
|
|
2062
|
+
params: v.params,
|
|
2063
|
+
query: m.query
|
|
2064
|
+
}, k = t.find((w) => T([w], $.path).route !== null);
|
|
2065
|
+
if (k?.beforeEnter)
|
|
2066
|
+
try {
|
|
2067
|
+
const w = await k.beforeEnter($, d);
|
|
2068
|
+
if (typeof w == "string") {
|
|
2069
|
+
await g(w);
|
|
2070
|
+
return;
|
|
2071
|
+
}
|
|
2072
|
+
if (w === !1) return;
|
|
2073
|
+
} catch {
|
|
2074
|
+
return;
|
|
2075
|
+
}
|
|
2076
|
+
if (k?.onEnter)
|
|
2077
|
+
try {
|
|
2078
|
+
const w = await k.onEnter($, d);
|
|
2079
|
+
if (typeof w == "string") {
|
|
2080
|
+
await g(w);
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
if (w === !1) return;
|
|
2084
|
+
} catch {
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2087
|
+
if (i.setState($), k?.afterEnter)
|
|
2088
|
+
try {
|
|
2089
|
+
k.afterEnter($, d);
|
|
2090
|
+
} catch {
|
|
2091
|
+
}
|
|
2092
|
+
} catch {
|
|
2093
|
+
}
|
|
2094
|
+
};
|
|
2095
|
+
c = async (u) => g(u), f = async (u) => g(u), h = () => {
|
|
2124
2096
|
};
|
|
2125
2097
|
}
|
|
2126
2098
|
return {
|
|
2127
2099
|
store: i,
|
|
2128
2100
|
push: c,
|
|
2129
2101
|
replace: f,
|
|
2130
|
-
back:
|
|
2102
|
+
back: h,
|
|
2131
2103
|
subscribe: i.subscribe,
|
|
2132
|
-
matchRoute: (
|
|
2104
|
+
matchRoute: (b) => T(t, b),
|
|
2133
2105
|
getCurrent: () => i.getState(),
|
|
2134
|
-
resolveRouteComponent:
|
|
2106
|
+
resolveRouteComponent: Je
|
|
2135
2107
|
};
|
|
2136
2108
|
}
|
|
2137
|
-
function
|
|
2138
|
-
return
|
|
2109
|
+
function nt(e, t) {
|
|
2110
|
+
return T(e, t);
|
|
2139
2111
|
}
|
|
2140
|
-
function
|
|
2141
|
-
const t =
|
|
2142
|
-
return
|
|
2112
|
+
function ot(e) {
|
|
2113
|
+
const t = Qe(e);
|
|
2114
|
+
return ae("router-view", {
|
|
2143
2115
|
async render() {
|
|
2144
|
-
if (!t) return
|
|
2116
|
+
if (!t) return B`<div>Router not initialized.</div>`;
|
|
2145
2117
|
const r = t.getCurrent(), { path: n } = r, o = t.matchRoute(n);
|
|
2146
|
-
if (!o.route) return
|
|
2118
|
+
if (!o.route) return B`<div>Not found</div>`;
|
|
2147
2119
|
let s = o.route.component;
|
|
2148
2120
|
if (o.route.load) {
|
|
2149
2121
|
const i = await o.route.load();
|
|
2150
2122
|
typeof i.default == "string" && (s = i.default);
|
|
2151
2123
|
}
|
|
2152
|
-
return typeof s == "string" ? { tag: s, props: {}, children: [] } :
|
|
2124
|
+
return typeof s == "string" ? { tag: s, props: {}, children: [] } : B`<div>Invalid route component</div>`;
|
|
2153
2125
|
},
|
|
2154
2126
|
onConnected(r) {
|
|
2155
2127
|
t && typeof t.subscribe == "function" && t.subscribe(() => {
|
|
2156
2128
|
typeof r.requestRender == "function" && r.requestRender();
|
|
2157
2129
|
});
|
|
2158
2130
|
}
|
|
2159
|
-
}),
|
|
2131
|
+
}), ae("router-link", {
|
|
2160
2132
|
state: {},
|
|
2161
2133
|
props: {
|
|
2162
2134
|
to: { type: String, default: "" },
|
|
@@ -2169,7 +2141,7 @@ function gt(e) {
|
|
|
2169
2141
|
disabled: { type: Boolean, default: !1 },
|
|
2170
2142
|
external: { type: Boolean, default: !1 },
|
|
2171
2143
|
class: { type: String, default: "" },
|
|
2172
|
-
style: { type: String, default:
|
|
2144
|
+
style: { type: String, default: fe`
|
|
2173
2145
|
[aria-disabled="true"] {
|
|
2174
2146
|
pointer-events: none;
|
|
2175
2147
|
opacity: 0.5;
|
|
@@ -2178,60 +2150,59 @@ function gt(e) {
|
|
|
2178
2150
|
},
|
|
2179
2151
|
style: (r) => r.style,
|
|
2180
2152
|
render: (r) => {
|
|
2181
|
-
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag,
|
|
2182
|
-
return
|
|
2183
|
-
${
|
|
2153
|
+
const n = t.getCurrent(), o = r.to, s = r.exact, i = r.exactActiveClass, a = r.activeClass, c = r.ariaCurrentValue, f = r.tag, h = r.disabled, p = r.external, l = n.path === o, x = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, y = l ? i : x ? a : "", b = l ? `aria-current="${c}"` : "", g = f === "button", u = h ? g ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", m = p && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
|
|
2154
|
+
return B`
|
|
2155
|
+
${de().when(g, B`
|
|
2184
2156
|
<button
|
|
2185
2157
|
part="button"
|
|
2186
2158
|
:class="${r.class} ${y}"
|
|
2159
|
+
${b}
|
|
2160
|
+
${u}
|
|
2187
2161
|
${m}
|
|
2188
|
-
${d}
|
|
2189
|
-
${v}
|
|
2190
2162
|
@click="navigate"
|
|
2191
2163
|
><slot></slot></button>
|
|
2192
|
-
`).otherwise(
|
|
2164
|
+
`).otherwise(B`
|
|
2193
2165
|
<a
|
|
2194
2166
|
part="link"
|
|
2195
2167
|
href="${o}"
|
|
2196
2168
|
:class="${r.class} ${y}"
|
|
2169
|
+
${b}
|
|
2170
|
+
${u}
|
|
2197
2171
|
${m}
|
|
2198
|
-
${d}
|
|
2199
|
-
${v}
|
|
2200
2172
|
@click="navigate"
|
|
2201
2173
|
><slot></slot></a>
|
|
2202
2174
|
`).done()}
|
|
2203
2175
|
`;
|
|
2204
2176
|
},
|
|
2205
2177
|
navigate: (r, n) => {
|
|
2206
|
-
|
|
2207
|
-
if (o) {
|
|
2178
|
+
if (n.disabled) {
|
|
2208
2179
|
r.preventDefault();
|
|
2209
2180
|
return;
|
|
2210
2181
|
}
|
|
2211
|
-
|
|
2182
|
+
n.external && (n.tag === "a" || !n.tag) || (r.preventDefault(), n.replace ? t.replace(n.to) : t.push(n.to));
|
|
2212
2183
|
}
|
|
2213
2184
|
}), t;
|
|
2214
2185
|
}
|
|
2215
2186
|
export {
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2187
|
+
N as GlobalEventBus,
|
|
2188
|
+
ae as component,
|
|
2189
|
+
ee as createStore,
|
|
2190
|
+
fe as css,
|
|
2191
|
+
Xe as each,
|
|
2192
|
+
Ye as emit,
|
|
2193
|
+
P as eventBus,
|
|
2194
|
+
B as html,
|
|
2195
|
+
ot as initRouter,
|
|
2196
|
+
rt as listen,
|
|
2197
|
+
de as match,
|
|
2198
|
+
T as matchRoute,
|
|
2199
|
+
nt as matchRouteSSR,
|
|
2200
|
+
et as off,
|
|
2201
|
+
Ge as on,
|
|
2202
|
+
tt as once,
|
|
2203
|
+
le as parseQuery,
|
|
2204
|
+
Je as resolveRouteComponent,
|
|
2205
|
+
Qe as useRouter,
|
|
2206
|
+
Ze as when
|
|
2236
2207
|
};
|
|
2237
2208
|
//# sourceMappingURL=custom-elements-runtime.es.js.map
|