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