@tempots/dom 33.1.1 → 34.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,24 +1,297 @@
1
- const _ = [], We = (t) => {
1
+ const Ue = (t) => Symbol(t);
2
+ function Ge(t, e) {
3
+ return {
4
+ type: t,
5
+ render: e
6
+ };
7
+ }
8
+ function be(t) {
9
+ return t != null && t !== !1 && t !== 0 && t !== "";
10
+ }
11
+ function Je(t) {
12
+ return !be(t);
13
+ }
14
+ function Ke(t) {
15
+ return t == null;
16
+ }
17
+ function ze(t) {
18
+ return t != null;
19
+ }
20
+ const w = {
21
+ /**
22
+ * Maps a value or a Signal to a new value.
23
+ * If the value is a Signal, it returns a new Signal with the mapped value.
24
+ * If the value is not a Signal, it returns the mapped value.
25
+ *
26
+ * @typeParam T - The type of the value.
27
+ * @typeParam U - The type of the new value.
28
+ * @param value - The value or Signal to map.
29
+ * @param fn - The function to map the value.
30
+ * @returns The mapped value.
31
+ */
32
+ map: (t, e) => m.is(t) ? t.map(e) : e(t),
33
+ /**
34
+ * Wraps a value or a Signal instance into a Signal.
35
+ * If the value is already a Signal, it returns the value itself.
36
+ * If the value is not a Signal, it creates a new Signal instance with the given value.
37
+ *
38
+ * @typeParam O - The type of the value.
39
+ * @param value - The value or Signal instance to wrap.
40
+ * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
41
+ * @returns A Signal instance.
42
+ */
43
+ toSignal: (t, e) => m.is(t) ? t.derive() : se(t, e),
44
+ /**
45
+ * Wraps a value in a `Signal` if it is not already a `Signal`.
46
+ * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
47
+ * @param value - The value to wrap or check.
48
+ * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
49
+ */
50
+ maybeToSignal: (t, e) => {
51
+ if (t != null)
52
+ return w.toSignal(t, e);
53
+ },
54
+ /**
55
+ * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
56
+ * @param value - The value or Signal instance to get the value from.
57
+ * @returns The value.
58
+ */
59
+ get: (t) => m.is(t) ? t.get() : t,
60
+ /**
61
+ * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
62
+ * @param value - The value or Signal instance to add the listener to.
63
+ * @param listener - The listener to call when the value changes.
64
+ * @returns A function to remove the listener.
65
+ */
66
+ on: (t, e) => m.is(t) ? t.on(e) : (e(t), () => {
67
+ }),
68
+ /**
69
+ * Disposes of a value or a Signal.
70
+ * If the value is a Signal, it disposes of the Signal.
71
+ * If the value is not a Signal, it does nothing.
72
+ * @param value - The value or Signal instance to dispose of.
73
+ */
74
+ dispose: (t) => {
75
+ m.is(t) && t.dispose();
76
+ },
77
+ /**
78
+ * Returns a function that disposes of a value or a Signal.
79
+ * If the value is a Signal, it returns a function that disposes of the Signal.
80
+ * If the value is not a Signal, it returns a function that does nothing.
81
+ * @param value - The value or Signal instance to dispose of.
82
+ * @returns A function to dispose of the value or Signal.
83
+ */
84
+ disposeFn: (t) => () => w.dispose(t),
85
+ /**
86
+ * Derives a Prop from a Signal.
87
+ * If the value is a Signal, it returns a new Prop with the derived value.
88
+ * If the value is not a Signal, it returns a new Prop with the value.
89
+ * @param value - The value or Signal instance to derive the Prop from.
90
+ * @param options - The options for the derived Prop.
91
+ * @param options.autoDisposeProp - Determines whether the derived Prop should be automatically disposed.
92
+ * @param options.equals - A function that determines if two values are equal.
93
+ * @returns A Prop instance.
94
+ */
95
+ deriveProp: (t, {
96
+ autoDisposeProp: e = !0,
97
+ equals: s
98
+ } = {}) => m.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : T(t, s),
99
+ /**
100
+ * Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
101
+ * @param value - The value or signal to check.
102
+ * @returns A signal that emits `true` if the value is truthy, `false` otherwise.
103
+ */
104
+ truthy: (t) => w.map(t, be),
105
+ /**
106
+ * Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
107
+ * @param value - The value or signal to check.
108
+ * @returns A signal that emits `true` if the value is falsy, `false` otherwise.
109
+ */
110
+ falsy: (t) => w.map(t, Je),
111
+ /**
112
+ * Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
113
+ * @param value - The value or signal to check.
114
+ * @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
115
+ */
116
+ nil: (t) => w.map(t, Ke),
117
+ /**
118
+ * Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
119
+ * @param value - The value or signal to check.
120
+ * @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
121
+ */
122
+ defined: (t) => w.map(t, ze)
123
+ }, Z = (...t) => (e, s) => {
124
+ if (t.length === 1)
125
+ return w.toSignal(t[0]).map(e);
126
+ const n = t.filter((r) => m.is(r));
127
+ return te(
128
+ () => e(...t.map((r) => w.get(r))),
129
+ n,
130
+ s
131
+ );
132
+ }, es = (t) => {
133
+ const e = Object.keys(t);
134
+ return Z(...Object.values(t))(
135
+ (...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
136
+ );
137
+ }, Ye = (...t) => (e, s = {}) => {
138
+ const n = t.filter((r) => m.is(r));
139
+ return ve(
140
+ () => e(...t.map(w.get)),
141
+ n,
142
+ s
143
+ );
144
+ };
145
+ class q {
146
+ _signals = /* @__PURE__ */ new Set();
147
+ _callbacks = [];
148
+ _disposed = !1;
149
+ /**
150
+ * Register a signal with this scope for automatic disposal.
151
+ *
152
+ * @param signal - The signal to track
153
+ * @throws Error if the scope has already been disposed
154
+ * @throws Error if the signal has already been disposed
155
+ * @public
156
+ */
157
+ track(e) {
158
+ if (this._disposed)
159
+ throw new Error("Cannot track signal in disposed scope");
160
+ if (e.isDisposed())
161
+ throw new Error("Cannot track already disposed signal");
162
+ this._signals.add(e);
163
+ }
164
+ /**
165
+ * Register a disposal callback to be called when this scope is disposed.
166
+ * Callbacks are called before signals are disposed.
167
+ * Use this for cleanup that doesn't need the `removeTree` parameter.
168
+ *
169
+ * @param callback - The callback to call on disposal
170
+ * @throws Error if the scope has already been disposed
171
+ * @public
172
+ */
173
+ onDispose(e) {
174
+ if (this._disposed)
175
+ throw new Error("Cannot register callback in disposed scope");
176
+ this._callbacks.push(e);
177
+ }
178
+ /**
179
+ * Dispose all signals tracked by this scope.
180
+ * This method is idempotent - calling it multiple times is safe.
181
+ *
182
+ * @public
183
+ */
184
+ dispose() {
185
+ if (!this._disposed) {
186
+ this._disposed = !0;
187
+ for (const e of this._callbacks)
188
+ try {
189
+ e();
190
+ } catch (s) {
191
+ console.error("Error in disposal callback:", s);
192
+ }
193
+ this._callbacks.length = 0;
194
+ for (const e of this._signals)
195
+ e.dispose();
196
+ this._signals.clear();
197
+ }
198
+ }
199
+ /**
200
+ * Check if this scope has been disposed.
201
+ *
202
+ * @returns true if the scope has been disposed
203
+ * @public
204
+ */
205
+ get disposed() {
206
+ return this._disposed;
207
+ }
208
+ /**
209
+ * Creates a prop signal and tracks it in this scope.
210
+ * Use this method in async contexts where automatic tracking doesn't work.
211
+ *
212
+ * @param value - The initial value
213
+ * @param equals - Optional equality function
214
+ * @returns A tracked Prop signal
215
+ * @public
216
+ */
217
+ prop(e, s) {
218
+ const n = le(() => T(e, s));
219
+ return this.track(n), n;
220
+ }
221
+ /**
222
+ * Creates a computed signal and tracks it in this scope.
223
+ * Use this method in async contexts where automatic tracking doesn't work.
224
+ *
225
+ * @param fn - The computation function
226
+ * @param dependencies - Array of signals this computed depends on
227
+ * @param equals - Optional equality function
228
+ * @returns A tracked Computed signal
229
+ * @public
230
+ */
231
+ computed(e, s, n) {
232
+ const r = le(() => te(e, s, n));
233
+ return this.track(r), r;
234
+ }
235
+ /**
236
+ * Creates an effect and tracks it in this scope.
237
+ * Use this method in async contexts where automatic tracking doesn't work.
238
+ *
239
+ * @param fn - The effect function
240
+ * @param signals - Array of signals to listen to
241
+ * @param options - Optional listener options
242
+ * @returns A clear function (the effect itself is tracked in the scope)
243
+ * @public
244
+ */
245
+ effect(e, s, n) {
246
+ return O(this, () => ve(e, s, n));
247
+ }
248
+ /**
249
+ * Creates a computed signal with curried signature and tracks it in this scope.
250
+ * Use this method in async contexts where automatic tracking doesn't work.
251
+ *
252
+ * @param args - Values or signals to compute from
253
+ * @returns A function that takes the computation function and returns a tracked Computed signal
254
+ * @public
255
+ */
256
+ computedOf(...e) {
257
+ return (s, n) => {
258
+ const r = le(() => Z(...e)(s, n));
259
+ return this.track(r), r;
260
+ };
261
+ }
262
+ /**
263
+ * Creates an effect with curried signature and tracks it in this scope.
264
+ * Use this method in async contexts where automatic tracking doesn't work.
265
+ *
266
+ * @param args - Values or signals to listen to
267
+ * @returns A function that takes the effect function and returns a clear function
268
+ * @public
269
+ */
270
+ effectOf(...e) {
271
+ return (s, n) => O(this, () => Ye(...e)(s, n));
272
+ }
273
+ }
274
+ const _ = [], Xe = (t) => {
2
275
  _.push(t);
3
- }, Ue = () => {
276
+ }, Qe = () => {
4
277
  if (_.length === 0)
5
278
  throw new Error("Cannot pop from empty scope stack");
6
279
  _.pop();
7
- }, ue = () => _[_.length - 1] ?? null, Zt = () => _, zt = () => _[_.length - 2] ?? null, P = (t, e) => {
8
- We(t);
280
+ }, he = () => _[_.length - 1] ?? null, ts = () => _, ss = () => _[_.length - 2] ?? null, O = (t, e) => {
281
+ Xe(t);
9
282
  try {
10
283
  return e();
11
284
  } finally {
12
- Ue();
285
+ Qe();
13
286
  }
14
- }, Kt = (t) => {
15
- const e = new j();
287
+ }, ns = (t) => {
288
+ const e = new q();
16
289
  try {
17
- return P(e, () => t(e));
290
+ return O(e, () => t(e));
18
291
  } finally {
19
292
  e.dispose();
20
293
  }
21
- }, ie = (t) => {
294
+ }, le = (t) => {
22
295
  const e = _.slice();
23
296
  _.length = 0;
24
297
  try {
@@ -27,7 +300,7 @@ const _ = [], We = (t) => {
27
300
  _.length = 0, _.push(...e);
28
301
  }
29
302
  };
30
- class g {
303
+ class m {
31
304
  /**
32
305
  * Represents a signal with a value of type T.
33
306
  *
@@ -80,7 +353,7 @@ class g {
80
353
  * @returns A Signal that represents the result of the Promise
81
354
  */
82
355
  static ofPromise = (e, s, n, r = (o, i) => o === i) => {
83
- const o = new g(s, r);
356
+ const o = new m(s, r);
84
357
  return e.then((i) => o._setAndNotify(i)).catch((i) => {
85
358
  n != null ? o._setAndNotify(n(i)) : console.error(
86
359
  "Unhandled promise rejection in Signal.ofPromise:",
@@ -173,11 +446,7 @@ class g {
173
446
  const o = this._onValueListeners.indexOf(n);
174
447
  o !== -1 && this._onValueListeners.splice(o, 1), s.abortSignal != null && s.abortSignal.removeEventListener("abort", r);
175
448
  };
176
- if (s.abortSignal != null && s.abortSignal.addEventListener("abort", r), !s.noAutoDispose) {
177
- const o = ue();
178
- o?.onDispose(r);
179
- }
180
- return r;
449
+ return s.abortSignal != null && s.abortSignal.addEventListener("abort", r), !s.noAutoDispose && he()?.onDispose(r), r;
181
450
  };
182
451
  /**
183
452
  * Registers a listener function to be called whenever the value of the signal changes.
@@ -200,7 +469,7 @@ class g {
200
469
  _setAndNotify = (e) => {
201
470
  if (this._disposed) return;
202
471
  const s = this._value;
203
- this.equals(s, e) || (this._value = e, this._onValueListeners.forEach((r) => r(e, s)));
472
+ this.equals(s, e) || (this._value = e, this._onValueListeners.forEach((n) => n(e, s)));
204
473
  };
205
474
  /**
206
475
  * @internal
@@ -371,8 +640,8 @@ class g {
371
640
  let r = s;
372
641
  const o = new N(() => {
373
642
  try {
374
- const i = this.get(), l = e(i);
375
- return r = l ?? r;
643
+ const i = this.get();
644
+ return r = e(i) ?? r;
376
645
  } catch (i) {
377
646
  throw console.error("Error in Signal.filterMap:", i), i;
378
647
  }
@@ -393,7 +662,7 @@ class g {
393
662
  * @returns A property that holds the mapped value and can be observed for changes.
394
663
  */
395
664
  mapAsync = (e, s, n, r = (o, i) => o === i) => {
396
- const o = A(s, r);
665
+ const o = T(s, r);
397
666
  let i = 0, l = new AbortController();
398
667
  return o.onDispose(
399
668
  this.on(async (c) => {
@@ -443,7 +712,7 @@ class g {
443
712
  deriveProp = ({
444
713
  autoDisposeProp: e = !0,
445
714
  equals: s
446
- } = {}) => this.feedProp(A(this.get(), s), e);
715
+ } = {}) => this.feedProp(T(this.get(), s), e);
447
716
  /**
448
717
  * 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.
449
718
  * @returns A new signal that emits the same values as the current signal.
@@ -472,8 +741,8 @@ class g {
472
741
  }), e.onDispose(this.on(e.setDirty, { noAutoDispose: !0 })), this.onDispose(e.dispose);
473
742
  };
474
743
  }
475
- const Ge = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
476
- class N extends g {
744
+ const Ze = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
745
+ class N extends m {
477
746
  /**
478
747
  * Creates a new Computed signal.
479
748
  *
@@ -499,9 +768,7 @@ class N extends g {
499
768
  * @see {@link untracked} - Create signals outside of scope tracking
500
769
  */
501
770
  constructor(e, s) {
502
- super(void 0, s), this._fn = e, this.setDirty();
503
- const n = ue();
504
- n?.track(this);
771
+ super(void 0, s), this._fn = e, this.setDirty(), he()?.track(this);
505
772
  }
506
773
  /**
507
774
  * Checks if a value is an instance of `Computed`.
@@ -529,471 +796,155 @@ class N extends g {
529
796
  this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((e) => e.setDirty()), this._scheduleNotify());
530
797
  };
531
798
  /**
532
- * @internal
533
- */
534
- _scheduleCount = 0;
535
- /**
536
- * Schedules a notification to be executed asynchronously.
537
- * If the signal is dirty, it will be updated and notified.
538
- * @internal
539
- */
540
- _scheduleNotify = () => {
541
- const e = ++this._scheduleCount;
542
- Ge(() => {
543
- this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
544
- });
545
- };
546
- /** {@inheritDoc Signal.get} */
547
- get = () => (this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn())), this._value);
548
- /** {@inheritDoc Signal.value} */
549
- get value() {
550
- return this.get();
551
- }
552
- /**
553
- * Disposes the computed signal and cancels any pending recomputations.
554
- * This override increments the schedule count to invalidate all pending
555
- * microtasks before disposing the signal.
556
- */
557
- dispose = () => {
558
- this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
559
- };
560
- }
561
- class Z extends g {
562
- /**
563
- * Checks if a value is a Prop.
564
- * @param value - The value to check.
565
- * @returns `true` if the value is a Prop, `false` otherwise.
566
- */
567
- static is = (e) => (
568
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
569
- e != null && e.$__prop__ === !0
570
- );
571
- /**
572
- * @internal
573
- */
574
- $__prop__ = !0;
575
- /**
576
- * Changes the value of the property and notifies its listeners.
577
- *
578
- * @param value - The new value of the property.
579
- */
580
- set = (e) => {
581
- this._setAndNotify(e);
582
- };
583
- /**
584
- * Updates the value of the signal by applying the provided function to the current value.
585
- * @param fn - The function to apply to the current value.
586
- */
587
- update = (e) => {
588
- this._setAndNotify(e(this.get()));
589
- };
590
- /**
591
- * Creates a reducer function that combines the provided reducer function and effects.
592
- * @param fn - The reducer function that takes the current state and an action, and returns the new state.
593
- * @param effects - An array of effects to be executed after the state is updated.
594
- * @returns A dispatch function that can be used to update the state and trigger the effects.
595
- */
596
- reducer = (e, ...s) => {
597
- const n = this;
598
- return function r(o) {
599
- const i = n.value;
600
- n.update((l) => e(l, o)), !n.equals(i, n.value) && s.forEach(
601
- (l) => l({
602
- previousState: i,
603
- state: n.value,
604
- action: o,
605
- dispatch: r
606
- })
607
- );
608
- };
609
- };
610
- /**
611
- * Creates an isomorphism for the Signal.
612
- * An isomorphism is a pair of functions that convert values between two types,
613
- * along with an equality function to compare values of the second type.
614
- *
615
- * @param to - A function that converts values from type T to type O.
616
- * @param from - A function that converts values from type O to type T.
617
- * @param equals - An optional function that compares values of type O for equality.
618
- * Defaults to a strict equality check (===).
619
- * @returns A Prop object representing the isomorphism.
620
- */
621
- iso = (e, s, n = (r, o) => r === o) => {
622
- const r = new Z(e(this.get()), n);
623
- return r.onDispose(this.on((o) => r.set(e(o)))), r.on((o) => this._setAndNotify(s(o))), r;
624
- };
625
- /**
626
- * Returns a `Prop` that represents the value at the specified key of the current value.
627
- *
628
- * @param key - The key of the value to access.
629
- * @returns A `Prop` that represents the value at the specified key.
630
- */
631
- atProp = (e) => this.iso(
632
- (s) => s[e],
633
- (s) => ({ ...this.value, [e]: s })
634
- );
635
- /**
636
- * Access for the current value of the property.
637
- */
638
- get value() {
639
- return this.get();
640
- }
641
- set value(e) {
642
- this._setAndNotify(e);
643
- }
644
- }
645
- const z = (t, e, s = (n, r) => n === r) => {
646
- const n = new N(t, s);
647
- return e.forEach((r) => r.setDerivative(n)), n;
648
- }, Se = (t, e, s = {}) => {
649
- let n = s.once ? () => {
650
- o(), t();
651
- } : t;
652
- if (s.skipInitial) {
653
- let i = !1;
654
- const l = n;
655
- n = () => {
656
- i ? l() : i = !0;
657
- };
658
- }
659
- const r = z(n, e), o = () => {
660
- r.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", o);
661
- };
662
- return s.abortSignal != null && s.abortSignal.addEventListener("abort", o), o;
663
- }, A = (t, e = (s, n) => s === n) => {
664
- const s = new Z(t, e), n = ue();
665
- return n?.track(s), s;
666
- }, K = (t, e = (s, n) => s === n) => new g(t, e);
667
- function we(t) {
668
- return t != null && t !== !1 && t !== 0 && t !== "";
669
- }
670
- function Je(t) {
671
- return !we(t);
672
- }
673
- function Xe(t) {
674
- return t == null;
675
- }
676
- function Ye(t) {
677
- return t != null;
678
- }
679
- const y = {
680
- /**
681
- * Maps a value or a Signal to a new value.
682
- * If the value is a Signal, it returns a new Signal with the mapped value.
683
- * If the value is not a Signal, it returns the mapped value.
684
- *
685
- * @typeParam T - The type of the value.
686
- * @typeParam U - The type of the new value.
687
- * @param value - The value or Signal to map.
688
- * @param fn - The function to map the value.
689
- * @returns The mapped value.
690
- */
691
- map: (t, e) => g.is(t) ? t.map(e) : e(t),
692
- /**
693
- * Wraps a value or a Signal instance into a Signal.
694
- * If the value is already a Signal, it returns the value itself.
695
- * If the value is not a Signal, it creates a new Signal instance with the given value.
696
- *
697
- * @typeParam O - The type of the value.
698
- * @param value - The value or Signal instance to wrap.
699
- * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
700
- * @returns A Signal instance.
701
- */
702
- toSignal: (t, e) => g.is(t) ? t.derive() : K(t, e),
703
- /**
704
- * Wraps a value in a `Signal` if it is not already a `Signal`.
705
- * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
706
- * @param value - The value to wrap or check.
707
- * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
708
- */
709
- maybeToSignal: (t, e) => {
710
- if (t != null)
711
- return y.toSignal(t, e);
712
- },
713
- /**
714
- * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
715
- * @param value - The value or Signal instance to get the value from.
716
- * @returns The value.
717
- */
718
- get: (t) => g.is(t) ? t.get() : t,
719
- /**
720
- * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
721
- * @param value - The value or Signal instance to add the listener to.
722
- * @param listener - The listener to call when the value changes.
723
- * @returns A function to remove the listener.
724
- */
725
- on: (t, e) => g.is(t) ? t.on(e) : (e(t), () => {
726
- }),
727
- /**
728
- * Disposes of a value or a Signal.
729
- * If the value is a Signal, it disposes of the Signal.
730
- * If the value is not a Signal, it does nothing.
731
- * @param value - The value or Signal instance to dispose of.
732
- */
733
- dispose: (t) => {
734
- g.is(t) && t.dispose();
735
- },
736
- /**
737
- * Returns a function that disposes of a value or a Signal.
738
- * If the value is a Signal, it returns a function that disposes of the Signal.
739
- * If the value is not a Signal, it returns a function that does nothing.
740
- * @param value - The value or Signal instance to dispose of.
741
- * @returns A function to dispose of the value or Signal.
742
- */
743
- disposeFn: (t) => () => y.dispose(t),
744
- /**
745
- * Derives a Prop from a Signal.
746
- * If the value is a Signal, it returns a new Prop with the derived value.
747
- * If the value is not a Signal, it returns a new Prop with the value.
748
- * @param value - The value or Signal instance to derive the Prop from.
749
- * @param options - The options for the derived Prop.
750
- * @param options.autoDisposeProp - Determines whether the derived Prop should be automatically disposed.
751
- * @param options.equals - A function that determines if two values are equal.
752
- * @returns A Prop instance.
753
- */
754
- deriveProp: (t, {
755
- autoDisposeProp: e = !0,
756
- equals: s
757
- } = {}) => g.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : A(t, s),
758
- /**
759
- * Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
760
- * @param value - The value or signal to check.
761
- * @returns A signal that emits `true` if the value is truthy, `false` otherwise.
762
- */
763
- truthy: (t) => y.map(t, we),
764
- /**
765
- * Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
766
- * @param value - The value or signal to check.
767
- * @returns A signal that emits `true` if the value is falsy, `false` otherwise.
768
- */
769
- falsy: (t) => y.map(t, Je),
770
- /**
771
- * Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
772
- * @param value - The value or signal to check.
773
- * @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
774
- */
775
- nil: (t) => y.map(t, Xe),
776
- /**
777
- * Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
778
- * @param value - The value or signal to check.
779
- * @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
780
- */
781
- defined: (t) => y.map(t, Ye)
782
- }, ee = (...t) => (e, s) => {
783
- if (t.length === 1)
784
- return y.toSignal(t[0]).map(e);
785
- const n = t.filter((r) => g.is(r));
786
- return z(
787
- () => e(...t.map((r) => y.get(r))),
788
- n,
789
- s
790
- );
791
- }, es = (t) => {
792
- const e = Object.keys(t);
793
- return ee(...Object.values(t))(
794
- (...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
795
- );
796
- }, Qe = (...t) => (e, s = {}) => {
797
- const n = t.filter((r) => g.is(r));
798
- return Se(
799
- () => e(...t.map(y.get)),
800
- n,
801
- s
802
- );
803
- };
804
- class j {
805
- _signals = /* @__PURE__ */ new Set();
806
- _callbacks = [];
807
- _disposed = !1;
808
- /**
809
- * Register a signal with this scope for automatic disposal.
810
- *
811
- * @param signal - The signal to track
812
- * @throws Error if the scope has already been disposed
813
- * @throws Error if the signal has already been disposed
814
- * @public
815
- */
816
- track(e) {
817
- if (this._disposed)
818
- throw new Error("Cannot track signal in disposed scope");
819
- if (e.isDisposed())
820
- throw new Error("Cannot track already disposed signal");
821
- this._signals.add(e);
822
- }
823
- /**
824
- * Register a disposal callback to be called when this scope is disposed.
825
- * Callbacks are called before signals are disposed.
826
- * Use this for cleanup that doesn't need the `removeTree` parameter.
827
- *
828
- * @param callback - The callback to call on disposal
829
- * @throws Error if the scope has already been disposed
830
- * @public
831
- */
832
- onDispose(e) {
833
- if (this._disposed)
834
- throw new Error("Cannot register callback in disposed scope");
835
- this._callbacks.push(e);
836
- }
837
- /**
838
- * Dispose all signals tracked by this scope.
839
- * This method is idempotent - calling it multiple times is safe.
840
- *
841
- * @public
842
- */
843
- dispose() {
844
- if (!this._disposed) {
845
- this._disposed = !0;
846
- for (const e of this._callbacks)
847
- try {
848
- e();
849
- } catch (s) {
850
- console.error("Error in disposal callback:", s);
851
- }
852
- this._callbacks.length = 0;
853
- for (const e of this._signals)
854
- e.dispose();
855
- this._signals.clear();
856
- }
857
- }
858
- /**
859
- * Check if this scope has been disposed.
860
- *
861
- * @returns true if the scope has been disposed
862
- * @public
863
- */
864
- get disposed() {
865
- return this._disposed;
866
- }
867
- /**
868
- * Creates a prop signal and tracks it in this scope.
869
- * Use this method in async contexts where automatic tracking doesn't work.
870
- *
871
- * @param value - The initial value
872
- * @param equals - Optional equality function
873
- * @returns A tracked Prop signal
874
- * @public
875
- */
876
- prop(e, s) {
877
- const n = ie(() => A(e, s));
878
- return this.track(n), n;
879
- }
880
- /**
881
- * Creates a computed signal and tracks it in this scope.
882
- * Use this method in async contexts where automatic tracking doesn't work.
883
- *
884
- * @param fn - The computation function
885
- * @param dependencies - Array of signals this computed depends on
886
- * @param equals - Optional equality function
887
- * @returns A tracked Computed signal
888
- * @public
889
- */
890
- computed(e, s, n) {
891
- const r = ie(() => z(e, s, n));
892
- return this.track(r), r;
893
- }
894
- /**
895
- * Creates an effect and tracks it in this scope.
896
- * Use this method in async contexts where automatic tracking doesn't work.
897
- *
898
- * @param fn - The effect function
899
- * @param signals - Array of signals to listen to
900
- * @param options - Optional listener options
901
- * @returns A clear function (the effect itself is tracked in the scope)
902
- * @public
799
+ * @internal
903
800
  */
904
- effect(e, s, n) {
905
- return P(this, () => Se(e, s, n));
906
- }
801
+ _scheduleCount = 0;
907
802
  /**
908
- * Creates a computed signal with curried signature and tracks it in this scope.
909
- * Use this method in async contexts where automatic tracking doesn't work.
910
- *
911
- * @param args - Values or signals to compute from
912
- * @returns A function that takes the computation function and returns a tracked Computed signal
913
- * @public
803
+ * Schedules a notification to be executed asynchronously.
804
+ * If the signal is dirty, it will be updated and notified.
805
+ * @internal
914
806
  */
915
- computedOf(...e) {
916
- return (s, n) => {
917
- const r = ie(() => ee(...e)(s, n));
918
- return this.track(r), r;
919
- };
807
+ _scheduleNotify = () => {
808
+ const e = ++this._scheduleCount;
809
+ Ze(() => {
810
+ this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
811
+ });
812
+ };
813
+ /** {@inheritDoc Signal.get} */
814
+ get = () => (this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn())), this._value);
815
+ /** {@inheritDoc Signal.value} */
816
+ get value() {
817
+ return this.get();
920
818
  }
921
819
  /**
922
- * Creates an effect with curried signature and tracks it in this scope.
923
- * Use this method in async contexts where automatic tracking doesn't work.
924
- *
925
- * @param args - Values or signals to listen to
926
- * @returns A function that takes the effect function and returns a clear function
927
- * @public
820
+ * Disposes the computed signal and cancels any pending recomputations.
821
+ * This override increments the schedule count to invalidate all pending
822
+ * microtasks before disposing the signal.
928
823
  */
929
- effectOf(...e) {
930
- return (s, n) => P(this, () => Qe(...e)(s, n));
931
- }
824
+ dispose = () => {
825
+ this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
826
+ };
932
827
  }
933
- const Ze = (t, e, s) => t + (e - t) * s, ge = 97, ze = (t, e, s) => {
934
- const n = Math.max(t.length, e.length);
935
- let r = "";
936
- for (let o = 0; o < n; o++) {
937
- let i = t.charCodeAt(o);
938
- isNaN(i) && (i = ge);
939
- let l = e.charCodeAt(o);
940
- isNaN(l) && (l = ge), r += String.fromCharCode(i + (l - i) * s);
941
- }
942
- return r;
943
- }, 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;
944
- class le {
828
+ class ee extends m {
945
829
  /**
946
- * Creates a new instance of `ElementPosition`.
947
- * @param index - The index of the element.
948
- * @param total - The total number of elements in the collection.
830
+ * Checks if a value is a Prop.
831
+ * @param value - The value to check.
832
+ * @returns `true` if the value is a Prop, `false` otherwise.
949
833
  */
950
- constructor(e, s) {
951
- this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
952
- }
834
+ static is = (e) => (
835
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
836
+ e != null && e.$__prop__ === !0
837
+ );
953
838
  /**
954
- * The counter of the element starting from 1.
839
+ * @internal
955
840
  */
956
- counter;
841
+ $__prop__ = !0;
957
842
  /**
958
- * Checks if the element is the first element in the collection.
959
- * @returns `true` if the element is the first element, `false` otherwise.
843
+ * Changes the value of the property and notifies its listeners.
844
+ *
845
+ * @param value - The new value of the property.
960
846
  */
961
- isFirst;
847
+ set = (e) => {
848
+ this._setAndNotify(e);
849
+ };
962
850
  /**
963
- * Checks if the counter of the element is even.
964
- * @returns `true` if the counter is even, `false` otherwise.
851
+ * Updates the value of the signal by applying the provided function to the current value.
852
+ * @param fn - The function to apply to the current value.
965
853
  */
966
- isEven;
854
+ update = (e) => {
855
+ this._setAndNotify(e(this.get()));
856
+ };
967
857
  /**
968
- * Checks if the counter of the element is odd.
969
- * @returns `true` if the counter is odd, `false` otherwise.
858
+ * Creates a reducer function that combines the provided reducer function and effects.
859
+ * @param fn - The reducer function that takes the current state and an action, and returns the new state.
860
+ * @param effects - An array of effects to be executed after the state is updated.
861
+ * @returns A dispatch function that can be used to update the state and trigger the effects.
970
862
  */
971
- isOdd;
972
- #e;
863
+ reducer = (e, ...s) => {
864
+ const n = this;
865
+ return function r(o) {
866
+ const i = n.value;
867
+ n.update((l) => e(l, o)), !n.equals(i, n.value) && s.forEach(
868
+ (l) => l({
869
+ previousState: i,
870
+ state: n.value,
871
+ action: o,
872
+ dispatch: r
873
+ })
874
+ );
875
+ };
876
+ };
973
877
  /**
974
- * Checks if the element is the last element in the collection.
975
- * @returns `true` if the element is the last element, `false` otherwise.
878
+ * Creates an isomorphism for the Signal.
879
+ * An isomorphism is a pair of functions that convert values between two types,
880
+ * along with an equality function to compare values of the second type.
881
+ *
882
+ * @param to - A function that converts values from type T to type O.
883
+ * @param from - A function that converts values from type O to type T.
884
+ * @param equals - An optional function that compares values of type O for equality.
885
+ * Defaults to a strict equality check (===).
886
+ * @returns A Prop object representing the isomorphism.
976
887
  */
977
- get isLast() {
978
- return this.#e == null && (this.#e = this.total.map((e) => this.counter === e)), this.#e;
979
- }
888
+ iso = (e, s, n = (r, o) => r === o) => {
889
+ const r = new ee(e(this.get()), n);
890
+ return r.onDispose(this.on((o) => r.set(e(o)))), r.on((o) => this._setAndNotify(s(o))), r;
891
+ };
980
892
  /**
981
- * Disposes the internal signal created by `isLast`.
893
+ * Returns a `Prop` that represents the value at the specified key of the current value.
982
894
  *
983
- * **Note:** With automatic signal disposal, this method is now a no-op when used within
984
- * a disposal scope (e.g., inside a renderable). The signal created by `isLast` is
985
- * automatically tracked and disposed when the scope ends. This method is kept for
986
- * backward compatibility and for cases where ElementPosition is used outside a scope.
895
+ * @param key - The key of the value to access.
896
+ * @returns A `Prop` that represents the value at the specified key.
987
897
  */
988
- dispose = () => {
989
- this.#e?.dispose(), this.#e = void 0;
990
- };
898
+ atProp = (e) => this.iso(
899
+ (s) => s[e],
900
+ (s) => ({ ...this.value, [e]: s })
901
+ );
902
+ /**
903
+ * Access for the current value of the property.
904
+ */
905
+ get value() {
906
+ return this.get();
907
+ }
908
+ set value(e) {
909
+ this._setAndNotify(e);
910
+ }
991
911
  }
992
- const he = () => (
912
+ const te = (t, e, s = (n, r) => n === r) => {
913
+ const n = new N(t, s);
914
+ return e.forEach((r) => r.setDerivative(n)), n;
915
+ }, ve = (t, e, s = {}) => {
916
+ let n = s.once ? () => {
917
+ o(), t();
918
+ } : t;
919
+ if (s.skipInitial) {
920
+ let i = !1;
921
+ const l = n;
922
+ n = () => {
923
+ i ? l() : i = !0;
924
+ };
925
+ }
926
+ const r = te(n, e), o = () => {
927
+ r.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", o);
928
+ };
929
+ return s.abortSignal != null && s.abortSignal.addEventListener("abort", o), o;
930
+ }, T = (t, e = (s, n) => s === n) => {
931
+ const s = new ee(t, e);
932
+ return he()?.track(s), s;
933
+ }, se = (t, e = (s, n) => s === n) => new m(t, e), de = () => (
993
934
  /* c8 ignore next */
994
935
  typeof window < "u" ? window : void 0
995
- );
996
- class be {
936
+ ), et = (t, e, s) => t + (e - t) * s, me = 97, tt = (t, e, s) => {
937
+ const n = Math.max(t.length, e.length);
938
+ let r = "";
939
+ for (let o = 0; o < n; o++) {
940
+ let i = t.charCodeAt(o);
941
+ isNaN(i) && (i = me);
942
+ let l = e.charCodeAt(o);
943
+ isNaN(l) && (l = me), r += String.fromCharCode(i + (l - i) * s);
944
+ }
945
+ return r;
946
+ }, st = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), nt = (t, e) => e, rt = (t) => typeof t == "number" ? et : typeof t == "string" ? tt : t instanceof Date ? st : nt;
947
+ class Se {
997
948
  _store = /* @__PURE__ */ new Map();
998
949
  /**
999
950
  * Retrieves the value associated with the specified key from the memory store.
@@ -1011,7 +962,7 @@ class be {
1011
962
  };
1012
963
  }
1013
964
  let ce = null, ae = null;
1014
- const st = () => (ce || (ce = new be()), ce), nt = () => (ae || (ae = new be()), ae), _e = ({
965
+ const ot = () => (ce || (ce = new Se()), ce), it = () => (ae || (ae = new Se()), ae), _e = ({
1015
966
  key: t,
1016
967
  defaultValue: e,
1017
968
  store: s,
@@ -1022,118 +973,118 @@ const st = () => (ce || (ce = new be()), ce), nt = () => (ae || (ae = new be()),
1022
973
  syncTabs: l = !0,
1023
974
  onKeyChange: c = "load"
1024
975
  }) => {
1025
- let a = y.get(t);
1026
- const u = s.getItem(a), h = new Z(
976
+ let a = w.get(t);
977
+ const u = s.getItem(a), h = new ee(
1027
978
  u != null ? i(r(u)) : typeof e == "function" ? e() : e,
1028
979
  o
1029
- ), p = he(), d = l && typeof p?.BroadcastChannel == "function";
1030
- let m = !1, w = null, D = null;
1031
- const b = (S) => {
1032
- if (!d) return null;
1033
- const M = `tempo:storedProp:${S}`, T = new p.BroadcastChannel(M), k = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, L = (F) => {
1034
- const v = F.data;
1035
- if (!(v == null || typeof v != "object" || v.key !== S || typeof v.value != "string" || v.sourceId != null && v.sourceId === k))
980
+ ), f = de(), p = l && typeof f?.BroadcastChannel == "function";
981
+ let y = !1, b = null, P = null;
982
+ const v = (S) => {
983
+ if (!p) return null;
984
+ const M = `tempo:storedProp:${S}`, E = new f.BroadcastChannel(M), I = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, L = (W) => {
985
+ const A = W.data;
986
+ if (!(A == null || typeof A != "object" || A.key !== S || typeof A.value != "string" || A.sourceId != null && A.sourceId === I))
1036
987
  try {
1037
- m = !0;
1038
- const oe = i(r(v.value));
1039
- h.set(oe);
1040
- } catch (oe) {
988
+ y = !0;
989
+ const ie = i(r(A.value));
990
+ h.set(ie);
991
+ } catch (ie) {
1041
992
  console.warn(
1042
993
  `Failed to sync storedProp for key "${S}" via BroadcastChannel`,
1043
- oe
994
+ ie
1044
995
  );
1045
996
  } finally {
1046
- m = !1;
997
+ y = !1;
1047
998
  }
1048
999
  };
1049
- return T.addEventListener("message", L), h.onDispose(() => {
1050
- T?.removeEventListener("message", L), T?.close();
1051
- }), { channel: T, instanceId: k, handleMessage: L };
1052
- }, x = b(a);
1053
- x && (w = x.channel, D = x.instanceId);
1054
- const re = (S) => {
1000
+ return E.addEventListener("message", L), h.onDispose(() => {
1001
+ E?.removeEventListener("message", L), E?.close();
1002
+ }), { channel: E, instanceId: I, handleMessage: L };
1003
+ }, x = v(a);
1004
+ x && (b = x.channel, P = x.instanceId);
1005
+ const F = (S) => {
1055
1006
  const M = a;
1056
1007
  if (M === S) return;
1057
- const T = h.get(), k = n(T);
1058
- if (s.setItem(M, k), w != null && (w.close(), w = null, D = null), a = S, c === "load") {
1059
- const F = s.getItem(S);
1060
- if (F != null)
1008
+ const E = h.get(), I = n(E);
1009
+ if (s.setItem(M, I), b != null && (b.close(), b = null, P = null), a = S, c === "load") {
1010
+ const W = s.getItem(S);
1011
+ if (W != null)
1061
1012
  try {
1062
- const v = i(r(F));
1063
- h.set(v);
1064
- } catch (v) {
1013
+ const A = i(r(W));
1014
+ h.set(A);
1015
+ } catch (A) {
1065
1016
  console.warn(
1066
1017
  `Failed to load storedProp from new key "${S}"`,
1067
- v
1018
+ A
1068
1019
  );
1069
1020
  }
1070
1021
  else
1071
- s.setItem(S, k);
1072
- } else c === "migrate" && s.setItem(S, k);
1073
- const L = b(S);
1074
- L && (w = L.channel, D = L.instanceId);
1075
- };
1076
- return g.is(t) && h.onDispose(t.on(re)), h.on((S, M) => {
1077
- const T = n(S);
1078
- s.setItem(a, T), w != null && !m && M !== void 0 && D != null && w.postMessage({
1022
+ s.setItem(S, I);
1023
+ } else c === "migrate" && s.setItem(S, I);
1024
+ const L = v(S);
1025
+ L && (b = L.channel, P = L.instanceId);
1026
+ };
1027
+ return m.is(t) && h.onDispose(t.on(F)), h.on((S, M) => {
1028
+ const E = n(S);
1029
+ s.setItem(a, E), b != null && !y && M !== void 0 && P != null && b.postMessage({
1079
1030
  key: a,
1080
- value: T,
1081
- sourceId: D
1031
+ value: E,
1032
+ sourceId: P
1082
1033
  });
1083
1034
  }), h;
1084
- }, ts = (t) => {
1085
- const s = he()?.localStorage, n = s && typeof s.getItem == "function" ? s : st();
1035
+ }, rs = (t) => {
1036
+ const e = de()?.localStorage, s = e && typeof e.getItem == "function" ? e : ot();
1086
1037
  return _e({
1087
1038
  ...t,
1088
- store: n
1039
+ store: s
1089
1040
  });
1090
- }, ss = (t) => {
1091
- const s = he()?.sessionStorage, n = s && typeof s.getItem == "function" ? s : nt();
1041
+ }, os = (t) => {
1042
+ const e = de()?.sessionStorage, s = e && typeof e.getItem == "function" ? e : it();
1092
1043
  return _e({
1093
1044
  ...t,
1094
- store: n
1045
+ store: s
1095
1046
  });
1096
1047
  };
1097
- function me(t) {
1048
+ function ye(t) {
1098
1049
  return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
1099
1050
  }
1100
- const rt = (t, e, s, n) => {
1101
- const r = n?.duration ?? 300, o = n?.easing ?? ((b) => b), i = n?.equals ?? ((b, x) => b === x);
1102
- let l = n?.interpolate, c = t, a = e(), u = performance.now(), h = null, p = !0;
1103
- const d = new N(e, i), m = A(t, i);
1104
- m.onDispose(() => {
1051
+ const lt = (t, e, s, n) => {
1052
+ const r = n?.duration ?? 300, o = n?.easing ?? ((v) => v), i = n?.equals ?? ((v, x) => v === x);
1053
+ let l = n?.interpolate, c = t, a = e(), u = performance.now(), h = null, f = !0;
1054
+ const p = new N(e, i), y = T(t, i);
1055
+ y.onDispose(() => {
1105
1056
  h !== null && cancelAnimationFrame(h);
1106
- }), m.onDispose(d.dispose), s.forEach((b) => {
1107
- b.setDerivative(d), b.onDispose(m.dispose);
1057
+ }), y.onDispose(p.dispose), s.forEach((v) => {
1058
+ v.setDerivative(p), v.onDispose(y.dispose);
1108
1059
  });
1109
- const w = (b) => {
1110
- a = b, u = performance.now(), c = m.value, p && (p = !1, h = me(D));
1111
- }, D = () => {
1112
- const x = (performance.now() - u) / y.get(r), re = o(x);
1113
- l == null && (l = tt(c));
1114
- let S = l(c, a, re);
1115
- x >= 1 ? (p = !0, S = a) : h = me(D), m.set(S);
1116
- };
1117
- return d.on(w), m;
1118
- }, ns = (t, e) => {
1060
+ const b = (v) => {
1061
+ a = v, u = performance.now(), c = y.value, f && (f = !1, h = ye(P));
1062
+ }, P = () => {
1063
+ const v = (performance.now() - u) / w.get(r), x = o(v);
1064
+ l == null && (l = rt(c));
1065
+ let F = l(c, a, x);
1066
+ v >= 1 ? (f = !0, F = a) : h = ye(P), y.set(F);
1067
+ };
1068
+ return p.on(b), y;
1069
+ }, is = (t, e) => {
1119
1070
  const { initialValue: s, ...n } = e ?? {};
1120
- return rt(
1071
+ return lt(
1121
1072
  /* c8 ignore next 2 */
1122
1073
  s ?? t.get(),
1123
1074
  t.get,
1124
1075
  [t],
1125
1076
  n
1126
1077
  );
1127
- }, ot = (t, e) => {
1128
- const s = Object.values(t).filter(g.is), n = Object.keys(t);
1129
- return z(() => {
1078
+ }, ct = (t, e) => {
1079
+ const s = Object.values(t).filter(m.is), n = Object.keys(t);
1080
+ return te(() => {
1130
1081
  const r = {};
1131
1082
  for (const o of n)
1132
- r[o] = y.get(t[o]);
1083
+ r[o] = w.get(t[o]);
1133
1084
  return e(r);
1134
1085
  }, s);
1135
- }, rs = (t) => ot(t, (e) => e), os = (t, e) => {
1136
- const s = A(t.get());
1086
+ }, ls = (t) => ct(t, (e) => e), cs = (t, e) => {
1087
+ const s = T(t.get());
1137
1088
  let n = null;
1138
1089
  const r = t.on(
1139
1090
  (o) => {
@@ -1149,33 +1100,81 @@ const rt = (t, e, s, n) => {
1149
1100
  return s.onDispose(() => {
1150
1101
  r(), n != null && clearTimeout(n);
1151
1102
  }), s;
1152
- }, is = (t) => {
1103
+ }, as = (t) => {
1153
1104
  let e;
1154
1105
  return t.map((s) => {
1155
1106
  const n = e;
1156
1107
  return e = s, n;
1157
1108
  });
1158
- }, ls = ({
1109
+ }, us = ({
1159
1110
  size: t = void 0,
1160
1111
  signal: e
1161
1112
  }) => {
1162
1113
  const s = [];
1163
1114
  return e.map((n) => (s.push(n), t != null && s.length > t && s.shift(), s.slice()));
1164
- }, cs = (t) => (...e) => ee(
1115
+ }, hs = (t) => (...e) => Z(
1165
1116
  t,
1166
1117
  ...e
1167
1118
  )((s, ...n) => s(...n));
1168
- function as(...t) {
1169
- return ee(...t)((...e) => {
1119
+ function ds(...t) {
1120
+ return Z(...t)((...e) => {
1170
1121
  for (const s of e) if (s != null) return s;
1171
1122
  });
1172
1123
  }
1173
- const ve = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Ae = /* @__PURE__ */ new Set(["selected"]), Te = /* @__PURE__ */ new Set([
1124
+ class ue {
1125
+ /**
1126
+ * Creates a new instance of `ElementPosition`.
1127
+ * @param index - The index of the element.
1128
+ * @param total - The total number of elements in the collection.
1129
+ */
1130
+ constructor(e, s) {
1131
+ this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
1132
+ }
1133
+ /**
1134
+ * The counter of the element starting from 1.
1135
+ */
1136
+ counter;
1137
+ /**
1138
+ * Checks if the element is the first element in the collection.
1139
+ * @returns `true` if the element is the first element, `false` otherwise.
1140
+ */
1141
+ isFirst;
1142
+ /**
1143
+ * Checks if the counter of the element is even.
1144
+ * @returns `true` if the counter is even, `false` otherwise.
1145
+ */
1146
+ isEven;
1147
+ /**
1148
+ * Checks if the counter of the element is odd.
1149
+ * @returns `true` if the counter is odd, `false` otherwise.
1150
+ */
1151
+ isOdd;
1152
+ #e;
1153
+ /**
1154
+ * Checks if the element is the last element in the collection.
1155
+ * @returns `true` if the element is the last element, `false` otherwise.
1156
+ */
1157
+ get isLast() {
1158
+ return this.#e == null && (this.#e = this.total.map((e) => this.counter === e)), this.#e;
1159
+ }
1160
+ /**
1161
+ * Disposes the internal signal created by `isLast`.
1162
+ *
1163
+ * **Note:** With automatic signal disposal, this method is now a no-op when used within
1164
+ * a disposal scope (e.g., inside a renderable). The signal created by `isLast` is
1165
+ * automatically tracked and disposed when the scope ends. This method is kept for
1166
+ * backward compatibility and for cases where ElementPosition is used outside a scope.
1167
+ */
1168
+ dispose = () => {
1169
+ this.#e?.dispose(), this.#e = void 0;
1170
+ };
1171
+ }
1172
+ const Ae = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Te = /* @__PURE__ */ new Set(["selected"]), Ee = /* @__PURE__ */ new Set([
1174
1173
  "rowSpan",
1175
1174
  "colSpan",
1176
1175
  "tabIndex",
1177
1176
  "valueAsNumber"
1178
- ]), Ee = /* @__PURE__ */ new Set(["valueAsDate"]), Ce = /* @__PURE__ */ new Set([
1177
+ ]), Ce = /* @__PURE__ */ new Set(["valueAsDate"]), De = /* @__PURE__ */ new Set([
1179
1178
  "value",
1180
1179
  "textContent",
1181
1180
  "innerText",
@@ -1183,28 +1182,28 @@ const ve = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Ae = /* @
1183
1182
  "outerHTML",
1184
1183
  "className",
1185
1184
  "classList"
1186
- ]), it = (t, e) => Ae.has(t) ? (s) => {
1185
+ ]), at = (t, e) => Te.has(t) ? (s) => {
1187
1186
  s == null || s !== !0 ? e.removeAttribute(t) : e.setAttribute(t, "");
1188
- } : ve.has(t) ? (s) => {
1187
+ } : Ae.has(t) ? (s) => {
1189
1188
  s == null ? e[t] = null : e[t] = !!s;
1190
- } : Te.has(t) ? (s) => {
1191
- s == null ? e[t] = null : e[t] = Number(s);
1192
1189
  } : Ee.has(t) ? (s) => {
1193
- s == null ? e[t] = null : e[t] = s;
1190
+ s == null ? e[t] = null : e[t] = Number(s);
1194
1191
  } : Ce.has(t) ? (s) => {
1192
+ s == null ? e[t] = null : e[t] = s;
1193
+ } : De.has(t) ? (s) => {
1195
1194
  s == null ? e[t] = null : e[t] = String(s);
1196
1195
  } : (s) => {
1197
1196
  s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
1198
- }, lt = (t, e) => Ae.has(t) ? () => e.hasAttribute(t) : ve.has(t) ? () => !!e[t] : Te.has(t) ? () => Number(e[t]) : Ee.has(t) ? () => e[t] : Ce.has(t) ? () => String(e[t]) : () => e.getAttribute(t), U = (t) => {
1197
+ }, ut = (t, e) => Te.has(t) ? () => e.hasAttribute(t) : Ae.has(t) ? () => !!e[t] : Ee.has(t) ? () => Number(e[t]) : Ce.has(t) ? () => e[t] : De.has(t) ? () => String(e[t]) : () => e.getAttribute(t), J = (t) => {
1199
1198
  const e = t;
1200
1199
  e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
1201
- }, ct = (t) => De(t) ? t : t.parentElement, De = (t) => t.nodeType === 1;
1200
+ }, ht = (t) => Pe(t) ? t : t.parentElement, Pe = (t) => t.nodeType === 1;
1202
1201
  class xe extends Error {
1203
1202
  constructor(e) {
1204
1203
  super(`Provider not found: ${e.description}`);
1205
1204
  }
1206
1205
  }
1207
- class $ {
1206
+ class R {
1208
1207
  /**
1209
1208
  * Constructs a new `DOMContext` instance.
1210
1209
  *
@@ -1226,7 +1225,7 @@ class $ {
1226
1225
  * @returns A new `DOMContext` instance.
1227
1226
  */
1228
1227
  static of(e, s, n) {
1229
- return new $(e.ownerDocument, e, s, n);
1228
+ return new R(e.ownerDocument, e, s, n);
1230
1229
  }
1231
1230
  /**
1232
1231
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
@@ -1311,7 +1310,7 @@ class $ {
1311
1310
  * @param element - The DOM element to use in the new `DOMContext` instance.
1312
1311
  * @returns A new `DOMContext` instance with the provided `element`.
1313
1312
  */
1314
- withElement = (e) => new $(this.document, e, void 0, this.providers);
1313
+ withElement = (e) => new R(this.document, e, void 0, this.providers);
1315
1314
  /**
1316
1315
  * Creates a portal to render content in a different part of the DOM tree.
1317
1316
  *
@@ -1368,7 +1367,7 @@ class $ {
1368
1367
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
1369
1368
  * @returns A new `DOMContext` instance with the specified reference.
1370
1369
  */
1371
- withReference = (e) => new $(this.document, this.element, e, this.providers);
1370
+ withReference = (e) => new R(this.document, this.element, e, this.providers);
1372
1371
  /**
1373
1372
  * Sets a provider for the given provider mark.
1374
1373
  *
@@ -1376,7 +1375,7 @@ class $ {
1376
1375
  * @param value - The provider to set for the given mark.
1377
1376
  * @returns A new `DOMContext` instance with the specified provider.
1378
1377
  */
1379
- setProvider = (e, s, n) => new $(this.document, this.element, this.reference, {
1378
+ setProvider = (e, s, n) => new R(this.document, this.element, this.reference, {
1380
1379
  ...this.providers,
1381
1380
  [e]: [s, n]
1382
1381
  });
@@ -1394,7 +1393,7 @@ class $ {
1394
1393
  return { value: s, onUse: n };
1395
1394
  };
1396
1395
  clear = (e) => {
1397
- e && (this.reference !== void 0 ? U(this.reference) : U(this.element));
1396
+ e && (this.reference !== void 0 ? J(this.reference) : J(this.element));
1398
1397
  };
1399
1398
  /**
1400
1399
  * Adds classes to the element.
@@ -1464,28 +1463,28 @@ class $ {
1464
1463
  */
1465
1464
  getStyle = (e) => this.element.style[e];
1466
1465
  makeAccessors = (e) => ({
1467
- get: lt(e, this.element),
1468
- set: it(e, this.element)
1466
+ get: ut(e, this.element),
1467
+ set: at(e, this.element)
1469
1468
  });
1470
1469
  getWindow = () => this.document.defaultView;
1471
1470
  }
1472
- const at = (t) => Symbol(t), fe = (t, e) => {
1473
- const s = new j(), n = P(s, () => t(e));
1471
+ const pe = (t, e) => {
1472
+ const s = new q(), n = O(s, () => t.render(e));
1474
1473
  return (r = !0) => {
1475
1474
  s.dispose(), n(r);
1476
1475
  };
1477
- }, us = (t, e, { doc: s, clear: n, disposeWithParent: r = !0, providers: o = {} } = {}) => {
1476
+ }, ps = (t, e, { doc: s, clear: n, disposeWithParent: r = !0, providers: o = {} } = {}) => {
1478
1477
  const i = typeof e == "string" ? (s ?? document).querySelector(e) : e;
1479
1478
  if (i === null)
1480
- throw new ut(
1479
+ throw new dt(
1481
1480
  `Cannot find element by selector for render: ${e}`
1482
1481
  );
1483
1482
  n !== !1 && (s ?? i.ownerDocument) != null && i.nodeType === 1 && (i.innerHTML = "");
1484
- const l = ct(i), c = De(i) ? void 0 : i, a = $.of(l, c, o), u = fe(t, a);
1483
+ const l = ht(i), c = Pe(i) ? void 0 : i, a = R.of(l, c, o), u = pe(t, a);
1485
1484
  let h;
1486
- return r && (h = new MutationObserver((p) => {
1487
- p[0]?.removedNodes.forEach((d) => {
1488
- d === i && (h?.disconnect(), u(i.nodeType !== 1));
1485
+ return r && (h = new MutationObserver((f) => {
1486
+ f[0]?.removedNodes.forEach((p) => {
1487
+ p === i && (h?.disconnect(), u(i.nodeType !== 1));
1489
1488
  });
1490
1489
  }), h.observe(i.parentElement, {
1491
1490
  childList: !0,
@@ -1494,27 +1493,27 @@ const at = (t) => Symbol(t), fe = (t, e) => {
1494
1493
  })), () => {
1495
1494
  h?.disconnect(), u(!0);
1496
1495
  };
1497
- }, hs = (t, {
1496
+ }, fs = (t, {
1498
1497
  startUrl: e = "https://example.com",
1499
1498
  selector: s,
1500
1499
  providers: n = {}
1501
1500
  } = {
1502
1501
  selector: "body"
1503
1502
  }) => {
1504
- const r = y.toSignal(e).deriveProp(), o = new ke(s, void 0), i = new R(o, void 0, { currentURL: r }, n);
1503
+ const r = w.toSignal(e).deriveProp(), o = new Ie(s, void 0), i = new j(o, void 0, { currentURL: r }, n);
1505
1504
  return {
1506
- clear: fe(t(), i),
1505
+ clear: pe(t(), i),
1507
1506
  root: o,
1508
1507
  currentURL: r
1509
1508
  };
1510
1509
  };
1511
- class ut extends Error {
1510
+ class dt extends Error {
1512
1511
  constructor(e) {
1513
1512
  super(e);
1514
1513
  }
1515
1514
  }
1516
- const Le = "data-tts-node", G = "data-tts-class", J = "data-tts-style", X = "data-tts-html", Y = "data-tts-text", Q = "data-tts-attrs";
1517
- class fs {
1515
+ const Le = "data-tts-node", K = "data-tts-class", z = "data-tts-style", Y = "data-tts-html", X = "data-tts-text", Q = "data-tts-attrs";
1516
+ class gs {
1518
1517
  /**
1519
1518
  * Selects elements from the headless environment.
1520
1519
  * @param selector - The selector to select elements from. The supported selectors are CSS selectors whose complexity depends on the adapter implementation.
@@ -1600,9 +1599,9 @@ class fs {
1600
1599
  getInnerHTML: a,
1601
1600
  setInnerHTML: u,
1602
1601
  getInnerText: h,
1603
- setInnerText: p
1602
+ setInnerText: f
1604
1603
  }) {
1605
- this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = u, this.getInnerText = h, this.setInnerText = p;
1604
+ this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = u, this.getInnerText = h, this.setInnerText = f;
1606
1605
  }
1607
1606
  /**
1608
1607
  * Sets the content of the root element from a HeadlessPortal. Generally this will be the same instance that is
@@ -1623,21 +1622,21 @@ class fs {
1623
1622
  if (r.hasChildren() && this.appendHTML(i, r.contentToHTML(s)), r.hasInnerHTML()) {
1624
1623
  if (s) {
1625
1624
  const l = this.getInnerHTML(i);
1626
- l != null && this.setAttribute(i, X, l);
1625
+ l != null && this.setAttribute(i, Y, l);
1627
1626
  }
1628
1627
  this.setInnerHTML(i, r.getInnerHTML());
1629
1628
  }
1630
1629
  if (r.hasInnerText()) {
1631
1630
  if (s) {
1632
1631
  const l = this.getInnerText(i);
1633
- l != null && this.setAttribute(i, Y, l);
1632
+ l != null && this.setAttribute(i, X, l);
1634
1633
  }
1635
1634
  this.setInnerText(i, r.getInnerText());
1636
1635
  }
1637
1636
  if (r.hasClasses()) {
1638
1637
  if (s) {
1639
1638
  const l = this.getClass(i);
1640
- l != null && this.setAttribute(i, G, l);
1639
+ l != null && this.setAttribute(i, K, l);
1641
1640
  }
1642
1641
  this.setClass(i, r.getClasses().join(" "));
1643
1642
  }
@@ -1646,7 +1645,7 @@ class fs {
1646
1645
  const l = this.getStyles(i);
1647
1646
  Object.keys(l).length > 0 && this.setAttribute(
1648
1647
  i,
1649
- J,
1648
+ z,
1650
1649
  JSON.stringify(l)
1651
1650
  );
1652
1651
  }
@@ -1673,56 +1672,56 @@ class fs {
1673
1672
  });
1674
1673
  };
1675
1674
  }
1676
- const ht = () => {
1677
- document.querySelectorAll(`[${Le}]`).forEach(U);
1675
+ const pt = () => {
1676
+ document.querySelectorAll(`[${Le}]`).forEach(J);
1678
1677
  }, ft = (t) => {
1679
- const e = t.getAttribute(G);
1680
- t.removeAttribute(G), e != null && t.setAttribute("class", e);
1681
- }, dt = () => {
1682
- document.querySelectorAll(`[${G}]`).forEach((e) => ft(e));
1683
- }, pt = (t) => {
1684
- const e = t.getAttribute(X);
1685
- t.removeAttribute(X), e != null && (t.innerHTML = e);
1678
+ const e = t.getAttribute(K);
1679
+ t.removeAttribute(K), e != null && t.setAttribute("class", e);
1686
1680
  }, gt = () => {
1687
- document.querySelectorAll(`[${X}]`).forEach((e) => pt(e));
1681
+ document.querySelectorAll(`[${K}]`).forEach((e) => ft(e));
1688
1682
  }, mt = (t) => {
1689
1683
  const e = t.getAttribute(Y);
1690
- t.removeAttribute(Y), e != null && (t.innerText = e);
1684
+ t.removeAttribute(Y), e != null && (t.innerHTML = e);
1691
1685
  }, yt = () => {
1692
1686
  document.querySelectorAll(`[${Y}]`).forEach((e) => mt(e));
1693
- }, Pe = (t) => JSON.parse(t.replace(/&quot;/g, '"')), St = (t) => {
1694
- const e = t.getAttribute(J);
1695
- if (t.removeAttribute(J), e != null) {
1696
- const s = Pe(e);
1687
+ }, wt = (t) => {
1688
+ const e = t.getAttribute(X);
1689
+ t.removeAttribute(X), e != null && (t.innerText = e);
1690
+ }, bt = () => {
1691
+ document.querySelectorAll(`[${X}]`).forEach((e) => wt(e));
1692
+ }, Oe = (t) => JSON.parse(t.replace(/&quot;/g, '"')), vt = (t) => {
1693
+ const e = t.getAttribute(z);
1694
+ if (t.removeAttribute(z), e != null) {
1695
+ const s = Oe(e);
1697
1696
  Object.entries(s).forEach(([n, r]) => {
1698
1697
  t.style.setProperty(n, r);
1699
1698
  });
1700
1699
  }
1701
- }, wt = () => {
1702
- document.querySelectorAll(`[${J}]`).forEach((e) => St(e));
1703
- }, bt = (t) => {
1700
+ }, St = () => {
1701
+ document.querySelectorAll(`[${z}]`).forEach((e) => vt(e));
1702
+ }, _t = (t) => {
1704
1703
  const e = t.getAttribute(Q);
1705
1704
  if (t.removeAttribute(Q), e != null) {
1706
- const s = Pe(e);
1705
+ const s = Oe(e);
1707
1706
  Object.entries(s).forEach(([n, r]) => {
1708
1707
  r == null ? t.removeAttribute(n) : t.setAttribute(n, r);
1709
1708
  });
1710
1709
  }
1711
- }, _t = () => {
1712
- document.querySelectorAll(`[${Q}]`).forEach((e) => bt(e));
1713
- }, ds = () => {
1714
- ht(), dt(), yt(), gt(), wt(), _t();
1715
- }, I = Symbol("class"), H = Symbol("style"), B = Symbol("handler"), Oe = () => Math.random().toString(36).substring(2, 15), vt = (t) => t.replace(/<[^>]*>?/g, "");
1710
+ }, At = () => {
1711
+ document.querySelectorAll(`[${Q}]`).forEach((e) => _t(e));
1712
+ }, ms = () => {
1713
+ pt(), gt(), bt(), yt(), St(), At();
1714
+ }, H = Symbol("class"), $ = Symbol("style"), U = Symbol("handler"), ke = () => Math.random().toString(36).substring(2, 15), Tt = (t) => t.replace(/<[^>]*>?/g, "");
1716
1715
  class Me {
1717
1716
  constructor(e) {
1718
1717
  this.parent = e;
1719
1718
  }
1720
- id = Oe();
1719
+ id = ke();
1721
1720
  properties = {};
1722
1721
  children = [];
1723
1722
  isElement = () => !0;
1724
1723
  isText = () => !1;
1725
- getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? vt(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
1724
+ getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? Tt(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
1726
1725
  removeChild = (e) => {
1727
1726
  const s = this.children.indexOf(e);
1728
1727
  s !== -1 && this.children.splice(s, 1);
@@ -1743,10 +1742,10 @@ class Me {
1743
1742
  getInnerText = () => this.properties.innerText ?? "";
1744
1743
  hasInnerText = () => this.properties.innerText != null;
1745
1744
  hasChildren = () => this.children.length > 0;
1746
- hasClasses = () => this.properties[I] != null;
1747
- hasStyles = () => this.properties[H] != null;
1745
+ hasClasses = () => this.properties[H] != null;
1746
+ hasStyles = () => this.properties[$] != null;
1748
1747
  hasAttributes = () => Object.keys(this.properties).length > 0;
1749
- hasHandlers = () => this.properties[B] != null;
1748
+ hasHandlers = () => this.properties[U] != null;
1750
1749
  hasRenderableProperties = () => this.hasClasses() || this.hasAttributes() || this.hasStyles();
1751
1750
  getById = (e) => {
1752
1751
  if (this.properties.id === e)
@@ -1758,26 +1757,26 @@ class Me {
1758
1757
  }
1759
1758
  };
1760
1759
  trigger = (e, s) => {
1761
- ((this.properties[B] ?? {})[e] ?? []).forEach((r) => r(s));
1760
+ ((this.properties[U] ?? {})[e] ?? []).forEach((r) => r(s));
1762
1761
  };
1763
1762
  click = () => {
1764
1763
  this.trigger("click", {});
1765
1764
  };
1766
1765
  on = (e, s, n, r) => {
1767
- const o = this.properties[B] ??= {}, i = r?.once ? (c) => {
1766
+ const o = this.properties[U] ??= {}, i = r?.once ? (c) => {
1768
1767
  l(), s(c, n);
1769
1768
  } : (c) => s(c, n);
1770
1769
  o[e] = [...o[e] ?? [], i];
1771
1770
  const l = () => {
1772
1771
  const c = o[e] ?? [], a = c.indexOf(i);
1773
- a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[B]) : o[e] = c, r?.signal != null && r.signal.removeEventListener("abort", l));
1772
+ a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[U]) : o[e] = c, r?.signal != null && r.signal.removeEventListener("abort", l));
1774
1773
  };
1775
1774
  return r?.signal != null && r.signal.addEventListener("abort", l), l;
1776
1775
  };
1777
1776
  addClasses = (e) => {
1778
1777
  if (e.length === 0)
1779
1778
  return;
1780
- const s = this.properties[I] ??= [];
1779
+ const s = this.properties[H] ??= [];
1781
1780
  e.forEach((n) => {
1782
1781
  s.includes(n) || s.push(n);
1783
1782
  });
@@ -1785,25 +1784,25 @@ class Me {
1785
1784
  removeClasses = (e) => {
1786
1785
  if (e.length === 0)
1787
1786
  return;
1788
- const s = this.properties[I] ??= [];
1787
+ const s = this.properties[H] ??= [];
1789
1788
  e.forEach((n) => {
1790
1789
  const r = s.indexOf(n);
1791
1790
  r !== -1 && s.splice(r, 1);
1792
- }), s.length === 0 && delete this.properties[I];
1791
+ }), s.length === 0 && delete this.properties[H];
1793
1792
  };
1794
- getClasses = () => this.properties[I] ?? [];
1793
+ getClasses = () => this.properties[H] ?? [];
1795
1794
  getAttributes = () => Object.entries(this.properties).filter(
1796
1795
  ([e]) => !["innerText", "innerHTML"].includes(e)
1797
1796
  );
1798
1797
  getVisibleAttributes = () => Reflect.ownKeys(this.properties).flatMap(
1799
- (e) => e === I ? [["class", this.getClasses()]] : e === H ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1798
+ (e) => e === H ? [["class", this.getClasses()]] : e === $ ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1800
1799
  );
1801
1800
  setStyle = (e, s) => {
1802
- const n = this.properties[H] ??= {};
1803
- n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[H]);
1801
+ const n = this.properties[$] ??= {};
1802
+ n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[$]);
1804
1803
  };
1805
- getStyle = (e) => this.properties[H]?.[e] ?? "";
1806
- getStyles = () => this.properties[H] ?? {};
1804
+ getStyle = (e) => this.properties[$]?.[e] ?? "";
1805
+ getStyles = () => this.properties[$] ?? {};
1807
1806
  makeAccessors = (e) => {
1808
1807
  const s = this.properties;
1809
1808
  return {
@@ -1812,8 +1811,8 @@ class Me {
1812
1811
  };
1813
1812
  };
1814
1813
  }
1815
- const At = (t) => t.replace(/"/g, "&quot;"), Tt = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1816
- class Et extends Me {
1814
+ const Et = (t) => t.replace(/"/g, "&quot;"), Ct = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1815
+ class Dt extends Me {
1817
1816
  constructor(e, s, n) {
1818
1817
  super(n), this.tagName = e, this.namespace = s;
1819
1818
  }
@@ -1821,11 +1820,11 @@ class Et extends Me {
1821
1820
  toHTML = (e = !1) => {
1822
1821
  const s = this.children.map((l) => l.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
1823
1822
  let r = null;
1824
- const o = 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 = Tt(c), "") : ` ${l}="${At(c)}"`).join(""), i = e ? ` ${Le}` : "";
1825
- return xt.has(this.tagName) && s === "" ? `<${this.tagName}${n}${o}${i} />` : `<${this.tagName}${n}${o}${i}>${r ?? s}</${this.tagName}>`;
1823
+ const o = 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(" ")}"` : xt.has(l) ? ` ${l}` : l === "innerHTML" ? (r = c, "") : l === "innerText" ? (r = Ct(c), "") : ` ${l}="${Et(c)}"`).join(""), i = e ? ` ${Le}` : "";
1824
+ return Lt.has(this.tagName) && s === "" ? `<${this.tagName}${n}${o}${i} />` : `<${this.tagName}${n}${o}${i}>${r ?? s}</${this.tagName}>`;
1826
1825
  };
1827
1826
  }
1828
- class ke extends Me {
1827
+ class Ie extends Me {
1829
1828
  constructor(e, s) {
1830
1829
  super(s), this.selector = e;
1831
1830
  }
@@ -1833,30 +1832,30 @@ class ke extends Me {
1833
1832
  toHTML = () => "";
1834
1833
  contentToHTML = (e = !1) => this.children.map((s) => s.toHTML(e)).join("");
1835
1834
  }
1836
- class Ct {
1835
+ class Pt {
1837
1836
  constructor(e) {
1838
1837
  this.text = e;
1839
1838
  }
1840
- id = Oe();
1839
+ id = ke();
1841
1840
  isElement = () => !1;
1842
1841
  isText = () => !0;
1843
1842
  getText = () => this.text;
1844
1843
  toHTML = () => this.text;
1845
1844
  }
1846
- class R {
1845
+ class j {
1847
1846
  constructor(e, s, n, r) {
1848
1847
  this.element = e, this.reference = s, this.container = n, this.providers = r;
1849
1848
  }
1850
1849
  appendOrInsert = (e) => {
1851
1850
  if (this.reference != null) {
1852
1851
  const s = this.element.children.indexOf(this.reference);
1853
- this.element.children.splice(s, 0, e);
1852
+ s >= 0 && this.element.children.splice(s, 0, e);
1854
1853
  } else
1855
1854
  this.element.children.push(e);
1856
1855
  };
1857
1856
  makeChildElement = (e, s) => {
1858
- const n = new Et(e, s, this.element);
1859
- return this.appendOrInsert(n), new R(
1857
+ const n = new Dt(e, s, this.element);
1858
+ return this.appendOrInsert(n), new j(
1860
1859
  n,
1861
1860
  void 0,
1862
1861
  this.container,
@@ -1864,8 +1863,8 @@ class R {
1864
1863
  );
1865
1864
  };
1866
1865
  makeChildText = (e) => {
1867
- const s = new Ct(e);
1868
- return this.appendOrInsert(s), new R(
1866
+ const s = new Pt(e);
1867
+ return this.appendOrInsert(s), new j(
1869
1868
  this.element,
1870
1869
  s,
1871
1870
  this.container,
@@ -1878,8 +1877,8 @@ class R {
1878
1877
  getText = () => this.reference?.getText() ?? this.element.getText();
1879
1878
  makeRef = () => this.makeChildText("");
1880
1879
  makePortal = (e) => {
1881
- const s = new ke(e, this.element);
1882
- return this.appendOrInsert(s), new R(
1880
+ const s = new Ie(e, this.element);
1881
+ return this.appendOrInsert(s), new j(
1883
1882
  s,
1884
1883
  void 0,
1885
1884
  this.container,
@@ -1893,7 +1892,7 @@ class R {
1893
1892
  * @param value - The provider to set for the given mark.
1894
1893
  * @returns A new `DOMContext` instance with the specified provider.
1895
1894
  */
1896
- setProvider = (e, s, n) => new R(this.element, this.reference, this.container, {
1895
+ setProvider = (e, s, n) => new j(this.element, this.reference, this.container, {
1897
1896
  ...this.providers,
1898
1897
  [e]: [s, n]
1899
1898
  });
@@ -1918,27 +1917,30 @@ class R {
1918
1917
  getStyle = (e) => this.element.getStyle(e);
1919
1918
  makeAccessors = (e) => this.element.makeAccessors(e);
1920
1919
  }
1921
- const Dt = /* @__PURE__ */ new Set([
1920
+ const xt = /* @__PURE__ */ new Set([
1922
1921
  "checked",
1923
1922
  "disabled",
1924
1923
  "multiple",
1925
1924
  "readonly",
1926
1925
  "required",
1927
1926
  "selected"
1928
- ]), xt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), Ie = (t) => (e) => e.makeChildText(t).clear, He = (t) => (e) => {
1927
+ ]), Lt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), ys = () => (
1928
+ /* c8 ignore next */
1929
+ typeof window < "u" ? window : void 0
1930
+ ), Ot = Symbol("DOM_RENDERABLE"), g = (t) => Ge(Ot, t), He = (t) => g((e) => e.makeChildText(t).clear), $e = (t) => g((e) => {
1929
1931
  const s = e.makeChildText(t.value), n = t.on(s.setText);
1930
1932
  return (r) => {
1931
1933
  n(), s.clear(r);
1932
1934
  };
1933
- }, ps = (t) => g.is(t) ? He(t) : Ie(t), E = (...t) => (e) => {
1934
- const s = t.map((n) => f(n)(e));
1935
+ }), ws = (t) => m.is(t) ? $e(t) : He(t), C = (...t) => g((e) => {
1936
+ const s = t.map((n) => d(n).render(e));
1935
1937
  return (n) => {
1936
1938
  s.forEach((r) => r(n));
1937
1939
  };
1938
- }, C = () => () => {
1939
- }, Lt = (t) => (e) => (e.addClasses(t), (s) => {
1940
+ }), D = g(() => () => {
1941
+ }), kt = (t) => g((e) => (e.addClasses(t), (s) => {
1940
1942
  s && e.removeClasses(t);
1941
- }), Pt = (t) => (e) => {
1943
+ })), Mt = (t) => g((e) => {
1942
1944
  let s = [];
1943
1945
  const n = t.on(
1944
1946
  (r) => {
@@ -1949,20 +1951,20 @@ const Dt = /* @__PURE__ */ new Set([
1949
1951
  return (r) => {
1950
1952
  n(), r && e.removeClasses(s), s.length = 0;
1951
1953
  };
1952
- }, Ot = (t, e) => (s) => {
1954
+ }), It = (t, e) => g((s) => {
1953
1955
  const { get: n, set: r } = s.makeAccessors(t), o = n();
1954
1956
  return r(e), (i) => {
1955
1957
  i && r(o);
1956
1958
  };
1957
- }, Mt = (t, e) => (s) => {
1959
+ }), Ht = (t, e) => g((s) => {
1958
1960
  const { get: n, set: r } = s.makeAccessors(t), o = n(), i = e.on(r, { noAutoDispose: !0 });
1959
1961
  return (l) => {
1960
1962
  i(), l && r(o);
1961
1963
  };
1962
- }, q = (t, e) => g.is(e) ? Mt(t, e) : Ot(t, e), kt = (t, e) => t === "class" ? g.is(e) ? Pt(e) : Lt(
1964
+ }), B = (t, e) => m.is(e) ? Ht(t, e) : It(t, e), $t = (t, e) => t === "class" ? m.is(e) ? Mt(e) : kt(
1963
1965
  /* c8 ignore next */
1964
1966
  (e ?? "").split(" ").filter((s) => s.length > 0)
1965
- ) : q(t, e), V = new Proxy(
1967
+ ) : B(t, e), V = new Proxy(
1966
1968
  {},
1967
1969
  {
1968
1970
  /**
@@ -1976,9 +1978,9 @@ const Dt = /* @__PURE__ */ new Set([
1976
1978
  * @returns The renderable component for the specified attribute.
1977
1979
  *
1978
1980
  */
1979
- get: (t, e) => (s) => kt(e, s)
1981
+ get: (t, e) => (s) => $t(e, s)
1980
1982
  }
1981
- ), It = (t, e) => q(`data-${t}`, e), gs = new Proxy(
1983
+ ), Nt = (t, e) => B(`data-${t}`, e), bs = new Proxy(
1982
1984
  {},
1983
1985
  {
1984
1986
  /**
@@ -1989,9 +1991,9 @@ const Dt = /* @__PURE__ */ new Set([
1989
1991
  * @returns The renderable component for the specified attribute.
1990
1992
  *
1991
1993
  */
1992
- get: (t, e) => (s) => It(e, s)
1994
+ get: (t, e) => (s) => Nt(e, s)
1993
1995
  }
1994
- ), Ht = (t, e) => q(`aria-${t}`, e), ms = new Proxy(
1996
+ ), Rt = (t, e) => B(`aria-${t}`, e), vs = new Proxy(
1995
1997
  {},
1996
1998
  {
1997
1999
  /**
@@ -2002,9 +2004,9 @@ const Dt = /* @__PURE__ */ new Set([
2002
2004
  * @returns The renderable component for the specified attribute.
2003
2005
  *
2004
2006
  */
2005
- get: (t, e) => (s) => Ht(e, s)
2007
+ get: (t, e) => (s) => Rt(e, s)
2006
2008
  }
2007
- ), Nt = (t, e) => q(t, e), ys = new Proxy(
2009
+ ), jt = (t, e) => B(t, e), Ss = new Proxy(
2008
2010
  {},
2009
2011
  {
2010
2012
  /**
@@ -2015,9 +2017,9 @@ const Dt = /* @__PURE__ */ new Set([
2015
2017
  * @returns The renderable component for the specified attribute.
2016
2018
  *
2017
2019
  */
2018
- get: (t, e) => (s) => Nt(e, s)
2020
+ get: (t, e) => (s) => jt(e, s)
2019
2021
  }
2020
- ), $t = (t, e) => q(t, e), Ss = new Proxy(
2022
+ ), Vt = (t, e) => B(t, e), _s = new Proxy(
2021
2023
  {},
2022
2024
  {
2023
2025
  /**
@@ -2027,31 +2029,31 @@ const Dt = /* @__PURE__ */ new Set([
2027
2029
  * @returns The renderable component for the specified attribute.
2028
2030
  *
2029
2031
  */
2030
- get: (t, e) => (s) => $t(e, s)
2032
+ get: (t, e) => (s) => Vt(e, s)
2031
2033
  }
2032
- ), f = (t) => {
2034
+ ), d = (t) => {
2033
2035
  if (t == null)
2034
- return C;
2036
+ return D;
2035
2037
  if (Array.isArray(t))
2036
- return E(...t.map(f));
2038
+ return C(...t.map(d));
2037
2039
  if (typeof t == "string")
2038
- return Ie(t);
2039
- if (g.is(t))
2040
2040
  return He(t);
2041
- if (typeof t == "function")
2041
+ if (m.is(t))
2042
+ return $e(t);
2043
+ if (typeof t == "object" && "render" in t && "type" in t)
2042
2044
  return t;
2043
2045
  throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
2044
- }, Ne = (t, ...e) => (s) => {
2045
- const n = s.makeChildElement(t, void 0), r = e.map((o) => f(o)(n));
2046
+ }, Ne = (t, ...e) => g((s) => {
2047
+ const n = s.makeChildElement(t, void 0), r = e.map((o) => d(o).render(n));
2046
2048
  return (o) => {
2047
2049
  r.forEach((i) => i(!1)), n.clear(o);
2048
2050
  };
2049
- }, te = (t, e, ...s) => (n) => {
2050
- const r = n.makeChildElement(t, e), o = s.map((i) => f(i)(r));
2051
+ }), ne = (t, e, ...s) => g((n) => {
2052
+ const r = n.makeChildElement(t, e), o = s.map((i) => d(i).render(r));
2051
2053
  return (i) => {
2052
2054
  o.forEach((l) => l(!1)), r.clear(i);
2053
2055
  };
2054
- }, ws = new Proxy(
2056
+ }), As = new Proxy(
2055
2057
  {},
2056
2058
  {
2057
2059
  /**
@@ -2059,9 +2061,9 @@ const Dt = /* @__PURE__ */ new Set([
2059
2061
  * @param tagName - The HTML tag name.
2060
2062
  * @returns A renderable function that creates and appends the HTML element to the DOM.
2061
2063
  */
2062
- get: (t, e) => (...s) => Ne(e, s.flatMap(f))
2064
+ get: (t, e) => (...s) => Ne(e, s.flatMap(d))
2063
2065
  }
2064
- ), bs = new Proxy(
2066
+ ), Ts = new Proxy(
2065
2067
  {},
2066
2068
  {
2067
2069
  /**
@@ -2071,7 +2073,7 @@ const Dt = /* @__PURE__ */ new Set([
2071
2073
  */
2072
2074
  get: (t, e) => (...s) => Ne("input", V.type(e), ...s)
2073
2075
  }
2074
- ), $e = "http://www.w3.org/2000/svg", _s = (t, ...e) => te(t, $e, ...e), vs = new Proxy(
2076
+ ), Re = "http://www.w3.org/2000/svg", Es = (t, ...e) => ne(t, Re, ...e), Cs = new Proxy(
2075
2077
  {},
2076
2078
  {
2077
2079
  /**
@@ -2079,9 +2081,9 @@ const Dt = /* @__PURE__ */ new Set([
2079
2081
  * @param tagName - The SVG tag name.
2080
2082
  * @returns A renderable function that creates and appends the SVG element to the DOM.
2081
2083
  */
2082
- get: (t, e) => (...s) => te(e, $e, s.flatMap(f))
2084
+ get: (t, e) => (...s) => ne(e, Re, s.flatMap(d))
2083
2085
  }
2084
- ), Re = "http://www.w3.org/1998/Math/MathML", As = (t, ...e) => te(t, Re, ...e), Ts = new Proxy(
2086
+ ), je = "http://www.w3.org/1998/Math/MathML", Ds = (t, ...e) => ne(t, je, ...e), Ps = new Proxy(
2085
2087
  {},
2086
2088
  {
2087
2089
  /**
@@ -2089,35 +2091,35 @@ const Dt = /* @__PURE__ */ new Set([
2089
2091
  * @param tagName - The Math tag name.
2090
2092
  * @returns A renderable function that creates and appends the Math element to the DOM.
2091
2093
  */
2092
- get: (t, e) => (...s) => te(e, Re, s.flatMap(f))
2094
+ get: (t, e) => (...s) => ne(e, je, s.flatMap(d))
2093
2095
  }
2094
2096
  ), Ve = (t, e) => {
2095
2097
  if (typeof e == "function")
2096
2098
  return Ve(t, { then: e });
2097
- const s = e.pending != null ? f(e.pending()) : C, n = e.then, r = e.error != null ? (o) => f(e.error(o)) : () => C;
2098
- return (o) => {
2099
+ const s = e.pending != null ? d(e.pending()) : D, n = e.then, r = e.error != null ? (o) => d(e.error(o)) : () => D;
2100
+ return g((o) => {
2099
2101
  let i = !0;
2100
2102
  const l = t(), c = o.makeRef();
2101
- let a = f(s)(c);
2103
+ let a = d(s).render(c);
2102
2104
  return l.then(
2103
2105
  (u) => {
2104
- i && (a(!0), a = f(n(u))(c));
2106
+ i && (a(!0), a = d(n(u)).render(c));
2105
2107
  },
2106
2108
  (u) => {
2107
- i && (a(!0), a = f(r(u))(c));
2109
+ i && (a(!0), a = d(r(u)).render(c));
2108
2110
  }
2109
2111
  ), (u) => {
2110
2112
  i = !1, a(u), c.clear(u);
2111
2113
  };
2112
- };
2113
- }, Es = (t, e) => Ve(() => t, e), je = (t, e, s) => (n) => n.on(t, e, s), Rt = (t) => je("click", (e, s) => {
2114
+ });
2115
+ }, xs = (t, e) => Ve(() => t, e), qe = (t, e, s) => g((n) => n.on(t, e, s)), qt = (t) => qe("click", (e, s) => {
2114
2116
  e.preventDefault();
2115
2117
  const n = e.target;
2116
2118
  setTimeout(() => {
2117
2119
  const r = n.ownerDocument != null ? n?.checked : void 0;
2118
2120
  r != null && t(!r, s);
2119
2121
  }, 0);
2120
- }), se = new Proxy(
2122
+ }), re = new Proxy(
2121
2123
  {},
2122
2124
  {
2123
2125
  /**
@@ -2125,20 +2127,20 @@ const Dt = /* @__PURE__ */ new Set([
2125
2127
  * @param fn - The function to call when the event is triggered.
2126
2128
  * @returns A `Renderable` function that adds the event listener to the element.
2127
2129
  */
2128
- get: (t, e) => (s) => je(e, s)
2130
+ get: (t, e) => (s) => qe(e, s)
2129
2131
  }
2130
- ), Vt = (t, e) => (s) => {
2132
+ ), Bt = (t, e) => (s) => {
2131
2133
  e?.preventDefault === !0 && s.preventDefault(), e?.stopPropagation === !0 && s.stopPropagation(), e?.stopImmediatePropagation === !0 && s.stopImmediatePropagation(), t(s);
2132
- }, O = (t, e) => Vt((s) => {
2134
+ }, k = (t, e) => Bt((s) => {
2133
2135
  const n = s.target;
2134
2136
  t(n, s);
2135
- }, e), jt = (t, e) => O(
2137
+ }, e), Ft = (t, e) => k(
2136
2138
  (s, n) => t(s.value, n),
2137
2139
  e
2138
- ), qt = (t, e) => O(
2140
+ ), Wt = (t, e) => k(
2139
2141
  (s, n) => t(s.valueAsNumber, n),
2140
2142
  e
2141
- ), Ft = (t, e) => O((s, n) => {
2143
+ ), Ut = (t, e) => k((s, n) => {
2142
2144
  if (s.value === "")
2143
2145
  return;
2144
2146
  const r = s.value.split("-"), o = new Date(
@@ -2147,7 +2149,7 @@ const Dt = /* @__PURE__ */ new Set([
2147
2149
  Number(r[2].substring(0, 2))
2148
2150
  );
2149
2151
  t(o, n);
2150
- }, e), Cs = (t, e) => O((s, n) => {
2152
+ }, e), Ls = (t, e) => k((s, n) => {
2151
2153
  if (s.value === "") {
2152
2154
  t(null, n);
2153
2155
  return;
@@ -2158,7 +2160,7 @@ const Dt = /* @__PURE__ */ new Set([
2158
2160
  Number(r[2].substring(0, 2))
2159
2161
  );
2160
2162
  t(o, n);
2161
- }, e), Bt = (t, e) => O((s, n) => {
2163
+ }, e), Gt = (t, e) => k((s, n) => {
2162
2164
  if (s.value === "")
2163
2165
  return;
2164
2166
  const r = s.value.split("T"), o = r[0].split("-"), i = new Date(
@@ -2167,7 +2169,7 @@ const Dt = /* @__PURE__ */ new Set([
2167
2169
  Number(o[2])
2168
2170
  ), l = r[1].split(":");
2169
2171
  i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), t(i, n);
2170
- }, e), Ds = (t, e) => O((s, n) => {
2172
+ }, e), Os = (t, e) => k((s, n) => {
2171
2173
  if (s.value === "") {
2172
2174
  t(null, n);
2173
2175
  return;
@@ -2183,17 +2185,17 @@ const Dt = /* @__PURE__ */ new Set([
2183
2185
  Number(o[2])
2184
2186
  ), l = r[1].split(":");
2185
2187
  i.setHours(Number(l[0] ?? 0)), i.setMinutes(Number(l[1] ?? 0)), i.setSeconds(Number(l[2] ?? 0)), t(i, n);
2186
- }, e), xs = (t, e) => O((s, n) => {
2188
+ }, e), ks = (t, e) => k((s, n) => {
2187
2189
  t(s.checked, n);
2188
- }, e), Ls = (t, e = "input") => E(V.valueAsDate(t), se[e](Ft(t.set))), Ps = (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)), de = (t, e, s) => g.is(t) ? e(t) : s(t), Wt = (t, e, s) => {
2190
+ }, e), Ms = (t, e = "input") => C(V.valueAsDate(t), re[e](Ut(t.set))), Is = (t, e = "input") => C(V.valueAsDate(t), re[e](Gt(t.set))), Hs = (t, e = "input") => C(V.valueAsNumber(t), re[e](Wt(t.set))), $s = (t, e = "input") => C(V.value(t), re[e](Ft(t.set))), Ns = (t) => C(V.checked(t), qt(t.set)), fe = (t, e, s) => m.is(t) ? e(t) : s(t), Jt = (t, e, s) => {
2189
2191
  const n = t.makeRef();
2190
2192
  let r = () => {
2191
2193
  }, o = null;
2192
2194
  const i = e.on(
2193
2195
  (l) => {
2194
- o?.dispose(), r(!0), o = new j(), r = P(
2196
+ o?.dispose(), r(!0), o = new q(), r = O(
2195
2197
  o,
2196
- () => f(s(l))(n)
2198
+ () => d(s(l)).render(n)
2197
2199
  );
2198
2200
  },
2199
2201
  { noAutoDispose: !0 }
@@ -2201,43 +2203,45 @@ const Dt = /* @__PURE__ */ new Set([
2201
2203
  return (l) => {
2202
2204
  o?.dispose(), r(l), i(), n.clear(l);
2203
2205
  };
2204
- }, ne = (t, e) => {
2206
+ }, oe = (t, e) => {
2205
2207
  function s(r) {
2206
- return (o) => {
2208
+ return g((o) => {
2207
2209
  const i = o.makeRef();
2208
2210
  let l, c;
2209
- const a = r.map((p) => Object.keys(p)[0]);
2211
+ const a = r.map((f) => Object.keys(f)[0]);
2210
2212
  let u;
2211
- const h = a.on((p) => {
2212
- if (p !== u) {
2213
- u = p, c?.dispose(), l?.(!0), c = r.map((m) => m[p]);
2214
- const d = e[p](c);
2215
- l = f(d)(i);
2213
+ const h = a.on((f) => {
2214
+ if (f !== u) {
2215
+ u = f, c?.dispose(), l?.(!0), c = r.map((y) => y[f]);
2216
+ const p = e[f](c);
2217
+ l = d(p).render(i);
2216
2218
  }
2217
2219
  });
2218
- return (p) => {
2219
- c?.dispose(), h(), i.clear(p), l?.(p);
2220
+ return (f) => {
2221
+ c?.dispose(), h(), i.clear(f), l?.(f);
2220
2222
  };
2221
- };
2223
+ });
2222
2224
  }
2223
2225
  function n(r) {
2224
2226
  const o = Object.keys(r)[0];
2225
- return f(e[o](K(r[o])));
2227
+ return d(e[o](se(r[o])));
2226
2228
  }
2227
- return de(t, s, n);
2228
- }, qe = (t, e, s) => ne(
2229
- y.map(t, (n) => ({ [n[e]]: n })),
2229
+ return fe(t, s, n);
2230
+ }, Be = (t, e, s) => oe(
2231
+ w.map(t, (n) => ({ [n[e]]: n })),
2230
2232
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2231
2233
  s
2232
- ), Is = (t, e) => qe(t, "kind", e), Hs = (t, e) => {
2233
- const s = y.map(t, ([n, r]) => ({ [n]: r }));
2234
- return ne(s, e);
2235
- }, Ns = (t, e) => qe(t, "type", e), Ut = (t, e) => ne(
2236
- y.map(t, (s) => ({ [s]: !0 })),
2234
+ ), Rs = (t, e) => Be(t, "kind", e), js = (t, e) => {
2235
+ const s = w.map(t, ([n, r]) => ({
2236
+ [n]: r
2237
+ }));
2238
+ return oe(s, e);
2239
+ }, Vs = (t, e) => Be(t, "type", e), Kt = (t, e) => oe(
2240
+ w.map(t, (s) => ({ [s]: !0 })),
2237
2241
  e
2238
- ), $s = (t, e = {}) => (s) => {
2242
+ ), qs = (t, e = {}) => (s) => {
2239
2243
  const n = e?.firstSeparator ?? t, r = e?.lastSeparator ?? t;
2240
- return Ut(
2244
+ return Kt(
2241
2245
  s.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
2242
2246
  {
2243
2247
  first: n,
@@ -2245,111 +2249,111 @@ const Dt = /* @__PURE__ */ new Set([
2245
2249
  other: t
2246
2250
  }
2247
2251
  );
2248
- }, Rs = (t) => (e) => (e.appendOrInsert(t), (s) => {
2249
- s && U(t);
2250
- }), Vs = (t, e, s) => {
2252
+ }, Bs = (t) => g((e) => (e.appendOrInsert(t), (s) => {
2253
+ s && J(t);
2254
+ })), Fs = (t, e, s) => {
2251
2255
  function n(o) {
2252
- return (i) => {
2256
+ return g((i) => {
2253
2257
  const l = i.makeRef();
2254
2258
  let c = () => {
2255
2259
  }, a = !1, u = null;
2256
- const h = o.on((p) => {
2257
- p == null ? (c(!0), c = f(s?.())(l), a = !1, u?.dispose(), u = null) : a ? u.set(p) : (u = A(p), c(!0), c = f(e(u))(
2258
- l
2259
- ), a = !0);
2260
+ const h = o.on((f) => {
2261
+ f == null ? (c(!0), c = d(s?.()).render(l), a = !1, u?.dispose(), u = null) : a ? u.set(f) : (u = T(f), c(!0), c = d(
2262
+ e(u)
2263
+ ).render(l), a = !0);
2260
2264
  });
2261
- return (p) => {
2262
- u?.dispose(), h(), c?.(p), l.clear(p);
2265
+ return (f) => {
2266
+ u?.dispose(), h(), c?.(f), l.clear(f);
2263
2267
  };
2264
- };
2268
+ });
2265
2269
  }
2266
2270
  function r(o) {
2267
2271
  if (o == null) {
2268
2272
  const i = s?.();
2269
- return i != null ? f(i) : C;
2273
+ return i != null ? d(i) : D;
2270
2274
  }
2271
- return f(e(K(o)));
2275
+ return d(e(se(o)));
2272
2276
  }
2273
- return de(
2277
+ return fe(
2274
2278
  t,
2275
2279
  n,
2276
2280
  r
2277
2281
  );
2278
- }, js = (...t) => (e, s) => (n) => {
2282
+ }, Ws = (...t) => (e, s) => g((n) => {
2279
2283
  const r = n.makeRef();
2280
2284
  if (t.some(
2281
- (d) => !g.is(d) && d == null
2285
+ (p) => !m.is(p) && p == null
2282
2286
  ))
2283
- return (s != null ? f(s?.()) : C)(
2284
- r
2285
- );
2287
+ return (s != null ? d(s?.()) : D).render(r);
2286
2288
  const i = t.map(() => null), l = t.map(
2287
- (d) => g.is(d) ? d.value != null : d != null
2289
+ (p) => m.is(p) ? p.value != null : p != null
2288
2290
  );
2289
2291
  let c = null;
2290
- const a = A(l.every((d) => d)), u = (d, m) => {
2291
- if (d.value != null) {
2292
- if (i[m] == null) {
2293
- const w = A(d.value);
2294
- i[m] = w;
2292
+ const a = T(l.every((p) => p)), u = (p, y) => {
2293
+ if (p.value != null) {
2294
+ if (i[y] == null) {
2295
+ const b = T(p.value);
2296
+ i[y] = b;
2295
2297
  } else
2296
- i[m].value = d.value;
2297
- l[m] = !0;
2298
+ i[y].value = p.value;
2299
+ l[y] = !0;
2298
2300
  } else
2299
- l[m] = !1;
2301
+ l[y] = !1;
2300
2302
  };
2301
2303
  let h = t.length - 1;
2302
- const p = t.map((d, m) => {
2303
- if (!g.is(d)) {
2304
- const w = A(d);
2305
- return i[m] = w, () => {
2304
+ const f = t.map((p, y) => {
2305
+ if (!m.is(p)) {
2306
+ const b = T(p);
2307
+ return i[y] = b, () => {
2306
2308
  };
2307
2309
  }
2308
- return d.on(() => {
2309
- u(d, m), h === 0 ? a.value = l.every((w) => w) : h--;
2310
+ return p.on(() => {
2311
+ u(p, y), h === 0 ? a.value = l.every((b) => b) : h--;
2310
2312
  });
2311
2313
  });
2312
- return a.on((d) => {
2313
- c?.(!0), c = null, d ? c = f(e(...i))(r) : c = f(s?.() ?? C)(r);
2314
- }), (d) => {
2315
- i.forEach((m) => m?.dispose()), a.dispose(), p.forEach((m) => m()), c?.(d), r.clear(d);
2314
+ return a.on((p) => {
2315
+ c?.(!0), c = null, p ? c = d(e(...i)).render(r) : c = d(s?.() ?? D).render(r);
2316
+ }), (p) => {
2317
+ i.forEach((y) => y?.dispose()), a.dispose(), f.forEach((y) => y()), c?.(p), r.clear(p);
2316
2318
  };
2317
- }, Fe = (t, e, s) => de(
2319
+ }), Fe = (t, e, s) => fe(
2318
2320
  t,
2319
- (n) => (r) => Wt(
2320
- r,
2321
- n,
2322
- (o) => o ? e() : s?.()
2321
+ (n) => g(
2322
+ (r) => Jt(
2323
+ r,
2324
+ n,
2325
+ (o) => o ? e() : s?.()
2326
+ )
2323
2327
  ),
2324
2328
  (n) => {
2325
2329
  if (n) {
2326
2330
  const r = e();
2327
- return r != null ? f(r) : C;
2331
+ return r != null ? d(r) : D;
2328
2332
  }
2329
- return f(s?.());
2333
+ return d(s?.());
2330
2334
  }
2331
- ), qs = (t, e, s) => Fe(
2332
- y.map(t, (n) => !n),
2335
+ ), Us = (t, e, s) => Fe(
2336
+ w.map(t, (n) => !n),
2333
2337
  e,
2334
2338
  s
2335
- ), Be = (t, e, s) => {
2339
+ ), We = (t, e, s) => {
2336
2340
  if (s != null)
2337
- return Be(t, (n) => {
2338
- const r = new le(
2341
+ return We(t, (n) => {
2342
+ const r = new ue(
2339
2343
  n.index,
2340
2344
  n.total.map((o) => o - 1)
2341
2345
  );
2342
- return E(
2343
- f(e(n)),
2346
+ return C(
2347
+ d(e(n)),
2344
2348
  Fe(
2345
2349
  n.isLast,
2346
- () => C,
2350
+ () => D,
2347
2351
  () => s(r)
2348
2352
  )
2349
2353
  );
2350
2354
  });
2351
- if (g.is(t))
2352
- return (n) => {
2355
+ if (m.is(t))
2356
+ return g((n) => {
2353
2357
  const r = t.derive(), o = n.makeRef(), i = [], l = [];
2354
2358
  return r.on((c) => {
2355
2359
  const a = i.splice(c), u = l.splice(c);
@@ -2358,9 +2362,12 @@ const Dt = /* @__PURE__ */ new Set([
2358
2362
  for (const h of a)
2359
2363
  h(!0);
2360
2364
  for (let h = i.length; h < c; h++) {
2361
- const p = new le(h, r), d = new j();
2362
- l.push(d), i.push(
2363
- P(d, () => f(e(p))(o))
2365
+ const f = new ue(h, r), p = new q();
2366
+ l.push(p), i.push(
2367
+ O(
2368
+ p,
2369
+ () => d(e(f)).render(o)
2370
+ )
2364
2371
  );
2365
2372
  }
2366
2373
  }), (c) => {
@@ -2371,47 +2378,49 @@ const Dt = /* @__PURE__ */ new Set([
2371
2378
  a(c);
2372
2379
  i.length = 0, o.clear(c);
2373
2380
  };
2374
- };
2381
+ });
2375
2382
  {
2376
- const n = K(t);
2377
- return E(
2383
+ const n = se(t);
2384
+ return C(
2378
2385
  ...Array.from({ length: t }, (r, o) => o).map((r) => {
2379
- const o = new le(r, n);
2380
- return f(e(o));
2386
+ const o = new ue(r, n);
2387
+ return d(e(o));
2381
2388
  })
2382
2389
  );
2383
2390
  }
2384
- }, Fs = (t, e, s) => {
2385
- const n = y.map(t, (o) => o.length), r = y.toSignal(t);
2386
- return Be(
2391
+ }, Gs = (t, e, s) => {
2392
+ const n = w.map(t, (o) => o.length), r = w.toSignal(t);
2393
+ return We(
2387
2394
  n,
2388
2395
  (o) => {
2389
2396
  const i = r.map((l) => l[o.index]);
2390
- return f(e(i, o));
2397
+ return d(e(i, o));
2391
2398
  },
2392
2399
  s
2393
2400
  );
2394
- }, Gt = (...t) => (e) => (s) => t.forEach((n) => {
2395
- typeof n == "function" ? n(s, e) : n.dispose(s, e);
2396
- }), Bs = (t, e) => {
2397
- if (g.is(t)) {
2401
+ }, zt = (...t) => g(
2402
+ (e) => (s) => t.forEach((n) => {
2403
+ typeof n == "function" ? n(s, e) : n.dispose(s, e);
2404
+ })
2405
+ ), Js = (t, e) => {
2406
+ if (m.is(t)) {
2398
2407
  const s = t;
2399
- return (n) => {
2408
+ return g((n) => {
2400
2409
  n = n.makeRef();
2401
- const r = s.map((l) => f(e(l)));
2410
+ const r = s.map((l) => d(e(l)));
2402
2411
  let o = () => {
2403
2412
  };
2404
2413
  const i = r.on((l) => {
2405
- o(!0), o = l(n);
2414
+ o(!0), o = l.render(n);
2406
2415
  });
2407
2416
  return (l) => {
2408
2417
  i(), o(l);
2409
2418
  };
2410
- };
2419
+ });
2411
2420
  }
2412
- return f(e(t));
2413
- }, Ws = (t, e, s = () => C) => ne(
2414
- y.map(
2421
+ return d(e(t));
2422
+ }, Ks = (t, e, s = () => D) => oe(
2423
+ w.map(
2415
2424
  t,
2416
2425
  (n) => n.length > 0 ? { notEmpty: n } : { whenEmpty: null }
2417
2426
  ),
@@ -2419,40 +2428,40 @@ const Dt = /* @__PURE__ */ new Set([
2419
2428
  notEmpty: (n) => e(n),
2420
2429
  whenEmpty: () => s()
2421
2430
  }
2422
- ), Us = (t, e) => (s) => {
2423
- const n = s.makePortal(t), r = fe(f(e), n);
2431
+ ), zs = (t, e) => g((s) => {
2432
+ const n = s.makePortal(t), r = pe(d(e), n);
2424
2433
  return () => r(!0);
2425
- }, W = /* @__PURE__ */ new Map(), Jt = (t) => ({
2426
- mark: at(`Probe(${t.description})`),
2434
+ }), G = /* @__PURE__ */ new Map(), Yt = (t) => ({
2435
+ mark: Ue(`Probe(${t.description})`),
2427
2436
  create: ({ callback: e = () => {
2428
2437
  }, timeout: s = 10 } = {}) => {
2429
2438
  const n = (l) => {
2430
- clearTimeout(r), W.delete(t), e(l);
2439
+ clearTimeout(r), G.delete(t), e(l);
2431
2440
  };
2432
- if (W.has(t))
2441
+ if (G.has(t))
2433
2442
  throw new Error(`Probe already exists: ${t.description}`);
2434
2443
  const r = setTimeout(() => n("timeout"), s), o = { counter: 0, timeoutId: r };
2435
- return W.set(t, o), {
2444
+ return G.set(t, o), {
2436
2445
  value: () => {
2437
2446
  clearTimeout(r);
2438
- const l = W.get(t);
2447
+ const l = G.get(t);
2439
2448
  l != null && --l.counter === 0 && n("resolved");
2440
2449
  },
2441
2450
  dispose: () => n("disposed"),
2442
2451
  onUse: () => o.counter++
2443
2452
  };
2444
2453
  }
2445
- }), Gs = Jt(Symbol("GlobalProbe")), Xt = (t, e) => (s) => {
2454
+ }), Ys = Yt(Symbol("GlobalProbe")), Xt = (t, e) => g((s) => {
2446
2455
  const n = s.getStyle(t);
2447
2456
  return s.setStyle(t, e), (r) => {
2448
2457
  r && s.setStyle(t, n);
2449
2458
  };
2450
- }, Yt = (t, e) => (s) => {
2459
+ }), Qt = (t, e) => g((s) => {
2451
2460
  const n = s.getStyle(t), r = e.on((o) => s.setStyle(t, o));
2452
2461
  return (o) => {
2453
2462
  r(), o && s.setStyle(t, n);
2454
2463
  };
2455
- }, ye = (t, e) => g.is(e) ? Yt(t, e) : Xt(t, e), Js = new Proxy({}, {
2464
+ }), we = (t, e) => m.is(e) ? Qt(t, e) : Xt(t, e), Xs = new Proxy({}, {
2456
2465
  /**
2457
2466
  * Creates a renderable component for the specified `style` property.
2458
2467
  *
@@ -2461,33 +2470,36 @@ const Dt = /* @__PURE__ */ new Set([
2461
2470
  * @returns The renderable component for the specified attribute.
2462
2471
  *
2463
2472
  */
2464
- get: (t, e) => e === "variable" ? (s, n) => ye(s, n) : (s) => ye(e, s)
2465
- }), Qt = (t) => (e) => {
2473
+ get: (t, e) => e === "variable" ? (s, n) => we(s, n) : (s) => we(e, s)
2474
+ }), Zt = (t) => g((e) => {
2466
2475
  if (e.isBrowser()) {
2467
2476
  const s = t(e);
2468
2477
  if (s != null)
2469
- return f(s)(e);
2478
+ return d(s).render(e);
2470
2479
  }
2471
2480
  return () => {
2472
2481
  };
2473
- }, Xs = (t) => (e) => {
2482
+ }), Qs = (t) => g((e) => {
2474
2483
  const s = t(e);
2475
2484
  return s == null ? () => {
2476
- } : f(s)(e);
2477
- }, Ys = (t) => Qt((e) => t(e.element)), Qs = (t) => (e) => {
2485
+ } : d(s).render(e);
2486
+ }), Zs = (t) => Zt((e) => t(e.element)), en = (t) => g((e) => {
2478
2487
  if (e.isHeadlessDOM()) {
2479
2488
  const s = t(e);
2480
2489
  if (s)
2481
- return f(s)(e);
2490
+ return d(s).render(e);
2482
2491
  }
2483
2492
  return () => {
2484
2493
  };
2485
- }, Zs = (t) => (e) => {
2486
- const s = new j(), n = P(s, () => f(t(s))(e));
2494
+ }), tn = (t) => g((e) => {
2495
+ const s = new q(), n = O(
2496
+ s,
2497
+ () => d(t(s)).render(e)
2498
+ );
2487
2499
  return (r) => {
2488
2500
  s.dispose(), n(r);
2489
2501
  };
2490
- }, pe = (t) => (e) => {
2502
+ }), ge = (t) => g((e) => {
2491
2503
  let s = e;
2492
2504
  function n() {
2493
2505
  return s;
@@ -2501,151 +2513,151 @@ const Dt = /* @__PURE__ */ new Set([
2501
2513
  return a?.(), c;
2502
2514
  },
2503
2515
  set: ({ mark: l, create: c }, a) => {
2504
- const { value: u, dispose: h, onUse: p } = c(a, n());
2505
- o.push(h), r(n().setProvider(l, u, p));
2516
+ const { value: u, dispose: h, onUse: f } = c(a, n());
2517
+ o.push(h), r(n().setProvider(l, u, f));
2506
2518
  }
2507
2519
  });
2508
2520
  return i == null ? () => {
2509
- } : E(
2510
- f(i),
2511
- Gt(() => o.forEach((l) => l()))
2512
- )(n());
2513
- }, zs = (t, e, s) => pe(({ set: n }) => (n(t, e), s())), Ks = (t, e) => pe(({ use: s }) => e(s(t))), en = (...t) => (e) => pe(({ use: s }) => {
2521
+ } : C(
2522
+ d(i),
2523
+ zt(() => o.forEach((l) => l()))
2524
+ ).render(n());
2525
+ }), sn = (t, e, s) => ge(({ set: n }) => (n(t, e), s())), nn = (t, e) => ge(({ use: s }) => e(s(t))), rn = (...t) => (e) => ge(({ use: s }) => {
2514
2526
  const n = t.map(s);
2515
2527
  return e(...n);
2516
2528
  });
2517
2529
  export {
2518
- Ht as Aria,
2519
- Es as Async,
2520
- kt as Attr,
2521
- ks as BindChecked,
2522
- Ls as BindDate,
2523
- Ps as BindDateTime,
2524
- Os as BindNumber,
2525
- Ms as BindText,
2526
- $ as BrowserContext,
2527
- G as CLASS_PLACEHOLDER_ATTR,
2530
+ Rt as Aria,
2531
+ xs as Async,
2532
+ $t as Attr,
2533
+ Ns as BindChecked,
2534
+ Ms as BindDate,
2535
+ Is as BindDateTime,
2536
+ Hs as BindNumber,
2537
+ $s as BindText,
2538
+ R as BrowserContext,
2539
+ K as CLASS_PLACEHOLDER_ATTR,
2528
2540
  N as Computed,
2529
- $s as Conjunction,
2530
- Rs as DOMNode,
2531
- It as DataAttr,
2532
- j as DisposalScope,
2541
+ qs as Conjunction,
2542
+ Bs as DOMNode,
2543
+ Nt as DataAttr,
2544
+ q as DisposalScope,
2533
2545
  Ne as El,
2534
- te as ElNS,
2535
- le as ElementPosition,
2536
- C as Empty,
2537
- Vs as Ensure,
2538
- js as EnsureAll,
2539
- Fs as ForEach,
2540
- E as Fragment,
2541
- Gs as GlobalProbe,
2542
- fs as HeadlessAdapter,
2543
- R as HeadlessContext,
2544
- Et as HeadlessElement,
2545
- ke as HeadlessPortal,
2546
- Ct as HeadlessText,
2547
- Bs as MapSignal,
2548
- $t as MathAttr,
2549
- As as MathEl,
2550
- be as MemoryStore,
2551
- Ws as NotEmpty,
2552
- Rt as OnChecked,
2553
- Gt as OnDispose,
2554
- ne as OneOf,
2555
- qe as OneOfField,
2556
- Is as OneOfKind,
2557
- Hs as OneOfTuple,
2558
- Ns as OneOfType,
2559
- Ut as OneOfValue,
2560
- Us as Portal,
2561
- Z as Prop,
2562
- zs as Provide,
2546
+ ne as ElNS,
2547
+ ue as ElementPosition,
2548
+ D as Empty,
2549
+ Fs as Ensure,
2550
+ Ws as EnsureAll,
2551
+ Gs as ForEach,
2552
+ C as Fragment,
2553
+ Ys as GlobalProbe,
2554
+ gs as HeadlessAdapter,
2555
+ j as HeadlessContext,
2556
+ Dt as HeadlessElement,
2557
+ Ie as HeadlessPortal,
2558
+ Pt as HeadlessText,
2559
+ Js as MapSignal,
2560
+ Vt as MathAttr,
2561
+ Ds as MathEl,
2562
+ Se as MemoryStore,
2563
+ Ks as NotEmpty,
2564
+ qt as OnChecked,
2565
+ zt as OnDispose,
2566
+ oe as OneOf,
2567
+ Be as OneOfField,
2568
+ Rs as OneOfKind,
2569
+ js as OneOfTuple,
2570
+ Vs as OneOfType,
2571
+ Kt as OneOfValue,
2572
+ zs as Portal,
2573
+ ee as Prop,
2574
+ sn as Provide,
2563
2575
  xe as ProviderNotFoundError,
2564
- ut as RenderingError,
2565
- Be as Repeat,
2566
- Nt as SVGAttr,
2567
- _s as SVGEl,
2568
- g as Signal,
2576
+ dt as RenderingError,
2577
+ We as Repeat,
2578
+ jt as SVGAttr,
2579
+ Es as SVGEl,
2580
+ m as Signal,
2569
2581
  Ve as Task,
2570
- ps as TextNode,
2571
- qs as Unless,
2572
- Ks as Use,
2573
- en as UseMany,
2574
- y as Value,
2582
+ ws as TextNode,
2583
+ Us as Unless,
2584
+ nn as Use,
2585
+ rn as UseMany,
2586
+ w as Value,
2575
2587
  Fe as When,
2576
- Qt as WithBrowserCtx,
2577
- Xs as WithCtx,
2578
- Ys as WithElement,
2579
- Qs as WithHeadlessCtx,
2580
- pe as WithProvider,
2581
- Zs as WithScope,
2588
+ Zt as WithBrowserCtx,
2589
+ Qs as WithCtx,
2590
+ Zs as WithElement,
2591
+ en as WithHeadlessCtx,
2592
+ ge as WithProvider,
2593
+ tn as WithScope,
2582
2594
  Le as _NODE_PLACEHOLDER_ATTR,
2583
- ct as _getSelfOrParentElement,
2584
- De as _isElement,
2585
- lt as _makeGetter,
2586
- it as _makeSetter,
2587
- U as _removeDOMNode,
2588
- He as _signalText,
2589
- Ie as _staticText,
2590
- ns as animateSignal,
2591
- rt as animateSignals,
2592
- ms as aria,
2595
+ ht as _getSelfOrParentElement,
2596
+ Pe as _isElement,
2597
+ ut as _makeGetter,
2598
+ at as _makeSetter,
2599
+ J as _removeDOMNode,
2600
+ $e as _signalText,
2601
+ He as _staticText,
2602
+ is as animateSignal,
2603
+ lt as animateSignals,
2604
+ vs as aria,
2593
2605
  V as attr,
2594
- cs as bind,
2595
- as as coalesce,
2596
- z as computed,
2597
- ee as computedOf,
2598
- ot as computedRecord,
2599
- gs as dataAttr,
2600
- os as delaySignal,
2601
- Se as effect,
2602
- Qe as effectOf,
2603
- Vt as emit,
2604
- xs as emitChecked,
2605
- O as emitTarget,
2606
- jt as emitValue,
2607
- Ft as emitValueAsDate,
2608
- Bt as emitValueAsDateTime,
2609
- Cs as emitValueAsNullableDate,
2610
- Ds as emitValueAsNullableDateTime,
2611
- qt as emitValueAsNumber,
2612
- et as endInterpolate,
2613
- ue as getCurrentScope,
2614
- zt as getParentScope,
2615
- Zt as getScopeStack,
2616
- he as getWindow,
2617
- tt as guessInterpolate,
2618
- ws as html,
2619
- bs as input,
2620
- Ke as interpolateDate,
2621
- Ze as interpolateNumber,
2622
- ze as interpolateString,
2606
+ hs as bind,
2607
+ ds as coalesce,
2608
+ te as computed,
2609
+ Z as computedOf,
2610
+ ct as computedRecord,
2611
+ Ge as createRenderable,
2612
+ bs as dataAttr,
2613
+ cs as delaySignal,
2614
+ ve as effect,
2615
+ Ye as effectOf,
2616
+ Bt as emit,
2617
+ ks as emitChecked,
2618
+ k as emitTarget,
2619
+ Ft as emitValue,
2620
+ Ut as emitValueAsDate,
2621
+ Gt as emitValueAsDateTime,
2622
+ Ls as emitValueAsNullableDate,
2623
+ Os as emitValueAsNullableDateTime,
2624
+ Wt as emitValueAsNumber,
2625
+ nt as endInterpolate,
2626
+ he as getCurrentScope,
2627
+ ss as getParentScope,
2628
+ ts as getScopeStack,
2629
+ ys as getWindow,
2630
+ rt as guessInterpolate,
2631
+ As as html,
2632
+ Ts as input,
2633
+ st as interpolateDate,
2634
+ et as interpolateNumber,
2635
+ tt as interpolateString,
2623
2636
  es as joinSignals,
2624
- ts as localStorageProp,
2625
- Jt as makeProbe,
2626
- at as makeProviderMark,
2627
- Ts as math,
2628
- Ss as mathAttr,
2629
- rs as merge,
2630
- se as on,
2631
- Ue as popScope,
2632
- is as previousSignal,
2633
- A as prop,
2634
- We as pushScope,
2635
- us as render,
2636
- fe as renderWithContext,
2637
- f as renderableOfTNode,
2638
- ds as restoreTempoPlaceholders,
2639
- hs as runHeadless,
2640
- _ as scopeStack,
2641
- Kt as scoped,
2642
- ss as sessionStorageProp,
2643
- K as signal,
2644
- ls as slidingWindowSignal,
2637
+ rs as localStorageProp,
2638
+ Yt as makeProbe,
2639
+ Ue as makeProviderMark,
2640
+ Ps as math,
2641
+ _s as mathAttr,
2642
+ ls as merge,
2643
+ re as on,
2644
+ Qe as popScope,
2645
+ as as previousSignal,
2646
+ T as prop,
2647
+ Xe as pushScope,
2648
+ ps as render,
2649
+ pe as renderWithContext,
2650
+ d as renderableOfTNode,
2651
+ ms as restoreTempoPlaceholders,
2652
+ fs as runHeadless,
2653
+ ns as scoped,
2654
+ os as sessionStorageProp,
2655
+ se as signal,
2656
+ us as slidingWindowSignal,
2645
2657
  _e as storedProp,
2646
- Js as style,
2647
- vs as svg,
2648
- ys as svgAttr,
2649
- ie as untracked,
2650
- P as withScope
2658
+ Xs as style,
2659
+ Cs as svg,
2660
+ Ss as svgAttr,
2661
+ le as untracked,
2662
+ O as withScope
2651
2663
  };