@voltro/web 0.50.1 → 0.52.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.
@@ -1,63 +1,107 @@
1
- import { t as e } from "./globalContext-d4A-ugDg.js";
2
- import { l as t, n, t as r } from "./defaultFallbacks-B4Ak-R6R.js";
1
+ import { t as e } from "./globalContext-AuflFFmy.js";
2
+ import { l as t, n, t as r } from "./defaultFallbacks-SQ45vAhz.js";
3
3
  import { f as i, i as a } from "./routerState-DAT472IC.js";
4
4
  import { Component as o, useCallback as s, useContext as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
5
+ import { useServerRequest as ee } from "@voltro/client";
5
6
  import { jsx as p, jsxs as m } from "react/jsx-runtime";
7
+ import { flushSync as h } from "react-dom";
8
+ import { Either as g, Schema as _ } from "effect";
6
9
  //#region src/routeEventBus.ts
7
- var h = {
10
+ var v = {
8
11
  pathname: "/",
9
12
  params: {},
10
13
  loaderData: void 0
11
- }, g = /* @__PURE__ */ new Set(), ee = (e) => {
12
- h = e;
13
- for (let e of g) e();
14
- }, _ = () => h, v = (e) => (g.add(e), () => {
15
- g.delete(e);
16
- }), y = class extends Error {
14
+ }, y = /* @__PURE__ */ new Set(), te = (e) => {
15
+ v = e;
16
+ for (let e of y) e();
17
+ }, ne = () => v, b = (e) => (y.add(e), () => {
18
+ y.delete(e);
19
+ }), x = class extends Error {
17
20
  _voltroControl = "not-found";
18
21
  constructor(e) {
19
22
  super(e ? `Not found: ${e}` : "Not found"), this.name = "NotFoundError";
20
23
  }
21
- }, b = class extends Error {
24
+ }, S = class extends Error {
22
25
  _voltroControl = "redirect";
23
26
  location;
24
27
  status;
25
28
  constructor(e, t) {
26
29
  super(`Redirect: ${e}`), this.name = "RedirectError", this.location = e, this.status = t?.status ?? 303;
27
30
  }
28
- }, x = (e) => {
29
- throw new y(e);
30
- }, S = (e, t) => {
31
- throw new b(e, t);
32
- }, te = (e) => e instanceof Error && e._voltroControl === "not-found", C = (e) => e instanceof Error && e._voltroControl === "redirect" && typeof e.location == "string", ne = [
31
+ }, C = (e) => {
32
+ throw new x(e);
33
+ }, w = (e, t) => {
34
+ throw new S(e, t);
35
+ }, re = (e) => e instanceof Error && e._voltroControl === "not-found", T = (e) => e instanceof Error && e._voltroControl === "redirect" && typeof e.location == "string", E = (e, t) => {
36
+ let n = {};
37
+ for (let [r, i] of e.entries()) {
38
+ let e = n[r];
39
+ e === void 0 ? n[r] = t?.arrayKeys?.has(r) ? [i] : i : Array.isArray(e) ? e.push(i) : n[r] = [e, i];
40
+ }
41
+ return n;
42
+ }, D = (e, t) => {
43
+ if (t <= 0) return !1;
44
+ let n = e;
45
+ return n._tag === "TupleType" && (n.rest?.length ?? 0) > 0 ? !0 : n._tag === "Union" ? (n.types ?? []).some((e) => D(e, t - 1)) : n._tag === "Transformation" || n._tag === "Refinement" ? n.from !== void 0 && D(n.from, t - 1) || n.to !== void 0 && D(n.to, t - 1) : !1;
46
+ }, O = (e) => {
47
+ let t = e.ast;
48
+ for (let e = 0; e < 3 && t._tag === "Transformation"; e++) t = t.from;
49
+ let n = /* @__PURE__ */ new Set();
50
+ if (t._tag !== "TypeLiteral") return n;
51
+ for (let e of t.propertySignatures) D(e.type, 6) && n.add(String(e.name));
52
+ return n;
53
+ }, k = (e, t) => {
54
+ let n = _.decodeUnknownEither(e), r = n(E(t, { arrayKeys: O(e) }));
55
+ if (g.isRight(r)) return r.right;
56
+ let i = n({});
57
+ if (g.isRight(i)) return i.right;
58
+ throw Error("searchParams schema could not decode an EMPTY query — every field must be optional or carry a default (Schema.optionalWith(..., { default })). An invalid query string falls back to these defaults instead of crashing the render, so a schema without them has no total answer.", { cause: i.left });
59
+ }, A = (e) => {
60
+ let t = new URLSearchParams(), n = (e, n) => {
61
+ if (n != null) switch (typeof n) {
62
+ case "string":
63
+ t.append(e, n);
64
+ return;
65
+ case "number":
66
+ case "boolean":
67
+ case "bigint":
68
+ t.append(e, String(n));
69
+ return;
70
+ default: throw Error(`withQuery: search param "${e}" is a ${typeof n} — a link encodes only strings, numbers, booleans and arrays of those. A Date (or object) has no canonical URL form; declare the field as a string/number transform in the page's searchParams schema and pass that.`);
71
+ }
72
+ };
73
+ for (let [t, r] of Object.entries(e)) if (Array.isArray(r)) for (let e of r) n(t, e);
74
+ else n(t, r);
75
+ return t;
76
+ }, j = [
33
77
  "static",
34
78
  "spa",
35
79
  "ssr",
36
80
  "isr"
37
- ], w = 0, re = 1, T = 2, E = 3, D = (e) => e.startsWith("[[...") && e.endsWith("]]") ? {
81
+ ], M = 0, N = 1, P = 2, F = 3, ie = (e) => e.startsWith("[[...") && e.endsWith("]]") ? {
38
82
  source: "(.*)",
39
83
  paramName: e.slice(5, -2),
40
- weight: T
84
+ weight: P
41
85
  } : e.startsWith("[...") && e.endsWith("]") ? {
42
86
  source: "(.+)",
43
87
  paramName: e.slice(4, -1),
44
- weight: E
88
+ weight: F
45
89
  } : e.startsWith("[") && e.endsWith("]") ? {
46
90
  source: "([^/]+)",
47
91
  paramName: e.slice(1, -1),
48
- weight: re
92
+ weight: N
49
93
  } : {
50
94
  source: e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
51
95
  paramName: null,
52
- weight: w
53
- }, ie = (e) => {
54
- let t = e.pattern.split("/").map(D);
96
+ weight: M
97
+ }, ae = (e) => {
98
+ let t = e.pattern.split("/").map(ie);
55
99
  for (let n = 0; n < t.length - 1; n++) {
56
100
  let r = t[n];
57
- if (r.weight === E || r.weight === T) throw Error(`Route ${JSON.stringify(e.pattern)}: catch-all segment must be last. Anything after a catch-all is unreachable.`);
101
+ if (r.weight === F || r.weight === P) throw Error(`Route ${JSON.stringify(e.pattern)}: catch-all segment must be last. Anything after a catch-all is unreachable.`);
58
102
  }
59
103
  let n, r = t[t.length - 1];
60
- n = r && r.weight === T ? `${t.slice(0, -1).map((e) => e.source).join("/")}(?:/(.*))?` : t.map((e) => e.source).join("/");
104
+ n = r && r.weight === P ? `${t.slice(0, -1).map((e) => e.source).join("/")}(?:/(.*))?` : t.map((e) => e.source).join("/");
61
105
  let i = t.map((e) => e.paramName).filter((e) => e !== null), a = t.reduce((e, t) => e + t.weight, 0);
62
106
  return {
63
107
  ...e,
@@ -65,11 +109,11 @@ var h = {
65
109
  paramNames: i,
66
110
  priority: a
67
111
  };
68
- }, ae = (e) => [...e].map((e, t) => ({
112
+ }, oe = (e) => [...e].map((e, t) => ({
69
113
  route: e,
70
114
  index: t
71
- })).sort((e, t) => e.route.priority === t.route.priority ? e.index - t.index : e.route.priority - t.route.priority).map(({ route: e }) => e), O = (e, t) => {
72
- let n = ae(e);
115
+ })).sort((e, t) => e.route.priority === t.route.priority ? e.index - t.index : e.route.priority - t.route.priority).map(({ route: e }) => e), I = (e, t) => {
116
+ let n = oe(e);
73
117
  for (let e of n) {
74
118
  let n = e.regex.exec(t);
75
119
  if (n) {
@@ -85,23 +129,23 @@ var h = {
85
129
  }
86
130
  }
87
131
  return null;
88
- }, oe = (e, t, n) => k(`${e}__seg${t}`, n), k = (e, t) => `${e}\u0000${Object.entries(t).sort(([e], [t]) => e < t ? -1 : 1).map(([e, t]) => `${e}=${t}`).join("")}`, se = (e, t) => {
132
+ }, se = (e, t, n) => L(`${e}__seg${t}`, n), L = (e, t) => `${e}\u0000${Object.entries(t).sort(([e], [t]) => e < t ? -1 : 1).map(([e, t]) => `${e}=${t}`).join("")}`, ce = (e, t) => {
89
133
  let n = e(t);
90
134
  return n instanceof Promise ? n.then(i) : i(n);
91
- }, ce = (e, t, n, r) => e === void 0 ? null : typeof e == "function" ? e({
135
+ }, le = (e, t, n, r) => e === void 0 ? null : typeof e == "function" ? e({
92
136
  params: t,
93
137
  loaderData: n,
94
138
  locale: r ?? "en"
95
- }) : e, le = (e, t) => {
139
+ }) : e, ue = (e, t) => {
96
140
  let n = null, r = -1;
97
141
  for (let i of e) (i.prefix === "" || t === i.prefix || t.startsWith(`${i.prefix}/`)) && i.prefix.length > r && (n = i, r = i.prefix.length);
98
142
  return n;
99
- }, ue = (e, t, n) => {
143
+ }, de = (e, t, n) => {
100
144
  if (e) for (let r = n; r >= 0; r--) {
101
145
  let n = e[r]?.[t];
102
146
  if (n !== void 0) return n;
103
147
  }
104
- }, de = class {
148
+ }, fe = class {
105
149
  entries = /* @__PURE__ */ new Map();
106
150
  get(e) {
107
151
  return this.entries.get(e);
@@ -149,63 +193,63 @@ var h = {
149
193
  clear() {
150
194
  this.entries.clear();
151
195
  }
152
- }, A = { kind: "native" }, fe = (e, t) => {
153
- if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return A;
196
+ }, R = { kind: "native" }, pe = (e, t) => {
197
+ if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return R;
154
198
  let n = e.target, r = n instanceof Element ? n.closest("a") : null;
155
- if (!r) return A;
199
+ if (!r) return R;
156
200
  let i = r.getAttribute("href");
157
- if (i === null) return A;
201
+ if (i === null) return R;
158
202
  let a = r.getAttribute("target");
159
- if (a && a !== "_self" || r.hasAttribute("download") || r.hasAttribute("data-no-spa")) return A;
203
+ if (a && a !== "_self" || r.hasAttribute("download") || r.hasAttribute("data-no-spa")) return R;
160
204
  let o = r.getAttribute("rel");
161
- if (o && /(^|\s)external(\s|$)/i.test(o)) return A;
205
+ if (o && /(^|\s)external(\s|$)/i.test(o)) return R;
162
206
  let s, c;
163
207
  try {
164
208
  c = new URL(t), s = new URL(i, c);
165
209
  } catch {
166
- return A;
210
+ return R;
167
211
  }
168
- return s.origin !== c.origin || s.pathname === c.pathname && s.search === c.search && s.hash !== "" ? A : {
212
+ return s.origin !== c.origin || s.pathname === c.pathname && s.search === c.search && s.hash !== "" ? R : {
169
213
  kind: "spa",
170
214
  to: s.pathname + s.search + s.hash
171
215
  };
172
- }, j = (e) => {
216
+ }, z = (e) => {
173
217
  let t = e.replace(/^#/, "");
174
218
  try {
175
219
  return decodeURIComponent(t);
176
220
  } catch {
177
221
  return t;
178
222
  }
179
- }, M = (e) => {
180
- let t = j(e);
223
+ }, me = (e) => {
224
+ let t = z(e);
181
225
  return t ? document.getElementById(t) ?? document.getElementsByName(t)[0] ?? null : null;
182
- }, pe = (e) => {
226
+ }, he = (e) => {
183
227
  if (typeof window.requestAnimationFrame == "function") {
184
228
  window.requestAnimationFrame(e);
185
229
  return;
186
230
  }
187
231
  window.setTimeout(e, 0);
188
- }, me = (e) => {
232
+ }, ge = (e) => {
189
233
  if (!e.hash) {
190
234
  window.scrollTo(0, 0);
191
235
  return;
192
236
  }
193
- pe(() => {
194
- let t = M(e.hash);
237
+ he(() => {
238
+ let t = me(e.hash);
195
239
  if (t) {
196
240
  t.scrollIntoView();
197
241
  return;
198
242
  }
199
243
  window.scrollTo(0, 0);
200
244
  });
201
- }, N = 0, he = () => {
245
+ }, B = 0, _e = () => {
202
246
  let e = typeof crypto < "u" ? crypto : void 0;
203
- return e && typeof e.randomUUID == "function" ? e.randomUUID() : (N += 1, `k${Date.now().toString(36)}-${N}`);
204
- }, P = e("router", null), F = () => {
205
- let e = c(P);
247
+ return e && typeof e.randomUUID == "function" ? e.randomUUID() : (B += 1, `k${Date.now().toString(36)}-${B}`);
248
+ }, V = e("router", null), H = () => {
249
+ let e = c(V);
206
250
  if (!e) throw Error("Router hooks must be used inside <Router>.");
207
251
  return e;
208
- }, I = Symbol.for("@voltro/web/loaderData:absent"), L = e("loaderData", I), ge = (e, t) => {
252
+ }, U = Symbol.for("@voltro/web/loaderData:absent"), W = e("loaderData", U), ve = (e, t) => {
209
253
  if (!e || e.pathname !== t) return;
210
254
  let n = {};
211
255
  for (let [t, r] of e.segments) n[t] = r;
@@ -213,16 +257,16 @@ var h = {
213
257
  page: e.page,
214
258
  segments: n
215
259
  };
216
- }, _e = (e, t) => {
260
+ }, ye = (e, t) => {
217
261
  if (e === t) return !0;
218
262
  if (!e || !t || !Object.is(e.page, t.page)) return !1;
219
263
  let n = Object.keys(e.segments), r = Object.keys(t.segments);
220
264
  return n.length === r.length && n.every((n) => Object.is(e.segments[Number(n)], t.segments[Number(n)]));
221
- }, ve = () => {
265
+ }, be = () => {
222
266
  if (typeof document > "u") return;
223
267
  let e = document.cookie.match(/(?:^|;\s*)voltro:locale=([^;]*)/);
224
268
  return e ? decodeURIComponent(e[1]) : void 0;
225
- }, ye = (e) => {
269
+ }, xe = (e) => {
226
270
  if (e === null || typeof document > "u") return () => {};
227
271
  let t = document.title, n = [], r = [], i = [], a = [], o = [];
228
272
  typeof e.title == "string" && (document.title = e.title);
@@ -257,7 +301,7 @@ var h = {
257
301
  }
258
302
  if (e.jsonLd) for (let t of e.jsonLd) {
259
303
  let e = document.createElement("script");
260
- e.type = "application/ld+json", e.setAttribute("data-voltro-page-jsonld", ""), e.textContent = be(t), document.head.appendChild(e), o.push(e);
304
+ e.type = "application/ld+json", e.setAttribute("data-voltro-page-jsonld", ""), e.textContent = Se(t), document.head.appendChild(e), o.push(e);
261
305
  }
262
306
  return () => {
263
307
  document.title = t;
@@ -267,7 +311,7 @@ var h = {
267
311
  for (let { el: e, previous: t } of r) e.content = t;
268
312
  for (let { el: e, previous: t } of a) e.href = t;
269
313
  };
270
- }, be = (e) => JSON.stringify(e).replace(/<\/(script)/gi, "<\\/$1").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"), xe = class extends o {
314
+ }, Se = (e) => JSON.stringify(e).replace(/<\/(script)/gi, "<\\/$1").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"), Ce = class extends o {
271
315
  state = { error: null };
272
316
  static getDerivedStateFromError(e) {
273
317
  return { error: e };
@@ -291,10 +335,19 @@ var h = {
291
335
  }
292
336
  return this.props.children;
293
337
  }
294
- }, Se = "data-voltro-page-slot", Ce = () => /* @__PURE__ */ p("div", { [Se]: "" }), R = ({ routes: e, notFounds: i = [], notFound: o = n, errorFallback: c = r }) => {
295
- let [m, h] = f(() => window.location.pathname), [g, _] = f(() => window.location.pathname), [v, y] = f(() => window.location.search + window.location.hash), b = v.split("#")[0] ?? "", x = d(new de()), S = d(/* @__PURE__ */ new Map()), [ne, w] = f(null), re = s((e, t) => (S.current.set(e, t), () => {
296
- S.current.delete(e);
297
- }), []), T = d(/* @__PURE__ */ new Map()), E = d(null), D = u(() => ae(e.map(ie)), [e]);
338
+ }, G = "data-voltro-page-slot", we = () => /* @__PURE__ */ p("div", { [G]: "" }), Te = (e) => {
339
+ let t = document;
340
+ if (typeof t.startViewTransition != "function" || typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
341
+ e();
342
+ return;
343
+ }
344
+ t.startViewTransition(() => {
345
+ h(e);
346
+ });
347
+ }, K = ({ routes: e, notFounds: i = [], notFound: o = n, errorFallback: c = r, viewTransitions: ee = !1 }) => {
348
+ let [m, h] = f(() => window.location.pathname), [g, _] = f(() => window.location.pathname), [v, y] = f(() => window.location.search + window.location.hash), ne = v.split("#")[0] ?? "", b = d(new fe()), x = d(/* @__PURE__ */ new Map()), [S, C] = f(null), w = d(void 0), E = s((e, t) => (x.current.set(e, t), () => {
349
+ x.current.delete(e);
350
+ }), []), D = d(/* @__PURE__ */ new Map()), O = d(null), k = u(() => oe(e.map(ae)), [e]);
298
351
  l(() => {
299
352
  if (typeof window > "u") return;
300
353
  let e = window.history.scrollRestoration;
@@ -303,7 +356,7 @@ var h = {
303
356
  } catch {}
304
357
  return window.history.state?.__vwebKey || window.history.replaceState({
305
358
  ...window.history.state,
306
- __vwebKey: he()
359
+ __vwebKey: _e()
307
360
  }, ""), () => {
308
361
  try {
309
362
  window.history.scrollRestoration = e;
@@ -313,35 +366,35 @@ var h = {
313
366
  let A = () => window.history.state?.__vwebKey ?? "initial";
314
367
  l(() => {
315
368
  let e = () => {
316
- let e = T.current.get(A());
317
- E.current = e ?? {
369
+ let e = D.current.get(A());
370
+ O.current = e ?? {
318
371
  x: 0,
319
372
  y: 0
320
- }, h(window.location.pathname), y(window.location.search + window.location.hash);
373
+ }, w.current = void 0, h(window.location.pathname), y(window.location.search + window.location.hash);
321
374
  };
322
375
  return window.addEventListener("popstate", e), () => window.removeEventListener("popstate", e);
323
376
  }, []);
324
377
  let j = s((e, t, n) => {
325
- T.current.set(A(), {
378
+ D.current.set(A(), {
326
379
  x: window.scrollX,
327
380
  y: window.scrollY
328
- });
329
- let r = { __vwebKey: he() };
330
- n?.replace ? window.history.replaceState(r, "", e) : window.history.pushState(r, "", e), h(t.pathname), y(t.search + t.hash), n?.scroll !== !1 && me(t);
381
+ }), w.current = n?.transition;
382
+ let r = { __vwebKey: _e() };
383
+ n?.replace ? window.history.replaceState(r, "", e) : window.history.pushState(r, "", e), h(t.pathname), y(t.search + t.hash), n?.scroll !== !1 && ge(t);
331
384
  }, []), M = s((e, t) => {
332
385
  let n = new URL(window.location.href), r = new URL(e, n);
333
386
  if (r.pathname !== n.pathname || r.search !== n.search || r.hash !== n.hash) {
334
- for (let n of S.current.values()) if (n({
387
+ for (let n of x.current.values()) if (n({
335
388
  to: e,
336
389
  ...t ? { opts: t } : {}
337
390
  })) {
338
- w({
391
+ C({
339
392
  to: e,
340
393
  ...t ? { opts: t } : {},
341
394
  retry: () => {
342
- w(null), j(e, r, t);
395
+ C(null), j(e, r, t);
343
396
  },
344
- reset: () => w(null)
397
+ reset: () => C(null)
345
398
  });
346
399
  return;
347
400
  }
@@ -351,54 +404,54 @@ var h = {
351
404
  l(() => {
352
405
  if (typeof document > "u") return;
353
406
  let e = (e) => {
354
- let t = fe(e, window.location.href);
407
+ let t = pe(e, window.location.href);
355
408
  t.kind === "spa" && (e.preventDefault(), M(t.to));
356
409
  };
357
410
  return document.addEventListener("click", e), () => document.removeEventListener("click", e);
358
411
  }, [M]);
359
- let N = u(() => O(D, m), [D, m]), P = d(/* @__PURE__ */ new Map()), [F, be] = f(0), Se = N?.route.load ? N.route.pattern : null;
412
+ let N = u(() => I(k, m), [k, m]), P = d(/* @__PURE__ */ new Map()), [F, ie] = f(0), R = N?.route.load ? N.route.pattern : null;
360
413
  l(() => {
361
414
  let e = N?.route;
362
415
  if (!e?.load || P.current.has(e.pattern)) return;
363
416
  let t = !1;
364
417
  return e.load().then((n) => {
365
- t || (P.current.set(e.pattern, n), be((e) => e + 1));
418
+ t || (P.current.set(e.pattern, n), ie((e) => e + 1));
366
419
  }).catch(() => {}), () => {
367
420
  t = !0;
368
421
  };
369
- }, [Se]);
370
- let R = d(/* @__PURE__ */ new Set()), Te = s((e) => {
422
+ }, [R]);
423
+ let z = d(/* @__PURE__ */ new Set()), me = s((e) => {
371
424
  let t = e.load;
372
- t && (P.current.has(e.pattern) || R.current.has(e.pattern) || (R.current.add(e.pattern), t().then((t) => {
425
+ t && (P.current.has(e.pattern) || z.current.has(e.pattern) || (z.current.add(e.pattern), t().then((t) => {
373
426
  P.current.set(e.pattern, t);
374
427
  }).catch(() => {
375
- R.current.delete(e.pattern);
428
+ z.current.delete(e.pattern);
376
429
  })));
377
- }, []), z = u(() => {
430
+ }, []), B = u(() => {
378
431
  if (!N) return null;
379
432
  let e = N.route;
380
433
  if (!e.load) return e;
381
434
  let t = P.current.get(e.pattern);
382
435
  return t ? {
383
436
  ...e,
384
- ...Pe(t),
437
+ ...Be(t),
385
438
  load: void 0
386
439
  } : null;
387
- }, [N, F]), B = u(() => O(D, g), [D, g]), V = u(() => {
388
- if (!B) return null;
389
- let e = B.route;
440
+ }, [N, F]), V = u(() => I(k, g), [k, g]), H = u(() => {
441
+ if (!V) return null;
442
+ let e = V.route;
390
443
  if (!e.load) return e;
391
444
  let t = P.current.get(e.pattern);
392
445
  return t ? {
393
446
  ...e,
394
- ...Pe(t),
447
+ ...Be(t),
395
448
  load: void 0
396
449
  } : null;
397
- }, [B, F]), Oe = s((e) => {
398
- let t = new URL(e, window.location.origin), n = O(D, t.pathname);
450
+ }, [V, F]), Se = s((e) => {
451
+ let t = new URL(e, window.location.origin), n = I(k, t.pathname);
399
452
  if (!n) return;
400
453
  let r = (e, r) => {
401
- x.current.start(e, (e) => se(r, {
454
+ b.current.start(e, (e) => ce(r, {
402
455
  params: n.params,
403
456
  pathname: t.pathname,
404
457
  search: t.search,
@@ -406,85 +459,93 @@ var h = {
406
459
  isServer: !1
407
460
  }));
408
461
  };
409
- Te(n.route), n.route.loader && r(k(n.route.pattern, n.params), n.route.loader), n.route.chain?.forEach((e, t) => {
410
- e.loader && r(oe(n.route.pattern, t, n.params), e.loader);
462
+ me(n.route), n.route.loader && r(L(n.route.pattern, n.params), n.route.loader), n.route.chain?.forEach((e, t) => {
463
+ e.loader && r(se(n.route.pattern, t, n.params), e.loader);
411
464
  });
412
- }, [D, Te]), [H, U] = f({ status: "idle" }), W = d(void 0);
413
- W.current === void 0 && (W.current = a());
414
- let ke = d(!1), [Ae, je] = f(() => W.current?.pageClientOnly === !0 && W.current.pathname === m);
465
+ }, [k, me]), [G, K] = f({ status: "idle" }), q = d(void 0);
466
+ q.current === void 0 && (q.current = a());
467
+ let De = d(!1), [Ae, je] = f(() => q.current?.pageClientOnly === !0 && q.current.pathname === m);
415
468
  l(() => {
416
469
  je(!1);
417
470
  }, []);
418
- let [G, Me] = f(() => ({
471
+ let [J, Me] = f(() => ({
419
472
  pathname: m,
420
- data: ge(W.current ?? null, m),
473
+ data: ve(q.current ?? null, m),
421
474
  chain: N?.route.chain
422
475
  }));
423
476
  l(() => {
424
- let e = (e) => {
425
- _(m), Me((t) => t.pathname === m && _e(t.data, e) ? t : {
426
- pathname: m,
427
- data: e,
428
- chain: N?.route.chain
477
+ let e = (w.current ?? ee) && g !== m, t = !1, n = (n) => {
478
+ if (!e || t) {
479
+ n();
480
+ return;
481
+ }
482
+ t = !0, Te(n);
483
+ }, r = (e) => {
484
+ n(() => {
485
+ _(m), Me((t) => t.pathname === m && ye(t.data, e) ? t : {
486
+ pathname: m,
487
+ data: e,
488
+ chain: N?.route.chain
489
+ });
429
490
  });
430
491
  };
431
492
  if (!N) {
432
- U({ status: "idle" }), e(void 0);
493
+ K({ status: "idle" }), r(void 0);
433
494
  return;
434
495
  }
435
- if (!z) {
436
- U({
496
+ if (!B) {
497
+ K({
437
498
  status: "pending",
438
- key: k(N.route.pattern, N.params)
499
+ key: L(N.route.pattern, N.params)
439
500
  });
440
501
  return;
441
502
  }
442
- let t = z, { params: n } = N, r = t.chain, i = (t.Pending ?? ue(r, "Pending", r ? r.length - 1 : -1)) !== void 0, a = [];
443
- if (t.loader) {
444
- let e = t.loader;
445
- a.push({
446
- cacheKey: k(t.pattern, n),
503
+ let i = B, { params: a } = N, o = i.chain, s = (i.Pending ?? de(o, "Pending", o ? o.length - 1 : -1)) !== void 0, c = [];
504
+ if (i.loader) {
505
+ let e = i.loader;
506
+ c.push({
507
+ cacheKey: L(i.pattern, a),
447
508
  target: "page",
448
- run: (t) => se(e, {
449
- params: n,
509
+ run: (t) => ce(e, {
510
+ params: a,
450
511
  pathname: m,
451
- search: b,
512
+ search: ne,
452
513
  signal: t,
453
514
  isServer: !1
454
515
  })
455
516
  });
456
517
  }
457
- if (t.chain?.forEach((e, r) => {
518
+ if (i.chain?.forEach((e, t) => {
458
519
  if (e.loader) {
459
- let i = e.loader;
460
- a.push({
461
- cacheKey: oe(t.pattern, r, n),
462
- target: r,
463
- run: (e) => se(i, {
464
- params: n,
520
+ let n = e.loader;
521
+ c.push({
522
+ cacheKey: se(i.pattern, t, a),
523
+ target: t,
524
+ run: (e) => ce(n, {
525
+ params: a,
465
526
  pathname: m,
466
- search: b,
527
+ search: ne,
467
528
  signal: e,
468
529
  isServer: !1
469
530
  })
470
531
  });
471
532
  }
472
- }), a.length === 0) {
473
- U({ status: "idle" }), e(void 0);
533
+ }), c.length === 0) {
534
+ K({ status: "idle" }), r(void 0);
474
535
  return;
475
536
  }
476
- let o = k(t.pattern, n), s = W.current;
477
- if (s && !ke.current && m === s.pathname) {
478
- ke.current = !0;
479
- for (let e of a) e.target === "page" ? s.pageRan && x.current.seed(e.cacheKey, s.page) : s.segments.has(e.target) && x.current.seed(e.cacheKey, s.segments.get(e.target));
537
+ let l = L(i.pattern, a), u = q.current;
538
+ if (u && !De.current && m === u.pathname) {
539
+ De.current = !0;
540
+ for (let e of c) e.target === "page" ? u.pageRan && b.current.seed(e.cacheKey, u.page) : u.segments.has(e.target) && b.current.seed(e.cacheKey, u.segments.get(e.target));
480
541
  }
481
- let c = a.map((e) => ({
542
+ let d = c.map((e) => ({
482
543
  spec: e,
483
- entry: x.current.start(e.cacheKey, e.run)
484
- })), l = () => {
544
+ entry: b.current.start(e.cacheKey, e.run)
545
+ })), f = () => {
485
546
  let e = {}, t;
486
- for (let { spec: n } of c) {
487
- let r = x.current.get(n.cacheKey);
547
+ for (let { spec: n } of d) {
548
+ let r = b.current.get(n.cacheKey);
488
549
  if (!r || r.status === "pending") return null;
489
550
  if (r.status === "error") return {
490
551
  ok: !1,
@@ -499,91 +560,91 @@ var h = {
499
560
  segments: e
500
561
  }
501
562
  };
502
- }, u = l();
503
- if (u) {
504
- u.ok ? (U({
563
+ }, p = f();
564
+ if (p) {
565
+ p.ok ? (K({
505
566
  status: "success",
506
- key: o,
507
- data: u.data
508
- }), e(u.data)) : (U({
567
+ key: l,
568
+ data: p.data
569
+ }), r(p.data)) : (K({
509
570
  status: "error",
510
- key: o,
511
- error: u.error
512
- }), C(u.error) || e(void 0));
571
+ key: l,
572
+ error: p.error
573
+ }), T(p.error) || r(void 0));
513
574
  return;
514
575
  }
515
- U({
576
+ K({
516
577
  status: "pending",
517
- key: o
518
- }), i && _(m);
519
- let d = !1, f = c.map(({ entry: e }) => e.status === "pending" ? e.promise : Promise.resolve());
520
- return Promise.all(f).then(() => {
521
- if (d) return;
522
- let t = l();
523
- t && (t.ok ? (U({
578
+ key: l
579
+ }), s && n(() => _(m));
580
+ let h = !1, v = d.map(({ entry: e }) => e.status === "pending" ? e.promise : Promise.resolve());
581
+ return Promise.all(v).then(() => {
582
+ if (h) return;
583
+ let e = f();
584
+ e && (e.ok ? (K({
524
585
  status: "success",
525
- key: o,
526
- data: t.data
527
- }), e(t.data)) : (U({
586
+ key: l,
587
+ data: e.data
588
+ }), r(e.data)) : (K({
528
589
  status: "error",
529
- key: o,
530
- error: t.error
531
- }), C(t.error) || e(void 0)));
590
+ key: l,
591
+ error: e.error
592
+ }), T(e.error) || r(void 0)));
532
593
  }), () => {
533
- d = !0;
594
+ h = !0;
534
595
  };
535
596
  }, [
536
597
  N,
537
- z,
598
+ B,
538
599
  m
539
600
  ]);
540
- let K = G.data?.page, q = g === m, J = G.pathname === g, Ne = J ? G.data?.page : void 0, Fe = V?.loader === void 0 ? I : Ne, Ie = ve(), Y = u(() => {
541
- if (!B) return null;
542
- let e = B.params.locale ?? Ie;
543
- return ce(V?.meta, B.params, K, e);
601
+ let Y = J.data?.page, X = g === m, Ne = J.pathname === g, Pe = Ne ? J.data?.page : void 0, Fe = H?.loader === void 0 ? U : Pe, Ie = be(), Z = u(() => {
602
+ if (!V) return null;
603
+ let e = V.params.locale ?? Ie;
604
+ return le(H?.meta, V.params, Y, e);
544
605
  }, [
545
- B,
546
606
  V,
547
- K,
607
+ H,
608
+ Y,
548
609
  Ie
549
610
  ]);
550
- l(() => ye(Y), [Y]);
551
- let [X, Z] = f(""), Q = d(!1), [Le, Re] = f(!1);
611
+ l(() => xe(Z), [Z]);
612
+ let [Le, Re] = f(""), Q = d(!1), [ze, Ve] = f(!1);
552
613
  l(() => {
553
614
  if (!Q.current) {
554
- Q.current = !0, Re(!0);
615
+ Q.current = !0, Ve(!0);
555
616
  return;
556
617
  }
557
- let e = Y?.title ?? (typeof document < "u" ? document.title : "");
558
- Z(e && e.length > 0 ? e : g);
559
- }, [g, Y]), l(() => {
560
- let e = E.current;
561
- e && (E.current = null, pe(() => window.scrollTo(e.x, e.y)));
618
+ let e = Z?.title ?? (typeof document < "u" ? document.title : "");
619
+ Re(e && e.length > 0 ? e : g);
620
+ }, [g, Z]), l(() => {
621
+ let e = O.current;
622
+ e && (O.current = null, he(() => window.scrollTo(e.x, e.y)));
562
623
  }, [g]);
563
- let ze = u(() => ({
624
+ let He = u(() => ({
564
625
  pathname: g,
565
626
  search: v,
566
627
  navigate: M,
567
- params: B?.params ?? {},
568
- prefetch: Oe,
569
- loaderData: K,
570
- registerBlocker: re,
571
- blocked: ne
628
+ params: V?.params ?? {},
629
+ prefetch: Se,
630
+ loaderData: Y,
631
+ registerBlocker: E,
632
+ blocked: S
572
633
  }), [
573
634
  g,
574
635
  v,
575
636
  M,
576
- B,
577
- Oe,
578
- K,
579
- re,
580
- ne
637
+ V,
638
+ Se,
639
+ Y,
640
+ E,
641
+ S
581
642
  ]);
582
643
  l(() => {
583
644
  if (typeof window > "u") return;
584
645
  let e = (e) => {
585
646
  let t = !1;
586
- for (let e of S.current.values()) if (e({ to: window.location.pathname })) {
647
+ for (let e of x.current.values()) if (e({ to: window.location.pathname })) {
587
648
  t = !0;
588
649
  break;
589
650
  }
@@ -591,93 +652,93 @@ var h = {
591
652
  };
592
653
  return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
593
654
  }, []), l(() => {
594
- ee({
655
+ te({
595
656
  pathname: g,
596
- params: B?.params ?? {},
597
- loaderData: K
657
+ params: V?.params ?? {},
658
+ loaderData: Y
598
659
  });
599
660
  }, [
600
661
  g,
601
- B,
602
- K
662
+ V,
663
+ Y
603
664
  ]), l(() => {
604
- if (H.status === "pending") return t({
665
+ if (G.status === "pending") return t({
605
666
  id: "voltro:router:loader",
606
667
  kind: "loading",
607
668
  label: "Loading…"
608
669
  });
609
- }, [H.status]), l(() => {
610
- if (H.status === "error") return t({
670
+ }, [G.status]), l(() => {
671
+ if (G.status === "error") return t({
611
672
  id: "voltro:router:loader-error",
612
673
  kind: "error",
613
674
  label: "Loader failed"
614
675
  });
615
- }, [H.status]), l(() => {
616
- H.status === "error" && C(H.error) && M(H.error.location, { replace: !0 });
617
- }, [H, M]);
618
- let Be = () => {
619
- let e = le(i, g);
676
+ }, [G.status]), l(() => {
677
+ G.status === "error" && T(G.error) && M(G.error.location, { replace: !0 });
678
+ }, [G, M]);
679
+ let Ue = () => {
680
+ let e = ue(i, g);
620
681
  if (e) {
621
682
  let { Component: t, chain: n } = e;
622
- return De(n, /* @__PURE__ */ p(t, {}), g, c);
683
+ return ke(n, /* @__PURE__ */ p(t, {}), g, c);
623
684
  }
624
685
  return /* @__PURE__ */ p(o, {});
625
- }, Ve = q && B && H.status === "error" ? H.error : void 0, $;
626
- if (!B) $ = Be();
627
- else if (te(Ve)) $ = Be();
686
+ }, We = X && V && G.status === "error" ? G.error : void 0, $;
687
+ if (!V) $ = Ue();
688
+ else if (re(We)) $ = Ue();
628
689
  else {
629
- let e = B.route.chain, t = e ? e.length - 1 : -1, n = V?.ErrorBoundary ?? ue(e, "Error", t) ?? c, r;
630
- if (Ae) r = /* @__PURE__ */ p(Ce, {});
631
- else if (q && H.status === "error" && !C(H.error)) r = /* @__PURE__ */ p(n, {
632
- error: H.error,
690
+ let e = V.route.chain, t = e ? e.length - 1 : -1, n = H?.ErrorBoundary ?? de(e, "Error", t) ?? c, r;
691
+ if (Ae) r = /* @__PURE__ */ p(we, {});
692
+ else if (X && G.status === "error" && !T(G.error)) r = /* @__PURE__ */ p(n, {
693
+ error: G.error,
633
694
  reset: () => {
634
- x.current.invalidate(B.route.pattern), h((e) => e), U({ status: "idle" });
695
+ b.current.invalidate(V.route.pattern), h((e) => e), K({ status: "idle" });
635
696
  }
636
697
  });
637
- else if (q && H.status === "pending") {
638
- let i = V?.Pending ?? ue(e, "Pending", t);
698
+ else if (X && G.status === "pending") {
699
+ let i = H?.Pending ?? de(e, "Pending", t);
639
700
  if (i) r = /* @__PURE__ */ p(i, {});
640
- else if (V?.Component) {
641
- let e = V.Component;
642
- r = /* @__PURE__ */ p(xe, {
701
+ else if (H?.Component) {
702
+ let e = H.Component;
703
+ r = /* @__PURE__ */ p(Ce, {
643
704
  resetKey: g,
644
705
  Fallback: n,
645
- children: /* @__PURE__ */ p(L.Provider, {
706
+ children: /* @__PURE__ */ p(W.Provider, {
646
707
  value: Fe,
647
708
  children: /* @__PURE__ */ p(e, {})
648
709
  })
649
710
  });
650
711
  } else r = null;
651
712
  } else {
652
- let e = V?.Component;
653
- r = e ? /* @__PURE__ */ p(xe, {
713
+ let e = H?.Component;
714
+ r = e ? /* @__PURE__ */ p(Ce, {
654
715
  resetKey: g,
655
716
  Fallback: n,
656
- children: /* @__PURE__ */ p(L.Provider, {
717
+ children: /* @__PURE__ */ p(W.Provider, {
657
718
  value: Fe,
658
719
  children: /* @__PURE__ */ p(e, {})
659
720
  })
660
721
  }) : null;
661
722
  }
662
- $ = De(e, r, g, c, (t) => {
663
- if (J) return G.data?.segments[t];
723
+ $ = ke(e, r, g, c, (t) => {
724
+ if (Ne) return J.data?.segments[t];
664
725
  let n = e?.[t]?.Layout;
665
- return n !== void 0 && n === G.chain?.[t]?.Layout ? G.data?.segments[t] : void 0;
726
+ return n !== void 0 && n === J.chain?.[t]?.Layout ? J.data?.segments[t] : void 0;
666
727
  });
667
728
  }
668
- return /* @__PURE__ */ p(we, {
669
- value: ze,
670
- announcer: Le ? /* @__PURE__ */ p(Ee, { message: X }) : null,
729
+ return /* @__PURE__ */ p(Ee, {
730
+ value: He,
731
+ announcer: ze ? /* @__PURE__ */ p(Oe, { message: Le }) : null,
671
732
  children: $
672
733
  });
673
- }, we = ({ value: e, announcer: t, children: n }) => /* @__PURE__ */ m(P.Provider, {
734
+ }, Ee = ({ value: e, announcer: t, children: n }) => /* @__PURE__ */ m(V.Provider, {
674
735
  value: e,
675
736
  children: [n, t]
676
- }), Te = (e, t) => /* @__PURE__ */ p(we, {
737
+ }), q = (e, t) => /* @__PURE__ */ p(Ee, {
677
738
  value: e,
678
739
  announcer: null,
679
740
  children: t
680
- }), z = {
741
+ }), De = {
681
742
  position: "absolute",
682
743
  width: 1,
683
744
  height: 1,
@@ -687,28 +748,28 @@ var h = {
687
748
  clip: "rect(0, 0, 0, 0)",
688
749
  whiteSpace: "nowrap",
689
750
  border: 0
690
- }, Ee = ({ message: e }) => /* @__PURE__ */ p("div", {
751
+ }, Oe = ({ message: e }) => /* @__PURE__ */ p("div", {
691
752
  "data-vweb-route-announcer": "",
692
753
  role: "status",
693
754
  "aria-live": "assertive",
694
755
  "aria-atomic": "true",
695
- style: z,
756
+ style: De,
696
757
  children: e
697
- }), De = (e, t, n, r, i) => {
758
+ }), ke = (e, t, n, r, i) => {
698
759
  if (!e || e.length === 0) return t;
699
760
  let a = t;
700
761
  for (let t = e.length - 1; t >= 0; t--) {
701
762
  let r = e[t];
702
763
  if (r.Layout) {
703
764
  let e = r.Layout;
704
- a = /* @__PURE__ */ p(L.Provider, {
705
- value: r.loader === void 0 ? I : i?.(t),
765
+ a = /* @__PURE__ */ p(W.Provider, {
766
+ value: r.loader === void 0 ? U : i?.(t),
706
767
  children: /* @__PURE__ */ p(e, { children: a })
707
768
  });
708
769
  }
709
770
  if (r.Error) {
710
771
  let e = r.Error;
711
- a = /* @__PURE__ */ p(xe, {
772
+ a = /* @__PURE__ */ p(Ce, {
712
773
  resetKey: n,
713
774
  Fallback: e,
714
775
  children: a
@@ -716,15 +777,15 @@ var h = {
716
777
  }
717
778
  }
718
779
  return a;
719
- }, B = () => F().pathname, V = () => F().navigate, Oe = () => F().params, H = () => {
720
- let e = c(L);
721
- if (e === I) throw Error("useLoaderData() was called at a level that declares no `loader`. Export `loader` from this page/layout, or — if this component is shared between routes that have one and routes that do not — read it with `useOptionalLoaderData()`, which returns `undefined` here instead of throwing. The React component stack below names the component.");
780
+ }, Ae = () => H().pathname, je = () => H().navigate, J = () => H().params, Me = () => {
781
+ let e = c(W);
782
+ if (e === U) throw Error("useLoaderData() was called at a level that declares no `loader`. Export `loader` from this page/layout, or — if this component is shared between routes that have one and routes that do not — read it with `useOptionalLoaderData()`, which returns `undefined` here instead of throwing. The React component stack below names the component.");
722
783
  return e;
723
- }, U = () => {
724
- let e = c(L);
725
- return e === I ? void 0 : e;
726
- }, W = () => F().prefetch, ke = (e) => {
727
- let { registerBlocker: t, blocked: n } = F(), r = d(Symbol("voltro:blocker")), i = d(e);
784
+ }, Y = () => {
785
+ let e = c(W);
786
+ return e === U ? void 0 : e;
787
+ }, X = () => H().prefetch, Ne = (e) => {
788
+ let { registerBlocker: t, blocked: n } = H(), r = d(Symbol("voltro:blocker")), i = d(e);
728
789
  return i.current = e, l(() => {
729
790
  let e = r.current;
730
791
  return t(e, (e) => {
@@ -737,24 +798,26 @@ var h = {
737
798
  retry: n.retry,
738
799
  reset: n.reset
739
800
  } : { blocked: !1 };
740
- }, Ae = (e) => e instanceof URLSearchParams ? e : new URLSearchParams(e), je = () => {
741
- let { navigate: e } = F();
742
- return s((t, n) => {
743
- let r = new URLSearchParams(typeof window < "u" ? window.location.search : ""), i = Ae(typeof t == "function" ? t(r) : t).toString(), a = typeof window < "u" ? window.location.pathname : "/", o = i ? `${a}?${i}` : a;
744
- e(o, {
745
- replace: !n?.push,
746
- ...n?.scroll === void 0 ? {} : { scroll: n.scroll }
801
+ }, Pe = (e) => e instanceof URLSearchParams ? e : new URLSearchParams(e);
802
+ function Fe(e) {
803
+ let { navigate: t } = H();
804
+ return s((n, r) => {
805
+ let i = new URLSearchParams(typeof window < "u" ? window.location.search : ""), a = e === void 0 ? Pe(typeof n == "function" ? n(i) : n).toString() : A(typeof n == "function" ? n(k(e, i)) : n).toString(), o = typeof window < "u" ? window.location.pathname : "/", s = a ? `${o}?${a}` : o;
806
+ t(s, {
807
+ replace: !r?.push,
808
+ ...r?.scroll === void 0 ? {} : { scroll: r.scroll }
747
809
  });
748
- }, [e]);
749
- }, G = (e) => e, Me = (e, t) => {
750
- let n = new URLSearchParams();
751
- for (let [e, r] of Object.entries(t)) r !== void 0 && n.append(e, String(r));
752
- let r = n.toString();
753
- return r ? `${e}?${r}` : e;
754
- }, K = (e, t) => `${e}#${t.replace(/^#/, "")}`, q = (e) => /^([a-z][a-z0-9+.-]*:|\/\/|#)/i.test(e), J = ({ to: e, children: t, onClick: n, prefetch: r = !1, replace: i = !1, onMouseEnter: a, onFocus: o, ref: c, ...u }) => {
755
- let f = V(), m = W(), h = q(e), g = d(null), ee = s((e) => {
756
- g.current = e, typeof c == "function" ? c(e) : c && (c.current = e);
757
- }, [c]);
810
+ }, [t, e]);
811
+ }
812
+ var Ie = (e) => e;
813
+ function Z(e, t) {
814
+ let n = A(t).toString();
815
+ return n ? `${e}?${n}` : e;
816
+ }
817
+ var Le = (e, t) => `${e}#${t.replace(/^#/, "")}`, Re = (e) => /^([a-z][a-z0-9+.-]*:|\/\/|#)/i.test(e), Q = ({ to: e, children: t, onClick: n, prefetch: r = !1, replace: i = !1, transition: a, onMouseEnter: o, onFocus: c, ref: u, ...f }) => {
818
+ let ee = je(), m = X(), h = Re(e), g = d(null), _ = s((e) => {
819
+ g.current = e, typeof u == "function" ? u(e) : u && (u.current = e);
820
+ }, [u]);
758
821
  l(() => {
759
822
  if (r !== "visible" || h) return;
760
823
  let t = g.current;
@@ -769,26 +832,32 @@ var h = {
769
832
  e,
770
833
  m
771
834
  ]);
772
- let _ = (t) => {
773
- h || t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0 || (t.preventDefault(), n?.(t), f(e, i ? { replace: i } : void 0));
774
- }, v = (t) => {
775
- r && !h && m(e), a?.(t);
835
+ let v = (t) => {
836
+ if (h || t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0) return;
837
+ t.preventDefault(), n?.(t);
838
+ let r = i || a !== void 0 ? {
839
+ ...i ? { replace: i } : {},
840
+ ...a === void 0 ? {} : { transition: a }
841
+ } : void 0;
842
+ ee(e, r);
776
843
  }, y = (t) => {
777
844
  r && !h && m(e), o?.(t);
845
+ }, te = (t) => {
846
+ r && !h && m(e), c?.(t);
778
847
  };
779
848
  return /* @__PURE__ */ p("a", {
780
- ...u,
781
- ref: ee,
849
+ ...f,
850
+ ref: _,
782
851
  href: e,
783
- onClick: _,
784
- onMouseEnter: v,
785
- onFocus: y,
852
+ onClick: v,
853
+ onMouseEnter: y,
854
+ onFocus: te,
786
855
  children: t
787
856
  });
788
- }, Ne = (e) => J({
857
+ }, ze = (e) => Q({
789
858
  ...e,
790
859
  to: e.to
791
- }), Pe = (e) => ({
860
+ }), Be = (e) => ({
792
861
  Component: e.default,
793
862
  meta: e.meta,
794
863
  loader: e.loader,
@@ -796,30 +865,31 @@ var h = {
796
865
  Pending: e.Pending,
797
866
  renderMode: e.renderMode,
798
867
  interactive: e.interactive
799
- }), Fe = (e, t, n = {}) => ({
868
+ }), Ve = (e, t, n = {}) => ({
800
869
  pattern: e,
801
- ...Pe(t),
870
+ ...Be(t),
802
871
  chain: n.chain
803
- }), Ie = (e, t, n = {}) => ({
872
+ }), He = (e, t, n = {}) => ({
804
873
  pattern: e,
805
874
  load: t,
806
875
  chain: n.chain
807
- }), Y = async (e, t) => {
808
- let n = O(e.map(ie), t)?.route.load;
876
+ }), Ue = async (e, t) => {
877
+ let n = I(e.map(ae), t)?.route.load;
809
878
  if (n) try {
810
879
  await n();
811
880
  } catch {}
812
- }, X = e("serverRequest", null), Z = () => c(X), Q = () => {
813
- let e = Z();
814
- if (e !== null) {
815
- let t = e.url.indexOf("?");
816
- return new URLSearchParams(t >= 0 ? e.url.slice(t + 1) : "");
817
- }
818
- return typeof window < "u" ? new URLSearchParams(window.location.search) : new URLSearchParams();
819
- }, Le = ({ value: e, children: t }) => /* @__PURE__ */ p(X.Provider, {
820
- value: e,
821
- children: t
822
- }), Re = (e) => {
881
+ };
882
+ //#endregion
883
+ //#region src/serverContext.tsx
884
+ function We(e) {
885
+ let t = ee(), n;
886
+ if (t !== null) {
887
+ let e = t.url.indexOf("?");
888
+ n = new URLSearchParams(e >= 0 ? t.url.slice(e + 1) : "");
889
+ } else n = typeof window < "u" ? new URLSearchParams(window.location.search) : new URLSearchParams();
890
+ return e === void 0 ? n : k(e, n);
891
+ }
892
+ var $ = (e) => {
823
893
  let t = {};
824
894
  if (!e) return t;
825
895
  for (let n of e.split(";")) {
@@ -837,4 +907,4 @@ var h = {
837
907
  return t;
838
908
  };
839
909
  //#endregion
840
- export { H as A, b as B, Y as C, oe as D, ce as E, W as F, _ as G, C as H, je as I, ee as K, K as L, V as M, U as N, ae as O, Oe as P, Me as R, Fe as S, fe as T, x as U, te as V, S as W, G as _, Z as a, k as b, L as c, Ce as d, Ne as f, ie as g, P as h, Q as i, B as j, ke as k, I as l, R as m, Le as n, J as o, ne as p, v as q, Re as r, de as s, X as t, Se as u, le as v, Te as w, O as x, Ie as y, y as z };
910
+ export { Y as A, S as B, le as C, Me as D, Ne as E, Z as F, ne as G, T as H, k as I, te as K, A as L, X as M, Fe as N, Ae as O, Le as P, E as R, pe as S, oe as T, C as U, re as V, w as W, L as _, W as a, Ue as b, we as c, K as d, V as f, He as g, ue as h, fe as i, J as j, je as k, ze as l, Ie as m, We as n, U as o, ae as p, b as q, Q as r, G as s, $ as t, j as u, I as v, se as w, q as x, Ve as y, x as z };