@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/dom/errors.d.ts +1 -9
- package/dom/headless-context.d.ts +58 -0
- package/index.cjs +1 -1
- package/index.d.ts +4 -1
- package/index.js +1426 -1200
- package/package.json +3 -2
- package/renderable/async.d.ts +2 -36
- package/renderable/conjunction.d.ts +2 -25
- package/renderable/element.d.ts +2 -8
- package/renderable/empty.d.ts +1 -7
- package/renderable/ensure.d.ts +2 -90
- package/renderable/foreach.d.ts +1 -63
- package/renderable/fragment.d.ts +1 -14
- package/renderable/map-signal.d.ts +1 -18
- package/renderable/not-empty.d.ts +1 -15
- package/renderable/on-dispose.d.ts +9 -9
- package/renderable/oneof.d.ts +2 -153
- package/renderable/provider.d.ts +7 -228
- package/renderable/repeat.d.ts +1 -70
- package/renderable/shared.d.ts +8 -0
- package/renderable/task.d.ts +2 -22
- package/renderable/utils.d.ts +1 -30
- package/renderable/when.d.ts +1 -20
- package/renderable/with-scope.d.ts +1 -39
- package/types/domain.d.ts +3 -12
package/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const st = (s) => Symbol(s);
|
|
2
|
+
function nt(s, e) {
|
|
3
3
|
return {
|
|
4
|
-
type:
|
|
4
|
+
type: s,
|
|
5
5
|
render: e
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function Ie(s) {
|
|
9
|
+
return s != null && s !== !1 && s !== 0 && s !== "";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return !
|
|
11
|
+
function rt(s) {
|
|
12
|
+
return !Ie(s);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
14
|
+
function it(s) {
|
|
15
|
+
return s == null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function ot(s) {
|
|
18
|
+
return s != null;
|
|
19
19
|
}
|
|
20
|
-
const
|
|
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: (
|
|
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: (
|
|
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: (
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
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: (
|
|
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: (
|
|
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: (
|
|
75
|
-
|
|
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: (
|
|
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: (
|
|
95
|
+
deriveProp: (s, {
|
|
96
96
|
autoDisposeProp: e = !0,
|
|
97
|
-
equals:
|
|
98
|
-
} = {}) =>
|
|
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: (
|
|
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: (
|
|
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: (
|
|
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: (
|
|
123
|
-
},
|
|
124
|
-
if (
|
|
125
|
-
return
|
|
126
|
-
const n =
|
|
127
|
-
return
|
|
128
|
-
() => e(...
|
|
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
|
-
|
|
130
|
+
t
|
|
131
131
|
);
|
|
132
|
-
},
|
|
133
|
-
([...o
|
|
134
|
-
|
|
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
|
-
),
|
|
138
|
-
const e = Object.keys(
|
|
139
|
-
return
|
|
140
|
-
(...
|
|
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
|
-
},
|
|
143
|
-
const n =
|
|
144
|
-
return
|
|
145
|
-
() => e(...
|
|
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
|
-
|
|
158
|
+
t
|
|
148
159
|
);
|
|
149
160
|
};
|
|
150
|
-
class
|
|
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 (
|
|
196
|
-
const n =
|
|
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,
|
|
224
|
-
const n =
|
|
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,
|
|
238
|
-
const r =
|
|
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,
|
|
252
|
-
return
|
|
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 (
|
|
264
|
-
const r =
|
|
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 (
|
|
288
|
+
return (t, n) => z(this, () => lt(...e)(t, n));
|
|
278
289
|
}
|
|
279
290
|
}
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
},
|
|
283
|
-
if (
|
|
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
|
-
|
|
286
|
-
},
|
|
287
|
-
|
|
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
|
-
|
|
302
|
+
ct();
|
|
292
303
|
}
|
|
293
|
-
},
|
|
294
|
-
const e = new
|
|
304
|
+
}, ds = (s) => {
|
|
305
|
+
const e = new ie();
|
|
295
306
|
try {
|
|
296
|
-
return
|
|
307
|
+
return z(e, () => s(e));
|
|
297
308
|
} finally {
|
|
298
309
|
e.dispose();
|
|
299
310
|
}
|
|
300
|
-
},
|
|
301
|
-
const e =
|
|
302
|
-
|
|
311
|
+
}, Ae = (s) => {
|
|
312
|
+
const e = j.slice();
|
|
313
|
+
j.length = 0;
|
|
303
314
|
try {
|
|
304
|
-
return
|
|
315
|
+
return s();
|
|
305
316
|
} finally {
|
|
306
|
-
|
|
317
|
+
j.length = 0, j.push(...e);
|
|
307
318
|
}
|
|
308
319
|
};
|
|
309
|
-
class
|
|
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,
|
|
318
|
-
this.equals =
|
|
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,
|
|
362
|
-
const
|
|
363
|
-
return e.then((
|
|
364
|
-
n != null ?
|
|
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
|
-
|
|
377
|
+
o
|
|
367
378
|
);
|
|
368
|
-
}),
|
|
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,
|
|
446
|
-
|
|
447
|
-
const n =
|
|
448
|
-
r(), e(
|
|
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
|
|
453
|
-
|
|
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
|
|
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,
|
|
476
|
+
onChange = (e, t = {}) => {
|
|
466
477
|
let n = 0;
|
|
467
|
-
const r = (
|
|
468
|
-
n++ > 0 && e(
|
|
478
|
+
const r = (i, o) => {
|
|
479
|
+
n++ > 0 && e(i, o);
|
|
469
480
|
};
|
|
470
|
-
return this.on(r,
|
|
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
|
|
478
|
-
this.equals(
|
|
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,
|
|
567
|
-
const n = new
|
|
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
|
-
},
|
|
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,
|
|
587
|
-
const n = new
|
|
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
|
-
},
|
|
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((
|
|
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((
|
|
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,
|
|
631
|
+
get: (e, t) => this.at(t)
|
|
621
632
|
});
|
|
622
633
|
}
|
|
623
|
-
filter = (e,
|
|
624
|
-
let n =
|
|
625
|
-
const r = new
|
|
634
|
+
filter = (e, t) => {
|
|
635
|
+
let n = t ?? this.get();
|
|
636
|
+
const r = new ee(() => {
|
|
626
637
|
try {
|
|
627
|
-
const
|
|
628
|
-
return n = e(
|
|
629
|
-
} catch (
|
|
630
|
-
throw console.error("Error in Signal.filter:",
|
|
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,
|
|
646
|
-
let r =
|
|
647
|
-
const
|
|
656
|
+
filterMap = (e, t, n = (r, i) => r === i) => {
|
|
657
|
+
let r = t;
|
|
658
|
+
const i = new ee(() => {
|
|
648
659
|
try {
|
|
649
|
-
const
|
|
650
|
-
return r = e(
|
|
651
|
-
} catch (
|
|
652
|
-
throw console.error("Error in Signal.filterMap:",
|
|
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(
|
|
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,
|
|
671
|
-
const
|
|
672
|
-
let
|
|
673
|
-
return
|
|
674
|
-
this.on(async (
|
|
675
|
-
const
|
|
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
|
|
679
|
-
|
|
680
|
-
} catch (
|
|
681
|
-
if (
|
|
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
|
-
|
|
758
|
+
i.set(n(v));
|
|
684
759
|
else
|
|
685
|
-
throw
|
|
760
|
+
throw v;
|
|
686
761
|
}
|
|
687
762
|
})
|
|
688
|
-
),
|
|
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,
|
|
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,
|
|
708
|
-
const n = this.on(e.set, { noAutoDispose: !
|
|
709
|
-
return e.onDispose(n),
|
|
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:
|
|
721
|
-
} = {}) => this.feedProp(
|
|
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
|
|
751
|
-
class
|
|
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,
|
|
777
|
-
super(void 0,
|
|
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
|
-
|
|
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
|
|
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, ...
|
|
944
|
+
reducer = (e, ...t) => {
|
|
870
945
|
const n = this;
|
|
871
|
-
return function r(
|
|
872
|
-
const
|
|
873
|
-
n.update((l) => e(l,
|
|
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:
|
|
950
|
+
previousState: o,
|
|
876
951
|
state: n.value,
|
|
877
|
-
action:
|
|
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,
|
|
895
|
-
const r = new
|
|
896
|
-
return r.onDispose(this.on((
|
|
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
|
-
(
|
|
906
|
-
(
|
|
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
|
|
919
|
-
const n = new
|
|
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
|
-
},
|
|
922
|
-
let n =
|
|
923
|
-
|
|
924
|
-
} :
|
|
925
|
-
if (
|
|
926
|
-
let
|
|
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
|
-
|
|
1004
|
+
o ? l() : o = !0;
|
|
930
1005
|
};
|
|
931
1006
|
}
|
|
932
|
-
const r =
|
|
933
|
-
r.dispose(),
|
|
934
|
-
};
|
|
935
|
-
return
|
|
936
|
-
},
|
|
937
|
-
const
|
|
938
|
-
return
|
|
939
|
-
},
|
|
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
|
-
),
|
|
943
|
-
const n = Math.max(
|
|
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
|
|
946
|
-
let
|
|
947
|
-
isNaN(
|
|
948
|
-
let l = e.charCodeAt(
|
|
949
|
-
isNaN(l) && (l =
|
|
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
|
-
},
|
|
953
|
-
class
|
|
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,
|
|
967
|
-
this._store.set(e,
|
|
1041
|
+
setItem = (e, t) => {
|
|
1042
|
+
this._store.set(e, t);
|
|
968
1043
|
};
|
|
969
1044
|
}
|
|
970
|
-
let
|
|
971
|
-
const
|
|
972
|
-
key:
|
|
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:
|
|
1049
|
+
store: t,
|
|
975
1050
|
serialize: n = JSON.stringify,
|
|
976
1051
|
deserialize: r = JSON.parse,
|
|
977
|
-
equals:
|
|
978
|
-
onLoad:
|
|
1052
|
+
equals: i = (d, v) => d === v,
|
|
1053
|
+
onLoad: o = (d) => d,
|
|
979
1054
|
syncTabs: l = !0,
|
|
980
|
-
onKeyChange:
|
|
1055
|
+
onKeyChange: f = "load"
|
|
981
1056
|
}) => {
|
|
982
|
-
let
|
|
983
|
-
const
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
),
|
|
987
|
-
let
|
|
988
|
-
const
|
|
989
|
-
if (!
|
|
990
|
-
const
|
|
991
|
-
const
|
|
992
|
-
if (!(
|
|
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
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
997
|
-
} catch (
|
|
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 "${
|
|
1000
|
-
|
|
1074
|
+
`Failed to sync storedProp for key "${k}" via BroadcastChannel`,
|
|
1075
|
+
re
|
|
1001
1076
|
);
|
|
1002
1077
|
} finally {
|
|
1003
|
-
|
|
1078
|
+
A = !1;
|
|
1004
1079
|
}
|
|
1005
1080
|
};
|
|
1006
|
-
return
|
|
1007
|
-
|
|
1008
|
-
}), { channel:
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
const X = (
|
|
1012
|
-
const
|
|
1013
|
-
if (
|
|
1014
|
-
const
|
|
1015
|
-
if (
|
|
1016
|
-
const
|
|
1017
|
-
if (
|
|
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
|
|
1020
|
-
|
|
1021
|
-
} catch (
|
|
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
|
-
|
|
1098
|
+
`Failed to load storedProp from new key "${k}"`,
|
|
1099
|
+
H
|
|
1025
1100
|
);
|
|
1026
1101
|
}
|
|
1027
1102
|
else
|
|
1028
|
-
|
|
1029
|
-
} else
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
};
|
|
1033
|
-
return
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
key:
|
|
1037
|
-
value:
|
|
1038
|
-
sourceId:
|
|
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
|
-
}),
|
|
1041
|
-
},
|
|
1042
|
-
const e =
|
|
1043
|
-
return
|
|
1044
|
-
...
|
|
1045
|
-
store:
|
|
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
|
-
},
|
|
1048
|
-
const e =
|
|
1049
|
-
return
|
|
1050
|
-
...
|
|
1051
|
-
store:
|
|
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
|
|
1055
|
-
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(
|
|
1129
|
+
function Le(s) {
|
|
1130
|
+
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(s) : setTimeout(s, 0);
|
|
1056
1131
|
}
|
|
1057
|
-
const
|
|
1058
|
-
const r = n?.duration ?? 300,
|
|
1059
|
-
let l = n?.interpolate,
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
}),
|
|
1064
|
-
|
|
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
|
|
1067
|
-
|
|
1068
|
-
},
|
|
1069
|
-
const
|
|
1070
|
-
l == null && (l =
|
|
1071
|
-
let X = l(
|
|
1072
|
-
|
|
1073
|
-
};
|
|
1074
|
-
return
|
|
1075
|
-
},
|
|
1076
|
-
const { initialValue:
|
|
1077
|
-
return
|
|
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
|
-
|
|
1080
|
-
|
|
1081
|
-
[
|
|
1154
|
+
t ?? s.get(),
|
|
1155
|
+
s.get,
|
|
1156
|
+
[s],
|
|
1082
1157
|
n
|
|
1083
1158
|
);
|
|
1084
|
-
},
|
|
1085
|
-
const
|
|
1086
|
-
return
|
|
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
|
|
1089
|
-
r[
|
|
1163
|
+
for (const i of n)
|
|
1164
|
+
r[i] = C.get(s[i]);
|
|
1090
1165
|
return e(r);
|
|
1091
|
-
},
|
|
1092
|
-
},
|
|
1093
|
-
const
|
|
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 =
|
|
1096
|
-
(
|
|
1170
|
+
const r = s.on(
|
|
1171
|
+
(i) => {
|
|
1097
1172
|
n != null && clearTimeout(n), n = setTimeout(
|
|
1098
1173
|
() => {
|
|
1099
|
-
n = null,
|
|
1174
|
+
n = null, t.set(i);
|
|
1100
1175
|
},
|
|
1101
|
-
typeof e == "function" ? e(
|
|
1176
|
+
typeof e == "function" ? e(i) : e
|
|
1102
1177
|
);
|
|
1103
1178
|
},
|
|
1104
1179
|
{ noAutoDispose: !0 }
|
|
1105
1180
|
);
|
|
1106
|
-
return
|
|
1181
|
+
return t.onDispose(() => {
|
|
1107
1182
|
r(), n != null && clearTimeout(n);
|
|
1108
|
-
}),
|
|
1109
|
-
},
|
|
1183
|
+
}), t;
|
|
1184
|
+
}, vs = (s) => {
|
|
1110
1185
|
let e;
|
|
1111
|
-
return
|
|
1186
|
+
return s.map((t) => {
|
|
1112
1187
|
const n = e;
|
|
1113
|
-
return e =
|
|
1188
|
+
return e = t, n;
|
|
1114
1189
|
});
|
|
1115
|
-
},
|
|
1116
|
-
size:
|
|
1190
|
+
}, ws = ({
|
|
1191
|
+
size: s = void 0,
|
|
1117
1192
|
signal: e
|
|
1118
1193
|
}) => {
|
|
1119
|
-
const
|
|
1120
|
-
return e.map((n) => (
|
|
1121
|
-
},
|
|
1122
|
-
|
|
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
|
-
)((
|
|
1125
|
-
function
|
|
1126
|
-
return
|
|
1127
|
-
for (const
|
|
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
|
|
1205
|
+
const Ts = (s, {
|
|
1131
1206
|
channel: e,
|
|
1132
|
-
serialize:
|
|
1207
|
+
serialize: t = JSON.stringify,
|
|
1133
1208
|
deserialize: n = JSON.parse,
|
|
1134
|
-
equals: r = (
|
|
1209
|
+
equals: r = (i, o) => i === o
|
|
1135
1210
|
}) => {
|
|
1136
|
-
const
|
|
1137
|
-
if (typeof
|
|
1211
|
+
const i = Se();
|
|
1212
|
+
if (typeof i?.BroadcastChannel != "function")
|
|
1138
1213
|
return () => {
|
|
1139
1214
|
};
|
|
1140
|
-
const
|
|
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
|
|
1144
|
-
const
|
|
1145
|
-
const
|
|
1146
|
-
if (!(
|
|
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
|
-
|
|
1149
|
-
const
|
|
1150
|
-
r(
|
|
1151
|
-
} catch (
|
|
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
|
-
|
|
1229
|
+
A
|
|
1155
1230
|
);
|
|
1156
1231
|
} finally {
|
|
1157
|
-
|
|
1232
|
+
f = !1;
|
|
1158
1233
|
}
|
|
1159
1234
|
};
|
|
1160
|
-
|
|
1161
|
-
const
|
|
1162
|
-
if (!
|
|
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
|
|
1165
|
-
|
|
1166
|
-
value:
|
|
1239
|
+
const A = t(O);
|
|
1240
|
+
o.postMessage({
|
|
1241
|
+
value: A,
|
|
1167
1242
|
sourceId: l
|
|
1168
1243
|
});
|
|
1169
|
-
} catch (
|
|
1244
|
+
} catch (A) {
|
|
1170
1245
|
console.warn(
|
|
1171
1246
|
`Failed to serialize prop for channel "${e}" via BroadcastChannel`,
|
|
1172
|
-
|
|
1247
|
+
A
|
|
1173
1248
|
);
|
|
1174
1249
|
}
|
|
1175
|
-
}),
|
|
1176
|
-
|
|
1250
|
+
}), S = () => {
|
|
1251
|
+
v(), o.removeEventListener("message", d), o.close();
|
|
1177
1252
|
};
|
|
1178
|
-
return
|
|
1253
|
+
return s.onDispose(S), S;
|
|
1179
1254
|
};
|
|
1180
|
-
class
|
|
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,
|
|
1187
|
-
this.index = e, this.total =
|
|
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
|
|
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
|
-
]),
|
|
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
|
-
]),
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
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
|
-
|
|
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,
|
|
1274
|
-
this.document = e, this.element =
|
|
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,
|
|
1285
|
-
return new
|
|
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,
|
|
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,
|
|
1318
|
-
const n = this.createElement(e,
|
|
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
|
|
1334
|
-
return this.appendOrInsert(
|
|
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
|
|
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
|
|
1422
|
-
if (
|
|
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(
|
|
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
|
|
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,
|
|
1888
|
+
setProvider = (e, t, n) => new te(this.document, this.element, this.reference, {
|
|
1441
1889
|
...this.providers,
|
|
1442
|
-
[e]: [
|
|
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
|
|
1454
|
-
const [
|
|
1455
|
-
return { value:
|
|
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 ?
|
|
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,
|
|
1487
|
-
const r = (
|
|
1488
|
-
return this.element.addEventListener(e, r, n), (
|
|
1489
|
-
|
|
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,
|
|
1519
|
-
this.element.style[e] =
|
|
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:
|
|
1529
|
-
set:
|
|
1976
|
+
get: St(e, this.element),
|
|
1977
|
+
set: bt(e, this.element)
|
|
1530
1978
|
});
|
|
1531
1979
|
getWindow = () => this.document.defaultView;
|
|
1532
1980
|
}
|
|
1533
|
-
const
|
|
1534
|
-
const
|
|
1981
|
+
const he = (s, e) => {
|
|
1982
|
+
const t = new ie(), n = z(t, () => s.render(e));
|
|
1535
1983
|
return (r = !0) => {
|
|
1536
|
-
|
|
1984
|
+
t.dispose(), n(r);
|
|
1537
1985
|
};
|
|
1538
|
-
},
|
|
1539
|
-
const
|
|
1540
|
-
if (
|
|
1541
|
-
throw new
|
|
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 && (
|
|
1545
|
-
const l =
|
|
1546
|
-
let
|
|
1547
|
-
return r &&
|
|
1548
|
-
|
|
1549
|
-
|
|
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
|
-
}),
|
|
1999
|
+
}), S.observe(o.parentElement, {
|
|
1552
2000
|
childList: !0,
|
|
1553
2001
|
subtree: !1,
|
|
1554
2002
|
attributes: !1
|
|
1555
2003
|
})), () => {
|
|
1556
|
-
|
|
2004
|
+
S?.disconnect(), v(!0);
|
|
1557
2005
|
};
|
|
1558
|
-
},
|
|
2006
|
+
}, _s = (s, {
|
|
1559
2007
|
startUrl: e = "https://example.com",
|
|
1560
|
-
selector:
|
|
2008
|
+
selector: t,
|
|
1561
2009
|
providers: n = {}
|
|
1562
2010
|
} = {
|
|
1563
2011
|
selector: "body"
|
|
1564
2012
|
}) => {
|
|
1565
|
-
const r =
|
|
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:
|
|
1568
|
-
root:
|
|
2015
|
+
clear: he(s(), o),
|
|
2016
|
+
root: i,
|
|
1569
2017
|
currentURL: r
|
|
1570
2018
|
};
|
|
1571
2019
|
};
|
|
1572
|
-
class
|
|
2020
|
+
class _t extends Error {
|
|
1573
2021
|
constructor(e) {
|
|
1574
2022
|
super(e);
|
|
1575
2023
|
}
|
|
1576
2024
|
}
|
|
1577
|
-
const
|
|
1578
|
-
class
|
|
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:
|
|
2102
|
+
getAttribute: t,
|
|
1655
2103
|
setAttribute: n,
|
|
1656
2104
|
getClass: r,
|
|
1657
|
-
setClass:
|
|
1658
|
-
getStyles:
|
|
2105
|
+
setClass: i,
|
|
2106
|
+
getStyles: o,
|
|
1659
2107
|
setStyles: l,
|
|
1660
|
-
appendHTML:
|
|
1661
|
-
getInnerHTML:
|
|
1662
|
-
setInnerHTML:
|
|
1663
|
-
getInnerText:
|
|
1664
|
-
setInnerText:
|
|
2108
|
+
appendHTML: f,
|
|
2109
|
+
getInnerHTML: d,
|
|
2110
|
+
setInnerHTML: v,
|
|
2111
|
+
getInnerText: S,
|
|
2112
|
+
setInnerText: O
|
|
1665
2113
|
}) {
|
|
1666
|
-
this.select = e, this.getAttribute =
|
|
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,
|
|
2124
|
+
setFromRoot = (e, t) => {
|
|
1677
2125
|
e.getPortals().forEach((r) => {
|
|
1678
|
-
const
|
|
1679
|
-
for (const
|
|
1680
|
-
if (
|
|
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(
|
|
1685
|
-
if (
|
|
1686
|
-
const l = this.getInnerHTML(
|
|
1687
|
-
l != null && this.setAttribute(
|
|
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(
|
|
2137
|
+
this.setInnerHTML(o, r.getInnerHTML());
|
|
1690
2138
|
}
|
|
1691
2139
|
if (r.hasInnerText()) {
|
|
1692
|
-
if (
|
|
1693
|
-
const l = this.getInnerText(
|
|
1694
|
-
l != null && this.setAttribute(
|
|
2140
|
+
if (t) {
|
|
2141
|
+
const l = this.getInnerText(o);
|
|
2142
|
+
l != null && this.setAttribute(o, ce, l);
|
|
1695
2143
|
}
|
|
1696
|
-
this.setInnerText(
|
|
2144
|
+
this.setInnerText(o, r.getInnerText());
|
|
1697
2145
|
}
|
|
1698
2146
|
if (r.hasClasses()) {
|
|
1699
|
-
if (
|
|
1700
|
-
const l = this.getClass(
|
|
1701
|
-
l != null && this.setAttribute(
|
|
2147
|
+
if (t) {
|
|
2148
|
+
const l = this.getClass(o);
|
|
2149
|
+
l != null && this.setAttribute(o, oe, l);
|
|
1702
2150
|
}
|
|
1703
|
-
this.setClass(
|
|
2151
|
+
this.setClass(o, r.getClasses().join(" "));
|
|
1704
2152
|
}
|
|
1705
2153
|
if (r.hasStyles()) {
|
|
1706
|
-
if (
|
|
1707
|
-
const l = this.getStyles(
|
|
2154
|
+
if (t) {
|
|
2155
|
+
const l = this.getStyles(o);
|
|
1708
2156
|
Object.keys(l).length > 0 && this.setAttribute(
|
|
1709
|
-
|
|
1710
|
-
|
|
2157
|
+
o,
|
|
2158
|
+
le,
|
|
1711
2159
|
JSON.stringify(l)
|
|
1712
2160
|
);
|
|
1713
2161
|
}
|
|
1714
|
-
this.setStyles(
|
|
2162
|
+
this.setStyles(o, r.getStyles());
|
|
1715
2163
|
}
|
|
1716
2164
|
if (r.hasAttributes()) {
|
|
1717
2165
|
const l = r.getAttributes();
|
|
1718
|
-
if (
|
|
1719
|
-
const
|
|
1720
|
-
l.forEach(([
|
|
1721
|
-
const
|
|
1722
|
-
|
|
1723
|
-
}),
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
JSON.stringify(Object.fromEntries(
|
|
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(([
|
|
1730
|
-
this.setAttribute(
|
|
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
|
|
1738
|
-
const e =
|
|
1739
|
-
|
|
1740
|
-
},
|
|
1741
|
-
const e =
|
|
1742
|
-
|
|
1743
|
-
},
|
|
1744
|
-
const e =
|
|
1745
|
-
|
|
1746
|
-
},
|
|
1747
|
-
const e =
|
|
1748
|
-
if (
|
|
1749
|
-
const
|
|
1750
|
-
n.length > 0 && (
|
|
2185
|
+
const Ke = (s) => JSON.parse(s.replace(/"/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
|
-
},
|
|
1753
|
-
const e =
|
|
1754
|
-
if (
|
|
1755
|
-
const
|
|
1756
|
-
Object.entries(
|
|
1757
|
-
r == null ?
|
|
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
|
-
},
|
|
2208
|
+
}, Ds = () => {
|
|
1761
2209
|
const e = [
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
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(
|
|
1772
|
-
|
|
2219
|
+
if (r.hasAttribute(Ce)) {
|
|
2220
|
+
ve(r);
|
|
1773
2221
|
return;
|
|
1774
2222
|
}
|
|
1775
|
-
r.hasAttribute(
|
|
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
|
-
},
|
|
1778
|
-
class
|
|
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 =
|
|
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 ?
|
|
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
|
|
1790
|
-
|
|
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((
|
|
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[
|
|
1809
|
-
hasStyles = () => this.properties[
|
|
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[
|
|
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
|
|
1817
|
-
const n =
|
|
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,
|
|
1823
|
-
((this.properties[
|
|
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,
|
|
1829
|
-
const
|
|
1830
|
-
l(),
|
|
1831
|
-
} : (
|
|
1832
|
-
|
|
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
|
|
1835
|
-
|
|
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
|
|
2290
|
+
const t = this.properties[Q] ??= [], n = new Set(t);
|
|
1843
2291
|
for (const r of e)
|
|
1844
|
-
n.has(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
|
|
2297
|
+
const t = this.properties[Q] ??= [], n = new Set(e);
|
|
1850
2298
|
let r = 0;
|
|
1851
|
-
for (let
|
|
1852
|
-
n.has(
|
|
1853
|
-
|
|
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[
|
|
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 ===
|
|
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,
|
|
1863
|
-
const n = this.properties[
|
|
1864
|
-
n[e] =
|
|
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[
|
|
1867
|
-
getStyles = () => this.properties[
|
|
2314
|
+
getStyle = (e) => this.properties[Z]?.[e] ?? "";
|
|
2315
|
+
getStyles = () => this.properties[Z] ?? {};
|
|
1868
2316
|
makeAccessors = (e) => {
|
|
1869
|
-
const
|
|
2317
|
+
const t = this.properties;
|
|
1870
2318
|
return {
|
|
1871
|
-
get: () =>
|
|
1872
|
-
set: (n) =>
|
|
2319
|
+
get: () => t[e],
|
|
2320
|
+
set: (n) => t[e] = n
|
|
1873
2321
|
};
|
|
1874
2322
|
};
|
|
1875
2323
|
}
|
|
1876
|
-
const
|
|
1877
|
-
class
|
|
1878
|
-
constructor(e,
|
|
1879
|
-
super(n), this.tagName = e, this.namespace =
|
|
2324
|
+
const Mt = (s) => s.replace(/"/g, """), kt = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
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
|
|
1884
|
-
|
|
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
|
|
1890
|
-
constructor(e,
|
|
1891
|
-
super(
|
|
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
|
-
|
|
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
|
|
2390
|
+
class $t {
|
|
1898
2391
|
constructor(e) {
|
|
1899
2392
|
this.text = e;
|
|
1900
2393
|
}
|
|
1901
|
-
id =
|
|
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
|
|
1908
|
-
constructor(e,
|
|
1909
|
-
this.element = e, this.reference =
|
|
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
|
|
1914
|
-
|
|
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,
|
|
1919
|
-
const n = new
|
|
1920
|
-
return this.appendOrInsert(n), new
|
|
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
|
|
1929
|
-
return this.appendOrInsert(
|
|
2430
|
+
const t = new $t(e);
|
|
2431
|
+
return this.appendOrInsert(t), new se(
|
|
1930
2432
|
this.element,
|
|
1931
|
-
|
|
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
|
|
1943
|
-
return this.appendOrInsert(
|
|
1944
|
-
|
|
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,
|
|
2459
|
+
setProvider = (e, t, n) => new se(this.element, this.reference, this.container, {
|
|
1958
2460
|
...this.providers,
|
|
1959
|
-
[e]: [
|
|
2461
|
+
[e]: [t, n]
|
|
1960
2462
|
});
|
|
1961
2463
|
getProvider = (e) => {
|
|
1962
2464
|
if (this.providers[e] === void 0)
|
|
1963
|
-
throw new
|
|
1964
|
-
const [
|
|
1965
|
-
return { value:
|
|
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,
|
|
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,
|
|
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
|
|
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
|
-
]),
|
|
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
|
-
),
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
s
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
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
|
|
2010
|
-
for (const
|
|
2011
|
-
|
|
2012
|
-
const
|
|
2013
|
-
for (const
|
|
2014
|
-
|
|
2015
|
-
l.length > 0 && e.removeClasses(l),
|
|
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(
|
|
2542
|
+
n(), r && e.removeClasses(Array.from(t)), t.clear();
|
|
2021
2543
|
};
|
|
2022
|
-
}),
|
|
2023
|
-
const { get: n, set: r } =
|
|
2024
|
-
return r(e), (
|
|
2025
|
-
|
|
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
|
-
}),
|
|
2028
|
-
const { get: n, set: r } =
|
|
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
|
-
|
|
2552
|
+
o(), l && r(i);
|
|
2031
2553
|
};
|
|
2032
|
-
}),
|
|
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((
|
|
2035
|
-
) :
|
|
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: (
|
|
2571
|
+
get: (s, e) => (t) => Wt(e, t)
|
|
2050
2572
|
}
|
|
2051
|
-
),
|
|
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: (
|
|
2584
|
+
get: (s, e) => (t) => Ut(e, t)
|
|
2063
2585
|
}
|
|
2064
|
-
),
|
|
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: (
|
|
2597
|
+
get: (s, e) => (t) => Jt(e, t)
|
|
2076
2598
|
}
|
|
2077
|
-
),
|
|
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: (
|
|
2610
|
+
get: (s, e) => (t) => Kt(e, t)
|
|
2089
2611
|
}
|
|
2090
|
-
),
|
|
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: (
|
|
2622
|
+
get: (s, e) => (t) => Gt(e, t)
|
|
2101
2623
|
}
|
|
2102
|
-
),
|
|
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 &&
|
|
2629
|
+
r != null && s(!r, t);
|
|
2189
2630
|
}, 0);
|
|
2190
|
-
}),
|
|
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: (
|
|
2639
|
+
get: (s, e) => (t) => Qe(e, t)
|
|
2199
2640
|
}
|
|
2200
|
-
),
|
|
2201
|
-
e?.preventDefault === !0 &&
|
|
2202
|
-
},
|
|
2203
|
-
const n =
|
|
2204
|
-
|
|
2205
|
-
}, e),
|
|
2206
|
-
(
|
|
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
|
-
),
|
|
2209
|
-
(
|
|
2649
|
+
), Qt = (s, e) => Y(
|
|
2650
|
+
(t, n) => s(t.valueAsNumber, n),
|
|
2210
2651
|
e
|
|
2211
|
-
),
|
|
2212
|
-
if (
|
|
2652
|
+
), Zt = (s, e) => Y((t, n) => {
|
|
2653
|
+
if (t.value === "")
|
|
2213
2654
|
return;
|
|
2214
|
-
const r =
|
|
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
|
-
|
|
2220
|
-
}, e),
|
|
2221
|
-
if (
|
|
2222
|
-
|
|
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 =
|
|
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
|
-
|
|
2231
|
-
}, e),
|
|
2232
|
-
if (
|
|
2671
|
+
s(i, n);
|
|
2672
|
+
}, e), es = (s, e) => Y((t, n) => {
|
|
2673
|
+
if (t.value === "")
|
|
2233
2674
|
return;
|
|
2234
|
-
const r =
|
|
2235
|
-
Number(
|
|
2236
|
-
Number(
|
|
2237
|
-
Number(
|
|
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
|
-
|
|
2240
|
-
}, e),
|
|
2241
|
-
if (
|
|
2242
|
-
|
|
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 =
|
|
2686
|
+
const r = t.value.split("T");
|
|
2246
2687
|
if (r.length !== 2) {
|
|
2247
|
-
|
|
2688
|
+
s(null, n);
|
|
2248
2689
|
return;
|
|
2249
2690
|
}
|
|
2250
|
-
const
|
|
2251
|
-
Number(
|
|
2252
|
-
Number(
|
|
2253
|
-
Number(
|
|
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
|
-
|
|
2256
|
-
}, e),
|
|
2257
|
-
t
|
|
2258
|
-
}, e),
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
(
|
|
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
|
-
|
|
2372
|
-
const
|
|
2373
|
-
|
|
2374
|
-
|
|
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
|
-
}),
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
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
|
-
),
|
|
2404
|
-
|
|
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
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
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
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
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
|
-
|
|
2490
|
-
},
|
|
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
|
|
2493
|
-
if (
|
|
2494
|
-
return
|
|
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
|
|
2500
|
-
src:
|
|
2760
|
+
function yn({
|
|
2761
|
+
src: s,
|
|
2501
2762
|
name: e,
|
|
2502
|
-
width:
|
|
2763
|
+
width: t,
|
|
2503
2764
|
height: n,
|
|
2504
2765
|
sandbox: r,
|
|
2505
|
-
allow:
|
|
2506
|
-
referrerpolicy:
|
|
2766
|
+
allow: i,
|
|
2767
|
+
referrerpolicy: o,
|
|
2507
2768
|
loading: l,
|
|
2508
|
-
iframeChild:
|
|
2509
|
-
onLoad:
|
|
2510
|
-
} = {}, ...
|
|
2511
|
-
return
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
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
|
-
|
|
2518
|
-
n != null ?
|
|
2778
|
+
N.height(
|
|
2779
|
+
n != null ? C.map(n, String) : void 0
|
|
2519
2780
|
),
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
const
|
|
2526
|
-
let
|
|
2527
|
-
const
|
|
2528
|
-
if (
|
|
2529
|
-
|
|
2530
|
-
const
|
|
2531
|
-
if (
|
|
2532
|
-
const
|
|
2533
|
-
if (
|
|
2534
|
-
const
|
|
2535
|
-
|
|
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 &&
|
|
2540
|
-
|
|
2541
|
-
}), (
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
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
|
|
2551
|
-
|
|
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
|
-
}),
|
|
2563
|
-
mark:
|
|
2814
|
+
}), ge = /* @__PURE__ */ new Map(), ss = (s) => ({
|
|
2815
|
+
mark: st(`Probe(${s.description})`),
|
|
2564
2816
|
create: ({ callback: e = () => {
|
|
2565
|
-
}, timeout:
|
|
2817
|
+
}, timeout: t = 10 } = {}) => {
|
|
2566
2818
|
const n = (l) => {
|
|
2567
|
-
clearTimeout(r),
|
|
2819
|
+
clearTimeout(r), ge.delete(s), e(l);
|
|
2568
2820
|
};
|
|
2569
|
-
if (
|
|
2570
|
-
throw new Error(`Probe already exists: ${
|
|
2571
|
-
const r = setTimeout(() => n("timeout"),
|
|
2572
|
-
return
|
|
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 =
|
|
2827
|
+
const l = ge.get(s);
|
|
2576
2828
|
l != null && --l.counter === 0 && n("resolved");
|
|
2577
2829
|
},
|
|
2578
2830
|
dispose: () => n("disposed"),
|
|
2579
|
-
onUse: () =>
|
|
2831
|
+
onUse: () => i.counter++
|
|
2580
2832
|
};
|
|
2581
2833
|
}
|
|
2582
|
-
}),
|
|
2583
|
-
function
|
|
2584
|
-
mode:
|
|
2834
|
+
}), wn = ss(Symbol("GlobalProbe"));
|
|
2835
|
+
function bn({
|
|
2836
|
+
mode: s,
|
|
2585
2837
|
delegatesFocus: e,
|
|
2586
|
-
slotAssignment:
|
|
2838
|
+
slotAssignment: t,
|
|
2587
2839
|
clonable: n,
|
|
2588
2840
|
serializable: r
|
|
2589
|
-
}, ...
|
|
2590
|
-
return
|
|
2591
|
-
const l = { mode:
|
|
2592
|
-
e !== void 0 && (l.delegatesFocus = e),
|
|
2593
|
-
const
|
|
2594
|
-
return
|
|
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
|
|
2598
|
-
const n =
|
|
2599
|
-
return
|
|
2600
|
-
r &&
|
|
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
|
-
}),
|
|
2603
|
-
const n =
|
|
2604
|
-
return (
|
|
2605
|
-
r(),
|
|
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
|
-
}),
|
|
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: (
|
|
2617
|
-
}),
|
|
2618
|
-
const s = t
|
|
2619
|
-
return
|
|
2620
|
-
|
|
2621
|
-
}
|
|
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
|
|
2624
|
-
if (
|
|
2625
|
-
return
|
|
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
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
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
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
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
|
};
|