@tempots/ui 5.0.0 → 5.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/index.cjs +1 -1
- package/index.d.ts +4 -0
- package/index.js +616 -566
- package/package.json +1 -1
- package/renderables/onclickoutside.d.ts +8 -0
- package/renderables/onenterkey.d.ts +1 -0
- package/renderables/onescapekey.d.ts +1 -0
- package/renderables/onkeypressed.d.ts +23 -0
package/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { getWindow as
|
|
5
|
-
import { delayed as
|
|
6
|
-
const
|
|
1
|
+
var be = Object.defineProperty;
|
|
2
|
+
var Ae = (t, e, o) => e in t ? be(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
|
|
3
|
+
var At = (t, e, o) => Ae(t, typeof e != "symbol" ? e + "" : e, o);
|
|
4
|
+
import { getWindow as ct, prop as H, makeProviderMark as Xt, Signal as Jt, Use as Gt, html as Rt, on as Qt, Value as E, attr as Zt, Empty as Et, OneOfType as te, WithElement as $, OnDispose as F, Portal as ee, Fragment as st, renderableOfTNode as Dt, When as ne, effectOf as Oe, computedOf as oe, WithBrowserCtx as Re, OneOfTuple as Ee, Prop as Le } from "@tempots/dom";
|
|
5
|
+
import { delayed as se, AsyncResult as U, nearEqual as ft, interval as Se } from "@tempots/std";
|
|
6
|
+
const Te = (t) => {
|
|
7
7
|
const e = t.split("/").pop();
|
|
8
8
|
if (e == null || e.startsWith(".")) return;
|
|
9
9
|
const o = e.split(".") || [];
|
|
10
10
|
return o.length > 1 ? "." + o.pop() : void 0;
|
|
11
|
-
},
|
|
12
|
-
const o =
|
|
11
|
+
}, Pe = (t, e) => {
|
|
12
|
+
const o = Te(e);
|
|
13
13
|
return o != null && (t.length === 0 || !t.some((n) => o == n));
|
|
14
|
-
},
|
|
14
|
+
}, ke = (t, e, o, n) => {
|
|
15
15
|
let s = t.target;
|
|
16
16
|
for (; s != null && !(s instanceof HTMLAnchorElement); )
|
|
17
17
|
s = s.parentElement;
|
|
18
18
|
if (s == null)
|
|
19
19
|
return !0;
|
|
20
|
-
const
|
|
21
|
-
if (t.button !== 0 || t.ctrlKey || t.metaKey ||
|
|
20
|
+
const r = s;
|
|
21
|
+
if (t.button !== 0 || t.ctrlKey || t.metaKey || r.target !== "_self" && r.target !== "" || r.getAttribute("download") != null)
|
|
22
22
|
return !0;
|
|
23
|
-
const { pathname:
|
|
23
|
+
const { pathname: i, search: c, hash: l } = r;
|
|
24
24
|
if (n) {
|
|
25
|
-
const a =
|
|
25
|
+
const a = i + c + l, h = r.getAttribute("href");
|
|
26
26
|
if (!(h != null && h.startsWith("#")) && h !== a)
|
|
27
27
|
return !0;
|
|
28
28
|
}
|
|
29
|
-
return e ? !1 :
|
|
30
|
-
},
|
|
29
|
+
return e ? !1 : Pe(o, i);
|
|
30
|
+
}, De = (t, e = {
|
|
31
31
|
ignoreUrlWithExtension: !0,
|
|
32
32
|
allowedExtensions: [],
|
|
33
33
|
ignoreExternalUrl: !0
|
|
@@ -36,41 +36,41 @@ const Ee = (t) => {
|
|
|
36
36
|
(n) => n.startsWith(".") ? n : "." + n
|
|
37
37
|
) : [];
|
|
38
38
|
return (n) => {
|
|
39
|
-
|
|
39
|
+
ke(
|
|
40
40
|
n,
|
|
41
41
|
e.ignoreUrlWithExtension ?? !0,
|
|
42
42
|
o,
|
|
43
43
|
e.ignoreExternalUrl ?? !0
|
|
44
44
|
) || t() && n.preventDefault();
|
|
45
45
|
};
|
|
46
|
-
},
|
|
47
|
-
var
|
|
48
|
-
const o = new URL(t, e ?? ((
|
|
46
|
+
}, Ce = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, re = (t, e) => {
|
|
47
|
+
var r;
|
|
48
|
+
const o = new URL(t, e ?? ((r = ct()) == null ? void 0 : r.location.toString())), n = Object.fromEntries(o.searchParams.entries());
|
|
49
49
|
let s = o.hash;
|
|
50
50
|
return s.startsWith("#") && (s = s.substring(1)), {
|
|
51
51
|
pathname: o.pathname,
|
|
52
52
|
search: n,
|
|
53
53
|
hash: s === "" ? void 0 : s
|
|
54
54
|
};
|
|
55
|
-
},
|
|
56
|
-
const o =
|
|
55
|
+
}, $t = (t, e) => {
|
|
56
|
+
const o = re(e);
|
|
57
57
|
return t.set(o), t;
|
|
58
|
-
},
|
|
58
|
+
}, Lt = (t) => {
|
|
59
59
|
const o = new URLSearchParams(t.search).toString(), n = t.hash;
|
|
60
60
|
return `${t.pathname}${o ? `?${o}` : ""}${n ? `#${n}` : ""}`;
|
|
61
|
-
},
|
|
61
|
+
}, We = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), Fe = (t) => {
|
|
62
62
|
const e = t.container.currentURL, o = e.iso(
|
|
63
|
-
(n) =>
|
|
63
|
+
(n) => re(n),
|
|
64
64
|
(n) => {
|
|
65
|
-
if (
|
|
66
|
-
return
|
|
67
|
-
const s = new URL(n.pathname, e.value),
|
|
68
|
-
return
|
|
65
|
+
if (We(n.pathname))
|
|
66
|
+
return Lt(n);
|
|
67
|
+
const s = new URL(n.pathname, e.value), r = s.origin + s.pathname;
|
|
68
|
+
return Lt({ ...n, pathname: r });
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
71
|
return { value: o, dispose: o.dispose };
|
|
72
|
-
},
|
|
73
|
-
const t =
|
|
72
|
+
}, Me = () => {
|
|
73
|
+
const t = ct(), e = (t == null ? void 0 : t.location.hash) === "" ? void 0 : (t == null ? void 0 : t.location.hash.substring(1)) ?? void 0;
|
|
74
74
|
return {
|
|
75
75
|
pathname: (t == null ? void 0 : t.location.pathname) ?? "",
|
|
76
76
|
search: Object.fromEntries(
|
|
@@ -78,8 +78,8 @@ const Ee = (t) => {
|
|
|
78
78
|
),
|
|
79
79
|
hash: e
|
|
80
80
|
};
|
|
81
|
-
},
|
|
82
|
-
const t =
|
|
81
|
+
}, Ve = () => {
|
|
82
|
+
const t = H(Me(), Ce), e = ct(), o = () => {
|
|
83
83
|
let n = (e == null ? void 0 : e.location.hash) ?? "";
|
|
84
84
|
n.startsWith("#") && (n = n.substring(1));
|
|
85
85
|
const s = {
|
|
@@ -94,72 +94,72 @@ const Ee = (t) => {
|
|
|
94
94
|
return e == null || e.addEventListener("popstate", o), t.onDispose(() => {
|
|
95
95
|
e == null || e.removeEventListener("popstate", o);
|
|
96
96
|
}), t.on((n) => {
|
|
97
|
-
e == null || e.history.pushState({}, "",
|
|
97
|
+
e == null || e.history.pushState({}, "", Lt(n));
|
|
98
98
|
}), {
|
|
99
99
|
value: t,
|
|
100
100
|
dispose: t.dispose
|
|
101
101
|
};
|
|
102
|
-
},
|
|
103
|
-
mark:
|
|
102
|
+
}, ie = {
|
|
103
|
+
mark: Xt("LocationProvider"),
|
|
104
104
|
create: (t, e) => {
|
|
105
105
|
if (e.isBrowser())
|
|
106
|
-
return
|
|
106
|
+
return Ve();
|
|
107
107
|
if (e.isHeadless())
|
|
108
|
-
return
|
|
108
|
+
return Fe(e);
|
|
109
109
|
throw new Error("Unknown context");
|
|
110
110
|
}
|
|
111
|
-
},
|
|
111
|
+
}, Ne = (t) => {
|
|
112
112
|
document.startViewTransition ? document.startViewTransition(t) : t();
|
|
113
|
-
},
|
|
114
|
-
if (typeof t == "string" ||
|
|
115
|
-
return
|
|
113
|
+
}, $e = (t, ...e) => {
|
|
114
|
+
if (typeof t == "string" || Jt.is(t))
|
|
115
|
+
return $e({ href: t }, ...e);
|
|
116
116
|
const {
|
|
117
117
|
href: o,
|
|
118
118
|
withViewTransition: n,
|
|
119
119
|
...s
|
|
120
120
|
} = t;
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}) :
|
|
121
|
+
return Gt(ie, (r) => Rt.a(
|
|
122
|
+
Qt.click(
|
|
123
|
+
De(() => (n == !0 ? Ne(() => {
|
|
124
|
+
$t(r, E.get(o));
|
|
125
|
+
}) : $t(r, E.get(o)), !0), s)
|
|
126
126
|
),
|
|
127
|
-
|
|
127
|
+
Zt.href(o),
|
|
128
128
|
...e
|
|
129
129
|
));
|
|
130
|
-
},
|
|
131
|
-
mark:
|
|
130
|
+
}, Kn = {
|
|
131
|
+
mark: Xt("Appearance"),
|
|
132
132
|
create: () => {
|
|
133
|
-
const t =
|
|
133
|
+
const t = He();
|
|
134
134
|
return {
|
|
135
135
|
value: t,
|
|
136
136
|
dispose: t.dispose
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
|
-
function
|
|
141
|
-
const t =
|
|
140
|
+
function He() {
|
|
141
|
+
const t = ct(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, o = (e == null ? void 0 : e.matches) ?? !1, n = H(o ? "dark" : "light"), s = (r) => n.set(r.matches ? "dark" : "light");
|
|
142
142
|
return e == null || e.addEventListener("change", s), n.onDispose(() => e == null ? void 0 : e.removeEventListener("change", s)), n;
|
|
143
143
|
}
|
|
144
|
-
const
|
|
144
|
+
const ce = (t, e) => {
|
|
145
145
|
if (typeof e == "function")
|
|
146
|
-
return
|
|
147
|
-
const o = e.failure ?? ((
|
|
148
|
-
return
|
|
149
|
-
AsyncSuccess: (
|
|
150
|
-
AsyncFailure: (
|
|
151
|
-
Loading: (
|
|
152
|
-
NotAsked:
|
|
146
|
+
return ce(t, { success: e });
|
|
147
|
+
const o = e.failure ?? ((i) => i.map((c) => `Error: ${c}`)), n = e.success, s = e.loading ?? (() => Et), r = e.notAsked ?? (() => Et);
|
|
148
|
+
return te(E.toSignal(t), {
|
|
149
|
+
AsyncSuccess: (i) => n(i.$.value),
|
|
150
|
+
AsyncFailure: (i) => o(i.$.error),
|
|
151
|
+
Loading: (i) => s(i.map((c) => c.previousValue)),
|
|
152
|
+
NotAsked: r
|
|
153
153
|
});
|
|
154
|
-
},
|
|
155
|
-
const o =
|
|
156
|
-
return
|
|
157
|
-
}),
|
|
154
|
+
}, _n = (t = 10) => $((e) => F(se(() => e == null ? void 0 : e.focus(), t))), In = (t = 10) => $((e) => {
|
|
155
|
+
const o = se(() => e.select(), t);
|
|
156
|
+
return F(o);
|
|
157
|
+
}), jn = $((t) => {
|
|
158
158
|
const e = t.style.getPropertyValue(":empty");
|
|
159
|
-
return t.style.setProperty(":empty", "display:none"),
|
|
159
|
+
return t.style.setProperty(":empty", "display:none"), F((o) => {
|
|
160
160
|
o && t.style.setProperty(":empty", e);
|
|
161
161
|
});
|
|
162
|
-
}),
|
|
162
|
+
}), Yn = (t) => ee("head > title", Zt.innerText(t)), Be = {
|
|
163
163
|
partial: {
|
|
164
164
|
root: null,
|
|
165
165
|
rootMargin: "0px",
|
|
@@ -170,111 +170,154 @@ const ie = (t, e) => {
|
|
|
170
170
|
rootMargin: "0px",
|
|
171
171
|
threshold: 1
|
|
172
172
|
}
|
|
173
|
-
},
|
|
173
|
+
}, dt = {
|
|
174
174
|
partial: /* @__PURE__ */ new Map(),
|
|
175
175
|
full: /* @__PURE__ */ new Map()
|
|
176
|
-
},
|
|
176
|
+
}, ot = {
|
|
177
177
|
partial: null,
|
|
178
178
|
full: null
|
|
179
179
|
};
|
|
180
|
-
function
|
|
181
|
-
return
|
|
180
|
+
function Ue(t) {
|
|
181
|
+
return ot[t] == null && (ot[t] = new IntersectionObserver((e) => {
|
|
182
182
|
e.forEach((o) => {
|
|
183
|
-
const n =
|
|
183
|
+
const n = dt[t].get(o.target);
|
|
184
184
|
n == null || n.set(o.isIntersecting);
|
|
185
185
|
});
|
|
186
|
-
},
|
|
187
|
-
}
|
|
188
|
-
const
|
|
189
|
-
const n =
|
|
190
|
-
return
|
|
191
|
-
|
|
192
|
-
const
|
|
193
|
-
|
|
194
|
-
function
|
|
186
|
+
}, Be[t])), ot[t];
|
|
187
|
+
}
|
|
188
|
+
const ze = ({ mode: t = "partial", once: e = !1 }, o) => {
|
|
189
|
+
const n = H(!1);
|
|
190
|
+
return st(
|
|
191
|
+
$((s) => {
|
|
192
|
+
const r = typeof IntersectionObserver < "u" ? Ue(t) : null;
|
|
193
|
+
dt[t].set(s, n), r == null || r.observe(s);
|
|
194
|
+
function i() {
|
|
195
195
|
var l;
|
|
196
|
-
|
|
196
|
+
r == null || r.unobserve(s), dt[t].delete(s), dt[t].size === 0 && ((l = ot[t]) == null || l.disconnect(), ot[t] = null);
|
|
197
197
|
}
|
|
198
198
|
let c = null;
|
|
199
199
|
return e && (c = n.on((l) => {
|
|
200
|
-
l &&
|
|
201
|
-
})),
|
|
202
|
-
n.dispose(),
|
|
200
|
+
l && i();
|
|
201
|
+
})), F(() => {
|
|
202
|
+
n.dispose(), i(), c == null || c();
|
|
203
203
|
});
|
|
204
204
|
}),
|
|
205
|
-
|
|
205
|
+
Dt(o(n))
|
|
206
206
|
);
|
|
207
|
-
},
|
|
207
|
+
}, qn = (t, e, o) => ze(t, (n) => ne(n, e, o ?? (() => Et)));
|
|
208
|
+
function Xn(t) {
|
|
209
|
+
return $((e) => {
|
|
210
|
+
const o = (n) => {
|
|
211
|
+
e.contains(n.target) || t(n);
|
|
212
|
+
};
|
|
213
|
+
return document.addEventListener("click", o), F(() => {
|
|
214
|
+
document.removeEventListener("click", o);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
const G = (t, e) => t === void 0 || t === e, Ht = (t, e) => t === void 0 || t === e;
|
|
219
|
+
function Ke(t, e) {
|
|
220
|
+
return typeof t == "string" ? e.key === t : Ht(t.key, e.key) && Ht(t.code, e.code) && G(t.ctrlKey, e.ctrlKey) && G(t.altKey, e.altKey) && G(t.shiftKey, e.shiftKey) && G(t.metaKey, e.metaKey) && G(t.repeat, e.repeat) && G(
|
|
221
|
+
t.commandOrControlKey,
|
|
222
|
+
e.metaKey || e.ctrlKey
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
function le({
|
|
226
|
+
allowedKeys: t,
|
|
227
|
+
handler: e
|
|
228
|
+
}) {
|
|
229
|
+
return $((o) => {
|
|
230
|
+
const n = (s) => {
|
|
231
|
+
if (o.contains(s.target)) {
|
|
232
|
+
for (const r of t)
|
|
233
|
+
if (Ke(r, s)) {
|
|
234
|
+
e(s);
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
return document.addEventListener("keydown", n), F(() => {
|
|
240
|
+
document.removeEventListener("keydown", n);
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
function Jn(t) {
|
|
245
|
+
return le({ allowedKeys: ["Enter"], handler: t });
|
|
246
|
+
}
|
|
247
|
+
function Gn(t) {
|
|
248
|
+
return le({ allowedKeys: ["Escape"], handler: t });
|
|
249
|
+
}
|
|
250
|
+
const Z = Math.min, q = Math.max, mt = Math.round, ht = Math.floor, C = (t) => ({
|
|
208
251
|
x: t,
|
|
209
252
|
y: t
|
|
210
|
-
}),
|
|
253
|
+
}), _e = {
|
|
211
254
|
left: "right",
|
|
212
255
|
right: "left",
|
|
213
256
|
bottom: "top",
|
|
214
257
|
top: "bottom"
|
|
215
|
-
},
|
|
258
|
+
}, Ie = {
|
|
216
259
|
start: "end",
|
|
217
260
|
end: "start"
|
|
218
261
|
};
|
|
219
|
-
function
|
|
220
|
-
return
|
|
262
|
+
function St(t, e, o) {
|
|
263
|
+
return q(t, Z(e, o));
|
|
221
264
|
}
|
|
222
|
-
function
|
|
265
|
+
function lt(t, e) {
|
|
223
266
|
return typeof t == "function" ? t(e) : t;
|
|
224
267
|
}
|
|
225
|
-
function
|
|
268
|
+
function X(t) {
|
|
226
269
|
return t.split("-")[0];
|
|
227
270
|
}
|
|
228
|
-
function
|
|
271
|
+
function at(t) {
|
|
229
272
|
return t.split("-")[1];
|
|
230
273
|
}
|
|
231
|
-
function
|
|
274
|
+
function ae(t) {
|
|
232
275
|
return t === "x" ? "y" : "x";
|
|
233
276
|
}
|
|
234
277
|
function Ct(t) {
|
|
235
278
|
return t === "y" ? "height" : "width";
|
|
236
279
|
}
|
|
237
|
-
function
|
|
238
|
-
return ["top", "bottom"].includes(
|
|
280
|
+
function z(t) {
|
|
281
|
+
return ["top", "bottom"].includes(X(t)) ? "y" : "x";
|
|
239
282
|
}
|
|
240
|
-
function
|
|
241
|
-
return
|
|
283
|
+
function Wt(t) {
|
|
284
|
+
return ae(z(t));
|
|
242
285
|
}
|
|
243
|
-
function
|
|
286
|
+
function je(t, e, o) {
|
|
244
287
|
o === void 0 && (o = !1);
|
|
245
|
-
const n =
|
|
246
|
-
let
|
|
247
|
-
return e.reference[
|
|
288
|
+
const n = at(t), s = Wt(t), r = Ct(s);
|
|
289
|
+
let i = s === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
|
|
290
|
+
return e.reference[r] > e.floating[r] && (i = gt(i)), [i, gt(i)];
|
|
248
291
|
}
|
|
249
|
-
function
|
|
250
|
-
const e =
|
|
251
|
-
return [
|
|
292
|
+
function Ye(t) {
|
|
293
|
+
const e = gt(t);
|
|
294
|
+
return [Tt(t), e, Tt(e)];
|
|
252
295
|
}
|
|
253
|
-
function
|
|
254
|
-
return t.replace(/start|end/g, (e) =>
|
|
296
|
+
function Tt(t) {
|
|
297
|
+
return t.replace(/start|end/g, (e) => Ie[e]);
|
|
255
298
|
}
|
|
256
|
-
function
|
|
257
|
-
const n = ["left", "right"], s = ["right", "left"],
|
|
299
|
+
function qe(t, e, o) {
|
|
300
|
+
const n = ["left", "right"], s = ["right", "left"], r = ["top", "bottom"], i = ["bottom", "top"];
|
|
258
301
|
switch (t) {
|
|
259
302
|
case "top":
|
|
260
303
|
case "bottom":
|
|
261
304
|
return o ? e ? s : n : e ? n : s;
|
|
262
305
|
case "left":
|
|
263
306
|
case "right":
|
|
264
|
-
return e ?
|
|
307
|
+
return e ? r : i;
|
|
265
308
|
default:
|
|
266
309
|
return [];
|
|
267
310
|
}
|
|
268
311
|
}
|
|
269
|
-
function
|
|
270
|
-
const s =
|
|
271
|
-
let
|
|
272
|
-
return s && (
|
|
312
|
+
function Xe(t, e, o, n) {
|
|
313
|
+
const s = at(t);
|
|
314
|
+
let r = qe(X(t), o === "start", n);
|
|
315
|
+
return s && (r = r.map((i) => i + "-" + s), e && (r = r.concat(r.map(Tt)))), r;
|
|
273
316
|
}
|
|
274
|
-
function
|
|
275
|
-
return t.replace(/left|right|bottom|top/g, (e) =>
|
|
317
|
+
function gt(t) {
|
|
318
|
+
return t.replace(/left|right|bottom|top/g, (e) => _e[e]);
|
|
276
319
|
}
|
|
277
|
-
function
|
|
320
|
+
function Je(t) {
|
|
278
321
|
return {
|
|
279
322
|
top: 0,
|
|
280
323
|
right: 0,
|
|
@@ -283,15 +326,15 @@ function Ye(t) {
|
|
|
283
326
|
...t
|
|
284
327
|
};
|
|
285
328
|
}
|
|
286
|
-
function
|
|
287
|
-
return typeof t != "number" ?
|
|
329
|
+
function ue(t) {
|
|
330
|
+
return typeof t != "number" ? Je(t) : {
|
|
288
331
|
top: t,
|
|
289
332
|
right: t,
|
|
290
333
|
bottom: t,
|
|
291
334
|
left: t
|
|
292
335
|
};
|
|
293
336
|
}
|
|
294
|
-
function
|
|
337
|
+
function pt(t) {
|
|
295
338
|
const {
|
|
296
339
|
x: e,
|
|
297
340
|
y: o,
|
|
@@ -309,12 +352,12 @@ function gt(t) {
|
|
|
309
352
|
y: o
|
|
310
353
|
};
|
|
311
354
|
}
|
|
312
|
-
function
|
|
355
|
+
function Bt(t, e, o) {
|
|
313
356
|
let {
|
|
314
357
|
reference: n,
|
|
315
358
|
floating: s
|
|
316
359
|
} = t;
|
|
317
|
-
const
|
|
360
|
+
const r = z(e), i = Wt(e), c = Ct(i), l = X(e), a = r === "y", h = n.x + n.width / 2 - s.width / 2, f = n.y + n.height / 2 - s.height / 2, m = n[c] / 2 - s[c] / 2;
|
|
318
361
|
let u;
|
|
319
362
|
switch (l) {
|
|
320
363
|
case "top":
|
|
@@ -347,31 +390,31 @@ function $t(t, e, o) {
|
|
|
347
390
|
y: n.y
|
|
348
391
|
};
|
|
349
392
|
}
|
|
350
|
-
switch (
|
|
393
|
+
switch (at(e)) {
|
|
351
394
|
case "start":
|
|
352
|
-
u[
|
|
395
|
+
u[i] -= m * (o && a ? -1 : 1);
|
|
353
396
|
break;
|
|
354
397
|
case "end":
|
|
355
|
-
u[
|
|
398
|
+
u[i] += m * (o && a ? -1 : 1);
|
|
356
399
|
break;
|
|
357
400
|
}
|
|
358
401
|
return u;
|
|
359
402
|
}
|
|
360
|
-
const
|
|
403
|
+
const Ge = async (t, e, o) => {
|
|
361
404
|
const {
|
|
362
405
|
placement: n = "bottom",
|
|
363
406
|
strategy: s = "absolute",
|
|
364
|
-
middleware:
|
|
365
|
-
platform:
|
|
366
|
-
} = o, c =
|
|
367
|
-
let a = await
|
|
407
|
+
middleware: r = [],
|
|
408
|
+
platform: i
|
|
409
|
+
} = o, c = r.filter(Boolean), l = await (i.isRTL == null ? void 0 : i.isRTL(e));
|
|
410
|
+
let a = await i.getElementRects({
|
|
368
411
|
reference: t,
|
|
369
412
|
floating: e,
|
|
370
413
|
strategy: s
|
|
371
414
|
}), {
|
|
372
415
|
x: h,
|
|
373
416
|
y: f
|
|
374
|
-
} =
|
|
417
|
+
} = Bt(a, n, l), m = n, u = {}, d = 0;
|
|
375
418
|
for (let p = 0; p < c.length; p++) {
|
|
376
419
|
const {
|
|
377
420
|
name: w,
|
|
@@ -389,7 +432,7 @@ const qe = async (t, e, o) => {
|
|
|
389
432
|
strategy: s,
|
|
390
433
|
middlewareData: u,
|
|
391
434
|
rects: a,
|
|
392
|
-
platform:
|
|
435
|
+
platform: i,
|
|
393
436
|
elements: {
|
|
394
437
|
reference: t,
|
|
395
438
|
floating: e
|
|
@@ -401,14 +444,14 @@ const qe = async (t, e, o) => {
|
|
|
401
444
|
...u[w],
|
|
402
445
|
...b
|
|
403
446
|
}
|
|
404
|
-
}, v && d <= 50 && (d++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (a = v.rects === !0 ? await
|
|
447
|
+
}, v && d <= 50 && (d++, typeof v == "object" && (v.placement && (m = v.placement), v.rects && (a = v.rects === !0 ? await i.getElementRects({
|
|
405
448
|
reference: t,
|
|
406
449
|
floating: e,
|
|
407
450
|
strategy: s
|
|
408
451
|
}) : v.rects), {
|
|
409
452
|
x: h,
|
|
410
453
|
y: f
|
|
411
|
-
} =
|
|
454
|
+
} = Bt(a, m, l)), p = -1);
|
|
412
455
|
}
|
|
413
456
|
return {
|
|
414
457
|
x: h,
|
|
@@ -418,14 +461,14 @@ const qe = async (t, e, o) => {
|
|
|
418
461
|
middlewareData: u
|
|
419
462
|
};
|
|
420
463
|
};
|
|
421
|
-
async function
|
|
464
|
+
async function fe(t, e) {
|
|
422
465
|
var o;
|
|
423
466
|
e === void 0 && (e = {});
|
|
424
467
|
const {
|
|
425
468
|
x: n,
|
|
426
469
|
y: s,
|
|
427
|
-
platform:
|
|
428
|
-
rects:
|
|
470
|
+
platform: r,
|
|
471
|
+
rects: i,
|
|
429
472
|
elements: c,
|
|
430
473
|
strategy: l
|
|
431
474
|
} = t, {
|
|
@@ -434,23 +477,23 @@ async function le(t, e) {
|
|
|
434
477
|
elementContext: f = "floating",
|
|
435
478
|
altBoundary: m = !1,
|
|
436
479
|
padding: u = 0
|
|
437
|
-
} =
|
|
438
|
-
element: (o = await (
|
|
480
|
+
} = lt(e, t), d = ue(u), w = c[m ? f === "floating" ? "reference" : "floating" : f], g = pt(await r.getClippingRect({
|
|
481
|
+
element: (o = await (r.isElement == null ? void 0 : r.isElement(w))) == null || o ? w : w.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(c.floating)),
|
|
439
482
|
boundary: a,
|
|
440
483
|
rootBoundary: h,
|
|
441
484
|
strategy: l
|
|
442
485
|
})), x = f === "floating" ? {
|
|
443
486
|
x: n,
|
|
444
487
|
y: s,
|
|
445
|
-
width:
|
|
446
|
-
height:
|
|
447
|
-
} :
|
|
488
|
+
width: i.floating.width,
|
|
489
|
+
height: i.floating.height
|
|
490
|
+
} : i.reference, y = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(c.floating)), b = await (r.isElement == null ? void 0 : r.isElement(y)) ? await (r.getScale == null ? void 0 : r.getScale(y)) || {
|
|
448
491
|
x: 1,
|
|
449
492
|
y: 1
|
|
450
493
|
} : {
|
|
451
494
|
x: 1,
|
|
452
495
|
y: 1
|
|
453
|
-
}, v =
|
|
496
|
+
}, v = pt(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
454
497
|
elements: c,
|
|
455
498
|
rect: x,
|
|
456
499
|
offsetParent: y,
|
|
@@ -463,7 +506,7 @@ async function le(t, e) {
|
|
|
463
506
|
right: (v.right - g.right + d.right) / b.x
|
|
464
507
|
};
|
|
465
508
|
}
|
|
466
|
-
const
|
|
509
|
+
const Qe = (t) => ({
|
|
467
510
|
name: "arrow",
|
|
468
511
|
options: t,
|
|
469
512
|
async fn(e) {
|
|
@@ -471,36 +514,36 @@ const Xe = (t) => ({
|
|
|
471
514
|
x: o,
|
|
472
515
|
y: n,
|
|
473
516
|
placement: s,
|
|
474
|
-
rects:
|
|
475
|
-
platform:
|
|
517
|
+
rects: r,
|
|
518
|
+
platform: i,
|
|
476
519
|
elements: c,
|
|
477
520
|
middlewareData: l
|
|
478
521
|
} = e, {
|
|
479
522
|
element: a,
|
|
480
523
|
padding: h = 0
|
|
481
|
-
} =
|
|
524
|
+
} = lt(t, e) || {};
|
|
482
525
|
if (a == null)
|
|
483
526
|
return {};
|
|
484
|
-
const f =
|
|
527
|
+
const f = ue(h), m = {
|
|
485
528
|
x: o,
|
|
486
529
|
y: n
|
|
487
|
-
}, u =
|
|
530
|
+
}, u = Wt(s), d = Ct(u), p = await i.getDimensions(a), w = u === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = r.reference[d] + r.reference[u] - m[u] - r.floating[d], v = m[u] - r.reference[u], L = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a));
|
|
488
531
|
let A = L ? L[y] : 0;
|
|
489
|
-
(!A || !await (
|
|
490
|
-
const _ = b / 2 - v / 2,
|
|
532
|
+
(!A || !await (i.isElement == null ? void 0 : i.isElement(L))) && (A = c.floating[y] || r.floating[d]);
|
|
533
|
+
const _ = b / 2 - v / 2, V = A / 2 - p[d] / 2 - 1, S = Z(f[g], V), I = Z(f[x], V), j = S, nt = A - p[d] - I, O = A / 2 - p[d] / 2 + _, Y = St(j, O, nt), N = !l.arrow && at(s) != null && O !== Y && r.reference[d] / 2 - (O < j ? S : I) - p[d] / 2 < 0, T = N ? O < j ? O - j : O - nt : 0;
|
|
491
534
|
return {
|
|
492
535
|
[u]: m[u] + T,
|
|
493
536
|
data: {
|
|
494
537
|
[u]: Y,
|
|
495
|
-
centerOffset:
|
|
496
|
-
...
|
|
538
|
+
centerOffset: O - Y - T,
|
|
539
|
+
...N && {
|
|
497
540
|
alignmentOffset: T
|
|
498
541
|
}
|
|
499
542
|
},
|
|
500
|
-
reset:
|
|
543
|
+
reset: N
|
|
501
544
|
};
|
|
502
545
|
}
|
|
503
|
-
}),
|
|
546
|
+
}), Ze = function(t) {
|
|
504
547
|
return t === void 0 && (t = {}), {
|
|
505
548
|
name: "flip",
|
|
506
549
|
options: t,
|
|
@@ -508,8 +551,8 @@ const Xe = (t) => ({
|
|
|
508
551
|
var o, n;
|
|
509
552
|
const {
|
|
510
553
|
placement: s,
|
|
511
|
-
middlewareData:
|
|
512
|
-
rects:
|
|
554
|
+
middlewareData: r,
|
|
555
|
+
rects: i,
|
|
513
556
|
initialPlacement: c,
|
|
514
557
|
platform: l,
|
|
515
558
|
elements: a
|
|
@@ -521,60 +564,60 @@ const Xe = (t) => ({
|
|
|
521
564
|
fallbackAxisSideDirection: d = "none",
|
|
522
565
|
flipAlignment: p = !0,
|
|
523
566
|
...w
|
|
524
|
-
} =
|
|
525
|
-
if ((o =
|
|
567
|
+
} = lt(t, e);
|
|
568
|
+
if ((o = r.arrow) != null && o.alignmentOffset)
|
|
526
569
|
return {};
|
|
527
|
-
const g =
|
|
528
|
-
!m && L && v.push(...
|
|
529
|
-
const A = [c, ...v], _ = await
|
|
530
|
-
let S = ((n =
|
|
531
|
-
if (h &&
|
|
532
|
-
const
|
|
533
|
-
|
|
570
|
+
const g = X(s), x = z(c), y = X(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = m || (y || !p ? [gt(c)] : Ye(c)), L = d !== "none";
|
|
571
|
+
!m && L && v.push(...Xe(c, p, d, b));
|
|
572
|
+
const A = [c, ...v], _ = await fe(e, w), V = [];
|
|
573
|
+
let S = ((n = r.flip) == null ? void 0 : n.overflows) || [];
|
|
574
|
+
if (h && V.push(_[g]), f) {
|
|
575
|
+
const O = je(s, i, b);
|
|
576
|
+
V.push(_[O[0]], _[O[1]]);
|
|
534
577
|
}
|
|
535
578
|
if (S = [...S, {
|
|
536
579
|
placement: s,
|
|
537
|
-
overflows:
|
|
538
|
-
}], !
|
|
580
|
+
overflows: V
|
|
581
|
+
}], !V.every((O) => O <= 0)) {
|
|
539
582
|
var I, j;
|
|
540
|
-
const
|
|
541
|
-
if (Y && (!(f === "alignment" ? x !==
|
|
583
|
+
const O = (((I = r.flip) == null ? void 0 : I.index) || 0) + 1, Y = A[O];
|
|
584
|
+
if (Y && (!(f === "alignment" ? x !== z(Y) : !1) || // We leave the current main axis only if every placement on that axis
|
|
542
585
|
// overflows the main axis.
|
|
543
|
-
S.every((P) => P.overflows[0] > 0 &&
|
|
586
|
+
S.every((P) => P.overflows[0] > 0 && z(P.placement) === x)))
|
|
544
587
|
return {
|
|
545
588
|
data: {
|
|
546
|
-
index:
|
|
589
|
+
index: O,
|
|
547
590
|
overflows: S
|
|
548
591
|
},
|
|
549
592
|
reset: {
|
|
550
593
|
placement: Y
|
|
551
594
|
}
|
|
552
595
|
};
|
|
553
|
-
let
|
|
554
|
-
if (!
|
|
596
|
+
let N = (j = S.filter((T) => T.overflows[0] <= 0).sort((T, P) => T.overflows[1] - P.overflows[1])[0]) == null ? void 0 : j.placement;
|
|
597
|
+
if (!N)
|
|
555
598
|
switch (u) {
|
|
556
599
|
case "bestFit": {
|
|
557
|
-
var
|
|
558
|
-
const T = (
|
|
600
|
+
var nt;
|
|
601
|
+
const T = (nt = S.filter((P) => {
|
|
559
602
|
if (L) {
|
|
560
|
-
const
|
|
561
|
-
return
|
|
603
|
+
const B = z(P.placement);
|
|
604
|
+
return B === x || // Create a bias to the `y` side axis due to horizontal
|
|
562
605
|
// reading directions favoring greater width.
|
|
563
|
-
|
|
606
|
+
B === "y";
|
|
564
607
|
}
|
|
565
608
|
return !0;
|
|
566
|
-
}).map((P) => [P.placement, P.overflows.filter((
|
|
567
|
-
T && (
|
|
609
|
+
}).map((P) => [P.placement, P.overflows.filter((B) => B > 0).reduce((B, ve) => B + ve, 0)]).sort((P, B) => P[1] - B[1])[0]) == null ? void 0 : nt[0];
|
|
610
|
+
T && (N = T);
|
|
568
611
|
break;
|
|
569
612
|
}
|
|
570
613
|
case "initialPlacement":
|
|
571
|
-
|
|
614
|
+
N = c;
|
|
572
615
|
break;
|
|
573
616
|
}
|
|
574
|
-
if (s !==
|
|
617
|
+
if (s !== N)
|
|
575
618
|
return {
|
|
576
619
|
reset: {
|
|
577
|
-
placement:
|
|
620
|
+
placement: N
|
|
578
621
|
}
|
|
579
622
|
};
|
|
580
623
|
}
|
|
@@ -582,12 +625,12 @@ const Xe = (t) => ({
|
|
|
582
625
|
}
|
|
583
626
|
};
|
|
584
627
|
};
|
|
585
|
-
async function
|
|
628
|
+
async function tn(t, e) {
|
|
586
629
|
const {
|
|
587
630
|
placement: o,
|
|
588
631
|
platform: n,
|
|
589
632
|
elements: s
|
|
590
|
-
} = t,
|
|
633
|
+
} = t, r = await (n.isRTL == null ? void 0 : n.isRTL(s.floating)), i = X(o), c = at(o), l = z(o) === "y", a = ["left", "top"].includes(i) ? -1 : 1, h = r && l ? -1 : 1, f = lt(e, t);
|
|
591
634
|
let {
|
|
592
635
|
mainAxis: m,
|
|
593
636
|
crossAxis: u,
|
|
@@ -609,7 +652,7 @@ async function Je(t, e) {
|
|
|
609
652
|
y: u * h
|
|
610
653
|
};
|
|
611
654
|
}
|
|
612
|
-
const
|
|
655
|
+
const en = function(t) {
|
|
613
656
|
return t === void 0 && (t = 0), {
|
|
614
657
|
name: "offset",
|
|
615
658
|
options: t,
|
|
@@ -617,21 +660,21 @@ const Ge = function(t) {
|
|
|
617
660
|
var o, n;
|
|
618
661
|
const {
|
|
619
662
|
x: s,
|
|
620
|
-
y:
|
|
621
|
-
placement:
|
|
663
|
+
y: r,
|
|
664
|
+
placement: i,
|
|
622
665
|
middlewareData: c
|
|
623
|
-
} = e, l = await
|
|
624
|
-
return
|
|
666
|
+
} = e, l = await tn(e, t);
|
|
667
|
+
return i === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
|
|
625
668
|
x: s + l.x,
|
|
626
|
-
y:
|
|
669
|
+
y: r + l.y,
|
|
627
670
|
data: {
|
|
628
671
|
...l,
|
|
629
|
-
placement:
|
|
672
|
+
placement: i
|
|
630
673
|
}
|
|
631
674
|
};
|
|
632
675
|
}
|
|
633
676
|
};
|
|
634
|
-
},
|
|
677
|
+
}, nn = function(t) {
|
|
635
678
|
return t === void 0 && (t = {}), {
|
|
636
679
|
name: "shift",
|
|
637
680
|
options: t,
|
|
@@ -641,8 +684,8 @@ const Ge = function(t) {
|
|
|
641
684
|
y: n,
|
|
642
685
|
placement: s
|
|
643
686
|
} = e, {
|
|
644
|
-
mainAxis:
|
|
645
|
-
crossAxis:
|
|
687
|
+
mainAxis: r = !0,
|
|
688
|
+
crossAxis: i = !1,
|
|
646
689
|
limiter: c = {
|
|
647
690
|
fn: (w) => {
|
|
648
691
|
let {
|
|
@@ -656,18 +699,18 @@ const Ge = function(t) {
|
|
|
656
699
|
}
|
|
657
700
|
},
|
|
658
701
|
...l
|
|
659
|
-
} =
|
|
702
|
+
} = lt(t, e), a = {
|
|
660
703
|
x: o,
|
|
661
704
|
y: n
|
|
662
|
-
}, h = await
|
|
705
|
+
}, h = await fe(e, l), f = z(X(s)), m = ae(f);
|
|
663
706
|
let u = a[m], d = a[f];
|
|
664
|
-
if (
|
|
707
|
+
if (r) {
|
|
665
708
|
const w = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", x = u + h[w], y = u - h[g];
|
|
666
|
-
u =
|
|
709
|
+
u = St(x, u, y);
|
|
667
710
|
}
|
|
668
|
-
if (
|
|
711
|
+
if (i) {
|
|
669
712
|
const w = f === "y" ? "top" : "left", g = f === "y" ? "bottom" : "right", x = d + h[w], y = d - h[g];
|
|
670
|
-
d =
|
|
713
|
+
d = St(x, d, y);
|
|
671
714
|
}
|
|
672
715
|
const p = c.fn({
|
|
673
716
|
...e,
|
|
@@ -680,53 +723,53 @@ const Ge = function(t) {
|
|
|
680
723
|
x: p.x - o,
|
|
681
724
|
y: p.y - n,
|
|
682
725
|
enabled: {
|
|
683
|
-
[m]:
|
|
684
|
-
[f]:
|
|
726
|
+
[m]: r,
|
|
727
|
+
[f]: i
|
|
685
728
|
}
|
|
686
729
|
}
|
|
687
730
|
};
|
|
688
731
|
}
|
|
689
732
|
};
|
|
690
733
|
};
|
|
691
|
-
function
|
|
734
|
+
function yt() {
|
|
692
735
|
return typeof window < "u";
|
|
693
736
|
}
|
|
694
|
-
function
|
|
695
|
-
return
|
|
737
|
+
function et(t) {
|
|
738
|
+
return he(t) ? (t.nodeName || "").toLowerCase() : "#document";
|
|
696
739
|
}
|
|
697
|
-
function
|
|
740
|
+
function R(t) {
|
|
698
741
|
var e;
|
|
699
742
|
return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
|
|
700
743
|
}
|
|
701
|
-
function
|
|
744
|
+
function M(t) {
|
|
702
745
|
var e;
|
|
703
|
-
return (e = (
|
|
746
|
+
return (e = (he(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
|
|
704
747
|
}
|
|
705
|
-
function
|
|
706
|
-
return
|
|
748
|
+
function he(t) {
|
|
749
|
+
return yt() ? t instanceof Node || t instanceof R(t).Node : !1;
|
|
707
750
|
}
|
|
708
751
|
function k(t) {
|
|
709
|
-
return
|
|
752
|
+
return yt() ? t instanceof Element || t instanceof R(t).Element : !1;
|
|
710
753
|
}
|
|
711
754
|
function W(t) {
|
|
712
|
-
return
|
|
755
|
+
return yt() ? t instanceof HTMLElement || t instanceof R(t).HTMLElement : !1;
|
|
713
756
|
}
|
|
714
|
-
function
|
|
715
|
-
return !
|
|
757
|
+
function Ut(t) {
|
|
758
|
+
return !yt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof R(t).ShadowRoot;
|
|
716
759
|
}
|
|
717
|
-
function
|
|
760
|
+
function ut(t) {
|
|
718
761
|
const {
|
|
719
762
|
overflow: e,
|
|
720
763
|
overflowX: o,
|
|
721
764
|
overflowY: n,
|
|
722
765
|
display: s
|
|
723
|
-
} =
|
|
766
|
+
} = D(t);
|
|
724
767
|
return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(s);
|
|
725
768
|
}
|
|
726
|
-
function
|
|
727
|
-
return ["table", "td", "th"].includes(
|
|
769
|
+
function on(t) {
|
|
770
|
+
return ["table", "td", "th"].includes(et(t));
|
|
728
771
|
}
|
|
729
|
-
function
|
|
772
|
+
function xt(t) {
|
|
730
773
|
return [":popover-open", ":modal"].some((e) => {
|
|
731
774
|
try {
|
|
732
775
|
return t.matches(e);
|
|
@@ -735,31 +778,31 @@ function yt(t) {
|
|
|
735
778
|
}
|
|
736
779
|
});
|
|
737
780
|
}
|
|
738
|
-
function
|
|
739
|
-
const e =
|
|
781
|
+
function Ft(t) {
|
|
782
|
+
const e = Mt(), o = k(t) ? D(t) : t;
|
|
740
783
|
return ["transform", "translate", "scale", "rotate", "perspective"].some((n) => o[n] ? o[n] !== "none" : !1) || (o.containerType ? o.containerType !== "normal" : !1) || !e && (o.backdropFilter ? o.backdropFilter !== "none" : !1) || !e && (o.filter ? o.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((n) => (o.willChange || "").includes(n)) || ["paint", "layout", "strict", "content"].some((n) => (o.contain || "").includes(n));
|
|
741
784
|
}
|
|
742
|
-
function
|
|
743
|
-
let e =
|
|
744
|
-
for (; W(e) && !
|
|
745
|
-
if (
|
|
785
|
+
function sn(t) {
|
|
786
|
+
let e = K(t);
|
|
787
|
+
for (; W(e) && !tt(e); ) {
|
|
788
|
+
if (Ft(e))
|
|
746
789
|
return e;
|
|
747
|
-
if (
|
|
790
|
+
if (xt(e))
|
|
748
791
|
return null;
|
|
749
|
-
e =
|
|
792
|
+
e = K(e);
|
|
750
793
|
}
|
|
751
794
|
return null;
|
|
752
795
|
}
|
|
753
|
-
function
|
|
796
|
+
function Mt() {
|
|
754
797
|
return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
|
|
755
798
|
}
|
|
756
|
-
function
|
|
757
|
-
return ["html", "body", "#document"].includes(
|
|
799
|
+
function tt(t) {
|
|
800
|
+
return ["html", "body", "#document"].includes(et(t));
|
|
758
801
|
}
|
|
759
|
-
function
|
|
760
|
-
return
|
|
802
|
+
function D(t) {
|
|
803
|
+
return R(t).getComputedStyle(t);
|
|
761
804
|
}
|
|
762
|
-
function
|
|
805
|
+
function vt(t) {
|
|
763
806
|
return k(t) ? {
|
|
764
807
|
scrollLeft: t.scrollLeft,
|
|
765
808
|
scrollTop: t.scrollTop
|
|
@@ -768,131 +811,131 @@ function xt(t) {
|
|
|
768
811
|
scrollTop: t.scrollY
|
|
769
812
|
};
|
|
770
813
|
}
|
|
771
|
-
function
|
|
772
|
-
if (
|
|
814
|
+
function K(t) {
|
|
815
|
+
if (et(t) === "html")
|
|
773
816
|
return t;
|
|
774
817
|
const e = (
|
|
775
818
|
// Step into the shadow DOM of the parent of a slotted node.
|
|
776
819
|
t.assignedSlot || // DOM Element detected.
|
|
777
820
|
t.parentNode || // ShadowRoot detected.
|
|
778
|
-
|
|
779
|
-
|
|
821
|
+
Ut(t) && t.host || // Fallback.
|
|
822
|
+
M(t)
|
|
780
823
|
);
|
|
781
|
-
return
|
|
824
|
+
return Ut(e) ? e.host : e;
|
|
782
825
|
}
|
|
783
|
-
function
|
|
784
|
-
const e =
|
|
785
|
-
return
|
|
826
|
+
function de(t) {
|
|
827
|
+
const e = K(t);
|
|
828
|
+
return tt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : W(e) && ut(e) ? e : de(e);
|
|
786
829
|
}
|
|
787
|
-
function
|
|
830
|
+
function rt(t, e, o) {
|
|
788
831
|
var n;
|
|
789
832
|
e === void 0 && (e = []), o === void 0 && (o = !0);
|
|
790
|
-
const s =
|
|
791
|
-
if (
|
|
792
|
-
const c =
|
|
793
|
-
return e.concat(
|
|
833
|
+
const s = de(t), r = s === ((n = t.ownerDocument) == null ? void 0 : n.body), i = R(s);
|
|
834
|
+
if (r) {
|
|
835
|
+
const c = Pt(i);
|
|
836
|
+
return e.concat(i, i.visualViewport || [], ut(s) ? s : [], c && o ? rt(c) : []);
|
|
794
837
|
}
|
|
795
|
-
return e.concat(s,
|
|
838
|
+
return e.concat(s, rt(s, [], o));
|
|
796
839
|
}
|
|
797
|
-
function
|
|
840
|
+
function Pt(t) {
|
|
798
841
|
return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
|
|
799
842
|
}
|
|
800
|
-
function
|
|
801
|
-
const e =
|
|
843
|
+
function me(t) {
|
|
844
|
+
const e = D(t);
|
|
802
845
|
let o = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
|
|
803
|
-
const s = W(t),
|
|
804
|
-
return c && (o =
|
|
846
|
+
const s = W(t), r = s ? t.offsetWidth : o, i = s ? t.offsetHeight : n, c = mt(o) !== r || mt(n) !== i;
|
|
847
|
+
return c && (o = r, n = i), {
|
|
805
848
|
width: o,
|
|
806
849
|
height: n,
|
|
807
850
|
$: c
|
|
808
851
|
};
|
|
809
852
|
}
|
|
810
|
-
function
|
|
853
|
+
function Vt(t) {
|
|
811
854
|
return k(t) ? t : t.contextElement;
|
|
812
855
|
}
|
|
813
|
-
function
|
|
814
|
-
const e =
|
|
856
|
+
function Q(t) {
|
|
857
|
+
const e = Vt(t);
|
|
815
858
|
if (!W(e))
|
|
816
|
-
return
|
|
859
|
+
return C(1);
|
|
817
860
|
const o = e.getBoundingClientRect(), {
|
|
818
861
|
width: n,
|
|
819
862
|
height: s,
|
|
820
|
-
$:
|
|
821
|
-
} =
|
|
822
|
-
let
|
|
823
|
-
return (!
|
|
824
|
-
x:
|
|
863
|
+
$: r
|
|
864
|
+
} = me(e);
|
|
865
|
+
let i = (r ? mt(o.width) : o.width) / n, c = (r ? mt(o.height) : o.height) / s;
|
|
866
|
+
return (!i || !Number.isFinite(i)) && (i = 1), (!c || !Number.isFinite(c)) && (c = 1), {
|
|
867
|
+
x: i,
|
|
825
868
|
y: c
|
|
826
869
|
};
|
|
827
870
|
}
|
|
828
|
-
const
|
|
829
|
-
function
|
|
830
|
-
const e =
|
|
831
|
-
return !
|
|
871
|
+
const rn = /* @__PURE__ */ C(0);
|
|
872
|
+
function ge(t) {
|
|
873
|
+
const e = R(t);
|
|
874
|
+
return !Mt() || !e.visualViewport ? rn : {
|
|
832
875
|
x: e.visualViewport.offsetLeft,
|
|
833
876
|
y: e.visualViewport.offsetTop
|
|
834
877
|
};
|
|
835
878
|
}
|
|
836
|
-
function
|
|
837
|
-
return e === void 0 && (e = !1), !o || e && o !==
|
|
879
|
+
function cn(t, e, o) {
|
|
880
|
+
return e === void 0 && (e = !1), !o || e && o !== R(t) ? !1 : e;
|
|
838
881
|
}
|
|
839
882
|
function J(t, e, o, n) {
|
|
840
883
|
e === void 0 && (e = !1), o === void 0 && (o = !1);
|
|
841
|
-
const s = t.getBoundingClientRect(),
|
|
842
|
-
let
|
|
843
|
-
e && (n ? k(n) && (
|
|
844
|
-
const c =
|
|
845
|
-
let l = (s.left + c.x) /
|
|
846
|
-
if (
|
|
847
|
-
const m =
|
|
848
|
-
let d = m, p =
|
|
884
|
+
const s = t.getBoundingClientRect(), r = Vt(t);
|
|
885
|
+
let i = C(1);
|
|
886
|
+
e && (n ? k(n) && (i = Q(n)) : i = Q(t));
|
|
887
|
+
const c = cn(r, o, n) ? ge(r) : C(0);
|
|
888
|
+
let l = (s.left + c.x) / i.x, a = (s.top + c.y) / i.y, h = s.width / i.x, f = s.height / i.y;
|
|
889
|
+
if (r) {
|
|
890
|
+
const m = R(r), u = n && k(n) ? R(n) : n;
|
|
891
|
+
let d = m, p = Pt(d);
|
|
849
892
|
for (; p && n && u !== d; ) {
|
|
850
|
-
const w =
|
|
851
|
-
l *= w.x, a *= w.y, h *= w.x, f *= w.y, l += y, a += b, d =
|
|
893
|
+
const w = Q(p), g = p.getBoundingClientRect(), x = D(p), y = g.left + (p.clientLeft + parseFloat(x.paddingLeft)) * w.x, b = g.top + (p.clientTop + parseFloat(x.paddingTop)) * w.y;
|
|
894
|
+
l *= w.x, a *= w.y, h *= w.x, f *= w.y, l += y, a += b, d = R(p), p = Pt(d);
|
|
852
895
|
}
|
|
853
896
|
}
|
|
854
|
-
return
|
|
897
|
+
return pt({
|
|
855
898
|
width: h,
|
|
856
899
|
height: f,
|
|
857
900
|
x: l,
|
|
858
901
|
y: a
|
|
859
902
|
});
|
|
860
903
|
}
|
|
861
|
-
function
|
|
862
|
-
const o =
|
|
863
|
-
return e ? e.left + o : J(
|
|
904
|
+
function Nt(t, e) {
|
|
905
|
+
const o = vt(t).scrollLeft;
|
|
906
|
+
return e ? e.left + o : J(M(t)).left + o;
|
|
864
907
|
}
|
|
865
|
-
function
|
|
908
|
+
function pe(t, e, o) {
|
|
866
909
|
o === void 0 && (o = !1);
|
|
867
910
|
const n = t.getBoundingClientRect(), s = n.left + e.scrollLeft - (o ? 0 : (
|
|
868
911
|
// RTL <body> scrollbar.
|
|
869
|
-
|
|
870
|
-
)),
|
|
912
|
+
Nt(t, n)
|
|
913
|
+
)), r = n.top + e.scrollTop;
|
|
871
914
|
return {
|
|
872
915
|
x: s,
|
|
873
|
-
y:
|
|
916
|
+
y: r
|
|
874
917
|
};
|
|
875
918
|
}
|
|
876
|
-
function
|
|
919
|
+
function ln(t) {
|
|
877
920
|
let {
|
|
878
921
|
elements: e,
|
|
879
922
|
rect: o,
|
|
880
923
|
offsetParent: n,
|
|
881
924
|
strategy: s
|
|
882
925
|
} = t;
|
|
883
|
-
const
|
|
884
|
-
if (n ===
|
|
926
|
+
const r = s === "fixed", i = M(n), c = e ? xt(e.floating) : !1;
|
|
927
|
+
if (n === i || c && r)
|
|
885
928
|
return o;
|
|
886
929
|
let l = {
|
|
887
930
|
scrollLeft: 0,
|
|
888
931
|
scrollTop: 0
|
|
889
|
-
}, a =
|
|
890
|
-
const h =
|
|
891
|
-
if ((f || !f && !
|
|
932
|
+
}, a = C(1);
|
|
933
|
+
const h = C(0), f = W(n);
|
|
934
|
+
if ((f || !f && !r) && ((et(n) !== "body" || ut(i)) && (l = vt(n)), W(n))) {
|
|
892
935
|
const u = J(n);
|
|
893
|
-
a =
|
|
936
|
+
a = Q(n), h.x = u.x + n.clientLeft, h.y = u.y + n.clientTop;
|
|
894
937
|
}
|
|
895
|
-
const m =
|
|
938
|
+
const m = i && !f && !r ? pe(i, l, !0) : C(0);
|
|
896
939
|
return {
|
|
897
940
|
width: o.width * a.x,
|
|
898
941
|
height: o.height * a.y,
|
|
@@ -900,54 +943,54 @@ function on(t) {
|
|
|
900
943
|
y: o.y * a.y - l.scrollTop * a.y + h.y + m.y
|
|
901
944
|
};
|
|
902
945
|
}
|
|
903
|
-
function
|
|
946
|
+
function an(t) {
|
|
904
947
|
return Array.from(t.getClientRects());
|
|
905
948
|
}
|
|
906
|
-
function
|
|
907
|
-
const e =
|
|
908
|
-
let
|
|
949
|
+
function un(t) {
|
|
950
|
+
const e = M(t), o = vt(t), n = t.ownerDocument.body, s = q(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = q(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
|
|
951
|
+
let i = -o.scrollLeft + Nt(t);
|
|
909
952
|
const c = -o.scrollTop;
|
|
910
|
-
return
|
|
953
|
+
return D(n).direction === "rtl" && (i += q(e.clientWidth, n.clientWidth) - s), {
|
|
911
954
|
width: s,
|
|
912
|
-
height:
|
|
913
|
-
x:
|
|
955
|
+
height: r,
|
|
956
|
+
x: i,
|
|
914
957
|
y: c
|
|
915
958
|
};
|
|
916
959
|
}
|
|
917
|
-
function
|
|
918
|
-
const o =
|
|
919
|
-
let
|
|
960
|
+
function fn(t, e) {
|
|
961
|
+
const o = R(t), n = M(t), s = o.visualViewport;
|
|
962
|
+
let r = n.clientWidth, i = n.clientHeight, c = 0, l = 0;
|
|
920
963
|
if (s) {
|
|
921
|
-
|
|
922
|
-
const a =
|
|
964
|
+
r = s.width, i = s.height;
|
|
965
|
+
const a = Mt();
|
|
923
966
|
(!a || a && e === "fixed") && (c = s.offsetLeft, l = s.offsetTop);
|
|
924
967
|
}
|
|
925
968
|
return {
|
|
926
|
-
width:
|
|
927
|
-
height:
|
|
969
|
+
width: r,
|
|
970
|
+
height: i,
|
|
928
971
|
x: c,
|
|
929
972
|
y: l
|
|
930
973
|
};
|
|
931
974
|
}
|
|
932
|
-
function
|
|
933
|
-
const o = J(t, !0, e === "fixed"), n = o.top + t.clientTop, s = o.left + t.clientLeft,
|
|
975
|
+
function hn(t, e) {
|
|
976
|
+
const o = J(t, !0, e === "fixed"), n = o.top + t.clientTop, s = o.left + t.clientLeft, r = W(t) ? Q(t) : C(1), i = t.clientWidth * r.x, c = t.clientHeight * r.y, l = s * r.x, a = n * r.y;
|
|
934
977
|
return {
|
|
935
|
-
width:
|
|
978
|
+
width: i,
|
|
936
979
|
height: c,
|
|
937
980
|
x: l,
|
|
938
981
|
y: a
|
|
939
982
|
};
|
|
940
983
|
}
|
|
941
|
-
function
|
|
984
|
+
function zt(t, e, o) {
|
|
942
985
|
let n;
|
|
943
986
|
if (e === "viewport")
|
|
944
|
-
n =
|
|
987
|
+
n = fn(t, o);
|
|
945
988
|
else if (e === "document")
|
|
946
|
-
n =
|
|
989
|
+
n = un(M(t));
|
|
947
990
|
else if (k(e))
|
|
948
|
-
n =
|
|
991
|
+
n = hn(e, o);
|
|
949
992
|
else {
|
|
950
|
-
const s =
|
|
993
|
+
const s = ge(t);
|
|
951
994
|
n = {
|
|
952
995
|
x: e.x - s.x,
|
|
953
996
|
y: e.y - s.y,
|
|
@@ -955,36 +998,36 @@ function Bt(t, e, o) {
|
|
|
955
998
|
height: e.height
|
|
956
999
|
};
|
|
957
1000
|
}
|
|
958
|
-
return
|
|
1001
|
+
return pt(n);
|
|
959
1002
|
}
|
|
960
|
-
function
|
|
961
|
-
const o =
|
|
962
|
-
return o === e || !k(o) ||
|
|
1003
|
+
function we(t, e) {
|
|
1004
|
+
const o = K(t);
|
|
1005
|
+
return o === e || !k(o) || tt(o) ? !1 : D(o).position === "fixed" || we(o, e);
|
|
963
1006
|
}
|
|
964
|
-
function
|
|
1007
|
+
function dn(t, e) {
|
|
965
1008
|
const o = e.get(t);
|
|
966
1009
|
if (o)
|
|
967
1010
|
return o;
|
|
968
|
-
let n =
|
|
969
|
-
const
|
|
970
|
-
let
|
|
971
|
-
for (; k(
|
|
972
|
-
const c =
|
|
973
|
-
!l && c.position === "fixed" && (s = null), (
|
|
1011
|
+
let n = rt(t, [], !1).filter((c) => k(c) && et(c) !== "body"), s = null;
|
|
1012
|
+
const r = D(t).position === "fixed";
|
|
1013
|
+
let i = r ? K(t) : t;
|
|
1014
|
+
for (; k(i) && !tt(i); ) {
|
|
1015
|
+
const c = D(i), l = Ft(i);
|
|
1016
|
+
!l && c.position === "fixed" && (s = null), (r ? !l && !s : !l && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || ut(i) && !l && we(t, i)) ? n = n.filter((h) => h !== i) : s = c, i = K(i);
|
|
974
1017
|
}
|
|
975
1018
|
return e.set(t, n), n;
|
|
976
1019
|
}
|
|
977
|
-
function
|
|
1020
|
+
function mn(t) {
|
|
978
1021
|
let {
|
|
979
1022
|
element: e,
|
|
980
1023
|
boundary: o,
|
|
981
1024
|
rootBoundary: n,
|
|
982
1025
|
strategy: s
|
|
983
1026
|
} = t;
|
|
984
|
-
const
|
|
985
|
-
const f =
|
|
986
|
-
return a.top =
|
|
987
|
-
},
|
|
1027
|
+
const i = [...o === "clippingAncestors" ? xt(e) ? [] : dn(e, this._c) : [].concat(o), n], c = i[0], l = i.reduce((a, h) => {
|
|
1028
|
+
const f = zt(e, h, s);
|
|
1029
|
+
return a.top = q(f.top, a.top), a.right = Z(f.right, a.right), a.bottom = Z(f.bottom, a.bottom), a.left = q(f.left, a.left), a;
|
|
1030
|
+
}, zt(e, c, s));
|
|
988
1031
|
return {
|
|
989
1032
|
width: l.right - l.left,
|
|
990
1033
|
height: l.bottom - l.top,
|
|
@@ -992,73 +1035,73 @@ function un(t) {
|
|
|
992
1035
|
y: l.top
|
|
993
1036
|
};
|
|
994
1037
|
}
|
|
995
|
-
function
|
|
1038
|
+
function gn(t) {
|
|
996
1039
|
const {
|
|
997
1040
|
width: e,
|
|
998
1041
|
height: o
|
|
999
|
-
} =
|
|
1042
|
+
} = me(t);
|
|
1000
1043
|
return {
|
|
1001
1044
|
width: e,
|
|
1002
1045
|
height: o
|
|
1003
1046
|
};
|
|
1004
1047
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const n = W(e), s =
|
|
1048
|
+
function pn(t, e, o) {
|
|
1049
|
+
const n = W(e), s = M(e), r = o === "fixed", i = J(t, !0, r, e);
|
|
1007
1050
|
let c = {
|
|
1008
1051
|
scrollLeft: 0,
|
|
1009
1052
|
scrollTop: 0
|
|
1010
1053
|
};
|
|
1011
|
-
const l =
|
|
1054
|
+
const l = C(0);
|
|
1012
1055
|
function a() {
|
|
1013
|
-
l.x =
|
|
1056
|
+
l.x = Nt(s);
|
|
1014
1057
|
}
|
|
1015
|
-
if (n || !n && !
|
|
1016
|
-
if ((
|
|
1017
|
-
const u = J(e, !0,
|
|
1058
|
+
if (n || !n && !r)
|
|
1059
|
+
if ((et(e) !== "body" || ut(s)) && (c = vt(e)), n) {
|
|
1060
|
+
const u = J(e, !0, r, e);
|
|
1018
1061
|
l.x = u.x + e.clientLeft, l.y = u.y + e.clientTop;
|
|
1019
1062
|
} else s && a();
|
|
1020
|
-
|
|
1021
|
-
const h = s && !n && !
|
|
1063
|
+
r && !n && s && a();
|
|
1064
|
+
const h = s && !n && !r ? pe(s, c) : C(0), f = i.left + c.scrollLeft - l.x - h.x, m = i.top + c.scrollTop - l.y - h.y;
|
|
1022
1065
|
return {
|
|
1023
1066
|
x: f,
|
|
1024
1067
|
y: m,
|
|
1025
|
-
width:
|
|
1026
|
-
height:
|
|
1068
|
+
width: i.width,
|
|
1069
|
+
height: i.height
|
|
1027
1070
|
};
|
|
1028
1071
|
}
|
|
1029
|
-
function
|
|
1030
|
-
return
|
|
1072
|
+
function Ot(t) {
|
|
1073
|
+
return D(t).position === "static";
|
|
1031
1074
|
}
|
|
1032
|
-
function
|
|
1033
|
-
if (!W(t) ||
|
|
1075
|
+
function Kt(t, e) {
|
|
1076
|
+
if (!W(t) || D(t).position === "fixed")
|
|
1034
1077
|
return null;
|
|
1035
1078
|
if (e)
|
|
1036
1079
|
return e(t);
|
|
1037
1080
|
let o = t.offsetParent;
|
|
1038
|
-
return
|
|
1081
|
+
return M(t) === o && (o = o.ownerDocument.body), o;
|
|
1039
1082
|
}
|
|
1040
|
-
function
|
|
1041
|
-
const o =
|
|
1042
|
-
if (
|
|
1083
|
+
function ye(t, e) {
|
|
1084
|
+
const o = R(t);
|
|
1085
|
+
if (xt(t))
|
|
1043
1086
|
return o;
|
|
1044
1087
|
if (!W(t)) {
|
|
1045
|
-
let s =
|
|
1046
|
-
for (; s && !
|
|
1047
|
-
if (k(s) && !
|
|
1088
|
+
let s = K(t);
|
|
1089
|
+
for (; s && !tt(s); ) {
|
|
1090
|
+
if (k(s) && !Ot(s))
|
|
1048
1091
|
return s;
|
|
1049
|
-
s =
|
|
1092
|
+
s = K(s);
|
|
1050
1093
|
}
|
|
1051
1094
|
return o;
|
|
1052
1095
|
}
|
|
1053
|
-
let n =
|
|
1054
|
-
for (; n &&
|
|
1055
|
-
n =
|
|
1056
|
-
return n &&
|
|
1096
|
+
let n = Kt(t, e);
|
|
1097
|
+
for (; n && on(n) && Ot(n); )
|
|
1098
|
+
n = Kt(n, e);
|
|
1099
|
+
return n && tt(n) && Ot(n) && !Ft(n) ? o : n || sn(t) || o;
|
|
1057
1100
|
}
|
|
1058
|
-
const
|
|
1059
|
-
const e = this.getOffsetParent ||
|
|
1101
|
+
const wn = async function(t) {
|
|
1102
|
+
const e = this.getOffsetParent || ye, o = this.getDimensions, n = await o(t.floating);
|
|
1060
1103
|
return {
|
|
1061
|
-
reference:
|
|
1104
|
+
reference: pn(t.reference, await e(t.floating), t.strategy),
|
|
1062
1105
|
floating: {
|
|
1063
1106
|
x: 0,
|
|
1064
1107
|
y: 0,
|
|
@@ -1067,33 +1110,33 @@ const dn = async function(t) {
|
|
|
1067
1110
|
}
|
|
1068
1111
|
};
|
|
1069
1112
|
};
|
|
1070
|
-
function
|
|
1071
|
-
return
|
|
1072
|
-
}
|
|
1073
|
-
const
|
|
1074
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1075
|
-
getDocumentElement:
|
|
1076
|
-
getClippingRect:
|
|
1077
|
-
getOffsetParent:
|
|
1078
|
-
getElementRects:
|
|
1079
|
-
getClientRects:
|
|
1080
|
-
getDimensions:
|
|
1081
|
-
getScale:
|
|
1113
|
+
function yn(t) {
|
|
1114
|
+
return D(t).direction === "rtl";
|
|
1115
|
+
}
|
|
1116
|
+
const xn = {
|
|
1117
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: ln,
|
|
1118
|
+
getDocumentElement: M,
|
|
1119
|
+
getClippingRect: mn,
|
|
1120
|
+
getOffsetParent: ye,
|
|
1121
|
+
getElementRects: wn,
|
|
1122
|
+
getClientRects: an,
|
|
1123
|
+
getDimensions: gn,
|
|
1124
|
+
getScale: Q,
|
|
1082
1125
|
isElement: k,
|
|
1083
|
-
isRTL:
|
|
1126
|
+
isRTL: yn
|
|
1084
1127
|
};
|
|
1085
|
-
function
|
|
1128
|
+
function xe(t, e) {
|
|
1086
1129
|
return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
|
|
1087
1130
|
}
|
|
1088
|
-
function
|
|
1131
|
+
function vn(t, e) {
|
|
1089
1132
|
let o = null, n;
|
|
1090
|
-
const s =
|
|
1091
|
-
function
|
|
1133
|
+
const s = M(t);
|
|
1134
|
+
function r() {
|
|
1092
1135
|
var c;
|
|
1093
1136
|
clearTimeout(n), (c = o) == null || c.disconnect(), o = null;
|
|
1094
1137
|
}
|
|
1095
|
-
function
|
|
1096
|
-
c === void 0 && (c = !1), l === void 0 && (l = 1),
|
|
1138
|
+
function i(c, l) {
|
|
1139
|
+
c === void 0 && (c = !1), l === void 0 && (l = 1), r();
|
|
1097
1140
|
const a = t.getBoundingClientRect(), {
|
|
1098
1141
|
left: h,
|
|
1099
1142
|
top: f,
|
|
@@ -1102,21 +1145,21 @@ function pn(t, e) {
|
|
|
1102
1145
|
} = a;
|
|
1103
1146
|
if (c || e(), !m || !u)
|
|
1104
1147
|
return;
|
|
1105
|
-
const d =
|
|
1148
|
+
const d = ht(f), p = ht(s.clientWidth - (h + m)), w = ht(s.clientHeight - (f + u)), g = ht(h), y = {
|
|
1106
1149
|
rootMargin: -d + "px " + -p + "px " + -w + "px " + -g + "px",
|
|
1107
|
-
threshold:
|
|
1150
|
+
threshold: q(0, Z(1, l)) || 1
|
|
1108
1151
|
};
|
|
1109
1152
|
let b = !0;
|
|
1110
1153
|
function v(L) {
|
|
1111
1154
|
const A = L[0].intersectionRatio;
|
|
1112
1155
|
if (A !== l) {
|
|
1113
1156
|
if (!b)
|
|
1114
|
-
return
|
|
1115
|
-
A ?
|
|
1116
|
-
|
|
1157
|
+
return i();
|
|
1158
|
+
A ? i(!1, A) : n = setTimeout(() => {
|
|
1159
|
+
i(!1, 1e-7);
|
|
1117
1160
|
}, 1e3);
|
|
1118
1161
|
}
|
|
1119
|
-
A === 1 && !
|
|
1162
|
+
A === 1 && !xe(a, t.getBoundingClientRect()) && i(), b = !1;
|
|
1120
1163
|
}
|
|
1121
1164
|
try {
|
|
1122
1165
|
o = new IntersectionObserver(v, {
|
|
@@ -1129,25 +1172,25 @@ function pn(t, e) {
|
|
|
1129
1172
|
}
|
|
1130
1173
|
o.observe(t);
|
|
1131
1174
|
}
|
|
1132
|
-
return
|
|
1175
|
+
return i(!0), r;
|
|
1133
1176
|
}
|
|
1134
|
-
function
|
|
1177
|
+
function bn(t, e, o, n) {
|
|
1135
1178
|
n === void 0 && (n = {});
|
|
1136
1179
|
const {
|
|
1137
1180
|
ancestorScroll: s = !0,
|
|
1138
|
-
ancestorResize:
|
|
1139
|
-
elementResize:
|
|
1181
|
+
ancestorResize: r = !0,
|
|
1182
|
+
elementResize: i = typeof ResizeObserver == "function",
|
|
1140
1183
|
layoutShift: c = typeof IntersectionObserver == "function",
|
|
1141
1184
|
animationFrame: l = !1
|
|
1142
|
-
} = n, a =
|
|
1185
|
+
} = n, a = Vt(t), h = s || r ? [...a ? rt(a) : [], ...rt(e)] : [];
|
|
1143
1186
|
h.forEach((g) => {
|
|
1144
1187
|
s && g.addEventListener("scroll", o, {
|
|
1145
1188
|
passive: !0
|
|
1146
|
-
}),
|
|
1189
|
+
}), r && g.addEventListener("resize", o);
|
|
1147
1190
|
});
|
|
1148
|
-
const f = a && c ?
|
|
1191
|
+
const f = a && c ? vn(a, o) : null;
|
|
1149
1192
|
let m = -1, u = null;
|
|
1150
|
-
|
|
1193
|
+
i && (u = new ResizeObserver((g) => {
|
|
1151
1194
|
let [x] = g;
|
|
1152
1195
|
x && x.target === a && u && (u.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
|
|
1153
1196
|
var y;
|
|
@@ -1158,28 +1201,28 @@ function wn(t, e, o, n) {
|
|
|
1158
1201
|
l && w();
|
|
1159
1202
|
function w() {
|
|
1160
1203
|
const g = J(t);
|
|
1161
|
-
p && !
|
|
1204
|
+
p && !xe(p, g) && o(), p = g, d = requestAnimationFrame(w);
|
|
1162
1205
|
}
|
|
1163
1206
|
return o(), () => {
|
|
1164
1207
|
var g;
|
|
1165
1208
|
h.forEach((x) => {
|
|
1166
|
-
s && x.removeEventListener("scroll", o),
|
|
1209
|
+
s && x.removeEventListener("scroll", o), r && x.removeEventListener("resize", o);
|
|
1167
1210
|
}), f == null || f(), (g = u) == null || g.disconnect(), u = null, l && cancelAnimationFrame(d);
|
|
1168
1211
|
};
|
|
1169
1212
|
}
|
|
1170
|
-
const
|
|
1213
|
+
const An = en, On = nn, _t = Ze, Rn = Qe, En = (t, e, o) => {
|
|
1171
1214
|
const n = /* @__PURE__ */ new Map(), s = {
|
|
1172
|
-
platform:
|
|
1215
|
+
platform: xn,
|
|
1173
1216
|
...o
|
|
1174
|
-
},
|
|
1217
|
+
}, r = {
|
|
1175
1218
|
...s.platform,
|
|
1176
1219
|
_c: n
|
|
1177
1220
|
};
|
|
1178
|
-
return
|
|
1221
|
+
return Ge(t, e, {
|
|
1179
1222
|
...s,
|
|
1180
|
-
platform:
|
|
1223
|
+
platform: r
|
|
1181
1224
|
});
|
|
1182
|
-
},
|
|
1225
|
+
}, Qn = [
|
|
1183
1226
|
"top",
|
|
1184
1227
|
"top-start",
|
|
1185
1228
|
"top-end",
|
|
@@ -1192,22 +1235,25 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1192
1235
|
"left",
|
|
1193
1236
|
"left-start",
|
|
1194
1237
|
"left-end"
|
|
1195
|
-
],
|
|
1238
|
+
], Zn = (t, e = { isOpen: !1 }) => {
|
|
1196
1239
|
const o = [];
|
|
1197
1240
|
let n = null;
|
|
1198
|
-
const s = E.deriveProp(e.isOpen)
|
|
1241
|
+
const s = E.deriveProp(e.isOpen);
|
|
1242
|
+
function r(c) {
|
|
1199
1243
|
n = c, s.set(!0);
|
|
1200
|
-
}
|
|
1244
|
+
}
|
|
1245
|
+
function i() {
|
|
1201
1246
|
s.set(!1), o.forEach((c) => c()), o.length = 0;
|
|
1202
|
-
}
|
|
1203
|
-
return
|
|
1204
|
-
|
|
1247
|
+
}
|
|
1248
|
+
return st(
|
|
1249
|
+
t(r, i),
|
|
1250
|
+
ne(
|
|
1205
1251
|
s,
|
|
1206
|
-
() =>
|
|
1207
|
-
(c) =>
|
|
1252
|
+
() => $(
|
|
1253
|
+
(c) => ee(
|
|
1208
1254
|
"body",
|
|
1209
1255
|
Rt.div(
|
|
1210
|
-
|
|
1256
|
+
$((l) => {
|
|
1211
1257
|
l.style.position = "absolute";
|
|
1212
1258
|
const a = typeof (n == null ? void 0 : n.target) == "string" ? c.querySelector(
|
|
1213
1259
|
n.target
|
|
@@ -1215,7 +1261,7 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1215
1261
|
if (a == null)
|
|
1216
1262
|
throw new Error(`Target not found: ${n == null ? void 0 : n.target}`);
|
|
1217
1263
|
let h = null;
|
|
1218
|
-
const f = E.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), m = E.toSignal((n == null ? void 0 : n.crossAxisOffset) ?? 0), u = E.toSignal((n == null ? void 0 : n.placement) ?? "top"), d = E.toSignal((n == null ? void 0 : n.arrowPadding) ?? 0), p = n == null ? void 0 : n.arrow, w =
|
|
1264
|
+
const f = E.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), m = E.toSignal((n == null ? void 0 : n.crossAxisOffset) ?? 0), u = E.toSignal((n == null ? void 0 : n.placement) ?? "top"), d = E.toSignal((n == null ? void 0 : n.arrowPadding) ?? 0), p = n == null ? void 0 : n.arrow, w = H({
|
|
1219
1265
|
centerOffset: 0,
|
|
1220
1266
|
alignmentOffset: 0,
|
|
1221
1267
|
containerWidth: 0,
|
|
@@ -1225,21 +1271,21 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1225
1271
|
});
|
|
1226
1272
|
async function g() {
|
|
1227
1273
|
const y = [
|
|
1228
|
-
|
|
1229
|
-
|
|
1274
|
+
_t(),
|
|
1275
|
+
An({
|
|
1230
1276
|
mainAxis: f.get(),
|
|
1231
1277
|
crossAxis: m.get()
|
|
1232
1278
|
}),
|
|
1233
|
-
|
|
1234
|
-
|
|
1279
|
+
On(),
|
|
1280
|
+
_t()
|
|
1235
1281
|
];
|
|
1236
1282
|
p != null && h != null && y.push(
|
|
1237
|
-
|
|
1283
|
+
Rn({
|
|
1238
1284
|
element: h,
|
|
1239
1285
|
padding: d.get()
|
|
1240
1286
|
})
|
|
1241
1287
|
);
|
|
1242
|
-
const b = await
|
|
1288
|
+
const b = await En(a, l, {
|
|
1243
1289
|
placement: u.get(),
|
|
1244
1290
|
strategy: "absolute",
|
|
1245
1291
|
middleware: y
|
|
@@ -1247,13 +1293,13 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1247
1293
|
if (l.style.top = `${L}px`, l.style.left = `${v}px`, h != null && A.arrow != null) {
|
|
1248
1294
|
const {
|
|
1249
1295
|
x: _,
|
|
1250
|
-
y:
|
|
1296
|
+
y: V,
|
|
1251
1297
|
centerOffset: S,
|
|
1252
1298
|
alignmentOffset: I
|
|
1253
1299
|
} = A.arrow;
|
|
1254
1300
|
w.set({
|
|
1255
1301
|
x: _,
|
|
1256
|
-
y:
|
|
1302
|
+
y: V,
|
|
1257
1303
|
centerOffset: S,
|
|
1258
1304
|
alignmentOffset: I,
|
|
1259
1305
|
containerWidth: l.offsetWidth,
|
|
@@ -1261,16 +1307,16 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1261
1307
|
});
|
|
1262
1308
|
}
|
|
1263
1309
|
}
|
|
1264
|
-
const x =
|
|
1310
|
+
const x = Oe(
|
|
1265
1311
|
f,
|
|
1266
1312
|
m,
|
|
1267
1313
|
u
|
|
1268
1314
|
)(g);
|
|
1269
|
-
return
|
|
1315
|
+
return st(
|
|
1270
1316
|
n == null ? void 0 : n.content,
|
|
1271
1317
|
(n == null ? void 0 : n.arrow) != null ? Rt.div(
|
|
1272
1318
|
n == null ? void 0 : n.arrow(
|
|
1273
|
-
|
|
1319
|
+
oe(
|
|
1274
1320
|
w,
|
|
1275
1321
|
u
|
|
1276
1322
|
)((y, b) => ({
|
|
@@ -1278,13 +1324,13 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1278
1324
|
placement: b
|
|
1279
1325
|
}))
|
|
1280
1326
|
),
|
|
1281
|
-
|
|
1327
|
+
$((y) => {
|
|
1282
1328
|
h = y, g();
|
|
1283
1329
|
})
|
|
1284
1330
|
) : null,
|
|
1285
|
-
|
|
1331
|
+
F(
|
|
1286
1332
|
w.dispose,
|
|
1287
|
-
|
|
1333
|
+
bn(a, l, g),
|
|
1288
1334
|
x
|
|
1289
1335
|
)
|
|
1290
1336
|
);
|
|
@@ -1292,25 +1338,24 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1292
1338
|
)
|
|
1293
1339
|
)
|
|
1294
1340
|
)
|
|
1295
|
-
)
|
|
1296
|
-
t(i, r)
|
|
1341
|
+
)
|
|
1297
1342
|
);
|
|
1298
|
-
},
|
|
1299
|
-
const n =
|
|
1300
|
-
(f) =>
|
|
1301
|
-
),
|
|
1302
|
-
(f) =>
|
|
1303
|
-
),
|
|
1343
|
+
}, Ln = (t, e, o) => {
|
|
1344
|
+
const n = H(U.notAsked), s = n.map(
|
|
1345
|
+
(f) => U.isSuccess(f) ? f.value : void 0
|
|
1346
|
+
), r = n.map(
|
|
1347
|
+
(f) => U.isFailure(f) ? f.error : void 0
|
|
1348
|
+
), i = n.map((f) => U.isLoading(f));
|
|
1304
1349
|
let c;
|
|
1305
1350
|
const l = async (f) => {
|
|
1306
1351
|
c == null || c.abort(), c = new AbortController();
|
|
1307
1352
|
const m = c.signal, u = n.get();
|
|
1308
|
-
n.set(
|
|
1353
|
+
n.set(U.loading(U.getOrUndefined(u)));
|
|
1309
1354
|
try {
|
|
1310
1355
|
const d = await e({ request: f, abortSignal: m, previous: u });
|
|
1311
|
-
await Promise.resolve(), c = void 0, n.set(
|
|
1356
|
+
await Promise.resolve(), c = void 0, n.set(U.success(d));
|
|
1312
1357
|
} catch (d) {
|
|
1313
|
-
c = void 0, n.set(
|
|
1358
|
+
c = void 0, n.set(U.failure(o(d)));
|
|
1314
1359
|
}
|
|
1315
1360
|
}, a = () => l(E.get(t)), h = () => {
|
|
1316
1361
|
c == null || c.abort(), c = void 0, n.dispose();
|
|
@@ -1318,44 +1363,44 @@ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, o) => {
|
|
|
1318
1363
|
return n.onDispose(E.on(t, l)), {
|
|
1319
1364
|
status: n,
|
|
1320
1365
|
value: s,
|
|
1321
|
-
error:
|
|
1322
|
-
loading:
|
|
1366
|
+
error: r,
|
|
1367
|
+
loading: i,
|
|
1323
1368
|
reload: a,
|
|
1324
1369
|
dispose: h
|
|
1325
1370
|
};
|
|
1326
|
-
},
|
|
1327
|
-
const { status: o, dispose: n, reload: s } = t, { loading:
|
|
1328
|
-
return
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
loading:
|
|
1332
|
-
failure:
|
|
1371
|
+
}, Sn = (t, e) => {
|
|
1372
|
+
const { status: o, dispose: n, reload: s } = t, { loading: r, failure: i, success: c } = e;
|
|
1373
|
+
return st(
|
|
1374
|
+
F(n),
|
|
1375
|
+
ce(o, {
|
|
1376
|
+
loading: r != null ? (l) => r(l, s) : void 0,
|
|
1377
|
+
failure: i != null ? (l) => i(l, s) : void 0,
|
|
1333
1378
|
success: (l) => c(l, s)
|
|
1334
1379
|
})
|
|
1335
1380
|
);
|
|
1336
|
-
},
|
|
1381
|
+
}, to = ({
|
|
1337
1382
|
request: t,
|
|
1338
1383
|
load: e,
|
|
1339
1384
|
mapError: o = (n) => n
|
|
1340
1385
|
}) => {
|
|
1341
|
-
const n =
|
|
1342
|
-
return (s) =>
|
|
1343
|
-
},
|
|
1386
|
+
const n = Ln(t, e, o);
|
|
1387
|
+
return (s) => Sn(n, s);
|
|
1388
|
+
}, Tn = (t, e) => {
|
|
1344
1389
|
if (typeof e == "function")
|
|
1345
|
-
return
|
|
1346
|
-
const o = e.failure ?? ((s) =>
|
|
1347
|
-
|
|
1348
|
-
s.map((
|
|
1390
|
+
return Tn(t, { success: e });
|
|
1391
|
+
const o = e.failure ?? ((s) => st(
|
|
1392
|
+
F(s.on(console.error)),
|
|
1393
|
+
s.map((r) => `Error: ${r}`)
|
|
1349
1394
|
)), n = e.success;
|
|
1350
|
-
return
|
|
1395
|
+
return te(E.toSignal(t), {
|
|
1351
1396
|
Success: (s) => n(s.$.value),
|
|
1352
1397
|
Failure: (s) => o(s.$.error)
|
|
1353
1398
|
});
|
|
1354
|
-
},
|
|
1399
|
+
}, eo = () => Qt.focus((t) => {
|
|
1355
1400
|
var e;
|
|
1356
1401
|
return (e = t.target) == null ? void 0 : e.select();
|
|
1357
1402
|
});
|
|
1358
|
-
class
|
|
1403
|
+
class bt {
|
|
1359
1404
|
/**
|
|
1360
1405
|
* Creates a new Rect instance.
|
|
1361
1406
|
*
|
|
@@ -1394,7 +1439,7 @@ class vt {
|
|
|
1394
1439
|
* console.log(rect1.equals(rect3)); // true (within tolerance)
|
|
1395
1440
|
* ```
|
|
1396
1441
|
*/
|
|
1397
|
-
|
|
1442
|
+
At(this, "equals", (e) => ft(this.left, e.left) && ft(this.top, e.top) && ft(this.width, e.width) && ft(this.height, e.height));
|
|
1398
1443
|
this.left = e, this.top = o, this.width = n, this.height = s;
|
|
1399
1444
|
}
|
|
1400
1445
|
/**
|
|
@@ -1428,7 +1473,7 @@ class vt {
|
|
|
1428
1473
|
width: n = 0,
|
|
1429
1474
|
height: s = 0
|
|
1430
1475
|
}) {
|
|
1431
|
-
return new
|
|
1476
|
+
return new bt(e, o, n, s);
|
|
1432
1477
|
}
|
|
1433
1478
|
/**
|
|
1434
1479
|
* Gets the x-coordinate of the right edge of the rectangle.
|
|
@@ -1494,96 +1539,96 @@ class vt {
|
|
|
1494
1539
|
return { width: this.width, height: this.height };
|
|
1495
1540
|
}
|
|
1496
1541
|
}
|
|
1497
|
-
function
|
|
1542
|
+
function It(t) {
|
|
1498
1543
|
const e = t.getBoundingClientRect();
|
|
1499
|
-
return
|
|
1544
|
+
return bt.of({
|
|
1500
1545
|
top: e.top + window.scrollY,
|
|
1501
1546
|
left: e.left + window.scrollX,
|
|
1502
1547
|
width: e.width,
|
|
1503
1548
|
height: e.height
|
|
1504
1549
|
});
|
|
1505
1550
|
}
|
|
1506
|
-
const
|
|
1507
|
-
const { element: o } = e, n =
|
|
1508
|
-
n.set(
|
|
1551
|
+
const Pn = (t) => Re((e) => {
|
|
1552
|
+
const { element: o } = e, n = H(It(o)), s = Dt(t(n))(e), r = () => {
|
|
1553
|
+
n.set(bt.of(It(o)));
|
|
1509
1554
|
};
|
|
1510
|
-
let
|
|
1511
|
-
return typeof ResizeObserver == "function" && (
|
|
1512
|
-
|
|
1555
|
+
let i;
|
|
1556
|
+
return typeof ResizeObserver == "function" && (i = new ResizeObserver(r), i.observe(o)), F((c) => {
|
|
1557
|
+
i == null || i.disconnect(), s(c);
|
|
1513
1558
|
});
|
|
1514
|
-
}),
|
|
1515
|
-
const o =
|
|
1559
|
+
}), no = (t) => Pn(t), oo = (t) => (e) => {
|
|
1560
|
+
const o = ct(), n = H({
|
|
1516
1561
|
width: (o == null ? void 0 : o.innerWidth) ?? 0,
|
|
1517
1562
|
height: (o == null ? void 0 : o.innerHeight) ?? 0
|
|
1518
|
-
}), s =
|
|
1563
|
+
}), s = Dt(t(n))(e), r = () => {
|
|
1519
1564
|
n.set({
|
|
1520
1565
|
width: (o == null ? void 0 : o.innerWidth) ?? 0,
|
|
1521
1566
|
height: (o == null ? void 0 : o.innerHeight) ?? 0
|
|
1522
1567
|
});
|
|
1523
1568
|
};
|
|
1524
|
-
return o == null || o.addEventListener("resize",
|
|
1525
|
-
o == null || o.removeEventListener("resize",
|
|
1569
|
+
return o == null || o.addEventListener("resize", r), (i) => {
|
|
1570
|
+
o == null || o.removeEventListener("resize", r), s(i);
|
|
1526
1571
|
};
|
|
1527
|
-
},
|
|
1572
|
+
}, kn = (t, e) => {
|
|
1528
1573
|
const o = e.split("/").filter((s) => s !== ""), n = {};
|
|
1529
1574
|
for (let s = 0; s < t.length; s++) {
|
|
1530
|
-
const
|
|
1531
|
-
if (!
|
|
1575
|
+
const r = t[s], i = o[s];
|
|
1576
|
+
if (!i && r.type !== "catch-all")
|
|
1532
1577
|
return null;
|
|
1533
|
-
if (
|
|
1534
|
-
if (
|
|
1578
|
+
if (r.type === "literal") {
|
|
1579
|
+
if (r.value !== i)
|
|
1535
1580
|
return null;
|
|
1536
|
-
} else if (
|
|
1537
|
-
n[
|
|
1538
|
-
else if (
|
|
1581
|
+
} else if (r.type === "param")
|
|
1582
|
+
n[r.name] = i;
|
|
1583
|
+
else if (r.type === "catch-all")
|
|
1539
1584
|
return { params: n, path: e };
|
|
1540
1585
|
}
|
|
1541
1586
|
return o.length !== t.length ? null : { params: n, path: e };
|
|
1542
|
-
},
|
|
1587
|
+
}, Dn = (t) => t.split("/").map((e) => e.startsWith(":") ? { type: "param", name: e.slice(1) } : e === "*" ? { type: "catch-all" } : { type: "literal", value: e }).filter((e) => e.type !== "literal" || e.value !== ""), Cn = (t) => {
|
|
1543
1588
|
const e = t.map((o) => {
|
|
1544
|
-
const n =
|
|
1589
|
+
const n = Dn(o);
|
|
1545
1590
|
return { route: o, segments: n };
|
|
1546
1591
|
});
|
|
1547
1592
|
return function(n) {
|
|
1548
|
-
for (const { segments: s, route:
|
|
1549
|
-
const
|
|
1550
|
-
if (
|
|
1551
|
-
return { ...
|
|
1593
|
+
for (const { segments: s, route: r } of e) {
|
|
1594
|
+
const i = kn(s, n);
|
|
1595
|
+
if (i)
|
|
1596
|
+
return { ...i, route: r };
|
|
1552
1597
|
}
|
|
1553
1598
|
return null;
|
|
1554
1599
|
};
|
|
1555
|
-
},
|
|
1556
|
-
const e =
|
|
1557
|
-
return
|
|
1600
|
+
}, so = (t) => {
|
|
1601
|
+
const e = Cn(Object.keys(t));
|
|
1602
|
+
return Gt(ie, (o) => {
|
|
1558
1603
|
const n = o.map((s) => {
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1604
|
+
const r = e(s.pathname);
|
|
1605
|
+
if (r == null)
|
|
1561
1606
|
throw console.error("No route found for", s), new Error("No route found");
|
|
1562
1607
|
return {
|
|
1563
|
-
params:
|
|
1564
|
-
route:
|
|
1565
|
-
path:
|
|
1608
|
+
params: r.params,
|
|
1609
|
+
route: r.route,
|
|
1610
|
+
path: r.path,
|
|
1566
1611
|
search: s.search,
|
|
1567
1612
|
hash: s.hash
|
|
1568
1613
|
};
|
|
1569
1614
|
});
|
|
1570
|
-
return
|
|
1615
|
+
return Ee(
|
|
1571
1616
|
n.map((s) => [s.route, s]),
|
|
1572
1617
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1573
1618
|
t
|
|
1574
1619
|
);
|
|
1575
1620
|
});
|
|
1576
|
-
},
|
|
1621
|
+
}, wt = 60 * 1e3, kt = 60 * wt, it = 24 * kt, jt = 7 * it, Yt = 30 * it, Wn = 365 * it, Fn = [
|
|
1577
1622
|
{
|
|
1578
|
-
max:
|
|
1579
|
-
value:
|
|
1623
|
+
max: wt * 90,
|
|
1624
|
+
value: wt,
|
|
1580
1625
|
name: "minute",
|
|
1581
1626
|
past: { singular: "a minute ago", plural: "{} minutes ago" },
|
|
1582
1627
|
future: { singular: "in a minute", plural: "in {} minutes" }
|
|
1583
1628
|
},
|
|
1584
1629
|
{
|
|
1585
|
-
max:
|
|
1586
|
-
value:
|
|
1630
|
+
max: kt * 36,
|
|
1631
|
+
value: kt,
|
|
1587
1632
|
name: "hour",
|
|
1588
1633
|
past: { singular: "an hour ago", plural: "{} hours ago" },
|
|
1589
1634
|
future: { singular: "in an hour", plural: "in {} hours" }
|
|
@@ -1596,28 +1641,28 @@ const En = (t) => be((e) => {
|
|
|
1596
1641
|
future: { singular: "tomorrow", plural: "in {} days" }
|
|
1597
1642
|
},
|
|
1598
1643
|
{
|
|
1599
|
-
max:
|
|
1600
|
-
value:
|
|
1644
|
+
max: jt * 6,
|
|
1645
|
+
value: jt,
|
|
1601
1646
|
name: "week",
|
|
1602
1647
|
past: { singular: "last week", plural: "{} weeks ago" },
|
|
1603
1648
|
future: { singular: "in a week", plural: "in {} weeks" }
|
|
1604
1649
|
},
|
|
1605
1650
|
{
|
|
1606
|
-
max:
|
|
1607
|
-
value:
|
|
1651
|
+
max: Yt * 18,
|
|
1652
|
+
value: Yt,
|
|
1608
1653
|
name: "month",
|
|
1609
1654
|
past: { singular: "last month", plural: "{} months ago" },
|
|
1610
1655
|
future: { singular: "in a month", plural: "in {} months" }
|
|
1611
1656
|
},
|
|
1612
1657
|
{
|
|
1613
1658
|
max: 1 / 0,
|
|
1614
|
-
value:
|
|
1659
|
+
value: Wn,
|
|
1615
1660
|
name: "year",
|
|
1616
1661
|
past: { singular: "last year", plural: "{} years ago" },
|
|
1617
1662
|
future: { singular: "in a year", plural: "in {} years" }
|
|
1618
1663
|
}
|
|
1619
1664
|
];
|
|
1620
|
-
function
|
|
1665
|
+
function qt(t, e, o, n) {
|
|
1621
1666
|
const s = Math.round(t / e);
|
|
1622
1667
|
return s <= 1 ? o : n.replace(
|
|
1623
1668
|
"{}",
|
|
@@ -1627,78 +1672,83 @@ function Yt(t, e, o, n) {
|
|
|
1627
1672
|
})
|
|
1628
1673
|
);
|
|
1629
1674
|
}
|
|
1630
|
-
const
|
|
1631
|
-
const e =
|
|
1675
|
+
const Mn = (t = 1e3) => {
|
|
1676
|
+
const e = H(/* @__PURE__ */ new Date()), o = Se(() => e.set(/* @__PURE__ */ new Date()), t);
|
|
1632
1677
|
return e.onDispose(o), e;
|
|
1633
|
-
},
|
|
1678
|
+
}, Vn = (t) => {
|
|
1634
1679
|
const e = Math.abs(t);
|
|
1635
|
-
if (e <
|
|
1680
|
+
if (e < wt)
|
|
1636
1681
|
return t < 0 ? "just now" : "in a moment";
|
|
1637
|
-
for (const o of
|
|
1682
|
+
for (const o of Fn)
|
|
1638
1683
|
if (e < o.max)
|
|
1639
|
-
return t < 0 ?
|
|
1684
|
+
return t < 0 ? qt(e, o.value, o.past.singular, o.past.plural) : qt(e, o.value, o.future.singular, o.future.plural);
|
|
1640
1685
|
throw new Error("unreachable");
|
|
1641
|
-
},
|
|
1642
|
-
const n = e != null ?
|
|
1686
|
+
}, Nn = (t, { now: e, frequency: o = 1e4 } = {}) => {
|
|
1687
|
+
const n = e != null ? Jt.is(e) ? e.derive() : H(e) : Mn(o), s = oe(
|
|
1643
1688
|
t,
|
|
1644
1689
|
n
|
|
1645
|
-
)((
|
|
1690
|
+
)((r, i) => r.getTime() - i.getTime());
|
|
1646
1691
|
return s.onDispose(() => E.dispose(n)), s;
|
|
1647
|
-
},
|
|
1648
|
-
const o =
|
|
1692
|
+
}, $n = (t, e = {}) => {
|
|
1693
|
+
const o = Nn(t, e), n = o.map(Vn);
|
|
1649
1694
|
return n.onDispose(o.dispose), n;
|
|
1650
|
-
},
|
|
1651
|
-
class
|
|
1695
|
+
}, ro = (t, e = {}) => $n(t, e);
|
|
1696
|
+
class Hn extends Le {
|
|
1652
1697
|
constructor() {
|
|
1653
1698
|
super(...arguments);
|
|
1654
1699
|
/**
|
|
1655
1700
|
* Triggers an update of the Ticker by incrementing its internal value.
|
|
1656
1701
|
* @returns void
|
|
1657
1702
|
*/
|
|
1658
|
-
|
|
1703
|
+
At(this, "tick", () => this.update((o) => o + 1));
|
|
1659
1704
|
}
|
|
1660
1705
|
}
|
|
1661
|
-
const
|
|
1706
|
+
const io = (t = 0) => new Hn(t, (e, o) => e === o);
|
|
1662
1707
|
export {
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1708
|
+
$e as Anchor,
|
|
1709
|
+
Kn as Appearance,
|
|
1710
|
+
ce as AsyncResultView,
|
|
1711
|
+
_n as AutoFocus,
|
|
1712
|
+
In as AutoSelect,
|
|
1713
|
+
Pn as ElementRect,
|
|
1714
|
+
no as ElementSize,
|
|
1715
|
+
Yn as HTMLTitle,
|
|
1716
|
+
jn as HiddenWhenEmpty,
|
|
1717
|
+
ze as InViewport,
|
|
1718
|
+
ie as Location,
|
|
1719
|
+
Xn as OnClickOutside,
|
|
1720
|
+
Jn as OnEnterKey,
|
|
1721
|
+
Gn as OnEscapeKey,
|
|
1722
|
+
le as OnKeyPressed,
|
|
1723
|
+
Zn as PopOver,
|
|
1724
|
+
bt as Rect,
|
|
1725
|
+
to as Resource,
|
|
1726
|
+
Sn as ResourceDisplay,
|
|
1727
|
+
Tn as ResultView,
|
|
1728
|
+
so as Router,
|
|
1729
|
+
eo as SelectOnFocus,
|
|
1730
|
+
Hn as Ticker,
|
|
1731
|
+
qn as WhenInViewport,
|
|
1732
|
+
oo as WindowSize,
|
|
1733
|
+
Pe as _checkExtensionCondition,
|
|
1734
|
+
Te as _getExtension,
|
|
1735
|
+
Cn as _makeRouteMatcher,
|
|
1736
|
+
Dn as _parseRouteSegments,
|
|
1737
|
+
Qn as allPlacements,
|
|
1738
|
+
Ce as areLocationsEqual,
|
|
1739
|
+
It as getAbsoluteRect,
|
|
1740
|
+
De as handleAnchorClick,
|
|
1741
|
+
re as locationFromURL,
|
|
1742
|
+
Ln as makeResource,
|
|
1743
|
+
Ke as matchesKeyCombo,
|
|
1744
|
+
kn as matchesRoute,
|
|
1745
|
+
Mn as nowSignal,
|
|
1746
|
+
ro as relativeTime,
|
|
1747
|
+
Nn as relativeTimeMillisSignal,
|
|
1748
|
+
$n as relativeTimeSignal,
|
|
1749
|
+
$t as setLocationFromUrl,
|
|
1750
|
+
io as ticker,
|
|
1751
|
+
Vn as timeDiffToString,
|
|
1752
|
+
Lt as urlFromLocation,
|
|
1753
|
+
He as useAppearance
|
|
1704
1754
|
};
|