@jasonshimmy/custom-elements-runtime 0.1.0 → 0.1.2

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,18 +1,18 @@
1
1
  function Re(e) {
2
2
  let t = new Proxy(e, {
3
- set: (o, l, f) => (o[l] = f, s(), !0)
3
+ set: (i, l, c) => (i[l] = c, s(), !0)
4
4
  });
5
5
  const n = [];
6
- function r(o) {
7
- n.push(o), o(t);
6
+ function r(i) {
7
+ n.push(i), i(t);
8
8
  }
9
- function i() {
9
+ function o() {
10
10
  return t;
11
11
  }
12
12
  function s() {
13
- n.forEach((o) => o(t));
13
+ n.forEach((i) => i(t));
14
14
  }
15
- return { subscribe: r, getState: i };
15
+ return { subscribe: r, getState: o };
16
16
  }
17
17
  class B extends EventTarget {
18
18
  handlers = {};
@@ -31,10 +31,10 @@ class B extends EventTarget {
31
31
  * @param data - Optional event payload
32
32
  */
33
33
  emit(t, n) {
34
- const r = Date.now(), i = this.eventCounters.get(t);
35
- if (!i || r - i.window > 1e3)
34
+ const r = Date.now(), o = this.eventCounters.get(t);
35
+ if (!o || r - o.window > 1e3)
36
36
  this.eventCounters.set(t, { count: 1, window: r });
37
- else if (i.count++, i.count > 50 && (console.error(`Event storm detected for "${t}": ${i.count} events in 1 second. Throttling...`), i.count > 100)) {
37
+ else if (o.count++, o.count > 50 && (console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`), o.count > 100)) {
38
38
  console.warn(`Blocking further "${t}" events to prevent infinite loop`);
39
39
  return;
40
40
  }
@@ -45,9 +45,9 @@ class B extends EventTarget {
45
45
  cancelable: !0
46
46
  }));
47
47
  const s = this.handlers[t];
48
- s && s.forEach((o) => {
48
+ s && s.forEach((i) => {
49
49
  try {
50
- o(n);
50
+ i(n);
51
51
  } catch (l) {
52
52
  console.error(`Error in global event handler for "${t}":`, l);
53
53
  }
@@ -93,8 +93,8 @@ class B extends EventTarget {
93
93
  */
94
94
  once(t, n) {
95
95
  return new Promise((r) => {
96
- const i = this.on(t, (s) => {
97
- i(), n(s), r(s);
96
+ const o = this.on(t, (s) => {
97
+ o(), n(s), r(s);
98
98
  });
99
99
  });
100
100
  }
@@ -140,8 +140,8 @@ class B extends EventTarget {
140
140
  }
141
141
  const Be = B.getInstance();
142
142
  function P(e, t = {}, n, r) {
143
- const i = r ?? t.key;
144
- return { tag: e, key: i, props: t, children: n };
143
+ const o = r ?? t.key;
144
+ return { tag: e, key: o, props: t, children: n };
145
145
  }
146
146
  function I(e) {
147
147
  return !!e && typeof e == "object" && (e.type === "AnchorBlock" || e.tag === "#anchor");
@@ -153,63 +153,63 @@ function le(e, t) {
153
153
  return e.key != null ? e : { ...e, key: t };
154
154
  }
155
155
  function ce(e, t = [], n = {}) {
156
- const r = {}, i = {}, s = {}, o = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
156
+ const r = {}, o = {}, s = {}, i = /([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;
157
157
  let l;
158
- for (; l = o.exec(e); ) {
159
- const f = l[1], u = l[2], p = (l[4] || l[6]) ?? "", d = p.match(/^{{(\d+)}}$/);
160
- let c = d ? t[Number(d[1])] ?? null : p;
161
- if (d || (c === "true" ? c = !0 : c === "false" ? c = !1 : c === "null" ? c = null : isNaN(Number(c)) || (c = Number(c))), f === ":")
162
- typeof c == "boolean" ? i[u] = c : c != null && (r[u] = c);
163
- else if (f === "@") {
164
- const y = "on" + u.charAt(0).toUpperCase() + u.slice(1);
165
- r[y] = typeof c == "function" ? c : typeof n[c] == "function" ? n[c] : void 0;
166
- } else if (f === "#") {
167
- const [y, ...h] = u.split("."), S = [...h];
168
- let m = c, a = [...S];
169
- if (y === "model" && typeof m == "string" && m.includes(".")) {
170
- const b = ["trim", "number", "lazy"], g = m.split(".");
171
- let x = m;
158
+ for (; l = i.exec(e); ) {
159
+ const c = l[1], d = l[2], p = (l[4] || l[6]) ?? "", u = p.match(/^{{(\d+)}}$/);
160
+ let f = u ? t[Number(u[1])] ?? null : p;
161
+ if (u || (f === "true" ? f = !0 : f === "false" ? f = !1 : f === "null" ? f = null : isNaN(Number(f)) || (f = Number(f))), c === ":")
162
+ typeof f == "boolean" ? o[d] = f : f != null && (r[d] = f);
163
+ else if (c === "@") {
164
+ const m = "on" + d.charAt(0).toUpperCase() + d.slice(1);
165
+ r[m] = typeof f == "function" ? f : typeof n[f] == "function" ? n[f] : void 0;
166
+ } else if (c === "#") {
167
+ const [m, ...h] = d.split("."), S = [...h];
168
+ let y = f, a = [...S];
169
+ if (m === "model" && typeof y == "string" && y.includes(".")) {
170
+ const b = ["trim", "number", "lazy"], g = y.split(".");
171
+ let x = y;
172
172
  const w = [];
173
173
  for (let k = g.length - 1; k > 0 && b.includes(g[k]); k--)
174
174
  w.unshift(g[k]), x = g.slice(0, k).join(".");
175
- m = x, a.push(...w);
175
+ y = x, a.push(...w);
176
176
  }
177
- s[y] = {
178
- value: m,
177
+ s[m] = {
178
+ value: y,
179
179
  modifiers: a
180
180
  };
181
- } else u === "ref" ? r.ref = c : i[u] = c;
181
+ } else d === "ref" ? r.ref = f : o[d] = f;
182
182
  }
183
- return { props: r, attrs: i, directives: s };
183
+ return { props: r, attrs: o, directives: s };
184
184
  }
185
185
  function fe(e, t, n) {
186
186
  function r(a, b) {
187
187
  return P("#text", {}, a, b);
188
188
  }
189
- let i = "";
189
+ let o = "";
190
190
  for (let a = 0; a < e.length; a++)
191
- i += e[a], a < t.length && (i += `{{${a}}}`);
192
- const s = /<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g, o = [];
193
- let l = null, f, u = [], p = null, d = {}, c, y = 0, h = [];
191
+ o += e[a], a < t.length && (o += `{{${a}}}`);
192
+ const s = /<\/?([a-zA-Z0-9-]+)([^>]*)\/?>|{{(\d+)}}|([^<]+)/g, i = [];
193
+ let l = null, c, d = [], p = null, u = {}, f, m = 0, h = [];
194
194
  function S(a) {
195
- !a || typeof a != "object" || I(a) || (a.props || a.attrs ? (a.props && (d.props || (d.props = {}), Object.assign(d.props, a.props)), a.attrs && (d.attrs || (d.attrs = {}), Object.keys(a.attrs).forEach((b) => {
196
- if (b === "style" && d.attrs.style) {
197
- const g = d.attrs.style.replace(
195
+ !a || typeof a != "object" || I(a) || (a.props || a.attrs ? (a.props && (u.props || (u.props = {}), Object.assign(u.props, a.props)), a.attrs && (u.attrs || (u.attrs = {}), Object.keys(a.attrs).forEach((b) => {
196
+ if (b === "style" && u.attrs.style) {
197
+ const g = u.attrs.style.replace(
198
198
  /;?\s*$/,
199
199
  ""
200
200
  ), x = a.attrs.style.replace(/^;?\s*/, "");
201
- d.attrs.style = g + "; " + x;
202
- } else if (b === "class" && d.attrs.class) {
203
- const g = d.attrs.class.trim().split(/\s+/).filter(Boolean), x = a.attrs.class.trim().split(/\s+/).filter(Boolean), w = [
201
+ u.attrs.style = g + "; " + x;
202
+ } else if (b === "class" && u.attrs.class) {
203
+ const g = u.attrs.class.trim().split(/\s+/).filter(Boolean), x = a.attrs.class.trim().split(/\s+/).filter(Boolean), w = [
204
204
  .../* @__PURE__ */ new Set([...g, ...x])
205
205
  ];
206
- d.attrs.class = w.join(" ");
206
+ u.attrs.class = w.join(" ");
207
207
  } else
208
- d.attrs[b] = a.attrs[b];
209
- }))) : (d.props || (d.props = {}), Object.assign(d.props, a)));
208
+ u.attrs[b] = a.attrs[b];
209
+ }))) : (u.props || (u.props = {}), Object.assign(u.props, a)));
210
210
  }
211
- function m(a, b) {
212
- const g = p ? u : h;
211
+ function y(a, b) {
212
+ const g = p ? d : h;
213
213
  if (I(a)) {
214
214
  const x = a.key ?? b;
215
215
  let w = a.children;
@@ -228,7 +228,7 @@ function fe(e, t, n) {
228
228
  if (a.length === 0) return;
229
229
  for (let x = 0; x < a.length; x++) {
230
230
  const w = a[x];
231
- I(w) || R(w) || Array.isArray(w) ? m(w, `${b}-${x}`) : w !== null && typeof w == "object" ? S(w) : g.push(r(String(w), `${b}-${x}`));
231
+ I(w) || R(w) || Array.isArray(w) ? y(w, `${b}-${x}`) : w !== null && typeof w == "object" ? S(w) : g.push(r(String(w), `${b}-${x}`));
232
232
  }
233
233
  return;
234
234
  }
@@ -238,13 +238,13 @@ function fe(e, t, n) {
238
238
  }
239
239
  g.push(r(String(a), b));
240
240
  }
241
- for (; f = s.exec(i); )
242
- if (f[1]) {
243
- const a = f[1], b = f[0][1] === "/", g = f[0][f[0].length - 2] === "/", {
241
+ for (; c = s.exec(o); )
242
+ if (c[1]) {
243
+ const a = c[1], b = c[0][1] === "/", g = c[0][c[0].length - 2] === "/", {
244
244
  props: x,
245
245
  attrs: w,
246
246
  directives: k
247
- } = ce(f[2] || "", t, n), $ = { props: {}, attrs: {} };
247
+ } = ce(c[2] || "", t, n), $ = { props: {}, attrs: {} };
248
248
  for (const v in x) $.props[v] = x[v];
249
249
  for (const v in w) $.attrs[v] = w[v];
250
250
  for (const [v, _] of Object.entries(k))
@@ -271,20 +271,20 @@ function fe(e, t, n) {
271
271
  } else if (A && typeof A == "object")
272
272
  for (const [j, L] of Object.entries(A))
273
273
  L && E.push(...j.split(/\s+/).filter(Boolean));
274
- const M = $.attrs.class || "", O = [
274
+ const O = $.attrs.class || "", M = [
275
275
  .../* @__PURE__ */ new Set([
276
- ...M.split(/\s+/).filter(Boolean),
276
+ ...O.split(/\s+/).filter(Boolean),
277
277
  ...E
278
278
  ])
279
279
  ];
280
- $.attrs.class = O.join(" ");
280
+ $.attrs.class = M.join(" ");
281
281
  } else if (v === "style") {
282
282
  const A = _.value;
283
283
  let E = "";
284
284
  if (typeof A == "string")
285
285
  E = A;
286
286
  else if (A && typeof A == "object") {
287
- const O = [];
287
+ const M = [];
288
288
  for (const [j, L] of Object.entries(A))
289
289
  if (L != null && L !== "") {
290
290
  const N = j.replace(
@@ -317,12 +317,12 @@ function fe(e, t, n) {
317
317
  "max-height"
318
318
  ];
319
319
  let X = String(L);
320
- typeof L == "number" && se.includes(N) && (X = `${L}px`), O.push(`${N}: ${X}`);
320
+ typeof L == "number" && se.includes(N) && (X = `${L}px`), M.push(`${N}: ${X}`);
321
321
  }
322
- E = O.join("; ") + (O.length > 0 ? ";" : "");
322
+ E = M.join("; ") + (M.length > 0 ? ";" : "");
323
323
  }
324
- const M = $.attrs.style || "";
325
- $.attrs.style = M + (M && !M.endsWith(";") ? "; " : "") + E;
324
+ const O = $.attrs.style || "";
325
+ $.attrs.style = O + (O && !O.endsWith(";") ? "; " : "") + E;
326
326
  }
327
327
  const C = {};
328
328
  for (const [v, _] of Object.entries(k))
@@ -330,30 +330,30 @@ function fe(e, t, n) {
330
330
  if (Object.keys(C).length > 0 && ($.directives = C), b) {
331
331
  const v = P(
332
332
  p,
333
- d,
334
- u.length === 1 && R(u[0]) && u[0].tag === "#text" ? typeof u[0].children == "string" ? u[0].children : "" : u.length ? u : void 0,
335
- c
336
- ), _ = o.pop();
337
- _ ? (p = _.tag, d = _.props, c = _.key, u = _.children, u.push(v)) : l = v;
338
- } else g ? (p ? u : h).push(P(a, $, void 0, void 0)) : (p && o.push({
333
+ u,
334
+ d.length === 1 && R(d[0]) && d[0].tag === "#text" ? typeof d[0].children == "string" ? d[0].children : "" : d.length ? d : void 0,
335
+ f
336
+ ), _ = i.pop();
337
+ _ ? (p = _.tag, u = _.props, f = _.key, d = _.children, d.push(v)) : l = v;
338
+ } else g ? (p ? d : h).push(P(a, $, void 0, void 0)) : (p && i.push({
339
339
  tag: p,
340
- props: d,
341
- children: u,
342
- key: c
343
- }), p = a, d = $, u = []);
344
- } else if (typeof f[3] < "u") {
345
- const a = Number(f[3]), b = t[a], g = `interp-${a}`;
346
- m(b, g);
347
- } else if (f[4]) {
348
- const a = f[4], b = p ? u : h, g = a.split(/({{\d+}})/);
340
+ props: u,
341
+ children: d,
342
+ key: f
343
+ }), p = a, u = $, d = []);
344
+ } else if (typeof c[3] < "u") {
345
+ const a = Number(c[3]), b = t[a], g = `interp-${a}`;
346
+ y(b, g);
347
+ } else if (c[4]) {
348
+ const a = c[4], b = p ? d : h, g = a.split(/({{\d+}})/);
349
349
  for (const x of g) {
350
350
  if (!x) continue;
351
351
  const w = x.match(/^{{(\d+)}}$/);
352
352
  if (w) {
353
353
  const k = Number(w[1]), $ = t[k], C = `interp-${k}`;
354
- m($, C);
354
+ y($, C);
355
355
  } else {
356
- const k = `text-${y++}`;
356
+ const k = `text-${m++}`;
357
357
  b.push(r(x, k));
358
358
  }
359
359
  }
@@ -371,17 +371,17 @@ function fe(e, t, n) {
371
371
  }
372
372
  return P("div", {}, "", "fallback-root");
373
373
  }
374
- function Me(e, ...t) {
374
+ function Oe(e, ...t) {
375
375
  const n = t[t.length - 1], r = typeof n == "object" && n && !Array.isArray(n) ? n : void 0;
376
376
  return fe(e, t, r);
377
377
  }
378
- function Oe(e, t) {
378
+ function Me(e, t) {
379
379
  return K(e ? t : [], "when-block");
380
380
  }
381
381
  function Ne(e, t) {
382
382
  return e.map((n, r) => {
383
- const i = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
384
- return K(t(n, r), `each-${i}`);
383
+ const o = typeof n == "object" ? n?.key ?? n?.id ?? `idx-${r}` : String(n);
384
+ return K(t(n, r), `each-${o}`);
385
385
  });
386
386
  }
387
387
  function Pe() {
@@ -394,11 +394,11 @@ function Pe() {
394
394
  return e.push([!0, t]), this;
395
395
  },
396
396
  done() {
397
- return de(...e);
397
+ return ue(...e);
398
398
  }
399
399
  };
400
400
  }
401
- function de(...e) {
401
+ function ue(...e) {
402
402
  for (let t = 0; t < e.length; t++) {
403
403
  const [n, r] = e[t];
404
404
  if (n) return [K(r, `whenChain-branch-${t}`)];
@@ -417,54 +417,54 @@ function z(e, t) {
417
417
  return t.split(".").reduce((n, r) => n?.[r], e);
418
418
  }
419
419
  function Y(e, t, n) {
420
- const r = t.split("."), i = r.pop();
421
- if (!i) return;
422
- const s = r.reduce((o, l) => (l in o || (o[l] = {}), o[l]), e);
423
- s[i] = n;
420
+ const r = t.split("."), o = r.pop();
421
+ if (!o) return;
422
+ const s = r.reduce((i, l) => (l in i || (i[l] = {}), i[l]), e);
423
+ s[o] = n;
424
424
  }
425
- function ue(e, t, n, r, i, s, o) {
425
+ function de(e, t, n, r, o, s, i) {
426
426
  if (!s) return;
427
- const l = t.includes("lazy"), f = t.includes("trim"), u = t.includes("number"), p = () => {
428
- const m = s._state || s;
429
- return z(m, e);
430
- }, d = p();
431
- let c = "text";
432
- const y = r?.type;
433
- if (o instanceof HTMLInputElement ? c = y || o.type || "text" : o instanceof HTMLSelectElement ? c = "select" : o instanceof HTMLTextAreaElement && (c = "textarea"), c === "checkbox")
434
- if (Array.isArray(d)) {
435
- const m = o?.getAttribute("value") || r?.value || "", a = d.includes(m);
436
- o && o.checked !== a && (n.checked = a);
427
+ const l = t.includes("lazy"), c = t.includes("trim"), d = t.includes("number"), p = () => {
428
+ const y = s._state || s;
429
+ return z(y, e);
430
+ }, u = p();
431
+ let f = "text";
432
+ const m = r?.type;
433
+ if (i instanceof HTMLInputElement ? f = m || i.type || "text" : i instanceof HTMLSelectElement ? f = "select" : i instanceof HTMLTextAreaElement && (f = "textarea"), f === "checkbox")
434
+ if (Array.isArray(u)) {
435
+ const y = i?.getAttribute("value") || r?.value || "", a = u.includes(y);
436
+ i && i.checked !== a && (n.checked = a);
437
437
  } else {
438
- const m = o?.getAttribute("true-value") || !0, a = d === m;
439
- o && o.checked !== a && (n.checked = a);
438
+ const y = i?.getAttribute("true-value") || !0, a = u === y;
439
+ i && i.checked !== a && (n.checked = a);
440
440
  }
441
- else if (c === "radio") {
442
- const m = r?.value || "", a = d === m;
443
- o && o.checked !== a && (n.checked = a);
444
- } else if (c === "select")
445
- if (o && o.hasAttribute("multiple")) {
446
- const m = o, a = Array.isArray(d) ? d : [];
441
+ else if (f === "radio") {
442
+ const y = r?.value || "", a = u === y;
443
+ i && i.checked !== a && (n.checked = a);
444
+ } else if (f === "select")
445
+ if (i && i.hasAttribute("multiple")) {
446
+ const y = i, a = Array.isArray(u) ? u : [];
447
447
  setTimeout(() => {
448
- Array.from(m.options).forEach((b) => {
448
+ Array.from(y.options).forEach((b) => {
449
449
  const g = a.includes(b.value);
450
450
  b.selected !== g && (b.selected = g);
451
451
  });
452
452
  }, 0);
453
453
  } else
454
454
  setTimeout(() => {
455
- o instanceof HTMLSelectElement && o.value !== String(d) && (o.value = String(d));
455
+ i instanceof HTMLSelectElement && i.value !== String(u) && (i.value = String(u));
456
456
  }, 0);
457
457
  else {
458
- const m = String(d ?? "");
459
- (!o || o.value !== m) && (n.value = d);
458
+ const y = String(u ?? "");
459
+ (!i || i.value !== y) && (n.value = u);
460
460
  }
461
- const h = l || c === "checkbox" || c === "radio" || c === "select" ? "change" : "input", S = (m) => {
462
- if (m.isComposing || i._isComposing || m.isTrusted === !1) return;
463
- const a = m.target;
461
+ const h = l || f === "checkbox" || f === "radio" || f === "select" ? "change" : "input", S = (y) => {
462
+ if (y.isComposing || o._isComposing || y.isTrusted === !1) return;
463
+ const a = y.target;
464
464
  if (a._modelUpdating) return;
465
465
  const b = p();
466
466
  let g = a.value;
467
- if (c === "checkbox")
467
+ if (f === "checkbox")
468
468
  if (Array.isArray(b)) {
469
469
  const $ = a.getAttribute("value") || "", C = [...b];
470
470
  if (a.checked)
@@ -478,35 +478,35 @@ function ue(e, t, n, r, i, s, o) {
478
478
  const $ = a.getAttribute("true-value") || !0, C = a.getAttribute("false-value") || !1;
479
479
  g = a.checked ? $ : C;
480
480
  }
481
- else if (c === "radio")
481
+ else if (f === "radio")
482
482
  g = a.getAttribute("value") || a.value;
483
- else if (c === "select" && a.multiple) {
483
+ else if (f === "select" && a.multiple) {
484
484
  const $ = a;
485
485
  g = Array.from($.selectedOptions).map(
486
486
  (C) => C.value
487
487
  );
488
- } else if (f && (g = g.trim()), u) {
488
+ } else if (c && (g = g.trim()), d) {
489
489
  const $ = Number(g);
490
490
  isNaN($) || (g = $);
491
491
  }
492
492
  const x = s._state || s, w = z(x, e);
493
493
  if (Array.isArray(g) && Array.isArray(w) ? JSON.stringify([...g].sort()) !== JSON.stringify([...w].sort()) : g !== w) {
494
- const $ = m.target;
494
+ const $ = y.target;
495
495
  $._modelUpdating = !0, Y(x, e, g), setTimeout(() => {
496
496
  $._modelUpdating = !1;
497
497
  }, 0), s._requestRender && s._requestRender();
498
498
  }
499
499
  };
500
- if (i[h] = S, c === "text" || c === "textarea") {
501
- const m = () => {
502
- i._isComposing = !0;
500
+ if (o[h] = S, f === "text" || f === "textarea") {
501
+ const y = () => {
502
+ o._isComposing = !0;
503
503
  }, a = (b) => {
504
- i._isComposing = !1;
504
+ o._isComposing = !1;
505
505
  const g = b.target;
506
506
  setTimeout(() => {
507
507
  if (g) {
508
508
  let x = g.value;
509
- if (f && (x = x.trim()), u) {
509
+ if (c && (x = x.trim()), d) {
510
510
  const C = Number(x);
511
511
  isNaN(C) || (x = C);
512
512
  }
@@ -517,57 +517,57 @@ function ue(e, t, n, r, i, s, o) {
517
517
  }
518
518
  }, 0);
519
519
  };
520
- i.compositionstart = m, i.compositionend = a;
520
+ o.compositionstart = y, o.compositionend = a;
521
521
  }
522
522
  }
523
523
  function pe(e, t, n, r) {
524
524
  if (r)
525
525
  try {
526
- const i = JSON.parse(e);
527
- if (typeof i == "object")
528
- for (const [s, o] of Object.entries(i))
529
- t[s] = o;
526
+ const o = JSON.parse(e);
527
+ if (typeof o == "object")
528
+ for (const [s, i] of Object.entries(o))
529
+ t[s] = i;
530
530
  } catch {
531
- const i = z(r, e);
532
- n[e] = i;
531
+ const o = z(r, e);
532
+ n[e] = o;
533
533
  }
534
534
  }
535
535
  function he(e, t, n) {
536
536
  if (!n) return;
537
- const r = z(n, e), i = t.style || "", s = r ? "" : "none";
538
- if (i) {
539
- const o = i.split(";").filter(Boolean), l = o.findIndex(
540
- (f) => f.trim().startsWith("display:")
537
+ const r = z(n, e), o = t.style || "", s = r ? "" : "none";
538
+ if (o) {
539
+ const i = o.split(";").filter(Boolean), l = i.findIndex(
540
+ (c) => c.trim().startsWith("display:")
541
541
  );
542
- l >= 0 ? o[l] = `display: ${s}` : o.push(`display: ${s}`), t.style = o.join("; ");
542
+ l >= 0 ? i[l] = `display: ${s}` : i.push(`display: ${s}`), t.style = i.join("; ");
543
543
  } else
544
544
  t.style = `display: ${s}`;
545
545
  }
546
546
  function ge(e, t, n) {
547
547
  if (!n) return;
548
548
  const r = z(n, e);
549
- let i = [];
550
- typeof r == "string" ? i = [r] : Array.isArray(r) ? i = r.filter(Boolean) : typeof r == "object" && (i = Object.entries(r).filter(([, l]) => !!l).map(([l]) => l));
551
- const s = t.class || "", o = s ? `${s} ${i.join(" ")}`.trim() : i.join(" ");
552
- o && (t.class = o);
549
+ let o = [];
550
+ typeof r == "string" ? o = [r] : Array.isArray(r) ? o = r.filter(Boolean) : typeof r == "object" && (o = Object.entries(r).filter(([, l]) => !!l).map(([l]) => l));
551
+ const s = t.class || "", i = s ? `${s} ${o.join(" ")}`.trim() : o.join(" ");
552
+ i && (t.class = i);
553
553
  }
554
- function ye(e, t, n) {
554
+ function me(e, t, n) {
555
555
  let r;
556
556
  if (typeof e == "string") {
557
557
  if (!n) return;
558
558
  r = z(n, e);
559
559
  } else
560
560
  r = e;
561
- let i = "";
561
+ let o = "";
562
562
  if (typeof r == "string")
563
- i = r;
563
+ o = r;
564
564
  else if (r && typeof r == "object") {
565
- const o = [];
566
- for (const [l, f] of Object.entries(r))
567
- if (f != null && f !== "") {
568
- const u = l.replace(
565
+ const i = [];
566
+ for (const [l, c] of Object.entries(r))
567
+ if (c != null && c !== "") {
568
+ const d = l.replace(
569
569
  /[A-Z]/g,
570
- (c) => `-${c.toLowerCase()}`
570
+ (f) => `-${f.toLowerCase()}`
571
571
  ), p = [
572
572
  "width",
573
573
  "height",
@@ -594,75 +594,75 @@ function ye(e, t, n) {
594
594
  "min-height",
595
595
  "max-height"
596
596
  ];
597
- let d = String(f);
598
- typeof f == "number" && p.includes(u) && (d = `${f}px`), o.push(`${u}: ${d}`);
597
+ let u = String(c);
598
+ typeof c == "number" && p.includes(d) && (u = `${c}px`), i.push(`${d}: ${u}`);
599
599
  }
600
- i = o.join("; ") + (o.length > 0 ? ";" : "");
600
+ o = i.join("; ") + (i.length > 0 ? ";" : "");
601
601
  }
602
602
  const s = t.style || "";
603
- t.style = s + (s && !s.endsWith(";") ? "; " : "") + i;
603
+ t.style = s + (s && !s.endsWith(";") ? "; " : "") + o;
604
604
  }
605
605
  function ie(e, t, n, r) {
606
- const i = {}, s = { ...r || {} }, o = {};
607
- for (const [l, f] of Object.entries(e)) {
608
- const { value: u, modifiers: p } = f;
606
+ const o = {}, s = { ...r || {} }, i = {};
607
+ for (const [l, c] of Object.entries(e)) {
608
+ const { value: d, modifiers: p } = c;
609
609
  switch (l) {
610
610
  case "model":
611
- ue(
612
- typeof u == "string" ? u : String(u),
611
+ de(
612
+ typeof d == "string" ? d : String(d),
613
613
  p,
614
- i,
615
- s,
616
614
  o,
615
+ s,
616
+ i,
617
617
  t,
618
618
  n
619
619
  );
620
620
  break;
621
621
  case "bind":
622
- pe(u, i, s, t);
622
+ pe(d, o, s, t);
623
623
  break;
624
624
  case "show":
625
- he(u, s, t);
625
+ he(d, s, t);
626
626
  break;
627
627
  case "class":
628
- ge(u, s, t);
628
+ ge(d, s, t);
629
629
  break;
630
630
  case "style":
631
- ye(u, s, t);
631
+ me(d, s, t);
632
632
  break;
633
633
  }
634
634
  }
635
- return { props: i, attrs: s, listeners: o };
635
+ return { props: o, attrs: s, listeners: i };
636
636
  }
637
637
  function Z(e, t) {
638
638
  if (Array.isArray(e)) {
639
639
  const s = /* @__PURE__ */ new Set();
640
- return e.map((o) => {
641
- if (!o || typeof o != "object") return o;
642
- let l = o.props?.key ?? o.key;
640
+ return e.map((i) => {
641
+ if (!i || typeof i != "object") return i;
642
+ let l = i.props?.key ?? i.key;
643
643
  if (!l) {
644
- const d = o.tag || "node", c = o.props?.attrs?.id ?? o.props?.attrs?.name ?? o.props?.attrs?.["data-key"] ?? "";
645
- l = c ? `${t}:${d}:${c}` : `${t}:${d}`;
644
+ const u = i.tag || "node", f = i.props?.attrs?.id ?? i.props?.attrs?.name ?? i.props?.attrs?.["data-key"] ?? "";
645
+ l = f ? `${t}:${u}:${f}` : `${t}:${u}`;
646
646
  }
647
- let f = l, u = 1;
648
- for (; s.has(f); )
649
- f = `${l}#${u++}`;
650
- s.add(f);
651
- let p = o.children;
652
- return Array.isArray(p) && (p = Z(p, f)), { ...o, key: f, children: p };
647
+ let c = l, d = 1;
648
+ for (; s.has(c); )
649
+ c = `${l}#${d++}`;
650
+ s.add(c);
651
+ let p = i.children;
652
+ return Array.isArray(p) && (p = Z(p, c)), { ...i, key: c, children: p };
653
653
  });
654
654
  }
655
655
  const n = e;
656
- let r = n.props?.key ?? n.key ?? t, i = n.children;
657
- return Array.isArray(i) && (i = Z(i, r)), { ...n, key: r, children: i };
656
+ let r = n.props?.key ?? n.key ?? t, o = n.children;
657
+ return Array.isArray(o) && (o = Z(o, r)), { ...n, key: r, children: o };
658
658
  }
659
- function me(e, t, n, r) {
660
- const i = n.directives ?? {}, s = ie(
661
- i,
659
+ function ye(e, t, n, r) {
660
+ const o = n.directives ?? {}, s = ie(
661
+ o,
662
662
  r,
663
663
  e,
664
664
  n.attrs
665
- ), o = {
665
+ ), i = {
666
666
  ...t.props,
667
667
  ...n.props,
668
668
  ...s.props
@@ -670,105 +670,105 @@ function me(e, t, n, r) {
670
670
  ...t.attrs,
671
671
  ...n.attrs,
672
672
  ...s.attrs
673
- }, f = t.props ?? {}, u = o;
674
- for (const c in { ...f, ...u }) {
675
- const y = f[c], h = u[c];
676
- y !== h && (c === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== h && (e.value = h ?? "") : c === "checked" && e instanceof HTMLInputElement ? e.checked = !!h : c.startsWith("on") && typeof h == "function" ? (typeof y == "function" && e.removeEventListener(c.slice(2).toLowerCase(), y), e.addEventListener(c.slice(2).toLowerCase(), h)) : h == null || h === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(h)));
673
+ }, c = t.props ?? {}, d = i;
674
+ for (const f in { ...c, ...d }) {
675
+ const m = c[f], h = d[f];
676
+ m !== h && (f === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? e.value !== h && (e.value = h ?? "") : f === "checked" && e instanceof HTMLInputElement ? e.checked = !!h : f.startsWith("on") && typeof h == "function" ? (typeof m == "function" && e.removeEventListener(f.slice(2).toLowerCase(), m), e.addEventListener(f.slice(2).toLowerCase(), h)) : h == null || h === !1 ? e.removeAttribute(f) : e.setAttribute(f, String(h)));
677
677
  }
678
- for (const [c, y] of Object.entries(
678
+ for (const [f, m] of Object.entries(
679
679
  s.listeners || {}
680
680
  ))
681
- e.addEventListener(c, y);
682
- const p = t.attrs ?? {}, d = l;
683
- for (const c in { ...p, ...d }) {
684
- const y = p[c], h = d[c];
685
- y !== h && (h == null || h === !1 ? e.removeAttribute(c) : e.setAttribute(c, String(h)));
681
+ e.addEventListener(f, m);
682
+ const p = t.attrs ?? {}, u = l;
683
+ for (const f in { ...p, ...u }) {
684
+ const m = p[f], h = u[f];
685
+ m !== h && (h == null || h === !1 ? e.removeAttribute(f) : e.setAttribute(f, String(h)));
686
686
  }
687
687
  }
688
688
  function T(e, t, n) {
689
689
  if (typeof e == "string")
690
690
  return document.createTextNode(e);
691
691
  if (e.tag === "#text") {
692
- const d = document.createTextNode(
692
+ const u = document.createTextNode(
693
693
  typeof e.children == "string" ? e.children : ""
694
694
  );
695
- return e.key != null && (d.key = e.key), d;
695
+ return e.key != null && (u.key = e.key), u;
696
696
  }
697
697
  if (e.tag === "#anchor") {
698
- const d = e, c = Array.isArray(d.children) ? d.children : [], y = document.createTextNode(""), h = document.createTextNode("");
699
- d.key != null && (y.key = `${d.key}:start`, h.key = `${d.key}:end`), d._startNode = y, d._endNode = h;
698
+ const u = e, f = Array.isArray(u.children) ? u.children : [], m = document.createTextNode(""), h = document.createTextNode("");
699
+ u.key != null && (m.key = `${u.key}:start`, h.key = `${u.key}:end`), u._startNode = m, u._endNode = h;
700
700
  const S = document.createDocumentFragment();
701
- S.appendChild(y);
702
- for (const m of c)
703
- S.appendChild(T(m, t));
701
+ S.appendChild(m);
702
+ for (const y of f)
703
+ S.appendChild(T(y, t));
704
704
  return S.appendChild(h), S;
705
705
  }
706
706
  const r = document.createElement(e.tag);
707
707
  e.key != null && (r.key = e.key);
708
- const { props: i = {}, attrs: s = {}, directives: o = {} } = e.props ?? {}, l = ie(o, t, r, s), f = {
709
- ...i,
708
+ const { props: o = {}, attrs: s = {}, directives: i = {} } = e.props ?? {}, l = ie(i, t, r, s), c = {
709
+ ...o,
710
710
  ...l.props
711
- }, u = {
711
+ }, d = {
712
712
  ...s,
713
713
  ...l.attrs
714
714
  };
715
- for (const d in u) {
716
- const c = u[d];
717
- typeof c == "boolean" ? c && r.setAttribute(d, "") : c != null && r.setAttribute(d, String(c));
718
- }
719
- for (const d in f) {
720
- const c = f[d];
721
- if (d === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement))
722
- r.value = c ?? "";
723
- else if (d === "checked" && r instanceof HTMLInputElement)
724
- r.checked = !!c;
725
- else if (d.startsWith("on") && typeof c == "function")
726
- r.addEventListener(d.slice(2).toLowerCase(), c);
715
+ for (const u in d) {
716
+ const f = d[u];
717
+ typeof f == "boolean" ? f && r.setAttribute(u, "") : f != null && r.setAttribute(u, String(f));
718
+ }
719
+ for (const u in c) {
720
+ const f = c[u];
721
+ if (u === "value" && (r instanceof HTMLInputElement || r instanceof HTMLTextAreaElement || r instanceof HTMLSelectElement))
722
+ r.value = f ?? "";
723
+ else if (u === "checked" && r instanceof HTMLInputElement)
724
+ r.checked = !!f;
725
+ else if (u.startsWith("on") && typeof f == "function")
726
+ r.addEventListener(u.slice(2).toLowerCase(), f);
727
727
  else {
728
- if (d.startsWith("on") && c === void 0)
728
+ if (u.startsWith("on") && f === void 0)
729
729
  continue;
730
- c == null || c === !1 ? r.removeAttribute(d) : r.setAttribute(d, String(c));
730
+ f == null || f === !1 ? r.removeAttribute(u) : r.setAttribute(u, String(f));
731
731
  }
732
732
  }
733
- for (const [d, c] of Object.entries(
733
+ for (const [u, f] of Object.entries(
734
734
  l.listeners || {}
735
735
  ))
736
- r.addEventListener(d, c);
736
+ r.addEventListener(u, f);
737
737
  const p = e.props?.ref ?? (e.props?.props && e.props.props.ref);
738
738
  if (typeof e != "string" && p && n && (n[p] = r), Array.isArray(e.children))
739
- for (const d of e.children)
740
- r.appendChild(T(d, t, n));
739
+ for (const u of e.children)
740
+ r.appendChild(T(u, t, n));
741
741
  else typeof e.children == "string" && (r.textContent = e.children);
742
742
  return r;
743
743
  }
744
- function be(e, t, n, r, i) {
744
+ function be(e, t, n, r, o) {
745
745
  if (typeof n == "string") {
746
746
  e.textContent !== n && (e.textContent = n);
747
747
  return;
748
748
  }
749
749
  if (!Array.isArray(n)) return;
750
- const s = Array.from(e.childNodes), o = Array.isArray(t) ? t : [], l = /* @__PURE__ */ new Map();
751
- for (const y of o)
752
- y && y.key != null && l.set(y.key, y);
753
- const f = /* @__PURE__ */ new Map();
754
- for (const y of s) {
755
- const h = y.key;
756
- h != null && f.set(h, y);
757
- }
758
- const u = /* @__PURE__ */ new Set();
750
+ const s = Array.from(e.childNodes), i = Array.isArray(t) ? t : [], l = /* @__PURE__ */ new Map();
751
+ for (const m of i)
752
+ m && m.key != null && l.set(m.key, m);
753
+ const c = /* @__PURE__ */ new Map();
754
+ for (const m of s) {
755
+ const h = m.key;
756
+ h != null && c.set(h, m);
757
+ }
758
+ const d = /* @__PURE__ */ new Set();
759
759
  let p = e.firstChild;
760
- function d(y, h) {
761
- let S = y;
762
- for (; S && (u.add(S), S !== h); )
760
+ function u(m, h) {
761
+ let S = m;
762
+ for (; S && (d.add(S), S !== h); )
763
763
  S = S.nextSibling;
764
764
  }
765
- function c(y, h, S, m) {
765
+ function f(m, h, S, y) {
766
766
  const a = [];
767
- let b = y.nextSibling;
767
+ let b = m.nextSibling;
768
768
  for (; b && b !== h; )
769
769
  a.push(b), b = b.nextSibling;
770
770
  const g = Array.isArray(S) ? S : [];
771
- if (m.some((w) => w && w.key != null) || g.some((w) => w && w.key != null)) {
771
+ if (y.some((w) => w && w.key != null) || g.some((w) => w && w.key != null)) {
772
772
  const w = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map();
773
773
  for (const v of g)
774
774
  v && v.key != null && w.set(v.key, v);
@@ -777,8 +777,8 @@ function be(e, t, n, r, i) {
777
777
  _ != null && k.set(_, v);
778
778
  }
779
779
  const $ = /* @__PURE__ */ new Set();
780
- let C = y.nextSibling;
781
- for (const v of m) {
780
+ let C = m.nextSibling;
781
+ for (const v of y) {
782
782
  let _;
783
783
  if (v.key != null && k.has(v.key)) {
784
784
  const A = w.get(v.key);
@@ -797,121 +797,121 @@ function be(e, t, n, r, i) {
797
797
  } else {
798
798
  const w = Math.min(
799
799
  g.length,
800
- m.length
800
+ y.length
801
801
  );
802
802
  for (let k = 0; k < w; k++) {
803
- const $ = g[k], C = m[k], v = D(a[k], $, C, r);
803
+ const $ = g[k], C = y[k], v = D(a[k], $, C, r);
804
804
  v !== a[k] && (e.insertBefore(v, a[k]), e.removeChild(a[k]));
805
805
  }
806
- for (let k = w; k < m.length; k++)
807
- e.insertBefore(T(m[k], r), h);
806
+ for (let k = w; k < y.length; k++)
807
+ e.insertBefore(T(y[k], r), h);
808
808
  for (let k = w; k < a.length; k++)
809
809
  e.removeChild(a[k]);
810
810
  }
811
811
  }
812
- for (const y of n) {
812
+ for (const m of n) {
813
813
  let h;
814
- if (y.tag === "#anchor") {
815
- const S = y.key, m = `${S}:start`, a = `${S}:end`;
816
- let b = f.get(m), g = f.get(a);
817
- const x = Array.isArray(y.children) ? y.children : [];
818
- if (b || (b = document.createTextNode(""), b.key = m), g || (g = document.createTextNode(""), g.key = a), y._startNode = b, y._endNode = g, !e.contains(b) || !e.contains(g)) {
814
+ if (m.tag === "#anchor") {
815
+ const S = m.key, y = `${S}:start`, a = `${S}:end`;
816
+ let b = c.get(y), g = c.get(a);
817
+ const x = Array.isArray(m.children) ? m.children : [];
818
+ if (b || (b = document.createTextNode(""), b.key = y), g || (g = document.createTextNode(""), g.key = a), m._startNode = b, m._endNode = g, !e.contains(b) || !e.contains(g)) {
819
819
  e.insertBefore(b, p);
820
820
  for (const w of x)
821
821
  e.insertBefore(T(w, r), p);
822
822
  e.insertBefore(g, p);
823
823
  } else
824
- c(
824
+ f(
825
825
  b,
826
826
  g,
827
827
  l.get(S)?.children,
828
828
  x
829
829
  );
830
- d(b, g), p = g.nextSibling;
830
+ u(b, g), p = g.nextSibling;
831
831
  continue;
832
832
  }
833
- if (y.key != null && f.has(y.key)) {
834
- const S = l.get(y.key);
833
+ if (m.key != null && c.has(m.key)) {
834
+ const S = l.get(m.key);
835
835
  h = D(
836
- f.get(y.key),
836
+ c.get(m.key),
837
837
  S,
838
- y,
838
+ m,
839
839
  r,
840
- i
841
- ), u.add(h), h !== p && e.contains(h) && (p && !e.contains(p) && (p = null), e.insertBefore(h, p));
840
+ o
841
+ ), d.add(h), h !== p && e.contains(h) && (p && !e.contains(p) && (p = null), e.insertBefore(h, p));
842
842
  } else
843
- h = T(y, r, i), p && !e.contains(p) && (p = null), e.insertBefore(h, p), u.add(h);
843
+ h = T(m, r, o), p && !e.contains(p) && (p = null), e.insertBefore(h, p), d.add(h);
844
844
  p = h.nextSibling;
845
845
  }
846
- for (const y of s)
847
- if (!u.has(y) && e.contains(y)) {
848
- if (y instanceof HTMLElement && i)
849
- for (const h in i)
850
- i[h] === y && delete i[h];
851
- e.removeChild(y);
846
+ for (const m of s)
847
+ if (!d.has(m) && e.contains(m)) {
848
+ if (m instanceof HTMLElement && o)
849
+ for (const h in o)
850
+ o[h] === m && delete o[h];
851
+ e.removeChild(m);
852
852
  }
853
853
  }
854
- function D(e, t, n, r, i) {
855
- if (t && typeof t != "string" && t.props?.ref && i && delete i[t.props.ref], t === n) return e;
854
+ function D(e, t, n, r, o) {
855
+ if (t && typeof t != "string" && t.props?.ref && o && delete o[t.props.ref], t === n) return e;
856
856
  if (typeof n == "string") {
857
857
  if (e.nodeType === Node.TEXT_NODE)
858
858
  return e.textContent !== n && (e.textContent = n), e;
859
859
  {
860
- const o = document.createTextNode(n);
861
- return e.parentNode?.replaceChild(o, e), o;
860
+ const i = document.createTextNode(n);
861
+ return e.parentNode?.replaceChild(i, e), i;
862
862
  }
863
863
  }
864
864
  if (n && typeof n != "string" && n.tag === "#anchor") {
865
- const o = n, l = Array.isArray(o.children) ? o.children : [], f = o._startNode ?? document.createTextNode(""), u = o._endNode ?? document.createTextNode("");
866
- o.key != null && (f.key = `${o.key}:start`, u.key = `${o.key}:end`), o._startNode = f, o._endNode = u;
865
+ const i = n, l = Array.isArray(i.children) ? i.children : [], c = i._startNode ?? document.createTextNode(""), d = i._endNode ?? document.createTextNode("");
866
+ i.key != null && (c.key = `${i.key}:start`, d.key = `${i.key}:end`), i._startNode = c, i._endNode = d;
867
867
  const p = document.createDocumentFragment();
868
- p.appendChild(f);
869
- for (const d of l)
870
- p.appendChild(T(d, r));
871
- return p.appendChild(u), e.parentNode?.replaceChild(p, e), f;
868
+ p.appendChild(c);
869
+ for (const u of l)
870
+ p.appendChild(T(u, r));
871
+ return p.appendChild(d), e.parentNode?.replaceChild(p, e), c;
872
872
  }
873
873
  if (!n) {
874
- const o = document.createComment("removed");
875
- return e.parentNode?.replaceChild(o, e), o;
874
+ const i = document.createComment("removed");
875
+ return e.parentNode?.replaceChild(i, e), i;
876
876
  }
877
877
  if (!t || typeof t == "string") {
878
- const o = T(n, r, i);
879
- return typeof n != "string" && n.props?.ref && i && (i[n.props.ref] = o), e.parentNode?.replaceChild(o, e), o;
878
+ const i = T(n, r, o);
879
+ return typeof n != "string" && n.props?.ref && o && (o[n.props.ref] = i), e.parentNode?.replaceChild(i, e), i;
880
880
  }
881
881
  if (n.tag === "#anchor") {
882
- const o = Array.isArray(n.children) ? n.children : [], l = n._startNode ?? document.createTextNode(""), f = n._endNode ?? document.createTextNode("");
883
- n.key != null && (l.key = `${n.key}:start`, f.key = `${n.key}:end`), n._startNode = l, n._endNode = f;
884
- const u = document.createDocumentFragment();
885
- u.appendChild(l);
886
- for (const p of o)
887
- u.appendChild(T(p, r));
888
- return u.appendChild(f), e.parentNode?.replaceChild(u, e), l;
882
+ const i = Array.isArray(n.children) ? n.children : [], l = n._startNode ?? document.createTextNode(""), c = n._endNode ?? document.createTextNode("");
883
+ n.key != null && (l.key = `${n.key}:start`, c.key = `${n.key}:end`), n._startNode = l, n._endNode = c;
884
+ const d = document.createDocumentFragment();
885
+ d.appendChild(l);
886
+ for (const p of i)
887
+ d.appendChild(T(p, r));
888
+ return d.appendChild(c), e.parentNode?.replaceChild(d, e), l;
889
889
  }
890
890
  if (typeof t != "string" && typeof n != "string" && t.tag === n.tag && t.key === n.key) {
891
- const o = e;
892
- return me(o, t.props || {}, n.props || {}, r), be(o, t.children, n.children, r, i), typeof n != "string" && n.props?.ref && i && (i[n.props.ref] = o), o;
891
+ const i = e;
892
+ return ye(i, t.props || {}, n.props || {}, r), be(i, t.children, n.children, r, o), typeof n != "string" && n.props?.ref && o && (o[n.props.ref] = i), i;
893
893
  }
894
- const s = T(n, r, i);
895
- return typeof n != "string" && n.props?.ref && i && (i[n.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
894
+ const s = T(n, r, o);
895
+ return typeof n != "string" && n.props?.ref && o && (o[n.props.ref] = s), e.parentNode?.replaceChild(s, e), s;
896
896
  }
897
897
  function xe(e, t, n, r) {
898
- const i = (p) => p.key == null ? { ...p, key: "__root__" } : p;
899
- let s = Array.isArray(t) ? { tag: "div", key: "__root__", children: t } : i(t);
898
+ const o = (p) => p.key == null ? { ...p, key: "__root__" } : p;
899
+ let s = Array.isArray(t) ? { tag: "div", key: "__root__", children: t } : o(t);
900
900
  s = Z(s, String(s.key ?? "root"));
901
- const o = e._prevVNode ?? null, l = e._prevDom ?? e.firstChild ?? null;
902
- let f;
903
- o && l ? typeof o != "string" && typeof s != "string" && o.tag === s.tag && o.key === s.key ? f = D(l, o, s, n, r) : (f = T(s, n, r), e.replaceChild(f, l)) : (f = T(s, n, r), e.firstChild ? e.replaceChild(f, e.firstChild) : e.appendChild(f));
904
- const u = [];
901
+ const i = e._prevVNode ?? null, l = e._prevDom ?? e.firstChild ?? null;
902
+ let c;
903
+ i && l ? typeof i != "string" && typeof s != "string" && i.tag === s.tag && i.key === s.key ? c = D(l, i, s, n, r) : (c = T(s, n, r), e.replaceChild(c, l)) : (c = T(s, n, r), e.firstChild ? e.replaceChild(c, e.firstChild) : e.appendChild(c));
904
+ const d = [];
905
905
  for (let p = 0; p < e.childNodes.length; p++) {
906
- const d = e.childNodes[p];
907
- if (d !== f && d.nodeName !== "STYLE") {
908
- if (d instanceof HTMLElement && r)
909
- for (const c in r)
910
- r[c] === d && delete r[c];
911
- u.push(d);
906
+ const u = e.childNodes[p];
907
+ if (u !== c && u.nodeName !== "STYLE") {
908
+ if (u instanceof HTMLElement && r)
909
+ for (const f in r)
910
+ r[f] === u && delete r[f];
911
+ d.push(u);
912
912
  }
913
913
  }
914
- u.forEach((p) => e.removeChild(p)), e._prevVNode = s, e._prevDom = f;
914
+ d.forEach((p) => e.removeChild(p)), e._prevVNode = s, e._prevDom = c;
915
915
  }
916
916
  function oe(e) {
917
917
  return e.replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~])\s*/g, "$1").replace(/;}/g, "}").trim();
@@ -925,128 +925,62 @@ function ve(e) {
925
925
  }
926
926
  const we = `
927
927
  :host, *, ::before, ::after {
928
+ all: isolate;
928
929
  box-sizing: border-box;
929
- border-width: 0;
930
- border-style: solid;
931
- border-color: currentColor;
932
- }
933
- :host {
934
- font-size: 16px;
935
- line-height: 1.5;
936
- font-family: ui-sans-serif, system-ui, sans-serif;
937
- -webkit-text-size-adjust: 100%;
938
- text-size-adjust: 100%;
939
- color: inherit;
940
- background-color: transparent;
941
- }
942
- *, ::before, ::after {
943
- -webkit-tap-highlight-color: transparent;
930
+ border: 0 solid currentColor;
944
931
  margin: 0;
945
932
  padding: 0;
946
933
  font: inherit;
947
934
  vertical-align: baseline;
948
935
  background: transparent;
949
936
  color: inherit;
937
+ -webkit-tap-highlight-color: transparent;
950
938
  }
951
- button, input, optgroup, select, textarea {
952
- font: inherit;
953
- color: inherit;
939
+ :host {
940
+ display: contents;
941
+ font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
942
+ -webkit-text-size-adjust: 100%;
943
+ text-size-adjust: 100%;
944
+ }
945
+ button, input, select, textarea {
954
946
  background: transparent;
955
- border: none;
956
947
  outline: none;
957
- margin: 0;
958
- padding: 0;
959
- }
960
- textarea {
961
- resize: vertical;
962
- }
963
- progress {
964
- vertical-align: baseline;
965
- }
966
- button, textarea {
967
- overflow: visible;
968
- }
969
- input[type="search"]::-webkit-search-decoration,
970
- input[type="search"]::-webkit-search-cancel-button,
971
- input[type="search"]::-webkit-search-results-button,
972
- input[type="search"]::-webkit-search-results-decoration {
973
- -webkit-appearance: none;
974
948
  }
949
+ textarea { resize: vertical }
950
+ progress { vertical-align: baseline }
951
+ button, textarea { overflow: visible }
975
952
  img, svg, video, canvas, audio, iframe, embed, object {
976
953
  display: block;
977
954
  max-width: 100%;
978
955
  height: auto;
979
- vertical-align: middle;
980
956
  }
981
- select {
982
- text-transform: none;
983
- }
984
- optgroup {
985
- font-weight: bold;
986
- }
987
- fieldset {
988
- border: none;
989
- }
990
- svg {
991
- fill: currentColor;
992
- stroke: none;
993
- }
994
- a {
995
- color: inherit;
996
- text-decoration: inherit;
997
- }
998
- a, button {
957
+ svg { fill: currentColor; stroke: none }
958
+ a { text-decoration: inherit; cursor: pointer }
959
+ button, [type=button], [type=reset], [type=submit] {
999
960
  cursor: pointer;
1000
- }
1001
- input[type="file"] {
1002
- border: 0;
1003
- }
1004
- button, [type="button"], [type="reset"], [type="submit"] {
1005
961
  appearance: button;
1006
- background-color: transparent;
1007
- background-image: none;
1008
- }
1009
- [type='button'], [type='reset'], [type='submit'] {
962
+ background: none;
1010
963
  -webkit-user-select: none;
1011
964
  user-select: none;
1012
965
  }
1013
- ::-webkit-input-placeholder { color: inherit; opacity: 0.5; }
1014
- ::placeholder { color: inherit; opacity: 0.5; }
966
+ ::-webkit-input-placeholder, ::placeholder {
967
+ color: inherit; opacity: .5;
968
+ }
1015
969
  *:focus {
1016
- outline: 2px solid #3b82f6;
970
+ outline: 2px solid var(--color-blue-500, #3b82f6);
1017
971
  outline-offset: 2px;
1018
972
  }
1019
- ol, ul {
1020
- list-style: none;
1021
- }
1022
- table {
1023
- border-collapse: collapse;
1024
- border-spacing: 0;
1025
- }
1026
- strong {
1027
- font-weight: bolder;
1028
- }
973
+ ol, ul { list-style: none }
974
+ table { border-collapse: collapse }
1029
975
  sub, sup {
1030
- font-size: 0.75em;
976
+ font-size: .75em;
1031
977
  line-height: 0;
1032
978
  position: relative;
1033
- vertical-align: baseline;
1034
- }
1035
- sub {
1036
- bottom: -0.25em;
1037
- }
1038
- sup {
1039
- top: -0.5em;
1040
- }
1041
- [disabled] {
1042
- cursor: not-allowed;
1043
- }
1044
- [hidden] {
1045
- display: none;
1046
- }
1047
- [aria-disabled="true"] {
1048
- cursor: not-allowed;
1049
979
  }
980
+ sub { bottom: -.25em }
981
+ sup { top: -.5em }
982
+ [disabled], [aria-disabled=true] { cursor: not-allowed }
983
+ [hidden] { display: none }
1050
984
  `, ke = {
1051
985
  gray: {
1052
986
  50: "var(--color-gray-50, #f9fafb)",
@@ -1060,6 +994,18 @@ const we = `
1060
994
  800: "var(--color-gray-800, #1f2937)",
1061
995
  900: "var(--color-gray-900, #111827)"
1062
996
  },
997
+ neutral: {
998
+ 50: "var(--color-neutral-50, #fafafa)",
999
+ 100: "var(--color-neutral-100, #f5f5f5)",
1000
+ 200: "var(--color-neutral-200, #e5e5e5)",
1001
+ 300: "var(--color-neutral-300, #d4d4d4)",
1002
+ 400: "var(--color-neutral-400, #a3a3a3)",
1003
+ 500: "var(--color-neutral-500, #737373)",
1004
+ 600: "var(--color-neutral-600, #525252)",
1005
+ 700: "var(--color-neutral-700, #404040)",
1006
+ 800: "var(--color-neutral-800, #262626)",
1007
+ 900: "var(--color-neutral-900, #171717)"
1008
+ },
1063
1009
  slate: {
1064
1010
  50: "var(--color-slate-50, #f8fafc)",
1065
1011
  100: "var(--color-slate-100, #f1f5f9)",
@@ -1179,6 +1125,26 @@ const we = `
1179
1125
  "inline-flex": "display:inline-flex;",
1180
1126
  grid: "display:grid;",
1181
1127
  hidden: "display:none;",
1128
+ /* Sizing & Spacing */
1129
+ "w-full": "width:100%;",
1130
+ "w-screen": "width:100dvw;",
1131
+ "h-full": "height:100%;",
1132
+ "h-screen": "height:100dvw;",
1133
+ "max-w-full": "max-width:100%;",
1134
+ "max-h-full": "max-height:100%;",
1135
+ "min-w-0": "min-width:0;",
1136
+ "min-h-0": "min-height:0;",
1137
+ "m-auto": "margin:auto;",
1138
+ "mx-auto": "margin-inline:auto;",
1139
+ "my-auto": "margin-block:auto;",
1140
+ /* Overflow */
1141
+ "overflow-auto": "overflow:auto;",
1142
+ "overflow-hidden": "overflow:hidden;",
1143
+ "overflow-visible": "overflow:visible;",
1144
+ "overflow-scroll": "overflow:scroll;",
1145
+ /* Pointer Events */
1146
+ "pointer-events-none": "pointer-events:none;",
1147
+ "pointer-events-auto": "pointer-events:auto;",
1182
1148
  /* Accessibility */
1183
1149
  "sr-only": "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;",
1184
1150
  "not-sr-only": "position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",
@@ -1283,7 +1249,28 @@ const we = `
1283
1249
  "items-stretch": "align-items:stretch;",
1284
1250
  "justify-center": "justify-content:center;",
1285
1251
  "justify-start": "justify-content:flex-start;",
1252
+ "justify-between": "justify-content:space-between;",
1253
+ "justify-around": "justify-content:space-around;",
1254
+ "justify-evenly": "justify-content:space-evenly;",
1286
1255
  "justify-end": "justify-content:flex-end;",
1256
+ "flex-wrap": "flex-wrap:wrap;",
1257
+ "flex-nowrap": "flex-wrap:nowrap;",
1258
+ "flex-wrap-reverse": "flex-wrap:wrap-reverse;",
1259
+ "content-center": "align-content:center;",
1260
+ "content-start": "align-content:flex-start;",
1261
+ "content-end": "align-content:flex-end;",
1262
+ "content-between": "align-content:space-between;",
1263
+ "content-around": "align-content:space-around;",
1264
+ "content-stretch": "align-content:stretch;",
1265
+ "self-auto": "align-self:auto;",
1266
+ "self-start": "align-self:flex-start;",
1267
+ "self-end": "align-self:flex-end;",
1268
+ "self-center": "align-self:center;",
1269
+ "self-stretch": "align-self:stretch;",
1270
+ "flex-1": "flex:1 1 0%;",
1271
+ "flex-auto": "flex:1 1 auto;",
1272
+ "flex-initial": "flex:0 1 auto;",
1273
+ "flex-none": "flex:0 0 auto;",
1287
1274
  "flex-col": "flex-direction:column;",
1288
1275
  "flex-row": "flex-direction:row;",
1289
1276
  grow: "flex-grow:1;",
@@ -1303,7 +1290,7 @@ const we = `
1303
1290
  "transition-colors": "transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;",
1304
1291
  "transition-opacity": "transition-property:opacity;",
1305
1292
  "transition-transform": "transition-property:transform;"
1306
- }, _e = "0.25rem", ee = {
1293
+ }, _e = "var(--spacing, 0.25rem)", ee = {
1307
1294
  m: ["margin"],
1308
1295
  mx: ["margin-inline"],
1309
1296
  my: ["margin-block"],
@@ -1321,6 +1308,12 @@ const we = `
1321
1308
  inset: ["inset"],
1322
1309
  "inset-x": ["inset-inline"],
1323
1310
  "inset-y": ["inset-block"],
1311
+ h: ["height"],
1312
+ w: ["width"],
1313
+ "min-h": ["min-height"],
1314
+ "min-w": ["min-width"],
1315
+ "max-h": ["max-height"],
1316
+ "max-w": ["max-width"],
1324
1317
  top: ["top"],
1325
1318
  bottom: ["bottom"],
1326
1319
  left: ["left"],
@@ -1367,19 +1360,19 @@ const we = `
1367
1360
  function U(e) {
1368
1361
  const t = e.startsWith("-"), r = (t ? e.slice(1) : e).split("-");
1369
1362
  if (r.length < 2) return null;
1370
- const i = r.slice(0, -1).join("-"), s = r[r.length - 1], o = parseFloat(s);
1371
- if (Number.isNaN(o) || !ee[i]) return null;
1363
+ const o = r.slice(0, -1).join("-"), s = r[r.length - 1], i = parseFloat(s);
1364
+ if (Number.isNaN(i) || !ee[o]) return null;
1372
1365
  const l = t ? "-" : "";
1373
- return ee[i].map((f) => `${f}:calc(${l}${_e} * ${o});`).join("");
1366
+ return ee[o].map((c) => `${c}:calc(${l}${_e} * ${i});`).join("");
1374
1367
  }
1375
1368
  function re(e) {
1376
- const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, i = n >> 8 & 255, s = n & 255;
1377
- return `${r} ${i} ${s}`;
1369
+ const t = e.replace("#", ""), n = parseInt(t, 16), r = n >> 16 & 255, o = n >> 8 & 255, s = n & 255;
1370
+ return `${r} ${o} ${s}`;
1378
1371
  }
1379
1372
  function Se(e) {
1380
1373
  const t = /^(bg|text|border|shadow|outline|caret|accent)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);
1381
1374
  if (!t) return null;
1382
- const [, n, r, i = "DEFAULT"] = t, s = ke[r]?.[i];
1375
+ const [, n, r, o = "DEFAULT"] = t, s = ke[r]?.[o];
1383
1376
  return s ? `${{
1384
1377
  bg: "background-color",
1385
1378
  text: "color",
@@ -1402,29 +1395,29 @@ function q(e) {
1402
1395
  if (n !== void 0) {
1403
1396
  const s = /#([0-9a-f]{6})/i.exec(r);
1404
1397
  if (s) {
1405
- const o = re(s[0]);
1406
- return r.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
1398
+ const i = re(s[0]);
1399
+ return r.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${n})`);
1407
1400
  }
1408
1401
  }
1409
1402
  return r;
1410
1403
  }
1411
- const i = W(t);
1412
- if (i && n !== void 0) {
1413
- const s = /#([0-9a-f]{6})/i.exec(i);
1404
+ const o = W(t);
1405
+ if (o && n !== void 0) {
1406
+ const s = /#([0-9a-f]{6})/i.exec(o);
1414
1407
  if (s) {
1415
- const o = re(s[0]);
1416
- return i.replace(/#([0-9a-f]{6})/i, `rgb(${o} / ${n})`);
1408
+ const i = re(s[0]);
1409
+ return o.replace(/#([0-9a-f]{6})/i, `rgb(${i} / ${n})`);
1417
1410
  }
1418
1411
  }
1419
- return i;
1412
+ return o;
1420
1413
  }
1421
1414
  function W(e) {
1422
1415
  const t = e.indexOf("-["), n = e.endsWith("]");
1423
1416
  if (t > 0 && n) {
1424
1417
  const r = e.slice(0, t);
1425
- let i = e.slice(t + 2, -1);
1426
- i = i.replace(/_/g, " ");
1427
- const o = {
1418
+ let o = e.slice(t + 2, -1);
1419
+ o = o.replace(/_/g, " ");
1420
+ const i = {
1428
1421
  bg: "background-color",
1429
1422
  text: "color",
1430
1423
  p: "padding",
@@ -1464,7 +1457,7 @@ function W(e) {
1464
1457
  leading: "line-height",
1465
1458
  z: "z-index"
1466
1459
  }[r] ?? r.replace(/_/g, "-");
1467
- if (o && i) return `${o}:${i};`;
1460
+ if (i && o) return `${i}:${o};`;
1468
1461
  }
1469
1462
  return null;
1470
1463
  }
@@ -1475,10 +1468,10 @@ function Ee(e) {
1475
1468
  const t = /class\s*=\s*["']([^"']+)["']/g, n = [];
1476
1469
  let r;
1477
1470
  for (; r = t.exec(e); ) {
1478
- let i = "", s = !1;
1479
- for (const o of r[1])
1480
- o === "[" && (s = !0), o === "]" && (s = !1), o === " " && !s ? (i && n.push(i), i = "") : i += o;
1481
- i && n.push(i);
1471
+ let o = "", s = !1;
1472
+ for (const i of r[1])
1473
+ i === "[" && (s = !0), i === "]" && (s = !1), i === " " && !s ? (o && n.push(o), o = "") : o += i;
1474
+ o && n.push(o);
1482
1475
  }
1483
1476
  return n.filter(Boolean);
1484
1477
  }
@@ -1486,27 +1479,27 @@ const ne = /* @__PURE__ */ new Map(), Te = 16;
1486
1479
  function je(e) {
1487
1480
  const t = Date.now(), n = ne.get(e);
1488
1481
  if (n && t - n.timestamp < Te) return n.css;
1489
- const r = Ee(e), i = new Set(r), s = [], o = [], l = [], f = [], u = {};
1482
+ const r = Ee(e), o = new Set(r), s = [], i = [], l = [], c = [], d = {};
1490
1483
  function p(h, S = !1) {
1491
- const m = (S ? "dark|" : "") + h;
1492
- if (m in u) return u[m];
1493
- const a = c(h, S);
1494
- return u[m] = a, a;
1484
+ const y = (S ? "dark|" : "") + h;
1485
+ if (y in d) return d[y];
1486
+ const a = f(h, S);
1487
+ return d[y] = a, a;
1495
1488
  }
1496
- function d(h) {
1497
- const S = h.some((a) => V.includes(a)), m = h.includes("dark");
1498
- return h.length === 0 ? 1 : !S && !m ? 2 : S && !m ? 3 : 4;
1489
+ function u(h) {
1490
+ const S = h.some((a) => V.includes(a)), y = h.includes("dark");
1491
+ return h.length === 0 ? 1 : !S && !y ? 2 : S && !y ? 3 : 4;
1499
1492
  }
1500
- function c(h, S = !1) {
1501
- const m = h.split(":"), a = m.find(
1493
+ function f(h, S = !1) {
1494
+ const y = h.split(":"), a = y.find(
1502
1495
  (_) => F[_] || U(_) || q(_) || W(_)
1503
1496
  );
1504
1497
  if (!a) return null;
1505
1498
  const b = F[a] ?? U(a) ?? q(a) ?? W(a);
1506
1499
  if (!b) return null;
1507
1500
  let g = `.${Ae(h)}`, x = b;
1508
- const w = m.indexOf(a);
1509
- let k = w >= 0 ? m.slice(0, w) : [];
1501
+ const w = y.indexOf(a);
1502
+ let k = w >= 0 ? y.slice(0, w) : [];
1510
1503
  S && (k = k.filter((_) => _ !== "dark"));
1511
1504
  const $ = k.filter((_) => V.includes(_)), C = $.length ? $[$.length - 1] : null;
1512
1505
  for (const _ of k) {
@@ -1517,22 +1510,22 @@ function je(e) {
1517
1510
  let v = `${g}{${x}}`;
1518
1511
  return S && C ? v = `@media (prefers-color-scheme: dark) and ${te[C]}{${v}}` : S ? v = `@media (prefers-color-scheme: dark){${v}}` : C && (v = `@media ${te[C]}{${v}}`), v;
1519
1512
  }
1520
- for (const h of i) {
1521
- const S = h.split(":"), m = S.find(
1513
+ for (const h of o) {
1514
+ const S = h.split(":"), y = S.find(
1522
1515
  (x) => F[x] || U(x) || q(x) || W(x)
1523
1516
  );
1524
- if (!m) continue;
1525
- const a = S.indexOf(m), b = a >= 0 ? S.slice(0, a) : [], g = d(b);
1517
+ if (!y) continue;
1518
+ const a = S.indexOf(y), b = a >= 0 ? S.slice(0, a) : [], g = u(b);
1526
1519
  if (g === 4) {
1527
1520
  const x = p(h, !0);
1528
- x && f.push(x);
1521
+ x && c.push(x);
1529
1522
  } else {
1530
1523
  const x = p(h);
1531
- x && (g === 1 ? s.push(x) : g === 2 ? o.push(x) : g === 3 && l.push(x));
1524
+ x && (g === 1 ? s.push(x) : g === 2 ? i.push(x) : g === 3 && l.push(x));
1532
1525
  }
1533
1526
  }
1534
- const y = [...s, ...o, ...l, ...f].join("");
1535
- return ne.set(e, { css: y, timestamp: t }), y;
1527
+ const m = [...s, ...i, ...l, ...c].join("");
1528
+ return ne.set(e, { css: m, timestamp: t }), m;
1536
1529
  }
1537
1530
  const Le = /* @__PURE__ */ new Map();
1538
1531
  function Q(e) {
@@ -1559,10 +1552,10 @@ function He(e, ...t) {
1559
1552
  function Ie(e, t, n) {
1560
1553
  let r = Q(e);
1561
1554
  r.includes("-") || (r = `cer-${r}`);
1562
- let i;
1563
- typeof t == "function" ? i = { ...n, render: t } : i = t, typeof i.onError != "function" && (i.onError = (s, o) => {
1564
- console.error(`[${r}] Error:`, s, o);
1565
- }), Le.set(r, i), typeof window < "u" && !customElements.get(r) && customElements.define(r, ze(i));
1555
+ let o;
1556
+ typeof t == "function" ? o = { ...n, render: t } : o = t, typeof o.onError != "function" && (o.onError = (s, i) => {
1557
+ console.error(`[${r}] Error:`, s, i);
1558
+ }), Le.set(r, o), typeof window < "u" && !customElements.get(r) && customElements.define(r, ze(o));
1566
1559
  }
1567
1560
  function ze(e) {
1568
1561
  if (!e.render)
@@ -1596,12 +1589,35 @@ function ze(e) {
1596
1589
  value: this._refs,
1597
1590
  writable: !1,
1598
1591
  enumerable: !1,
1599
- // Hide from iteration to avoid proxy traps
1600
1592
  configurable: !1
1601
- }), this.context = t, Object.keys(e).forEach((n) => {
1593
+ }), this.context = t, this._applyProps(e), Object.defineProperty(this.context, "emit", {
1594
+ value: (n, r, o) => {
1595
+ this.dispatchEvent(
1596
+ new CustomEvent(n, {
1597
+ detail: r,
1598
+ bubbles: !0,
1599
+ composed: !0,
1600
+ ...o || {}
1601
+ })
1602
+ );
1603
+ const s = `on${n.charAt(0).toUpperCase()}${n.slice(1)}`, i = typeof this[s] == "function" ? this[s] : void 0, l = typeof this.context[s] == "function" ? this.context[s] : void 0, c = typeof e[s] == "function" ? e[s] : void 0;
1604
+ i && i(r, this.context), l && l !== i && l(r, this.context), c && c !== i && c !== l && c(r, this.context);
1605
+ },
1606
+ writable: !1,
1607
+ enumerable: !1,
1608
+ configurable: !1
1609
+ }), Object.keys(e).forEach((n) => {
1602
1610
  const r = e[n];
1603
- typeof r == "function" && !n.startsWith("on") && (this.context[n] = (...i) => r(...i, this.context));
1604
- }), this._applyProps(e), this._applyComputed(e), this._initializing = !1, this._initWatchers(e), this._render(e);
1611
+ if (typeof r == "function" && !n.startsWith("on"))
1612
+ this.context[n] = (...o) => r(...o, this.context);
1613
+ else if (n.startsWith("on") && n.length > 2 && n[2] === n[2].toUpperCase()) {
1614
+ const o = n.slice(2, 3).toLowerCase() + n.slice(3);
1615
+ this.addEventListener(o, (s) => {
1616
+ const i = typeof this[n] == "function" ? this[n] : this.context[n];
1617
+ typeof i == "function" && i(s.detail, this.context);
1618
+ });
1619
+ }
1620
+ }), this._applyComputed(e), this._initializing = !1, this._initWatchers(e), this._render(e);
1605
1621
  }
1606
1622
  connectedCallback() {
1607
1623
  this._runLogicWithinErrorBoundary(e, () => {
@@ -1631,8 +1647,8 @@ function ze(e) {
1631
1647
  t.computed && Object.entries(t.computed).forEach(([n, r]) => {
1632
1648
  Object.defineProperty(this.context, n, {
1633
1649
  get: () => {
1634
- const i = r(this.context);
1635
- return J(i);
1650
+ const o = r(this.context);
1651
+ return J(o);
1636
1652
  },
1637
1653
  enumerable: !0
1638
1654
  });
@@ -1655,8 +1671,8 @@ function ze(e) {
1655
1671
  if (n instanceof Promise) {
1656
1672
  this._templateLoading = !0, n.then((r) => (this._templateLoading = !1, this._templateError = null, this._renderOutput(r), r)).catch((r) => {
1657
1673
  if (this._templateLoading = !1, this._templateError = r, t.errorTemplate) {
1658
- const i = t.errorTemplate(r, this.context);
1659
- return this._renderOutput(i), i;
1674
+ const o = t.errorTemplate(r, this.context);
1675
+ return this._renderOutput(o), o;
1660
1676
  }
1661
1677
  throw r;
1662
1678
  }), t.loadingTemplate && this._renderOutput(t.loadingTemplate(this.context));
@@ -1669,15 +1685,15 @@ function ze(e) {
1669
1685
  _renderOutput(t) {
1670
1686
  if (!this.shadowRoot) return;
1671
1687
  const n = new Proxy(this.context, {
1672
- get: (r, i) => i === "_requestRender" ? () => this._requestRender() : i === "context" ? r : typeof i == "string" && i.includes(".") ? i.split(".").reduce((s, o) => s?.[o], r) : r[i],
1673
- set: (r, i, s) => {
1674
- if (typeof i == "string" && i.includes(".")) {
1675
- const o = i.split("."), l = o.pop();
1688
+ get: (r, o) => o === "_requestRender" ? () => this._requestRender() : o === "context" ? r : typeof o == "string" && o.includes(".") ? o.split(".").reduce((s, i) => s?.[i], r) : r[o],
1689
+ set: (r, o, s) => {
1690
+ if (typeof o == "string" && o.includes(".")) {
1691
+ const i = o.split("."), l = i.pop();
1676
1692
  if (!l) return !1;
1677
- const f = o.reduce((u, p) => (p in u || (u[p] = {}), u[p]), r);
1678
- return f[l] = s, !0;
1693
+ const c = i.reduce((d, p) => (p in d || (d[p] = {}), d[p]), r);
1694
+ return c[l] = s, !0;
1679
1695
  }
1680
- return r[i] = s, !0;
1696
+ return r[o] = s, !0;
1681
1697
  }
1682
1698
  });
1683
1699
  xe(
@@ -1712,10 +1728,10 @@ function ze(e) {
1712
1728
  }
1713
1729
  let r = "";
1714
1730
  t.style && (typeof t.style == "string" ? r = t.style : typeof t.style == "function" && (r = t.style(this.context)));
1715
- let i = ve(`${r}
1731
+ let o = ve(`${r}
1716
1732
  ${n}
1717
1733
  `);
1718
- i = oe(i), this._styleSheet || (this._styleSheet = new CSSStyleSheet()), (this._styleSheet.cssRules.length === 0 || this._styleSheet.toString() !== i) && this._styleSheet.replaceSync(i), this.shadowRoot.adoptedStyleSheets = [G(), this._styleSheet];
1734
+ o = oe(o), this._styleSheet || (this._styleSheet = new CSSStyleSheet()), (this._styleSheet.cssRules.length === 0 || this._styleSheet.toString() !== o) && this._styleSheet.replaceSync(o), this.shadowRoot.adoptedStyleSheets = [G(), this._styleSheet];
1719
1735
  });
1720
1736
  }
1721
1737
  // --- Error Boundary function ---
@@ -1733,11 +1749,11 @@ ${n}
1733
1749
  // --- State, props, computed ---
1734
1750
  _initContext(t) {
1735
1751
  try {
1736
- let n = function(i, s = "") {
1737
- return Array.isArray(i) ? new Proxy(i, {
1738
- get(o, l, f) {
1739
- const u = Reflect.get(o, l, f);
1740
- return typeof u == "function" && typeof l == "string" && [
1752
+ let n = function(o, s = "") {
1753
+ return Array.isArray(o) ? new Proxy(o, {
1754
+ get(i, l, c) {
1755
+ const d = Reflect.get(i, l, c);
1756
+ return typeof d == "function" && typeof l == "string" && [
1741
1757
  "push",
1742
1758
  "pop",
1743
1759
  "shift",
@@ -1745,44 +1761,44 @@ ${n}
1745
1761
  "splice",
1746
1762
  "sort",
1747
1763
  "reverse"
1748
- ].includes(l) ? function(...d) {
1749
- const c = u.apply(o, d);
1764
+ ].includes(l) ? function(...u) {
1765
+ const f = d.apply(i, u);
1750
1766
  if (!r._initializing) {
1751
- const y = s || "root";
1752
- r._triggerWatchers(y, o), r._render(t);
1767
+ const m = s || "root";
1768
+ r._triggerWatchers(m, i), r._render(t);
1753
1769
  }
1754
- return c;
1755
- } : u;
1770
+ return f;
1771
+ } : d;
1756
1772
  },
1757
- set(o, l, f) {
1758
- if (o[l] = f, !r._initializing) {
1759
- const u = s ? `${s}.${String(l)}` : String(l);
1760
- r._triggerWatchers(u, f), r._render(t);
1773
+ set(i, l, c) {
1774
+ if (i[l] = c, !r._initializing) {
1775
+ const d = s ? `${s}.${String(l)}` : String(l);
1776
+ r._triggerWatchers(d, c), r._render(t);
1761
1777
  }
1762
1778
  return !0;
1763
1779
  },
1764
- deleteProperty(o, l) {
1765
- if (delete o[l], !r._initializing) {
1766
- const f = s ? `${s}.${String(l)}` : String(l);
1767
- r._triggerWatchers(f, void 0), r._render(t);
1780
+ deleteProperty(i, l) {
1781
+ if (delete i[l], !r._initializing) {
1782
+ const c = s ? `${s}.${String(l)}` : String(l);
1783
+ r._triggerWatchers(c, void 0), r._render(t);
1768
1784
  }
1769
1785
  return !0;
1770
1786
  }
1771
- }) : i && typeof i == "object" ? (Object.keys(i).forEach((o) => {
1772
- const l = s ? `${s}.${o}` : o;
1773
- i[o] = n(i[o], l);
1774
- }), new Proxy(i, {
1775
- set(o, l, f) {
1776
- const u = s ? `${s}.${String(l)}` : String(l);
1777
- return o[l] = n(f, u), r._initializing || (r._triggerWatchers(
1778
- u,
1779
- o[l]
1787
+ }) : o && typeof o == "object" ? (Object.keys(o).forEach((i) => {
1788
+ const l = s ? `${s}.${i}` : i;
1789
+ o[i] = n(o[i], l);
1790
+ }), new Proxy(o, {
1791
+ set(i, l, c) {
1792
+ const d = s ? `${s}.${String(l)}` : String(l);
1793
+ return i[l] = n(c, d), r._initializing || (r._triggerWatchers(
1794
+ d,
1795
+ i[l]
1780
1796
  ), r._render(t)), !0;
1781
1797
  },
1782
- get(o, l, f) {
1783
- return Reflect.get(o, l, f);
1798
+ get(i, l, c) {
1799
+ return Reflect.get(i, l, c);
1784
1800
  }
1785
- })) : i;
1801
+ })) : o;
1786
1802
  };
1787
1803
  const r = this;
1788
1804
  return n({ ...t.state });
@@ -1793,17 +1809,17 @@ ${n}
1793
1809
  _initWatchers(t) {
1794
1810
  if (t.watch)
1795
1811
  for (const [n, r] of Object.entries(t.watch)) {
1796
- let i, s = {};
1797
- if (Array.isArray(r) ? (i = r[0], s = r[1] || {}) : i = r, this._watchers.set(n, {
1798
- callback: i,
1812
+ let o, s = {};
1813
+ if (Array.isArray(r) ? (o = r[0], s = r[1] || {}) : o = r, this._watchers.set(n, {
1814
+ callback: o,
1799
1815
  options: s,
1800
1816
  oldValue: this._getNestedValue(n)
1801
1817
  }), s.immediate)
1802
1818
  try {
1803
- const o = this._getNestedValue(n);
1804
- i(o, void 0, this.context);
1805
- } catch (o) {
1806
- console.error(`Error in immediate watcher for "${n}":`, o);
1819
+ const i = this._getNestedValue(n);
1820
+ o(i, void 0, this.context);
1821
+ } catch (i) {
1822
+ console.error(`Error in immediate watcher for "${n}":`, i);
1807
1823
  }
1808
1824
  }
1809
1825
  }
@@ -1814,40 +1830,44 @@ ${n}
1814
1830
  );
1815
1831
  }
1816
1832
  _triggerWatchers(t, n) {
1817
- const r = (s, o) => {
1818
- if (s === o) return !0;
1819
- if (typeof s != typeof o || typeof s != "object" || s === null || o === null) return !1;
1820
- if (Array.isArray(s) && Array.isArray(o))
1821
- return s.length !== o.length ? !1 : s.every((u, p) => r(u, o[p]));
1822
- const l = Object.keys(s), f = Object.keys(o);
1823
- return l.length !== f.length ? !1 : l.every((u) => r(s[u], o[u]));
1824
- }, i = this._watchers.get(t);
1825
- if (i && !r(n, i.oldValue))
1833
+ const r = (s, i) => {
1834
+ if (s === i) return !0;
1835
+ if (typeof s != typeof i || typeof s != "object" || s === null || i === null) return !1;
1836
+ if (Array.isArray(s) && Array.isArray(i))
1837
+ return s.length !== i.length ? !1 : s.every((d, p) => r(d, i[p]));
1838
+ const l = Object.keys(s), c = Object.keys(i);
1839
+ return l.length !== c.length ? !1 : l.every((d) => r(s[d], i[d]));
1840
+ }, o = this._watchers.get(t);
1841
+ if (o && !r(n, o.oldValue))
1826
1842
  try {
1827
- i.callback(n, i.oldValue, this.context), i.oldValue = n;
1843
+ o.callback(n, o.oldValue, this.context), o.oldValue = n;
1828
1844
  } catch (s) {
1829
1845
  console.error(`Error in watcher for "${t}":`, s);
1830
1846
  }
1831
- for (const [s, o] of this._watchers.entries())
1832
- if (o.options.deep && t.startsWith(s + "."))
1847
+ for (const [s, i] of this._watchers.entries())
1848
+ if (i.options.deep && t.startsWith(s + "."))
1833
1849
  try {
1834
1850
  const l = this._getNestedValue(s);
1835
- r(l, o.oldValue) || (o.callback(l, o.oldValue, this.context), o.oldValue = l);
1851
+ r(l, i.oldValue) || (i.callback(l, i.oldValue, this.context), i.oldValue = l);
1836
1852
  } catch (l) {
1837
1853
  console.error(`Error in deep watcher for "${s}":`, l);
1838
1854
  }
1839
1855
  }
1840
1856
  _applyProps(t) {
1841
1857
  try {
1842
- let n = function(r, i) {
1843
- return i === Boolean ? r === "true" : i === Number ? Number(r) : r;
1858
+ let n = function(r, o) {
1859
+ return o === Boolean ? r === "true" : o === Number ? Number(r) : r;
1844
1860
  };
1845
1861
  if (!t.props) return;
1846
- Object.entries(t.props).forEach(([r, i]) => {
1847
- const s = this.getAttribute(Q(r));
1848
- s !== null ? this.context[r] = J(
1849
- n(s, i.type)
1850
- ) : "default" in i && i.default !== void 0 && (this.context[r] = J(i.default));
1862
+ Object.entries(t.props).forEach(([r, o]) => {
1863
+ if (o.type === Function && typeof this[r] == "function")
1864
+ this.context[r] = this[r];
1865
+ else {
1866
+ const s = this.getAttribute(Q(r));
1867
+ s !== null ? this.context[r] = J(
1868
+ n(s, o.type)
1869
+ ) : "default" in o && o.default !== void 0 && (this.context[r] = J(o.default));
1870
+ }
1851
1871
  });
1852
1872
  } catch (n) {
1853
1873
  this._hasError = !0, t.onError && t.onError(n, this.context), t.errorFallback && this.shadowRoot && (this.shadowRoot.innerHTML = t.errorFallback(
@@ -1865,8 +1885,8 @@ export {
1865
1885
  He as css,
1866
1886
  Ne as each,
1867
1887
  Be as eventBus,
1868
- Me as html,
1888
+ Oe as html,
1869
1889
  Pe as match,
1870
- Oe as when
1890
+ Me as when
1871
1891
  };
1872
1892
  //# sourceMappingURL=custom-elements-runtime.es.js.map