@tempots/dom 31.6.1 → 33.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,56 +1,33 @@
1
- const ke = (t, e, s) => t + (e - t) * s;
2
- const $e = (t, e, s) => {
3
- const r = Math.max(t.length, e.length);
4
- let n = "";
5
- for (let i = 0; i < r; i++) {
6
- let o = t.charCodeAt(i);
7
- isNaN(o) && (o = 97);
8
- let l = e.charCodeAt(i);
9
- isNaN(l) && (l = 97), n += String.fromCharCode(o + (l - o) * s);
1
+ const _ = [], We = (t) => {
2
+ _.push(t);
3
+ }, Ue = () => {
4
+ if (_.length === 0)
5
+ throw new Error("Cannot pop from empty scope stack");
6
+ _.pop();
7
+ }, ye = () => _[_.length - 1] ?? null, Zt = () => _, zt = () => _[_.length - 2] ?? null, L = (t, e) => {
8
+ We(t);
9
+ try {
10
+ return e();
11
+ } finally {
12
+ Ue();
10
13
  }
11
- return n;
12
- }, Ne = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), Re = (t, e) => e, Ve = (t) => typeof t == "number" ? ke : typeof t == "string" ? $e : t instanceof Date ? Ne : Re;
13
- class se {
14
- /**
15
- * Creates a new instance of `ElementPosition`.
16
- * @param index - The index of the element.
17
- * @param total - The total number of elements in the collection.
18
- */
19
- constructor(e, s) {
20
- this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
14
+ }, Kt = (t) => {
15
+ const e = new j();
16
+ try {
17
+ return L(e, () => t(e));
18
+ } finally {
19
+ e.dispose();
21
20
  }
22
- /**
23
- * The counter of the element starting from 1.
24
- */
25
- counter;
26
- /**
27
- * Checks if the element is the first element in the collection.
28
- * @returns `true` if the element is the first element, `false` otherwise.
29
- */
30
- isFirst;
31
- /**
32
- * Checks if the counter of the element is even.
33
- * @returns `true` if the counter is even, `false` otherwise.
34
- */
35
- isEven;
36
- /**
37
- * Checks if the counter of the element is odd.
38
- * @returns `true` if the counter is odd, `false` otherwise.
39
- */
40
- isOdd;
41
- #e;
42
- /**
43
- * Checks if the element is the last element in the collection.
44
- * @returns `true` if the element is the last element, `false` otherwise.
45
- */
46
- get isLast() {
47
- return this.#e == null && (this.#e = this.total.map((e) => this.counter === e)), this.#e;
21
+ }, oe = (t) => {
22
+ const e = _.slice();
23
+ _.length = 0;
24
+ try {
25
+ return t();
26
+ } finally {
27
+ _.length = 0, _.push(...e);
48
28
  }
49
- dispose = () => {
50
- this.#e?.dispose(), this.#e = void 0;
51
- };
52
- }
53
- class m {
29
+ };
30
+ class g {
54
31
  /**
55
32
  * Represents a signal with a value of type T.
56
33
  *
@@ -102,10 +79,10 @@ class m {
102
79
  * @param equals - Function to compare two values for equality (defaults to strict equality)
103
80
  * @returns A Signal that represents the result of the Promise
104
81
  */
105
- static ofPromise = (e, s, r, n = (i, o) => i === o) => {
106
- const i = new m(s, n);
82
+ static ofPromise = (e, s, n, r = (i, o) => i === o) => {
83
+ const i = new g(s, r);
107
84
  return e.then((o) => i._setAndNotify(o)).catch((o) => {
108
- r != null ? i._setAndNotify(r(o)) : console.error(
85
+ n != null ? i._setAndNotify(n(o)) : console.error(
109
86
  "Unhandled promise rejection in Signal.ofPromise:",
110
87
  o
111
88
  );
@@ -168,17 +145,32 @@ class m {
168
145
  */
169
146
  on = (e, s = {}) => {
170
147
  s.skipInitial || e(this.get(), void 0);
171
- const r = s.once ? (i, o) => {
172
- n(), e(i, o);
148
+ const n = s.once ? (i, o) => {
149
+ r(), e(i, o);
173
150
  } : e;
174
- this._onValueListeners.push(r);
175
- const n = () => {
151
+ this._onValueListeners.push(n);
152
+ const r = () => {
176
153
  this._onValueListeners.splice(
177
- this._onValueListeners.indexOf(r),
154
+ this._onValueListeners.indexOf(n),
178
155
  1
179
- ), s.abortSignal != null && s.abortSignal.removeEventListener("abort", n);
156
+ ), s.abortSignal != null && s.abortSignal.removeEventListener("abort", r);
157
+ };
158
+ return s.abortSignal != null && s.abortSignal.addEventListener("abort", r), r;
159
+ };
160
+ /**
161
+ * Registers a listener function to be called whenever the value of the signal changes.
162
+ * The listener function will not be called with the current value of the signal.
163
+ * Returns a function that can be called to unregister the listener.
164
+ *
165
+ * @param listener - The listener function to be called when the value of the signal changes.
166
+ * @param options - Options for the listener.
167
+ */
168
+ onChange = (e, s = {}) => {
169
+ let n = 0;
170
+ const r = (i, o) => {
171
+ n++ > 0 && e(i, o);
180
172
  };
181
- return s.abortSignal != null && s.abortSignal.addEventListener("abort", n), n;
173
+ return this.on(r, s);
182
174
  };
183
175
  /**
184
176
  * @internal
@@ -186,7 +178,7 @@ class m {
186
178
  _setAndNotify = (e) => {
187
179
  if (this._disposed) return;
188
180
  const s = this._value;
189
- this.equals(s, e) || (this._value = e, this._onValueListeners.forEach((n) => n(e, s)));
181
+ this.equals(s, e) || (this._value = e, this._onValueListeners.forEach((r) => r(e, s)));
190
182
  };
191
183
  /**
192
184
  * @internal
@@ -256,20 +248,32 @@ class m {
256
248
  * )
257
249
  * ```
258
250
  *
251
+ * **Auto-Disposal:** The returned computed signal is automatically registered with the current
252
+ * disposal scope (if one exists). When used within a renderable or `WithScope()`, the signal
253
+ * will be automatically disposed when the component unmounts. No manual `OnDispose()` needed!
254
+ *
255
+ * ```typescript
256
+ * const MyComponent: Renderable = (ctx) => {
257
+ * const count = prop(0);
258
+ * const doubled = count.map(x => x * 2); // ✅ Auto-disposed
259
+ * return html.div(doubled);
260
+ * };
261
+ * ```
262
+ *
259
263
  * @typeParam O - The type of the transformed value
260
264
  * @param fn - Function that transforms the signal's value to a new value
261
265
  * @param equals - Optional function to determine if two transformed values are equal (defaults to strict equality)
262
- * @returns A new computed signal with the transformed value
266
+ * @returns A new computed signal with the transformed value (auto-registered with current scope)
263
267
  */
264
- map = (e, s = (r, n) => r === n) => {
265
- const r = new H(() => {
268
+ map = (e, s = (n, r) => n === r) => {
269
+ const n = new N(() => {
266
270
  try {
267
271
  return e(this.get());
268
- } catch (n) {
269
- throw console.error("Error in Signal.map:", n), n;
272
+ } catch (r) {
273
+ throw console.error("Error in Signal.map:", r), r;
270
274
  }
271
275
  }, s);
272
- return this.setDerivative(r), r;
276
+ return this.setDerivative(n), n;
273
277
  };
274
278
  /**
275
279
  * Returns a new Signal that applies the given function to the value of the current Signal,
@@ -281,15 +285,15 @@ class m {
281
285
  * Defaults to a strict equality check (===).
282
286
  * @returns A new Signal that emits the values of the resulting Signal.
283
287
  */
284
- flatMap = (e, s = (r, n) => r === n) => {
285
- const r = new H(() => {
288
+ flatMap = (e, s = (n, r) => n === r) => {
289
+ const n = new N(() => {
286
290
  try {
287
291
  return e(this.get()).get();
288
- } catch (n) {
289
- throw console.error("Error in Signal.flatMap:", n), n;
292
+ } catch (r) {
293
+ throw console.error("Error in Signal.flatMap:", r), r;
290
294
  }
291
295
  }, s);
292
- return this.setDerivative(r), r;
296
+ return this.setDerivative(n), n;
293
297
  };
294
298
  /**
295
299
  * Invokes a callback function with the current value of the signal, without modifying the signal.
@@ -319,16 +323,16 @@ class m {
319
323
  });
320
324
  }
321
325
  filter = (e, s) => {
322
- let r = s ?? this.get();
323
- const n = new H(() => {
326
+ let n = s ?? this.get();
327
+ const r = new N(() => {
324
328
  try {
325
329
  const i = this.get();
326
- return r = e(i) ? i : r;
330
+ return n = e(i) ? i : n;
327
331
  } catch (i) {
328
332
  throw console.error("Error in Signal.filter:", i), i;
329
333
  }
330
334
  }, this.equals);
331
- return this.setDerivative(n), n;
335
+ return this.setDerivative(r), r;
332
336
  };
333
337
  /**
334
338
  * Returns a new Computed object that applies the provided mapping function to the value of this Signal,
@@ -340,16 +344,16 @@ class m {
340
344
  * @param equals - Optional equality function to determine if two values are equal.
341
345
  * @returns - A new Computed object with the mapped and filtered values.
342
346
  */
343
- filterMap = (e, s, r = (n, i) => n === i) => {
344
- let n = s;
345
- const i = new H(() => {
347
+ filterMap = (e, s, n = (r, i) => r === i) => {
348
+ let r = s;
349
+ const i = new N(() => {
346
350
  try {
347
351
  const o = this.get(), l = e(o);
348
- return n = l ?? n;
352
+ return r = l ?? r;
349
353
  } catch (o) {
350
354
  throw console.error("Error in Signal.filterMap:", o), o;
351
355
  }
352
- }, r);
356
+ }, n);
353
357
  return this.setDerivative(i), i;
354
358
  };
355
359
  /**
@@ -365,8 +369,8 @@ class m {
365
369
  * @param equals - The equality function to compare the mapped values for equality.
366
370
  * @returns A property that holds the mapped value and can be observed for changes.
367
371
  */
368
- mapAsync = (e, s, r, n = (i, o) => i === o) => {
369
- const i = _(s, n);
372
+ mapAsync = (e, s, n, r = (i, o) => i === o) => {
373
+ const i = T(s, r);
370
374
  let o = 0, l = new AbortController();
371
375
  return i.onDispose(
372
376
  this.on(async (c) => {
@@ -377,8 +381,8 @@ class m {
377
381
  a === o && i.set(u);
378
382
  } catch (u) {
379
383
  if (a === o)
380
- if (r != null)
381
- i.set(r(u));
384
+ if (n != null)
385
+ i.set(n(u));
382
386
  else
383
387
  throw u;
384
388
  }
@@ -395,7 +399,7 @@ class m {
395
399
  * @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
396
400
  * @returns A new signal containing the mapped values.
397
401
  */
398
- mapMaybe = (e, s) => this.map((r) => e(r) ?? s);
402
+ mapMaybe = (e, s) => this.map((n) => e(n) ?? s);
399
403
  /**
400
404
  * Feeds a property into the signal and sets up disposal behavior.
401
405
  * @param prop - The property to feed into the signal.
@@ -403,8 +407,8 @@ class m {
403
407
  * @returns The input property.
404
408
  */
405
409
  feedProp = (e, s = !1) => {
406
- const r = this.on(e.set);
407
- return e.onDispose(r), s ? this.onDispose(e.dispose) : this.onDispose(r), e;
410
+ const n = this.on(e.set);
411
+ return e.onDispose(n), s ? this.onDispose(e.dispose) : this.onDispose(n), e;
408
412
  };
409
413
  /**
410
414
  * Derives a new property from the current signal.
@@ -416,7 +420,7 @@ class m {
416
420
  deriveProp = ({
417
421
  autoDisposeProp: e = !0,
418
422
  equals: s
419
- } = {}) => this.feedProp(_(this.get(), s), e);
423
+ } = {}) => this.feedProp(T(this.get(), s), e);
420
424
  /**
421
425
  * 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.
422
426
  * @returns A new signal that emits the same values as the current signal.
@@ -445,15 +449,36 @@ class m {
445
449
  }), e.onDispose(this.on(e.setDirty)), this.onDispose(e.dispose);
446
450
  };
447
451
  }
448
- const je = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
449
- class H extends m {
452
+ const Ge = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
453
+ class N extends g {
450
454
  /**
451
- * Represents a Signal object.
452
- * @param _fn - The function that returns the value of the signal.
455
+ * Creates a new Computed signal.
456
+ *
457
+ * **Auto-Registration:** This constructor automatically registers the signal with the current
458
+ * disposal scope (if one exists). This ensures that computed signals created by methods like
459
+ * `.map()`, `.flatMap()`, `.filter()`, etc. are automatically tracked and disposed.
460
+ *
461
+ * When a computed signal is created within a renderable or `WithScope()`, it will be
462
+ * automatically disposed when the component unmounts or the scope is disposed.
463
+ *
464
+ * To create a computed signal that outlives the current scope, use `untracked()`:
465
+ * ```typescript
466
+ * const globalSignal = untracked(() => mySignal.map(x => x * 2));
467
+ * // Remember to dispose manually: globalSignal.dispose()
468
+ * ```
469
+ *
470
+ * @param _fn - The function that computes the value of the signal.
453
471
  * @param equals - The function used to compare two values of type T for equality.
472
+ *
473
+ * @see {@link computed} - Factory function for creating computed signals with explicit dependencies
474
+ * @see {@link Signal.map} - Creates a computed signal by transforming values
475
+ * @see {@link getCurrentScope} - Get the current disposal scope
476
+ * @see {@link untracked} - Create signals outside of scope tracking
454
477
  */
455
478
  constructor(e, s) {
456
479
  super(void 0, s), this._fn = e, this.setDirty();
480
+ const n = ye();
481
+ n?.track(this);
457
482
  }
458
483
  /**
459
484
  * Checks if a value is an instance of `Computed`.
@@ -491,7 +516,7 @@ class H extends m {
491
516
  */
492
517
  _scheduleNotify = () => {
493
518
  const e = ++this._scheduleCount;
494
- je(() => {
519
+ Ge(() => {
495
520
  this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
496
521
  });
497
522
  };
@@ -501,8 +526,16 @@ class H extends m {
501
526
  get value() {
502
527
  return this.get();
503
528
  }
529
+ /**
530
+ * Disposes the computed signal and cancels any pending recomputations.
531
+ * This override increments the schedule count to invalidate all pending
532
+ * microtasks before disposing the signal.
533
+ */
534
+ dispose = () => {
535
+ this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
536
+ };
504
537
  }
505
- class Y extends m {
538
+ class Z extends g {
506
539
  /**
507
540
  * Checks if a value is a Prop.
508
541
  * @param value - The value to check.
@@ -538,15 +571,15 @@ class Y extends m {
538
571
  * @returns A dispatch function that can be used to update the state and trigger the effects.
539
572
  */
540
573
  reducer = (e, ...s) => {
541
- const r = this;
542
- return function n(i) {
543
- const o = r.value;
544
- r.update((l) => e(l, i)), !r.equals(o, r.value) && s.forEach(
574
+ const n = this;
575
+ return function r(i) {
576
+ const o = n.value;
577
+ n.update((l) => e(l, i)), !n.equals(o, n.value) && s.forEach(
545
578
  (l) => l({
546
579
  previousState: o,
547
- state: r.value,
580
+ state: n.value,
548
581
  action: i,
549
- dispatch: n
582
+ dispatch: r
550
583
  })
551
584
  );
552
585
  };
@@ -562,9 +595,9 @@ class Y extends m {
562
595
  * Defaults to a strict equality check (===).
563
596
  * @returns A Prop object representing the isomorphism.
564
597
  */
565
- iso = (e, s, r = (n, i) => n === i) => {
566
- const n = new Y(e(this.get()), r);
567
- return n.onDispose(this.on((i) => n.set(e(i)))), n.on((i) => this._setAndNotify(s(i))), n;
598
+ iso = (e, s, n = (r, i) => r === i) => {
599
+ const r = new Z(e(this.get()), n);
600
+ return r.onDispose(this.on((i) => r.set(e(i)))), r.on((i) => this._setAndNotify(s(i))), r;
568
601
  };
569
602
  /**
570
603
  * Returns a `Prop` that represents the value at the specified key of the current value.
@@ -586,38 +619,38 @@ class Y extends m {
586
619
  this._setAndNotify(e);
587
620
  }
588
621
  }
589
- const re = (t, e, s = (r, n) => r === n) => {
590
- const r = new H(t, s);
591
- return e.forEach((n) => n.setDerivative(r)), r;
592
- }, qe = (t, e, s = {}) => {
593
- let r = s.once ? () => {
622
+ const z = (t, e, s = (n, r) => n === r) => {
623
+ const n = new N(t, s);
624
+ return e.forEach((r) => r.setDerivative(n)), n;
625
+ }, Se = (t, e, s = {}) => {
626
+ let n = s.once ? () => {
594
627
  i(), t();
595
628
  } : t;
596
629
  if (s.skipInitial) {
597
630
  let o = !1;
598
- const l = r;
599
- r = () => {
631
+ const l = n;
632
+ n = () => {
600
633
  o ? l() : o = !0;
601
634
  };
602
635
  }
603
- const n = re(r, e), i = () => {
604
- n.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", i);
636
+ const r = z(n, e), i = () => {
637
+ r.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", i);
605
638
  };
606
639
  return s.abortSignal != null && s.abortSignal.addEventListener("abort", i), i;
607
- }, _ = (t, e = (s, r) => s === r) => new Y(t, e), Q = (t, e = (s, r) => s === r) => new m(t, e), ne = () => (
608
- /* c8 ignore next */
609
- typeof window < "u" ? window : void 0
610
- );
611
- function he(t) {
640
+ }, T = (t, e = (s, n) => s === n) => {
641
+ const s = new Z(t, e), n = ye();
642
+ return n?.track(s), s;
643
+ }, K = (t, e = (s, n) => s === n) => new g(t, e);
644
+ function we(t) {
612
645
  return t != null && t !== !1 && t !== 0 && t !== "";
613
646
  }
614
- function Fe(t) {
615
- return !he(t);
647
+ function Je(t) {
648
+ return !we(t);
616
649
  }
617
- function Be(t) {
650
+ function Xe(t) {
618
651
  return t == null;
619
652
  }
620
- function We(t) {
653
+ function Ye(t) {
621
654
  return t != null;
622
655
  }
623
656
  const y = {
@@ -632,7 +665,7 @@ const y = {
632
665
  * @param fn - The function to map the value.
633
666
  * @returns The mapped value.
634
667
  */
635
- map: (t, e) => m.is(t) ? t.map(e) : e(t),
668
+ map: (t, e) => g.is(t) ? t.map(e) : e(t),
636
669
  /**
637
670
  * Wraps a value or a Signal instance into a Signal.
638
671
  * If the value is already a Signal, it returns the value itself.
@@ -643,7 +676,7 @@ const y = {
643
676
  * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
644
677
  * @returns A Signal instance.
645
678
  */
646
- toSignal: (t, e) => m.is(t) ? t.derive() : Q(t, e),
679
+ toSignal: (t, e) => g.is(t) ? t.derive() : K(t, e),
647
680
  /**
648
681
  * Wraps a value in a `Signal` if it is not already a `Signal`.
649
682
  * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
@@ -659,14 +692,14 @@ const y = {
659
692
  * @param value - The value or Signal instance to get the value from.
660
693
  * @returns The value.
661
694
  */
662
- get: (t) => m.is(t) ? t.get() : t,
695
+ get: (t) => g.is(t) ? t.get() : t,
663
696
  /**
664
697
  * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
665
698
  * @param value - The value or Signal instance to add the listener to.
666
699
  * @param listener - The listener to call when the value changes.
667
700
  * @returns A function to remove the listener.
668
701
  */
669
- on: (t, e) => m.is(t) ? t.on(e) : (e(t), () => {
702
+ on: (t, e) => g.is(t) ? t.on(e) : (e(t), () => {
670
703
  }),
671
704
  /**
672
705
  * Disposes of a value or a Signal.
@@ -675,8 +708,16 @@ const y = {
675
708
  * @param value - The value or Signal instance to dispose of.
676
709
  */
677
710
  dispose: (t) => {
678
- m.is(t) && t.dispose();
711
+ g.is(t) && t.dispose();
679
712
  },
713
+ /**
714
+ * Returns a function that disposes of a value or a Signal.
715
+ * If the value is a Signal, it returns a function that disposes of the Signal.
716
+ * If the value is not a Signal, it returns a function that does nothing.
717
+ * @param value - The value or Signal instance to dispose of.
718
+ * @returns A function to dispose of the value or Signal.
719
+ */
720
+ disposeFn: (t) => () => y.dispose(t),
680
721
  /**
681
722
  * Derives a Prop from a Signal.
682
723
  * If the value is a Signal, it returns a new Prop with the derived value.
@@ -690,54 +731,246 @@ const y = {
690
731
  deriveProp: (t, {
691
732
  autoDisposeProp: e = !0,
692
733
  equals: s
693
- } = {}) => m.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : _(t, s),
734
+ } = {}) => g.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : T(t, s),
694
735
  /**
695
736
  * Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
696
737
  * @param value - The value or signal to check.
697
738
  * @returns A signal that emits `true` if the value is truthy, `false` otherwise.
698
739
  */
699
- truthy: (t) => y.map(t, he),
740
+ truthy: (t) => y.map(t, we),
700
741
  /**
701
742
  * Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
702
743
  * @param value - The value or signal to check.
703
744
  * @returns A signal that emits `true` if the value is falsy, `false` otherwise.
704
745
  */
705
- falsy: (t) => y.map(t, Fe),
746
+ falsy: (t) => y.map(t, Je),
706
747
  /**
707
748
  * Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
708
749
  * @param value - The value or signal to check.
709
750
  * @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
710
751
  */
711
- nil: (t) => y.map(t, Be),
752
+ nil: (t) => y.map(t, Xe),
712
753
  /**
713
754
  * Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
714
755
  * @param value - The value or signal to check.
715
756
  * @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
716
757
  */
717
- defined: (t) => y.map(t, We)
718
- }, ie = (...t) => (e, s) => {
758
+ defined: (t) => y.map(t, Ye)
759
+ }, ee = (...t) => (e, s) => {
719
760
  if (t.length === 1)
720
761
  return y.toSignal(t[0]).map(e);
721
- const r = t.filter((n) => m.is(n));
722
- return re(
723
- () => e(...t.map((n) => y.get(n))),
724
- r,
762
+ const n = t.filter((r) => g.is(r));
763
+ return z(
764
+ () => e(...t.map((r) => y.get(r))),
765
+ n,
725
766
  s
726
767
  );
727
- }, Ht = (t) => {
768
+ }, es = (t) => {
728
769
  const e = Object.keys(t);
729
- return ie(...Object.values(t))(
730
- (...s) => Object.fromEntries(e.map((r, n) => [r, s[n]]))
770
+ return ee(...Object.values(t))(
771
+ (...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
731
772
  );
732
- }, kt = (...t) => (e, s = {}) => {
733
- const r = t.filter((n) => m.is(n));
734
- return qe(
773
+ }, Qe = (...t) => (e, s = {}) => {
774
+ const n = t.filter((r) => g.is(r));
775
+ return Se(
735
776
  () => e(...t.map(y.get)),
736
- r,
777
+ n,
737
778
  s
738
779
  );
739
780
  };
740
- class fe {
781
+ class j {
782
+ _signals = /* @__PURE__ */ new Set();
783
+ _callbacks = [];
784
+ _disposed = !1;
785
+ /**
786
+ * Register a signal with this scope for automatic disposal.
787
+ *
788
+ * @param signal - The signal to track
789
+ * @throws Error if the scope has already been disposed
790
+ * @throws Error if the signal has already been disposed
791
+ * @public
792
+ */
793
+ track(e) {
794
+ if (this._disposed)
795
+ throw new Error("Cannot track signal in disposed scope");
796
+ if (e.isDisposed())
797
+ throw new Error("Cannot track already disposed signal");
798
+ this._signals.add(e);
799
+ }
800
+ /**
801
+ * Register a disposal callback to be called when this scope is disposed.
802
+ * Callbacks are called before signals are disposed.
803
+ * Use this for cleanup that doesn't need the `removeTree` parameter.
804
+ *
805
+ * @param callback - The callback to call on disposal
806
+ * @throws Error if the scope has already been disposed
807
+ * @public
808
+ */
809
+ onDispose(e) {
810
+ if (this._disposed)
811
+ throw new Error("Cannot register callback in disposed scope");
812
+ this._callbacks.push(e);
813
+ }
814
+ /**
815
+ * Dispose all signals tracked by this scope.
816
+ * This method is idempotent - calling it multiple times is safe.
817
+ *
818
+ * @public
819
+ */
820
+ dispose() {
821
+ if (!this._disposed) {
822
+ this._disposed = !0;
823
+ for (const e of this._callbacks)
824
+ try {
825
+ e();
826
+ } catch (s) {
827
+ console.error("Error in disposal callback:", s);
828
+ }
829
+ this._callbacks.length = 0;
830
+ for (const e of this._signals)
831
+ e.dispose();
832
+ this._signals.clear();
833
+ }
834
+ }
835
+ /**
836
+ * Check if this scope has been disposed.
837
+ *
838
+ * @returns true if the scope has been disposed
839
+ * @public
840
+ */
841
+ get disposed() {
842
+ return this._disposed;
843
+ }
844
+ /**
845
+ * Creates a prop signal and tracks it in this scope.
846
+ * Use this method in async contexts where automatic tracking doesn't work.
847
+ *
848
+ * @param value - The initial value
849
+ * @param equals - Optional equality function
850
+ * @returns A tracked Prop signal
851
+ * @public
852
+ */
853
+ prop(e, s) {
854
+ const n = oe(() => T(e, s));
855
+ return this.track(n), n;
856
+ }
857
+ /**
858
+ * Creates a computed signal and tracks it in this scope.
859
+ * Use this method in async contexts where automatic tracking doesn't work.
860
+ *
861
+ * @param fn - The computation function
862
+ * @param dependencies - Array of signals this computed depends on
863
+ * @param equals - Optional equality function
864
+ * @returns A tracked Computed signal
865
+ * @public
866
+ */
867
+ computed(e, s, n) {
868
+ const r = oe(() => z(e, s, n));
869
+ return this.track(r), r;
870
+ }
871
+ /**
872
+ * Creates an effect and tracks it in this scope.
873
+ * Use this method in async contexts where automatic tracking doesn't work.
874
+ *
875
+ * @param fn - The effect function
876
+ * @param signals - Array of signals to listen to
877
+ * @param options - Optional listener options
878
+ * @returns A clear function (the effect itself is tracked in the scope)
879
+ * @public
880
+ */
881
+ effect(e, s, n) {
882
+ return L(this, () => Se(e, s, n));
883
+ }
884
+ /**
885
+ * Creates a computed signal with curried signature and tracks it in this scope.
886
+ * Use this method in async contexts where automatic tracking doesn't work.
887
+ *
888
+ * @param args - Values or signals to compute from
889
+ * @returns A function that takes the computation function and returns a tracked Computed signal
890
+ * @public
891
+ */
892
+ computedOf(...e) {
893
+ return (s, n) => {
894
+ const r = oe(() => ee(...e)(s, n));
895
+ return this.track(r), r;
896
+ };
897
+ }
898
+ /**
899
+ * Creates an effect with curried signature and tracks it in this scope.
900
+ * Use this method in async contexts where automatic tracking doesn't work.
901
+ *
902
+ * @param args - Values or signals to listen to
903
+ * @returns A function that takes the effect function and returns a clear function
904
+ * @public
905
+ */
906
+ effectOf(...e) {
907
+ return (s, n) => L(this, () => Qe(...e)(s, n));
908
+ }
909
+ }
910
+ const Ze = (t, e, s) => t + (e - t) * s, pe = 97, ze = (t, e, s) => {
911
+ const n = Math.max(t.length, e.length);
912
+ let r = "";
913
+ for (let i = 0; i < n; i++) {
914
+ let o = t.charCodeAt(i);
915
+ isNaN(o) && (o = pe);
916
+ let l = e.charCodeAt(i);
917
+ isNaN(l) && (l = pe), r += String.fromCharCode(o + (l - o) * s);
918
+ }
919
+ return r;
920
+ }, Ke = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), et = (t, e) => e, tt = (t) => typeof t == "number" ? Ze : typeof t == "string" ? ze : t instanceof Date ? Ke : et;
921
+ class le {
922
+ /**
923
+ * Creates a new instance of `ElementPosition`.
924
+ * @param index - The index of the element.
925
+ * @param total - The total number of elements in the collection.
926
+ */
927
+ constructor(e, s) {
928
+ this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
929
+ }
930
+ /**
931
+ * The counter of the element starting from 1.
932
+ */
933
+ counter;
934
+ /**
935
+ * Checks if the element is the first element in the collection.
936
+ * @returns `true` if the element is the first element, `false` otherwise.
937
+ */
938
+ isFirst;
939
+ /**
940
+ * Checks if the counter of the element is even.
941
+ * @returns `true` if the counter is even, `false` otherwise.
942
+ */
943
+ isEven;
944
+ /**
945
+ * Checks if the counter of the element is odd.
946
+ * @returns `true` if the counter is odd, `false` otherwise.
947
+ */
948
+ isOdd;
949
+ #e;
950
+ /**
951
+ * Checks if the element is the last element in the collection.
952
+ * @returns `true` if the element is the last element, `false` otherwise.
953
+ */
954
+ get isLast() {
955
+ return this.#e == null && (this.#e = this.total.map((e) => this.counter === e)), this.#e;
956
+ }
957
+ /**
958
+ * Disposes the internal signal created by `isLast`.
959
+ *
960
+ * **Note:** With automatic signal disposal, this method is now a no-op when used within
961
+ * a disposal scope (e.g., inside a renderable). The signal created by `isLast` is
962
+ * automatically tracked and disposed when the scope ends. This method is kept for
963
+ * backward compatibility and for cases where ElementPosition is used outside a scope.
964
+ */
965
+ dispose = () => {
966
+ this.#e?.dispose(), this.#e = void 0;
967
+ };
968
+ }
969
+ const ue = () => (
970
+ /* c8 ignore next */
971
+ typeof window < "u" ? window : void 0
972
+ );
973
+ class be {
741
974
  _store = /* @__PURE__ */ new Map();
742
975
  /**
743
976
  * Retrieves the value associated with the specified key from the memory store.
@@ -754,164 +987,169 @@ class fe {
754
987
  this._store.set(e, s);
755
988
  };
756
989
  }
757
- const de = ({
990
+ let ce = null, ae = null;
991
+ const st = () => (ce || (ce = new be()), ce), nt = () => (ae || (ae = new be()), ae), _e = ({
758
992
  key: t,
759
993
  defaultValue: e,
760
994
  store: s,
761
- serialize: r = JSON.stringify,
762
- deserialize: n = JSON.parse,
995
+ serialize: n = JSON.stringify,
996
+ deserialize: r = JSON.parse,
763
997
  equals: i = (a, u) => a === u,
764
998
  onLoad: o = (a) => a,
765
999
  syncTabs: l = !0,
766
1000
  onKeyChange: c = "load"
767
1001
  }) => {
768
1002
  let a = y.get(t);
769
- const u = s.getItem(a), p = new Y(
770
- u != null ? o(n(u)) : typeof e == "function" ? e() : e,
1003
+ const u = s.getItem(a), h = new Z(
1004
+ u != null ? o(r(u)) : typeof e == "function" ? e() : e,
771
1005
  i
772
- ), d = ne(), f = l && typeof d?.BroadcastChannel == "function";
773
- let g = !1, w = null, C = null;
774
- const S = (b) => {
775
- if (!f) return null;
776
- const D = `tempo:storedProp:${b}`, A = new d.BroadcastChannel(D), O = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, x = (j) => {
777
- const v = j.data;
778
- if (!(v == null || typeof v != "object" || v.key !== b || typeof v.value != "string" || v.sourceId != null && v.sourceId === O))
1006
+ ), p = ue(), d = l && typeof p?.BroadcastChannel == "function";
1007
+ let m = !1, w = null, D = null;
1008
+ const b = (S) => {
1009
+ if (!d) return null;
1010
+ const M = `tempo:storedProp:${S}`, A = new p.BroadcastChannel(M), k = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, x = (F) => {
1011
+ const v = F.data;
1012
+ if (!(v == null || typeof v != "object" || v.key !== S || typeof v.value != "string" || v.sourceId != null && v.sourceId === k))
779
1013
  try {
780
- g = !0;
781
- const te = o(n(v.value));
782
- p.set(te);
783
- } catch (te) {
1014
+ m = !0;
1015
+ const ie = o(r(v.value));
1016
+ h.set(ie);
1017
+ } catch (ie) {
784
1018
  console.warn(
785
- `Failed to sync storedProp for key "${b}" via BroadcastChannel`,
786
- te
1019
+ `Failed to sync storedProp for key "${S}" via BroadcastChannel`,
1020
+ ie
787
1021
  );
788
1022
  } finally {
789
- g = !1;
1023
+ m = !1;
790
1024
  }
791
1025
  };
792
- return A.addEventListener("message", x), p.onDispose(() => {
1026
+ return A.addEventListener("message", x), h.onDispose(() => {
793
1027
  A?.removeEventListener("message", x), A?.close();
794
- }), { channel: A, instanceId: O, handleMessage: x };
795
- }, P = S(a);
796
- P && (w = P.channel, C = P.instanceId);
797
- const ee = (b) => {
798
- const D = a;
799
- if (D === b) return;
800
- const A = p.get(), O = r(A);
801
- if (s.setItem(D, O), w != null && (w.close(), w = null, C = null), a = b, c === "load") {
802
- const j = s.getItem(b);
803
- if (j != null)
1028
+ }), { channel: A, instanceId: k, handleMessage: x };
1029
+ }, P = b(a);
1030
+ P && (w = P.channel, D = P.instanceId);
1031
+ const re = (S) => {
1032
+ const M = a;
1033
+ if (M === S) return;
1034
+ const A = h.get(), k = n(A);
1035
+ if (s.setItem(M, k), w != null && (w.close(), w = null, D = null), a = S, c === "load") {
1036
+ const F = s.getItem(S);
1037
+ if (F != null)
804
1038
  try {
805
- const v = o(n(j));
806
- p.set(v);
1039
+ const v = o(r(F));
1040
+ h.set(v);
807
1041
  } catch (v) {
808
1042
  console.warn(
809
- `Failed to load storedProp from new key "${b}"`,
1043
+ `Failed to load storedProp from new key "${S}"`,
810
1044
  v
811
1045
  );
812
1046
  }
813
1047
  else
814
- s.setItem(b, O);
815
- } else c === "migrate" && s.setItem(b, O);
816
- const x = S(b);
817
- x && (w = x.channel, C = x.instanceId);
818
- };
819
- return m.is(t) && p.onDispose(t.on(ee)), p.on((b, D) => {
820
- const A = r(b);
821
- s.setItem(a, A), w != null && !g && D !== void 0 && C != null && w.postMessage({
1048
+ s.setItem(S, k);
1049
+ } else c === "migrate" && s.setItem(S, k);
1050
+ const x = b(S);
1051
+ x && (w = x.channel, D = x.instanceId);
1052
+ };
1053
+ return g.is(t) && h.onDispose(t.on(re)), h.on((S, M) => {
1054
+ const A = n(S);
1055
+ s.setItem(a, A), w != null && !m && M !== void 0 && D != null && w.postMessage({
822
1056
  key: a,
823
1057
  value: A,
824
- sourceId: C
1058
+ sourceId: D
825
1059
  });
826
- }), p;
827
- }, $t = (t) => de({
828
- ...t,
829
- /* c8 ignore next 3 */
830
- store: ne()?.localStorage ?? new fe()
831
- }), Nt = (t) => de({
832
- ...t,
833
- /* c8 ignore next 3 */
834
- store: ne()?.sessionStorage ?? new fe()
835
- });
836
- function ae(t) {
1060
+ }), h;
1061
+ }, ts = (t) => {
1062
+ const s = ue()?.localStorage, n = s && typeof s.getItem == "function" ? s : st();
1063
+ return _e({
1064
+ ...t,
1065
+ store: n
1066
+ });
1067
+ }, ss = (t) => {
1068
+ const s = ue()?.sessionStorage, n = s && typeof s.getItem == "function" ? s : nt();
1069
+ return _e({
1070
+ ...t,
1071
+ store: n
1072
+ });
1073
+ };
1074
+ function ge(t) {
837
1075
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
838
1076
  }
839
- const Ue = (t, e, s, r) => {
840
- const n = r?.duration ?? 300, i = r?.easing ?? ((S) => S), o = r?.equals ?? ((S, P) => S === P);
841
- let l = r?.interpolate, c = t, a = e(), u = performance.now(), p = null, d = !0;
842
- const f = new H(e, o), g = _(t, o);
843
- g.onDispose(() => {
844
- p !== null && cancelAnimationFrame(p);
845
- }), g.onDispose(f.dispose), s.forEach((S) => {
846
- S.setDerivative(f), S.onDispose(g.dispose);
1077
+ const rt = (t, e, s, n) => {
1078
+ const r = n?.duration ?? 300, i = n?.easing ?? ((b) => b), o = n?.equals ?? ((b, P) => b === P);
1079
+ let l = n?.interpolate, c = t, a = e(), u = performance.now(), h = null, p = !0;
1080
+ const d = new N(e, o), m = T(t, o);
1081
+ m.onDispose(() => {
1082
+ h !== null && cancelAnimationFrame(h);
1083
+ }), m.onDispose(d.dispose), s.forEach((b) => {
1084
+ b.setDerivative(d), b.onDispose(m.dispose);
847
1085
  });
848
- const w = (S) => {
849
- a = S, u = performance.now(), c = g.value, d && (d = !1, p = ae(C));
850
- }, C = () => {
851
- const P = (performance.now() - u) / y.get(n), ee = i(P);
852
- l == null && (l = Ve(c));
853
- let b = l(c, a, ee);
854
- P >= 1 ? (d = !0, b = a) : p = ae(C), g.set(b);
855
- };
856
- return f.on(w), g;
857
- }, Rt = (t, e) => {
858
- const { initialValue: s, ...r } = e ?? {};
859
- return Ue(
1086
+ const w = (b) => {
1087
+ a = b, u = performance.now(), c = m.value, p && (p = !1, h = ge(D));
1088
+ }, D = () => {
1089
+ const P = (performance.now() - u) / y.get(r), re = i(P);
1090
+ l == null && (l = tt(c));
1091
+ let S = l(c, a, re);
1092
+ P >= 1 ? (p = !0, S = a) : h = ge(D), m.set(S);
1093
+ };
1094
+ return d.on(w), m;
1095
+ }, ns = (t, e) => {
1096
+ const { initialValue: s, ...n } = e ?? {};
1097
+ return rt(
860
1098
  /* c8 ignore next 2 */
861
1099
  s ?? t.get(),
862
1100
  t.get,
863
1101
  [t],
864
- r
1102
+ n
865
1103
  );
866
- }, Je = (t, e) => {
867
- const s = Object.values(t).filter(m.is), r = Object.keys(t);
868
- return re(() => {
869
- const n = {};
870
- for (const i of r)
871
- n[i] = y.get(t[i]);
872
- return e(n);
1104
+ }, it = (t, e) => {
1105
+ const s = Object.values(t).filter(g.is), n = Object.keys(t);
1106
+ return z(() => {
1107
+ const r = {};
1108
+ for (const i of n)
1109
+ r[i] = y.get(t[i]);
1110
+ return e(r);
873
1111
  }, s);
874
- }, Vt = (t) => Je(t, (e) => e), jt = (t, e) => {
875
- const s = _(t.get());
876
- let r = null;
877
- const n = t.on((i) => {
878
- r != null && clearTimeout(r), r = setTimeout(
1112
+ }, rs = (t) => it(t, (e) => e), is = (t, e) => {
1113
+ const s = T(t.get());
1114
+ let n = null;
1115
+ const r = t.on((i) => {
1116
+ n != null && clearTimeout(n), n = setTimeout(
879
1117
  () => {
880
- r = null, s.set(i);
1118
+ n = null, s.set(i);
881
1119
  },
882
1120
  typeof e == "function" ? e(i) : e
883
1121
  );
884
1122
  });
885
1123
  return s.onDispose(() => {
886
- n(), r != null && clearTimeout(r);
1124
+ r(), n != null && clearTimeout(n);
887
1125
  }), s;
888
- }, qt = (t) => {
1126
+ }, os = (t) => {
889
1127
  let e;
890
1128
  return t.map((s) => {
891
- const r = e;
892
- return e = s, r;
1129
+ const n = e;
1130
+ return e = s, n;
893
1131
  });
894
- }, Ft = ({
1132
+ }, ls = ({
895
1133
  size: t = void 0,
896
1134
  signal: e
897
1135
  }) => {
898
1136
  const s = [];
899
- return e.map((r) => (s.push(r), t != null && s.length > t && s.shift(), s.slice()));
900
- }, Bt = (t) => (...e) => ie(
1137
+ return e.map((n) => (s.push(n), t != null && s.length > t && s.shift(), s.slice()));
1138
+ }, cs = (t) => (...e) => ee(
901
1139
  t,
902
1140
  ...e
903
- )((s, ...r) => s(...r));
904
- function Wt(...t) {
905
- return ie(...t)((...e) => {
1141
+ )((s, ...n) => s(...n));
1142
+ function as(...t) {
1143
+ return ee(...t)((...e) => {
906
1144
  for (const s of e) if (s != null) return s;
907
1145
  });
908
1146
  }
909
- const pe = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), me = /* @__PURE__ */ new Set(["selected"]), ge = /* @__PURE__ */ new Set([
1147
+ const ve = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Te = /* @__PURE__ */ new Set(["selected"]), Ae = /* @__PURE__ */ new Set([
910
1148
  "rowSpan",
911
1149
  "colSpan",
912
1150
  "tabIndex",
913
1151
  "valueAsNumber"
914
- ]), ye = /* @__PURE__ */ new Set(["valueAsDate"]), be = /* @__PURE__ */ new Set([
1152
+ ]), Ee = /* @__PURE__ */ new Set(["valueAsDate"]), Ce = /* @__PURE__ */ new Set([
915
1153
  "value",
916
1154
  "textContent",
917
1155
  "innerText",
@@ -919,28 +1157,28 @@ const pe = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), me = /* @
919
1157
  "outerHTML",
920
1158
  "className",
921
1159
  "classList"
922
- ]), Ge = (t, e) => me.has(t) ? (s) => {
1160
+ ]), ot = (t, e) => Te.has(t) ? (s) => {
923
1161
  s == null || s !== !0 ? e.removeAttribute(t) : e.setAttribute(t, "");
924
- } : pe.has(t) ? (s) => {
1162
+ } : ve.has(t) ? (s) => {
925
1163
  s == null ? e[t] = null : e[t] = !!s;
926
- } : ge.has(t) ? (s) => {
1164
+ } : Ae.has(t) ? (s) => {
927
1165
  s == null ? e[t] = null : e[t] = Number(s);
928
- } : ye.has(t) ? (s) => {
1166
+ } : Ee.has(t) ? (s) => {
929
1167
  s == null ? e[t] = null : e[t] = s;
930
- } : be.has(t) ? (s) => {
1168
+ } : Ce.has(t) ? (s) => {
931
1169
  s == null ? e[t] = null : e[t] = String(s);
932
1170
  } : (s) => {
933
1171
  s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
934
- }, Xe = (t, e) => me.has(t) ? () => e.hasAttribute(t) : pe.has(t) ? () => !!e[t] : ge.has(t) ? () => Number(e[t]) : ye.has(t) ? () => e[t] : be.has(t) ? () => String(e[t]) : () => e.getAttribute(t), B = (t) => {
1172
+ }, lt = (t, e) => Te.has(t) ? () => e.hasAttribute(t) : ve.has(t) ? () => !!e[t] : Ae.has(t) ? () => Number(e[t]) : Ee.has(t) ? () => e[t] : Ce.has(t) ? () => String(e[t]) : () => e.getAttribute(t), U = (t) => {
935
1173
  const e = t;
936
1174
  e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
937
- }, Ye = (t) => we(t) ? t : t.parentElement, we = (t) => t.nodeType === 1;
938
- class Se extends Error {
1175
+ }, ct = (t) => De(t) ? t : t.parentElement, De = (t) => t.nodeType === 1;
1176
+ class Pe extends Error {
939
1177
  constructor(e) {
940
1178
  super(`Provider not found: ${e.description}`);
941
1179
  }
942
1180
  }
943
- class k {
1181
+ class $ {
944
1182
  /**
945
1183
  * Constructs a new `DOMContext` instance.
946
1184
  *
@@ -950,8 +1188,8 @@ class k {
950
1188
  * @param providers - The `Providers` instance associated with this context.
951
1189
  * @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
952
1190
  */
953
- constructor(e, s, r, n) {
954
- this.document = e, this.element = s, this.reference = r, this.providers = n;
1191
+ constructor(e, s, n, r) {
1192
+ this.document = e, this.element = s, this.reference = n, this.providers = r;
955
1193
  }
956
1194
  /**
957
1195
  * Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
@@ -961,8 +1199,8 @@ class k {
961
1199
  * @param providers - The providers to associate with the `DOMContext`.
962
1200
  * @returns A new `DOMContext` instance.
963
1201
  */
964
- static of(e, s, r) {
965
- return new k(e.ownerDocument, e, s, r);
1202
+ static of(e, s, n) {
1203
+ return new $(e.ownerDocument, e, s, n);
966
1204
  }
967
1205
  /**
968
1206
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
@@ -995,8 +1233,8 @@ class k {
995
1233
  * @returns A new DOMContext focused on the newly created child element
996
1234
  */
997
1235
  makeChildElement = (e, s) => {
998
- const r = this.createElement(e, s);
999
- return this.appendOrInsert(r), this.withElement(r);
1236
+ const n = this.createElement(e, s);
1237
+ return this.appendOrInsert(n), this.withElement(n);
1000
1238
  };
1001
1239
  /**
1002
1240
  * Creates a new text node with the specified text content.
@@ -1047,7 +1285,7 @@ class k {
1047
1285
  * @param element - The DOM element to use in the new `DOMContext` instance.
1048
1286
  * @returns A new `DOMContext` instance with the provided `element`.
1049
1287
  */
1050
- withElement = (e) => new k(this.document, e, void 0, this.providers);
1288
+ withElement = (e) => new $(this.document, e, void 0, this.providers);
1051
1289
  /**
1052
1290
  * Creates a portal to render content in a different part of the DOM tree.
1053
1291
  *
@@ -1104,7 +1342,7 @@ class k {
1104
1342
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
1105
1343
  * @returns A new `DOMContext` instance with the specified reference.
1106
1344
  */
1107
- withReference = (e) => new k(this.document, this.element, e, this.providers);
1345
+ withReference = (e) => new $(this.document, this.element, e, this.providers);
1108
1346
  /**
1109
1347
  * Sets a provider for the given provider mark.
1110
1348
  *
@@ -1112,9 +1350,9 @@ class k {
1112
1350
  * @param value - The provider to set for the given mark.
1113
1351
  * @returns A new `DOMContext` instance with the specified provider.
1114
1352
  */
1115
- setProvider = (e, s, r) => new k(this.document, this.element, this.reference, {
1353
+ setProvider = (e, s, n) => new $(this.document, this.element, this.reference, {
1116
1354
  ...this.providers,
1117
- [e]: [s, r]
1355
+ [e]: [s, n]
1118
1356
  });
1119
1357
  /**
1120
1358
  * Retrieves a provider for the given provider mark.
@@ -1125,12 +1363,12 @@ class k {
1125
1363
  */
1126
1364
  getProvider = (e) => {
1127
1365
  if (this.providers[e] === void 0)
1128
- throw new Se(e);
1129
- const [s, r] = this.providers[e];
1130
- return { value: s, onUse: r };
1366
+ throw new Pe(e);
1367
+ const [s, n] = this.providers[e];
1368
+ return { value: s, onUse: n };
1131
1369
  };
1132
1370
  clear = (e) => {
1133
- e && (this.reference !== void 0 ? B(this.reference) : B(this.element));
1371
+ e && (this.reference !== void 0 ? U(this.reference) : U(this.element));
1134
1372
  };
1135
1373
  /**
1136
1374
  * Adds classes to the element.
@@ -1158,10 +1396,10 @@ class k {
1158
1396
  * @param options - The options for the event listener.
1159
1397
  * @returns A function to remove the event listener.
1160
1398
  */
1161
- on = (e, s, r) => {
1162
- const n = (i) => s(i, this);
1163
- return this.element.addEventListener(e, n, r), (i) => {
1164
- i && this.element.removeEventListener(e, n, r);
1399
+ on = (e, s, n) => {
1400
+ const r = (i) => s(i, this);
1401
+ return this.element.addEventListener(e, r, n), (i) => {
1402
+ i && this.element.removeEventListener(e, r, n);
1165
1403
  };
1166
1404
  };
1167
1405
  /**
@@ -1200,55 +1438,57 @@ class k {
1200
1438
  */
1201
1439
  getStyle = (e) => this.element.style[e];
1202
1440
  makeAccessors = (e) => ({
1203
- get: Xe(e, this.element),
1204
- set: Ge(e, this.element)
1441
+ get: lt(e, this.element),
1442
+ set: ot(e, this.element)
1205
1443
  });
1206
1444
  getWindow = () => this.document.defaultView;
1207
1445
  }
1208
- const Qe = (t) => Symbol(t), oe = (t, e) => {
1209
- const s = t(e);
1210
- return (r = !0) => s(r);
1211
- }, Ut = (t, e, { doc: s, clear: r, disposeWithParent: n = !0, providers: i = {} } = {}) => {
1446
+ const at = (t) => Symbol(t), he = (t, e) => {
1447
+ const s = new j(), n = L(s, () => t(e));
1448
+ return (r = !0) => {
1449
+ s.dispose(), n(r);
1450
+ };
1451
+ }, us = (t, e, { doc: s, clear: n, disposeWithParent: r = !0, providers: i = {} } = {}) => {
1212
1452
  const o = typeof e == "string" ? (s ?? document).querySelector(e) : e;
1213
1453
  if (o === null)
1214
- throw new Ze(
1454
+ throw new ut(
1215
1455
  `Cannot find element by selector for render: ${e}`
1216
1456
  );
1217
- r !== !1 && (s ?? o.ownerDocument) != null && o.nodeType === 1 && (o.innerHTML = "");
1218
- const l = Ye(o), c = we(o) ? void 0 : o, a = k.of(l, c, i), u = oe(t, a);
1219
- let p;
1220
- return n && (p = new MutationObserver((d) => {
1221
- d[0]?.removedNodes.forEach((f) => {
1222
- f === o && (p?.disconnect(), u(o.nodeType !== 1));
1457
+ n !== !1 && (s ?? o.ownerDocument) != null && o.nodeType === 1 && (o.innerHTML = "");
1458
+ const l = ct(o), c = De(o) ? void 0 : o, a = $.of(l, c, i), u = he(t, a);
1459
+ let h;
1460
+ return r && (h = new MutationObserver((p) => {
1461
+ p[0]?.removedNodes.forEach((d) => {
1462
+ d === o && (h?.disconnect(), u(o.nodeType !== 1));
1223
1463
  });
1224
- }), p.observe(o.parentElement, {
1464
+ }), h.observe(o.parentElement, {
1225
1465
  childList: !0,
1226
1466
  subtree: !1,
1227
1467
  attributes: !1
1228
1468
  })), () => {
1229
- p?.disconnect(), u(!0);
1469
+ h?.disconnect(), u(!0);
1230
1470
  };
1231
- }, Jt = (t, {
1471
+ }, hs = (t, {
1232
1472
  startUrl: e = "https://example.com",
1233
1473
  selector: s,
1234
- providers: r = {}
1474
+ providers: n = {}
1235
1475
  } = {
1236
1476
  selector: "body"
1237
1477
  }) => {
1238
- const n = y.toSignal(e).deriveProp(), i = new Ee(s, void 0), o = new $(i, void 0, { currentURL: n }, r);
1478
+ const r = y.toSignal(e).deriveProp(), i = new ke(s, void 0), o = new R(i, void 0, { currentURL: r }, n);
1239
1479
  return {
1240
- clear: oe(t(), o),
1480
+ clear: he(t(), o),
1241
1481
  root: i,
1242
- currentURL: n
1482
+ currentURL: r
1243
1483
  };
1244
1484
  };
1245
- class Ze extends Error {
1485
+ class ut extends Error {
1246
1486
  constructor(e) {
1247
1487
  super(e);
1248
1488
  }
1249
1489
  }
1250
- const Te = "data-tts-node", W = "data-tts-class", U = "data-tts-style", J = "data-tts-html", G = "data-tts-text", X = "data-tts-attrs";
1251
- class Gt {
1490
+ const xe = "data-tts-node", G = "data-tts-class", J = "data-tts-style", X = "data-tts-html", Y = "data-tts-text", Q = "data-tts-attrs";
1491
+ class fs {
1252
1492
  /**
1253
1493
  * Selects elements from the headless environment.
1254
1494
  * @param selector - The selector to select elements from. The supported selectors are CSS selectors whose complexity depends on the adapter implementation.
@@ -1325,18 +1565,18 @@ class Gt {
1325
1565
  constructor({
1326
1566
  select: e,
1327
1567
  getAttribute: s,
1328
- setAttribute: r,
1329
- getClass: n,
1568
+ setAttribute: n,
1569
+ getClass: r,
1330
1570
  setClass: i,
1331
1571
  getStyles: o,
1332
1572
  setStyles: l,
1333
1573
  appendHTML: c,
1334
1574
  getInnerHTML: a,
1335
1575
  setInnerHTML: u,
1336
- getInnerText: p,
1337
- setInnerText: d
1576
+ getInnerText: h,
1577
+ setInnerText: p
1338
1578
  }) {
1339
- this.select = e, this.getAttribute = s, this.setAttribute = r, this.getClass = n, this.setClass = i, this.getStyles = o, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = u, this.getInnerText = p, this.setInnerText = d;
1579
+ this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = i, this.getStyles = o, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = u, this.getInnerText = h, this.setInnerText = p;
1340
1580
  }
1341
1581
  /**
1342
1582
  * Sets the content of the root element from a HeadlessPortal. Generally this will be the same instance that is
@@ -1347,47 +1587,47 @@ class Gt {
1347
1587
  * when you render on the server and then hydrate on the client.
1348
1588
  */
1349
1589
  setFromRoot = (e, s) => {
1350
- e.getPortals().forEach((n) => {
1351
- const i = typeof n.selector == "string" ? this.select(n.selector) : [n.selector];
1590
+ e.getPortals().forEach((r) => {
1591
+ const i = typeof r.selector == "string" ? this.select(r.selector) : [r.selector];
1352
1592
  for (const o of i) {
1353
1593
  if (o == null)
1354
1594
  throw new Error(
1355
- `Cannot find element by selector for render: ${n.selector}`
1595
+ `Cannot find element by selector for render: ${r.selector}`
1356
1596
  );
1357
- if (n.hasChildren() && this.appendHTML(o, n.contentToHTML(s)), n.hasInnerHTML()) {
1597
+ if (r.hasChildren() && this.appendHTML(o, r.contentToHTML(s)), r.hasInnerHTML()) {
1358
1598
  if (s) {
1359
1599
  const l = this.getInnerHTML(o);
1360
- l != null && this.setAttribute(o, J, l);
1600
+ l != null && this.setAttribute(o, X, l);
1361
1601
  }
1362
- this.setInnerHTML(o, n.getInnerHTML());
1602
+ this.setInnerHTML(o, r.getInnerHTML());
1363
1603
  }
1364
- if (n.hasInnerText()) {
1604
+ if (r.hasInnerText()) {
1365
1605
  if (s) {
1366
1606
  const l = this.getInnerText(o);
1367
- l != null && this.setAttribute(o, G, l);
1607
+ l != null && this.setAttribute(o, Y, l);
1368
1608
  }
1369
- this.setInnerText(o, n.getInnerText());
1609
+ this.setInnerText(o, r.getInnerText());
1370
1610
  }
1371
- if (n.hasClasses()) {
1611
+ if (r.hasClasses()) {
1372
1612
  if (s) {
1373
1613
  const l = this.getClass(o);
1374
- l != null && this.setAttribute(o, W, l);
1614
+ l != null && this.setAttribute(o, G, l);
1375
1615
  }
1376
- this.setClass(o, n.getClasses().join(" "));
1616
+ this.setClass(o, r.getClasses().join(" "));
1377
1617
  }
1378
- if (n.hasStyles()) {
1618
+ if (r.hasStyles()) {
1379
1619
  if (s) {
1380
1620
  const l = this.getStyles(o);
1381
1621
  Object.keys(l).length > 0 && this.setAttribute(
1382
1622
  o,
1383
- U,
1623
+ J,
1384
1624
  JSON.stringify(l)
1385
1625
  );
1386
1626
  }
1387
- this.setStyles(o, n.getStyles());
1627
+ this.setStyles(o, r.getStyles());
1388
1628
  }
1389
- if (n.hasAttributes()) {
1390
- const l = n.getAttributes();
1629
+ if (r.hasAttributes()) {
1630
+ const l = r.getAttributes();
1391
1631
  if (s) {
1392
1632
  const c = [];
1393
1633
  l.forEach(([a]) => {
@@ -1395,7 +1635,7 @@ class Gt {
1395
1635
  u != null && c.push([a, u]);
1396
1636
  }), c.length > 0 && this.setAttribute(
1397
1637
  o,
1398
- X,
1638
+ Q,
1399
1639
  JSON.stringify(Object.fromEntries(c))
1400
1640
  );
1401
1641
  }
@@ -1407,56 +1647,56 @@ class Gt {
1407
1647
  });
1408
1648
  };
1409
1649
  }
1410
- const ze = () => {
1411
- document.querySelectorAll(`[${Te}]`).forEach(B);
1412
- }, Ke = (t) => {
1413
- const e = t.getAttribute(W);
1414
- t.removeAttribute(W), e != null && t.setAttribute("class", e);
1415
- }, et = () => {
1416
- document.querySelectorAll(`[${W}]`).forEach((e) => Ke(e));
1417
- }, tt = (t) => {
1418
- const e = t.getAttribute(J);
1419
- t.removeAttribute(J), e != null && (t.innerHTML = e);
1420
- }, st = () => {
1421
- document.querySelectorAll(`[${J}]`).forEach((e) => tt(e));
1422
- }, rt = (t) => {
1650
+ const ht = () => {
1651
+ document.querySelectorAll(`[${xe}]`).forEach(U);
1652
+ }, ft = (t) => {
1423
1653
  const e = t.getAttribute(G);
1424
- t.removeAttribute(G), e != null && (t.innerText = e);
1425
- }, nt = () => {
1426
- document.querySelectorAll(`[${G}]`).forEach((e) => rt(e));
1427
- }, ve = (t) => JSON.parse(t.replace(/&quot;/g, '"')), it = (t) => {
1428
- const e = t.getAttribute(U);
1429
- if (t.removeAttribute(U), e != null) {
1430
- const s = ve(e);
1431
- Object.entries(s).forEach(([r, n]) => {
1432
- t.style.setProperty(r, n);
1654
+ t.removeAttribute(G), e != null && t.setAttribute("class", e);
1655
+ }, dt = () => {
1656
+ document.querySelectorAll(`[${G}]`).forEach((e) => ft(e));
1657
+ }, pt = (t) => {
1658
+ const e = t.getAttribute(X);
1659
+ t.removeAttribute(X), e != null && (t.innerHTML = e);
1660
+ }, gt = () => {
1661
+ document.querySelectorAll(`[${X}]`).forEach((e) => pt(e));
1662
+ }, mt = (t) => {
1663
+ const e = t.getAttribute(Y);
1664
+ t.removeAttribute(Y), e != null && (t.innerText = e);
1665
+ }, yt = () => {
1666
+ document.querySelectorAll(`[${Y}]`).forEach((e) => mt(e));
1667
+ }, Le = (t) => JSON.parse(t.replace(/&quot;/g, '"')), St = (t) => {
1668
+ const e = t.getAttribute(J);
1669
+ if (t.removeAttribute(J), e != null) {
1670
+ const s = Le(e);
1671
+ Object.entries(s).forEach(([n, r]) => {
1672
+ t.style.setProperty(n, r);
1433
1673
  });
1434
1674
  }
1435
- }, ot = () => {
1436
- document.querySelectorAll(`[${U}]`).forEach((e) => it(e));
1437
- }, lt = (t) => {
1438
- const e = t.getAttribute(X);
1439
- if (t.removeAttribute(X), e != null) {
1440
- const s = ve(e);
1441
- Object.entries(s).forEach(([r, n]) => {
1442
- n == null ? t.removeAttribute(r) : t.setAttribute(r, n);
1675
+ }, wt = () => {
1676
+ document.querySelectorAll(`[${J}]`).forEach((e) => St(e));
1677
+ }, bt = (t) => {
1678
+ const e = t.getAttribute(Q);
1679
+ if (t.removeAttribute(Q), e != null) {
1680
+ const s = Le(e);
1681
+ Object.entries(s).forEach(([n, r]) => {
1682
+ r == null ? t.removeAttribute(n) : t.setAttribute(n, r);
1443
1683
  });
1444
1684
  }
1445
- }, ct = () => {
1446
- document.querySelectorAll(`[${X}]`).forEach((e) => lt(e));
1447
- }, Xt = () => {
1448
- ze(), et(), nt(), st(), ot(), ct();
1449
- }, M = Symbol("class"), I = Symbol("style"), q = Symbol("handler"), Ae = () => Math.random().toString(36).substring(2, 15), at = (t) => t.replace(/<[^>]*>?/g, "");
1450
- class _e {
1685
+ }, _t = () => {
1686
+ document.querySelectorAll(`[${Q}]`).forEach((e) => bt(e));
1687
+ }, ds = () => {
1688
+ ht(), dt(), yt(), gt(), wt(), _t();
1689
+ }, I = Symbol("class"), H = Symbol("style"), B = Symbol("handler"), Oe = () => Math.random().toString(36).substring(2, 15), vt = (t) => t.replace(/<[^>]*>?/g, "");
1690
+ class Me {
1451
1691
  constructor(e) {
1452
1692
  this.parent = e;
1453
1693
  }
1454
- id = Ae();
1694
+ id = Oe();
1455
1695
  properties = {};
1456
1696
  children = [];
1457
1697
  isElement = () => !0;
1458
1698
  isText = () => !1;
1459
- getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? at(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
1699
+ getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? vt(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
1460
1700
  removeChild = (e) => {
1461
1701
  const s = this.children.indexOf(e);
1462
1702
  s !== -1 && this.children.splice(s, 1);
@@ -1477,89 +1717,89 @@ class _e {
1477
1717
  getInnerText = () => this.properties.innerText ?? "";
1478
1718
  hasInnerText = () => this.properties.innerText != null;
1479
1719
  hasChildren = () => this.children.length > 0;
1480
- hasClasses = () => this.properties[M] != null;
1481
- hasStyles = () => this.properties[I] != null;
1720
+ hasClasses = () => this.properties[I] != null;
1721
+ hasStyles = () => this.properties[H] != null;
1482
1722
  hasAttributes = () => Object.keys(this.properties).length > 0;
1483
- hasHandlers = () => this.properties[q] != null;
1723
+ hasHandlers = () => this.properties[B] != null;
1484
1724
  hasRenderableProperties = () => this.hasClasses() || this.hasAttributes() || this.hasStyles();
1485
1725
  getById = (e) => {
1486
1726
  if (this.properties.id === e)
1487
1727
  return this;
1488
1728
  for (const s of this.elements()) {
1489
- const r = s.getById(e);
1490
- if (r != null)
1491
- return r;
1729
+ const n = s.getById(e);
1730
+ if (n != null)
1731
+ return n;
1492
1732
  }
1493
1733
  };
1494
1734
  trigger = (e, s) => {
1495
- ((this.properties[q] ?? {})[e] ?? []).forEach((n) => n(s));
1735
+ ((this.properties[B] ?? {})[e] ?? []).forEach((r) => r(s));
1496
1736
  };
1497
1737
  click = () => {
1498
1738
  this.trigger("click", {});
1499
1739
  };
1500
- on = (e, s, r, n) => {
1501
- const i = this.properties[q] ??= {}, o = n?.once ? (c) => {
1502
- l(), s(c, r);
1503
- } : (c) => s(c, r);
1740
+ on = (e, s, n, r) => {
1741
+ const i = this.properties[B] ??= {}, o = r?.once ? (c) => {
1742
+ l(), s(c, n);
1743
+ } : (c) => s(c, n);
1504
1744
  i[e] = [...i[e] ?? [], o];
1505
1745
  const l = () => {
1506
1746
  const c = i[e] ?? [], a = c.indexOf(o);
1507
- a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete i[e], Object.keys(i).length === 0 && delete this.properties[q]) : i[e] = c, n?.signal != null && n.signal.removeEventListener("abort", l));
1747
+ a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete i[e], Object.keys(i).length === 0 && delete this.properties[B]) : i[e] = c, r?.signal != null && r.signal.removeEventListener("abort", l));
1508
1748
  };
1509
- return n?.signal != null && n.signal.addEventListener("abort", l), l;
1749
+ return r?.signal != null && r.signal.addEventListener("abort", l), l;
1510
1750
  };
1511
1751
  addClasses = (e) => {
1512
1752
  if (e.length === 0)
1513
1753
  return;
1514
- const s = this.properties[M] ??= [];
1515
- e.forEach((r) => {
1516
- s.includes(r) || s.push(r);
1754
+ const s = this.properties[I] ??= [];
1755
+ e.forEach((n) => {
1756
+ s.includes(n) || s.push(n);
1517
1757
  });
1518
1758
  };
1519
1759
  removeClasses = (e) => {
1520
1760
  if (e.length === 0)
1521
1761
  return;
1522
- const s = this.properties[M] ??= [];
1523
- e.forEach((r) => {
1524
- const n = s.indexOf(r);
1525
- n !== -1 && s.splice(n, 1);
1526
- }), s.length === 0 && delete this.properties[M];
1762
+ const s = this.properties[I] ??= [];
1763
+ e.forEach((n) => {
1764
+ const r = s.indexOf(n);
1765
+ r !== -1 && s.splice(r, 1);
1766
+ }), s.length === 0 && delete this.properties[I];
1527
1767
  };
1528
- getClasses = () => this.properties[M] ?? [];
1768
+ getClasses = () => this.properties[I] ?? [];
1529
1769
  getAttributes = () => Object.entries(this.properties).filter(
1530
1770
  ([e]) => !["innerText", "innerHTML"].includes(e)
1531
1771
  );
1532
1772
  getVisibleAttributes = () => Reflect.ownKeys(this.properties).flatMap(
1533
- (e) => e === M ? [["class", this.getClasses()]] : e === I ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1773
+ (e) => e === I ? [["class", this.getClasses()]] : e === H ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1534
1774
  );
1535
1775
  setStyle = (e, s) => {
1536
- const r = this.properties[I] ??= {};
1537
- r[e] = s, s === "" && (delete r[e], Object.keys(r).length === 0 && delete this.properties[I]);
1776
+ const n = this.properties[H] ??= {};
1777
+ n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[H]);
1538
1778
  };
1539
- getStyle = (e) => this.properties[I]?.[e] ?? "";
1540
- getStyles = () => this.properties[I] ?? {};
1779
+ getStyle = (e) => this.properties[H]?.[e] ?? "";
1780
+ getStyles = () => this.properties[H] ?? {};
1541
1781
  makeAccessors = (e) => {
1542
1782
  const s = this.properties;
1543
1783
  return {
1544
1784
  get: () => s[e],
1545
- set: (r) => s[e] = r
1785
+ set: (n) => s[e] = n
1546
1786
  };
1547
1787
  };
1548
1788
  }
1549
- const ut = (t) => t.replace(/"/g, "&quot;"), ht = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1550
- class ft extends _e {
1551
- constructor(e, s, r) {
1552
- super(r), this.tagName = e, this.namespace = s;
1789
+ const Tt = (t) => t.replace(/"/g, "&quot;"), At = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1790
+ class Et extends Me {
1791
+ constructor(e, s, n) {
1792
+ super(n), this.tagName = e, this.namespace = s;
1553
1793
  }
1554
1794
  isPortal = () => !1;
1555
1795
  toHTML = (e = !1) => {
1556
- const s = this.children.map((l) => l.toHTML()).join(""), r = this.namespace ? ` xmlns="${this.namespace}"` : "";
1557
- let n = null;
1558
- const i = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, u]) => `${a}: ${u};`).join(" ")}"` : pt.has(l) ? ` ${l}` : l === "innerHTML" ? (n = c, "") : l === "innerText" ? (n = ht(c), "") : ` ${l}="${ut(c)}"`).join(""), o = e ? ` ${Te}` : "";
1559
- return mt.has(this.tagName) && s === "" ? `<${this.tagName}${r}${i}${o} />` : `<${this.tagName}${r}${i}${o}>${n ?? s}</${this.tagName}>`;
1796
+ const s = this.children.map((l) => l.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
1797
+ let r = null;
1798
+ const i = this.getVisibleAttributes().map(([l, c]) => l === "class" ? ` class="${c.join(" ")}"` : l === "style" ? typeof c == "string" ? ` style="${c}"` : ` style="${Object.entries(c).map(([a, u]) => `${a}: ${u};`).join(" ")}"` : Dt.has(l) ? ` ${l}` : l === "innerHTML" ? (r = c, "") : l === "innerText" ? (r = At(c), "") : ` ${l}="${Tt(c)}"`).join(""), o = e ? ` ${xe}` : "";
1799
+ return Pt.has(this.tagName) && s === "" ? `<${this.tagName}${n}${i}${o} />` : `<${this.tagName}${n}${i}${o}>${r ?? s}</${this.tagName}>`;
1560
1800
  };
1561
1801
  }
1562
- class Ee extends _e {
1802
+ class ke extends Me {
1563
1803
  constructor(e, s) {
1564
1804
  super(s), this.selector = e;
1565
1805
  }
@@ -1567,19 +1807,19 @@ class Ee extends _e {
1567
1807
  toHTML = () => "";
1568
1808
  contentToHTML = (e = !1) => this.children.map((s) => s.toHTML(e)).join("");
1569
1809
  }
1570
- class dt {
1810
+ class Ct {
1571
1811
  constructor(e) {
1572
1812
  this.text = e;
1573
1813
  }
1574
- id = Ae();
1814
+ id = Oe();
1575
1815
  isElement = () => !1;
1576
1816
  isText = () => !0;
1577
1817
  getText = () => this.text;
1578
1818
  toHTML = () => this.text;
1579
1819
  }
1580
- class $ {
1581
- constructor(e, s, r, n) {
1582
- this.element = e, this.reference = s, this.container = r, this.providers = n;
1820
+ class R {
1821
+ constructor(e, s, n, r) {
1822
+ this.element = e, this.reference = s, this.container = n, this.providers = r;
1583
1823
  }
1584
1824
  appendOrInsert = (e) => {
1585
1825
  if (this.reference != null) {
@@ -1589,17 +1829,17 @@ class $ {
1589
1829
  this.element.children.push(e);
1590
1830
  };
1591
1831
  makeChildElement = (e, s) => {
1592
- const r = new ft(e, s, this.element);
1593
- return this.appendOrInsert(r), new $(
1594
- r,
1832
+ const n = new Et(e, s, this.element);
1833
+ return this.appendOrInsert(n), new R(
1834
+ n,
1595
1835
  void 0,
1596
1836
  this.container,
1597
1837
  this.providers
1598
1838
  );
1599
1839
  };
1600
1840
  makeChildText = (e) => {
1601
- const s = new dt(e);
1602
- return this.appendOrInsert(s), new $(
1841
+ const s = new Ct(e);
1842
+ return this.appendOrInsert(s), new R(
1603
1843
  this.element,
1604
1844
  s,
1605
1845
  this.container,
@@ -1612,8 +1852,8 @@ class $ {
1612
1852
  getText = () => this.reference?.getText() ?? this.element.getText();
1613
1853
  makeRef = () => this.makeChildText("");
1614
1854
  makePortal = (e) => {
1615
- const s = new Ee(e, this.element);
1616
- return this.appendOrInsert(s), new $(
1855
+ const s = new ke(e, this.element);
1856
+ return this.appendOrInsert(s), new R(
1617
1857
  s,
1618
1858
  void 0,
1619
1859
  this.container,
@@ -1627,15 +1867,15 @@ class $ {
1627
1867
  * @param value - The provider to set for the given mark.
1628
1868
  * @returns A new `DOMContext` instance with the specified provider.
1629
1869
  */
1630
- setProvider = (e, s, r) => new $(this.element, this.reference, this.container, {
1870
+ setProvider = (e, s, n) => new R(this.element, this.reference, this.container, {
1631
1871
  ...this.providers,
1632
- [e]: [s, r]
1872
+ [e]: [s, n]
1633
1873
  });
1634
1874
  getProvider = (e) => {
1635
1875
  if (this.providers[e] === void 0)
1636
- throw new Se(e);
1637
- const [s, r] = this.providers[e];
1638
- return { value: s, onUse: r };
1876
+ throw new Pe(e);
1877
+ const [s, n] = this.providers[e];
1878
+ return { value: s, onUse: n };
1639
1879
  };
1640
1880
  clear = (e) => {
1641
1881
  e && (this.reference !== void 0 ? this.element.removeChild(this.reference) : this.element.remove());
@@ -1652,48 +1892,48 @@ class $ {
1652
1892
  getStyle = (e) => this.element.getStyle(e);
1653
1893
  makeAccessors = (e) => this.element.makeAccessors(e);
1654
1894
  }
1655
- const pt = /* @__PURE__ */ new Set([
1895
+ const Dt = /* @__PURE__ */ new Set([
1656
1896
  "checked",
1657
1897
  "disabled",
1658
1898
  "multiple",
1659
1899
  "readonly",
1660
1900
  "required",
1661
1901
  "selected"
1662
- ]), mt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), Ce = (t) => (e) => e.makeChildText(t).clear, Pe = (t) => (e) => {
1663
- const s = e.makeChildText(t.value), r = t.on(s.setText);
1664
- return (n) => {
1665
- r(), s.clear(n);
1666
- };
1667
- }, Yt = (t) => m.is(t) ? Pe(t) : Ce(t), T = (...t) => (e) => {
1668
- const s = t.map((r) => h(r)(e));
1902
+ ]), Pt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), Ie = (t) => (e) => e.makeChildText(t).clear, He = (t) => (e) => {
1903
+ const s = e.makeChildText(t.value), n = t.on(s.setText);
1669
1904
  return (r) => {
1670
- s.forEach((n) => n(r));
1905
+ n(), s.clear(r);
1906
+ };
1907
+ }, ps = (t) => g.is(t) ? He(t) : Ie(t), E = (...t) => (e) => {
1908
+ const s = t.map((n) => f(n)(e));
1909
+ return (n) => {
1910
+ s.forEach((r) => r(n));
1671
1911
  };
1672
- }, E = () => () => {
1673
- }, gt = (t) => (e) => (e.addClasses(t), (s) => {
1912
+ }, C = () => () => {
1913
+ }, xt = (t) => (e) => (e.addClasses(t), (s) => {
1674
1914
  s && e.removeClasses(t);
1675
- }), yt = (t) => (e) => {
1915
+ }), Lt = (t) => (e) => {
1676
1916
  let s = [];
1677
- const r = t.on((n) => {
1678
- e.removeClasses(s), s = (n ?? "").split(" ").filter((i) => i.length > 0), e.addClasses(s);
1917
+ const n = t.on((r) => {
1918
+ e.removeClasses(s), s = (r ?? "").split(" ").filter((i) => i.length > 0), e.addClasses(s);
1679
1919
  });
1680
- return (n) => {
1681
- r(), n && e.removeClasses(s), s.length = 0;
1920
+ return (r) => {
1921
+ n(), r && e.removeClasses(s), s.length = 0;
1682
1922
  };
1683
- }, bt = (t, e) => (s) => {
1684
- const { get: r, set: n } = s.makeAccessors(t), i = r();
1685
- return n(e), (o) => {
1686
- o && n(i);
1923
+ }, Ot = (t, e) => (s) => {
1924
+ const { get: n, set: r } = s.makeAccessors(t), i = n();
1925
+ return r(e), (o) => {
1926
+ o && r(i);
1687
1927
  };
1688
- }, wt = (t, e) => (s) => {
1689
- const { get: r, set: n } = s.makeAccessors(t), i = r(), o = e.on(n);
1928
+ }, Mt = (t, e) => (s) => {
1929
+ const { get: n, set: r } = s.makeAccessors(t), i = n(), o = e.on(r);
1690
1930
  return (l) => {
1691
- o(), l && n(i);
1931
+ o(), l && r(i);
1692
1932
  };
1693
- }, N = (t, e) => m.is(e) ? wt(t, e) : bt(t, e), Z = (t = "") => (e, s) => {
1694
- const r = t ? `${t}${e}` : e;
1695
- return N(r, s);
1696
- }, R = new Proxy(
1933
+ }, q = (t, e) => g.is(e) ? Mt(t, e) : Ot(t, e), kt = (t, e) => t === "class" ? g.is(e) ? Lt(e) : xt(
1934
+ /* c8 ignore next */
1935
+ (e ?? "").split(" ").filter((s) => s.length > 0)
1936
+ ) : q(t, e), V = new Proxy(
1697
1937
  {},
1698
1938
  {
1699
1939
  /**
@@ -1707,12 +1947,9 @@ const pt = /* @__PURE__ */ new Set([
1707
1947
  * @returns The renderable component for the specified attribute.
1708
1948
  *
1709
1949
  */
1710
- get: (t, e) => e === "class" ? (s) => m.is(s) ? yt(s) : gt(
1711
- /* c8 ignore next */
1712
- (s ?? "").split(" ").filter((r) => r.length > 0)
1713
- ) : e === "set" ? Z() : (s) => N(e, s)
1950
+ get: (t, e) => (s) => kt(e, s)
1714
1951
  }
1715
- ), Qt = new Proxy(
1952
+ ), It = (t, e) => q(`data-${t}`, e), gs = new Proxy(
1716
1953
  {},
1717
1954
  {
1718
1955
  /**
@@ -1723,9 +1960,9 @@ const pt = /* @__PURE__ */ new Set([
1723
1960
  * @returns The renderable component for the specified attribute.
1724
1961
  *
1725
1962
  */
1726
- get: (t, e) => e === "set" ? Z("data-") : (s) => N(`data-${e}`, s)
1963
+ get: (t, e) => (s) => It(e, s)
1727
1964
  }
1728
- ), Zt = new Proxy(
1965
+ ), Ht = (t, e) => q(`aria-${t}`, e), ms = new Proxy(
1729
1966
  {},
1730
1967
  {
1731
1968
  /**
@@ -1736,9 +1973,9 @@ const pt = /* @__PURE__ */ new Set([
1736
1973
  * @returns The renderable component for the specified attribute.
1737
1974
  *
1738
1975
  */
1739
- get: (t, e) => e === "set" ? Z("aria-") : (s) => N(`aria-${e}`, s)
1976
+ get: (t, e) => (s) => Ht(e, s)
1740
1977
  }
1741
- ), zt = new Proxy(
1978
+ ), Nt = (t, e) => q(t, e), ys = new Proxy(
1742
1979
  {},
1743
1980
  {
1744
1981
  /**
@@ -1749,9 +1986,9 @@ const pt = /* @__PURE__ */ new Set([
1749
1986
  * @returns The renderable component for the specified attribute.
1750
1987
  *
1751
1988
  */
1752
- get: (t, e) => e === "set" ? Z() : (s) => N(e, s)
1989
+ get: (t, e) => (s) => Nt(e, s)
1753
1990
  }
1754
- ), Kt = new Proxy(
1991
+ ), $t = (t, e) => q(t, e), Ss = new Proxy(
1755
1992
  {},
1756
1993
  {
1757
1994
  /**
@@ -1761,31 +1998,31 @@ const pt = /* @__PURE__ */ new Set([
1761
1998
  * @returns The renderable component for the specified attribute.
1762
1999
  *
1763
2000
  */
1764
- get: (t, e) => (s) => N(e, s)
2001
+ get: (t, e) => (s) => $t(e, s)
1765
2002
  }
1766
- ), h = (t) => {
2003
+ ), f = (t) => {
1767
2004
  if (t == null)
1768
- return E;
2005
+ return C;
1769
2006
  if (Array.isArray(t))
1770
- return T(...t.map(h));
2007
+ return E(...t.map(f));
1771
2008
  if (typeof t == "string")
1772
- return Ce(t);
1773
- if (m.is(t))
1774
- return Pe(t);
2009
+ return Ie(t);
2010
+ if (g.is(t))
2011
+ return He(t);
1775
2012
  if (typeof t == "function")
1776
2013
  return t;
1777
2014
  throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
1778
- }, xe = (t, ...e) => (s) => {
1779
- const r = s.makeChildElement(t, void 0), n = e.map((i) => h(i)(r));
2015
+ }, Ne = (t, ...e) => (s) => {
2016
+ const n = s.makeChildElement(t, void 0), r = e.map((i) => f(i)(n));
1780
2017
  return (i) => {
1781
- n.forEach((o) => o(!1)), r.clear(i);
2018
+ r.forEach((o) => o(!1)), n.clear(i);
1782
2019
  };
1783
- }, Le = (t, e, ...s) => (r) => {
1784
- const n = r.makeChildElement(t, e), i = s.map((o) => h(o)(n));
2020
+ }, te = (t, e, ...s) => (n) => {
2021
+ const r = n.makeChildElement(t, e), i = s.map((o) => f(o)(r));
1785
2022
  return (o) => {
1786
- i.forEach((l) => l(!1)), n.clear(o);
2023
+ i.forEach((l) => l(!1)), r.clear(o);
1787
2024
  };
1788
- }, es = new Proxy(
2025
+ }, ws = new Proxy(
1789
2026
  {},
1790
2027
  {
1791
2028
  /**
@@ -1793,9 +2030,9 @@ const pt = /* @__PURE__ */ new Set([
1793
2030
  * @param tagName - The HTML tag name.
1794
2031
  * @returns A renderable function that creates and appends the HTML element to the DOM.
1795
2032
  */
1796
- get: (t, e) => (...s) => xe(e, s.flatMap(h))
2033
+ get: (t, e) => (...s) => Ne(e, s.flatMap(f))
1797
2034
  }
1798
- ), ts = new Proxy(
2035
+ ), bs = new Proxy(
1799
2036
  {},
1800
2037
  {
1801
2038
  /**
@@ -1803,9 +2040,9 @@ const pt = /* @__PURE__ */ new Set([
1803
2040
  * @param type - The input type name.
1804
2041
  * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
1805
2042
  */
1806
- get: (t, e) => (...s) => xe("input", R.type(e), ...s)
2043
+ get: (t, e) => (...s) => Ne("input", V.type(e), ...s)
1807
2044
  }
1808
- ), St = "http://www.w3.org/2000/svg", ss = new Proxy(
2045
+ ), $e = "http://www.w3.org/2000/svg", _s = (t, ...e) => te(t, $e, ...e), vs = new Proxy(
1809
2046
  {},
1810
2047
  {
1811
2048
  /**
@@ -1813,9 +2050,9 @@ const pt = /* @__PURE__ */ new Set([
1813
2050
  * @param tagName - The SVG tag name.
1814
2051
  * @returns A renderable function that creates and appends the SVG element to the DOM.
1815
2052
  */
1816
- get: (t, e) => (...s) => Le(e, St, s.flatMap(h))
2053
+ get: (t, e) => (...s) => te(e, $e, s.flatMap(f))
1817
2054
  }
1818
- ), Tt = "http://www.w3.org/1998/Math/MathML", rs = new Proxy(
2055
+ ), Re = "http://www.w3.org/1998/Math/MathML", Ts = (t, ...e) => te(t, Re, ...e), As = new Proxy(
1819
2056
  {},
1820
2057
  {
1821
2058
  /**
@@ -1823,35 +2060,35 @@ const pt = /* @__PURE__ */ new Set([
1823
2060
  * @param tagName - The Math tag name.
1824
2061
  * @returns A renderable function that creates and appends the Math element to the DOM.
1825
2062
  */
1826
- get: (t, e) => (...s) => Le(e, Tt, s.flatMap(h))
2063
+ get: (t, e) => (...s) => te(e, Re, s.flatMap(f))
1827
2064
  }
1828
- ), De = (t, e) => {
2065
+ ), Ve = (t, e) => {
1829
2066
  if (typeof e == "function")
1830
- return De(t, { then: e });
1831
- const s = e.pending != null ? h(e.pending()) : E, r = e.then, n = e.error != null ? (i) => h(e.error(i)) : () => E;
2067
+ return Ve(t, { then: e });
2068
+ const s = e.pending != null ? f(e.pending()) : C, n = e.then, r = e.error != null ? (i) => f(e.error(i)) : () => C;
1832
2069
  return (i) => {
1833
2070
  let o = !0;
1834
2071
  const l = t(), c = i.makeRef();
1835
- let a = h(s)(c);
2072
+ let a = f(s)(c);
1836
2073
  return l.then(
1837
2074
  (u) => {
1838
- o && (a(!0), a = h(r(u))(c));
2075
+ o && (a(!0), a = f(n(u))(c));
1839
2076
  },
1840
2077
  (u) => {
1841
- o && (a(!0), a = h(n(u))(c));
2078
+ o && (a(!0), a = f(r(u))(c));
1842
2079
  }
1843
2080
  ), (u) => {
1844
2081
  o = !1, a(u), c.clear(u);
1845
2082
  };
1846
2083
  };
1847
- }, ns = (t, e) => De(() => t, e), Oe = (t, e, s) => (r) => r.on(t, e, s), vt = (t) => Oe("click", (e, s) => {
2084
+ }, Es = (t, e) => Ve(() => t, e), je = (t, e, s) => (n) => n.on(t, e, s), Rt = (t) => je("click", (e, s) => {
1848
2085
  e.preventDefault();
1849
- const r = e.target;
2086
+ const n = e.target;
1850
2087
  setTimeout(() => {
1851
- const n = r.ownerDocument != null ? r?.checked : void 0;
1852
- n != null && t(!n, s);
2088
+ const r = n.ownerDocument != null ? n?.checked : void 0;
2089
+ r != null && t(!r, s);
1853
2090
  }, 0);
1854
- }), z = new Proxy(
2091
+ }), se = new Proxy(
1855
2092
  {},
1856
2093
  {
1857
2094
  /**
@@ -1859,334 +2096,331 @@ const pt = /* @__PURE__ */ new Set([
1859
2096
  * @param fn - The function to call when the event is triggered.
1860
2097
  * @returns A `Renderable` function that adds the event listener to the element.
1861
2098
  */
1862
- get: (t, e) => (s) => Oe(e, s)
2099
+ get: (t, e) => (s) => je(e, s)
1863
2100
  }
1864
- ), At = (t, e) => (s) => {
2101
+ ), Vt = (t, e) => (s) => {
1865
2102
  e?.preventDefault === !0 && s.preventDefault(), e?.stopPropagation === !0 && s.stopPropagation(), e?.stopImmediatePropagation === !0 && s.stopImmediatePropagation(), t(s);
1866
- }, L = (t, e) => At((s) => {
1867
- const r = s.target;
1868
- t(r, s);
1869
- }, e), _t = (t, e) => L(
1870
- (s, r) => t(s.value, r),
2103
+ }, O = (t, e) => Vt((s) => {
2104
+ const n = s.target;
2105
+ t(n, s);
2106
+ }, e), jt = (t, e) => O(
2107
+ (s, n) => t(s.value, n),
1871
2108
  e
1872
- ), Et = (t, e) => L(
1873
- (s, r) => t(s.valueAsNumber, r),
2109
+ ), qt = (t, e) => O(
2110
+ (s, n) => t(s.valueAsNumber, n),
1874
2111
  e
1875
- ), Ct = (t, e) => L((s, r) => {
2112
+ ), Ft = (t, e) => O((s, n) => {
1876
2113
  if (s.value === "")
1877
2114
  return;
1878
- const n = s.value.split("-"), i = new Date(
1879
- Number(n[0]),
1880
- Number(n[1]) - 1,
1881
- Number(n[2].substring(0, 2))
2115
+ const r = s.value.split("-"), i = new Date(
2116
+ Number(r[0]),
2117
+ Number(r[1]) - 1,
2118
+ Number(r[2].substring(0, 2))
1882
2119
  );
1883
- t(i, r);
1884
- }, e), is = (t, e) => L((s, r) => {
2120
+ t(i, n);
2121
+ }, e), Cs = (t, e) => O((s, n) => {
1885
2122
  if (s.value === "") {
1886
- t(null, r);
2123
+ t(null, n);
1887
2124
  return;
1888
2125
  }
1889
- const n = s.value.split("-"), i = new Date(
1890
- Number(n[0]),
1891
- Number(n[1]) - 1,
1892
- Number(n[2].substring(0, 2))
2126
+ const r = s.value.split("-"), i = new Date(
2127
+ Number(r[0]),
2128
+ Number(r[1]) - 1,
2129
+ Number(r[2].substring(0, 2))
1893
2130
  );
1894
- t(i, r);
1895
- }, e), Pt = (t, e) => L((s, r) => {
2131
+ t(i, n);
2132
+ }, e), Bt = (t, e) => O((s, n) => {
1896
2133
  if (s.value === "")
1897
2134
  return;
1898
- const n = s.value.split("T"), i = n[0].split("-"), o = new Date(
2135
+ const r = s.value.split("T"), i = r[0].split("-"), o = new Date(
1899
2136
  Number(i[0]),
1900
2137
  Number(i[1]) - 1,
1901
2138
  Number(i[2])
1902
- ), l = n[1].split(":");
1903
- o.setHours(Number(l[0])), o.setMinutes(Number(l[1])), o.setSeconds(Number(l[2])), t(o, r);
1904
- }, e), os = (t, e) => L((s, r) => {
2139
+ ), l = r[1].split(":");
2140
+ o.setHours(Number(l[0])), o.setMinutes(Number(l[1])), o.setSeconds(Number(l[2])), t(o, n);
2141
+ }, e), Ds = (t, e) => O((s, n) => {
1905
2142
  if (s.value === "") {
1906
- t(null, r);
2143
+ t(null, n);
1907
2144
  return;
1908
2145
  }
1909
- const n = s.value.split("T");
1910
- if (n.length !== 2) {
1911
- t(null, r);
2146
+ const r = s.value.split("T");
2147
+ if (r.length !== 2) {
2148
+ t(null, n);
1912
2149
  return;
1913
2150
  }
1914
- const i = n[0].split("-"), o = new Date(
2151
+ const i = r[0].split("-"), o = new Date(
1915
2152
  Number(i[0]),
1916
2153
  Number(i[1]) - 1,
1917
2154
  Number(i[2])
1918
- ), l = n[1].split(":");
1919
- o.setHours(Number(l[0] ?? 0)), o.setMinutes(Number(l[1] ?? 0)), o.setSeconds(Number(l[2] ?? 0)), t(o, r);
1920
- }, e), ls = (t, e) => L((s, r) => {
1921
- t(s.checked, r);
1922
- }, e), cs = (t, e = "input") => T(R.valueAsDate(t), z[e](Ct(t.set))), as = (t, e = "input") => T(R.valueAsDate(t), z[e](Pt(t.set))), us = (t, e = "input") => T(R.valueAsNumber(t), z[e](Et(t.set))), hs = (t, e = "input") => T(R.value(t), z[e](_t(t.set))), fs = (t) => T(R.checked(t), vt(t.set)), le = (t, e, s) => m.is(t) ? e(t) : s(t), xt = (t, e, s) => {
1923
- const r = t.makeRef();
1924
- let n = () => {
1925
- };
1926
- const i = e.on((o) => {
1927
- n(!0), n = h(s(o))(r);
2155
+ ), l = r[1].split(":");
2156
+ o.setHours(Number(l[0] ?? 0)), o.setMinutes(Number(l[1] ?? 0)), o.setSeconds(Number(l[2] ?? 0)), t(o, n);
2157
+ }, e), Ps = (t, e) => O((s, n) => {
2158
+ t(s.checked, n);
2159
+ }, e), xs = (t, e = "input") => E(V.valueAsDate(t), se[e](Ft(t.set))), Ls = (t, e = "input") => E(V.valueAsDate(t), se[e](Bt(t.set))), Os = (t, e = "input") => E(V.valueAsNumber(t), se[e](qt(t.set))), Ms = (t, e = "input") => E(V.value(t), se[e](jt(t.set))), ks = (t) => E(V.checked(t), Rt(t.set)), fe = (t, e, s) => g.is(t) ? e(t) : s(t), Wt = (t, e, s) => {
2160
+ const n = t.makeRef();
2161
+ let r = () => {
2162
+ }, i = null;
2163
+ const o = e.on((l) => {
2164
+ i?.dispose(), r(!0), i = new j(), r = L(
2165
+ i,
2166
+ () => f(s(l))(n)
2167
+ );
1928
2168
  });
1929
- return (o) => {
1930
- n(o), i(), r.clear(o);
2169
+ return (l) => {
2170
+ i?.dispose(), r(l), o(), n.clear(l);
1931
2171
  };
1932
- }, K = (t, e) => {
1933
- function s(n) {
2172
+ }, ne = (t, e) => {
2173
+ function s(r) {
1934
2174
  return (i) => {
1935
2175
  const o = i.makeRef();
1936
2176
  let l, c;
1937
- const a = n.map((d) => Object.keys(d)[0]);
2177
+ const a = r.map((p) => Object.keys(p)[0]);
1938
2178
  let u;
1939
- const p = a.on((d) => {
1940
- if (d !== u) {
1941
- u = d, c?.dispose(), l?.(!0), c = n.map((g) => g[d]);
1942
- const f = e[d](c);
1943
- l = h(f)(o);
2179
+ const h = a.on((p) => {
2180
+ if (p !== u) {
2181
+ u = p, c?.dispose(), l?.(!0), c = r.map((m) => m[p]);
2182
+ const d = e[p](c);
2183
+ l = f(d)(o);
1944
2184
  }
1945
2185
  });
1946
- return (d) => {
1947
- c?.dispose(), p(), o.clear(d), l?.(d);
2186
+ return (p) => {
2187
+ c?.dispose(), h(), o.clear(p), l?.(p);
1948
2188
  };
1949
2189
  };
1950
2190
  }
1951
- function r(n) {
1952
- const i = Object.keys(n)[0];
1953
- return h(e[i](Q(n[i])));
2191
+ function n(r) {
2192
+ const i = Object.keys(r)[0];
2193
+ return f(e[i](K(r[i])));
1954
2194
  }
1955
- return le(t, s, r);
1956
- }, Me = (t, e, s) => K(
1957
- y.map(t, (r) => ({ [r[e]]: r })),
2195
+ return fe(t, s, n);
2196
+ }, qe = (t, e, s) => ne(
2197
+ y.map(t, (n) => ({ [n[e]]: n })),
1958
2198
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1959
2199
  s
1960
- ), ds = (t, e) => Me(t, "kind", e), ps = (t, e) => {
1961
- const s = y.map(t, ([r, n]) => ({ [r]: n }));
1962
- return K(s, e);
1963
- }, ms = (t, e) => Me(t, "type", e), Lt = (t, e) => K(
2200
+ ), Is = (t, e) => qe(t, "kind", e), Hs = (t, e) => {
2201
+ const s = y.map(t, ([n, r]) => ({ [n]: r }));
2202
+ return ne(s, e);
2203
+ }, Ns = (t, e) => qe(t, "type", e), Ut = (t, e) => ne(
1964
2204
  y.map(t, (s) => ({ [s]: !0 })),
1965
2205
  e
1966
- ), gs = (t, e = {}) => (s) => {
1967
- const r = e?.firstSeparator ?? t, n = e?.lastSeparator ?? t;
1968
- return Lt(
2206
+ ), $s = (t, e = {}) => (s) => {
2207
+ const n = e?.firstSeparator ?? t, r = e?.lastSeparator ?? t;
2208
+ return Ut(
1969
2209
  s.map((i) => i.isFirst ? "first" : i.isLast ? "last" : "other"),
1970
2210
  {
1971
- first: r,
1972
- last: n,
2211
+ first: n,
2212
+ last: r,
1973
2213
  other: t
1974
2214
  }
1975
2215
  );
1976
- }, ys = (t) => (e) => (e.appendOrInsert(t), (s) => {
1977
- s && B(t);
1978
- }), bs = (t, e, s) => {
1979
- function r(i) {
2216
+ }, Rs = (t) => (e) => (e.appendOrInsert(t), (s) => {
2217
+ s && U(t);
2218
+ }), Vs = (t, e, s) => {
2219
+ function n(i) {
1980
2220
  return (o) => {
1981
2221
  const l = o.makeRef();
1982
2222
  let c = () => {
1983
2223
  }, a = !1, u = null;
1984
- const p = i.on((d) => {
1985
- d == null ? (c(!0), c = h(s?.())(l), a = !1, u?.dispose(), u = null) : a ? u.set(d) : (u = _(d), c(!0), c = h(e(u))(
2224
+ const h = i.on((p) => {
2225
+ p == null ? (c(!0), c = f(s?.())(l), a = !1, u?.dispose(), u = null) : a ? u.set(p) : (u = T(p), c(!0), c = f(e(u))(
1986
2226
  l
1987
2227
  ), a = !0);
1988
2228
  });
1989
- return (d) => {
1990
- u?.dispose(), p(), c?.(d), l.clear(d);
2229
+ return (p) => {
2230
+ u?.dispose(), h(), c?.(p), l.clear(p);
1991
2231
  };
1992
2232
  };
1993
2233
  }
1994
- function n(i) {
2234
+ function r(i) {
1995
2235
  if (i == null) {
1996
2236
  const o = s?.();
1997
- return o != null ? h(o) : E;
2237
+ return o != null ? f(o) : C;
1998
2238
  }
1999
- return h(e(Q(i)));
2239
+ return f(e(K(i)));
2000
2240
  }
2001
- return le(
2241
+ return fe(
2002
2242
  t,
2003
- r,
2004
- n
2243
+ n,
2244
+ r
2005
2245
  );
2006
- }, ws = (...t) => (e, s) => (r) => {
2007
- const n = r.makeRef();
2246
+ }, js = (...t) => (e, s) => (n) => {
2247
+ const r = n.makeRef();
2008
2248
  if (t.some(
2009
- (f) => !m.is(f) && f == null
2249
+ (d) => !g.is(d) && d == null
2010
2250
  ))
2011
- return (s != null ? h(s?.()) : E)(
2012
- n
2251
+ return (s != null ? f(s?.()) : C)(
2252
+ r
2013
2253
  );
2014
2254
  const o = t.map(() => null), l = t.map(
2015
- (f) => m.is(f) ? f.value != null : f != null
2255
+ (d) => g.is(d) ? d.value != null : d != null
2016
2256
  );
2017
2257
  let c = null;
2018
- const a = _(l.every((f) => f)), u = (f, g) => {
2019
- if (f.value != null) {
2020
- if (o[g] == null) {
2021
- const w = _(f.value);
2022
- o[g] = w;
2258
+ const a = T(l.every((d) => d)), u = (d, m) => {
2259
+ if (d.value != null) {
2260
+ if (o[m] == null) {
2261
+ const w = T(d.value);
2262
+ o[m] = w;
2023
2263
  } else
2024
- o[g].value = f.value;
2025
- l[g] = !0;
2264
+ o[m].value = d.value;
2265
+ l[m] = !0;
2026
2266
  } else
2027
- l[g] = !1;
2267
+ l[m] = !1;
2028
2268
  };
2029
- let p = t.length - 1;
2030
- const d = t.map((f, g) => {
2031
- if (!m.is(f)) {
2032
- const w = _(f);
2033
- return o[g] = w, () => {
2269
+ let h = t.length - 1;
2270
+ const p = t.map((d, m) => {
2271
+ if (!g.is(d)) {
2272
+ const w = T(d);
2273
+ return o[m] = w, () => {
2034
2274
  };
2035
2275
  }
2036
- return f.on(() => {
2037
- u(f, g), p === 0 ? a.value = l.every((w) => w) : p--;
2276
+ return d.on(() => {
2277
+ u(d, m), h === 0 ? a.value = l.every((w) => w) : h--;
2038
2278
  });
2039
2279
  });
2040
- return a.on((f) => {
2041
- c?.(!0), c = null, f ? c = h(e(...o))(n) : c = h(s?.() ?? E)(n);
2042
- }), (f) => {
2043
- o.forEach((g) => g?.dispose()), a.dispose(), d.forEach((g) => g()), c?.(f), n.clear(f);
2044
- };
2045
- }, V = (...t) => (e) => (s) => t.forEach((r) => {
2046
- typeof r == "function" ? r(s, e) : r.dispose(s, e);
2047
- }), Ie = (t, e, s) => le(
2280
+ return a.on((d) => {
2281
+ c?.(!0), c = null, d ? c = f(e(...o))(r) : c = f(s?.() ?? C)(r);
2282
+ }), (d) => {
2283
+ o.forEach((m) => m?.dispose()), a.dispose(), p.forEach((m) => m()), c?.(d), r.clear(d);
2284
+ };
2285
+ }, Fe = (t, e, s) => fe(
2048
2286
  t,
2049
- (r) => (n) => xt(
2050
- n,
2287
+ (n) => (r) => Wt(
2051
2288
  r,
2289
+ n,
2052
2290
  (i) => i ? e() : s?.()
2053
2291
  ),
2054
- (r) => {
2055
- if (r) {
2056
- const n = e();
2057
- return n != null ? h(n) : E;
2292
+ (n) => {
2293
+ if (n) {
2294
+ const r = e();
2295
+ return r != null ? f(r) : C;
2058
2296
  }
2059
- return h(s?.());
2297
+ return f(s?.());
2060
2298
  }
2061
- ), Ss = (t, e, s) => Ie(
2062
- y.map(t, (r) => !r),
2299
+ ), qs = (t, e, s) => Fe(
2300
+ y.map(t, (n) => !n),
2063
2301
  e,
2064
2302
  s
2065
- ), He = (t, e, s) => {
2303
+ ), Be = (t, e, s) => {
2066
2304
  if (s != null)
2067
- return He(t, (r) => {
2068
- const n = new se(
2069
- r.index,
2070
- r.total.map((i) => i - 1)
2305
+ return Be(t, (n) => {
2306
+ const r = new le(
2307
+ n.index,
2308
+ n.total.map((i) => i - 1)
2071
2309
  );
2072
- return T(
2073
- V(n.dispose),
2074
- h(e(r)),
2075
- Ie(
2076
- r.isLast,
2077
- () => E,
2078
- () => s(n)
2310
+ return E(
2311
+ f(e(n)),
2312
+ Fe(
2313
+ n.isLast,
2314
+ () => C,
2315
+ () => s(r)
2079
2316
  )
2080
2317
  );
2081
2318
  });
2082
- if (m.is(t))
2083
- return (r) => {
2084
- const n = t.derive(), i = r.makeRef(), o = [];
2085
- return n.on((l) => {
2086
- const c = o.splice(l);
2087
- for (const a of c)
2088
- a(!0);
2089
- for (let a = o.length; a < l; a++) {
2090
- const u = new se(a, n);
2091
- o.push(
2092
- T(
2093
- V(u.dispose),
2094
- h(e(u))
2095
- )(i)
2319
+ if (g.is(t))
2320
+ return (n) => {
2321
+ const r = t.derive(), i = n.makeRef(), o = [], l = [];
2322
+ return r.on((c) => {
2323
+ const a = o.splice(c), u = l.splice(c);
2324
+ for (const h of u)
2325
+ h.dispose();
2326
+ for (const h of a)
2327
+ h(!0);
2328
+ for (let h = o.length; h < c; h++) {
2329
+ const p = new le(h, r), d = new j();
2330
+ l.push(d), o.push(
2331
+ L(d, () => f(e(p))(i))
2096
2332
  );
2097
2333
  }
2098
- }), (l) => {
2099
- n.dispose();
2100
- for (const c of o)
2101
- c(l);
2102
- o.length = 0, i.clear(l);
2334
+ }), (c) => {
2335
+ for (const a of l)
2336
+ a.dispose();
2337
+ l.length = 0, r.dispose();
2338
+ for (const a of o)
2339
+ a(c);
2340
+ o.length = 0, i.clear(c);
2103
2341
  };
2104
2342
  };
2105
2343
  {
2106
- const r = Q(t);
2107
- return T(
2108
- ...Array.from({ length: t }, (n, i) => i).map((n) => {
2109
- const i = new se(n, r);
2110
- return T(
2111
- V(i.dispose),
2112
- h(e(i))
2113
- );
2344
+ const n = K(t);
2345
+ return E(
2346
+ ...Array.from({ length: t }, (r, i) => i).map((r) => {
2347
+ const i = new le(r, n);
2348
+ return f(e(i));
2114
2349
  })
2115
2350
  );
2116
2351
  }
2117
- }, Ts = (t, e, s) => {
2118
- const r = y.map(t, (i) => i.length), n = y.toSignal(t);
2119
- return He(
2120
- r,
2352
+ }, Fs = (t, e, s) => {
2353
+ const n = y.map(t, (i) => i.length), r = y.toSignal(t);
2354
+ return Be(
2355
+ n,
2121
2356
  (i) => {
2122
- const o = n.map((l) => l[i.index]);
2123
- return T(
2124
- V(o.dispose),
2125
- h(e(o, i))
2126
- );
2357
+ const o = r.map((l) => l[i.index]);
2358
+ return f(e(o, i));
2127
2359
  },
2128
2360
  s
2129
2361
  );
2130
- }, vs = (t, e) => {
2131
- if (m.is(t)) {
2362
+ }, Gt = (...t) => (e) => (s) => t.forEach((n) => {
2363
+ typeof n == "function" ? n(s, e) : n.dispose(s, e);
2364
+ }), Bs = (t, e) => {
2365
+ if (g.is(t)) {
2132
2366
  const s = t;
2133
- return (r) => {
2134
- r = r.makeRef();
2135
- const n = s.map((l) => h(e(l)));
2367
+ return (n) => {
2368
+ n = n.makeRef();
2369
+ const r = s.map((l) => f(e(l)));
2136
2370
  let i = () => {
2137
2371
  };
2138
- const o = n.on((l) => {
2139
- i(!0), i = l(r);
2372
+ const o = r.on((l) => {
2373
+ i(!0), i = l(n);
2140
2374
  });
2141
2375
  return (l) => {
2142
2376
  o(), i(l);
2143
2377
  };
2144
2378
  };
2145
2379
  }
2146
- return h(e(t));
2147
- }, As = (t, e, s = () => E) => K(
2380
+ return f(e(t));
2381
+ }, Ws = (t, e, s = () => C) => ne(
2148
2382
  y.map(
2149
2383
  t,
2150
- (r) => r.length > 0 ? { notEmpty: r } : { whenEmpty: null }
2384
+ (n) => n.length > 0 ? { notEmpty: n } : { whenEmpty: null }
2151
2385
  ),
2152
2386
  {
2153
- notEmpty: (r) => e(r),
2387
+ notEmpty: (n) => e(n),
2154
2388
  whenEmpty: () => s()
2155
2389
  }
2156
- ), _s = (t, e) => (s) => {
2157
- const r = s.makePortal(t), n = oe(h(e), r);
2158
- return () => n(!0);
2159
- }, F = /* @__PURE__ */ new Map(), Dt = (t) => ({
2160
- mark: Qe(`Probe(${t.description})`),
2390
+ ), Us = (t, e) => (s) => {
2391
+ const n = s.makePortal(t), r = he(f(e), n);
2392
+ return () => r(!0);
2393
+ }, W = /* @__PURE__ */ new Map(), Jt = (t) => ({
2394
+ mark: at(`Probe(${t.description})`),
2161
2395
  create: ({ callback: e = () => {
2162
2396
  }, timeout: s = 10 } = {}) => {
2163
- const r = (l) => {
2164
- clearTimeout(n), F.delete(t), e(l);
2397
+ const n = (l) => {
2398
+ clearTimeout(r), W.delete(t), e(l);
2165
2399
  };
2166
- if (F.has(t))
2400
+ if (W.has(t))
2167
2401
  throw new Error(`Probe already exists: ${t.description}`);
2168
- const n = setTimeout(() => r("timeout"), s), i = { counter: 0, timeoutId: n };
2169
- return F.set(t, i), {
2402
+ const r = setTimeout(() => n("timeout"), s), i = { counter: 0, timeoutId: r };
2403
+ return W.set(t, i), {
2170
2404
  value: () => {
2171
- clearTimeout(n);
2172
- const l = F.get(t);
2173
- l != null && --l.counter === 0 && r("resolved");
2405
+ clearTimeout(r);
2406
+ const l = W.get(t);
2407
+ l != null && --l.counter === 0 && n("resolved");
2174
2408
  },
2175
- dispose: () => r("disposed"),
2409
+ dispose: () => n("disposed"),
2176
2410
  onUse: () => i.counter++
2177
2411
  };
2178
2412
  }
2179
- }), Es = Dt(Symbol("GlobalProbe")), Ot = (t, e) => (s) => {
2180
- const r = s.getStyle(t);
2181
- return s.setStyle(t, e), (n) => {
2182
- n && s.setStyle(t, r);
2413
+ }), Gs = Jt(Symbol("GlobalProbe")), Xt = (t, e) => (s) => {
2414
+ const n = s.getStyle(t);
2415
+ return s.setStyle(t, e), (r) => {
2416
+ r && s.setStyle(t, n);
2183
2417
  };
2184
- }, Mt = (t, e) => (s) => {
2185
- const r = s.getStyle(t), n = e.on((i) => s.setStyle(t, i));
2418
+ }, Yt = (t, e) => (s) => {
2419
+ const n = s.getStyle(t), r = e.on((i) => s.setStyle(t, i));
2186
2420
  return (i) => {
2187
- n(), i && s.setStyle(t, r);
2421
+ r(), i && s.setStyle(t, n);
2188
2422
  };
2189
- }, ue = (t, e) => m.is(e) ? Mt(t, e) : Ot(t, e), Cs = new Proxy({}, {
2423
+ }, me = (t, e) => g.is(e) ? Yt(t, e) : Xt(t, e), Js = new Proxy({}, {
2190
2424
  /**
2191
2425
  * Creates a renderable component for the specified `style` property.
2192
2426
  *
@@ -2195,168 +2429,191 @@ const pt = /* @__PURE__ */ new Set([
2195
2429
  * @returns The renderable component for the specified attribute.
2196
2430
  *
2197
2431
  */
2198
- get: (t, e) => e === "variable" ? (s, r) => ue(s, r) : (s) => ue(e, s)
2199
- }), It = (t) => (e) => {
2432
+ get: (t, e) => e === "variable" ? (s, n) => me(s, n) : (s) => me(e, s)
2433
+ }), Qt = (t) => (e) => {
2200
2434
  if (e.isBrowser()) {
2201
2435
  const s = t(e);
2202
2436
  if (s != null)
2203
- return h(s)(e);
2437
+ return f(s)(e);
2204
2438
  }
2205
2439
  return () => {
2206
2440
  };
2207
- }, Ps = (t) => (e) => {
2441
+ }, Xs = (t) => (e) => {
2208
2442
  const s = t(e);
2209
2443
  return s == null ? () => {
2210
- } : h(s)(e);
2211
- }, xs = (t) => It((e) => t(e.element)), Ls = (t) => (e) => {
2444
+ } : f(s)(e);
2445
+ }, Ys = (t) => Qt((e) => t(e.element)), Qs = (t) => (e) => {
2212
2446
  if (e.isHeadlessDOM()) {
2213
2447
  const s = t(e);
2214
2448
  if (s)
2215
- return h(s)(e);
2449
+ return f(s)(e);
2216
2450
  }
2217
2451
  return () => {
2218
2452
  };
2219
- }, ce = (t) => (e) => {
2453
+ }, Zs = (t) => (e) => {
2454
+ const s = new j(), n = L(s, () => f(t(s))(e));
2455
+ return (r) => {
2456
+ s.dispose(), n(r);
2457
+ };
2458
+ }, de = (t) => (e) => {
2220
2459
  let s = e;
2221
- function r() {
2460
+ function n() {
2222
2461
  return s;
2223
2462
  }
2224
- function n(l) {
2463
+ function r(l) {
2225
2464
  s = l;
2226
2465
  }
2227
2466
  const i = [], o = t({
2228
2467
  use: ({ mark: l }) => {
2229
- const { value: c, onUse: a } = r().getProvider(l);
2468
+ const { value: c, onUse: a } = n().getProvider(l);
2230
2469
  return a?.(), c;
2231
2470
  },
2232
2471
  set: ({ mark: l, create: c }, a) => {
2233
- const { value: u, dispose: p, onUse: d } = c(a, r());
2234
- i.push(p), n(r().setProvider(l, u, d));
2472
+ const { value: u, dispose: h, onUse: p } = c(a, n());
2473
+ i.push(h), r(n().setProvider(l, u, p));
2235
2474
  }
2236
2475
  });
2237
2476
  return o == null ? () => {
2238
- } : T(
2239
- h(o),
2240
- V(() => i.forEach((l) => l()))
2241
- )(r());
2242
- }, Ds = (t, e, s) => ce(({ set: r }) => (r(t, e), s())), Os = (t, e) => ce(({ use: s }) => e(s(t))), Ms = (...t) => (e) => ce(({ use: s }) => {
2243
- const r = t.map(s);
2244
- return e(...r);
2477
+ } : E(
2478
+ f(o),
2479
+ Gt(() => i.forEach((l) => l()))
2480
+ )(n());
2481
+ }, zs = (t, e, s) => de(({ set: n }) => (n(t, e), s())), Ks = (t, e) => de(({ use: s }) => e(s(t))), en = (...t) => (e) => de(({ use: s }) => {
2482
+ const n = t.map(s);
2483
+ return e(...n);
2245
2484
  });
2246
2485
  export {
2247
- ns as Async,
2248
- fs as BindChecked,
2249
- cs as BindDate,
2250
- as as BindDateTime,
2251
- us as BindNumber,
2252
- hs as BindText,
2253
- k as BrowserContext,
2254
- W as CLASS_PLACEHOLDER_ATTR,
2255
- H as Computed,
2256
- gs as Conjunction,
2257
- ys as DOMNode,
2258
- xe as El,
2259
- Le as ElNS,
2260
- se as ElementPosition,
2261
- E as Empty,
2262
- bs as Ensure,
2263
- ws as EnsureAll,
2264
- Ts as ForEach,
2265
- T as Fragment,
2266
- Es as GlobalProbe,
2267
- Gt as HeadlessAdapter,
2268
- $ as HeadlessContext,
2269
- ft as HeadlessElement,
2270
- Ee as HeadlessPortal,
2271
- dt as HeadlessText,
2272
- vs as MapSignal,
2273
- fe as MemoryStore,
2274
- As as NotEmpty,
2275
- vt as OnChecked,
2276
- V as OnDispose,
2277
- K as OneOf,
2278
- Me as OneOfField,
2279
- ds as OneOfKind,
2280
- ps as OneOfTuple,
2281
- ms as OneOfType,
2282
- Lt as OneOfValue,
2283
- _s as Portal,
2284
- Y as Prop,
2285
- Ds as Provide,
2286
- Se as ProviderNotFoundError,
2287
- Ze as RenderingError,
2288
- He as Repeat,
2289
- m as Signal,
2290
- De as Task,
2291
- Yt as TextNode,
2292
- Ss as Unless,
2293
- Os as Use,
2294
- Ms as UseMany,
2486
+ Ht as Aria,
2487
+ Es as Async,
2488
+ kt as Attr,
2489
+ ks as BindChecked,
2490
+ xs as BindDate,
2491
+ Ls as BindDateTime,
2492
+ Os as BindNumber,
2493
+ Ms as BindText,
2494
+ $ as BrowserContext,
2495
+ G as CLASS_PLACEHOLDER_ATTR,
2496
+ N as Computed,
2497
+ $s as Conjunction,
2498
+ Rs as DOMNode,
2499
+ It as DataAttr,
2500
+ j as DisposalScope,
2501
+ Ne as El,
2502
+ te as ElNS,
2503
+ le as ElementPosition,
2504
+ C as Empty,
2505
+ Vs as Ensure,
2506
+ js as EnsureAll,
2507
+ Fs as ForEach,
2508
+ E as Fragment,
2509
+ Gs as GlobalProbe,
2510
+ fs as HeadlessAdapter,
2511
+ R as HeadlessContext,
2512
+ Et as HeadlessElement,
2513
+ ke as HeadlessPortal,
2514
+ Ct as HeadlessText,
2515
+ Bs as MapSignal,
2516
+ $t as MathAttr,
2517
+ Ts as MathEl,
2518
+ be as MemoryStore,
2519
+ Ws as NotEmpty,
2520
+ Rt as OnChecked,
2521
+ Gt as OnDispose,
2522
+ ne as OneOf,
2523
+ qe as OneOfField,
2524
+ Is as OneOfKind,
2525
+ Hs as OneOfTuple,
2526
+ Ns as OneOfType,
2527
+ Ut as OneOfValue,
2528
+ Us as Portal,
2529
+ Z as Prop,
2530
+ zs as Provide,
2531
+ Pe as ProviderNotFoundError,
2532
+ ut as RenderingError,
2533
+ Be as Repeat,
2534
+ Nt as SVGAttr,
2535
+ _s as SVGEl,
2536
+ g as Signal,
2537
+ Ve as Task,
2538
+ ps as TextNode,
2539
+ qs as Unless,
2540
+ Ks as Use,
2541
+ en as UseMany,
2295
2542
  y as Value,
2296
- Ie as When,
2297
- It as WithBrowserCtx,
2298
- Ps as WithCtx,
2299
- xs as WithElement,
2300
- Ls as WithHeadlessCtx,
2301
- ce as WithProvider,
2302
- Te as _NODE_PLACEHOLDER_ATTR,
2303
- Ye as _getSelfOrParentElement,
2304
- we as _isElement,
2305
- Xe as _makeGetter,
2306
- Ge as _makeSetter,
2307
- B as _removeDOMNode,
2308
- Pe as _signalText,
2309
- Ce as _staticText,
2310
- Rt as animateSignal,
2311
- Ue as animateSignals,
2312
- Zt as aria,
2313
- R as attr,
2314
- Bt as bind,
2315
- Wt as coalesce,
2316
- re as computed,
2317
- ie as computedOf,
2318
- Je as computedRecord,
2319
- Qt as dataAttr,
2320
- jt as delaySignal,
2321
- qe as effect,
2322
- kt as effectOf,
2323
- At as emit,
2324
- ls as emitChecked,
2325
- L as emitTarget,
2326
- _t as emitValue,
2327
- Ct as emitValueAsDate,
2328
- Pt as emitValueAsDateTime,
2329
- is as emitValueAsNullableDate,
2330
- os as emitValueAsNullableDateTime,
2331
- Et as emitValueAsNumber,
2332
- Re as endInterpolate,
2333
- ne as getWindow,
2334
- Ve as guessInterpolate,
2335
- es as html,
2336
- ts as input,
2337
- Ne as interpolateDate,
2338
- ke as interpolateNumber,
2339
- $e as interpolateString,
2340
- Ht as joinSignals,
2341
- $t as localStorageProp,
2342
- Dt as makeProbe,
2343
- Qe as makeProviderMark,
2344
- rs as math,
2345
- Kt as mathAttr,
2346
- Vt as merge,
2347
- z as on,
2348
- qt as previousSignal,
2349
- _ as prop,
2350
- Ut as render,
2351
- oe as renderWithContext,
2352
- h as renderableOfTNode,
2353
- Xt as restoreTempoPlaceholders,
2354
- Jt as runHeadless,
2355
- Nt as sessionStorageProp,
2356
- Q as signal,
2357
- Ft as slidingWindowSignal,
2358
- de as storedProp,
2359
- Cs as style,
2360
- ss as svg,
2361
- zt as svgAttr
2543
+ Fe as When,
2544
+ Qt as WithBrowserCtx,
2545
+ Xs as WithCtx,
2546
+ Ys as WithElement,
2547
+ Qs as WithHeadlessCtx,
2548
+ de as WithProvider,
2549
+ Zs as WithScope,
2550
+ xe as _NODE_PLACEHOLDER_ATTR,
2551
+ ct as _getSelfOrParentElement,
2552
+ De as _isElement,
2553
+ lt as _makeGetter,
2554
+ ot as _makeSetter,
2555
+ U as _removeDOMNode,
2556
+ He as _signalText,
2557
+ Ie as _staticText,
2558
+ ns as animateSignal,
2559
+ rt as animateSignals,
2560
+ ms as aria,
2561
+ V as attr,
2562
+ cs as bind,
2563
+ as as coalesce,
2564
+ z as computed,
2565
+ ee as computedOf,
2566
+ it as computedRecord,
2567
+ gs as dataAttr,
2568
+ is as delaySignal,
2569
+ Se as effect,
2570
+ Qe as effectOf,
2571
+ Vt as emit,
2572
+ Ps as emitChecked,
2573
+ O as emitTarget,
2574
+ jt as emitValue,
2575
+ Ft as emitValueAsDate,
2576
+ Bt as emitValueAsDateTime,
2577
+ Cs as emitValueAsNullableDate,
2578
+ Ds as emitValueAsNullableDateTime,
2579
+ qt as emitValueAsNumber,
2580
+ et as endInterpolate,
2581
+ ye as getCurrentScope,
2582
+ zt as getParentScope,
2583
+ Zt as getScopeStack,
2584
+ ue as getWindow,
2585
+ tt as guessInterpolate,
2586
+ ws as html,
2587
+ bs as input,
2588
+ Ke as interpolateDate,
2589
+ Ze as interpolateNumber,
2590
+ ze as interpolateString,
2591
+ es as joinSignals,
2592
+ ts as localStorageProp,
2593
+ Jt as makeProbe,
2594
+ at as makeProviderMark,
2595
+ As as math,
2596
+ Ss as mathAttr,
2597
+ rs as merge,
2598
+ se as on,
2599
+ Ue as popScope,
2600
+ os as previousSignal,
2601
+ T as prop,
2602
+ We as pushScope,
2603
+ us as render,
2604
+ he as renderWithContext,
2605
+ f as renderableOfTNode,
2606
+ ds as restoreTempoPlaceholders,
2607
+ hs as runHeadless,
2608
+ _ as scopeStack,
2609
+ Kt as scoped,
2610
+ ss as sessionStorageProp,
2611
+ K as signal,
2612
+ ls as slidingWindowSignal,
2613
+ _e as storedProp,
2614
+ Js as style,
2615
+ vs as svg,
2616
+ ys as svgAttr,
2617
+ oe as untracked,
2618
+ L as withScope
2362
2619
  };