@tempots/dom 20.1.0 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,8 +1,12 @@
1
- var Te = Object.defineProperty;
2
- var Ce = (t, e, r) => e in t ? Te(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var u = (t, e, r) => Ce(t, typeof e != "symbol" ? e + "" : e, r);
4
- const Le = (t, e, r) => t + (e - t) * r;
5
- const Oe = (t, e, r) => {
1
+ var Re = Object.defineProperty;
2
+ var ee = (t) => {
3
+ throw TypeError(t);
4
+ };
5
+ var Me = (t, e, r) => e in t ? Re(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
6
+ var u = (t, e, r) => Me(t, typeof e != "symbol" ? e + "" : e, r), te = (t, e, r) => e.has(t) || ee("Cannot " + r);
7
+ var D = (t, e, r) => (te(t, e, "read from private field"), r ? r.call(t) : e.get(t)), re = (t, e, r) => e.has(t) ? ee("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), J = (t, e, r, s) => (te(t, e, "write to private field"), s ? s.call(t, r) : e.set(t, r), r);
8
+ const $e = (t, e, r) => t + (e - t) * r;
9
+ const Fe = (t, e, r) => {
6
10
  const s = Math.max(t.length, e.length);
7
11
  let n = "";
8
12
  for (let o = 0; o < s; o++) {
@@ -12,52 +16,50 @@ const Oe = (t, e, r) => {
12
16
  isNaN(l) && (l = 97), n += String.fromCharCode(i + (l - i) * r);
13
17
  }
14
18
  return n;
15
- }, ke = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), Ne = (t, e) => e, Re = (t) => typeof t == "number" ? Le : typeof t == "string" ? Oe : t instanceof Date ? ke : Ne;
16
- class R {
19
+ }, Ve = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), qe = (t, e) => e, Ie = (t) => typeof t == "number" ? $e : typeof t == "string" ? Fe : t instanceof Date ? Ve : qe;
20
+ var y;
21
+ class T {
17
22
  /**
18
23
  * Creates a new instance of `ElementPosition`.
19
24
  * @param index - The index of the element.
20
25
  * @param total - The total number of elements in the collection.
21
26
  */
22
27
  constructor(e, r) {
23
- this.index = e, this.total = r;
24
- }
25
- /**
26
- * Gets the counter of the element.
27
- */
28
- get counter() {
29
- return this.index + 1;
30
- }
31
- /**
32
- * Checks if the element is the first element in the collection.
33
- * @returns `true` if the element is the first element, `false` otherwise.
34
- */
35
- get isFirst() {
36
- return this.index === 0;
28
+ /**
29
+ * The counter of the element starting from 1.
30
+ */
31
+ u(this, "counter");
32
+ /**
33
+ * Checks if the element is the first element in the collection.
34
+ * @returns `true` if the element is the first element, `false` otherwise.
35
+ */
36
+ u(this, "isFirst");
37
+ /**
38
+ * Checks if the counter of the element is even.
39
+ * @returns `true` if the counter is even, `false` otherwise.
40
+ */
41
+ u(this, "isEven");
42
+ /**
43
+ * Checks if the counter of the element is odd.
44
+ * @returns `true` if the counter is odd, `false` otherwise.
45
+ */
46
+ u(this, "isOdd");
47
+ re(this, y);
48
+ u(this, "dispose", () => {
49
+ D(this, y) != null && (D(this, y).dispose(), J(this, y, void 0));
50
+ });
51
+ this.index = e, this.total = r, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
37
52
  }
38
53
  /**
39
54
  * Checks if the element is the last element in the collection.
40
55
  * @returns `true` if the element is the last element, `false` otherwise.
41
56
  */
42
57
  get isLast() {
43
- return this.index === this.total - 1;
44
- }
45
- /**
46
- * Checks if the counter of the element is even.
47
- * @returns `true` if the counter is even, `false` otherwise.
48
- */
49
- get isEven() {
50
- return this.index % 2 === 1;
51
- }
52
- /**
53
- * Checks if the counter of the element is odd.
54
- * @returns `true` if the counter is odd, `false` otherwise.
55
- */
56
- get isOdd() {
57
- return this.index % 2 === 0;
58
+ return D(this, y) == null && J(this, y, this.total.map((e) => this.counter === e)), D(this, y);
58
59
  }
59
60
  }
60
- const p = class p {
61
+ y = new WeakMap();
62
+ const C = class C {
61
63
  /**
62
64
  * Represents a signal with a value of type T.
63
65
  *
@@ -241,21 +243,21 @@ const p = class p {
241
243
  * @returns A property that holds the mapped value and can be observed for changes.
242
244
  */
243
245
  u(this, "mapAsync", (e, r, s, n = (o, i) => o === i) => {
244
- const o = C(r, n);
246
+ const o = V(r, n);
245
247
  let i = 0, l = new AbortController();
246
248
  return o.onDispose(
247
249
  this.on(async (a) => {
248
- const c = ++i;
250
+ const f = ++i;
249
251
  l.abort(), l = new AbortController();
250
252
  try {
251
- const d = await e(a, { abortSignal: l.signal });
252
- c === i && o.set(d);
253
- } catch (d) {
254
- if (c === i)
253
+ const g = await e(a, { abortSignal: l.signal });
254
+ f === i && o.set(g);
255
+ } catch (g) {
256
+ if (f === i)
255
257
  if (s != null)
256
- o.set(s(d));
258
+ o.set(s(g));
257
259
  else
258
- throw d;
260
+ throw g;
259
261
  }
260
262
  })
261
263
  ), o;
@@ -286,7 +288,7 @@ const p = class p {
286
288
  * @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
287
289
  * @returns The derived property.
288
290
  */
289
- u(this, "deriveProp", (e = !0) => this.feedProp(C(this.get()), e));
291
+ u(this, "deriveProp", (e = !0) => this.feedProp(V(this.get()), e));
290
292
  /**
291
293
  * Returns a signal that emits the count of values received so far.
292
294
  * @returns A signal that emits the count of values received so far.
@@ -338,8 +340,8 @@ const p = class p {
338
340
  * @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
339
341
  * @returns - A Signal that represents the result of the Promise.
340
342
  */
341
- u(p, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
342
- const o = new p(r, n);
343
+ u(C, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
344
+ const o = new C(r, n);
343
345
  return e.then((i) => o._setAndNotify(i, !1)).catch((i) => {
344
346
  s != null ? o._setAndNotify(s(i), !1) : console.error(
345
347
  "Unhandled promise rejection in Signal.ofPromise:",
@@ -352,47 +354,12 @@ u(p, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
352
354
  * @param value - The value to check.
353
355
  * @returns `true` if the value is a Signal, `false` otherwise.
354
356
  */
355
- u(p, "is", (e) => (
357
+ u(C, "is", (e) => (
356
358
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
357
359
  e != null && e.$__signal__ === !0
358
- )), /**
359
- * Wraps a value or a Signal instance into a Signal.
360
- * If the value is already a Signal, it returns the value itself.
361
- * If the value is not a Signal, it creates a new Signal instance with the given value.
362
- *
363
- * @typeParam O - The type of the value.
364
- * @param value - The value or Signal instance to wrap.
365
- * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
366
- * @returns A Signal instance.
367
- */
368
- u(p, "wrap", (e, r = (s, n) => s === n) => p.is(e) ? e : new p(e, r)), /**
369
- * Wraps a value in a `Signal` if it is not already a `Signal`.
370
- * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
371
- * @param value - The value to wrap or check.
372
- * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
373
- */
374
- u(p, "maybeWrap", (e) => e == null ? e : p.wrap(e)), /**
375
- * Unwraps a value from a `Signal` if it is a `Signal`, otherwise returns the value as is.
376
- *
377
- * @param value - The value to unwrap.
378
- * @returns The unwrapped value.
379
- */
380
- u(p, "unwrap", (e) => p.is(e) ? e.get() : e), /**
381
- * Maps the value of a `Signal` or a regular value using the provided mapping function.
382
- * If the input value is a `Signal`, the mapping function is applied to its value.
383
- * If the input value is not a `Signal`, the mapping function is directly applied to the value.
384
- *
385
- * @param value - The input value to be mapped.
386
- * @param fn - The mapping function to be applied to the value.
387
- * @returns A new `Signal` with the mapped value if the input value is a `Signal`,
388
- * otherwise, the result of applying the mapping function to the value.
389
- *
390
- * @typeParam N - The type of the input value.
391
- * @typeParam O - The type of the mapped value.
392
- */
393
- u(p, "map", (e, r) => p.is(e) ? e.map(r) : r(e));
394
- let h = p;
395
- const Me = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
360
+ ));
361
+ let h = C;
362
+ const Be = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
396
363
  class E extends h {
397
364
  /**
398
365
  * Represents a Signal object.
@@ -428,7 +395,7 @@ class E extends h {
428
395
  */
429
396
  u(this, "_scheduleNotify", () => {
430
397
  const r = ++this._scheduleCount;
431
- Me(() => {
398
+ Be(() => {
432
399
  this._scheduleCount !== r || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
433
400
  });
434
401
  });
@@ -450,7 +417,7 @@ class E extends h {
450
417
  return this.get();
451
418
  }
452
419
  }
453
- const V = class V extends h {
420
+ const q = class q extends h {
454
421
  constructor() {
455
422
  super(...arguments);
456
423
  /**
@@ -504,7 +471,7 @@ const V = class V extends h {
504
471
  * @returns A Prop object representing the isomorphism.
505
472
  */
506
473
  u(this, "iso", (r, s, n = (o, i) => o === i) => {
507
- const o = new V(r(this.get()), n);
474
+ const o = new q(r(this.get()), n);
508
475
  return o.onDispose(this.on((i) => o.set(r(i)))), o.on((i) => this._setAndNotify(s(i), !1)), o;
509
476
  });
510
477
  /**
@@ -533,29 +500,83 @@ const V = class V extends h {
533
500
  * @param value - The value to check.
534
501
  * @returns `true` if the value is a Prop, `false` otherwise.
535
502
  */
536
- u(V, "is", (r) => (
503
+ u(q, "is", (r) => (
537
504
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
538
505
  r != null && r.$__prop__ === !0
539
506
  ));
540
- let F = V;
541
- const U = (t, e, r = (s, n) => s === n) => {
507
+ let F = q;
508
+ const z = (t, e, r = (s, n) => s === n) => {
542
509
  const s = new E(t, r);
543
510
  return e.forEach((n) => n.setDerivative(s)), s;
544
- }, $e = (...t) => (e, r) => {
511
+ }, je = (t, e) => z(t, e).dispose, V = (t, e = (r, s) => r === s) => new F(t, e), I = (t, e = (r, s) => r === s) => new h(t, e), d = {
512
+ /**
513
+ * Maps a value or a Signal to a new value.
514
+ * If the value is a Signal, it returns a new Signal with the mapped value.
515
+ * If the value is not a Signal, it returns the mapped value.
516
+ *
517
+ * @typeParam T - The type of the value.
518
+ * @typeParam U - The type of the new value.
519
+ * @param value - The value or Signal to map.
520
+ * @param fn - The function to map the value.
521
+ * @returns The mapped value.
522
+ */
523
+ map: (t, e) => h.is(t) ? t.map(e) : e(t),
524
+ /**
525
+ * Wraps a value or a Signal instance into a Signal.
526
+ * If the value is already a Signal, it returns the value itself.
527
+ * If the value is not a Signal, it creates a new Signal instance with the given value.
528
+ *
529
+ * @typeParam O - The type of the value.
530
+ * @param value - The value or Signal instance to wrap.
531
+ * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
532
+ * @returns A Signal instance.
533
+ */
534
+ toSignal: (t, e) => h.is(t) ? t : I(t, e),
535
+ /**
536
+ * Wraps a value in a `Signal` if it is not already a `Signal`.
537
+ * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
538
+ * @param value - The value to wrap or check.
539
+ * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
540
+ */
541
+ maybeToSignal: (t, e) => {
542
+ if (t != null)
543
+ return d.toSignal(t, e);
544
+ },
545
+ /**
546
+ * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
547
+ * @param value - The value or Signal instance to get the value from.
548
+ * @returns The value.
549
+ */
550
+ get: (t) => h.is(t) ? t.get() : t,
551
+ /**
552
+ * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
553
+ * @param value - The value or Signal instance to add the listener to.
554
+ * @param listener - The listener to call when the value changes.
555
+ * @returns A function to remove the listener.
556
+ */
557
+ on: (t, e) => h.is(t) ? t.on(e) : (e(t), () => {
558
+ }),
559
+ /**
560
+ * Disposes of a value or a Signal.
561
+ * If the value is a Signal, it disposes of the Signal.
562
+ * If the value is not a Signal, it does nothing.
563
+ * @param value - The value or Signal instance to dispose of.
564
+ */
565
+ dispose: (t) => {
566
+ h.is(t) && t.dispose();
567
+ }
568
+ }, At = (...t) => (e, r) => {
545
569
  const s = t.filter((n) => h.is(n));
546
- return U(
547
- () => e(...t.map((n) => h.unwrap(n))),
570
+ return z(
571
+ () => e(...t.map((n) => d.get(n))),
548
572
  s,
549
573
  r
550
574
  );
551
- }, Fe = (t, e) => U(t, e).dispose, gt = (...t) => (e) => {
575
+ }, Et = (...t) => (e) => {
552
576
  const r = t.filter((s) => h.is(s));
553
- Fe(
554
- () => e(...t.map(h.unwrap)),
555
- r
556
- );
557
- }, C = (t, e = (r, s) => r === s) => new F(t, e), G = (t, e = (r, s) => r === s) => new h(t, e);
558
- class Z {
577
+ je(() => e(...t.map(d.get)), r);
578
+ };
579
+ class ne {
559
580
  constructor() {
560
581
  u(this, "_store", /* @__PURE__ */ new Map());
561
582
  /**
@@ -574,7 +595,7 @@ class Z {
574
595
  });
575
596
  }
576
597
  }
577
- const K = ({
598
+ const oe = ({
578
599
  key: t,
579
600
  defaultValue: e,
580
601
  store: r,
@@ -587,57 +608,57 @@ const K = ({
587
608
  l != null ? i(n(l)) : typeof e == "function" ? e() : e,
588
609
  o
589
610
  );
590
- return a.on((c) => {
591
- r.setItem(t, s(c));
611
+ return a.on((f) => {
612
+ r.setItem(t, s(f));
592
613
  }), a;
593
- }, _t = (t) => K({
614
+ }, Pt = (t) => oe({
594
615
  ...t,
595
- store: (window == null ? void 0 : window.localStorage) ?? new Z()
596
- }), vt = (t) => K({
616
+ store: (window == null ? void 0 : window.localStorage) ?? new ne()
617
+ }), Dt = (t) => oe({
597
618
  ...t,
598
- store: (window == null ? void 0 : window.sessionStorage) ?? new Z()
619
+ store: (window == null ? void 0 : window.sessionStorage) ?? new ne()
599
620
  });
600
- function Y(t) {
621
+ function se(t) {
601
622
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
602
623
  }
603
- const Ve = (t, e, r, s) => {
604
- const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((y) => y), i = (s == null ? void 0 : s.equals) ?? ((y, N) => y === N);
605
- let l = s == null ? void 0 : s.interpolate, a = t, c = e(), d = performance.now(), v = null, m = !0;
606
- const D = new E(e, i), A = C(t, i);
624
+ const Ue = (t, e, r, s) => {
625
+ const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((_) => _), i = (s == null ? void 0 : s.equals) ?? ((_, R) => _ === R);
626
+ let l = s == null ? void 0 : s.interpolate, a = t, f = e(), g = performance.now(), w = null, U = !0;
627
+ const G = new E(e, i), A = V(t, i);
607
628
  A.onDispose(() => {
608
- v !== null && cancelAnimationFrame(v);
609
- }), A.onDispose(D.dispose), r.forEach((y) => {
610
- y.setDerivative(D), y.onDispose(A.dispose);
629
+ w !== null && cancelAnimationFrame(w);
630
+ }), A.onDispose(G.dispose), r.forEach((_) => {
631
+ _.setDerivative(G), _.onDispose(A.dispose);
611
632
  });
612
- const De = (y) => {
613
- c = y, d = performance.now(), a = A.value, m && (m = !1, v = Y(z));
614
- }, z = () => {
615
- const N = (performance.now() - d) / h.unwrap(n), be = o(N);
616
- l == null && (l = Re(a));
617
- let Q = l(a, c, be);
618
- N >= 1 ? (m = !0, Q = c) : v = Y(z), A.set(Q);
633
+ const Le = (_) => {
634
+ f = _, g = performance.now(), a = A.value, U && (U = !1, w = se(K));
635
+ }, K = () => {
636
+ const R = (performance.now() - g) / d.get(n), Ne = o(R);
637
+ l == null && (l = Ie(a));
638
+ let x = l(a, f, Ne);
639
+ R >= 1 ? (U = !0, x = f) : w = se(K), A.set(x);
619
640
  };
620
- return D.on(De), A;
621
- }, yt = (t, e) => {
641
+ return G.on(Le), A;
642
+ }, bt = (t, e) => {
622
643
  const { initialValue: r, ...s } = e ?? {};
623
- return Ve(
644
+ return Ue(
624
645
  r ?? t.get(),
625
646
  t.get,
626
647
  [t],
627
648
  s
628
649
  );
629
- }, wt = (t, e) => {
650
+ }, Tt = (t, e) => {
630
651
  const { signals: r, literals: s } = Object.entries(t).reduce(
631
652
  ({ signals: o, literals: i }, [l, a]) => (h.is(a) ? o.push([l, a]) : i[l] = a, { signals: o, literals: i }),
632
653
  { signals: [], literals: {} }
633
654
  ), n = r.map(([, o]) => o);
634
- return U(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
635
- }, x = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), ee = /* @__PURE__ */ new Set([
655
+ return z(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
656
+ }, ie = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), le = /* @__PURE__ */ new Set([
636
657
  "rowSpan",
637
658
  "colSpan",
638
659
  "tabIndex",
639
660
  "valueAsNumber"
640
- ]), te = /* @__PURE__ */ new Set(["valueAsDate"]), re = /* @__PURE__ */ new Set([
661
+ ]), ue = /* @__PURE__ */ new Set(["valueAsDate"]), ae = /* @__PURE__ */ new Set([
641
662
  "value",
642
663
  "textContent",
643
664
  "innerText",
@@ -645,25 +666,25 @@ const Ve = (t, e, r, s) => {
645
666
  "outerHTML",
646
667
  "className",
647
668
  "classList"
648
- ]), I = /* @__PURE__ */ new Map(), b = (t, e) => {
649
- if (I.has(t))
650
- return I.get(t);
669
+ ]), H = /* @__PURE__ */ new Map(), b = (t, e) => {
670
+ if (H.has(t))
671
+ return H.get(t);
651
672
  {
652
673
  const r = e(t);
653
- return I.set(t, r), r;
674
+ return H.set(t, r), r;
654
675
  }
655
- }, qe = (t) => (e, r) => {
676
+ }, Ge = (t) => (e, r) => {
656
677
  r == null ? e[t] = null : e[t] = !!r;
657
- }, Ie = (t) => (e, r) => {
678
+ }, Je = (t) => (e, r) => {
658
679
  r == null ? e[t] = null : e[t] = Number(r);
659
- }, Be = (t) => (e, r) => {
680
+ }, He = (t) => (e, r) => {
660
681
  r == null ? e[t] = null : e[t] = r;
661
- }, je = (t) => (e, r) => {
682
+ }, We = (t) => (e, r) => {
662
683
  r == null ? e[t] = null : e[t] = String(r);
663
- }, Ue = (t) => (e, r) => {
684
+ }, Xe = (t) => (e, r) => {
664
685
  r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
665
- }, se = (t) => x.has(t) ? b(t, qe) : ee.has(t) ? b(t, Ie) : te.has(t) ? b(t, Be) : re.has(t) ? b(t, je) : b(t, Ue), ne = (t) => (e) => x.has(t) ? !!e[t] : ee.has(t) ? Number(e[t]) : te.has(t) ? e[t] : re.has(t) ? String(e[t]) : e.getAttribute(t);
666
- class w {
686
+ }, ce = (t) => ie.has(t) ? b(t, Ge) : le.has(t) ? b(t, Je) : ue.has(t) ? b(t, He) : ae.has(t) ? b(t, We) : b(t, Xe), fe = (t) => (e) => ie.has(t) ? !!e[t] : le.has(t) ? Number(e[t]) : ue.has(t) ? e[t] : ae.has(t) ? String(e[t]) : e.getAttribute(t);
687
+ class v {
667
688
  /**
668
689
  * Constructs a new `DOMContext` instance.
669
690
  *
@@ -711,18 +732,18 @@ class w {
711
732
  * @param document - The `Document` to use for the `DOMContext`.
712
733
  * @returns A new `DOMContext` instance.
713
734
  */
714
- u(this, "withDocument", (e) => new w(e, this.element, this.reference, this.providers, !0));
735
+ u(this, "withDocument", (e) => new v(e, this.element, this.reference, this.providers, !0));
715
736
  /**
716
737
  * Creates a new `DOMContext` instance with the provided `element`.
717
738
  * @param element - The DOM element to use in the new `DOMContext` instance.
718
739
  * @returns A new `DOMContext` instance with the provided `element`.
719
740
  */
720
- u(this, "withElement", (e) => new w(this.document, e, void 0, this.providers, !1));
741
+ u(this, "withElement", (e) => new v(this.document, e, void 0, this.providers, !1));
721
742
  /**
722
743
  * Creates a new `DOMContext` instance with the `isFirstLevel` property set to `true`.
723
744
  * @returns A new `DOMContext` instance with the `isFirstLevel` property set to `true`.
724
745
  */
725
- u(this, "withFirstLevel", () => new w(
746
+ u(this, "withFirstLevel", () => new v(
726
747
  this.document,
727
748
  this.element,
728
749
  this.reference,
@@ -735,7 +756,7 @@ class w {
735
756
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
736
757
  * @returns A new `DOMContext` instance with the specified reference.
737
758
  */
738
- u(this, "withReference", (e) => new w(
759
+ u(this, "withReference", (e) => new v(
739
760
  this.document,
740
761
  this.element,
741
762
  e,
@@ -748,7 +769,7 @@ class w {
748
769
  * @param value - The value to set for the provider.
749
770
  * @returns A new DOMContext with the updated providers.
750
771
  */
751
- u(this, "withProvider", (e, r) => new w(
772
+ u(this, "withProvider", (e, r) => new v(
752
773
  this.document,
753
774
  this.element,
754
775
  this.reference,
@@ -765,7 +786,7 @@ class w {
765
786
  * @param providers - An object containing the providers to be merged into the existing providers.
766
787
  * @returns A new DOMContext instance with the merged providers.
767
788
  */
768
- u(this, "withProviders", (e) => new w(
789
+ u(this, "withProviders", (e) => new v(
769
790
  this.document,
770
791
  this.element,
771
792
  this.reference,
@@ -784,7 +805,7 @@ class w {
784
805
  */
785
806
  u(this, "getProvider", (e) => {
786
807
  if (this.providers[e] === void 0)
787
- throw new Ge(e);
808
+ throw new ze(e);
788
809
  return this.providers[e];
789
810
  });
790
811
  this.document = e, this.element = r, this.reference = s, this.providers = n, this.isFirstLevel = o;
@@ -797,41 +818,41 @@ class w {
797
818
  * @returns A new `DOMContext` instance.
798
819
  */
799
820
  static of(e, r) {
800
- return new w(e.ownerDocument, e, r, {}, !0);
821
+ return new v(e.ownerDocument, e, r, {}, !0);
801
822
  }
802
823
  }
803
- class Ge extends Error {
824
+ class ze extends Error {
804
825
  constructor(e) {
805
826
  super(`Provider not found: ${e.description}`);
806
827
  }
807
828
  }
808
- const _ = (t) => {
829
+ const m = (t) => {
809
830
  const e = t;
810
831
  e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
811
- }, Je = (t) => oe(t) ? t : t.parentElement, oe = (t) => t.nodeType === 1, ie = (t) => (e) => {
812
- pe(e);
832
+ }, Qe = (t) => he(t) ? t : t.parentElement, he = (t) => t.nodeType === 1, de = (t) => (e) => {
833
+ we(e);
813
834
  const r = e.createText(t);
814
835
  return e.appendOrInsert(r), (s) => {
815
- s && _(r);
836
+ s && m(r);
816
837
  };
817
- }, le = (t) => (e) => {
818
- pe(e);
838
+ }, pe = (t) => (e) => {
839
+ we(e);
819
840
  const r = e.createText(t.value);
820
841
  e.appendOrInsert(r);
821
842
  const s = t.on((n) => r.data = n);
822
843
  return (n) => {
823
- s(), n && _(r);
844
+ s(), n && m(r);
824
845
  };
825
- }, St = (t) => h.is(t) ? le(t) : ie(t), g = (...t) => (e) => {
826
- const r = t.map((s) => f(s)(e));
846
+ }, Ot = (t) => h.is(t) ? pe(t) : de(t), p = (...t) => (e) => {
847
+ const r = t.map((s) => c(s)(e));
827
848
  return (s) => {
828
849
  r.forEach((n) => n(s));
829
850
  };
830
851
  }, S = () => () => {
831
- }, We = (t) => (e) => (he(e), e.element.classList.add(...t), (r) => {
852
+ }, Ye = (t) => (e) => (ye(e), e.element.classList.add(...t), (r) => {
832
853
  r && e.element.classList.remove(...t);
833
- }), He = (t) => (e) => {
834
- he(e);
854
+ }), Ze = (t) => (e) => {
855
+ ye(e);
835
856
  const r = e.element;
836
857
  let s = [];
837
858
  const n = t.on((o) => {
@@ -840,19 +861,19 @@ const _ = (t) => {
840
861
  return (o) => {
841
862
  n(), o && s.forEach((i) => r.classList.remove(i)), s.length = 0;
842
863
  };
843
- }, L = (t, e) => {
844
- const r = se(t), s = ne(t);
864
+ }, k = (t, e) => {
865
+ const r = ce(t), s = fe(t);
845
866
  return (n) => {
846
- fe(n, t);
867
+ ve(n, t);
847
868
  const o = s(n.element);
848
869
  return r(n.element, e), (i) => {
849
870
  i && r(n.element, o);
850
871
  };
851
872
  };
852
- }, O = (t, e) => {
853
- const r = se(t), s = ne(t);
873
+ }, L = (t, e) => {
874
+ const r = ce(t), s = fe(t);
854
875
  return (n) => {
855
- fe(n, t);
876
+ ve(n, t);
856
877
  const o = s(n.element), i = e.on((l) => r(n.element, l));
857
878
  return (l) => {
858
879
  i(), l && r(n.element, o);
@@ -872,17 +893,17 @@ const _ = (t) => {
872
893
  * @returns The renderable component for the specified attribute.
873
894
  *
874
895
  */
875
- get: (t, e) => e === "class" ? (r) => h.is(r) ? He(r) : We(
896
+ get: (t, e) => e === "class" ? (r) => h.is(r) ? Ze(r) : Ye(
876
897
  (r ?? "").split(" ").filter((s) => s.length > 0)
877
- ) : (r) => h.is(r) ? O(
898
+ ) : (r) => h.is(r) ? L(
878
899
  e,
879
900
  r
880
- ) : L(
901
+ ) : k(
881
902
  e,
882
903
  r
883
904
  )
884
905
  }
885
- ), At = new Proxy(
906
+ ), Ct = new Proxy(
886
907
  {},
887
908
  {
888
909
  /**
@@ -893,12 +914,12 @@ const _ = (t) => {
893
914
  * @returns The renderable component for the specified attribute.
894
915
  *
895
916
  */
896
- get: (t, e) => (r) => h.is(r) ? O(
917
+ get: (t, e) => (r) => h.is(r) ? L(
897
918
  `data-${e}`,
898
919
  r
899
- ) : L(`data-${e}`, r)
920
+ ) : k(`data-${e}`, r)
900
921
  }
901
- ), Et = new Proxy(
922
+ ), kt = new Proxy(
902
923
  {},
903
924
  {
904
925
  /**
@@ -909,15 +930,15 @@ const _ = (t) => {
909
930
  * @returns The renderable component for the specified attribute.
910
931
  *
911
932
  */
912
- get: (t, e) => (r) => h.is(r) ? O(
933
+ get: (t, e) => (r) => h.is(r) ? L(
913
934
  `aria-${e}`,
914
935
  r
915
- ) : L(
936
+ ) : k(
916
937
  `aria-${e}`,
917
938
  r
918
939
  )
919
940
  }
920
- ), Pt = new Proxy(
941
+ ), Lt = new Proxy(
921
942
  {},
922
943
  {
923
944
  /**
@@ -928,15 +949,15 @@ const _ = (t) => {
928
949
  * @returns The renderable component for the specified attribute.
929
950
  *
930
951
  */
931
- get: (t, e) => (r) => h.is(r) ? O(
952
+ get: (t, e) => (r) => h.is(r) ? L(
932
953
  e,
933
954
  r
934
- ) : L(
955
+ ) : k(
935
956
  e,
936
957
  r
937
958
  )
938
959
  }
939
- ), Dt = new Proxy(
960
+ ), Nt = new Proxy(
940
961
  {},
941
962
  {
942
963
  /**
@@ -946,29 +967,29 @@ const _ = (t) => {
946
967
  * @returns The renderable component for the specified attribute.
947
968
  *
948
969
  */
949
- get: (t, e) => (r) => h.is(r) ? O(
970
+ get: (t, e) => (r) => h.is(r) ? L(
950
971
  e,
951
972
  r
952
- ) : L(
973
+ ) : k(
953
974
  e,
954
975
  r
955
976
  )
956
977
  }
957
- ), f = (t) => t == null ? S : Array.isArray(t) ? g(...t.map(f)) : typeof t == "string" ? ie(t) : h.is(t) ? le(t) : t, ue = (t, ...e) => (r) => {
978
+ ), c = (t) => t == null ? S : Array.isArray(t) ? p(...t.map(c)) : typeof t == "string" ? de(t) : h.is(t) ? pe(t) : t, me = (t, ...e) => (r) => {
958
979
  const s = r.createElement(t, void 0);
959
- r.isFirstLevel && k() && de(s), r.appendOrInsert(s), r = r.withElement(s);
960
- const n = e.map((o) => f(o)(r));
980
+ r.isFirstLevel && N() && Se(s), r.appendOrInsert(s), r = r.withElement(s);
981
+ const n = e.map((o) => c(o)(r));
961
982
  return (o) => {
962
- n.forEach((i) => i(!1)), o && _(s);
983
+ n.forEach((i) => i(!1)), o && m(s);
963
984
  };
964
- }, ae = (t, e, ...r) => (s) => {
985
+ }, ge = (t, e, ...r) => (s) => {
965
986
  const n = s.createElement(t, e);
966
- s.isFirstLevel && k() && de(n), s.appendOrInsert(n), s = s.withElement(n);
967
- const o = r.map((i) => f(i)(s));
987
+ s.isFirstLevel && N() && Se(n), s.appendOrInsert(n), s = s.withElement(n);
988
+ const o = r.map((i) => c(i)(s));
968
989
  return (i) => {
969
- o.forEach((l) => l(!1)), i && _(n);
990
+ o.forEach((l) => l(!1)), i && m(n);
970
991
  };
971
- }, bt = new Proxy(
992
+ }, Rt = new Proxy(
972
993
  {},
973
994
  {
974
995
  /**
@@ -976,9 +997,9 @@ const _ = (t) => {
976
997
  * @param tagName - The HTML tag name.
977
998
  * @returns A renderable function that creates and appends the HTML element to the DOM.
978
999
  */
979
- get: (t, e) => (...r) => ue(e, r.flatMap(f))
1000
+ get: (t, e) => (...r) => me(e, r.flatMap(c))
980
1001
  }
981
- ), Tt = new Proxy(
1002
+ ), Mt = new Proxy(
982
1003
  {},
983
1004
  {
984
1005
  /**
@@ -986,9 +1007,9 @@ const _ = (t) => {
986
1007
  * @param type - The input type name.
987
1008
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
988
1009
  */
989
- get: (t, e) => (...r) => ue("input", P.type(e), ...r)
1010
+ get: (t, e) => (...r) => me("input", P.type(e), ...r)
990
1011
  }
991
- ), Xe = "http://www.w3.org/2000/svg", Ct = new Proxy(
1012
+ ), Ke = "http://www.w3.org/2000/svg", $t = new Proxy(
992
1013
  {},
993
1014
  {
994
1015
  /**
@@ -996,9 +1017,9 @@ const _ = (t) => {
996
1017
  * @param tagName - The SVG tag name.
997
1018
  * @returns A renderable function that creates and appends the SVG element to the DOM.
998
1019
  */
999
- get: (t, e) => (...r) => ae(e, Xe, r.flatMap(f))
1020
+ get: (t, e) => (...r) => ge(e, Ke, r.flatMap(c))
1000
1021
  }
1001
- ), ze = "http://www.w3.org/1998/Math/MathML", Lt = new Proxy(
1022
+ ), xe = "http://www.w3.org/1998/Math/MathML", Ft = new Proxy(
1002
1023
  {},
1003
1024
  {
1004
1025
  /**
@@ -1006,108 +1027,108 @@ const _ = (t) => {
1006
1027
  * @param tagName - The Math tag name.
1007
1028
  * @returns A renderable function that creates and appends the Math element to the DOM.
1008
1029
  */
1009
- get: (t, e) => (...r) => ae(e, ze, r.flatMap(f))
1030
+ get: (t, e) => (...r) => ge(e, xe, r.flatMap(c))
1010
1031
  }
1011
- ), T = "data-tempo-attr", M = "data-tempo-class", ce = "data-tempo-node", $ = "data-tempo-text", Qe = (t, e) => {
1032
+ ), O = "data-tempo-attr", M = "data-tempo-class", _e = "data-tempo-node", $ = "data-tempo-text", et = (t, e) => {
1012
1033
  const r = t.getAttribute(e);
1013
1034
  if (r != null) {
1014
- const s = t.getAttribute(T) ?? "{}", n = { ...JSON.parse(s), name: r };
1035
+ const s = t.getAttribute(O) ?? "{}", n = { ...JSON.parse(s), name: r };
1015
1036
  t.setAttribute(
1016
- T,
1037
+ O,
1017
1038
  JSON.stringify(n).replace(/"/g, "&quot;")
1018
1039
  );
1019
1040
  }
1020
- }, fe = (t, e) => {
1021
- k() && t.isFirstLevel && Qe(t.element, e);
1022
- }, Ye = (t) => {
1023
- t.querySelectorAll(`[${T}]`).forEach((e) => {
1041
+ }, ve = (t, e) => {
1042
+ N() && t.isFirstLevel && et(t.element, e);
1043
+ }, tt = (t) => {
1044
+ t.querySelectorAll(`[${O}]`).forEach((e) => {
1024
1045
  const r = JSON.parse(
1025
- (e.getAttribute(T) ?? "{}").replace(/&quot;/g, '"')
1046
+ (e.getAttribute(O) ?? "{}").replace(/&quot;/g, '"')
1026
1047
  );
1027
1048
  for (const [s, n] of Object.entries(r))
1028
1049
  e.setAttribute(s, n);
1029
- e.removeAttribute(T);
1050
+ e.removeAttribute(O);
1030
1051
  });
1031
1052
  };
1032
- function Ze(t) {
1053
+ function rt(t) {
1033
1054
  t.setAttribute(M, t.className);
1034
1055
  }
1035
- const he = (t) => {
1036
- k() && t.isFirstLevel && Ze(t.element);
1037
- }, Ke = (t) => {
1056
+ const ye = (t) => {
1057
+ N() && t.isFirstLevel && rt(t.element);
1058
+ }, st = (t) => {
1038
1059
  t.querySelectorAll(`[${M}]`).forEach((e) => {
1039
1060
  const r = e.getAttribute(M);
1040
1061
  r !== null && (e.className = r, e.removeAttribute(M));
1041
1062
  });
1042
- }, de = (t) => {
1043
- t.setAttribute(ce, "");
1044
- }, xe = (t) => {
1045
- t.querySelectorAll(`[${ce}]`).forEach((e) => {
1046
- _(e);
1063
+ }, Se = (t) => {
1064
+ t.setAttribute(_e, "");
1065
+ }, nt = (t) => {
1066
+ t.querySelectorAll(`[${_e}]`).forEach((e) => {
1067
+ m(e);
1047
1068
  });
1048
- }, et = (t) => {
1069
+ }, ot = (t) => {
1049
1070
  t.setAttribute($, t.textContent ?? "");
1050
- }, pe = (t) => {
1051
- k() && t.isFirstLevel && et(t.element);
1052
- }, tt = (t) => {
1071
+ }, we = (t) => {
1072
+ N() && t.isFirstLevel && ot(t.element);
1073
+ }, it = (t) => {
1053
1074
  t.querySelectorAll(`[${$}]`).forEach((e) => {
1054
1075
  e.textContent = e.getAttribute($), e.removeAttribute($);
1055
1076
  });
1056
- }, rt = (t) => {
1057
- xe(t), Ke(t), Ye(t), tt(t);
1058
- }, me = () => {
1077
+ }, lt = (t) => {
1078
+ nt(t), st(t), tt(t), it(t);
1079
+ }, Ae = () => {
1059
1080
  const t = globalThis;
1060
1081
  return t.__tempoSSR__ == null && (t.__tempoSSR__ = {
1061
1082
  isSSR: !1,
1062
1083
  counter: 0
1063
1084
  }), t.__tempoSSR__;
1064
- }, J = (t, e) => {
1065
- const r = me();
1085
+ }, Q = (t, e) => {
1086
+ const r = Ae();
1066
1087
  r[t] = e;
1067
- }, ge = (t) => me()[t], B = (t) => {
1068
- J("isSSR", t);
1069
- }, W = () => ge("counter"), st = () => {
1070
- J("counter", (W() ?? 0) + 1);
1071
- }, nt = () => {
1072
- J("counter", (W() ?? 0) - 1);
1073
- }, Ot = (t = 30) => (B(!0), new Promise((e, r) => {
1088
+ }, Ee = (t) => Ae()[t], W = (t) => {
1089
+ Q("isSSR", t);
1090
+ }, Y = () => Ee("counter"), ut = () => {
1091
+ Q("counter", (Y() ?? 0) + 1);
1092
+ }, at = () => {
1093
+ Q("counter", (Y() ?? 0) - 1);
1094
+ }, Vt = (t = 30) => (W(!0), new Promise((e, r) => {
1074
1095
  let s;
1075
1096
  const n = setInterval(() => {
1076
- W() <= 0 && (clearInterval(n), clearTimeout(s), B(!1), e());
1097
+ Y() <= 0 && (clearInterval(n), clearTimeout(s), W(!1), e());
1077
1098
  }, 30);
1078
1099
  s = setTimeout(() => {
1079
- clearInterval(n), B(!1), r(new Error("SSR Timeout"));
1100
+ clearInterval(n), W(!1), r(new Error("SSR Timeout"));
1080
1101
  }, t * 1e3);
1081
- })), kt = (t) => (st(), f(t(nt))), k = () => ge("isSSR"), _e = (t, e) => {
1102
+ })), qt = (t) => (ut(), c(t(at))), N = () => Ee("isSSR"), Pe = (t, e) => {
1082
1103
  if (typeof e == "function")
1083
- return _e(t, { then: e });
1084
- const r = e.pending != null ? f(e.pending) : S, s = e.then, n = e.error != null ? (o) => f(e.error(o)) : () => S;
1104
+ return Pe(t, { then: e });
1105
+ const r = e.pending != null ? c(e.pending) : S, s = e.then, n = e.error != null ? (o) => c(e.error(o)) : () => S;
1085
1106
  return (o) => {
1086
1107
  let i = !0;
1087
1108
  const l = t();
1088
1109
  o = o.makeRef();
1089
- let a = f(r)(o);
1110
+ let a = c(r)(o);
1090
1111
  return l.then(
1091
- (c) => {
1092
- i && (a(!0), a = f(s(c))(o));
1112
+ (f) => {
1113
+ i && (a(!0), a = c(s(f))(o));
1093
1114
  },
1094
- (c) => {
1095
- i && (a(!0), a = f(n(c))(o));
1115
+ (f) => {
1116
+ i && (a(!0), a = c(n(f))(o));
1096
1117
  }
1097
- ), (c) => {
1098
- i = !1, a(c), c && o.reference && _(o.reference);
1118
+ ), (f) => {
1119
+ i = !1, a(f), f && o.reference && m(o.reference);
1099
1120
  };
1100
1121
  };
1101
- }, Nt = (t, e) => _e(() => t, e), ve = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1122
+ }, It = (t, e) => Pe(() => t, e), De = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
1102
1123
  s && r.element.removeEventListener(t, e);
1103
- }), ot = (t) => ve("click", (e) => {
1124
+ }), ct = (t) => De("click", (e) => {
1104
1125
  e.preventDefault();
1105
1126
  const r = e.target;
1106
1127
  setTimeout(() => {
1107
1128
  const s = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
1108
1129
  s != null && t(!s);
1109
1130
  }, 0);
1110
- }), q = new Proxy(
1131
+ }), B = new Proxy(
1111
1132
  {},
1112
1133
  {
1113
1134
  /**
@@ -1115,15 +1136,15 @@ const he = (t) => {
1115
1136
  * @param fn - The function to call when the event is triggered.
1116
1137
  * @returns A `Renderable` function that adds the event listener to the element.
1117
1138
  */
1118
- get: (t, e) => (r) => ve(e, r)
1139
+ get: (t, e) => (r) => De(e, r)
1119
1140
  }
1120
- ), it = (t) => (e) => {
1141
+ ), ft = (t) => (e) => {
1121
1142
  const r = e.target;
1122
1143
  t(r.value);
1123
- }, lt = (t) => (e) => {
1144
+ }, ht = (t) => (e) => {
1124
1145
  const r = e.target;
1125
1146
  t(r.valueAsNumber);
1126
- }, ut = (t) => (e) => {
1147
+ }, dt = (t) => (e) => {
1127
1148
  const r = e.target;
1128
1149
  if (r.value === "")
1129
1150
  return;
@@ -1133,7 +1154,7 @@ const he = (t) => {
1133
1154
  Number(s[2].substring(0, 2))
1134
1155
  );
1135
1156
  t(n);
1136
- }, at = (t) => (e) => {
1157
+ }, pt = (t) => (e) => {
1137
1158
  const r = e.target;
1138
1159
  if (r.value === "")
1139
1160
  return;
@@ -1143,57 +1164,57 @@ const he = (t) => {
1143
1164
  Number(n[2])
1144
1165
  ), i = s[1].split(":");
1145
1166
  o.setHours(Number(i[0])), o.setMinutes(Number(i[1])), o.setSeconds(Number(i[2])), t(o);
1146
- }, Rt = (t) => (e) => {
1167
+ }, Bt = (t) => (e) => {
1147
1168
  const r = e.target;
1148
1169
  t(r.checked);
1149
- }, Mt = (t) => (e) => {
1170
+ }, jt = (t) => (e) => {
1150
1171
  e.preventDefault(), t();
1151
- }, $t = (t) => (e) => {
1172
+ }, Ut = (t) => (e) => {
1152
1173
  e.stopPropagation(), t();
1153
- }, Ft = (t) => (e) => {
1174
+ }, Gt = (t) => (e) => {
1154
1175
  e.stopImmediatePropagation(), t();
1155
- }, Vt = (t, e = "input") => g(
1176
+ }, Jt = (t, e = "input") => p(
1156
1177
  P.valueAsDate(t),
1157
- q[e](ut(t.set))
1158
- ), qt = (t, e = "input") => g(
1178
+ B[e](dt(t.set))
1179
+ ), Ht = (t, e = "input") => p(
1159
1180
  P.valueAsDate(t),
1160
- q[e](at(t.set))
1161
- ), It = (t, e = "input") => g(
1181
+ B[e](pt(t.set))
1182
+ ), Wt = (t, e = "input") => p(
1162
1183
  P.valueAsNumber(t),
1163
- q[e](lt(t.set))
1164
- ), Bt = (t, e = "input") => g(P.value(t), q[e](it(t.set))), jt = (t) => g(P.checked(t), ot(t.set)), H = (t, e) => {
1184
+ B[e](ht(t.set))
1185
+ ), Xt = (t, e = "input") => p(P.value(t), B[e](ft(t.set))), zt = (t) => p(P.checked(t), ct(t.set)), Z = (t, e) => {
1165
1186
  if (h.is(t))
1166
1187
  return (s) => {
1167
1188
  s = s.makeRef();
1168
1189
  let n, o;
1169
- const i = t.map((c) => Object.keys(c)[0]);
1190
+ const i = t.map((f) => Object.keys(f)[0]);
1170
1191
  let l;
1171
- const a = i.on((c) => {
1172
- if (c !== l) {
1173
- o == null || o.dispose(), n == null || n(!0), o = t.map((v) => v[c]);
1174
- const d = e[c](o);
1175
- n = f(d)(s), l = c;
1192
+ const a = i.on((f) => {
1193
+ if (f !== l) {
1194
+ o == null || o.dispose(), n == null || n(!0), o = t.map((w) => w[f]);
1195
+ const g = e[f](o);
1196
+ n = c(g)(s), l = f;
1176
1197
  }
1177
1198
  });
1178
- return (c) => {
1179
- a(), c && s.reference != null && _(s.reference), n == null || n(!0);
1199
+ return (f) => {
1200
+ a(), f && s.reference != null && m(s.reference), n == null || n(!0);
1180
1201
  };
1181
1202
  };
1182
1203
  const r = Object.keys(t)[0];
1183
- return f(e[r](G(t[r])));
1184
- }, ye = (t, e, r) => H(
1185
- h.map(t, (s) => ({ [s[e]]: s })),
1204
+ return c(e[r](I(t[r])));
1205
+ }, be = (t, e, r) => Z(
1206
+ d.map(t, (s) => ({ [s[e]]: s })),
1186
1207
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1187
1208
  r
1188
- ), Ut = (t, e) => ye(t, "kind", e), Gt = (t, e) => {
1189
- const r = h.map(t, ([s, n]) => ({ [s]: n }));
1190
- return H(r, e);
1191
- }, Jt = (t, e) => ye(t, "type", e), X = (t, e) => H(
1192
- h.map(t, (r) => ({ [r]: !0 })),
1209
+ ), Qt = (t, e) => be(t, "kind", e), Yt = (t, e) => {
1210
+ const r = d.map(t, ([s, n]) => ({ [s]: n }));
1211
+ return Z(r, e);
1212
+ }, Zt = (t, e) => be(t, "type", e), mt = (t, e) => Z(
1213
+ d.map(t, (r) => ({ [r]: !0 })),
1193
1214
  e
1194
- ), Wt = (t, e = {}) => (r) => {
1215
+ ), Kt = (t, e = {}) => (r) => {
1195
1216
  const s = (e == null ? void 0 : e.firstSeparator) ?? t, n = (e == null ? void 0 : e.lastSeparator) ?? t;
1196
- return X(
1217
+ return mt(
1197
1218
  r.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
1198
1219
  {
1199
1220
  first: () => s,
@@ -1201,15 +1222,15 @@ const he = (t) => {
1201
1222
  other: () => t
1202
1223
  }
1203
1224
  );
1204
- }, we = (t, e) => (r) => {
1225
+ }, Te = (t, e) => (r) => {
1205
1226
  const s = Object.values(t).reduce((n, o) => {
1206
1227
  const i = r.getProvider(o);
1207
1228
  if (i == null)
1208
1229
  throw new Error(`No provider found for mark: ${o.description}`);
1209
1230
  return n[o] = i, n;
1210
1231
  }, {});
1211
- return f(e(s))(r);
1212
- }, Ht = (t, e) => (r) => {
1232
+ return c(e(s))(r);
1233
+ }, xt = (t, e) => (r) => {
1213
1234
  const s = [], n = Object.entries(t).reduce(
1214
1235
  (o, [i, l]) => (s.push(
1215
1236
  l((a) => (Reflect.set(o, i, a), null))(r)
@@ -1219,97 +1240,96 @@ const he = (t) => {
1219
1240
  return s.push(e(n)(r)), (o) => {
1220
1241
  s.forEach((i) => i(o));
1221
1242
  };
1222
- }, Xt = (t, e) => we([t], (r) => f(e(r[t]))), zt = (t, e) => we(t, (r) => f(e(r))), Qt = (t) => (e) => t(e), Yt = (t) => (e) => (e.appendOrInsert(t), (r) => {
1223
- r && _(t);
1224
- }), ct = (t, e, r) => {
1243
+ }, er = (t, e) => Te([t], (r) => c(e(r[t]))), tr = (t, e) => Te(t, (r) => c(e(r))), rr = (t) => (e) => t(e), sr = (t) => (e) => (e.appendOrInsert(t), (r) => {
1244
+ r && m(t);
1245
+ }), gt = (t, e, r) => {
1225
1246
  if (h.is(t)) {
1226
1247
  const s = t;
1227
1248
  return (n) => {
1228
1249
  n = n.makeRef();
1229
1250
  let o = null, i = !1;
1230
- const l = C(null), a = s.on((c) => {
1231
- c == null ? (o == null || o(!0), o = f((r == null ? void 0 : r()) ?? S)(n), i = !1) : (l.value = c, i || (o == null || o(!0), o = f(e(l))(n), i = !0));
1251
+ const l = V(null), a = s.on((f) => {
1252
+ f == null ? (o == null || o(!0), o = c((r == null ? void 0 : r()) ?? S)(n), i = !1) : (l.value = f, i || (o == null || o(!0), o = c(e(l))(n), i = !0));
1232
1253
  });
1233
- return (c) => {
1234
- a(), o == null || o(c), c && n.reference && _(n.reference);
1254
+ return (f) => {
1255
+ a(), o == null || o(f), f && n.reference && m(n.reference);
1235
1256
  };
1236
1257
  };
1237
1258
  } else {
1238
1259
  const s = t;
1239
1260
  if (s == null) {
1240
1261
  const n = r == null ? void 0 : r();
1241
- return n != null ? f(n) : S;
1262
+ return n != null ? c(n) : S;
1242
1263
  }
1243
- return f(e(G(s)));
1264
+ return c(e(I(s)));
1244
1265
  }
1245
- }, j = (t) => (e) => (r) => t(r, e), Se = (t, e, r) => r != null ? Se(t, (s) => {
1246
- const n = s.map((i) => new R(i.index, i.total - 1)), o = s.map((i) => i.isLast ? "last" : "other");
1247
- return g(
1248
- j(() => {
1249
- n.dispose(), o.dispose();
1250
- }),
1251
- f(e(s)),
1252
- X(o, {
1253
- last: () => S,
1254
- other: () => r(n)
1255
- })
1266
+ }, X = (t) => (e) => (r) => t(r, e), j = (t, e, r) => gt(
1267
+ d.map(t, (s) => s ? !0 : null),
1268
+ () => e,
1269
+ r != null ? () => r : void 0
1270
+ ), nr = (t, e, r) => j(
1271
+ d.map(t, (s) => !s),
1272
+ e,
1273
+ r
1274
+ ), Oe = (t, e, r) => r != null ? Oe(t, (s) => {
1275
+ const n = new T(
1276
+ s.index,
1277
+ s.total.map((o) => o - 1)
1278
+ );
1279
+ return p(
1280
+ X(n.dispose),
1281
+ c(e(s)),
1282
+ j(s.isLast, S, r(n))
1256
1283
  );
1257
1284
  }) : h.is(t) ? (s) => {
1258
1285
  s = s.makeRef();
1259
- const n = t.map(
1260
- (a) => Array.from({ length: a }, (c, d) => d).map(
1261
- (c) => new R(c, a)
1262
- )
1263
- ), o = [], i = [], l = n.on((a) => {
1264
- var d, v;
1265
- const c = a.length;
1266
- for (; c < o.length; )
1267
- (d = o.pop()) == null || d(!0), (v = i.pop()) == null || v.dispose();
1268
- for (let m = 0; m < c; m++)
1269
- if (i[m] == null) {
1270
- i[m] = C(a[m]);
1271
- const D = f(e(i[m]));
1272
- o[m] = D(s);
1273
- } else
1274
- i[m].value = a[m];
1286
+ const n = Array.from(
1287
+ { length: t.value },
1288
+ (l, a) => a
1289
+ ).map((l) => new T(l, t)), o = n.map(
1290
+ (l) => c(e(l))(s)
1291
+ ), i = t.on((l) => {
1292
+ for (; l < o.length; )
1293
+ o.pop()(!0), n.pop().dispose();
1294
+ for (let a = 0; a < l; a++)
1295
+ if (n[a] == null) {
1296
+ n[a] = new T(a, t);
1297
+ const f = c(e(n[a]));
1298
+ o[a] = f(s);
1299
+ }
1275
1300
  });
1276
- return (a) => {
1277
- l(), a && s.reference && _(s.reference);
1301
+ return (l) => {
1302
+ i(), l && s.reference && m(s.reference);
1278
1303
  };
1279
- } : g(
1304
+ } : p(
1280
1305
  ...Array.from({ length: t }, (s, n) => n).map(
1281
- (s) => f(e(G(new R(s, t))))
1306
+ (s) => c(e(new T(s, I(t))))
1282
1307
  )
1283
- ), ft = (t, e, r) => r != null ? ft(t, (s, n) => {
1284
- const o = n.map((l) => new R(l.index, l.total - 1)), i = n.map((l) => l.isLast ? "last" : "other");
1285
- return g([
1286
- j(() => {
1287
- i.dispose(), o.dispose();
1288
- }),
1289
- f(e(s, n)),
1290
- X(i, {
1291
- last: () => S,
1292
- other: () => r(o)
1293
- })
1308
+ ), _t = (t, e, r) => r != null ? _t(t, (s, n) => {
1309
+ const o = new T(
1310
+ n.index,
1311
+ n.total.map((i) => i - 1)
1312
+ );
1313
+ return p([
1314
+ X(o.dispose),
1315
+ c(e(s, n)),
1316
+ j(n.isLast, S, r(o))
1294
1317
  ]);
1295
1318
  }) : (s) => {
1296
- const n = h.map(t, (o) => o.length);
1297
- return Se(n, (o) => {
1298
- const i = $e(
1299
- o,
1300
- t
1301
- )((l, a) => a[l.index]);
1302
- return g(
1303
- j(() => i.dispose()),
1304
- f(e(i, o))
1319
+ const n = d.map(t, (i) => i.length), o = d.toSignal(t);
1320
+ return Oe(n, (i) => {
1321
+ const l = o.map((a) => a[i.index]);
1322
+ return p(
1323
+ X(l.dispose),
1324
+ c(e(l, i))
1305
1325
  );
1306
1326
  })(s);
1307
- }, Zt = (t, e) => {
1327
+ }, or = (t, e) => {
1308
1328
  if (h.is(t)) {
1309
1329
  const r = t;
1310
1330
  return (s) => {
1311
1331
  s = s.makeRef();
1312
- const n = r.map((l) => f(e(l)));
1332
+ const n = r.map((l) => c(e(l)));
1313
1333
  let o = () => {
1314
1334
  };
1315
1335
  const i = n.on((l) => {
@@ -1320,57 +1340,49 @@ const he = (t) => {
1320
1340
  };
1321
1341
  };
1322
1342
  }
1323
- return f(e(t));
1324
- }, Ae = (t, e, r) => ct(
1325
- h.map(t, (s) => s ? !0 : null),
1326
- () => e,
1327
- r != null ? () => r : void 0
1328
- ), Kt = (t, e, r) => Ae(
1329
- h.map(t, (s) => !s),
1330
- e,
1331
- r
1332
- ), xt = (t, e, r = S) => Ae(
1333
- h.map(t, (s) => s.length > 0),
1343
+ return c(e(t));
1344
+ }, ir = (t, e, r = S) => j(
1345
+ d.map(t, (s) => s.length > 0),
1334
1346
  e,
1335
1347
  r
1336
- ), er = (t) => (e) => t(e.element) ?? (() => {
1337
- }), Ee = (t, e) => {
1348
+ ), lr = (t) => (e) => t(e.element) ?? (() => {
1349
+ }), Ce = (t, e) => {
1338
1350
  const r = t(e);
1339
1351
  return () => r(!0);
1340
- }, tr = (t, e, { doc: r, clear: s } = {}) => {
1352
+ }, ur = (t, e, { doc: r, clear: s } = {}) => {
1341
1353
  const n = typeof e == "string" ? (r ?? document).querySelector(e) : e;
1342
1354
  if (n === null)
1343
- throw new ht(
1355
+ throw new vt(
1344
1356
  `Cannot find element by selector for render: ${e}`
1345
1357
  );
1346
- s !== !1 && (r ?? n.ownerDocument) != null && rt(r ?? n.ownerDocument);
1347
- const o = Je(n), i = oe(n) ? void 0 : n, l = w.of(o, i);
1348
- return Ee(t, l);
1358
+ s !== !1 && (r ?? n.ownerDocument) != null && lt(r ?? n.ownerDocument);
1359
+ const o = Qe(n), i = he(n) ? void 0 : n, l = v.of(o, i);
1360
+ return Ce(t, l);
1349
1361
  };
1350
- class ht extends Error {
1362
+ class vt extends Error {
1351
1363
  constructor(e) {
1352
1364
  super(e);
1353
1365
  }
1354
1366
  }
1355
- const rr = (t, e) => (r) => {
1367
+ const ar = (t, e) => (r) => {
1356
1368
  const s = r.document.querySelector(t);
1357
1369
  if (s === null)
1358
1370
  throw new Error(`Cannot find element by selector for portal: ${t}`);
1359
- return Ee(
1360
- f(e),
1371
+ return Ce(
1372
+ c(e),
1361
1373
  r.withElement(s).withFirstLevel()
1362
1374
  );
1363
- }, sr = (t) => Symbol(t), Pe = (t, e) => (r) => f(e)(r.withProviders(t)), nr = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : f, or = (t, e, r) => Pe({ [t]: e }, f(r)), ir = (t, e) => Pe(t, f(e)), dt = (t, e) => (r) => {
1375
+ }, cr = (t) => Symbol(t), ke = (t, e) => (r) => c(e)(r.withProviders(t)), fr = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : c, hr = (t, e, r) => ke({ [t]: e }, c(r)), dr = (t, e) => ke(t, c(e)), yt = (t, e) => (r) => {
1364
1376
  const s = r.element, n = s.style.getPropertyValue(t);
1365
1377
  return s.style.setProperty(t, e), (o) => {
1366
1378
  o && s.style.setProperty(t, n);
1367
1379
  };
1368
- }, pt = (t, e) => (r) => {
1380
+ }, St = (t, e) => (r) => {
1369
1381
  const s = r.element, n = s.style.getPropertyValue(t);
1370
1382
  return e.on((o) => s.style.setProperty(t, o)), (o) => {
1371
1383
  o && s.style.setProperty(t, n);
1372
1384
  };
1373
- }, lr = new Proxy(
1385
+ }, pr = new Proxy(
1374
1386
  {},
1375
1387
  {
1376
1388
  /**
@@ -1381,115 +1393,116 @@ const rr = (t, e) => (r) => {
1381
1393
  * @returns The renderable component for the specified attribute.
1382
1394
  *
1383
1395
  */
1384
- get: (t, e) => (r) => h.is(r) ? pt(e, r) : dt(e, r)
1396
+ get: (t, e) => (r) => h.is(r) ? St(e, r) : yt(e, r)
1385
1397
  }
1386
1398
  );
1387
1399
  export {
1388
- Nt as Async,
1389
- jt as BindChecked,
1390
- Vt as BindDate,
1391
- qt as BindDateTime,
1392
- It as BindNumber,
1393
- Bt as BindText,
1400
+ It as Async,
1401
+ zt as BindChecked,
1402
+ Jt as BindDate,
1403
+ Ht as BindDateTime,
1404
+ Wt as BindNumber,
1405
+ Xt as BindText,
1394
1406
  E as Computed,
1395
- Wt as Conjunction,
1396
- w as DOMContext,
1397
- Yt as DOMNode,
1398
- ue as El,
1399
- ae as ElNS,
1400
- R as ElementPosition,
1407
+ Kt as Conjunction,
1408
+ v as DOMContext,
1409
+ sr as DOMNode,
1410
+ me as El,
1411
+ ge as ElNS,
1412
+ T as ElementPosition,
1401
1413
  S as Empty,
1402
- ct as Ensure,
1403
- ft as ForEach,
1404
- g as Fragment,
1405
- Zt as MapSignal,
1406
- Z as MemoryStore,
1407
- xt as NotEmpty,
1408
- ot as OnChecked,
1409
- Qt as OnCtx,
1410
- er as OnMount,
1411
- j as OnUnmount,
1412
- H as OneOf,
1413
- ye as OneOfField,
1414
- Ut as OneOfKind,
1415
- Gt as OneOfTuple,
1416
- Jt as OneOfType,
1417
- X as OneOfValue,
1418
- rr as Portal,
1414
+ gt as Ensure,
1415
+ _t as ForEach,
1416
+ p as Fragment,
1417
+ or as MapSignal,
1418
+ ne as MemoryStore,
1419
+ ir as NotEmpty,
1420
+ ct as OnChecked,
1421
+ rr as OnCtx,
1422
+ lr as OnMount,
1423
+ X as OnUnmount,
1424
+ Z as OneOf,
1425
+ be as OneOfField,
1426
+ Qt as OneOfKind,
1427
+ Yt as OneOfTuple,
1428
+ Zt as OneOfType,
1429
+ mt as OneOfValue,
1430
+ ar as Portal,
1419
1431
  F as Prop,
1420
- nr as Provide,
1421
- Ge as ProviderNotFoundError,
1422
- ht as RenderingError,
1423
- Se as Repeat,
1432
+ fr as Provide,
1433
+ ze as ProviderNotFoundError,
1434
+ vt as RenderingError,
1435
+ Oe as Repeat,
1424
1436
  h as Signal,
1425
- _e as Task,
1426
- St as TextNode,
1427
- Kt as Unless,
1428
- Ht as Use,
1429
- Xt as UseProvider,
1430
- zt as UseProviders,
1431
- kt as UseSSRDone,
1432
- Ae as When,
1433
- or as WithProvider,
1434
- ir as WithProviders,
1435
- de as _addNodeTracker,
1436
- rt as _clearSSR,
1437
- Je as _getSelfOrParentElement,
1438
- oe as _isElement,
1439
- ne as _makeGetter,
1440
- se as _makeSetter,
1441
- fe as _maybeAddAttributeTracker,
1442
- he as _maybeAddClassTracker,
1443
- pe as _maybeAddTextTracker,
1444
- _ as _removeDOMNode,
1445
- Ue as _setAttribute,
1446
- qe as _setBooleanProperty,
1447
- Be as _setDateProperty,
1448
- Ie as _setNumberProperty,
1449
- je as _setStringProperty,
1450
- le as _signalText,
1451
- ie as _staticText,
1452
- yt as animateSignal,
1453
- Ve as animateSignals,
1454
- Et as aria,
1437
+ Pe as Task,
1438
+ Ot as TextNode,
1439
+ nr as Unless,
1440
+ xt as Use,
1441
+ er as UseProvider,
1442
+ tr as UseProviders,
1443
+ qt as UseSSRDone,
1444
+ d as Value,
1445
+ j as When,
1446
+ hr as WithProvider,
1447
+ dr as WithProviders,
1448
+ Se as _addNodeTracker,
1449
+ lt as _clearSSR,
1450
+ Qe as _getSelfOrParentElement,
1451
+ he as _isElement,
1452
+ fe as _makeGetter,
1453
+ ce as _makeSetter,
1454
+ ve as _maybeAddAttributeTracker,
1455
+ ye as _maybeAddClassTracker,
1456
+ we as _maybeAddTextTracker,
1457
+ m as _removeDOMNode,
1458
+ Xe as _setAttribute,
1459
+ Ge as _setBooleanProperty,
1460
+ He as _setDateProperty,
1461
+ Je as _setNumberProperty,
1462
+ We as _setStringProperty,
1463
+ pe as _signalText,
1464
+ de as _staticText,
1465
+ bt as animateSignal,
1466
+ Ue as animateSignals,
1467
+ kt as aria,
1455
1468
  P as attr,
1456
- At as dataAttr,
1457
- Rt as emitChecked,
1458
- Mt as emitPreventDefault,
1459
- Ft as emitStopImmediatePropagation,
1460
- $t as emitStopPropagation,
1461
- it as emitValue,
1462
- ut as emitValueAsDate,
1463
- at as emitValueAsDateTime,
1464
- lt as emitValueAsNumber,
1465
- Ne as endInterpolate,
1466
- Re as guessInterpolate,
1467
- bt as html,
1468
- Tt as input,
1469
- ke as interpolateDate,
1470
- Le as interpolateNumber,
1471
- Oe as interpolateString,
1472
- k as isSSR,
1473
- _t as localStorageProp,
1474
- U as makeComputed,
1475
- $e as makeComputedOf,
1476
- wt as makeComputedRecord,
1477
- Fe as makeEffect,
1478
- gt as makeEffectOf,
1479
- C as makeProp,
1480
- sr as makeProviderMark,
1481
- G as makeSignal,
1482
- Lt as math,
1483
- Dt as mathAttr,
1484
- q as on,
1485
- Ot as prepareSSR,
1486
- tt as removeTextTrackers,
1487
- tr as render,
1488
- Ee as renderWithContext,
1489
- f as renderableOfTNode,
1490
- vt as sessionStorageProp,
1491
- K as storedProp,
1492
- lr as style,
1493
- Ct as svg,
1494
- Pt as svgAttr
1469
+ Ct as dataAttr,
1470
+ Bt as emitChecked,
1471
+ jt as emitPreventDefault,
1472
+ Gt as emitStopImmediatePropagation,
1473
+ Ut as emitStopPropagation,
1474
+ ft as emitValue,
1475
+ dt as emitValueAsDate,
1476
+ pt as emitValueAsDateTime,
1477
+ ht as emitValueAsNumber,
1478
+ qe as endInterpolate,
1479
+ Ie as guessInterpolate,
1480
+ Rt as html,
1481
+ Mt as input,
1482
+ Ve as interpolateDate,
1483
+ $e as interpolateNumber,
1484
+ Fe as interpolateString,
1485
+ N as isSSR,
1486
+ Pt as localStorageProp,
1487
+ z as makeComputed,
1488
+ At as makeComputedOf,
1489
+ Tt as makeComputedRecord,
1490
+ je as makeEffect,
1491
+ Et as makeEffectOf,
1492
+ V as makeProp,
1493
+ cr as makeProviderMark,
1494
+ I as makeSignal,
1495
+ Ft as math,
1496
+ Nt as mathAttr,
1497
+ B as on,
1498
+ Vt as prepareSSR,
1499
+ it as removeTextTrackers,
1500
+ ur as render,
1501
+ Ce as renderWithContext,
1502
+ c as renderableOfTNode,
1503
+ Dt as sessionStorageProp,
1504
+ oe as storedProp,
1505
+ pr as style,
1506
+ $t as svg,
1507
+ Lt as svgAttr
1495
1508
  };