@tempots/dom 35.0.3 → 35.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dom/headless-context.d.ts +58 -0
- package/index.cjs +1 -1
- package/index.d.ts +1 -1
- package/index.js +634 -494
- package/package.json +5 -1
package/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const Ye = (t) => Symbol(t);
|
|
2
|
+
function Xe(t, e) {
|
|
3
3
|
return {
|
|
4
4
|
type: t,
|
|
5
5
|
render: e
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function Te(t) {
|
|
9
9
|
return t != null && t !== !1 && t !== 0 && t !== "";
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
return !
|
|
11
|
+
function Qe(t) {
|
|
12
|
+
return !Te(t);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Ze(t) {
|
|
15
15
|
return t == null;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function et(t) {
|
|
18
18
|
return t != null;
|
|
19
19
|
}
|
|
20
20
|
const w = {
|
|
@@ -101,26 +101,26 @@ const w = {
|
|
|
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, Te),
|
|
105
105
|
/**
|
|
106
106
|
* Creates a new signal that emits `true` if the value is falsy, `false` otherwise.
|
|
107
107
|
* @param value - The value or signal to check.
|
|
108
108
|
* @returns A signal that emits `true` if the value is falsy, `false` otherwise.
|
|
109
109
|
*/
|
|
110
|
-
falsy: (t) => w.map(t,
|
|
110
|
+
falsy: (t) => w.map(t, Qe),
|
|
111
111
|
/**
|
|
112
112
|
* Creates a new signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
113
113
|
* @param value - The value or signal to check.
|
|
114
114
|
* @returns A signal that emits `true` if the value is null or undefined, `false` otherwise.
|
|
115
115
|
*/
|
|
116
|
-
nil: (t) => w.map(t,
|
|
116
|
+
nil: (t) => w.map(t, Ze),
|
|
117
117
|
/**
|
|
118
118
|
* Creates a new signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
119
119
|
* @param value - The value or signal to check.
|
|
120
120
|
* @returns A signal that emits `true` if the value is not null or undefined, `false` otherwise.
|
|
121
121
|
*/
|
|
122
|
-
defined: (t) => w.map(t,
|
|
123
|
-
},
|
|
122
|
+
defined: (t) => w.map(t, et)
|
|
123
|
+
}, B = (...t) => (e, s) => {
|
|
124
124
|
if (t.length === 1)
|
|
125
125
|
return w.toSignal(t[0]).map(e);
|
|
126
126
|
const n = t.filter((r) => y.is(r));
|
|
@@ -129,25 +129,36 @@ const w = {
|
|
|
129
129
|
n,
|
|
130
130
|
s
|
|
131
131
|
);
|
|
132
|
-
},
|
|
133
|
-
([...o]) => e(
|
|
132
|
+
}, Qt = (...t) => (e, s, n, r = (o, i) => o === i) => B(...t)((...o) => o).mapAsync(
|
|
133
|
+
([...o], i) => e(
|
|
134
|
+
...o,
|
|
135
|
+
i
|
|
136
|
+
),
|
|
137
|
+
s,
|
|
138
|
+
n,
|
|
139
|
+
r
|
|
140
|
+
), Zt = (...t) => (e, s, n, r = (o, i) => o === i) => B(...t)((...o) => o).mapAsyncGenerator(
|
|
141
|
+
([...o], i) => e(
|
|
142
|
+
...o,
|
|
143
|
+
i
|
|
144
|
+
),
|
|
134
145
|
s,
|
|
135
146
|
n,
|
|
136
147
|
r
|
|
137
|
-
),
|
|
148
|
+
), es = (t) => {
|
|
138
149
|
const e = Object.keys(t);
|
|
139
|
-
return
|
|
150
|
+
return B(...Object.values(t))(
|
|
140
151
|
(...s) => Object.fromEntries(e.map((n, r) => [n, s[r]]))
|
|
141
152
|
);
|
|
142
|
-
},
|
|
153
|
+
}, tt = (...t) => (e, s = {}) => {
|
|
143
154
|
const n = t.filter((r) => y.is(r));
|
|
144
|
-
return
|
|
155
|
+
return _e(
|
|
145
156
|
() => e(...t.map(w.get)),
|
|
146
157
|
n,
|
|
147
158
|
s
|
|
148
159
|
);
|
|
149
160
|
};
|
|
150
|
-
class
|
|
161
|
+
class J {
|
|
151
162
|
_signals = /* @__PURE__ */ new Set();
|
|
152
163
|
_callbacks = [];
|
|
153
164
|
_disposed = !1;
|
|
@@ -249,7 +260,7 @@ class z {
|
|
|
249
260
|
* @public
|
|
250
261
|
*/
|
|
251
262
|
effect(e, s, n) {
|
|
252
|
-
return
|
|
263
|
+
return O(this, () => _e(e, s, n));
|
|
253
264
|
}
|
|
254
265
|
/**
|
|
255
266
|
* Creates a computed signal with curried signature and tracks it in this scope.
|
|
@@ -261,7 +272,7 @@ class z {
|
|
|
261
272
|
*/
|
|
262
273
|
computedOf(...e) {
|
|
263
274
|
return (s, n) => {
|
|
264
|
-
const r = ce(() =>
|
|
275
|
+
const r = ce(() => B(...e)(s, n));
|
|
265
276
|
return this.track(r), r;
|
|
266
277
|
};
|
|
267
278
|
}
|
|
@@ -274,36 +285,36 @@ class z {
|
|
|
274
285
|
* @public
|
|
275
286
|
*/
|
|
276
287
|
effectOf(...e) {
|
|
277
|
-
return (s, n) =>
|
|
288
|
+
return (s, n) => O(this, () => tt(...e)(s, n));
|
|
278
289
|
}
|
|
279
290
|
}
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
},
|
|
283
|
-
if (
|
|
291
|
+
const _ = [], st = (t) => {
|
|
292
|
+
_.push(t);
|
|
293
|
+
}, nt = () => {
|
|
294
|
+
if (_.length === 0)
|
|
284
295
|
throw new Error("Cannot pop from empty scope stack");
|
|
285
|
-
|
|
286
|
-
}, pe = () =>
|
|
287
|
-
|
|
296
|
+
_.pop();
|
|
297
|
+
}, pe = () => _[_.length - 1] ?? null, ts = () => _, ss = () => _[_.length - 2] ?? null, O = (t, e) => {
|
|
298
|
+
st(t);
|
|
288
299
|
try {
|
|
289
300
|
return e();
|
|
290
301
|
} finally {
|
|
291
|
-
|
|
302
|
+
nt();
|
|
292
303
|
}
|
|
293
|
-
},
|
|
294
|
-
const e = new
|
|
304
|
+
}, ns = (t) => {
|
|
305
|
+
const e = new J();
|
|
295
306
|
try {
|
|
296
|
-
return
|
|
307
|
+
return O(e, () => t(e));
|
|
297
308
|
} finally {
|
|
298
309
|
e.dispose();
|
|
299
310
|
}
|
|
300
311
|
}, ce = (t) => {
|
|
301
|
-
const e =
|
|
302
|
-
|
|
312
|
+
const e = _.slice();
|
|
313
|
+
_.length = 0;
|
|
303
314
|
try {
|
|
304
315
|
return t();
|
|
305
316
|
} finally {
|
|
306
|
-
|
|
317
|
+
_.length = 0, _.push(...e);
|
|
307
318
|
}
|
|
308
319
|
};
|
|
309
320
|
class y {
|
|
@@ -671,14 +682,78 @@ class y {
|
|
|
671
682
|
const o = D(s, r);
|
|
672
683
|
let i = 0, l = new AbortController();
|
|
673
684
|
return o.onDispose(
|
|
674
|
-
this.on(async (
|
|
675
|
-
const
|
|
685
|
+
this.on(async (c) => {
|
|
686
|
+
const a = ++i;
|
|
676
687
|
l.abort(), l = new AbortController();
|
|
677
688
|
try {
|
|
678
|
-
const u = await e(
|
|
679
|
-
|
|
689
|
+
const u = await e(c, { abortSignal: l.signal });
|
|
690
|
+
a === i && o.set(u);
|
|
680
691
|
} catch (u) {
|
|
681
|
-
if (
|
|
692
|
+
if (a === i)
|
|
693
|
+
if (n != null)
|
|
694
|
+
o.set(n(u));
|
|
695
|
+
else
|
|
696
|
+
throw u;
|
|
697
|
+
}
|
|
698
|
+
})
|
|
699
|
+
), o;
|
|
700
|
+
};
|
|
701
|
+
/**
|
|
702
|
+
* Maps the values emitted by the signal to multiple values over time using an async generator.
|
|
703
|
+
* Each time the source signal changes, a new async generator is created and iterated.
|
|
704
|
+
* Previous generators are aborted when a new value arrives.
|
|
705
|
+
*
|
|
706
|
+
* This is useful for streaming data, such as:
|
|
707
|
+
* - AI/LLM streaming responses
|
|
708
|
+
* - Server-Sent Events (SSE)
|
|
709
|
+
* - Paginated data loading
|
|
710
|
+
* - WebSocket message streams
|
|
711
|
+
*
|
|
712
|
+
* @example
|
|
713
|
+
* ```typescript
|
|
714
|
+
* const query = prop('hello')
|
|
715
|
+
*
|
|
716
|
+
* // Stream AI response tokens
|
|
717
|
+
* const streamingResponse = query.mapAsyncGenerator(
|
|
718
|
+
* async function* (q, { abortSignal }) {
|
|
719
|
+
* const response = await fetch('/api/stream?q=' + q, { signal: abortSignal })
|
|
720
|
+
* const reader = response.body!.getReader()
|
|
721
|
+
* let accumulated = ''
|
|
722
|
+
*
|
|
723
|
+
* while (true) {
|
|
724
|
+
* const { done, value } = await reader.read()
|
|
725
|
+
* if (done) break
|
|
726
|
+
* accumulated += new TextDecoder().decode(value)
|
|
727
|
+
* yield accumulated // Update signal with each chunk
|
|
728
|
+
* }
|
|
729
|
+
* },
|
|
730
|
+
* '', // alt: empty string while loading
|
|
731
|
+
* (err) => 'Error: ' + err // recover
|
|
732
|
+
* )
|
|
733
|
+
* ```
|
|
734
|
+
*
|
|
735
|
+
* @typeParam O - The type of the yielded values.
|
|
736
|
+
* @param fn - The async generator function that yields values over time. The second argument provides an AbortSignal to cancel the generator when a new value arrives.
|
|
737
|
+
* @param alt - The initial value to use before the first yield.
|
|
738
|
+
* @param recover - Optional function to handle errors thrown by the generator.
|
|
739
|
+
* @param equals - Optional equality function to compare yielded values.
|
|
740
|
+
* @returns A property that updates each time the generator yields a value.
|
|
741
|
+
*/
|
|
742
|
+
mapAsyncGenerator = (e, s, n, r = (o, i) => o === i) => {
|
|
743
|
+
const o = D(s, r);
|
|
744
|
+
let i = 0, l = new AbortController();
|
|
745
|
+
return o.onDispose(
|
|
746
|
+
this.on(async (c) => {
|
|
747
|
+
const a = ++i;
|
|
748
|
+
l.abort(), l = new AbortController();
|
|
749
|
+
try {
|
|
750
|
+
const u = e(c, { abortSignal: l.signal });
|
|
751
|
+
for await (const d of u) {
|
|
752
|
+
if (a !== i) return;
|
|
753
|
+
o.set(d);
|
|
754
|
+
}
|
|
755
|
+
} catch (u) {
|
|
756
|
+
if (a === i)
|
|
682
757
|
if (n != null)
|
|
683
758
|
o.set(n(u));
|
|
684
759
|
else
|
|
@@ -747,7 +822,7 @@ class y {
|
|
|
747
822
|
}), e.onDispose(this.on(e.setDirty, { noAutoDispose: !0 })), this.onDispose(e.dispose);
|
|
748
823
|
};
|
|
749
824
|
}
|
|
750
|
-
const
|
|
825
|
+
const rt = typeof queueMicrotask == "function" ? queueMicrotask : (t) => Promise.resolve().then(t);
|
|
751
826
|
class R extends y {
|
|
752
827
|
/**
|
|
753
828
|
* Creates a new Computed signal.
|
|
@@ -812,7 +887,7 @@ class R extends y {
|
|
|
812
887
|
*/
|
|
813
888
|
_scheduleNotify = () => {
|
|
814
889
|
const e = ++this._scheduleCount;
|
|
815
|
-
|
|
890
|
+
rt(() => {
|
|
816
891
|
this._scheduleCount !== e || this._disposed || this._isDirty && (this._isDirty = !1, this._setAndNotify(this._fn()));
|
|
817
892
|
});
|
|
818
893
|
};
|
|
@@ -918,7 +993,7 @@ class se extends y {
|
|
|
918
993
|
const ne = (t, e, s = (n, r) => n === r) => {
|
|
919
994
|
const n = new R(t, s);
|
|
920
995
|
return e.forEach((r) => r.setDerivative(n)), n;
|
|
921
|
-
},
|
|
996
|
+
}, _e = (t, e, s = {}) => {
|
|
922
997
|
let n = s.once ? () => {
|
|
923
998
|
o(), t();
|
|
924
999
|
} : t;
|
|
@@ -939,18 +1014,18 @@ const ne = (t, e, s = (n, r) => n === r) => {
|
|
|
939
1014
|
}, re = (t, e = (s, n) => s === n) => new y(t, e), oe = () => (
|
|
940
1015
|
/* c8 ignore next */
|
|
941
1016
|
typeof window < "u" ? window : void 0
|
|
942
|
-
),
|
|
1017
|
+
), ot = (t, e, s) => t + (e - t) * s, be = 97, it = (t, e, s) => {
|
|
943
1018
|
const n = Math.max(t.length, e.length);
|
|
944
1019
|
let r = "";
|
|
945
1020
|
for (let o = 0; o < n; o++) {
|
|
946
1021
|
let i = t.charCodeAt(o);
|
|
947
|
-
isNaN(i) && (i =
|
|
1022
|
+
isNaN(i) && (i = be);
|
|
948
1023
|
let l = e.charCodeAt(o);
|
|
949
|
-
isNaN(l) && (l =
|
|
1024
|
+
isNaN(l) && (l = be), r += String.fromCharCode(i + (l - i) * s);
|
|
950
1025
|
}
|
|
951
1026
|
return r;
|
|
952
|
-
},
|
|
953
|
-
class
|
|
1027
|
+
}, lt = (t, e, s) => new Date(t.getTime() + (e.getTime() - t.getTime()) * s), at = (t, e) => e, ct = (t) => typeof t == "number" ? ot : typeof t == "string" ? it : t instanceof Date ? lt : at;
|
|
1028
|
+
class Ee {
|
|
954
1029
|
_store = /* @__PURE__ */ new Map();
|
|
955
1030
|
/**
|
|
956
1031
|
* Retrieves the value associated with the specified key from the memory store.
|
|
@@ -968,120 +1043,120 @@ class Te {
|
|
|
968
1043
|
};
|
|
969
1044
|
}
|
|
970
1045
|
let ue = null, he = null;
|
|
971
|
-
const
|
|
1046
|
+
const ut = () => (ue || (ue = new Ee()), ue), ht = () => (he || (he = new Ee()), he), Ce = ({
|
|
972
1047
|
key: t,
|
|
973
1048
|
defaultValue: e,
|
|
974
1049
|
store: s,
|
|
975
1050
|
serialize: n = JSON.stringify,
|
|
976
1051
|
deserialize: r = JSON.parse,
|
|
977
|
-
equals: o = (
|
|
978
|
-
onLoad: i = (
|
|
1052
|
+
equals: o = (a, u) => a === u,
|
|
1053
|
+
onLoad: i = (a) => a,
|
|
979
1054
|
syncTabs: l = !0,
|
|
980
|
-
onKeyChange:
|
|
1055
|
+
onKeyChange: c = "load"
|
|
981
1056
|
}) => {
|
|
982
|
-
let
|
|
983
|
-
const u = s.getItem(
|
|
1057
|
+
let a = w.get(t);
|
|
1058
|
+
const u = s.getItem(a), d = new se(
|
|
984
1059
|
u != null ? i(r(u)) : typeof e == "function" ? e() : e,
|
|
985
1060
|
o
|
|
986
1061
|
), f = oe(), h = l && typeof f?.BroadcastChannel == "function";
|
|
987
|
-
let p = !1,
|
|
988
|
-
const
|
|
1062
|
+
let p = !1, b = null, v = null;
|
|
1063
|
+
const S = (A) => {
|
|
989
1064
|
if (!h) return null;
|
|
990
|
-
const I = `tempo:storedProp:${
|
|
1065
|
+
const I = `tempo:storedProp:${A}`, P = new f.BroadcastChannel(I), H = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`, M = (Q) => {
|
|
991
1066
|
const C = Q.data;
|
|
992
|
-
if (!(C == null || typeof C != "object" || C.key !==
|
|
1067
|
+
if (!(C == null || typeof C != "object" || C.key !== A || typeof C.value != "string" || C.sourceId != null && C.sourceId === H))
|
|
993
1068
|
try {
|
|
994
1069
|
p = !0;
|
|
995
1070
|
const ae = i(r(C.value));
|
|
996
1071
|
d.set(ae);
|
|
997
1072
|
} catch (ae) {
|
|
998
1073
|
console.warn(
|
|
999
|
-
`Failed to sync storedProp for key "${
|
|
1074
|
+
`Failed to sync storedProp for key "${A}" via BroadcastChannel`,
|
|
1000
1075
|
ae
|
|
1001
1076
|
);
|
|
1002
1077
|
} finally {
|
|
1003
1078
|
p = !1;
|
|
1004
1079
|
}
|
|
1005
1080
|
};
|
|
1006
|
-
return P.addEventListener("message",
|
|
1007
|
-
P?.removeEventListener("message",
|
|
1008
|
-
}), { channel: P, instanceId: H, handleMessage:
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
const X = (
|
|
1012
|
-
const I =
|
|
1013
|
-
if (I ===
|
|
1081
|
+
return P.addEventListener("message", M), d.onDispose(() => {
|
|
1082
|
+
P?.removeEventListener("message", M), P?.close();
|
|
1083
|
+
}), { channel: P, instanceId: H, handleMessage: M };
|
|
1084
|
+
}, x = S(a);
|
|
1085
|
+
x && (b = x.channel, v = x.instanceId);
|
|
1086
|
+
const X = (A) => {
|
|
1087
|
+
const I = a;
|
|
1088
|
+
if (I === A) return;
|
|
1014
1089
|
const P = d.get(), H = n(P);
|
|
1015
|
-
if (s.setItem(I, H),
|
|
1016
|
-
const Q = s.getItem(
|
|
1090
|
+
if (s.setItem(I, H), b != null && (b.close(), b = null, v = null), a = A, c === "load") {
|
|
1091
|
+
const Q = s.getItem(A);
|
|
1017
1092
|
if (Q != null)
|
|
1018
1093
|
try {
|
|
1019
1094
|
const C = i(r(Q));
|
|
1020
1095
|
d.set(C);
|
|
1021
1096
|
} catch (C) {
|
|
1022
1097
|
console.warn(
|
|
1023
|
-
`Failed to load storedProp from new key "${
|
|
1098
|
+
`Failed to load storedProp from new key "${A}"`,
|
|
1024
1099
|
C
|
|
1025
1100
|
);
|
|
1026
1101
|
}
|
|
1027
1102
|
else
|
|
1028
|
-
s.setItem(
|
|
1029
|
-
} else
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
};
|
|
1033
|
-
return y.is(t) && d.onDispose(t.on(X)), d.on((
|
|
1034
|
-
const P = n(
|
|
1035
|
-
s.setItem(
|
|
1036
|
-
key:
|
|
1103
|
+
s.setItem(A, H);
|
|
1104
|
+
} else c === "migrate" && s.setItem(A, H);
|
|
1105
|
+
const M = S(A);
|
|
1106
|
+
M && (b = M.channel, v = M.instanceId);
|
|
1107
|
+
};
|
|
1108
|
+
return y.is(t) && d.onDispose(t.on(X)), d.on((A, I) => {
|
|
1109
|
+
const P = n(A);
|
|
1110
|
+
s.setItem(a, P), b != null && !p && I !== void 0 && v != null && b.postMessage({
|
|
1111
|
+
key: a,
|
|
1037
1112
|
value: P,
|
|
1038
|
-
sourceId:
|
|
1113
|
+
sourceId: v
|
|
1039
1114
|
});
|
|
1040
1115
|
}), d;
|
|
1041
|
-
},
|
|
1042
|
-
const e = oe()?.localStorage, s = e && typeof e.getItem == "function" ? e :
|
|
1043
|
-
return
|
|
1116
|
+
}, rs = (t) => {
|
|
1117
|
+
const e = oe()?.localStorage, s = e && typeof e.getItem == "function" ? e : ut();
|
|
1118
|
+
return Ce({
|
|
1044
1119
|
...t,
|
|
1045
1120
|
store: s
|
|
1046
1121
|
});
|
|
1047
|
-
},
|
|
1048
|
-
const e = oe()?.sessionStorage, s = e && typeof e.getItem == "function" ? e :
|
|
1049
|
-
return
|
|
1122
|
+
}, os = (t) => {
|
|
1123
|
+
const e = oe()?.sessionStorage, s = e && typeof e.getItem == "function" ? e : ht();
|
|
1124
|
+
return Ce({
|
|
1050
1125
|
...t,
|
|
1051
1126
|
store: s
|
|
1052
1127
|
});
|
|
1053
1128
|
};
|
|
1054
|
-
function
|
|
1129
|
+
function Se(t) {
|
|
1055
1130
|
return typeof requestAnimationFrame == "function" ? requestAnimationFrame(t) : setTimeout(t, 0);
|
|
1056
1131
|
}
|
|
1057
|
-
const
|
|
1058
|
-
const r = n?.duration ?? 300, o = n?.easing ?? ((
|
|
1059
|
-
let l = n?.interpolate,
|
|
1132
|
+
const dt = (t, e, s, n) => {
|
|
1133
|
+
const r = n?.duration ?? 300, o = n?.easing ?? ((S) => S), i = n?.equals ?? ((S, x) => S === x);
|
|
1134
|
+
let l = n?.interpolate, c = t, a = e(), u = performance.now(), d = null, f = !0;
|
|
1060
1135
|
const h = new R(e, i), p = D(t, i);
|
|
1061
1136
|
p.onDispose(() => {
|
|
1062
1137
|
d !== null && cancelAnimationFrame(d);
|
|
1063
|
-
}), p.onDispose(h.dispose), s.forEach((
|
|
1064
|
-
|
|
1138
|
+
}), p.onDispose(h.dispose), s.forEach((S) => {
|
|
1139
|
+
S.setDerivative(h), S.onDispose(p.dispose);
|
|
1065
1140
|
});
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1068
|
-
},
|
|
1069
|
-
const
|
|
1070
|
-
l == null && (l =
|
|
1071
|
-
let X = l(
|
|
1072
|
-
|
|
1073
|
-
};
|
|
1074
|
-
return h.on(
|
|
1075
|
-
},
|
|
1141
|
+
const b = (S) => {
|
|
1142
|
+
a = S, u = performance.now(), c = p.value, f && (f = !1, d = Se(v));
|
|
1143
|
+
}, v = () => {
|
|
1144
|
+
const S = (performance.now() - u) / w.get(r), x = o(S);
|
|
1145
|
+
l == null && (l = ct(c));
|
|
1146
|
+
let X = l(c, a, x);
|
|
1147
|
+
S >= 1 ? (f = !0, X = a) : d = Se(v), p.set(X);
|
|
1148
|
+
};
|
|
1149
|
+
return h.on(b), p;
|
|
1150
|
+
}, is = (t, e) => {
|
|
1076
1151
|
const { initialValue: s, ...n } = e ?? {};
|
|
1077
|
-
return
|
|
1152
|
+
return dt(
|
|
1078
1153
|
/* c8 ignore next 2 */
|
|
1079
1154
|
s ?? t.get(),
|
|
1080
1155
|
t.get,
|
|
1081
1156
|
[t],
|
|
1082
1157
|
n
|
|
1083
1158
|
);
|
|
1084
|
-
},
|
|
1159
|
+
}, ft = (t, e) => {
|
|
1085
1160
|
const s = Object.values(t).filter(y.is), n = Object.keys(t);
|
|
1086
1161
|
return ne(() => {
|
|
1087
1162
|
const r = {};
|
|
@@ -1089,7 +1164,7 @@ const ut = (t, e, s, n) => {
|
|
|
1089
1164
|
r[o] = w.get(t[o]);
|
|
1090
1165
|
return e(r);
|
|
1091
1166
|
}, s);
|
|
1092
|
-
},
|
|
1167
|
+
}, ls = (t) => ft(t, (e) => e), as = (t, e) => {
|
|
1093
1168
|
const s = D(t.get());
|
|
1094
1169
|
let n = null;
|
|
1095
1170
|
const r = t.on(
|
|
@@ -1106,28 +1181,28 @@ const ut = (t, e, s, n) => {
|
|
|
1106
1181
|
return s.onDispose(() => {
|
|
1107
1182
|
r(), n != null && clearTimeout(n);
|
|
1108
1183
|
}), s;
|
|
1109
|
-
},
|
|
1184
|
+
}, cs = (t) => {
|
|
1110
1185
|
let e;
|
|
1111
1186
|
return t.map((s) => {
|
|
1112
1187
|
const n = e;
|
|
1113
1188
|
return e = s, n;
|
|
1114
1189
|
});
|
|
1115
|
-
},
|
|
1190
|
+
}, us = ({
|
|
1116
1191
|
size: t = void 0,
|
|
1117
1192
|
signal: e
|
|
1118
1193
|
}) => {
|
|
1119
1194
|
const s = [];
|
|
1120
1195
|
return e.map((n) => (s.push(n), t != null && s.length > t && s.shift(), s.slice()));
|
|
1121
|
-
},
|
|
1196
|
+
}, hs = (t) => (...e) => B(
|
|
1122
1197
|
t,
|
|
1123
1198
|
...e
|
|
1124
1199
|
)((s, ...n) => s(...n));
|
|
1125
|
-
function
|
|
1126
|
-
return
|
|
1200
|
+
function ds(...t) {
|
|
1201
|
+
return B(...t)((...e) => {
|
|
1127
1202
|
for (const s of e) if (s != null) return s;
|
|
1128
1203
|
});
|
|
1129
1204
|
}
|
|
1130
|
-
const
|
|
1205
|
+
const fs = (t, {
|
|
1131
1206
|
channel: e,
|
|
1132
1207
|
serialize: s = JSON.stringify,
|
|
1133
1208
|
deserialize: n = JSON.parse,
|
|
@@ -1140,12 +1215,12 @@ const us = (t, {
|
|
|
1140
1215
|
const i = new o.BroadcastChannel(
|
|
1141
1216
|
`tempo:syncProp:${e}`
|
|
1142
1217
|
), l = `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
1143
|
-
let
|
|
1144
|
-
const
|
|
1218
|
+
let c = !1;
|
|
1219
|
+
const a = (f) => {
|
|
1145
1220
|
const h = f.data;
|
|
1146
1221
|
if (!(h == null || typeof h != "object" || typeof h.value != "string" || h.sourceId != null && h.sourceId === l))
|
|
1147
1222
|
try {
|
|
1148
|
-
|
|
1223
|
+
c = !0;
|
|
1149
1224
|
const p = n(h.value);
|
|
1150
1225
|
r(t.get(), p) || t.set(p);
|
|
1151
1226
|
} catch (p) {
|
|
@@ -1154,12 +1229,12 @@ const us = (t, {
|
|
|
1154
1229
|
p
|
|
1155
1230
|
);
|
|
1156
1231
|
} finally {
|
|
1157
|
-
|
|
1232
|
+
c = !1;
|
|
1158
1233
|
}
|
|
1159
1234
|
};
|
|
1160
|
-
i.addEventListener("message",
|
|
1235
|
+
i.addEventListener("message", a);
|
|
1161
1236
|
const u = t.on((f, h) => {
|
|
1162
|
-
if (!
|
|
1237
|
+
if (!c && h !== void 0 && !r(f, h))
|
|
1163
1238
|
try {
|
|
1164
1239
|
const p = s(f);
|
|
1165
1240
|
i.postMessage({
|
|
@@ -1173,7 +1248,7 @@ const us = (t, {
|
|
|
1173
1248
|
);
|
|
1174
1249
|
}
|
|
1175
1250
|
}), d = () => {
|
|
1176
|
-
u(), i.removeEventListener("message",
|
|
1251
|
+
u(), i.removeEventListener("message", a), i.close();
|
|
1177
1252
|
};
|
|
1178
1253
|
return t.onDispose(d), d;
|
|
1179
1254
|
};
|
|
@@ -1225,12 +1300,14 @@ class de {
|
|
|
1225
1300
|
this.#e?.dispose(), this.#e = void 0;
|
|
1226
1301
|
};
|
|
1227
1302
|
}
|
|
1228
|
-
const
|
|
1303
|
+
const De = /* @__PURE__ */ new Set(["checked", "disabled", "hidden", "multiple", "readonly", "required", "autofocus"]), Le = /* @__PURE__ */ new Set(["selected"]), xe = /* @__PURE__ */ new Set([
|
|
1229
1304
|
"rowSpan",
|
|
1230
1305
|
"colSpan",
|
|
1231
1306
|
"tabIndex",
|
|
1232
1307
|
"valueAsNumber"
|
|
1233
|
-
]),
|
|
1308
|
+
]), Pe = /* @__PURE__ */ new Set(["valueAsDate"]), Me = {
|
|
1309
|
+
readonly: "readOnly"
|
|
1310
|
+
}, Oe = /* @__PURE__ */ new Set([
|
|
1234
1311
|
"value",
|
|
1235
1312
|
"textContent",
|
|
1236
1313
|
"innerText",
|
|
@@ -1239,23 +1316,30 @@ const Ce = /* @__PURE__ */ new Set(["checked", "disabled", "hidden"]), De = /* @
|
|
|
1239
1316
|
"outerHTML",
|
|
1240
1317
|
"className",
|
|
1241
1318
|
"classList"
|
|
1242
|
-
]),
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
}
|
|
1319
|
+
]), pt = (t, e) => {
|
|
1320
|
+
if (Le.has(t))
|
|
1321
|
+
return (s) => {
|
|
1322
|
+
s == null || s !== !0 ? e.removeAttribute(t) : e.setAttribute(t, "");
|
|
1323
|
+
};
|
|
1324
|
+
if (De.has(t)) {
|
|
1325
|
+
const s = Me[t] || t;
|
|
1326
|
+
return (n) => {
|
|
1327
|
+
n == null ? e[s] = null : e[s] = !!n;
|
|
1328
|
+
};
|
|
1329
|
+
} else return xe.has(t) ? (s) => {
|
|
1330
|
+
s == null ? e[t] = null : e[t] = Number(s);
|
|
1331
|
+
} : Pe.has(t) ? (s) => {
|
|
1332
|
+
s == null ? e[t] = null : e[t] = s;
|
|
1333
|
+
} : Oe.has(t) ? (s) => {
|
|
1334
|
+
s == null ? e[t] = null : e[t] = String(s);
|
|
1335
|
+
} : (s) => {
|
|
1336
|
+
s == null ? e.removeAttribute(t) : e.setAttribute(t, s);
|
|
1337
|
+
};
|
|
1338
|
+
}, gt = (t, e) => Le.has(t) ? () => e.hasAttribute(t) : De.has(t) ? () => !!e[Me[t] || t] : xe.has(t) ? () => Number(e[t]) : Pe.has(t) ? () => e[t] : Oe.has(t) ? () => String(e[t]) : () => e.getAttribute(t), te = (t) => {
|
|
1255
1339
|
const e = t;
|
|
1256
1340
|
e && e.onblur && (e.onblur = null), !(!t || t.ownerDocument === void 0) && t.parentNode && t.parentNode.removeChild(t);
|
|
1257
|
-
},
|
|
1258
|
-
class
|
|
1341
|
+
}, mt = (t) => ke(t) || Ie(t) ? t : t.parentElement, ke = (t) => t.nodeType === 1, Ie = (t) => t.nodeType === 11;
|
|
1342
|
+
class He extends Error {
|
|
1259
1343
|
constructor(e) {
|
|
1260
1344
|
super(`Provider not found: ${e.description}`);
|
|
1261
1345
|
}
|
|
@@ -1450,7 +1534,7 @@ class j {
|
|
|
1450
1534
|
*/
|
|
1451
1535
|
getProvider = (e) => {
|
|
1452
1536
|
if (this.providers[e] === void 0)
|
|
1453
|
-
throw new
|
|
1537
|
+
throw new He(e);
|
|
1454
1538
|
const [s, n] = this.providers[e];
|
|
1455
1539
|
return { value: s, onUse: n };
|
|
1456
1540
|
};
|
|
@@ -1525,24 +1609,24 @@ class j {
|
|
|
1525
1609
|
*/
|
|
1526
1610
|
getStyle = (e) => this.element.style[e];
|
|
1527
1611
|
makeAccessors = (e) => ({
|
|
1528
|
-
get:
|
|
1529
|
-
set:
|
|
1612
|
+
get: gt(e, this.element),
|
|
1613
|
+
set: pt(e, this.element)
|
|
1530
1614
|
});
|
|
1531
1615
|
getWindow = () => this.document.defaultView;
|
|
1532
1616
|
}
|
|
1533
|
-
const
|
|
1534
|
-
const s = new
|
|
1617
|
+
const z = (t, e) => {
|
|
1618
|
+
const s = new J(), n = O(s, () => t.render(e));
|
|
1535
1619
|
return (r = !0) => {
|
|
1536
1620
|
s.dispose(), n(r);
|
|
1537
1621
|
};
|
|
1538
|
-
},
|
|
1622
|
+
}, ps = (t, e, { doc: s, clear: n, disposeWithParent: r = !0, providers: o = {} } = {}) => {
|
|
1539
1623
|
const i = typeof e == "string" ? (s ?? document).querySelector(e) : e;
|
|
1540
1624
|
if (i === null)
|
|
1541
|
-
throw new
|
|
1625
|
+
throw new yt(
|
|
1542
1626
|
`Cannot find element by selector for render: ${e}`
|
|
1543
1627
|
);
|
|
1544
1628
|
n !== !1 && (s ?? i.ownerDocument) != null && (i.nodeType === 1 || i.nodeType === 11) && (i.innerHTML = "");
|
|
1545
|
-
const l =
|
|
1629
|
+
const l = mt(i), c = ke(i) || Ie(i) ? void 0 : i, a = j.of(l, c, o), u = z(t, a);
|
|
1546
1630
|
let d;
|
|
1547
1631
|
return r && i.parentElement != null && (d = new MutationObserver((f) => {
|
|
1548
1632
|
f[0]?.removedNodes.forEach((h) => {
|
|
@@ -1555,27 +1639,27 @@ const G = (t, e) => {
|
|
|
1555
1639
|
})), () => {
|
|
1556
1640
|
d?.disconnect(), u(!0);
|
|
1557
1641
|
};
|
|
1558
|
-
},
|
|
1642
|
+
}, gs = (t, {
|
|
1559
1643
|
startUrl: e = "https://example.com",
|
|
1560
1644
|
selector: s,
|
|
1561
1645
|
providers: n = {}
|
|
1562
1646
|
} = {
|
|
1563
1647
|
selector: "body"
|
|
1564
1648
|
}) => {
|
|
1565
|
-
const r = w.toSignal(e).deriveProp(), o = new
|
|
1649
|
+
const r = w.toSignal(e).deriveProp(), o = new je(s, void 0), i = new V(o, void 0, { currentURL: r }, n);
|
|
1566
1650
|
return {
|
|
1567
|
-
clear:
|
|
1651
|
+
clear: z(t(), i),
|
|
1568
1652
|
root: o,
|
|
1569
1653
|
currentURL: r
|
|
1570
1654
|
};
|
|
1571
1655
|
};
|
|
1572
|
-
class
|
|
1656
|
+
class yt extends Error {
|
|
1573
1657
|
constructor(e) {
|
|
1574
1658
|
super(e);
|
|
1575
1659
|
}
|
|
1576
1660
|
}
|
|
1577
|
-
const fe = "data-tts-node",
|
|
1578
|
-
class
|
|
1661
|
+
const fe = "data-tts-node", q = "data-tts-class", F = "data-tts-style", W = "data-tts-html", U = "data-tts-text", G = "data-tts-attrs";
|
|
1662
|
+
class ms {
|
|
1579
1663
|
/**
|
|
1580
1664
|
* Selects elements from the headless environment.
|
|
1581
1665
|
* @param selector - The selector to select elements from. The supported selectors are CSS selectors whose complexity depends on the adapter implementation.
|
|
@@ -1657,13 +1741,13 @@ class fs {
|
|
|
1657
1741
|
setClass: o,
|
|
1658
1742
|
getStyles: i,
|
|
1659
1743
|
setStyles: l,
|
|
1660
|
-
appendHTML:
|
|
1661
|
-
getInnerHTML:
|
|
1744
|
+
appendHTML: c,
|
|
1745
|
+
getInnerHTML: a,
|
|
1662
1746
|
setInnerHTML: u,
|
|
1663
1747
|
getInnerText: d,
|
|
1664
1748
|
setInnerText: f
|
|
1665
1749
|
}) {
|
|
1666
|
-
this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML =
|
|
1750
|
+
this.select = e, this.getAttribute = s, this.setAttribute = n, this.getClass = r, this.setClass = o, this.getStyles = i, this.setStyles = l, this.appendHTML = c, this.getInnerHTML = a, this.setInnerHTML = u, this.getInnerText = d, this.setInnerText = f;
|
|
1667
1751
|
}
|
|
1668
1752
|
/**
|
|
1669
1753
|
* Sets the content of the root element from a HeadlessPortal. Generally this will be the same instance that is
|
|
@@ -1684,21 +1768,21 @@ class fs {
|
|
|
1684
1768
|
if (r.hasChildren() && this.appendHTML(i, r.contentToHTML(s)), r.hasInnerHTML()) {
|
|
1685
1769
|
if (s) {
|
|
1686
1770
|
const l = this.getInnerHTML(i);
|
|
1687
|
-
l != null && this.setAttribute(i,
|
|
1771
|
+
l != null && this.setAttribute(i, W, l);
|
|
1688
1772
|
}
|
|
1689
1773
|
this.setInnerHTML(i, r.getInnerHTML());
|
|
1690
1774
|
}
|
|
1691
1775
|
if (r.hasInnerText()) {
|
|
1692
1776
|
if (s) {
|
|
1693
1777
|
const l = this.getInnerText(i);
|
|
1694
|
-
l != null && this.setAttribute(i,
|
|
1778
|
+
l != null && this.setAttribute(i, U, l);
|
|
1695
1779
|
}
|
|
1696
1780
|
this.setInnerText(i, r.getInnerText());
|
|
1697
1781
|
}
|
|
1698
1782
|
if (r.hasClasses()) {
|
|
1699
1783
|
if (s) {
|
|
1700
1784
|
const l = this.getClass(i);
|
|
1701
|
-
l != null && this.setAttribute(i,
|
|
1785
|
+
l != null && this.setAttribute(i, q, l);
|
|
1702
1786
|
}
|
|
1703
1787
|
this.setClass(i, r.getClasses().join(" "));
|
|
1704
1788
|
}
|
|
@@ -1707,7 +1791,7 @@ class fs {
|
|
|
1707
1791
|
const l = this.getStyles(i);
|
|
1708
1792
|
Object.keys(l).length > 0 && this.setAttribute(
|
|
1709
1793
|
i,
|
|
1710
|
-
|
|
1794
|
+
F,
|
|
1711
1795
|
JSON.stringify(l)
|
|
1712
1796
|
);
|
|
1713
1797
|
}
|
|
@@ -1716,55 +1800,55 @@ class fs {
|
|
|
1716
1800
|
if (r.hasAttributes()) {
|
|
1717
1801
|
const l = r.getAttributes();
|
|
1718
1802
|
if (s) {
|
|
1719
|
-
const
|
|
1720
|
-
l.forEach(([
|
|
1721
|
-
const u = this.getAttribute(i,
|
|
1722
|
-
u != null &&
|
|
1723
|
-
}),
|
|
1803
|
+
const c = [];
|
|
1804
|
+
l.forEach(([a]) => {
|
|
1805
|
+
const u = this.getAttribute(i, a);
|
|
1806
|
+
u != null && c.push([a, u]);
|
|
1807
|
+
}), c.length > 0 && this.setAttribute(
|
|
1724
1808
|
i,
|
|
1725
|
-
|
|
1726
|
-
JSON.stringify(Object.fromEntries(
|
|
1809
|
+
G,
|
|
1810
|
+
JSON.stringify(Object.fromEntries(c))
|
|
1727
1811
|
);
|
|
1728
1812
|
}
|
|
1729
|
-
l.forEach(([
|
|
1730
|
-
this.setAttribute(i,
|
|
1813
|
+
l.forEach(([c, a]) => {
|
|
1814
|
+
this.setAttribute(i, c, a);
|
|
1731
1815
|
});
|
|
1732
1816
|
}
|
|
1733
1817
|
}
|
|
1734
1818
|
});
|
|
1735
1819
|
};
|
|
1736
1820
|
}
|
|
1737
|
-
const
|
|
1738
|
-
const e = t.getAttribute(
|
|
1739
|
-
t.removeAttribute(
|
|
1740
|
-
},
|
|
1741
|
-
const e = t.getAttribute(F);
|
|
1742
|
-
t.removeAttribute(F), e != null && (t.innerHTML = e);
|
|
1743
|
-
}, wt = (t) => {
|
|
1821
|
+
const $e = (t) => JSON.parse(t.replace(/"/g, '"')), wt = (t) => {
|
|
1822
|
+
const e = t.getAttribute(q);
|
|
1823
|
+
t.removeAttribute(q), e != null && t.setAttribute("class", e);
|
|
1824
|
+
}, bt = (t) => {
|
|
1744
1825
|
const e = t.getAttribute(W);
|
|
1745
|
-
t.removeAttribute(W), e != null && (t.
|
|
1826
|
+
t.removeAttribute(W), e != null && (t.innerHTML = e);
|
|
1827
|
+
}, St = (t) => {
|
|
1828
|
+
const e = t.getAttribute(U);
|
|
1829
|
+
t.removeAttribute(U), e != null && (t.innerText = e);
|
|
1746
1830
|
}, vt = (t) => {
|
|
1747
|
-
const e = t.getAttribute(
|
|
1748
|
-
if (t.removeAttribute(
|
|
1749
|
-
const s =
|
|
1831
|
+
const e = t.getAttribute(F);
|
|
1832
|
+
if (t.removeAttribute(F), e != null) {
|
|
1833
|
+
const s = $e(e), n = Object.entries(s);
|
|
1750
1834
|
n.length > 0 && (t.style.cssText = n.map(([r, o]) => `${r}: ${o}`).join("; "));
|
|
1751
1835
|
}
|
|
1752
|
-
},
|
|
1753
|
-
const e = t.getAttribute(
|
|
1754
|
-
if (t.removeAttribute(
|
|
1755
|
-
const s =
|
|
1836
|
+
}, At = (t) => {
|
|
1837
|
+
const e = t.getAttribute(G);
|
|
1838
|
+
if (t.removeAttribute(G), e != null) {
|
|
1839
|
+
const s = $e(e);
|
|
1756
1840
|
Object.entries(s).forEach(([n, r]) => {
|
|
1757
1841
|
r == null ? t.removeAttribute(n) : t.setAttribute(n, r);
|
|
1758
1842
|
});
|
|
1759
1843
|
}
|
|
1760
|
-
},
|
|
1844
|
+
}, ys = () => {
|
|
1761
1845
|
const e = [
|
|
1762
1846
|
fe,
|
|
1763
|
-
B,
|
|
1764
|
-
F,
|
|
1765
|
-
W,
|
|
1766
1847
|
q,
|
|
1767
|
-
|
|
1848
|
+
W,
|
|
1849
|
+
U,
|
|
1850
|
+
F,
|
|
1851
|
+
G
|
|
1768
1852
|
].map((n) => `[${n}]`).join(",");
|
|
1769
1853
|
document.querySelectorAll(e).forEach((n) => {
|
|
1770
1854
|
const r = n;
|
|
@@ -1772,19 +1856,19 @@ const Ie = (t) => JSON.parse(t.replace(/"/g, '"')), mt = (t) => {
|
|
|
1772
1856
|
te(r);
|
|
1773
1857
|
return;
|
|
1774
1858
|
}
|
|
1775
|
-
r.hasAttribute(
|
|
1859
|
+
r.hasAttribute(q) && wt(r), r.hasAttribute(U) && St(r), r.hasAttribute(W) && bt(r), r.hasAttribute(F) && vt(r), r.hasAttribute(G) && At(r);
|
|
1776
1860
|
});
|
|
1777
|
-
},
|
|
1778
|
-
class
|
|
1861
|
+
}, Tt = "data-tempo-id", $ = Symbol("class"), N = Symbol("style"), Z = Symbol("handler"), Ne = () => Math.random().toString(36).substring(2, 15), _t = (t) => t.replace(/<[^>]*>?/g, "");
|
|
1862
|
+
class Re {
|
|
1779
1863
|
constructor(e) {
|
|
1780
1864
|
this.parent = e;
|
|
1781
1865
|
}
|
|
1782
|
-
id =
|
|
1866
|
+
id = Ne();
|
|
1783
1867
|
properties = {};
|
|
1784
1868
|
children = [];
|
|
1785
1869
|
isElement = () => !0;
|
|
1786
1870
|
isText = () => !1;
|
|
1787
|
-
getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ?
|
|
1871
|
+
getText = () => this.properties.innerText != null ? this.properties.innerText : this.properties.innerHTML != null ? _t(this.properties.innerHTML) : this.children.map((e) => e.getText()).join("");
|
|
1788
1872
|
removeChild = (e) => {
|
|
1789
1873
|
const s = this.children.indexOf(e);
|
|
1790
1874
|
s !== -1 && this.children.splice(s, 1);
|
|
@@ -1805,8 +1889,8 @@ class Ne {
|
|
|
1805
1889
|
getInnerText = () => this.properties.innerText ?? "";
|
|
1806
1890
|
hasInnerText = () => this.properties.innerText != null;
|
|
1807
1891
|
hasChildren = () => this.children.length > 0;
|
|
1808
|
-
hasClasses = () => this.properties[
|
|
1809
|
-
hasStyles = () => this.properties[
|
|
1892
|
+
hasClasses = () => this.properties[$] != null;
|
|
1893
|
+
hasStyles = () => this.properties[N] != null;
|
|
1810
1894
|
hasAttributes = () => Object.keys(this.properties).length > 0;
|
|
1811
1895
|
hasHandlers = () => this.properties[Z] != null;
|
|
1812
1896
|
hasRenderableProperties = () => this.hasClasses() || this.hasAttributes() || this.hasStyles();
|
|
@@ -1826,45 +1910,45 @@ class Ne {
|
|
|
1826
1910
|
this.trigger("click", {});
|
|
1827
1911
|
};
|
|
1828
1912
|
on = (e, s, n, r) => {
|
|
1829
|
-
const o = this.properties[Z] ??= {}, i = r?.once ? (
|
|
1830
|
-
l(), s(
|
|
1831
|
-
} : (
|
|
1913
|
+
const o = this.properties[Z] ??= {}, i = r?.once ? (c) => {
|
|
1914
|
+
l(), s(c, n);
|
|
1915
|
+
} : (c) => s(c, n);
|
|
1832
1916
|
o[e] = [...o[e] ?? [], i];
|
|
1833
1917
|
const l = () => {
|
|
1834
|
-
const
|
|
1835
|
-
|
|
1918
|
+
const c = o[e] ?? [], a = c.indexOf(i);
|
|
1919
|
+
a !== -1 && (c.splice(a, 1), c.length === 0 ? (delete o[e], Object.keys(o).length === 0 && delete this.properties[Z]) : o[e] = c, r?.signal != null && r.signal.removeEventListener("abort", l));
|
|
1836
1920
|
};
|
|
1837
1921
|
return r?.signal != null && r.signal.addEventListener("abort", l), l;
|
|
1838
1922
|
};
|
|
1839
1923
|
addClasses = (e) => {
|
|
1840
1924
|
if (e.length === 0)
|
|
1841
1925
|
return;
|
|
1842
|
-
const s = this.properties[
|
|
1926
|
+
const s = this.properties[$] ??= [], n = new Set(s);
|
|
1843
1927
|
for (const r of e)
|
|
1844
1928
|
n.has(r) || (s.push(r), n.add(r));
|
|
1845
1929
|
};
|
|
1846
1930
|
removeClasses = (e) => {
|
|
1847
1931
|
if (e.length === 0)
|
|
1848
1932
|
return;
|
|
1849
|
-
const s = this.properties[
|
|
1933
|
+
const s = this.properties[$] ??= [], n = new Set(e);
|
|
1850
1934
|
let r = 0;
|
|
1851
1935
|
for (let o = 0; o < s.length; o++)
|
|
1852
1936
|
n.has(s[o]) || (s[r] = s[o], r++);
|
|
1853
|
-
s.length = r, s.length === 0 && delete this.properties[
|
|
1937
|
+
s.length = r, s.length === 0 && delete this.properties[$];
|
|
1854
1938
|
};
|
|
1855
|
-
getClasses = () => this.properties[
|
|
1939
|
+
getClasses = () => this.properties[$] ?? [];
|
|
1856
1940
|
getAttributes = () => Object.entries(this.properties).filter(
|
|
1857
1941
|
([e]) => !["innerText", "innerHTML"].includes(e)
|
|
1858
1942
|
);
|
|
1859
1943
|
getVisibleAttributes = () => Reflect.ownKeys(this.properties).flatMap(
|
|
1860
|
-
(e) => e ===
|
|
1944
|
+
(e) => e === $ ? [["class", this.getClasses()]] : e === N ? [["style", this.getStyles()]] : typeof e == "string" ? [[e, String(this.properties[e])]] : []
|
|
1861
1945
|
);
|
|
1862
1946
|
setStyle = (e, s) => {
|
|
1863
|
-
const n = this.properties[
|
|
1864
|
-
n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[
|
|
1947
|
+
const n = this.properties[N] ??= {};
|
|
1948
|
+
n[e] = s, s === "" && (delete n[e], Object.keys(n).length === 0 && delete this.properties[N]);
|
|
1865
1949
|
};
|
|
1866
|
-
getStyle = (e) => this.properties[
|
|
1867
|
-
getStyles = () => this.properties[
|
|
1950
|
+
getStyle = (e) => this.properties[N]?.[e] ?? "";
|
|
1951
|
+
getStyles = () => this.properties[N] ?? {};
|
|
1868
1952
|
makeAccessors = (e) => {
|
|
1869
1953
|
const s = this.properties;
|
|
1870
1954
|
return {
|
|
@@ -1873,36 +1957,90 @@ class Ne {
|
|
|
1873
1957
|
};
|
|
1874
1958
|
};
|
|
1875
1959
|
}
|
|
1876
|
-
const
|
|
1877
|
-
class
|
|
1960
|
+
const Et = (t) => t.replace(/"/g, """), Ct = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
1961
|
+
class Dt extends Re {
|
|
1878
1962
|
constructor(e, s, n) {
|
|
1879
1963
|
super(n), this.tagName = e, this.namespace = s;
|
|
1880
1964
|
}
|
|
1881
1965
|
isPortal = () => !1;
|
|
1966
|
+
/**
|
|
1967
|
+
* Builds the attributes string for this element.
|
|
1968
|
+
* Returns an object containing the attributes string and any innerHTML value.
|
|
1969
|
+
*/
|
|
1970
|
+
buildAttributesString = (e) => {
|
|
1971
|
+
let s = null;
|
|
1972
|
+
const n = this.namespace ? ` xmlns="${this.namespace}"` : "", r = this.getVisibleAttributes().map(([i, l]) => i === "class" ? ` class="${l.join(" ")}"` : i === "style" ? typeof l == "string" ? ` style="${l}"` : ` style="${Object.entries(l).map(([c, a]) => `${c}: ${a};`).join(" ")}"` : xt.has(i) ? ` ${i}` : i === "innerHTML" ? (s = l, "") : i === "innerText" ? (s = Ct(l), "") : ` ${i}="${Et(l)}"`).join(""), o = e ? ` ${fe} ${Tt}="${this.id}"` : "";
|
|
1973
|
+
return { attrs: `${n}${r}${o}`, innerHTML: s };
|
|
1974
|
+
};
|
|
1882
1975
|
toHTML = (e = !1) => {
|
|
1883
|
-
const s = this.children.map((
|
|
1884
|
-
|
|
1885
|
-
const o = this.getVisibleAttributes().map(([l, a]) => l === "class" ? ` class="${a.join(" ")}"` : l === "style" ? typeof a == "string" ? ` style="${a}"` : ` style="${Object.entries(a).map(([c, u]) => `${c}: ${u};`).join(" ")}"` : Ct.has(l) ? ` ${l}` : l === "innerHTML" ? (r = a, "") : l === "innerText" ? (r = At(a), "") : ` ${l}="${_t(a)}"`).join(""), i = e ? ` ${fe}` : "";
|
|
1886
|
-
return Dt.has(this.tagName) && s === "" ? `<${this.tagName}${n}${o}${i} />` : `<${this.tagName}${n}${o}${i}>${r ?? s}</${this.tagName}>`;
|
|
1976
|
+
const s = this.children.map((o) => o.toHTML()).join(""), { attrs: n, innerHTML: r } = this.buildAttributesString(e);
|
|
1977
|
+
return ve.has(this.tagName) && s === "" ? `<${this.tagName}${n} />` : `<${this.tagName}${n}>${r ?? s}</${this.tagName}>`;
|
|
1887
1978
|
};
|
|
1979
|
+
/**
|
|
1980
|
+
* Generates HTML output as an async stream of string chunks.
|
|
1981
|
+
* Yields the opening tag, then each child's content, then the closing tag.
|
|
1982
|
+
*
|
|
1983
|
+
* @param options - Options for streaming output.
|
|
1984
|
+
* @yields String chunks of HTML content.
|
|
1985
|
+
*/
|
|
1986
|
+
async *toHTMLStream(e) {
|
|
1987
|
+
const s = e?.generatePlaceholders ?? !1, { attrs: n, innerHTML: r } = this.buildAttributesString(s);
|
|
1988
|
+
if (ve.has(this.tagName) && this.children.length === 0) {
|
|
1989
|
+
yield `<${this.tagName}${n} />`;
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
if (yield `<${this.tagName}${n}>`, r !== null)
|
|
1993
|
+
yield r;
|
|
1994
|
+
else
|
|
1995
|
+
for (const o of this.children)
|
|
1996
|
+
yield* o.toHTMLStream(e);
|
|
1997
|
+
yield `</${this.tagName}>`;
|
|
1998
|
+
}
|
|
1888
1999
|
}
|
|
1889
|
-
class
|
|
2000
|
+
class je extends Re {
|
|
1890
2001
|
constructor(e, s) {
|
|
1891
2002
|
super(s), this.selector = e;
|
|
1892
2003
|
}
|
|
1893
2004
|
isPortal = () => !0;
|
|
1894
2005
|
toHTML = () => "";
|
|
2006
|
+
/**
|
|
2007
|
+
* Portals don't render inline - they render at their target selector.
|
|
2008
|
+
* This method yields nothing for the inline position.
|
|
2009
|
+
*/
|
|
2010
|
+
// eslint-disable-next-line require-yield
|
|
2011
|
+
async *toHTMLStream(e) {
|
|
2012
|
+
}
|
|
1895
2013
|
contentToHTML = (e = !1) => this.children.map((s) => s.toHTML(e)).join("");
|
|
2014
|
+
/**
|
|
2015
|
+
* Streams the portal's content HTML.
|
|
2016
|
+
* Unlike toHTMLStream, this yields the actual content for rendering at the target location.
|
|
2017
|
+
*
|
|
2018
|
+
* @param options - Options for streaming output.
|
|
2019
|
+
* @yields String chunks of the portal's content.
|
|
2020
|
+
*/
|
|
2021
|
+
async *contentToHTMLStream(e) {
|
|
2022
|
+
for (const s of this.children)
|
|
2023
|
+
yield* s.toHTMLStream(e);
|
|
2024
|
+
}
|
|
1896
2025
|
}
|
|
1897
|
-
class
|
|
2026
|
+
class Lt {
|
|
1898
2027
|
constructor(e) {
|
|
1899
2028
|
this.text = e;
|
|
1900
2029
|
}
|
|
1901
|
-
id =
|
|
2030
|
+
id = Ne();
|
|
1902
2031
|
isElement = () => !1;
|
|
1903
2032
|
isText = () => !0;
|
|
1904
2033
|
getText = () => this.text;
|
|
1905
2034
|
toHTML = () => this.text;
|
|
2035
|
+
/**
|
|
2036
|
+
* Streams the text content as a single chunk.
|
|
2037
|
+
*
|
|
2038
|
+
* @param options - Options (unused for text nodes, kept for API consistency).
|
|
2039
|
+
* @yields The text content.
|
|
2040
|
+
*/
|
|
2041
|
+
async *toHTMLStream(e) {
|
|
2042
|
+
yield this.text;
|
|
2043
|
+
}
|
|
1906
2044
|
}
|
|
1907
2045
|
class V {
|
|
1908
2046
|
constructor(e, s, n, r) {
|
|
@@ -1916,7 +2054,7 @@ class V {
|
|
|
1916
2054
|
this.element.children.push(e);
|
|
1917
2055
|
};
|
|
1918
2056
|
makeChildElement = (e, s) => {
|
|
1919
|
-
const n = new
|
|
2057
|
+
const n = new Dt(e, s, this.element);
|
|
1920
2058
|
return this.appendOrInsert(n), new V(
|
|
1921
2059
|
n,
|
|
1922
2060
|
void 0,
|
|
@@ -1925,7 +2063,7 @@ class V {
|
|
|
1925
2063
|
);
|
|
1926
2064
|
};
|
|
1927
2065
|
makeChildText = (e) => {
|
|
1928
|
-
const s = new
|
|
2066
|
+
const s = new Lt(e);
|
|
1929
2067
|
return this.appendOrInsert(s), new V(
|
|
1930
2068
|
this.element,
|
|
1931
2069
|
s,
|
|
@@ -1939,7 +2077,7 @@ class V {
|
|
|
1939
2077
|
getText = () => this.reference?.getText() ?? this.element.getText();
|
|
1940
2078
|
makeRef = () => this.makeChildText("");
|
|
1941
2079
|
makePortal = (e) => {
|
|
1942
|
-
const s = new
|
|
2080
|
+
const s = new je(e, this.element);
|
|
1943
2081
|
return this.appendOrInsert(s), new V(
|
|
1944
2082
|
s,
|
|
1945
2083
|
void 0,
|
|
@@ -1960,7 +2098,7 @@ class V {
|
|
|
1960
2098
|
});
|
|
1961
2099
|
getProvider = (e) => {
|
|
1962
2100
|
if (this.providers[e] === void 0)
|
|
1963
|
-
throw new
|
|
2101
|
+
throw new He(e);
|
|
1964
2102
|
const [s, n] = this.providers[e];
|
|
1965
2103
|
return { value: s, onUse: n };
|
|
1966
2104
|
};
|
|
@@ -1979,60 +2117,60 @@ class V {
|
|
|
1979
2117
|
getStyle = (e) => this.element.getStyle(e);
|
|
1980
2118
|
makeAccessors = (e) => this.element.makeAccessors(e);
|
|
1981
2119
|
}
|
|
1982
|
-
const
|
|
2120
|
+
const xt = /* @__PURE__ */ new Set([
|
|
1983
2121
|
"checked",
|
|
1984
2122
|
"disabled",
|
|
1985
2123
|
"multiple",
|
|
1986
2124
|
"readonly",
|
|
1987
2125
|
"required",
|
|
1988
2126
|
"selected"
|
|
1989
|
-
]),
|
|
2127
|
+
]), ve = /* @__PURE__ */ new Set(["img", "br", "hr", "input", "link", "meta"]), ws = () => (
|
|
1990
2128
|
/* c8 ignore next */
|
|
1991
2129
|
typeof window < "u" ? window : void 0
|
|
1992
|
-
),
|
|
2130
|
+
), Pt = Symbol("DOM_RENDERABLE"), m = (t) => Xe(Pt, t), Ve = (t) => m((e) => e.makeChildText(t).clear), Be = (t) => m((e) => {
|
|
1993
2131
|
const s = e.makeChildText(t.value), n = t.on(s.setText);
|
|
1994
2132
|
return (r) => {
|
|
1995
2133
|
n(), s.clear(r);
|
|
1996
2134
|
};
|
|
1997
|
-
}),
|
|
2135
|
+
}), bs = (t) => y.is(t) ? Be(t) : Ve(t), E = (...t) => m((e) => {
|
|
1998
2136
|
const s = t.map((n) => g(n).render(e));
|
|
1999
2137
|
return (n) => {
|
|
2000
2138
|
s.forEach((r) => r(n));
|
|
2001
2139
|
};
|
|
2002
|
-
}),
|
|
2003
|
-
}),
|
|
2140
|
+
}), L = m(() => () => {
|
|
2141
|
+
}), Mt = (t) => m((e) => (e.addClasses(t), (s) => {
|
|
2004
2142
|
s && e.removeClasses(t);
|
|
2005
|
-
})),
|
|
2143
|
+
})), Ot = (t) => m((e) => {
|
|
2006
2144
|
let s = /* @__PURE__ */ new Set();
|
|
2007
2145
|
const n = t.on(
|
|
2008
2146
|
(r) => {
|
|
2009
|
-
const o = (r ?? "").split(" ").filter((
|
|
2010
|
-
for (const
|
|
2011
|
-
i.has(
|
|
2012
|
-
const
|
|
2013
|
-
for (const
|
|
2014
|
-
s.has(
|
|
2015
|
-
l.length > 0 && e.removeClasses(l),
|
|
2147
|
+
const o = (r ?? "").split(" ").filter((a) => a.length > 0), i = new Set(o), l = [];
|
|
2148
|
+
for (const a of s)
|
|
2149
|
+
i.has(a) || l.push(a);
|
|
2150
|
+
const c = [];
|
|
2151
|
+
for (const a of i)
|
|
2152
|
+
s.has(a) || c.push(a);
|
|
2153
|
+
l.length > 0 && e.removeClasses(l), c.length > 0 && e.addClasses(c), s = i;
|
|
2016
2154
|
},
|
|
2017
2155
|
{ noAutoDispose: !0 }
|
|
2018
2156
|
);
|
|
2019
2157
|
return (r) => {
|
|
2020
2158
|
n(), r && e.removeClasses(Array.from(s)), s.clear();
|
|
2021
2159
|
};
|
|
2022
|
-
}),
|
|
2160
|
+
}), kt = (t, e) => m((s) => {
|
|
2023
2161
|
const { get: n, set: r } = s.makeAccessors(t), o = n();
|
|
2024
2162
|
return r(e), (i) => {
|
|
2025
2163
|
i && r(o);
|
|
2026
2164
|
};
|
|
2027
|
-
}),
|
|
2165
|
+
}), It = (t, e) => m((s) => {
|
|
2028
2166
|
const { get: n, set: r } = s.makeAccessors(t), o = n(), i = e.on(r, { noAutoDispose: !0 });
|
|
2029
2167
|
return (l) => {
|
|
2030
2168
|
i(), l && r(o);
|
|
2031
2169
|
};
|
|
2032
|
-
}), K = (t, e) => y.is(e) ?
|
|
2170
|
+
}), K = (t, e) => y.is(e) ? It(t, e) : kt(t, e), Ht = (t, e) => t === "class" ? y.is(e) ? Ot(e) : Mt(
|
|
2033
2171
|
/* c8 ignore next */
|
|
2034
2172
|
(e ?? "").split(" ").filter((s) => s.length > 0)
|
|
2035
|
-
) : K(t, e),
|
|
2173
|
+
) : K(t, e), T = new Proxy(
|
|
2036
2174
|
{},
|
|
2037
2175
|
{
|
|
2038
2176
|
/**
|
|
@@ -2046,9 +2184,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2046
2184
|
* @returns The renderable component for the specified attribute.
|
|
2047
2185
|
*
|
|
2048
2186
|
*/
|
|
2049
|
-
get: (t, e) => (s) =>
|
|
2187
|
+
get: (t, e) => (s) => Ht(e, s)
|
|
2050
2188
|
}
|
|
2051
|
-
),
|
|
2189
|
+
), $t = (t, e) => K(`data-${t}`, e), Ss = new Proxy(
|
|
2052
2190
|
{},
|
|
2053
2191
|
{
|
|
2054
2192
|
/**
|
|
@@ -2059,9 +2197,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2059
2197
|
* @returns The renderable component for the specified attribute.
|
|
2060
2198
|
*
|
|
2061
2199
|
*/
|
|
2062
|
-
get: (t, e) => (s) =>
|
|
2200
|
+
get: (t, e) => (s) => $t(e, s)
|
|
2063
2201
|
}
|
|
2064
|
-
),
|
|
2202
|
+
), Nt = (t, e) => K(`aria-${t}`, e), vs = new Proxy(
|
|
2065
2203
|
{},
|
|
2066
2204
|
{
|
|
2067
2205
|
/**
|
|
@@ -2072,9 +2210,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2072
2210
|
* @returns The renderable component for the specified attribute.
|
|
2073
2211
|
*
|
|
2074
2212
|
*/
|
|
2075
|
-
get: (t, e) => (s) =>
|
|
2213
|
+
get: (t, e) => (s) => Nt(e, s)
|
|
2076
2214
|
}
|
|
2077
|
-
),
|
|
2215
|
+
), Rt = (t, e) => K(t, e), As = new Proxy(
|
|
2078
2216
|
{},
|
|
2079
2217
|
{
|
|
2080
2218
|
/**
|
|
@@ -2085,9 +2223,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2085
2223
|
* @returns The renderable component for the specified attribute.
|
|
2086
2224
|
*
|
|
2087
2225
|
*/
|
|
2088
|
-
get: (t, e) => (s) =>
|
|
2226
|
+
get: (t, e) => (s) => Rt(e, s)
|
|
2089
2227
|
}
|
|
2090
|
-
),
|
|
2228
|
+
), jt = (t, e) => K(t, e), Ts = new Proxy(
|
|
2091
2229
|
{},
|
|
2092
2230
|
{
|
|
2093
2231
|
/**
|
|
@@ -2097,21 +2235,21 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2097
2235
|
* @returns The renderable component for the specified attribute.
|
|
2098
2236
|
*
|
|
2099
2237
|
*/
|
|
2100
|
-
get: (t, e) => (s) =>
|
|
2238
|
+
get: (t, e) => (s) => jt(e, s)
|
|
2101
2239
|
}
|
|
2102
2240
|
), g = (t) => {
|
|
2103
2241
|
if (t == null)
|
|
2104
|
-
return
|
|
2242
|
+
return L;
|
|
2105
2243
|
if (Array.isArray(t))
|
|
2106
2244
|
return E(...t.map(g));
|
|
2107
2245
|
if (typeof t == "string")
|
|
2108
|
-
return
|
|
2246
|
+
return Ve(t);
|
|
2109
2247
|
if (y.is(t))
|
|
2110
|
-
return
|
|
2248
|
+
return Be(t);
|
|
2111
2249
|
if (typeof t == "object" && "render" in t && "type" in t)
|
|
2112
2250
|
return t;
|
|
2113
2251
|
throw new Error(`Unknown type: '${typeof t}' for child: ${t}`);
|
|
2114
|
-
},
|
|
2252
|
+
}, qe = (t, ...e) => m((s) => {
|
|
2115
2253
|
const n = s.makeChildElement(t, void 0), r = e.map((o) => g(o).render(n));
|
|
2116
2254
|
return (o) => {
|
|
2117
2255
|
r.forEach((i) => i(!1)), n.clear(o);
|
|
@@ -2121,7 +2259,7 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2121
2259
|
return (i) => {
|
|
2122
2260
|
o.forEach((l) => l(!1)), r.clear(i);
|
|
2123
2261
|
};
|
|
2124
|
-
}),
|
|
2262
|
+
}), Vt = new Proxy(
|
|
2125
2263
|
{},
|
|
2126
2264
|
{
|
|
2127
2265
|
/**
|
|
@@ -2129,9 +2267,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2129
2267
|
* @param tagName - The HTML tag name.
|
|
2130
2268
|
* @returns A renderable function that creates and appends the HTML element to the DOM.
|
|
2131
2269
|
*/
|
|
2132
|
-
get: (t, e) => (...s) =>
|
|
2270
|
+
get: (t, e) => (...s) => qe(e, s.flatMap(g))
|
|
2133
2271
|
}
|
|
2134
|
-
),
|
|
2272
|
+
), _s = new Proxy(
|
|
2135
2273
|
{},
|
|
2136
2274
|
{
|
|
2137
2275
|
/**
|
|
@@ -2139,9 +2277,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2139
2277
|
* @param type - The input type name.
|
|
2140
2278
|
* @returns A renderable function that creates and appends the HTMLInput element to the DOM.
|
|
2141
2279
|
*/
|
|
2142
|
-
get: (t, e) => (...s) =>
|
|
2280
|
+
get: (t, e) => (...s) => qe("input", T.type(e), ...s)
|
|
2143
2281
|
}
|
|
2144
|
-
),
|
|
2282
|
+
), Fe = "http://www.w3.org/2000/svg", Es = (t, ...e) => ie(t, Fe, ...e), Cs = new Proxy(
|
|
2145
2283
|
{},
|
|
2146
2284
|
{
|
|
2147
2285
|
/**
|
|
@@ -2149,9 +2287,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2149
2287
|
* @param tagName - The SVG tag name.
|
|
2150
2288
|
* @returns A renderable function that creates and appends the SVG element to the DOM.
|
|
2151
2289
|
*/
|
|
2152
|
-
get: (t, e) => (...s) => ie(e,
|
|
2290
|
+
get: (t, e) => (...s) => ie(e, Fe, s.flatMap(g))
|
|
2153
2291
|
}
|
|
2154
|
-
),
|
|
2292
|
+
), We = "http://www.w3.org/1998/Math/MathML", Ds = (t, ...e) => ie(t, We, ...e), Ls = new Proxy(
|
|
2155
2293
|
{},
|
|
2156
2294
|
{
|
|
2157
2295
|
/**
|
|
@@ -2159,28 +2297,28 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2159
2297
|
* @param tagName - The Math tag name.
|
|
2160
2298
|
* @returns A renderable function that creates and appends the Math element to the DOM.
|
|
2161
2299
|
*/
|
|
2162
|
-
get: (t, e) => (...s) => ie(e,
|
|
2300
|
+
get: (t, e) => (...s) => ie(e, We, s.flatMap(g))
|
|
2163
2301
|
}
|
|
2164
|
-
),
|
|
2302
|
+
), Ue = (t, e) => {
|
|
2165
2303
|
if (typeof e == "function")
|
|
2166
|
-
return
|
|
2167
|
-
const s = e.pending != null ? g(e.pending()) :
|
|
2304
|
+
return Ue(t, { then: e });
|
|
2305
|
+
const s = e.pending != null ? g(e.pending()) : L, n = e.then, r = e.error != null ? (o) => g(e.error(o)) : () => L;
|
|
2168
2306
|
return m((o) => {
|
|
2169
2307
|
let i = !0;
|
|
2170
|
-
const l = t(),
|
|
2171
|
-
let
|
|
2308
|
+
const l = t(), c = o.makeRef();
|
|
2309
|
+
let a = g(s).render(c);
|
|
2172
2310
|
return l.then(
|
|
2173
2311
|
(u) => {
|
|
2174
|
-
i && (
|
|
2312
|
+
i && (a(!0), a = g(n(u)).render(c));
|
|
2175
2313
|
},
|
|
2176
2314
|
(u) => {
|
|
2177
|
-
i && (
|
|
2315
|
+
i && (a(!0), a = g(r(u)).render(c));
|
|
2178
2316
|
}
|
|
2179
2317
|
), (u) => {
|
|
2180
|
-
i = !1,
|
|
2318
|
+
i = !1, a(u), c.clear(u);
|
|
2181
2319
|
};
|
|
2182
2320
|
});
|
|
2183
|
-
},
|
|
2321
|
+
}, xs = (t, e) => Ue(() => t, e), Ge = (t, e, s) => m((n) => n.on(t, e, s)), Bt = (t) => Ge("click", (e, s) => {
|
|
2184
2322
|
e.preventDefault();
|
|
2185
2323
|
const n = e.target;
|
|
2186
2324
|
setTimeout(() => {
|
|
@@ -2195,20 +2333,20 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2195
2333
|
* @param fn - The function to call when the event is triggered.
|
|
2196
2334
|
* @returns A `Renderable` function that adds the event listener to the element.
|
|
2197
2335
|
*/
|
|
2198
|
-
get: (t, e) => (s) =>
|
|
2336
|
+
get: (t, e) => (s) => Ge(e, s)
|
|
2199
2337
|
}
|
|
2200
|
-
),
|
|
2338
|
+
), qt = (t, e) => (s) => {
|
|
2201
2339
|
e?.preventDefault === !0 && s.preventDefault(), e?.stopPropagation === !0 && s.stopPropagation(), e?.stopImmediatePropagation === !0 && s.stopImmediatePropagation(), t(s);
|
|
2202
|
-
},
|
|
2340
|
+
}, k = (t, e) => qt((s) => {
|
|
2203
2341
|
const n = s.target;
|
|
2204
2342
|
t(n, s);
|
|
2205
|
-
}, e),
|
|
2343
|
+
}, e), Ft = (t, e) => k(
|
|
2206
2344
|
(s, n) => t(s.value, n),
|
|
2207
2345
|
e
|
|
2208
|
-
),
|
|
2346
|
+
), Wt = (t, e) => k(
|
|
2209
2347
|
(s, n) => t(s.valueAsNumber, n),
|
|
2210
2348
|
e
|
|
2211
|
-
),
|
|
2349
|
+
), Ut = (t, e) => k((s, n) => {
|
|
2212
2350
|
if (s.value === "")
|
|
2213
2351
|
return;
|
|
2214
2352
|
const r = s.value.split("-"), o = new Date(
|
|
@@ -2217,7 +2355,7 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2217
2355
|
Number(r[2].substring(0, 2))
|
|
2218
2356
|
);
|
|
2219
2357
|
t(o, n);
|
|
2220
|
-
}, e),
|
|
2358
|
+
}, e), Ps = (t, e) => k((s, n) => {
|
|
2221
2359
|
if (s.value === "") {
|
|
2222
2360
|
t(null, n);
|
|
2223
2361
|
return;
|
|
@@ -2228,7 +2366,7 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2228
2366
|
Number(r[2].substring(0, 2))
|
|
2229
2367
|
);
|
|
2230
2368
|
t(o, n);
|
|
2231
|
-
}, e),
|
|
2369
|
+
}, e), Gt = (t, e) => k((s, n) => {
|
|
2232
2370
|
if (s.value === "")
|
|
2233
2371
|
return;
|
|
2234
2372
|
const r = s.value.split("T"), o = r[0].split("-"), i = new Date(
|
|
@@ -2237,7 +2375,7 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2237
2375
|
Number(o[2])
|
|
2238
2376
|
), l = r[1].split(":");
|
|
2239
2377
|
i.setHours(Number(l[0])), i.setMinutes(Number(l[1])), i.setSeconds(Number(l[2])), t(i, n);
|
|
2240
|
-
}, e),
|
|
2378
|
+
}, e), Ms = (t, e) => k((s, n) => {
|
|
2241
2379
|
if (s.value === "") {
|
|
2242
2380
|
t(null, n);
|
|
2243
2381
|
return;
|
|
@@ -2253,15 +2391,15 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2253
2391
|
Number(o[2])
|
|
2254
2392
|
), l = r[1].split(":");
|
|
2255
2393
|
i.setHours(Number(l[0] ?? 0)), i.setMinutes(Number(l[1] ?? 0)), i.setSeconds(Number(l[2] ?? 0)), t(i, n);
|
|
2256
|
-
}, e),
|
|
2394
|
+
}, e), Os = (t, e) => k((s, n) => {
|
|
2257
2395
|
t(s.checked, n);
|
|
2258
|
-
}, e),
|
|
2396
|
+
}, e), ks = (t, e = "input") => E(T.valueAsDate(t), Y[e](Ut(t.set))), Is = (t, e = "input") => E(T.valueAsDate(t), Y[e](Gt(t.set))), Hs = (t, e = "input") => E(T.valueAsNumber(t), Y[e](Wt(t.set))), $s = (t, e = "input") => E(T.value(t), Y[e](Ft(t.set))), Ns = (t) => E(T.checked(t), Bt(t.set)), ge = (t, e, s) => y.is(t) ? e(t) : s(t), Jt = (t, e, s) => {
|
|
2259
2397
|
const n = t.makeRef();
|
|
2260
2398
|
let r = () => {
|
|
2261
2399
|
}, o = null;
|
|
2262
2400
|
const i = e.on(
|
|
2263
2401
|
(l) => {
|
|
2264
|
-
o?.dispose(), r(!0), o = new
|
|
2402
|
+
o?.dispose(), r(!0), o = new J(), r = O(
|
|
2265
2403
|
o,
|
|
2266
2404
|
() => g(s(l)).render(n)
|
|
2267
2405
|
);
|
|
@@ -2275,18 +2413,18 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2275
2413
|
function s(r) {
|
|
2276
2414
|
return m((o) => {
|
|
2277
2415
|
const i = o.makeRef();
|
|
2278
|
-
let l,
|
|
2279
|
-
const
|
|
2416
|
+
let l, c;
|
|
2417
|
+
const a = r.map((f) => Object.keys(f)[0]);
|
|
2280
2418
|
let u;
|
|
2281
|
-
const d =
|
|
2419
|
+
const d = a.on((f) => {
|
|
2282
2420
|
if (f !== u) {
|
|
2283
|
-
u = f,
|
|
2284
|
-
const h = e[f](
|
|
2421
|
+
u = f, c?.dispose(), l?.(!0), c = r.map((p) => p[f]);
|
|
2422
|
+
const h = e[f](c);
|
|
2285
2423
|
l = g(h).render(i);
|
|
2286
2424
|
}
|
|
2287
2425
|
});
|
|
2288
2426
|
return (f) => {
|
|
2289
|
-
|
|
2427
|
+
c?.dispose(), d(), i.clear(f), l?.(f);
|
|
2290
2428
|
};
|
|
2291
2429
|
});
|
|
2292
2430
|
}
|
|
@@ -2295,21 +2433,21 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2295
2433
|
return g(e[o](re(r[o])));
|
|
2296
2434
|
}
|
|
2297
2435
|
return ge(t, s, n);
|
|
2298
|
-
},
|
|
2436
|
+
}, Je = (t, e, s) => le(
|
|
2299
2437
|
w.map(t, (n) => ({ [n[e]]: n })),
|
|
2300
2438
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2301
2439
|
s
|
|
2302
|
-
),
|
|
2440
|
+
), Rs = (t, e) => Je(t, "kind", e), js = (t, e) => {
|
|
2303
2441
|
const s = w.map(t, ([n, r]) => ({
|
|
2304
2442
|
[n]: r
|
|
2305
2443
|
}));
|
|
2306
2444
|
return le(s, e);
|
|
2307
|
-
},
|
|
2445
|
+
}, Vs = (t, e) => Je(t, "type", e), zt = (t, e) => le(
|
|
2308
2446
|
w.map(t, (s) => ({ [s]: !0 })),
|
|
2309
2447
|
e
|
|
2310
|
-
),
|
|
2448
|
+
), Bs = (t, e = {}) => (s) => {
|
|
2311
2449
|
const n = e?.firstSeparator ?? t, r = e?.lastSeparator ?? t;
|
|
2312
|
-
return
|
|
2450
|
+
return zt(
|
|
2313
2451
|
s.map((o) => o.isFirst ? "first" : o.isLast ? "last" : "other"),
|
|
2314
2452
|
{
|
|
2315
2453
|
first: n,
|
|
@@ -2317,28 +2455,28 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2317
2455
|
other: t
|
|
2318
2456
|
}
|
|
2319
2457
|
);
|
|
2320
|
-
},
|
|
2458
|
+
}, qs = (t) => m((e) => (e.appendOrInsert(t), (s) => {
|
|
2321
2459
|
s && te(t);
|
|
2322
|
-
})),
|
|
2460
|
+
})), Fs = (t, e, s) => {
|
|
2323
2461
|
function n(o) {
|
|
2324
2462
|
return m((i) => {
|
|
2325
2463
|
const l = i.makeRef();
|
|
2326
|
-
let
|
|
2327
|
-
},
|
|
2464
|
+
let c = () => {
|
|
2465
|
+
}, a = !1, u = null;
|
|
2328
2466
|
const d = o.on((f) => {
|
|
2329
|
-
f == null ? (
|
|
2467
|
+
f == null ? (c(!0), c = g(s?.()).render(l), a = !1, u?.dispose(), u = null) : a ? u.set(f) : (u = D(f), c(!0), c = g(
|
|
2330
2468
|
e(u)
|
|
2331
|
-
).render(l),
|
|
2469
|
+
).render(l), a = !0);
|
|
2332
2470
|
});
|
|
2333
2471
|
return (f) => {
|
|
2334
|
-
u?.dispose(), d(),
|
|
2472
|
+
u?.dispose(), d(), c?.(f), l.clear(f);
|
|
2335
2473
|
};
|
|
2336
2474
|
});
|
|
2337
2475
|
}
|
|
2338
2476
|
function r(o) {
|
|
2339
2477
|
if (o == null) {
|
|
2340
2478
|
const i = s?.();
|
|
2341
|
-
return i != null ? g(i) :
|
|
2479
|
+
return i != null ? g(i) : L;
|
|
2342
2480
|
}
|
|
2343
2481
|
return g(e(re(o)));
|
|
2344
2482
|
}
|
|
@@ -2347,21 +2485,21 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2347
2485
|
n,
|
|
2348
2486
|
r
|
|
2349
2487
|
);
|
|
2350
|
-
},
|
|
2488
|
+
}, Ws = (...t) => (e, s) => m((n) => {
|
|
2351
2489
|
const r = n.makeRef();
|
|
2352
2490
|
if (t.some(
|
|
2353
2491
|
(h) => !y.is(h) && h == null
|
|
2354
2492
|
))
|
|
2355
|
-
return (s != null ? g(s?.()) :
|
|
2493
|
+
return (s != null ? g(s?.()) : L).render(r);
|
|
2356
2494
|
const i = t.map(() => null), l = t.map(
|
|
2357
2495
|
(h) => y.is(h) ? h.value != null : h != null
|
|
2358
2496
|
);
|
|
2359
|
-
let
|
|
2360
|
-
const
|
|
2497
|
+
let c = null;
|
|
2498
|
+
const a = D(l.every((h) => h)), u = (h, p) => {
|
|
2361
2499
|
if (h.value != null) {
|
|
2362
2500
|
if (i[p] == null) {
|
|
2363
|
-
const
|
|
2364
|
-
i[p] =
|
|
2501
|
+
const b = D(h.value);
|
|
2502
|
+
i[p] = b;
|
|
2365
2503
|
} else
|
|
2366
2504
|
i[p].value = h.value;
|
|
2367
2505
|
l[p] = !0;
|
|
@@ -2371,23 +2509,23 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2371
2509
|
let d = t.length - 1;
|
|
2372
2510
|
const f = t.map((h, p) => {
|
|
2373
2511
|
if (!y.is(h)) {
|
|
2374
|
-
const
|
|
2375
|
-
return i[p] =
|
|
2512
|
+
const b = D(h);
|
|
2513
|
+
return i[p] = b, () => {
|
|
2376
2514
|
};
|
|
2377
2515
|
}
|
|
2378
2516
|
return h.on(() => {
|
|
2379
|
-
u(h, p), d === 0 ?
|
|
2517
|
+
u(h, p), d === 0 ? a.value = l.every((b) => b) : d--;
|
|
2380
2518
|
});
|
|
2381
2519
|
});
|
|
2382
|
-
return
|
|
2383
|
-
|
|
2520
|
+
return a.on((h) => {
|
|
2521
|
+
c?.(!0), c = null, h ? c = g(e(...i)).render(r) : c = g(s?.() ?? L).render(r);
|
|
2384
2522
|
}), (h) => {
|
|
2385
|
-
i.forEach((p) => p?.dispose()),
|
|
2523
|
+
i.forEach((p) => p?.dispose()), a.dispose(), f.forEach((p) => p()), c?.(h), r.clear(h);
|
|
2386
2524
|
};
|
|
2387
|
-
}),
|
|
2525
|
+
}), ze = (t, e, s) => ge(
|
|
2388
2526
|
t,
|
|
2389
2527
|
(n) => m(
|
|
2390
|
-
(r) =>
|
|
2528
|
+
(r) => Jt(
|
|
2391
2529
|
r,
|
|
2392
2530
|
n,
|
|
2393
2531
|
(o) => o ? e() : s?.()
|
|
@@ -2396,26 +2534,26 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2396
2534
|
(n) => {
|
|
2397
2535
|
if (n) {
|
|
2398
2536
|
const r = e();
|
|
2399
|
-
return r != null ? g(r) :
|
|
2537
|
+
return r != null ? g(r) : L;
|
|
2400
2538
|
}
|
|
2401
2539
|
return g(s?.());
|
|
2402
2540
|
}
|
|
2403
|
-
),
|
|
2541
|
+
), Us = (t, e, s) => ze(
|
|
2404
2542
|
w.map(t, (n) => !n),
|
|
2405
2543
|
e,
|
|
2406
2544
|
s
|
|
2407
|
-
),
|
|
2545
|
+
), Ke = (t, e, s) => {
|
|
2408
2546
|
if (s != null)
|
|
2409
|
-
return
|
|
2547
|
+
return Ke(t, (n) => {
|
|
2410
2548
|
const r = new de(
|
|
2411
2549
|
n.index,
|
|
2412
2550
|
n.total.map((o) => o - 1)
|
|
2413
2551
|
);
|
|
2414
2552
|
return E(
|
|
2415
2553
|
g(e(n)),
|
|
2416
|
-
|
|
2554
|
+
ze(
|
|
2417
2555
|
n.isLast,
|
|
2418
|
-
() =>
|
|
2556
|
+
() => L,
|
|
2419
2557
|
() => s(r)
|
|
2420
2558
|
)
|
|
2421
2559
|
);
|
|
@@ -2423,28 +2561,28 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2423
2561
|
if (y.is(t))
|
|
2424
2562
|
return m((n) => {
|
|
2425
2563
|
const r = t.derive(), o = n.makeRef(), i = [], l = [];
|
|
2426
|
-
return r.on((
|
|
2427
|
-
const
|
|
2564
|
+
return r.on((c) => {
|
|
2565
|
+
const a = i.splice(c), u = l.splice(c);
|
|
2428
2566
|
for (const d of u)
|
|
2429
2567
|
d.dispose();
|
|
2430
|
-
for (const d of
|
|
2568
|
+
for (const d of a)
|
|
2431
2569
|
d(!0);
|
|
2432
|
-
for (let d = i.length; d <
|
|
2433
|
-
const f = new de(d, r), h = new
|
|
2570
|
+
for (let d = i.length; d < c; d++) {
|
|
2571
|
+
const f = new de(d, r), h = new J();
|
|
2434
2572
|
l.push(h), i.push(
|
|
2435
|
-
|
|
2573
|
+
O(
|
|
2436
2574
|
h,
|
|
2437
2575
|
() => g(e(f)).render(o)
|
|
2438
2576
|
)
|
|
2439
2577
|
);
|
|
2440
2578
|
}
|
|
2441
|
-
}), (
|
|
2442
|
-
for (const
|
|
2443
|
-
|
|
2579
|
+
}), (c) => {
|
|
2580
|
+
for (const a of l)
|
|
2581
|
+
a.dispose();
|
|
2444
2582
|
l.length = 0, r.dispose();
|
|
2445
|
-
for (const
|
|
2446
|
-
c
|
|
2447
|
-
i.length = 0, o.clear(
|
|
2583
|
+
for (const a of i)
|
|
2584
|
+
a(c);
|
|
2585
|
+
i.length = 0, o.clear(c);
|
|
2448
2586
|
};
|
|
2449
2587
|
});
|
|
2450
2588
|
{
|
|
@@ -2456,9 +2594,9 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2456
2594
|
})
|
|
2457
2595
|
);
|
|
2458
2596
|
}
|
|
2459
|
-
},
|
|
2597
|
+
}, Gs = (t, e, s) => {
|
|
2460
2598
|
const n = w.map(t, (o) => o.length), r = w.toSignal(t);
|
|
2461
|
-
return
|
|
2599
|
+
return Ke(
|
|
2462
2600
|
n,
|
|
2463
2601
|
(o) => {
|
|
2464
2602
|
const i = r.map((l) => l[o.index]);
|
|
@@ -2470,7 +2608,7 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2470
2608
|
(e) => (s) => t.forEach((n) => {
|
|
2471
2609
|
typeof n == "function" ? n(s, e) : n.dispose(s, e);
|
|
2472
2610
|
})
|
|
2473
|
-
),
|
|
2611
|
+
), Js = (t, e) => {
|
|
2474
2612
|
if (y.is(t)) {
|
|
2475
2613
|
const s = t;
|
|
2476
2614
|
return m((n) => {
|
|
@@ -2496,7 +2634,7 @@ const Ct = /* @__PURE__ */ new Set([
|
|
|
2496
2634
|
return () => {
|
|
2497
2635
|
};
|
|
2498
2636
|
});
|
|
2499
|
-
function
|
|
2637
|
+
function zs({
|
|
2500
2638
|
src: t,
|
|
2501
2639
|
name: e,
|
|
2502
2640
|
width: s,
|
|
@@ -2505,41 +2643,41 @@ function Us({
|
|
|
2505
2643
|
allow: o,
|
|
2506
2644
|
referrerpolicy: i,
|
|
2507
2645
|
loading: l,
|
|
2508
|
-
iframeChild:
|
|
2509
|
-
onLoad:
|
|
2646
|
+
iframeChild: c,
|
|
2647
|
+
onLoad: a
|
|
2510
2648
|
} = {}, ...u) {
|
|
2511
|
-
return
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2649
|
+
return Vt.iframe(
|
|
2650
|
+
T.src(t),
|
|
2651
|
+
T.name(e),
|
|
2652
|
+
T.width(
|
|
2515
2653
|
s != null ? w.map(s, String) : void 0
|
|
2516
2654
|
),
|
|
2517
|
-
|
|
2655
|
+
T.height(
|
|
2518
2656
|
n != null ? w.map(n, String) : void 0
|
|
2519
2657
|
),
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2658
|
+
T.sandbox(r),
|
|
2659
|
+
T.allow(o),
|
|
2660
|
+
T.referrerpolicy(i),
|
|
2661
|
+
c,
|
|
2524
2662
|
ye((d) => {
|
|
2525
2663
|
const f = d.element;
|
|
2526
2664
|
let h, p = !1;
|
|
2527
|
-
const
|
|
2665
|
+
const b = () => {
|
|
2528
2666
|
if (p) return;
|
|
2529
2667
|
p = !0;
|
|
2530
|
-
const
|
|
2531
|
-
if (
|
|
2532
|
-
const
|
|
2533
|
-
if (
|
|
2534
|
-
const
|
|
2535
|
-
h =
|
|
2668
|
+
const v = f.contentDocument;
|
|
2669
|
+
if (v && (a && a(f), u.length > 0)) {
|
|
2670
|
+
const S = v.body;
|
|
2671
|
+
if (S) {
|
|
2672
|
+
const x = d.withElement(S);
|
|
2673
|
+
h = z(E(...u), x);
|
|
2536
2674
|
}
|
|
2537
2675
|
}
|
|
2538
2676
|
};
|
|
2539
|
-
return l != null && w.on(l, (
|
|
2540
|
-
f.loading =
|
|
2541
|
-
}), (u.length > 0 ||
|
|
2542
|
-
u.length > 0 ||
|
|
2677
|
+
return l != null && w.on(l, (v) => {
|
|
2678
|
+
f.loading = v;
|
|
2679
|
+
}), (u.length > 0 || a) && (t || setTimeout(b, 0)), E(
|
|
2680
|
+
u.length > 0 || a ? Y.load(b) : L,
|
|
2543
2681
|
me(() => {
|
|
2544
2682
|
h && h(!1);
|
|
2545
2683
|
})
|
|
@@ -2547,7 +2685,7 @@ function Us({
|
|
|
2547
2685
|
})
|
|
2548
2686
|
);
|
|
2549
2687
|
}
|
|
2550
|
-
const
|
|
2688
|
+
const Ks = (t, e, s = () => L) => le(
|
|
2551
2689
|
w.map(
|
|
2552
2690
|
t,
|
|
2553
2691
|
(n) => n.length > 0 ? { notEmpty: n } : { whenEmpty: null }
|
|
@@ -2556,11 +2694,11 @@ const Js = (t, e, s = () => x) => le(
|
|
|
2556
2694
|
notEmpty: (n) => e(n),
|
|
2557
2695
|
whenEmpty: () => s()
|
|
2558
2696
|
}
|
|
2559
|
-
),
|
|
2560
|
-
const n = s.makePortal(t), r =
|
|
2697
|
+
), Ys = (t, e) => m((s) => {
|
|
2698
|
+
const n = s.makePortal(t), r = z(g(e), n);
|
|
2561
2699
|
return () => r(!0);
|
|
2562
|
-
}), ee = /* @__PURE__ */ new Map(),
|
|
2563
|
-
mark:
|
|
2700
|
+
}), ee = /* @__PURE__ */ new Map(), Kt = (t) => ({
|
|
2701
|
+
mark: Ye(`Probe(${t.description})`),
|
|
2564
2702
|
create: ({ callback: e = () => {
|
|
2565
2703
|
}, timeout: s = 10 } = {}) => {
|
|
2566
2704
|
const n = (l) => {
|
|
@@ -2579,8 +2717,8 @@ const Js = (t, e, s = () => x) => le(
|
|
|
2579
2717
|
onUse: () => o.counter++
|
|
2580
2718
|
};
|
|
2581
2719
|
}
|
|
2582
|
-
}),
|
|
2583
|
-
function
|
|
2720
|
+
}), Xs = Kt(Symbol("GlobalProbe"));
|
|
2721
|
+
function Qs({
|
|
2584
2722
|
mode: t,
|
|
2585
2723
|
delegatesFocus: e,
|
|
2586
2724
|
slotAssignment: s,
|
|
@@ -2590,21 +2728,21 @@ function Ks({
|
|
|
2590
2728
|
return ye((i) => {
|
|
2591
2729
|
const l = { mode: t };
|
|
2592
2730
|
e !== void 0 && (l.delegatesFocus = e), s !== void 0 && (l.slotAssignment = s), n !== void 0 && (l.clonable = n), r !== void 0 && (l.serializable = r);
|
|
2593
|
-
const
|
|
2731
|
+
const c = i.element.attachShadow(l), a = i.withElement(c), u = z(E(...o), a);
|
|
2594
2732
|
return me(() => u(!0));
|
|
2595
2733
|
});
|
|
2596
2734
|
}
|
|
2597
|
-
const
|
|
2735
|
+
const Yt = (t, e) => m((s) => {
|
|
2598
2736
|
const n = s.getStyle(t);
|
|
2599
2737
|
return s.setStyle(t, e), (r) => {
|
|
2600
2738
|
r && s.setStyle(t, n);
|
|
2601
2739
|
};
|
|
2602
|
-
}),
|
|
2740
|
+
}), Xt = (t, e) => m((s) => {
|
|
2603
2741
|
const n = s.getStyle(t), r = e.on((o) => s.setStyle(t, o));
|
|
2604
2742
|
return (o) => {
|
|
2605
2743
|
r(), o && s.setStyle(t, n);
|
|
2606
2744
|
};
|
|
2607
|
-
}),
|
|
2745
|
+
}), Ae = (t, e) => y.is(e) ? Xt(t, e) : Yt(t, e), Zs = new Proxy({}, {
|
|
2608
2746
|
/**
|
|
2609
2747
|
* Creates a renderable component for the specified `style` property.
|
|
2610
2748
|
*
|
|
@@ -2613,12 +2751,12 @@ const Gt = (t, e) => m((s) => {
|
|
|
2613
2751
|
* @returns The renderable component for the specified attribute.
|
|
2614
2752
|
*
|
|
2615
2753
|
*/
|
|
2616
|
-
get: (t, e) => e === "variable" ? (s, n) =>
|
|
2617
|
-
}),
|
|
2754
|
+
get: (t, e) => e === "variable" ? (s, n) => Ae(s, n) : (s) => Ae(e, s)
|
|
2755
|
+
}), en = (t) => m((e) => {
|
|
2618
2756
|
const s = t(e);
|
|
2619
2757
|
return s == null ? () => {
|
|
2620
2758
|
} : g(s).render(e);
|
|
2621
|
-
}),
|
|
2759
|
+
}), tn = (t) => ye((e) => t(e.element)), sn = (t) => m((e) => {
|
|
2622
2760
|
if (e.isHeadlessDOM()) {
|
|
2623
2761
|
const s = t(e);
|
|
2624
2762
|
if (s)
|
|
@@ -2626,8 +2764,8 @@ const Gt = (t, e) => m((s) => {
|
|
|
2626
2764
|
}
|
|
2627
2765
|
return () => {
|
|
2628
2766
|
};
|
|
2629
|
-
}),
|
|
2630
|
-
const s = new
|
|
2767
|
+
}), nn = (t) => m((e) => {
|
|
2768
|
+
const s = new J(), n = O(
|
|
2631
2769
|
s,
|
|
2632
2770
|
() => g(t(s)).render(e)
|
|
2633
2771
|
);
|
|
@@ -2644,11 +2782,11 @@ const Gt = (t, e) => m((s) => {
|
|
|
2644
2782
|
}
|
|
2645
2783
|
const o = [], i = t({
|
|
2646
2784
|
use: ({ mark: l }) => {
|
|
2647
|
-
const { value:
|
|
2648
|
-
return
|
|
2785
|
+
const { value: c, onUse: a } = n().getProvider(l);
|
|
2786
|
+
return a?.(), c;
|
|
2649
2787
|
},
|
|
2650
|
-
set: ({ mark: l, create:
|
|
2651
|
-
const { value: u, dispose: d, onUse: f } = a
|
|
2788
|
+
set: ({ mark: l, create: c }, a) => {
|
|
2789
|
+
const { value: u, dispose: d, onUse: f } = c(a, n());
|
|
2652
2790
|
o.push(d), r(n().setProvider(l, u, f));
|
|
2653
2791
|
}
|
|
2654
2792
|
});
|
|
@@ -2657,147 +2795,149 @@ const Gt = (t, e) => m((s) => {
|
|
|
2657
2795
|
g(i),
|
|
2658
2796
|
me(() => o.forEach((l) => l()))
|
|
2659
2797
|
).render(n());
|
|
2660
|
-
}),
|
|
2798
|
+
}), rn = (t, e, s) => we(({ set: n }) => (n(t, e), s())), on = (t, e) => we(({ use: s }) => e(s(t))), ln = (...t) => (e) => we(({ use: s }) => {
|
|
2661
2799
|
const n = t.map(s);
|
|
2662
2800
|
return e(...n);
|
|
2663
2801
|
});
|
|
2664
2802
|
export {
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2803
|
+
Nt as Aria,
|
|
2804
|
+
xs as Async,
|
|
2805
|
+
Ht as Attr,
|
|
2806
|
+
Ns as BindChecked,
|
|
2807
|
+
ks as BindDate,
|
|
2808
|
+
Is as BindDateTime,
|
|
2809
|
+
Hs as BindNumber,
|
|
2810
|
+
$s as BindText,
|
|
2673
2811
|
j as BrowserContext,
|
|
2674
|
-
|
|
2812
|
+
q as CLASS_PLACEHOLDER_ATTR,
|
|
2675
2813
|
R as Computed,
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2814
|
+
Bs as Conjunction,
|
|
2815
|
+
qs as DOMNode,
|
|
2816
|
+
$t as DataAttr,
|
|
2817
|
+
J as DisposalScope,
|
|
2818
|
+
qe as El,
|
|
2681
2819
|
ie as ElNS,
|
|
2682
2820
|
de as ElementPosition,
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2821
|
+
L as Empty,
|
|
2822
|
+
Fs as Ensure,
|
|
2823
|
+
Ws as EnsureAll,
|
|
2824
|
+
Gs as ForEach,
|
|
2687
2825
|
E as Fragment,
|
|
2688
|
-
|
|
2689
|
-
|
|
2826
|
+
Xs as GlobalProbe,
|
|
2827
|
+
Tt as HYDRATION_ID_ATTR,
|
|
2828
|
+
ms as HeadlessAdapter,
|
|
2690
2829
|
V as HeadlessContext,
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2830
|
+
Dt as HeadlessElement,
|
|
2831
|
+
je as HeadlessPortal,
|
|
2832
|
+
Lt as HeadlessText,
|
|
2833
|
+
zs as IFrame,
|
|
2834
|
+
Js as MapSignal,
|
|
2835
|
+
jt as MathAttr,
|
|
2836
|
+
Ds as MathEl,
|
|
2837
|
+
Ee as MemoryStore,
|
|
2838
|
+
Ks as NotEmpty,
|
|
2839
|
+
Bt as OnChecked,
|
|
2701
2840
|
me as OnDispose,
|
|
2702
2841
|
le as OneOf,
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2842
|
+
Je as OneOfField,
|
|
2843
|
+
Rs as OneOfKind,
|
|
2844
|
+
js as OneOfTuple,
|
|
2845
|
+
Vs as OneOfType,
|
|
2846
|
+
zt as OneOfValue,
|
|
2847
|
+
Ys as Portal,
|
|
2709
2848
|
se as Prop,
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2849
|
+
rn as Provide,
|
|
2850
|
+
He as ProviderNotFoundError,
|
|
2851
|
+
yt as RenderingError,
|
|
2852
|
+
Ke as Repeat,
|
|
2853
|
+
Rt as SVGAttr,
|
|
2854
|
+
Es as SVGEl,
|
|
2855
|
+
Qs as ShadowRoot,
|
|
2717
2856
|
y as Signal,
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2857
|
+
Ue as Task,
|
|
2858
|
+
bs as TextNode,
|
|
2859
|
+
Us as Unless,
|
|
2860
|
+
on as Use,
|
|
2861
|
+
ln as UseMany,
|
|
2723
2862
|
w as Value,
|
|
2724
|
-
|
|
2863
|
+
ze as When,
|
|
2725
2864
|
ye as WithBrowserCtx,
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2865
|
+
en as WithCtx,
|
|
2866
|
+
tn as WithElement,
|
|
2867
|
+
sn as WithHeadlessCtx,
|
|
2729
2868
|
we as WithProvider,
|
|
2730
|
-
|
|
2869
|
+
nn as WithScope,
|
|
2731
2870
|
fe as _NODE_PLACEHOLDER_ATTR,
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2871
|
+
mt as _getSelfOrParentElement,
|
|
2872
|
+
ke as _isElement,
|
|
2873
|
+
Ie as _isFragment,
|
|
2874
|
+
gt as _makeGetter,
|
|
2875
|
+
pt as _makeSetter,
|
|
2737
2876
|
te as _removeDOMNode,
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2877
|
+
Be as _signalText,
|
|
2878
|
+
Ve as _staticText,
|
|
2879
|
+
is as animateSignal,
|
|
2880
|
+
dt as animateSignals,
|
|
2881
|
+
vs as aria,
|
|
2882
|
+
T as attr,
|
|
2883
|
+
hs as bind,
|
|
2884
|
+
ds as coalesce,
|
|
2746
2885
|
ne as computed,
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
Ft as
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2886
|
+
B as computedOf,
|
|
2887
|
+
Qt as computedOfAsync,
|
|
2888
|
+
Zt as computedOfAsyncGenerator,
|
|
2889
|
+
ft as computedRecord,
|
|
2890
|
+
Xe as createRenderable,
|
|
2891
|
+
Ss as dataAttr,
|
|
2892
|
+
as as delaySignal,
|
|
2893
|
+
_e as effect,
|
|
2894
|
+
tt as effectOf,
|
|
2895
|
+
qt as emit,
|
|
2896
|
+
Os as emitChecked,
|
|
2897
|
+
k as emitTarget,
|
|
2898
|
+
Ft as emitValue,
|
|
2899
|
+
Ut as emitValueAsDate,
|
|
2900
|
+
Gt as emitValueAsDateTime,
|
|
2901
|
+
Ps as emitValueAsNullableDate,
|
|
2902
|
+
Ms as emitValueAsNullableDateTime,
|
|
2903
|
+
Wt as emitValueAsNumber,
|
|
2904
|
+
at as endInterpolate,
|
|
2765
2905
|
pe as getCurrentScope,
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2906
|
+
ss as getParentScope,
|
|
2907
|
+
ts as getScopeStack,
|
|
2908
|
+
ws as getWindow,
|
|
2909
|
+
ct as guessInterpolate,
|
|
2910
|
+
Vt as html,
|
|
2911
|
+
_s as input,
|
|
2912
|
+
lt as interpolateDate,
|
|
2913
|
+
ot as interpolateNumber,
|
|
2914
|
+
it as interpolateString,
|
|
2915
|
+
es as joinSignals,
|
|
2916
|
+
rs as localStorageProp,
|
|
2917
|
+
Kt as makeProbe,
|
|
2918
|
+
Ye as makeProviderMark,
|
|
2919
|
+
Ls as math,
|
|
2920
|
+
Ts as mathAttr,
|
|
2921
|
+
ls as merge,
|
|
2782
2922
|
Y as on,
|
|
2783
|
-
|
|
2784
|
-
|
|
2923
|
+
nt as popScope,
|
|
2924
|
+
cs as previousSignal,
|
|
2785
2925
|
D as prop,
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2926
|
+
st as pushScope,
|
|
2927
|
+
ps as render,
|
|
2928
|
+
z as renderWithContext,
|
|
2789
2929
|
g as renderableOfTNode,
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2930
|
+
ys as restoreTempoPlaceholders,
|
|
2931
|
+
gs as runHeadless,
|
|
2932
|
+
ns as scoped,
|
|
2933
|
+
os as sessionStorageProp,
|
|
2794
2934
|
re as signal,
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2935
|
+
us as slidingWindowSignal,
|
|
2936
|
+
Ce as storedProp,
|
|
2937
|
+
Zs as style,
|
|
2938
|
+
Cs as svg,
|
|
2939
|
+
As as svgAttr,
|
|
2940
|
+
fs as syncProp,
|
|
2801
2941
|
ce as untracked,
|
|
2802
|
-
|
|
2942
|
+
O as withScope
|
|
2803
2943
|
};
|