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