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