@tempots/dom 20.0.1 → 21.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +1 -1
- package/index.d.ts +1 -0
- package/index.js +562 -520
- package/package.json +1 -1
- package/renderable/attribute.d.ts +2 -1
- package/renderable/ensure.d.ts +3 -2
- package/renderable/foreach.d.ts +3 -2
- package/renderable/map-signal.d.ts +3 -3
- package/renderable/not-empty.d.ts +3 -3
- package/renderable/oneof.d.ts +9 -8
- package/renderable/repeat.d.ts +2 -1
- package/renderable/text.d.ts +2 -1
- package/renderable/when.d.ts +3 -3
- package/std/position.d.ts +4 -4
- package/std/signal-utils.d.ts +2 -1
- package/std/signal.d.ts +2 -60
- package/std/value.d.ts +71 -0
- package/types/domain.d.ts +1 -6
package/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
const
|
|
5
|
-
const
|
|
1
|
+
var Ce = Object.defineProperty;
|
|
2
|
+
var Le = (t, e, r) => e in t ? Ce(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var u = (t, e, r) => Le(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
const Oe = (t, e, r) => t + (e - t) * r;
|
|
5
|
+
const ke = (t, e, r) => {
|
|
6
6
|
const s = Math.max(t.length, e.length);
|
|
7
7
|
let n = "";
|
|
8
8
|
for (let o = 0; o < s; o++) {
|
|
9
9
|
let i = t.charCodeAt(o);
|
|
10
10
|
isNaN(i) && (i = 97);
|
|
11
|
-
let
|
|
12
|
-
isNaN(
|
|
11
|
+
let l = e.charCodeAt(o);
|
|
12
|
+
isNaN(l) && (l = 97), n += String.fromCharCode(i + (l - i) * r);
|
|
13
13
|
}
|
|
14
14
|
return n;
|
|
15
|
-
},
|
|
16
|
-
class
|
|
15
|
+
}, Ne = (t, e, r) => new Date(t.getTime() + (e.getTime() - t.getTime()) * r), Re = (t, e) => e, Me = (t) => typeof t == "number" ? Oe : typeof t == "string" ? ke : t instanceof Date ? Ne : Re;
|
|
16
|
+
class M {
|
|
17
17
|
/**
|
|
18
18
|
* Creates a new instance of `ElementPosition`.
|
|
19
19
|
* @param index - The index of the element.
|
|
@@ -43,21 +43,21 @@ class ke {
|
|
|
43
43
|
return this.index === this.total - 1;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* Checks if the
|
|
47
|
-
* @returns `true` if the
|
|
46
|
+
* Checks if the counter of the element is even.
|
|
47
|
+
* @returns `true` if the counter is even, `false` otherwise.
|
|
48
48
|
*/
|
|
49
49
|
get isEven() {
|
|
50
|
-
return this.index % 2 ===
|
|
50
|
+
return this.index % 2 === 1;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* Checks if the
|
|
54
|
-
* @returns `true` if the
|
|
53
|
+
* Checks if the counter of the element is odd.
|
|
54
|
+
* @returns `true` if the counter is odd, `false` otherwise.
|
|
55
55
|
*/
|
|
56
56
|
get isOdd() {
|
|
57
|
-
return this.index % 2 ===
|
|
57
|
+
return this.index % 2 === 0;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const C = class C {
|
|
61
61
|
/**
|
|
62
62
|
* Represents a signal with a value of type T.
|
|
63
63
|
*
|
|
@@ -69,33 +69,33 @@ const p = class p {
|
|
|
69
69
|
/**
|
|
70
70
|
* @internal
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
u(this, "$__signal__", !0);
|
|
73
73
|
/**
|
|
74
74
|
* @internal
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
u(this, "_value");
|
|
77
77
|
/**
|
|
78
78
|
* @internal
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
u(this, "_derivatives", []);
|
|
81
81
|
/**
|
|
82
82
|
* @internal
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
u(this, "_onValueListeners", []);
|
|
85
85
|
/**
|
|
86
86
|
* @internal
|
|
87
87
|
*/
|
|
88
|
-
|
|
88
|
+
u(this, "_onDisposeListeners", []);
|
|
89
89
|
/**
|
|
90
90
|
* Gets the current value of the signal.
|
|
91
91
|
* @returns The current value of the signal.
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
u(this, "get", () => this._value);
|
|
94
94
|
/**
|
|
95
95
|
* Checks if the signal has any registered listeners.
|
|
96
96
|
* @returns `true` if the signal has listeners, `false` otherwise.
|
|
97
97
|
*/
|
|
98
|
-
|
|
98
|
+
u(this, "hasListeners", () => this._onValueListeners.length > 0);
|
|
99
99
|
/**
|
|
100
100
|
* Registers a listener function to be called whenever the value of the signal changes.
|
|
101
101
|
* The listener function will be immediately called with the current value of the signal.
|
|
@@ -103,37 +103,37 @@ const p = class p {
|
|
|
103
103
|
*
|
|
104
104
|
* @param listener - The listener function to be called when the value of the signal changes.
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
u(this, "on", (e) => (e(this.get()), this._onValueListeners.push(e), () => {
|
|
107
107
|
this._onValueListeners.splice(this._onValueListeners.indexOf(e), 1);
|
|
108
108
|
}));
|
|
109
109
|
/**
|
|
110
110
|
* @internal
|
|
111
111
|
*/
|
|
112
|
-
|
|
112
|
+
u(this, "_setAndNotify", (e, r) => {
|
|
113
113
|
const s = this.equals(this._value, e);
|
|
114
114
|
s || (this._value = e), (r || !s) && this._onValueListeners.forEach((n) => n(e));
|
|
115
115
|
});
|
|
116
116
|
/**
|
|
117
117
|
* @internal
|
|
118
118
|
*/
|
|
119
|
-
|
|
119
|
+
u(this, "_disposed", !1);
|
|
120
120
|
/**
|
|
121
121
|
* Checks whether the signal is disposed.
|
|
122
122
|
* @returns True if the signal is disposed, false otherwise.
|
|
123
123
|
*/
|
|
124
|
-
|
|
124
|
+
u(this, "isDisposed", () => this._disposed);
|
|
125
125
|
/**
|
|
126
126
|
* Adds a listener function to be called when the object is disposed.
|
|
127
127
|
* @param listener - The listener function to be called when the object is disposed.
|
|
128
128
|
* @returns A function that can be called to remove the listener.
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
u(this, "onDispose", (e) => {
|
|
131
131
|
this._onDisposeListeners.push(e);
|
|
132
132
|
});
|
|
133
133
|
/**
|
|
134
134
|
* Disposes the signal, releasing any resources associated with it.
|
|
135
135
|
*/
|
|
136
|
-
|
|
136
|
+
u(this, "dispose", () => {
|
|
137
137
|
this._disposed || (this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
|
|
138
138
|
});
|
|
139
139
|
/**
|
|
@@ -145,7 +145,7 @@ const p = class p {
|
|
|
145
145
|
* @param equals - Optional equality function to determine if two mapped values are equal.
|
|
146
146
|
* @returns - A new Computed instance with the mapped value.
|
|
147
147
|
*/
|
|
148
|
-
|
|
148
|
+
u(this, "map", (e, r = (s, n) => s === n) => {
|
|
149
149
|
const s = new E(() => {
|
|
150
150
|
try {
|
|
151
151
|
return e(this.get());
|
|
@@ -165,7 +165,7 @@ const p = class p {
|
|
|
165
165
|
* Defaults to a strict equality check (===).
|
|
166
166
|
* @returns A new Signal that emits the values of the resulting Signal.
|
|
167
167
|
*/
|
|
168
|
-
|
|
168
|
+
u(this, "flatMap", (e, r = (s, n) => s === n) => {
|
|
169
169
|
const s = new E(() => {
|
|
170
170
|
try {
|
|
171
171
|
return e(this.get()).get();
|
|
@@ -181,19 +181,19 @@ const p = class p {
|
|
|
181
181
|
* @param fn - The callback function to be invoked with the current value of the signal.
|
|
182
182
|
* @returns A new signal that emits the same value as the original signal and invokes the callback function.
|
|
183
183
|
*/
|
|
184
|
-
|
|
184
|
+
u(this, "tap", (e) => this.map((r) => (e(r), r)));
|
|
185
185
|
/**
|
|
186
186
|
* Returns a new Signal that emits the value at the specified key of the current value.
|
|
187
187
|
*
|
|
188
188
|
* @param key - The key of the value to retrieve.
|
|
189
189
|
* @returns A new Signal that emits the value at the specified key.
|
|
190
190
|
*/
|
|
191
|
-
|
|
191
|
+
u(this, "at", (e) => this.map((r) => r[e]));
|
|
192
192
|
/**
|
|
193
193
|
* @internal
|
|
194
194
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
u(this, "_$");
|
|
196
|
+
u(this, "filter", (e, r) => {
|
|
197
197
|
let s = r ?? this.get();
|
|
198
198
|
const n = new E(() => {
|
|
199
199
|
try {
|
|
@@ -215,12 +215,12 @@ const p = class p {
|
|
|
215
215
|
* @param equals - Optional equality function to determine if two values are equal.
|
|
216
216
|
* @returns - A new Computed object with the mapped and filtered values.
|
|
217
217
|
*/
|
|
218
|
-
|
|
218
|
+
u(this, "filterMap", (e, r, s = (n, o) => n === o) => {
|
|
219
219
|
let n = r;
|
|
220
220
|
const o = new E(() => {
|
|
221
221
|
try {
|
|
222
|
-
const i = this.get(),
|
|
223
|
-
return n =
|
|
222
|
+
const i = this.get(), l = e(i);
|
|
223
|
+
return n = l ?? n;
|
|
224
224
|
} catch (i) {
|
|
225
225
|
throw console.error("Error in Signal.filterMap:", i), i;
|
|
226
226
|
}
|
|
@@ -240,18 +240,18 @@ const p = class p {
|
|
|
240
240
|
* @param equals - The equality function to compare the mapped values for equality.
|
|
241
241
|
* @returns A property that holds the mapped value and can be observed for changes.
|
|
242
242
|
*/
|
|
243
|
-
|
|
244
|
-
const o =
|
|
245
|
-
let i = 0,
|
|
243
|
+
u(this, "mapAsync", (e, r, s, n = (o, i) => o === i) => {
|
|
244
|
+
const o = L(r, n);
|
|
245
|
+
let i = 0, l = new AbortController();
|
|
246
246
|
return o.onDispose(
|
|
247
|
-
this.on(async (
|
|
248
|
-
const
|
|
249
|
-
|
|
247
|
+
this.on(async (a) => {
|
|
248
|
+
const c = ++i;
|
|
249
|
+
l.abort(), l = new AbortController();
|
|
250
250
|
try {
|
|
251
|
-
const d = await e(
|
|
252
|
-
|
|
251
|
+
const d = await e(a, { abortSignal: l.signal });
|
|
252
|
+
c === i && o.set(d);
|
|
253
253
|
} catch (d) {
|
|
254
|
-
if (
|
|
254
|
+
if (c === i)
|
|
255
255
|
if (s != null)
|
|
256
256
|
o.set(s(d));
|
|
257
257
|
else
|
|
@@ -270,14 +270,14 @@ const p = class p {
|
|
|
270
270
|
* @param alt - The alternative value to use when the mapped value is `undefined` or `null`.
|
|
271
271
|
* @returns A new signal containing the mapped values.
|
|
272
272
|
*/
|
|
273
|
-
|
|
273
|
+
u(this, "mapMaybe", (e, r) => this.map((s) => e(s) ?? r));
|
|
274
274
|
/**
|
|
275
275
|
* Feeds a property into the signal and sets up disposal behavior.
|
|
276
276
|
* @param prop - The property to feed into the signal.
|
|
277
277
|
* @param autoDisposeProp - Determines whether the property should be automatically disposed when the signal is disposed.
|
|
278
278
|
* @returns The input property.
|
|
279
279
|
*/
|
|
280
|
-
|
|
280
|
+
u(this, "feedProp", (e, r = !1) => {
|
|
281
281
|
const s = this.on(e.set);
|
|
282
282
|
return e.onDispose(s), r ? this.onDispose(e.dispose) : this.onDispose(s), e;
|
|
283
283
|
});
|
|
@@ -286,12 +286,12 @@ const p = class p {
|
|
|
286
286
|
* @param autoDisposeProp - Determines whether the derived property should be automatically disposed.
|
|
287
287
|
* @returns The derived property.
|
|
288
288
|
*/
|
|
289
|
-
|
|
289
|
+
u(this, "deriveProp", (e = !0) => this.feedProp(L(this.get()), e));
|
|
290
290
|
/**
|
|
291
291
|
* Returns a signal that emits the count of values received so far.
|
|
292
292
|
* @returns A signal that emits the count of values received so far.
|
|
293
293
|
*/
|
|
294
|
-
|
|
294
|
+
u(this, "count", () => {
|
|
295
295
|
let e = 0;
|
|
296
296
|
return this.map(() => ++e);
|
|
297
297
|
});
|
|
@@ -301,7 +301,7 @@ const p = class p {
|
|
|
301
301
|
* Additionally, when the computed value is disposed, it sets the signal as dirty.
|
|
302
302
|
* @param computed - The computed value to add as a derivative.
|
|
303
303
|
*/
|
|
304
|
-
|
|
304
|
+
u(this, "setDerivative", (e) => {
|
|
305
305
|
this._derivatives.push(e), e.onDispose(() => {
|
|
306
306
|
this._derivatives.splice(
|
|
307
307
|
this._derivatives.indexOf(e),
|
|
@@ -338,8 +338,8 @@ const p = class p {
|
|
|
338
338
|
* @param equals - A function to compare two values of type O for equality. Defaults to strict equality (===).
|
|
339
339
|
* @returns - A Signal that represents the result of the Promise.
|
|
340
340
|
*/
|
|
341
|
-
|
|
342
|
-
const o = new
|
|
341
|
+
u(C, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
|
|
342
|
+
const o = new C(r, n);
|
|
343
343
|
return e.then((i) => o._setAndNotify(i, !1)).catch((i) => {
|
|
344
344
|
s != null ? o._setAndNotify(s(i), !1) : console.error(
|
|
345
345
|
"Unhandled promise rejection in Signal.ofPromise:",
|
|
@@ -352,47 +352,12 @@ l(p, "ofPromise", (e, r, s, n = (o, i) => o === i) => {
|
|
|
352
352
|
* @param value - The value to check.
|
|
353
353
|
* @returns `true` if the value is a Signal, `false` otherwise.
|
|
354
354
|
*/
|
|
355
|
-
|
|
355
|
+
u(C, "is", (e) => (
|
|
356
356
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
357
357
|
e != null && e.$__signal__ === !0
|
|
358
|
-
))
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
* If the value is not a Signal, it creates a new Signal instance with the given value.
|
|
362
|
-
*
|
|
363
|
-
* @typeParam O - The type of the value.
|
|
364
|
-
* @param value - The value or Signal instance to wrap.
|
|
365
|
-
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
366
|
-
* @returns A Signal instance.
|
|
367
|
-
*/
|
|
368
|
-
l(p, "wrap", (e, r = (s, n) => s === n) => p.is(e) ? e : new p(e, r)), /**
|
|
369
|
-
* Wraps a value in a `Signal` if it is not already a `Signal`.
|
|
370
|
-
* If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
|
|
371
|
-
* @param value - The value to wrap or check.
|
|
372
|
-
* @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
|
|
373
|
-
*/
|
|
374
|
-
l(p, "maybeWrap", (e) => e == null ? e : p.wrap(e)), /**
|
|
375
|
-
* Unwraps a value from a `Signal` if it is a `Signal`, otherwise returns the value as is.
|
|
376
|
-
*
|
|
377
|
-
* @param value - The value to unwrap.
|
|
378
|
-
* @returns The unwrapped value.
|
|
379
|
-
*/
|
|
380
|
-
l(p, "unwrap", (e) => p.is(e) ? e.get() : e), /**
|
|
381
|
-
* Maps the value of a `Signal` or a regular value using the provided mapping function.
|
|
382
|
-
* If the input value is a `Signal`, the mapping function is applied to its value.
|
|
383
|
-
* If the input value is not a `Signal`, the mapping function is directly applied to the value.
|
|
384
|
-
*
|
|
385
|
-
* @param value - The input value to be mapped.
|
|
386
|
-
* @param fn - The mapping function to be applied to the value.
|
|
387
|
-
* @returns A new `Signal` with the mapped value if the input value is a `Signal`,
|
|
388
|
-
* otherwise, the result of applying the mapping function to the value.
|
|
389
|
-
*
|
|
390
|
-
* @typeParam N - The type of the input value.
|
|
391
|
-
* @typeParam O - The type of the mapped value.
|
|
392
|
-
*/
|
|
393
|
-
l(p, "map", (e, r) => p.is(e) ? e.map(r) : r(e));
|
|
394
|
-
let h = p;
|
|
395
|
-
const Re = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
|
|
358
|
+
));
|
|
359
|
+
let h = C;
|
|
360
|
+
const $e = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
|
|
396
361
|
class E extends h {
|
|
397
362
|
/**
|
|
398
363
|
* Represents a Signal object.
|
|
@@ -404,36 +369,36 @@ class E extends h {
|
|
|
404
369
|
/**
|
|
405
370
|
* @internal
|
|
406
371
|
*/
|
|
407
|
-
|
|
372
|
+
u(this, "$__computed__", !0);
|
|
408
373
|
/**
|
|
409
374
|
* @internal
|
|
410
375
|
*/
|
|
411
|
-
|
|
376
|
+
u(this, "_isDirty", !1);
|
|
412
377
|
/**
|
|
413
378
|
* Marks the signal as dirty, indicating that its value has changed and needs to be recalculated.
|
|
414
379
|
* If the signal is already dirty or disposed, this method does nothing.
|
|
415
380
|
* It also marks all dependent signals as dirty and schedules a notification to update their values.
|
|
416
381
|
*/
|
|
417
|
-
|
|
382
|
+
u(this, "setDirty", () => {
|
|
418
383
|
this._isDirty || this._disposed || (this._isDirty = !0, this._derivatives.forEach((r) => r.setDirty()), this._scheduleNotify());
|
|
419
384
|
});
|
|
420
385
|
/**
|
|
421
386
|
* @internal
|
|
422
387
|
*/
|
|
423
|
-
|
|
388
|
+
u(this, "_scheduleCount", 0);
|
|
424
389
|
/**
|
|
425
390
|
* Schedules a notification to be executed asynchronously.
|
|
426
391
|
* If the signal is dirty, it will be updated and notified.
|
|
427
392
|
* @internal
|
|
428
393
|
*/
|
|
429
|
-
|
|
394
|
+
u(this, "_scheduleNotify", () => {
|
|
430
395
|
const r = ++this._scheduleCount;
|
|
431
|
-
|
|
396
|
+
$e(() => {
|
|
432
397
|
this._scheduleCount !== r || this._disposed !== !1 || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn(), !1));
|
|
433
398
|
});
|
|
434
399
|
});
|
|
435
400
|
/** {@inheritDoc Signal.get} */
|
|
436
|
-
|
|
401
|
+
u(this, "get", () => (this._isDirty && (this._isDirty = !1, this._value = this._fn(), this._setAndNotify(this._value, !0)), this._value));
|
|
437
402
|
this._fn = r, this.setDirty();
|
|
438
403
|
}
|
|
439
404
|
/**
|
|
@@ -450,26 +415,26 @@ class E extends h {
|
|
|
450
415
|
return this.get();
|
|
451
416
|
}
|
|
452
417
|
}
|
|
453
|
-
const
|
|
418
|
+
const q = class q extends h {
|
|
454
419
|
constructor() {
|
|
455
420
|
super(...arguments);
|
|
456
421
|
/**
|
|
457
422
|
* @internal
|
|
458
423
|
*/
|
|
459
|
-
|
|
424
|
+
u(this, "$__prop__", !0);
|
|
460
425
|
/**
|
|
461
426
|
* Changes the value of the property and notifies its listeners.
|
|
462
427
|
*
|
|
463
428
|
* @param value - The new value of the property.
|
|
464
429
|
*/
|
|
465
|
-
|
|
430
|
+
u(this, "set", (r) => {
|
|
466
431
|
this._setAndNotify(r, !1);
|
|
467
432
|
});
|
|
468
433
|
/**
|
|
469
434
|
* Updates the value of the signal by applying the provided function to the current value.
|
|
470
435
|
* @param fn - The function to apply to the current value.
|
|
471
436
|
*/
|
|
472
|
-
|
|
437
|
+
u(this, "update", (r) => {
|
|
473
438
|
this._setAndNotify(r(this.get()), !1);
|
|
474
439
|
});
|
|
475
440
|
/**
|
|
@@ -478,13 +443,13 @@ const F = class F extends h {
|
|
|
478
443
|
* @param effects - An array of effects to be executed after the state is updated.
|
|
479
444
|
* @returns A dispatch function that can be used to update the state and trigger the effects.
|
|
480
445
|
*/
|
|
481
|
-
|
|
446
|
+
u(this, "reducer", (r, ...s) => {
|
|
482
447
|
const n = this;
|
|
483
448
|
return function o(i) {
|
|
484
|
-
const
|
|
485
|
-
n.update((
|
|
486
|
-
(
|
|
487
|
-
previousState:
|
|
449
|
+
const l = n.value;
|
|
450
|
+
n.update((a) => r(a, i)), !n.equals(l, n.value) && s.forEach(
|
|
451
|
+
(a) => a({
|
|
452
|
+
previousState: l,
|
|
488
453
|
state: n.value,
|
|
489
454
|
action: i,
|
|
490
455
|
dispatch: o
|
|
@@ -503,8 +468,8 @@ const F = class F extends h {
|
|
|
503
468
|
* Defaults to a strict equality check (===).
|
|
504
469
|
* @returns A Prop object representing the isomorphism.
|
|
505
470
|
*/
|
|
506
|
-
|
|
507
|
-
const o = new
|
|
471
|
+
u(this, "iso", (r, s, n = (o, i) => o === i) => {
|
|
472
|
+
const o = new q(r(this.get()), n);
|
|
508
473
|
return o.onDispose(this.on((i) => o.set(r(i)))), o.on((i) => this._setAndNotify(s(i), !1)), o;
|
|
509
474
|
});
|
|
510
475
|
/**
|
|
@@ -513,7 +478,7 @@ const F = class F extends h {
|
|
|
513
478
|
* @param key - The key of the value to access.
|
|
514
479
|
* @returns A `Prop` that represents the value at the specified key.
|
|
515
480
|
*/
|
|
516
|
-
|
|
481
|
+
u(this, "atProp", (r) => this.iso(
|
|
517
482
|
(s) => s[r],
|
|
518
483
|
(s) => ({ ...this.value, [r]: s })
|
|
519
484
|
));
|
|
@@ -533,111 +498,156 @@ const F = class F extends h {
|
|
|
533
498
|
* @param value - The value to check.
|
|
534
499
|
* @returns `true` if the value is a Prop, `false` otherwise.
|
|
535
500
|
*/
|
|
536
|
-
|
|
501
|
+
u(q, "is", (r) => (
|
|
537
502
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
538
503
|
r != null && r.$__prop__ === !0
|
|
539
504
|
));
|
|
540
|
-
let
|
|
541
|
-
const
|
|
505
|
+
let F = q;
|
|
506
|
+
const J = (t, e, r = (s, n) => s === n) => {
|
|
542
507
|
const s = new E(t, r);
|
|
543
508
|
return e.forEach((n) => n.setDerivative(s)), s;
|
|
544
|
-
},
|
|
509
|
+
}, Ve = (t, e) => J(t, e).dispose, L = (t, e = (r, s) => r === s) => new F(t, e), I = (t, e = (r, s) => r === s) => new h(t, e), m = {
|
|
510
|
+
/**
|
|
511
|
+
* Maps a value or a Signal to a new value.
|
|
512
|
+
* If the value is a Signal, it returns a new Signal with the mapped value.
|
|
513
|
+
* If the value is not a Signal, it returns the mapped value.
|
|
514
|
+
*
|
|
515
|
+
* @typeParam T - The type of the value.
|
|
516
|
+
* @typeParam U - The type of the new value.
|
|
517
|
+
* @param value - The value or Signal to map.
|
|
518
|
+
* @param fn - The function to map the value.
|
|
519
|
+
* @returns The mapped value.
|
|
520
|
+
*/
|
|
521
|
+
map: (t, e) => h.is(t) ? t.map(e) : e(t),
|
|
522
|
+
/**
|
|
523
|
+
* Wraps a value or a Signal instance into a Signal.
|
|
524
|
+
* If the value is already a Signal, it returns the value itself.
|
|
525
|
+
* If the value is not a Signal, it creates a new Signal instance with the given value.
|
|
526
|
+
*
|
|
527
|
+
* @typeParam O - The type of the value.
|
|
528
|
+
* @param value - The value or Signal instance to wrap.
|
|
529
|
+
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
530
|
+
* @returns A Signal instance.
|
|
531
|
+
*/
|
|
532
|
+
toSignal: (t, e) => h.is(t) ? t : I(t, e),
|
|
533
|
+
/**
|
|
534
|
+
* Wraps a value in a `Signal` if it is not already a `Signal`.
|
|
535
|
+
* If the value is `null` or `undefined`, it returns `null` or `undefined` respectively.
|
|
536
|
+
* @param value - The value to wrap or check.
|
|
537
|
+
* @returns The wrapped value if it is not `null` or `undefined`, otherwise `null` or `undefined`.
|
|
538
|
+
*/
|
|
539
|
+
maybeToSignal: (t, e) => {
|
|
540
|
+
if (t != null)
|
|
541
|
+
return m.toSignal(t, e);
|
|
542
|
+
},
|
|
543
|
+
/**
|
|
544
|
+
* Gets the value from a `Signal` or the value itself if it is not a `Signal`.
|
|
545
|
+
* @param value - The value or Signal instance to get the value from.
|
|
546
|
+
* @returns The value.
|
|
547
|
+
*/
|
|
548
|
+
get: (t) => h.is(t) ? t.get() : t,
|
|
549
|
+
/**
|
|
550
|
+
* Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
|
|
551
|
+
* @param value - The value or Signal instance to add the listener to.
|
|
552
|
+
* @param listener - The listener to call when the value changes.
|
|
553
|
+
* @returns A function to remove the listener.
|
|
554
|
+
*/
|
|
555
|
+
on: (t, e) => h.is(t) ? t.on(e) : (e(t), () => {
|
|
556
|
+
})
|
|
557
|
+
}, Fe = (...t) => (e, r) => {
|
|
545
558
|
const s = t.filter((n) => h.is(n));
|
|
546
|
-
return
|
|
547
|
-
() => e(...t.map((n) =>
|
|
559
|
+
return J(
|
|
560
|
+
() => e(...t.map((n) => m.get(n))),
|
|
548
561
|
s,
|
|
549
562
|
r
|
|
550
563
|
);
|
|
551
|
-
},
|
|
564
|
+
}, _t = (...t) => (e) => {
|
|
552
565
|
const r = t.filter((s) => h.is(s));
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
);
|
|
557
|
-
}, C = (t, e = (r, s) => r === s) => new $(t, e), gt = (t, e = (r, s) => r === s) => new h(t, e);
|
|
558
|
-
class Q {
|
|
566
|
+
Ve(() => e(...t.map(m.get)), r);
|
|
567
|
+
};
|
|
568
|
+
class K {
|
|
559
569
|
constructor() {
|
|
560
|
-
|
|
570
|
+
u(this, "_store", /* @__PURE__ */ new Map());
|
|
561
571
|
/**
|
|
562
572
|
* Retrieves the value associated with the specified key from the memory store.
|
|
563
573
|
* @param key - The key to retrieve the value for.
|
|
564
574
|
* @returns The value associated with the key, or `null` if the key is not found.
|
|
565
575
|
*/
|
|
566
|
-
|
|
576
|
+
u(this, "getItem", (e) => this._store.get(e) ?? null);
|
|
567
577
|
/**
|
|
568
578
|
* Sets the value associated with the specified key in the memory store.
|
|
569
579
|
* @param key - The key to set the value for.
|
|
570
580
|
* @param value - The value to set.
|
|
571
581
|
*/
|
|
572
|
-
|
|
582
|
+
u(this, "setItem", (e, r) => {
|
|
573
583
|
this._store.set(e, r);
|
|
574
584
|
});
|
|
575
585
|
}
|
|
576
586
|
}
|
|
577
|
-
const
|
|
587
|
+
const x = ({
|
|
578
588
|
key: t,
|
|
579
589
|
defaultValue: e,
|
|
580
590
|
store: r,
|
|
581
591
|
serialize: s = JSON.stringify,
|
|
582
592
|
deserialize: n = JSON.parse,
|
|
583
|
-
equals: o = (
|
|
584
|
-
onLoad: i = (
|
|
593
|
+
equals: o = (l, a) => l === a,
|
|
594
|
+
onLoad: i = (l) => l
|
|
585
595
|
}) => {
|
|
586
|
-
const
|
|
587
|
-
|
|
596
|
+
const l = r.getItem(t), a = new F(
|
|
597
|
+
l != null ? i(n(l)) : typeof e == "function" ? e() : e,
|
|
588
598
|
o
|
|
589
599
|
);
|
|
590
|
-
return
|
|
591
|
-
r.setItem(t, s(
|
|
592
|
-
}),
|
|
593
|
-
},
|
|
600
|
+
return a.on((c) => {
|
|
601
|
+
r.setItem(t, s(c));
|
|
602
|
+
}), a;
|
|
603
|
+
}, vt = (t) => x({
|
|
594
604
|
...t,
|
|
595
|
-
store: (window == null ? void 0 : window.localStorage) ?? new
|
|
596
|
-
}),
|
|
605
|
+
store: (window == null ? void 0 : window.localStorage) ?? new K()
|
|
606
|
+
}), yt = (t) => x({
|
|
597
607
|
...t,
|
|
598
|
-
store: (window == null ? void 0 : window.sessionStorage) ?? new
|
|
608
|
+
store: (window == null ? void 0 : window.sessionStorage) ?? new K()
|
|
599
609
|
});
|
|
600
|
-
function
|
|
610
|
+
function Z(t) {
|
|
601
611
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
|
|
602
612
|
}
|
|
603
|
-
const
|
|
604
|
-
const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((
|
|
605
|
-
let
|
|
606
|
-
const D = new E(e, i), A =
|
|
613
|
+
const qe = (t, e, r, s) => {
|
|
614
|
+
const n = (s == null ? void 0 : s.duration) ?? 300, o = (s == null ? void 0 : s.easing) ?? ((y) => y), i = (s == null ? void 0 : s.equals) ?? ((y, R) => y === R);
|
|
615
|
+
let l = s == null ? void 0 : s.interpolate, a = t, c = e(), d = performance.now(), v = null, p = !0;
|
|
616
|
+
const D = new E(e, i), A = L(t, i);
|
|
607
617
|
A.onDispose(() => {
|
|
608
|
-
|
|
609
|
-
}), A.onDispose(D.dispose), r.forEach((
|
|
610
|
-
|
|
618
|
+
v !== null && cancelAnimationFrame(v);
|
|
619
|
+
}), A.onDispose(D.dispose), r.forEach((y) => {
|
|
620
|
+
y.setDerivative(D), y.onDispose(A.dispose);
|
|
611
621
|
});
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
},
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
let
|
|
618
|
-
|
|
622
|
+
const be = (y) => {
|
|
623
|
+
c = y, d = performance.now(), a = A.value, p && (p = !1, v = Z(Q));
|
|
624
|
+
}, Q = () => {
|
|
625
|
+
const R = (performance.now() - d) / m.get(n), Te = o(R);
|
|
626
|
+
l == null && (l = Me(a));
|
|
627
|
+
let Y = l(a, c, Te);
|
|
628
|
+
R >= 1 ? (p = !0, Y = c) : v = Z(Q), A.set(Y);
|
|
619
629
|
};
|
|
620
|
-
return D.on(
|
|
621
|
-
},
|
|
630
|
+
return D.on(be), A;
|
|
631
|
+
}, St = (t, e) => {
|
|
622
632
|
const { initialValue: r, ...s } = e ?? {};
|
|
623
|
-
return
|
|
633
|
+
return qe(
|
|
624
634
|
r ?? t.get(),
|
|
625
635
|
t.get,
|
|
626
636
|
[t],
|
|
627
637
|
s
|
|
628
638
|
);
|
|
629
|
-
},
|
|
639
|
+
}, wt = (t, e) => {
|
|
630
640
|
const { signals: r, literals: s } = Object.entries(t).reduce(
|
|
631
|
-
({ signals: o, literals: i }, [
|
|
641
|
+
({ signals: o, literals: i }, [l, a]) => (h.is(a) ? o.push([l, a]) : i[l] = a, { signals: o, literals: i }),
|
|
632
642
|
{ signals: [], literals: {} }
|
|
633
643
|
), n = r.map(([, o]) => o);
|
|
634
|
-
return
|
|
635
|
-
},
|
|
644
|
+
return J(() => (r.forEach(([o, i]) => s[o] = i.value), e(s)), n);
|
|
645
|
+
}, ee = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "selected"]), te = /* @__PURE__ */ new Set([
|
|
636
646
|
"rowSpan",
|
|
637
647
|
"colSpan",
|
|
638
648
|
"tabIndex",
|
|
639
649
|
"valueAsNumber"
|
|
640
|
-
]),
|
|
650
|
+
]), re = /* @__PURE__ */ new Set(["valueAsDate"]), se = /* @__PURE__ */ new Set([
|
|
641
651
|
"value",
|
|
642
652
|
"textContent",
|
|
643
653
|
"innerText",
|
|
@@ -645,25 +655,25 @@ const $e = (t, e, r, s) => {
|
|
|
645
655
|
"outerHTML",
|
|
646
656
|
"className",
|
|
647
657
|
"classList"
|
|
648
|
-
]),
|
|
649
|
-
if (
|
|
650
|
-
return
|
|
658
|
+
]), j = /* @__PURE__ */ new Map(), b = (t, e) => {
|
|
659
|
+
if (j.has(t))
|
|
660
|
+
return j.get(t);
|
|
651
661
|
{
|
|
652
662
|
const r = e(t);
|
|
653
|
-
return
|
|
663
|
+
return j.set(t, r), r;
|
|
654
664
|
}
|
|
655
|
-
},
|
|
665
|
+
}, Ie = (t) => (e, r) => {
|
|
656
666
|
r == null ? e[t] = null : e[t] = !!r;
|
|
657
|
-
},
|
|
667
|
+
}, Be = (t) => (e, r) => {
|
|
658
668
|
r == null ? e[t] = null : e[t] = Number(r);
|
|
659
|
-
},
|
|
669
|
+
}, je = (t) => (e, r) => {
|
|
660
670
|
r == null ? e[t] = null : e[t] = r;
|
|
661
|
-
},
|
|
671
|
+
}, Ue = (t) => (e, r) => {
|
|
662
672
|
r == null ? e[t] = null : e[t] = String(r);
|
|
663
|
-
},
|
|
673
|
+
}, Ge = (t) => (e, r) => {
|
|
664
674
|
r == null ? e.removeAttribute(t) : e.setAttribute(t, r);
|
|
665
|
-
},
|
|
666
|
-
class
|
|
675
|
+
}, ne = (t) => ee.has(t) ? b(t, Ie) : te.has(t) ? b(t, Be) : re.has(t) ? b(t, je) : se.has(t) ? b(t, Ue) : b(t, Ge), oe = (t) => (e) => ee.has(t) ? !!e[t] : te.has(t) ? Number(e[t]) : re.has(t) ? e[t] : se.has(t) ? String(e[t]) : e.getAttribute(t);
|
|
676
|
+
class S {
|
|
667
677
|
/**
|
|
668
678
|
* Constructs a new `DOMContext` instance.
|
|
669
679
|
*
|
|
@@ -681,19 +691,19 @@ class v {
|
|
|
681
691
|
* @param namespace - The namespace URI to create the element in, or `undefined` to create a standard HTML element.
|
|
682
692
|
* @returns The newly created element.
|
|
683
693
|
*/
|
|
684
|
-
|
|
694
|
+
u(this, "createElement", (e, r) => r !== void 0 ? this.document.createElementNS(r, e) : this.document.createElement(e));
|
|
685
695
|
/**
|
|
686
696
|
* Creates a new text node with the specified text content.
|
|
687
697
|
* @param text - The text content for the new text node.
|
|
688
698
|
* @returns A new `Text` node with the specified text content.
|
|
689
699
|
*/
|
|
690
|
-
|
|
700
|
+
u(this, "createText", (e) => this.document.createTextNode(e));
|
|
691
701
|
/**
|
|
692
702
|
* Creates a new `DOMContext` with a reference to a newly created text node.
|
|
693
703
|
* The text node is appended or inserted to the current `DOMContext`.
|
|
694
704
|
* The new `DOMContext` with the reference is returned.
|
|
695
705
|
*/
|
|
696
|
-
|
|
706
|
+
u(this, "makeRef", () => {
|
|
697
707
|
const e = this.createText("");
|
|
698
708
|
return this.appendOrInsert(e), this.withReference(e);
|
|
699
709
|
});
|
|
@@ -702,7 +712,7 @@ class v {
|
|
|
702
712
|
*
|
|
703
713
|
* @param child - The child node to append or insert.
|
|
704
714
|
*/
|
|
705
|
-
|
|
715
|
+
u(this, "appendOrInsert", (e) => {
|
|
706
716
|
this.reference === void 0 ? this.element.appendChild(e) : this.element.insertBefore(e, this.reference);
|
|
707
717
|
});
|
|
708
718
|
/**
|
|
@@ -711,18 +721,18 @@ class v {
|
|
|
711
721
|
* @param document - The `Document` to use for the `DOMContext`.
|
|
712
722
|
* @returns A new `DOMContext` instance.
|
|
713
723
|
*/
|
|
714
|
-
|
|
724
|
+
u(this, "withDocument", (e) => new S(e, this.element, this.reference, this.providers, !0));
|
|
715
725
|
/**
|
|
716
726
|
* Creates a new `DOMContext` instance with the provided `element`.
|
|
717
727
|
* @param element - The DOM element to use in the new `DOMContext` instance.
|
|
718
728
|
* @returns A new `DOMContext` instance with the provided `element`.
|
|
719
729
|
*/
|
|
720
|
-
|
|
730
|
+
u(this, "withElement", (e) => new S(this.document, e, void 0, this.providers, !1));
|
|
721
731
|
/**
|
|
722
732
|
* Creates a new `DOMContext` instance with the `isFirstLevel` property set to `true`.
|
|
723
733
|
* @returns A new `DOMContext` instance with the `isFirstLevel` property set to `true`.
|
|
724
734
|
*/
|
|
725
|
-
|
|
735
|
+
u(this, "withFirstLevel", () => new S(
|
|
726
736
|
this.document,
|
|
727
737
|
this.element,
|
|
728
738
|
this.reference,
|
|
@@ -735,7 +745,7 @@ class v {
|
|
|
735
745
|
* @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
|
|
736
746
|
* @returns A new `DOMContext` instance with the specified reference.
|
|
737
747
|
*/
|
|
738
|
-
|
|
748
|
+
u(this, "withReference", (e) => new S(
|
|
739
749
|
this.document,
|
|
740
750
|
this.element,
|
|
741
751
|
e,
|
|
@@ -748,7 +758,7 @@ class v {
|
|
|
748
758
|
* @param value - The value to set for the provider.
|
|
749
759
|
* @returns A new DOMContext with the updated providers.
|
|
750
760
|
*/
|
|
751
|
-
|
|
761
|
+
u(this, "withProvider", (e, r) => new S(
|
|
752
762
|
this.document,
|
|
753
763
|
this.element,
|
|
754
764
|
this.reference,
|
|
@@ -765,7 +775,7 @@ class v {
|
|
|
765
775
|
* @param providers - An object containing the providers to be merged into the existing providers.
|
|
766
776
|
* @returns A new DOMContext instance with the merged providers.
|
|
767
777
|
*/
|
|
768
|
-
|
|
778
|
+
u(this, "withProviders", (e) => new S(
|
|
769
779
|
this.document,
|
|
770
780
|
this.element,
|
|
771
781
|
this.reference,
|
|
@@ -782,9 +792,9 @@ class v {
|
|
|
782
792
|
* @returns The provider for the given mark.
|
|
783
793
|
* @throws Throws `ProviderNotFoundError` if the provider for the given mark is not found.
|
|
784
794
|
*/
|
|
785
|
-
|
|
795
|
+
u(this, "getProvider", (e) => {
|
|
786
796
|
if (this.providers[e] === void 0)
|
|
787
|
-
throw new
|
|
797
|
+
throw new Je(e);
|
|
788
798
|
return this.providers[e];
|
|
789
799
|
});
|
|
790
800
|
this.document = e, this.element = r, this.reference = s, this.providers = n, this.isFirstLevel = o;
|
|
@@ -797,41 +807,41 @@ class v {
|
|
|
797
807
|
* @returns A new `DOMContext` instance.
|
|
798
808
|
*/
|
|
799
809
|
static of(e, r) {
|
|
800
|
-
return new
|
|
810
|
+
return new S(e.ownerDocument, e, r, {}, !0);
|
|
801
811
|
}
|
|
802
812
|
}
|
|
803
|
-
class
|
|
813
|
+
class Je extends Error {
|
|
804
814
|
constructor(e) {
|
|
805
815
|
super(`Provider not found: ${e.description}`);
|
|
806
816
|
}
|
|
807
817
|
}
|
|
808
|
-
const
|
|
818
|
+
const _ = (t) => {
|
|
809
819
|
const e = t;
|
|
810
820
|
e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentElement && t.parentElement.removeChild(t);
|
|
811
|
-
},
|
|
812
|
-
|
|
821
|
+
}, He = (t) => ie(t) ? t : t.parentElement, ie = (t) => t.nodeType === 1, le = (t) => (e) => {
|
|
822
|
+
me(e);
|
|
813
823
|
const r = e.createText(t);
|
|
814
824
|
return e.appendOrInsert(r), (s) => {
|
|
815
|
-
s &&
|
|
825
|
+
s && _(r);
|
|
816
826
|
};
|
|
817
|
-
},
|
|
818
|
-
|
|
827
|
+
}, ue = (t) => (e) => {
|
|
828
|
+
me(e);
|
|
819
829
|
const r = e.createText(t.value);
|
|
820
830
|
e.appendOrInsert(r);
|
|
821
831
|
const s = t.on((n) => r.data = n);
|
|
822
832
|
return (n) => {
|
|
823
|
-
s(), n &&
|
|
833
|
+
s(), n && _(r);
|
|
824
834
|
};
|
|
825
|
-
},
|
|
826
|
-
const r = t.map((s) =>
|
|
835
|
+
}, At = (t) => h.is(t) ? ue(t) : le(t), g = (...t) => (e) => {
|
|
836
|
+
const r = t.map((s) => f(s)(e));
|
|
827
837
|
return (s) => {
|
|
828
838
|
r.forEach((n) => n(s));
|
|
829
839
|
};
|
|
830
|
-
},
|
|
831
|
-
},
|
|
840
|
+
}, w = () => () => {
|
|
841
|
+
}, We = (t) => (e) => (de(e), e.element.classList.add(...t), (r) => {
|
|
832
842
|
r && e.element.classList.remove(...t);
|
|
833
|
-
}),
|
|
834
|
-
|
|
843
|
+
}), Xe = (t) => (e) => {
|
|
844
|
+
de(e);
|
|
835
845
|
const r = e.element;
|
|
836
846
|
let s = [];
|
|
837
847
|
const n = t.on((o) => {
|
|
@@ -840,22 +850,22 @@ const g = (t) => {
|
|
|
840
850
|
return (o) => {
|
|
841
851
|
n(), o && s.forEach((i) => r.classList.remove(i)), s.length = 0;
|
|
842
852
|
};
|
|
843
|
-
},
|
|
844
|
-
const r =
|
|
853
|
+
}, O = (t, e) => {
|
|
854
|
+
const r = ne(t), s = oe(t);
|
|
845
855
|
return (n) => {
|
|
846
|
-
|
|
856
|
+
he(n, t);
|
|
847
857
|
const o = s(n.element);
|
|
848
858
|
return r(n.element, e), (i) => {
|
|
849
859
|
i && r(n.element, o);
|
|
850
860
|
};
|
|
851
861
|
};
|
|
852
|
-
},
|
|
853
|
-
const r =
|
|
862
|
+
}, k = (t, e) => {
|
|
863
|
+
const r = ne(t), s = oe(t);
|
|
854
864
|
return (n) => {
|
|
855
|
-
|
|
856
|
-
const o = s(n.element), i = e.on((
|
|
857
|
-
return (
|
|
858
|
-
i(),
|
|
865
|
+
he(n, t);
|
|
866
|
+
const o = s(n.element), i = e.on((l) => r(n.element, l));
|
|
867
|
+
return (l) => {
|
|
868
|
+
i(), l && r(n.element, o);
|
|
859
869
|
};
|
|
860
870
|
};
|
|
861
871
|
}, P = new Proxy(
|
|
@@ -872,17 +882,17 @@ const g = (t) => {
|
|
|
872
882
|
* @returns The renderable component for the specified attribute.
|
|
873
883
|
*
|
|
874
884
|
*/
|
|
875
|
-
get: (t, e) => e === "class" ? (r) => h.is(r) ?
|
|
885
|
+
get: (t, e) => e === "class" ? (r) => h.is(r) ? Xe(r) : We(
|
|
876
886
|
(r ?? "").split(" ").filter((s) => s.length > 0)
|
|
877
|
-
) : (r) => h.is(r) ?
|
|
887
|
+
) : (r) => h.is(r) ? k(
|
|
878
888
|
e,
|
|
879
889
|
r
|
|
880
|
-
) :
|
|
890
|
+
) : O(
|
|
881
891
|
e,
|
|
882
892
|
r
|
|
883
893
|
)
|
|
884
894
|
}
|
|
885
|
-
),
|
|
895
|
+
), Et = new Proxy(
|
|
886
896
|
{},
|
|
887
897
|
{
|
|
888
898
|
/**
|
|
@@ -893,12 +903,12 @@ const g = (t) => {
|
|
|
893
903
|
* @returns The renderable component for the specified attribute.
|
|
894
904
|
*
|
|
895
905
|
*/
|
|
896
|
-
get: (t, e) => (r) => h.is(r) ?
|
|
906
|
+
get: (t, e) => (r) => h.is(r) ? k(
|
|
897
907
|
`data-${e}`,
|
|
898
908
|
r
|
|
899
|
-
) :
|
|
909
|
+
) : O(`data-${e}`, r)
|
|
900
910
|
}
|
|
901
|
-
),
|
|
911
|
+
), Pt = new Proxy(
|
|
902
912
|
{},
|
|
903
913
|
{
|
|
904
914
|
/**
|
|
@@ -909,15 +919,15 @@ const g = (t) => {
|
|
|
909
919
|
* @returns The renderable component for the specified attribute.
|
|
910
920
|
*
|
|
911
921
|
*/
|
|
912
|
-
get: (t, e) => (r) => h.is(r) ?
|
|
922
|
+
get: (t, e) => (r) => h.is(r) ? k(
|
|
913
923
|
`aria-${e}`,
|
|
914
924
|
r
|
|
915
|
-
) :
|
|
925
|
+
) : O(
|
|
916
926
|
`aria-${e}`,
|
|
917
927
|
r
|
|
918
928
|
)
|
|
919
929
|
}
|
|
920
|
-
),
|
|
930
|
+
), Dt = new Proxy(
|
|
921
931
|
{},
|
|
922
932
|
{
|
|
923
933
|
/**
|
|
@@ -928,15 +938,15 @@ const g = (t) => {
|
|
|
928
938
|
* @returns The renderable component for the specified attribute.
|
|
929
939
|
*
|
|
930
940
|
*/
|
|
931
|
-
get: (t, e) => (r) => h.is(r) ?
|
|
941
|
+
get: (t, e) => (r) => h.is(r) ? k(
|
|
932
942
|
e,
|
|
933
943
|
r
|
|
934
|
-
) :
|
|
944
|
+
) : O(
|
|
935
945
|
e,
|
|
936
946
|
r
|
|
937
947
|
)
|
|
938
948
|
}
|
|
939
|
-
),
|
|
949
|
+
), bt = new Proxy(
|
|
940
950
|
{},
|
|
941
951
|
{
|
|
942
952
|
/**
|
|
@@ -946,29 +956,29 @@ const g = (t) => {
|
|
|
946
956
|
* @returns The renderable component for the specified attribute.
|
|
947
957
|
*
|
|
948
958
|
*/
|
|
949
|
-
get: (t, e) => (r) => h.is(r) ?
|
|
959
|
+
get: (t, e) => (r) => h.is(r) ? k(
|
|
950
960
|
e,
|
|
951
961
|
r
|
|
952
|
-
) :
|
|
962
|
+
) : O(
|
|
953
963
|
e,
|
|
954
964
|
r
|
|
955
965
|
)
|
|
956
966
|
}
|
|
957
|
-
),
|
|
967
|
+
), f = (t) => t == null ? w : Array.isArray(t) ? g(...t.map(f)) : typeof t == "string" ? le(t) : h.is(t) ? ue(t) : t, ae = (t, ...e) => (r) => {
|
|
958
968
|
const s = r.createElement(t, void 0);
|
|
959
|
-
r.isFirstLevel && N() &&
|
|
960
|
-
const n = e.map((o) =>
|
|
969
|
+
r.isFirstLevel && N() && pe(s), r.appendOrInsert(s), r = r.withElement(s);
|
|
970
|
+
const n = e.map((o) => f(o)(r));
|
|
961
971
|
return (o) => {
|
|
962
|
-
n.forEach((i) => i(!1)), o &&
|
|
972
|
+
n.forEach((i) => i(!1)), o && _(s);
|
|
963
973
|
};
|
|
964
|
-
},
|
|
974
|
+
}, ce = (t, e, ...r) => (s) => {
|
|
965
975
|
const n = s.createElement(t, e);
|
|
966
|
-
s.isFirstLevel && N() &&
|
|
967
|
-
const o = r.map((i) =>
|
|
976
|
+
s.isFirstLevel && N() && pe(n), s.appendOrInsert(n), s = s.withElement(n);
|
|
977
|
+
const o = r.map((i) => f(i)(s));
|
|
968
978
|
return (i) => {
|
|
969
|
-
o.forEach((
|
|
979
|
+
o.forEach((l) => l(!1)), i && _(n);
|
|
970
980
|
};
|
|
971
|
-
},
|
|
981
|
+
}, Tt = new Proxy(
|
|
972
982
|
{},
|
|
973
983
|
{
|
|
974
984
|
/**
|
|
@@ -976,9 +986,9 @@ const g = (t) => {
|
|
|
976
986
|
* @param tagName - The HTML tag name.
|
|
977
987
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
978
988
|
*/
|
|
979
|
-
get: (t, e) => (...r) =>
|
|
989
|
+
get: (t, e) => (...r) => ae(e, r.flatMap(f))
|
|
980
990
|
}
|
|
981
|
-
),
|
|
991
|
+
), Ct = new Proxy(
|
|
982
992
|
{},
|
|
983
993
|
{
|
|
984
994
|
/**
|
|
@@ -986,9 +996,9 @@ const g = (t) => {
|
|
|
986
996
|
* @param type - The input type name.
|
|
987
997
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
988
998
|
*/
|
|
989
|
-
get: (t, e) => (...r) =>
|
|
999
|
+
get: (t, e) => (...r) => ae("input", P.type(e), ...r)
|
|
990
1000
|
}
|
|
991
|
-
),
|
|
1001
|
+
), ze = "http://www.w3.org/2000/svg", Lt = new Proxy(
|
|
992
1002
|
{},
|
|
993
1003
|
{
|
|
994
1004
|
/**
|
|
@@ -996,9 +1006,9 @@ const g = (t) => {
|
|
|
996
1006
|
* @param tagName - The SVG tag name.
|
|
997
1007
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
998
1008
|
*/
|
|
999
|
-
get: (t, e) => (...r) =>
|
|
1009
|
+
get: (t, e) => (...r) => ce(e, ze, r.flatMap(f))
|
|
1000
1010
|
}
|
|
1001
|
-
),
|
|
1011
|
+
), Qe = "http://www.w3.org/1998/Math/MathML", Ot = new Proxy(
|
|
1002
1012
|
{},
|
|
1003
1013
|
{
|
|
1004
1014
|
/**
|
|
@@ -1006,9 +1016,9 @@ const g = (t) => {
|
|
|
1006
1016
|
* @param tagName - The Math tag name.
|
|
1007
1017
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
1008
1018
|
*/
|
|
1009
|
-
get: (t, e) => (...r) =>
|
|
1019
|
+
get: (t, e) => (...r) => ce(e, Qe, r.flatMap(f))
|
|
1010
1020
|
}
|
|
1011
|
-
), T = "data-tempo-attr",
|
|
1021
|
+
), T = "data-tempo-attr", $ = "data-tempo-class", fe = "data-tempo-node", V = "data-tempo-text", Ye = (t, e) => {
|
|
1012
1022
|
const r = t.getAttribute(e);
|
|
1013
1023
|
if (r != null) {
|
|
1014
1024
|
const s = t.getAttribute(T) ?? "{}", n = { ...JSON.parse(s), name: r };
|
|
@@ -1017,9 +1027,9 @@ const g = (t) => {
|
|
|
1017
1027
|
JSON.stringify(n).replace(/"/g, """)
|
|
1018
1028
|
);
|
|
1019
1029
|
}
|
|
1020
|
-
},
|
|
1021
|
-
N() && t.isFirstLevel &&
|
|
1022
|
-
},
|
|
1030
|
+
}, he = (t, e) => {
|
|
1031
|
+
N() && t.isFirstLevel && Ye(t.element, e);
|
|
1032
|
+
}, Ze = (t) => {
|
|
1023
1033
|
t.querySelectorAll(`[${T}]`).forEach((e) => {
|
|
1024
1034
|
const r = JSON.parse(
|
|
1025
1035
|
(e.getAttribute(T) ?? "{}").replace(/"/g, '"')
|
|
@@ -1029,85 +1039,85 @@ const g = (t) => {
|
|
|
1029
1039
|
e.removeAttribute(T);
|
|
1030
1040
|
});
|
|
1031
1041
|
};
|
|
1032
|
-
function
|
|
1033
|
-
t.setAttribute(
|
|
1042
|
+
function Ke(t) {
|
|
1043
|
+
t.setAttribute($, t.className);
|
|
1034
1044
|
}
|
|
1035
|
-
const
|
|
1036
|
-
N() && t.isFirstLevel && Qe(t.element);
|
|
1037
|
-
}, Ye = (t) => {
|
|
1038
|
-
t.querySelectorAll(`[${R}]`).forEach((e) => {
|
|
1039
|
-
const r = e.getAttribute(R);
|
|
1040
|
-
r !== null && (e.className = r, e.removeAttribute(R));
|
|
1041
|
-
});
|
|
1042
|
-
}, fe = (t) => {
|
|
1043
|
-
t.setAttribute(ue, "");
|
|
1044
|
-
}, Ze = (t) => {
|
|
1045
|
-
t.querySelectorAll(`[${ue}]`).forEach((e) => {
|
|
1046
|
-
g(e);
|
|
1047
|
-
});
|
|
1048
|
-
}, Ke = (t) => {
|
|
1049
|
-
t.setAttribute(M, t.textContent ?? "");
|
|
1050
|
-
}, he = (t) => {
|
|
1045
|
+
const de = (t) => {
|
|
1051
1046
|
N() && t.isFirstLevel && Ke(t.element);
|
|
1052
1047
|
}, xe = (t) => {
|
|
1053
|
-
t.querySelectorAll(`[${
|
|
1054
|
-
|
|
1048
|
+
t.querySelectorAll(`[${$}]`).forEach((e) => {
|
|
1049
|
+
const r = e.getAttribute($);
|
|
1050
|
+
r !== null && (e.className = r, e.removeAttribute($));
|
|
1055
1051
|
});
|
|
1052
|
+
}, pe = (t) => {
|
|
1053
|
+
t.setAttribute(fe, "");
|
|
1056
1054
|
}, et = (t) => {
|
|
1057
|
-
|
|
1058
|
-
|
|
1055
|
+
t.querySelectorAll(`[${fe}]`).forEach((e) => {
|
|
1056
|
+
_(e);
|
|
1057
|
+
});
|
|
1058
|
+
}, tt = (t) => {
|
|
1059
|
+
t.setAttribute(V, t.textContent ?? "");
|
|
1060
|
+
}, me = (t) => {
|
|
1061
|
+
N() && t.isFirstLevel && tt(t.element);
|
|
1062
|
+
}, rt = (t) => {
|
|
1063
|
+
t.querySelectorAll(`[${V}]`).forEach((e) => {
|
|
1064
|
+
e.textContent = e.getAttribute(V), e.removeAttribute(V);
|
|
1065
|
+
});
|
|
1066
|
+
}, st = (t) => {
|
|
1067
|
+
et(t), xe(t), Ze(t), rt(t);
|
|
1068
|
+
}, ge = () => {
|
|
1059
1069
|
const t = globalThis;
|
|
1060
1070
|
return t.__tempoSSR__ == null && (t.__tempoSSR__ = {
|
|
1061
1071
|
isSSR: !1,
|
|
1062
1072
|
counter: 0
|
|
1063
1073
|
}), t.__tempoSSR__;
|
|
1064
|
-
},
|
|
1065
|
-
const r =
|
|
1074
|
+
}, H = (t, e) => {
|
|
1075
|
+
const r = ge();
|
|
1066
1076
|
r[t] = e;
|
|
1067
|
-
},
|
|
1068
|
-
|
|
1069
|
-
},
|
|
1070
|
-
|
|
1071
|
-
},
|
|
1072
|
-
|
|
1073
|
-
},
|
|
1077
|
+
}, _e = (t) => ge()[t], U = (t) => {
|
|
1078
|
+
H("isSSR", t);
|
|
1079
|
+
}, W = () => _e("counter"), nt = () => {
|
|
1080
|
+
H("counter", (W() ?? 0) + 1);
|
|
1081
|
+
}, ot = () => {
|
|
1082
|
+
H("counter", (W() ?? 0) - 1);
|
|
1083
|
+
}, kt = (t = 30) => (U(!0), new Promise((e, r) => {
|
|
1074
1084
|
let s;
|
|
1075
1085
|
const n = setInterval(() => {
|
|
1076
|
-
|
|
1086
|
+
W() <= 0 && (clearInterval(n), clearTimeout(s), U(!1), e());
|
|
1077
1087
|
}, 30);
|
|
1078
1088
|
s = setTimeout(() => {
|
|
1079
|
-
clearInterval(n),
|
|
1089
|
+
clearInterval(n), U(!1), r(new Error("SSR Timeout"));
|
|
1080
1090
|
}, t * 1e3);
|
|
1081
|
-
})), Nt = (t) => (
|
|
1091
|
+
})), Nt = (t) => (nt(), f(t(ot))), N = () => _e("isSSR"), ve = (t, e) => {
|
|
1082
1092
|
if (typeof e == "function")
|
|
1083
|
-
return
|
|
1084
|
-
const r = e.pending != null ?
|
|
1093
|
+
return ve(t, { then: e });
|
|
1094
|
+
const r = e.pending != null ? f(e.pending) : w, s = e.then, n = e.error != null ? (o) => f(e.error(o)) : () => w;
|
|
1085
1095
|
return (o) => {
|
|
1086
1096
|
let i = !0;
|
|
1087
|
-
const
|
|
1097
|
+
const l = t();
|
|
1088
1098
|
o = o.makeRef();
|
|
1089
|
-
let
|
|
1090
|
-
return
|
|
1091
|
-
(
|
|
1092
|
-
i && (
|
|
1099
|
+
let a = f(r)(o);
|
|
1100
|
+
return l.then(
|
|
1101
|
+
(c) => {
|
|
1102
|
+
i && (a(!0), a = f(s(c))(o));
|
|
1093
1103
|
},
|
|
1094
|
-
(
|
|
1095
|
-
i && (
|
|
1104
|
+
(c) => {
|
|
1105
|
+
i && (a(!0), a = f(n(c))(o));
|
|
1096
1106
|
}
|
|
1097
|
-
), (
|
|
1098
|
-
i = !1,
|
|
1107
|
+
), (c) => {
|
|
1108
|
+
i = !1, a(c), c && o.reference && _(o.reference);
|
|
1099
1109
|
};
|
|
1100
1110
|
};
|
|
1101
|
-
},
|
|
1111
|
+
}, Rt = (t, e) => ve(() => t, e), ye = (t, e) => (r) => (r.element.addEventListener(t, e), (s) => {
|
|
1102
1112
|
s && r.element.removeEventListener(t, e);
|
|
1103
|
-
}),
|
|
1113
|
+
}), it = (t) => ye("click", (e) => {
|
|
1104
1114
|
e.preventDefault();
|
|
1105
1115
|
const r = e.target;
|
|
1106
1116
|
setTimeout(() => {
|
|
1107
1117
|
const s = r.ownerDocument != null ? r == null ? void 0 : r.checked : void 0;
|
|
1108
1118
|
s != null && t(!s);
|
|
1109
1119
|
}, 0);
|
|
1110
|
-
}),
|
|
1120
|
+
}), B = new Proxy(
|
|
1111
1121
|
{},
|
|
1112
1122
|
{
|
|
1113
1123
|
/**
|
|
@@ -1115,15 +1125,15 @@ const ce = (t) => {
|
|
|
1115
1125
|
* @param fn - The function to call when the event is triggered.
|
|
1116
1126
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
1117
1127
|
*/
|
|
1118
|
-
get: (t, e) => (r) =>
|
|
1128
|
+
get: (t, e) => (r) => ye(e, r)
|
|
1119
1129
|
}
|
|
1120
|
-
),
|
|
1130
|
+
), lt = (t) => (e) => {
|
|
1121
1131
|
const r = e.target;
|
|
1122
1132
|
t(r.value);
|
|
1123
|
-
},
|
|
1133
|
+
}, ut = (t) => (e) => {
|
|
1124
1134
|
const r = e.target;
|
|
1125
1135
|
t(r.valueAsNumber);
|
|
1126
|
-
},
|
|
1136
|
+
}, at = (t) => (e) => {
|
|
1127
1137
|
const r = e.target;
|
|
1128
1138
|
if (r.value === "")
|
|
1129
1139
|
return;
|
|
@@ -1133,7 +1143,7 @@ const ce = (t) => {
|
|
|
1133
1143
|
Number(s[2].substring(0, 2))
|
|
1134
1144
|
);
|
|
1135
1145
|
t(n);
|
|
1136
|
-
},
|
|
1146
|
+
}, ct = (t) => (e) => {
|
|
1137
1147
|
const r = e.target;
|
|
1138
1148
|
if (r.value === "")
|
|
1139
1149
|
return;
|
|
@@ -1143,52 +1153,57 @@ const ce = (t) => {
|
|
|
1143
1153
|
Number(n[2])
|
|
1144
1154
|
), i = s[1].split(":");
|
|
1145
1155
|
o.setHours(Number(i[0])), o.setMinutes(Number(i[1])), o.setSeconds(Number(i[2])), t(o);
|
|
1146
|
-
},
|
|
1156
|
+
}, Mt = (t) => (e) => {
|
|
1147
1157
|
const r = e.target;
|
|
1148
1158
|
t(r.checked);
|
|
1149
|
-
}, Mt = (t) => (e) => {
|
|
1150
|
-
e.preventDefault(), t();
|
|
1151
1159
|
}, $t = (t) => (e) => {
|
|
1160
|
+
e.preventDefault(), t();
|
|
1161
|
+
}, Vt = (t) => (e) => {
|
|
1152
1162
|
e.stopPropagation(), t();
|
|
1153
1163
|
}, Ft = (t) => (e) => {
|
|
1154
1164
|
e.stopImmediatePropagation(), t();
|
|
1155
|
-
},
|
|
1165
|
+
}, qt = (t, e = "input") => g(
|
|
1156
1166
|
P.valueAsDate(t),
|
|
1157
|
-
|
|
1158
|
-
),
|
|
1167
|
+
B[e](at(t.set))
|
|
1168
|
+
), It = (t, e = "input") => g(
|
|
1159
1169
|
P.valueAsDate(t),
|
|
1160
|
-
|
|
1161
|
-
),
|
|
1170
|
+
B[e](ct(t.set))
|
|
1171
|
+
), Bt = (t, e = "input") => g(
|
|
1162
1172
|
P.valueAsNumber(t),
|
|
1163
|
-
|
|
1164
|
-
),
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1173
|
+
B[e](ut(t.set))
|
|
1174
|
+
), jt = (t, e = "input") => g(P.value(t), B[e](lt(t.set))), Ut = (t) => g(P.checked(t), it(t.set)), X = (t, e) => {
|
|
1175
|
+
if (h.is(t))
|
|
1176
|
+
return (s) => {
|
|
1177
|
+
s = s.makeRef();
|
|
1178
|
+
let n, o;
|
|
1179
|
+
const i = t.map((c) => Object.keys(c)[0]);
|
|
1180
|
+
let l;
|
|
1181
|
+
const a = i.on((c) => {
|
|
1182
|
+
if (c !== l) {
|
|
1183
|
+
o == null || o.dispose(), n == null || n(!0), o = t.map((v) => v[c]);
|
|
1184
|
+
const d = e[c](o);
|
|
1185
|
+
n = f(d)(s), l = c;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
return (c) => {
|
|
1189
|
+
a(), c && s.reference != null && _(s.reference), n == null || n(!0);
|
|
1190
|
+
};
|
|
1191
|
+
};
|
|
1192
|
+
const r = Object.keys(t)[0];
|
|
1193
|
+
return f(e[r](I(t[r])));
|
|
1194
|
+
}, Se = (t, e, r) => X(
|
|
1195
|
+
m.map(t, (s) => ({ [s[e]]: s })),
|
|
1181
1196
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1182
1197
|
r
|
|
1183
|
-
),
|
|
1184
|
-
const r =
|
|
1185
|
-
return
|
|
1186
|
-
},
|
|
1187
|
-
|
|
1198
|
+
), Gt = (t, e) => Se(t, "kind", e), Jt = (t, e) => {
|
|
1199
|
+
const r = m.map(t, ([s, n]) => ({ [s]: n }));
|
|
1200
|
+
return X(r, e);
|
|
1201
|
+
}, Ht = (t, e) => Se(t, "type", e), z = (t, e) => X(
|
|
1202
|
+
m.map(t, (r) => ({ [r]: !0 })),
|
|
1188
1203
|
e
|
|
1189
1204
|
), Wt = (t, e = {}) => (r) => {
|
|
1190
|
-
const s = (e == null ? void 0 : e.firstSeparator) ??
|
|
1191
|
-
return
|
|
1205
|
+
const s = (e == null ? void 0 : e.firstSeparator) ?? t, n = (e == null ? void 0 : e.lastSeparator) ?? t;
|
|
1206
|
+
return z(
|
|
1192
1207
|
r.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
|
|
1193
1208
|
{
|
|
1194
1209
|
first: () => s,
|
|
@@ -1196,150 +1211,176 @@ const ce = (t) => {
|
|
|
1196
1211
|
other: () => t
|
|
1197
1212
|
}
|
|
1198
1213
|
);
|
|
1199
|
-
},
|
|
1214
|
+
}, we = (t, e) => (r) => {
|
|
1200
1215
|
const s = Object.values(t).reduce((n, o) => {
|
|
1201
1216
|
const i = r.getProvider(o);
|
|
1202
1217
|
if (i == null)
|
|
1203
1218
|
throw new Error(`No provider found for mark: ${o.description}`);
|
|
1204
1219
|
return n[o] = i, n;
|
|
1205
1220
|
}, {});
|
|
1206
|
-
return
|
|
1207
|
-
},
|
|
1221
|
+
return f(e(s))(r);
|
|
1222
|
+
}, Xt = (t, e) => (r) => {
|
|
1208
1223
|
const s = [], n = Object.entries(t).reduce(
|
|
1209
|
-
(o, [i,
|
|
1210
|
-
|
|
1224
|
+
(o, [i, l]) => (s.push(
|
|
1225
|
+
l((a) => (Reflect.set(o, i, a), null))(r)
|
|
1211
1226
|
), o),
|
|
1212
1227
|
{}
|
|
1213
1228
|
);
|
|
1214
1229
|
return s.push(e(n)(r)), (o) => {
|
|
1215
1230
|
s.forEach((i) => i(o));
|
|
1216
1231
|
};
|
|
1217
|
-
},
|
|
1218
|
-
r &&
|
|
1219
|
-
}),
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1232
|
+
}, zt = (t, e) => we([t], (r) => f(e(r[t]))), Qt = (t, e) => we(t, (r) => f(e(r))), Yt = (t) => (e) => t(e), Zt = (t) => (e) => (e.appendOrInsert(t), (r) => {
|
|
1233
|
+
r && _(t);
|
|
1234
|
+
}), ft = (t, e, r) => {
|
|
1235
|
+
if (h.is(t)) {
|
|
1236
|
+
const s = t;
|
|
1237
|
+
return (n) => {
|
|
1238
|
+
n = n.makeRef();
|
|
1239
|
+
let o = null, i = !1;
|
|
1240
|
+
const l = L(null), a = s.on((c) => {
|
|
1241
|
+
c == null ? (o == null || o(!0), o = f((r == null ? void 0 : r()) ?? w)(n), i = !1) : (l.value = c, i || (o == null || o(!0), o = f(e(l))(n), i = !0));
|
|
1242
|
+
});
|
|
1243
|
+
return (c) => {
|
|
1244
|
+
a(), o == null || o(c), c && n.reference && _(n.reference);
|
|
1245
|
+
};
|
|
1246
|
+
};
|
|
1247
|
+
} else {
|
|
1248
|
+
const s = t;
|
|
1249
|
+
if (s == null) {
|
|
1250
|
+
const n = r == null ? void 0 : r();
|
|
1251
|
+
return n != null ? f(n) : w;
|
|
1252
|
+
}
|
|
1253
|
+
return f(e(I(s)));
|
|
1254
|
+
}
|
|
1255
|
+
}, G = (t) => (e) => (r) => t(r, e), Ae = (t, e, r) => r != null ? Ae(t, (s) => {
|
|
1256
|
+
const n = s.map((i) => new M(i.index, i.total - 1)), o = s.map((i) => i.isLast ? "last" : "other");
|
|
1257
|
+
return g(
|
|
1258
|
+
G(() => {
|
|
1259
|
+
n.dispose(), o.dispose();
|
|
1260
|
+
}),
|
|
1261
|
+
f(e(s)),
|
|
1262
|
+
z(o, {
|
|
1263
|
+
last: () => w,
|
|
1264
|
+
other: () => r(n)
|
|
1236
1265
|
})
|
|
1237
1266
|
);
|
|
1238
|
-
}) : (s) => {
|
|
1267
|
+
}) : h.is(t) ? (s) => {
|
|
1239
1268
|
s = s.makeRef();
|
|
1240
1269
|
const n = t.map(
|
|
1241
|
-
(
|
|
1242
|
-
(
|
|
1270
|
+
(a) => Array.from({ length: a }, (c, d) => d).map(
|
|
1271
|
+
(c) => new M(c, a)
|
|
1243
1272
|
)
|
|
1244
|
-
), o = [], i = [],
|
|
1245
|
-
var d,
|
|
1246
|
-
const
|
|
1247
|
-
for (;
|
|
1248
|
-
(d = o.pop()) == null || d(!0), (
|
|
1249
|
-
for (let
|
|
1250
|
-
if (i[
|
|
1251
|
-
i[
|
|
1252
|
-
const D =
|
|
1253
|
-
o[
|
|
1273
|
+
), o = [], i = [], l = n.on((a) => {
|
|
1274
|
+
var d, v;
|
|
1275
|
+
const c = a.length;
|
|
1276
|
+
for (; c < o.length; )
|
|
1277
|
+
(d = o.pop()) == null || d(!0), (v = i.pop()) == null || v.dispose();
|
|
1278
|
+
for (let p = 0; p < c; p++)
|
|
1279
|
+
if (i[p] == null) {
|
|
1280
|
+
i[p] = L(a[p]);
|
|
1281
|
+
const D = f(e(i[p]));
|
|
1282
|
+
o[p] = D(s);
|
|
1254
1283
|
} else
|
|
1255
|
-
i[
|
|
1284
|
+
i[p].value = a[p];
|
|
1256
1285
|
});
|
|
1257
|
-
return (
|
|
1258
|
-
|
|
1286
|
+
return (a) => {
|
|
1287
|
+
l(), a && s.reference && _(s.reference);
|
|
1259
1288
|
};
|
|
1260
|
-
}
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1289
|
+
} : g(
|
|
1290
|
+
...Array.from({ length: t }, (s, n) => n).map(
|
|
1291
|
+
(s) => f(e(I(new M(s, t))))
|
|
1292
|
+
)
|
|
1293
|
+
), ht = (t, e, r) => r != null ? ht(t, (s, n) => {
|
|
1294
|
+
const o = n.map((l) => new M(l.index, l.total - 1)), i = n.map((l) => l.isLast ? "last" : "other");
|
|
1295
|
+
return g([
|
|
1296
|
+
G(() => {
|
|
1297
|
+
i.dispose(), o.dispose();
|
|
1298
|
+
}),
|
|
1299
|
+
f(e(s, n)),
|
|
1300
|
+
z(i, {
|
|
1301
|
+
last: () => w,
|
|
1302
|
+
other: () => r(o)
|
|
1268
1303
|
})
|
|
1269
1304
|
]);
|
|
1270
1305
|
}) : (s) => {
|
|
1271
|
-
const n =
|
|
1272
|
-
return
|
|
1273
|
-
const i =
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
);
|
|
1277
|
-
return
|
|
1278
|
-
|
|
1279
|
-
|
|
1306
|
+
const n = m.map(t, (o) => o.length);
|
|
1307
|
+
return Ae(n, (o) => {
|
|
1308
|
+
const i = Fe(
|
|
1309
|
+
o,
|
|
1310
|
+
t
|
|
1311
|
+
)((l, a) => a[l.index]);
|
|
1312
|
+
return g(
|
|
1313
|
+
G(() => i.dispose()),
|
|
1314
|
+
f(e(i, o))
|
|
1280
1315
|
);
|
|
1281
1316
|
})(s);
|
|
1282
|
-
},
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1317
|
+
}, Kt = (t, e) => {
|
|
1318
|
+
if (h.is(t)) {
|
|
1319
|
+
const r = t;
|
|
1320
|
+
return (s) => {
|
|
1321
|
+
s = s.makeRef();
|
|
1322
|
+
const n = r.map((l) => f(e(l)));
|
|
1323
|
+
let o = () => {
|
|
1324
|
+
};
|
|
1325
|
+
const i = n.on((l) => {
|
|
1326
|
+
o(!0), o = l(s);
|
|
1327
|
+
});
|
|
1328
|
+
return (l) => {
|
|
1329
|
+
i(), o(l);
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
}
|
|
1333
|
+
return f(e(t));
|
|
1334
|
+
}, Ee = (t, e, r) => ft(
|
|
1335
|
+
m.map(t, (s) => s ? !0 : null),
|
|
1295
1336
|
() => e,
|
|
1296
1337
|
r != null ? () => r : void 0
|
|
1297
|
-
),
|
|
1298
|
-
|
|
1338
|
+
), xt = (t, e, r) => Ee(
|
|
1339
|
+
m.map(t, (s) => !s),
|
|
1299
1340
|
e,
|
|
1300
1341
|
r
|
|
1301
|
-
),
|
|
1302
|
-
|
|
1342
|
+
), er = (t, e, r = w) => Ee(
|
|
1343
|
+
m.map(t, (s) => s.length > 0),
|
|
1303
1344
|
e,
|
|
1304
1345
|
r
|
|
1305
|
-
),
|
|
1306
|
-
}),
|
|
1346
|
+
), tr = (t) => (e) => t(e.element) ?? (() => {
|
|
1347
|
+
}), Pe = (t, e) => {
|
|
1307
1348
|
const r = t(e);
|
|
1308
1349
|
return () => r(!0);
|
|
1309
|
-
},
|
|
1350
|
+
}, rr = (t, e, { doc: r, clear: s } = {}) => {
|
|
1310
1351
|
const n = typeof e == "string" ? (r ?? document).querySelector(e) : e;
|
|
1311
1352
|
if (n === null)
|
|
1312
|
-
throw new
|
|
1353
|
+
throw new dt(
|
|
1313
1354
|
`Cannot find element by selector for render: ${e}`
|
|
1314
1355
|
);
|
|
1315
|
-
s !== !1 && (r ?? n.ownerDocument) != null &&
|
|
1316
|
-
const o =
|
|
1317
|
-
return
|
|
1356
|
+
s !== !1 && (r ?? n.ownerDocument) != null && st(r ?? n.ownerDocument);
|
|
1357
|
+
const o = He(n), i = ie(n) ? void 0 : n, l = S.of(o, i);
|
|
1358
|
+
return Pe(t, l);
|
|
1318
1359
|
};
|
|
1319
|
-
class
|
|
1360
|
+
class dt extends Error {
|
|
1320
1361
|
constructor(e) {
|
|
1321
1362
|
super(e);
|
|
1322
1363
|
}
|
|
1323
1364
|
}
|
|
1324
|
-
const
|
|
1365
|
+
const sr = (t, e) => (r) => {
|
|
1325
1366
|
const s = r.document.querySelector(t);
|
|
1326
1367
|
if (s === null)
|
|
1327
1368
|
throw new Error(`Cannot find element by selector for portal: ${t}`);
|
|
1328
|
-
return
|
|
1329
|
-
|
|
1369
|
+
return Pe(
|
|
1370
|
+
f(e),
|
|
1330
1371
|
r.withElement(s).withFirstLevel()
|
|
1331
1372
|
);
|
|
1332
|
-
},
|
|
1373
|
+
}, nr = (t) => Symbol(t), De = (t, e) => (r) => f(e)(r.withProviders(t)), or = (...t) => t.length > 0 ? t.reduceRight((e, r) => (s) => e(r(s))) : f, ir = (t, e, r) => De({ [t]: e }, f(r)), lr = (t, e) => De(t, f(e)), pt = (t, e) => (r) => {
|
|
1333
1374
|
const s = r.element, n = s.style.getPropertyValue(t);
|
|
1334
1375
|
return s.style.setProperty(t, e), (o) => {
|
|
1335
1376
|
o && s.style.setProperty(t, n);
|
|
1336
1377
|
};
|
|
1337
|
-
},
|
|
1378
|
+
}, mt = (t, e) => (r) => {
|
|
1338
1379
|
const s = r.element, n = s.style.getPropertyValue(t);
|
|
1339
1380
|
return e.on((o) => s.style.setProperty(t, o)), (o) => {
|
|
1340
1381
|
o && s.style.setProperty(t, n);
|
|
1341
1382
|
};
|
|
1342
|
-
},
|
|
1383
|
+
}, ur = new Proxy(
|
|
1343
1384
|
{},
|
|
1344
1385
|
{
|
|
1345
1386
|
/**
|
|
@@ -1350,115 +1391,116 @@ const rr = (t, e) => (r) => {
|
|
|
1350
1391
|
* @returns The renderable component for the specified attribute.
|
|
1351
1392
|
*
|
|
1352
1393
|
*/
|
|
1353
|
-
get: (t, e) => (r) => h.is(r) ?
|
|
1394
|
+
get: (t, e) => (r) => h.is(r) ? mt(e, r) : pt(e, r)
|
|
1354
1395
|
}
|
|
1355
1396
|
);
|
|
1356
1397
|
export {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1398
|
+
Rt as Async,
|
|
1399
|
+
Ut as BindChecked,
|
|
1400
|
+
qt as BindDate,
|
|
1401
|
+
It as BindDateTime,
|
|
1402
|
+
Bt as BindNumber,
|
|
1403
|
+
jt as BindText,
|
|
1363
1404
|
E as Computed,
|
|
1364
1405
|
Wt as Conjunction,
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1406
|
+
S as DOMContext,
|
|
1407
|
+
Zt as DOMNode,
|
|
1408
|
+
ae as El,
|
|
1409
|
+
ce as ElNS,
|
|
1410
|
+
M as ElementPosition,
|
|
1411
|
+
w as Empty,
|
|
1412
|
+
ft as Ensure,
|
|
1413
|
+
ht as ForEach,
|
|
1414
|
+
g as Fragment,
|
|
1415
|
+
Kt as MapSignal,
|
|
1416
|
+
K as MemoryStore,
|
|
1417
|
+
er as NotEmpty,
|
|
1418
|
+
it as OnChecked,
|
|
1419
|
+
Yt as OnCtx,
|
|
1420
|
+
tr as OnMount,
|
|
1421
|
+
G as OnUnmount,
|
|
1422
|
+
X as OneOf,
|
|
1423
|
+
Se as OneOfField,
|
|
1424
|
+
Gt as OneOfKind,
|
|
1425
|
+
Jt as OneOfTuple,
|
|
1426
|
+
Ht as OneOfType,
|
|
1427
|
+
z as OneOfValue,
|
|
1428
|
+
sr as Portal,
|
|
1429
|
+
F as Prop,
|
|
1430
|
+
or as Provide,
|
|
1431
|
+
Je as ProviderNotFoundError,
|
|
1432
|
+
dt as RenderingError,
|
|
1433
|
+
Ae as Repeat,
|
|
1393
1434
|
h as Signal,
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1435
|
+
ve as Task,
|
|
1436
|
+
At as TextNode,
|
|
1437
|
+
xt as Unless,
|
|
1438
|
+
Xt as Use,
|
|
1439
|
+
zt as UseProvider,
|
|
1440
|
+
Qt as UseProviders,
|
|
1400
1441
|
Nt as UseSSRDone,
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
ir as
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1442
|
+
m as Value,
|
|
1443
|
+
Ee as When,
|
|
1444
|
+
ir as WithProvider,
|
|
1445
|
+
lr as WithProviders,
|
|
1446
|
+
pe as _addNodeTracker,
|
|
1447
|
+
st as _clearSSR,
|
|
1448
|
+
He as _getSelfOrParentElement,
|
|
1449
|
+
ie as _isElement,
|
|
1450
|
+
oe as _makeGetter,
|
|
1451
|
+
ne as _makeSetter,
|
|
1452
|
+
he as _maybeAddAttributeTracker,
|
|
1453
|
+
de as _maybeAddClassTracker,
|
|
1454
|
+
me as _maybeAddTextTracker,
|
|
1455
|
+
_ as _removeDOMNode,
|
|
1456
|
+
Ge as _setAttribute,
|
|
1457
|
+
Ie as _setBooleanProperty,
|
|
1458
|
+
je as _setDateProperty,
|
|
1459
|
+
Be as _setNumberProperty,
|
|
1460
|
+
Ue as _setStringProperty,
|
|
1461
|
+
ue as _signalText,
|
|
1462
|
+
le as _staticText,
|
|
1463
|
+
St as animateSignal,
|
|
1464
|
+
qe as animateSignals,
|
|
1465
|
+
Pt as aria,
|
|
1424
1466
|
P as attr,
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1467
|
+
Et as dataAttr,
|
|
1468
|
+
Mt as emitChecked,
|
|
1469
|
+
$t as emitPreventDefault,
|
|
1428
1470
|
Ft as emitStopImmediatePropagation,
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1471
|
+
Vt as emitStopPropagation,
|
|
1472
|
+
lt as emitValue,
|
|
1473
|
+
at as emitValueAsDate,
|
|
1474
|
+
ct as emitValueAsDateTime,
|
|
1475
|
+
ut as emitValueAsNumber,
|
|
1476
|
+
Re as endInterpolate,
|
|
1477
|
+
Me as guessInterpolate,
|
|
1478
|
+
Tt as html,
|
|
1479
|
+
Ct as input,
|
|
1480
|
+
Ne as interpolateDate,
|
|
1481
|
+
Oe as interpolateNumber,
|
|
1482
|
+
ke as interpolateString,
|
|
1441
1483
|
N as isSSR,
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1484
|
+
vt as localStorageProp,
|
|
1485
|
+
J as makeComputed,
|
|
1486
|
+
Fe as makeComputedOf,
|
|
1487
|
+
wt as makeComputedRecord,
|
|
1488
|
+
Ve as makeEffect,
|
|
1489
|
+
_t as makeEffectOf,
|
|
1490
|
+
L as makeProp,
|
|
1491
|
+
nr as makeProviderMark,
|
|
1492
|
+
I as makeSignal,
|
|
1493
|
+
Ot as math,
|
|
1494
|
+
bt as mathAttr,
|
|
1495
|
+
B as on,
|
|
1496
|
+
kt as prepareSSR,
|
|
1497
|
+
rt as removeTextTrackers,
|
|
1498
|
+
rr as render,
|
|
1499
|
+
Pe as renderWithContext,
|
|
1500
|
+
f as renderableOfTNode,
|
|
1501
|
+
yt as sessionStorageProp,
|
|
1502
|
+
x as storedProp,
|
|
1503
|
+
ur as style,
|
|
1504
|
+
Lt as svg,
|
|
1505
|
+
Dt as svgAttr
|
|
1464
1506
|
};
|