@tempots/ui 15.0.0 → 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 +732 -1712
  3. package/package.json +5 -6
package/index.js CHANGED
@@ -1,113 +1,114 @@
1
- import { getWindow as st, prop as M, makeProviderMark as Ft, computedOf as Mt, Signal as ce, Use as ct, html as Et, on as le, Value as C, attr as Nt, Empty as Pt, OneOfType as ue, WithElement as _, OnDispose as N, Fragment as Y, Portal as fe, renderableOfTNode as he, When as de, previousSignal as He, effectOf as We, WithBrowserCtx as Fe, WithCtx as Me, Provide as Ne, OneOfTuple as me, Prop as Ve } from "@tempots/dom";
2
- import { delayed as pe, 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, Lt = (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
- }, Yt = (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
- Yt(() => {
81
- if (e) {
82
- const h = et(c), g = l?.state ?? {};
83
- u === "replaceState" || l?.replace ? e.history.replaceState(g, "", h) : e.history.pushState(g, "", 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
- Yt(() => {
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) => Lt(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
- }, Ye = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), qe = (t) => {
104
- const e = t.container.currentURL, n = e.iso(
105
- (r) => Lt(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 (Ye(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) => Lt(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
- }), kt = (t) => {
136
- if (t == null) return;
137
- const e = `${t}`;
138
- return e === "" ? void 0 : e;
139
- }, ge = (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
- }, Xe = (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
- }, qt = (t, e, n) => {
163
- const o = Xe(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 = kt(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: ge(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((p) => p.pathname), s = e.map((p) => ({ ...p.search })), i = e.map((p) => p.hash), r = (p, x) => qt(t.location.value, p, x), a = (p, x) => Mt(
216
- e,
217
- p
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, P) => qt(S, P, x)
220
- ), c = (p, x, S) => {
221
- const P = it({
222
- ...p,
223
- hash: kt(p.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(P, x, S);
226
- }, l = (p, x) => {
227
- const S = Je(x, "pushState");
228
- c(p, x, S);
229
- }, u = (p, x) => {
230
- const S = p(it(t.location.value));
231
- l(S, x);
232
- }, h = (p, x) => {
233
- const S = t.resolve(p);
234
- l(S, x);
235
- }, g = (p, x) => {
236
- const S = { ...x, replace: !0 };
237
- h(p, S);
238
- }, f = (p, x) => {
239
- t.go(p, x);
240
- }, d = (p) => {
241
- t.back(p);
242
- }, y = (p) => {
243
- t.forward(p);
244
- }, m = (p, x) => u((S) => ({ ...S, pathname: p }), x), v = (p, x) => u((S) => {
245
- const P = { ...S }, K = kt(p);
246
- return K == null ? delete P.hash : P.hash = K, P;
247
- }, x), b = (p) => v(void 0, p), w = (p, x) => u(
248
- (S) => ({
249
- ...S,
250
- search: ge(S.search, p)
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: g,
265
- go: f,
266
- back: d,
267
- forward: y,
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,
268
269
  setPathname: m,
269
- setHash: v,
270
- clearHash: b,
271
- setSearch: w,
272
- setSearchParam: (p, x, S) => w({ [p]: x }, S),
273
- updateSearch: (p, x) => u(
274
- (S) => ({
275
- ...S,
276
- search: { ...p({ ...S.search }) }
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: (p) => e.map((x) => x.search[p]),
281
- run: (p, 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
- p(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 qe(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
- }, Vt = {
301
- mark: Ft("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" || ce.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(Vt, (c) => Et.a(
314
- le.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
- Nt.href(n),
325
- ...e
325
+ X.href(n),
326
+ ...t
326
327
  /* c8 ignore next 2 */
327
328
  ));
328
- }, yo = {
329
- mark: Ft("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 we = (t, e) => {
343
- if (typeof e == "function")
344
- return we(t, { success: e });
345
- const n = e.failure ?? ((r) => r.map((a) => `Error: ${a}`)), o = e.success, s = e.loading ?? (() => Pt), i = e.notAsked ?? (() => Pt);
346
- return ue(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
- }, xo = (t = 10) => _((e) => N(pe(() => e?.focus(), t))), bo = (t = 10) => _((e) => {
353
- const n = pe(() => 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 So(t) {
357
- const e = Object.entries(t);
358
- return Y(
359
- ...e.map(
360
- ([n, o]) => Nt.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 Oo = _((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
- }), Ao = (t) => fe("head > title", Nt.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,1132 +378,151 @@ const Oo = _((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 Y(
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
- he(n(o))
411
+ wt(n(s))
411
412
  );
412
- }, Ro = (t, e, n) => sn(t, (o) => de(o, e, n ?? (() => Pt)));
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, Xt = (t, e) => t === void 0 || t === e;
424
- function an(t, e) {
425
- return typeof t == "string" ? e.key === t : Xt(t.key, e.key) && Xt(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 ve({
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 Eo(t) {
450
- return ve({ allowedKeys: ["Enter"], handler: t });
450
+ function Ue(e) {
451
+ return kt({ allowedKeys: ["Enter"], handler: e });
451
452
  }
452
- function Po(t) {
453
- return ve({ 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 m = 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: m, 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 = He(c);
496
- return Y(
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
- }, Lo = ({
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 Tt(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 ye(t) {
549
- return t === "x" ? "y" : "x";
550
- }
551
- function $t(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 zt(t) {
559
- return ye(I(t));
560
- }
561
- function dn(t, e, n) {
562
- n === void 0 && (n = !1);
563
- const o = ht(t), s = zt(t), i = $t(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 [Ct(t), e, Ct(e)];
570
- }
571
- function Ct(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(Ct)))), 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 xe(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 = zt(e), a = $t(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, g = 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] -= g * (n && l ? -1 : 1);
671
- break;
672
- case "end":
673
- f[r] += g * (n && l ? -1 : 1);
674
- break;
675
- }
676
- return f;
677
- }
678
- const xn = async (t, e, n) => {
679
- const {
680
- placement: o = "bottom",
681
- strategy: s = "absolute",
682
- middleware: i = [],
683
- platform: r
684
- } = n, a = i.filter(Boolean), c = await (r.isRTL == null ? void 0 : r.isRTL(e));
685
- let l = await r.getElementRects({
686
- reference: t,
687
- floating: e,
688
- strategy: s
689
- }), {
690
- x: u,
691
- y: h
692
- } = Gt(l, o, c), g = o, f = {}, d = 0;
693
- for (let y = 0; y < a.length; y++) {
694
- const {
695
- name: m,
696
- fn: v
697
- } = a[y], {
698
- x: b,
699
- y: w,
700
- data: A,
701
- reset: O
702
- } = await v({
703
- x: u,
704
- y: h,
705
- initialPlacement: o,
706
- placement: g,
707
- strategy: s,
708
- middlewareData: f,
709
- rects: l,
710
- platform: r,
711
- elements: {
712
- reference: t,
713
- floating: e
714
- }
715
- });
716
- u = b ?? u, h = w ?? h, f = {
717
- ...f,
718
- [m]: {
719
- ...f[m],
720
- ...A
721
- }
722
- }, O && d <= 50 && (d++, typeof O == "object" && (O.placement && (g = O.placement), O.rects && (l = O.rects === !0 ? await r.getElementRects({
723
- reference: t,
724
- floating: e,
725
- strategy: s
726
- }) : O.rects), {
727
- x: u,
728
- y: h
729
- } = Gt(l, g, c)), y = -1);
730
- }
731
- return {
732
- x: u,
733
- y: h,
734
- placement: g,
735
- strategy: s,
736
- middlewareData: f
737
- };
738
- };
739
- async function be(t, e) {
740
- var n;
741
- e === void 0 && (e = {});
742
- const {
743
- x: o,
744
- y: s,
745
- platform: i,
746
- rects: r,
747
- elements: a,
748
- strategy: c
749
- } = t, {
750
- boundary: l = "clippingAncestors",
751
- rootBoundary: u = "viewport",
752
- elementContext: h = "floating",
753
- altBoundary: g = !1,
754
- padding: f = 0
755
- } = ft(e, t), d = xe(f), m = a[g ? h === "floating" ? "reference" : "floating" : h], v = yt(await i.getClippingRect({
756
- element: (n = await (i.isElement == null ? void 0 : i.isElement(m))) == null || n ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
757
- boundary: l,
758
- rootBoundary: u,
759
- strategy: c
760
- })), b = h === "floating" ? {
761
- x: o,
762
- y: s,
763
- width: r.floating.width,
764
- height: r.floating.height
765
- } : r.reference, w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), A = await (i.isElement == null ? void 0 : i.isElement(w)) ? await (i.getScale == null ? void 0 : i.getScale(w)) || {
766
- x: 1,
767
- y: 1
768
- } : {
769
- x: 1,
770
- y: 1
771
- }, O = yt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
772
- elements: a,
773
- rect: b,
774
- offsetParent: w,
775
- strategy: c
776
- }) : b);
777
- return {
778
- top: (v.top - O.top + d.top) / A.y,
779
- bottom: (O.bottom - v.bottom + d.bottom) / A.y,
780
- left: (v.left - O.left + d.left) / A.x,
781
- right: (O.right - v.right + d.right) / A.x
782
- };
783
- }
784
- const bn = (t) => ({
785
- name: "arrow",
786
- options: t,
787
- async fn(e) {
788
- const {
789
- x: n,
790
- y: o,
791
- placement: s,
792
- rects: i,
793
- platform: r,
794
- elements: a,
795
- middlewareData: c
796
- } = e, {
797
- element: l,
798
- padding: u = 0
799
- } = ft(t, e) || {};
800
- if (l == null)
801
- return {};
802
- const h = xe(u), g = {
803
- x: n,
804
- y: o
805
- }, f = zt(s), d = $t(f), y = await r.getDimensions(l), m = f === "y", v = m ? "top" : "left", b = m ? "bottom" : "right", w = m ? "clientHeight" : "clientWidth", A = i.reference[d] + i.reference[f] - g[f] - i.floating[d], O = g[f] - i.reference[f], T = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(l));
806
- let E = T ? T[w] : 0;
807
- (!E || !await (r.isElement == null ? void 0 : r.isElement(T))) && (E = a.floating[w] || i.floating[d]);
808
- const U = A / 2 - O / 2, p = E / 2 - y[d] / 2 - 1, x = nt(h[v], p), S = nt(h[b], p), P = x, K = E - y[d] - S, L = E / 2 - y[d] / 2 + U, X = Tt(P, L, K), B = !c.arrow && ht(s) != null && L !== X && i.reference[d] / 2 - (L < P ? x : S) - y[d] / 2 < 0, D = B ? L < P ? L - P : L - K : 0;
809
- return {
810
- [f]: g[f] + D,
811
- data: {
812
- [f]: X,
813
- centerOffset: L - X - D,
814
- ...B && {
815
- alignmentOffset: D
816
- }
817
- },
818
- reset: B
819
- };
820
- }
821
- }), Sn = function(t) {
822
- return t === void 0 && (t = {}), {
823
- name: "flip",
824
- options: t,
825
- async fn(e) {
826
- var n, o;
827
- const {
828
- placement: s,
829
- middlewareData: i,
830
- rects: r,
831
- initialPlacement: a,
832
- platform: c,
833
- elements: l
834
- } = e, {
835
- mainAxis: u = !0,
836
- crossAxis: h = !0,
837
- fallbackPlacements: g,
838
- fallbackStrategy: f = "bestFit",
839
- fallbackAxisSideDirection: d = "none",
840
- flipAlignment: y = !0,
841
- ...m
842
- } = ft(t, e);
843
- if ((n = i.arrow) != null && n.alignmentOffset)
844
- return {};
845
- const v = J(s), b = I(a), w = J(a) === a, A = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), O = g || (w || !y ? [vt(a)] : mn(a)), T = d !== "none";
846
- !g && T && O.push(...vn(a, y, d, A));
847
- const E = [a, ...O], U = await be(e, m), p = [];
848
- let x = ((o = i.flip) == null ? void 0 : o.overflows) || [];
849
- if (u && p.push(U[v]), h) {
850
- const L = dn(s, r, A);
851
- p.push(U[L[0]], U[L[1]]);
852
- }
853
- if (x = [...x, {
854
- placement: s,
855
- overflows: p
856
- }], !p.every((L) => L <= 0)) {
857
- var S, P;
858
- const L = (((S = i.flip) == null ? void 0 : S.index) || 0) + 1, X = E[L];
859
- if (X && (!(h === "alignment" ? b !== I(X) : !1) || // We leave the current main axis only if every placement on that axis
860
- // overflows the main axis.
861
- x.every((H) => I(H.placement) === b ? H.overflows[0] > 0 : !0)))
862
- return {
863
- data: {
864
- index: L,
865
- overflows: x
866
- },
867
- reset: {
868
- placement: X
869
- }
870
- };
871
- let B = (P = x.filter((D) => D.overflows[0] <= 0).sort((D, H) => D.overflows[1] - H.overflows[1])[0]) == null ? void 0 : P.placement;
872
- if (!B)
873
- switch (f) {
874
- case "bestFit": {
875
- var K;
876
- const D = (K = x.filter((H) => {
877
- if (T) {
878
- const j = I(H.placement);
879
- return j === b || // Create a bias to the `y` side axis due to horizontal
880
- // reading directions favoring greater width.
881
- j === "y";
882
- }
883
- return !0;
884
- }).map((H) => [H.placement, H.overflows.filter((j) => j > 0).reduce((j, De) => j + De, 0)]).sort((H, j) => H[1] - j[1])[0]) == null ? void 0 : K[0];
885
- D && (B = D);
886
- break;
887
- }
888
- case "initialPlacement":
889
- B = a;
890
- break;
891
- }
892
- if (s !== B)
893
- return {
894
- reset: {
895
- placement: B
896
- }
897
- };
898
- }
899
- return {};
900
- }
901
- };
902
- }, On = /* @__PURE__ */ new Set(["left", "top"]);
903
- async function An(t, e) {
904
- const {
905
- placement: n,
906
- platform: o,
907
- elements: s
908
- } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), r = J(n), a = ht(n), c = I(n) === "y", l = On.has(r) ? -1 : 1, u = i && c ? -1 : 1, h = ft(e, t);
909
- let {
910
- mainAxis: g,
911
- crossAxis: f,
912
- alignmentAxis: d
913
- } = typeof h == "number" ? {
914
- mainAxis: h,
915
- crossAxis: 0,
916
- alignmentAxis: null
917
- } : {
918
- mainAxis: h.mainAxis || 0,
919
- crossAxis: h.crossAxis || 0,
920
- alignmentAxis: h.alignmentAxis
921
- };
922
- return a && typeof d == "number" && (f = a === "end" ? d * -1 : d), c ? {
923
- x: f * u,
924
- y: g * l
925
- } : {
926
- x: g * l,
927
- y: f * u
928
- };
929
- }
930
- const Rn = function(t) {
931
- return t === void 0 && (t = 0), {
932
- name: "offset",
933
- options: t,
934
- async fn(e) {
935
- var n, o;
936
- const {
937
- x: s,
938
- y: i,
939
- placement: r,
940
- middlewareData: a
941
- } = e, c = await An(e, t);
942
- return r === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
943
- x: s + c.x,
944
- y: i + c.y,
945
- data: {
946
- ...c,
947
- placement: r
948
- }
949
- };
950
- }
951
- };
952
- }, En = function(t) {
953
- return t === void 0 && (t = {}), {
954
- name: "shift",
955
- options: t,
956
- async fn(e) {
957
- const {
958
- x: n,
959
- y: o,
960
- placement: s
961
- } = e, {
962
- mainAxis: i = !0,
963
- crossAxis: r = !1,
964
- limiter: a = {
965
- fn: (m) => {
966
- let {
967
- x: v,
968
- y: b
969
- } = m;
970
- return {
971
- x: v,
972
- y: b
973
- };
974
- }
975
- },
976
- ...c
977
- } = ft(t, e), l = {
978
- x: n,
979
- y: o
980
- }, u = await be(e, c), h = I(J(s)), g = ye(h);
981
- let f = l[g], d = l[h];
982
- if (i) {
983
- const m = g === "y" ? "top" : "left", v = g === "y" ? "bottom" : "right", b = f + u[m], w = f - u[v];
984
- f = Tt(b, f, w);
985
- }
986
- if (r) {
987
- const m = h === "y" ? "top" : "left", v = h === "y" ? "bottom" : "right", b = d + u[m], w = d - u[v];
988
- d = Tt(b, d, w);
989
- }
990
- const y = a.fn({
991
- ...e,
992
- [g]: f,
993
- [h]: d
994
- });
995
- return {
996
- ...y,
997
- data: {
998
- x: y.x - n,
999
- y: y.y - o,
1000
- enabled: {
1001
- [g]: i,
1002
- [h]: r
1003
- }
1004
- }
1005
- };
1006
- }
1007
- };
1008
- };
1009
- function bt() {
1010
- return typeof window < "u";
1011
- }
1012
- function rt(t) {
1013
- return Se(t) ? (t.nodeName || "").toLowerCase() : "#document";
1014
- }
1015
- function k(t) {
1016
- var e;
1017
- return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
1018
- }
1019
- function z(t) {
1020
- var e;
1021
- return (e = (Se(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1022
- }
1023
- function Se(t) {
1024
- return bt() ? t instanceof Node || t instanceof k(t).Node : !1;
1025
- }
1026
- function W(t) {
1027
- return bt() ? t instanceof Element || t instanceof k(t).Element : !1;
1028
- }
1029
- function $(t) {
1030
- return bt() ? t instanceof HTMLElement || t instanceof k(t).HTMLElement : !1;
1031
- }
1032
- function Zt(t) {
1033
- return !bt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof k(t).ShadowRoot;
1034
- }
1035
- const Pn = /* @__PURE__ */ new Set(["inline", "contents"]);
1036
- function dt(t) {
1037
- const {
1038
- overflow: e,
1039
- overflowX: n,
1040
- overflowY: o,
1041
- display: s
1042
- } = F(t);
1043
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !Pn.has(s);
1044
- }
1045
- const Ln = /* @__PURE__ */ new Set(["table", "td", "th"]);
1046
- function kn(t) {
1047
- return Ln.has(rt(t));
1048
- }
1049
- const Tn = [":popover-open", ":modal"];
1050
- function St(t) {
1051
- return Tn.some((e) => {
1052
- try {
1053
- return t.matches(e);
1054
- } catch {
1055
- return !1;
1056
- }
1057
- });
1058
- }
1059
- const Cn = ["transform", "translate", "scale", "rotate", "perspective"], Dn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Hn = ["paint", "layout", "strict", "content"];
1060
- function Bt(t) {
1061
- const e = _t(), n = W(t) ? F(t) : t;
1062
- return Cn.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) || Dn.some((o) => (n.willChange || "").includes(o)) || Hn.some((o) => (n.contain || "").includes(o));
1063
- }
1064
- function Wn(t) {
1065
- let e = q(t);
1066
- for (; $(e) && !ot(e); ) {
1067
- if (Bt(e))
1068
- return e;
1069
- if (St(e))
1070
- return null;
1071
- e = q(e);
1072
- }
1073
- return null;
1074
- }
1075
- function _t() {
1076
- return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1077
- }
1078
- const Fn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1079
- function ot(t) {
1080
- return Fn.has(rt(t));
1081
- }
1082
- function F(t) {
1083
- return k(t).getComputedStyle(t);
1084
- }
1085
- function Ot(t) {
1086
- return W(t) ? {
1087
- scrollLeft: t.scrollLeft,
1088
- scrollTop: t.scrollTop
1089
- } : {
1090
- scrollLeft: t.scrollX,
1091
- scrollTop: t.scrollY
1092
- };
1093
- }
1094
- function q(t) {
1095
- if (rt(t) === "html")
1096
- return t;
1097
- const e = (
1098
- // Step into the shadow DOM of the parent of a slotted node.
1099
- t.assignedSlot || // DOM Element detected.
1100
- t.parentNode || // ShadowRoot detected.
1101
- Zt(t) && t.host || // Fallback.
1102
- z(t)
1103
- );
1104
- return Zt(e) ? e.host : e;
1105
- }
1106
- function Oe(t) {
1107
- const e = q(t);
1108
- return ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : $(e) && dt(e) ? e : Oe(e);
1109
- }
1110
- function lt(t, e, n) {
1111
- var o;
1112
- e === void 0 && (e = []), n === void 0 && (n = !0);
1113
- const s = Oe(t), i = s === ((o = t.ownerDocument) == null ? void 0 : o.body), r = k(s);
1114
- if (i) {
1115
- const a = Dt(r);
1116
- return e.concat(r, r.visualViewport || [], dt(s) ? s : [], a && n ? lt(a) : []);
1117
- }
1118
- return e.concat(s, lt(s, [], n));
1119
- }
1120
- function Dt(t) {
1121
- return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1122
- }
1123
- function Ae(t) {
1124
- const e = F(t);
1125
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
1126
- const s = $(t), i = s ? t.offsetWidth : n, r = s ? t.offsetHeight : o, a = wt(n) !== i || wt(o) !== r;
1127
- return a && (n = i, o = r), {
1128
- width: n,
1129
- height: o,
1130
- $: a
1131
- };
1132
- }
1133
- function Ut(t) {
1134
- return W(t) ? t : t.contextElement;
1135
- }
1136
- function tt(t) {
1137
- const e = Ut(t);
1138
- if (!$(e))
1139
- return V(1);
1140
- const n = e.getBoundingClientRect(), {
1141
- width: o,
1142
- height: s,
1143
- $: i
1144
- } = Ae(e);
1145
- let r = (i ? wt(n.width) : n.width) / o, a = (i ? wt(n.height) : n.height) / s;
1146
- return (!r || !Number.isFinite(r)) && (r = 1), (!a || !Number.isFinite(a)) && (a = 1), {
1147
- x: r,
1148
- y: a
1149
- };
1150
- }
1151
- const Mn = /* @__PURE__ */ V(0);
1152
- function Re(t) {
1153
- const e = k(t);
1154
- return !_t() || !e.visualViewport ? Mn : {
1155
- x: e.visualViewport.offsetLeft,
1156
- y: e.visualViewport.offsetTop
1157
- };
1158
- }
1159
- function Nn(t, e, n) {
1160
- return e === void 0 && (e = !1), !n || e && n !== k(t) ? !1 : e;
1161
- }
1162
- function G(t, e, n, o) {
1163
- e === void 0 && (e = !1), n === void 0 && (n = !1);
1164
- const s = t.getBoundingClientRect(), i = Ut(t);
1165
- let r = V(1);
1166
- e && (o ? W(o) && (r = tt(o)) : r = tt(t));
1167
- const a = Nn(i, n, o) ? Re(i) : V(0);
1168
- 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;
1169
- if (i) {
1170
- const g = k(i), f = o && W(o) ? k(o) : o;
1171
- let d = g, y = Dt(d);
1172
- for (; y && o && f !== d; ) {
1173
- const m = tt(y), v = y.getBoundingClientRect(), b = F(y), w = v.left + (y.clientLeft + parseFloat(b.paddingLeft)) * m.x, A = v.top + (y.clientTop + parseFloat(b.paddingTop)) * m.y;
1174
- c *= m.x, l *= m.y, u *= m.x, h *= m.y, c += w, l += A, d = k(y), y = Dt(d);
1175
- }
1176
- }
1177
- return yt({
1178
- width: u,
1179
- height: h,
1180
- x: c,
1181
- y: l
1182
- });
1183
- }
1184
- function Kt(t, e) {
1185
- const n = Ot(t).scrollLeft;
1186
- return e ? e.left + n : G(z(t)).left + n;
1187
- }
1188
- function Ee(t, e, n) {
1189
- n === void 0 && (n = !1);
1190
- const o = t.getBoundingClientRect(), s = o.left + e.scrollLeft - (n ? 0 : (
1191
- // RTL <body> scrollbar.
1192
- Kt(t, o)
1193
- )), i = o.top + e.scrollTop;
1194
- return {
1195
- x: s,
1196
- y: i
1197
- };
1198
- }
1199
- function Vn(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 g = r && !h && !i ? Ee(r, c, !0) : 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 + g.x,
1223
- y: n.y * l.y - c.scrollTop * l.y + u.y + g.y
1224
- };
1225
- }
1226
- function $n(t) {
1227
- return Array.from(t.getClientRects());
1228
- }
1229
- function zn(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 + Kt(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
- function Bn(t, e) {
1241
- const n = k(t), o = z(t), s = n.visualViewport;
1242
- let i = o.clientWidth, r = o.clientHeight, a = 0, c = 0;
1243
- if (s) {
1244
- i = s.width, r = s.height;
1245
- const l = _t();
1246
- (!l || l && e === "fixed") && (a = s.offsetLeft, c = s.offsetTop);
1247
- }
1248
- return {
1249
- width: i,
1250
- height: r,
1251
- x: a,
1252
- y: c
1253
- };
1254
- }
1255
- function _n(t, e) {
1256
- 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;
1257
- return {
1258
- width: r,
1259
- height: a,
1260
- x: c,
1261
- y: l
1262
- };
1263
- }
1264
- function te(t, e, n) {
1265
- let o;
1266
- if (e === "viewport")
1267
- o = Bn(t, n);
1268
- else if (e === "document")
1269
- o = zn(z(t));
1270
- else if (W(e))
1271
- o = _n(e, n);
1272
- else {
1273
- const s = Re(t);
1274
- o = {
1275
- x: e.x - s.x,
1276
- y: e.y - s.y,
1277
- width: e.width,
1278
- height: e.height
1279
- };
1280
- }
1281
- return yt(o);
1282
- }
1283
- function Pe(t, e) {
1284
- const n = q(t);
1285
- return n === e || !W(n) || ot(n) ? !1 : F(n).position === "fixed" || Pe(n, e);
1286
- }
1287
- function Un(t, e) {
1288
- const n = e.get(t);
1289
- if (n)
1290
- return n;
1291
- let o = lt(t, [], !1).filter((a) => W(a) && rt(a) !== "body"), s = null;
1292
- const i = F(t).position === "fixed";
1293
- let r = i ? q(t) : t;
1294
- for (; W(r) && !ot(r); ) {
1295
- const a = F(r), c = Bt(r);
1296
- !c && a.position === "fixed" && (s = null), (i ? !c && !s : !c && a.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || dt(r) && !c && Pe(t, r)) ? o = o.filter((u) => u !== r) : s = a, r = q(r);
1297
- }
1298
- return e.set(t, o), o;
1299
- }
1300
- function Kn(t) {
1301
- let {
1302
- element: e,
1303
- boundary: n,
1304
- rootBoundary: o,
1305
- strategy: s
1306
- } = t;
1307
- const r = [...n === "clippingAncestors" ? St(e) ? [] : Un(e, this._c) : [].concat(n), o], a = r[0], c = r.reduce((l, u) => {
1308
- const h = te(e, u, s);
1309
- 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;
1310
- }, te(e, a, s));
1311
- return {
1312
- width: c.right - c.left,
1313
- height: c.bottom - c.top,
1314
- x: c.left,
1315
- y: c.top
1316
- };
1317
- }
1318
- function jn(t) {
1319
- const {
1320
- width: e,
1321
- height: n
1322
- } = Ae(t);
1323
- return {
1324
- width: e,
1325
- height: n
1326
- };
1327
- }
1328
- function In(t, e, n) {
1329
- const o = $(e), s = z(e), i = n === "fixed", r = G(t, !0, i, e);
1330
- let a = {
1331
- scrollLeft: 0,
1332
- scrollTop: 0
1333
- };
1334
- const c = V(0);
1335
- function l() {
1336
- c.x = Kt(s);
1337
- }
1338
- if (o || !o && !i)
1339
- if ((rt(e) !== "body" || dt(s)) && (a = Ot(e)), o) {
1340
- const f = G(e, !0, i, e);
1341
- c.x = f.x + e.clientLeft, c.y = f.y + e.clientTop;
1342
- } else s && l();
1343
- i && !o && s && l();
1344
- const u = s && !o && !i ? Ee(s, a) : V(0), h = r.left + a.scrollLeft - c.x - u.x, g = r.top + a.scrollTop - c.y - u.y;
1345
- return {
1346
- x: h,
1347
- y: g,
1348
- width: r.width,
1349
- height: r.height
1350
- };
1351
- }
1352
- function Rt(t) {
1353
- return F(t).position === "static";
1354
- }
1355
- function ee(t, e) {
1356
- if (!$(t) || F(t).position === "fixed")
1357
- return null;
1358
- if (e)
1359
- return e(t);
1360
- let n = t.offsetParent;
1361
- return z(t) === n && (n = n.ownerDocument.body), n;
1362
- }
1363
- function Le(t, e) {
1364
- const n = k(t);
1365
- if (St(t))
1366
- return n;
1367
- if (!$(t)) {
1368
- let s = q(t);
1369
- for (; s && !ot(s); ) {
1370
- if (W(s) && !Rt(s))
1371
- return s;
1372
- s = q(s);
1373
- }
1374
- return n;
1375
- }
1376
- let o = ee(t, e);
1377
- for (; o && kn(o) && Rt(o); )
1378
- o = ee(o, e);
1379
- return o && ot(o) && Rt(o) && !Bt(o) ? n : o || Wn(t) || n;
1380
- }
1381
- const Yn = async function(t) {
1382
- const e = this.getOffsetParent || Le, n = this.getDimensions, o = await n(t.floating);
1383
- return {
1384
- reference: In(t.reference, await e(t.floating), t.strategy),
1385
- floating: {
1386
- x: 0,
1387
- y: 0,
1388
- width: o.width,
1389
- height: o.height
1390
- }
1391
- };
1392
- };
1393
- function qn(t) {
1394
- return F(t).direction === "rtl";
1395
- }
1396
- const Xn = {
1397
- convertOffsetParentRelativeRectToViewportRelativeRect: Vn,
1398
- getDocumentElement: z,
1399
- getClippingRect: Kn,
1400
- getOffsetParent: Le,
1401
- getElementRects: Yn,
1402
- getClientRects: $n,
1403
- getDimensions: jn,
1404
- getScale: tt,
1405
- isElement: W,
1406
- isRTL: qn
1407
- };
1408
- function ke(t, e) {
1409
- return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1410
- }
1411
- function Qn(t, e) {
1412
- let n = null, o;
1413
- const s = z(t);
1414
- function i() {
1415
- var a;
1416
- clearTimeout(o), (a = n) == null || a.disconnect(), n = null;
1417
- }
1418
- function r(a, c) {
1419
- a === void 0 && (a = !1), c === void 0 && (c = 1), i();
1420
- const l = t.getBoundingClientRect(), {
1421
- left: u,
1422
- top: h,
1423
- width: g,
1424
- height: f
1425
- } = l;
1426
- if (a || e(), !g || !f)
1427
- return;
1428
- const d = pt(h), y = pt(s.clientWidth - (u + g)), m = pt(s.clientHeight - (h + f)), v = pt(u), w = {
1429
- rootMargin: -d + "px " + -y + "px " + -m + "px " + -v + "px",
1430
- threshold: Q(0, nt(1, c)) || 1
1431
- };
1432
- let A = !0;
1433
- function O(T) {
1434
- const E = T[0].intersectionRatio;
1435
- if (E !== c) {
1436
- if (!A)
1437
- return r();
1438
- E ? r(!1, E) : o = setTimeout(() => {
1439
- r(!1, 1e-7);
1440
- }, 1e3);
1441
- }
1442
- E === 1 && !ke(l, t.getBoundingClientRect()) && r(), A = !1;
1443
- }
1444
- try {
1445
- n = new IntersectionObserver(O, {
1446
- ...w,
1447
- // Handle <iframe>s
1448
- root: s.ownerDocument
1449
- });
1450
- } catch {
1451
- n = new IntersectionObserver(O, w);
1452
- }
1453
- n.observe(t);
1454
- }
1455
- return r(!0), i;
1456
- }
1457
- function Jn(t, e, n, o) {
1458
- o === void 0 && (o = {});
1459
- const {
1460
- ancestorScroll: s = !0,
1461
- ancestorResize: i = !0,
1462
- elementResize: r = typeof ResizeObserver == "function",
1463
- layoutShift: a = typeof IntersectionObserver == "function",
1464
- animationFrame: c = !1
1465
- } = o, l = Ut(t), u = s || i ? [...l ? lt(l) : [], ...lt(e)] : [];
1466
- u.forEach((v) => {
1467
- s && v.addEventListener("scroll", n, {
1468
- passive: !0
1469
- }), i && v.addEventListener("resize", n);
1470
- });
1471
- const h = l && a ? Qn(l, n) : null;
1472
- let g = -1, f = null;
1473
- r && (f = new ResizeObserver((v) => {
1474
- let [b] = v;
1475
- b && b.target === l && f && (f.unobserve(e), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
1476
- var w;
1477
- (w = f) == null || w.observe(e);
1478
- })), n();
1479
- }), l && !c && f.observe(l), f.observe(e));
1480
- let d, y = c ? G(t) : null;
1481
- c && m();
1482
- function m() {
1483
- const v = G(t);
1484
- y && !ke(y, v) && n(), y = v, d = requestAnimationFrame(m);
1485
- }
1486
- return n(), () => {
1487
- var v;
1488
- u.forEach((b) => {
1489
- s && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
1490
- }), h?.(), (v = f) == null || v.disconnect(), f = null, c && cancelAnimationFrame(d);
1491
- };
1492
- }
1493
- const Gn = Rn, Zn = En, ne = Sn, to = bn, eo = (t, e, n) => {
1494
- const o = /* @__PURE__ */ new Map(), s = {
1495
- platform: Xn,
1496
- ...n
1497
- }, i = {
1498
- ...s.platform,
1499
- _c: o
1500
- };
1501
- return xn(t, e, {
1502
- ...s,
1503
- platform: i
521
+ onError: s,
522
+ onSettled: a
1504
523
  });
1505
- }, ko = [
524
+ return ce(r, { content: o });
525
+ }, De = [
1506
526
  "top",
1507
527
  "top-start",
1508
528
  "top-end",
@@ -1515,42 +535,42 @@ const Gn = Rn, Zn = En, ne = Sn, to = bn, eo = (t, e, n) => {
1515
535
  "left",
1516
536
  "left-start",
1517
537
  "left-end"
1518
- ], To = (t, e = { isOpen: !1 }) => {
538
+ ], Ne = (e, t = { isOpen: !1 }) => {
1519
539
  const n = [];
1520
- let o = null;
1521
- const s = C.deriveProp(e.isOpen);
1522
- function i(a) {
1523
- 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);
1524
544
  }
1525
545
  function r() {
1526
- s.set(!1), n.forEach((a) => a()), n.length = 0;
546
+ a.set(!1), n.forEach((i) => i()), n.length = 0;
1527
547
  }
1528
- return Y(
1529
- t(i, r),
1530
- de(
1531
- s,
1532
- () => Y(
1533
- o?.onClickOutside != null ? rn(o.onClickOutside) : null,
1534
- _(
1535
- (a) => fe(
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(
1536
556
  "body",
1537
- Et.div(
1538
- _((c) => {
557
+ V.div(
558
+ L((c) => {
1539
559
  c.style.position = "absolute";
1540
- const l = typeof o?.target == "string" ? a.querySelector(
1541
- o.target
1542
- ) : o?.target ?? a;
1543
- if (l == null)
1544
- throw new Error(`Target not found: ${o?.target}`);
1545
- let u = null;
1546
- const h = C.toSignal(o?.mainAxisOffset ?? 0), g = C.toSignal(
1547
- o?.crossAxisOffset ?? 0
1548
- ), 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(
1549
569
  /* c8 ignore next 3 */
1550
- o?.placement ?? "top"
1551
- ), d = C.toSignal(
1552
- o?.arrowPadding ?? 0
1553
- ), y = o?.arrow, m = M({
570
+ s?.placement ?? "top"
571
+ ), f = y.toSignal(
572
+ s?.arrowPadding ?? 0
573
+ ), E = s?.arrow, m = b({
1554
574
  centerOffset: 0,
1555
575
  alignmentOffset: 0,
1556
576
  containerWidth: 0,
@@ -1558,71 +578,71 @@ const Gn = Rn, Zn = En, ne = Sn, to = bn, eo = (t, e, n) => {
1558
578
  x: void 0,
1559
579
  y: void 0
1560
580
  });
1561
- async function v() {
1562
- const w = [
1563
- ne(),
1564
- Gn({
1565
- mainAxis: h.get(),
1566
- crossAxis: g.get()
581
+ async function S() {
582
+ const g = [
583
+ st(),
584
+ Dt({
585
+ mainAxis: w.get(),
586
+ crossAxis: P.get()
1567
587
  }),
1568
- Zn(),
1569
- ne()
588
+ Nt(),
589
+ st()
1570
590
  ];
1571
- y != null && u != null && w.push(
1572
- to({
1573
- element: u,
1574
- padding: d.get()
591
+ E != null && d != null && g.push(
592
+ Ft({
593
+ element: d,
594
+ padding: f.get()
1575
595
  })
1576
596
  );
1577
- const A = await eo(l, c, {
1578
- placement: f.get(),
597
+ const N = await Ct(u, c, {
598
+ placement: k.get(),
1579
599
  strategy: "absolute",
1580
- middleware: w
1581
- }), { x: O, y: T, middlewareData: E } = A;
1582
- if (c.style.top = `${T}px`, c.style.left = `${O}px`, u != null && E.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) {
1583
603
  const {
1584
- x: U,
1585
- y: p,
1586
- centerOffset: x,
1587
- alignmentOffset: S
1588
- } = E.arrow;
604
+ x: et,
605
+ y: l,
606
+ centerOffset: h,
607
+ alignmentOffset: p
608
+ } = j.arrow;
1589
609
  m.set({
1590
- x: U,
1591
- y: p,
1592
- centerOffset: x,
1593
- alignmentOffset: S,
610
+ x: et,
611
+ y: l,
612
+ centerOffset: h,
613
+ alignmentOffset: p,
1594
614
  containerWidth: c.offsetWidth,
1595
615
  containerHeight: c.offsetHeight
1596
616
  });
1597
617
  }
1598
618
  }
1599
- const b = We(
1600
- h,
1601
- g,
1602
- f
1603
- )(v);
1604
- return Y(
1605
- o?.content,
1606
- o?.arrow != null ? Et.div(
1607
- o?.arrow(
1608
- Mt(
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(
1609
629
  m,
1610
- f
630
+ k
1611
631
  )(
1612
- (w, A) => ({
1613
- ...w,
1614
- placement: A
632
+ (g, N) => ({
633
+ ...g,
634
+ placement: N
1615
635
  })
1616
636
  )
1617
637
  ),
1618
- _((w) => {
1619
- u = w, v();
638
+ L((g) => {
639
+ d = g, S();
1620
640
  })
1621
641
  ) : null,
1622
642
  // arrowSignal is automatically disposed by the scope
1623
- N(
1624
- Jn(l, c, v),
1625
- b
643
+ x(
644
+ Mt(u, c, S),
645
+ O
1626
646
  )
1627
647
  );
1628
648
  })
@@ -1632,86 +652,86 @@ const Gn = Rn, Zn = En, ne = Sn, to = bn, eo = (t, e, n) => {
1632
652
  )
1633
653
  )
1634
654
  );
1635
- }, no = ({
1636
- request: t,
1637
- load: e,
655
+ }, le = ({
656
+ request: e,
657
+ load: t,
1638
658
  convertError: n,
1639
- onSuccess: o,
1640
- onError: s,
1641
- onSettled: i
659
+ onSuccess: s,
660
+ onError: a,
661
+ onSettled: o
1642
662
  }) => {
1643
663
  let r;
1644
- const a = M(R.notAsked), c = a.map(
1645
- (m) => R.isSuccess(m) ? m.value : void 0
1646
- ), l = a.map(
1647
- (m) => R.isFailure(m) ? m.error : void 0
1648
- ), u = a.map((m) => R.isLoading(m)), 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 = () => {
1649
669
  r?.abort(), r = void 0;
1650
- }, g = (m) => {
1651
- h(), a.set(m ?? R.notAsked);
1652
- }, f = async (m) => {
1653
- h(), r = new AbortController();
1654
- const v = r.signal, b = a.get();
1655
- 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)));
1656
676
  try {
1657
- const w = await e({ request: m, abortSignal: v, previous: b });
1658
- await Promise.resolve(), r = void 0, a.set(R.success(w)), o?.(w, m);
1659
- } catch (w) {
1660
- r = void 0, a.set(R.failure(n(w))), s?.(n(w), m);
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);
1661
681
  }
1662
- i?.(a.get(), m);
1663
- }, d = () => f(C.get(t)), y = () => {
1664
- 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();
1665
685
  };
1666
- return a.onDispose(C.on(t, f)), {
1667
- status: a,
686
+ return i.onDispose(y.on(e, k)), {
687
+ status: i,
1668
688
  value: c,
1669
- error: l,
1670
- loading: u,
1671
- cancel: g,
1672
- reload: d,
1673
- dispose: y
689
+ error: u,
690
+ loading: d,
691
+ cancel: P,
692
+ reload: f,
693
+ dispose: E
1674
694
  };
1675
- }, oo = (t, e) => {
1676
- const { status: n, dispose: o, reload: s } = t, { pending: i, failure: r, success: a } = e;
1677
- return Y(
1678
- N(o),
1679
- we(n, {
1680
- loading: i != null ? (c) => i({ previous: c, reload: s, cancel: t.cancel }) : void 0,
1681
- failure: r != null ? (c) => r({ error: c, reload: s }) : void 0,
1682
- 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 })
1683
703
  })
1684
704
  );
1685
- }, Co = ({
1686
- request: t,
1687
- load: e,
1688
- convertError: n = (l) => l,
1689
- onSuccess: o,
1690
- onError: s,
1691
- onSettled: i,
705
+ }, Ce = ({
706
+ request: e,
707
+ load: t,
708
+ convertError: n = (u) => u,
709
+ onSuccess: s,
710
+ onError: a,
711
+ onSettled: o,
1692
712
  success: r,
1693
- pending: a,
713
+ pending: i,
1694
714
  failure: c
1695
715
  }) => {
1696
- const l = no({
1697
- request: t,
1698
- load: e,
716
+ const u = le({
717
+ request: e,
718
+ load: t,
1699
719
  convertError: n,
1700
- onSuccess: o,
1701
- onError: s,
1702
- onSettled: i
720
+ onSuccess: s,
721
+ onError: a,
722
+ onSettled: o
1703
723
  });
1704
- return oo(l, { success: r, pending: a, failure: c });
1705
- }, so = (t, e) => {
1706
- if (typeof e == "function")
1707
- return so(t, { success: e });
1708
- const n = e.failure ?? ((s) => (s.on(console.error), s.map((i) => `Error: ${i}`))), o = e.success;
1709
- return ue(C.toSignal(t), {
1710
- Success: (s) => o(s.$.value),
1711
- 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)
1712
732
  });
1713
- }, Do = () => le.focus((t) => t.target?.select());
1714
- class At {
733
+ }, Fe = () => mt.focus((e) => e.target?.select());
734
+ class $ {
1715
735
  /**
1716
736
  * Creates a new Rect instance.
1717
737
  *
@@ -1729,8 +749,8 @@ class At {
1729
749
  * console.log(rect.height); // 50
1730
750
  * ```
1731
751
  */
1732
- constructor(e, n, o, s, i, r) {
1733
- 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;
1734
754
  }
1735
755
  /**
1736
756
  * Creates a new Rect instance using an object with optional properties.
@@ -1758,14 +778,14 @@ class At {
1758
778
  * ```
1759
779
  */
1760
780
  static of({
1761
- left: e = 0,
781
+ left: t = 0,
1762
782
  top: n = 0,
1763
- width: o = 0,
1764
- height: s = 0,
1765
- localLeft: i = 0,
783
+ width: s = 0,
784
+ height: a = 0,
785
+ localLeft: o = 0,
1766
786
  localTop: r = 0
1767
787
  }) {
1768
- return new At(e, n, o, s, i, r);
788
+ return new $(t, n, s, a, o, r);
1769
789
  }
1770
790
  /**
1771
791
  * Gets the x-coordinate of the right edge of the rectangle.
@@ -1897,107 +917,107 @@ class At {
1897
917
  * console.log(rect1.equals(rect3)); // true (within tolerance)
1898
918
  * ```
1899
919
  */
1900
- equals = (e) => mt(this.left, e.left) && mt(this.top, e.top) && mt(this.width, e.width) && mt(this.height, e.height);
1901
- }
1902
- function oe(t) {
1903
- const e = t.getBoundingClientRect();
1904
- return At.of({
1905
- top: e.top + window.scrollY,
1906
- left: e.left + window.scrollX,
1907
- width: e.width,
1908
- height: e.height,
1909
- localLeft: t.offsetLeft,
1910
- 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
1911
931
  });
1912
932
  }
1913
- const Ho = (t) => Fe((e) => {
1914
- const { element: n } = e, o = M(oe(n), (a, c) => a.equals(c)), s = he(t(o)).render(e), i = () => o.set(At.of(oe(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)));
1915
935
  let r = null;
1916
- return typeof ResizeObserver < "u" && (r = new ResizeObserver(i)), r?.observe(n), N((a) => {
1917
- r?.disconnect(), s(a);
936
+ return typeof ResizeObserver < "u" && (r = new ResizeObserver(o)), r?.observe(n), x((i) => {
937
+ r?.disconnect(), a(i);
1918
938
  });
1919
939
  });
1920
- function se(t) {
940
+ function ut(e) {
1921
941
  return {
1922
942
  /* c8 ignore next 6 */
1923
- width: t?.innerWidth ?? 0,
1924
- height: t?.innerHeight ?? 0
943
+ width: e?.innerWidth ?? 0,
944
+ height: e?.innerHeight ?? 0
1925
945
  };
1926
946
  }
1927
- const Wo = (t) => Me(() => {
1928
- const e = st(), n = M(
1929
- se(e),
1930
- (s, i) => s.width === i.width && s.height === i.height
1931
- ), o = () => n.set(se(e));
1932
- return e?.addEventListener("resize", o), Y(
1933
- N(() => {
1934
- 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);
1935
955
  }),
1936
- t(n)
956
+ e(n)
1937
957
  );
1938
- }), ro = (t, e) => {
1939
- const n = e.split("/").filter((i) => i !== ""), o = (i) => {
958
+ }), de = (e, t) => {
959
+ const n = t.split("/").filter((o) => o !== ""), s = (o) => {
1940
960
  try {
1941
- return decodeURIComponent(i);
961
+ return decodeURIComponent(o);
1942
962
  } catch {
1943
- return i;
963
+ return o;
1944
964
  }
1945
- }, s = {};
1946
- for (let i = 0; i < t.length; i++) {
1947
- const r = t[i], a = n[i];
1948
- 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")
1949
969
  return null;
1950
970
  if (r.type === "literal") {
1951
- if (r.value !== a)
971
+ if (r.value !== i)
1952
972
  return null;
1953
973
  } else if (r.type === "param")
1954
- s[r.name] = o(a);
974
+ a[r.name] = s(i);
1955
975
  else if (r.type === "catch-all") {
1956
976
  if (r.name) {
1957
- const c = n.slice(i).join("/");
1958
- s[r.name] = o(c);
977
+ const c = n.slice(o).join("/");
978
+ a[r.name] = s(c);
1959
979
  }
1960
- return { params: s, path: e };
980
+ return { params: a, path: t };
1961
981
  }
1962
982
  }
1963
- return n.length !== t.length ? null : { params: s, path: e };
1964
- }, Te = (t) => t.split("/").map((e) => {
1965
- if (e.startsWith(":"))
1966
- return { type: "param", name: e.slice(1) };
1967
- if (e.startsWith("*")) {
1968
- 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);
1969
989
  return n != "" ? { type: "catch-all", name: n } : { type: "catch-all" };
1970
990
  } else
1971
- return { type: "literal", value: e };
1972
- }).filter((e) => e.type !== "literal" || e.value !== ""), Fo = (t) => {
1973
- const e = t.map((n) => {
1974
- const o = Te(n);
1975
- 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 };
1976
996
  });
1977
- return function(o) {
1978
- for (const { segments: s, route: i } of e) {
1979
- const r = ro(s, o);
997
+ return function(s) {
998
+ for (const { segments: a, route: o } of t) {
999
+ const r = de(a, s);
1980
1000
  if (r)
1981
- return { ...r, route: i };
1001
+ return { ...r, route: o };
1982
1002
  }
1983
1003
  return null;
1984
1004
  };
1985
- }, io = (t) => {
1986
- if (t == null)
1005
+ }, pe = (e) => {
1006
+ if (e == null)
1987
1007
  throw new Error(
1988
1008
  "NavigationService: no Location handle attached. Make sure to attach one before calling navigation helpers."
1989
1009
  );
1990
- return t;
1010
+ return e;
1991
1011
  };
1992
- class ao {
1012
+ class fe {
1993
1013
  handles = [];
1994
- attach(e) {
1995
- const n = this.handles.lastIndexOf(e);
1996
- 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);
1997
1017
  }
1998
- detach(e) {
1018
+ detach(t) {
1999
1019
  for (let n = this.handles.length - 1; n >= 0; n--)
2000
- if (this.handles[n] === e) {
1020
+ if (this.handles[n] === t) {
2001
1021
  this.handles.splice(n, 1);
2002
1022
  break;
2003
1023
  }
@@ -2006,291 +1026,291 @@ class ao {
2006
1026
  return this.handles[this.handles.length - 1];
2007
1027
  }
2008
1028
  getHandle() {
2009
- return io(this.current);
1029
+ return pe(this.current);
2010
1030
  }
2011
- navigate(e, n) {
2012
- this.getHandle().navigate(e, n);
1031
+ navigate(t, n) {
1032
+ this.getHandle().navigate(t, n);
2013
1033
  }
2014
- replace(e, n) {
2015
- this.getHandle().replace(e, n);
1034
+ replace(t, n) {
1035
+ this.getHandle().replace(t, n);
2016
1036
  }
2017
- go(e, n) {
2018
- this.getHandle().go(e, n);
1037
+ go(t, n) {
1038
+ this.getHandle().go(t, n);
2019
1039
  }
2020
- back(e) {
2021
- this.getHandle().back(e);
1040
+ back(t) {
1041
+ this.getHandle().back(t);
2022
1042
  }
2023
- forward(e) {
2024
- this.getHandle().forward(e);
1043
+ forward(t) {
1044
+ this.getHandle().forward(t);
2025
1045
  }
2026
- setPathname(e, n) {
2027
- this.getHandle().setPathname(e, n);
1046
+ setPathname(t, n) {
1047
+ this.getHandle().setPathname(t, n);
2028
1048
  }
2029
- setSearch(e, n) {
2030
- this.getHandle().setSearch(e, n);
1049
+ setSearch(t, n) {
1050
+ this.getHandle().setSearch(t, n);
2031
1051
  }
2032
- setSearchParam(e, n, o) {
2033
- this.getHandle().setSearchParam(e, n, o);
1052
+ setSearchParam(t, n, s) {
1053
+ this.getHandle().setSearchParam(t, n, s);
2034
1054
  }
2035
- updateSearch(e, n) {
2036
- this.getHandle().updateSearch(e, n);
1055
+ updateSearch(t, n) {
1056
+ this.getHandle().updateSearch(t, n);
2037
1057
  }
2038
- setHash(e, n) {
2039
- this.getHandle().setHash(e, n);
1058
+ setHash(t, n) {
1059
+ this.getHandle().setHash(t, n);
2040
1060
  }
2041
- clearHash(e) {
2042
- this.getHandle().clearHash(e);
1061
+ clearHash(t) {
1062
+ this.getHandle().clearHash(t);
2043
1063
  }
2044
- run(e, n) {
2045
- this.getHandle().run(e, n);
1064
+ run(t, n) {
1065
+ this.getHandle().run(t, n);
2046
1066
  }
2047
1067
  }
2048
- const Mo = new ao(), Ht = {
2049
- mark: Ft("RouterContext"),
1068
+ const Ve = new fe(), q = {
1069
+ mark: Q("RouterContext"),
2050
1070
  create: () => {
2051
- const t = M([]);
1071
+ const e = b([]);
2052
1072
  return {
2053
- value: t,
2054
- dispose: () => t.dispose()
1073
+ value: e,
1074
+ dispose: () => e.dispose()
2055
1075
  };
2056
1076
  }
2057
- }, co = (t, e, n) => {
2058
- const o = n.split("/").filter((r) => r !== ""), s = {};
2059
- let i = 0;
2060
- for (let r = 0; r < t.length; r++) {
2061
- const a = t[r], c = o[r];
2062
- 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")
2063
1083
  return null;
2064
- if (a.type === "literal") {
2065
- if (a.value !== c)
1084
+ if (i.type === "literal") {
1085
+ if (i.value !== c)
2066
1086
  return null;
2067
- i++;
2068
- } else if (a.type === "param")
2069
- s[a.name] = c, i++;
2070
- else if (a.type === "catch-all") {
2071
- a.name && (s[a.name] = o.slice(i).join("/"));
2072
- 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("/");
2073
1093
  return {
2074
- params: s,
2075
- matchedPath: l === "/" ? "" : l,
2076
- remainingPath: u === "/" ? "" : u,
2077
- route: e
1094
+ params: a,
1095
+ matchedPath: u === "/" ? "" : u,
1096
+ remainingPath: d === "/" ? "" : d,
1097
+ route: t
2078
1098
  };
2079
1099
  }
2080
1100
  }
2081
- if (o.length === t.length) {
2082
- const r = "/" + o.join("/");
1101
+ if (s.length === e.length) {
1102
+ const r = "/" + s.join("/");
2083
1103
  return {
2084
- params: s,
1104
+ params: a,
2085
1105
  matchedPath: r === "/" ? "" : r,
2086
1106
  remainingPath: "",
2087
- route: e
1107
+ route: t
2088
1108
  };
2089
1109
  }
2090
1110
  return null;
2091
- }, Ce = (t) => {
2092
- const e = t.map((n) => {
2093
- const o = Te(n);
2094
- 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 };
2095
1115
  });
2096
- return function(o) {
2097
- for (const { segments: s, route: i } of e) {
2098
- const r = co(s, i, o);
1116
+ return function(s) {
1117
+ for (const { segments: a, route: o } of t) {
1118
+ const r = me(a, o, s);
2099
1119
  if (r)
2100
1120
  return r;
2101
1121
  }
2102
1122
  return null;
2103
1123
  };
2104
- }, No = (t) => {
2105
- const e = Ce(Object.keys(t));
2106
- return Ne(
2107
- Ht,
1124
+ }, _e = (e) => {
1125
+ const t = Ot(Object.keys(e));
1126
+ return Tt(
1127
+ q,
2108
1128
  {},
2109
- () => ct(Vt, (n) => ct(Ht, (o) => {
2110
- const s = n.location.map((i) => {
2111
- 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);
2112
1132
  if (r == null)
2113
- throw console.error("No route found for", i), new Error("No route found");
2114
- const a = {
1133
+ throw console.error("No route found for", o), new Error("No route found");
1134
+ const i = {
2115
1135
  matchedPath: r.matchedPath,
2116
1136
  remainingPath: r.remainingPath,
2117
- fullPath: i.pathname,
1137
+ fullPath: o.pathname,
2118
1138
  params: r.params
2119
1139
  };
2120
- return o.value = [...o.value, a], {
1140
+ return s.value = [...s.value, i], {
2121
1141
  params: r.params,
2122
1142
  route: r.route,
2123
- path: r.matchedPath || i.pathname,
2124
- search: i.search,
2125
- hash: i.hash
1143
+ path: r.matchedPath || o.pathname,
1144
+ search: o.search,
1145
+ hash: o.hash
2126
1146
  };
2127
1147
  });
2128
- return me(
2129
- s.map((i) => [i.route, i]),
1148
+ return St(
1149
+ a.map((o) => [o.route, o]),
2130
1150
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2131
- t
1151
+ e
2132
1152
  );
2133
1153
  }))
2134
1154
  );
2135
- }, Vo = (t) => {
2136
- const e = Ce(Object.keys(t));
2137
- return ct(Ht, (n) => ct(Vt, (o) => {
2138
- const s = n.map((i) => {
2139
- 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];
2140
1160
  if (r == null)
2141
- throw console.error("No router context available for ChildRouter", i), new Error("No router context available for ChildRouter");
2142
- 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);
2143
1163
  if (c == null)
2144
- 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");
2145
1165
  return {
2146
1166
  params: c.params,
2147
1167
  // Only this router's parameters
2148
1168
  route: c.route,
2149
1169
  path: c.matchedPath,
2150
- search: o.location.value.search,
2151
- hash: o.location.value.hash
1170
+ search: s.location.value.search,
1171
+ hash: s.location.value.hash
2152
1172
  };
2153
1173
  });
2154
- return me(
2155
- s.map((i) => [i.route, i]),
1174
+ return St(
1175
+ a.map((o) => [o.route, o]),
2156
1176
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2157
- t
1177
+ e
2158
1178
  );
2159
1179
  }));
2160
- }, xt = 60 * 1e3, Wt = 60 * xt, ut = 24 * Wt, re = 7 * ut, ie = 30 * ut, lo = 365 * ut, uo = [
1180
+ }, z = 60 * 1e3, Y = 60 * z, D = 24 * Y, ht = 7 * D, dt = 30 * D, ge = 365 * D, ve = [
2161
1181
  {
2162
- max: xt * 90,
2163
- value: xt,
1182
+ max: z * 90,
1183
+ value: z,
2164
1184
  name: "minute",
2165
1185
  past: { singular: "a minute ago", plural: "{} minutes ago" },
2166
1186
  future: { singular: "in a minute", plural: "in {} minutes" }
2167
1187
  },
2168
1188
  {
2169
- max: Wt * 36,
2170
- value: Wt,
1189
+ max: Y * 36,
1190
+ value: Y,
2171
1191
  name: "hour",
2172
1192
  past: { singular: "an hour ago", plural: "{} hours ago" },
2173
1193
  future: { singular: "in an hour", plural: "in {} hours" }
2174
1194
  },
2175
1195
  {
2176
- max: ut * 10,
2177
- value: ut,
1196
+ max: D * 10,
1197
+ value: D,
2178
1198
  name: "day",
2179
1199
  past: { singular: "yesterday", plural: "{} days ago" },
2180
1200
  future: { singular: "tomorrow", plural: "in {} days" }
2181
1201
  },
2182
1202
  {
2183
- max: re * 6,
2184
- value: re,
1203
+ max: ht * 6,
1204
+ value: ht,
2185
1205
  name: "week",
2186
1206
  past: { singular: "last week", plural: "{} weeks ago" },
2187
1207
  future: { singular: "in a week", plural: "in {} weeks" }
2188
1208
  },
2189
1209
  {
2190
- max: ie * 18,
2191
- value: ie,
1210
+ max: dt * 18,
1211
+ value: dt,
2192
1212
  name: "month",
2193
1213
  past: { singular: "last month", plural: "{} months ago" },
2194
1214
  future: { singular: "in a month", plural: "in {} months" }
2195
1215
  },
2196
1216
  {
2197
1217
  max: 1 / 0,
2198
- value: lo,
1218
+ value: ge,
2199
1219
  name: "year",
2200
1220
  past: { singular: "last year", plural: "{} years ago" },
2201
1221
  future: { singular: "in a year", plural: "in {} years" }
2202
1222
  }
2203
1223
  ];
2204
- function ae(t, e, n, o) {
2205
- const s = Math.round(t / e);
2206
- 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(
2207
1227
  "{}",
2208
- s.toLocaleString(void 0, {
1228
+ a.toLocaleString(void 0, {
2209
1229
  maximumFractionDigits: 0,
2210
1230
  minimumFractionDigits: 0
2211
1231
  })
2212
1232
  );
2213
1233
  }
2214
- const fo = (t = 1e3) => {
2215
- const e = M(/* @__PURE__ */ new Date()), n = $e(() => e.set(/* @__PURE__ */ new Date()), t);
2216
- return e.onDispose(n), e;
2217
- }, ho = (t) => {
2218
- const e = Math.abs(t);
2219
- if (e < xt)
2220
- return t < 0 ? "just now" : "in a moment";
2221
- for (const n of uo)
2222
- if (e < n.max)
2223
- return t < 0 ? ae(e, n.value, n.past.singular, n.past.plural) : ae(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);
2224
1244
  throw new Error("unreachable");
2225
- }, mo = (t, { now: e, frequency: n = 1e4 } = {}) => {
2226
- const o = e != null ? ce.is(e) ? e.derive() : M(e) : fo(n), s = Mt(
2227
- t,
2228
- o
2229
- )((i, r) => i.getTime() - r.getTime());
2230
- return s.onDispose(() => C.dispose(o)), s;
2231
- }, po = (t, e = {}) => {
2232
- const n = mo(t, e), o = n.map(ho);
2233
- return o.onDispose(n.dispose), o;
2234
- }, $o = (t, e = {}) => po(t, e);
2235
- class go 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 {
2236
1256
  /**
2237
1257
  * Triggers an update of the Ticker by incrementing its internal value.
2238
1258
  * @returns void
2239
1259
  */
2240
- tick = () => this.update((e) => e + 1);
1260
+ tick = () => this.update((t) => t + 1);
2241
1261
  }
2242
- const zo = (t = 0) => new go(t, (e, n) => e === n);
1262
+ const qe = (e = 0) => new xe(e, Ut);
2243
1263
  export {
2244
- tn as Anchor,
2245
- yo as Appearance,
2246
- we as AsyncResultView,
2247
- xo as AutoFocus,
2248
- bo as AutoSelect,
2249
- Vo as ChildRouter,
2250
- Ho as ElementRect,
2251
- Ao as HTMLTitle,
2252
- Oo as HiddenWhenEmpty,
2253
- sn as InViewport,
2254
- Vt as Location,
2255
- Lo as Mutation,
2256
- ln as MutationDisplay,
2257
- Mo as NavigationService,
2258
- rn as OnClickOutside,
2259
- Eo as OnEnterKey,
2260
- Po as OnEscapeKey,
2261
- ve as OnKeyPressed,
2262
- To as PopOver,
2263
- Co as Query,
2264
- oo as QueryDisplay,
2265
- At as Rect,
2266
- so as ResultView,
2267
- No as RootRouter,
2268
- Ht as RouterContextProvider,
2269
- Do as SelectOnFocus,
2270
- go as Ticker,
2271
- Ro as WhenInViewport,
2272
- Wo as WindowSize,
2273
- Be as _checkExtensionCondition,
2274
- ze as _getExtension,
2275
- Fo as _makeRouteMatcher,
2276
- Te as _parseRouteSegments,
2277
- ko as allPlacements,
2278
- Ke as areLocationsEqual,
2279
- So as classes,
2280
- qt as evaluateLocationMatch,
2281
- oe as getAbsoluteRect,
2282
- Ue as handleAnchorClick,
2283
- Lt as locationFromURL,
2284
- cn as makeMutationResource,
2285
- no as makeQueryResource,
2286
- an as matchesKeyCombo,
2287
- ro as matchesRoute,
2288
- fo as nowSignal,
2289
- $o as relativeTime,
2290
- mo as relativeTimeMillisSignal,
2291
- po as relativeTimeSignal,
2292
- zo as ticker,
2293
- ho as timeDiffToString,
2294
- et as urlFromLocation,
2295
- 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
2296
1316
  };