@tempots/dom 34.1.0 → 34.3.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 +3 -2
- package/index.js +644 -539
- package/package.json +2 -2
- package/renderable/iframe.d.ts +91 -0
- package/types/domain.d.ts +2 -2
package/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const Ge = (t) => Symbol(t);
|
|
2
|
+
function Ke(t, e) {
|
|
3
3
|
return {
|
|
4
4
|
type: t,
|
|
5
5
|
render: e
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Se(t) {
|
|
9
9
|
return t != null && t !== !1 && t !== 0 && t !== "";
|
|
10
10
|
}
|
|
11
11
|
function Ye(t) {
|
|
12
|
-
return !
|
|
12
|
+
return !Se(t);
|
|
13
13
|
}
|
|
14
14
|
function Xe(t) {
|
|
15
15
|
return t == null;
|
|
@@ -29,7 +29,7 @@ const w = {
|
|
|
29
29
|
* @param fn - The function to map the value.
|
|
30
30
|
* @returns The mapped value.
|
|
31
31
|
*/
|
|
32
|
-
map: (t, e) =>
|
|
32
|
+
map: (t, e) => y.is(t) ? t.map(e) : e(t),
|
|
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,7 +40,7 @@ const w = {
|
|
|
40
40
|
* @param equals - A function that determines if two values are equal. Defaults to strict equality (===).
|
|
41
41
|
* @returns A Signal instance.
|
|
42
42
|
*/
|
|
43
|
-
toSignal: (t, e) =>
|
|
43
|
+
toSignal: (t, e) => y.is(t) ? t.derive() : re(t, 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.
|
|
@@ -56,14 +56,14 @@ const w = {
|
|
|
56
56
|
* @param value - The value or Signal instance to get the value from.
|
|
57
57
|
* @returns The value.
|
|
58
58
|
*/
|
|
59
|
-
get: (t) =>
|
|
59
|
+
get: (t) => y.is(t) ? t.get() : t,
|
|
60
60
|
/**
|
|
61
61
|
* Adds a listener to a `Signal` or calls the listener immediately if it is not a `Signal`.
|
|
62
62
|
* @param value - The value or Signal instance to add the listener to.
|
|
63
63
|
* @param listener - The listener to call when the value changes.
|
|
64
64
|
* @returns A function to remove the listener.
|
|
65
65
|
*/
|
|
66
|
-
on: (t, e) =>
|
|
66
|
+
on: (t, e) => y.is(t) ? t.on(e) : (e(t), () => {
|
|
67
67
|
}),
|
|
68
68
|
/**
|
|
69
69
|
* Disposes of a value or a Signal.
|
|
@@ -72,7 +72,7 @@ const w = {
|
|
|
72
72
|
* @param value - The value or Signal instance to dispose of.
|
|
73
73
|
*/
|
|
74
74
|
dispose: (t) => {
|
|
75
|
-
|
|
75
|
+
y.is(t) && t.dispose();
|
|
76
76
|
},
|
|
77
77
|
/**
|
|
78
78
|
* Returns a function that disposes of a value or a Signal.
|
|
@@ -95,13 +95,13 @@ const w = {
|
|
|
95
95
|
deriveProp: (t, {
|
|
96
96
|
autoDisposeProp: e = !0,
|
|
97
97
|
equals: s
|
|
98
|
-
} = {}) =>
|
|
98
|
+
} = {}) => y.is(t) ? t.deriveProp({ autoDisposeProp: e, equals: s }) : D(t, s),
|
|
99
99
|
/**
|
|
100
100
|
* Creates a new signal that emits `true` if the value is truthy, `false` otherwise.
|
|
101
101
|
* @param value - The value or signal to check.
|
|
102
102
|
* @returns A signal that emits `true` if the value is truthy, `false` otherwise.
|
|
103
103
|
*/
|
|
104
|
-
truthy: (t) => w.map(t,
|
|
104
|
+
truthy: (t) => w.map(t, Se),
|
|
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.
|
|
@@ -120,23 +120,23 @@ const w = {
|
|
|
120
120
|
* @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
121
121
|
*/
|
|
122
122
|
defined: (t) => w.map(t, Qe)
|
|
123
|
-
},
|
|
123
|
+
}, te = (...t) => (e, s) => {
|
|
124
124
|
if (t.length === 1)
|
|
125
125
|
return w.toSignal(t[0]).map(e);
|
|
126
|
-
const n = t.filter((r) =>
|
|
127
|
-
return
|
|
126
|
+
const n = t.filter((r) => y.is(r));
|
|
127
|
+
return ne(
|
|
128
128
|
() => e(...t.map((r) => w.get(r))),
|
|
129
129
|
n,
|
|
130
130
|
s
|
|
131
131
|
);
|
|
132
|
-
},
|
|
132
|
+
}, ss = (t) => {
|
|
133
133
|
const e = Object.keys(t);
|
|
134
|
-
return
|
|
134
|
+
return te(...Object.values(t))(
|
|
135
135
|
(...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
|
|
136
136
|
);
|
|
137
137
|
}, Ze = (...t) => (e, s = {}) => {
|
|
138
|
-
const n = t.filter((r) =>
|
|
139
|
-
return
|
|
138
|
+
const n = t.filter((r) => y.is(r));
|
|
139
|
+
return _e(
|
|
140
140
|
() => e(...t.map(w.get)),
|
|
141
141
|
n,
|
|
142
142
|
s
|
|
@@ -215,7 +215,7 @@ class q {
|
|
|
215
215
|
* @public
|
|
216
216
|
*/
|
|
217
217
|
prop(e, s) {
|
|
218
|
-
const n = ce(() =>
|
|
218
|
+
const n = ce(() => D(e, s));
|
|
219
219
|
return this.track(n), n;
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
@@ -229,7 +229,7 @@ class q {
|
|
|
229
229
|
* @public
|
|
230
230
|
*/
|
|
231
231
|
computed(e, s, n) {
|
|
232
|
-
const r = ce(() =>
|
|
232
|
+
const r = ce(() => ne(e, s, n));
|
|
233
233
|
return this.track(r), r;
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
@@ -243,7 +243,7 @@ class q {
|
|
|
243
243
|
* @public
|
|
244
244
|
*/
|
|
245
245
|
effect(e, s, n) {
|
|
246
|
-
return
|
|
246
|
+
return M(this, () => _e(e, s, n));
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* Creates a computed signal with curried signature and tracks it in this scope.
|
|
@@ -255,7 +255,7 @@ class q {
|
|
|
255
255
|
*/
|
|
256
256
|
computedOf(...e) {
|
|
257
257
|
return (s, n) => {
|
|
258
|
-
const r = ce(() =>
|
|
258
|
+
const r = ce(() => te(...e)(s, n));
|
|
259
259
|
return this.track(r), r;
|
|
260
260
|
};
|
|
261
261
|
}
|
|
@@ -268,39 +268,39 @@ class q {
|
|
|
268
268
|
* @public
|
|
269
269
|
*/
|
|
270
270
|
effectOf(...e) {
|
|
271
|
-
return (s, n) =>
|
|
271
|
+
return (s, n) => M(this, () => Ze(...e)(s, n));
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
const
|
|
275
|
-
|
|
274
|
+
const A = [], et = (t) => {
|
|
275
|
+
A.push(t);
|
|
276
276
|
}, tt = () => {
|
|
277
|
-
if (
|
|
277
|
+
if (A.length === 0)
|
|
278
278
|
throw new Error("Cannot pop from empty scope stack");
|
|
279
|
-
|
|
280
|
-
},
|
|
279
|
+
A.pop();
|
|
280
|
+
}, pe = () => A[A.length - 1] ?? null, ns = () => A, rs = () => A[A.length - 2] ?? null, M = (t, e) => {
|
|
281
281
|
et(t);
|
|
282
282
|
try {
|
|
283
283
|
return e();
|
|
284
284
|
} finally {
|
|
285
285
|
tt();
|
|
286
286
|
}
|
|
287
|
-
},
|
|
287
|
+
}, os = (t) => {
|
|
288
288
|
const e = new q();
|
|
289
289
|
try {
|
|
290
|
-
return
|
|
290
|
+
return M(e, () => t(e));
|
|
291
291
|
} finally {
|
|
292
292
|
e.dispose();
|
|
293
293
|
}
|
|
294
294
|
}, ce = (t) => {
|
|
295
|
-
const e =
|
|
296
|
-
|
|
295
|
+
const e = A.slice();
|
|
296
|
+
A.length = 0;
|
|
297
297
|
try {
|
|
298
298
|
return t();
|
|
299
299
|
} finally {
|
|
300
|
-
|
|
300
|
+
A.length = 0, A.push(...e);
|
|
301
301
|
}
|
|
302
302
|
};
|
|
303
|
-
class
|
|
303
|
+
class y {
|
|
304
304
|
/**
|
|
305
305
|
* Represents a signal with a value of type T.
|
|
306
306
|
*
|
|
@@ -353,7 +353,7 @@ class m {
|
|
|
353
353
|
* @returns A Signal that represents the result of the Promise
|
|
354
354
|
*/
|
|
355
355
|
static ofPromise = (e, s, n, r = (o, i) => o === i) => {
|
|
356
|
-
const o = new
|
|
356
|
+
const o = new y(s, r);
|
|
357
357
|
return e.then((i) => o._setAndNotify(i)).catch((i) => {
|
|
358
358
|
n != null ? o._setAndNotify(n(i)) : console.error(
|
|
359
359
|
"Unhandled promise rejection in Signal.ofPromise:",
|
|
@@ -446,7 +446,7 @@ class m {
|
|
|
446
446
|
const o = this._onValueListeners.indexOf(n);
|
|
447
447
|
o !== -1 && this._onValueListeners.splice(o, 1), s.abortSignal != null && s.abortSignal.removeEventListener("abort", r);
|
|
448
448
|
};
|
|
449
|
-
return s.abortSignal != null && s.abortSignal.addEventListener("abort", r), !s.noAutoDispose &&
|
|
449
|
+
return s.abortSignal != null && s.abortSignal.addEventListener("abort", r), !s.noAutoDispose && pe()?.onDispose(r), r;
|
|
450
450
|
};
|
|
451
451
|
/**
|
|
452
452
|
* Registers a listener function to be called whenever the value of the signal changes.
|
|
@@ -558,7 +558,7 @@ class m {
|
|
|
558
558
|
* @returns A new computed signal with the transformed value (auto-registered with current scope)
|
|
559
559
|
*/
|
|
560
560
|
map = (e, s = (n, r) => n === r) => {
|
|
561
|
-
const n = new
|
|
561
|
+
const n = new R(() => {
|
|
562
562
|
try {
|
|
563
563
|
return e(this.get());
|
|
564
564
|
} catch (r) {
|
|
@@ -578,7 +578,7 @@ class m {
|
|
|
578
578
|
* @returns A new Signal that emits the values of the resulting Signal.
|
|
579
579
|
*/
|
|
580
580
|
flatMap = (e, s = (n, r) => n === r) => {
|
|
581
|
-
const n = new
|
|
581
|
+
const n = new R(() => {
|
|
582
582
|
try {
|
|
583
583
|
return e(this.get()).get();
|
|
584
584
|
} catch (r) {
|
|
@@ -616,7 +616,7 @@ class m {
|
|
|
616
616
|
}
|
|
617
617
|
filter = (e, s) => {
|
|
618
618
|
let n = s ?? this.get();
|
|
619
|
-
const r = new
|
|
619
|
+
const r = new R(() => {
|
|
620
620
|
try {
|
|
621
621
|
const o = this.get();
|
|
622
622
|
return n = e(o) ? o : n;
|
|
@@ -638,7 +638,7 @@ class m {
|
|
|
638
638
|
*/
|
|
639
639
|
filterMap = (e, s, n = (r, o) => r === o) => {
|
|
640
640
|
let r = s;
|
|
641
|
-
const o = new
|
|
641
|
+
const o = new R(() => {
|
|
642
642
|
try {
|
|
643
643
|
const i = this.get();
|
|
644
644
|
return r = e(i) ?? r;
|
|
@@ -662,17 +662,17 @@ class m {
|
|
|
662
662
|
* @returns A property that holds the mapped value and can be observed for changes.
|
|
663
663
|
*/
|
|
664
664
|
mapAsync = (e, s, n, r = (o, i) => o === i) => {
|
|
665
|
-
const o =
|
|
665
|
+
const o = D(s, r);
|
|
666
666
|
let i = 0, l = new AbortController();
|
|
667
667
|
return o.onDispose(
|
|
668
|
-
this.on(async (
|
|
669
|
-
const
|
|
668
|
+
this.on(async (a) => {
|
|
669
|
+
const c = ++i;
|
|
670
670
|
l.abort(), l = new AbortController();
|
|
671
671
|
try {
|
|
672
|
-
const u = await e(
|
|
673
|
-
|
|
672
|
+
const u = await e(a, { abortSignal: l.signal });
|
|
673
|
+
c === i && o.set(u);
|
|
674
674
|
} catch (u) {
|
|
675
|
-
if (
|
|
675
|
+
if (c === i)
|
|
676
676
|
if (n != null)
|
|
677
677
|
o.set(n(u));
|
|
678
678
|
else
|
|
@@ -712,7 +712,7 @@ class m {
|
|
|
712
712
|
deriveProp = ({
|
|
713
713
|
autoDisposeProp: e = !0,
|
|
714
714
|
equals: s
|
|
715
|
-
} = {}) => this.feedProp(
|
|
715
|
+
} = {}) => this.feedProp(D(this.get(), s), e);
|
|
716
716
|
/**
|
|
717
717
|
* Derives a new signal from the current signal. Useful to create a new signal that emits the same values as the current signal but can be disposed independently.
|
|
718
718
|
* @returns A new signal that emits the same values as the current signal.
|
|
@@ -742,7 +742,7 @@ class m {
|
|
|
742
742
|
};
|
|
743
743
|
}
|
|
744
744
|
const st = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
|
|
745
|
-
class
|
|
745
|
+
class R extends y {
|
|
746
746
|
/**
|
|
747
747
|
* Creates a new Computed signal.
|
|
748
748
|
*
|
|
@@ -768,7 +768,7 @@ class $ extends m {
|
|
|
768
768
|
* @see {@link untracked} - Create signals outside of scope tracking
|
|
769
769
|
*/
|
|
770
770
|
constructor(e, s) {
|
|
771
|
-
super(void 0, s), this._fn = e, this.setDirty(),
|
|
771
|
+
super(void 0, s), this._fn = e, this.setDirty(), pe()?.track(this);
|
|
772
772
|
}
|
|
773
773
|
/**
|
|
774
774
|
* Checks if a value is an instance of `Computed`.
|
|
@@ -825,7 +825,7 @@ class $ extends m {
|
|
|
825
825
|
this._disposed || (this._scheduleCount++, this._disposed = !0, this._onDisposeListeners.forEach((e) => e()), this._onDisposeListeners.length = 0, this._derivatives.length = 0);
|
|
826
826
|
};
|
|
827
827
|
}
|
|
828
|
-
class
|
|
828
|
+
class se extends y {
|
|
829
829
|
/**
|
|
830
830
|
* Checks if a value is a Prop.
|
|
831
831
|
* @param value - The value to check.
|
|
@@ -886,7 +886,7 @@ class ee extends m {
|
|
|
886
886
|
* @returns A Prop object representing the isomorphism.
|
|
887
887
|
*/
|
|
888
888
|
iso = (e, s, n = (r, o) => r === o) => {
|
|
889
|
-
const r = new
|
|
889
|
+
const r = new se(e(this.get()), n);
|
|
890
890
|
return r.onDispose(this.on((o) => r.set(e(o)))), r.on((o) => this._setAndNotify(s(o))), r;
|
|
891
891
|
};
|
|
892
892
|
/**
|
|
@@ -909,10 +909,10 @@ class ee extends m {
|
|
|
909
909
|
this._setAndNotify(e);
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
|
-
const
|
|
913
|
-
const n = new
|
|
912
|
+
const ne = (t, e, s = (n, r) => n === r) => {
|
|
913
|
+
const n = new R(t, s);
|
|
914
914
|
return e.forEach((r) => r.setDerivative(n)), n;
|
|
915
|
-
},
|
|
915
|
+
}, _e = (t, e, s = {}) => {
|
|
916
916
|
let n = s.once ? () => {
|
|
917
917
|
o(), t();
|
|
918
918
|
} : t;
|
|
@@ -923,28 +923,28 @@ const te = (t, e, s = (n, r) => n === r) => {
|
|
|
923
923
|
i ? l() : i = !0;
|
|
924
924
|
};
|
|
925
925
|
}
|
|
926
|
-
const r =
|
|
926
|
+
const r = ne(n, e), o = () => {
|
|
927
927
|
r.dispose(), s.abortSignal != null && s.abortSignal.removeEventListener("abort", o);
|
|
928
928
|
};
|
|
929
929
|
return s.abortSignal != null && s.abortSignal.addEventListener("abort", o), o;
|
|
930
|
-
},
|
|
931
|
-
const s = new
|
|
932
|
-
return
|
|
933
|
-
},
|
|
930
|
+
}, D = (t, e = (s, n) => s === n) => {
|
|
931
|
+
const s = new se(t, e);
|
|
932
|
+
return pe()?.track(s), s;
|
|
933
|
+
}, re = (t, e = (s, n) => s === n) => new y(t, e), oe = () => (
|
|
934
934
|
/* c8 ignore next */
|
|
935
935
|
typeof window < "u" ? window : void 0
|
|
936
|
-
), nt = (t, e, s) => t + (e - t) * s,
|
|
936
|
+
), nt = (t, e, s) => t + (e - t) * s, we = 97, rt = (t, e, s) => {
|
|
937
937
|
const n = Math.max(t.length, e.length);
|
|
938
938
|
let r = "";
|
|
939
939
|
for (let o = 0; o < n; o++) {
|
|
940
940
|
let i = t.charCodeAt(o);
|
|
941
|
-
isNaN(i) && (i =
|
|
941
|
+
isNaN(i) && (i = we);
|
|
942
942
|
let l = e.charCodeAt(o);
|
|
943
|
-
isNaN(l) && (l =
|
|
943
|
+
isNaN(l) && (l = we), r += String.fromCharCode(i + (l - i) * s);
|
|
944
944
|
}
|
|
945
945
|
return r;
|
|
946
946
|
}, ot = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), it = (t, e) => e, lt = (t) => typeof t == "number" ? nt : typeof t == "string" ? rt : t instanceof Date ? ot : it;
|
|
947
|
-
class
|
|
947
|
+
class Te {
|
|
948
948
|
_store = /* @__PURE__ */ new Map();
|
|
949
949
|
/**
|
|
950
950
|
* Retrieves the value associated with the specified key from the memory store.
|
|
@@ -961,112 +961,112 @@ class Se {
|
|
|
961
961
|
this._store.set(e, s);
|
|
962
962
|
};
|
|
963
963
|
}
|
|
964
|
-
let
|
|
965
|
-
const
|
|
964
|
+
let ue = null, he = null;
|
|
965
|
+
const at = () => (ue || (ue = new Te()), ue), ct = () => (he || (he = new Te()), he), Ae = ({
|
|
966
966
|
key: t,
|
|
967
967
|
defaultValue: e,
|
|
968
968
|
store: s,
|
|
969
969
|
serialize: n = JSON.stringify,
|
|
970
970
|
deserialize: r = JSON.parse,
|
|
971
|
-
equals: o = (
|
|
972
|
-
onLoad: i = (
|
|
971
|
+
equals: o = (c, u) => c === u,
|
|
972
|
+
onLoad: i = (c) => c,
|
|
973
973
|
syncTabs: l = !0,
|
|
974
|
-
onKeyChange:
|
|
974
|
+
onKeyChange: a = "load"
|
|
975
975
|
}) => {
|
|
976
|
-
let
|
|
977
|
-
const u = s.getItem(
|
|
976
|
+
let c = w.get(t);
|
|
977
|
+
const u = s.getItem(c), d = new se(
|
|
978
978
|
u != null ? i(r(u)) : typeof e == "function" ? e() : e,
|
|
979
979
|
o
|
|
980
|
-
),
|
|
981
|
-
let
|
|
982
|
-
const b = (
|
|
983
|
-
if (!
|
|
984
|
-
const
|
|
985
|
-
const
|
|
986
|
-
if (!(
|
|
980
|
+
), p = oe(), h = l && typeof p?.BroadcastChannel == "function";
|
|
981
|
+
let f = !1, v = null, S = null;
|
|
982
|
+
const b = (_) => {
|
|
983
|
+
if (!h) return null;
|
|
984
|
+
const I = `tempo:storedProp:${_}`, L = new p.BroadcastChannel(I), H = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, O = (J) => {
|
|
985
|
+
const C = J.data;
|
|
986
|
+
if (!(C == null || typeof C != "object" || C.key !== _ || typeof C.value != "string" || C.sourceId != null && C.sourceId === H))
|
|
987
987
|
try {
|
|
988
|
-
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
} catch (
|
|
988
|
+
f = !0;
|
|
989
|
+
const ae = i(r(C.value));
|
|
990
|
+
d.set(ae);
|
|
991
|
+
} catch (ae) {
|
|
992
992
|
console.warn(
|
|
993
|
-
`Failed to sync storedProp for key "${
|
|
994
|
-
|
|
993
|
+
`Failed to sync storedProp for key "${_}" via BroadcastChannel`,
|
|
994
|
+
ae
|
|
995
995
|
);
|
|
996
996
|
} finally {
|
|
997
|
-
|
|
997
|
+
f = !1;
|
|
998
998
|
}
|
|
999
999
|
};
|
|
1000
|
-
return
|
|
1001
|
-
|
|
1002
|
-
}), { channel:
|
|
1003
|
-
}, x = b(
|
|
1004
|
-
x && (v = x.channel,
|
|
1005
|
-
const
|
|
1006
|
-
const
|
|
1007
|
-
if (
|
|
1008
|
-
const
|
|
1009
|
-
if (s.setItem(
|
|
1010
|
-
const
|
|
1011
|
-
if (
|
|
1000
|
+
return L.addEventListener("message", O), d.onDispose(() => {
|
|
1001
|
+
L?.removeEventListener("message", O), L?.close();
|
|
1002
|
+
}), { channel: L, instanceId: H, handleMessage: O };
|
|
1003
|
+
}, x = b(c);
|
|
1004
|
+
x && (v = x.channel, S = x.instanceId);
|
|
1005
|
+
const U = (_) => {
|
|
1006
|
+
const I = c;
|
|
1007
|
+
if (I === _) return;
|
|
1008
|
+
const L = d.get(), H = n(L);
|
|
1009
|
+
if (s.setItem(I, H), v != null && (v.close(), v = null, S = null), c = _, a === "load") {
|
|
1010
|
+
const J = s.getItem(_);
|
|
1011
|
+
if (J != null)
|
|
1012
1012
|
try {
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
} catch (
|
|
1013
|
+
const C = i(r(J));
|
|
1014
|
+
d.set(C);
|
|
1015
|
+
} catch (C) {
|
|
1016
1016
|
console.warn(
|
|
1017
|
-
`Failed to load storedProp from new key "${
|
|
1018
|
-
|
|
1017
|
+
`Failed to load storedProp from new key "${_}"`,
|
|
1018
|
+
C
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
1021
|
else
|
|
1022
|
-
s.setItem(
|
|
1023
|
-
} else
|
|
1024
|
-
const
|
|
1025
|
-
|
|
1026
|
-
};
|
|
1027
|
-
return
|
|
1028
|
-
const
|
|
1029
|
-
s.setItem(
|
|
1030
|
-
key:
|
|
1031
|
-
value:
|
|
1032
|
-
sourceId:
|
|
1022
|
+
s.setItem(_, H);
|
|
1023
|
+
} else a === "migrate" && s.setItem(_, H);
|
|
1024
|
+
const O = b(_);
|
|
1025
|
+
O && (v = O.channel, S = O.instanceId);
|
|
1026
|
+
};
|
|
1027
|
+
return y.is(t) && d.onDispose(t.on(U)), d.on((_, I) => {
|
|
1028
|
+
const L = n(_);
|
|
1029
|
+
s.setItem(c, L), v != null && !f && I !== void 0 && S != null && v.postMessage({
|
|
1030
|
+
key: c,
|
|
1031
|
+
value: L,
|
|
1032
|
+
sourceId: S
|
|
1033
1033
|
});
|
|
1034
|
-
}),
|
|
1035
|
-
},
|
|
1036
|
-
const e =
|
|
1037
|
-
return
|
|
1034
|
+
}), d;
|
|
1035
|
+
}, is = (t) => {
|
|
1036
|
+
const e = oe()?.localStorage, s = e && typeof e.getItem == "function" ? e : at();
|
|
1037
|
+
return Ae({
|
|
1038
1038
|
...t,
|
|
1039
1039
|
store: s
|
|
1040
1040
|
});
|
|
1041
|
-
},
|
|
1042
|
-
const e =
|
|
1043
|
-
return
|
|
1041
|
+
}, ls = (t) => {
|
|
1042
|
+
const e = oe()?.sessionStorage, s = e && typeof e.getItem == "function" ? e : ct();
|
|
1043
|
+
return Ae({
|
|
1044
1044
|
...t,
|
|
1045
1045
|
store: s
|
|
1046
1046
|
});
|
|
1047
1047
|
};
|
|
1048
|
-
function
|
|
1048
|
+
function ve(t) {
|
|
1049
1049
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
|
|
1050
1050
|
}
|
|
1051
1051
|
const ut = (t, e, s, n) => {
|
|
1052
1052
|
const r = n?.duration ?? 300, o = n?.easing ?? ((b) => b), i = n?.equals ?? ((b, x) => b === x);
|
|
1053
|
-
let l = n?.interpolate,
|
|
1054
|
-
const
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
}),
|
|
1058
|
-
b.setDerivative(
|
|
1053
|
+
let l = n?.interpolate, a = t, c = e(), u = performance.now(), d = null, p = !0;
|
|
1054
|
+
const h = new R(e, i), f = D(t, i);
|
|
1055
|
+
f.onDispose(() => {
|
|
1056
|
+
d !== null && cancelAnimationFrame(d);
|
|
1057
|
+
}), f.onDispose(h.dispose), s.forEach((b) => {
|
|
1058
|
+
b.setDerivative(h), b.onDispose(f.dispose);
|
|
1059
1059
|
});
|
|
1060
1060
|
const v = (b) => {
|
|
1061
|
-
|
|
1062
|
-
},
|
|
1061
|
+
c = b, u = performance.now(), a = f.value, p && (p = !1, d = ve(S));
|
|
1062
|
+
}, S = () => {
|
|
1063
1063
|
const b = (performance.now() - u) / w.get(r), x = o(b);
|
|
1064
|
-
l == null && (l = lt(
|
|
1065
|
-
let
|
|
1066
|
-
b >= 1 ? (
|
|
1064
|
+
l == null && (l = lt(a));
|
|
1065
|
+
let U = l(a, c, x);
|
|
1066
|
+
b >= 1 ? (p = !0, U = c) : d = ve(S), f.set(U);
|
|
1067
1067
|
};
|
|
1068
|
-
return
|
|
1069
|
-
},
|
|
1068
|
+
return h.on(v), f;
|
|
1069
|
+
}, as = (t, e) => {
|
|
1070
1070
|
const { initialValue: s, ...n } = e ?? {};
|
|
1071
1071
|
return ut(
|
|
1072
1072
|
/* c8 ignore next 2 */
|
|
@@ -1076,15 +1076,15 @@ const ut = (t, e, s, n) => {
|
|
|
1076
1076
|
n
|
|
1077
1077
|
);
|
|
1078
1078
|
}, ht = (t, e) => {
|
|
1079
|
-
const s = Object.values(t).filter(
|
|
1080
|
-
return
|
|
1079
|
+
const s = Object.values(t).filter(y.is), n = Object.keys(t);
|
|
1080
|
+
return ne(() => {
|
|
1081
1081
|
const r = {};
|
|
1082
1082
|
for (const o of n)
|
|
1083
1083
|
r[o] = w.get(t[o]);
|
|
1084
1084
|
return e(r);
|
|
1085
1085
|
}, s);
|
|
1086
|
-
}, cs = (t) => ht(t, (e) => e),
|
|
1087
|
-
const s =
|
|
1086
|
+
}, cs = (t) => ht(t, (e) => e), us = (t, e) => {
|
|
1087
|
+
const s = D(t.get());
|
|
1088
1088
|
let n = null;
|
|
1089
1089
|
const r = t.on(
|
|
1090
1090
|
(o) => {
|
|
@@ -1100,28 +1100,78 @@ const ut = (t, e, s, n) => {
|
|
|
1100
1100
|
return s.onDispose(() => {
|
|
1101
1101
|
r(), n != null && clearTimeout(n);
|
|
1102
1102
|
}), s;
|
|
1103
|
-
},
|
|
1103
|
+
}, hs = (t) => {
|
|
1104
1104
|
let e;
|
|
1105
1105
|
return t.map((s) => {
|
|
1106
1106
|
const n = e;
|
|
1107
1107
|
return e = s, n;
|
|
1108
1108
|
});
|
|
1109
|
-
},
|
|
1109
|
+
}, ds = ({
|
|
1110
1110
|
size: t = void 0,
|
|
1111
1111
|
signal: e
|
|
1112
1112
|
}) => {
|
|
1113
1113
|
const s = [];
|
|
1114
1114
|
return e.map((n) => (s.push(n), t != null && s.length > t && s.shift(), s.slice()));
|
|
1115
|
-
},
|
|
1115
|
+
}, ps = (t) => (...e) => te(
|
|
1116
1116
|
t,
|
|
1117
1117
|
...e
|
|
1118
1118
|
)((s, ...n) => s(...n));
|
|
1119
|
-
function
|
|
1120
|
-
return
|
|
1119
|
+
function fs(...t) {
|
|
1120
|
+
return te(...t)((...e) => {
|
|
1121
1121
|
for (const s of e) if (s != null) return s;
|
|
1122
1122
|
});
|
|
1123
1123
|
}
|
|
1124
|
-
|
|
1124
|
+
const gs = (t, {
|
|
1125
|
+
channel: e,
|
|
1126
|
+
serialize: s = JSON.stringify,
|
|
1127
|
+
deserialize: n = JSON.parse,
|
|
1128
|
+
equals: r = (o, i) => o === i
|
|
1129
|
+
}) => {
|
|
1130
|
+
const o = oe();
|
|
1131
|
+
if (typeof o?.BroadcastChannel != "function")
|
|
1132
|
+
return () => {
|
|
1133
|
+
};
|
|
1134
|
+
const i = new o.BroadcastChannel(
|
|
1135
|
+
`tempo:syncProp:${e}`
|
|
1136
|
+
), l = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
1137
|
+
let a = !1;
|
|
1138
|
+
const c = (p) => {
|
|
1139
|
+
const h = p.data;
|
|
1140
|
+
if (!(h == null || typeof h != "object" || typeof h.value != "string" || h.sourceId != null && h.sourceId === l))
|
|
1141
|
+
try {
|
|
1142
|
+
a = !0;
|
|
1143
|
+
const f = n(h.value);
|
|
1144
|
+
r(t.get(), f) || t.set(f);
|
|
1145
|
+
} catch (f) {
|
|
1146
|
+
console.warn(
|
|
1147
|
+
`Failed to sync prop for channel "${e}" via BroadcastChannel`,
|
|
1148
|
+
f
|
|
1149
|
+
);
|
|
1150
|
+
} finally {
|
|
1151
|
+
a = !1;
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
i.addEventListener("message", c);
|
|
1155
|
+
const u = t.on((p, h) => {
|
|
1156
|
+
if (!a && h !== void 0 && !r(p, h))
|
|
1157
|
+
try {
|
|
1158
|
+
const f = s(p);
|
|
1159
|
+
i.postMessage({
|
|
1160
|
+
value: f,
|
|
1161
|
+
sourceId: l
|
|
1162
|
+
});
|
|
1163
|
+
} catch (f) {
|
|
1164
|
+
console.warn(
|
|
1165
|
+
`Failed to serialize prop for channel "${e}" via BroadcastChannel`,
|
|
1166
|
+
f
|
|
1167
|
+
);
|
|
1168
|
+
}
|
|
1169
|
+
}), d = () => {
|
|
1170
|
+
u(), i.removeEventListener("message", c), i.close();
|
|
1171
|
+
};
|
|
1172
|
+
return t.onDispose(d), d;
|
|
1173
|
+
};
|
|
1174
|
+
class de {
|
|
1125
1175
|
/**
|
|
1126
1176
|
* Creates a new instance of `ElementPosition`.
|
|
1127
1177
|
* @param index - The index of the element.
|
|
@@ -1169,12 +1219,12 @@ class he {
|
|
|
1169
1219
|
this.#e?.dispose(), this.#e = void 0;
|
|
1170
1220
|
};
|
|
1171
1221
|
}
|
|
1172
|
-
const
|
|
1222
|
+
const Ee = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Ce = /* @__PURE__ */ new Set(["selected"]), De = /* @__PURE__ */ new Set([
|
|
1173
1223
|
"rowSpan",
|
|
1174
1224
|
"colSpan",
|
|
1175
1225
|
"tabIndex",
|
|
1176
1226
|
"valueAsNumber"
|
|
1177
|
-
]),
|
|
1227
|
+
]), Pe = /* @__PURE__ */ new Set(["valueAsDate"]), xe = /* @__PURE__ */ new Set([
|
|
1178
1228
|
"value",
|
|
1179
1229
|
"textContent",
|
|
1180
1230
|
"innerText",
|
|
@@ -1182,28 +1232,28 @@ const Ae = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), Te = /* @
|
|
|
1182
1232
|
"outerHTML",
|
|
1183
1233
|
"className",
|
|
1184
1234
|
"classList"
|
|
1185
|
-
]), dt = (t, e) =>
|
|
1235
|
+
]), dt = (t, e) => Ce.has(t) ? (s) => {
|
|
1186
1236
|
s == null || s !== !0 ? e.removeAttribute(t) : e.setAttribute(t, "");
|
|
1187
|
-
} : Ae.has(t) ? (s) => {
|
|
1188
|
-
s == null ? e[t] = null : e[t] = !!s;
|
|
1189
1237
|
} : Ee.has(t) ? (s) => {
|
|
1238
|
+
s == null ? e[t] = null : e[t] = !!s;
|
|
1239
|
+
} : De.has(t) ? (s) => {
|
|
1190
1240
|
s == null ? e[t] = null : e[t] = Number(s);
|
|
1191
|
-
} :
|
|
1241
|
+
} : Pe.has(t) ? (s) => {
|
|
1192
1242
|
s == null ? e[t] = null : e[t] = s;
|
|
1193
|
-
} :
|
|
1243
|
+
} : xe.has(t) ? (s) => {
|
|
1194
1244
|
s == null ? e[t] = null : e[t] = String(s);
|
|
1195
1245
|
} : (s) => {
|
|
1196
1246
|
s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
|
|
1197
|
-
}, pt = (t, e) =>
|
|
1247
|
+
}, pt = (t, e) => Ce.has(t) ? () => e.hasAttribute(t) : Ee.has(t) ? () => !!e[t] : De.has(t) ? () => Number(e[t]) : Pe.has(t) ? () => e[t] : xe.has(t) ? () => String(e[t]) : () => e.getAttribute(t), K = (t) => {
|
|
1198
1248
|
const e = t;
|
|
1199
1249
|
e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentNode && t.parentNode.removeChild(t);
|
|
1200
|
-
}, ft = (t) =>
|
|
1201
|
-
class
|
|
1250
|
+
}, ft = (t) => Le(t) || Oe(t) ? t : t.parentElement, Le = (t) => t.nodeType === 1, Oe = (t) => t.nodeType === 11;
|
|
1251
|
+
class Me extends Error {
|
|
1202
1252
|
constructor(e) {
|
|
1203
1253
|
super(`Provider not found: ${e.description}`);
|
|
1204
1254
|
}
|
|
1205
1255
|
}
|
|
1206
|
-
class
|
|
1256
|
+
class j {
|
|
1207
1257
|
/**
|
|
1208
1258
|
* Constructs a new `DOMContext` instance.
|
|
1209
1259
|
*
|
|
@@ -1225,7 +1275,7 @@ class R {
|
|
|
1225
1275
|
* @returns A new `DOMContext` instance.
|
|
1226
1276
|
*/
|
|
1227
1277
|
static of(e, s, n) {
|
|
1228
|
-
return new
|
|
1278
|
+
return new j(e.ownerDocument, e, s, n);
|
|
1229
1279
|
}
|
|
1230
1280
|
/**
|
|
1231
1281
|
* Creates a new DOM element (eg: HTML or SVG) with the specified tag name and namespace.
|
|
@@ -1310,7 +1360,12 @@ class R {
|
|
|
1310
1360
|
* @param element - The DOM element to use in the new `DOMContext` instance.
|
|
1311
1361
|
* @returns A new `DOMContext` instance with the provided `element`.
|
|
1312
1362
|
*/
|
|
1313
|
-
withElement = (e) => new
|
|
1363
|
+
withElement = (e) => new j(
|
|
1364
|
+
e.ownerDocument ?? this.document,
|
|
1365
|
+
e,
|
|
1366
|
+
void 0,
|
|
1367
|
+
this.providers
|
|
1368
|
+
);
|
|
1314
1369
|
/**
|
|
1315
1370
|
* Creates a portal to render content in a different part of the DOM tree.
|
|
1316
1371
|
*
|
|
@@ -1367,7 +1422,7 @@ class R {
|
|
|
1367
1422
|
* @param reference - The optional `Text` node to use as the reference for the new `DOMContext`.
|
|
1368
1423
|
* @returns A new `DOMContext` instance with the specified reference.
|
|
1369
1424
|
*/
|
|
1370
|
-
withReference = (e) => new
|
|
1425
|
+
withReference = (e) => new j(this.document, this.element, e, this.providers);
|
|
1371
1426
|
/**
|
|
1372
1427
|
* Sets a provider for the given provider mark.
|
|
1373
1428
|
*
|
|
@@ -1375,7 +1430,7 @@ class R {
|
|
|
1375
1430
|
* @param value - The provider to set for the given mark.
|
|
1376
1431
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1377
1432
|
*/
|
|
1378
|
-
setProvider = (e, s, n) => new
|
|
1433
|
+
setProvider = (e, s, n) => new j(this.document, this.element, this.reference, {
|
|
1379
1434
|
...this.providers,
|
|
1380
1435
|
[e]: [s, n]
|
|
1381
1436
|
});
|
|
@@ -1388,12 +1443,12 @@ class R {
|
|
|
1388
1443
|
*/
|
|
1389
1444
|
getProvider = (e) => {
|
|
1390
1445
|
if (this.providers[e] === void 0)
|
|
1391
|
-
throw new
|
|
1446
|
+
throw new Me(e);
|
|
1392
1447
|
const [s, n] = this.providers[e];
|
|
1393
1448
|
return { value: s, onUse: n };
|
|
1394
1449
|
};
|
|
1395
1450
|
clear = (e) => {
|
|
1396
|
-
e && (this.reference !== void 0 ?
|
|
1451
|
+
e && (this.reference !== void 0 ? K(this.reference) : K(this.element));
|
|
1397
1452
|
};
|
|
1398
1453
|
/**
|
|
1399
1454
|
* Adds classes to the element.
|
|
@@ -1468,41 +1523,41 @@ class R {
|
|
|
1468
1523
|
});
|
|
1469
1524
|
getWindow = () => this.document.defaultView;
|
|
1470
1525
|
}
|
|
1471
|
-
const
|
|
1472
|
-
const s = new q(), n =
|
|
1526
|
+
const B = (t, e) => {
|
|
1527
|
+
const s = new q(), n = M(s, () => t.render(e));
|
|
1473
1528
|
return (r = !0) => {
|
|
1474
1529
|
s.dispose(), n(r);
|
|
1475
1530
|
};
|
|
1476
|
-
},
|
|
1531
|
+
}, ms = (t, e, { doc: s, clear: n, disposeWithParent: r = !0, providers: o = {} } = {}) => {
|
|
1477
1532
|
const i = typeof e == "string" ? (s ?? document).querySelector(e) : e;
|
|
1478
1533
|
if (i === null)
|
|
1479
1534
|
throw new gt(
|
|
1480
1535
|
`Cannot find element by selector for render: ${e}`
|
|
1481
1536
|
);
|
|
1482
1537
|
n !== !1 && (s ?? i.ownerDocument) != null && (i.nodeType === 1 || i.nodeType === 11) && (i.innerHTML = "");
|
|
1483
|
-
const l = ft(i),
|
|
1484
|
-
let
|
|
1485
|
-
return r && i.parentElement != null && (
|
|
1486
|
-
|
|
1487
|
-
|
|
1538
|
+
const l = ft(i), a = Le(i) || Oe(i) ? void 0 : i, c = j.of(l, a, o), u = B(t, c);
|
|
1539
|
+
let d;
|
|
1540
|
+
return r && i.parentElement != null && (d = new MutationObserver((p) => {
|
|
1541
|
+
p[0]?.removedNodes.forEach((h) => {
|
|
1542
|
+
h === i && (d?.disconnect(), u(i.nodeType !== 1));
|
|
1488
1543
|
});
|
|
1489
|
-
}),
|
|
1544
|
+
}), d.observe(i.parentElement, {
|
|
1490
1545
|
childList: !0,
|
|
1491
1546
|
subtree: !1,
|
|
1492
1547
|
attributes: !1
|
|
1493
1548
|
})), () => {
|
|
1494
|
-
|
|
1549
|
+
d?.disconnect(), u(!0);
|
|
1495
1550
|
};
|
|
1496
|
-
},
|
|
1551
|
+
}, ys = (t, {
|
|
1497
1552
|
startUrl: e = "https://example.com",
|
|
1498
1553
|
selector: s,
|
|
1499
1554
|
providers: n = {}
|
|
1500
1555
|
} = {
|
|
1501
1556
|
selector: "body"
|
|
1502
1557
|
}) => {
|
|
1503
|
-
const r = w.toSignal(e).deriveProp(), o = new
|
|
1558
|
+
const r = w.toSignal(e).deriveProp(), o = new Ne(s, void 0), i = new V(o, void 0, { currentURL: r }, n);
|
|
1504
1559
|
return {
|
|
1505
|
-
clear:
|
|
1560
|
+
clear: B(t(), i),
|
|
1506
1561
|
root: o,
|
|
1507
1562
|
currentURL: r
|
|
1508
1563
|
};
|
|
@@ -1512,8 +1567,8 @@ class gt extends Error {
|
|
|
1512
1567
|
super(e);
|
|
1513
1568
|
}
|
|
1514
1569
|
}
|
|
1515
|
-
const
|
|
1516
|
-
class
|
|
1570
|
+
const ke = "data-tts-node", Y = "data-tts-class", X = "data-tts-style", Q = "data-tts-html", Z = "data-tts-text", ee = "data-tts-attrs";
|
|
1571
|
+
class ws {
|
|
1517
1572
|
/**
|
|
1518
1573
|
* Selects elements from the headless environment.
|
|
1519
1574
|
* @param selector - The selector to select elements from. The supported selectors are CSS selectors whose complexity depends on the adapter implementation.
|
|
@@ -1595,13 +1650,13 @@ class ms {
|
|
|
1595
1650
|
setClass: o,
|
|
1596
1651
|
getStyles: i,
|
|
1597
1652
|
setStyles: l,
|
|
1598
|
-
appendHTML:
|
|
1599
|
-
getInnerHTML:
|
|
1653
|
+
appendHTML: a,
|
|
1654
|
+
getInnerHTML: c,
|
|
1600
1655
|
setInnerHTML: u,
|
|
1601
|
-
getInnerText:
|
|
1602
|
-
setInnerText:
|
|
1656
|
+
getInnerText: d,
|
|
1657
|
+
setInnerText: p
|
|
1603
1658
|
}) {
|
|
1604
|
-
this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML =
|
|
1659
|
+
this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = a, this.getInnerHTML = c, this.setInnerHTML = u, this.getInnerText = d, this.setInnerText = p;
|
|
1605
1660
|
}
|
|
1606
1661
|
/**
|
|
1607
1662
|
* Sets the content of the root element from a HeadlessPortal. Generally this will be the same instance that is
|
|
@@ -1622,21 +1677,21 @@ class ms {
|
|
|
1622
1677
|
if (r.hasChildren() && this.appendHTML(i, r.contentToHTML(s)), r.hasInnerHTML()) {
|
|
1623
1678
|
if (s) {
|
|
1624
1679
|
const l = this.getInnerHTML(i);
|
|
1625
|
-
l != null && this.setAttribute(i,
|
|
1680
|
+
l != null && this.setAttribute(i, Q, l);
|
|
1626
1681
|
}
|
|
1627
1682
|
this.setInnerHTML(i, r.getInnerHTML());
|
|
1628
1683
|
}
|
|
1629
1684
|
if (r.hasInnerText()) {
|
|
1630
1685
|
if (s) {
|
|
1631
1686
|
const l = this.getInnerText(i);
|
|
1632
|
-
l != null && this.setAttribute(i,
|
|
1687
|
+
l != null && this.setAttribute(i, Z, l);
|
|
1633
1688
|
}
|
|
1634
1689
|
this.setInnerText(i, r.getInnerText());
|
|
1635
1690
|
}
|
|
1636
1691
|
if (r.hasClasses()) {
|
|
1637
1692
|
if (s) {
|
|
1638
1693
|
const l = this.getClass(i);
|
|
1639
|
-
l != null && this.setAttribute(i,
|
|
1694
|
+
l != null && this.setAttribute(i, Y, l);
|
|
1640
1695
|
}
|
|
1641
1696
|
this.setClass(i, r.getClasses().join(" "));
|
|
1642
1697
|
}
|
|
@@ -1645,7 +1700,7 @@ class ms {
|
|
|
1645
1700
|
const l = this.getStyles(i);
|
|
1646
1701
|
Object.keys(l).length > 0 && this.setAttribute(
|
|
1647
1702
|
i,
|
|
1648
|
-
|
|
1703
|
+
X,
|
|
1649
1704
|
JSON.stringify(l)
|
|
1650
1705
|
);
|
|
1651
1706
|
}
|
|
@@ -1654,18 +1709,18 @@ class ms {
|
|
|
1654
1709
|
if (r.hasAttributes()) {
|
|
1655
1710
|
const l = r.getAttributes();
|
|
1656
1711
|
if (s) {
|
|
1657
|
-
const
|
|
1658
|
-
l.forEach(([
|
|
1659
|
-
const u = this.getAttribute(i,
|
|
1660
|
-
u != null &&
|
|
1661
|
-
}),
|
|
1712
|
+
const a = [];
|
|
1713
|
+
l.forEach(([c]) => {
|
|
1714
|
+
const u = this.getAttribute(i, c);
|
|
1715
|
+
u != null && a.push([c, u]);
|
|
1716
|
+
}), a.length > 0 && this.setAttribute(
|
|
1662
1717
|
i,
|
|
1663
|
-
|
|
1664
|
-
JSON.stringify(Object.fromEntries(
|
|
1718
|
+
ee,
|
|
1719
|
+
JSON.stringify(Object.fromEntries(a))
|
|
1665
1720
|
);
|
|
1666
1721
|
}
|
|
1667
|
-
l.forEach(([
|
|
1668
|
-
this.setAttribute(i,
|
|
1722
|
+
l.forEach(([a, c]) => {
|
|
1723
|
+
this.setAttribute(i, a, c);
|
|
1669
1724
|
});
|
|
1670
1725
|
}
|
|
1671
1726
|
}
|
|
@@ -1673,50 +1728,50 @@ class ms {
|
|
|
1673
1728
|
};
|
|
1674
1729
|
}
|
|
1675
1730
|
const mt = () => {
|
|
1676
|
-
document.querySelectorAll(`[${
|
|
1731
|
+
document.querySelectorAll(`[${ke}]`).forEach(K);
|
|
1677
1732
|
}, yt = (t) => {
|
|
1678
|
-
const e = t.getAttribute(
|
|
1679
|
-
t.removeAttribute(
|
|
1733
|
+
const e = t.getAttribute(Y);
|
|
1734
|
+
t.removeAttribute(Y), e != null && t.setAttribute("class", e);
|
|
1680
1735
|
}, wt = () => {
|
|
1681
|
-
document.querySelectorAll(`[${
|
|
1736
|
+
document.querySelectorAll(`[${Y}]`).forEach((e) => yt(e));
|
|
1682
1737
|
}, vt = (t) => {
|
|
1683
|
-
const e = t.getAttribute(
|
|
1684
|
-
t.removeAttribute(
|
|
1738
|
+
const e = t.getAttribute(Q);
|
|
1739
|
+
t.removeAttribute(Q), e != null && (t.innerHTML = e);
|
|
1685
1740
|
}, bt = () => {
|
|
1686
|
-
document.querySelectorAll(`[${
|
|
1741
|
+
document.querySelectorAll(`[${Q}]`).forEach((e) => vt(e));
|
|
1687
1742
|
}, St = (t) => {
|
|
1688
|
-
const e = t.getAttribute(
|
|
1689
|
-
t.removeAttribute(
|
|
1743
|
+
const e = t.getAttribute(Z);
|
|
1744
|
+
t.removeAttribute(Z), e != null && (t.innerText = e);
|
|
1690
1745
|
}, _t = () => {
|
|
1691
|
-
document.querySelectorAll(`[${
|
|
1692
|
-
},
|
|
1693
|
-
const e = t.getAttribute(
|
|
1694
|
-
if (t.removeAttribute(
|
|
1695
|
-
const s =
|
|
1746
|
+
document.querySelectorAll(`[${Z}]`).forEach((e) => St(e));
|
|
1747
|
+
}, Ie = (t) => JSON.parse(t.replace(/"/g, '"')), Tt = (t) => {
|
|
1748
|
+
const e = t.getAttribute(X);
|
|
1749
|
+
if (t.removeAttribute(X), e != null) {
|
|
1750
|
+
const s = Ie(e);
|
|
1696
1751
|
Object.entries(s).forEach(([n, r]) => {
|
|
1697
1752
|
t.style.setProperty(n, r);
|
|
1698
1753
|
});
|
|
1699
1754
|
}
|
|
1700
|
-
},
|
|
1701
|
-
document.querySelectorAll(`[${
|
|
1755
|
+
}, At = () => {
|
|
1756
|
+
document.querySelectorAll(`[${X}]`).forEach((e) => Tt(e));
|
|
1702
1757
|
}, Et = (t) => {
|
|
1703
|
-
const e = t.getAttribute(
|
|
1704
|
-
if (t.removeAttribute(
|
|
1705
|
-
const s =
|
|
1758
|
+
const e = t.getAttribute(ee);
|
|
1759
|
+
if (t.removeAttribute(ee), e != null) {
|
|
1760
|
+
const s = Ie(e);
|
|
1706
1761
|
Object.entries(s).forEach(([n, r]) => {
|
|
1707
1762
|
r == null ? t.removeAttribute(n) : t.setAttribute(n, r);
|
|
1708
1763
|
});
|
|
1709
1764
|
}
|
|
1710
1765
|
}, Ct = () => {
|
|
1711
|
-
document.querySelectorAll(`[${
|
|
1712
|
-
},
|
|
1713
|
-
mt(), wt(), _t(), bt(),
|
|
1714
|
-
},
|
|
1715
|
-
class
|
|
1766
|
+
document.querySelectorAll(`[${ee}]`).forEach((e) => Et(e));
|
|
1767
|
+
}, vs = () => {
|
|
1768
|
+
mt(), wt(), _t(), bt(), At(), Ct();
|
|
1769
|
+
}, $ = Symbol("class"), N = Symbol("style"), z = Symbol("handler"), He = () => Math.random().toString(36).substring(2, 15), Dt = (t) => t.replace(/<[^>]*>?/g, "");
|
|
1770
|
+
class $e {
|
|
1716
1771
|
constructor(e) {
|
|
1717
1772
|
this.parent = e;
|
|
1718
1773
|
}
|
|
1719
|
-
id =
|
|
1774
|
+
id = He();
|
|
1720
1775
|
properties = {};
|
|
1721
1776
|
children = [];
|
|
1722
1777
|
isElement = () => !0;
|
|
@@ -1742,10 +1797,10 @@ class Ie {
|
|
|
1742
1797
|
getInnerText = () => this.properties.innerText ?? "";
|
|
1743
1798
|
hasInnerText = () => this.properties.innerText != null;
|
|
1744
1799
|
hasChildren = () => this.children.length > 0;
|
|
1745
|
-
hasClasses = () => this.properties[
|
|
1800
|
+
hasClasses = () => this.properties[$] != null;
|
|
1746
1801
|
hasStyles = () => this.properties[N] != null;
|
|
1747
1802
|
hasAttributes = () => Object.keys(this.properties).length > 0;
|
|
1748
|
-
hasHandlers = () => this.properties[
|
|
1803
|
+
hasHandlers = () => this.properties[z] != null;
|
|
1749
1804
|
hasRenderableProperties = () => this.hasClasses() || this.hasAttributes() || this.hasStyles();
|
|
1750
1805
|
getById = (e) => {
|
|
1751
1806
|
if (this.properties.id === e)
|
|
@@ -1757,26 +1812,26 @@ class Ie {
|
|
|
1757
1812
|
}
|
|
1758
1813
|
};
|
|
1759
1814
|
trigger = (e, s) => {
|
|
1760
|
-
((this.properties[
|
|
1815
|
+
((this.properties[z] ?? {})[e] ?? []).forEach((r) => r(s));
|
|
1761
1816
|
};
|
|
1762
1817
|
click = () => {
|
|
1763
1818
|
this.trigger("click", {});
|
|
1764
1819
|
};
|
|
1765
1820
|
on = (e, s, n, r) => {
|
|
1766
|
-
const o = this.properties[
|
|
1767
|
-
l(), s(
|
|
1768
|
-
} : (
|
|
1821
|
+
const o = this.properties[z] ??= {}, i = r?.once ? (a) => {
|
|
1822
|
+
l(), s(a, n);
|
|
1823
|
+
} : (a) => s(a, n);
|
|
1769
1824
|
o[e] = [...o[e] ?? [], i];
|
|
1770
1825
|
const l = () => {
|
|
1771
|
-
const
|
|
1772
|
-
|
|
1826
|
+
const a = o[e] ?? [], c = a.indexOf(i);
|
|
1827
|
+
c !== -1 && (a.splice(c, 1), a.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[z]) : o[e] = a, r?.signal != null && r.signal.removeEventListener("abort", l));
|
|
1773
1828
|
};
|
|
1774
1829
|
return r?.signal != null && r.signal.addEventListener("abort", l), l;
|
|
1775
1830
|
};
|
|
1776
1831
|
addClasses = (e) => {
|
|
1777
1832
|
if (e.length === 0)
|
|
1778
1833
|
return;
|
|
1779
|
-
const s = this.properties[
|
|
1834
|
+
const s = this.properties[$] ??= [];
|
|
1780
1835
|
e.forEach((n) => {
|
|
1781
1836
|
s.includes(n) || s.push(n);
|
|
1782
1837
|
});
|
|
@@ -1784,18 +1839,18 @@ class Ie {
|
|
|
1784
1839
|
removeClasses = (e) => {
|
|
1785
1840
|
if (e.length === 0)
|
|
1786
1841
|
return;
|
|
1787
|
-
const s = this.properties[
|
|
1842
|
+
const s = this.properties[$] ??= [];
|
|
1788
1843
|
e.forEach((n) => {
|
|
1789
1844
|
const r = s.indexOf(n);
|
|
1790
1845
|
r !== -1 && s.splice(r, 1);
|
|
1791
|
-
}), s.length === 0 && delete this.properties[
|
|
1846
|
+
}), s.length === 0 && delete this.properties[$];
|
|
1792
1847
|
};
|
|
1793
|
-
getClasses = () => this.properties[
|
|
1848
|
+
getClasses = () => this.properties[$] ?? [];
|
|
1794
1849
|
getAttributes = () => Object.entries(this.properties).filter(
|
|
1795
1850
|
([e]) => !["innerText", "innerHTML"].includes(e)
|
|
1796
1851
|
);
|
|
1797
1852
|
getVisibleAttributes = () => Reflect.ownKeys(this.properties).flatMap(
|
|
1798
|
-
(e) => e ===
|
|
1853
|
+
(e) => e === $ ? [["class", this.getClasses()]] : e === N ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
|
|
1799
1854
|
);
|
|
1800
1855
|
setStyle = (e, s) => {
|
|
1801
1856
|
const n = this.properties[N] ??= {};
|
|
@@ -1812,7 +1867,7 @@ class Ie {
|
|
|
1812
1867
|
};
|
|
1813
1868
|
}
|
|
1814
1869
|
const Pt = (t) => t.replace(/"/g, """), xt = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1815
|
-
class Lt extends
|
|
1870
|
+
class Lt extends $e {
|
|
1816
1871
|
constructor(e, s, n) {
|
|
1817
1872
|
super(n), this.tagName = e, this.namespace = s;
|
|
1818
1873
|
}
|
|
@@ -1820,11 +1875,11 @@ class Lt extends Ie {
|
|
|
1820
1875
|
toHTML = (e = !1) => {
|
|
1821
1876
|
const s = this.children.map((l) => l.toHTML()).join(""), n = this.namespace ? ` xmlns="${this.namespace}"` : "";
|
|
1822
1877
|
let r = null;
|
|
1823
|
-
const o = this.getVisibleAttributes().map(([l,
|
|
1824
|
-
return
|
|
1878
|
+
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(" ")}"` : Mt.has(l) ? ` ${l}` : l === "innerHTML" ? (r = a, "") : l === "innerText" ? (r = xt(a), "") : ` ${l}="${Pt(a)}"`).join(""), i = e ? ` ${ke}` : "";
|
|
1879
|
+
return kt.has(this.tagName) && s === "" ? `<${this.tagName}${n}${o}${i} />` : `<${this.tagName}${n}${o}${i}>${r ?? s}</${this.tagName}>`;
|
|
1825
1880
|
};
|
|
1826
1881
|
}
|
|
1827
|
-
class
|
|
1882
|
+
class Ne extends $e {
|
|
1828
1883
|
constructor(e, s) {
|
|
1829
1884
|
super(s), this.selector = e;
|
|
1830
1885
|
}
|
|
@@ -1836,13 +1891,13 @@ class Ot {
|
|
|
1836
1891
|
constructor(e) {
|
|
1837
1892
|
this.text = e;
|
|
1838
1893
|
}
|
|
1839
|
-
id =
|
|
1894
|
+
id = He();
|
|
1840
1895
|
isElement = () => !1;
|
|
1841
1896
|
isText = () => !0;
|
|
1842
1897
|
getText = () => this.text;
|
|
1843
1898
|
toHTML = () => this.text;
|
|
1844
1899
|
}
|
|
1845
|
-
class
|
|
1900
|
+
class V {
|
|
1846
1901
|
constructor(e, s, n, r) {
|
|
1847
1902
|
this.element = e, this.reference = s, this.container = n, this.providers = r;
|
|
1848
1903
|
}
|
|
@@ -1855,7 +1910,7 @@ class j {
|
|
|
1855
1910
|
};
|
|
1856
1911
|
makeChildElement = (e, s) => {
|
|
1857
1912
|
const n = new Lt(e, s, this.element);
|
|
1858
|
-
return this.appendOrInsert(n), new
|
|
1913
|
+
return this.appendOrInsert(n), new V(
|
|
1859
1914
|
n,
|
|
1860
1915
|
void 0,
|
|
1861
1916
|
this.container,
|
|
@@ -1864,7 +1919,7 @@ class j {
|
|
|
1864
1919
|
};
|
|
1865
1920
|
makeChildText = (e) => {
|
|
1866
1921
|
const s = new Ot(e);
|
|
1867
|
-
return this.appendOrInsert(s), new
|
|
1922
|
+
return this.appendOrInsert(s), new V(
|
|
1868
1923
|
this.element,
|
|
1869
1924
|
s,
|
|
1870
1925
|
this.container,
|
|
@@ -1877,8 +1932,8 @@ class j {
|
|
|
1877
1932
|
getText = () => this.reference?.getText() ?? this.element.getText();
|
|
1878
1933
|
makeRef = () => this.makeChildText("");
|
|
1879
1934
|
makePortal = (e) => {
|
|
1880
|
-
const s = new
|
|
1881
|
-
return this.appendOrInsert(s), new
|
|
1935
|
+
const s = new Ne(e, this.element);
|
|
1936
|
+
return this.appendOrInsert(s), new V(
|
|
1882
1937
|
s,
|
|
1883
1938
|
void 0,
|
|
1884
1939
|
this.container,
|
|
@@ -1892,13 +1947,13 @@ class j {
|
|
|
1892
1947
|
* @param value - The provider to set for the given mark.
|
|
1893
1948
|
* @returns A new `DOMContext` instance with the specified provider.
|
|
1894
1949
|
*/
|
|
1895
|
-
setProvider = (e, s, n) => new
|
|
1950
|
+
setProvider = (e, s, n) => new V(this.element, this.reference, this.container, {
|
|
1896
1951
|
...this.providers,
|
|
1897
1952
|
[e]: [s, n]
|
|
1898
1953
|
});
|
|
1899
1954
|
getProvider = (e) => {
|
|
1900
1955
|
if (this.providers[e] === void 0)
|
|
1901
|
-
throw new
|
|
1956
|
+
throw new Me(e);
|
|
1902
1957
|
const [s, n] = this.providers[e];
|
|
1903
1958
|
return { value: s, onUse: n };
|
|
1904
1959
|
};
|
|
@@ -1917,30 +1972,30 @@ class j {
|
|
|
1917
1972
|
getStyle = (e) => this.element.getStyle(e);
|
|
1918
1973
|
makeAccessors = (e) => this.element.makeAccessors(e);
|
|
1919
1974
|
}
|
|
1920
|
-
const
|
|
1975
|
+
const Mt = /* @__PURE__ */ new Set([
|
|
1921
1976
|
"checked",
|
|
1922
1977
|
"disabled",
|
|
1923
1978
|
"multiple",
|
|
1924
1979
|
"readonly",
|
|
1925
1980
|
"required",
|
|
1926
1981
|
"selected"
|
|
1927
|
-
]),
|
|
1982
|
+
]), kt = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), bs = () => (
|
|
1928
1983
|
/* c8 ignore next */
|
|
1929
1984
|
typeof window < "u" ? window : void 0
|
|
1930
|
-
), It = Symbol("DOM_RENDERABLE"),
|
|
1985
|
+
), It = Symbol("DOM_RENDERABLE"), m = (t) => Ke(It, t), Re = (t) => m((e) => e.makeChildText(t).clear), je = (t) => m((e) => {
|
|
1931
1986
|
const s = e.makeChildText(t.value), n = t.on(s.setText);
|
|
1932
1987
|
return (r) => {
|
|
1933
1988
|
n(), s.clear(r);
|
|
1934
1989
|
};
|
|
1935
|
-
}),
|
|
1936
|
-
const s = t.map((n) =>
|
|
1990
|
+
}), Ss = (t) => y.is(t) ? je(t) : Re(t), E = (...t) => m((e) => {
|
|
1991
|
+
const s = t.map((n) => g(n).render(e));
|
|
1937
1992
|
return (n) => {
|
|
1938
1993
|
s.forEach((r) => r(n));
|
|
1939
1994
|
};
|
|
1940
|
-
}),
|
|
1941
|
-
}), Ht = (t) =>
|
|
1995
|
+
}), P = m(() => () => {
|
|
1996
|
+
}), Ht = (t) => m((e) => (e.addClasses(t), (s) => {
|
|
1942
1997
|
s && e.removeClasses(t);
|
|
1943
|
-
})),
|
|
1998
|
+
})), $t = (t) => m((e) => {
|
|
1944
1999
|
let s = [];
|
|
1945
2000
|
const n = t.on(
|
|
1946
2001
|
(r) => {
|
|
@@ -1951,20 +2006,20 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
1951
2006
|
return (r) => {
|
|
1952
2007
|
n(), r && e.removeClasses(s), s.length = 0;
|
|
1953
2008
|
};
|
|
1954
|
-
}),
|
|
2009
|
+
}), Nt = (t, e) => m((s) => {
|
|
1955
2010
|
const { get: n, set: r } = s.makeAccessors(t), o = n();
|
|
1956
2011
|
return r(e), (i) => {
|
|
1957
2012
|
i && r(o);
|
|
1958
2013
|
};
|
|
1959
|
-
}), Rt = (t, e) =>
|
|
2014
|
+
}), Rt = (t, e) => m((s) => {
|
|
1960
2015
|
const { get: n, set: r } = s.makeAccessors(t), o = n(), i = e.on(r, { noAutoDispose: !0 });
|
|
1961
2016
|
return (l) => {
|
|
1962
2017
|
i(), l && r(o);
|
|
1963
2018
|
};
|
|
1964
|
-
}),
|
|
2019
|
+
}), F = (t, e) => y.is(e) ? Rt(t, e) : Nt(t, e), jt = (t, e) => t === "class" ? y.is(e) ? $t(e) : Ht(
|
|
1965
2020
|
/* c8 ignore next */
|
|
1966
2021
|
(e ?? "").split(" ").filter((s) => s.length > 0)
|
|
1967
|
-
) :
|
|
2022
|
+
) : F(t, e), T = new Proxy(
|
|
1968
2023
|
{},
|
|
1969
2024
|
{
|
|
1970
2025
|
/**
|
|
@@ -1980,7 +2035,7 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
1980
2035
|
*/
|
|
1981
2036
|
get: (t, e) => (s) => jt(e, s)
|
|
1982
2037
|
}
|
|
1983
|
-
), Vt = (t, e) =>
|
|
2038
|
+
), Vt = (t, e) => F(`data-${t}`, e), _s = new Proxy(
|
|
1984
2039
|
{},
|
|
1985
2040
|
{
|
|
1986
2041
|
/**
|
|
@@ -1993,7 +2048,7 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
1993
2048
|
*/
|
|
1994
2049
|
get: (t, e) => (s) => Vt(e, s)
|
|
1995
2050
|
}
|
|
1996
|
-
), qt = (t, e) =>
|
|
2051
|
+
), qt = (t, e) => F(`aria-${t}`, e), Ts = new Proxy(
|
|
1997
2052
|
{},
|
|
1998
2053
|
{
|
|
1999
2054
|
/**
|
|
@@ -2006,7 +2061,7 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2006
2061
|
*/
|
|
2007
2062
|
get: (t, e) => (s) => qt(e, s)
|
|
2008
2063
|
}
|
|
2009
|
-
), Bt = (t, e) =>
|
|
2064
|
+
), Bt = (t, e) => F(t, e), As = new Proxy(
|
|
2010
2065
|
{},
|
|
2011
2066
|
{
|
|
2012
2067
|
/**
|
|
@@ -2019,7 +2074,7 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2019
2074
|
*/
|
|
2020
2075
|
get: (t, e) => (s) => Bt(e, s)
|
|
2021
2076
|
}
|
|
2022
|
-
), Ft = (t, e) =>
|
|
2077
|
+
), Ft = (t, e) => F(t, e), Es = new Proxy(
|
|
2023
2078
|
{},
|
|
2024
2079
|
{
|
|
2025
2080
|
/**
|
|
@@ -2031,29 +2086,29 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2031
2086
|
*/
|
|
2032
2087
|
get: (t, e) => (s) => Ft(e, s)
|
|
2033
2088
|
}
|
|
2034
|
-
),
|
|
2089
|
+
), g = (t) => {
|
|
2035
2090
|
if (t == null)
|
|
2036
|
-
return
|
|
2091
|
+
return P;
|
|
2037
2092
|
if (Array.isArray(t))
|
|
2038
|
-
return E(...t.map(
|
|
2093
|
+
return E(...t.map(g));
|
|
2039
2094
|
if (typeof t == "string")
|
|
2040
|
-
return
|
|
2041
|
-
if (
|
|
2042
|
-
return
|
|
2095
|
+
return Re(t);
|
|
2096
|
+
if (y.is(t))
|
|
2097
|
+
return je(t);
|
|
2043
2098
|
if (typeof t == "object" && "render" in t && "type" in t)
|
|
2044
2099
|
return t;
|
|
2045
2100
|
throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
|
|
2046
|
-
},
|
|
2047
|
-
const n = s.makeChildElement(t, void 0), r = e.map((o) =>
|
|
2101
|
+
}, Ve = (t, ...e) => m((s) => {
|
|
2102
|
+
const n = s.makeChildElement(t, void 0), r = e.map((o) => g(o).render(n));
|
|
2048
2103
|
return (o) => {
|
|
2049
2104
|
r.forEach((i) => i(!1)), n.clear(o);
|
|
2050
2105
|
};
|
|
2051
|
-
}),
|
|
2052
|
-
const r = n.makeChildElement(t, e), o = s.map((i) =>
|
|
2106
|
+
}), ie = (t, e, ...s) => m((n) => {
|
|
2107
|
+
const r = n.makeChildElement(t, e), o = s.map((i) => g(i).render(r));
|
|
2053
2108
|
return (i) => {
|
|
2054
2109
|
o.forEach((l) => l(!1)), r.clear(i);
|
|
2055
2110
|
};
|
|
2056
|
-
}),
|
|
2111
|
+
}), Wt = new Proxy(
|
|
2057
2112
|
{},
|
|
2058
2113
|
{
|
|
2059
2114
|
/**
|
|
@@ -2061,9 +2116,9 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2061
2116
|
* @param tagName - The HTML tag name.
|
|
2062
2117
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
2063
2118
|
*/
|
|
2064
|
-
get: (t, e) => (...s) =>
|
|
2119
|
+
get: (t, e) => (...s) => Ve(e, s.flatMap(g))
|
|
2065
2120
|
}
|
|
2066
|
-
),
|
|
2121
|
+
), Cs = new Proxy(
|
|
2067
2122
|
{},
|
|
2068
2123
|
{
|
|
2069
2124
|
/**
|
|
@@ -2071,9 +2126,9 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2071
2126
|
* @param type - The input type name.
|
|
2072
2127
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
2073
2128
|
*/
|
|
2074
|
-
get: (t, e) => (...s) =>
|
|
2129
|
+
get: (t, e) => (...s) => Ve("input", T.type(e), ...s)
|
|
2075
2130
|
}
|
|
2076
|
-
),
|
|
2131
|
+
), qe = "http://www.w3.org/2000/svg", Ds = (t, ...e) => ie(t, qe, ...e), Ps = new Proxy(
|
|
2077
2132
|
{},
|
|
2078
2133
|
{
|
|
2079
2134
|
/**
|
|
@@ -2081,9 +2136,9 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2081
2136
|
* @param tagName - The SVG tag name.
|
|
2082
2137
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
2083
2138
|
*/
|
|
2084
|
-
get: (t, e) => (...s) =>
|
|
2139
|
+
get: (t, e) => (...s) => ie(e, qe, s.flatMap(g))
|
|
2085
2140
|
}
|
|
2086
|
-
),
|
|
2141
|
+
), Be = "http://www.w3.org/1998/Math/MathML", xs = (t, ...e) => ie(t, Be, ...e), Ls = new Proxy(
|
|
2087
2142
|
{},
|
|
2088
2143
|
{
|
|
2089
2144
|
/**
|
|
@@ -2091,35 +2146,35 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2091
2146
|
* @param tagName - The Math tag name.
|
|
2092
2147
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
2093
2148
|
*/
|
|
2094
|
-
get: (t, e) => (...s) =>
|
|
2149
|
+
get: (t, e) => (...s) => ie(e, Be, s.flatMap(g))
|
|
2095
2150
|
}
|
|
2096
|
-
),
|
|
2151
|
+
), Fe = (t, e) => {
|
|
2097
2152
|
if (typeof e == "function")
|
|
2098
|
-
return
|
|
2099
|
-
const s = e.pending != null ?
|
|
2100
|
-
return
|
|
2153
|
+
return Fe(t, { then: e });
|
|
2154
|
+
const s = e.pending != null ? g(e.pending()) : P, n = e.then, r = e.error != null ? (o) => g(e.error(o)) : () => P;
|
|
2155
|
+
return m((o) => {
|
|
2101
2156
|
let i = !0;
|
|
2102
|
-
const l = t(),
|
|
2103
|
-
let
|
|
2157
|
+
const l = t(), a = o.makeRef();
|
|
2158
|
+
let c = g(s).render(a);
|
|
2104
2159
|
return l.then(
|
|
2105
2160
|
(u) => {
|
|
2106
|
-
i && (
|
|
2161
|
+
i && (c(!0), c = g(n(u)).render(a));
|
|
2107
2162
|
},
|
|
2108
2163
|
(u) => {
|
|
2109
|
-
i && (
|
|
2164
|
+
i && (c(!0), c = g(r(u)).render(a));
|
|
2110
2165
|
}
|
|
2111
2166
|
), (u) => {
|
|
2112
|
-
i = !1,
|
|
2167
|
+
i = !1, c(u), a.clear(u);
|
|
2113
2168
|
};
|
|
2114
2169
|
});
|
|
2115
|
-
},
|
|
2170
|
+
}, Os = (t, e) => Fe(() => t, e), We = (t, e, s) => m((n) => n.on(t, e, s)), Ut = (t) => We("click", (e, s) => {
|
|
2116
2171
|
e.preventDefault();
|
|
2117
2172
|
const n = e.target;
|
|
2118
2173
|
setTimeout(() => {
|
|
2119
2174
|
const r = n.ownerDocument != null ? n?.checked : void 0;
|
|
2120
2175
|
r != null && t(!r, s);
|
|
2121
2176
|
}, 0);
|
|
2122
|
-
}),
|
|
2177
|
+
}), W = new Proxy(
|
|
2123
2178
|
{},
|
|
2124
2179
|
{
|
|
2125
2180
|
/**
|
|
@@ -2127,17 +2182,17 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2127
2182
|
* @param fn - The function to call when the event is triggered.
|
|
2128
2183
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
2129
2184
|
*/
|
|
2130
|
-
get: (t, e) => (s) =>
|
|
2185
|
+
get: (t, e) => (s) => We(e, s)
|
|
2131
2186
|
}
|
|
2132
|
-
),
|
|
2187
|
+
), Jt = (t, e) => (s) => {
|
|
2133
2188
|
e?.preventDefault === !0 && s.preventDefault(), e?.stopPropagation === !0 && s.stopPropagation(), e?.stopImmediatePropagation === !0 && s.stopImmediatePropagation(), t(s);
|
|
2134
|
-
}, k = (t, e) =>
|
|
2189
|
+
}, k = (t, e) => Jt((s) => {
|
|
2135
2190
|
const n = s.target;
|
|
2136
2191
|
t(n, s);
|
|
2137
|
-
}, e),
|
|
2192
|
+
}, e), zt = (t, e) => k(
|
|
2138
2193
|
(s, n) => t(s.value, n),
|
|
2139
2194
|
e
|
|
2140
|
-
),
|
|
2195
|
+
), Gt = (t, e) => k(
|
|
2141
2196
|
(s, n) => t(s.valueAsNumber, n),
|
|
2142
2197
|
e
|
|
2143
2198
|
), Kt = (t, e) => k((s, n) => {
|
|
@@ -2149,7 +2204,7 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2149
2204
|
Number(r[2].substring(0, 2))
|
|
2150
2205
|
);
|
|
2151
2206
|
t(o, n);
|
|
2152
|
-
}, e),
|
|
2207
|
+
}, e), Ms = (t, e) => k((s, n) => {
|
|
2153
2208
|
if (s.value === "") {
|
|
2154
2209
|
t(null, n);
|
|
2155
2210
|
return;
|
|
@@ -2160,7 +2215,7 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2160
2215
|
Number(r[2].substring(0, 2))
|
|
2161
2216
|
);
|
|
2162
2217
|
t(o, n);
|
|
2163
|
-
}, e),
|
|
2218
|
+
}, e), Yt = (t, e) => k((s, n) => {
|
|
2164
2219
|
if (s.value === "")
|
|
2165
2220
|
return;
|
|
2166
2221
|
const r = s.value.split("T"), o = r[0].split("-"), i = new Date(
|
|
@@ -2185,17 +2240,17 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2185
2240
|
Number(o[2])
|
|
2186
2241
|
), l = r[1].split(":");
|
|
2187
2242
|
i.setHours(Number(l[0] ?? 0)), i.setMinutes(Number(l[1] ?? 0)), i.setSeconds(Number(l[2] ?? 0)), t(i, n);
|
|
2188
|
-
}, e),
|
|
2243
|
+
}, e), Is = (t, e) => k((s, n) => {
|
|
2189
2244
|
t(s.checked, n);
|
|
2190
|
-
}, e),
|
|
2245
|
+
}, e), Hs = (t, e = "input") => E(T.valueAsDate(t), W[e](Kt(t.set))), $s = (t, e = "input") => E(T.valueAsDate(t), W[e](Yt(t.set))), Ns = (t, e = "input") => E(T.valueAsNumber(t), W[e](Gt(t.set))), Rs = (t, e = "input") => E(T.value(t), W[e](zt(t.set))), js = (t) => E(T.checked(t), Ut(t.set)), fe = (t, e, s) => y.is(t) ? e(t) : s(t), Xt = (t, e, s) => {
|
|
2191
2246
|
const n = t.makeRef();
|
|
2192
2247
|
let r = () => {
|
|
2193
2248
|
}, o = null;
|
|
2194
2249
|
const i = e.on(
|
|
2195
2250
|
(l) => {
|
|
2196
|
-
o?.dispose(), r(!0), o = new q(), r =
|
|
2251
|
+
o?.dispose(), r(!0), o = new q(), r = M(
|
|
2197
2252
|
o,
|
|
2198
|
-
() =>
|
|
2253
|
+
() => g(s(l)).render(n)
|
|
2199
2254
|
);
|
|
2200
2255
|
},
|
|
2201
2256
|
{ noAutoDispose: !0 }
|
|
@@ -2203,45 +2258,45 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2203
2258
|
return (l) => {
|
|
2204
2259
|
o?.dispose(), r(l), i(), n.clear(l);
|
|
2205
2260
|
};
|
|
2206
|
-
},
|
|
2261
|
+
}, le = (t, e) => {
|
|
2207
2262
|
function s(r) {
|
|
2208
|
-
return
|
|
2263
|
+
return m((o) => {
|
|
2209
2264
|
const i = o.makeRef();
|
|
2210
|
-
let l,
|
|
2211
|
-
const
|
|
2265
|
+
let l, a;
|
|
2266
|
+
const c = r.map((p) => Object.keys(p)[0]);
|
|
2212
2267
|
let u;
|
|
2213
|
-
const
|
|
2214
|
-
if (
|
|
2215
|
-
u =
|
|
2216
|
-
const
|
|
2217
|
-
l =
|
|
2268
|
+
const d = c.on((p) => {
|
|
2269
|
+
if (p !== u) {
|
|
2270
|
+
u = p, a?.dispose(), l?.(!0), a = r.map((f) => f[p]);
|
|
2271
|
+
const h = e[p](a);
|
|
2272
|
+
l = g(h).render(i);
|
|
2218
2273
|
}
|
|
2219
2274
|
});
|
|
2220
|
-
return (
|
|
2221
|
-
|
|
2275
|
+
return (p) => {
|
|
2276
|
+
a?.dispose(), d(), i.clear(p), l?.(p);
|
|
2222
2277
|
};
|
|
2223
2278
|
});
|
|
2224
2279
|
}
|
|
2225
2280
|
function n(r) {
|
|
2226
2281
|
const o = Object.keys(r)[0];
|
|
2227
|
-
return
|
|
2282
|
+
return g(e[o](re(r[o])));
|
|
2228
2283
|
}
|
|
2229
2284
|
return fe(t, s, n);
|
|
2230
|
-
},
|
|
2285
|
+
}, Ue = (t, e, s) => le(
|
|
2231
2286
|
w.map(t, (n) => ({ [n[e]]: n })),
|
|
2232
2287
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2233
2288
|
s
|
|
2234
|
-
),
|
|
2289
|
+
), Vs = (t, e) => Ue(t, "kind", e), qs = (t, e) => {
|
|
2235
2290
|
const s = w.map(t, ([n, r]) => ({
|
|
2236
2291
|
[n]: r
|
|
2237
2292
|
}));
|
|
2238
|
-
return
|
|
2239
|
-
},
|
|
2293
|
+
return le(s, e);
|
|
2294
|
+
}, Bs = (t, e) => Ue(t, "type", e), Qt = (t, e) => le(
|
|
2240
2295
|
w.map(t, (s) => ({ [s]: !0 })),
|
|
2241
2296
|
e
|
|
2242
|
-
),
|
|
2297
|
+
), Fs = (t, e = {}) => (s) => {
|
|
2243
2298
|
const n = e?.firstSeparator ?? t, r = e?.lastSeparator ?? t;
|
|
2244
|
-
return
|
|
2299
|
+
return Qt(
|
|
2245
2300
|
s.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
|
|
2246
2301
|
{
|
|
2247
2302
|
first: n,
|
|
@@ -2249,77 +2304,77 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2249
2304
|
other: t
|
|
2250
2305
|
}
|
|
2251
2306
|
);
|
|
2252
|
-
},
|
|
2253
|
-
s &&
|
|
2254
|
-
})),
|
|
2307
|
+
}, Ws = (t) => m((e) => (e.appendOrInsert(t), (s) => {
|
|
2308
|
+
s && K(t);
|
|
2309
|
+
})), Us = (t, e, s) => {
|
|
2255
2310
|
function n(o) {
|
|
2256
|
-
return
|
|
2311
|
+
return m((i) => {
|
|
2257
2312
|
const l = i.makeRef();
|
|
2258
|
-
let
|
|
2259
|
-
},
|
|
2260
|
-
const
|
|
2261
|
-
|
|
2313
|
+
let a = () => {
|
|
2314
|
+
}, c = !1, u = null;
|
|
2315
|
+
const d = o.on((p) => {
|
|
2316
|
+
p == null ? (a(!0), a = g(s?.()).render(l), c = !1, u?.dispose(), u = null) : c ? u.set(p) : (u = D(p), a(!0), a = g(
|
|
2262
2317
|
e(u)
|
|
2263
|
-
).render(l),
|
|
2318
|
+
).render(l), c = !0);
|
|
2264
2319
|
});
|
|
2265
|
-
return (
|
|
2266
|
-
u?.dispose(),
|
|
2320
|
+
return (p) => {
|
|
2321
|
+
u?.dispose(), d(), a?.(p), l.clear(p);
|
|
2267
2322
|
};
|
|
2268
2323
|
});
|
|
2269
2324
|
}
|
|
2270
2325
|
function r(o) {
|
|
2271
2326
|
if (o == null) {
|
|
2272
2327
|
const i = s?.();
|
|
2273
|
-
return i != null ?
|
|
2328
|
+
return i != null ? g(i) : P;
|
|
2274
2329
|
}
|
|
2275
|
-
return
|
|
2330
|
+
return g(e(re(o)));
|
|
2276
2331
|
}
|
|
2277
2332
|
return fe(
|
|
2278
2333
|
t,
|
|
2279
2334
|
n,
|
|
2280
2335
|
r
|
|
2281
2336
|
);
|
|
2282
|
-
},
|
|
2337
|
+
}, Js = (...t) => (e, s) => m((n) => {
|
|
2283
2338
|
const r = n.makeRef();
|
|
2284
2339
|
if (t.some(
|
|
2285
|
-
(
|
|
2340
|
+
(h) => !y.is(h) && h == null
|
|
2286
2341
|
))
|
|
2287
|
-
return (s != null ?
|
|
2342
|
+
return (s != null ? g(s?.()) : P).render(r);
|
|
2288
2343
|
const i = t.map(() => null), l = t.map(
|
|
2289
|
-
(
|
|
2344
|
+
(h) => y.is(h) ? h.value != null : h != null
|
|
2290
2345
|
);
|
|
2291
|
-
let
|
|
2292
|
-
const
|
|
2293
|
-
if (
|
|
2294
|
-
if (i[
|
|
2295
|
-
const v =
|
|
2296
|
-
i[
|
|
2346
|
+
let a = null;
|
|
2347
|
+
const c = D(l.every((h) => h)), u = (h, f) => {
|
|
2348
|
+
if (h.value != null) {
|
|
2349
|
+
if (i[f] == null) {
|
|
2350
|
+
const v = D(h.value);
|
|
2351
|
+
i[f] = v;
|
|
2297
2352
|
} else
|
|
2298
|
-
i[
|
|
2299
|
-
l[
|
|
2353
|
+
i[f].value = h.value;
|
|
2354
|
+
l[f] = !0;
|
|
2300
2355
|
} else
|
|
2301
|
-
l[
|
|
2356
|
+
l[f] = !1;
|
|
2302
2357
|
};
|
|
2303
|
-
let
|
|
2304
|
-
const
|
|
2305
|
-
if (!
|
|
2306
|
-
const v =
|
|
2307
|
-
return i[
|
|
2358
|
+
let d = t.length - 1;
|
|
2359
|
+
const p = t.map((h, f) => {
|
|
2360
|
+
if (!y.is(h)) {
|
|
2361
|
+
const v = D(h);
|
|
2362
|
+
return i[f] = v, () => {
|
|
2308
2363
|
};
|
|
2309
2364
|
}
|
|
2310
|
-
return
|
|
2311
|
-
u(
|
|
2365
|
+
return h.on(() => {
|
|
2366
|
+
u(h, f), d === 0 ? c.value = l.every((v) => v) : d--;
|
|
2312
2367
|
});
|
|
2313
2368
|
});
|
|
2314
|
-
return
|
|
2315
|
-
|
|
2316
|
-
}), (
|
|
2317
|
-
i.forEach((
|
|
2369
|
+
return c.on((h) => {
|
|
2370
|
+
a?.(!0), a = null, h ? a = g(e(...i)).render(r) : a = g(s?.() ?? P).render(r);
|
|
2371
|
+
}), (h) => {
|
|
2372
|
+
i.forEach((f) => f?.dispose()), c.dispose(), p.forEach((f) => f()), a?.(h), r.clear(h);
|
|
2318
2373
|
};
|
|
2319
|
-
}),
|
|
2374
|
+
}), Je = (t, e, s) => fe(
|
|
2320
2375
|
t,
|
|
2321
|
-
(n) =>
|
|
2322
|
-
(r) =>
|
|
2376
|
+
(n) => m(
|
|
2377
|
+
(r) => Xt(
|
|
2323
2378
|
r,
|
|
2324
2379
|
n,
|
|
2325
2380
|
(o) => o ? e() : s?.()
|
|
@@ -2328,86 +2383,86 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2328
2383
|
(n) => {
|
|
2329
2384
|
if (n) {
|
|
2330
2385
|
const r = e();
|
|
2331
|
-
return r != null ?
|
|
2386
|
+
return r != null ? g(r) : P;
|
|
2332
2387
|
}
|
|
2333
|
-
return
|
|
2388
|
+
return g(s?.());
|
|
2334
2389
|
}
|
|
2335
|
-
),
|
|
2390
|
+
), zs = (t, e, s) => Je(
|
|
2336
2391
|
w.map(t, (n) => !n),
|
|
2337
2392
|
e,
|
|
2338
2393
|
s
|
|
2339
|
-
),
|
|
2394
|
+
), ze = (t, e, s) => {
|
|
2340
2395
|
if (s != null)
|
|
2341
|
-
return
|
|
2342
|
-
const r = new
|
|
2396
|
+
return ze(t, (n) => {
|
|
2397
|
+
const r = new de(
|
|
2343
2398
|
n.index,
|
|
2344
2399
|
n.total.map((o) => o - 1)
|
|
2345
2400
|
);
|
|
2346
2401
|
return E(
|
|
2347
|
-
|
|
2348
|
-
|
|
2402
|
+
g(e(n)),
|
|
2403
|
+
Je(
|
|
2349
2404
|
n.isLast,
|
|
2350
|
-
() =>
|
|
2405
|
+
() => P,
|
|
2351
2406
|
() => s(r)
|
|
2352
2407
|
)
|
|
2353
2408
|
);
|
|
2354
2409
|
});
|
|
2355
|
-
if (
|
|
2356
|
-
return
|
|
2410
|
+
if (y.is(t))
|
|
2411
|
+
return m((n) => {
|
|
2357
2412
|
const r = t.derive(), o = n.makeRef(), i = [], l = [];
|
|
2358
|
-
return r.on((
|
|
2359
|
-
const
|
|
2360
|
-
for (const
|
|
2361
|
-
|
|
2362
|
-
for (const
|
|
2363
|
-
|
|
2364
|
-
for (let
|
|
2365
|
-
const
|
|
2366
|
-
l.push(
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
() =>
|
|
2413
|
+
return r.on((a) => {
|
|
2414
|
+
const c = i.splice(a), u = l.splice(a);
|
|
2415
|
+
for (const d of u)
|
|
2416
|
+
d.dispose();
|
|
2417
|
+
for (const d of c)
|
|
2418
|
+
d(!0);
|
|
2419
|
+
for (let d = i.length; d < a; d++) {
|
|
2420
|
+
const p = new de(d, r), h = new q();
|
|
2421
|
+
l.push(h), i.push(
|
|
2422
|
+
M(
|
|
2423
|
+
h,
|
|
2424
|
+
() => g(e(p)).render(o)
|
|
2370
2425
|
)
|
|
2371
2426
|
);
|
|
2372
2427
|
}
|
|
2373
|
-
}), (
|
|
2374
|
-
for (const
|
|
2375
|
-
|
|
2428
|
+
}), (a) => {
|
|
2429
|
+
for (const c of l)
|
|
2430
|
+
c.dispose();
|
|
2376
2431
|
l.length = 0, r.dispose();
|
|
2377
|
-
for (const
|
|
2378
|
-
a
|
|
2379
|
-
i.length = 0, o.clear(
|
|
2432
|
+
for (const c of i)
|
|
2433
|
+
c(a);
|
|
2434
|
+
i.length = 0, o.clear(a);
|
|
2380
2435
|
};
|
|
2381
2436
|
});
|
|
2382
2437
|
{
|
|
2383
|
-
const n =
|
|
2438
|
+
const n = re(t);
|
|
2384
2439
|
return E(
|
|
2385
2440
|
...Array.from({ length: t }, (r, o) => o).map((r) => {
|
|
2386
|
-
const o = new
|
|
2387
|
-
return
|
|
2441
|
+
const o = new de(r, n);
|
|
2442
|
+
return g(e(o));
|
|
2388
2443
|
})
|
|
2389
2444
|
);
|
|
2390
2445
|
}
|
|
2391
|
-
},
|
|
2446
|
+
}, Gs = (t, e, s) => {
|
|
2392
2447
|
const n = w.map(t, (o) => o.length), r = w.toSignal(t);
|
|
2393
|
-
return
|
|
2448
|
+
return ze(
|
|
2394
2449
|
n,
|
|
2395
2450
|
(o) => {
|
|
2396
2451
|
const i = r.map((l) => l[o.index]);
|
|
2397
|
-
return
|
|
2452
|
+
return g(e(i, o));
|
|
2398
2453
|
},
|
|
2399
2454
|
s
|
|
2400
2455
|
);
|
|
2401
|
-
},
|
|
2456
|
+
}, ge = (...t) => m(
|
|
2402
2457
|
(e) => (s) => t.forEach((n) => {
|
|
2403
2458
|
typeof n == "function" ? n(s, e) : n.dispose(s, e);
|
|
2404
2459
|
})
|
|
2405
2460
|
), Ks = (t, e) => {
|
|
2406
|
-
if (
|
|
2461
|
+
if (y.is(t)) {
|
|
2407
2462
|
const s = t;
|
|
2408
|
-
return
|
|
2463
|
+
return m((n) => {
|
|
2409
2464
|
n = n.makeRef();
|
|
2410
|
-
const r = s.map((l) =>
|
|
2465
|
+
const r = s.map((l) => g(e(l)));
|
|
2411
2466
|
let o = () => {
|
|
2412
2467
|
};
|
|
2413
2468
|
const i = r.on((l) => {
|
|
@@ -2418,8 +2473,64 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2418
2473
|
};
|
|
2419
2474
|
});
|
|
2420
2475
|
}
|
|
2421
|
-
return
|
|
2422
|
-
},
|
|
2476
|
+
return g(e(t));
|
|
2477
|
+
}, me = (t) => m((e) => {
|
|
2478
|
+
if (e.isBrowser()) {
|
|
2479
|
+
const s = t(e);
|
|
2480
|
+
if (s != null)
|
|
2481
|
+
return g(s).render(e);
|
|
2482
|
+
}
|
|
2483
|
+
return () => {
|
|
2484
|
+
};
|
|
2485
|
+
});
|
|
2486
|
+
function Ys({
|
|
2487
|
+
src: t,
|
|
2488
|
+
name: e,
|
|
2489
|
+
width: s,
|
|
2490
|
+
height: n,
|
|
2491
|
+
sandbox: r,
|
|
2492
|
+
allow: o,
|
|
2493
|
+
referrerpolicy: i,
|
|
2494
|
+
loading: l,
|
|
2495
|
+
iframeChild: a,
|
|
2496
|
+
onLoad: c
|
|
2497
|
+
} = {}, ...u) {
|
|
2498
|
+
return Wt.iframe(
|
|
2499
|
+
T.src(t),
|
|
2500
|
+
T.name(e),
|
|
2501
|
+
T.width(s != null ? w.map(s, String) : void 0),
|
|
2502
|
+
T.height(n != null ? w.map(n, String) : void 0),
|
|
2503
|
+
T.sandbox(r),
|
|
2504
|
+
T.allow(o),
|
|
2505
|
+
T.referrerpolicy(i),
|
|
2506
|
+
a,
|
|
2507
|
+
me((d) => {
|
|
2508
|
+
const p = d.element;
|
|
2509
|
+
let h, f = !1;
|
|
2510
|
+
const v = () => {
|
|
2511
|
+
if (f) return;
|
|
2512
|
+
f = !0;
|
|
2513
|
+
const S = p.contentDocument;
|
|
2514
|
+
if (S && (c && c(p), u.length > 0)) {
|
|
2515
|
+
const b = S.body;
|
|
2516
|
+
if (b) {
|
|
2517
|
+
const x = d.withElement(b);
|
|
2518
|
+
h = B(E(...u), x);
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
};
|
|
2522
|
+
return l != null && w.on(l, (S) => {
|
|
2523
|
+
p.loading = S;
|
|
2524
|
+
}), (u.length > 0 || c) && (t || setTimeout(v, 0)), E(
|
|
2525
|
+
u.length > 0 || c ? W.load(v) : P,
|
|
2526
|
+
ge(() => {
|
|
2527
|
+
h && h(!1);
|
|
2528
|
+
})
|
|
2529
|
+
);
|
|
2530
|
+
})
|
|
2531
|
+
);
|
|
2532
|
+
}
|
|
2533
|
+
const Xs = (t, e, s = () => P) => le(
|
|
2423
2534
|
w.map(
|
|
2424
2535
|
t,
|
|
2425
2536
|
(n) => n.length > 0 ? { notEmpty: n } : { whenEmpty: null }
|
|
@@ -2428,11 +2539,11 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2428
2539
|
notEmpty: (n) => e(n),
|
|
2429
2540
|
whenEmpty: () => s()
|
|
2430
2541
|
}
|
|
2431
|
-
),
|
|
2432
|
-
const n = s.makePortal(t), r =
|
|
2542
|
+
), Qs = (t, e) => m((s) => {
|
|
2543
|
+
const n = s.makePortal(t), r = B(g(e), n);
|
|
2433
2544
|
return () => r(!0);
|
|
2434
|
-
}), G = /* @__PURE__ */ new Map(),
|
|
2435
|
-
mark:
|
|
2545
|
+
}), G = /* @__PURE__ */ new Map(), Zt = (t) => ({
|
|
2546
|
+
mark: Ge(`Probe(${t.description})`),
|
|
2436
2547
|
create: ({ callback: e = () => {
|
|
2437
2548
|
}, timeout: s = 10 } = {}) => {
|
|
2438
2549
|
const n = (l) => {
|
|
@@ -2451,40 +2562,32 @@ const kt = /* @__PURE__ */ new Set([
|
|
|
2451
2562
|
onUse: () => o.counter++
|
|
2452
2563
|
};
|
|
2453
2564
|
}
|
|
2454
|
-
}),
|
|
2455
|
-
|
|
2456
|
-
const s = t(e);
|
|
2457
|
-
if (s != null)
|
|
2458
|
-
return d(s).render(e);
|
|
2459
|
-
}
|
|
2460
|
-
return () => {
|
|
2461
|
-
};
|
|
2462
|
-
});
|
|
2463
|
-
function Qs({
|
|
2565
|
+
}), Zs = Zt(Symbol("GlobalProbe"));
|
|
2566
|
+
function en({
|
|
2464
2567
|
mode: t,
|
|
2465
2568
|
delegatesFocus: e,
|
|
2466
2569
|
slotAssignment: s,
|
|
2467
2570
|
clonable: n,
|
|
2468
2571
|
serializable: r
|
|
2469
2572
|
}, ...o) {
|
|
2470
|
-
return
|
|
2573
|
+
return me((i) => {
|
|
2471
2574
|
const l = { mode: t };
|
|
2472
2575
|
e !== void 0 && (l.delegatesFocus = e), s !== void 0 && (l.slotAssignment = s), n !== void 0 && (l.clonable = n), r !== void 0 && (l.serializable = r);
|
|
2473
|
-
const
|
|
2474
|
-
return
|
|
2576
|
+
const a = i.element.attachShadow(l), c = i.withElement(a), u = B(E(...o), c);
|
|
2577
|
+
return ge(() => u(!0));
|
|
2475
2578
|
});
|
|
2476
2579
|
}
|
|
2477
|
-
const
|
|
2580
|
+
const es = (t, e) => m((s) => {
|
|
2478
2581
|
const n = s.getStyle(t);
|
|
2479
2582
|
return s.setStyle(t, e), (r) => {
|
|
2480
2583
|
r && s.setStyle(t, n);
|
|
2481
2584
|
};
|
|
2482
|
-
}),
|
|
2585
|
+
}), ts = (t, e) => m((s) => {
|
|
2483
2586
|
const n = s.getStyle(t), r = e.on((o) => s.setStyle(t, o));
|
|
2484
2587
|
return (o) => {
|
|
2485
2588
|
r(), o && s.setStyle(t, n);
|
|
2486
2589
|
};
|
|
2487
|
-
}),
|
|
2590
|
+
}), be = (t, e) => y.is(e) ? ts(t, e) : es(t, e), tn = new Proxy({}, {
|
|
2488
2591
|
/**
|
|
2489
2592
|
* Creates a renderable component for the specified `style` property.
|
|
2490
2593
|
*
|
|
@@ -2493,28 +2596,28 @@ const Zt = (t, e) => g((s) => {
|
|
|
2493
2596
|
* @returns The renderable component for the specified attribute.
|
|
2494
2597
|
*
|
|
2495
2598
|
*/
|
|
2496
|
-
get: (t, e) => e === "variable" ? (s, n) =>
|
|
2497
|
-
}),
|
|
2599
|
+
get: (t, e) => e === "variable" ? (s, n) => be(s, n) : (s) => be(e, s)
|
|
2600
|
+
}), sn = (t) => m((e) => {
|
|
2498
2601
|
const s = t(e);
|
|
2499
2602
|
return s == null ? () => {
|
|
2500
|
-
} :
|
|
2501
|
-
}),
|
|
2603
|
+
} : g(s).render(e);
|
|
2604
|
+
}), nn = (t) => me((e) => t(e.element)), rn = (t) => m((e) => {
|
|
2502
2605
|
if (e.isHeadlessDOM()) {
|
|
2503
2606
|
const s = t(e);
|
|
2504
2607
|
if (s)
|
|
2505
|
-
return
|
|
2608
|
+
return g(s).render(e);
|
|
2506
2609
|
}
|
|
2507
2610
|
return () => {
|
|
2508
2611
|
};
|
|
2509
|
-
}),
|
|
2510
|
-
const s = new q(), n =
|
|
2612
|
+
}), on = (t) => m((e) => {
|
|
2613
|
+
const s = new q(), n = M(
|
|
2511
2614
|
s,
|
|
2512
|
-
() =>
|
|
2615
|
+
() => g(t(s)).render(e)
|
|
2513
2616
|
);
|
|
2514
2617
|
return (r) => {
|
|
2515
2618
|
s.dispose(), n(r);
|
|
2516
2619
|
};
|
|
2517
|
-
}),
|
|
2620
|
+
}), ye = (t) => m((e) => {
|
|
2518
2621
|
let s = e;
|
|
2519
2622
|
function n() {
|
|
2520
2623
|
return s;
|
|
@@ -2524,157 +2627,159 @@ const Zt = (t, e) => g((s) => {
|
|
|
2524
2627
|
}
|
|
2525
2628
|
const o = [], i = t({
|
|
2526
2629
|
use: ({ mark: l }) => {
|
|
2527
|
-
const { value:
|
|
2528
|
-
return
|
|
2630
|
+
const { value: a, onUse: c } = n().getProvider(l);
|
|
2631
|
+
return c?.(), a;
|
|
2529
2632
|
},
|
|
2530
|
-
set: ({ mark: l, create:
|
|
2531
|
-
const { value: u, dispose:
|
|
2532
|
-
o.push(
|
|
2633
|
+
set: ({ mark: l, create: a }, c) => {
|
|
2634
|
+
const { value: u, dispose: d, onUse: p } = a(c, n());
|
|
2635
|
+
o.push(d), r(n().setProvider(l, u, p));
|
|
2533
2636
|
}
|
|
2534
2637
|
});
|
|
2535
2638
|
return i == null ? () => {
|
|
2536
2639
|
} : E(
|
|
2537
|
-
|
|
2538
|
-
|
|
2640
|
+
g(i),
|
|
2641
|
+
ge(() => o.forEach((l) => l()))
|
|
2539
2642
|
).render(n());
|
|
2540
|
-
}),
|
|
2643
|
+
}), ln = (t, e, s) => ye(({ set: n }) => (n(t, e), s())), an = (t, e) => ye(({ use: s }) => e(s(t))), cn = (...t) => (e) => ye(({ use: s }) => {
|
|
2541
2644
|
const n = t.map(s);
|
|
2542
2645
|
return e(...n);
|
|
2543
2646
|
});
|
|
2544
2647
|
export {
|
|
2545
2648
|
qt as Aria,
|
|
2546
|
-
|
|
2649
|
+
Os as Async,
|
|
2547
2650
|
jt as Attr,
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2651
|
+
js as BindChecked,
|
|
2652
|
+
Hs as BindDate,
|
|
2653
|
+
$s as BindDateTime,
|
|
2551
2654
|
Ns as BindNumber,
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2655
|
+
Rs as BindText,
|
|
2656
|
+
j as BrowserContext,
|
|
2657
|
+
Y as CLASS_PLACEHOLDER_ATTR,
|
|
2658
|
+
R as Computed,
|
|
2659
|
+
Fs as Conjunction,
|
|
2660
|
+
Ws as DOMNode,
|
|
2558
2661
|
Vt as DataAttr,
|
|
2559
2662
|
q as DisposalScope,
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2663
|
+
Ve as El,
|
|
2664
|
+
ie as ElNS,
|
|
2665
|
+
de as ElementPosition,
|
|
2666
|
+
P as Empty,
|
|
2667
|
+
Us as Ensure,
|
|
2668
|
+
Js as EnsureAll,
|
|
2669
|
+
Gs as ForEach,
|
|
2567
2670
|
E as Fragment,
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2671
|
+
Zs as GlobalProbe,
|
|
2672
|
+
ws as HeadlessAdapter,
|
|
2673
|
+
V as HeadlessContext,
|
|
2571
2674
|
Lt as HeadlessElement,
|
|
2572
|
-
|
|
2675
|
+
Ne as HeadlessPortal,
|
|
2573
2676
|
Ot as HeadlessText,
|
|
2677
|
+
Ys as IFrame,
|
|
2574
2678
|
Ks as MapSignal,
|
|
2575
2679
|
Ft as MathAttr,
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2680
|
+
xs as MathEl,
|
|
2681
|
+
Te as MemoryStore,
|
|
2682
|
+
Xs as NotEmpty,
|
|
2683
|
+
Ut as OnChecked,
|
|
2684
|
+
ge as OnDispose,
|
|
2685
|
+
le as OneOf,
|
|
2686
|
+
Ue as OneOfField,
|
|
2687
|
+
Vs as OneOfKind,
|
|
2688
|
+
qs as OneOfTuple,
|
|
2689
|
+
Bs as OneOfType,
|
|
2690
|
+
Qt as OneOfValue,
|
|
2691
|
+
Qs as Portal,
|
|
2692
|
+
se as Prop,
|
|
2693
|
+
ln as Provide,
|
|
2694
|
+
Me as ProviderNotFoundError,
|
|
2591
2695
|
gt as RenderingError,
|
|
2592
|
-
|
|
2696
|
+
ze as Repeat,
|
|
2593
2697
|
Bt as SVGAttr,
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2698
|
+
Ds as SVGEl,
|
|
2699
|
+
en as ShadowRoot,
|
|
2700
|
+
y as Signal,
|
|
2701
|
+
Fe as Task,
|
|
2702
|
+
Ss as TextNode,
|
|
2703
|
+
zs as Unless,
|
|
2704
|
+
an as Use,
|
|
2705
|
+
cn as UseMany,
|
|
2602
2706
|
w as Value,
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2707
|
+
Je as When,
|
|
2708
|
+
me as WithBrowserCtx,
|
|
2709
|
+
sn as WithCtx,
|
|
2710
|
+
nn as WithElement,
|
|
2711
|
+
rn as WithHeadlessCtx,
|
|
2712
|
+
ye as WithProvider,
|
|
2713
|
+
on as WithScope,
|
|
2714
|
+
ke as _NODE_PLACEHOLDER_ATTR,
|
|
2611
2715
|
ft as _getSelfOrParentElement,
|
|
2612
|
-
|
|
2613
|
-
|
|
2716
|
+
Le as _isElement,
|
|
2717
|
+
Oe as _isFragment,
|
|
2614
2718
|
pt as _makeGetter,
|
|
2615
2719
|
dt as _makeSetter,
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2720
|
+
K as _removeDOMNode,
|
|
2721
|
+
je as _signalText,
|
|
2722
|
+
Re as _staticText,
|
|
2723
|
+
as as animateSignal,
|
|
2620
2724
|
ut as animateSignals,
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2725
|
+
Ts as aria,
|
|
2726
|
+
T as attr,
|
|
2727
|
+
ps as bind,
|
|
2728
|
+
fs as coalesce,
|
|
2729
|
+
ne as computed,
|
|
2730
|
+
te as computedOf,
|
|
2627
2731
|
ht as computedRecord,
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2732
|
+
Ke as createRenderable,
|
|
2733
|
+
_s as dataAttr,
|
|
2734
|
+
us as delaySignal,
|
|
2735
|
+
_e as effect,
|
|
2632
2736
|
Ze as effectOf,
|
|
2633
|
-
|
|
2634
|
-
|
|
2737
|
+
Jt as emit,
|
|
2738
|
+
Is as emitChecked,
|
|
2635
2739
|
k as emitTarget,
|
|
2636
|
-
|
|
2740
|
+
zt as emitValue,
|
|
2637
2741
|
Kt as emitValueAsDate,
|
|
2638
|
-
|
|
2639
|
-
|
|
2742
|
+
Yt as emitValueAsDateTime,
|
|
2743
|
+
Ms as emitValueAsNullableDate,
|
|
2640
2744
|
ks as emitValueAsNullableDateTime,
|
|
2641
|
-
|
|
2745
|
+
Gt as emitValueAsNumber,
|
|
2642
2746
|
it as endInterpolate,
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2747
|
+
pe as getCurrentScope,
|
|
2748
|
+
rs as getParentScope,
|
|
2749
|
+
ns as getScopeStack,
|
|
2750
|
+
bs as getWindow,
|
|
2647
2751
|
lt as guessInterpolate,
|
|
2648
|
-
|
|
2649
|
-
|
|
2752
|
+
Wt as html,
|
|
2753
|
+
Cs as input,
|
|
2650
2754
|
ot as interpolateDate,
|
|
2651
2755
|
nt as interpolateNumber,
|
|
2652
2756
|
rt as interpolateString,
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2757
|
+
ss as joinSignals,
|
|
2758
|
+
is as localStorageProp,
|
|
2759
|
+
Zt as makeProbe,
|
|
2760
|
+
Ge as makeProviderMark,
|
|
2761
|
+
Ls as math,
|
|
2762
|
+
Es as mathAttr,
|
|
2659
2763
|
cs as merge,
|
|
2660
|
-
|
|
2764
|
+
W as on,
|
|
2661
2765
|
tt as popScope,
|
|
2662
|
-
|
|
2663
|
-
|
|
2766
|
+
hs as previousSignal,
|
|
2767
|
+
D as prop,
|
|
2664
2768
|
et as pushScope,
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2769
|
+
ms as render,
|
|
2770
|
+
B as renderWithContext,
|
|
2771
|
+
g as renderableOfTNode,
|
|
2772
|
+
vs as restoreTempoPlaceholders,
|
|
2773
|
+
ys as runHeadless,
|
|
2774
|
+
os as scoped,
|
|
2775
|
+
ls as sessionStorageProp,
|
|
2776
|
+
re as signal,
|
|
2777
|
+
ds as slidingWindowSignal,
|
|
2778
|
+
Ae as storedProp,
|
|
2779
|
+
tn as style,
|
|
2780
|
+
Ps as svg,
|
|
2781
|
+
As as svgAttr,
|
|
2782
|
+
gs as syncProp,
|
|
2678
2783
|
ce as untracked,
|
|
2679
|
-
|
|
2784
|
+
M as withScope
|
|
2680
2785
|
};
|