@tempots/ui 4.2.3 → 4.3.0

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