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