@tempots/ui 15.0.1 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.js +735 -1722
  3. package/package.json +4 -5
package/index.js CHANGED
@@ -1,113 +1,114 @@
1
- import { getWindow as st, prop as M, makeProviderMark as Mt, computedOf as Nt, Signal as le, Use as ct, html as Pt, on as ue, Value as C, attr as Vt, Empty as Lt, OneOfType as fe, WithElement as _, OnDispose as N, Fragment as X, Portal as he, renderableOfTNode as de, When as me, previousSignal as We, effectOf as He, WithBrowserCtx as Fe, WithCtx as Me, OneOfTuple as pe, Provide as Ne, Prop as Ve } from "@tempots/dom";
2
- import { delayed as ge, AsyncResult as R, nearEqual as mt, interval as $e } from "@tempots/std";
3
- const ze = (t) => {
4
- const e = t.split("/").pop();
5
- if (e == null || e.startsWith(".")) return;
6
- const n = e.split(".") || [];
1
+ import { getWindow as W, prop as b, makeProviderMark as Q, computedOf as J, Signal as ft, Use as M, html as V, on as mt, Value as y, attr as X, Empty as _, OneOfType as gt, WithElement as L, OnDispose as x, Fragment as R, Portal as vt, renderableOfTNode as wt, When as yt, previousSignal as Lt, effectOf as Rt, WithBrowserCtx as At, WithCtx as Ht, OneOfTuple as St, Provide as Tt, Prop as Wt, strictEquals as Ut } from "@tempots/dom";
2
+ import { delayed as bt, AsyncResult as v, nearEqual as C, interval as Kt } from "@tempots/std";
3
+ import { autoUpdate as Mt, flip as st, offset as Dt, shift as Nt, computePosition as Ct, arrow as Ft } from "@floating-ui/dom";
4
+ const zt = (e) => {
5
+ const t = e.split("/").pop();
6
+ if (t == null || t.startsWith(".")) return;
7
+ const n = t.split(".") || [];
7
8
  return n.length > 1 ? "." + n.pop() : void 0;
8
- }, Be = (t, e) => {
9
- const n = ze(e);
10
- return n != null && (t.length === 0 || !t.some((o) => n == o));
11
- }, _e = (t, e, n, o) => {
12
- let s = t.target;
13
- for (; s != null && !(s instanceof HTMLAnchorElement); )
14
- s = s.parentElement;
15
- if (s == null)
9
+ }, $t = (e, t) => {
10
+ const n = zt(t);
11
+ return n != null && (e.length === 0 || !e.some((s) => n == s));
12
+ }, jt = (e, t, n, s) => {
13
+ let a = e.target;
14
+ for (; a != null && !(a instanceof HTMLAnchorElement); )
15
+ a = a.parentElement;
16
+ if (a == null)
16
17
  return !0;
17
- const i = s;
18
- if (t.button !== 0 || t.ctrlKey || t.metaKey || i.target !== "_self" && i.target !== "" || i.getAttribute("download") != null)
18
+ const o = a;
19
+ if (e.button !== 0 || e.ctrlKey || e.metaKey || o.target !== "_self" && o.target !== "" || o.getAttribute("download") != null)
19
20
  return !0;
20
- const { pathname: r, search: a, hash: c } = i;
21
- if (o) {
22
- const l = r + a + c, u = i.getAttribute("href");
23
- if (!u?.startsWith("#") && u !== l)
21
+ const { pathname: r, search: i, hash: c } = o;
22
+ if (s) {
23
+ const u = r + i + c, d = o.getAttribute("href");
24
+ if (!d?.startsWith("#") && d !== u)
24
25
  return !0;
25
26
  }
26
- return e ? !1 : Be(n, r);
27
- }, Ue = (t, e = {
27
+ return t ? !1 : $t(n, r);
28
+ }, Vt = (e, t = {
28
29
  ignoreUrlWithExtension: !0,
29
30
  allowedExtensions: [],
30
31
  ignoreExternalUrl: !0
31
32
  }) => {
32
- const n = e.ignoreUrlWithExtension === !0 && Array.isArray(e.allowedExtensions) ? e.allowedExtensions.map(
33
- (o) => o.startsWith(".") ? o : "." + o
33
+ const n = t.ignoreUrlWithExtension === !0 && Array.isArray(t.allowedExtensions) ? t.allowedExtensions.map(
34
+ (s) => s.startsWith(".") ? s : "." + s
34
35
  ) : [];
35
- return (o) => {
36
- _e(
37
- o,
38
- e.ignoreUrlWithExtension ?? !0,
36
+ return (s) => {
37
+ jt(
38
+ s,
39
+ t.ignoreUrlWithExtension ?? !0,
39
40
  n,
40
- e.ignoreExternalUrl ?? !0
41
- ) || t() && o.preventDefault();
41
+ t.ignoreExternalUrl ?? !0
42
+ ) || e() && s.preventDefault();
42
43
  };
43
- }, Ke = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, kt = (t, e) => {
44
- const n = new URL(t, e ?? st()?.location.toString()), o = Object.fromEntries(n.searchParams?.entries() ?? []);
45
- let s = n.hash;
46
- return s.startsWith("#") && (s = s.substring(1)), {
44
+ }, _t = (e, t) => e.pathname === t.pathname && JSON.stringify(e.search) === JSON.stringify(t.search) && e.hash === t.hash, I = (e, t) => {
45
+ const n = new URL(e, t ?? W()?.location.toString()), s = Object.fromEntries(n.searchParams?.entries() ?? []);
46
+ let a = n.hash;
47
+ return a.startsWith("#") && (a = a.substring(1)), {
47
48
  pathname: n.pathname,
48
- search: o,
49
- hash: s === "" ? void 0 : s
49
+ search: s,
50
+ hash: a === "" ? void 0 : a
50
51
  };
51
- }, et = (t) => {
52
- const n = new URLSearchParams(t.search).toString(), o = t.hash;
53
- return `${t.pathname}${n ? `?${n}` : ""}${o ? `#${o}` : ""}`;
54
- }, je = (t) => {
55
- document.startViewTransition ? document.startViewTransition(t) : t();
56
- }, jt = () => {
57
- const t = st(), e = t?.location.hash ?? "";
52
+ }, T = (e) => {
53
+ const n = new URLSearchParams(e.search).toString(), s = e.hash;
54
+ return `${e.pathname}${n ? `?${n}` : ""}${s ? `#${s}` : ""}`;
55
+ }, It = (e) => {
56
+ document.startViewTransition ? document.startViewTransition(e) : e();
57
+ }, rt = () => {
58
+ const e = W(), t = e?.location.hash ?? "";
58
59
  return {
59
- pathname: t?.location.pathname ?? "",
60
+ pathname: e?.location.pathname ?? "",
60
61
  search: Object.fromEntries(
61
- new URLSearchParams(t?.location.search ?? "").entries()
62
+ new URLSearchParams(e?.location.search ?? "").entries()
62
63
  ),
63
- hash: e.startsWith("#") ? e.substring(1) || void 0 : e === "" ? void 0 : e
64
+ hash: t.startsWith("#") ? t.substring(1) || void 0 : t === "" ? void 0 : t
64
65
  };
65
- }, It = (t) => {
66
- if (t?.scroll !== "auto")
66
+ }, at = (e) => {
67
+ if (e?.scroll !== "auto")
67
68
  return;
68
- const e = st();
69
- e && e.requestAnimationFrame(
70
- () => e.scrollTo({ top: 0, left: 0, behavior: "auto" })
69
+ const t = W();
70
+ t && t.requestAnimationFrame(
71
+ () => t.scrollTo({ top: 0, left: 0, behavior: "auto" })
71
72
  );
72
- }, Xt = (t, e) => {
73
- e?.viewTransition ? je(t) : t();
74
- }, Ie = () => {
75
- const t = M(jt(), Ke), e = st(), n = () => {
76
- t.set(jt());
73
+ }, ot = (e, t) => {
74
+ t?.viewTransition ? It(e) : e();
75
+ }, Bt = () => {
76
+ const e = b(rt(), _t), t = W(), n = () => {
77
+ e.set(rt());
77
78
  };
78
- e?.addEventListener("popstate", n), e?.addEventListener("hashchange", n);
79
- const o = (c, l, u) => {
80
- Xt(() => {
81
- if (e) {
82
- const h = et(c), m = l?.state ?? {};
83
- u === "replaceState" || l?.replace ? e.history.replaceState(m, "", h) : e.history.pushState(m, "", h);
79
+ t?.addEventListener("popstate", n), t?.addEventListener("hashchange", n);
80
+ const s = (c, u, d) => {
81
+ ot(() => {
82
+ if (t) {
83
+ const w = T(c), P = u?.state ?? {};
84
+ d === "replaceState" || u?.replace ? t.history.replaceState(P, "", w) : t.history.pushState(P, "", w);
84
85
  }
85
- t.set(c);
86
- }, l), It(l);
87
- }, s = (c, l) => {
88
- Xt(() => {
89
- e?.history.go(c);
90
- }, l), It(l);
86
+ e.set(c);
87
+ }, u), at(u);
88
+ }, a = (c, u) => {
89
+ ot(() => {
90
+ t?.history.go(c);
91
+ }, u), at(u);
91
92
  };
92
93
  return {
93
- location: t,
94
- commit: o,
95
- go: s,
96
- back: (c) => s(-1, c),
97
- forward: (c) => s(1, c),
98
- resolve: (c) => kt(c),
94
+ location: e,
95
+ commit: s,
96
+ go: a,
97
+ back: (c) => a(-1, c),
98
+ forward: (c) => a(1, c),
99
+ resolve: (c) => I(c),
99
100
  dispose: () => {
100
- e?.removeEventListener("popstate", n), e?.removeEventListener("hashchange", n), t.dispose();
101
+ t?.removeEventListener("popstate", n), t?.removeEventListener("hashchange", n), e.dispose();
101
102
  }
102
103
  };
103
- }, Xe = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), Ye = (t) => {
104
- const e = t.container.currentURL, n = e.iso(
105
- (r) => kt(r, e.value),
104
+ }, qt = (e) => e.startsWith("http://") || e.startsWith("https://") || e.startsWith("//"), Yt = (e) => {
105
+ const t = e.container.currentURL, n = t.iso(
106
+ (r) => I(r, t.value),
106
107
  (r) => {
107
- if (Xe(r.pathname))
108
- return et(r);
109
- const a = new URL(r.pathname, e.value), c = a.origin + a.pathname;
110
- return et({ ...r, pathname: c });
108
+ if (qt(r.pathname))
109
+ return T(r);
110
+ const i = new URL(r.pathname, t.value), c = i.origin + i.pathname;
111
+ return T({ ...r, pathname: c });
111
112
  }
112
113
  );
113
114
  return {
@@ -115,10 +116,10 @@ const ze = (t) => {
115
116
  dispose: () => {
116
117
  n.dispose();
117
118
  },
118
- commit: (r, a, c) => {
119
+ commit: (r, i, c) => {
119
120
  n.set(r);
120
121
  },
121
- go: (r, a) => {
122
+ go: (r, i) => {
122
123
  },
123
124
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
124
125
  back: (r) => {
@@ -126,64 +127,64 @@ const ze = (t) => {
126
127
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
127
128
  forward: (r) => {
128
129
  },
129
- resolve: (r) => kt(r, e.value)
130
+ resolve: (r) => I(r, t.value)
130
131
  };
131
- }, it = (t) => ({
132
- pathname: t.pathname,
133
- search: { ...t.search },
134
- hash: t.hash ?? void 0
135
- }), Tt = (t) => {
136
- if (t == null) return;
137
- const e = `${t}`;
138
- return e === "" ? void 0 : e;
139
- }, we = (t, e) => {
140
- const n = { ...t };
141
- for (const [o, s] of Object.entries(e))
142
- s == null ? delete n[o] : n[o] = s;
132
+ }, U = (e) => ({
133
+ pathname: e.pathname,
134
+ search: { ...e.search },
135
+ hash: e.hash ?? void 0
136
+ }), B = (e) => {
137
+ if (e == null) return;
138
+ const t = `${e}`;
139
+ return t === "" ? void 0 : t;
140
+ }, xt = (e, t) => {
141
+ const n = { ...e };
142
+ for (const [s, a] of Object.entries(t))
143
+ a == null ? delete n[s] : n[s] = a;
143
144
  return n;
144
- }, qe = (t, e) => {
145
- const n = e?.includeSearch ?? !0, o = e?.includeHash ?? !0, s = e?.ignoreSearchParams ?? [];
146
- let i;
145
+ }, Qt = (e, t) => {
146
+ const n = t?.includeSearch ?? !0, s = t?.includeHash ?? !0, a = t?.ignoreSearchParams ?? [];
147
+ let o;
147
148
  if (!n)
148
- i = {};
149
- else if (s.length === 0)
150
- i = { ...t.search };
149
+ o = {};
150
+ else if (a.length === 0)
151
+ o = { ...e.search };
151
152
  else {
152
- const r = new Set(s);
153
- i = {};
154
- for (const [a, c] of Object.entries(t.search))
155
- r.has(a) || (i[a] = c);
153
+ const r = new Set(a);
154
+ o = {};
155
+ for (const [i, c] of Object.entries(e.search))
156
+ r.has(i) || (o[i] = c);
156
157
  }
157
158
  return {
158
- pathname: t.pathname,
159
- search: i,
160
- hash: o ? t.hash : void 0
159
+ pathname: e.pathname,
160
+ search: o,
161
+ hash: s ? e.hash : void 0
161
162
  };
162
- }, Yt = (t, e, n) => {
163
- const o = qe(t, n);
164
- return typeof e == "string" ? et(o) === e : e instanceof RegExp ? ((e.global || e.sticky) && (e.lastIndex = 0), e.test(et(o))) : e(o);
163
+ }, it = (e, t, n) => {
164
+ const s = Qt(e, n);
165
+ return typeof t == "string" ? T(s) === t : t instanceof RegExp ? ((t.global || t.sticky) && (t.lastIndex = 0), t.test(T(s))) : t(s);
165
166
  };
166
- class Qe {
167
- constructor(e) {
168
- this.current = e;
167
+ class Jt {
168
+ constructor(t) {
169
+ this.current = t;
169
170
  }
170
171
  get location() {
171
172
  return this.current;
172
173
  }
173
- setLocation(e) {
174
- return this.current = it(e), this;
174
+ setLocation(t) {
175
+ return this.current = U(t), this;
175
176
  }
176
- setPathname(e) {
177
+ setPathname(t) {
177
178
  return this.current = {
178
179
  ...this.current,
179
- pathname: e
180
+ pathname: t
180
181
  }, this;
181
182
  }
182
- setHash(e) {
183
- const n = Tt(e);
183
+ setHash(t) {
184
+ const n = B(t);
184
185
  if (n == null) {
185
- const { hash: o, ...s } = this.current;
186
- this.current = s;
186
+ const { hash: s, ...a } = this.current;
187
+ this.current = a;
187
188
  } else
188
189
  this.current = {
189
190
  ...this.current,
@@ -192,181 +193,181 @@ class Qe {
192
193
  return this;
193
194
  }
194
195
  clearHash() {
195
- const { hash: e, ...n } = this.current;
196
+ const { hash: t, ...n } = this.current;
196
197
  return this.current = n, this;
197
198
  }
198
- setSearch(e) {
199
+ setSearch(t) {
199
200
  return this.current = {
200
201
  ...this.current,
201
- search: we(this.current.search, e)
202
+ search: xt(this.current.search, t)
202
203
  }, this;
203
204
  }
204
- setSearchParam(e, n) {
205
- return this.setSearch({ [e]: n });
205
+ setSearchParam(t, n) {
206
+ return this.setSearch({ [t]: n });
206
207
  }
207
- updateSearch(e) {
208
+ updateSearch(t) {
208
209
  return this.current = {
209
210
  ...this.current,
210
- search: { ...e({ ...this.current.search }) }
211
+ search: { ...t({ ...this.current.search }) }
211
212
  }, this;
212
213
  }
213
214
  }
214
- const Je = (t, e) => t?.replace ? "replaceState" : e, Ge = (t) => {
215
- const e = t.location, n = e.map(et), o = e.map((g) => g.pathname), s = e.map((g) => ({ ...g.search })), i = e.map((g) => g.hash), r = (g, x) => Yt(t.location.value, g, x), a = (g, x) => Nt(
216
- e,
217
- g
215
+ const Xt = (e, t) => e?.replace ? "replaceState" : t, Gt = (e) => {
216
+ const t = e.location, n = t.map(T), s = t.map((l) => l.pathname), a = t.map((l) => ({ ...l.search })), o = t.map((l) => l.hash), r = (l, h) => it(e.location.value, l, h), i = (l, h) => J(
217
+ t,
218
+ l
218
219
  )(
219
- (S, L) => Yt(S, L, x)
220
- ), c = (g, x, S) => {
221
- const L = it({
222
- ...g,
223
- hash: Tt(g.hash ?? void 0)
220
+ (p, A) => it(p, A, h)
221
+ ), c = (l, h, p) => {
222
+ const A = U({
223
+ ...l,
224
+ hash: B(l.hash ?? void 0)
224
225
  });
225
- t.commit(L, x, S);
226
- }, l = (g, x) => {
227
- const S = Je(x, "pushState");
228
- c(g, x, S);
229
- }, u = (g, x) => {
230
- const S = g(it(t.location.value));
231
- l(S, x);
232
- }, h = (g, x) => {
233
- const S = t.resolve(g);
234
- l(S, x);
235
- }, m = (g, x) => {
236
- const S = { ...x, replace: !0 };
237
- h(g, S);
238
- }, f = (g, x) => {
239
- t.go(g, x);
240
- }, d = (g) => {
241
- t.back(g);
242
- }, y = (g) => {
243
- t.forward(g);
244
- }, p = (g, x) => u((S) => ({ ...S, pathname: g }), x), v = (g, x) => u((S) => {
245
- const L = { ...S }, K = Tt(g);
246
- return K == null ? delete L.hash : L.hash = K, L;
247
- }, x), b = (g) => v(void 0, g), w = (g, x) => u(
248
- (S) => ({
249
- ...S,
250
- search: we(S.search, g)
226
+ e.commit(A, h, p);
227
+ }, u = (l, h) => {
228
+ const p = Xt(h, "pushState");
229
+ c(l, h, p);
230
+ }, d = (l, h) => {
231
+ const p = l(U(e.location.value));
232
+ u(p, h);
233
+ }, w = (l, h) => {
234
+ const p = e.resolve(l);
235
+ u(p, h);
236
+ }, P = (l, h) => {
237
+ const p = { ...h, replace: !0 };
238
+ w(l, p);
239
+ }, k = (l, h) => {
240
+ e.go(l, h);
241
+ }, f = (l) => {
242
+ e.back(l);
243
+ }, E = (l) => {
244
+ e.forward(l);
245
+ }, m = (l, h) => d((p) => ({ ...p, pathname: l }), h), S = (l, h) => d((p) => {
246
+ const A = { ...p }, nt = B(l);
247
+ return nt == null ? delete A.hash : A.hash = nt, A;
248
+ }, h), O = (l) => S(void 0, l), g = (l, h) => d(
249
+ (p) => ({
250
+ ...p,
251
+ search: xt(p.search, l)
251
252
  }),
252
- x
253
+ h
253
254
  );
254
255
  return {
255
256
  handle: {
256
- location: e,
257
+ location: t,
257
258
  url: n,
258
- pathname: o,
259
- search: s,
260
- hash: i,
261
- setLocation: l,
262
- updateLocation: u,
263
- navigate: h,
264
- replace: m,
265
- go: f,
266
- back: d,
267
- forward: y,
268
- setPathname: p,
269
- setHash: v,
270
- clearHash: b,
271
- setSearch: w,
272
- setSearchParam: (g, x, S) => w({ [g]: x }, S),
273
- updateSearch: (g, x) => u(
274
- (S) => ({
275
- ...S,
276
- search: { ...g({ ...S.search }) }
259
+ pathname: s,
260
+ search: a,
261
+ hash: o,
262
+ setLocation: u,
263
+ updateLocation: d,
264
+ navigate: w,
265
+ replace: P,
266
+ go: k,
267
+ back: f,
268
+ forward: E,
269
+ setPathname: m,
270
+ setHash: S,
271
+ clearHash: O,
272
+ setSearch: g,
273
+ setSearchParam: (l, h, p) => g({ [l]: h }, p),
274
+ updateSearch: (l, h) => d(
275
+ (p) => ({
276
+ ...p,
277
+ search: { ...l({ ...p.search }) }
277
278
  }),
278
- x
279
+ h
279
280
  ),
280
- queryParam: (g) => e.map((x) => x.search[g]),
281
- run: (g, x) => {
282
- const S = new Qe(
283
- it(t.location.value)
281
+ queryParam: (l) => t.map((h) => h.search[l]),
282
+ run: (l, h) => {
283
+ const p = new Jt(
284
+ U(e.location.value)
284
285
  );
285
- g(S), l(it(S.location), x);
286
+ l(p), u(U(p.location), h);
286
287
  },
287
288
  match: r,
288
- matchSignal: a
289
+ matchSignal: i
289
290
  },
290
291
  dispose: () => {
291
- t.dispose(), n.dispose(), o.dispose(), s.dispose(), i.dispose();
292
+ e.dispose(), n.dispose(), s.dispose(), a.dispose(), o.dispose();
292
293
  }
293
294
  };
294
- }, Ze = (t) => {
295
- if (t.isBrowser())
296
- return Ie();
297
- if (t.isHeadless())
298
- return Ye(t);
295
+ }, Zt = (e) => {
296
+ if (e.isBrowser())
297
+ return Bt();
298
+ if (e.isHeadless())
299
+ return Yt(e);
299
300
  throw new Error("Unknown context");
300
- }, $t = {
301
- mark: Mt("Location"),
302
- create: (t, e) => {
303
- const n = Ze(e), { handle: o, dispose: s } = Ge(n);
301
+ }, G = {
302
+ mark: Q("Location"),
303
+ create: (e, t) => {
304
+ const n = Zt(t), { handle: s, dispose: a } = Gt(n);
304
305
  return {
305
- value: o,
306
- dispose: s
306
+ value: s,
307
+ dispose: a
307
308
  };
308
309
  }
309
- }, tn = (t, ...e) => {
310
- if (typeof t == "string" || le.is(t))
311
- return tn({ href: t }, ...e);
312
- const { href: n, state: o, scroll: s, viewTransition: i, replace: r, ...a } = t;
313
- return ct($t, (c) => Pt.a(
314
- ue.click(
315
- Ue(() => {
316
- let l = !1;
317
- const u = {};
318
- return o !== void 0 && (u.state = o, l = !0), s !== void 0 && (u.scroll = s, l = !0), i !== void 0 && (u.viewTransition = i, l = !0), r !== void 0 && (u.replace = r, l = !0), c.navigate(
319
- C.get(n),
320
- l ? u : void 0
310
+ }, te = (e, ...t) => {
311
+ if (typeof e == "string" || ft.is(e))
312
+ return te({ href: e }, ...t);
313
+ const { href: n, state: s, scroll: a, viewTransition: o, replace: r, ...i } = e;
314
+ return M(G, (c) => V.a(
315
+ mt.click(
316
+ Vt(() => {
317
+ let u = !1;
318
+ const d = {};
319
+ return s !== void 0 && (d.state = s, u = !0), a !== void 0 && (d.scroll = a, u = !0), o !== void 0 && (d.viewTransition = o, u = !0), r !== void 0 && (d.replace = r, u = !0), c.navigate(
320
+ y.get(n),
321
+ u ? d : void 0
321
322
  ), !0;
322
- }, a)
323
+ }, i)
323
324
  ),
324
- Vt.href(n),
325
- ...e
325
+ X.href(n),
326
+ ...t
326
327
  /* c8 ignore next 2 */
327
328
  ));
328
- }, bo = {
329
- mark: Mt("Appearance"),
329
+ }, Oe = {
330
+ mark: Q("Appearance"),
330
331
  create: () => {
331
- const t = en();
332
+ const e = ee();
332
333
  return {
333
- value: t,
334
- dispose: t.dispose
334
+ value: e,
335
+ dispose: () => e.dispose()
335
336
  };
336
337
  }
337
338
  };
338
- function en() {
339
- const t = st(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, n = e?.matches ?? !1, o = M(n ? "dark" : "light"), s = (i) => o.set(i.matches ? "dark" : "light");
340
- return e?.addEventListener("change", s), o.onDispose(() => e?.removeEventListener("change", s)), o;
341
- }
342
- const ve = (t, e) => {
343
- if (typeof e == "function")
344
- return ve(t, { success: e });
345
- const n = e.failure ?? ((r) => r.map((a) => `Error: ${a}`)), o = e.success, s = e.loading ?? (() => Lt), i = e.notAsked ?? (() => Lt);
346
- return fe(C.toSignal(t), {
347
- AsyncSuccess: (r) => o(r.$.value),
339
+ function ee() {
340
+ const e = W(), t = e != null && e.matchMedia != null ? e.matchMedia("(prefers-color-scheme: dark)") : void 0, n = t?.matches ?? !1, s = b(n ? "dark" : "light"), a = (o) => s.set(o.matches ? "dark" : "light");
341
+ return t?.addEventListener("change", a), s.onDispose(() => t?.removeEventListener("change", a)), s;
342
+ }
343
+ const Pt = (e, t) => {
344
+ if (typeof t == "function")
345
+ return Pt(e, { success: t });
346
+ const n = t.failure ?? ((r) => r.map((i) => `Error: ${i}`)), s = t.success, a = t.loading ?? (() => _), o = t.notAsked ?? (() => _);
347
+ return gt(y.toSignal(e), {
348
+ AsyncSuccess: (r) => s(r.$.value),
348
349
  AsyncFailure: (r) => n(r.$.error),
349
- Loading: (r) => s(r.map((a) => a.previousValue)),
350
- NotAsked: i
350
+ Loading: (r) => a(r.map((i) => i.previousValue)),
351
+ NotAsked: o
351
352
  });
352
- }, So = (t = 10) => _((e) => N(ge(() => e?.focus(), t))), Oo = (t = 10) => _((e) => {
353
- const n = ge(() => e.select(), t);
354
- return N(n);
353
+ }, Le = (e = 10) => L((t) => x(bt(() => t?.focus(), e))), Re = (e = 10) => L((t) => {
354
+ const n = bt(() => t.select(), e);
355
+ return x(n);
355
356
  });
356
- function Ao(t) {
357
- const e = Object.entries(t);
358
- return X(
359
- ...e.map(
360
- ([n, o]) => Vt.class(C.map(o, (s) => s ? n : void 0))
357
+ function Ae(e) {
358
+ const t = Object.entries(e);
359
+ return R(
360
+ ...t.map(
361
+ ([n, s]) => X.class(y.map(s, (a) => a ? n : void 0))
361
362
  )
362
363
  );
363
364
  }
364
- const Ro = _((t) => {
365
- const e = t.style.getPropertyValue(":empty");
366
- return t.style.setProperty(":empty", "display:none"), N((n) => {
367
- n && t.style.setProperty(":empty", e);
365
+ const He = L((e) => {
366
+ const t = e.style.getPropertyValue(":empty");
367
+ return e.style.setProperty(":empty", "display:none"), x((n) => {
368
+ n && e.style.setProperty(":empty", t);
368
369
  });
369
- }), Eo = (t) => he("head > title", Vt.innerText(t)), nn = {
370
+ }), Te = (e) => vt("head > title", X.innerText(e)), ne = {
370
371
  partial: {
371
372
  root: null,
372
373
  rootMargin: "0px",
@@ -377,1139 +378,151 @@ const Ro = _((t) => {
377
378
  rootMargin: "0px",
378
379
  threshold: 1
379
380
  }
380
- }, gt = {
381
+ }, F = {
381
382
  partial: /* @__PURE__ */ new Map(),
382
383
  full: /* @__PURE__ */ new Map()
383
- }, at = {
384
+ }, K = {
384
385
  partial: null,
385
386
  full: null
386
387
  };
387
- function on(t) {
388
- return at[t] == null && (at[t] = new IntersectionObserver((e) => {
389
- e.forEach((n) => {
390
- gt[t].get(n.target)?.set(n.isIntersecting);
388
+ function se(e) {
389
+ return K[e] == null && (K[e] = new IntersectionObserver((t) => {
390
+ t.forEach((n) => {
391
+ F[e].get(n.target)?.set(n.isIntersecting);
391
392
  });
392
- }, nn[t])), at[t];
393
- }
394
- const sn = ({ mode: t = "partial", once: e = !1 }, n) => {
395
- const o = M(!1);
396
- return X(
397
- _((s) => {
398
- const i = typeof IntersectionObserver < "u" ? on(t) : null;
399
- gt[t].set(s, o), i?.observe(s);
393
+ }, ne[e])), K[e];
394
+ }
395
+ const re = ({ mode: e = "partial", once: t = !1 }, n) => {
396
+ const s = b(!1);
397
+ return R(
398
+ L((a) => {
399
+ const o = typeof IntersectionObserver < "u" ? se(e) : null;
400
+ F[e].set(a, s), o?.observe(a);
400
401
  function r() {
401
- i?.unobserve(s), gt[t].delete(s), gt[t].size === 0 && (at[t]?.disconnect(), at[t] = null);
402
+ o?.unobserve(a), F[e].delete(a), F[e].size === 0 && (K[e]?.disconnect(), K[e] = null);
402
403
  }
403
- let a = null;
404
- return e && (a = o.on((c) => {
404
+ let i = null;
405
+ return t && (i = s.on((c) => {
405
406
  c && r();
406
- })), N(() => {
407
- o.dispose(), r(), a?.();
407
+ })), x(() => {
408
+ s.dispose(), r(), i?.();
408
409
  });
409
410
  }),
410
- de(n(o))
411
+ wt(n(s))
411
412
  );
412
- }, Po = (t, e, n) => sn(t, (o) => me(o, e, n ?? (() => Lt)));
413
- function rn(t) {
414
- return _((e) => {
415
- const n = (o) => {
416
- e.contains(o.target) || t(o);
413
+ }, We = (e, t, n) => re(e, (s) => yt(s, t, n ?? (() => _)));
414
+ function ae(e) {
415
+ return L((t) => {
416
+ const n = (s) => {
417
+ t.contains(s.target) || e(s);
417
418
  };
418
- return document.addEventListener("click", n), N(() => {
419
+ return document.addEventListener("click", n), x(() => {
419
420
  document.removeEventListener("click", n);
420
421
  });
421
422
  });
422
423
  }
423
- const Z = (t, e) => t === void 0 || t === e, qt = (t, e) => t === void 0 || t === e;
424
- function an(t, e) {
425
- return typeof t == "string" ? e.key === t : qt(t.key, e.key) && qt(t.code, e.code) && Z(t.ctrlKey, e.ctrlKey) && Z(t.altKey, e.altKey) && Z(t.shiftKey, e.shiftKey) && Z(t.metaKey, e.metaKey) && Z(t.repeat, e.repeat) && Z(
426
- t.commandOrControlKey,
427
- e.metaKey || e.ctrlKey
424
+ const H = (e, t) => e === void 0 || e === t, ct = (e, t) => e === void 0 || e === t;
425
+ function oe(e, t) {
426
+ return typeof e == "string" ? t.key === e : ct(e.key, t.key) && ct(e.code, t.code) && H(e.ctrlKey, t.ctrlKey) && H(e.altKey, t.altKey) && H(e.shiftKey, t.shiftKey) && H(e.metaKey, t.metaKey) && H(e.repeat, t.repeat) && H(
427
+ e.commandOrControlKey,
428
+ t.metaKey || t.ctrlKey
428
429
  );
429
430
  }
430
- function ye({
431
- allowedKeys: t,
432
- handler: e
431
+ function kt({
432
+ allowedKeys: e,
433
+ handler: t
433
434
  }) {
434
- return _((n) => {
435
- const o = (s) => {
436
- if (n.contains(s.target)) {
437
- for (const i of t)
438
- if (an(i, s)) {
439
- e(s);
435
+ return L((n) => {
436
+ const s = (a) => {
437
+ if (n.contains(a.target)) {
438
+ for (const o of e)
439
+ if (oe(o, a)) {
440
+ t(a);
440
441
  break;
441
442
  }
442
443
  }
443
444
  };
444
- return document.addEventListener("keydown", o), N(() => {
445
- document.removeEventListener("keydown", o);
445
+ return document.addEventListener("keydown", s), x(() => {
446
+ document.removeEventListener("keydown", s);
446
447
  });
447
448
  });
448
449
  }
449
- function Lo(t) {
450
- return ye({ allowedKeys: ["Enter"], handler: t });
450
+ function Ue(e) {
451
+ return kt({ allowedKeys: ["Enter"], handler: e });
451
452
  }
452
- function ko(t) {
453
- return ye({ allowedKeys: ["Escape"], handler: t });
453
+ function Ke(e) {
454
+ return kt({ allowedKeys: ["Escape"], handler: e });
454
455
  }
455
- const cn = ({
456
- mutate: t,
457
- convertError: e,
456
+ const ie = ({
457
+ mutate: e,
458
+ convertError: t,
458
459
  onSuccess: n,
459
- onError: o,
460
- onSettled: s
460
+ onError: s,
461
+ onSettled: a
461
462
  }) => {
462
- let i;
463
- const r = M(R.notAsked), a = r.map(
464
- (d) => R.isSuccess(d) ? d.value : void 0
463
+ let o;
464
+ const r = b(v.notAsked), i = r.map(
465
+ (f) => v.isSuccess(f) ? f.value : void 0
465
466
  ), c = r.map(
466
- (d) => R.isFailure(d) ? d.error : void 0
467
- ), l = r.map((d) => R.isLoading(d)), u = () => {
468
- i?.abort(), i = void 0;
467
+ (f) => v.isFailure(f) ? f.error : void 0
468
+ ), u = r.map((f) => v.isLoading(f)), d = () => {
469
+ o?.abort(), o = void 0;
469
470
  };
470
471
  return {
471
472
  status: r,
472
- value: a,
473
+ value: i,
473
474
  error: c,
474
- pending: l,
475
- execute: async (d, y) => {
476
- u(), i = new AbortController();
477
- const p = i.signal, v = r.get(), b = y?.optimisticValue ?? (y?.optimisticFromRequest != null ? y.optimisticFromRequest(d) : void 0);
478
- b != null ? r.set(R.loading(b)) : r.set(R.loading(R.getOrUndefined(v)));
475
+ pending: u,
476
+ execute: async (f, E) => {
477
+ d(), o = new AbortController();
478
+ const m = o.signal, S = r.get(), O = E?.optimisticValue ?? (E?.optimisticFromRequest != null ? E.optimisticFromRequest(f) : void 0);
479
+ O != null ? r.set(v.loading(O)) : r.set(v.loading(v.getOrUndefined(S)));
479
480
  try {
480
- const w = await t({ request: d, abortSignal: p, previous: v });
481
- i = void 0, r.set(R.success(w)), n?.(w, d);
482
- } catch (w) {
483
- i = void 0, r.set(R.failure(e(w))), o?.(e(w), d);
481
+ const g = await e({ request: f, abortSignal: m, previous: S });
482
+ o = void 0, r.set(v.success(g)), n?.(g, f);
483
+ } catch (g) {
484
+ o = void 0, r.set(v.failure(t(g))), s?.(t(g), f);
484
485
  }
485
- s?.(r.get(), d);
486
+ a?.(r.get(), f);
486
487
  },
487
- cancel: (d) => {
488
- u(), r.set(d ?? R.notAsked);
488
+ cancel: (f) => {
489
+ d(), r.set(f ?? v.notAsked);
489
490
  },
490
491
  dispose: () => {
491
- i?.abort(), i = void 0, r.dispose();
492
+ o?.abort(), o = void 0, r.dispose();
492
493
  }
493
494
  };
494
- }, ln = (t, e) => {
495
- const { status: n, dispose: o, execute: s, cancel: i, pending: r, error: a, value: c } = t, { content: l } = e, u = We(c);
496
- return X(
497
- N(o),
498
- l({
499
- previous: u,
500
- execute: s,
501
- cancel: i,
495
+ }, ce = (e, t) => {
496
+ const { status: n, dispose: s, execute: a, cancel: o, pending: r, error: i, value: c } = e, { content: u } = t, d = Lt(c);
497
+ return R(
498
+ x(s),
499
+ u({
500
+ previous: d,
501
+ execute: a,
502
+ cancel: o,
502
503
  pending: r,
503
- error: a,
504
+ error: i,
504
505
  value: c,
505
506
  status: n
506
507
  })
507
508
  );
508
- }, To = ({
509
- mutate: t,
510
- convertError: e = (r) => r,
509
+ }, Me = ({
510
+ mutate: e,
511
+ convertError: t = (r) => r,
511
512
  onSuccess: n,
512
- onError: o,
513
- onSettled: s,
514
- content: i
513
+ onError: s,
514
+ onSettled: a,
515
+ content: o
515
516
  }) => {
516
- const r = cn({
517
- mutate: t,
518
- convertError: e,
517
+ const r = ie({
518
+ mutate: e,
519
+ convertError: t,
519
520
  onSuccess: n,
520
- onError: o,
521
- onSettled: s
522
- });
523
- return ln(r, { content: i });
524
- }, nt = Math.min, Q = Math.max, wt = Math.round, pt = Math.floor, V = (t) => ({
525
- x: t,
526
- y: t
527
- }), un = {
528
- left: "right",
529
- right: "left",
530
- bottom: "top",
531
- top: "bottom"
532
- }, fn = {
533
- start: "end",
534
- end: "start"
535
- };
536
- function Ct(t, e, n) {
537
- return Q(t, nt(e, n));
538
- }
539
- function ft(t, e) {
540
- return typeof t == "function" ? t(e) : t;
541
- }
542
- function J(t) {
543
- return t.split("-")[0];
544
- }
545
- function ht(t) {
546
- return t.split("-")[1];
547
- }
548
- function xe(t) {
549
- return t === "x" ? "y" : "x";
550
- }
551
- function zt(t) {
552
- return t === "y" ? "height" : "width";
553
- }
554
- const hn = /* @__PURE__ */ new Set(["top", "bottom"]);
555
- function I(t) {
556
- return hn.has(J(t)) ? "y" : "x";
557
- }
558
- function Bt(t) {
559
- return xe(I(t));
560
- }
561
- function dn(t, e, n) {
562
- n === void 0 && (n = !1);
563
- const o = ht(t), s = Bt(t), i = zt(s);
564
- let r = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
565
- return e.reference[i] > e.floating[i] && (r = vt(r)), [r, vt(r)];
566
- }
567
- function mn(t) {
568
- const e = vt(t);
569
- return [Dt(t), e, Dt(e)];
570
- }
571
- function Dt(t) {
572
- return t.replace(/start|end/g, (e) => fn[e]);
573
- }
574
- const Qt = ["left", "right"], Jt = ["right", "left"], pn = ["top", "bottom"], gn = ["bottom", "top"];
575
- function wn(t, e, n) {
576
- switch (t) {
577
- case "top":
578
- case "bottom":
579
- return n ? e ? Jt : Qt : e ? Qt : Jt;
580
- case "left":
581
- case "right":
582
- return e ? pn : gn;
583
- default:
584
- return [];
585
- }
586
- }
587
- function vn(t, e, n, o) {
588
- const s = ht(t);
589
- let i = wn(J(t), n === "start", o);
590
- return s && (i = i.map((r) => r + "-" + s), e && (i = i.concat(i.map(Dt)))), i;
591
- }
592
- function vt(t) {
593
- return t.replace(/left|right|bottom|top/g, (e) => un[e]);
594
- }
595
- function yn(t) {
596
- return {
597
- top: 0,
598
- right: 0,
599
- bottom: 0,
600
- left: 0,
601
- ...t
602
- };
603
- }
604
- function be(t) {
605
- return typeof t != "number" ? yn(t) : {
606
- top: t,
607
- right: t,
608
- bottom: t,
609
- left: t
610
- };
611
- }
612
- function yt(t) {
613
- const {
614
- x: e,
615
- y: n,
616
- width: o,
617
- height: s
618
- } = t;
619
- return {
620
- width: o,
621
- height: s,
622
- top: n,
623
- left: e,
624
- right: e + o,
625
- bottom: n + s,
626
- x: e,
627
- y: n
628
- };
629
- }
630
- function Gt(t, e, n) {
631
- let {
632
- reference: o,
633
- floating: s
634
- } = t;
635
- const i = I(e), r = Bt(e), a = zt(r), c = J(e), l = i === "y", u = o.x + o.width / 2 - s.width / 2, h = o.y + o.height / 2 - s.height / 2, m = o[a] / 2 - s[a] / 2;
636
- let f;
637
- switch (c) {
638
- case "top":
639
- f = {
640
- x: u,
641
- y: o.y - s.height
642
- };
643
- break;
644
- case "bottom":
645
- f = {
646
- x: u,
647
- y: o.y + o.height
648
- };
649
- break;
650
- case "right":
651
- f = {
652
- x: o.x + o.width,
653
- y: h
654
- };
655
- break;
656
- case "left":
657
- f = {
658
- x: o.x - s.width,
659
- y: h
660
- };
661
- break;
662
- default:
663
- f = {
664
- x: o.x,
665
- y: o.y
666
- };
667
- }
668
- switch (ht(e)) {
669
- case "start":
670
- f[r] -= m * (n && l ? -1 : 1);
671
- break;
672
- case "end":
673
- f[r] += m * (n && l ? -1 : 1);
674
- break;
675
- }
676
- return f;
677
- }
678
- async function xn(t, e) {
679
- var n;
680
- e === void 0 && (e = {});
681
- const {
682
- x: o,
683
- y: s,
684
- platform: i,
685
- rects: r,
686
- elements: a,
687
- strategy: c
688
- } = t, {
689
- boundary: l = "clippingAncestors",
690
- rootBoundary: u = "viewport",
691
- elementContext: h = "floating",
692
- altBoundary: m = !1,
693
- padding: f = 0
694
- } = ft(e, t), d = be(f), p = a[m ? h === "floating" ? "reference" : "floating" : h], v = yt(await i.getClippingRect({
695
- element: (n = await (i.isElement == null ? void 0 : i.isElement(p))) == null || n ? p : p.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
696
- boundary: l,
697
- rootBoundary: u,
698
- strategy: c
699
- })), b = h === "floating" ? {
700
- x: o,
701
- y: s,
702
- width: r.floating.width,
703
- height: r.floating.height
704
- } : r.reference, w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), O = await (i.isElement == null ? void 0 : i.isElement(w)) ? await (i.getScale == null ? void 0 : i.getScale(w)) || {
705
- x: 1,
706
- y: 1
707
- } : {
708
- x: 1,
709
- y: 1
710
- }, E = yt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
711
- elements: a,
712
- rect: b,
713
- offsetParent: w,
714
- strategy: c
715
- }) : b);
716
- return {
717
- top: (v.top - E.top + d.top) / O.y,
718
- bottom: (E.bottom - v.bottom + d.bottom) / O.y,
719
- left: (v.left - E.left + d.left) / O.x,
720
- right: (E.right - v.right + d.right) / O.x
721
- };
722
- }
723
- const bn = async (t, e, n) => {
724
- const {
725
- placement: o = "bottom",
726
- strategy: s = "absolute",
727
- middleware: i = [],
728
- platform: r
729
- } = n, a = i.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(e));
730
- let l = await r.getElementRects({
731
- reference: t,
732
- floating: e,
733
- strategy: s
734
- }), {
735
- x: u,
736
- y: h
737
- } = Gt(l, o, c), m = o, f = {}, d = 0;
738
- for (let p = 0; p < a.length; p++) {
739
- var y;
740
- const {
741
- name: v,
742
- fn: b
743
- } = a[p], {
744
- x: w,
745
- y: O,
746
- data: E,
747
- reset: A
748
- } = await b({
749
- x: u,
750
- y: h,
751
- initialPlacement: o,
752
- placement: m,
753
- strategy: s,
754
- middlewareData: f,
755
- rects: l,
756
- platform: {
757
- ...r,
758
- detectOverflow: (y = r.detectOverflow) != null ? y : xn
759
- },
760
- elements: {
761
- reference: t,
762
- floating: e
763
- }
764
- });
765
- u = w ?? u, h = O ?? h, f = {
766
- ...f,
767
- [v]: {
768
- ...f[v],
769
- ...E
770
- }
771
- }, A && d <= 50 && (d++, typeof A == "object" && (A.placement && (m = A.placement), A.rects && (l = A.rects === !0 ? await r.getElementRects({
772
- reference: t,
773
- floating: e,
774
- strategy: s
775
- }) : A.rects), {
776
- x: u,
777
- y: h
778
- } = Gt(l, m, c)), p = -1);
779
- }
780
- return {
781
- x: u,
782
- y: h,
783
- placement: m,
784
- strategy: s,
785
- middlewareData: f
786
- };
787
- }, Sn = (t) => ({
788
- name: "arrow",
789
- options: t,
790
- async fn(e) {
791
- const {
792
- x: n,
793
- y: o,
794
- placement: s,
795
- rects: i,
796
- platform: r,
797
- elements: a,
798
- middlewareData: c
799
- } = e, {
800
- element: l,
801
- padding: u = 0
802
- } = ft(t, e) || {};
803
- if (l == null)
804
- return {};
805
- const h = be(u), m = {
806
- x: n,
807
- y: o
808
- }, f = Bt(s), d = zt(f), y = await r.getDimensions(l), p = f === "y", v = p ? "top" : "left", b = p ? "bottom" : "right", w = p ? "clientHeight" : "clientWidth", O = i.reference[d] + i.reference[f] - m[f] - i.floating[d], E = m[f] - i.reference[f], A = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l));
809
- let P = A ? A[w] : 0;
810
- (!P || !await (r.isElement == null ? void 0 : r.isElement(A))) && (P = a.floating[w] || i.floating[d]);
811
- const U = O / 2 - E / 2, g = P / 2 - y[d] / 2 - 1, x = nt(h[v], g), S = nt(h[b], g), L = x, K = P - y[d] - S, k = P / 2 - y[d] / 2 + U, q = Ct(L, k, K), B = !c.arrow && ht(s) != null && k !== q && i.reference[d] / 2 - (k < L ? x : S) - y[d] / 2 < 0, D = B ? k < L ? k - L : k - K : 0;
812
- return {
813
- [f]: m[f] + D,
814
- data: {
815
- [f]: q,
816
- centerOffset: k - q - D,
817
- ...B && {
818
- alignmentOffset: D
819
- }
820
- },
821
- reset: B
822
- };
823
- }
824
- }), On = function(t) {
825
- return t === void 0 && (t = {}), {
826
- name: "flip",
827
- options: t,
828
- async fn(e) {
829
- var n, o;
830
- const {
831
- placement: s,
832
- middlewareData: i,
833
- rects: r,
834
- initialPlacement: a,
835
- platform: c,
836
- elements: l
837
- } = e, {
838
- mainAxis: u = !0,
839
- crossAxis: h = !0,
840
- fallbackPlacements: m,
841
- fallbackStrategy: f = "bestFit",
842
- fallbackAxisSideDirection: d = "none",
843
- flipAlignment: y = !0,
844
- ...p
845
- } = ft(t, e);
846
- if ((n = i.arrow) != null && n.alignmentOffset)
847
- return {};
848
- const v = J(s), b = I(a), w = J(a) === a, O = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), E = m || (w || !y ? [vt(a)] : mn(a)), A = d !== "none";
849
- !m && A && E.push(...vn(a, y, d, O));
850
- const P = [a, ...E], U = await c.detectOverflow(e, p), g = [];
851
- let x = ((o = i.flip) == null ? void 0 : o.overflows) || [];
852
- if (u && g.push(U[v]), h) {
853
- const k = dn(s, r, O);
854
- g.push(U[k[0]], U[k[1]]);
855
- }
856
- if (x = [...x, {
857
- placement: s,
858
- overflows: g
859
- }], !g.every((k) => k <= 0)) {
860
- var S, L;
861
- const k = (((S = i.flip) == null ? void 0 : S.index) || 0) + 1, q = P[k];
862
- if (q && (!(h === "alignment" ? b !== I(q) : !1) || // We leave the current main axis only if every placement on that axis
863
- // overflows the main axis.
864
- x.every((W) => I(W.placement) === b ? W.overflows[0] > 0 : !0)))
865
- return {
866
- data: {
867
- index: k,
868
- overflows: x
869
- },
870
- reset: {
871
- placement: q
872
- }
873
- };
874
- let B = (L = x.filter((D) => D.overflows[0] <= 0).sort((D, W) => D.overflows[1] - W.overflows[1])[0]) == null ? void 0 : L.placement;
875
- if (!B)
876
- switch (f) {
877
- case "bestFit": {
878
- var K;
879
- const D = (K = x.filter((W) => {
880
- if (A) {
881
- const j = I(W.placement);
882
- return j === b || // Create a bias to the `y` side axis due to horizontal
883
- // reading directions favoring greater width.
884
- j === "y";
885
- }
886
- return !0;
887
- }).map((W) => [W.placement, W.overflows.filter((j) => j > 0).reduce((j, De) => j + De, 0)]).sort((W, j) => W[1] - j[1])[0]) == null ? void 0 : K[0];
888
- D && (B = D);
889
- break;
890
- }
891
- case "initialPlacement":
892
- B = a;
893
- break;
894
- }
895
- if (s !== B)
896
- return {
897
- reset: {
898
- placement: B
899
- }
900
- };
901
- }
902
- return {};
903
- }
904
- };
905
- }, An = /* @__PURE__ */ new Set(["left", "top"]);
906
- async function Rn(t, e) {
907
- const {
908
- placement: n,
909
- platform: o,
910
- elements: s
911
- } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), r = J(n), a = ht(n), c = I(n) === "y", l = An.has(r) ? -1 : 1, u = i && c ? -1 : 1, h = ft(e, t);
912
- let {
913
- mainAxis: m,
914
- crossAxis: f,
915
- alignmentAxis: d
916
- } = typeof h == "number" ? {
917
- mainAxis: h,
918
- crossAxis: 0,
919
- alignmentAxis: null
920
- } : {
921
- mainAxis: h.mainAxis || 0,
922
- crossAxis: h.crossAxis || 0,
923
- alignmentAxis: h.alignmentAxis
924
- };
925
- return a && typeof d == "number" && (f = a === "end" ? d * -1 : d), c ? {
926
- x: f * u,
927
- y: m * l
928
- } : {
929
- x: m * l,
930
- y: f * u
931
- };
932
- }
933
- const En = function(t) {
934
- return t === void 0 && (t = 0), {
935
- name: "offset",
936
- options: t,
937
- async fn(e) {
938
- var n, o;
939
- const {
940
- x: s,
941
- y: i,
942
- placement: r,
943
- middlewareData: a
944
- } = e, c = await Rn(e, t);
945
- return r === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
946
- x: s + c.x,
947
- y: i + c.y,
948
- data: {
949
- ...c,
950
- placement: r
951
- }
952
- };
953
- }
954
- };
955
- }, Pn = function(t) {
956
- return t === void 0 && (t = {}), {
957
- name: "shift",
958
- options: t,
959
- async fn(e) {
960
- const {
961
- x: n,
962
- y: o,
963
- placement: s,
964
- platform: i
965
- } = e, {
966
- mainAxis: r = !0,
967
- crossAxis: a = !1,
968
- limiter: c = {
969
- fn: (v) => {
970
- let {
971
- x: b,
972
- y: w
973
- } = v;
974
- return {
975
- x: b,
976
- y: w
977
- };
978
- }
979
- },
980
- ...l
981
- } = ft(t, e), u = {
982
- x: n,
983
- y: o
984
- }, h = await i.detectOverflow(e, l), m = I(J(s)), f = xe(m);
985
- let d = u[f], y = u[m];
986
- if (r) {
987
- const v = f === "y" ? "top" : "left", b = f === "y" ? "bottom" : "right", w = d + h[v], O = d - h[b];
988
- d = Ct(w, d, O);
989
- }
990
- if (a) {
991
- const v = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", w = y + h[v], O = y - h[b];
992
- y = Ct(w, y, O);
993
- }
994
- const p = c.fn({
995
- ...e,
996
- [f]: d,
997
- [m]: y
998
- });
999
- return {
1000
- ...p,
1001
- data: {
1002
- x: p.x - n,
1003
- y: p.y - o,
1004
- enabled: {
1005
- [f]: r,
1006
- [m]: a
1007
- }
1008
- }
1009
- };
1010
- }
1011
- };
1012
- };
1013
- function bt() {
1014
- return typeof window < "u";
1015
- }
1016
- function rt(t) {
1017
- return Se(t) ? (t.nodeName || "").toLowerCase() : "#document";
1018
- }
1019
- function T(t) {
1020
- var e;
1021
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
1022
- }
1023
- function z(t) {
1024
- var e;
1025
- return (e = (Se(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1026
- }
1027
- function Se(t) {
1028
- return bt() ? t instanceof Node || t instanceof T(t).Node : !1;
1029
- }
1030
- function H(t) {
1031
- return bt() ? t instanceof Element || t instanceof T(t).Element : !1;
1032
- }
1033
- function $(t) {
1034
- return bt() ? t instanceof HTMLElement || t instanceof T(t).HTMLElement : !1;
1035
- }
1036
- function Zt(t) {
1037
- return !bt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof T(t).ShadowRoot;
1038
- }
1039
- const Ln = /* @__PURE__ */ new Set(["inline", "contents"]);
1040
- function dt(t) {
1041
- const {
1042
- overflow: e,
1043
- overflowX: n,
1044
- overflowY: o,
1045
- display: s
1046
- } = F(t);
1047
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !Ln.has(s);
1048
- }
1049
- const kn = /* @__PURE__ */ new Set(["table", "td", "th"]);
1050
- function Tn(t) {
1051
- return kn.has(rt(t));
1052
- }
1053
- const Cn = [":popover-open", ":modal"];
1054
- function St(t) {
1055
- return Cn.some((e) => {
1056
- try {
1057
- return t.matches(e);
1058
- } catch {
1059
- return !1;
1060
- }
1061
- });
1062
- }
1063
- const Dn = ["transform", "translate", "scale", "rotate", "perspective"], Wn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Hn = ["paint", "layout", "strict", "content"];
1064
- function _t(t) {
1065
- const e = Ut(), n = H(t) ? F(t) : t;
1066
- return Dn.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) || Wn.some((o) => (n.willChange || "").includes(o)) || Hn.some((o) => (n.contain || "").includes(o));
1067
- }
1068
- function Fn(t) {
1069
- let e = Y(t);
1070
- for (; $(e) && !ot(e); ) {
1071
- if (_t(e))
1072
- return e;
1073
- if (St(e))
1074
- return null;
1075
- e = Y(e);
1076
- }
1077
- return null;
1078
- }
1079
- function Ut() {
1080
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1081
- }
1082
- const Mn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1083
- function ot(t) {
1084
- return Mn.has(rt(t));
1085
- }
1086
- function F(t) {
1087
- return T(t).getComputedStyle(t);
1088
- }
1089
- function Ot(t) {
1090
- return H(t) ? {
1091
- scrollLeft: t.scrollLeft,
1092
- scrollTop: t.scrollTop
1093
- } : {
1094
- scrollLeft: t.scrollX,
1095
- scrollTop: t.scrollY
1096
- };
1097
- }
1098
- function Y(t) {
1099
- if (rt(t) === "html")
1100
- return t;
1101
- const e = (
1102
- // Step into the shadow DOM of the parent of a slotted node.
1103
- t.assignedSlot || // DOM Element detected.
1104
- t.parentNode || // ShadowRoot detected.
1105
- Zt(t) && t.host || // Fallback.
1106
- z(t)
1107
- );
1108
- return Zt(e) ? e.host : e;
1109
- }
1110
- function Oe(t) {
1111
- const e = Y(t);
1112
- return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : $(e) && dt(e) ? e : Oe(e);
1113
- }
1114
- function lt(t, e, n) {
1115
- var o;
1116
- e === void 0 && (e = []), n === void 0 && (n = !0);
1117
- const s = Oe(t), i = s === ((o = t.ownerDocument) == null ? void 0 : o.body), r = T(s);
1118
- if (i) {
1119
- const a = Wt(r);
1120
- return e.concat(r, r.visualViewport || [], dt(s) ? s : [], a && n ? lt(a) : []);
1121
- }
1122
- return e.concat(s, lt(s, [], n));
1123
- }
1124
- function Wt(t) {
1125
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1126
- }
1127
- function Ae(t) {
1128
- const e = F(t);
1129
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
1130
- const s = $(t), i = s ? t.offsetWidth : n, r = s ? t.offsetHeight : o, a = wt(n) !== i || wt(o) !== r;
1131
- return a && (n = i, o = r), {
1132
- width: n,
1133
- height: o,
1134
- $: a
1135
- };
1136
- }
1137
- function Kt(t) {
1138
- return H(t) ? t : t.contextElement;
1139
- }
1140
- function tt(t) {
1141
- const e = Kt(t);
1142
- if (!$(e))
1143
- return V(1);
1144
- const n = e.getBoundingClientRect(), {
1145
- width: o,
1146
- height: s,
1147
- $: i
1148
- } = Ae(e);
1149
- let r = (i ? wt(n.width) : n.width) / o, a = (i ? wt(n.height) : n.height) / s;
1150
- return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
1151
- x: r,
1152
- y: a
1153
- };
1154
- }
1155
- const Nn = /* @__PURE__ */ V(0);
1156
- function Re(t) {
1157
- const e = T(t);
1158
- return !Ut() || !e.visualViewport ? Nn : {
1159
- x: e.visualViewport.offsetLeft,
1160
- y: e.visualViewport.offsetTop
1161
- };
1162
- }
1163
- function Vn(t, e, n) {
1164
- return e === void 0 && (e = !1), !n || e && n !== T(t) ? !1 : e;
1165
- }
1166
- function G(t, e, n, o) {
1167
- e === void 0 && (e = !1), n === void 0 && (n = !1);
1168
- const s = t.getBoundingClientRect(), i = Kt(t);
1169
- let r = V(1);
1170
- e && (o ? H(o) && (r = tt(o)) : r = tt(t));
1171
- const a = Vn(i, n, o) ? Re(i) : V(0);
1172
- let c = (s.left + a.x) / r.x, l = (s.top + a.y) / r.y, u = s.width / r.x, h = s.height / r.y;
1173
- if (i) {
1174
- const m = T(i), f = o && H(o) ? T(o) : o;
1175
- let d = m, y = Wt(d);
1176
- for (; y && o && f !== d; ) {
1177
- const p = tt(y), v = y.getBoundingClientRect(), b = F(y), w = v.left + (y.clientLeft + parseFloat(b.paddingLeft)) * p.x, O = v.top + (y.clientTop + parseFloat(b.paddingTop)) * p.y;
1178
- c *= p.x, l *= p.y, u *= p.x, h *= p.y, c += w, l += O, d = T(y), y = Wt(d);
1179
- }
1180
- }
1181
- return yt({
1182
- width: u,
1183
- height: h,
1184
- x: c,
1185
- y: l
1186
- });
1187
- }
1188
- function At(t, e) {
1189
- const n = Ot(t).scrollLeft;
1190
- return e ? e.left + n : G(z(t)).left + n;
1191
- }
1192
- function Ee(t, e) {
1193
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - At(t, n), s = n.top + e.scrollTop;
1194
- return {
1195
- x: o,
1196
- y: s
1197
- };
1198
- }
1199
- function $n(t) {
1200
- let {
1201
- elements: e,
1202
- rect: n,
1203
- offsetParent: o,
1204
- strategy: s
1205
- } = t;
1206
- const i = s === "fixed", r = z(o), a = e ? St(e.floating) : !1;
1207
- if (o === r || a && i)
1208
- return n;
1209
- let c = {
1210
- scrollLeft: 0,
1211
- scrollTop: 0
1212
- }, l = V(1);
1213
- const u = V(0), h = $(o);
1214
- if ((h || !h && !i) && ((rt(o) !== "body" || dt(r)) && (c = Ot(o)), $(o))) {
1215
- const f = G(o);
1216
- l = tt(o), u.x = f.x + o.clientLeft, u.y = f.y + o.clientTop;
1217
- }
1218
- const m = r && !h && !i ? Ee(r, c) : V(0);
1219
- return {
1220
- width: n.width * l.x,
1221
- height: n.height * l.y,
1222
- x: n.x * l.x - c.scrollLeft * l.x + u.x + m.x,
1223
- y: n.y * l.y - c.scrollTop * l.y + u.y + m.y
1224
- };
1225
- }
1226
- function zn(t) {
1227
- return Array.from(t.getClientRects());
1228
- }
1229
- function Bn(t) {
1230
- const e = z(t), n = Ot(t), o = t.ownerDocument.body, s = Q(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = Q(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
1231
- let r = -n.scrollLeft + At(t);
1232
- const a = -n.scrollTop;
1233
- return F(o).direction === "rtl" && (r += Q(e.clientWidth, o.clientWidth) - s), {
1234
- width: s,
1235
- height: i,
1236
- x: r,
1237
- y: a
1238
- };
1239
- }
1240
- const te = 25;
1241
- function _n(t, e) {
1242
- const n = T(t), o = z(t), s = n.visualViewport;
1243
- let i = o.clientWidth, r = o.clientHeight, a = 0, c = 0;
1244
- if (s) {
1245
- i = s.width, r = s.height;
1246
- const u = Ut();
1247
- (!u || u && e === "fixed") && (a = s.offsetLeft, c = s.offsetTop);
1248
- }
1249
- const l = At(o);
1250
- if (l <= 0) {
1251
- const u = o.ownerDocument, h = u.body, m = getComputedStyle(h), f = u.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, d = Math.abs(o.clientWidth - h.clientWidth - f);
1252
- d <= te && (i -= d);
1253
- } else l <= te && (i += l);
1254
- return {
1255
- width: i,
1256
- height: r,
1257
- x: a,
1258
- y: c
1259
- };
1260
- }
1261
- const Un = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1262
- function Kn(t, e) {
1263
- const n = G(t, !0, e === "fixed"), o = n.top + t.clientTop, s = n.left + t.clientLeft, i = $(t) ? tt(t) : V(1), r = t.clientWidth * i.x, a = t.clientHeight * i.y, c = s * i.x, l = o * i.y;
1264
- return {
1265
- width: r,
1266
- height: a,
1267
- x: c,
1268
- y: l
1269
- };
1270
- }
1271
- function ee(t, e, n) {
1272
- let o;
1273
- if (e === "viewport")
1274
- o = _n(t, n);
1275
- else if (e === "document")
1276
- o = Bn(z(t));
1277
- else if (H(e))
1278
- o = Kn(e, n);
1279
- else {
1280
- const s = Re(t);
1281
- o = {
1282
- x: e.x - s.x,
1283
- y: e.y - s.y,
1284
- width: e.width,
1285
- height: e.height
1286
- };
1287
- }
1288
- return yt(o);
1289
- }
1290
- function Pe(t, e) {
1291
- const n = Y(t);
1292
- return n === e || !H(n) || ot(n) ? !1 : F(n).position === "fixed" || Pe(n, e);
1293
- }
1294
- function jn(t, e) {
1295
- const n = e.get(t);
1296
- if (n)
1297
- return n;
1298
- let o = lt(t, [], !1).filter((a) => H(a) && rt(a) !== "body"), s = null;
1299
- const i = F(t).position === "fixed";
1300
- let r = i ? Y(t) : t;
1301
- for (; H(r) && !ot(r); ) {
1302
- const a = F(r), c = _t(r);
1303
- !c && a.position === "fixed" && (s = null), (i ? !c && !s : !c && a.position === "static" && !!s && Un.has(s.position) || dt(r) && !c && Pe(t, r)) ? o = o.filter((u) => u !== r) : s = a, r = Y(r);
1304
- }
1305
- return e.set(t, o), o;
1306
- }
1307
- function In(t) {
1308
- let {
1309
- element: e,
1310
- boundary: n,
1311
- rootBoundary: o,
1312
- strategy: s
1313
- } = t;
1314
- const r = [...n === "clippingAncestors" ? St(e) ? [] : jn(e, this._c) : [].concat(n), o], a = r[0], c = r.reduce((l, u) => {
1315
- const h = ee(e, u, s);
1316
- return l.top = Q(h.top, l.top), l.right = nt(h.right, l.right), l.bottom = nt(h.bottom, l.bottom), l.left = Q(h.left, l.left), l;
1317
- }, ee(e, a, s));
1318
- return {
1319
- width: c.right - c.left,
1320
- height: c.bottom - c.top,
1321
- x: c.left,
1322
- y: c.top
1323
- };
1324
- }
1325
- function Xn(t) {
1326
- const {
1327
- width: e,
1328
- height: n
1329
- } = Ae(t);
1330
- return {
1331
- width: e,
1332
- height: n
1333
- };
1334
- }
1335
- function Yn(t, e, n) {
1336
- const o = $(e), s = z(e), i = n === "fixed", r = G(t, !0, i, e);
1337
- let a = {
1338
- scrollLeft: 0,
1339
- scrollTop: 0
1340
- };
1341
- const c = V(0);
1342
- function l() {
1343
- c.x = At(s);
1344
- }
1345
- if (o || !o && !i)
1346
- if ((rt(e) !== "body" || dt(s)) && (a = Ot(e)), o) {
1347
- const f = G(e, !0, i, e);
1348
- c.x = f.x + e.clientLeft, c.y = f.y + e.clientTop;
1349
- } else s && l();
1350
- i && !o && s && l();
1351
- const u = s && !o && !i ? Ee(s, a) : V(0), h = r.left + a.scrollLeft - c.x - u.x, m = r.top + a.scrollTop - c.y - u.y;
1352
- return {
1353
- x: h,
1354
- y: m,
1355
- width: r.width,
1356
- height: r.height
1357
- };
1358
- }
1359
- function Et(t) {
1360
- return F(t).position === "static";
1361
- }
1362
- function ne(t, e) {
1363
- if (!$(t) || F(t).position === "fixed")
1364
- return null;
1365
- if (e)
1366
- return e(t);
1367
- let n = t.offsetParent;
1368
- return z(t) === n && (n = n.ownerDocument.body), n;
1369
- }
1370
- function Le(t, e) {
1371
- const n = T(t);
1372
- if (St(t))
1373
- return n;
1374
- if (!$(t)) {
1375
- let s = Y(t);
1376
- for (; s && !ot(s); ) {
1377
- if (H(s) && !Et(s))
1378
- return s;
1379
- s = Y(s);
1380
- }
1381
- return n;
1382
- }
1383
- let o = ne(t, e);
1384
- for (; o && Tn(o) && Et(o); )
1385
- o = ne(o, e);
1386
- return o && ot(o) && Et(o) && !_t(o) ? n : o || Fn(t) || n;
1387
- }
1388
- const qn = async function(t) {
1389
- const e = this.getOffsetParent || Le, n = this.getDimensions, o = await n(t.floating);
1390
- return {
1391
- reference: Yn(t.reference, await e(t.floating), t.strategy),
1392
- floating: {
1393
- x: 0,
1394
- y: 0,
1395
- width: o.width,
1396
- height: o.height
1397
- }
1398
- };
1399
- };
1400
- function Qn(t) {
1401
- return F(t).direction === "rtl";
1402
- }
1403
- const Jn = {
1404
- convertOffsetParentRelativeRectToViewportRelativeRect: $n,
1405
- getDocumentElement: z,
1406
- getClippingRect: In,
1407
- getOffsetParent: Le,
1408
- getElementRects: qn,
1409
- getClientRects: zn,
1410
- getDimensions: Xn,
1411
- getScale: tt,
1412
- isElement: H,
1413
- isRTL: Qn
1414
- };
1415
- function ke(t, e) {
1416
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1417
- }
1418
- function Gn(t, e) {
1419
- let n = null, o;
1420
- const s = z(t);
1421
- function i() {
1422
- var a;
1423
- clearTimeout(o), (a = n) == null || a.disconnect(), n = null;
1424
- }
1425
- function r(a, c) {
1426
- a === void 0 && (a = !1), c === void 0 && (c = 1), i();
1427
- const l = t.getBoundingClientRect(), {
1428
- left: u,
1429
- top: h,
1430
- width: m,
1431
- height: f
1432
- } = l;
1433
- if (a || e(), !m || !f)
1434
- return;
1435
- const d = pt(h), y = pt(s.clientWidth - (u + m)), p = pt(s.clientHeight - (h + f)), v = pt(u), w = {
1436
- rootMargin: -d + "px " + -y + "px " + -p + "px " + -v + "px",
1437
- threshold: Q(0, nt(1, c)) || 1
1438
- };
1439
- let O = !0;
1440
- function E(A) {
1441
- const P = A[0].intersectionRatio;
1442
- if (P !== c) {
1443
- if (!O)
1444
- return r();
1445
- P ? r(!1, P) : o = setTimeout(() => {
1446
- r(!1, 1e-7);
1447
- }, 1e3);
1448
- }
1449
- P === 1 && !ke(l, t.getBoundingClientRect()) && r(), O = !1;
1450
- }
1451
- try {
1452
- n = new IntersectionObserver(E, {
1453
- ...w,
1454
- // Handle <iframe>s
1455
- root: s.ownerDocument
1456
- });
1457
- } catch {
1458
- n = new IntersectionObserver(E, w);
1459
- }
1460
- n.observe(t);
1461
- }
1462
- return r(!0), i;
1463
- }
1464
- function Zn(t, e, n, o) {
1465
- o === void 0 && (o = {});
1466
- const {
1467
- ancestorScroll: s = !0,
1468
- ancestorResize: i = !0,
1469
- elementResize: r = typeof ResizeObserver == "function",
1470
- layoutShift: a = typeof IntersectionObserver == "function",
1471
- animationFrame: c = !1
1472
- } = o, l = Kt(t), u = s || i ? [...l ? lt(l) : [], ...lt(e)] : [];
1473
- u.forEach((v) => {
1474
- s && v.addEventListener("scroll", n, {
1475
- passive: !0
1476
- }), i && v.addEventListener("resize", n);
1477
- });
1478
- const h = l && a ? Gn(l, n) : null;
1479
- let m = -1, f = null;
1480
- r && (f = new ResizeObserver((v) => {
1481
- let [b] = v;
1482
- b && b.target === l && f && (f.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1483
- var w;
1484
- (w = f) == null || w.observe(e);
1485
- })), n();
1486
- }), l && !c && f.observe(l), f.observe(e));
1487
- let d, y = c ? G(t) : null;
1488
- c && p();
1489
- function p() {
1490
- const v = G(t);
1491
- y && !ke(y, v) && n(), y = v, d = requestAnimationFrame(p);
1492
- }
1493
- return n(), () => {
1494
- var v;
1495
- u.forEach((b) => {
1496
- s && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
1497
- }), h?.(), (v = f) == null || v.disconnect(), f = null, c && cancelAnimationFrame(d);
1498
- };
1499
- }
1500
- const to = En, eo = Pn, oe = On, no = Sn, oo = (t, e, n) => {
1501
- const o = /* @__PURE__ */ new Map(), s = {
1502
- platform: Jn,
1503
- ...n
1504
- }, i = {
1505
- ...s.platform,
1506
- _c: o
1507
- };
1508
- return bn(t, e, {
1509
- ...s,
1510
- platform: i
521
+ onError: s,
522
+ onSettled: a
1511
523
  });
1512
- }, Co = [
524
+ return ce(r, { content: o });
525
+ }, De = [
1513
526
  "top",
1514
527
  "top-start",
1515
528
  "top-end",
@@ -1522,42 +535,42 @@ const to = En, eo = Pn, oe = On, no = Sn, oo = (t, e, n) => {
1522
535
  "left",
1523
536
  "left-start",
1524
537
  "left-end"
1525
- ], Do = (t, e = { isOpen: !1 }) => {
538
+ ], Ne = (e, t = { isOpen: !1 }) => {
1526
539
  const n = [];
1527
- let o = null;
1528
- const s = C.deriveProp(e.isOpen);
1529
- function i(a) {
1530
- o = a, s.set(!0);
540
+ let s = null;
541
+ const a = y.deriveProp(t.isOpen);
542
+ function o(i) {
543
+ s = i, a.set(!0);
1531
544
  }
1532
545
  function r() {
1533
- s.set(!1), n.forEach((a) => a()), n.length = 0;
546
+ a.set(!1), n.forEach((i) => i()), n.length = 0;
1534
547
  }
1535
- return X(
1536
- t(i, r),
1537
- me(
1538
- s,
1539
- () => X(
1540
- o?.onClickOutside != null ? rn(o.onClickOutside) : null,
1541
- _(
1542
- (a) => he(
548
+ return R(
549
+ e(o, r),
550
+ yt(
551
+ a,
552
+ () => R(
553
+ s?.onClickOutside != null ? ae(s.onClickOutside) : null,
554
+ L(
555
+ (i) => vt(
1543
556
  "body",
1544
- Pt.div(
1545
- _((c) => {
557
+ V.div(
558
+ L((c) => {
1546
559
  c.style.position = "absolute";
1547
- const l = typeof o?.target == "string" ? a.querySelector(
1548
- o.target
1549
- ) : o?.target ?? a;
1550
- if (l == null)
1551
- throw new Error(`Target not found: ${o?.target}`);
1552
- let u = null;
1553
- const h = C.toSignal(o?.mainAxisOffset ?? 0), m = C.toSignal(
1554
- o?.crossAxisOffset ?? 0
1555
- ), f = C.toSignal(
560
+ const u = typeof s?.target == "string" ? i.querySelector(
561
+ s.target
562
+ ) : s?.target ?? i;
563
+ if (u == null)
564
+ throw new Error(`Target not found: ${s?.target}`);
565
+ let d = null;
566
+ const w = y.toSignal(s?.mainAxisOffset ?? 0), P = y.toSignal(
567
+ s?.crossAxisOffset ?? 0
568
+ ), k = y.toSignal(
1556
569
  /* c8 ignore next 3 */
1557
- o?.placement ?? "top"
1558
- ), d = C.toSignal(
1559
- o?.arrowPadding ?? 0
1560
- ), y = o?.arrow, p = M({
570
+ s?.placement ?? "top"
571
+ ), f = y.toSignal(
572
+ s?.arrowPadding ?? 0
573
+ ), E = s?.arrow, m = b({
1561
574
  centerOffset: 0,
1562
575
  alignmentOffset: 0,
1563
576
  containerWidth: 0,
@@ -1565,71 +578,71 @@ const to = En, eo = Pn, oe = On, no = Sn, oo = (t, e, n) => {
1565
578
  x: void 0,
1566
579
  y: void 0
1567
580
  });
1568
- async function v() {
1569
- const w = [
1570
- oe(),
1571
- to({
1572
- mainAxis: h.get(),
1573
- crossAxis: m.get()
581
+ async function S() {
582
+ const g = [
583
+ st(),
584
+ Dt({
585
+ mainAxis: w.get(),
586
+ crossAxis: P.get()
1574
587
  }),
1575
- eo(),
1576
- oe()
588
+ Nt(),
589
+ st()
1577
590
  ];
1578
- y != null && u != null && w.push(
1579
- no({
1580
- element: u,
1581
- padding: d.get()
591
+ E != null && d != null && g.push(
592
+ Ft({
593
+ element: d,
594
+ padding: f.get()
1582
595
  })
1583
596
  );
1584
- const O = await oo(l, c, {
1585
- placement: f.get(),
597
+ const N = await Ct(u, c, {
598
+ placement: k.get(),
1586
599
  strategy: "absolute",
1587
- middleware: w
1588
- }), { x: E, y: A, middlewareData: P } = O;
1589
- if (c.style.top = `${A}px`, c.style.left = `${E}px`, u != null && P.arrow != null) {
600
+ middleware: g
601
+ }), { x: Z, y: tt, middlewareData: j } = N;
602
+ if (c.style.top = `${tt}px`, c.style.left = `${Z}px`, d != null && j.arrow != null) {
1590
603
  const {
1591
- x: U,
1592
- y: g,
1593
- centerOffset: x,
1594
- alignmentOffset: S
1595
- } = P.arrow;
1596
- p.set({
1597
- x: U,
1598
- y: g,
1599
- centerOffset: x,
1600
- alignmentOffset: S,
604
+ x: et,
605
+ y: l,
606
+ centerOffset: h,
607
+ alignmentOffset: p
608
+ } = j.arrow;
609
+ m.set({
610
+ x: et,
611
+ y: l,
612
+ centerOffset: h,
613
+ alignmentOffset: p,
1601
614
  containerWidth: c.offsetWidth,
1602
615
  containerHeight: c.offsetHeight
1603
616
  });
1604
617
  }
1605
618
  }
1606
- const b = He(
1607
- h,
1608
- m,
1609
- f
1610
- )(v);
1611
- return X(
1612
- o?.content,
1613
- o?.arrow != null ? Pt.div(
1614
- o?.arrow(
1615
- Nt(
1616
- p,
1617
- f
619
+ const O = Rt(
620
+ w,
621
+ P,
622
+ k
623
+ )(S);
624
+ return R(
625
+ s?.content,
626
+ s?.arrow != null ? V.div(
627
+ s?.arrow(
628
+ J(
629
+ m,
630
+ k
1618
631
  )(
1619
- (w, O) => ({
1620
- ...w,
1621
- placement: O
632
+ (g, N) => ({
633
+ ...g,
634
+ placement: N
1622
635
  })
1623
636
  )
1624
637
  ),
1625
- _((w) => {
1626
- u = w, v();
638
+ L((g) => {
639
+ d = g, S();
1627
640
  })
1628
641
  ) : null,
1629
642
  // arrowSignal is automatically disposed by the scope
1630
- N(
1631
- Zn(l, c, v),
1632
- b
643
+ x(
644
+ Mt(u, c, S),
645
+ O
1633
646
  )
1634
647
  );
1635
648
  })
@@ -1639,86 +652,86 @@ const to = En, eo = Pn, oe = On, no = Sn, oo = (t, e, n) => {
1639
652
  )
1640
653
  )
1641
654
  );
1642
- }, so = ({
1643
- request: t,
1644
- load: e,
655
+ }, le = ({
656
+ request: e,
657
+ load: t,
1645
658
  convertError: n,
1646
- onSuccess: o,
1647
- onError: s,
1648
- onSettled: i
659
+ onSuccess: s,
660
+ onError: a,
661
+ onSettled: o
1649
662
  }) => {
1650
663
  let r;
1651
- const a = M(R.notAsked), c = a.map(
1652
- (p) => R.isSuccess(p) ? p.value : void 0
1653
- ), l = a.map(
1654
- (p) => R.isFailure(p) ? p.error : void 0
1655
- ), u = a.map((p) => R.isLoading(p)), h = () => {
664
+ const i = b(v.notAsked), c = i.map(
665
+ (m) => v.isSuccess(m) ? m.value : void 0
666
+ ), u = i.map(
667
+ (m) => v.isFailure(m) ? m.error : void 0
668
+ ), d = i.map((m) => v.isLoading(m)), w = () => {
1656
669
  r?.abort(), r = void 0;
1657
- }, m = (p) => {
1658
- h(), a.set(p ?? R.notAsked);
1659
- }, f = async (p) => {
1660
- h(), r = new AbortController();
1661
- const v = r.signal, b = a.get();
1662
- a.set(R.loading(R.getOrUndefined(b)));
670
+ }, P = (m) => {
671
+ w(), i.set(m ?? v.notAsked);
672
+ }, k = async (m) => {
673
+ w(), r = new AbortController();
674
+ const S = r.signal, O = i.get();
675
+ i.set(v.loading(v.getOrUndefined(O)));
1663
676
  try {
1664
- const w = await e({ request: p, abortSignal: v, previous: b });
1665
- await Promise.resolve(), r = void 0, a.set(R.success(w)), o?.(w, p);
1666
- } catch (w) {
1667
- r = void 0, a.set(R.failure(n(w))), s?.(n(w), p);
677
+ const g = await t({ request: m, abortSignal: S, previous: O });
678
+ await Promise.resolve(), r = void 0, i.set(v.success(g)), s?.(g, m);
679
+ } catch (g) {
680
+ r = void 0, i.set(v.failure(n(g))), a?.(n(g), m);
1668
681
  }
1669
- i?.(a.get(), p);
1670
- }, d = () => f(C.get(t)), y = () => {
1671
- r?.abort(), r = void 0, a.dispose();
682
+ o?.(i.get(), m);
683
+ }, f = () => k(y.get(e)), E = () => {
684
+ r?.abort(), r = void 0, i.dispose();
1672
685
  };
1673
- return a.onDispose(C.on(t, f)), {
1674
- status: a,
686
+ return i.onDispose(y.on(e, k)), {
687
+ status: i,
1675
688
  value: c,
1676
- error: l,
1677
- loading: u,
1678
- cancel: m,
1679
- reload: d,
1680
- dispose: y
689
+ error: u,
690
+ loading: d,
691
+ cancel: P,
692
+ reload: f,
693
+ dispose: E
1681
694
  };
1682
- }, ro = (t, e) => {
1683
- const { status: n, dispose: o, reload: s } = t, { pending: i, failure: r, success: a } = e;
1684
- return X(
1685
- N(o),
1686
- ve(n, {
1687
- loading: i != null ? (c) => i({ previous: c, reload: s, cancel: t.cancel }) : void 0,
1688
- failure: r != null ? (c) => r({ error: c, reload: s }) : void 0,
1689
- success: (c) => a({ value: c, reload: s })
695
+ }, ue = (e, t) => {
696
+ const { status: n, dispose: s, reload: a } = e, { pending: o, failure: r, success: i } = t;
697
+ return R(
698
+ x(s),
699
+ Pt(n, {
700
+ loading: o != null ? (c) => o({ previous: c, reload: a, cancel: e.cancel }) : void 0,
701
+ failure: r != null ? (c) => r({ error: c, reload: a }) : void 0,
702
+ success: (c) => i({ value: c, reload: a })
1690
703
  })
1691
704
  );
1692
- }, Wo = ({
1693
- request: t,
1694
- load: e,
1695
- convertError: n = (l) => l,
1696
- onSuccess: o,
1697
- onError: s,
1698
- onSettled: i,
705
+ }, Ce = ({
706
+ request: e,
707
+ load: t,
708
+ convertError: n = (u) => u,
709
+ onSuccess: s,
710
+ onError: a,
711
+ onSettled: o,
1699
712
  success: r,
1700
- pending: a,
713
+ pending: i,
1701
714
  failure: c
1702
715
  }) => {
1703
- const l = so({
1704
- request: t,
1705
- load: e,
716
+ const u = le({
717
+ request: e,
718
+ load: t,
1706
719
  convertError: n,
1707
- onSuccess: o,
1708
- onError: s,
1709
- onSettled: i
720
+ onSuccess: s,
721
+ onError: a,
722
+ onSettled: o
1710
723
  });
1711
- return ro(l, { success: r, pending: a, failure: c });
1712
- }, io = (t, e) => {
1713
- if (typeof e == "function")
1714
- return io(t, { success: e });
1715
- const n = e.failure ?? ((s) => (s.on(console.error), s.map((i) => `Error: ${i}`))), o = e.success;
1716
- return fe(C.toSignal(t), {
1717
- Success: (s) => o(s.$.value),
1718
- Failure: (s) => n(s.$.error)
724
+ return ue(u, { success: r, pending: i, failure: c });
725
+ }, he = (e, t) => {
726
+ if (typeof t == "function")
727
+ return he(e, { success: t });
728
+ const n = t.failure ?? ((a) => (a.on(console.error), a.map((o) => `Error: ${o}`))), s = t.success;
729
+ return gt(y.toSignal(e), {
730
+ Success: (a) => s(a.$.value),
731
+ Failure: (a) => n(a.$.error)
1719
732
  });
1720
- }, Ho = () => ue.focus((t) => t.target?.select());
1721
- class Rt {
733
+ }, Fe = () => mt.focus((e) => e.target?.select());
734
+ class $ {
1722
735
  /**
1723
736
  * Creates a new Rect instance.
1724
737
  *
@@ -1736,8 +749,8 @@ class Rt {
1736
749
  * console.log(rect.height); // 50
1737
750
  * ```
1738
751
  */
1739
- constructor(e, n, o, s, i, r) {
1740
- this.left = e, this.top = n, this.width = o, this.height = s, this.localLeft = i, this.localTop = r;
752
+ constructor(t, n, s, a, o, r) {
753
+ this.left = t, this.top = n, this.width = s, this.height = a, this.localLeft = o, this.localTop = r;
1741
754
  }
1742
755
  /**
1743
756
  * Creates a new Rect instance using an object with optional properties.
@@ -1765,14 +778,14 @@ class Rt {
1765
778
  * ```
1766
779
  */
1767
780
  static of({
1768
- left: e = 0,
781
+ left: t = 0,
1769
782
  top: n = 0,
1770
- width: o = 0,
1771
- height: s = 0,
1772
- localLeft: i = 0,
783
+ width: s = 0,
784
+ height: a = 0,
785
+ localLeft: o = 0,
1773
786
  localTop: r = 0
1774
787
  }) {
1775
- return new Rt(e, n, o, s, i, r);
788
+ return new $(t, n, s, a, o, r);
1776
789
  }
1777
790
  /**
1778
791
  * Gets the x-coordinate of the right edge of the rectangle.
@@ -1904,107 +917,107 @@ class Rt {
1904
917
  * console.log(rect1.equals(rect3)); // true (within tolerance)
1905
918
  * ```
1906
919
  */
1907
- equals = (e) => mt(this.left, e.left) && mt(this.top, e.top) && mt(this.width, e.width) && mt(this.height, e.height);
1908
- }
1909
- function se(t) {
1910
- const e = t.getBoundingClientRect();
1911
- return Rt.of({
1912
- top: e.top + window.scrollY,
1913
- left: e.left + window.scrollX,
1914
- width: e.width,
1915
- height: e.height,
1916
- localLeft: t.offsetLeft,
1917
- localTop: t.offsetTop
920
+ equals = (t) => C(this.left, t.left) && C(this.top, t.top) && C(this.width, t.width) && C(this.height, t.height);
921
+ }
922
+ function lt(e) {
923
+ const t = e.getBoundingClientRect();
924
+ return $.of({
925
+ top: t.top + window.scrollY,
926
+ left: t.left + window.scrollX,
927
+ width: t.width,
928
+ height: t.height,
929
+ localLeft: e.offsetLeft,
930
+ localTop: e.offsetTop
1918
931
  });
1919
932
  }
1920
- const Fo = (t) => Fe((e) => {
1921
- const { element: n } = e, o = M(se(n), (a, c) => a.equals(c)), s = de(t(o)).render(e), i = () => o.set(Rt.of(se(n)));
933
+ const ze = (e) => At((t) => {
934
+ const { element: n } = t, s = b(lt(n), (i, c) => i.equals(c)), a = wt(e(s)).render(t), o = () => s.set($.of(lt(n)));
1922
935
  let r = null;
1923
- return typeof ResizeObserver < "u" && (r = new ResizeObserver(i)), r?.observe(n), N((a) => {
1924
- r?.disconnect(), s(a);
936
+ return typeof ResizeObserver < "u" && (r = new ResizeObserver(o)), r?.observe(n), x((i) => {
937
+ r?.disconnect(), a(i);
1925
938
  });
1926
939
  });
1927
- function re(t) {
940
+ function ut(e) {
1928
941
  return {
1929
942
  /* c8 ignore next 6 */
1930
- width: t?.innerWidth ?? 0,
1931
- height: t?.innerHeight ?? 0
943
+ width: e?.innerWidth ?? 0,
944
+ height: e?.innerHeight ?? 0
1932
945
  };
1933
946
  }
1934
- const Mo = (t) => Me(() => {
1935
- const e = st(), n = M(
1936
- re(e),
1937
- (s, i) => s.width === i.width && s.height === i.height
1938
- ), o = () => n.set(re(e));
1939
- return e?.addEventListener("resize", o), X(
1940
- N(() => {
1941
- e?.removeEventListener("resize", o);
947
+ const $e = (e) => Ht(() => {
948
+ const t = W(), n = b(
949
+ ut(t),
950
+ (a, o) => a.width === o.width && a.height === o.height
951
+ ), s = () => n.set(ut(t));
952
+ return t?.addEventListener("resize", s), R(
953
+ x(() => {
954
+ t?.removeEventListener("resize", s);
1942
955
  }),
1943
- t(n)
956
+ e(n)
1944
957
  );
1945
- }), ao = (t, e) => {
1946
- const n = e.split("/").filter((i) => i !== ""), o = (i) => {
958
+ }), de = (e, t) => {
959
+ const n = t.split("/").filter((o) => o !== ""), s = (o) => {
1947
960
  try {
1948
- return decodeURIComponent(i);
961
+ return decodeURIComponent(o);
1949
962
  } catch {
1950
- return i;
963
+ return o;
1951
964
  }
1952
- }, s = {};
1953
- for (let i = 0; i < t.length; i++) {
1954
- const r = t[i], a = n[i];
1955
- if (!a && r.type !== "catch-all")
965
+ }, a = {};
966
+ for (let o = 0; o < e.length; o++) {
967
+ const r = e[o], i = n[o];
968
+ if (!i && r.type !== "catch-all")
1956
969
  return null;
1957
970
  if (r.type === "literal") {
1958
- if (r.value !== a)
971
+ if (r.value !== i)
1959
972
  return null;
1960
973
  } else if (r.type === "param")
1961
- s[r.name] = o(a);
974
+ a[r.name] = s(i);
1962
975
  else if (r.type === "catch-all") {
1963
976
  if (r.name) {
1964
- const c = n.slice(i).join("/");
1965
- s[r.name] = o(c);
977
+ const c = n.slice(o).join("/");
978
+ a[r.name] = s(c);
1966
979
  }
1967
- return { params: s, path: e };
980
+ return { params: a, path: t };
1968
981
  }
1969
982
  }
1970
- return n.length !== t.length ? null : { params: s, path: e };
1971
- }, Te = (t) => t.split("/").map((e) => {
1972
- if (e.startsWith(":"))
1973
- return { type: "param", name: e.slice(1) };
1974
- if (e.startsWith("*")) {
1975
- const n = e.slice(1);
983
+ return n.length !== e.length ? null : { params: a, path: t };
984
+ }, Et = (e) => e.split("/").map((t) => {
985
+ if (t.startsWith(":"))
986
+ return { type: "param", name: t.slice(1) };
987
+ if (t.startsWith("*")) {
988
+ const n = t.slice(1);
1976
989
  return n != "" ? { type: "catch-all", name: n } : { type: "catch-all" };
1977
990
  } else
1978
- return { type: "literal", value: e };
1979
- }).filter((e) => e.type !== "literal" || e.value !== ""), No = (t) => {
1980
- const e = t.map((n) => {
1981
- const o = Te(n);
1982
- return { route: n, segments: o };
991
+ return { type: "literal", value: t };
992
+ }).filter((t) => t.type !== "literal" || t.value !== ""), je = (e) => {
993
+ const t = e.map((n) => {
994
+ const s = Et(n);
995
+ return { route: n, segments: s };
1983
996
  });
1984
- return function(o) {
1985
- for (const { segments: s, route: i } of e) {
1986
- const r = ao(s, o);
997
+ return function(s) {
998
+ for (const { segments: a, route: o } of t) {
999
+ const r = de(a, s);
1987
1000
  if (r)
1988
- return { ...r, route: i };
1001
+ return { ...r, route: o };
1989
1002
  }
1990
1003
  return null;
1991
1004
  };
1992
- }, co = (t) => {
1993
- if (t == null)
1005
+ }, pe = (e) => {
1006
+ if (e == null)
1994
1007
  throw new Error(
1995
1008
  "NavigationService: no Location handle attached. Make sure to attach one before calling navigation helpers."
1996
1009
  );
1997
- return t;
1010
+ return e;
1998
1011
  };
1999
- class lo {
1012
+ class fe {
2000
1013
  handles = [];
2001
- attach(e) {
2002
- const n = this.handles.lastIndexOf(e);
2003
- return n !== -1 && this.handles.splice(n, 1), this.handles.push(e), () => this.detach(e);
1014
+ attach(t) {
1015
+ const n = this.handles.lastIndexOf(t);
1016
+ return n !== -1 && this.handles.splice(n, 1), this.handles.push(t), () => this.detach(t);
2004
1017
  }
2005
- detach(e) {
1018
+ detach(t) {
2006
1019
  for (let n = this.handles.length - 1; n >= 0; n--)
2007
- if (this.handles[n] === e) {
1020
+ if (this.handles[n] === t) {
2008
1021
  this.handles.splice(n, 1);
2009
1022
  break;
2010
1023
  }
@@ -2013,291 +1026,291 @@ class lo {
2013
1026
  return this.handles[this.handles.length - 1];
2014
1027
  }
2015
1028
  getHandle() {
2016
- return co(this.current);
1029
+ return pe(this.current);
2017
1030
  }
2018
- navigate(e, n) {
2019
- this.getHandle().navigate(e, n);
1031
+ navigate(t, n) {
1032
+ this.getHandle().navigate(t, n);
2020
1033
  }
2021
- replace(e, n) {
2022
- this.getHandle().replace(e, n);
1034
+ replace(t, n) {
1035
+ this.getHandle().replace(t, n);
2023
1036
  }
2024
- go(e, n) {
2025
- this.getHandle().go(e, n);
1037
+ go(t, n) {
1038
+ this.getHandle().go(t, n);
2026
1039
  }
2027
- back(e) {
2028
- this.getHandle().back(e);
1040
+ back(t) {
1041
+ this.getHandle().back(t);
2029
1042
  }
2030
- forward(e) {
2031
- this.getHandle().forward(e);
1043
+ forward(t) {
1044
+ this.getHandle().forward(t);
2032
1045
  }
2033
- setPathname(e, n) {
2034
- this.getHandle().setPathname(e, n);
1046
+ setPathname(t, n) {
1047
+ this.getHandle().setPathname(t, n);
2035
1048
  }
2036
- setSearch(e, n) {
2037
- this.getHandle().setSearch(e, n);
1049
+ setSearch(t, n) {
1050
+ this.getHandle().setSearch(t, n);
2038
1051
  }
2039
- setSearchParam(e, n, o) {
2040
- this.getHandle().setSearchParam(e, n, o);
1052
+ setSearchParam(t, n, s) {
1053
+ this.getHandle().setSearchParam(t, n, s);
2041
1054
  }
2042
- updateSearch(e, n) {
2043
- this.getHandle().updateSearch(e, n);
1055
+ updateSearch(t, n) {
1056
+ this.getHandle().updateSearch(t, n);
2044
1057
  }
2045
- setHash(e, n) {
2046
- this.getHandle().setHash(e, n);
1058
+ setHash(t, n) {
1059
+ this.getHandle().setHash(t, n);
2047
1060
  }
2048
- clearHash(e) {
2049
- this.getHandle().clearHash(e);
1061
+ clearHash(t) {
1062
+ this.getHandle().clearHash(t);
2050
1063
  }
2051
- run(e, n) {
2052
- this.getHandle().run(e, n);
1064
+ run(t, n) {
1065
+ this.getHandle().run(t, n);
2053
1066
  }
2054
1067
  }
2055
- const Vo = new lo(), Ht = {
2056
- mark: Mt("RouterContext"),
1068
+ const Ve = new fe(), q = {
1069
+ mark: Q("RouterContext"),
2057
1070
  create: () => {
2058
- const t = M([]);
1071
+ const e = b([]);
2059
1072
  return {
2060
- value: t,
2061
- dispose: () => t.dispose()
1073
+ value: e,
1074
+ dispose: () => e.dispose()
2062
1075
  };
2063
1076
  }
2064
- }, uo = (t, e, n) => {
2065
- const o = n.split("/").filter((r) => r !== ""), s = {};
2066
- let i = 0;
2067
- for (let r = 0; r < t.length; r++) {
2068
- const a = t[r], c = o[r];
2069
- if (!c && a.type !== "catch-all")
1077
+ }, me = (e, t, n) => {
1078
+ const s = n.split("/").filter((r) => r !== ""), a = {};
1079
+ let o = 0;
1080
+ for (let r = 0; r < e.length; r++) {
1081
+ const i = e[r], c = s[r];
1082
+ if (!c && i.type !== "catch-all")
2070
1083
  return null;
2071
- if (a.type === "literal") {
2072
- if (a.value !== c)
1084
+ if (i.type === "literal") {
1085
+ if (i.value !== c)
2073
1086
  return null;
2074
- i++;
2075
- } else if (a.type === "param")
2076
- s[a.name] = c, i++;
2077
- else if (a.type === "catch-all") {
2078
- a.name && (s[a.name] = o.slice(i).join("/"));
2079
- const l = "/" + o.slice(0, i).join("/"), u = "/" + o.slice(i).join("/");
1087
+ o++;
1088
+ } else if (i.type === "param")
1089
+ a[i.name] = c, o++;
1090
+ else if (i.type === "catch-all") {
1091
+ i.name && (a[i.name] = s.slice(o).join("/"));
1092
+ const u = "/" + s.slice(0, o).join("/"), d = "/" + s.slice(o).join("/");
2080
1093
  return {
2081
- params: s,
2082
- matchedPath: l === "/" ? "" : l,
2083
- remainingPath: u === "/" ? "" : u,
2084
- route: e
1094
+ params: a,
1095
+ matchedPath: u === "/" ? "" : u,
1096
+ remainingPath: d === "/" ? "" : d,
1097
+ route: t
2085
1098
  };
2086
1099
  }
2087
1100
  }
2088
- if (o.length === t.length) {
2089
- const r = "/" + o.join("/");
1101
+ if (s.length === e.length) {
1102
+ const r = "/" + s.join("/");
2090
1103
  return {
2091
- params: s,
1104
+ params: a,
2092
1105
  matchedPath: r === "/" ? "" : r,
2093
1106
  remainingPath: "",
2094
- route: e
1107
+ route: t
2095
1108
  };
2096
1109
  }
2097
1110
  return null;
2098
- }, Ce = (t) => {
2099
- const e = t.map((n) => {
2100
- const o = Te(n);
2101
- return { route: n, segments: o };
1111
+ }, Ot = (e) => {
1112
+ const t = e.map((n) => {
1113
+ const s = Et(n);
1114
+ return { route: n, segments: s };
2102
1115
  });
2103
- return function(o) {
2104
- for (const { segments: s, route: i } of e) {
2105
- const r = uo(s, i, o);
1116
+ return function(s) {
1117
+ for (const { segments: a, route: o } of t) {
1118
+ const r = me(a, o, s);
2106
1119
  if (r)
2107
1120
  return r;
2108
1121
  }
2109
1122
  return null;
2110
1123
  };
2111
- }, $o = (t) => {
2112
- const e = Ce(Object.keys(t));
2113
- return Ne(
2114
- Ht,
1124
+ }, _e = (e) => {
1125
+ const t = Ot(Object.keys(e));
1126
+ return Tt(
1127
+ q,
2115
1128
  {},
2116
- () => ct($t, (n) => ct(Ht, (o) => {
2117
- const s = n.location.map((i) => {
2118
- const r = e(i.pathname);
1129
+ () => M(G, (n) => M(q, (s) => {
1130
+ const a = n.location.map((o) => {
1131
+ const r = t(o.pathname);
2119
1132
  if (r == null)
2120
- throw console.error("No route found for", i), new Error("No route found");
2121
- const a = {
1133
+ throw console.error("No route found for", o), new Error("No route found");
1134
+ const i = {
2122
1135
  matchedPath: r.matchedPath,
2123
1136
  remainingPath: r.remainingPath,
2124
- fullPath: i.pathname,
1137
+ fullPath: o.pathname,
2125
1138
  params: r.params
2126
1139
  };
2127
- return o.value = [...o.value, a], {
1140
+ return s.value = [...s.value, i], {
2128
1141
  params: r.params,
2129
1142
  route: r.route,
2130
- path: r.matchedPath || i.pathname,
2131
- search: i.search,
2132
- hash: i.hash
1143
+ path: r.matchedPath || o.pathname,
1144
+ search: o.search,
1145
+ hash: o.hash
2133
1146
  };
2134
1147
  });
2135
- return pe(
2136
- s.map((i) => [i.route, i]),
1148
+ return St(
1149
+ a.map((o) => [o.route, o]),
2137
1150
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2138
- t
1151
+ e
2139
1152
  );
2140
1153
  }))
2141
1154
  );
2142
- }, zo = (t) => {
2143
- const e = Ce(Object.keys(t));
2144
- return ct(Ht, (n) => ct($t, (o) => {
2145
- const s = n.map((i) => {
2146
- const r = i[i.length - 1];
1155
+ }, Ie = (e) => {
1156
+ const t = Ot(Object.keys(e));
1157
+ return M(q, (n) => M(G, (s) => {
1158
+ const a = n.map((o) => {
1159
+ const r = o[o.length - 1];
2147
1160
  if (r == null)
2148
- throw console.error("No router context available for ChildRouter", i), new Error("No router context available for ChildRouter");
2149
- const a = r.remainingPath ?? "", c = e(a);
1161
+ throw console.error("No router context available for ChildRouter", o), new Error("No router context available for ChildRouter");
1162
+ const i = r.remainingPath ?? "", c = t(i);
2150
1163
  if (c == null)
2151
- throw console.error("No route found for remaining path", a), new Error("No route found");
1164
+ throw console.error("No route found for remaining path", i), new Error("No route found");
2152
1165
  return {
2153
1166
  params: c.params,
2154
1167
  // Only this router's parameters
2155
1168
  route: c.route,
2156
1169
  path: c.matchedPath,
2157
- search: o.location.value.search,
2158
- hash: o.location.value.hash
1170
+ search: s.location.value.search,
1171
+ hash: s.location.value.hash
2159
1172
  };
2160
1173
  });
2161
- return pe(
2162
- s.map((i) => [i.route, i]),
1174
+ return St(
1175
+ a.map((o) => [o.route, o]),
2163
1176
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2164
- t
1177
+ e
2165
1178
  );
2166
1179
  }));
2167
- }, xt = 60 * 1e3, Ft = 60 * xt, ut = 24 * Ft, ie = 7 * ut, ae = 30 * ut, fo = 365 * ut, ho = [
1180
+ }, z = 60 * 1e3, Y = 60 * z, D = 24 * Y, ht = 7 * D, dt = 30 * D, ge = 365 * D, ve = [
2168
1181
  {
2169
- max: xt * 90,
2170
- value: xt,
1182
+ max: z * 90,
1183
+ value: z,
2171
1184
  name: "minute",
2172
1185
  past: { singular: "a minute ago", plural: "{} minutes ago" },
2173
1186
  future: { singular: "in a minute", plural: "in {} minutes" }
2174
1187
  },
2175
1188
  {
2176
- max: Ft * 36,
2177
- value: Ft,
1189
+ max: Y * 36,
1190
+ value: Y,
2178
1191
  name: "hour",
2179
1192
  past: { singular: "an hour ago", plural: "{} hours ago" },
2180
1193
  future: { singular: "in an hour", plural: "in {} hours" }
2181
1194
  },
2182
1195
  {
2183
- max: ut * 10,
2184
- value: ut,
1196
+ max: D * 10,
1197
+ value: D,
2185
1198
  name: "day",
2186
1199
  past: { singular: "yesterday", plural: "{} days ago" },
2187
1200
  future: { singular: "tomorrow", plural: "in {} days" }
2188
1201
  },
2189
1202
  {
2190
- max: ie * 6,
2191
- value: ie,
1203
+ max: ht * 6,
1204
+ value: ht,
2192
1205
  name: "week",
2193
1206
  past: { singular: "last week", plural: "{} weeks ago" },
2194
1207
  future: { singular: "in a week", plural: "in {} weeks" }
2195
1208
  },
2196
1209
  {
2197
- max: ae * 18,
2198
- value: ae,
1210
+ max: dt * 18,
1211
+ value: dt,
2199
1212
  name: "month",
2200
1213
  past: { singular: "last month", plural: "{} months ago" },
2201
1214
  future: { singular: "in a month", plural: "in {} months" }
2202
1215
  },
2203
1216
  {
2204
1217
  max: 1 / 0,
2205
- value: fo,
1218
+ value: ge,
2206
1219
  name: "year",
2207
1220
  past: { singular: "last year", plural: "{} years ago" },
2208
1221
  future: { singular: "in a year", plural: "in {} years" }
2209
1222
  }
2210
1223
  ];
2211
- function ce(t, e, n, o) {
2212
- const s = Math.round(t / e);
2213
- return s <= 1 ? n : o.replace(
1224
+ function pt(e, t, n, s) {
1225
+ const a = Math.round(e / t);
1226
+ return a <= 1 ? n : s.replace(
2214
1227
  "{}",
2215
- s.toLocaleString(void 0, {
1228
+ a.toLocaleString(void 0, {
2216
1229
  maximumFractionDigits: 0,
2217
1230
  minimumFractionDigits: 0
2218
1231
  })
2219
1232
  );
2220
1233
  }
2221
- const mo = (t = 1e3) => {
2222
- const e = M(/* @__PURE__ */ new Date()), n = $e(() => e.set(/* @__PURE__ */ new Date()), t);
2223
- return e.onDispose(n), e;
2224
- }, po = (t) => {
2225
- const e = Math.abs(t);
2226
- if (e < xt)
2227
- return t < 0 ? "just now" : "in a moment";
2228
- for (const n of ho)
2229
- if (e < n.max)
2230
- return t < 0 ? ce(e, n.value, n.past.singular, n.past.plural) : ce(e, n.value, n.future.singular, n.future.plural);
1234
+ const we = (e = 1e3) => {
1235
+ const t = b(/* @__PURE__ */ new Date()), n = Kt(() => t.set(/* @__PURE__ */ new Date()), e);
1236
+ return t.onDispose(n), t;
1237
+ }, ye = (e) => {
1238
+ const t = Math.abs(e);
1239
+ if (t < z)
1240
+ return e < 0 ? "just now" : "in a moment";
1241
+ for (const n of ve)
1242
+ if (t < n.max)
1243
+ return e < 0 ? pt(t, n.value, n.past.singular, n.past.plural) : pt(t, n.value, n.future.singular, n.future.plural);
2231
1244
  throw new Error("unreachable");
2232
- }, go = (t, { now: e, frequency: n = 1e4 } = {}) => {
2233
- const o = e != null ? le.is(e) ? e.derive() : M(e) : mo(n), s = Nt(
2234
- t,
2235
- o
2236
- )((i, r) => i.getTime() - r.getTime());
2237
- return s.onDispose(() => C.dispose(o)), s;
2238
- }, wo = (t, e = {}) => {
2239
- const n = go(t, e), o = n.map(po);
2240
- return o.onDispose(n.dispose), o;
2241
- }, Bo = (t, e = {}) => wo(t, e);
2242
- class vo extends Ve {
1245
+ }, Se = (e, { now: t, frequency: n = 1e4 } = {}) => {
1246
+ const s = t != null ? ft.is(t) ? t.derive() : b(t) : we(n), a = J(
1247
+ e,
1248
+ s
1249
+ )((o, r) => o.getTime() - r.getTime());
1250
+ return a.onDispose(() => y.dispose(s)), a;
1251
+ }, be = (e, t = {}) => {
1252
+ const n = Se(e, t), s = n.map(ye);
1253
+ return s.onDispose(() => n.dispose()), s;
1254
+ }, Be = (e, t = {}) => be(e, t);
1255
+ class xe extends Wt {
2243
1256
  /**
2244
1257
  * Triggers an update of the Ticker by incrementing its internal value.
2245
1258
  * @returns void
2246
1259
  */
2247
- tick = () => this.update((e) => e + 1);
1260
+ tick = () => this.update((t) => t + 1);
2248
1261
  }
2249
- const _o = (t = 0) => new vo(t, (e, n) => e === n);
1262
+ const qe = (e = 0) => new xe(e, Ut);
2250
1263
  export {
2251
- tn as Anchor,
2252
- bo as Appearance,
2253
- ve as AsyncResultView,
2254
- So as AutoFocus,
2255
- Oo as AutoSelect,
2256
- zo as ChildRouter,
2257
- Fo as ElementRect,
2258
- Eo as HTMLTitle,
2259
- Ro as HiddenWhenEmpty,
2260
- sn as InViewport,
2261
- $t as Location,
2262
- To as Mutation,
2263
- ln as MutationDisplay,
2264
- Vo as NavigationService,
2265
- rn as OnClickOutside,
2266
- Lo as OnEnterKey,
2267
- ko as OnEscapeKey,
2268
- ye as OnKeyPressed,
2269
- Do as PopOver,
2270
- Wo as Query,
2271
- ro as QueryDisplay,
2272
- Rt as Rect,
2273
- io as ResultView,
2274
- $o as RootRouter,
2275
- Ht as RouterContextProvider,
2276
- Ho as SelectOnFocus,
2277
- vo as Ticker,
2278
- Po as WhenInViewport,
2279
- Mo as WindowSize,
2280
- Be as _checkExtensionCondition,
2281
- ze as _getExtension,
2282
- No as _makeRouteMatcher,
2283
- Te as _parseRouteSegments,
2284
- Co as allPlacements,
2285
- Ke as areLocationsEqual,
2286
- Ao as classes,
2287
- Yt as evaluateLocationMatch,
2288
- se as getAbsoluteRect,
2289
- Ue as handleAnchorClick,
2290
- kt as locationFromURL,
2291
- cn as makeMutationResource,
2292
- so as makeQueryResource,
2293
- an as matchesKeyCombo,
2294
- ao as matchesRoute,
2295
- mo as nowSignal,
2296
- Bo as relativeTime,
2297
- go as relativeTimeMillisSignal,
2298
- wo as relativeTimeSignal,
2299
- _o as ticker,
2300
- po as timeDiffToString,
2301
- et as urlFromLocation,
2302
- en as useAppearance
1264
+ te as Anchor,
1265
+ Oe as Appearance,
1266
+ Pt as AsyncResultView,
1267
+ Le as AutoFocus,
1268
+ Re as AutoSelect,
1269
+ Ie as ChildRouter,
1270
+ ze as ElementRect,
1271
+ Te as HTMLTitle,
1272
+ He as HiddenWhenEmpty,
1273
+ re as InViewport,
1274
+ G as Location,
1275
+ Me as Mutation,
1276
+ ce as MutationDisplay,
1277
+ Ve as NavigationService,
1278
+ ae as OnClickOutside,
1279
+ Ue as OnEnterKey,
1280
+ Ke as OnEscapeKey,
1281
+ kt as OnKeyPressed,
1282
+ Ne as PopOver,
1283
+ Ce as Query,
1284
+ ue as QueryDisplay,
1285
+ $ as Rect,
1286
+ he as ResultView,
1287
+ _e as RootRouter,
1288
+ q as RouterContextProvider,
1289
+ Fe as SelectOnFocus,
1290
+ xe as Ticker,
1291
+ We as WhenInViewport,
1292
+ $e as WindowSize,
1293
+ $t as _checkExtensionCondition,
1294
+ zt as _getExtension,
1295
+ je as _makeRouteMatcher,
1296
+ Et as _parseRouteSegments,
1297
+ De as allPlacements,
1298
+ _t as areLocationsEqual,
1299
+ Ae as classes,
1300
+ it as evaluateLocationMatch,
1301
+ lt as getAbsoluteRect,
1302
+ Vt as handleAnchorClick,
1303
+ I as locationFromURL,
1304
+ ie as makeMutationResource,
1305
+ le as makeQueryResource,
1306
+ oe as matchesKeyCombo,
1307
+ de as matchesRoute,
1308
+ we as nowSignal,
1309
+ Be as relativeTime,
1310
+ Se as relativeTimeMillisSignal,
1311
+ be as relativeTimeSignal,
1312
+ qe as ticker,
1313
+ ye as timeDiffToString,
1314
+ T as urlFromLocation,
1315
+ ee as useAppearance
2303
1316
  };