@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.
@@ -1,13 +1,13 @@
1
- function at(e, t) {
2
- return Y(e ? t : [], "when-block");
1
+ function Ze(e, t) {
2
+ return F(e ? t : [], "when-block");
3
3
  }
4
- function lt(e, t) {
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 Y(t(r, n), `each-${o}`);
7
+ return F(t(r, n), `each-${o}`);
8
8
  });
9
9
  }
10
- function $e() {
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 _e(...e);
20
+ return pe(...e);
21
21
  }
22
22
  };
23
23
  }
24
- function _e(...e) {
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 [Y(n, `whenChain-branch-${t}`)];
27
+ if (r) return [F(n, `whenChain-branch-${t}`)];
28
28
  }
29
- return [Y([], "whenChain-empty")];
29
+ return [F([], "whenChain-empty")];
30
30
  }
31
- function Y(e, t) {
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 D extends EventTarget {
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 D.instance || (D.instance = new D()), D.instance;
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 K = D.getInstance(), ct = (e, t) => K.emit(e, t), ft = (e, t) => K.on(e, t), ut = (e, t) => K.off(e, t), dt = (e, t) => K.once(e, t), pt = (e, t, r) => K.listen(e, t, r);
164
- function ce(e) {
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 ae(e) {
182
+ function G(e) {
183
183
  return e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
184
184
  }
185
- function oe(e) {
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 Se(e, t, r) {
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: ie(e, n)
204
+ oldValue: X(e, n)
205
205
  }), i.immediate)
206
206
  try {
207
- const a = ie(e, n);
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 ie(e, t) {
214
+ function X(e, t) {
215
215
  return t.split(".").reduce((r, n) => r?.[n], e);
216
216
  }
217
- function Ce(e, t, r, n) {
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((p, g) => o(p, a[g]));
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((p) => o(i[p], a[p]));
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 = ie(e, i);
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 Ae(e, t, r) {
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(ae(o));
251
- i !== null ? r[o] = oe(n(i, s.type)) : "default" in s && s.default !== void 0 && (r[o] = oe(s.default));
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 Ee(e, t, r, n) {
255
+ function me(e, t, r, n) {
256
256
  e.onConnected && !r && (e.onConnected(t), n(!0));
257
257
  }
258
- function Te(e, t, r, n, o, s, i, a) {
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 je(e, t, r, n, o) {
261
+ function ve(e, t, r, n, o) {
262
262
  e.onAttributeChanged && e.onAttributeChanged(t, r, n, o);
263
263
  }
264
- function M(e, t) {
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
- M(r, t);
269
+ j(r, t);
270
270
  }
271
271
  }
272
- function O(e, t) {
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 fe(e, t, r) {
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 Le(e, t, r, n, o, s, i) {
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"), p = () => {
284
- const h = s._state || s;
285
- return O(h, e);
286
- }, g = p();
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 b = n?.type;
289
- if (i instanceof HTMLInputElement ? l = b || i.type || "text" : i instanceof HTMLSelectElement ? l = "select" : i instanceof HTMLTextAreaElement && (l = "textarea"), l === "checkbox")
290
- if (Array.isArray(g)) {
291
- const h = i?.getAttribute("value") || n?.value || "", d = g.includes(h);
292
- i && i.checked !== d && (r.checked = d);
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 h = i?.getAttribute("true-value") || !0, d = g === h;
295
- i && i.checked !== d && (r.checked = d);
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 h = n?.value || "", d = g === h;
299
- i && i.checked !== d && (r.checked = d);
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 h = i, d = Array.isArray(g) ? g : [];
302
+ const g = i, u = Array.isArray(p) ? p : [];
303
303
  setTimeout(() => {
304
- Array.from(h.options).forEach((v) => {
305
- const x = d.includes(v.value);
306
- v.selected !== x && (v.selected = x);
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(g) && (i.value = String(g));
311
+ i instanceof HTMLSelectElement && i.value !== String(p) && (i.value = String(p));
312
312
  }, 0);
313
313
  else {
314
- const h = String(g ?? "");
315
- (!i || i.value !== h) && (r.value = g);
316
- }
317
- const y = a || l === "checkbox" || l === "radio" || l === "select" ? "change" : "input", m = (h) => {
318
- if (h.isComposing || o._isComposing || h.isTrusted === !1) return;
319
- const d = h.target;
320
- if (d._modelUpdating) return;
321
- const v = p();
322
- let x = d.value;
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(v)) {
325
- const _ = d.getAttribute("value") || "", S = [...v];
326
- if (d.checked)
327
- S.includes(_) || S.push(_);
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 C = S.indexOf(_);
330
- C > -1 && S.splice(C, 1);
329
+ const S = _.indexOf(w);
330
+ S > -1 && _.splice(S, 1);
331
331
  }
332
- x = S;
332
+ v = _;
333
333
  } else {
334
- const _ = d.getAttribute("true-value") || !0, S = d.getAttribute("false-value") || !1;
335
- x = d.checked ? _ : S;
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
- x = d.getAttribute("value") || d.value;
339
- else if (l === "select" && d.multiple) {
340
- const _ = d;
341
- x = Array.from(_.selectedOptions).map(
342
- (S) => S.value
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 && (x = x.trim()), f) {
345
- const _ = Number(x);
346
- isNaN(_) || (x = _);
344
+ } else if (c && (v = v.trim()), f) {
345
+ const w = Number(v);
346
+ isNaN(w) || (v = w);
347
347
  }
348
- const u = s._state || s, $ = O(u, e);
349
- if (Array.isArray(x) && Array.isArray($) ? JSON.stringify([...x].sort()) !== JSON.stringify([...$].sort()) : x !== $) {
350
- const _ = h.target;
351
- _._modelUpdating = !0, fe(u, e, x), setTimeout(() => {
352
- _._modelUpdating = !1;
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] = m, l === "text" || l === "textarea") {
357
- const h = () => {
356
+ if (o[y] = b, l === "text" || l === "textarea") {
357
+ const g = () => {
358
358
  o._isComposing = !0;
359
- }, d = (v) => {
359
+ }, u = (m) => {
360
360
  o._isComposing = !1;
361
- const x = v.target;
361
+ const v = m.target;
362
362
  setTimeout(() => {
363
- if (x) {
364
- let u = x.value;
365
- if (c && (u = u.trim()), f) {
366
- const S = Number(u);
367
- isNaN(S) || (u = S);
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, w = O($, e);
370
- (Array.isArray(u) && Array.isArray(w) ? JSON.stringify([...u].sort()) !== JSON.stringify([...w].sort()) : u !== w) && (x && (x._modelUpdating = !0, setTimeout(() => {
371
- x._modelUpdating = !1;
372
- }, 0)), fe($, e, u), s._requestRender && s._requestRender());
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 = h, o.compositionend = d;
376
+ o.compositionstart = g, o.compositionend = u;
377
377
  }
378
378
  }
379
- function Be(e, t, r, n) {
380
- if (n)
381
- try {
382
- const o = JSON.parse(e);
383
- if (typeof o == "object")
384
- for (const [s, i] of Object.entries(o))
385
- t[s] = i;
386
- } catch {
387
- const o = O(n, e);
388
- r[e] = o;
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 ze(e, t, r) {
398
+ function ke(e, t, r) {
392
399
  if (!r) return;
393
- const n = O(r, e), o = t.style || "", s = n ? "" : "none";
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 Re(e, t, r) {
409
+ function $e(e, t, r) {
403
410
  if (!r) return;
404
- const n = O(r, e);
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).map(([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 Ne(e, t, r) {
417
+ function _e(e, t, r) {
411
418
  let n;
412
419
  if (typeof e == "string") {
413
420
  if (!r) return;
414
- n = O(r, e);
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
- ), p = [
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 g = String(c);
454
- typeof c == "number" && p.includes(f) && (g = `${c}px`), i.push(`${f}: ${g}`);
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 be(e, t, r, n) {
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: p } = c;
471
+ const { value: f, modifiers: h } = c;
465
472
  switch (a) {
466
473
  case "model":
467
- Le(
474
+ xe(
468
475
  typeof f == "string" ? f : String(f),
469
- p,
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
- Be(f, o, s, t);
485
+ we(f, o, s, t);
479
486
  break;
480
487
  case "show":
481
- ze(f, s, t);
488
+ ke(f, s, t);
482
489
  break;
483
490
  case "class":
484
- Re(f, s, t);
491
+ $e(f, s, t);
485
492
  break;
486
493
  case "style":
487
- Ne(f, s, t);
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 se(e, t) {
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 g = i.tag || "node", l = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
501
- a = l ? `${t}:${g}:${l}` : `${t}:${g}`;
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 p = i.children;
508
- return Array.isArray(p) && (p = se(p, c)), { ...i, key: c, children: p };
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 = se(o, n)), { ...r, key: n, children: o };
520
+ return Array.isArray(o) && (o = Y(o, n)), { ...r, key: n, children: o };
514
521
  }
515
- function Me(e, t, r, n) {
516
- const o = r.directives ?? {}, s = be(
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 b = c[l], y = f[l];
532
- b !== 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 b == "function" && e.removeEventListener(l.slice(2).toLowerCase(), b), e.addEventListener(l.slice(2).toLowerCase(), y)) : y == null || y === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(y)));
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, b] of Object.entries(
541
+ for (const [l, x] of Object.entries(
535
542
  s.listeners || {}
536
543
  ))
537
- e.addEventListener(l, b);
538
- const p = t.attrs ?? {}, g = a;
539
- for (const l in { ...p, ...g }) {
540
- const b = p[l], y = g[l];
541
- b !== y && (y == null || y === !1 ? e.removeAttribute(l) : e.setAttribute(l, String(y)));
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 L(e, t, r) {
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 g = document.createTextNode(
555
+ const p = document.createTextNode(
549
556
  typeof e.children == "string" ? e.children : ""
550
557
  );
551
- return e.key != null && (g.key = e.key), g;
558
+ return e.key != null && (p.key = e.key), p;
552
559
  }
553
560
  if (e.tag === "#anchor") {
554
- const g = e, l = Array.isArray(g.children) ? g.children : [], b = document.createTextNode(""), y = document.createTextNode("");
555
- g.key != null && (b.key = `${g.key}:start`, y.key = `${g.key}:end`), g._startNode = b, g._endNode = y;
556
- const m = document.createDocumentFragment();
557
- m.appendChild(b);
558
- for (const h of l) {
559
- const d = L(h, t);
560
- m.appendChild(d);
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 m.appendChild(y), m;
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 = be(i, t, n, s), c = {
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 g in f) {
574
- const l = f[g];
575
- typeof l == "boolean" ? l && n.setAttribute(g, "") : l != null && n.setAttribute(g, String(l));
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 g in c) {
578
- const l = c[g];
579
- if (g === "value" && (n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement))
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 (g === "checked" && n instanceof HTMLInputElement)
596
+ else if (p === "checked" && n instanceof HTMLInputElement)
582
597
  n.checked = !!l;
583
- else if (g.startsWith("on") && typeof l == "function")
584
- n.addEventListener(g.slice(2).toLowerCase(), l);
598
+ else if (p.startsWith("on") && typeof l == "function")
599
+ n.addEventListener(p.slice(2).toLowerCase(), l);
585
600
  else {
586
- if (g.startsWith("on") && l === void 0)
601
+ if (p.startsWith("on") && l === void 0)
587
602
  continue;
588
- l == null || l === !1 ? n.removeAttribute(g) : n.setAttribute(g, String(l));
603
+ l == null || l === !1 ? n.removeAttribute(p) : n.setAttribute(p, String(l));
589
604
  }
590
605
  }
591
- for (const [g, l] of Object.entries(
606
+ for (const [p, l] of Object.entries(
592
607
  a.listeners || {}
593
608
  ))
594
- n.addEventListener(g, l);
595
- const p = e.props?.ref ?? (e.props?.props && e.props.props.ref);
596
- if (typeof e != "string" && p && r && (r[p] = n), Array.isArray(e.children))
597
- for (const g of e.children)
598
- n.appendChild(L(g, t, r));
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 Oe(e, t, r, n, o) {
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 b of i)
610
- b && b.key != null && a.set(b.key, b);
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 b of s) {
613
- const y = b.key;
614
- y != null && c.set(y, b);
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 p = e.firstChild;
618
- function g(b, y) {
619
- let m = b;
620
- for (; m && (f.add(m), m !== y); )
621
- m = m.nextSibling;
622
- }
623
- function l(b, y, m, h) {
624
- const d = [];
625
- let v = b.nextSibling;
626
- for (; v && v !== y; )
627
- d.push(v), v = v.nextSibling;
628
- const x = Array.isArray(m) ? m : [];
629
- if (h.some(($) => $ && $.key != null) || x.some(($) => $ && $.key != null)) {
630
- const $ = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map();
631
- for (const C of x)
632
- C && C.key != null && $.set(C.key, C);
633
- for (const C of d) {
634
- const k = C.key;
635
- k != null && w.set(k, C);
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 _ = /* @__PURE__ */ new Set();
638
- let S = b.nextSibling;
639
- for (const C of h) {
640
- let k;
641
- if (C.key != null && w.has(C.key)) {
642
- const B = $.get(C.key);
643
- k = Q(
644
- w.get(C.key),
645
- B,
646
- C,
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
- ), _.add(k), k !== S && e.contains(k) && e.insertBefore(k, S);
663
+ ), w.add(C), C !== _ && e.contains(C) && e.insertBefore(C, _);
649
664
  } else
650
- k = L(C, n), e.insertBefore(k, S), _.add(k);
651
- S = k.nextSibling;
665
+ C = A(S, n), e.insertBefore(C, _), w.add(C);
666
+ _ = C.nextSibling;
652
667
  }
653
- for (const C of d)
654
- !_.has(C) && e.contains(C) && e.removeChild(C);
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
- x.length,
658
- h.length
672
+ v.length,
673
+ g.length
659
674
  );
660
- for (let w = 0; w < $; w++) {
661
- const _ = x[w], S = h[w], C = Q(d[w], _, S, n);
662
- C !== d[w] && (e.insertBefore(C, d[w]), e.removeChild(d[w]));
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 w = $; w < h.length; w++)
665
- e.insertBefore(L(h[w], n), y);
666
- for (let w = $; w < d.length; w++)
667
- e.removeChild(d[w]);
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 b of r) {
685
+ for (const x of r) {
671
686
  let y;
672
- if (b.tag === "#anchor") {
673
- const m = b.key, h = `${m}:start`, d = `${m}:end`;
674
- let v = c.get(h), x = c.get(d);
675
- const u = Array.isArray(b.children) ? b.children : [];
676
- if (v || (v = document.createTextNode(""), v.key = h), x || (x = document.createTextNode(""), x.key = d), b._startNode = v, b._endNode = x, !e.contains(v) || !e.contains(x)) {
677
- e.insertBefore(v, p);
678
- for (const $ of u)
679
- e.insertBefore(L($, n), p);
680
- e.insertBefore(x, p);
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
- x,
685
- a.get(m)?.children,
686
- u
700
+ a.get(b)?.children,
701
+ d
687
702
  );
688
- g(v, x), p = x.nextSibling;
703
+ p(m, v), h = v.nextSibling;
689
704
  continue;
690
705
  }
691
- if (b.key != null && c.has(b.key)) {
692
- const m = a.get(b.key);
693
- y = Q(
694
- c.get(b.key),
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 !== p && e.contains(y) && (p && !e.contains(p) && (p = null), e.insertBefore(y, p));
714
+ ), f.add(y), y !== h && e.contains(y) && (h && !e.contains(h) && (h = null), e.insertBefore(y, h));
700
715
  } else
701
- y = L(b, n, o), p && !e.contains(p) && (p = null), e.insertBefore(y, p), f.add(y);
702
- p = y.nextSibling;
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 b of s)
705
- !f.has(b) && e.contains(b) && (M(b, o), e.removeChild(b));
719
+ for (const x of s)
720
+ !f.has(x) && e.contains(x) && (j(x, o), e.removeChild(x));
706
721
  }
707
- function Q(e, t, r, n, o) {
708
- if (t && typeof t != "string" && t.props?.ref && o && M(e, o), t === r) return e;
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 p = document.createDocumentFragment();
721
- p.appendChild(c);
722
- for (const g of a) {
723
- const l = L(g, n);
724
- p.appendChild(l);
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 p.appendChild(f), e.parentNode?.replaceChild(p, e), c;
741
+ return h.appendChild(f), e.parentNode?.replaceChild(h, e), c;
727
742
  }
728
743
  if (!r) {
729
- M(e, o);
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
- M(e, o);
735
- const i = L(r, n, o);
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 p of i)
744
- f.appendChild(L(p, n));
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 Me(i, t.props || {}, r.props || {}, n), Oe(i, t.children, r.children, n, o), typeof r != "string" && r.props?.ref && o && (o[r.props.ref] = i), i;
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
- M(e, o);
752
- const s = L(r, n, o);
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 Pe(e, t, r, n) {
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 = se(o, String(o.key ?? "root"));
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 = Q(i, s, o, r, n) : (a = L(o, r, n), e.replaceChild(a, i)) : (a = L(o, r, n), e.firstChild ? e.replaceChild(a, e.firstChild) : e.appendChild(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 p = e.childNodes[f];
769
- p !== a && p.nodeName !== "STYLE" && (M(p, n), c.push(p));
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 ve(e, ...t) {
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 xe(e) {
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 U = null;
783
- function ue() {
784
- return U || (U = new CSSStyleSheet(), U.replaceSync(xe(De))), U;
797
+ let W = null;
798
+ function re() {
799
+ return W || (W = new CSSStyleSheet(), W.replaceSync(ue(Te))), W;
785
800
  }
786
- function We(e) {
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 De = ve`
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
- `, He = {
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
- }, G = {
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
- }, qe = "0.25rem", de = {
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
- }, Ie = {
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
- }, pe = {
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
- }, ee = ["sm", "md", "lg", "xl", "2xl"];
1223
- function te(e) {
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) || !de[o]) return null;
1242
+ if (Number.isNaN(i) || !ne[o]) return null;
1228
1243
  const a = t ? "-" : "";
1229
- return de[o].map((c) => `${c}:calc(${a}${qe} * ${i});`).join("");
1244
+ return ne[o].map((c) => `${c}:calc(${a}${je} * ${i});`).join("");
1230
1245
  }
1231
- function he(e) {
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 Fe(e) {
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 = He[n]?.[o];
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 Ke(e) {
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 re(e) {
1260
- const { base: t, opacity: r } = Ke(e), n = Fe(t);
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 = he(s[0]);
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 = Z(t);
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 = he(s[0]);
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 Z(e) {
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 Ve(e) {
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 Ue(e) {
1349
+ function Me(e) {
1335
1350
  return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g, "\\$1");
1336
1351
  }
1337
- function Je(e) {
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 ge = /* @__PURE__ */ new Map(), Qe = 16;
1347
- function Ze(e) {
1348
- const t = Date.now(), r = ge.get(e);
1349
- if (r && t - r.timestamp < Qe) return r.css;
1350
- const n = Je(e), o = new Set(n), s = [], i = [], a = [], c = [], f = {};
1351
- function p(y, m = !1) {
1352
- const h = (m ? "dark|" : "") + y;
1353
- if (h in f) return f[h];
1354
- const d = l(y, m);
1355
- return f[h] = d, d;
1356
- }
1357
- function g(y) {
1358
- const m = y.some((d) => ee.includes(d)), h = y.includes("dark");
1359
- return y.length === 0 ? 1 : !m && !h ? 2 : m && !h ? 3 : 4;
1360
- }
1361
- function l(y, m = !1) {
1362
- const h = y.split(":"), d = h.find(
1363
- (k) => G[k] || te(k) || re(k) || Z(k)
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 (!d) return null;
1366
- const v = G[d] ?? te(d) ?? re(d) ?? Z(d);
1367
- if (!v) return null;
1368
- let x = `.${Ue(y)}`, u = v;
1369
- const $ = h.indexOf(d);
1370
- let w = $ >= 0 ? h.slice(0, $) : [];
1371
- m && (w = w.filter((k) => k !== "dark"));
1372
- const _ = w.filter((k) => ee.includes(k)), S = _.length ? _[_.length - 1] : null;
1373
- for (const k of w) {
1374
- const B = Ve(k);
1375
- if (B) {
1376
- x = `${B}${x}`;
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 (ee.includes(k)) continue;
1380
- const A = Ie[k];
1381
- typeof A == "function" && (x = A(x, u).replace(/\{.*$/, ""));
1394
+ if (U.includes(C)) continue;
1395
+ const L = Re[C];
1396
+ typeof L == "function" && (v = L(v, d).replace(/\{.*$/, ""));
1382
1397
  }
1383
- let C = `${x}{${u}}`;
1384
- return m && S ? C = `@media (prefers-color-scheme: dark) and ${pe[S]}{${C}}` : m ? C = `@media (prefers-color-scheme: dark){${C}}` : S && (C = `@media ${pe[S]}{${C}}`), C;
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 m = y.split(":"), h = m.find(
1388
- (u) => G[u] || te(u) || re(u) || Z(u)
1402
+ const b = y.split(":"), g = b.find(
1403
+ (d) => K[d] || V(d) || J(d) || q(d)
1389
1404
  );
1390
- if (!h) continue;
1391
- const d = m.indexOf(h), v = d >= 0 ? m.slice(0, d) : [], x = g(v);
1392
- if (x === 4) {
1393
- const u = p(y, !0);
1394
- u && c.push(u);
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 u = p(y);
1397
- u && (x === 1 ? s.push(u) : x === 2 ? i.push(u) : x === 3 && a.push(u));
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 b = [...s, ...i, ...a, ...c].join("");
1401
- return ge.set(e, { css: b, timestamp: t }), b;
1415
+ const x = [...s, ...i, ...a, ...c].join("");
1416
+ return se.set(e, { css: x, timestamp: t }), x;
1402
1417
  }
1403
- const F = [];
1404
- function Xe(e, t, r, n, o, s, i, a) {
1418
+ const O = [];
1419
+ function De(e, t, r, n, o, s, i, a) {
1405
1420
  if (e) {
1406
- F.push(r);
1421
+ O.push(r);
1407
1422
  try {
1408
1423
  if (t.loadingTemplate && r.isLoading) {
1409
- P(e, t.loadingTemplate(r), r, n, o);
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 && P(e, t.errorTemplate(r.error, r), r, n, o);
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), P(e, f, r, n, o), a(e.innerHTML);
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 && P(e, t.errorTemplate(f, r), r, n, o);
1422
- }), t.loadingTemplate && P(e, t.loadingTemplate(r), r, n, o);
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
- P(e, c, r, n, o), a(e.innerHTML);
1440
+ z(e, c, r, n, o), a(e.innerHTML);
1426
1441
  } finally {
1427
- F.pop();
1442
+ O.pop();
1428
1443
  }
1429
1444
  }
1430
1445
  }
1431
- function P(e, t, r, n, o) {
1432
- e && (Pe(
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 Ye(e, t, r, n, o, s, i) {
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 Ge(e, t, r, n, o, s) {
1467
+ function qe(e, t, r, n, o, s) {
1453
1468
  if (!e) return;
1454
- const i = Ze(n);
1469
+ const i = We(n);
1455
1470
  if (!t.style && (!i || i.trim() === "")) {
1456
- s(null), e.adoptedStyleSheets = [ue()];
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 = We(`${a}
1476
+ let c = Ae(`${a}
1462
1477
  ${i}
1463
1478
  `);
1464
- c = xe(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 = [ue(), f], s(f);
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 et = /* @__PURE__ */ new Map();
1469
- function ye(e, t, r) {
1470
- let n = ae(e);
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
- }), et.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, tt(o));
1490
+ }), Ie.set(n, o), typeof window < "u" && !customElements.get(n) && customElements.define(n, Fe(o));
1476
1491
  }
1477
- function tt(e) {
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
- Ee(
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
- Te(
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), je(
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(ae) : [];
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 oe(o);
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
- Xe(
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
- Ye(
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
- Ge(
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(...g) {
1711
- const l = f.apply(i, g);
1725
+ ].includes(a) ? function(...p) {
1726
+ const l = f.apply(i, p);
1712
1727
  if (!n._initializing) {
1713
- const b = s || "root";
1714
- n._triggerWatchers(b, i), n._render(t);
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
- Se(
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
- Ce(this.context, this._watchers, t, r);
1780
+ ge(this.context, this._watchers, t, r);
1766
1781
  }
1767
1782
  _applyProps(t) {
1768
1783
  this._runLogicWithinErrorBoundary(t, () => {
1769
1784
  try {
1770
- Ae(this, t, this.context);
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 I(e, t = {}, r, n) {
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 X(e) {
1797
+ function I(e) {
1783
1798
  return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
1784
1799
  }
1785
- function J(e) {
1786
- return typeof e == "object" && e !== null && "tag" in e && !X(e);
1800
+ function D(e) {
1801
+ return typeof e == "object" && e !== null && "tag" in e && !I(e);
1787
1802
  }
1788
- function rt(e, t) {
1803
+ function Ke(e, t) {
1789
1804
  return e.key != null ? e : { ...e, key: t };
1790
1805
  }
1791
- function nt(e, t = [], r = {}) {
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], p = (a[4] || a[6]) ?? "", g = p.match(/^{{(\d+)}}$/);
1796
- let l = g ? t[Number(g[1])] ?? null : p;
1797
- if (g || (l === "true" ? l = !0 : l === "false" ? l = !1 : l === "null" ? l = null : isNaN(Number(l)) || (l = Number(l))), c === ":")
1798
- typeof l == "boolean" ? o[f] = l : l != null && (typeof r[l] < "u" ? n[f] = r[l] : n[f] = l);
1799
- else if (c === "@") {
1800
- const b = "on" + f.charAt(0).toUpperCase() + f.slice(1);
1801
- n[b] = typeof l == "function" ? l : typeof r[l] == "function" ? r[l] : void 0;
1802
- } else if (c === "#") {
1803
- const [b, ...y] = f.split("."), m = [...y];
1804
- let h = l, d = [...m];
1805
- if (b === "model" && typeof h == "string" && h.includes(".")) {
1806
- const v = ["trim", "number", "lazy"], x = h.split(".");
1807
- let u = h;
1808
- const $ = [];
1809
- for (let w = x.length - 1; w > 0 && v.includes(x[w]); w--)
1810
- $.unshift(x[w]), u = x.slice(0, w).join(".");
1811
- h = u, d.push(...$);
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 ot(e, t, r) {
1822
- const n = F.length > 0 ? F[F.length - 1] : void 0, o = r ?? n;
1823
- function s(u, $) {
1824
- return I("#text", {}, u, $);
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 u = 0; u < e.length; u++)
1828
- i += e[u], u < t.length && (i += `{{${u}}}`);
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, p = [], g = null, l = {}, b, y = 0, m = [];
1831
- function h(u) {
1832
- !u || typeof u != "object" || X(u) || (u.props || u.attrs ? (u.props && (l.props || (l.props = {}), Object.assign(l.props, u.props)), u.attrs && (l.attrs || (l.attrs = {}), Object.keys(u.attrs).forEach(($) => {
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 w = l.attrs.style.replace(
1844
+ const k = l.attrs.style.replace(
1835
1845
  /;?\s*$/,
1836
1846
  ""
1837
- ), _ = u.attrs.style.replace(/^;?\s*/, "");
1838
- l.attrs.style = w + "; " + _;
1847
+ ), w = d.attrs.style.replace(/^;?\s*/, "");
1848
+ l.attrs.style = k + "; " + w;
1839
1849
  } else if ($ === "class" && l.attrs.class) {
1840
- const w = l.attrs.class.trim().split(/\s+/).filter(Boolean), _ = u.attrs.class.trim().split(/\s+/).filter(Boolean), S = [
1841
- .../* @__PURE__ */ new Set([...w, ..._])
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 = S.join(" ");
1853
+ l.attrs.class = _.join(" ");
1844
1854
  } else
1845
- l.attrs[$] = u.attrs[$];
1846
- }))) : (l.props || (l.props = {}), Object.assign(l.props, u)));
1847
- }
1848
- function d(u, $) {
1849
- const w = g ? p : m;
1850
- if (X(u)) {
1851
- const _ = u.key ?? $;
1852
- let S = u.children;
1853
- w.push({
1854
- ...u,
1855
- key: _,
1856
- children: S
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 (J(u)) {
1861
- w.push(rt(u, void 0));
1870
+ if (D(d)) {
1871
+ k.push(Ke(d, void 0));
1862
1872
  return;
1863
1873
  }
1864
- if (Array.isArray(u)) {
1865
- if (u.length === 0) return;
1866
- for (let _ = 0; _ < u.length; _++) {
1867
- const S = u[_];
1868
- X(S) || J(S) || Array.isArray(S) ? d(S, `${$}-${_}`) : S !== null && typeof S == "object" ? h(S) : w.push(s(String(S), `${$}-${_}`));
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 (u !== null && typeof u == "object") {
1873
- h(u);
1882
+ if (d !== null && typeof d == "object") {
1883
+ g(d);
1874
1884
  return;
1875
1885
  }
1876
- w.push(s(String(u), $));
1886
+ k.push(s(String(d), $));
1877
1887
  }
1878
- const v = /* @__PURE__ */ new Set([
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 u = f[1], $ = f[0][1] === "/", w = f[0][f[0].length - 2] === "/" || v.has(u), {
1897
- props: _,
1898
- attrs: S,
1899
- directives: C
1900
- } = nt(f[2] || "", t, o), k = { props: {}, attrs: {} };
1901
- for (const A in _) k.props[A] = _[A];
1902
- for (const A in S) k.attrs[A] = S[A];
1903
- for (const [A, T] of Object.entries(C)) {
1904
- if (A === "bind")
1905
- if (typeof T.value == "object" && T.value !== null)
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
- p.length === 1 && J(p[0]) && p[0].tag === "#text" ? typeof p[0].children == "string" ? p[0].children : "" : p.length ? p : void 0,
1989
- b
1990
- ), T = c.pop();
1991
- T ? (g = T.tag, l = T.props, b = T.key, p = T.children, p.push(A)) : (m.push(A), g = null, l = {}, b = void 0, p = []);
1992
- } else w ? g ? p.push(I(u, k, void 0, void 0)) : m.push(I(u, k, void 0, void 0)) : (g && c.push({
1993
- tag: g,
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: p,
1996
- key: b
1997
- }), g = u, l = k, p = []);
1924
+ children: h,
1925
+ key: x
1926
+ }), p = d, l = C, h = []);
1998
1927
  } else if (typeof f[3] < "u") {
1999
- const u = Number(f[3]), $ = t[u], w = `interp-${u}`;
2000
- d($, w);
1928
+ const d = Number(f[3]), $ = t[d], k = `interp-${d}`;
1929
+ u($, k);
2001
1930
  } else if (f[4]) {
2002
- const u = f[4], $ = g ? p : m, w = u.split(/({{\d+}})/);
2003
- for (const _ of w) {
2004
- if (!_) continue;
2005
- const S = _.match(/^{{(\d+)}}$/);
2006
- if (S) {
2007
- const C = Number(S[1]), k = t[C], B = `interp-${C}`;
2008
- d(k, B);
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 C = `text-${y++}`;
2011
- $.push(s(_, C));
1939
+ const S = `text-${y++}`;
1940
+ $.push(s(w, S));
2012
1941
  }
2013
1942
  }
2014
1943
  }
2015
- const x = m.filter((u) => J(u) && u.tag === "#text" ? typeof u.children == "string" && u.children.trim() !== "" : !0);
2016
- return x.length === 1 ? x[0] : x.length > 1 ? x : I("div", {}, "", "fallback-root");
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 W(e, ...t) {
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 ot(e, t, n);
1949
+ return Ve(e, t, n);
2021
1950
  }
2022
- const me = (e) => e ? typeof URLSearchParams > "u" ? {} : Object.fromEntries(new URLSearchParams(e)) : {}, N = (e, t) => {
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
- }, ne = {};
2034
- async function it(e) {
1962
+ }, Q = {};
1963
+ async function Je(e) {
2035
1964
  if (e.component) return e.component;
2036
1965
  if (e.load) {
2037
- if (ne[e.path]) return ne[e.path];
1966
+ if (Q[e.path]) return Q[e.path];
2038
1967
  try {
2039
1968
  const t = await e.load();
2040
- return ne[e.path] = t.default, t.default;
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 st(e) {
1976
+ function Qe(e) {
2048
1977
  const { routes: t, base: r = "", initialUrl: n } = e;
2049
- let o, s, i, a, c, f, p;
2050
- const g = async (m, h) => {
2051
- const d = t.find((v) => N([v], m.path).route !== null);
2052
- if (d?.beforeEnter)
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 v = await d.beforeEnter(m, h);
2055
- return typeof v == "string" ? (await y(v, !0), !1) : v !== !1;
2056
- } catch (v) {
2057
- return console.error("beforeEnter error", v), !1;
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 (m, h) => {
2061
- const d = t.find((v) => N([v], m.path).route !== null);
2062
- if (d?.onEnter)
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 v = await d.onEnter(m, h);
2065
- return typeof v == "string" ? (await y(v, !0), !1) : v !== !1;
2066
- } catch (v) {
2067
- return console.error("onEnter error", v), !1;
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
- }, b = (m, h) => {
2071
- const d = t.find((v) => N([v], m.path).route !== null);
2072
- if (d?.afterEnter)
1999
+ }, x = (b, g) => {
2000
+ const u = t.find((m) => T([m], b.path).route !== null);
2001
+ if (u?.afterEnter)
2073
2002
  try {
2074
- d.afterEnter(m, h);
2075
- } catch (v) {
2076
- console.error("afterEnter error", v);
2003
+ u.afterEnter(b, g);
2004
+ } catch (m) {
2005
+ console.error("afterEnter error", m);
2077
2006
  }
2078
- }, y = async (m, h = !1) => {
2007
+ }, y = async (b, g = !1) => {
2079
2008
  try {
2080
- const d = {
2081
- path: m.replace(r, "") || "/",
2009
+ const u = {
2010
+ path: b.replace(r, "") || "/",
2082
2011
  query: {}
2083
- }, v = N(t, d.path);
2084
- if (!v) throw new Error(`No route found for ${d.path}`);
2085
- const x = i.getState(), u = {
2086
- path: d.path,
2087
- params: v.params,
2088
- query: d.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 g(u, x) || !await l(u, x)) return;
2091
- typeof window < "u" && typeof document < "u" && (h ? window.history.replaceState({}, "", r + m) : window.history.pushState({}, "", r + m)), i.setState(u), b(u, x);
2092
- } catch (d) {
2093
- console.error("Navigation error:", d);
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 h = new URL(window.location.href), d = h.pathname.replace(r, "") || "/", v = me(h.search);
2099
- return { path: d, query: v };
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 m = N(t, s.path);
2102
- i = ce({
2030
+ const b = T(t, s.path);
2031
+ i = ee({
2103
2032
  path: s.path,
2104
- params: m.params,
2033
+ params: b.params,
2105
2034
  query: s.query
2106
- }), a = async (h = !1) => {
2107
- const d = o();
2108
- await y(d.path, h);
2109
- }, window.addEventListener("popstate", () => a(!0)), c = (h) => y(h, !1), f = (h) => y(h, !0), p = () => window.history.back();
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 h = new URL(n || "/", "http://localhost"), d = h.pathname.replace(r, "") || "/", v = me(h.search);
2113
- return { path: d, query: v };
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 m = N(t, s.path);
2116
- i = ce({
2044
+ const b = T(t, s.path);
2045
+ i = ee({
2117
2046
  path: s.path,
2118
- params: m.params,
2047
+ params: b.params,
2119
2048
  query: s.query
2120
2049
  }), a = async () => {
2121
- }, c = async () => {
2122
- }, f = async () => {
2123
- }, p = () => {
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: p,
2102
+ back: h,
2131
2103
  subscribe: i.subscribe,
2132
- matchRoute: (m) => N(t, m),
2104
+ matchRoute: (b) => T(t, b),
2133
2105
  getCurrent: () => i.getState(),
2134
- resolveRouteComponent: it
2106
+ resolveRouteComponent: Je
2135
2107
  };
2136
2108
  }
2137
- function ht(e, t) {
2138
- return N(e, t);
2109
+ function nt(e, t) {
2110
+ return T(e, t);
2139
2111
  }
2140
- function gt(e) {
2141
- const t = st(e);
2142
- return ye("router-view", {
2112
+ function ot(e) {
2113
+ const t = Qe(e);
2114
+ return ae("router-view", {
2143
2115
  async render() {
2144
- if (!t) return W`<div>Router not initialized.</div>`;
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 W`<div>Not found</div>`;
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: [] } : W`<div>Invalid route component</div>`;
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
- }), ye("router-link", {
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: ve`
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, p = r.disabled, g = r.external, l = n.path === o, b = s ? l : n && typeof n.path == "string" ? n.path.startsWith(o) : !1, y = l ? i : b ? a : "", m = l ? `aria-current="${c}"` : "", h = f === "button", d = p ? h ? 'disabled aria-disabled="true" tabindex="-1"' : 'aria-disabled="true" tabindex="-1"' : "", v = g && (f === "a" || !f) ? 'target="_blank" rel="noopener noreferrer"' : "";
2182
- return W`
2183
- ${$e().when(h, W`
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(W`
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
- const { disabled: o, external: s, tag: i, replace: a, to: c } = n.props;
2207
- if (o) {
2178
+ if (n.disabled) {
2208
2179
  r.preventDefault();
2209
2180
  return;
2210
2181
  }
2211
- s && (i === "a" || !i) || (r.preventDefault(), a ? t.replace(c) : t.push(c));
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
- D as GlobalEventBus,
2217
- ye as component,
2218
- ce as createStore,
2219
- ve as css,
2220
- lt as each,
2221
- ct as emit,
2222
- K as eventBus,
2223
- W as html,
2224
- gt as initRouter,
2225
- pt as listen,
2226
- $e as match,
2227
- N as matchRoute,
2228
- ht as matchRouteSSR,
2229
- ut as off,
2230
- ft as on,
2231
- dt as once,
2232
- me as parseQuery,
2233
- it as resolveRouteComponent,
2234
- st as useRouter,
2235
- at as when
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