@tempots/dom 25.1.3 → 26.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,12 +1,12 @@
1
- var ke = Object.defineProperty;
2
- var te = (s) => {
1
+ var Ne = Object.defineProperty;
2
+ var se = (s) => {
3
3
  throw TypeError(s);
4
4
  };
5
- var Ie = (s, e, t) => e in s ? ke(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
- var o = (s, e, t) => Ie(s, typeof e != "symbol" ? e + "" : e, t), se = (s, e, t) => e.has(s) || te("Cannot " + t);
7
- var X = (s, e, t) => (se(s, e, "read from private field"), t ? t.call(s) : e.get(s)), re = (s, e, t) => e.has(s) ? te("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), ne = (s, e, t, r) => (se(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
8
- const Ne = (s, e, t) => s + (e - s) * t;
9
- const Re = (s, e, t) => {
5
+ var $e = (s, e, t) => e in s ? Ne(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
+ var o = (s, e, t) => $e(s, typeof e != "symbol" ? e + "" : e, t), re = (s, e, t) => e.has(s) || se("Cannot " + t);
7
+ var X = (s, e, t) => (re(s, e, "read from private field"), t ? t.call(s) : e.get(s)), ne = (s, e, t) => e.has(s) ? se("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), ie = (s, e, t, r) => (re(s, e, "write to private field"), r ? r.call(s, t) : e.set(s, t), t);
8
+ const Ie = (s, e, t) => s + (e - s) * t;
9
+ const ke = (s, e, t) => {
10
10
  const r = Math.max(s.length, e.length);
11
11
  let n = "";
12
12
  for (let i = 0; i < r; i++) {
@@ -16,8 +16,8 @@ const Re = (s, e, t) => {
16
16
  isNaN(c) && (c = 97), n += String.fromCharCode(l + (c - l) * t);
17
17
  }
18
18
  return n;
19
- }, Ve = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), je = (s, e) => e, qe = (s) => typeof s == "number" ? Ne : typeof s == "string" ? Re : s instanceof Date ? Ve : je;
20
- var D;
19
+ }, Re = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), Ve = (s, e) => e, je = (s) => typeof s == "number" ? Ie : typeof s == "string" ? ke : s instanceof Date ? Re : Ve;
20
+ var M;
21
21
  class Y {
22
22
  /**
23
23
  * Creates a new instance of `ElementPosition`.
@@ -44,7 +44,7 @@ class Y {
44
44
  * @returns `true` if the counter is odd, `false` otherwise.
45
45
  */
46
46
  o(this, "isOdd");
47
- re(this, D);
47
+ ne(this, M);
48
48
  o(this, "dispose", () => {
49
49
  this.total.dispose();
50
50
  });
@@ -55,10 +55,10 @@ class Y {
55
55
  * @returns `true` if the element is the last element, `false` otherwise.
56
56
  */
57
57
  get isLast() {
58
- return X(this, D) == null && ne(this, D, this.total.map((e) => this.counter === e)), X(this, D);
58
+ return X(this, M) == null && ie(this, M, this.total.map((e) => this.counter === e)), X(this, M);
59
59
  }
60
60
  }
61
- D = new WeakMap();
61
+ M = new WeakMap();
62
62
  const H = class H {
63
63
  /**
64
64
  * Represents a signal with a value of type T.
@@ -124,6 +124,7 @@ const H = class H {
124
124
  * @internal
125
125
  */
126
126
  o(this, "_setAndNotify", (e, t) => {
127
+ if (this._disposed) return;
127
128
  const r = this._value, n = this.equals(r, e);
128
129
  n || (this._value = e), (t || !n) && this._onValueListeners.forEach((i) => i(e, r));
129
130
  });
@@ -160,7 +161,7 @@ const H = class H {
160
161
  * @returns - A new Computed instance with the mapped value.
161
162
  */
162
163
  o(this, "map", (e, t = (r, n) => r === n) => {
163
- const r = new L(() => {
164
+ const r = new x(() => {
164
165
  try {
165
166
  return e(this.get());
166
167
  } catch (n) {
@@ -180,7 +181,7 @@ const H = class H {
180
181
  * @returns A new Signal that emits the values of the resulting Signal.
181
182
  */
182
183
  o(this, "flatMap", (e, t = (r, n) => r === n) => {
183
- const r = new L(() => {
184
+ const r = new x(() => {
184
185
  try {
185
186
  return e(this.get()).get();
186
187
  } catch (n) {
@@ -209,7 +210,7 @@ const H = class H {
209
210
  o(this, "_$");
210
211
  o(this, "filter", (e, t) => {
211
212
  let r = t ?? this.get();
212
- const n = new L(() => {
213
+ const n = new x(() => {
213
214
  try {
214
215
  const i = this.get();
215
216
  return r = e(i) ? i : r;
@@ -231,7 +232,7 @@ const H = class H {
231
232
  */
232
233
  o(this, "filterMap", (e, t, r = (n, i) => n === i) => {
233
234
  let n = t;
234
- const i = new L(() => {
235
+ const i = new x(() => {
235
236
  try {
236
237
  const l = this.get(), c = e(l);
237
238
  return n = c ?? n;
@@ -255,21 +256,21 @@ const H = class H {
255
256
  * @returns A property that holds the mapped value and can be observed for changes.
256
257
  */
257
258
  o(this, "mapAsync", (e, t, r, n = (i, l) => i === l) => {
258
- const i = v(t, n);
259
+ const i = w(t, n);
259
260
  let l = 0, c = new AbortController();
260
261
  return i.onDispose(
261
- this.on(async (a) => {
262
+ this.on(async (u) => {
262
263
  const h = ++l;
263
264
  c.abort(), c = new AbortController();
264
265
  try {
265
- const u = await e(a, { abortSignal: c.signal });
266
- h === l && i.set(u);
267
- } catch (u) {
266
+ const a = await e(u, { abortSignal: c.signal });
267
+ h === l && i.set(a);
268
+ } catch (a) {
268
269
  if (h === l)
269
270
  if (r != null)
270
- i.set(r(u));
271
+ i.set(r(a));
271
272
  else
272
- throw u;
273
+ throw a;
273
274
  }
274
275
  })
275
276
  ), i;
@@ -305,7 +306,7 @@ const H = class H {
305
306
  o(this, "deriveProp", ({
306
307
  autoDisposeProp: e = !0,
307
308
  equals: t
308
- } = {}) => this.feedProp(v(this.get(), t), e));
309
+ } = {}) => this.feedProp(w(this.get(), t), e));
309
310
  /**
310
311
  * Derives a new signal from the current signal. Useful to create a new signal that emits the same values as the current signal but can be disposed independently.
311
312
  * @returns A new signal that emits the same values as the current signal.
@@ -381,8 +382,8 @@ o(H, "is", (e) => (
381
382
  e != null && e.$__signal__ === !0
382
383
  ));
383
384
  let d = H;
384
- const Fe = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
385
- class L extends d {
385
+ const qe = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
386
+ class x extends d {
386
387
  /**
387
388
  * Represents a Signal object.
388
389
  * @param _fn - The function that returns the value of the signal.
@@ -417,8 +418,8 @@ class L extends d {
417
418
  */
418
419
  o(this, "_scheduleNotify", () => {
419
420
  const t = ++this._scheduleCount;
420
- Fe(() => {
421
- this._scheduleCount !== t || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
421
+ qe(() => {
422
+ this._scheduleCount !== t || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
422
423
  });
423
424
  });
424
425
  /** {@inheritDoc Signal.get} */
@@ -439,7 +440,7 @@ class L extends d {
439
440
  return this.get();
440
441
  }
441
442
  }
442
- const U = class U extends d {
443
+ const W = class W extends d {
443
444
  constructor() {
444
445
  super(...arguments);
445
446
  /**
@@ -471,8 +472,8 @@ const U = class U extends d {
471
472
  const n = this;
472
473
  return function i(l) {
473
474
  const c = n.value;
474
- n.update((a) => t(a, l)), !n.equals(c, n.value) && r.forEach(
475
- (a) => a({
475
+ n.update((u) => t(u, l)), !n.equals(c, n.value) && r.forEach(
476
+ (u) => u({
476
477
  previousState: c,
477
478
  state: n.value,
478
479
  action: l,
@@ -493,7 +494,7 @@ const U = class U extends d {
493
494
  * @returns A Prop object representing the isomorphism.
494
495
  */
495
496
  o(this, "iso", (t, r, n = (i, l) => i === l) => {
496
- const i = new U(t(this.get()), n);
497
+ const i = new W(t(this.get()), n);
497
498
  return i.onDispose(this.on((l) => i.set(t(l)))), i.on((l) => this._setAndNotify(r(l), !1)), i;
498
499
  });
499
500
  /**
@@ -522,15 +523,15 @@ const U = class U extends d {
522
523
  * @param value - The value to check.
523
524
  * @returns `true` if the value is a Prop, `false` otherwise.
524
525
  */
525
- o(U, "is", (t) => (
526
+ o(W, "is", (t) => (
526
527
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
527
528
  t != null && t.$__prop__ === !0
528
529
  ));
529
- let N = U;
530
+ let k = W;
530
531
  const z = (s, e, t = (r, n) => r === n) => {
531
- const r = new L(s, t);
532
+ const r = new x(s, t);
532
533
  return e.forEach((n) => n.setDerivative(r)), r;
533
- }, Be = (s, e, t = {}) => {
534
+ }, Fe = (s, e, t = {}) => {
534
535
  let r = t.once ? () => {
535
536
  i(), s();
536
537
  } : s;
@@ -545,7 +546,7 @@ const z = (s, e, t = (r, n) => r === n) => {
545
546
  n.dispose(), t.abortSignal != null && t.abortSignal.removeEventListener("abort", i);
546
547
  };
547
548
  return t.abortSignal != null && t.abortSignal.addEventListener("abort", i), i;
548
- }, v = (s, e = (t, r) => t === r) => new N(s, e), W = (s, e = (t, r) => t === r) => new d(s, e), oe = () => typeof window < "u" ? window : void 0, y = {
549
+ }, w = (s, e = (t, r) => t === r) => new k(s, e), U = (s, e = (t, r) => t === r) => new d(s, e), le = () => typeof window < "u" ? window : void 0, y = {
549
550
  /**
550
551
  * Maps a value or a Signal to a new value.
551
552
  * If the value is a Signal, it returns a new Signal with the mapped value.
@@ -568,7 +569,7 @@ const z = (s, e, t = (r, n) => r === n) => {
568
569
  * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
569
570
  * @returns A Signal instance.
570
571
  */
571
- toSignal: (s, e) => d.is(s) ? s : W(s, e),
572
+ toSignal: (s, e) => d.is(s) ? s : U(s, e),
572
573
  /**
573
574
  * Wraps a value in a `Signal` if it is not already a `Signal`.
574
575
  * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
@@ -615,23 +616,28 @@ const z = (s, e, t = (r, n) => r === n) => {
615
616
  deriveProp: (s, {
616
617
  autoDisposeProp: e = !0,
617
618
  equals: t
618
- } = {}) => d.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : v(s, t)
619
- }, Ht = (...s) => (e, t) => {
619
+ } = {}) => d.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : w(s, t)
620
+ }, Be = (...s) => (e, t) => {
620
621
  const r = s.filter((n) => d.is(n));
621
622
  return z(
622
623
  () => e(...s.map((n) => y.get(n))),
623
624
  r,
624
625
  t
625
626
  );
626
- }, $t = (...s) => (e, t = {}) => {
627
+ }, Ht = (s) => {
628
+ const e = Object.keys(s);
629
+ return Be(...Object.values(s))(
630
+ (...t) => Object.fromEntries(e.map((r, n) => [r, t[n]]))
631
+ );
632
+ }, Nt = (...s) => (e, t = {}) => {
627
633
  const r = s.filter((n) => d.is(n));
628
- return Be(
634
+ return Fe(
629
635
  () => e(...s.map(y.get)),
630
636
  r,
631
637
  t
632
638
  );
633
639
  };
634
- class le {
640
+ class ce {
635
641
  constructor() {
636
642
  o(this, "_store", /* @__PURE__ */ new Map());
637
643
  /**
@@ -650,59 +656,59 @@ class le {
650
656
  });
651
657
  }
652
658
  }
653
- const ce = ({
659
+ const ue = ({
654
660
  key: s,
655
661
  defaultValue: e,
656
662
  store: t,
657
663
  serialize: r = JSON.stringify,
658
664
  deserialize: n = JSON.parse,
659
- equals: i = (c, a) => c === a,
665
+ equals: i = (c, u) => c === u,
660
666
  onLoad: l = (c) => c
661
667
  }) => {
662
- const c = t.getItem(s), a = new N(
668
+ const c = t.getItem(s), u = new k(
663
669
  c != null ? l(n(c)) : typeof e == "function" ? e() : e,
664
670
  i
665
671
  );
666
- return a.on((h) => {
672
+ return u.on((h) => {
667
673
  t.setItem(s, r(h));
668
- }), a;
669
- }, kt = (s) => {
674
+ }), u;
675
+ }, $t = (s) => {
670
676
  var e;
671
- return ce({
677
+ return ue({
672
678
  ...s,
673
- store: ((e = oe()) == null ? void 0 : e.localStorage) ?? new le()
679
+ store: ((e = le()) == null ? void 0 : e.localStorage) ?? new ce()
674
680
  });
675
681
  }, It = (s) => {
676
682
  var e;
677
- return ce({
683
+ return ue({
678
684
  ...s,
679
- store: ((e = oe()) == null ? void 0 : e.sessionStorage) ?? new le()
685
+ store: ((e = le()) == null ? void 0 : e.sessionStorage) ?? new ce()
680
686
  });
681
687
  };
682
- function ie(s) {
688
+ function oe(s) {
683
689
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
684
690
  }
685
- const Ue = (s, e, t, r) => {
686
- const n = (r == null ? void 0 : r.duration) ?? 300, i = (r == null ? void 0 : r.easing) ?? ((A) => A), l = (r == null ? void 0 : r.equals) ?? ((A, I) => A === I);
687
- let c = r == null ? void 0 : r.interpolate, a = s, h = e(), u = performance.now(), m = null, T = !0;
688
- const p = new L(e, l), g = v(s, l);
691
+ const We = (s, e, t, r) => {
692
+ const n = (r == null ? void 0 : r.duration) ?? 300, i = (r == null ? void 0 : r.easing) ?? ((S) => S), l = (r == null ? void 0 : r.equals) ?? ((S, I) => S === I);
693
+ let c = r == null ? void 0 : r.interpolate, u = s, h = e(), a = performance.now(), m = null, b = !0;
694
+ const p = new x(e, l), g = w(s, l);
689
695
  g.onDispose(() => {
690
696
  m !== null && cancelAnimationFrame(m);
691
- }), g.onDispose(p.dispose), t.forEach((A) => {
692
- A.setDerivative(p), A.onDispose(g.dispose);
697
+ }), g.onDispose(p.dispose), t.forEach((S) => {
698
+ S.setDerivative(p), S.onDispose(g.dispose);
693
699
  });
694
- const w = (A) => {
695
- h = A, u = performance.now(), a = g.value, T && (T = !1, m = ie(K));
696
- }, K = () => {
697
- const I = (performance.now() - u) / y.get(n), $e = i(I);
698
- c == null && (c = qe(a));
699
- let ee = c(a, h, $e);
700
- I >= 1 ? (T = !0, ee = h) : m = ie(K), g.set(ee);
700
+ const C = (S) => {
701
+ h = S, a = performance.now(), u = g.value, b && (b = !1, m = oe(ee));
702
+ }, ee = () => {
703
+ const I = (performance.now() - a) / y.get(n), He = i(I);
704
+ c == null && (c = je(u));
705
+ let te = c(u, h, He);
706
+ I >= 1 ? (b = !0, te = h) : m = oe(ee), g.set(te);
701
707
  };
702
- return p.on(w), g;
703
- }, Nt = (s, e) => {
708
+ return p.on(C), g;
709
+ }, kt = (s, e) => {
704
710
  const { initialValue: t, ...r } = e ?? {};
705
- return Ue(
711
+ return We(
706
712
  t ?? s.get(),
707
713
  s.get,
708
714
  [s],
@@ -710,16 +716,16 @@ const Ue = (s, e, t, r) => {
710
716
  );
711
717
  }, Rt = (s, e) => {
712
718
  const { signals: t, literals: r } = Object.entries(s).reduce(
713
- ({ signals: i, literals: l }, [c, a]) => (d.is(a) ? i.push([c, a]) : l[c] = a, { signals: i, literals: l }),
719
+ ({ signals: i, literals: l }, [c, u]) => (d.is(u) ? i.push([c, u]) : l[c] = u, { signals: i, literals: l }),
714
720
  { signals: [], literals: {} }
715
721
  ), n = t.map(([, i]) => i);
716
722
  return z(() => (t.forEach(([i, l]) => r[i] = l.value), e(r)), n);
717
- }, ae = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), ue = /* @__PURE__ */ new Set(["selected"]), he = /* @__PURE__ */ new Set([
723
+ }, ae = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), he = /* @__PURE__ */ new Set(["selected"]), fe = /* @__PURE__ */ new Set([
718
724
  "rowSpan",
719
725
  "colSpan",
720
726
  "tabIndex",
721
727
  "valueAsNumber"
722
- ]), fe = /* @__PURE__ */ new Set(["valueAsDate"]), de = /* @__PURE__ */ new Set([
728
+ ]), de = /* @__PURE__ */ new Set(["valueAsDate"]), pe = /* @__PURE__ */ new Set([
723
729
  "value",
724
730
  "textContent",
725
731
  "innerText",
@@ -727,28 +733,28 @@ const Ue = (s, e, t, r) => {
727
733
  "outerHTML",
728
734
  "className",
729
735
  "classList"
730
- ]), We = (s, e) => ue.has(s) ? (t) => {
736
+ ]), Ue = (s, e) => he.has(s) ? (t) => {
731
737
  t == null || t !== !0 ? e.removeAttribute(s) : e.setAttribute(s, "");
732
738
  } : ae.has(s) ? (t) => {
733
739
  t == null ? e[s] = null : e[s] = !!t;
734
- } : he.has(s) ? (t) => {
735
- t == null ? e[s] = null : e[s] = Number(t);
736
740
  } : fe.has(s) ? (t) => {
737
- t == null ? e[s] = null : e[s] = t;
741
+ t == null ? e[s] = null : e[s] = Number(t);
738
742
  } : de.has(s) ? (t) => {
743
+ t == null ? e[s] = null : e[s] = t;
744
+ } : pe.has(s) ? (t) => {
739
745
  t == null ? e[s] = null : e[s] = String(t);
740
746
  } : (t) => {
741
747
  t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
742
- }, Je = (s, e) => ue.has(s) ? () => e.hasAttribute(s) : ae.has(s) ? () => !!e[s] : he.has(s) ? () => Number(e[s]) : fe.has(s) ? () => e[s] : de.has(s) ? () => String(e[s]) : () => e.getAttribute(s), R = (s) => {
748
+ }, Je = (s, e) => he.has(s) ? () => e.hasAttribute(s) : ae.has(s) ? () => !!e[s] : fe.has(s) ? () => Number(e[s]) : de.has(s) ? () => e[s] : pe.has(s) ? () => String(e[s]) : () => e.getAttribute(s), R = (s) => {
743
749
  const e = s;
744
750
  e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentElement && s.parentElement.removeChild(s);
745
- }, Ge = (s) => pe(s) ? s : s.parentElement, pe = (s) => s.nodeType === 1;
746
- class ge extends Error {
751
+ }, Ge = (s) => ge(s) ? s : s.parentElement, ge = (s) => s.nodeType === 1;
752
+ class me extends Error {
747
753
  constructor(e) {
748
754
  super(`Provider not found: ${e.description}`);
749
755
  }
750
756
  }
751
- class x {
757
+ class L {
752
758
  /**
753
759
  * Constructs a new `DOMContext` instance.
754
760
  *
@@ -830,7 +836,7 @@ class x {
830
836
  * @param element - The DOM element to use in the new `DOMContext` instance.
831
837
  * @returns A new `DOMContext` instance with the provided `element`.
832
838
  */
833
- o(this, "withElement", (e) => new x(this.document, e, void 0, this.providers));
839
+ o(this, "withElement", (e) => new L(this.document, e, void 0, this.providers));
834
840
  /**
835
841
  * Creates a new `DOMContext` instance with a reference to a DOM element selected by the provided `selector`.
836
842
  * @param selector - The CSS selector for the target DOM element.
@@ -848,17 +854,17 @@ class x {
848
854
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
849
855
  * @returns A new `DOMContext` instance with the specified reference.
850
856
  */
851
- o(this, "withReference", (e) => new x(this.document, this.element, e, this.providers));
857
+ o(this, "withReference", (e) => new L(this.document, this.element, e, this.providers));
852
858
  /**
853
- * Returns a new HTMLDOMContext instance with the specified providers merged into
854
- * the existing providers.
859
+ * Sets a provider for the given provider mark.
855
860
  *
856
- * @param providers - An object containing the providers to be merged into the existing providers.
857
- * @returns A new HTMLDOMContext instance with the merged providers.
861
+ * @param mark - The provider mark to set the provider for.
862
+ * @param value - The provider to set for the given mark.
863
+ * @returns A new `DOMContext` instance with the specified provider.
858
864
  */
859
- o(this, "withProviders", (e) => new x(this.document, this.element, this.reference, {
865
+ o(this, "setProvider", (e, t) => new L(this.document, this.element, this.reference, {
860
866
  ...this.providers,
861
- ...e
867
+ [e]: t
862
868
  }));
863
869
  /**
864
870
  * Retrieves a provider for the given provider mark.
@@ -869,7 +875,7 @@ class x {
869
875
  */
870
876
  o(this, "getProvider", (e) => {
871
877
  if (this.providers[e] === void 0)
872
- throw new ge(e);
878
+ throw new me(e);
873
879
  return this.providers[e];
874
880
  });
875
881
  o(this, "clear", (e) => {
@@ -911,13 +917,24 @@ class x {
911
917
  /**
912
918
  * Returns `true` if the context is a browser DOM context.
913
919
  * @returns `true` if the context is a browser DOM context.
920
+ * @deprecated Use `isBrowser()` instead.
914
921
  */
915
922
  o(this, "isBrowserDOM", () => !0);
923
+ /**
924
+ * Returns `true` if the context is a browser context.
925
+ * @returns `true` if the context is a browser context.
926
+ */
927
+ o(this, "isBrowser", () => !0);
916
928
  /**
917
929
  * Returns `true` if the context is a headless DOM context.
918
930
  * @returns `true` if the context is a headless DOM context.
919
931
  */
920
932
  o(this, "isHeadlessDOM", () => !1);
933
+ /**
934
+ * Returns `true` if the context is a headless context.
935
+ * @returns `true` if the context is a headless context.
936
+ */
937
+ o(this, "isHeadless", () => !1);
921
938
  /**
922
939
  * Sets the style of the element.
923
940
  * @param name - The name of the style to set.
@@ -934,7 +951,7 @@ class x {
934
951
  o(this, "getStyle", (e) => this.element.style[e]);
935
952
  o(this, "makeAccessors", (e) => ({
936
953
  get: Je(e, this.element),
937
- set: We(e, this.element)
954
+ set: Ue(e, this.element)
938
955
  }));
939
956
  this.document = e, this.element = t, this.reference = r, this.providers = n;
940
957
  }
@@ -946,50 +963,50 @@ class x {
946
963
  * @returns A new `DOMContext` instance.
947
964
  */
948
965
  static of(e, t) {
949
- return new x(e.ownerDocument, e, t, {});
966
+ return new L(e.ownerDocument, e, t, {});
950
967
  }
951
968
  }
952
- const Q = (s, e) => {
969
+ const Xe = (s) => Symbol(s), Q = (s, e) => {
953
970
  const t = s(e);
954
971
  return (r = !0) => t(r);
955
972
  }, Vt = (s, e, { doc: t, clear: r, disposeWithParent: n = !0 } = {}) => {
956
973
  const i = typeof e == "string" ? (t ?? document).querySelector(e) : e;
957
974
  if (i === null)
958
- throw new Xe(
975
+ throw new Ye(
959
976
  `Cannot find element by selector for render: ${e}`
960
977
  );
961
978
  r !== !1 && (t ?? i.ownerDocument) != null && i.nodeType === 1 && (i.innerHTML = "");
962
- const l = Ge(i), c = pe(i) ? void 0 : i, a = x.of(l, c), h = Q(s, a);
963
- let u;
964
- return n && (u = new MutationObserver((m) => {
965
- var T;
966
- (T = m[0]) == null || T.removedNodes.forEach((p) => {
967
- p === i && (h(i.nodeType !== Node.ELEMENT_NODE), u == null || u.disconnect());
979
+ const l = Ge(i), c = ge(i) ? void 0 : i, u = L.of(l, c), h = Q(s, u);
980
+ let a;
981
+ return n && (a = new MutationObserver((m) => {
982
+ var b;
983
+ (b = m[0]) == null || b.removedNodes.forEach((p) => {
984
+ p === i && (h(i.nodeType !== Node.ELEMENT_NODE), a == null || a.disconnect());
968
985
  });
969
- }), u.observe(i.parentElement, {
986
+ }), a.observe(i.parentElement, {
970
987
  childList: !0,
971
988
  subtree: !1,
972
989
  attributes: !1
973
990
  })), () => {
974
- u == null || u.disconnect(), h(!0);
991
+ a == null || a.disconnect(), h(!0);
975
992
  };
976
993
  }, jt = (s, {
977
994
  startUrl: e = "https://example.com",
978
995
  selector: t = ":root"
979
996
  } = {}) => {
980
- const r = y.toSignal(e).deriveProp(), n = new Se(t, void 0), i = new O(n, void 0, { currentURL: r }, {});
997
+ const r = y.toSignal(e).deriveProp(), n = new Se(t, void 0), i = new D(n, void 0, { currentURL: r }, {});
981
998
  return {
982
999
  clear: Q(s(), i),
983
1000
  root: n,
984
1001
  currentURL: r
985
1002
  };
986
1003
  };
987
- class Xe extends Error {
1004
+ class Ye extends Error {
988
1005
  constructor(e) {
989
1006
  super(e);
990
1007
  }
991
1008
  }
992
- const me = "data-tts-node", V = "data-tts-class", j = "data-tts-style", q = "data-tts-html", F = "data-tts-text", B = "data-tts-attrs";
1009
+ const ye = "data-tts-node", V = "data-tts-class", j = "data-tts-style", q = "data-tts-html", F = "data-tts-text", B = "data-tts-attrs";
993
1010
  class qt {
994
1011
  constructor({
995
1012
  select: e,
@@ -999,11 +1016,11 @@ class qt {
999
1016
  setClass: i,
1000
1017
  getStyles: l,
1001
1018
  setStyles: c,
1002
- appendHTML: a,
1019
+ appendHTML: u,
1003
1020
  getInnerHTML: h,
1004
- setInnerHTML: u,
1021
+ setInnerHTML: a,
1005
1022
  getInnerText: m,
1006
- setInnerText: T
1023
+ setInnerText: b
1007
1024
  }) {
1008
1025
  /**
1009
1026
  * Selects elements from the headless environment.
@@ -1129,73 +1146,73 @@ class qt {
1129
1146
  const l = n.getAttributes();
1130
1147
  if (t) {
1131
1148
  const c = [];
1132
- l.forEach(([a]) => {
1133
- const h = this.getAttribute(i, a);
1134
- h != null && c.push([a, h]);
1149
+ l.forEach(([u]) => {
1150
+ const h = this.getAttribute(i, u);
1151
+ h != null && c.push([u, h]);
1135
1152
  }), c.length > 0 && this.setAttribute(
1136
1153
  i,
1137
1154
  B,
1138
1155
  JSON.stringify(Object.fromEntries(c))
1139
1156
  );
1140
1157
  }
1141
- l.forEach(([c, a]) => {
1142
- this.setAttribute(i, c, a);
1158
+ l.forEach(([c, u]) => {
1159
+ this.setAttribute(i, c, u);
1143
1160
  });
1144
1161
  }
1145
1162
  }
1146
1163
  });
1147
1164
  });
1148
- this.select = e, this.getAttribute = t, this.setAttribute = r, this.getClass = n, this.setClass = i, this.getStyles = l, this.setStyles = c, this.appendHTML = a, this.getInnerHTML = h, this.setInnerHTML = u, this.getInnerText = m, this.setInnerText = T;
1165
+ this.select = e, this.getAttribute = t, this.setAttribute = r, this.getClass = n, this.setClass = i, this.getStyles = l, this.setStyles = c, this.appendHTML = u, this.getInnerHTML = h, this.setInnerHTML = a, this.getInnerText = m, this.setInnerText = b;
1149
1166
  }
1150
1167
  }
1151
- const Ye = () => {
1152
- document.querySelectorAll(`[${me}]`).forEach(R);
1153
- }, ze = (s) => {
1168
+ const ze = () => {
1169
+ document.querySelectorAll(`[${ye}]`).forEach(R);
1170
+ }, Qe = (s) => {
1154
1171
  const e = s.getAttribute(V);
1155
1172
  s.removeAttribute(V), e != null && s.setAttribute("class", e);
1156
- }, Qe = () => {
1157
- document.querySelectorAll(`[${V}]`).forEach((e) => ze(e));
1158
- }, Ze = (s) => {
1173
+ }, Ze = () => {
1174
+ document.querySelectorAll(`[${V}]`).forEach((e) => Qe(e));
1175
+ }, Ke = (s) => {
1159
1176
  const e = s.getAttribute(q);
1160
1177
  s.removeAttribute(q), e != null && (s.innerHTML = e);
1161
- }, Ke = () => {
1162
- document.querySelectorAll(`[${q}]`).forEach((e) => Ze(e));
1163
- }, et = (s) => {
1178
+ }, et = () => {
1179
+ document.querySelectorAll(`[${q}]`).forEach((e) => Ke(e));
1180
+ }, tt = (s) => {
1164
1181
  const e = s.getAttribute(F);
1165
1182
  s.removeAttribute(F), e != null && (s.innerText = e);
1166
- }, tt = () => {
1167
- document.querySelectorAll(`[${F}]`).forEach((e) => et(e));
1168
- }, ye = (s) => JSON.parse(s.replace(/&quot;/g, '"')), st = (s) => {
1183
+ }, st = () => {
1184
+ document.querySelectorAll(`[${F}]`).forEach((e) => tt(e));
1185
+ }, be = (s) => JSON.parse(s.replace(/&quot;/g, '"')), rt = (s) => {
1169
1186
  const e = s.getAttribute(j);
1170
1187
  if (s.removeAttribute(j), e != null) {
1171
- const t = ye(e);
1188
+ const t = be(e);
1172
1189
  Object.entries(t).forEach(([r, n]) => {
1173
1190
  s.style.setProperty(r, n);
1174
1191
  });
1175
1192
  }
1176
- }, rt = () => {
1177
- document.querySelectorAll(`[${j}]`).forEach((e) => st(e));
1178
- }, nt = (s) => {
1193
+ }, nt = () => {
1194
+ document.querySelectorAll(`[${j}]`).forEach((e) => rt(e));
1195
+ }, it = (s) => {
1179
1196
  const e = s.getAttribute(B);
1180
1197
  if (s.removeAttribute(B), e != null) {
1181
- const t = ye(e);
1198
+ const t = be(e);
1182
1199
  Object.entries(t).forEach(([r, n]) => {
1183
1200
  n == null ? s.removeAttribute(r) : s.setAttribute(r, n);
1184
1201
  });
1185
1202
  }
1186
- }, it = () => {
1187
- document.querySelectorAll(`[${B}]`).forEach((e) => nt(e));
1203
+ }, ot = () => {
1204
+ document.querySelectorAll(`[${B}]`).forEach((e) => it(e));
1188
1205
  }, Ft = () => {
1189
- Ye(), Qe(), tt(), Ke(), rt(), it();
1190
- }, b = Symbol("class"), _ = Symbol("style"), C = Symbol("handler"), Te = () => Math.random().toString(36).substring(2, 15), ot = (s) => s.replace(/<[^>]*>?/g, "");
1191
- class be {
1206
+ ze(), Ze(), st(), et(), nt(), ot();
1207
+ }, T = Symbol("class"), E = Symbol("style"), P = Symbol("handler"), Te = () => Math.random().toString(36).substring(2, 15), lt = (s) => s.replace(/<[^>]*>?/g, "");
1208
+ class Ae {
1192
1209
  constructor(e) {
1193
1210
  o(this, "id", Te());
1194
1211
  o(this, "properties", {});
1195
1212
  o(this, "children", []);
1196
1213
  o(this, "isElement", () => !0);
1197
1214
  o(this, "isText", () => !1);
1198
- o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? ot(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
1215
+ o(this, "getText", () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? lt(this.properties.innerHTML) : this.children.map((e) => e.getText()).join(""));
1199
1216
  o(this, "removeChild", (e) => {
1200
1217
  const t = this.children.indexOf(e);
1201
1218
  t !== -1 && this.children.splice(t, 1);
@@ -1216,10 +1233,10 @@ class be {
1216
1233
  o(this, "getInnerText", () => this.properties.innerText ?? "");
1217
1234
  o(this, "hasInnerText", () => this.properties.innerText != null);
1218
1235
  o(this, "hasChildren", () => this.children.length > 0);
1219
- o(this, "hasClasses", () => this.properties[b] != null);
1220
- o(this, "hasStyles", () => this.properties[_] != null);
1236
+ o(this, "hasClasses", () => this.properties[T] != null);
1237
+ o(this, "hasStyles", () => this.properties[E] != null);
1221
1238
  o(this, "hasAttributes", () => Object.keys(this.properties).length > 0);
1222
- o(this, "hasHandlers", () => this.properties[C] != null);
1239
+ o(this, "hasHandlers", () => this.properties[P] != null);
1223
1240
  o(this, "hasRenderableProperties", () => this.hasClasses() || this.hasAttributes() || this.hasStyles());
1224
1241
  o(this, "getById", (e) => {
1225
1242
  if (this.properties.id === e)
@@ -1231,20 +1248,20 @@ class be {
1231
1248
  }
1232
1249
  });
1233
1250
  o(this, "trigger", (e, t) => {
1234
- ((this.properties[C] ?? {})[e] ?? []).forEach((n) => n(t));
1251
+ ((this.properties[P] ?? {})[e] ?? []).forEach((n) => n(t));
1235
1252
  });
1236
1253
  o(this, "click", () => {
1237
1254
  this.trigger("click", {});
1238
1255
  });
1239
1256
  o(this, "on", (e, t, r) => {
1240
1257
  var c;
1241
- const n = (c = this.properties)[C] ?? (c[C] = {}), i = r != null && r.once ? (a) => {
1242
- l(), t(a);
1243
- } : (a) => t(a);
1258
+ const n = (c = this.properties)[P] ?? (c[P] = {}), i = r != null && r.once ? (u) => {
1259
+ l(), t(u);
1260
+ } : (u) => t(u);
1244
1261
  n[e] = [...n[e] ?? [], i];
1245
1262
  const l = () => {
1246
- const a = n[e] ?? [], h = a.indexOf(i);
1247
- h !== -1 && (a.splice(h, 1), a.length === 0 ? (delete n[e], Object.keys(n).length === 0 && delete this.properties[C]) : n[e] = a, (r == null ? void 0 : r.signal) != null && r.signal.removeEventListener("abort", l));
1263
+ const u = n[e] ?? [], h = u.indexOf(i);
1264
+ h !== -1 && (u.splice(h, 1), u.length === 0 ? (delete n[e], Object.keys(n).length === 0 && delete this.properties[P]) : n[e] = u, (r == null ? void 0 : r.signal) != null && r.signal.removeEventListener("abort", l));
1248
1265
  };
1249
1266
  return (r == null ? void 0 : r.signal) != null && r.signal.addEventListener("abort", l), l;
1250
1267
  });
@@ -1252,7 +1269,7 @@ class be {
1252
1269
  var r;
1253
1270
  if (e.length === 0)
1254
1271
  return;
1255
- const t = (r = this.properties)[b] ?? (r[b] = []);
1272
+ const t = (r = this.properties)[T] ?? (r[T] = []);
1256
1273
  e.forEach((n) => {
1257
1274
  t.includes(n) || t.push(n);
1258
1275
  });
@@ -1261,29 +1278,29 @@ class be {
1261
1278
  var r;
1262
1279
  if (e.length === 0)
1263
1280
  return;
1264
- const t = (r = this.properties)[b] ?? (r[b] = []);
1281
+ const t = (r = this.properties)[T] ?? (r[T] = []);
1265
1282
  e.forEach((n) => {
1266
1283
  const i = t.indexOf(n);
1267
1284
  i !== -1 && t.splice(i, 1);
1268
- }), t.length === 0 && delete this.properties[b];
1285
+ }), t.length === 0 && delete this.properties[T];
1269
1286
  });
1270
- o(this, "getClasses", () => this.properties[b] ?? []);
1287
+ o(this, "getClasses", () => this.properties[T] ?? []);
1271
1288
  o(this, "getAttributes", () => Object.entries(this.properties).filter(
1272
1289
  ([e]) => !["innerText", "innerHTML"].includes(e)
1273
1290
  ));
1274
1291
  o(this, "getVisibleAttributes", () => Reflect.ownKeys(this.properties).flatMap(
1275
- (e) => e === b ? [["class", this.getClasses()]] : e === _ ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1292
+ (e) => e === T ? [["class", this.getClasses()]] : e === E ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1276
1293
  ));
1277
1294
  o(this, "setStyle", (e, t) => {
1278
1295
  var n;
1279
- const r = (n = this.properties)[_] ?? (n[_] = {});
1280
- r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[_]);
1296
+ const r = (n = this.properties)[E] ?? (n[E] = {});
1297
+ r[e] = t, t === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[E]);
1281
1298
  });
1282
1299
  o(this, "getStyle", (e) => {
1283
1300
  var t;
1284
- return ((t = this.properties[_]) == null ? void 0 : t[e]) ?? "";
1301
+ return ((t = this.properties[E]) == null ? void 0 : t[e]) ?? "";
1285
1302
  });
1286
- o(this, "getStyles", () => this.properties[_] ?? {});
1303
+ o(this, "getStyles", () => this.properties[E] ?? {});
1287
1304
  o(this, "makeAccessors", (e) => {
1288
1305
  const t = this.properties;
1289
1306
  return {
@@ -1294,21 +1311,21 @@ class be {
1294
1311
  this.parent = e;
1295
1312
  }
1296
1313
  }
1297
- const lt = (s) => s.replace(/"/g, "&quot;"), ct = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1298
- class at extends be {
1314
+ const ct = (s) => s.replace(/"/g, "&quot;"), ut = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1315
+ class at extends Ae {
1299
1316
  constructor(t, r, n) {
1300
1317
  super(n);
1301
1318
  o(this, "isPortal", () => !1);
1302
1319
  o(this, "toHTML", (t = !1) => {
1303
- const r = this.children.map((a) => a.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
1320
+ const r = this.children.map((u) => u.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
1304
1321
  let i = null;
1305
- const l = this.getVisibleAttributes().map(([a, h]) => a === "class" ? ` class="${h.join(" ")}"` : a === "style" ? typeof h == "string" ? ` style="${h}"` : ` style="${Object.entries(h).map(([u, m]) => `${u}: ${m};`).join(" ")}"` : ht.has(a) ? ` ${a}` : a === "innerHTML" ? (i = h, "") : a === "innerText" ? (i = ct(h), "") : ` ${a}="${lt(h)}"`).join(""), c = t ? ` ${me}` : "";
1306
- return ft.has(this.tagName) && r === "" ? `<${this.tagName}${n}${l}${c} />` : `<${this.tagName}${n}${l}${c}>${i ?? r}</${this.tagName}>`;
1322
+ const l = this.getVisibleAttributes().map(([u, h]) => u === "class" ? ` class="${h.join(" ")}"` : u === "style" ? typeof h == "string" ? ` style="${h}"` : ` style="${Object.entries(h).map(([a, m]) => `${a}: ${m};`).join(" ")}"` : ft.has(u) ? ` ${u}` : u === "innerHTML" ? (i = h, "") : u === "innerText" ? (i = ut(h), "") : ` ${u}="${ct(h)}"`).join(""), c = t ? ` ${ye}` : "";
1323
+ return dt.has(this.tagName) && r === "" ? `<${this.tagName}${n}${l}${c} />` : `<${this.tagName}${n}${l}${c}>${i ?? r}</${this.tagName}>`;
1307
1324
  });
1308
1325
  this.tagName = t, this.namespace = r;
1309
1326
  }
1310
1327
  }
1311
- class Se extends be {
1328
+ class Se extends Ae {
1312
1329
  constructor(t, r) {
1313
1330
  super(r);
1314
1331
  o(this, "isPortal", () => !0);
@@ -1317,7 +1334,7 @@ class Se extends be {
1317
1334
  this.selector = t;
1318
1335
  }
1319
1336
  }
1320
- class ut {
1337
+ class ht {
1321
1338
  constructor(e) {
1322
1339
  o(this, "id", Te());
1323
1340
  o(this, "isElement", () => !1);
@@ -1327,7 +1344,7 @@ class ut {
1327
1344
  this.text = e;
1328
1345
  }
1329
1346
  }
1330
- class O {
1347
+ class D {
1331
1348
  constructor(e, t, r, n) {
1332
1349
  o(this, "appendOrInsert", (e) => {
1333
1350
  if (this.reference != null) {
@@ -1338,7 +1355,7 @@ class O {
1338
1355
  });
1339
1356
  o(this, "makeChildElement", (e, t) => {
1340
1357
  const r = new at(e, t, this.element);
1341
- return this.appendOrInsert(r), new O(
1358
+ return this.appendOrInsert(r), new D(
1342
1359
  r,
1343
1360
  void 0,
1344
1361
  this.container,
@@ -1346,8 +1363,8 @@ class O {
1346
1363
  );
1347
1364
  });
1348
1365
  o(this, "makeChildText", (e) => {
1349
- const t = new ut(e);
1350
- return this.appendOrInsert(t), new O(
1366
+ const t = new ht(e);
1367
+ return this.appendOrInsert(t), new D(
1351
1368
  this.element,
1352
1369
  t,
1353
1370
  this.container,
@@ -1364,20 +1381,27 @@ class O {
1364
1381
  o(this, "makeRef", () => this.makeChildText(""));
1365
1382
  o(this, "makePortal", (e) => {
1366
1383
  const t = new Se(e, this.element);
1367
- return this.appendOrInsert(t), new O(
1384
+ return this.appendOrInsert(t), new D(
1368
1385
  t,
1369
1386
  void 0,
1370
1387
  this.container,
1371
1388
  this.providers
1372
1389
  );
1373
1390
  });
1374
- o(this, "withProviders", (e) => new O(this.element, this.reference, this.container, {
1391
+ /**
1392
+ * Sets a provider for the given provider mark.
1393
+ *
1394
+ * @param mark - The provider mark to set the provider for.
1395
+ * @param value - The provider to set for the given mark.
1396
+ * @returns A new `DOMContext` instance with the specified provider.
1397
+ */
1398
+ o(this, "setProvider", (e, t) => new D(this.element, this.reference, this.container, {
1375
1399
  ...this.providers,
1376
- ...e
1400
+ [e]: t
1377
1401
  }));
1378
1402
  o(this, "getProvider", (e) => {
1379
1403
  if (this.providers[e] === void 0)
1380
- throw new ge(e);
1404
+ throw new me(e);
1381
1405
  return this.providers[e];
1382
1406
  });
1383
1407
  o(this, "clear", (e) => {
@@ -1388,37 +1412,36 @@ class O {
1388
1412
  o(this, "removeClasses", (e) => this.element.removeClasses(e));
1389
1413
  o(this, "getClasses", () => this.element.getClasses());
1390
1414
  o(this, "isBrowserDOM", () => !1);
1415
+ o(this, "isBrowser", () => !1);
1391
1416
  o(this, "isHeadlessDOM", () => !0);
1417
+ o(this, "isHeadless", () => !0);
1392
1418
  o(this, "setStyle", (e, t) => this.element.setStyle(e, t));
1393
1419
  o(this, "getStyle", (e) => this.element.getStyle(e));
1394
1420
  o(this, "makeAccessors", (e) => this.element.makeAccessors(e));
1395
1421
  this.element = e, this.reference = t, this.container = r, this.providers = n;
1396
1422
  }
1397
1423
  }
1398
- const ht = /* @__PURE__ */ new Set([
1424
+ const ft = /* @__PURE__ */ new Set([
1399
1425
  "checked",
1400
1426
  "disabled",
1401
1427
  "multiple",
1402
1428
  "readonly",
1403
1429
  "required",
1404
1430
  "selected"
1405
- ]), ft = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), Ae = (s) => (e) => {
1406
- const t = e.makeChildText(s);
1407
- return (r) => t.clear(r);
1408
- }, Ee = (s) => (e) => {
1409
- const t = e.makeChildText(s.value), r = s.on((n) => t.setText(n));
1431
+ ]), dt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), _e = (s) => (e) => e.makeChildText(s).clear, Ee = (s) => (e) => {
1432
+ const t = e.makeChildText(s.value), r = s.on(t.setText);
1410
1433
  return (n) => {
1411
1434
  r(), t.clear(n);
1412
1435
  };
1413
- }, Bt = (s) => d.is(s) ? Ee(s) : Ae(s), S = (...s) => (e) => {
1436
+ }, Bt = (s) => d.is(s) ? Ee(s) : _e(s), A = (...s) => (e) => {
1414
1437
  const t = s.map((r) => f(r)(e));
1415
1438
  return (r) => {
1416
1439
  t.forEach((n) => n(r));
1417
1440
  };
1418
- }, E = () => () => {
1419
- }, dt = (s) => (e) => (e.addClasses(s), (t) => {
1441
+ }, _ = () => () => {
1442
+ }, pt = (s) => (e) => (e.addClasses(s), (t) => {
1420
1443
  t && e.removeClasses(s);
1421
- }), pt = (s) => (e) => {
1444
+ }), gt = (s) => (e) => {
1422
1445
  let t = [];
1423
1446
  const r = s.on((n) => {
1424
1447
  e.removeClasses(t), t = (n ?? "").split(" ").filter((i) => i.length > 0), e.addClasses(t);
@@ -1426,17 +1449,17 @@ const ht = /* @__PURE__ */ new Set([
1426
1449
  return (n) => {
1427
1450
  r(), n && e.removeClasses(t), t.length = 0;
1428
1451
  };
1429
- }, $ = (s, e) => (t) => {
1452
+ }, N = (s, e) => (t) => {
1430
1453
  const { get: r, set: n } = t.makeAccessors(s), i = r();
1431
1454
  return n(e), (l) => {
1432
1455
  l && n(i);
1433
1456
  };
1434
- }, k = (s, e) => (t) => {
1457
+ }, $ = (s, e) => (t) => {
1435
1458
  const { get: r, set: n } = t.makeAccessors(s), i = r(), l = e.on(n);
1436
1459
  return (c) => {
1437
1460
  l(), c && n(i);
1438
1461
  };
1439
- }, M = new Proxy(
1462
+ }, O = new Proxy(
1440
1463
  {},
1441
1464
  {
1442
1465
  /**
@@ -1450,17 +1473,17 @@ const ht = /* @__PURE__ */ new Set([
1450
1473
  * @returns The renderable component for the specified attribute.
1451
1474
  *
1452
1475
  */
1453
- get: (s, e) => e === "class" ? (t) => d.is(t) ? pt(t) : dt(
1476
+ get: (s, e) => e === "class" ? (t) => d.is(t) ? gt(t) : pt(
1454
1477
  (t ?? "").split(" ").filter((r) => r.length > 0)
1455
- ) : (t) => d.is(t) ? k(
1478
+ ) : (t) => d.is(t) ? $(
1456
1479
  e,
1457
1480
  t
1458
- ) : $(
1481
+ ) : N(
1459
1482
  e,
1460
1483
  t
1461
1484
  )
1462
1485
  }
1463
- ), Ut = new Proxy(
1486
+ ), Wt = new Proxy(
1464
1487
  {},
1465
1488
  {
1466
1489
  /**
@@ -1471,12 +1494,12 @@ const ht = /* @__PURE__ */ new Set([
1471
1494
  * @returns The renderable component for the specified attribute.
1472
1495
  *
1473
1496
  */
1474
- get: (s, e) => (t) => d.is(t) ? k(
1497
+ get: (s, e) => (t) => d.is(t) ? $(
1475
1498
  `data-${e}`,
1476
1499
  t
1477
- ) : $(`data-${e}`, t)
1500
+ ) : N(`data-${e}`, t)
1478
1501
  }
1479
- ), Wt = new Proxy(
1502
+ ), Ut = new Proxy(
1480
1503
  {},
1481
1504
  {
1482
1505
  /**
@@ -1487,10 +1510,10 @@ const ht = /* @__PURE__ */ new Set([
1487
1510
  * @returns The renderable component for the specified attribute.
1488
1511
  *
1489
1512
  */
1490
- get: (s, e) => (t) => d.is(t) ? k(
1513
+ get: (s, e) => (t) => d.is(t) ? $(
1491
1514
  `aria-${e}`,
1492
1515
  t
1493
- ) : $(
1516
+ ) : N(
1494
1517
  `aria-${e}`,
1495
1518
  t
1496
1519
  )
@@ -1506,10 +1529,10 @@ const ht = /* @__PURE__ */ new Set([
1506
1529
  * @returns The renderable component for the specified attribute.
1507
1530
  *
1508
1531
  */
1509
- get: (s, e) => (t) => d.is(t) ? k(
1532
+ get: (s, e) => (t) => d.is(t) ? $(
1510
1533
  e,
1511
1534
  t
1512
- ) : $(
1535
+ ) : N(
1513
1536
  e,
1514
1537
  t
1515
1538
  )
@@ -1524,32 +1547,32 @@ const ht = /* @__PURE__ */ new Set([
1524
1547
  * @returns The renderable component for the specified attribute.
1525
1548
  *
1526
1549
  */
1527
- get: (s, e) => (t) => d.is(t) ? k(
1550
+ get: (s, e) => (t) => d.is(t) ? $(
1528
1551
  e,
1529
1552
  t
1530
- ) : $(
1553
+ ) : N(
1531
1554
  e,
1532
1555
  t
1533
1556
  )
1534
1557
  }
1535
1558
  ), f = (s) => {
1536
1559
  if (s == null)
1537
- return E;
1560
+ return _;
1538
1561
  if (Array.isArray(s))
1539
- return S(...s.map(f));
1562
+ return A(...s.map(f));
1540
1563
  if (typeof s == "string")
1541
- return Ae(s);
1564
+ return _e(s);
1542
1565
  if (d.is(s))
1543
1566
  return Ee(s);
1544
1567
  if (typeof s == "function")
1545
1568
  return s;
1546
1569
  throw new Error(`Unknown type: '${typeof s}' for child: ${s}`);
1547
- }, _e = (s, ...e) => (t) => {
1570
+ }, we = (s, ...e) => (t) => {
1548
1571
  const r = t.makeChildElement(s, void 0), n = e.map((i) => f(i)(r));
1549
1572
  return (i) => {
1550
1573
  n.forEach((l) => l(!1)), r.clear(i);
1551
1574
  };
1552
- }, ve = (s, e, ...t) => (r) => {
1575
+ }, Ce = (s, e, ...t) => (r) => {
1553
1576
  const n = r.makeChildElement(s, e), i = t.map((l) => f(l)(n));
1554
1577
  return (l) => {
1555
1578
  i.forEach((c) => c(!1)), n.clear(l);
@@ -1562,7 +1585,7 @@ const ht = /* @__PURE__ */ new Set([
1562
1585
  * @param tagName - The HTML tag name.
1563
1586
  * @returns A renderable function that creates and appends the HTML element to the DOM.
1564
1587
  */
1565
- get: (s, e) => (...t) => _e(e, t.flatMap(f))
1588
+ get: (s, e) => (...t) => we(e, t.flatMap(f))
1566
1589
  }
1567
1590
  ), Yt = new Proxy(
1568
1591
  {},
@@ -1572,9 +1595,9 @@ const ht = /* @__PURE__ */ new Set([
1572
1595
  * @param type - The input type name.
1573
1596
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
1574
1597
  */
1575
- get: (s, e) => (...t) => _e("input", M.type(e), ...t)
1598
+ get: (s, e) => (...t) => we("input", O.type(e), ...t)
1576
1599
  }
1577
- ), gt = "http://www.w3.org/2000/svg", zt = new Proxy(
1600
+ ), mt = "http://www.w3.org/2000/svg", zt = new Proxy(
1578
1601
  {},
1579
1602
  {
1580
1603
  /**
@@ -1582,9 +1605,9 @@ const ht = /* @__PURE__ */ new Set([
1582
1605
  * @param tagName - The SVG tag name.
1583
1606
  * @returns A renderable function that creates and appends the SVG element to the DOM.
1584
1607
  */
1585
- get: (s, e) => (...t) => ve(e, gt, t.flatMap(f))
1608
+ get: (s, e) => (...t) => Ce(e, mt, t.flatMap(f))
1586
1609
  }
1587
- ), mt = "http://www.w3.org/1998/Math/MathML", Qt = new Proxy(
1610
+ ), yt = "http://www.w3.org/1998/Math/MathML", Qt = new Proxy(
1588
1611
  {},
1589
1612
  {
1590
1613
  /**
@@ -1592,28 +1615,28 @@ const ht = /* @__PURE__ */ new Set([
1592
1615
  * @param tagName - The Math tag name.
1593
1616
  * @returns A renderable function that creates and appends the Math element to the DOM.
1594
1617
  */
1595
- get: (s, e) => (...t) => ve(e, mt, t.flatMap(f))
1618
+ get: (s, e) => (...t) => Ce(e, yt, t.flatMap(f))
1596
1619
  }
1597
- ), we = (s, e) => {
1620
+ ), Pe = (s, e) => {
1598
1621
  if (typeof e == "function")
1599
- return we(s, { then: e });
1600
- const t = e.pending != null ? f(e.pending()) : E, r = e.then, n = e.error != null ? (i) => f(e.error(i)) : () => E;
1622
+ return Pe(s, { then: e });
1623
+ const t = e.pending != null ? f(e.pending()) : _, r = e.then, n = e.error != null ? (i) => f(e.error(i)) : () => _;
1601
1624
  return (i) => {
1602
1625
  let l = !0;
1603
- const c = s(), a = i.makeRef();
1604
- let h = f(t)(a);
1626
+ const c = s(), u = i.makeRef();
1627
+ let h = f(t)(u);
1605
1628
  return c.then(
1606
- (u) => {
1607
- l && (h(!0), h = f(r(u))(a));
1629
+ (a) => {
1630
+ l && (h(!0), h = f(r(a))(u));
1608
1631
  },
1609
- (u) => {
1610
- l && (h(!0), h = f(n(u))(a));
1632
+ (a) => {
1633
+ l && (h(!0), h = f(n(a))(u));
1611
1634
  }
1612
- ), (u) => {
1613
- l = !1, h(u), a.clear(u);
1635
+ ), (a) => {
1636
+ l = !1, h(a), u.clear(a);
1614
1637
  };
1615
1638
  };
1616
- }, Zt = (s, e) => we(() => s, e), Ce = (s, e, t) => (r) => r.on(s, e, t), yt = (s) => Ce("click", (e) => {
1639
+ }, Zt = (s, e) => Pe(() => s, e), ve = (s, e, t) => (r) => r.on(s, e, t), bt = (s) => ve("click", (e) => {
1617
1640
  e.preventDefault();
1618
1641
  const t = e.target;
1619
1642
  setTimeout(() => {
@@ -1628,12 +1651,12 @@ const ht = /* @__PURE__ */ new Set([
1628
1651
  * @param fn - The function to call when the event is triggered.
1629
1652
  * @returns A `Renderable` function that adds the event listener to the element.
1630
1653
  */
1631
- get: (s, e) => (t) => Ce(e, t)
1654
+ get: (s, e) => (t) => ve(e, t)
1632
1655
  }
1633
1656
  ), Tt = (s) => (e) => {
1634
1657
  const t = e.target;
1635
1658
  s(t.value);
1636
- }, bt = (s) => (e) => {
1659
+ }, At = (s) => (e) => {
1637
1660
  const t = e.target;
1638
1661
  s(t.valueAsNumber);
1639
1662
  }, St = (s) => (e) => {
@@ -1646,7 +1669,19 @@ const ht = /* @__PURE__ */ new Set([
1646
1669
  Number(r[2].substring(0, 2))
1647
1670
  );
1648
1671
  s(n);
1649
- }, At = (s) => (e) => {
1672
+ }, Kt = (s) => (e) => {
1673
+ const t = e.target;
1674
+ if (t.value === "") {
1675
+ s(null);
1676
+ return;
1677
+ }
1678
+ const r = t.value.split("-"), n = new Date(
1679
+ Number(r[0]),
1680
+ Number(r[1]) - 1,
1681
+ Number(r[2].substring(0, 2))
1682
+ );
1683
+ s(n);
1684
+ }, _t = (s) => (e) => {
1650
1685
  const t = e.target;
1651
1686
  if (t.value === "")
1652
1687
  return;
@@ -1656,46 +1691,63 @@ const ht = /* @__PURE__ */ new Set([
1656
1691
  Number(n[2])
1657
1692
  ), l = r[1].split(":");
1658
1693
  i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), s(i);
1659
- }, Kt = (s) => (e) => {
1694
+ }, es = (s) => (e) => {
1695
+ const t = e.target;
1696
+ if (t.value === "") {
1697
+ s(null);
1698
+ return;
1699
+ }
1700
+ const r = t.value.split("T");
1701
+ if (r.length !== 2) {
1702
+ s(null);
1703
+ return;
1704
+ }
1705
+ const n = r[0].split("-"), i = new Date(
1706
+ Number(n[0]),
1707
+ Number(n[1]) - 1,
1708
+ Number(n[2])
1709
+ ), l = r[1].split(":");
1710
+ i.setHours(Number(l[0] ?? 0)), i.setMinutes(Number(l[1] ?? 0)), i.setSeconds(Number(l[2] ?? 0)), s(i);
1711
+ }, ts = (s) => (e) => {
1660
1712
  const t = e.target;
1661
1713
  s(t.checked);
1662
- }, es = (s) => (e) => {
1714
+ }, ss = (s) => (e) => {
1663
1715
  e.preventDefault(), s();
1664
- }, ts = (s) => (e) => {
1716
+ }, rs = (s) => (e) => {
1665
1717
  e.stopPropagation(), s();
1666
- }, ss = (s) => (e) => {
1718
+ }, ns = (s) => (e) => {
1667
1719
  e.stopImmediatePropagation(), s();
1668
- }, rs = (s, e = "input") => S(M.valueAsDate(s), J[e](St(s.set))), ns = (s, e = "input") => S(M.valueAsDate(s), J[e](At(s.set))), is = (s, e = "input") => S(M.valueAsNumber(s), J[e](bt(s.set))), os = (s, e = "input") => S(M.value(s), J[e](Tt(s.set))), ls = (s) => S(M.checked(s), yt(s.set)), G = (s, e) => {
1720
+ }, is = (s, e = "input") => A(O.valueAsDate(s), J[e](St(s.set))), os = (s, e = "input") => A(O.valueAsDate(s), J[e](_t(s.set))), ls = (s, e = "input") => A(O.valueAsNumber(s), J[e](At(s.set))), cs = (s, e = "input") => A(O.value(s), J[e](Tt(s.set))), us = (s) => A(O.checked(s), bt(s.set)), G = (s, e) => {
1669
1721
  if (d.is(s))
1670
1722
  return (r) => {
1671
1723
  const n = r.makeRef();
1672
1724
  let i, l;
1673
- const c = s.map((u) => Object.keys(u)[0]);
1674
- let a;
1675
- const h = c.on((u) => {
1676
- if (u !== a) {
1677
- l == null || l.dispose(), i == null || i(!0), l = s.map((T) => T[u]);
1678
- const m = e[u](l);
1679
- i = f(m)(n), a = u;
1725
+ const c = s.map((a) => Object.keys(a)[0]);
1726
+ let u;
1727
+ const h = c.on((a) => {
1728
+ if (a !== u) {
1729
+ u = a, l == null || l.dispose(), i == null || i(!0), l = s.map((b) => b[a]);
1730
+ const m = e[a](l);
1731
+ i = f(m)(n);
1680
1732
  }
1681
1733
  });
1682
- return (u) => {
1683
- l == null || l.dispose(), h(), n.clear(u), i == null || i(u);
1734
+ return (a) => {
1735
+ l == null || l.dispose(), h(), n.clear(a), i == null || i(a);
1684
1736
  };
1685
1737
  };
1686
1738
  const t = Object.keys(s)[0];
1687
- return f(e[t](W(s[t])));
1688
- }, Pe = (s, e, t) => G(
1739
+ return f(e[t](U(s[t])));
1740
+ }, xe = (s, e, t) => G(
1689
1741
  y.map(s, (r) => ({ [r[e]]: r })),
1690
1742
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1691
1743
  t
1692
- ), cs = (s, e) => Pe(s, "kind", e), as = (s, e) => {
1744
+ ), as = (s, e) => xe(s, "kind", e), hs = (s, e) => {
1693
1745
  const t = y.map(s, ([r, n]) => ({ [r]: n }));
1694
1746
  return G(t, e);
1695
- }, us = (s, e) => Pe(s, "type", e), Et = (s, e) => G(
1747
+ }, fs = (s, e) => xe(s, "type", e), Et = (s, e) => G(
1696
1748
  y.map(s, (t) => ({ [t]: !0 })),
1697
1749
  e
1698
- ), hs = (s, e = {}) => (t) => {
1750
+ ), ds = (s, e = {}) => (t) => {
1699
1751
  const r = (e == null ? void 0 : e.firstSeparator) ?? s, n = (e == null ? void 0 : e.lastSeparator) ?? s;
1700
1752
  return Et(
1701
1753
  t.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
@@ -1705,72 +1757,49 @@ const ht = /* @__PURE__ */ new Set([
1705
1757
  other: s
1706
1758
  }
1707
1759
  );
1708
- }, Le = (s, e) => (t) => {
1709
- const r = Object.values(s).reduce(
1710
- (n, i) => {
1711
- const l = t.getProvider(i);
1712
- return Reflect.set(n, i, l), n;
1713
- },
1714
- {}
1715
- );
1716
- return f(e(r))(t);
1717
- }, fs = (s, e) => (t) => {
1718
- const r = [], n = Object.entries(s).reduce(
1719
- (i, [l, c]) => (r.push(
1720
- c((a) => (Reflect.set(i, l, a), null))(t)
1721
- ), i),
1722
- {}
1723
- );
1724
- return r.push(f(e(n))(t)), (i) => {
1725
- r.forEach((l) => l(i));
1726
- };
1727
- }, _t = (s, e) => Le([s], (t) => f(e(t[s]))), ds = (s, e) => Le(s, (t) => f(e(t))), ps = (s) => (e) => {
1728
- const t = s(e);
1729
- return t == null ? () => {
1730
- } : f(t)(e);
1731
- }, gs = (s) => (e) => (e.appendOrInsert(s), (t) => {
1760
+ }, ps = (s) => (e) => (e.appendOrInsert(s), (t) => {
1732
1761
  t && R(s);
1733
- }), vt = (s, e, t) => {
1762
+ }), wt = (s, e, t) => {
1734
1763
  if (d.is(s)) {
1735
1764
  const r = s;
1736
1765
  return (n) => {
1737
1766
  const i = n.makeRef();
1738
1767
  let l = () => {
1739
- }, c = !1, a = null;
1740
- const h = r.on((u) => {
1741
- u == null ? (l(!0), l = f((t == null ? void 0 : t()) ?? E)(i), c = !1, a == null || a.dispose(), a = null) : (a == null ? a = v(u) : a.value = u, c || (l(!0), l = f(e(a))(
1768
+ }, c = !1, u = null;
1769
+ const h = r.on((a) => {
1770
+ a == null ? (l(!0), l = f((t == null ? void 0 : t()) ?? _)(i), c = !1, u == null || u.dispose(), u = null) : (u == null ? u = w(a) : u.value = a, c || (l(!0), l = f(e(u))(
1742
1771
  i
1743
1772
  ), c = !0));
1744
1773
  });
1745
- return (u) => {
1746
- a == null || a.dispose(), h(), l == null || l(u), i.clear(u);
1774
+ return (a) => {
1775
+ u == null || u.dispose(), h(), l == null || l(a), i.clear(a);
1747
1776
  };
1748
1777
  };
1749
1778
  } else {
1750
1779
  const r = s;
1751
1780
  if (r == null) {
1752
1781
  const n = t == null ? void 0 : t();
1753
- return n != null ? f(n) : E;
1782
+ return n != null ? f(n) : _;
1754
1783
  }
1755
- return f(e(W(r)));
1784
+ return f(e(U(r)));
1756
1785
  }
1757
- }, ms = (...s) => (e, t) => (r) => {
1786
+ }, gs = (...s) => (e, t) => (r) => {
1758
1787
  const n = r.makeRef();
1759
1788
  if (s.some(
1760
1789
  (p) => !d.is(p) && p == null
1761
1790
  ))
1762
- return (t != null ? f(t == null ? void 0 : t()) : E)(
1791
+ return (t != null ? f(t == null ? void 0 : t()) : _)(
1763
1792
  n
1764
1793
  );
1765
1794
  const l = s.map(() => null), c = s.map(
1766
1795
  (p) => d.is(p) ? p.value != null : p != null
1767
1796
  );
1768
- let a = null;
1769
- const h = v(c.every((p) => p)), u = (p, g) => {
1797
+ let u = null;
1798
+ const h = w(c.every((p) => p)), a = (p, g) => {
1770
1799
  if (p.value != null) {
1771
1800
  if (l[g] == null) {
1772
- const w = v(p.value);
1773
- l[g] = w;
1801
+ const C = w(p.value);
1802
+ l[g] = C;
1774
1803
  } else
1775
1804
  l[g].value = p.value;
1776
1805
  c[g] = !0;
@@ -1778,93 +1807,77 @@ const ht = /* @__PURE__ */ new Set([
1778
1807
  c[g] = !1;
1779
1808
  };
1780
1809
  let m = s.length - 1;
1781
- const T = s.map((p, g) => {
1810
+ const b = s.map((p, g) => {
1782
1811
  if (!d.is(p)) {
1783
- const w = v(p);
1784
- return l[g] = w, () => {
1812
+ const C = w(p);
1813
+ return l[g] = C, () => {
1785
1814
  };
1786
1815
  }
1787
1816
  return p.on(() => {
1788
- u(p, g), m === 0 ? h.value = c.every((w) => w) : m--;
1817
+ a(p, g), m === 0 ? h.value = c.every((C) => C) : m--;
1789
1818
  });
1790
1819
  });
1791
1820
  return h.on((p) => {
1792
- a == null || a(!0), a = null, p ? a = f(e(...l))(n) : a = f((t == null ? void 0 : t()) ?? E)(n);
1821
+ u == null || u(!0), u = null, p ? u = f(e(...l))(n) : u = f((t == null ? void 0 : t()) ?? _)(n);
1793
1822
  }), (p) => {
1794
- l.forEach((g) => g == null ? void 0 : g.dispose()), h.dispose(), T.forEach((g) => g()), a == null || a(p), n.clear(p);
1823
+ l.forEach((g) => g == null ? void 0 : g.dispose()), h.dispose(), b.forEach((g) => g()), u == null || u(p), n.clear(p);
1795
1824
  };
1796
- }, Z = (...s) => (e) => (t) => s.forEach((r) => r(t, e)), xe = (s, e, t) => vt(
1825
+ }, Z = (...s) => (e) => (t) => s.forEach((r) => r(t, e)), Le = (s, e, t) => wt(
1797
1826
  y.map(s, (r) => r ? !0 : null),
1798
1827
  e,
1799
1828
  t ?? void 0
1800
- ), ys = (s, e, t) => xe(
1829
+ ), ms = (s, e, t) => Le(
1801
1830
  y.map(s, (r) => !r),
1802
1831
  e,
1803
1832
  t
1804
- ), Oe = (s, e, t) => t != null ? Oe(s, (r) => {
1833
+ ), De = (s, e, t) => t != null ? De(s, (r) => {
1805
1834
  const n = new Y(
1806
1835
  r.index,
1807
1836
  r.total.map((i) => i - 1)
1808
1837
  );
1809
- return S(
1838
+ return A(
1810
1839
  Z(n.dispose),
1811
1840
  f(e(r)),
1812
- xe(
1841
+ Le(
1813
1842
  r.isLast,
1814
- () => E,
1843
+ () => _,
1815
1844
  () => t(n)
1816
1845
  )
1817
1846
  );
1818
1847
  }) : d.is(s) ? (r) => {
1819
1848
  const n = r.makeRef(), i = [], l = s.on((c) => {
1820
- const a = i.splice(c);
1821
- for (const h of a)
1849
+ const u = i.splice(c);
1850
+ for (const h of u)
1822
1851
  h(!0);
1823
1852
  for (let h = i.length; h < c; h++) {
1824
- const u = new Y(h, s);
1825
- i.push(f(e(u))(n));
1853
+ const a = new Y(h, s);
1854
+ i.push(f(e(a))(n));
1826
1855
  }
1827
1856
  });
1828
1857
  return (c) => {
1829
1858
  l();
1830
- for (const a of i)
1831
- a(c);
1859
+ for (const u of i)
1860
+ u(c);
1832
1861
  i.length = 0, n.clear(c);
1833
1862
  };
1834
- } : S(
1863
+ } : A(
1835
1864
  ...Array.from({ length: s }, (r, n) => n).map(
1836
- (r) => f(e(new Y(r, W(s))))
1865
+ (r) => f(e(new Y(r, U(s))))
1837
1866
  )
1838
- ), Ts = (s, e, t) => {
1867
+ ), ys = (s, e, t) => {
1839
1868
  const r = y.map(s, (i) => i.length), n = y.toSignal(s);
1840
- return Oe(
1869
+ return De(
1841
1870
  r,
1842
1871
  (i) => {
1843
1872
  const l = n.map((c) => c[i.index]);
1844
- return S(
1873
+ return A(
1845
1874
  Z(l.dispose),
1846
1875
  f(e(l, i))
1847
1876
  );
1848
1877
  },
1849
1878
  t
1850
1879
  );
1851
- }, wt = (s) => (e) => {
1852
- if (e.isBrowserDOM()) {
1853
- const t = s(e);
1854
- if (t != null)
1855
- return f(t)(e);
1856
- }
1857
- return () => {
1858
- };
1859
- }, bs = (s) => (e) => {
1860
- if (e.isHeadlessDOM()) {
1861
- const t = s(e);
1862
- if (t)
1863
- return f(t)(e);
1864
- }
1865
- return () => {
1866
- };
1867
- }, Ss = (s) => wt((e) => s(e.element)), As = (s, e) => {
1880
+ }, bs = (s, e) => {
1868
1881
  if (d.is(s)) {
1869
1882
  const t = s;
1870
1883
  return (r) => {
@@ -1881,7 +1894,7 @@ const ht = /* @__PURE__ */ new Set([
1881
1894
  };
1882
1895
  }
1883
1896
  return f(e(s));
1884
- }, Es = (s, e, t = () => E) => G(
1897
+ }, Ts = (s, e, t = () => _) => G(
1885
1898
  y.map(
1886
1899
  s,
1887
1900
  (r) => r.length > 0 ? { notEmpty: r } : { whenEmpty: null }
@@ -1890,42 +1903,53 @@ const ht = /* @__PURE__ */ new Set([
1890
1903
  notEmpty: (r) => e(r),
1891
1904
  whenEmpty: () => t()
1892
1905
  }
1893
- ), _s = (s, e) => (t) => {
1906
+ ), As = (s, e) => (t) => {
1894
1907
  const r = t.makePortal(s);
1895
1908
  return Q(f(e), r);
1896
- }, Ct = (s) => Symbol(s), De = (s, e) => (t) => f(e)(t.withProviders(s)), vs = (...s) => s.length > 0 ? s.reduceRight((e, t) => (r) => e(t(r))) : f, Pt = (s, e, t) => De({ [s]: e }, f(t)), ws = (s, e) => De(s, f(e)), Me = Ct("Probe"), P = /* @__PURE__ */ new Map(), Lt = ({
1909
+ }, K = (s) => (e) => {
1910
+ let t = e;
1911
+ const r = s({
1912
+ use: e.getProvider,
1913
+ set: (n, i) => t = t.setProvider(n, i)
1914
+ });
1915
+ return r == null ? () => {
1916
+ } : f(r)(t);
1917
+ }, Ct = (s, e, t) => K(({ set: r }) => (r(s, e), t(e))), Pt = (s, e) => K(({ use: t }) => e(t(s))), Ss = (...s) => (e) => K(({ use: t }) => {
1918
+ const r = s.map((n) => t(n));
1919
+ return e(...r);
1920
+ }), Me = Xe("Probe"), v = /* @__PURE__ */ new Map(), vt = ({
1897
1921
  identifier: s,
1898
1922
  callback: e = () => {
1899
1923
  },
1900
1924
  child: t,
1901
1925
  timeout: r = 10
1902
1926
  }) => {
1903
- if (P.has(s))
1927
+ if (v.has(s))
1904
1928
  throw new Error(`Probe already exists: ${s.description}`);
1905
1929
  const n = setTimeout(() => e("timeout"), r);
1906
- P.set(s, {
1930
+ v.set(s, {
1907
1931
  counter: 0,
1908
1932
  timeoutId: n
1909
1933
  });
1910
1934
  const i = (l) => {
1911
1935
  clearTimeout(n);
1912
- const c = P.get(l);
1936
+ const c = v.get(l);
1913
1937
  if (c == null)
1914
1938
  throw new Error(`Probe not found: ${l.description}`);
1915
- --c.counter === 0 ? (e("resolved"), P.delete(l)) : P.set(l, c);
1939
+ --c.counter === 0 ? (e("resolved"), v.delete(l)) : v.set(l, c);
1916
1940
  };
1917
- return S(
1941
+ return A(
1918
1942
  Z(() => clearTimeout(n)),
1919
- Pt(Me, i, t)
1943
+ Ct(Me, i, () => t)
1920
1944
  );
1921
- }, xt = (s, e) => _t(Me, (t) => {
1922
- const r = P.get(s);
1945
+ }, xt = (s, e) => Pt(Me, (t) => {
1946
+ const r = v.get(s);
1923
1947
  return r == null ? e(() => {
1924
1948
  }) : (clearTimeout(r.timeoutId), r.counter++, e(() => t(s)));
1925
- }), He = Symbol("globalProbe"), Cs = ({
1949
+ }), Oe = Symbol("globalProbe"), _s = ({
1926
1950
  callback: s,
1927
1951
  timeout: e
1928
- }, t) => Lt({ identifier: He, callback: s, child: t, timeout: e }), Ps = (s) => xt(He, s), Ot = (s, e) => (t) => {
1952
+ }, t) => vt({ identifier: Oe, callback: s, child: t, timeout: e }), Es = (s) => xt(Oe, s), Lt = (s, e) => (t) => {
1929
1953
  const r = t.getStyle(s);
1930
1954
  return t.setStyle(s, e), (n) => {
1931
1955
  n && t.setStyle(s, r);
@@ -1935,7 +1959,7 @@ const ht = /* @__PURE__ */ new Set([
1935
1959
  return e.on((n) => t.setStyle(s, n)), (n) => {
1936
1960
  n && t.setStyle(s, r);
1937
1961
  };
1938
- }, Ls = new Proxy(
1962
+ }, ws = new Proxy(
1939
1963
  {},
1940
1964
  {
1941
1965
  /**
@@ -1946,120 +1970,141 @@ const ht = /* @__PURE__ */ new Set([
1946
1970
  * @returns The renderable component for the specified attribute.
1947
1971
  *
1948
1972
  */
1949
- get: (s, e) => (t) => d.is(t) ? Dt(e, t) : Ot(e, t)
1973
+ get: (s, e) => (t) => d.is(t) ? Dt(e, t) : Lt(e, t)
1950
1974
  }
1951
- );
1975
+ ), Mt = (s) => (e) => {
1976
+ if (e.isBrowser()) {
1977
+ const t = s(e);
1978
+ if (t != null)
1979
+ return f(t)(e);
1980
+ }
1981
+ return () => {
1982
+ };
1983
+ }, Cs = (s) => (e) => {
1984
+ const t = s(e);
1985
+ return t == null ? () => {
1986
+ } : f(t)(e);
1987
+ }, Ps = (s) => Mt((e) => s(e.element)), vs = (s) => (e) => {
1988
+ if (e.isHeadlessDOM()) {
1989
+ const t = s(e);
1990
+ if (t)
1991
+ return f(t)(e);
1992
+ }
1993
+ return () => {
1994
+ };
1995
+ };
1952
1996
  export {
1953
1997
  Zt as Async,
1954
- ls as BindChecked,
1955
- rs as BindDate,
1956
- ns as BindDateTime,
1957
- is as BindNumber,
1958
- os as BindText,
1959
- x as BrowserContext,
1998
+ us as BindChecked,
1999
+ is as BindDate,
2000
+ os as BindDateTime,
2001
+ ls as BindNumber,
2002
+ cs as BindText,
2003
+ L as BrowserContext,
1960
2004
  V as CLASS_PLACEHOLDER_ATTR,
1961
- L as Computed,
1962
- hs as Conjunction,
1963
- gs as DOMNode,
1964
- _e as El,
1965
- ve as ElNS,
2005
+ x as Computed,
2006
+ ds as Conjunction,
2007
+ ps as DOMNode,
2008
+ we as El,
2009
+ Ce as ElNS,
1966
2010
  Y as ElementPosition,
1967
- E as Empty,
1968
- vt as Ensure,
1969
- ms as EnsureAll,
1970
- Ts as ForEach,
1971
- S as Fragment,
2011
+ _ as Empty,
2012
+ wt as Ensure,
2013
+ gs as EnsureAll,
2014
+ ys as ForEach,
2015
+ A as Fragment,
1972
2016
  qt as HeadlessAdapter,
1973
- O as HeadlessContext,
2017
+ D as HeadlessContext,
1974
2018
  at as HeadlessElement,
1975
2019
  Se as HeadlessPortal,
1976
- ut as HeadlessText,
1977
- As as MapSignal,
1978
- le as MemoryStore,
1979
- Es as NotEmpty,
1980
- wt as OnBrowserCtx,
1981
- yt as OnChecked,
1982
- ps as OnCtx,
2020
+ ht as HeadlessText,
2021
+ bs as MapSignal,
2022
+ ce as MemoryStore,
2023
+ Ts as NotEmpty,
2024
+ bt as OnChecked,
1983
2025
  Z as OnDispose,
1984
- Ss as OnElement,
1985
- bs as OnHeadlessCtx,
1986
2026
  G as OneOf,
1987
- Pe as OneOfField,
1988
- cs as OneOfKind,
1989
- as as OneOfTuple,
1990
- us as OneOfType,
2027
+ xe as OneOfField,
2028
+ as as OneOfKind,
2029
+ hs as OneOfTuple,
2030
+ fs as OneOfType,
1991
2031
  Et as OneOfValue,
1992
- _s as Portal,
1993
- N as Prop,
1994
- vs as Provide,
1995
- Cs as ProvideGlobalProbe,
1996
- Lt as ProvideProbe,
1997
- ge as ProviderNotFoundError,
1998
- Xe as RenderingError,
1999
- Oe as Repeat,
2032
+ As as Portal,
2033
+ k as Prop,
2034
+ _s as ProvideGlobalProbe,
2035
+ vt as ProvideProbe,
2036
+ me as ProviderNotFoundError,
2037
+ Ye as RenderingError,
2038
+ De as Repeat,
2039
+ Ct as SetProvider,
2000
2040
  d as Signal,
2001
- we as Task,
2041
+ Pe as Task,
2002
2042
  Bt as TextNode,
2003
- ys as Unless,
2004
- fs as Use,
2005
- Ps as UseGlobalProbe,
2043
+ ms as Unless,
2044
+ Es as UseGlobalProbe,
2006
2045
  xt as UseProbe,
2007
- _t as UseProvider,
2008
- ds as UseProviders,
2046
+ Pt as UseProvider,
2047
+ Ss as UseProviders,
2009
2048
  y as Value,
2010
- xe as When,
2011
- Pt as WithProvider,
2012
- ws as WithProviders,
2013
- me as _NODE_PLACEHOLDER_ATTR,
2049
+ Le as When,
2050
+ Mt as WithBrowserCtx,
2051
+ Cs as WithCtx,
2052
+ Ps as WithElement,
2053
+ vs as WithHeadlessCtx,
2054
+ K as WithProvider,
2055
+ ye as _NODE_PLACEHOLDER_ATTR,
2014
2056
  Ge as _getSelfOrParentElement,
2015
- pe as _isElement,
2057
+ ge as _isElement,
2016
2058
  Je as _makeGetter,
2017
- We as _makeSetter,
2059
+ Ue as _makeSetter,
2018
2060
  R as _removeDOMNode,
2019
2061
  Ee as _signalText,
2020
- Ae as _staticText,
2021
- Nt as animateSignal,
2022
- Ue as animateSignals,
2023
- Wt as aria,
2024
- M as attr,
2025
- Ut as dataAttr,
2026
- Kt as emitChecked,
2027
- es as emitPreventDefault,
2028
- ss as emitStopImmediatePropagation,
2029
- ts as emitStopPropagation,
2062
+ _e as _staticText,
2063
+ kt as animateSignal,
2064
+ We as animateSignals,
2065
+ Ut as aria,
2066
+ O as attr,
2067
+ z as computed,
2068
+ Be as computedOf,
2069
+ Rt as computedRecord,
2070
+ Wt as dataAttr,
2071
+ Fe as effect,
2072
+ Nt as effectOf,
2073
+ ts as emitChecked,
2074
+ ss as emitPreventDefault,
2075
+ ns as emitStopImmediatePropagation,
2076
+ rs as emitStopPropagation,
2030
2077
  Tt as emitValue,
2031
2078
  St as emitValueAsDate,
2032
- At as emitValueAsDateTime,
2033
- bt as emitValueAsNumber,
2034
- je as endInterpolate,
2035
- oe as getWindow,
2036
- qe as guessInterpolate,
2079
+ _t as emitValueAsDateTime,
2080
+ Kt as emitValueAsNullableDate,
2081
+ es as emitValueAsNullableDateTime,
2082
+ At as emitValueAsNumber,
2083
+ Ve as endInterpolate,
2084
+ le as getWindow,
2085
+ je as guessInterpolate,
2037
2086
  Xt as html,
2038
2087
  Yt as input,
2039
- Ve as interpolateDate,
2040
- Ne as interpolateNumber,
2041
- Re as interpolateString,
2042
- kt as localStorageProp,
2043
- z as makeComputed,
2044
- Ht as makeComputedOf,
2045
- Rt as makeComputedRecord,
2046
- Be as makeEffect,
2047
- $t as makeEffectOf,
2048
- v as makeProp,
2049
- Ct as makeProviderMark,
2050
- W as makeSignal,
2088
+ Re as interpolateDate,
2089
+ Ie as interpolateNumber,
2090
+ ke as interpolateString,
2091
+ Ht as joinSignals,
2092
+ $t as localStorageProp,
2093
+ Xe as makeProviderMark,
2051
2094
  Qt as math,
2052
2095
  Gt as mathAttr,
2053
2096
  J as on,
2054
2097
  Me as probeMarker,
2098
+ w as prop,
2055
2099
  Vt as render,
2056
2100
  Q as renderWithContext,
2057
2101
  f as renderableOfTNode,
2058
2102
  Ft as restoreTempoPlaceholders,
2059
2103
  jt as runHeadless,
2060
2104
  It as sessionStorageProp,
2061
- ce as storedProp,
2062
- Ls as style,
2105
+ U as signal,
2106
+ ue as storedProp,
2107
+ ws as style,
2063
2108
  zt as svg,
2064
2109
  Jt as svgAttr
2065
2110
  };