@tempots/ui 6.1.0 → 6.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,7 +1,7 @@
1
1
  var Le = Object.defineProperty;
2
2
  var Pe = (t, e, o) => e in t ? Le(t, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[e] = o;
3
- var At = (t, e, o) => Pe(t, typeof e != "symbol" ? e + "" : e, o);
4
- import { getWindow as at, prop as F, makeProviderMark as Wt, Signal as te, Use as rt, html as Et, on as ee, Value as E, attr as ne, Empty as Lt, OneOfType as oe, WithElement as H, OnDispose as M, Portal as re, Fragment as st, renderableOfTNode as Ft, When as se, effectOf as Se, computedOf as ie, WithBrowserCtx as Te, Provide as ke, OneOfTuple as ce, Prop as Ce } from "@tempots/dom";
3
+ var Ot = (t, e, o) => Pe(t, typeof e != "symbol" ? e + "" : e, o);
4
+ import { getWindow as at, prop as F, makeProviderMark as Wt, Signal as ee, Use as st, html as Et, on as ne, Value as A, attr as Ft, Empty as Lt, OneOfType as oe, WithElement as H, OnDispose as M, Fragment as q, Portal as re, renderableOfTNode as Mt, When as se, effectOf as Se, computedOf as ie, WithBrowserCtx as Te, Provide as ke, OneOfTuple as ce, Prop as Ce } from "@tempots/dom";
5
5
  import { delayed as ae, AsyncResult as U, nearEqual as ht, interval as De } from "@tempots/std";
6
6
  const We = (t) => {
7
7
  const e = t.split("/").pop();
@@ -52,7 +52,7 @@ const We = (t) => {
52
52
  search: n,
53
53
  hash: r === "" ? void 0 : r
54
54
  };
55
- }, zt = (t, e) => {
55
+ }, Kt = (t, e) => {
56
56
  const o = le(e);
57
57
  return t.set(o), t;
58
58
  }, Pt = (t) => {
@@ -99,7 +99,7 @@ const We = (t) => {
99
99
  value: t,
100
100
  dispose: t.dispose
101
101
  };
102
- }, Mt = {
102
+ }, Nt = {
103
103
  mark: Wt("Location"),
104
104
  create: (t, e) => {
105
105
  if (e.isBrowser())
@@ -111,34 +111,34 @@ const We = (t) => {
111
111
  }, ze = (t) => {
112
112
  document.startViewTransition ? document.startViewTransition(t) : t();
113
113
  }, Ke = (t, ...e) => {
114
- if (typeof t == "string" || te.is(t))
114
+ if (typeof t == "string" || ee.is(t))
115
115
  return Ke({ href: t }, ...e);
116
116
  const {
117
117
  href: o,
118
118
  withViewTransition: n,
119
119
  ...r
120
120
  } = t;
121
- return rt(Mt, (s) => Et.a(
122
- ee.click(
121
+ return st(Nt, (s) => Et.a(
122
+ ne.click(
123
123
  Ne(() => (n === !0 ? ze(() => {
124
- zt(s, E.get(o));
125
- }) : zt(s, E.get(o)), !0), r)
124
+ Kt(s, A.get(o));
125
+ }) : Kt(s, A.get(o)), !0), r)
126
126
  ),
127
- ne.href(o),
127
+ Ft.href(o),
128
128
  ...e
129
129
  /* c8 ignore next 2 */
130
130
  ));
131
- }, In = {
131
+ }, Yn = {
132
132
  mark: Wt("Appearance"),
133
133
  create: () => {
134
- const t = _e();
134
+ const t = je();
135
135
  return {
136
136
  value: t,
137
137
  dispose: t.dispose
138
138
  };
139
139
  }
140
140
  };
141
- function _e() {
141
+ function je() {
142
142
  const t = at(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, o = (e == null ? void 0 : e.matches) ?? !1, n = F(o ? "dark" : "light"), r = (s) => n.set(s.matches ? "dark" : "light");
143
143
  return e == null || e.addEventListener("change", r), n.onDispose(() => e == null ? void 0 : e.removeEventListener("change", r)), n;
144
144
  }
@@ -146,21 +146,30 @@ const ue = (t, e) => {
146
146
  if (typeof e == "function")
147
147
  return ue(t, { success: e });
148
148
  const o = e.failure ?? ((i) => i.map((c) => `Error: ${c}`)), n = e.success, r = e.loading ?? (() => Lt), s = e.notAsked ?? (() => Lt);
149
- return oe(E.toSignal(t), {
149
+ return oe(A.toSignal(t), {
150
150
  AsyncSuccess: (i) => n(i.$.value),
151
151
  AsyncFailure: (i) => o(i.$.error),
152
152
  Loading: (i) => r(i.map((c) => c.previousValue)),
153
153
  NotAsked: s
154
154
  });
155
- }, Yn = (t = 10) => H((e) => M(ae(() => e == null ? void 0 : e.focus(), t))), qn = (t = 10) => H((e) => {
155
+ }, qn = (t = 10) => H((e) => M(ae(() => e == null ? void 0 : e.focus(), t))), Xn = (t = 10) => H((e) => {
156
156
  const o = ae(() => e.select(), t);
157
157
  return M(o);
158
- }), Xn = H((t) => {
158
+ });
159
+ function Jn(t) {
160
+ const e = Object.entries(t);
161
+ return q(
162
+ ...e.map(
163
+ ([o, n]) => Ft.class(A.map(n, (r) => r ? o : void 0))
164
+ )
165
+ );
166
+ }
167
+ const Gn = H((t) => {
159
168
  const e = t.style.getPropertyValue(":empty");
160
169
  return t.style.setProperty(":empty", "display:none"), M((o) => {
161
170
  o && t.style.setProperty(":empty", e);
162
171
  });
163
- }), Jn = (t) => re("head > title", ne.innerText(t)), je = {
172
+ }), Qn = (t) => re("head > title", Ft.innerText(t)), _e = {
164
173
  partial: {
165
174
  root: null,
166
175
  rootMargin: "0px",
@@ -174,27 +183,27 @@ const ue = (t, e) => {
174
183
  }, mt = {
175
184
  partial: /* @__PURE__ */ new Map(),
176
185
  full: /* @__PURE__ */ new Map()
177
- }, ot = {
186
+ }, rt = {
178
187
  partial: null,
179
188
  full: null
180
189
  };
181
190
  function Ie(t) {
182
- return ot[t] == null && (ot[t] = new IntersectionObserver((e) => {
191
+ return rt[t] == null && (rt[t] = new IntersectionObserver((e) => {
183
192
  e.forEach((o) => {
184
193
  const n = mt[t].get(o.target);
185
194
  n == null || n.set(o.isIntersecting);
186
195
  });
187
- }, je[t])), ot[t];
196
+ }, _e[t])), rt[t];
188
197
  }
189
198
  const Ye = ({ mode: t = "partial", once: e = !1 }, o) => {
190
199
  const n = F(!1);
191
- return st(
200
+ return q(
192
201
  H((r) => {
193
202
  const s = typeof IntersectionObserver < "u" ? Ie(t) : null;
194
203
  mt[t].set(r, n), s == null || s.observe(r);
195
204
  function i() {
196
205
  var a;
197
- s == null || s.unobserve(r), mt[t].delete(r), mt[t].size === 0 && ((a = ot[t]) == null || a.disconnect(), ot[t] = null);
206
+ s == null || s.unobserve(r), mt[t].delete(r), mt[t].size === 0 && ((a = rt[t]) == null || a.disconnect(), rt[t] = null);
198
207
  }
199
208
  let c = null;
200
209
  return e && (c = n.on((a) => {
@@ -203,10 +212,10 @@ const Ye = ({ mode: t = "partial", once: e = !1 }, o) => {
203
212
  n.dispose(), i(), c == null || c();
204
213
  });
205
214
  }),
206
- Ft(o(n))
215
+ Mt(o(n))
207
216
  );
208
- }, Gn = (t, e, o) => Ye(t, (n) => se(n, e, o ?? (() => Lt)));
209
- function Qn(t) {
217
+ }, Zn = (t, e, o) => Ye(t, (n) => se(n, e, o ?? (() => Lt)));
218
+ function qe(t) {
210
219
  return H((e) => {
211
220
  const o = (n) => {
212
221
  e.contains(n.target) || t(n);
@@ -216,9 +225,9 @@ function Qn(t) {
216
225
  });
217
226
  });
218
227
  }
219
- const G = (t, e) => t === void 0 || t === e, Kt = (t, e) => t === void 0 || t === e;
220
- function qe(t, e) {
221
- return typeof t == "string" ? e.key === t : Kt(t.key, e.key) && Kt(t.code, e.code) && G(t.ctrlKey, e.ctrlKey) && G(t.altKey, e.altKey) && G(t.shiftKey, e.shiftKey) && G(t.metaKey, e.metaKey) && G(t.repeat, e.repeat) && G(
228
+ const Q = (t, e) => t === void 0 || t === e, jt = (t, e) => t === void 0 || t === e;
229
+ function Xe(t, e) {
230
+ return typeof t == "string" ? e.key === t : jt(t.key, e.key) && jt(t.code, e.code) && Q(t.ctrlKey, e.ctrlKey) && Q(t.altKey, e.altKey) && Q(t.shiftKey, e.shiftKey) && Q(t.metaKey, e.metaKey) && Q(t.repeat, e.repeat) && Q(
222
231
  t.commandOrControlKey,
223
232
  e.metaKey || e.ctrlKey
224
233
  );
@@ -231,7 +240,7 @@ function fe({
231
240
  const n = (r) => {
232
241
  if (o.contains(r.target)) {
233
242
  for (const s of t)
234
- if (qe(s, r)) {
243
+ if (Xe(s, r)) {
235
244
  e(r);
236
245
  break;
237
246
  }
@@ -242,31 +251,31 @@ function fe({
242
251
  });
243
252
  });
244
253
  }
245
- function Zn(t) {
254
+ function to(t) {
246
255
  return fe({ allowedKeys: ["Enter"], handler: t });
247
256
  }
248
- function to(t) {
257
+ function eo(t) {
249
258
  return fe({ allowedKeys: ["Escape"], handler: t });
250
259
  }
251
- const Z = Math.min, q = Math.max, gt = Math.round, dt = Math.floor, D = (t) => ({
260
+ const tt = Math.min, X = Math.max, gt = Math.round, dt = Math.floor, D = (t) => ({
252
261
  x: t,
253
262
  y: t
254
- }), Xe = {
263
+ }), Je = {
255
264
  left: "right",
256
265
  right: "left",
257
266
  bottom: "top",
258
267
  top: "bottom"
259
- }, Je = {
268
+ }, Ge = {
260
269
  start: "end",
261
270
  end: "start"
262
271
  };
263
272
  function St(t, e, o) {
264
- return q(t, Z(e, o));
273
+ return X(t, tt(e, o));
265
274
  }
266
275
  function lt(t, e) {
267
276
  return typeof t == "function" ? t(e) : t;
268
277
  }
269
- function X(t) {
278
+ function J(t) {
270
279
  return t.split("-")[0];
271
280
  }
272
281
  function ut(t) {
@@ -275,29 +284,29 @@ function ut(t) {
275
284
  function he(t) {
276
285
  return t === "x" ? "y" : "x";
277
286
  }
278
- function Nt(t) {
287
+ function Vt(t) {
279
288
  return t === "y" ? "height" : "width";
280
289
  }
281
290
  function z(t) {
282
- return ["top", "bottom"].includes(X(t)) ? "y" : "x";
291
+ return ["top", "bottom"].includes(J(t)) ? "y" : "x";
283
292
  }
284
- function Vt(t) {
293
+ function $t(t) {
285
294
  return he(z(t));
286
295
  }
287
- function Ge(t, e, o) {
296
+ function Qe(t, e, o) {
288
297
  o === void 0 && (o = !1);
289
- const n = ut(t), r = Vt(t), s = Nt(r);
298
+ const n = ut(t), r = $t(t), s = Vt(r);
290
299
  let i = r === "x" ? n === (o ? "end" : "start") ? "right" : "left" : n === "start" ? "bottom" : "top";
291
300
  return e.reference[s] > e.floating[s] && (i = pt(i)), [i, pt(i)];
292
301
  }
293
- function Qe(t) {
302
+ function Ze(t) {
294
303
  const e = pt(t);
295
304
  return [Tt(t), e, Tt(e)];
296
305
  }
297
306
  function Tt(t) {
298
- return t.replace(/start|end/g, (e) => Je[e]);
307
+ return t.replace(/start|end/g, (e) => Ge[e]);
299
308
  }
300
- function Ze(t, e, o) {
309
+ function tn(t, e, o) {
301
310
  const n = ["left", "right"], r = ["right", "left"], s = ["top", "bottom"], i = ["bottom", "top"];
302
311
  switch (t) {
303
312
  case "top":
@@ -310,15 +319,15 @@ function Ze(t, e, o) {
310
319
  return [];
311
320
  }
312
321
  }
313
- function tn(t, e, o, n) {
322
+ function en(t, e, o, n) {
314
323
  const r = ut(t);
315
- let s = Ze(X(t), o === "start", n);
324
+ let s = tn(J(t), o === "start", n);
316
325
  return r && (s = s.map((i) => i + "-" + r), e && (s = s.concat(s.map(Tt)))), s;
317
326
  }
318
327
  function pt(t) {
319
- return t.replace(/left|right|bottom|top/g, (e) => Xe[e]);
328
+ return t.replace(/left|right|bottom|top/g, (e) => Je[e]);
320
329
  }
321
- function en(t) {
330
+ function nn(t) {
322
331
  return {
323
332
  top: 0,
324
333
  right: 0,
@@ -328,7 +337,7 @@ function en(t) {
328
337
  };
329
338
  }
330
339
  function de(t) {
331
- return typeof t != "number" ? en(t) : {
340
+ return typeof t != "number" ? nn(t) : {
332
341
  top: t,
333
342
  right: t,
334
343
  bottom: t,
@@ -358,7 +367,7 @@ function _t(t, e, o) {
358
367
  reference: n,
359
368
  floating: r
360
369
  } = t;
361
- const s = z(e), i = Vt(e), c = Nt(i), a = X(e), l = s === "y", h = n.x + n.width / 2 - r.width / 2, f = n.y + n.height / 2 - r.height / 2, m = n[c] / 2 - r[c] / 2;
370
+ const s = z(e), i = $t(e), c = Vt(i), a = J(e), l = s === "y", h = n.x + n.width / 2 - r.width / 2, f = n.y + n.height / 2 - r.height / 2, m = n[c] / 2 - r[c] / 2;
362
371
  let u;
363
372
  switch (a) {
364
373
  case "top":
@@ -401,7 +410,7 @@ function _t(t, e, o) {
401
410
  }
402
411
  return u;
403
412
  }
404
- const nn = async (t, e, o) => {
413
+ const on = async (t, e, o) => {
405
414
  const {
406
415
  placement: n = "bottom",
407
416
  strategy: r = "absolute",
@@ -507,7 +516,7 @@ async function me(t, e) {
507
516
  right: (v.right - g.right + d.right) / b.x
508
517
  };
509
518
  }
510
- const on = (t) => ({
519
+ const rn = (t) => ({
511
520
  name: "arrow",
512
521
  options: t,
513
522
  async fn(e) {
@@ -528,15 +537,15 @@ const on = (t) => ({
528
537
  const f = de(h), m = {
529
538
  x: o,
530
539
  y: n
531
- }, u = Vt(r), d = Nt(u), p = await i.getDimensions(l), w = u === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = s.reference[d] + s.reference[u] - m[u] - s.floating[d], v = m[u] - s.reference[u], L = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
540
+ }, u = $t(r), d = Vt(u), p = await i.getDimensions(l), w = u === "y", g = w ? "top" : "left", x = w ? "bottom" : "right", y = w ? "clientHeight" : "clientWidth", b = s.reference[d] + s.reference[u] - m[u] - s.floating[d], v = m[u] - s.reference[u], L = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l));
532
541
  let R = L ? L[y] : 0;
533
542
  (!R || !await (i.isElement == null ? void 0 : i.isElement(L))) && (R = c.floating[y] || s.floating[d]);
534
- const _ = b / 2 - v / 2, V = R / 2 - p[d] / 2 - 1, P = Z(f[g], V), j = Z(f[x], V), I = P, nt = R - p[d] - j, A = R / 2 - p[d] / 2 + _, Y = St(I, A, nt), $ = !a.arrow && ut(r) != null && A !== Y && s.reference[d] / 2 - (A < I ? P : j) - p[d] / 2 < 0, S = $ ? A < I ? A - I : A - nt : 0;
543
+ const j = b / 2 - v / 2, V = R / 2 - p[d] / 2 - 1, P = tt(f[g], V), _ = tt(f[x], V), I = P, ot = R - p[d] - _, O = R / 2 - p[d] / 2 + j, Y = St(I, O, ot), $ = !a.arrow && ut(r) != null && O !== Y && s.reference[d] / 2 - (O < I ? P : _) - p[d] / 2 < 0, S = $ ? O < I ? O - I : O - ot : 0;
535
544
  return {
536
545
  [u]: m[u] + S,
537
546
  data: {
538
547
  [u]: Y,
539
- centerOffset: A - Y - S,
548
+ centerOffset: O - Y - S,
540
549
  ...$ && {
541
550
  alignmentOffset: S
542
551
  }
@@ -544,7 +553,7 @@ const on = (t) => ({
544
553
  reset: $
545
554
  };
546
555
  }
547
- }), rn = function(t) {
556
+ }), sn = function(t) {
548
557
  return t === void 0 && (t = {}), {
549
558
  name: "flip",
550
559
  options: t,
@@ -568,26 +577,26 @@ const on = (t) => ({
568
577
  } = lt(t, e);
569
578
  if ((o = s.arrow) != null && o.alignmentOffset)
570
579
  return {};
571
- const g = X(r), x = z(c), y = X(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = m || (y || !p ? [pt(c)] : Qe(c)), L = d !== "none";
572
- !m && L && v.push(...tn(c, p, d, b));
573
- const R = [c, ...v], _ = await me(e, w), V = [];
580
+ const g = J(r), x = z(c), y = J(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = m || (y || !p ? [pt(c)] : Ze(c)), L = d !== "none";
581
+ !m && L && v.push(...en(c, p, d, b));
582
+ const R = [c, ...v], j = await me(e, w), V = [];
574
583
  let P = ((n = s.flip) == null ? void 0 : n.overflows) || [];
575
- if (h && V.push(_[g]), f) {
576
- const A = Ge(r, i, b);
577
- V.push(_[A[0]], _[A[1]]);
584
+ if (h && V.push(j[g]), f) {
585
+ const O = Qe(r, i, b);
586
+ V.push(j[O[0]], j[O[1]]);
578
587
  }
579
588
  if (P = [...P, {
580
589
  placement: r,
581
590
  overflows: V
582
- }], !V.every((A) => A <= 0)) {
583
- var j, I;
584
- const A = (((j = s.flip) == null ? void 0 : j.index) || 0) + 1, Y = R[A];
591
+ }], !V.every((O) => O <= 0)) {
592
+ var _, I;
593
+ const O = (((_ = s.flip) == null ? void 0 : _.index) || 0) + 1, Y = R[O];
585
594
  if (Y && (!(f === "alignment" ? x !== z(Y) : !1) || // We leave the current main axis only if every placement on that axis
586
595
  // overflows the main axis.
587
596
  P.every((T) => T.overflows[0] > 0 && z(T.placement) === x)))
588
597
  return {
589
598
  data: {
590
- index: A,
599
+ index: O,
591
600
  overflows: P
592
601
  },
593
602
  reset: {
@@ -598,8 +607,8 @@ const on = (t) => ({
598
607
  if (!$)
599
608
  switch (u) {
600
609
  case "bestFit": {
601
- var nt;
602
- const S = (nt = P.filter((T) => {
610
+ var ot;
611
+ const S = (ot = P.filter((T) => {
603
612
  if (L) {
604
613
  const B = z(T.placement);
605
614
  return B === x || // Create a bias to the `y` side axis due to horizontal
@@ -607,7 +616,7 @@ const on = (t) => ({
607
616
  B === "y";
608
617
  }
609
618
  return !0;
610
- }).map((T) => [T.placement, T.overflows.filter((B) => B > 0).reduce((B, Ee) => B + Ee, 0)]).sort((T, B) => T[1] - B[1])[0]) == null ? void 0 : nt[0];
619
+ }).map((T) => [T.placement, T.overflows.filter((B) => B > 0).reduce((B, Ee) => B + Ee, 0)]).sort((T, B) => T[1] - B[1])[0]) == null ? void 0 : ot[0];
611
620
  S && ($ = S);
612
621
  break;
613
622
  }
@@ -626,12 +635,12 @@ const on = (t) => ({
626
635
  }
627
636
  };
628
637
  };
629
- async function sn(t, e) {
638
+ async function cn(t, e) {
630
639
  const {
631
640
  placement: o,
632
641
  platform: n,
633
642
  elements: r
634
- } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), i = X(o), c = ut(o), a = z(o) === "y", l = ["left", "top"].includes(i) ? -1 : 1, h = s && a ? -1 : 1, f = lt(e, t);
643
+ } = t, s = await (n.isRTL == null ? void 0 : n.isRTL(r.floating)), i = J(o), c = ut(o), a = z(o) === "y", l = ["left", "top"].includes(i) ? -1 : 1, h = s && a ? -1 : 1, f = lt(e, t);
635
644
  let {
636
645
  mainAxis: m,
637
646
  crossAxis: u,
@@ -653,7 +662,7 @@ async function sn(t, e) {
653
662
  y: u * h
654
663
  };
655
664
  }
656
- const cn = function(t) {
665
+ const an = function(t) {
657
666
  return t === void 0 && (t = 0), {
658
667
  name: "offset",
659
668
  options: t,
@@ -664,7 +673,7 @@ const cn = function(t) {
664
673
  y: s,
665
674
  placement: i,
666
675
  middlewareData: c
667
- } = e, a = await sn(e, t);
676
+ } = e, a = await cn(e, t);
668
677
  return i === ((o = c.offset) == null ? void 0 : o.placement) && (n = c.arrow) != null && n.alignmentOffset ? {} : {
669
678
  x: r + a.x,
670
679
  y: s + a.y,
@@ -675,7 +684,7 @@ const cn = function(t) {
675
684
  };
676
685
  }
677
686
  };
678
- }, an = function(t) {
687
+ }, ln = function(t) {
679
688
  return t === void 0 && (t = {}), {
680
689
  name: "shift",
681
690
  options: t,
@@ -703,7 +712,7 @@ const cn = function(t) {
703
712
  } = lt(t, e), l = {
704
713
  x: o,
705
714
  y: n
706
- }, h = await me(e, a), f = z(X(r)), m = he(f);
715
+ }, h = await me(e, a), f = z(J(r)), m = he(f);
707
716
  let u = l[m], d = l[f];
708
717
  if (s) {
709
718
  const w = m === "y" ? "top" : "left", g = m === "y" ? "bottom" : "right", x = u + h[w], y = u - h[g];
@@ -735,10 +744,10 @@ const cn = function(t) {
735
744
  function xt() {
736
745
  return typeof window < "u";
737
746
  }
738
- function et(t) {
747
+ function nt(t) {
739
748
  return ge(t) ? (t.nodeName || "").toLowerCase() : "#document";
740
749
  }
741
- function O(t) {
750
+ function E(t) {
742
751
  var e;
743
752
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
744
753
  }
@@ -747,16 +756,16 @@ function N(t) {
747
756
  return (e = (ge(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
748
757
  }
749
758
  function ge(t) {
750
- return xt() ? t instanceof Node || t instanceof O(t).Node : !1;
759
+ return xt() ? t instanceof Node || t instanceof E(t).Node : !1;
751
760
  }
752
761
  function k(t) {
753
- return xt() ? t instanceof Element || t instanceof O(t).Element : !1;
762
+ return xt() ? t instanceof Element || t instanceof E(t).Element : !1;
754
763
  }
755
764
  function W(t) {
756
- return xt() ? t instanceof HTMLElement || t instanceof O(t).HTMLElement : !1;
765
+ return xt() ? t instanceof HTMLElement || t instanceof E(t).HTMLElement : !1;
757
766
  }
758
- function jt(t) {
759
- return !xt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof O(t).ShadowRoot;
767
+ function It(t) {
768
+ return !xt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof E(t).ShadowRoot;
760
769
  }
761
770
  function ft(t) {
762
771
  const {
@@ -767,8 +776,8 @@ function ft(t) {
767
776
  } = C(t);
768
777
  return /auto|scroll|overlay|hidden|clip/.test(e + n + o) && !["inline", "contents"].includes(r);
769
778
  }
770
- function ln(t) {
771
- return ["table", "td", "th"].includes(et(t));
779
+ function un(t) {
780
+ return ["table", "td", "th"].includes(nt(t));
772
781
  }
773
782
  function vt(t) {
774
783
  return [":popover-open", ":modal"].some((e) => {
@@ -779,14 +788,14 @@ function vt(t) {
779
788
  }
780
789
  });
781
790
  }
782
- function $t(t) {
783
- const e = Ht(), o = k(t) ? C(t) : t;
791
+ function Ht(t) {
792
+ const e = Bt(), o = k(t) ? C(t) : t;
784
793
  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));
785
794
  }
786
- function un(t) {
795
+ function fn(t) {
787
796
  let e = K(t);
788
- for (; W(e) && !tt(e); ) {
789
- if ($t(e))
797
+ for (; W(e) && !et(e); ) {
798
+ if (Ht(e))
790
799
  return e;
791
800
  if (vt(e))
792
801
  return null;
@@ -794,14 +803,14 @@ function un(t) {
794
803
  }
795
804
  return null;
796
805
  }
797
- function Ht() {
806
+ function Bt() {
798
807
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
799
808
  }
800
- function tt(t) {
801
- return ["html", "body", "#document"].includes(et(t));
809
+ function et(t) {
810
+ return ["html", "body", "#document"].includes(nt(t));
802
811
  }
803
812
  function C(t) {
804
- return O(t).getComputedStyle(t);
813
+ return E(t).getComputedStyle(t);
805
814
  }
806
815
  function bt(t) {
807
816
  return k(t) ? {
@@ -813,25 +822,25 @@ function bt(t) {
813
822
  };
814
823
  }
815
824
  function K(t) {
816
- if (et(t) === "html")
825
+ if (nt(t) === "html")
817
826
  return t;
818
827
  const e = (
819
828
  // Step into the shadow DOM of the parent of a slotted node.
820
829
  t.assignedSlot || // DOM Element detected.
821
830
  t.parentNode || // ShadowRoot detected.
822
- jt(t) && t.host || // Fallback.
831
+ It(t) && t.host || // Fallback.
823
832
  N(t)
824
833
  );
825
- return jt(e) ? e.host : e;
834
+ return It(e) ? e.host : e;
826
835
  }
827
836
  function pe(t) {
828
837
  const e = K(t);
829
- return tt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : W(e) && ft(e) ? e : pe(e);
838
+ return et(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : W(e) && ft(e) ? e : pe(e);
830
839
  }
831
840
  function it(t, e, o) {
832
841
  var n;
833
842
  e === void 0 && (e = []), o === void 0 && (o = !0);
834
- const r = pe(t), s = r === ((n = t.ownerDocument) == null ? void 0 : n.body), i = O(r);
843
+ const r = pe(t), s = r === ((n = t.ownerDocument) == null ? void 0 : n.body), i = E(r);
835
844
  if (s) {
836
845
  const c = kt(i);
837
846
  return e.concat(i, i.visualViewport || [], ft(r) ? r : [], c && o ? it(c) : []);
@@ -851,11 +860,11 @@ function we(t) {
851
860
  $: c
852
861
  };
853
862
  }
854
- function Bt(t) {
863
+ function Ut(t) {
855
864
  return k(t) ? t : t.contextElement;
856
865
  }
857
- function Q(t) {
858
- const e = Bt(t);
866
+ function Z(t) {
867
+ const e = Ut(t);
859
868
  if (!W(e))
860
869
  return D(1);
861
870
  const o = e.getBoundingClientRect(), {
@@ -869,30 +878,30 @@ function Q(t) {
869
878
  y: c
870
879
  };
871
880
  }
872
- const fn = /* @__PURE__ */ D(0);
881
+ const hn = /* @__PURE__ */ D(0);
873
882
  function ye(t) {
874
- const e = O(t);
875
- return !Ht() || !e.visualViewport ? fn : {
883
+ const e = E(t);
884
+ return !Bt() || !e.visualViewport ? hn : {
876
885
  x: e.visualViewport.offsetLeft,
877
886
  y: e.visualViewport.offsetTop
878
887
  };
879
888
  }
880
- function hn(t, e, o) {
881
- return e === void 0 && (e = !1), !o || e && o !== O(t) ? !1 : e;
889
+ function dn(t, e, o) {
890
+ return e === void 0 && (e = !1), !o || e && o !== E(t) ? !1 : e;
882
891
  }
883
- function J(t, e, o, n) {
892
+ function G(t, e, o, n) {
884
893
  e === void 0 && (e = !1), o === void 0 && (o = !1);
885
- const r = t.getBoundingClientRect(), s = Bt(t);
894
+ const r = t.getBoundingClientRect(), s = Ut(t);
886
895
  let i = D(1);
887
- e && (n ? k(n) && (i = Q(n)) : i = Q(t));
888
- const c = hn(s, o, n) ? ye(s) : D(0);
896
+ e && (n ? k(n) && (i = Z(n)) : i = Z(t));
897
+ const c = dn(s, o, n) ? ye(s) : D(0);
889
898
  let a = (r.left + c.x) / i.x, l = (r.top + c.y) / i.y, h = r.width / i.x, f = r.height / i.y;
890
899
  if (s) {
891
- const m = O(s), u = n && k(n) ? O(n) : n;
900
+ const m = E(s), u = n && k(n) ? E(n) : n;
892
901
  let d = m, p = kt(d);
893
902
  for (; p && n && u !== d; ) {
894
- const w = Q(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;
895
- a *= w.x, l *= w.y, h *= w.x, f *= w.y, a += y, l += b, d = O(p), p = kt(d);
903
+ const w = Z(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;
904
+ a *= w.x, l *= w.y, h *= w.x, f *= w.y, a += y, l += b, d = E(p), p = kt(d);
896
905
  }
897
906
  }
898
907
  return wt({
@@ -902,22 +911,22 @@ function J(t, e, o, n) {
902
911
  y: l
903
912
  });
904
913
  }
905
- function Ut(t, e) {
914
+ function zt(t, e) {
906
915
  const o = bt(t).scrollLeft;
907
- return e ? e.left + o : J(N(t)).left + o;
916
+ return e ? e.left + o : G(N(t)).left + o;
908
917
  }
909
918
  function xe(t, e, o) {
910
919
  o === void 0 && (o = !1);
911
920
  const n = t.getBoundingClientRect(), r = n.left + e.scrollLeft - (o ? 0 : (
912
921
  // RTL <body> scrollbar.
913
- Ut(t, n)
922
+ zt(t, n)
914
923
  )), s = n.top + e.scrollTop;
915
924
  return {
916
925
  x: r,
917
926
  y: s
918
927
  };
919
928
  }
920
- function dn(t) {
929
+ function mn(t) {
921
930
  let {
922
931
  elements: e,
923
932
  rect: o,
@@ -932,9 +941,9 @@ function dn(t) {
932
941
  scrollTop: 0
933
942
  }, l = D(1);
934
943
  const h = D(0), f = W(n);
935
- if ((f || !f && !s) && ((et(n) !== "body" || ft(i)) && (a = bt(n)), W(n))) {
936
- const u = J(n);
937
- l = Q(n), h.x = u.x + n.clientLeft, h.y = u.y + n.clientTop;
944
+ if ((f || !f && !s) && ((nt(n) !== "body" || ft(i)) && (a = bt(n)), W(n))) {
945
+ const u = G(n);
946
+ l = Z(n), h.x = u.x + n.clientLeft, h.y = u.y + n.clientTop;
938
947
  }
939
948
  const m = i && !f && !s ? xe(i, a, !0) : D(0);
940
949
  return {
@@ -944,26 +953,26 @@ function dn(t) {
944
953
  y: o.y * l.y - a.scrollTop * l.y + h.y + m.y
945
954
  };
946
955
  }
947
- function mn(t) {
956
+ function gn(t) {
948
957
  return Array.from(t.getClientRects());
949
958
  }
950
- function gn(t) {
951
- const e = N(t), o = bt(t), n = t.ownerDocument.body, r = q(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = q(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
952
- let i = -o.scrollLeft + Ut(t);
959
+ function pn(t) {
960
+ const e = N(t), o = bt(t), n = t.ownerDocument.body, r = X(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), s = X(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
961
+ let i = -o.scrollLeft + zt(t);
953
962
  const c = -o.scrollTop;
954
- return C(n).direction === "rtl" && (i += q(e.clientWidth, n.clientWidth) - r), {
963
+ return C(n).direction === "rtl" && (i += X(e.clientWidth, n.clientWidth) - r), {
955
964
  width: r,
956
965
  height: s,
957
966
  x: i,
958
967
  y: c
959
968
  };
960
969
  }
961
- function pn(t, e) {
962
- const o = O(t), n = N(t), r = o.visualViewport;
970
+ function wn(t, e) {
971
+ const o = E(t), n = N(t), r = o.visualViewport;
963
972
  let s = n.clientWidth, i = n.clientHeight, c = 0, a = 0;
964
973
  if (r) {
965
974
  s = r.width, i = r.height;
966
- const l = Ht();
975
+ const l = Bt();
967
976
  (!l || l && e === "fixed") && (c = r.offsetLeft, a = r.offsetTop);
968
977
  }
969
978
  return {
@@ -973,8 +982,8 @@ function pn(t, e) {
973
982
  y: a
974
983
  };
975
984
  }
976
- function wn(t, e) {
977
- const o = J(t, !0, e === "fixed"), n = o.top + t.clientTop, r = o.left + t.clientLeft, s = W(t) ? Q(t) : D(1), i = t.clientWidth * s.x, c = t.clientHeight * s.y, a = r * s.x, l = n * s.y;
985
+ function yn(t, e) {
986
+ const o = G(t, !0, e === "fixed"), n = o.top + t.clientTop, r = o.left + t.clientLeft, s = W(t) ? Z(t) : D(1), i = t.clientWidth * s.x, c = t.clientHeight * s.y, a = r * s.x, l = n * s.y;
978
987
  return {
979
988
  width: i,
980
989
  height: c,
@@ -982,14 +991,14 @@ function wn(t, e) {
982
991
  y: l
983
992
  };
984
993
  }
985
- function It(t, e, o) {
994
+ function Yt(t, e, o) {
986
995
  let n;
987
996
  if (e === "viewport")
988
- n = pn(t, o);
997
+ n = wn(t, o);
989
998
  else if (e === "document")
990
- n = gn(N(t));
999
+ n = pn(N(t));
991
1000
  else if (k(e))
992
- n = wn(e, o);
1001
+ n = yn(e, o);
993
1002
  else {
994
1003
  const r = ye(t);
995
1004
  n = {
@@ -1003,32 +1012,32 @@ function It(t, e, o) {
1003
1012
  }
1004
1013
  function ve(t, e) {
1005
1014
  const o = K(t);
1006
- return o === e || !k(o) || tt(o) ? !1 : C(o).position === "fixed" || ve(o, e);
1015
+ return o === e || !k(o) || et(o) ? !1 : C(o).position === "fixed" || ve(o, e);
1007
1016
  }
1008
- function yn(t, e) {
1017
+ function xn(t, e) {
1009
1018
  const o = e.get(t);
1010
1019
  if (o)
1011
1020
  return o;
1012
- let n = it(t, [], !1).filter((c) => k(c) && et(c) !== "body"), r = null;
1021
+ let n = it(t, [], !1).filter((c) => k(c) && nt(c) !== "body"), r = null;
1013
1022
  const s = C(t).position === "fixed";
1014
1023
  let i = s ? K(t) : t;
1015
- for (; k(i) && !tt(i); ) {
1016
- const c = C(i), a = $t(i);
1024
+ for (; k(i) && !et(i); ) {
1025
+ const c = C(i), a = Ht(i);
1017
1026
  !a && c.position === "fixed" && (r = null), (s ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || ft(i) && !a && ve(t, i)) ? n = n.filter((h) => h !== i) : r = c, i = K(i);
1018
1027
  }
1019
1028
  return e.set(t, n), n;
1020
1029
  }
1021
- function xn(t) {
1030
+ function vn(t) {
1022
1031
  let {
1023
1032
  element: e,
1024
1033
  boundary: o,
1025
1034
  rootBoundary: n,
1026
1035
  strategy: r
1027
1036
  } = t;
1028
- const i = [...o === "clippingAncestors" ? vt(e) ? [] : yn(e, this._c) : [].concat(o), n], c = i[0], a = i.reduce((l, h) => {
1029
- const f = It(e, h, r);
1030
- return l.top = q(f.top, l.top), l.right = Z(f.right, l.right), l.bottom = Z(f.bottom, l.bottom), l.left = q(f.left, l.left), l;
1031
- }, It(e, c, r));
1037
+ const i = [...o === "clippingAncestors" ? vt(e) ? [] : xn(e, this._c) : [].concat(o), n], c = i[0], a = i.reduce((l, h) => {
1038
+ const f = Yt(e, h, r);
1039
+ return l.top = X(f.top, l.top), l.right = tt(f.right, l.right), l.bottom = tt(f.bottom, l.bottom), l.left = X(f.left, l.left), l;
1040
+ }, Yt(e, c, r));
1032
1041
  return {
1033
1042
  width: a.right - a.left,
1034
1043
  height: a.bottom - a.top,
@@ -1036,7 +1045,7 @@ function xn(t) {
1036
1045
  y: a.top
1037
1046
  };
1038
1047
  }
1039
- function vn(t) {
1048
+ function bn(t) {
1040
1049
  const {
1041
1050
  width: e,
1042
1051
  height: o
@@ -1046,19 +1055,19 @@ function vn(t) {
1046
1055
  height: o
1047
1056
  };
1048
1057
  }
1049
- function bn(t, e, o) {
1050
- const n = W(e), r = N(e), s = o === "fixed", i = J(t, !0, s, e);
1058
+ function Rn(t, e, o) {
1059
+ const n = W(e), r = N(e), s = o === "fixed", i = G(t, !0, s, e);
1051
1060
  let c = {
1052
1061
  scrollLeft: 0,
1053
1062
  scrollTop: 0
1054
1063
  };
1055
1064
  const a = D(0);
1056
1065
  function l() {
1057
- a.x = Ut(r);
1066
+ a.x = zt(r);
1058
1067
  }
1059
1068
  if (n || !n && !s)
1060
- if ((et(e) !== "body" || ft(r)) && (c = bt(e)), n) {
1061
- const u = J(e, !0, s, e);
1069
+ if ((nt(e) !== "body" || ft(r)) && (c = bt(e)), n) {
1070
+ const u = G(e, !0, s, e);
1062
1071
  a.x = u.x + e.clientLeft, a.y = u.y + e.clientTop;
1063
1072
  } else r && l();
1064
1073
  s && !n && r && l();
@@ -1070,10 +1079,10 @@ function bn(t, e, o) {
1070
1079
  height: i.height
1071
1080
  };
1072
1081
  }
1073
- function Ot(t) {
1082
+ function At(t) {
1074
1083
  return C(t).position === "static";
1075
1084
  }
1076
- function Yt(t, e) {
1085
+ function qt(t, e) {
1077
1086
  if (!W(t) || C(t).position === "fixed")
1078
1087
  return null;
1079
1088
  if (e)
@@ -1082,27 +1091,27 @@ function Yt(t, e) {
1082
1091
  return N(t) === o && (o = o.ownerDocument.body), o;
1083
1092
  }
1084
1093
  function be(t, e) {
1085
- const o = O(t);
1094
+ const o = E(t);
1086
1095
  if (vt(t))
1087
1096
  return o;
1088
1097
  if (!W(t)) {
1089
1098
  let r = K(t);
1090
- for (; r && !tt(r); ) {
1091
- if (k(r) && !Ot(r))
1099
+ for (; r && !et(r); ) {
1100
+ if (k(r) && !At(r))
1092
1101
  return r;
1093
1102
  r = K(r);
1094
1103
  }
1095
1104
  return o;
1096
1105
  }
1097
- let n = Yt(t, e);
1098
- for (; n && ln(n) && Ot(n); )
1099
- n = Yt(n, e);
1100
- return n && tt(n) && Ot(n) && !$t(n) ? o : n || un(t) || o;
1106
+ let n = qt(t, e);
1107
+ for (; n && un(n) && At(n); )
1108
+ n = qt(n, e);
1109
+ return n && et(n) && At(n) && !Ht(n) ? o : n || fn(t) || o;
1101
1110
  }
1102
- const Rn = async function(t) {
1111
+ const On = async function(t) {
1103
1112
  const e = this.getOffsetParent || be, o = this.getDimensions, n = await o(t.floating);
1104
1113
  return {
1105
- reference: bn(t.reference, await e(t.floating), t.strategy),
1114
+ reference: Rn(t.reference, await e(t.floating), t.strategy),
1106
1115
  floating: {
1107
1116
  x: 0,
1108
1117
  y: 0,
@@ -1114,22 +1123,22 @@ const Rn = async function(t) {
1114
1123
  function An(t) {
1115
1124
  return C(t).direction === "rtl";
1116
1125
  }
1117
- const On = {
1118
- convertOffsetParentRelativeRectToViewportRelativeRect: dn,
1126
+ const En = {
1127
+ convertOffsetParentRelativeRectToViewportRelativeRect: mn,
1119
1128
  getDocumentElement: N,
1120
- getClippingRect: xn,
1129
+ getClippingRect: vn,
1121
1130
  getOffsetParent: be,
1122
- getElementRects: Rn,
1123
- getClientRects: mn,
1124
- getDimensions: vn,
1125
- getScale: Q,
1131
+ getElementRects: On,
1132
+ getClientRects: gn,
1133
+ getDimensions: bn,
1134
+ getScale: Z,
1126
1135
  isElement: k,
1127
1136
  isRTL: An
1128
1137
  };
1129
1138
  function Re(t, e) {
1130
1139
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1131
1140
  }
1132
- function En(t, e) {
1141
+ function Ln(t, e) {
1133
1142
  let o = null, n;
1134
1143
  const r = N(t);
1135
1144
  function s() {
@@ -1148,7 +1157,7 @@ function En(t, e) {
1148
1157
  return;
1149
1158
  const d = dt(f), p = dt(r.clientWidth - (h + m)), w = dt(r.clientHeight - (f + u)), g = dt(h), y = {
1150
1159
  rootMargin: -d + "px " + -p + "px " + -w + "px " + -g + "px",
1151
- threshold: q(0, Z(1, a)) || 1
1160
+ threshold: X(0, tt(1, a)) || 1
1152
1161
  };
1153
1162
  let b = !0;
1154
1163
  function v(L) {
@@ -1175,7 +1184,7 @@ function En(t, e) {
1175
1184
  }
1176
1185
  return i(!0), s;
1177
1186
  }
1178
- function Ln(t, e, o, n) {
1187
+ function Pn(t, e, o, n) {
1179
1188
  n === void 0 && (n = {});
1180
1189
  const {
1181
1190
  ancestorScroll: r = !0,
@@ -1183,13 +1192,13 @@ function Ln(t, e, o, n) {
1183
1192
  elementResize: i = typeof ResizeObserver == "function",
1184
1193
  layoutShift: c = typeof IntersectionObserver == "function",
1185
1194
  animationFrame: a = !1
1186
- } = n, l = Bt(t), h = r || s ? [...l ? it(l) : [], ...it(e)] : [];
1195
+ } = n, l = Ut(t), h = r || s ? [...l ? it(l) : [], ...it(e)] : [];
1187
1196
  h.forEach((g) => {
1188
1197
  r && g.addEventListener("scroll", o, {
1189
1198
  passive: !0
1190
1199
  }), s && g.addEventListener("resize", o);
1191
1200
  });
1192
- const f = l && c ? En(l, o) : null;
1201
+ const f = l && c ? Ln(l, o) : null;
1193
1202
  let m = -1, u = null;
1194
1203
  i && (u = new ResizeObserver((g) => {
1195
1204
  let [x] = g;
@@ -1198,10 +1207,10 @@ function Ln(t, e, o, n) {
1198
1207
  (y = u) == null || y.observe(e);
1199
1208
  })), o();
1200
1209
  }), l && !a && u.observe(l), u.observe(e));
1201
- let d, p = a ? J(t) : null;
1210
+ let d, p = a ? G(t) : null;
1202
1211
  a && w();
1203
1212
  function w() {
1204
- const g = J(t);
1213
+ const g = G(t);
1205
1214
  p && !Re(p, g) && o(), p = g, d = requestAnimationFrame(w);
1206
1215
  }
1207
1216
  return o(), () => {
@@ -1211,19 +1220,19 @@ function Ln(t, e, o, n) {
1211
1220
  }), f == null || f(), (g = u) == null || g.disconnect(), u = null, a && cancelAnimationFrame(d);
1212
1221
  };
1213
1222
  }
1214
- const Pn = cn, Sn = an, qt = rn, Tn = on, kn = (t, e, o) => {
1223
+ const Sn = an, Tn = ln, Xt = sn, kn = rn, Cn = (t, e, o) => {
1215
1224
  const n = /* @__PURE__ */ new Map(), r = {
1216
- platform: On,
1225
+ platform: En,
1217
1226
  ...o
1218
1227
  }, s = {
1219
1228
  ...r.platform,
1220
1229
  _c: n
1221
1230
  };
1222
- return nn(t, e, {
1231
+ return on(t, e, {
1223
1232
  ...r,
1224
1233
  platform: s
1225
1234
  });
1226
- }, eo = [
1235
+ }, no = [
1227
1236
  "top",
1228
1237
  "top-start",
1229
1238
  "top-end",
@@ -1236,115 +1245,122 @@ const Pn = cn, Sn = an, qt = rn, Tn = on, kn = (t, e, o) => {
1236
1245
  "left",
1237
1246
  "left-start",
1238
1247
  "left-end"
1239
- ], no = (t, e = { isOpen: !1 }) => {
1248
+ ], oo = (t, e = { isOpen: !1 }) => {
1240
1249
  const o = [];
1241
1250
  let n = null;
1242
- const r = E.deriveProp(e.isOpen);
1251
+ const r = A.deriveProp(e.isOpen);
1243
1252
  function s(c) {
1244
1253
  n = c, r.set(!0);
1245
1254
  }
1246
1255
  function i() {
1247
1256
  r.set(!1), o.forEach((c) => c()), o.length = 0;
1248
1257
  }
1249
- return st(
1258
+ return q(
1250
1259
  t(s, i),
1251
1260
  se(
1252
1261
  r,
1253
- () => H(
1254
- (c) => re(
1255
- "body",
1256
- Et.div(
1257
- H((a) => {
1258
- a.style.position = "absolute";
1259
- const l = typeof (n == null ? void 0 : n.target) == "string" ? c.querySelector(
1260
- n.target
1261
- ) : (n == null ? void 0 : n.target) ?? c;
1262
- if (l == null)
1263
- throw new Error(`Target not found: ${n == null ? void 0 : n.target}`);
1264
- let h = null;
1265
- const f = E.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), m = E.toSignal((n == null ? void 0 : n.crossAxisOffset) ?? 0), u = E.toSignal(
1266
- /* c8 ignore next 3 */
1267
- (n == null ? void 0 : n.placement) ?? "top"
1268
- ), d = E.toSignal((n == null ? void 0 : n.arrowPadding) ?? 0), p = n == null ? void 0 : n.arrow, w = F({
1269
- centerOffset: 0,
1270
- alignmentOffset: 0,
1271
- containerWidth: 0,
1272
- containerHeight: 0,
1273
- x: void 0,
1274
- y: void 0
1275
- });
1276
- async function g() {
1277
- const y = [
1278
- qt(),
1279
- Pn({
1280
- mainAxis: f.get(),
1281
- crossAxis: m.get()
1282
- }),
1283
- Sn(),
1284
- qt()
1285
- ];
1286
- p != null && h != null && y.push(
1287
- Tn({
1288
- element: h,
1289
- padding: d.get()
1290
- })
1291
- );
1292
- const b = await kn(l, a, {
1293
- placement: u.get(),
1294
- strategy: "absolute",
1295
- middleware: y
1296
- }), { x: v, y: L, middlewareData: R } = b;
1297
- if (a.style.top = `${L}px`, a.style.left = `${v}px`, h != null && R.arrow != null) {
1298
- const {
1299
- x: _,
1300
- y: V,
1301
- centerOffset: P,
1302
- alignmentOffset: j
1303
- } = R.arrow;
1304
- w.set({
1305
- x: _,
1306
- y: V,
1307
- centerOffset: P,
1308
- alignmentOffset: j,
1309
- containerWidth: a.offsetWidth,
1310
- containerHeight: a.offsetHeight
1311
- });
1262
+ () => q(
1263
+ (n == null ? void 0 : n.onClickOutside) != null ? qe(n.onClickOutside) : null,
1264
+ H(
1265
+ (c) => re(
1266
+ "body",
1267
+ Et.div(
1268
+ H((a) => {
1269
+ a.style.position = "absolute";
1270
+ const l = typeof (n == null ? void 0 : n.target) == "string" ? c.querySelector(
1271
+ n.target
1272
+ ) : (n == null ? void 0 : n.target) ?? c;
1273
+ if (l == null)
1274
+ throw new Error(`Target not found: ${n == null ? void 0 : n.target}`);
1275
+ let h = null;
1276
+ const f = A.toSignal((n == null ? void 0 : n.mainAxisOffset) ?? 0), m = A.toSignal(
1277
+ (n == null ? void 0 : n.crossAxisOffset) ?? 0
1278
+ ), u = A.toSignal(
1279
+ /* c8 ignore next 3 */
1280
+ (n == null ? void 0 : n.placement) ?? "top"
1281
+ ), d = A.toSignal(
1282
+ (n == null ? void 0 : n.arrowPadding) ?? 0
1283
+ ), p = n == null ? void 0 : n.arrow, w = F({
1284
+ centerOffset: 0,
1285
+ alignmentOffset: 0,
1286
+ containerWidth: 0,
1287
+ containerHeight: 0,
1288
+ x: void 0,
1289
+ y: void 0
1290
+ });
1291
+ async function g() {
1292
+ const y = [
1293
+ Xt(),
1294
+ Sn({
1295
+ mainAxis: f.get(),
1296
+ crossAxis: m.get()
1297
+ }),
1298
+ Tn(),
1299
+ Xt()
1300
+ ];
1301
+ p != null && h != null && y.push(
1302
+ kn({
1303
+ element: h,
1304
+ padding: d.get()
1305
+ })
1306
+ );
1307
+ const b = await Cn(l, a, {
1308
+ placement: u.get(),
1309
+ strategy: "absolute",
1310
+ middleware: y
1311
+ }), { x: v, y: L, middlewareData: R } = b;
1312
+ if (a.style.top = `${L}px`, a.style.left = `${v}px`, h != null && R.arrow != null) {
1313
+ const {
1314
+ x: j,
1315
+ y: V,
1316
+ centerOffset: P,
1317
+ alignmentOffset: _
1318
+ } = R.arrow;
1319
+ w.set({
1320
+ x: j,
1321
+ y: V,
1322
+ centerOffset: P,
1323
+ alignmentOffset: _,
1324
+ containerWidth: a.offsetWidth,
1325
+ containerHeight: a.offsetHeight
1326
+ });
1327
+ }
1312
1328
  }
1313
- }
1314
- const x = Se(
1315
- f,
1316
- m,
1317
- u
1318
- )(g);
1319
- return st(
1320
- n == null ? void 0 : n.content,
1321
- (n == null ? void 0 : n.arrow) != null ? Et.div(
1322
- n == null ? void 0 : n.arrow(
1323
- ie(
1324
- w,
1325
- u
1326
- )((y, b) => ({
1327
- ...y,
1328
- placement: b
1329
- }))
1330
- ),
1331
- H((y) => {
1332
- h = y, g();
1333
- })
1334
- ) : null,
1335
- M(
1336
- w.dispose,
1337
- Ln(l, a, g),
1338
- x
1339
- )
1340
- );
1341
- })
1329
+ const x = Se(
1330
+ f,
1331
+ m,
1332
+ u
1333
+ )(g);
1334
+ return q(
1335
+ n == null ? void 0 : n.content,
1336
+ (n == null ? void 0 : n.arrow) != null ? Et.div(
1337
+ n == null ? void 0 : n.arrow(
1338
+ ie(
1339
+ w,
1340
+ u
1341
+ )((y, b) => ({
1342
+ ...y,
1343
+ placement: b
1344
+ }))
1345
+ ),
1346
+ H((y) => {
1347
+ h = y, g();
1348
+ })
1349
+ ) : null,
1350
+ M(
1351
+ w.dispose,
1352
+ Pn(l, a, g),
1353
+ x
1354
+ )
1355
+ );
1356
+ })
1357
+ )
1342
1358
  )
1343
1359
  )
1344
1360
  )
1345
1361
  )
1346
1362
  );
1347
- }, Cn = (t, e, o) => {
1363
+ }, Dn = (t, e, o) => {
1348
1364
  const n = F(U.notAsked), r = n.map(
1349
1365
  (f) => U.isSuccess(f) ? f.value : void 0
1350
1366
  ), s = n.map(
@@ -1361,10 +1377,10 @@ const Pn = cn, Sn = an, qt = rn, Tn = on, kn = (t, e, o) => {
1361
1377
  } catch (d) {
1362
1378
  c = void 0, n.set(U.failure(o(d)));
1363
1379
  }
1364
- }, l = () => a(E.get(t)), h = () => {
1380
+ }, l = () => a(A.get(t)), h = () => {
1365
1381
  c == null || c.abort(), c = void 0, n.dispose();
1366
1382
  };
1367
- return n.onDispose(E.on(t, a)), {
1383
+ return n.onDispose(A.on(t, a)), {
1368
1384
  status: n,
1369
1385
  value: r,
1370
1386
  error: s,
@@ -1372,9 +1388,9 @@ const Pn = cn, Sn = an, qt = rn, Tn = on, kn = (t, e, o) => {
1372
1388
  reload: l,
1373
1389
  dispose: h
1374
1390
  };
1375
- }, Dn = (t, e) => {
1391
+ }, Wn = (t, e) => {
1376
1392
  const { status: o, dispose: n, reload: r } = t, { loading: s, failure: i, success: c } = e;
1377
- return st(
1393
+ return q(
1378
1394
  M(n),
1379
1395
  ue(o, {
1380
1396
  loading: s != null ? (a) => s(a, r) : void 0,
@@ -1382,25 +1398,25 @@ const Pn = cn, Sn = an, qt = rn, Tn = on, kn = (t, e, o) => {
1382
1398
  success: (a) => c(a, r)
1383
1399
  })
1384
1400
  );
1385
- }, oo = ({
1401
+ }, ro = ({
1386
1402
  request: t,
1387
1403
  load: e,
1388
1404
  mapError: o = (n) => n
1389
1405
  }) => {
1390
- const n = Cn(t, e, o);
1391
- return (r) => Dn(n, r);
1392
- }, Wn = (t, e) => {
1406
+ const n = Dn(t, e, o);
1407
+ return (r) => Wn(n, r);
1408
+ }, Fn = (t, e) => {
1393
1409
  if (typeof e == "function")
1394
- return Wn(t, { success: e });
1395
- const o = e.failure ?? ((r) => st(
1410
+ return Fn(t, { success: e });
1411
+ const o = e.failure ?? ((r) => q(
1396
1412
  M(r.on(console.error)),
1397
1413
  r.map((s) => `Error: ${s}`)
1398
1414
  )), n = e.success;
1399
- return oe(E.toSignal(t), {
1415
+ return oe(A.toSignal(t), {
1400
1416
  Success: (r) => n(r.$.value),
1401
1417
  Failure: (r) => o(r.$.error)
1402
1418
  });
1403
- }, ro = () => ee.focus((t) => {
1419
+ }, so = () => ne.focus((t) => {
1404
1420
  var e;
1405
1421
  return (e = t.target) == null ? void 0 : e.select();
1406
1422
  });
@@ -1443,7 +1459,7 @@ class Rt {
1443
1459
  * console.log(rect1.equals(rect3)); // true (within tolerance)
1444
1460
  * ```
1445
1461
  */
1446
- At(this, "equals", (e) => ht(this.left, e.left) && ht(this.top, e.top) && ht(this.width, e.width) && ht(this.height, e.height));
1462
+ Ot(this, "equals", (e) => ht(this.left, e.left) && ht(this.top, e.top) && ht(this.width, e.width) && ht(this.height, e.height));
1447
1463
  this.left = e, this.top = o, this.width = n, this.height = r;
1448
1464
  }
1449
1465
  /**
@@ -1543,7 +1559,7 @@ class Rt {
1543
1559
  return { width: this.width, height: this.height };
1544
1560
  }
1545
1561
  }
1546
- function Xt(t) {
1562
+ function Jt(t) {
1547
1563
  const e = t.getBoundingClientRect();
1548
1564
  return Rt.of({
1549
1565
  top: e.top + window.scrollY,
@@ -1552,29 +1568,29 @@ function Xt(t) {
1552
1568
  height: e.height
1553
1569
  });
1554
1570
  }
1555
- const so = (t) => Te((e) => {
1556
- const { element: o } = e, n = F(Xt(o), (c, a) => c.equals(a)), r = Ft(t(n))(e), s = () => n.set(Rt.of(Xt(o)));
1571
+ const io = (t) => Te((e) => {
1572
+ const { element: o } = e, n = F(Jt(o), (c, a) => c.equals(a)), r = Mt(t(n))(e), s = () => n.set(Rt.of(Jt(o)));
1557
1573
  let i = null;
1558
1574
  return typeof ResizeObserver < "u" && (i = new ResizeObserver(s)), i == null || i.observe(o), M((c) => {
1559
1575
  i == null || i.disconnect(), r(c);
1560
1576
  });
1561
1577
  });
1562
- function Jt(t) {
1578
+ function Gt(t) {
1563
1579
  return {
1564
1580
  /* c8 ignore next 6 */
1565
1581
  width: (t == null ? void 0 : t.innerWidth) ?? 0,
1566
1582
  height: (t == null ? void 0 : t.innerHeight) ?? 0
1567
1583
  };
1568
1584
  }
1569
- const io = (t) => (e) => {
1585
+ const co = (t) => (e) => {
1570
1586
  const o = at(), n = F(
1571
- Jt(o),
1587
+ Gt(o),
1572
1588
  (i, c) => i.width === c.width && i.height === c.height
1573
- ), r = Ft(t(n))(e), s = () => n.set(Jt(o));
1589
+ ), r = Mt(t(n))(e), s = () => n.set(Gt(o));
1574
1590
  return o == null || o.addEventListener("resize", s), (i) => {
1575
1591
  o == null || o.removeEventListener("resize", s), r(i);
1576
1592
  };
1577
- }, Fn = (t, e) => {
1593
+ }, Mn = (t, e) => {
1578
1594
  const o = e.split("/").filter((r) => r !== ""), n = {};
1579
1595
  for (let r = 0; r < t.length; r++) {
1580
1596
  const s = t[r], i = o[r];
@@ -1589,14 +1605,14 @@ const io = (t) => (e) => {
1589
1605
  return { params: n, path: e };
1590
1606
  }
1591
1607
  return o.length !== t.length ? null : { params: n, path: e };
1592
- }, Ae = (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 !== ""), co = (t) => {
1608
+ }, Oe = (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 !== ""), ao = (t) => {
1593
1609
  const e = t.map((o) => {
1594
- const n = Ae(o);
1610
+ const n = Oe(o);
1595
1611
  return { route: o, segments: n };
1596
1612
  });
1597
1613
  return function(n) {
1598
1614
  for (const { segments: r, route: s } of e) {
1599
- const i = Fn(r, n);
1615
+ const i = Mn(r, n);
1600
1616
  if (i)
1601
1617
  return { ...i, route: s };
1602
1618
  }
@@ -1611,7 +1627,7 @@ const io = (t) => (e) => {
1611
1627
  dispose: () => t.dispose()
1612
1628
  };
1613
1629
  }
1614
- }, Mn = (t, e, o) => {
1630
+ }, Nn = (t, e, o) => {
1615
1631
  const n = o.split("/").filter((i) => i !== ""), r = {};
1616
1632
  let s = 0;
1617
1633
  for (let i = 0; i < t.length; i++) {
@@ -1644,25 +1660,25 @@ const io = (t) => (e) => {
1644
1660
  };
1645
1661
  }
1646
1662
  return null;
1647
- }, Oe = (t) => {
1663
+ }, Ae = (t) => {
1648
1664
  const e = t.map((o) => {
1649
- const n = Ae(o);
1665
+ const n = Oe(o);
1650
1666
  return { route: o, segments: n };
1651
1667
  });
1652
1668
  return function(n) {
1653
1669
  for (const { segments: r, route: s } of e) {
1654
- const i = Mn(r, s, n);
1670
+ const i = Nn(r, s, n);
1655
1671
  if (i)
1656
1672
  return i;
1657
1673
  }
1658
1674
  return null;
1659
1675
  };
1660
- }, ao = (t) => {
1661
- const e = Oe(Object.keys(t));
1676
+ }, lo = (t) => {
1677
+ const e = Ae(Object.keys(t));
1662
1678
  return ke(
1663
1679
  Ct,
1664
1680
  {},
1665
- () => rt(Mt, (o) => rt(Ct, (n) => {
1681
+ () => st(Nt, (o) => st(Ct, (n) => {
1666
1682
  const r = o.map((s) => {
1667
1683
  const i = e(s.pathname);
1668
1684
  if (i == null)
@@ -1688,9 +1704,9 @@ const io = (t) => (e) => {
1688
1704
  );
1689
1705
  }))
1690
1706
  );
1691
- }, lo = (t) => {
1692
- const e = Oe(Object.keys(t));
1693
- return rt(Ct, (o) => rt(Mt, (n) => {
1707
+ }, uo = (t) => {
1708
+ const e = Ae(Object.keys(t));
1709
+ return st(Ct, (o) => st(Nt, (n) => {
1694
1710
  const r = o.map((s) => {
1695
1711
  const i = s[s.length - 1], c = (i == null ? void 0 : i.remainingPath) || "";
1696
1712
  if (c === "")
@@ -1713,7 +1729,7 @@ const io = (t) => (e) => {
1713
1729
  t
1714
1730
  );
1715
1731
  }));
1716
- }, yt = 60 * 1e3, Dt = 60 * yt, ct = 24 * Dt, Gt = 7 * ct, Qt = 30 * ct, Nn = 365 * ct, Vn = [
1732
+ }, yt = 60 * 1e3, Dt = 60 * yt, ct = 24 * Dt, Qt = 7 * ct, Zt = 30 * ct, Vn = 365 * ct, $n = [
1717
1733
  {
1718
1734
  max: yt * 90,
1719
1735
  value: yt,
@@ -1736,28 +1752,28 @@ const io = (t) => (e) => {
1736
1752
  future: { singular: "tomorrow", plural: "in {} days" }
1737
1753
  },
1738
1754
  {
1739
- max: Gt * 6,
1740
- value: Gt,
1755
+ max: Qt * 6,
1756
+ value: Qt,
1741
1757
  name: "week",
1742
1758
  past: { singular: "last week", plural: "{} weeks ago" },
1743
1759
  future: { singular: "in a week", plural: "in {} weeks" }
1744
1760
  },
1745
1761
  {
1746
- max: Qt * 18,
1747
- value: Qt,
1762
+ max: Zt * 18,
1763
+ value: Zt,
1748
1764
  name: "month",
1749
1765
  past: { singular: "last month", plural: "{} months ago" },
1750
1766
  future: { singular: "in a month", plural: "in {} months" }
1751
1767
  },
1752
1768
  {
1753
1769
  max: 1 / 0,
1754
- value: Nn,
1770
+ value: Vn,
1755
1771
  name: "year",
1756
1772
  past: { singular: "last year", plural: "{} years ago" },
1757
1773
  future: { singular: "in a year", plural: "in {} years" }
1758
1774
  }
1759
1775
  ];
1760
- function Zt(t, e, o, n) {
1776
+ function te(t, e, o, n) {
1761
1777
  const r = Math.round(t / e);
1762
1778
  return r <= 1 ? o : n.replace(
1763
1779
  "{}",
@@ -1767,84 +1783,85 @@ function Zt(t, e, o, n) {
1767
1783
  })
1768
1784
  );
1769
1785
  }
1770
- const $n = (t = 1e3) => {
1786
+ const Hn = (t = 1e3) => {
1771
1787
  const e = F(/* @__PURE__ */ new Date()), o = De(() => e.set(/* @__PURE__ */ new Date()), t);
1772
1788
  return e.onDispose(o), e;
1773
- }, Hn = (t) => {
1789
+ }, Bn = (t) => {
1774
1790
  const e = Math.abs(t);
1775
1791
  if (e < yt)
1776
1792
  return t < 0 ? "just now" : "in a moment";
1777
- for (const o of Vn)
1793
+ for (const o of $n)
1778
1794
  if (e < o.max)
1779
- return t < 0 ? Zt(e, o.value, o.past.singular, o.past.plural) : Zt(e, o.value, o.future.singular, o.future.plural);
1795
+ return t < 0 ? te(e, o.value, o.past.singular, o.past.plural) : te(e, o.value, o.future.singular, o.future.plural);
1780
1796
  throw new Error("unreachable");
1781
- }, Bn = (t, { now: e, frequency: o = 1e4 } = {}) => {
1782
- const n = e != null ? te.is(e) ? e.derive() : F(e) : $n(o), r = ie(
1797
+ }, Un = (t, { now: e, frequency: o = 1e4 } = {}) => {
1798
+ const n = e != null ? ee.is(e) ? e.derive() : F(e) : Hn(o), r = ie(
1783
1799
  t,
1784
1800
  n
1785
1801
  )((s, i) => s.getTime() - i.getTime());
1786
- return r.onDispose(() => E.dispose(n)), r;
1787
- }, Un = (t, e = {}) => {
1788
- const o = Bn(t, e), n = o.map(Hn);
1802
+ return r.onDispose(() => A.dispose(n)), r;
1803
+ }, zn = (t, e = {}) => {
1804
+ const o = Un(t, e), n = o.map(Bn);
1789
1805
  return n.onDispose(o.dispose), n;
1790
- }, uo = (t, e = {}) => Un(t, e);
1791
- class zn extends Ce {
1806
+ }, fo = (t, e = {}) => zn(t, e);
1807
+ class Kn extends Ce {
1792
1808
  constructor() {
1793
1809
  super(...arguments);
1794
1810
  /**
1795
1811
  * Triggers an update of the Ticker by incrementing its internal value.
1796
1812
  * @returns void
1797
1813
  */
1798
- At(this, "tick", () => this.update((o) => o + 1));
1814
+ Ot(this, "tick", () => this.update((o) => o + 1));
1799
1815
  }
1800
1816
  }
1801
- const fo = (t = 0) => new zn(t, (e, o) => e === o);
1817
+ const ho = (t = 0) => new Kn(t, (e, o) => e === o);
1802
1818
  export {
1803
1819
  Ke as Anchor,
1804
- In as Appearance,
1820
+ Yn as Appearance,
1805
1821
  ue as AsyncResultView,
1806
- Yn as AutoFocus,
1807
- qn as AutoSelect,
1808
- lo as ChildRouter,
1809
- so as ElementRect,
1810
- Jn as HTMLTitle,
1811
- Xn as HiddenWhenEmpty,
1822
+ qn as AutoFocus,
1823
+ Xn as AutoSelect,
1824
+ uo as ChildRouter,
1825
+ io as ElementRect,
1826
+ Qn as HTMLTitle,
1827
+ Gn as HiddenWhenEmpty,
1812
1828
  Ye as InViewport,
1813
- Mt as Location,
1814
- Qn as OnClickOutside,
1815
- Zn as OnEnterKey,
1816
- to as OnEscapeKey,
1829
+ Nt as Location,
1830
+ qe as OnClickOutside,
1831
+ to as OnEnterKey,
1832
+ eo as OnEscapeKey,
1817
1833
  fe as OnKeyPressed,
1818
- no as PopOver,
1834
+ oo as PopOver,
1819
1835
  Rt as Rect,
1820
- oo as Resource,
1821
- Dn as ResourceDisplay,
1822
- Wn as ResultView,
1823
- ao as RootRouter,
1836
+ ro as Resource,
1837
+ Wn as ResourceDisplay,
1838
+ Fn as ResultView,
1839
+ lo as RootRouter,
1824
1840
  Ct as RouterContextProvider,
1825
- ro as SelectOnFocus,
1826
- zn as Ticker,
1827
- Gn as WhenInViewport,
1828
- io as WindowSize,
1841
+ so as SelectOnFocus,
1842
+ Kn as Ticker,
1843
+ Zn as WhenInViewport,
1844
+ co as WindowSize,
1829
1845
  Fe as _checkExtensionCondition,
1830
1846
  We as _getExtension,
1831
- co as _makeRouteMatcher,
1832
- Ae as _parseRouteSegments,
1833
- eo as allPlacements,
1847
+ ao as _makeRouteMatcher,
1848
+ Oe as _parseRouteSegments,
1849
+ no as allPlacements,
1834
1850
  Ve as areLocationsEqual,
1835
- Xt as getAbsoluteRect,
1851
+ Jn as classes,
1852
+ Jt as getAbsoluteRect,
1836
1853
  Ne as handleAnchorClick,
1837
1854
  le as locationFromURL,
1838
- Cn as makeResource,
1839
- qe as matchesKeyCombo,
1840
- Fn as matchesRoute,
1841
- $n as nowSignal,
1842
- uo as relativeTime,
1843
- Bn as relativeTimeMillisSignal,
1844
- Un as relativeTimeSignal,
1845
- zt as setLocationFromUrl,
1846
- fo as ticker,
1847
- Hn as timeDiffToString,
1855
+ Dn as makeResource,
1856
+ Xe as matchesKeyCombo,
1857
+ Mn as matchesRoute,
1858
+ Hn as nowSignal,
1859
+ fo as relativeTime,
1860
+ Un as relativeTimeMillisSignal,
1861
+ zn as relativeTimeSignal,
1862
+ Kt as setLocationFromUrl,
1863
+ ho as ticker,
1864
+ Bn as timeDiffToString,
1848
1865
  Pt as urlFromLocation,
1849
- _e as useAppearance
1866
+ je as useAppearance
1850
1867
  };