@tempots/dom 35.0.4 → 36.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,23 +1,23 @@
1
- const Ge = (t) => Symbol(t);
2
- function Ke(t, e) {
1
+ const st = (s) => Symbol(s);
2
+ function nt(s, e) {
3
3
  return {
4
- type: t,
4
+ type: s,
5
5
  render: e
6
6
  };
7
7
  }
8
- function _e(t) {
9
- return t != null && t !== !1 && t !== 0 && t !== "";
8
+ function Ie(s) {
9
+ return s != null && s !== !1 && s !== 0 && s !== "";
10
10
  }
11
- function Ye(t) {
12
- return !_e(t);
11
+ function rt(s) {
12
+ return !Ie(s);
13
13
  }
14
- function Xe(t) {
15
- return t == null;
14
+ function it(s) {
15
+ return s == null;
16
16
  }
17
- function Qe(t) {
18
- return t != null;
17
+ function ot(s) {
18
+ return s != null;
19
19
  }
20
- const w = {
20
+ const C = {
21
21
  /**
22
22
  * Maps a value or a Signal to a new value.
23
23
  * If the value is a Signal, it returns a new Signal with the mapped value.
@@ -29,7 +29,7 @@ const w = {
29
29
  * @param fn - The function to map the value.
30
30
  * @returns The mapped value.
31
31
  */
32
- map: (t, e) => y.is(t) ? t.map(e) : e(t),
32
+ map: (s, e) => _.is(s) ? s.map(e) : e(s),
33
33
  /**
34
34
  * Wraps a value or a Signal instance into a Signal.
35
35
  * If the value is already a Signal, it returns the value itself.
@@ -40,30 +40,30 @@ const w = {
40
40
  * @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
41
41
  * @returns A Signal instance.
42
42
  */
43
- toSignal: (t, e) => y.is(t) ? t.derive() : re(t, e),
43
+ toSignal: (s, e) => _.is(s) ? s.derive() : ye(s, e),
44
44
  /**
45
45
  * Wraps a value in a `Signal` if it is not already a `Signal`.
46
46
  * If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
47
47
  * @param value - The value to wrap or check.
48
48
  * @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
49
49
  */
50
- maybeToSignal: (t, e) => {
51
- if (t != null)
52
- return w.toSignal(t, e);
50
+ maybeToSignal: (s, e) => {
51
+ if (s != null)
52
+ return C.toSignal(s, e);
53
53
  },
54
54
  /**
55
55
  * Gets the value from a `Signal` or the value itself if it is not a `Signal`.
56
56
  * @param value - The value or Signal instance to get the value from.
57
57
  * @returns The value.
58
58
  */
59
- get: (t) => y.is(t) ? t.get() : t,
59
+ get: (s) => _.is(s) ? s.get() : s,
60
60
  /**
61
61
  * Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
62
62
  * @param value - The value or Signal instance to add the listener to.
63
63
  * @param listener - The listener to call when the value changes.
64
64
  * @returns A function to remove the listener.
65
65
  */
66
- on: (t, e) => y.is(t) ? t.on(e) : (e(t), () => {
66
+ on: (s, e) => _.is(s) ? s.on(e) : (e(s), () => {
67
67
  }),
68
68
  /**
69
69
  * Disposes of a value or a Signal.
@@ -71,8 +71,8 @@ const w = {
71
71
  * If the value is not a Signal, it does nothing.
72
72
  * @param value - The value or Signal instance to dispose of.
73
73
  */
74
- dispose: (t) => {
75
- y.is(t) && t.dispose();
74
+ dispose: (s) => {
75
+ _.is(s) && s.dispose();
76
76
  },
77
77
  /**
78
78
  * Returns a function that disposes of a value or a Signal.
@@ -81,7 +81,7 @@ const w = {
81
81
  * @param value - The value or Signal instance to dispose of.
82
82
  * @returns A function to dispose of the value or Signal.
83
83
  */
84
- disposeFn: (t) => () => w.dispose(t),
84
+ disposeFn: (s) => () => C.dispose(s),
85
85
  /**
86
86
  * Derives a Prop from a Signal.
87
87
  * If the value is a Signal, it returns a new Prop with the derived value.
@@ -92,62 +92,73 @@ const w = {
92
92
  * @param options.equals - A function that determines if two values are equal.
93
93
  * @returns A Prop instance.
94
94
  */
95
- deriveProp: (t, {
95
+ deriveProp: (s, {
96
96
  autoDisposeProp: e = !0,
97
- equals: s
98
- } = {}) => y.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : D(t, s),
97
+ equals: t
98
+ } = {}) => _.is(s) ? s.deriveProp({ autoDisposeProp: e, equals: t }) : B(s, t),
99
99
  /**
100
100
  * Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
101
101
  * @param value - The value or signal to check.
102
102
  * @returns A signal that emits `true` if the value is truthy, `false` otherwise.
103
103
  */
104
- truthy: (t) => w.map(t, _e),
104
+ truthy: (s) => C.map(s, Ie),
105
105
  /**
106
106
  * Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
107
107
  * @param value - The value or signal to check.
108
108
  * @returns A signal that emits `true` if the value is falsy, `false` otherwise.
109
109
  */
110
- falsy: (t) => w.map(t, Ye),
110
+ falsy: (s) => C.map(s, rt),
111
111
  /**
112
112
  * Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
113
113
  * @param value - The value or signal to check.
114
114
  * @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
115
115
  */
116
- nil: (t) => w.map(t, Xe),
116
+ nil: (s) => C.map(s, it),
117
117
  /**
118
118
  * Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
119
119
  * @param value - The value or signal to check.
120
120
  * @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
121
121
  */
122
- defined: (t) => w.map(t, Qe)
123
- }, J = (...t) => (e, s) => {
124
- if (t.length === 1)
125
- return w.toSignal(t[0]).map(e);
126
- const n = t.filter((r) => y.is(r));
127
- return ne(
128
- () => e(...t.map((r) => w.get(r))),
122
+ defined: (s) => C.map(s, ot)
123
+ }, ne = (...s) => (e, t) => {
124
+ if (s.length === 1)
125
+ return C.toSignal(s[0]).map(e);
126
+ const n = s.filter((r) => _.is(r));
127
+ return be(
128
+ () => e(...s.map((r) => C.get(r))),
129
129
  n,
130
- s
130
+ t
131
131
  );
132
- }, Yt = (...t) => (e, s, n, r = (o, i) => o === i) => J(...t)((...o) => o).mapAsync(
133
- ([...o]) => e(...o),
134
- s,
132
+ }, ls = (...s) => (e, t, n, r = (i, o) => i === o) => ne(...s)((...i) => i).mapAsync(
133
+ ([...i], o) => e(
134
+ ...i,
135
+ o
136
+ ),
137
+ t,
138
+ n,
139
+ r
140
+ ), as = (...s) => (e, t, n, r = (i, o) => i === o) => ne(...s)((...i) => i).mapAsyncGenerator(
141
+ ([...i], o) => e(
142
+ ...i,
143
+ o
144
+ ),
145
+ t,
135
146
  n,
136
147
  r
137
- ), Xt = (t) => {
138
- const e = Object.keys(t);
139
- return J(...Object.values(t))(
140
- (...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
148
+ ), cs = (s) => {
149
+ const e = Object.keys(s);
150
+ return ne(...Object.values(s))(
151
+ (...t) => Object.fromEntries(e.map((n, r) => [n, t[r]]))
141
152
  );
142
- }, Ze = (...t) => (e, s = {}) => {
143
- const n = t.filter((r) => y.is(r));
144
- return Ae(
145
- () => e(...t.map(w.get)),
153
+ }, lt = (...s) => (e, t = {}) => {
154
+ const n = s.filter((r) => _.is(r));
155
+ return $e(
156
+ () => e(...s.map(C.get)),
146
157
  n,
147
- s
158
+ t
148
159
  );
149
160
  };
150
- class z {
161
+ class ie {
151
162
  _signals = /* @__PURE__ */ new Set();
152
163
  _callbacks = [];
153
164
  _disposed = !1;
@@ -192,8 +203,8 @@ class z {
192
203
  for (const e of this._callbacks)
193
204
  try {
194
205
  e();
195
- } catch (s) {
196
- const n = s instanceof Error ? s.message : String(s);
206
+ } catch (t) {
207
+ const n = t instanceof Error ? t.message : String(t);
197
208
  console.error("Error in disposal callback:", n);
198
209
  }
199
210
  this._callbacks.length = 0;
@@ -220,8 +231,8 @@ class z {
220
231
  * @returns A tracked Prop signal
221
232
  * @public
222
233
  */
223
- prop(e, s) {
224
- const n = ce(() => D(e, s));
234
+ prop(e, t) {
235
+ const n = Ae(() => B(e, t));
225
236
  return this.track(n), n;
226
237
  }
227
238
  /**
@@ -234,8 +245,8 @@ class z {
234
245
  * @returns A tracked Computed signal
235
246
  * @public
236
247
  */
237
- computed(e, s, n) {
238
- const r = ce(() => ne(e, s, n));
248
+ computed(e, t, n) {
249
+ const r = Ae(() => be(e, t, n));
239
250
  return this.track(r), r;
240
251
  }
241
252
  /**
@@ -248,8 +259,8 @@ class z {
248
259
  * @returns A clear function (the effect itself is tracked in the scope)
249
260
  * @public
250
261
  */
251
- effect(e, s, n) {
252
- return k(this, () => Ae(e, s, n));
262
+ effect(e, t, n) {
263
+ return z(this, () => $e(e, t, n));
253
264
  }
254
265
  /**
255
266
  * Creates a computed signal with curried signature and tracks it in this scope.
@@ -260,8 +271,8 @@ class z {
260
271
  * @public
261
272
  */
262
273
  computedOf(...e) {
263
- return (s, n) => {
264
- const r = ce(() => J(...e)(s, n));
274
+ return (t, n) => {
275
+ const r = Ae(() => ne(...e)(t, n));
265
276
  return this.track(r), r;
266
277
  };
267
278
  }
@@ -274,39 +285,39 @@ class z {
274
285
  * @public
275
286
  */
276
287
  effectOf(...e) {
277
- return (s, n) => k(this, () => Ze(...e)(s, n));
288
+ return (t, n) => z(this, () => lt(...e)(t, n));
278
289
  }
279
290
  }
280
- const T = [], et = (t) => {
281
- T.push(t);
282
- }, tt = () => {
283
- if (T.length === 0)
291
+ const j = [], at = (s) => {
292
+ j.push(s);
293
+ }, ct = () => {
294
+ if (j.length === 0)
284
295
  throw new Error("Cannot pop from empty scope stack");
285
- T.pop();
286
- }, pe = () => T[T.length - 1] ?? null, Qt = () => T, Zt = () => T[T.length - 2] ?? null, k = (t, e) => {
287
- et(t);
296
+ j.pop();
297
+ }, Oe = () => j[j.length - 1] ?? null, us = () => j, hs = () => j[j.length - 2] ?? null, z = (s, e) => {
298
+ at(s);
288
299
  try {
289
300
  return e();
290
301
  } finally {
291
- tt();
302
+ ct();
292
303
  }
293
- }, es = (t) => {
294
- const e = new z();
304
+ }, ds = (s) => {
305
+ const e = new ie();
295
306
  try {
296
- return k(e, () => t(e));
307
+ return z(e, () => s(e));
297
308
  } finally {
298
309
  e.dispose();
299
310
  }
300
- }, ce = (t) => {
301
- const e = T.slice();
302
- T.length = 0;
311
+ }, Ae = (s) => {
312
+ const e = j.slice();
313
+ j.length = 0;
303
314
  try {
304
- return t();
315
+ return s();
305
316
  } finally {
306
- T.length = 0, T.push(...e);
317
+ j.length = 0, j.push(...e);
307
318
  }
308
319
  };
309
- class y {
320
+ class _ {
310
321
  /**
311
322
  * Represents a signal with a value of type T.
312
323
  *
@@ -314,8 +325,8 @@ class y {
314
325
  * @param equals - A function that determines whether two values of type T are equal.
315
326
  * @public
316
327
  */
317
- constructor(e, s) {
318
- this.equals = s, this._value = e;
328
+ constructor(e, t) {
329
+ this.equals = t, this._value = e;
319
330
  }
320
331
  /**
321
332
  * Creates a Signal that holds the result of a Promise, with proper error handling.
@@ -358,14 +369,14 @@ class y {
358
369
  * @param equals - Function to compare two values for equality (defaults to strict equality)
359
370
  * @returns A Signal that represents the result of the Promise
360
371
  */
361
- static ofPromise = (e, s, n, r = (o, i) => o === i) => {
362
- const o = new y(s, r);
363
- return e.then((i) => o._setAndNotify(i)).catch((i) => {
364
- n != null ? o._setAndNotify(n(i)) : console.error(
372
+ static ofPromise = (e, t, n, r = (i, o) => i === o) => {
373
+ const i = new _(t, r);
374
+ return e.then((o) => i._setAndNotify(o)).catch((o) => {
375
+ n != null ? i._setAndNotify(n(o)) : console.error(
365
376
  "Unhandled promise rejection in Signal.ofPromise:",
366
- i
377
+ o
367
378
  );
368
- }), o;
379
+ }), i;
369
380
  };
370
381
  /**
371
382
  * Checks if a value is a Signal.
@@ -442,17 +453,17 @@ class y {
442
453
  * }
443
454
  * ```
444
455
  */
445
- on = (e, s = {}) => {
446
- s.skipInitial || e(this.get(), void 0);
447
- const n = s.once ? (o, i) => {
448
- r(), e(o, i);
456
+ on = (e, t = {}) => {
457
+ t.skipInitial || e(this.get(), void 0);
458
+ const n = t.once ? (i, o) => {
459
+ r(), e(i, o);
449
460
  } : e;
450
461
  this._onValueListeners.push(n);
451
462
  const r = () => {
452
- const o = this._onValueListeners.indexOf(n);
453
- o !== -1 && this._onValueListeners.splice(o, 1), s.abortSignal != null && s.abortSignal.removeEventListener("abort", r);
463
+ const i = this._onValueListeners.indexOf(n);
464
+ i !== -1 && this._onValueListeners.splice(i, 1), t.abortSignal != null && t.abortSignal.removeEventListener("abort", r);
454
465
  };
455
- return s.abortSignal != null && s.abortSignal.addEventListener("abort", r), !s.noAutoDispose && pe()?.onDispose(r), r;
466
+ return t.abortSignal != null && t.abortSignal.addEventListener("abort", r), !t.noAutoDispose && Oe()?.onDispose(r), r;
456
467
  };
457
468
  /**
458
469
  * Registers a listener function to be called whenever the value of the signal changes.
@@ -462,20 +473,20 @@ class y {
462
473
  * @param listener - The listener function to be called when the value of the signal changes.
463
474
  * @param options - Options for the listener.
464
475
  */
465
- onChange = (e, s = {}) => {
476
+ onChange = (e, t = {}) => {
466
477
  let n = 0;
467
- const r = (o, i) => {
468
- n++ > 0 && e(o, i);
478
+ const r = (i, o) => {
479
+ n++ > 0 && e(i, o);
469
480
  };
470
- return this.on(r, s);
481
+ return this.on(r, t);
471
482
  };
472
483
  /**
473
484
  * @internal
474
485
  */
475
486
  _setAndNotify = (e) => {
476
487
  if (this._disposed) return;
477
- const s = this._value;
478
- this.equals(s, e) || (this._value = e, this._onValueListeners.forEach((n) => n(e, s)));
488
+ const t = this._value;
489
+ this.equals(t, e) || (this._value = e, this._onValueListeners.forEach((n) => n(e, t)));
479
490
  };
480
491
  /**
481
492
  * @internal
@@ -563,14 +574,14 @@ class y {
563
574
  * @param equals - Optional function to determine if two transformed values are equal (defaults to strict equality)
564
575
  * @returns A new computed signal with the transformed value (auto-registered with current scope)
565
576
  */
566
- map = (e, s = (n, r) => n === r) => {
567
- const n = new R(() => {
577
+ map = (e, t = (n, r) => n === r) => {
578
+ const n = new ee(() => {
568
579
  try {
569
580
  return e(this.get());
570
581
  } catch (r) {
571
582
  throw console.error("Error in Signal.map:", r), r;
572
583
  }
573
- }, s);
584
+ }, t);
574
585
  return this.setDerivative(n), n;
575
586
  };
576
587
  /**
@@ -583,14 +594,14 @@ class y {
583
594
  * Defaults to a strict equality check (===).
584
595
  * @returns A new Signal that emits the values of the resulting Signal.
585
596
  */
586
- flatMap = (e, s = (n, r) => n === r) => {
587
- const n = new R(() => {
597
+ flatMap = (e, t = (n, r) => n === r) => {
598
+ const n = new ee(() => {
588
599
  try {
589
600
  return e(this.get()).get();
590
601
  } catch (r) {
591
602
  throw console.error("Error in Signal.flatMap:", r), r;
592
603
  }
593
- }, s);
604
+ }, t);
594
605
  return this.setDerivative(n), n;
595
606
  };
596
607
  /**
@@ -599,14 +610,14 @@ class y {
599
610
  * @param fn - The callback function to be invoked with the current value of the signal.
600
611
  * @returns A new signal that emits the same value as the original signal and invokes the callback function.
601
612
  */
602
- tap = (e) => this.map((s) => (e(s), s));
613
+ tap = (e) => this.map((t) => (e(t), t));
603
614
  /**
604
615
  * Returns a new Signal that emits the value at the specified key of the current value.
605
616
  *
606
617
  * @param key - The key of the value to retrieve.
607
618
  * @returns A new Signal that emits the value at the specified key.
608
619
  */
609
- at = (e) => this.map((s) => s[e]);
620
+ at = (e) => this.map((t) => t[e]);
610
621
  /**
611
622
  * @internal
612
623
  */
@@ -617,17 +628,17 @@ class y {
617
628
  */
618
629
  get $() {
619
630
  return this._$ !== void 0 ? this._$ : this._$ = new Proxy(this, {
620
- get: (e, s) => this.at(s)
631
+ get: (e, t) => this.at(t)
621
632
  });
622
633
  }
623
- filter = (e, s) => {
624
- let n = s ?? this.get();
625
- const r = new R(() => {
634
+ filter = (e, t) => {
635
+ let n = t ?? this.get();
636
+ const r = new ee(() => {
626
637
  try {
627
- const o = this.get();
628
- return n = e(o) ? o : n;
629
- } catch (o) {
630
- throw console.error("Error in Signal.filter:", o), o;
638
+ const i = this.get();
639
+ return n = e(i) ? i : n;
640
+ } catch (i) {
641
+ throw console.error("Error in Signal.filter:", i), i;
631
642
  }
632
643
  }, this.equals);
633
644
  return this.setDerivative(r), r;
@@ -642,17 +653,17 @@ class y {
642
653
  * @param equals - Optional equality function to determine if two values are equal.
643
654
  * @returns - A new Computed object with the mapped and filtered values.
644
655
  */
645
- filterMap = (e, s, n = (r, o) => r === o) => {
646
- let r = s;
647
- const o = new R(() => {
656
+ filterMap = (e, t, n = (r, i) => r === i) => {
657
+ let r = t;
658
+ const i = new ee(() => {
648
659
  try {
649
- const i = this.get();
650
- return r = e(i) ?? r;
651
- } catch (i) {
652
- throw console.error("Error in Signal.filterMap:", i), i;
660
+ const o = this.get();
661
+ return r = e(o) ?? r;
662
+ } catch (o) {
663
+ throw console.error("Error in Signal.filterMap:", o), o;
653
664
  }
654
665
  }, n);
655
- return this.setDerivative(o), o;
666
+ return this.setDerivative(i), i;
656
667
  };
657
668
  /**
658
669
  * Maps the values emitted by the signal to a new value asynchronously using the provided function.
@@ -667,25 +678,89 @@ class y {
667
678
  * @param equals - The equality function to compare the mapped values for equality.
668
679
  * @returns A property that holds the mapped value and can be observed for changes.
669
680
  */
670
- mapAsync = (e, s, n, r = (o, i) => o === i) => {
671
- const o = D(s, r);
672
- let i = 0, l = new AbortController();
673
- return o.onDispose(
674
- this.on(async (a) => {
675
- const c = ++i;
681
+ mapAsync = (e, t, n, r = (i, o) => i === o) => {
682
+ const i = B(t, r);
683
+ let o = 0, l = new AbortController();
684
+ return i.onDispose(
685
+ this.on(async (f) => {
686
+ const d = ++o;
676
687
  l.abort(), l = new AbortController();
677
688
  try {
678
- const u = await e(a, { abortSignal: l.signal });
679
- c === i && o.set(u);
680
- } catch (u) {
681
- if (c === i)
689
+ const v = await e(f, { abortSignal: l.signal });
690
+ d === o && i.set(v);
691
+ } catch (v) {
692
+ if (d === o)
693
+ if (n != null)
694
+ i.set(n(v));
695
+ else
696
+ throw v;
697
+ }
698
+ })
699
+ ), i;
700
+ };
701
+ /**
702
+ * Maps the values emitted by the signal to multiple values over time using an async generator.
703
+ * Each time the source signal changes, a new async generator is created and iterated.
704
+ * Previous generators are aborted when a new value arrives.
705
+ *
706
+ * This is useful for streaming data, such as:
707
+ * - AI/LLM streaming responses
708
+ * - Server-Sent Events (SSE)
709
+ * - Paginated data loading
710
+ * - WebSocket message streams
711
+ *
712
+ * @example
713
+ * ```typescript
714
+ * const query = prop('hello')
715
+ *
716
+ * // Stream AI response tokens
717
+ * const streamingResponse = query.mapAsyncGenerator(
718
+ * async function* (q, { abortSignal }) {
719
+ * const response = await fetch('/api/stream?q=' + q, { signal: abortSignal })
720
+ * const reader = response.body!.getReader()
721
+ * let accumulated = ''
722
+ *
723
+ * while (true) {
724
+ * const { done, value } = await reader.read()
725
+ * if (done) break
726
+ * accumulated += new TextDecoder().decode(value)
727
+ * yield accumulated // Update signal with each chunk
728
+ * }
729
+ * },
730
+ * '', // alt: empty string while loading
731
+ * (err) => 'Error: ' + err // recover
732
+ * )
733
+ * ```
734
+ *
735
+ * @typeParam O - The type of the yielded values.
736
+ * @param fn - The async generator function that yields values over time. The second argument provides an AbortSignal to cancel the generator when a new value arrives.
737
+ * @param alt - The initial value to use before the first yield.
738
+ * @param recover - Optional function to handle errors thrown by the generator.
739
+ * @param equals - Optional equality function to compare yielded values.
740
+ * @returns A property that updates each time the generator yields a value.
741
+ */
742
+ mapAsyncGenerator = (e, t, n, r = (i, o) => i === o) => {
743
+ const i = B(t, r);
744
+ let o = 0, l = new AbortController();
745
+ return i.onDispose(
746
+ this.on(async (f) => {
747
+ const d = ++o;
748
+ l.abort(), l = new AbortController();
749
+ try {
750
+ const v = e(f, { abortSignal: l.signal });
751
+ for await (const S of v) {
752
+ if (d !== o) return;
753
+ i.set(S);
754
+ }
755
+ } catch (v) {
756
+ if (d === o)
682
757
  if (n != null)
683
- o.set(n(u));
758
+ i.set(n(v));
684
759
  else
685
- throw u;
760
+ throw v;
686
761
  }
687
762
  })
688
- ), o;
763
+ ), i;
689
764
  };
690
765
  /**
691
766
  * Maps the values of the signal using the provided function `fn`, and returns a new signal
@@ -697,16 +772,16 @@ class y {
697
772
  * @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
698
773
  * @returns A new signal containing the mapped values.
699
774
  */
700
- mapMaybe = (e, s) => this.map((n) => e(n) ?? s);
775
+ mapMaybe = (e, t) => this.map((n) => e(n) ?? t);
701
776
  /**
702
777
  * Feeds a property into the signal and sets up disposal behavior.
703
778
  * @param prop - The property to feed into the signal.
704
779
  * @param autoDisposeProp - Determines whether the property should be automatically disposed when the signal is disposed.
705
780
  * @returns The input property.
706
781
  */
707
- feedProp = (e, s = !1) => {
708
- const n = this.on(e.set, { noAutoDispose: !s });
709
- return e.onDispose(n), s ? this.onDispose(e.dispose) : this.onDispose(n), e;
782
+ feedProp = (e, t = !1) => {
783
+ const n = this.on(e.set, { noAutoDispose: !t });
784
+ return e.onDispose(n), t ? this.onDispose(e.dispose) : this.onDispose(n), e;
710
785
  };
711
786
  /**
712
787
  * Derives a new property from the current signal.
@@ -717,8 +792,8 @@ class y {
717
792
  */
718
793
  deriveProp = ({
719
794
  autoDisposeProp: e = !0,
720
- equals: s
721
- } = {}) => this.feedProp(D(this.get(), s), e);
795
+ equals: t
796
+ } = {}) => this.feedProp(B(this.get(), t), e);
722
797
  /**
723
798
  * Derives a new signal from the current signal. Useful to create a new signal that emits the same values as the current signal but can be disposed independently.
724
799
  * @returns A new signal that emits the same values as the current signal.
@@ -747,8 +822,8 @@ class y {
747
822
  }), e.onDispose(this.on(e.setDirty, { noAutoDispose: !0 })), this.onDispose(e.dispose);
748
823
  };
749
824
  }
750
- const st = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
751
- class R extends y {
825
+ const ut = typeof queueMicrotask == "function" ? queueMicrotask : (s) => Promise.resolve().then(s);
826
+ class ee extends _ {
752
827
  /**
753
828
  * Creates a new Computed signal.
754
829
  *
@@ -773,8 +848,8 @@ class R extends y {
773
848
  * @see {@link getCurrentScope} - Get the current disposal scope
774
849
  * @see {@link untracked} - Create signals outside of scope tracking
775
850
  */
776
- constructor(e, s) {
777
- super(void 0, s), this._fn = e, this.setDirty(), pe()?.track(this);
851
+ constructor(e, t) {
852
+ super(void 0, t), this._fn = e, this.setDirty(), Oe()?.track(this);
778
853
  }
779
854
  /**
780
855
  * Checks if a value is an instance of `Computed`.
@@ -812,7 +887,7 @@ class R extends y {
812
887
  */
813
888
  _scheduleNotify = () => {
814
889
  const e = ++this._scheduleCount;
815
- st(() => {
890
+ ut(() => {
816
891
  this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
817
892
  });
818
893
  };
@@ -831,7 +906,7 @@ class R extends y {
831
906
  this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
832
907
  };
833
908
  }
834
- class se extends y {
909
+ class we extends _ {
835
910
  /**
836
911
  * Checks if a value is a Prop.
837
912
  * @param value - The value to check.
@@ -866,15 +941,15 @@ class se extends y {
866
941
  * @param effects - An array of effects to be executed after the state is updated.
867
942
  * @returns A dispatch function that can be used to update the state and trigger the effects.
868
943
  */
869
- reducer = (e, ...s) => {
944
+ reducer = (e, ...t) => {
870
945
  const n = this;
871
- return function r(o) {
872
- const i = n.value;
873
- n.update((l) => e(l, o)), !n.equals(i, n.value) && s.forEach(
946
+ return function r(i) {
947
+ const o = n.value;
948
+ n.update((l) => e(l, i)), !n.equals(o, n.value) && t.forEach(
874
949
  (l) => l({
875
- previousState: i,
950
+ previousState: o,
876
951
  state: n.value,
877
- action: o,
952
+ action: i,
878
953
  dispatch: r
879
954
  })
880
955
  );
@@ -891,9 +966,9 @@ class se extends y {
891
966
  * Defaults to a strict equality check (===).
892
967
  * @returns A Prop object representing the isomorphism.
893
968
  */
894
- iso = (e, s, n = (r, o) => r === o) => {
895
- const r = new se(e(this.get()), n);
896
- return r.onDispose(this.on((o) => r.set(e(o)))), r.on((o) => this._setAndNotify(s(o))), r;
969
+ iso = (e, t, n = (r, i) => r === i) => {
970
+ const r = new we(e(this.get()), n);
971
+ return r.onDispose(this.on((i) => r.set(e(i)))), r.on((i) => this._setAndNotify(t(i))), r;
897
972
  };
898
973
  /**
899
974
  * Returns a `Prop` that represents the value at the specified key of the current value.
@@ -902,8 +977,8 @@ class se extends y {
902
977
  * @returns A `Prop` that represents the value at the specified key.
903
978
  */
904
979
  atProp = (e) => this.iso(
905
- (s) => s[e],
906
- (s) => ({ ...this.value, [e]: s })
980
+ (t) => t[e],
981
+ (t) => ({ ...this.value, [e]: t })
907
982
  );
908
983
  /**
909
984
  * Access for the current value of the property.
@@ -915,42 +990,42 @@ class se extends y {
915
990
  this._setAndNotify(e);
916
991
  }
917
992
  }
918
- const ne = (t, e, s = (n, r) => n === r) => {
919
- const n = new R(t, s);
993
+ const be = (s, e, t = (n, r) => n === r) => {
994
+ const n = new ee(s, t);
920
995
  return e.forEach((r) => r.setDerivative(n)), n;
921
- }, Ae = (t, e, s = {}) => {
922
- let n = s.once ? () => {
923
- o(), t();
924
- } : t;
925
- if (s.skipInitial) {
926
- let i = !1;
996
+ }, $e = (s, e, t = {}) => {
997
+ let n = t.once ? () => {
998
+ i(), s();
999
+ } : s;
1000
+ if (t.skipInitial) {
1001
+ let o = !1;
927
1002
  const l = n;
928
1003
  n = () => {
929
- i ? l() : i = !0;
1004
+ o ? l() : o = !0;
930
1005
  };
931
1006
  }
932
- const r = ne(n, e), o = () => {
933
- r.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", o);
934
- };
935
- return s.abortSignal != null && s.abortSignal.addEventListener("abort", o), o;
936
- }, D = (t, e = (s, n) => s === n) => {
937
- const s = new se(t, e);
938
- return pe()?.track(s), s;
939
- }, re = (t, e = (s, n) => s === n) => new y(t, e), oe = () => (
1007
+ const r = be(n, e), i = () => {
1008
+ r.dispose(), t.abortSignal != null && t.abortSignal.removeEventListener("abort", i);
1009
+ };
1010
+ return t.abortSignal != null && t.abortSignal.addEventListener("abort", i), i;
1011
+ }, B = (s, e = (t, n) => t === n) => {
1012
+ const t = new we(s, e);
1013
+ return Oe()?.track(t), t;
1014
+ }, ye = (s, e = (t, n) => t === n) => new _(s, e), Se = () => (
940
1015
  /* c8 ignore next */
941
1016
  typeof window < "u" ? window : void 0
942
- ), nt = (t, e, s) => t + (e - t) * s, ve = 97, rt = (t, e, s) => {
943
- const n = Math.max(t.length, e.length);
1017
+ ), ht = (s, e, t) => s + (e - s) * t, Pe = 97, dt = (s, e, t) => {
1018
+ const n = Math.max(s.length, e.length);
944
1019
  let r = "";
945
- for (let o = 0; o < n; o++) {
946
- let i = t.charCodeAt(o);
947
- isNaN(i) && (i = ve);
948
- let l = e.charCodeAt(o);
949
- isNaN(l) && (l = ve), r += String.fromCharCode(i + (l - i) * s);
1020
+ for (let i = 0; i < n; i++) {
1021
+ let o = s.charCodeAt(i);
1022
+ isNaN(o) && (o = Pe);
1023
+ let l = e.charCodeAt(i);
1024
+ isNaN(l) && (l = Pe), r += String.fromCharCode(o + (l - o) * t);
950
1025
  }
951
1026
  return r;
952
- }, ot = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), it = (t, e) => e, lt = (t) => typeof t == "number" ? nt : typeof t == "string" ? rt : t instanceof Date ? ot : it;
953
- class Te {
1027
+ }, ft = (s, e, t) => new Date(s.getTime() + (e.getTime() - s.getTime()) * t), pt = (s, e) => e, mt = (s) => typeof s == "number" ? ht : typeof s == "string" ? dt : s instanceof Date ? ft : pt;
1028
+ class He {
954
1029
  _store = /* @__PURE__ */ new Map();
955
1030
  /**
956
1031
  * Retrieves the value associated with the specified key from the memory store.
@@ -963,228 +1038,228 @@ class Te {
963
1038
  * @param key - The key to set the value for.
964
1039
  * @param value - The value to set.
965
1040
  */
966
- setItem = (e, s) => {
967
- this._store.set(e, s);
1041
+ setItem = (e, t) => {
1042
+ this._store.set(e, t);
968
1043
  };
969
1044
  }
970
- let ue = null, he = null;
971
- const at = () => (ue || (ue = new Te()), ue), ct = () => (he || (he = new Te()), he), Ee = ({
972
- key: t,
1045
+ let _e = null, Ee = null;
1046
+ const gt = () => (_e || (_e = new He()), _e), yt = () => (Ee || (Ee = new He()), Ee), Ne = ({
1047
+ key: s,
973
1048
  defaultValue: e,
974
- store: s,
1049
+ store: t,
975
1050
  serialize: n = JSON.stringify,
976
1051
  deserialize: r = JSON.parse,
977
- equals: o = (c, u) => c === u,
978
- onLoad: i = (c) => c,
1052
+ equals: i = (d, v) => d === v,
1053
+ onLoad: o = (d) => d,
979
1054
  syncTabs: l = !0,
980
- onKeyChange: a = "load"
1055
+ onKeyChange: f = "load"
981
1056
  }) => {
982
- let c = w.get(t);
983
- const u = s.getItem(c), d = new se(
984
- u != null ? i(r(u)) : typeof e == "function" ? e() : e,
985
- o
986
- ), f = oe(), h = l && typeof f?.BroadcastChannel == "function";
987
- let p = !1, v = null, S = null;
988
- const b = (_) => {
989
- if (!h) return null;
990
- const I = `tempo:storedProp:${_}`, P = new f.BroadcastChannel(I), H = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, O = (Q) => {
991
- const C = Q.data;
992
- if (!(C == null || typeof C != "object" || C.key !== _ || typeof C.value != "string" || C.sourceId != null && C.sourceId === H))
1057
+ let d = C.get(s);
1058
+ const v = t.getItem(d), S = new we(
1059
+ v != null ? o(r(v)) : typeof e == "function" ? e() : e,
1060
+ i
1061
+ ), O = Se(), T = l && typeof O?.BroadcastChannel == "function";
1062
+ let A = !1, $ = null, M = null;
1063
+ const x = (k) => {
1064
+ if (!T) return null;
1065
+ const U = `tempo:storedProp:${k}`, V = new O.BroadcastChannel(U), q = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, F = (K) => {
1066
+ const H = K.data;
1067
+ if (!(H == null || typeof H != "object" || H.key !== k || typeof H.value != "string" || H.sourceId != null && H.sourceId === q))
993
1068
  try {
994
- p = !0;
995
- const ae = i(r(C.value));
996
- d.set(ae);
997
- } catch (ae) {
1069
+ A = !0;
1070
+ const re = o(r(H.value));
1071
+ S.set(re);
1072
+ } catch (re) {
998
1073
  console.warn(
999
- `Failed to sync storedProp for key "${_}" via BroadcastChannel`,
1000
- ae
1074
+ `Failed to sync storedProp for key "${k}" via BroadcastChannel`,
1075
+ re
1001
1076
  );
1002
1077
  } finally {
1003
- p = !1;
1078
+ A = !1;
1004
1079
  }
1005
1080
  };
1006
- return P.addEventListener("message", O), d.onDispose(() => {
1007
- P?.removeEventListener("message", O), P?.close();
1008
- }), { channel: P, instanceId: H, handleMessage: O };
1009
- }, L = b(c);
1010
- L && (v = L.channel, S = L.instanceId);
1011
- const X = (_) => {
1012
- const I = c;
1013
- if (I === _) return;
1014
- const P = d.get(), H = n(P);
1015
- if (s.setItem(I, H), v != null && (v.close(), v = null, S = null), c = _, a === "load") {
1016
- const Q = s.getItem(_);
1017
- if (Q != null)
1081
+ return V.addEventListener("message", F), S.onDispose(() => {
1082
+ V?.removeEventListener("message", F), V?.close();
1083
+ }), { channel: V, instanceId: q, handleMessage: F };
1084
+ }, R = x(d);
1085
+ R && ($ = R.channel, M = R.instanceId);
1086
+ const X = (k) => {
1087
+ const U = d;
1088
+ if (U === k) return;
1089
+ const V = S.get(), q = n(V);
1090
+ if (t.setItem(U, q), $ != null && ($.close(), $ = null, M = null), d = k, f === "load") {
1091
+ const K = t.getItem(k);
1092
+ if (K != null)
1018
1093
  try {
1019
- const C = i(r(Q));
1020
- d.set(C);
1021
- } catch (C) {
1094
+ const H = o(r(K));
1095
+ S.set(H);
1096
+ } catch (H) {
1022
1097
  console.warn(
1023
- `Failed to load storedProp from new key "${_}"`,
1024
- C
1098
+ `Failed to load storedProp from new key "${k}"`,
1099
+ H
1025
1100
  );
1026
1101
  }
1027
1102
  else
1028
- s.setItem(_, H);
1029
- } else a === "migrate" && s.setItem(_, H);
1030
- const O = b(_);
1031
- O && (v = O.channel, S = O.instanceId);
1032
- };
1033
- return y.is(t) && d.onDispose(t.on(X)), d.on((_, I) => {
1034
- const P = n(_);
1035
- s.setItem(c, P), v != null && !p && I !== void 0 && S != null && v.postMessage({
1036
- key: c,
1037
- value: P,
1038
- sourceId: S
1103
+ t.setItem(k, q);
1104
+ } else f === "migrate" && t.setItem(k, q);
1105
+ const F = x(k);
1106
+ F && ($ = F.channel, M = F.instanceId);
1107
+ };
1108
+ return _.is(s) && S.onDispose(s.on(X)), S.on((k, U) => {
1109
+ const V = n(k);
1110
+ t.setItem(d, V), $ != null && !A && U !== void 0 && M != null && $.postMessage({
1111
+ key: d,
1112
+ value: V,
1113
+ sourceId: M
1039
1114
  });
1040
- }), d;
1041
- }, ts = (t) => {
1042
- const e = oe()?.localStorage, s = e && typeof e.getItem == "function" ? e : at();
1043
- return Ee({
1044
- ...t,
1045
- store: s
1115
+ }), S;
1116
+ }, fs = (s) => {
1117
+ const e = Se()?.localStorage, t = e && typeof e.getItem == "function" ? e : gt();
1118
+ return Ne({
1119
+ ...s,
1120
+ store: t
1046
1121
  });
1047
- }, ss = (t) => {
1048
- const e = oe()?.sessionStorage, s = e && typeof e.getItem == "function" ? e : ct();
1049
- return Ee({
1050
- ...t,
1051
- store: s
1122
+ }, ps = (s) => {
1123
+ const e = Se()?.sessionStorage, t = e && typeof e.getItem == "function" ? e : yt();
1124
+ return Ne({
1125
+ ...s,
1126
+ store: t
1052
1127
  });
1053
1128
  };
1054
- function be(t) {
1055
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
1129
+ function Le(s) {
1130
+ return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
1056
1131
  }
1057
- const ut = (t, e, s, n) => {
1058
- const r = n?.duration ?? 300, o = n?.easing ?? ((b) => b), i = n?.equals ?? ((b, L) => b === L);
1059
- let l = n?.interpolate, a = t, c = e(), u = performance.now(), d = null, f = !0;
1060
- const h = new R(e, i), p = D(t, i);
1061
- p.onDispose(() => {
1062
- d !== null && cancelAnimationFrame(d);
1063
- }), p.onDispose(h.dispose), s.forEach((b) => {
1064
- b.setDerivative(h), b.onDispose(p.dispose);
1132
+ const vt = (s, e, t, n) => {
1133
+ const r = n?.duration ?? 300, i = n?.easing ?? ((x) => x), o = n?.equals ?? ((x, R) => x === R);
1134
+ let l = n?.interpolate, f = s, d = e(), v = performance.now(), S = null, O = !0;
1135
+ const T = new ee(e, o), A = B(s, o);
1136
+ A.onDispose(() => {
1137
+ S !== null && cancelAnimationFrame(S);
1138
+ }), A.onDispose(T.dispose), t.forEach((x) => {
1139
+ x.setDerivative(T), x.onDispose(A.dispose);
1065
1140
  });
1066
- const v = (b) => {
1067
- c = b, u = performance.now(), a = p.value, f && (f = !1, d = be(S));
1068
- }, S = () => {
1069
- const b = (performance.now() - u) / w.get(r), L = o(b);
1070
- l == null && (l = lt(a));
1071
- let X = l(a, c, L);
1072
- b >= 1 ? (f = !0, X = c) : d = be(S), p.set(X);
1073
- };
1074
- return h.on(v), p;
1075
- }, ns = (t, e) => {
1076
- const { initialValue: s, ...n } = e ?? {};
1077
- return ut(
1141
+ const $ = (x) => {
1142
+ d = x, v = performance.now(), f = A.value, O && (O = !1, S = Le(M));
1143
+ }, M = () => {
1144
+ const x = (performance.now() - v) / C.get(r), R = i(x);
1145
+ l == null && (l = mt(f));
1146
+ let X = l(f, d, R);
1147
+ x >= 1 ? (O = !0, X = d) : S = Le(M), A.set(X);
1148
+ };
1149
+ return T.on($), A;
1150
+ }, ms = (s, e) => {
1151
+ const { initialValue: t, ...n } = e ?? {};
1152
+ return vt(
1078
1153
  /* c8 ignore next 2 */
1079
- s ?? t.get(),
1080
- t.get,
1081
- [t],
1154
+ t ?? s.get(),
1155
+ s.get,
1156
+ [s],
1082
1157
  n
1083
1158
  );
1084
- }, ht = (t, e) => {
1085
- const s = Object.values(t).filter(y.is), n = Object.keys(t);
1086
- return ne(() => {
1159
+ }, wt = (s, e) => {
1160
+ const t = Object.values(s).filter(_.is), n = Object.keys(s);
1161
+ return be(() => {
1087
1162
  const r = {};
1088
- for (const o of n)
1089
- r[o] = w.get(t[o]);
1163
+ for (const i of n)
1164
+ r[i] = C.get(s[i]);
1090
1165
  return e(r);
1091
- }, s);
1092
- }, rs = (t) => ht(t, (e) => e), os = (t, e) => {
1093
- const s = D(t.get());
1166
+ }, t);
1167
+ }, gs = (s) => wt(s, (e) => e), ys = (s, e) => {
1168
+ const t = B(s.get());
1094
1169
  let n = null;
1095
- const r = t.on(
1096
- (o) => {
1170
+ const r = s.on(
1171
+ (i) => {
1097
1172
  n != null && clearTimeout(n), n = setTimeout(
1098
1173
  () => {
1099
- n = null, s.set(o);
1174
+ n = null, t.set(i);
1100
1175
  },
1101
- typeof e == "function" ? e(o) : e
1176
+ typeof e == "function" ? e(i) : e
1102
1177
  );
1103
1178
  },
1104
1179
  { noAutoDispose: !0 }
1105
1180
  );
1106
- return s.onDispose(() => {
1181
+ return t.onDispose(() => {
1107
1182
  r(), n != null && clearTimeout(n);
1108
- }), s;
1109
- }, is = (t) => {
1183
+ }), t;
1184
+ }, vs = (s) => {
1110
1185
  let e;
1111
- return t.map((s) => {
1186
+ return s.map((t) => {
1112
1187
  const n = e;
1113
- return e = s, n;
1188
+ return e = t, n;
1114
1189
  });
1115
- }, ls = ({
1116
- size: t = void 0,
1190
+ }, ws = ({
1191
+ size: s = void 0,
1117
1192
  signal: e
1118
1193
  }) => {
1119
- const s = [];
1120
- return e.map((n) => (s.push(n), t != null && s.length > t && s.shift(), s.slice()));
1121
- }, as = (t) => (...e) => J(
1122
- t,
1194
+ const t = [];
1195
+ return e.map((n) => (t.push(n), s != null && t.length > s && t.shift(), t.slice()));
1196
+ }, bs = (s) => (...e) => ne(
1197
+ s,
1123
1198
  ...e
1124
- )((s, ...n) => s(...n));
1125
- function cs(...t) {
1126
- return J(...t)((...e) => {
1127
- for (const s of e) if (s != null) return s;
1199
+ )((t, ...n) => t(...n));
1200
+ function Ss(...s) {
1201
+ return ne(...s)((...e) => {
1202
+ for (const t of e) if (t != null) return t;
1128
1203
  });
1129
1204
  }
1130
- const us = (t, {
1205
+ const Ts = (s, {
1131
1206
  channel: e,
1132
- serialize: s = JSON.stringify,
1207
+ serialize: t = JSON.stringify,
1133
1208
  deserialize: n = JSON.parse,
1134
- equals: r = (o, i) => o === i
1209
+ equals: r = (i, o) => i === o
1135
1210
  }) => {
1136
- const o = oe();
1137
- if (typeof o?.BroadcastChannel != "function")
1211
+ const i = Se();
1212
+ if (typeof i?.BroadcastChannel != "function")
1138
1213
  return () => {
1139
1214
  };
1140
- const i = new o.BroadcastChannel(
1215
+ const o = new i.BroadcastChannel(
1141
1216
  `tempo:syncProp:${e}`
1142
1217
  ), l = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
1143
- let a = !1;
1144
- const c = (f) => {
1145
- const h = f.data;
1146
- if (!(h == null || typeof h != "object" || typeof h.value != "string" || h.sourceId != null && h.sourceId === l))
1218
+ let f = !1;
1219
+ const d = (O) => {
1220
+ const T = O.data;
1221
+ if (!(T == null || typeof T != "object" || typeof T.value != "string" || T.sourceId != null && T.sourceId === l))
1147
1222
  try {
1148
- a = !0;
1149
- const p = n(h.value);
1150
- r(t.get(), p) || t.set(p);
1151
- } catch (p) {
1223
+ f = !0;
1224
+ const A = n(T.value);
1225
+ r(s.get(), A) || s.set(A);
1226
+ } catch (A) {
1152
1227
  console.warn(
1153
1228
  `Failed to sync prop for channel "${e}" via BroadcastChannel`,
1154
- p
1229
+ A
1155
1230
  );
1156
1231
  } finally {
1157
- a = !1;
1232
+ f = !1;
1158
1233
  }
1159
1234
  };
1160
- i.addEventListener("message", c);
1161
- const u = t.on((f, h) => {
1162
- if (!a && h !== void 0 && !r(f, h))
1235
+ o.addEventListener("message", d);
1236
+ const v = s.on((O, T) => {
1237
+ if (!f && T !== void 0 && !r(O, T))
1163
1238
  try {
1164
- const p = s(f);
1165
- i.postMessage({
1166
- value: p,
1239
+ const A = t(O);
1240
+ o.postMessage({
1241
+ value: A,
1167
1242
  sourceId: l
1168
1243
  });
1169
- } catch (p) {
1244
+ } catch (A) {
1170
1245
  console.warn(
1171
1246
  `Failed to serialize prop for channel "${e}" via BroadcastChannel`,
1172
- p
1247
+ A
1173
1248
  );
1174
1249
  }
1175
- }), d = () => {
1176
- u(), i.removeEventListener("message", c), i.close();
1250
+ }), S = () => {
1251
+ v(), o.removeEventListener("message", d), o.close();
1177
1252
  };
1178
- return t.onDispose(d), d;
1253
+ return s.onDispose(S), S;
1179
1254
  };
1180
- class de {
1255
+ class De {
1181
1256
  /**
1182
1257
  * Creates a new instance of `ElementPosition`.
1183
1258
  * @param index - The index of the element.
1184
1259
  * @param total - The total number of elements in the collection.
1185
1260
  */
1186
- constructor(e, s) {
1187
- this.index = e, this.total = s, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
1261
+ constructor(e, t) {
1262
+ this.index = e, this.total = t, this.counter = e + 1, this.isFirst = e === 0, this.isEven = e % 2 === 1, this.isOdd = e % 2 === 0;
1188
1263
  }
1189
1264
  /**
1190
1265
  * The counter of the element starting from 1.
@@ -1225,12 +1300,22 @@ class de {
1225
1300
  this.#e?.dispose(), this.#e = void 0;
1226
1301
  };
1227
1302
  }
1228
- const Ce = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), De = /* @__PURE__ */ new Set(["selected"]), xe = /* @__PURE__ */ new Set([
1303
+ const Re = /* @__PURE__ */ new Set([
1304
+ "checked",
1305
+ "disabled",
1306
+ "hidden",
1307
+ "multiple",
1308
+ "readonly",
1309
+ "required",
1310
+ "autofocus"
1311
+ ]), je = /* @__PURE__ */ new Set(["selected"]), Ve = /* @__PURE__ */ new Set([
1229
1312
  "rowSpan",
1230
1313
  "colSpan",
1231
1314
  "tabIndex",
1232
1315
  "valueAsNumber"
1233
- ]), Le = /* @__PURE__ */ new Set(["valueAsDate"]), Pe = /* @__PURE__ */ new Set([
1316
+ ]), Be = /* @__PURE__ */ new Set(["valueAsDate"]), qe = {
1317
+ readonly: "readOnly"
1318
+ }, Fe = /* @__PURE__ */ new Set([
1234
1319
  "value",
1235
1320
  "textContent",
1236
1321
  "innerText",
@@ -1239,28 +1324,391 @@ const Ce = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), De = /* @
1239
1324
  "outerHTML",
1240
1325
  "className",
1241
1326
  "classList"
1242
- ]), dt = (t, e) => De.has(t) ? (s) => {
1243
- s == null || s !== !0 ? e.removeAttribute(t) : e.setAttribute(t, "");
1244
- } : Ce.has(t) ? (s) => {
1245
- s == null ? e[t] = null : e[t] = !!s;
1246
- } : xe.has(t) ? (s) => {
1247
- s == null ? e[t] = null : e[t] = Number(s);
1248
- } : Le.has(t) ? (s) => {
1249
- s == null ? e[t] = null : e[t] = s;
1250
- } : Pe.has(t) ? (s) => {
1251
- s == null ? e[t] = null : e[t] = String(s);
1252
- } : (s) => {
1253
- s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
1254
- }, ft = (t, e) => De.has(t) ? () => e.hasAttribute(t) : Ce.has(t) ? () => !!e[t] : xe.has(t) ? () => Number(e[t]) : Le.has(t) ? () => e[t] : Pe.has(t) ? () => String(e[t]) : () => e.getAttribute(t), te = (t) => {
1255
- const e = t;
1256
- e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentNode && t.parentNode.removeChild(t);
1257
- }, pt = (t) => Oe(t) || ke(t) ? t : t.parentElement, Oe = (t) => t.nodeType === 1, ke = (t) => t.nodeType === 11;
1258
- class Me extends Error {
1327
+ ]), bt = (s, e) => {
1328
+ if (je.has(s))
1329
+ return (t) => {
1330
+ t == null || t !== !0 ? e.removeAttribute(s) : e.setAttribute(s, "");
1331
+ };
1332
+ if (Re.has(s)) {
1333
+ const t = qe[s] || s;
1334
+ return (n) => {
1335
+ n == null ? e[t] = null : e[t] = !!n;
1336
+ };
1337
+ } else return Ve.has(s) ? (t) => {
1338
+ t == null ? e[s] = null : e[s] = Number(t);
1339
+ } : Be.has(s) ? (t) => {
1340
+ t == null ? e[s] = null : e[s] = t;
1341
+ } : Fe.has(s) ? (t) => {
1342
+ t == null ? e[s] = null : e[s] = String(t);
1343
+ } : (t) => {
1344
+ t == null ? e.removeAttribute(s) : e.setAttribute(s, t);
1345
+ };
1346
+ }, St = (s, e) => je.has(s) ? () => e.hasAttribute(s) : Re.has(s) ? () => (
1347
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1348
+ !!e[qe[s] || s]
1349
+ ) : Ve.has(s) ? () => Number(e[s]) : Be.has(s) ? () => e[s] : Fe.has(s) ? () => String(e[s]) : () => e.getAttribute(s), ve = (s) => {
1350
+ const e = s;
1351
+ e && e.onblur && (e.onblur = null), !(!s || s.ownerDocument === void 0) && s.parentNode && s.parentNode.removeChild(s);
1352
+ }, Tt = (s) => We(s) || Ue(s) ? s : s.parentElement, We = (s) => s.nodeType === 1, Ue = (s) => s.nodeType === 11;
1353
+ class Je extends Error {
1259
1354
  constructor(e) {
1260
1355
  super(`Provider not found: ${e.description}`);
1261
1356
  }
1262
1357
  }
1263
- class j {
1358
+ function At(s) {
1359
+ const { create: e } = s, t = (a) => e((c) => c.makeChildText(a).clear), n = (a) => e((c) => {
1360
+ const h = c.makeChildText(a.value), u = a.on(h.setText);
1361
+ return (m) => {
1362
+ u(), h.clear(m);
1363
+ };
1364
+ }), r = (a, c, h) => _.is(a) ? c(a) : h(a), i = (a) => {
1365
+ if (a == null)
1366
+ return l;
1367
+ if (Array.isArray(a))
1368
+ return f(...a.map(i));
1369
+ if (typeof a == "string")
1370
+ return t(a);
1371
+ if (_.is(a))
1372
+ return n(a);
1373
+ if (typeof a == "object" && "render" in a && "type" in a)
1374
+ return a;
1375
+ throw new Error(`Unknown type: '${typeof a}' for child: ${a}`);
1376
+ }, o = (a, c, h) => {
1377
+ const u = a.makeRef();
1378
+ let m = () => {
1379
+ }, p = null;
1380
+ const b = c.on(
1381
+ (y) => {
1382
+ p?.dispose(), m(!0), p = new ie(), m = z(
1383
+ p,
1384
+ () => i(h(y)).render(u)
1385
+ );
1386
+ },
1387
+ { noAutoDispose: !0 }
1388
+ );
1389
+ return (y) => {
1390
+ p?.dispose(), m(y), b(), u.clear(y);
1391
+ };
1392
+ }, l = e(() => () => {
1393
+ }), f = (...a) => e((c) => {
1394
+ const h = a.map(
1395
+ (u) => i(u).render(c)
1396
+ );
1397
+ return (u) => {
1398
+ h.forEach((m) => m(u));
1399
+ };
1400
+ }), d = (a, c, h) => r(
1401
+ a,
1402
+ (u) => e(
1403
+ (m) => o(
1404
+ m,
1405
+ u,
1406
+ (p) => p ? c() : h?.()
1407
+ )
1408
+ ),
1409
+ (u) => {
1410
+ if (u) {
1411
+ const m = c();
1412
+ return m != null ? i(m) : l;
1413
+ }
1414
+ return i(h?.());
1415
+ }
1416
+ ), v = (a, c, h) => d(
1417
+ C.map(a, (u) => !u),
1418
+ c,
1419
+ h
1420
+ ), S = (a, c, h) => {
1421
+ if (h != null)
1422
+ return S(a, (u) => {
1423
+ const m = new De(
1424
+ u.index,
1425
+ u.total.map((p) => p - 1)
1426
+ );
1427
+ return f(
1428
+ i(c(u)),
1429
+ d(
1430
+ u.isLast,
1431
+ () => l,
1432
+ () => h(m)
1433
+ )
1434
+ );
1435
+ });
1436
+ if (_.is(a))
1437
+ return e((u) => {
1438
+ const m = a.derive(), p = u.makeRef(), b = [], y = [];
1439
+ return m.on((w) => {
1440
+ const E = b.splice(w), D = y.splice(w);
1441
+ for (const I of D)
1442
+ I.dispose();
1443
+ for (const I of E)
1444
+ I(!0);
1445
+ for (let I = b.length; I < w; I++) {
1446
+ const g = new De(I, m), P = new ie();
1447
+ y.push(P), b.push(
1448
+ z(
1449
+ P,
1450
+ () => i(c(g)).render(p)
1451
+ )
1452
+ );
1453
+ }
1454
+ }), (w) => {
1455
+ for (const E of y)
1456
+ E.dispose();
1457
+ y.length = 0, m.dispose();
1458
+ for (const E of b)
1459
+ E(w);
1460
+ b.length = 0, p.clear(w);
1461
+ };
1462
+ });
1463
+ {
1464
+ const u = ye(a);
1465
+ return f(
1466
+ ...Array.from({ length: a }, (m, p) => p).map((m) => {
1467
+ const p = new De(m, u);
1468
+ return i(c(p));
1469
+ })
1470
+ );
1471
+ }
1472
+ }, O = (a, c, h) => {
1473
+ const u = C.map(a, (p) => p.length), m = C.toSignal(a);
1474
+ return S(
1475
+ u,
1476
+ (p) => {
1477
+ const b = m.map((y) => y[p.index]);
1478
+ return i(c(b, p));
1479
+ },
1480
+ h
1481
+ );
1482
+ }, T = (a, c) => {
1483
+ function h(m) {
1484
+ return e((p) => {
1485
+ const b = p.makeRef();
1486
+ let y, w;
1487
+ const E = m.map((g) => Object.keys(g)[0]);
1488
+ let D;
1489
+ const I = E.on((g) => {
1490
+ if (g !== D) {
1491
+ D = g, w?.dispose(), y?.(!0), w = m.map((G) => G[g]);
1492
+ const P = c[g](w);
1493
+ y = i(P).render(b);
1494
+ }
1495
+ });
1496
+ return (g) => {
1497
+ w?.dispose(), I(), b.clear(g), y?.(g);
1498
+ };
1499
+ });
1500
+ }
1501
+ function u(m) {
1502
+ const p = Object.keys(m)[0];
1503
+ return i(c[p](ye(m[p])));
1504
+ }
1505
+ return r(a, h, u);
1506
+ }, A = (a, c, h) => T(
1507
+ C.map(a, (u) => ({ [u[c]]: u })),
1508
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1509
+ h
1510
+ ), $ = (a, c) => A(a, "kind", c), M = (a, c) => A(a, "type", c), x = (a, c) => {
1511
+ const h = C.map(a, ([u, m]) => ({
1512
+ [u]: m
1513
+ }));
1514
+ return T(h, c);
1515
+ }, R = (a, c) => T(
1516
+ C.map(a, (h) => ({ [h]: !0 })),
1517
+ c
1518
+ ), X = (a, c) => {
1519
+ if (_.is(a)) {
1520
+ const h = a;
1521
+ return e((u) => {
1522
+ const m = u.makeRef(), p = h.map((w) => i(c(w)));
1523
+ let b = () => {
1524
+ };
1525
+ const y = p.on((w) => {
1526
+ b(!0), b = w.render(m);
1527
+ });
1528
+ return (w) => {
1529
+ y(), b(w);
1530
+ };
1531
+ });
1532
+ }
1533
+ return i(c(a));
1534
+ }, k = (a, c, h) => {
1535
+ function u(p) {
1536
+ return e((b) => {
1537
+ const y = b.makeRef();
1538
+ let w = () => {
1539
+ }, E = !1, D = null;
1540
+ const I = p.on((g) => {
1541
+ g == null ? (w(!0), w = i(h?.()).render(y), E = !1, D?.dispose(), D = null) : E ? D.set(g) : (D = B(g), w(!0), w = i(
1542
+ c(D)
1543
+ ).render(y), E = !0);
1544
+ });
1545
+ return (g) => {
1546
+ D?.dispose(), I(), w?.(g), y.clear(g);
1547
+ };
1548
+ });
1549
+ }
1550
+ function m(p) {
1551
+ if (p == null) {
1552
+ const b = h?.();
1553
+ return b != null ? i(b) : l;
1554
+ }
1555
+ return i(c(ye(p)));
1556
+ }
1557
+ return r(
1558
+ a,
1559
+ u,
1560
+ m
1561
+ );
1562
+ }, U = (...a) => (c, h) => e((u) => {
1563
+ const m = u.makeRef();
1564
+ if (a.some(
1565
+ (g) => !_.is(g) && g == null
1566
+ ))
1567
+ return (h != null ? i(h?.()) : l).render(m);
1568
+ const p = a.map(
1569
+ () => null
1570
+ ), b = a.map(
1571
+ (g) => _.is(g) ? g.value != null : g != null
1572
+ );
1573
+ let y = null;
1574
+ const w = B(b.every((g) => g)), E = (g, P) => {
1575
+ if (g.value != null) {
1576
+ if (p[P] == null) {
1577
+ const G = B(g.value);
1578
+ p[P] = G;
1579
+ } else
1580
+ p[P].value = g.value;
1581
+ b[P] = !0;
1582
+ } else
1583
+ b[P] = !1;
1584
+ };
1585
+ let D = a.length - 1;
1586
+ const I = a.map((g, P) => {
1587
+ if (!_.is(g)) {
1588
+ const G = B(g);
1589
+ return p[P] = G, () => {
1590
+ };
1591
+ }
1592
+ return g.on(() => {
1593
+ E(g, P), D === 0 ? w.value = b.every((G) => G) : D--;
1594
+ });
1595
+ });
1596
+ return w.on((g) => {
1597
+ y?.(!0), y = null, g ? y = i(c(...p)).render(
1598
+ m
1599
+ ) : y = i(h?.() ?? l).render(m);
1600
+ }), (g) => {
1601
+ p.forEach((P) => P?.dispose()), w.dispose(), I.forEach((P) => P()), y?.(g), m.clear(g);
1602
+ };
1603
+ }), V = (a, c, h = () => l) => T(
1604
+ C.map(
1605
+ a,
1606
+ (u) => u.length > 0 ? { notEmpty: u } : { whenEmpty: null }
1607
+ ),
1608
+ {
1609
+ notEmpty: (u) => c(u),
1610
+ whenEmpty: () => h()
1611
+ }
1612
+ ), q = (a, c) => {
1613
+ if (typeof c == "function")
1614
+ return q(a, { then: c });
1615
+ const h = c.pending != null ? i(c.pending()) : l, u = c.then, m = c.error != null ? (p) => i(c.error(p)) : () => l;
1616
+ return e((p) => {
1617
+ let b = !0;
1618
+ const y = a(), w = p.makeRef();
1619
+ let E = i(h).render(w);
1620
+ return y.then(
1621
+ (D) => {
1622
+ b && (E(!0), E = i(u(D)).render(w));
1623
+ },
1624
+ (D) => {
1625
+ b && (E(!0), E = i(m(D)).render(w));
1626
+ }
1627
+ ), (D) => {
1628
+ b = !1, E(D), w.clear(D);
1629
+ };
1630
+ });
1631
+ }, F = (a, c) => q(() => a, c), K = (...a) => e(
1632
+ (c) => (h) => a.forEach((u) => {
1633
+ typeof u == "function" ? u(h, c) : u.dispose(h, c);
1634
+ })
1635
+ ), H = (a, c = {}) => (h) => {
1636
+ const u = c?.firstSeparator ?? a, m = c?.lastSeparator ?? a;
1637
+ return R(
1638
+ h.map((p) => p.isFirst ? "first" : p.isLast ? "last" : "other"),
1639
+ {
1640
+ first: u,
1641
+ last: m,
1642
+ other: a
1643
+ }
1644
+ );
1645
+ }, re = (a) => e((c) => {
1646
+ const h = new ie(), u = z(
1647
+ h,
1648
+ () => i(a(h)).render(c)
1649
+ );
1650
+ return (m) => {
1651
+ h.dispose(), u(m);
1652
+ };
1653
+ }), pe = (a) => e((c) => {
1654
+ let h = c;
1655
+ function u() {
1656
+ return h;
1657
+ }
1658
+ function m(y) {
1659
+ h = y;
1660
+ }
1661
+ const p = [], b = a({
1662
+ use: ({ mark: y }) => {
1663
+ const { value: w, onUse: E } = u().getProvider(y);
1664
+ return E?.(), w;
1665
+ },
1666
+ set: ({ mark: y, create: w }, E) => {
1667
+ const { value: D, dispose: I, onUse: g } = w(E, u());
1668
+ p.push(I), m(u().setProvider(y, D, g));
1669
+ }
1670
+ });
1671
+ return b == null ? () => {
1672
+ } : f(
1673
+ i(b),
1674
+ K(() => p.forEach((y) => y()))
1675
+ ).render(u());
1676
+ });
1677
+ return {
1678
+ Empty: l,
1679
+ Fragment: f,
1680
+ When: d,
1681
+ Unless: v,
1682
+ ForEach: O,
1683
+ Repeat: S,
1684
+ OneOf: T,
1685
+ OneOfField: A,
1686
+ OneOfKind: $,
1687
+ OneOfType: M,
1688
+ OneOfValue: R,
1689
+ OneOfTuple: x,
1690
+ MapSignal: X,
1691
+ Ensure: k,
1692
+ EnsureAll: U,
1693
+ NotEmpty: V,
1694
+ Task: q,
1695
+ Async: F,
1696
+ OnDispose: K,
1697
+ Conjunction: H,
1698
+ WithScope: re,
1699
+ WithProvider: pe,
1700
+ Provide: (a, c, h) => pe(({ set: u }) => (u(a, c), h())),
1701
+ Use: (a, c) => pe(({ use: h }) => c(h(a))),
1702
+ UseMany: (...a) => (c) => pe(({ use: h }) => {
1703
+ const u = a.map(h);
1704
+ return c(...u);
1705
+ }),
1706
+ handleValueOrSignal: r,
1707
+ createReactiveRenderable: o,
1708
+ renderableOfTNode: i
1709
+ };
1710
+ }
1711
+ class te {
1264
1712
  /**
1265
1713
  * Constructs a new `DOMContext` instance.
1266
1714
  *
@@ -1270,8 +1718,8 @@ class j {
1270
1718
  * @param providers - The `Providers` instance associated with this context.
1271
1719
  * @param isFirstLevel - A boolean value indicating whether this context is at the first level, meaning the outermost node in the generated DOM.
1272
1720
  */
1273
- constructor(e, s, n, r) {
1274
- this.document = e, this.element = s, this.reference = n, this.providers = r;
1721
+ constructor(e, t, n, r) {
1722
+ this.document = e, this.element = t, this.reference = n, this.providers = r;
1275
1723
  }
1276
1724
  /**
1277
1725
  * Creates a new `DOMContext` instance for the given `Element` and optional reference `Node`.
@@ -1281,8 +1729,8 @@ class j {
1281
1729
  * @param providers - The providers to associate with the `DOMContext`.
1282
1730
  * @returns A new `DOMContext` instance.
1283
1731
  */
1284
- static of(e, s, n) {
1285
- return new j(e.ownerDocument, e, s, n);
1732
+ static of(e, t, n) {
1733
+ return new te(e.ownerDocument, e, t, n);
1286
1734
  }
1287
1735
  /**
1288
1736
  * Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
@@ -1291,7 +1739,7 @@ class j {
1291
1739
  * @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
1292
1740
  * @returns The newly created element.
1293
1741
  */
1294
- createElement = (e, s) => s !== void 0 ? this.document.createElementNS(s, e) : this.document.createElement(e);
1742
+ createElement = (e, t) => t !== void 0 ? this.document.createElementNS(t, e) : this.document.createElement(e);
1295
1743
  /**
1296
1744
  * Creates a new child element and appends it to the current element, returning a new context.
1297
1745
  *
@@ -1314,8 +1762,8 @@ class j {
1314
1762
  * @param namespace - The namespace URI for the element, or undefined for HTML elements
1315
1763
  * @returns A new DOMContext focused on the newly created child element
1316
1764
  */
1317
- makeChildElement = (e, s) => {
1318
- const n = this.createElement(e, s);
1765
+ makeChildElement = (e, t) => {
1766
+ const n = this.createElement(e, t);
1319
1767
  return this.appendOrInsert(n), this.withElement(n);
1320
1768
  };
1321
1769
  /**
@@ -1330,8 +1778,8 @@ class j {
1330
1778
  * @returns A new `DOMContext` with a reference to the new text node.
1331
1779
  */
1332
1780
  makeChildText = (e) => {
1333
- const s = this.createText(e);
1334
- return this.appendOrInsert(s), this.withReference(s);
1781
+ const t = this.createText(e);
1782
+ return this.appendOrInsert(t), this.withReference(t);
1335
1783
  };
1336
1784
  /**
1337
1785
  * Sets the text content of the current element.
@@ -1367,7 +1815,7 @@ class j {
1367
1815
  * @param element - The DOM element to use in the new `DOMContext` instance.
1368
1816
  * @returns A new `DOMContext` instance with the provided `element`.
1369
1817
  */
1370
- withElement = (e) => new j(
1818
+ withElement = (e) => new te(
1371
1819
  e.ownerDocument ?? this.document,
1372
1820
  e,
1373
1821
  void 0,
@@ -1418,10 +1866,10 @@ class j {
1418
1866
  * @throws {Error} When the selector doesn't match any element in the document
1419
1867
  */
1420
1868
  makePortal = (e) => {
1421
- const s = typeof e == "string" ? this.document.querySelector(e) : e;
1422
- if (s == null)
1869
+ const t = typeof e == "string" ? this.document.querySelector(e) : e;
1870
+ if (t == null)
1423
1871
  throw new Error(`Cannot find element by selector for portal: ${e}`);
1424
- return this.withElement(s);
1872
+ return this.withElement(t);
1425
1873
  };
1426
1874
  /**
1427
1875
  * Creates a new `DOMContext` instance with the specified reference.
@@ -1429,7 +1877,7 @@ class j {
1429
1877
  * @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
1430
1878
  * @returns A new `DOMContext` instance with the specified reference.
1431
1879
  */
1432
- withReference = (e) => new j(this.document, this.element, e, this.providers);
1880
+ withReference = (e) => new te(this.document, this.element, e, this.providers);
1433
1881
  /**
1434
1882
  * Sets a provider for the given provider mark.
1435
1883
  *
@@ -1437,9 +1885,9 @@ class j {
1437
1885
  * @param value - The provider to set for the given mark.
1438
1886
  * @returns A new `DOMContext` instance with the specified provider.
1439
1887
  */
1440
- setProvider = (e, s, n) => new j(this.document, this.element, this.reference, {
1888
+ setProvider = (e, t, n) => new te(this.document, this.element, this.reference, {
1441
1889
  ...this.providers,
1442
- [e]: [s, n]
1890
+ [e]: [t, n]
1443
1891
  });
1444
1892
  /**
1445
1893
  * Retrieves a provider for the given provider mark.
@@ -1450,12 +1898,12 @@ class j {
1450
1898
  */
1451
1899
  getProvider = (e) => {
1452
1900
  if (this.providers[e] === void 0)
1453
- throw new Me(e);
1454
- const [s, n] = this.providers[e];
1455
- return { value: s, onUse: n };
1901
+ throw new Je(e);
1902
+ const [t, n] = this.providers[e];
1903
+ return { value: t, onUse: n };
1456
1904
  };
1457
1905
  clear = (e) => {
1458
- e && (this.reference !== void 0 ? te(this.reference) : te(this.element));
1906
+ e && (this.reference !== void 0 ? ve(this.reference) : ve(this.element));
1459
1907
  };
1460
1908
  /**
1461
1909
  * Adds classes to the element.
@@ -1483,10 +1931,10 @@ class j {
1483
1931
  * @param options - The options for the event listener.
1484
1932
  * @returns A function to remove the event listener.
1485
1933
  */
1486
- on = (e, s, n) => {
1487
- const r = (o) => s(o, this);
1488
- return this.element.addEventListener(e, r, n), (o) => {
1489
- o && this.element.removeEventListener(e, r, n);
1934
+ on = (e, t, n) => {
1935
+ const r = (i) => t(i, this);
1936
+ return this.element.addEventListener(e, r, n), (i) => {
1937
+ i && this.element.removeEventListener(e, r, n);
1490
1938
  };
1491
1939
  };
1492
1940
  /**
@@ -1515,8 +1963,8 @@ class j {
1515
1963
  * @param name - The name of the style to set.
1516
1964
  * @param value - The value of the style to set.
1517
1965
  */
1518
- setStyle = (e, s) => {
1519
- this.element.style[e] = s;
1966
+ setStyle = (e, t) => {
1967
+ this.element.style[e] = t;
1520
1968
  };
1521
1969
  /**
1522
1970
  * Gets the style of the element.
@@ -1525,57 +1973,57 @@ class j {
1525
1973
  */
1526
1974
  getStyle = (e) => this.element.style[e];
1527
1975
  makeAccessors = (e) => ({
1528
- get: ft(e, this.element),
1529
- set: dt(e, this.element)
1976
+ get: St(e, this.element),
1977
+ set: bt(e, this.element)
1530
1978
  });
1531
1979
  getWindow = () => this.document.defaultView;
1532
1980
  }
1533
- const G = (t, e) => {
1534
- const s = new z(), n = k(s, () => t.render(e));
1981
+ const he = (s, e) => {
1982
+ const t = new ie(), n = z(t, () => s.render(e));
1535
1983
  return (r = !0) => {
1536
- s.dispose(), n(r);
1984
+ t.dispose(), n(r);
1537
1985
  };
1538
- }, hs = (t, e, { doc: s, clear: n, disposeWithParent: r = !0, providers: o = {} } = {}) => {
1539
- const i = typeof e == "string" ? (s ?? document).querySelector(e) : e;
1540
- if (i === null)
1541
- throw new gt(
1986
+ }, As = (s, e, { doc: t, clear: n, disposeWithParent: r = !0, providers: i = {} } = {}) => {
1987
+ const o = typeof e == "string" ? (t ?? document).querySelector(e) : e;
1988
+ if (o === null)
1989
+ throw new _t(
1542
1990
  `Cannot find element by selector for render: ${e}`
1543
1991
  );
1544
- n !== !1 && (s ?? i.ownerDocument) != null && (i.nodeType === 1 || i.nodeType === 11) && (i.innerHTML = "");
1545
- const l = pt(i), a = Oe(i) || ke(i) ? void 0 : i, c = j.of(l, a, o), u = G(t, c);
1546
- let d;
1547
- return r && i.parentElement != null && (d = new MutationObserver((f) => {
1548
- f[0]?.removedNodes.forEach((h) => {
1549
- h === i && (d?.disconnect(), u(i.nodeType !== 1));
1992
+ n !== !1 && (t ?? o.ownerDocument) != null && (o.nodeType === 1 || o.nodeType === 11) && (o.innerHTML = "");
1993
+ const l = Tt(o), f = We(o) || Ue(o) ? void 0 : o, d = te.of(l, f, i), v = he(s, d);
1994
+ let S;
1995
+ return r && o.parentElement != null && (S = new MutationObserver((O) => {
1996
+ O[0]?.removedNodes.forEach((T) => {
1997
+ T === o && (S?.disconnect(), v(o.nodeType !== 1));
1550
1998
  });
1551
- }), d.observe(i.parentElement, {
1999
+ }), S.observe(o.parentElement, {
1552
2000
  childList: !0,
1553
2001
  subtree: !1,
1554
2002
  attributes: !1
1555
2003
  })), () => {
1556
- d?.disconnect(), u(!0);
2004
+ S?.disconnect(), v(!0);
1557
2005
  };
1558
- }, ds = (t, {
2006
+ }, _s = (s, {
1559
2007
  startUrl: e = "https://example.com",
1560
- selector: s,
2008
+ selector: t,
1561
2009
  providers: n = {}
1562
2010
  } = {
1563
2011
  selector: "body"
1564
2012
  }) => {
1565
- const r = w.toSignal(e).deriveProp(), o = new $e(s, void 0), i = new V(o, void 0, { currentURL: r }, n);
2013
+ const r = C.toSignal(e).deriveProp(), i = new Ye(t, void 0), o = new se(i, void 0, { currentURL: r }, n);
1566
2014
  return {
1567
- clear: G(t(), i),
1568
- root: o,
2015
+ clear: he(s(), o),
2016
+ root: i,
1569
2017
  currentURL: r
1570
2018
  };
1571
2019
  };
1572
- class gt extends Error {
2020
+ class _t extends Error {
1573
2021
  constructor(e) {
1574
2022
  super(e);
1575
2023
  }
1576
2024
  }
1577
- const fe = "data-tts-node", B = "data-tts-class", q = "data-tts-style", F = "data-tts-html", W = "data-tts-text", U = "data-tts-attrs";
1578
- class fs {
2025
+ const Ce = "data-tts-node", oe = "data-tts-class", le = "data-tts-style", ae = "data-tts-html", ce = "data-tts-text", ue = "data-tts-attrs";
2026
+ class Es {
1579
2027
  /**
1580
2028
  * Selects elements from the headless environment.
1581
2029
  * @param selector - The selector to select elements from. The supported selectors are CSS selectors whose complexity depends on the adapter implementation.
@@ -1651,19 +2099,19 @@ class fs {
1651
2099
  setInnerText;
1652
2100
  constructor({
1653
2101
  select: e,
1654
- getAttribute: s,
2102
+ getAttribute: t,
1655
2103
  setAttribute: n,
1656
2104
  getClass: r,
1657
- setClass: o,
1658
- getStyles: i,
2105
+ setClass: i,
2106
+ getStyles: o,
1659
2107
  setStyles: l,
1660
- appendHTML: a,
1661
- getInnerHTML: c,
1662
- setInnerHTML: u,
1663
- getInnerText: d,
1664
- setInnerText: f
2108
+ appendHTML: f,
2109
+ getInnerHTML: d,
2110
+ setInnerHTML: v,
2111
+ getInnerText: S,
2112
+ setInnerText: O
1665
2113
  }) {
1666
- this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = a, this.getInnerHTML = c, this.setInnerHTML = u, this.getInnerText = d, this.setInnerText = f;
2114
+ this.select = e, this.getAttribute = t, this.setAttribute = n, this.getClass = r, this.setClass = i, this.getStyles = o, this.setStyles = l, this.appendHTML = f, this.getInnerHTML = d, this.setInnerHTML = v, this.getInnerText = S, this.setInnerText = O;
1667
2115
  }
1668
2116
  /**
1669
2117
  * Sets the content of the root element from a HeadlessPortal. Generally this will be the same instance that is
@@ -1673,121 +2121,121 @@ class fs {
1673
2121
  * @param setPlaceholders - Whether to set placeholders for the content. This allows you to restore the original content
1674
2122
  * when you render on the server and then hydrate on the client.
1675
2123
  */
1676
- setFromRoot = (e, s) => {
2124
+ setFromRoot = (e, t) => {
1677
2125
  e.getPortals().forEach((r) => {
1678
- const o = typeof r.selector == "string" ? this.select(r.selector) : [r.selector];
1679
- for (const i of o) {
1680
- if (i == null)
2126
+ const i = typeof r.selector == "string" ? this.select(r.selector) : [r.selector];
2127
+ for (const o of i) {
2128
+ if (o == null)
1681
2129
  throw new Error(
1682
2130
  `Cannot find element by selector for render: ${r.selector}`
1683
2131
  );
1684
- if (r.hasChildren() && this.appendHTML(i, r.contentToHTML(s)), r.hasInnerHTML()) {
1685
- if (s) {
1686
- const l = this.getInnerHTML(i);
1687
- l != null && this.setAttribute(i, F, l);
2132
+ if (r.hasChildren() && this.appendHTML(o, r.contentToHTML(t)), r.hasInnerHTML()) {
2133
+ if (t) {
2134
+ const l = this.getInnerHTML(o);
2135
+ l != null && this.setAttribute(o, ae, l);
1688
2136
  }
1689
- this.setInnerHTML(i, r.getInnerHTML());
2137
+ this.setInnerHTML(o, r.getInnerHTML());
1690
2138
  }
1691
2139
  if (r.hasInnerText()) {
1692
- if (s) {
1693
- const l = this.getInnerText(i);
1694
- l != null && this.setAttribute(i, W, l);
2140
+ if (t) {
2141
+ const l = this.getInnerText(o);
2142
+ l != null && this.setAttribute(o, ce, l);
1695
2143
  }
1696
- this.setInnerText(i, r.getInnerText());
2144
+ this.setInnerText(o, r.getInnerText());
1697
2145
  }
1698
2146
  if (r.hasClasses()) {
1699
- if (s) {
1700
- const l = this.getClass(i);
1701
- l != null && this.setAttribute(i, B, l);
2147
+ if (t) {
2148
+ const l = this.getClass(o);
2149
+ l != null && this.setAttribute(o, oe, l);
1702
2150
  }
1703
- this.setClass(i, r.getClasses().join(" "));
2151
+ this.setClass(o, r.getClasses().join(" "));
1704
2152
  }
1705
2153
  if (r.hasStyles()) {
1706
- if (s) {
1707
- const l = this.getStyles(i);
2154
+ if (t) {
2155
+ const l = this.getStyles(o);
1708
2156
  Object.keys(l).length > 0 && this.setAttribute(
1709
- i,
1710
- q,
2157
+ o,
2158
+ le,
1711
2159
  JSON.stringify(l)
1712
2160
  );
1713
2161
  }
1714
- this.setStyles(i, r.getStyles());
2162
+ this.setStyles(o, r.getStyles());
1715
2163
  }
1716
2164
  if (r.hasAttributes()) {
1717
2165
  const l = r.getAttributes();
1718
- if (s) {
1719
- const a = [];
1720
- l.forEach(([c]) => {
1721
- const u = this.getAttribute(i, c);
1722
- u != null && a.push([c, u]);
1723
- }), a.length > 0 && this.setAttribute(
1724
- i,
1725
- U,
1726
- JSON.stringify(Object.fromEntries(a))
2166
+ if (t) {
2167
+ const f = [];
2168
+ l.forEach(([d]) => {
2169
+ const v = this.getAttribute(o, d);
2170
+ v != null && f.push([d, v]);
2171
+ }), f.length > 0 && this.setAttribute(
2172
+ o,
2173
+ ue,
2174
+ JSON.stringify(Object.fromEntries(f))
1727
2175
  );
1728
2176
  }
1729
- l.forEach(([a, c]) => {
1730
- this.setAttribute(i, a, c);
2177
+ l.forEach(([f, d]) => {
2178
+ this.setAttribute(o, f, d);
1731
2179
  });
1732
2180
  }
1733
2181
  }
1734
2182
  });
1735
2183
  };
1736
2184
  }
1737
- const Ie = (t) => JSON.parse(t.replace(/&quot;/g, '"')), mt = (t) => {
1738
- const e = t.getAttribute(B);
1739
- t.removeAttribute(B), e != null && t.setAttribute("class", e);
1740
- }, yt = (t) => {
1741
- const e = t.getAttribute(F);
1742
- t.removeAttribute(F), e != null && (t.innerHTML = e);
1743
- }, wt = (t) => {
1744
- const e = t.getAttribute(W);
1745
- t.removeAttribute(W), e != null && (t.innerText = e);
1746
- }, vt = (t) => {
1747
- const e = t.getAttribute(q);
1748
- if (t.removeAttribute(q), e != null) {
1749
- const s = Ie(e), n = Object.entries(s);
1750
- n.length > 0 && (t.style.cssText = n.map(([r, o]) => `${r}: ${o}`).join("; "));
2185
+ const Ke = (s) => JSON.parse(s.replace(/&quot;/g, '"')), Et = (s) => {
2186
+ const e = s.getAttribute(oe);
2187
+ s.removeAttribute(oe), e != null && s.setAttribute("class", e);
2188
+ }, Dt = (s) => {
2189
+ const e = s.getAttribute(ae);
2190
+ s.removeAttribute(ae), e != null && (s.innerHTML = e);
2191
+ }, Ct = (s) => {
2192
+ const e = s.getAttribute(ce);
2193
+ s.removeAttribute(ce), e != null && (s.innerText = e);
2194
+ }, Ot = (s) => {
2195
+ const e = s.getAttribute(le);
2196
+ if (s.removeAttribute(le), e != null) {
2197
+ const t = Ke(e), n = Object.entries(t);
2198
+ n.length > 0 && (s.style.cssText = n.map(([r, i]) => `${r}: ${i}`).join("; "));
1751
2199
  }
1752
- }, bt = (t) => {
1753
- const e = t.getAttribute(U);
1754
- if (t.removeAttribute(U), e != null) {
1755
- const s = Ie(e);
1756
- Object.entries(s).forEach(([n, r]) => {
1757
- r == null ? t.removeAttribute(n) : t.setAttribute(n, r);
2200
+ }, xt = (s) => {
2201
+ const e = s.getAttribute(ue);
2202
+ if (s.removeAttribute(ue), e != null) {
2203
+ const t = Ke(e);
2204
+ Object.entries(t).forEach(([n, r]) => {
2205
+ r == null ? s.removeAttribute(n) : s.setAttribute(n, r);
1758
2206
  });
1759
2207
  }
1760
- }, ps = () => {
2208
+ }, Ds = () => {
1761
2209
  const e = [
1762
- fe,
1763
- B,
1764
- F,
1765
- W,
1766
- q,
1767
- U
2210
+ Ce,
2211
+ oe,
2212
+ ae,
2213
+ ce,
2214
+ le,
2215
+ ue
1768
2216
  ].map((n) => `[${n}]`).join(",");
1769
2217
  document.querySelectorAll(e).forEach((n) => {
1770
2218
  const r = n;
1771
- if (r.hasAttribute(fe)) {
1772
- te(r);
2219
+ if (r.hasAttribute(Ce)) {
2220
+ ve(r);
1773
2221
  return;
1774
2222
  }
1775
- r.hasAttribute(B) && mt(r), r.hasAttribute(W) && wt(r), r.hasAttribute(F) && yt(r), r.hasAttribute(q) && vt(r), r.hasAttribute(U) && bt(r);
2223
+ r.hasAttribute(oe) && Et(r), r.hasAttribute(ce) && Ct(r), r.hasAttribute(ae) && Dt(r), r.hasAttribute(le) && Ot(r), r.hasAttribute(ue) && xt(r);
1776
2224
  });
1777
- }, N = Symbol("class"), $ = Symbol("style"), Z = Symbol("handler"), He = () => Math.random().toString(36).substring(2, 15), St = (t) => t.replace(/<[^>]*>?/g, "");
1778
- class Ne {
2225
+ }, Pt = "data-tempo-id", Q = Symbol("class"), Z = Symbol("style"), me = Symbol("handler"), Ge = () => Math.random().toString(36).substring(2, 15), Lt = (s) => s.replace(/<[^>]*>?/g, "");
2226
+ class ze {
1779
2227
  constructor(e) {
1780
2228
  this.parent = e;
1781
2229
  }
1782
- id = He();
2230
+ id = Ge();
1783
2231
  properties = {};
1784
2232
  children = [];
1785
2233
  isElement = () => !0;
1786
2234
  isText = () => !1;
1787
- getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? St(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
2235
+ getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? Lt(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
1788
2236
  removeChild = (e) => {
1789
- const s = this.children.indexOf(e);
1790
- s !== -1 && this.children.splice(s, 1);
2237
+ const t = this.children.indexOf(e);
2238
+ t !== -1 && this.children.splice(t, 1);
1791
2239
  };
1792
2240
  remove = () => {
1793
2241
  if (this.parent != null)
@@ -1796,7 +2244,7 @@ class Ne {
1796
2244
  throw new Error("Parent is undefined");
1797
2245
  };
1798
2246
  getPortals = () => {
1799
- const e = this.elements().flatMap((s) => s.isPortal() ? [s, ...s.getPortals()] : s.getPortals());
2247
+ const e = this.elements().flatMap((t) => t.isPortal() ? [t, ...t.getPortals()] : t.getPortals());
1800
2248
  return this.isPortal() && e.unshift(this), e;
1801
2249
  };
1802
2250
  elements = () => this.children.filter((e) => e.isElement());
@@ -1805,119 +2253,173 @@ class Ne {
1805
2253
  getInnerText = () => this.properties.innerText ?? "";
1806
2254
  hasInnerText = () => this.properties.innerText != null;
1807
2255
  hasChildren = () => this.children.length > 0;
1808
- hasClasses = () => this.properties[N] != null;
1809
- hasStyles = () => this.properties[$] != null;
2256
+ hasClasses = () => this.properties[Q] != null;
2257
+ hasStyles = () => this.properties[Z] != null;
1810
2258
  hasAttributes = () => Object.keys(this.properties).length > 0;
1811
- hasHandlers = () => this.properties[Z] != null;
2259
+ hasHandlers = () => this.properties[me] != null;
1812
2260
  hasRenderableProperties = () => this.hasClasses() || this.hasAttributes() || this.hasStyles();
1813
2261
  getById = (e) => {
1814
2262
  if (this.properties.id === e)
1815
2263
  return this;
1816
- for (const s of this.elements()) {
1817
- const n = s.getById(e);
2264
+ for (const t of this.elements()) {
2265
+ const n = t.getById(e);
1818
2266
  if (n != null)
1819
2267
  return n;
1820
2268
  }
1821
2269
  };
1822
- trigger = (e, s) => {
1823
- ((this.properties[Z] ?? {})[e] ?? []).forEach((r) => r(s));
2270
+ trigger = (e, t) => {
2271
+ ((this.properties[me] ?? {})[e] ?? []).forEach((r) => r(t));
1824
2272
  };
1825
2273
  click = () => {
1826
2274
  this.trigger("click", {});
1827
2275
  };
1828
- on = (e, s, n, r) => {
1829
- const o = this.properties[Z] ??= {}, i = r?.once ? (a) => {
1830
- l(), s(a, n);
1831
- } : (a) => s(a, n);
1832
- o[e] = [...o[e] ?? [], i];
2276
+ on = (e, t, n, r) => {
2277
+ const i = this.properties[me] ??= {}, o = r?.once ? (f) => {
2278
+ l(), t(f, n);
2279
+ } : (f) => t(f, n);
2280
+ i[e] = [...i[e] ?? [], o];
1833
2281
  const l = () => {
1834
- const a = o[e] ?? [], c = a.indexOf(i);
1835
- c !== -1 && (a.splice(c, 1), a.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[Z]) : o[e] = a, r?.signal != null && r.signal.removeEventListener("abort", l));
2282
+ const f = i[e] ?? [], d = f.indexOf(o);
2283
+ d !== -1 && (f.splice(d, 1), f.length === 0 ? (delete i[e], Object.keys(i).length === 0 && delete this.properties[me]) : i[e] = f, r?.signal != null && r.signal.removeEventListener("abort", l));
1836
2284
  };
1837
2285
  return r?.signal != null && r.signal.addEventListener("abort", l), l;
1838
2286
  };
1839
2287
  addClasses = (e) => {
1840
2288
  if (e.length === 0)
1841
2289
  return;
1842
- const s = this.properties[N] ??= [], n = new Set(s);
2290
+ const t = this.properties[Q] ??= [], n = new Set(t);
1843
2291
  for (const r of e)
1844
- n.has(r) || (s.push(r), n.add(r));
2292
+ n.has(r) || (t.push(r), n.add(r));
1845
2293
  };
1846
2294
  removeClasses = (e) => {
1847
2295
  if (e.length === 0)
1848
2296
  return;
1849
- const s = this.properties[N] ??= [], n = new Set(e);
2297
+ const t = this.properties[Q] ??= [], n = new Set(e);
1850
2298
  let r = 0;
1851
- for (let o = 0; o < s.length; o++)
1852
- n.has(s[o]) || (s[r] = s[o], r++);
1853
- s.length = r, s.length === 0 && delete this.properties[N];
2299
+ for (let i = 0; i < t.length; i++)
2300
+ n.has(t[i]) || (t[r] = t[i], r++);
2301
+ t.length = r, t.length === 0 && delete this.properties[Q];
1854
2302
  };
1855
- getClasses = () => this.properties[N] ?? [];
2303
+ getClasses = () => this.properties[Q] ?? [];
1856
2304
  getAttributes = () => Object.entries(this.properties).filter(
1857
2305
  ([e]) => !["innerText", "innerHTML"].includes(e)
1858
2306
  );
1859
2307
  getVisibleAttributes = () => Reflect.ownKeys(this.properties).flatMap(
1860
- (e) => e === N ? [["class", this.getClasses()]] : e === $ ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
2308
+ (e) => e === Q ? [["class", this.getClasses()]] : e === Z ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
1861
2309
  );
1862
- setStyle = (e, s) => {
1863
- const n = this.properties[$] ??= {};
1864
- n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[$]);
2310
+ setStyle = (e, t) => {
2311
+ const n = this.properties[Z] ??= {};
2312
+ n[e] = t, t === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[Z]);
1865
2313
  };
1866
- getStyle = (e) => this.properties[$]?.[e] ?? "";
1867
- getStyles = () => this.properties[$] ?? {};
2314
+ getStyle = (e) => this.properties[Z]?.[e] ?? "";
2315
+ getStyles = () => this.properties[Z] ?? {};
1868
2316
  makeAccessors = (e) => {
1869
- const s = this.properties;
2317
+ const t = this.properties;
1870
2318
  return {
1871
- get: () => s[e],
1872
- set: (n) => s[e] = n
2319
+ get: () => t[e],
2320
+ set: (n) => t[e] = n
1873
2321
  };
1874
2322
  };
1875
2323
  }
1876
- const _t = (t) => t.replace(/"/g, "&quot;"), At = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1877
- class Tt extends Ne {
1878
- constructor(e, s, n) {
1879
- super(n), this.tagName = e, this.namespace = s;
2324
+ const Mt = (s) => s.replace(/"/g, "&quot;"), kt = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2325
+ class It extends ze {
2326
+ constructor(e, t, n) {
2327
+ super(n), this.tagName = e, this.namespace = t;
1880
2328
  }
1881
2329
  isPortal = () => !1;
2330
+ /**
2331
+ * Builds the attributes string for this element.
2332
+ * Returns an object containing the attributes string and any innerHTML value.
2333
+ */
2334
+ buildAttributesString = (e) => {
2335
+ let t = null;
2336
+ const n = this.namespace ? ` xmlns="${this.namespace}"` : "", r = this.getVisibleAttributes().map(([o, l]) => o === "class" ? ` class="${l.join(" ")}"` : o === "style" ? typeof l == "string" ? ` style="${l}"` : ` style="${Object.entries(l).map(([f, d]) => `${f}: ${d};`).join(" ")}"` : Ht.has(o) ? ` ${o}` : o === "innerHTML" ? (t = l, "") : o === "innerText" ? (t = kt(l), "") : ` ${o}="${Mt(l)}"`).join(""), i = e ? ` ${Ce} ${Pt}="${this.id}"` : "";
2337
+ return { attrs: `${n}${r}${i}`, innerHTML: t };
2338
+ };
1882
2339
  toHTML = (e = !1) => {
1883
- const s = this.children.map((l) => l.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
1884
- let r = null;
1885
- const o = this.getVisibleAttributes().map(([l, a]) => l === "class" ? ` class="${a.join(" ")}"` : l === "style" ? typeof a == "string" ? ` style="${a}"` : ` style="${Object.entries(a).map(([c, u]) => `${c}: ${u};`).join(" ")}"` : Ct.has(l) ? ` ${l}` : l === "innerHTML" ? (r = a, "") : l === "innerText" ? (r = At(a), "") : ` ${l}="${_t(a)}"`).join(""), i = e ? ` ${fe}` : "";
1886
- return Dt.has(this.tagName) && s === "" ? `<${this.tagName}${n}${o}${i} />` : `<${this.tagName}${n}${o}${i}>${r ?? s}</${this.tagName}>`;
2340
+ const t = this.children.map((i) => i.toHTML()).join(""), { attrs: n, innerHTML: r } = this.buildAttributesString(e);
2341
+ return Me.has(this.tagName) && t === "" ? `<${this.tagName}${n} />` : `<${this.tagName}${n}>${r ?? t}</${this.tagName}>`;
1887
2342
  };
2343
+ /**
2344
+ * Generates HTML output as an async stream of string chunks.
2345
+ * Yields the opening tag, then each child's content, then the closing tag.
2346
+ *
2347
+ * @param options - Options for streaming output.
2348
+ * @yields String chunks of HTML content.
2349
+ */
2350
+ async *toHTMLStream(e) {
2351
+ const t = e?.generatePlaceholders ?? !1, { attrs: n, innerHTML: r } = this.buildAttributesString(t);
2352
+ if (Me.has(this.tagName) && this.children.length === 0) {
2353
+ yield `<${this.tagName}${n} />`;
2354
+ return;
2355
+ }
2356
+ if (yield `<${this.tagName}${n}>`, r !== null)
2357
+ yield r;
2358
+ else
2359
+ for (const i of this.children)
2360
+ yield* i.toHTMLStream(e);
2361
+ yield `</${this.tagName}>`;
2362
+ }
1888
2363
  }
1889
- class $e extends Ne {
1890
- constructor(e, s) {
1891
- super(s), this.selector = e;
2364
+ class Ye extends ze {
2365
+ constructor(e, t) {
2366
+ super(t), this.selector = e;
1892
2367
  }
1893
2368
  isPortal = () => !0;
1894
2369
  toHTML = () => "";
1895
- contentToHTML = (e = !1) => this.children.map((s) => s.toHTML(e)).join("");
2370
+ /**
2371
+ * Portals don't render inline - they render at their target selector.
2372
+ * This method yields nothing for the inline position.
2373
+ */
2374
+ // eslint-disable-next-line require-yield
2375
+ async *toHTMLStream(e) {
2376
+ }
2377
+ contentToHTML = (e = !1) => this.children.map((t) => t.toHTML(e)).join("");
2378
+ /**
2379
+ * Streams the portal's content HTML.
2380
+ * Unlike toHTMLStream, this yields the actual content for rendering at the target location.
2381
+ *
2382
+ * @param options - Options for streaming output.
2383
+ * @yields String chunks of the portal's content.
2384
+ */
2385
+ async *contentToHTMLStream(e) {
2386
+ for (const t of this.children)
2387
+ yield* t.toHTMLStream(e);
2388
+ }
1896
2389
  }
1897
- class Et {
2390
+ class $t {
1898
2391
  constructor(e) {
1899
2392
  this.text = e;
1900
2393
  }
1901
- id = He();
2394
+ id = Ge();
1902
2395
  isElement = () => !1;
1903
2396
  isText = () => !0;
1904
2397
  getText = () => this.text;
1905
2398
  toHTML = () => this.text;
2399
+ /**
2400
+ * Streams the text content as a single chunk.
2401
+ *
2402
+ * @param options - Options (unused for text nodes, kept for API consistency).
2403
+ * @yields The text content.
2404
+ */
2405
+ async *toHTMLStream(e) {
2406
+ yield this.text;
2407
+ }
1906
2408
  }
1907
- class V {
1908
- constructor(e, s, n, r) {
1909
- this.element = e, this.reference = s, this.container = n, this.providers = r;
2409
+ class se {
2410
+ constructor(e, t, n, r) {
2411
+ this.element = e, this.reference = t, this.container = n, this.providers = r;
1910
2412
  }
1911
2413
  appendOrInsert = (e) => {
1912
2414
  if (this.reference != null) {
1913
- const s = this.element.children.indexOf(this.reference);
1914
- s >= 0 && this.element.children.splice(s, 0, e);
2415
+ const t = this.element.children.indexOf(this.reference);
2416
+ t >= 0 && this.element.children.splice(t, 0, e);
1915
2417
  } else
1916
2418
  this.element.children.push(e);
1917
2419
  };
1918
- makeChildElement = (e, s) => {
1919
- const n = new Tt(e, s, this.element);
1920
- return this.appendOrInsert(n), new V(
2420
+ makeChildElement = (e, t) => {
2421
+ const n = new It(e, t, this.element);
2422
+ return this.appendOrInsert(n), new se(
1921
2423
  n,
1922
2424
  void 0,
1923
2425
  this.container,
@@ -1925,10 +2427,10 @@ class V {
1925
2427
  );
1926
2428
  };
1927
2429
  makeChildText = (e) => {
1928
- const s = new Et(e);
1929
- return this.appendOrInsert(s), new V(
2430
+ const t = new $t(e);
2431
+ return this.appendOrInsert(t), new se(
1930
2432
  this.element,
1931
- s,
2433
+ t,
1932
2434
  this.container,
1933
2435
  this.providers
1934
2436
  );
@@ -1939,9 +2441,9 @@ class V {
1939
2441
  getText = () => this.reference?.getText() ?? this.element.getText();
1940
2442
  makeRef = () => this.makeChildText("");
1941
2443
  makePortal = (e) => {
1942
- const s = new $e(e, this.element);
1943
- return this.appendOrInsert(s), new V(
1944
- s,
2444
+ const t = new Ye(e, this.element);
2445
+ return this.appendOrInsert(t), new se(
2446
+ t,
1945
2447
  void 0,
1946
2448
  this.container,
1947
2449
  this.providers
@@ -1954,20 +2456,20 @@ class V {
1954
2456
  * @param value - The provider to set for the given mark.
1955
2457
  * @returns A new `DOMContext` instance with the specified provider.
1956
2458
  */
1957
- setProvider = (e, s, n) => new V(this.element, this.reference, this.container, {
2459
+ setProvider = (e, t, n) => new se(this.element, this.reference, this.container, {
1958
2460
  ...this.providers,
1959
- [e]: [s, n]
2461
+ [e]: [t, n]
1960
2462
  });
1961
2463
  getProvider = (e) => {
1962
2464
  if (this.providers[e] === void 0)
1963
- throw new Me(e);
1964
- const [s, n] = this.providers[e];
1965
- return { value: s, onUse: n };
2465
+ throw new Je(e);
2466
+ const [t, n] = this.providers[e];
2467
+ return { value: t, onUse: n };
1966
2468
  };
1967
2469
  clear = (e) => {
1968
2470
  e && (this.reference !== void 0 ? this.element.removeChild(this.reference) : this.element.remove());
1969
2471
  };
1970
- on = (e, s) => this.element.on(e, s, this);
2472
+ on = (e, t) => this.element.on(e, t, this);
1971
2473
  addClasses = (e) => this.element.addClasses(e);
1972
2474
  removeClasses = (e) => this.element.removeClasses(e);
1973
2475
  getClasses = () => this.element.getClasses();
@@ -1975,64 +2477,84 @@ class V {
1975
2477
  isBrowser = () => !1;
1976
2478
  isHeadlessDOM = () => !0;
1977
2479
  isHeadless = () => !0;
1978
- setStyle = (e, s) => this.element.setStyle(e, s);
2480
+ setStyle = (e, t) => this.element.setStyle(e, t);
1979
2481
  getStyle = (e) => this.element.getStyle(e);
1980
2482
  makeAccessors = (e) => this.element.makeAccessors(e);
1981
2483
  }
1982
- const Ct = /* @__PURE__ */ new Set([
2484
+ const Ht = /* @__PURE__ */ new Set([
1983
2485
  "checked",
1984
2486
  "disabled",
1985
2487
  "multiple",
1986
2488
  "readonly",
1987
2489
  "required",
1988
2490
  "selected"
1989
- ]), Dt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), gs = () => (
2491
+ ]), Me = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), Cs = () => (
1990
2492
  /* c8 ignore next */
1991
2493
  typeof window < "u" ? window : void 0
1992
- ), xt = Symbol("DOM_RENDERABLE"), m = (t) => Ke(xt, t), Re = (t) => m((e) => e.makeChildText(t).clear), je = (t) => m((e) => {
1993
- const s = e.makeChildText(t.value), n = t.on(s.setText);
1994
- return (r) => {
1995
- n(), s.clear(r);
1996
- };
1997
- }), ms = (t) => y.is(t) ? je(t) : Re(t), E = (...t) => m((e) => {
1998
- const s = t.map((n) => g(n).render(e));
1999
- return (n) => {
2000
- s.forEach((r) => r(n));
2001
- };
2002
- }), x = m(() => () => {
2003
- }), Lt = (t) => m((e) => (e.addClasses(t), (s) => {
2004
- s && e.removeClasses(t);
2005
- })), Pt = (t) => m((e) => {
2006
- let s = /* @__PURE__ */ new Set();
2007
- const n = t.on(
2494
+ ), Nt = Symbol("DOM_RENDERABLE"), L = (s) => nt(Nt, s), Rt = At({
2495
+ create: L
2496
+ }), {
2497
+ Empty: jt,
2498
+ Fragment: J,
2499
+ When: Os,
2500
+ Unless: xs,
2501
+ ForEach: Ps,
2502
+ Repeat: Ls,
2503
+ OneOf: Ms,
2504
+ OneOfField: ks,
2505
+ OneOfKind: Is,
2506
+ OneOfType: $s,
2507
+ OneOfValue: Hs,
2508
+ OneOfTuple: Ns,
2509
+ MapSignal: Rs,
2510
+ Ensure: js,
2511
+ EnsureAll: Vs,
2512
+ NotEmpty: Bs,
2513
+ Task: qs,
2514
+ Async: Fs,
2515
+ OnDispose: Xe,
2516
+ Conjunction: Ws,
2517
+ WithScope: Us,
2518
+ WithProvider: Js,
2519
+ Provide: Ks,
2520
+ Use: Gs,
2521
+ UseMany: zs,
2522
+ handleValueOrSignal: Ys,
2523
+ createReactiveRenderable: Xs,
2524
+ renderableOfTNode: W
2525
+ } = Rt, Vt = (s) => L((e) => (e.addClasses(s), (t) => {
2526
+ t && e.removeClasses(s);
2527
+ })), Bt = (s) => L((e) => {
2528
+ let t = /* @__PURE__ */ new Set();
2529
+ const n = s.on(
2008
2530
  (r) => {
2009
- const o = (r ?? "").split(" ").filter((c) => c.length > 0), i = new Set(o), l = [];
2010
- for (const c of s)
2011
- i.has(c) || l.push(c);
2012
- const a = [];
2013
- for (const c of i)
2014
- s.has(c) || a.push(c);
2015
- l.length > 0 && e.removeClasses(l), a.length > 0 && e.addClasses(a), s = i;
2531
+ const i = (r ?? "").split(" ").filter((d) => d.length > 0), o = new Set(i), l = [];
2532
+ for (const d of t)
2533
+ o.has(d) || l.push(d);
2534
+ const f = [];
2535
+ for (const d of o)
2536
+ t.has(d) || f.push(d);
2537
+ l.length > 0 && e.removeClasses(l), f.length > 0 && e.addClasses(f), t = o;
2016
2538
  },
2017
2539
  { noAutoDispose: !0 }
2018
2540
  );
2019
2541
  return (r) => {
2020
- n(), r && e.removeClasses(Array.from(s)), s.clear();
2542
+ n(), r && e.removeClasses(Array.from(t)), t.clear();
2021
2543
  };
2022
- }), Ot = (t, e) => m((s) => {
2023
- const { get: n, set: r } = s.makeAccessors(t), o = n();
2024
- return r(e), (i) => {
2025
- i && r(o);
2544
+ }), qt = (s, e) => L((t) => {
2545
+ const { get: n, set: r } = t.makeAccessors(s), i = n();
2546
+ return r(e), (o) => {
2547
+ o && r(i);
2026
2548
  };
2027
- }), kt = (t, e) => m((s) => {
2028
- const { get: n, set: r } = s.makeAccessors(t), o = n(), i = e.on(r, { noAutoDispose: !0 });
2549
+ }), Ft = (s, e) => L((t) => {
2550
+ const { get: n, set: r } = t.makeAccessors(s), i = n(), o = e.on(r, { noAutoDispose: !0 });
2029
2551
  return (l) => {
2030
- i(), l && r(o);
2552
+ o(), l && r(i);
2031
2553
  };
2032
- }), K = (t, e) => y.is(e) ? kt(t, e) : Ot(t, e), Mt = (t, e) => t === "class" ? y.is(e) ? Pt(e) : Lt(
2554
+ }), de = (s, e) => _.is(e) ? Ft(s, e) : qt(s, e), Wt = (s, e) => s === "class" ? _.is(e) ? Bt(e) : Vt(
2033
2555
  /* c8 ignore next */
2034
- (e ?? "").split(" ").filter((s) => s.length > 0)
2035
- ) : K(t, e), A = new Proxy(
2556
+ (e ?? "").split(" ").filter((t) => t.length > 0)
2557
+ ) : de(s, e), N = new Proxy(
2036
2558
  {},
2037
2559
  {
2038
2560
  /**
@@ -2046,9 +2568,9 @@ const Ct = /* @__PURE__ */ new Set([
2046
2568
  * @returns The renderable component for the specified attribute.
2047
2569
  *
2048
2570
  */
2049
- get: (t, e) => (s) => Mt(e, s)
2571
+ get: (s, e) => (t) => Wt(e, t)
2050
2572
  }
2051
- ), It = (t, e) => K(`data-${t}`, e), ys = new Proxy(
2573
+ ), Ut = (s, e) => de(`data-${s}`, e), Qs = new Proxy(
2052
2574
  {},
2053
2575
  {
2054
2576
  /**
@@ -2059,9 +2581,9 @@ const Ct = /* @__PURE__ */ new Set([
2059
2581
  * @returns The renderable component for the specified attribute.
2060
2582
  *
2061
2583
  */
2062
- get: (t, e) => (s) => It(e, s)
2584
+ get: (s, e) => (t) => Ut(e, t)
2063
2585
  }
2064
- ), Ht = (t, e) => K(`aria-${t}`, e), ws = new Proxy(
2586
+ ), Jt = (s, e) => de(`aria-${s}`, e), Zs = new Proxy(
2065
2587
  {},
2066
2588
  {
2067
2589
  /**
@@ -2072,9 +2594,9 @@ const Ct = /* @__PURE__ */ new Set([
2072
2594
  * @returns The renderable component for the specified attribute.
2073
2595
  *
2074
2596
  */
2075
- get: (t, e) => (s) => Ht(e, s)
2597
+ get: (s, e) => (t) => Jt(e, t)
2076
2598
  }
2077
- ), Nt = (t, e) => K(t, e), vs = new Proxy(
2599
+ ), Kt = (s, e) => de(s, e), en = new Proxy(
2078
2600
  {},
2079
2601
  {
2080
2602
  /**
@@ -2085,9 +2607,9 @@ const Ct = /* @__PURE__ */ new Set([
2085
2607
  * @returns The renderable component for the specified attribute.
2086
2608
  *
2087
2609
  */
2088
- get: (t, e) => (s) => Nt(e, s)
2610
+ get: (s, e) => (t) => Kt(e, t)
2089
2611
  }
2090
- ), $t = (t, e) => K(t, e), bs = new Proxy(
2612
+ ), Gt = (s, e) => de(s, e), tn = new Proxy(
2091
2613
  {},
2092
2614
  {
2093
2615
  /**
@@ -2097,97 +2619,16 @@ const Ct = /* @__PURE__ */ new Set([
2097
2619
  * @returns The renderable component for the specified attribute.
2098
2620
  *
2099
2621
  */
2100
- get: (t, e) => (s) => $t(e, s)
2622
+ get: (s, e) => (t) => Gt(e, t)
2101
2623
  }
2102
- ), g = (t) => {
2103
- if (t == null)
2104
- return x;
2105
- if (Array.isArray(t))
2106
- return E(...t.map(g));
2107
- if (typeof t == "string")
2108
- return Re(t);
2109
- if (y.is(t))
2110
- return je(t);
2111
- if (typeof t == "object" && "render" in t && "type" in t)
2112
- return t;
2113
- throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
2114
- }, Ve = (t, ...e) => m((s) => {
2115
- const n = s.makeChildElement(t, void 0), r = e.map((o) => g(o).render(n));
2116
- return (o) => {
2117
- r.forEach((i) => i(!1)), n.clear(o);
2118
- };
2119
- }), ie = (t, e, ...s) => m((n) => {
2120
- const r = n.makeChildElement(t, e), o = s.map((i) => g(i).render(r));
2121
- return (i) => {
2122
- o.forEach((l) => l(!1)), r.clear(i);
2123
- };
2124
- }), Rt = new Proxy(
2125
- {},
2126
- {
2127
- /**
2128
- * Creates a renderable that represents an HTML element.
2129
- * @param tagName - The HTML tag name.
2130
- * @returns A renderable function that creates and appends the HTML element to the DOM.
2131
- */
2132
- get: (t, e) => (...s) => Ve(e, s.flatMap(g))
2133
- }
2134
- ), Ss = new Proxy(
2135
- {},
2136
- {
2137
- /**
2138
- * Creates a renderable that represents an HTMLInput element.
2139
- * @param type - The input type name.
2140
- * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
2141
- */
2142
- get: (t, e) => (...s) => Ve("input", A.type(e), ...s)
2143
- }
2144
- ), Be = "http://www.w3.org/2000/svg", _s = (t, ...e) => ie(t, Be, ...e), As = new Proxy(
2145
- {},
2146
- {
2147
- /**
2148
- * Creates a renderable that represents an SVG element.
2149
- * @param tagName - The SVG tag name.
2150
- * @returns A renderable function that creates and appends the SVG element to the DOM.
2151
- */
2152
- get: (t, e) => (...s) => ie(e, Be, s.flatMap(g))
2153
- }
2154
- ), qe = "http://www.w3.org/1998/Math/MathML", Ts = (t, ...e) => ie(t, qe, ...e), Es = new Proxy(
2155
- {},
2156
- {
2157
- /**
2158
- * Creates a renderable that represents an Math element.
2159
- * @param tagName - The Math tag name.
2160
- * @returns A renderable function that creates and appends the Math element to the DOM.
2161
- */
2162
- get: (t, e) => (...s) => ie(e, qe, s.flatMap(g))
2163
- }
2164
- ), Fe = (t, e) => {
2165
- if (typeof e == "function")
2166
- return Fe(t, { then: e });
2167
- const s = e.pending != null ? g(e.pending()) : x, n = e.then, r = e.error != null ? (o) => g(e.error(o)) : () => x;
2168
- return m((o) => {
2169
- let i = !0;
2170
- const l = t(), a = o.makeRef();
2171
- let c = g(s).render(a);
2172
- return l.then(
2173
- (u) => {
2174
- i && (c(!0), c = g(n(u)).render(a));
2175
- },
2176
- (u) => {
2177
- i && (c(!0), c = g(r(u)).render(a));
2178
- }
2179
- ), (u) => {
2180
- i = !1, c(u), a.clear(u);
2181
- };
2182
- });
2183
- }, Cs = (t, e) => Fe(() => t, e), We = (t, e, s) => m((n) => n.on(t, e, s)), jt = (t) => We("click", (e, s) => {
2624
+ ), Qe = (s, e, t) => L((n) => n.on(s, e, t)), zt = (s) => Qe("click", (e, t) => {
2184
2625
  e.preventDefault();
2185
2626
  const n = e.target;
2186
2627
  setTimeout(() => {
2187
2628
  const r = n.ownerDocument != null ? n?.checked : void 0;
2188
- r != null && t(!r, s);
2629
+ r != null && s(!r, t);
2189
2630
  }, 0);
2190
- }), Y = new Proxy(
2631
+ }), fe = new Proxy(
2191
2632
  {},
2192
2633
  {
2193
2634
  /**
@@ -2195,416 +2636,227 @@ const Ct = /* @__PURE__ */ new Set([
2195
2636
  * @param fn - The function to call when the event is triggered.
2196
2637
  * @returns A `Renderable` function that adds the event listener to the element.
2197
2638
  */
2198
- get: (t, e) => (s) => We(e, s)
2639
+ get: (s, e) => (t) => Qe(e, t)
2199
2640
  }
2200
- ), Vt = (t, e) => (s) => {
2201
- e?.preventDefault === !0 && s.preventDefault(), e?.stopPropagation === !0 && s.stopPropagation(), e?.stopImmediatePropagation === !0 && s.stopImmediatePropagation(), t(s);
2202
- }, M = (t, e) => Vt((s) => {
2203
- const n = s.target;
2204
- t(n, s);
2205
- }, e), Bt = (t, e) => M(
2206
- (s, n) => t(s.value, n),
2641
+ ), Yt = (s, e) => (t) => {
2642
+ e?.preventDefault === !0 && t.preventDefault(), e?.stopPropagation === !0 && t.stopPropagation(), e?.stopImmediatePropagation === !0 && t.stopImmediatePropagation(), s(t);
2643
+ }, Y = (s, e) => Yt((t) => {
2644
+ const n = t.target;
2645
+ s(n, t);
2646
+ }, e), Xt = (s, e) => Y(
2647
+ (t, n) => s(t.value, n),
2207
2648
  e
2208
- ), qt = (t, e) => M(
2209
- (s, n) => t(s.valueAsNumber, n),
2649
+ ), Qt = (s, e) => Y(
2650
+ (t, n) => s(t.valueAsNumber, n),
2210
2651
  e
2211
- ), Ft = (t, e) => M((s, n) => {
2212
- if (s.value === "")
2652
+ ), Zt = (s, e) => Y((t, n) => {
2653
+ if (t.value === "")
2213
2654
  return;
2214
- const r = s.value.split("-"), o = new Date(
2655
+ const r = t.value.split("-"), i = new Date(
2215
2656
  Number(r[0]),
2216
2657
  Number(r[1]) - 1,
2217
2658
  Number(r[2].substring(0, 2))
2218
2659
  );
2219
- t(o, n);
2220
- }, e), Ds = (t, e) => M((s, n) => {
2221
- if (s.value === "") {
2222
- t(null, n);
2660
+ s(i, n);
2661
+ }, e), sn = (s, e) => Y((t, n) => {
2662
+ if (t.value === "") {
2663
+ s(null, n);
2223
2664
  return;
2224
2665
  }
2225
- const r = s.value.split("-"), o = new Date(
2666
+ const r = t.value.split("-"), i = new Date(
2226
2667
  Number(r[0]),
2227
2668
  Number(r[1]) - 1,
2228
2669
  Number(r[2].substring(0, 2))
2229
2670
  );
2230
- t(o, n);
2231
- }, e), Wt = (t, e) => M((s, n) => {
2232
- if (s.value === "")
2671
+ s(i, n);
2672
+ }, e), es = (s, e) => Y((t, n) => {
2673
+ if (t.value === "")
2233
2674
  return;
2234
- const r = s.value.split("T"), o = r[0].split("-"), i = new Date(
2235
- Number(o[0]),
2236
- Number(o[1]) - 1,
2237
- Number(o[2])
2675
+ const r = t.value.split("T"), i = r[0].split("-"), o = new Date(
2676
+ Number(i[0]),
2677
+ Number(i[1]) - 1,
2678
+ Number(i[2])
2238
2679
  ), l = r[1].split(":");
2239
- i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), t(i, n);
2240
- }, e), xs = (t, e) => M((s, n) => {
2241
- if (s.value === "") {
2242
- t(null, n);
2680
+ o.setHours(Number(l[0])), o.setMinutes(Number(l[1])), o.setSeconds(Number(l[2])), s(o, n);
2681
+ }, e), nn = (s, e) => Y((t, n) => {
2682
+ if (t.value === "") {
2683
+ s(null, n);
2243
2684
  return;
2244
2685
  }
2245
- const r = s.value.split("T");
2686
+ const r = t.value.split("T");
2246
2687
  if (r.length !== 2) {
2247
- t(null, n);
2688
+ s(null, n);
2248
2689
  return;
2249
2690
  }
2250
- const o = r[0].split("-"), i = new Date(
2251
- Number(o[0]),
2252
- Number(o[1]) - 1,
2253
- Number(o[2])
2691
+ const i = r[0].split("-"), o = new Date(
2692
+ Number(i[0]),
2693
+ Number(i[1]) - 1,
2694
+ Number(i[2])
2254
2695
  ), l = r[1].split(":");
2255
- i.setHours(Number(l[0] ?? 0)), i.setMinutes(Number(l[1] ?? 0)), i.setSeconds(Number(l[2] ?? 0)), t(i, n);
2256
- }, e), Ls = (t, e) => M((s, n) => {
2257
- t(s.checked, n);
2258
- }, e), Ps = (t, e = "input") => E(A.valueAsDate(t), Y[e](Ft(t.set))), Os = (t, e = "input") => E(A.valueAsDate(t), Y[e](Wt(t.set))), ks = (t, e = "input") => E(A.valueAsNumber(t), Y[e](qt(t.set))), Ms = (t, e = "input") => E(A.value(t), Y[e](Bt(t.set))), Is = (t) => E(A.checked(t), jt(t.set)), ge = (t, e, s) => y.is(t) ? e(t) : s(t), Ut = (t, e, s) => {
2259
- const n = t.makeRef();
2260
- let r = () => {
2261
- }, o = null;
2262
- const i = e.on(
2263
- (l) => {
2264
- o?.dispose(), r(!0), o = new z(), r = k(
2265
- o,
2266
- () => g(s(l)).render(n)
2267
- );
2268
- },
2269
- { noAutoDispose: !0 }
2270
- );
2271
- return (l) => {
2272
- o?.dispose(), r(l), i(), n.clear(l);
2273
- };
2274
- }, le = (t, e) => {
2275
- function s(r) {
2276
- return m((o) => {
2277
- const i = o.makeRef();
2278
- let l, a;
2279
- const c = r.map((f) => Object.keys(f)[0]);
2280
- let u;
2281
- const d = c.on((f) => {
2282
- if (f !== u) {
2283
- u = f, a?.dispose(), l?.(!0), a = r.map((p) => p[f]);
2284
- const h = e[f](a);
2285
- l = g(h).render(i);
2286
- }
2287
- });
2288
- return (f) => {
2289
- a?.dispose(), d(), i.clear(f), l?.(f);
2290
- };
2291
- });
2292
- }
2293
- function n(r) {
2294
- const o = Object.keys(r)[0];
2295
- return g(e[o](re(r[o])));
2296
- }
2297
- return ge(t, s, n);
2298
- }, Ue = (t, e, s) => le(
2299
- w.map(t, (n) => ({ [n[e]]: n })),
2300
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2301
- s
2302
- ), Hs = (t, e) => Ue(t, "kind", e), Ns = (t, e) => {
2303
- const s = w.map(t, ([n, r]) => ({
2304
- [n]: r
2305
- }));
2306
- return le(s, e);
2307
- }, $s = (t, e) => Ue(t, "type", e), Jt = (t, e) => le(
2308
- w.map(t, (s) => ({ [s]: !0 })),
2309
- e
2310
- ), Rs = (t, e = {}) => (s) => {
2311
- const n = e?.firstSeparator ?? t, r = e?.lastSeparator ?? t;
2312
- return Jt(
2313
- s.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
2314
- {
2315
- first: n,
2316
- last: r,
2317
- other: t
2318
- }
2319
- );
2320
- }, js = (t) => m((e) => (e.appendOrInsert(t), (s) => {
2321
- s && te(t);
2322
- })), Vs = (t, e, s) => {
2323
- function n(o) {
2324
- return m((i) => {
2325
- const l = i.makeRef();
2326
- let a = () => {
2327
- }, c = !1, u = null;
2328
- const d = o.on((f) => {
2329
- f == null ? (a(!0), a = g(s?.()).render(l), c = !1, u?.dispose(), u = null) : c ? u.set(f) : (u = D(f), a(!0), a = g(
2330
- e(u)
2331
- ).render(l), c = !0);
2332
- });
2333
- return (f) => {
2334
- u?.dispose(), d(), a?.(f), l.clear(f);
2335
- };
2336
- });
2337
- }
2338
- function r(o) {
2339
- if (o == null) {
2340
- const i = s?.();
2341
- return i != null ? g(i) : x;
2342
- }
2343
- return g(e(re(o)));
2344
- }
2345
- return ge(
2346
- t,
2347
- n,
2348
- r
2349
- );
2350
- }, Bs = (...t) => (e, s) => m((n) => {
2351
- const r = n.makeRef();
2352
- if (t.some(
2353
- (h) => !y.is(h) && h == null
2354
- ))
2355
- return (s != null ? g(s?.()) : x).render(r);
2356
- const i = t.map(() => null), l = t.map(
2357
- (h) => y.is(h) ? h.value != null : h != null
2358
- );
2359
- let a = null;
2360
- const c = D(l.every((h) => h)), u = (h, p) => {
2361
- if (h.value != null) {
2362
- if (i[p] == null) {
2363
- const v = D(h.value);
2364
- i[p] = v;
2365
- } else
2366
- i[p].value = h.value;
2367
- l[p] = !0;
2368
- } else
2369
- l[p] = !1;
2696
+ o.setHours(Number(l[0] ?? 0)), o.setMinutes(Number(l[1] ?? 0)), o.setSeconds(Number(l[2] ?? 0)), s(o, n);
2697
+ }, e), rn = (s, e) => Y((t, n) => {
2698
+ s(t.checked, n);
2699
+ }, e), on = (s, e = "input") => J(N.valueAsDate(s), fe[e](Zt(s.set))), ln = (s, e = "input") => J(N.valueAsDate(s), fe[e](es(s.set))), an = (s, e = "input") => J(N.valueAsNumber(s), fe[e](Qt(s.set))), cn = (s, e = "input") => J(N.value(s), fe[e](Xt(s.set))), un = (s) => J(N.checked(s), zt(s.set)), hn = (s) => L((e) => (e.appendOrInsert(s), (t) => {
2700
+ t && ve(s);
2701
+ })), Ze = (s, ...e) => L((t) => {
2702
+ const n = t.makeChildElement(s, void 0), r = e.map((i) => W(i).render(n));
2703
+ return (i) => {
2704
+ r.forEach((o) => o(!1)), n.clear(i);
2370
2705
  };
2371
- let d = t.length - 1;
2372
- const f = t.map((h, p) => {
2373
- if (!y.is(h)) {
2374
- const v = D(h);
2375
- return i[p] = v, () => {
2376
- };
2377
- }
2378
- return h.on(() => {
2379
- u(h, p), d === 0 ? c.value = l.every((v) => v) : d--;
2380
- });
2381
- });
2382
- return c.on((h) => {
2383
- a?.(!0), a = null, h ? a = g(e(...i)).render(r) : a = g(s?.() ?? x).render(r);
2384
- }), (h) => {
2385
- i.forEach((p) => p?.dispose()), c.dispose(), f.forEach((p) => p()), a?.(h), r.clear(h);
2706
+ }), Te = (s, e, ...t) => L((n) => {
2707
+ const r = n.makeChildElement(s, e), i = t.map((o) => W(o).render(r));
2708
+ return (o) => {
2709
+ i.forEach((l) => l(!1)), r.clear(o);
2386
2710
  };
2387
- }), Je = (t, e, s) => ge(
2388
- t,
2389
- (n) => m(
2390
- (r) => Ut(
2391
- r,
2392
- n,
2393
- (o) => o ? e() : s?.()
2394
- )
2395
- ),
2396
- (n) => {
2397
- if (n) {
2398
- const r = e();
2399
- return r != null ? g(r) : x;
2400
- }
2401
- return g(s?.());
2711
+ }), ts = new Proxy(
2712
+ {},
2713
+ {
2714
+ /**
2715
+ * Creates a renderable that represents an HTML element.
2716
+ * @param tagName - The HTML tag name.
2717
+ * @returns A renderable function that creates and appends the HTML element to the DOM.
2718
+ */
2719
+ get: (s, e) => (...t) => Ze(e, t.flatMap(W))
2402
2720
  }
2403
- ), qs = (t, e, s) => Je(
2404
- w.map(t, (n) => !n),
2405
- e,
2406
- s
2407
- ), ze = (t, e, s) => {
2408
- if (s != null)
2409
- return ze(t, (n) => {
2410
- const r = new de(
2411
- n.index,
2412
- n.total.map((o) => o - 1)
2413
- );
2414
- return E(
2415
- g(e(n)),
2416
- Je(
2417
- n.isLast,
2418
- () => x,
2419
- () => s(r)
2420
- )
2421
- );
2422
- });
2423
- if (y.is(t))
2424
- return m((n) => {
2425
- const r = t.derive(), o = n.makeRef(), i = [], l = [];
2426
- return r.on((a) => {
2427
- const c = i.splice(a), u = l.splice(a);
2428
- for (const d of u)
2429
- d.dispose();
2430
- for (const d of c)
2431
- d(!0);
2432
- for (let d = i.length; d < a; d++) {
2433
- const f = new de(d, r), h = new z();
2434
- l.push(h), i.push(
2435
- k(
2436
- h,
2437
- () => g(e(f)).render(o)
2438
- )
2439
- );
2440
- }
2441
- }), (a) => {
2442
- for (const c of l)
2443
- c.dispose();
2444
- l.length = 0, r.dispose();
2445
- for (const c of i)
2446
- c(a);
2447
- i.length = 0, o.clear(a);
2448
- };
2449
- });
2721
+ ), dn = new Proxy(
2722
+ {},
2450
2723
  {
2451
- const n = re(t);
2452
- return E(
2453
- ...Array.from({ length: t }, (r, o) => o).map((r) => {
2454
- const o = new de(r, n);
2455
- return g(e(o));
2456
- })
2457
- );
2724
+ /**
2725
+ * Creates a renderable that represents an HTMLInput element.
2726
+ * @param type - The input type name.
2727
+ * @returns A renderable function that creates and appends the HTMLInput element to the DOM.
2728
+ */
2729
+ get: (s, e) => (...t) => Ze("input", N.type(e), ...t)
2458
2730
  }
2459
- }, Fs = (t, e, s) => {
2460
- const n = w.map(t, (o) => o.length), r = w.toSignal(t);
2461
- return ze(
2462
- n,
2463
- (o) => {
2464
- const i = r.map((l) => l[o.index]);
2465
- return g(e(i, o));
2466
- },
2467
- s
2468
- );
2469
- }, me = (...t) => m(
2470
- (e) => (s) => t.forEach((n) => {
2471
- typeof n == "function" ? n(s, e) : n.dispose(s, e);
2472
- })
2473
- ), Ws = (t, e) => {
2474
- if (y.is(t)) {
2475
- const s = t;
2476
- return m((n) => {
2477
- n = n.makeRef();
2478
- const r = s.map((l) => g(e(l)));
2479
- let o = () => {
2480
- };
2481
- const i = r.on((l) => {
2482
- o(!0), o = l.render(n);
2483
- });
2484
- return (l) => {
2485
- i(), o(l);
2486
- };
2487
- });
2731
+ ), et = "http://www.w3.org/2000/svg", fn = (s, ...e) => Te(s, et, ...e), pn = new Proxy(
2732
+ {},
2733
+ {
2734
+ /**
2735
+ * Creates a renderable that represents an SVG element.
2736
+ * @param tagName - The SVG tag name.
2737
+ * @returns A renderable function that creates and appends the SVG element to the DOM.
2738
+ */
2739
+ get: (s, e) => (...t) => Te(e, et, t.flatMap(W))
2488
2740
  }
2489
- return g(e(t));
2490
- }, ye = (t) => m((e) => {
2741
+ ), tt = "http://www.w3.org/1998/Math/MathML", mn = (s, ...e) => Te(s, tt, ...e), gn = new Proxy(
2742
+ {},
2743
+ {
2744
+ /**
2745
+ * Creates a renderable that represents an Math element.
2746
+ * @param tagName - The Math tag name.
2747
+ * @returns A renderable function that creates and appends the Math element to the DOM.
2748
+ */
2749
+ get: (s, e) => (...t) => Te(e, tt, t.flatMap(W))
2750
+ }
2751
+ ), xe = (s) => L((e) => {
2491
2752
  if (e.isBrowser()) {
2492
- const s = t(e);
2493
- if (s != null)
2494
- return g(s).render(e);
2753
+ const t = s(e);
2754
+ if (t != null)
2755
+ return W(t).render(e);
2495
2756
  }
2496
2757
  return () => {
2497
2758
  };
2498
2759
  });
2499
- function Us({
2500
- src: t,
2760
+ function yn({
2761
+ src: s,
2501
2762
  name: e,
2502
- width: s,
2763
+ width: t,
2503
2764
  height: n,
2504
2765
  sandbox: r,
2505
- allow: o,
2506
- referrerpolicy: i,
2766
+ allow: i,
2767
+ referrerpolicy: o,
2507
2768
  loading: l,
2508
- iframeChild: a,
2509
- onLoad: c
2510
- } = {}, ...u) {
2511
- return Rt.iframe(
2512
- A.src(t),
2513
- A.name(e),
2514
- A.width(
2515
- s != null ? w.map(s, String) : void 0
2769
+ iframeChild: f,
2770
+ onLoad: d
2771
+ } = {}, ...v) {
2772
+ return ts.iframe(
2773
+ N.src(s),
2774
+ N.name(e),
2775
+ N.width(
2776
+ t != null ? C.map(t, String) : void 0
2516
2777
  ),
2517
- A.height(
2518
- n != null ? w.map(n, String) : void 0
2778
+ N.height(
2779
+ n != null ? C.map(n, String) : void 0
2519
2780
  ),
2520
- A.sandbox(r),
2521
- A.allow(o),
2522
- A.referrerpolicy(i),
2523
- a,
2524
- ye((d) => {
2525
- const f = d.element;
2526
- let h, p = !1;
2527
- const v = () => {
2528
- if (p) return;
2529
- p = !0;
2530
- const S = f.contentDocument;
2531
- if (S && (c && c(f), u.length > 0)) {
2532
- const b = S.body;
2533
- if (b) {
2534
- const L = d.withElement(b);
2535
- h = G(E(...u), L);
2781
+ N.sandbox(r),
2782
+ N.allow(i),
2783
+ N.referrerpolicy(o),
2784
+ f,
2785
+ xe((S) => {
2786
+ const O = S.element;
2787
+ let T, A = !1;
2788
+ const $ = () => {
2789
+ if (A) return;
2790
+ A = !0;
2791
+ const M = O.contentDocument;
2792
+ if (M && (d && d(O), v.length > 0)) {
2793
+ const x = M.body;
2794
+ if (x) {
2795
+ const R = S.withElement(x);
2796
+ T = he(J(...v), R);
2536
2797
  }
2537
2798
  }
2538
2799
  };
2539
- return l != null && w.on(l, (S) => {
2540
- f.loading = S;
2541
- }), (u.length > 0 || c) && (t || setTimeout(v, 0)), E(
2542
- u.length > 0 || c ? Y.load(v) : x,
2543
- me(() => {
2544
- h && h(!1);
2800
+ return l != null && C.on(l, (M) => {
2801
+ O.loading = M;
2802
+ }), (v.length > 0 || d) && (s || setTimeout($, 0)), J(
2803
+ v.length > 0 || d ? fe.load($) : jt,
2804
+ Xe(() => {
2805
+ T && T(!1);
2545
2806
  })
2546
2807
  );
2547
2808
  })
2548
2809
  );
2549
2810
  }
2550
- const Js = (t, e, s = () => x) => le(
2551
- w.map(
2552
- t,
2553
- (n) => n.length > 0 ? { notEmpty: n } : { whenEmpty: null }
2554
- ),
2555
- {
2556
- notEmpty: (n) => e(n),
2557
- whenEmpty: () => s()
2558
- }
2559
- ), zs = (t, e) => m((s) => {
2560
- const n = s.makePortal(t), r = G(g(e), n);
2811
+ const vn = (s, e) => L((t) => {
2812
+ const n = t.makePortal(s), r = he(W(e), n);
2561
2813
  return () => r(!0);
2562
- }), ee = /* @__PURE__ */ new Map(), zt = (t) => ({
2563
- mark: Ge(`Probe(${t.description})`),
2814
+ }), ge = /* @__PURE__ */ new Map(), ss = (s) => ({
2815
+ mark: st(`Probe(${s.description})`),
2564
2816
  create: ({ callback: e = () => {
2565
- }, timeout: s = 10 } = {}) => {
2817
+ }, timeout: t = 10 } = {}) => {
2566
2818
  const n = (l) => {
2567
- clearTimeout(r), ee.delete(t), e(l);
2819
+ clearTimeout(r), ge.delete(s), e(l);
2568
2820
  };
2569
- if (ee.has(t))
2570
- throw new Error(`Probe already exists: ${t.description}`);
2571
- const r = setTimeout(() => n("timeout"), s), o = { counter: 0, timeoutId: r };
2572
- return ee.set(t, o), {
2821
+ if (ge.has(s))
2822
+ throw new Error(`Probe already exists: ${s.description}`);
2823
+ const r = setTimeout(() => n("timeout"), t), i = { counter: 0, timeoutId: r };
2824
+ return ge.set(s, i), {
2573
2825
  value: () => {
2574
2826
  clearTimeout(r);
2575
- const l = ee.get(t);
2827
+ const l = ge.get(s);
2576
2828
  l != null && --l.counter === 0 && n("resolved");
2577
2829
  },
2578
2830
  dispose: () => n("disposed"),
2579
- onUse: () => o.counter++
2831
+ onUse: () => i.counter++
2580
2832
  };
2581
2833
  }
2582
- }), Gs = zt(Symbol("GlobalProbe"));
2583
- function Ks({
2584
- mode: t,
2834
+ }), wn = ss(Symbol("GlobalProbe"));
2835
+ function bn({
2836
+ mode: s,
2585
2837
  delegatesFocus: e,
2586
- slotAssignment: s,
2838
+ slotAssignment: t,
2587
2839
  clonable: n,
2588
2840
  serializable: r
2589
- }, ...o) {
2590
- return ye((i) => {
2591
- const l = { mode: t };
2592
- e !== void 0 && (l.delegatesFocus = e), s !== void 0 && (l.slotAssignment = s), n !== void 0 && (l.clonable = n), r !== void 0 && (l.serializable = r);
2593
- const a = i.element.attachShadow(l), c = i.withElement(a), u = G(E(...o), c);
2594
- return me(() => u(!0));
2841
+ }, ...i) {
2842
+ return xe((o) => {
2843
+ const l = { mode: s };
2844
+ e !== void 0 && (l.delegatesFocus = e), t !== void 0 && (l.slotAssignment = t), n !== void 0 && (l.clonable = n), r !== void 0 && (l.serializable = r);
2845
+ const f = o.element.attachShadow(l), d = o.withElement(f), v = he(J(...i), d);
2846
+ return Xe(() => v(!0));
2595
2847
  });
2596
2848
  }
2597
- const Gt = (t, e) => m((s) => {
2598
- const n = s.getStyle(t);
2599
- return s.setStyle(t, e), (r) => {
2600
- r && s.setStyle(t, n);
2849
+ const ns = (s, e) => L((t) => {
2850
+ const n = t.getStyle(s);
2851
+ return t.setStyle(s, e), (r) => {
2852
+ r && t.setStyle(s, n);
2601
2853
  };
2602
- }), Kt = (t, e) => m((s) => {
2603
- const n = s.getStyle(t), r = e.on((o) => s.setStyle(t, o));
2604
- return (o) => {
2605
- r(), o && s.setStyle(t, n);
2854
+ }), rs = (s, e) => L((t) => {
2855
+ const n = t.getStyle(s), r = e.on((i) => t.setStyle(s, i));
2856
+ return (i) => {
2857
+ r(), i && t.setStyle(s, n);
2606
2858
  };
2607
- }), Se = (t, e) => y.is(e) ? Kt(t, e) : Gt(t, e), Ys = new Proxy({}, {
2859
+ }), ke = (s, e) => _.is(e) ? rs(s, e) : ns(s, e), Sn = new Proxy({}, {
2608
2860
  /**
2609
2861
  * Creates a renderable component for the specified `style` property.
2610
2862
  *
@@ -2613,191 +2865,165 @@ const Gt = (t, e) => m((s) => {
2613
2865
  * @returns The renderable component for the specified attribute.
2614
2866
  *
2615
2867
  */
2616
- get: (t, e) => e === "variable" ? (s, n) => Se(s, n) : (s) => Se(e, s)
2617
- }), Xs = (t) => m((e) => {
2618
- const s = t(e);
2619
- return s == null ? () => {
2620
- } : g(s).render(e);
2621
- }), Qs = (t) => ye((e) => t(e.element)), Zs = (t) => m((e) => {
2868
+ get: (s, e) => e === "variable" ? (t, n) => ke(t, n) : (t) => ke(e, t)
2869
+ }), is = (s) => L((e) => e.makeChildText(s).clear), os = (s) => L((e) => {
2870
+ const t = e.makeChildText(s.value), n = s.on(t.setText);
2871
+ return (r) => {
2872
+ n(), t.clear(r);
2873
+ };
2874
+ }), Tn = (s) => _.is(s) ? os(s) : is(s), An = (s) => L((e) => {
2875
+ const t = s(e);
2876
+ return t == null ? () => {
2877
+ } : W(t).render(e);
2878
+ }), _n = (s) => xe((e) => s(e.element)), En = (s) => L((e) => {
2622
2879
  if (e.isHeadlessDOM()) {
2623
- const s = t(e);
2624
- if (s)
2625
- return g(s).render(e);
2880
+ const t = s(e);
2881
+ if (t)
2882
+ return W(t).render(e);
2626
2883
  }
2627
2884
  return () => {
2628
2885
  };
2629
- }), en = (t) => m((e) => {
2630
- const s = new z(), n = k(
2631
- s,
2632
- () => g(t(s)).render(e)
2633
- );
2634
- return (r) => {
2635
- s.dispose(), n(r);
2636
- };
2637
- }), we = (t) => m((e) => {
2638
- let s = e;
2639
- function n() {
2640
- return s;
2641
- }
2642
- function r(l) {
2643
- s = l;
2644
- }
2645
- const o = [], i = t({
2646
- use: ({ mark: l }) => {
2647
- const { value: a, onUse: c } = n().getProvider(l);
2648
- return c?.(), a;
2649
- },
2650
- set: ({ mark: l, create: a }, c) => {
2651
- const { value: u, dispose: d, onUse: f } = a(c, n());
2652
- o.push(d), r(n().setProvider(l, u, f));
2653
- }
2654
- });
2655
- return i == null ? () => {
2656
- } : E(
2657
- g(i),
2658
- me(() => o.forEach((l) => l()))
2659
- ).render(n());
2660
- }), tn = (t, e, s) => we(({ set: n }) => (n(t, e), s())), sn = (t, e) => we(({ use: s }) => e(s(t))), nn = (...t) => (e) => we(({ use: s }) => {
2661
- const n = t.map(s);
2662
- return e(...n);
2663
2886
  });
2664
2887
  export {
2665
- Ht as Aria,
2666
- Cs as Async,
2667
- Mt as Attr,
2668
- Is as BindChecked,
2669
- Ps as BindDate,
2670
- Os as BindDateTime,
2671
- ks as BindNumber,
2672
- Ms as BindText,
2673
- j as BrowserContext,
2674
- B as CLASS_PLACEHOLDER_ATTR,
2675
- R as Computed,
2676
- Rs as Conjunction,
2677
- js as DOMNode,
2678
- It as DataAttr,
2679
- z as DisposalScope,
2680
- Ve as El,
2681
- ie as ElNS,
2682
- de as ElementPosition,
2683
- x as Empty,
2684
- Vs as Ensure,
2685
- Bs as EnsureAll,
2686
- Fs as ForEach,
2687
- E as Fragment,
2688
- Gs as GlobalProbe,
2689
- fs as HeadlessAdapter,
2690
- V as HeadlessContext,
2691
- Tt as HeadlessElement,
2692
- $e as HeadlessPortal,
2693
- Et as HeadlessText,
2694
- Us as IFrame,
2695
- Ws as MapSignal,
2696
- $t as MathAttr,
2697
- Ts as MathEl,
2698
- Te as MemoryStore,
2699
- Js as NotEmpty,
2700
- jt as OnChecked,
2701
- me as OnDispose,
2702
- le as OneOf,
2703
- Ue as OneOfField,
2704
- Hs as OneOfKind,
2888
+ Jt as Aria,
2889
+ Fs as Async,
2890
+ Wt as Attr,
2891
+ un as BindChecked,
2892
+ on as BindDate,
2893
+ ln as BindDateTime,
2894
+ an as BindNumber,
2895
+ cn as BindText,
2896
+ te as BrowserContext,
2897
+ oe as CLASS_PLACEHOLDER_ATTR,
2898
+ ee as Computed,
2899
+ Ws as Conjunction,
2900
+ hn as DOMNode,
2901
+ Ut as DataAttr,
2902
+ ie as DisposalScope,
2903
+ Ze as El,
2904
+ Te as ElNS,
2905
+ De as ElementPosition,
2906
+ jt as Empty,
2907
+ js as Ensure,
2908
+ Vs as EnsureAll,
2909
+ Ps as ForEach,
2910
+ J as Fragment,
2911
+ wn as GlobalProbe,
2912
+ Pt as HYDRATION_ID_ATTR,
2913
+ Es as HeadlessAdapter,
2914
+ se as HeadlessContext,
2915
+ It as HeadlessElement,
2916
+ Ye as HeadlessPortal,
2917
+ $t as HeadlessText,
2918
+ yn as IFrame,
2919
+ Rs as MapSignal,
2920
+ Gt as MathAttr,
2921
+ mn as MathEl,
2922
+ He as MemoryStore,
2923
+ Bs as NotEmpty,
2924
+ zt as OnChecked,
2925
+ Xe as OnDispose,
2926
+ Ms as OneOf,
2927
+ ks as OneOfField,
2928
+ Is as OneOfKind,
2705
2929
  Ns as OneOfTuple,
2706
2930
  $s as OneOfType,
2707
- Jt as OneOfValue,
2708
- zs as Portal,
2709
- se as Prop,
2710
- tn as Provide,
2711
- Me as ProviderNotFoundError,
2712
- gt as RenderingError,
2713
- ze as Repeat,
2714
- Nt as SVGAttr,
2715
- _s as SVGEl,
2716
- Ks as ShadowRoot,
2717
- y as Signal,
2718
- Fe as Task,
2719
- ms as TextNode,
2720
- qs as Unless,
2721
- sn as Use,
2722
- nn as UseMany,
2723
- w as Value,
2724
- Je as When,
2725
- ye as WithBrowserCtx,
2726
- Xs as WithCtx,
2727
- Qs as WithElement,
2728
- Zs as WithHeadlessCtx,
2729
- we as WithProvider,
2730
- en as WithScope,
2731
- fe as _NODE_PLACEHOLDER_ATTR,
2732
- pt as _getSelfOrParentElement,
2733
- Oe as _isElement,
2734
- ke as _isFragment,
2735
- ft as _makeGetter,
2736
- dt as _makeSetter,
2737
- te as _removeDOMNode,
2738
- je as _signalText,
2739
- Re as _staticText,
2740
- ns as animateSignal,
2741
- ut as animateSignals,
2742
- ws as aria,
2743
- A as attr,
2744
- as as bind,
2745
- cs as coalesce,
2746
- ne as computed,
2747
- J as computedOf,
2748
- Yt as computedOfAsync,
2749
- ht as computedRecord,
2750
- Ke as createRenderable,
2751
- ys as dataAttr,
2752
- os as delaySignal,
2753
- Ae as effect,
2754
- Ze as effectOf,
2755
- Vt as emit,
2756
- Ls as emitChecked,
2757
- M as emitTarget,
2758
- Bt as emitValue,
2759
- Ft as emitValueAsDate,
2760
- Wt as emitValueAsDateTime,
2761
- Ds as emitValueAsNullableDate,
2762
- xs as emitValueAsNullableDateTime,
2763
- qt as emitValueAsNumber,
2764
- it as endInterpolate,
2765
- pe as getCurrentScope,
2766
- Zt as getParentScope,
2767
- Qt as getScopeStack,
2768
- gs as getWindow,
2769
- lt as guessInterpolate,
2770
- Rt as html,
2771
- Ss as input,
2772
- ot as interpolateDate,
2773
- nt as interpolateNumber,
2774
- rt as interpolateString,
2775
- Xt as joinSignals,
2776
- ts as localStorageProp,
2777
- zt as makeProbe,
2778
- Ge as makeProviderMark,
2779
- Es as math,
2780
- bs as mathAttr,
2781
- rs as merge,
2782
- Y as on,
2783
- tt as popScope,
2784
- is as previousSignal,
2785
- D as prop,
2786
- et as pushScope,
2787
- hs as render,
2788
- G as renderWithContext,
2789
- g as renderableOfTNode,
2790
- ps as restoreTempoPlaceholders,
2791
- ds as runHeadless,
2792
- es as scoped,
2793
- ss as sessionStorageProp,
2794
- re as signal,
2795
- ls as slidingWindowSignal,
2796
- Ee as storedProp,
2797
- Ys as style,
2798
- As as svg,
2799
- vs as svgAttr,
2800
- us as syncProp,
2801
- ce as untracked,
2802
- k as withScope
2931
+ Hs as OneOfValue,
2932
+ vn as Portal,
2933
+ we as Prop,
2934
+ Ks as Provide,
2935
+ Je as ProviderNotFoundError,
2936
+ _t as RenderingError,
2937
+ Ls as Repeat,
2938
+ Kt as SVGAttr,
2939
+ fn as SVGEl,
2940
+ bn as ShadowRoot,
2941
+ _ as Signal,
2942
+ qs as Task,
2943
+ Tn as TextNode,
2944
+ xs as Unless,
2945
+ Gs as Use,
2946
+ zs as UseMany,
2947
+ C as Value,
2948
+ Os as When,
2949
+ xe as WithBrowserCtx,
2950
+ An as WithCtx,
2951
+ _n as WithElement,
2952
+ En as WithHeadlessCtx,
2953
+ Js as WithProvider,
2954
+ Us as WithScope,
2955
+ Ce as _NODE_PLACEHOLDER_ATTR,
2956
+ Tt as _getSelfOrParentElement,
2957
+ We as _isElement,
2958
+ Ue as _isFragment,
2959
+ St as _makeGetter,
2960
+ bt as _makeSetter,
2961
+ ve as _removeDOMNode,
2962
+ os as _signalText,
2963
+ is as _staticText,
2964
+ ms as animateSignal,
2965
+ vt as animateSignals,
2966
+ Zs as aria,
2967
+ N as attr,
2968
+ bs as bind,
2969
+ Ss as coalesce,
2970
+ be as computed,
2971
+ ne as computedOf,
2972
+ ls as computedOfAsync,
2973
+ as as computedOfAsyncGenerator,
2974
+ wt as computedRecord,
2975
+ At as createRenderKit,
2976
+ nt as createRenderable,
2977
+ Qs as dataAttr,
2978
+ ys as delaySignal,
2979
+ $e as effect,
2980
+ lt as effectOf,
2981
+ Yt as emit,
2982
+ rn as emitChecked,
2983
+ Y as emitTarget,
2984
+ Xt as emitValue,
2985
+ Zt as emitValueAsDate,
2986
+ es as emitValueAsDateTime,
2987
+ sn as emitValueAsNullableDate,
2988
+ nn as emitValueAsNullableDateTime,
2989
+ Qt as emitValueAsNumber,
2990
+ pt as endInterpolate,
2991
+ Oe as getCurrentScope,
2992
+ hs as getParentScope,
2993
+ us as getScopeStack,
2994
+ Cs as getWindow,
2995
+ mt as guessInterpolate,
2996
+ ts as html,
2997
+ dn as input,
2998
+ ft as interpolateDate,
2999
+ ht as interpolateNumber,
3000
+ dt as interpolateString,
3001
+ cs as joinSignals,
3002
+ fs as localStorageProp,
3003
+ ss as makeProbe,
3004
+ st as makeProviderMark,
3005
+ gn as math,
3006
+ tn as mathAttr,
3007
+ gs as merge,
3008
+ fe as on,
3009
+ ct as popScope,
3010
+ vs as previousSignal,
3011
+ B as prop,
3012
+ at as pushScope,
3013
+ As as render,
3014
+ he as renderWithContext,
3015
+ W as renderableOfTNode,
3016
+ Ds as restoreTempoPlaceholders,
3017
+ _s as runHeadless,
3018
+ ds as scoped,
3019
+ ps as sessionStorageProp,
3020
+ ye as signal,
3021
+ ws as slidingWindowSignal,
3022
+ Ne as storedProp,
3023
+ Sn as style,
3024
+ pn as svg,
3025
+ en as svgAttr,
3026
+ Ts as syncProp,
3027
+ Ae as untracked,
3028
+ z as withScope
2803
3029
  };