@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.
- package/CHANGELOG.md +231 -0
- package/dist/{defaultFallbacks-B4Ak-R6R.js → defaultFallbacks-SQ45vAhz.js} +1 -1
- package/dist/{frameworkBoot-CV_o2tIk.js → frameworkBoot-CnE9vzLQ.js} +2 -2
- package/dist/frameworkBoot.js +1 -1
- package/dist/globalContext-AuflFFmy.js +2 -0
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +143 -31
- package/dist/index.js +10 -9
- package/dist/islands.d.ts +66 -0
- package/dist/islands.js +60 -0
- package/dist/mount.js +37 -2
- package/dist/{serverContext-38JTbYPa.js → serverContext-CzmZZwuQ.js} +352 -282
- package/dist/ssr.d.ts +6 -10
- package/dist/ssr.js +10 -9
- package/package.json +9 -4
- package/dist/globalContext-d4A-ugDg.js +0 -10
- package/dist/mount-nudb4UCl.js +0 -81
|
@@ -1,63 +1,107 @@
|
|
|
1
|
-
import { t as e } from "./globalContext-
|
|
2
|
-
import { l as t, n, t as r } from "./defaultFallbacks-
|
|
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
|
|
10
|
+
var v = {
|
|
8
11
|
pathname: "/",
|
|
9
12
|
params: {},
|
|
10
13
|
loaderData: void 0
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
for (let e of
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
29
|
-
throw new
|
|
30
|
-
},
|
|
31
|
-
throw new
|
|
32
|
-
},
|
|
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
|
-
],
|
|
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:
|
|
84
|
+
weight: P
|
|
41
85
|
} : e.startsWith("[...") && e.endsWith("]") ? {
|
|
42
86
|
source: "(.+)",
|
|
43
87
|
paramName: e.slice(4, -1),
|
|
44
|
-
weight:
|
|
88
|
+
weight: F
|
|
45
89
|
} : e.startsWith("[") && e.endsWith("]") ? {
|
|
46
90
|
source: "([^/]+)",
|
|
47
91
|
paramName: e.slice(1, -1),
|
|
48
|
-
weight:
|
|
92
|
+
weight: N
|
|
49
93
|
} : {
|
|
50
94
|
source: e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
|
|
51
95
|
paramName: null,
|
|
52
|
-
weight:
|
|
53
|
-
},
|
|
54
|
-
let t = e.pattern.split("/").map(
|
|
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 ===
|
|
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 ===
|
|
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
|
-
},
|
|
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),
|
|
72
|
-
let n =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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,
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
153
|
-
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return
|
|
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
|
|
199
|
+
if (!r) return R;
|
|
156
200
|
let i = r.getAttribute("href");
|
|
157
|
-
if (i === null) return
|
|
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
|
|
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
|
|
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
|
|
210
|
+
return R;
|
|
167
211
|
}
|
|
168
|
-
return s.origin !== c.origin || s.pathname === c.pathname && s.search === c.search && s.hash !== "" ?
|
|
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
|
-
},
|
|
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
|
-
},
|
|
180
|
-
let t =
|
|
223
|
+
}, me = (e) => {
|
|
224
|
+
let t = z(e);
|
|
181
225
|
return t ? document.getElementById(t) ?? document.getElementsByName(t)[0] ?? null : null;
|
|
182
|
-
},
|
|
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
|
-
},
|
|
232
|
+
}, ge = (e) => {
|
|
189
233
|
if (!e.hash) {
|
|
190
234
|
window.scrollTo(0, 0);
|
|
191
235
|
return;
|
|
192
236
|
}
|
|
193
|
-
|
|
194
|
-
let t =
|
|
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
|
-
},
|
|
245
|
+
}, B = 0, _e = () => {
|
|
202
246
|
let e = typeof crypto < "u" ? crypto : void 0;
|
|
203
|
-
return e && typeof e.randomUUID == "function" ? e.randomUUID() : (
|
|
204
|
-
},
|
|
205
|
-
let e = c(
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
295
|
-
let
|
|
296
|
-
|
|
297
|
-
|
|
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:
|
|
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 =
|
|
317
|
-
|
|
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
|
-
|
|
378
|
+
D.current.set(A(), {
|
|
326
379
|
x: window.scrollX,
|
|
327
380
|
y: window.scrollY
|
|
328
|
-
});
|
|
329
|
-
let r = { __vwebKey:
|
|
330
|
-
n?.replace ? window.history.replaceState(r, "", e) : window.history.pushState(r, "", e), h(t.pathname), y(t.search + t.hash), n?.scroll !== !1 &&
|
|
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
|
|
387
|
+
for (let n of x.current.values()) if (n({
|
|
335
388
|
to: e,
|
|
336
389
|
...t ? { opts: t } : {}
|
|
337
390
|
})) {
|
|
338
|
-
|
|
391
|
+
C({
|
|
339
392
|
to: e,
|
|
340
393
|
...t ? { opts: t } : {},
|
|
341
394
|
retry: () => {
|
|
342
|
-
|
|
395
|
+
C(null), j(e, r, t);
|
|
343
396
|
},
|
|
344
|
-
reset: () =>
|
|
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 =
|
|
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(() =>
|
|
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),
|
|
418
|
+
t || (P.current.set(e.pattern, n), ie((e) => e + 1));
|
|
366
419
|
}).catch(() => {}), () => {
|
|
367
420
|
t = !0;
|
|
368
421
|
};
|
|
369
|
-
}, [
|
|
370
|
-
let
|
|
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) ||
|
|
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
|
-
|
|
428
|
+
z.current.delete(e.pattern);
|
|
376
429
|
})));
|
|
377
|
-
}, []),
|
|
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
|
-
...
|
|
437
|
+
...Be(t),
|
|
385
438
|
load: void 0
|
|
386
439
|
} : null;
|
|
387
|
-
}, [N, F]),
|
|
388
|
-
if (!
|
|
389
|
-
let e =
|
|
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
|
-
...
|
|
447
|
+
...Be(t),
|
|
395
448
|
load: void 0
|
|
396
449
|
} : null;
|
|
397
|
-
}, [
|
|
398
|
-
let t = new URL(e, window.location.origin), n =
|
|
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
|
-
|
|
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
|
-
|
|
410
|
-
e.loader && r(
|
|
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
|
-
}, [
|
|
413
|
-
|
|
414
|
-
let
|
|
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 [
|
|
471
|
+
let [J, Me] = f(() => ({
|
|
419
472
|
pathname: m,
|
|
420
|
-
data:
|
|
473
|
+
data: ve(q.current ?? null, m),
|
|
421
474
|
chain: N?.route.chain
|
|
422
475
|
}));
|
|
423
476
|
l(() => {
|
|
424
|
-
let e = (
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
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
|
-
|
|
493
|
+
K({ status: "idle" }), r(void 0);
|
|
433
494
|
return;
|
|
434
495
|
}
|
|
435
|
-
if (!
|
|
436
|
-
|
|
496
|
+
if (!B) {
|
|
497
|
+
K({
|
|
437
498
|
status: "pending",
|
|
438
|
-
key:
|
|
499
|
+
key: L(N.route.pattern, N.params)
|
|
439
500
|
});
|
|
440
501
|
return;
|
|
441
502
|
}
|
|
442
|
-
let
|
|
443
|
-
if (
|
|
444
|
-
let e =
|
|
445
|
-
|
|
446
|
-
cacheKey:
|
|
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) =>
|
|
449
|
-
params:
|
|
509
|
+
run: (t) => ce(e, {
|
|
510
|
+
params: a,
|
|
450
511
|
pathname: m,
|
|
451
|
-
search:
|
|
512
|
+
search: ne,
|
|
452
513
|
signal: t,
|
|
453
514
|
isServer: !1
|
|
454
515
|
})
|
|
455
516
|
});
|
|
456
517
|
}
|
|
457
|
-
if (
|
|
518
|
+
if (i.chain?.forEach((e, t) => {
|
|
458
519
|
if (e.loader) {
|
|
459
|
-
let
|
|
460
|
-
|
|
461
|
-
cacheKey:
|
|
462
|
-
target:
|
|
463
|
-
run: (e) =>
|
|
464
|
-
params:
|
|
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:
|
|
527
|
+
search: ne,
|
|
467
528
|
signal: e,
|
|
468
529
|
isServer: !1
|
|
469
530
|
})
|
|
470
531
|
});
|
|
471
532
|
}
|
|
472
|
-
}),
|
|
473
|
-
|
|
533
|
+
}), c.length === 0) {
|
|
534
|
+
K({ status: "idle" }), r(void 0);
|
|
474
535
|
return;
|
|
475
536
|
}
|
|
476
|
-
let
|
|
477
|
-
if (
|
|
478
|
-
|
|
479
|
-
for (let e of
|
|
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
|
|
542
|
+
let d = c.map((e) => ({
|
|
482
543
|
spec: e,
|
|
483
|
-
entry:
|
|
484
|
-
})),
|
|
544
|
+
entry: b.current.start(e.cacheKey, e.run)
|
|
545
|
+
})), f = () => {
|
|
485
546
|
let e = {}, t;
|
|
486
|
-
for (let { spec: n } of
|
|
487
|
-
let r =
|
|
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
|
-
},
|
|
503
|
-
if (
|
|
504
|
-
|
|
563
|
+
}, p = f();
|
|
564
|
+
if (p) {
|
|
565
|
+
p.ok ? (K({
|
|
505
566
|
status: "success",
|
|
506
|
-
key:
|
|
507
|
-
data:
|
|
508
|
-
}),
|
|
567
|
+
key: l,
|
|
568
|
+
data: p.data
|
|
569
|
+
}), r(p.data)) : (K({
|
|
509
570
|
status: "error",
|
|
510
|
-
key:
|
|
511
|
-
error:
|
|
512
|
-
}),
|
|
571
|
+
key: l,
|
|
572
|
+
error: p.error
|
|
573
|
+
}), T(p.error) || r(void 0));
|
|
513
574
|
return;
|
|
514
575
|
}
|
|
515
|
-
|
|
576
|
+
K({
|
|
516
577
|
status: "pending",
|
|
517
|
-
key:
|
|
518
|
-
}),
|
|
519
|
-
let
|
|
520
|
-
return Promise.all(
|
|
521
|
-
if (
|
|
522
|
-
let
|
|
523
|
-
|
|
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:
|
|
526
|
-
data:
|
|
527
|
-
}), e
|
|
586
|
+
key: l,
|
|
587
|
+
data: e.data
|
|
588
|
+
}), r(e.data)) : (K({
|
|
528
589
|
status: "error",
|
|
529
|
-
key:
|
|
530
|
-
error:
|
|
531
|
-
}),
|
|
590
|
+
key: l,
|
|
591
|
+
error: e.error
|
|
592
|
+
}), T(e.error) || r(void 0)));
|
|
532
593
|
}), () => {
|
|
533
|
-
|
|
594
|
+
h = !0;
|
|
534
595
|
};
|
|
535
596
|
}, [
|
|
536
597
|
N,
|
|
537
|
-
|
|
598
|
+
B,
|
|
538
599
|
m
|
|
539
600
|
]);
|
|
540
|
-
let
|
|
541
|
-
if (!
|
|
542
|
-
let e =
|
|
543
|
-
return
|
|
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
|
-
|
|
607
|
+
H,
|
|
608
|
+
Y,
|
|
548
609
|
Ie
|
|
549
610
|
]);
|
|
550
|
-
l(() =>
|
|
551
|
-
let [
|
|
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,
|
|
615
|
+
Q.current = !0, Ve(!0);
|
|
555
616
|
return;
|
|
556
617
|
}
|
|
557
|
-
let e =
|
|
558
|
-
|
|
559
|
-
}, [g,
|
|
560
|
-
let e =
|
|
561
|
-
e && (
|
|
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
|
|
624
|
+
let He = u(() => ({
|
|
564
625
|
pathname: g,
|
|
565
626
|
search: v,
|
|
566
627
|
navigate: M,
|
|
567
|
-
params:
|
|
568
|
-
prefetch:
|
|
569
|
-
loaderData:
|
|
570
|
-
registerBlocker:
|
|
571
|
-
blocked:
|
|
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
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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
|
|
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
|
-
|
|
655
|
+
te({
|
|
595
656
|
pathname: g,
|
|
596
|
-
params:
|
|
597
|
-
loaderData:
|
|
657
|
+
params: V?.params ?? {},
|
|
658
|
+
loaderData: Y
|
|
598
659
|
});
|
|
599
660
|
}, [
|
|
600
661
|
g,
|
|
601
|
-
|
|
602
|
-
|
|
662
|
+
V,
|
|
663
|
+
Y
|
|
603
664
|
]), l(() => {
|
|
604
|
-
if (
|
|
665
|
+
if (G.status === "pending") return t({
|
|
605
666
|
id: "voltro:router:loader",
|
|
606
667
|
kind: "loading",
|
|
607
668
|
label: "Loading…"
|
|
608
669
|
});
|
|
609
|
-
}, [
|
|
610
|
-
if (
|
|
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
|
-
}, [
|
|
616
|
-
|
|
617
|
-
}, [
|
|
618
|
-
let
|
|
619
|
-
let e =
|
|
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
|
|
683
|
+
return ke(n, /* @__PURE__ */ p(t, {}), g, c);
|
|
623
684
|
}
|
|
624
685
|
return /* @__PURE__ */ p(o, {});
|
|
625
|
-
},
|
|
626
|
-
if (!
|
|
627
|
-
else if (
|
|
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 =
|
|
630
|
-
if (Ae) r = /* @__PURE__ */ p(
|
|
631
|
-
else if (
|
|
632
|
-
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
|
-
|
|
695
|
+
b.current.invalidate(V.route.pattern), h((e) => e), K({ status: "idle" });
|
|
635
696
|
}
|
|
636
697
|
});
|
|
637
|
-
else if (
|
|
638
|
-
let i =
|
|
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 (
|
|
641
|
-
let e =
|
|
642
|
-
r = /* @__PURE__ */ p(
|
|
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(
|
|
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 =
|
|
653
|
-
r = e ? /* @__PURE__ */ p(
|
|
713
|
+
let e = H?.Component;
|
|
714
|
+
r = e ? /* @__PURE__ */ p(Ce, {
|
|
654
715
|
resetKey: g,
|
|
655
716
|
Fallback: n,
|
|
656
|
-
children: /* @__PURE__ */ p(
|
|
717
|
+
children: /* @__PURE__ */ p(W.Provider, {
|
|
657
718
|
value: Fe,
|
|
658
719
|
children: /* @__PURE__ */ p(e, {})
|
|
659
720
|
})
|
|
660
721
|
}) : null;
|
|
661
722
|
}
|
|
662
|
-
$ =
|
|
663
|
-
if (
|
|
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 ===
|
|
726
|
+
return n !== void 0 && n === J.chain?.[t]?.Layout ? J.data?.segments[t] : void 0;
|
|
666
727
|
});
|
|
667
728
|
}
|
|
668
|
-
return /* @__PURE__ */ p(
|
|
669
|
-
value:
|
|
670
|
-
announcer:
|
|
729
|
+
return /* @__PURE__ */ p(Ee, {
|
|
730
|
+
value: He,
|
|
731
|
+
announcer: ze ? /* @__PURE__ */ p(Oe, { message: Le }) : null,
|
|
671
732
|
children: $
|
|
672
733
|
});
|
|
673
|
-
},
|
|
734
|
+
}, Ee = ({ value: e, announcer: t, children: n }) => /* @__PURE__ */ m(V.Provider, {
|
|
674
735
|
value: e,
|
|
675
736
|
children: [n, t]
|
|
676
|
-
}),
|
|
737
|
+
}), q = (e, t) => /* @__PURE__ */ p(Ee, {
|
|
677
738
|
value: e,
|
|
678
739
|
announcer: null,
|
|
679
740
|
children: t
|
|
680
|
-
}),
|
|
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
|
-
},
|
|
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:
|
|
756
|
+
style: De,
|
|
696
757
|
children: e
|
|
697
|
-
}),
|
|
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(
|
|
705
|
-
value: r.loader === void 0 ?
|
|
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(
|
|
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
|
-
},
|
|
720
|
-
let e = c(
|
|
721
|
-
if (e ===
|
|
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
|
-
},
|
|
724
|
-
let e = c(
|
|
725
|
-
return e ===
|
|
726
|
-
},
|
|
727
|
-
let { registerBlocker: t, blocked: n } =
|
|
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
|
-
},
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
e(o, {
|
|
745
|
-
|
|
746
|
-
|
|
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
|
-
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
let
|
|
753
|
-
return
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
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
|
|
773
|
-
h || t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0
|
|
774
|
-
|
|
775
|
-
r
|
|
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
|
-
...
|
|
781
|
-
ref:
|
|
849
|
+
...f,
|
|
850
|
+
ref: _,
|
|
782
851
|
href: e,
|
|
783
|
-
onClick:
|
|
784
|
-
onMouseEnter:
|
|
785
|
-
onFocus:
|
|
852
|
+
onClick: v,
|
|
853
|
+
onMouseEnter: y,
|
|
854
|
+
onFocus: te,
|
|
786
855
|
children: t
|
|
787
856
|
});
|
|
788
|
-
},
|
|
857
|
+
}, ze = (e) => Q({
|
|
789
858
|
...e,
|
|
790
859
|
to: e.to
|
|
791
|
-
}),
|
|
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
|
-
}),
|
|
868
|
+
}), Ve = (e, t, n = {}) => ({
|
|
800
869
|
pattern: e,
|
|
801
|
-
...
|
|
870
|
+
...Be(t),
|
|
802
871
|
chain: n.chain
|
|
803
|
-
}),
|
|
872
|
+
}), He = (e, t, n = {}) => ({
|
|
804
873
|
pattern: e,
|
|
805
874
|
load: t,
|
|
806
875
|
chain: n.chain
|
|
807
|
-
}),
|
|
808
|
-
let n =
|
|
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
|
-
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
}
|
|
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 {
|
|
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 };
|