@genai-fi/base 4.2.2 → 4.2.3

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,14 +1,14 @@
1
- import { jsx as I } from "react/jsx-runtime";
2
- import { ThemeProvider as Pe } from "@emotion/react";
3
- import { StyledEngineProvider as Le } from "@mui/material";
4
- import { theme as Se } from "../../style/theme.js";
5
- import * as i from "react";
6
- import { Suspense as ke } from "react";
7
- import * as $e from "react-dom";
8
- import Te from "../Loading/Loading.js";
9
- import { P as Me } from "../../react-D_xU5dL6.js";
1
+ import { jsx as A } from "react/jsx-runtime";
2
+ import { ThemeProvider as Ae } from "@emotion/react";
3
+ import { StyledEngineProvider as Ue } from "@mui/material";
4
+ import { theme as We } from "../../style/theme.js";
5
+ import * as o from "react";
6
+ import { Suspense as Be } from "react";
7
+ import * as He from "react-dom";
8
+ import je from "../Loading/Loading.js";
9
+ import { P as Ve } from "../../react-D_xU5dL6.js";
10
10
  /**
11
- * react-router v7.8.1
11
+ * react-router v7.13.0
12
12
  *
13
13
  * Copyright (c) Remix Software Inc.
14
14
  *
@@ -17,11 +17,11 @@ import { P as Me } from "../../react-D_xU5dL6.js";
17
17
  *
18
18
  * @license MIT
19
19
  */
20
- function E(e, t) {
20
+ function C(e, t) {
21
21
  if (e === !1 || e === null || typeof e > "u")
22
22
  throw new Error(t);
23
23
  }
24
- function S(e, t) {
24
+ function T(e, t) {
25
25
  if (!e) {
26
26
  typeof console < "u" && console.warn(t);
27
27
  try {
@@ -30,119 +30,119 @@ function S(e, t) {
30
30
  }
31
31
  }
32
32
  }
33
- function G({
33
+ function te({
34
34
  pathname: e = "/",
35
35
  search: t = "",
36
36
  hash: n = ""
37
37
  }) {
38
38
  return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
39
39
  }
40
- function z(e) {
40
+ function G(e) {
41
41
  let t = {};
42
42
  if (e) {
43
43
  let n = e.indexOf("#");
44
44
  n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
45
- let a = e.indexOf("?");
46
- a >= 0 && (t.search = e.substring(a), e = e.substring(0, a)), e && (t.pathname = e);
45
+ let r = e.indexOf("?");
46
+ r >= 0 && (t.search = e.substring(r), e = e.substring(0, r)), e && (t.pathname = e);
47
47
  }
48
48
  return t;
49
49
  }
50
- function se(e, t, n = "/") {
51
- return Ne(e, t, n, !1);
50
+ function ge(e, t, n = "/") {
51
+ return ze(e, t, n, !1);
52
52
  }
53
- function Ne(e, t, n, a) {
54
- let r = typeof t == "string" ? z(t) : t, o = T(r.pathname || "/", n);
55
- if (o == null)
53
+ function ze(e, t, n, r) {
54
+ let i = typeof t == "string" ? G(t) : t, a = M(i.pathname || "/", n);
55
+ if (a == null)
56
56
  return null;
57
- let l = ce(e);
58
- De(l);
59
- let c = null;
60
- for (let u = 0; c == null && u < l.length; ++u) {
61
- let s = je(o);
62
- c = _e(
57
+ let l = ye(e);
58
+ Je(l);
59
+ let s = null;
60
+ for (let u = 0; s == null && u < l.length; ++u) {
61
+ let f = rt(a);
62
+ s = tt(
63
63
  l[u],
64
- s,
65
- a
64
+ f,
65
+ r
66
66
  );
67
67
  }
68
- return c;
68
+ return s;
69
69
  }
70
- function ce(e, t = [], n = [], a = "", r = !1) {
71
- let o = (l, c, u = r, s) => {
72
- let f = {
73
- relativePath: s === void 0 ? l.path || "" : s,
70
+ function ye(e, t = [], n = [], r = "", i = !1) {
71
+ let a = (l, s, u = i, f) => {
72
+ let d = {
73
+ relativePath: f === void 0 ? l.path || "" : f,
74
74
  caseSensitive: l.caseSensitive === !0,
75
- childrenIndex: c,
75
+ childrenIndex: s,
76
76
  route: l
77
77
  };
78
- if (f.relativePath.startsWith("/")) {
79
- if (!f.relativePath.startsWith(a) && u)
78
+ if (d.relativePath.startsWith("/")) {
79
+ if (!d.relativePath.startsWith(r) && u)
80
80
  return;
81
- E(
82
- f.relativePath.startsWith(a),
83
- `Absolute route path "${f.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
84
- ), f.relativePath = f.relativePath.slice(a.length);
81
+ C(
82
+ d.relativePath.startsWith(r),
83
+ `Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
84
+ ), d.relativePath = d.relativePath.slice(r.length);
85
85
  }
86
- let d = $([a, f.relativePath]), h = n.concat(f);
87
- l.children && l.children.length > 0 && (E(
86
+ let c = D([r, d.relativePath]), h = n.concat(d);
87
+ l.children && l.children.length > 0 && (C(
88
88
  // Our types know better, but runtime JS may not!
89
89
  // @ts-expect-error
90
90
  l.index !== !0,
91
- `Index routes must not have child routes. Please remove all child routes from route path "${d}".`
92
- ), ce(
91
+ `Index routes must not have child routes. Please remove all child routes from route path "${c}".`
92
+ ), ye(
93
93
  l.children,
94
94
  t,
95
95
  h,
96
- d,
96
+ c,
97
97
  u
98
98
  )), !(l.path == null && !l.index) && t.push({
99
- path: d,
100
- score: Ue(d, l.index),
99
+ path: c,
100
+ score: Ze(c, l.index),
101
101
  routesMeta: h
102
102
  });
103
103
  };
104
- return e.forEach((l, c) => {
104
+ return e.forEach((l, s) => {
105
105
  var u;
106
106
  if (l.path === "" || !((u = l.path) != null && u.includes("?")))
107
- o(l, c);
107
+ a(l, s);
108
108
  else
109
- for (let s of fe(l.path))
110
- o(l, c, !0, s);
109
+ for (let f of Re(l.path))
110
+ a(l, s, !0, f);
111
111
  }), t;
112
112
  }
113
- function fe(e) {
113
+ function Re(e) {
114
114
  let t = e.split("/");
115
115
  if (t.length === 0) return [];
116
- let [n, ...a] = t, r = n.endsWith("?"), o = n.replace(/\?$/, "");
117
- if (a.length === 0)
118
- return r ? [o, ""] : [o];
119
- let l = fe(a.join("/")), c = [];
120
- return c.push(
116
+ let [n, ...r] = t, i = n.endsWith("?"), a = n.replace(/\?$/, "");
117
+ if (r.length === 0)
118
+ return i ? [a, ""] : [a];
119
+ let l = Re(r.join("/")), s = [];
120
+ return s.push(
121
121
  ...l.map(
122
- (u) => u === "" ? o : [o, u].join("/")
122
+ (u) => u === "" ? a : [a, u].join("/")
123
123
  )
124
- ), r && c.push(...l), c.map(
124
+ ), i && s.push(...l), s.map(
125
125
  (u) => e.startsWith("/") && u === "" ? "/" : u
126
126
  );
127
127
  }
128
- function De(e) {
128
+ function Je(e) {
129
129
  e.sort(
130
- (t, n) => t.score !== n.score ? n.score - t.score : He(
131
- t.routesMeta.map((a) => a.childrenIndex),
132
- n.routesMeta.map((a) => a.childrenIndex)
130
+ (t, n) => t.score !== n.score ? n.score - t.score : et(
131
+ t.routesMeta.map((r) => r.childrenIndex),
132
+ n.routesMeta.map((r) => r.childrenIndex)
133
133
  )
134
134
  );
135
135
  }
136
- var Fe = /^:[\w-]+$/, Ae = 3, Ie = 2, We = 1, Be = 10, Oe = -2, ae = (e) => e === "*";
137
- function Ue(e, t) {
138
- let n = e.split("/"), a = n.length;
139
- return n.some(ae) && (a += Oe), t && (a += Ie), n.filter((r) => !ae(r)).reduce(
140
- (r, o) => r + (Fe.test(o) ? Ae : o === "" ? We : Be),
141
- a
136
+ var Ye = /^:[\w-]+$/, Ke = 3, Ge = 2, qe = 1, Xe = 10, Qe = -2, ue = (e) => e === "*";
137
+ function Ze(e, t) {
138
+ let n = e.split("/"), r = n.length;
139
+ return n.some(ue) && (r += Qe), t && (r += Ge), n.filter((i) => !ue(i)).reduce(
140
+ (i, a) => i + (Ye.test(a) ? Ke : a === "" ? qe : Xe),
141
+ r
142
142
  );
143
143
  }
144
- function He(e, t) {
145
- return e.length === t.length && e.slice(0, -1).every((a, r) => a === t[r]) ? (
144
+ function et(e, t) {
145
+ return e.length === t.length && e.slice(0, -1).every((r, i) => r === t[i]) ? (
146
146
  // If two routes are siblings, we should try to match the earlier sibling
147
147
  // first. This allows people to have fine-grained control over the matching
148
148
  // behavior by simply putting routes with identical paths in the order they
@@ -154,340 +154,414 @@ function He(e, t) {
154
154
  0
155
155
  );
156
156
  }
157
- function _e(e, t, n = !1) {
158
- let { routesMeta: a } = e, r = {}, o = "/", l = [];
159
- for (let c = 0; c < a.length; ++c) {
160
- let u = a[c], s = c === a.length - 1, f = o === "/" ? t : t.slice(o.length) || "/", d = j(
161
- { path: u.relativePath, caseSensitive: u.caseSensitive, end: s },
162
- f
157
+ function tt(e, t, n = !1) {
158
+ let { routesMeta: r } = e, i = {}, a = "/", l = [];
159
+ for (let s = 0; s < r.length; ++s) {
160
+ let u = r[s], f = s === r.length - 1, d = a === "/" ? t : t.slice(a.length) || "/", c = K(
161
+ { path: u.relativePath, caseSensitive: u.caseSensitive, end: f },
162
+ d
163
163
  ), h = u.route;
164
- if (!d && s && n && !a[a.length - 1].route.index && (d = j(
164
+ if (!c && f && n && !r[r.length - 1].route.index && (c = K(
165
165
  {
166
166
  path: u.relativePath,
167
167
  caseSensitive: u.caseSensitive,
168
168
  end: !1
169
169
  },
170
- f
171
- )), !d)
170
+ d
171
+ )), !c)
172
172
  return null;
173
- Object.assign(r, d.params), l.push({
173
+ Object.assign(i, c.params), l.push({
174
174
  // TODO: Can this as be avoided?
175
- params: r,
176
- pathname: $([o, d.pathname]),
177
- pathnameBase: Ke(
178
- $([o, d.pathnameBase])
175
+ params: i,
176
+ pathname: D([a, c.pathname]),
177
+ pathnameBase: lt(
178
+ D([a, c.pathnameBase])
179
179
  ),
180
180
  route: h
181
- }), d.pathnameBase !== "/" && (o = $([o, d.pathnameBase]));
181
+ }), c.pathnameBase !== "/" && (a = D([a, c.pathnameBase]));
182
182
  }
183
183
  return l;
184
184
  }
185
- function j(e, t) {
185
+ function K(e, t) {
186
186
  typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
187
- let [n, a] = Ve(
187
+ let [n, r] = nt(
188
188
  e.path,
189
189
  e.caseSensitive,
190
190
  e.end
191
- ), r = t.match(n);
192
- if (!r) return null;
193
- let o = r[0], l = o.replace(/(.)\/+$/, "$1"), c = r.slice(1);
191
+ ), i = t.match(n);
192
+ if (!i) return null;
193
+ let a = i[0], l = a.replace(/(.)\/+$/, "$1"), s = i.slice(1);
194
194
  return {
195
- params: a.reduce(
196
- (s, { paramName: f, isOptional: d }, h) => {
197
- if (f === "*") {
198
- let p = c[h] || "";
199
- l = o.slice(0, o.length - p.length).replace(/(.)\/+$/, "$1");
195
+ params: r.reduce(
196
+ (f, { paramName: d, isOptional: c }, h) => {
197
+ if (d === "*") {
198
+ let y = s[h] || "";
199
+ l = a.slice(0, a.length - y.length).replace(/(.)\/+$/, "$1");
200
200
  }
201
- const y = c[h];
202
- return d && !y ? s[f] = void 0 : s[f] = (y || "").replace(/%2F/g, "/"), s;
201
+ const m = s[h];
202
+ return c && !m ? f[d] = void 0 : f[d] = (m || "").replace(/%2F/g, "/"), f;
203
203
  },
204
204
  {}
205
205
  ),
206
- pathname: o,
206
+ pathname: a,
207
207
  pathnameBase: l,
208
208
  pattern: e
209
209
  };
210
210
  }
211
- function Ve(e, t = !1, n = !0) {
212
- S(
211
+ function nt(e, t = !1, n = !0) {
212
+ T(
213
213
  e === "*" || !e.endsWith("*") || e.endsWith("/*"),
214
214
  `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
215
215
  );
216
- let a = [], r = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
216
+ let r = [], i = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
217
217
  /\/:([\w-]+)(\?)?/g,
218
- (l, c, u) => (a.push({ paramName: c, isOptional: u != null }), u ? "/?([^\\/]+)?" : "/([^\\/]+)")
218
+ (l, s, u) => (r.push({ paramName: s, isOptional: u != null }), u ? "/?([^\\/]+)?" : "/([^\\/]+)")
219
219
  ).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2");
220
- return e.endsWith("*") ? (a.push({ paramName: "*" }), r += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? r += "\\/*$" : e !== "" && e !== "/" && (r += "(?:(?=\\/|$))"), [new RegExp(r, t ? void 0 : "i"), a];
220
+ return e.endsWith("*") ? (r.push({ paramName: "*" }), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), r];
221
221
  }
222
- function je(e) {
222
+ function rt(e) {
223
223
  try {
224
224
  return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
225
225
  } catch (t) {
226
- return S(
226
+ return T(
227
227
  !1,
228
228
  `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
229
229
  ), e;
230
230
  }
231
231
  }
232
- function T(e, t) {
232
+ function M(e, t) {
233
233
  if (t === "/") return e;
234
234
  if (!e.toLowerCase().startsWith(t.toLowerCase()))
235
235
  return null;
236
- let n = t.endsWith("/") ? t.length - 1 : t.length, a = e.charAt(n);
237
- return a && a !== "/" ? null : e.slice(n) || "/";
236
+ let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
237
+ return r && r !== "/" ? null : e.slice(n) || "/";
238
238
  }
239
- function ze(e, t = "/") {
239
+ var at = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
240
+ function it(e, t = "/") {
240
241
  let {
241
242
  pathname: n,
242
- search: a = "",
243
- hash: r = ""
244
- } = typeof e == "string" ? z(e) : e;
245
- return {
246
- pathname: n ? n.startsWith("/") ? n : Ye(n, t) : t,
247
- search: qe(a),
248
- hash: Ge(r)
243
+ search: r = "",
244
+ hash: i = ""
245
+ } = typeof e == "string" ? G(e) : e, a;
246
+ return n ? (n = n.replace(/\/\/+/g, "/"), n.startsWith("/") ? a = ce(n.substring(1), "/") : a = ce(n, t)) : a = t, {
247
+ pathname: a,
248
+ search: st(r),
249
+ hash: ut(i)
249
250
  };
250
251
  }
251
- function Ye(e, t) {
252
+ function ce(e, t) {
252
253
  let n = t.replace(/\/+$/, "").split("/");
253
- return e.split("/").forEach((r) => {
254
- r === ".." ? n.length > 1 && n.pop() : r !== "." && n.push(r);
254
+ return e.split("/").forEach((i) => {
255
+ i === ".." ? n.length > 1 && n.pop() : i !== "." && n.push(i);
255
256
  }), n.length > 1 ? n.join("/") : "/";
256
257
  }
257
- function K(e, t, n, a) {
258
+ function Q(e, t, n, r) {
258
259
  return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
259
- a
260
+ r
260
261
  )}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
261
262
  }
262
- function Je(e) {
263
+ function ot(e) {
263
264
  return e.filter(
264
265
  (t, n) => n === 0 || t.route.path && t.route.path.length > 0
265
266
  );
266
267
  }
267
- function de(e) {
268
- let t = Je(e);
268
+ function we(e) {
269
+ let t = ot(e);
269
270
  return t.map(
270
- (n, a) => a === t.length - 1 ? n.pathname : n.pathnameBase
271
+ (n, r) => r === t.length - 1 ? n.pathname : n.pathnameBase
271
272
  );
272
273
  }
273
- function he(e, t, n, a = !1) {
274
- let r;
275
- typeof e == "string" ? r = z(e) : (r = { ...e }, E(
276
- !r.pathname || !r.pathname.includes("?"),
277
- K("?", "pathname", "search", r)
278
- ), E(
279
- !r.pathname || !r.pathname.includes("#"),
280
- K("#", "pathname", "hash", r)
281
- ), E(
282
- !r.search || !r.search.includes("#"),
283
- K("#", "search", "hash", r)
274
+ function Ee(e, t, n, r = !1) {
275
+ let i;
276
+ typeof e == "string" ? i = G(e) : (i = { ...e }, C(
277
+ !i.pathname || !i.pathname.includes("?"),
278
+ Q("?", "pathname", "search", i)
279
+ ), C(
280
+ !i.pathname || !i.pathname.includes("#"),
281
+ Q("#", "pathname", "hash", i)
282
+ ), C(
283
+ !i.search || !i.search.includes("#"),
284
+ Q("#", "search", "hash", i)
284
285
  ));
285
- let o = e === "" || r.pathname === "", l = o ? "/" : r.pathname, c;
286
+ let a = e === "" || i.pathname === "", l = a ? "/" : i.pathname, s;
286
287
  if (l == null)
287
- c = n;
288
+ s = n;
288
289
  else {
289
- let d = t.length - 1;
290
- if (!a && l.startsWith("..")) {
290
+ let c = t.length - 1;
291
+ if (!r && l.startsWith("..")) {
291
292
  let h = l.split("/");
292
293
  for (; h[0] === ".."; )
293
- h.shift(), d -= 1;
294
- r.pathname = h.join("/");
294
+ h.shift(), c -= 1;
295
+ i.pathname = h.join("/");
295
296
  }
296
- c = d >= 0 ? t[d] : "/";
297
+ s = c >= 0 ? t[c] : "/";
297
298
  }
298
- let u = ze(r, c), s = l && l !== "/" && l.endsWith("/"), f = (o || l === ".") && n.endsWith("/");
299
- return !u.pathname.endsWith("/") && (s || f) && (u.pathname += "/"), u;
299
+ let u = it(i, s), f = l && l !== "/" && l.endsWith("/"), d = (a || l === ".") && n.endsWith("/");
300
+ return !u.pathname.endsWith("/") && (f || d) && (u.pathname += "/"), u;
300
301
  }
301
- var $ = (e) => e.join("/").replace(/\/\/+/g, "/"), Ke = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), qe = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, Ge = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
302
- function Xe(e) {
302
+ var D = (e) => e.join("/").replace(/\/\/+/g, "/"), lt = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), st = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, ut = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e, ct = class {
303
+ constructor(e, t, n, r = !1) {
304
+ this.status = e, this.statusText = t || "", this.internal = r, n instanceof Error ? (this.data = n.toString(), this.error = n) : this.data = n;
305
+ }
306
+ };
307
+ function ft(e) {
303
308
  return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
304
309
  }
305
- var me = [
310
+ function xe(e) {
311
+ return e.map((t) => t.route.path).filter(Boolean).join("/").replace(/\/\/*/g, "/") || "/";
312
+ }
313
+ var Ce = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
314
+ function be(e, t) {
315
+ let n = e;
316
+ if (typeof n != "string" || !at.test(n))
317
+ return {
318
+ absoluteURL: void 0,
319
+ isExternal: !1,
320
+ to: n
321
+ };
322
+ let r = n, i = !1;
323
+ if (Ce)
324
+ try {
325
+ let a = new URL(window.location.href), l = n.startsWith("//") ? new URL(a.protocol + n) : new URL(n), s = M(l.pathname, t);
326
+ l.origin === a.origin && s != null ? n = s + l.search + l.hash : i = !0;
327
+ } catch {
328
+ T(
329
+ !1,
330
+ `<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
331
+ );
332
+ }
333
+ return {
334
+ absoluteURL: r,
335
+ isExternal: i,
336
+ to: n
337
+ };
338
+ }
339
+ Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
340
+ var Pe = [
306
341
  "POST",
307
342
  "PUT",
308
343
  "PATCH",
309
344
  "DELETE"
310
345
  ];
311
346
  new Set(
312
- me
347
+ Pe
313
348
  );
314
- var Qe = [
349
+ var dt = [
315
350
  "GET",
316
- ...me
351
+ ...Pe
317
352
  ];
318
- new Set(Qe);
319
- var D = i.createContext(null);
320
- D.displayName = "DataRouter";
321
- var B = i.createContext(null);
353
+ new Set(dt);
354
+ var F = o.createContext(null);
355
+ F.displayName = "DataRouter";
356
+ var B = o.createContext(null);
322
357
  B.displayName = "DataRouterState";
323
- i.createContext(!1);
324
- var X = i.createContext({
358
+ var Le = o.createContext(!1);
359
+ function ht() {
360
+ return o.useContext(Le);
361
+ }
362
+ var ne = o.createContext({
325
363
  isTransitioning: !1
326
364
  });
327
- X.displayName = "ViewTransition";
328
- var pe = i.createContext(
365
+ ne.displayName = "ViewTransition";
366
+ var Se = o.createContext(
329
367
  /* @__PURE__ */ new Map()
330
368
  );
331
- pe.displayName = "Fetchers";
332
- var Ze = i.createContext(null);
333
- Ze.displayName = "Await";
334
- var k = i.createContext(
369
+ Se.displayName = "Fetchers";
370
+ var mt = o.createContext(null);
371
+ mt.displayName = "Await";
372
+ var S = o.createContext(
335
373
  null
336
374
  );
337
- k.displayName = "Navigation";
338
- var Y = i.createContext(
375
+ S.displayName = "Navigation";
376
+ var q = o.createContext(
339
377
  null
340
378
  );
341
- Y.displayName = "Location";
342
- var M = i.createContext({
379
+ q.displayName = "Location";
380
+ var N = o.createContext({
343
381
  outlet: null,
344
382
  matches: [],
345
383
  isDataRoute: !1
346
384
  });
347
- M.displayName = "Route";
348
- var Q = i.createContext(null);
349
- Q.displayName = "RouteError";
350
- function et(e, { relative: t } = {}) {
351
- E(
352
- O(),
385
+ N.displayName = "Route";
386
+ var re = o.createContext(null);
387
+ re.displayName = "RouteError";
388
+ var $e = "REACT_ROUTER_ERROR", pt = "REDIRECT", vt = "ROUTE_ERROR_RESPONSE";
389
+ function gt(e) {
390
+ if (e.startsWith(`${$e}:${pt}:{`))
391
+ try {
392
+ let t = JSON.parse(e.slice(28));
393
+ if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string" && typeof t.location == "string" && typeof t.reloadDocument == "boolean" && typeof t.replace == "boolean")
394
+ return t;
395
+ } catch {
396
+ }
397
+ }
398
+ function yt(e) {
399
+ if (e.startsWith(
400
+ `${$e}:${vt}:{`
401
+ ))
402
+ try {
403
+ let t = JSON.parse(e.slice(40));
404
+ if (typeof t == "object" && t && typeof t.status == "number" && typeof t.statusText == "string")
405
+ return new ct(
406
+ t.status,
407
+ t.statusText,
408
+ t.data
409
+ );
410
+ } catch {
411
+ }
412
+ }
413
+ function Rt(e, { relative: t } = {}) {
414
+ C(
415
+ H(),
353
416
  // TODO: This error is probably because they somehow have 2 versions of the
354
417
  // router loaded. We can help them understand how to avoid that.
355
418
  "useHref() may be used only in the context of a <Router> component."
356
419
  );
357
- let { basename: n, navigator: a } = i.useContext(k), { hash: r, pathname: o, search: l } = U(e, { relative: t }), c = o;
358
- return n !== "/" && (c = o === "/" ? n : $([n, o])), a.createHref({ pathname: c, search: l, hash: r });
420
+ let { basename: n, navigator: r } = o.useContext(S), { hash: i, pathname: a, search: l } = j(e, { relative: t }), s = a;
421
+ return n !== "/" && (s = a === "/" ? n : D([n, a])), r.createHref({ pathname: s, search: l, hash: i });
359
422
  }
360
- function O() {
361
- return i.useContext(Y) != null;
423
+ function H() {
424
+ return o.useContext(q) != null;
362
425
  }
363
- function F() {
364
- return E(
365
- O(),
426
+ function _() {
427
+ return C(
428
+ H(),
366
429
  // TODO: This error is probably because they somehow have 2 versions of the
367
430
  // router loaded. We can help them understand how to avoid that.
368
431
  "useLocation() may be used only in the context of a <Router> component."
369
- ), i.useContext(Y).location;
432
+ ), o.useContext(q).location;
370
433
  }
371
- var ve = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
372
- function ge(e) {
373
- i.useContext(k).static || i.useLayoutEffect(e);
434
+ var ke = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
435
+ function Te(e) {
436
+ o.useContext(S).static || o.useLayoutEffect(e);
374
437
  }
375
- function tt() {
376
- let { isDataRoute: e } = i.useContext(M);
377
- return e ? mt() : nt();
438
+ function wt() {
439
+ let { isDataRoute: e } = o.useContext(N);
440
+ return e ? Mt() : Et();
378
441
  }
379
- function nt() {
380
- E(
381
- O(),
442
+ function Et() {
443
+ C(
444
+ H(),
382
445
  // TODO: This error is probably because they somehow have 2 versions of the
383
446
  // router loaded. We can help them understand how to avoid that.
384
447
  "useNavigate() may be used only in the context of a <Router> component."
385
448
  );
386
- let e = i.useContext(D), { basename: t, navigator: n } = i.useContext(k), { matches: a } = i.useContext(M), { pathname: r } = F(), o = JSON.stringify(de(a)), l = i.useRef(!1);
387
- return ge(() => {
449
+ let e = o.useContext(F), { basename: t, navigator: n } = o.useContext(S), { matches: r } = o.useContext(N), { pathname: i } = _(), a = JSON.stringify(we(r)), l = o.useRef(!1);
450
+ return Te(() => {
388
451
  l.current = !0;
389
- }), i.useCallback(
390
- (u, s = {}) => {
391
- if (S(l.current, ve), !l.current) return;
452
+ }), o.useCallback(
453
+ (u, f = {}) => {
454
+ if (T(l.current, ke), !l.current) return;
392
455
  if (typeof u == "number") {
393
456
  n.go(u);
394
457
  return;
395
458
  }
396
- let f = he(
459
+ let d = Ee(
397
460
  u,
398
- JSON.parse(o),
399
- r,
400
- s.relative === "path"
461
+ JSON.parse(a),
462
+ i,
463
+ f.relative === "path"
401
464
  );
402
- e == null && t !== "/" && (f.pathname = f.pathname === "/" ? t : $([t, f.pathname])), (s.replace ? n.replace : n.push)(
403
- f,
404
- s.state,
405
- s
465
+ e == null && t !== "/" && (d.pathname = d.pathname === "/" ? t : D([t, d.pathname])), (f.replace ? n.replace : n.push)(
466
+ d,
467
+ f.state,
468
+ f
406
469
  );
407
470
  },
408
471
  [
409
472
  t,
410
473
  n,
411
- o,
412
- r,
474
+ a,
475
+ i,
413
476
  e
414
477
  ]
415
478
  );
416
479
  }
417
- i.createContext(null);
418
- function U(e, { relative: t } = {}) {
419
- let { matches: n } = i.useContext(M), { pathname: a } = F(), r = JSON.stringify(de(n));
420
- return i.useMemo(
421
- () => he(
480
+ o.createContext(null);
481
+ function j(e, { relative: t } = {}) {
482
+ let { matches: n } = o.useContext(N), { pathname: r } = _(), i = JSON.stringify(we(n));
483
+ return o.useMemo(
484
+ () => Ee(
422
485
  e,
423
- JSON.parse(r),
424
- a,
486
+ JSON.parse(i),
487
+ r,
425
488
  t === "path"
426
489
  ),
427
- [e, r, a, t]
490
+ [e, i, r, t]
428
491
  );
429
492
  }
430
- function rt(e, t, n, a) {
431
- E(
432
- O(),
493
+ function xt(e, t, n, r, i) {
494
+ C(
495
+ H(),
433
496
  // TODO: This error is probably because they somehow have 2 versions of the
434
497
  // router loaded. We can help them understand how to avoid that.
435
498
  "useRoutes() may be used only in the context of a <Router> component."
436
499
  );
437
- let { navigator: r } = i.useContext(k), { matches: o } = i.useContext(M), l = o[o.length - 1], c = l ? l.params : {}, u = l ? l.pathname : "/", s = l ? l.pathnameBase : "/", f = l && l.route;
500
+ let { navigator: a } = o.useContext(S), { matches: l } = o.useContext(N), s = l[l.length - 1], u = s ? s.params : {}, f = s ? s.pathname : "/", d = s ? s.pathnameBase : "/", c = s && s.route;
438
501
  {
439
- let m = f && f.path || "";
440
- ye(
441
- u,
442
- !f || m.endsWith("*") || m.endsWith("*?"),
443
- `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${m}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
502
+ let p = c && c.path || "";
503
+ De(
504
+ f,
505
+ !c || p.endsWith("*") || p.endsWith("*?"),
506
+ `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${p}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
444
507
 
445
- Please change the parent <Route path="${m}"> to <Route path="${m === "/" ? "*" : `${m}/*`}">.`
508
+ Please change the parent <Route path="${p}"> to <Route path="${p === "/" ? "*" : `${p}/*`}">.`
446
509
  );
447
510
  }
448
- let d = F(), h;
449
- h = d;
450
- let y = h.pathname || "/", p = y;
451
- if (s !== "/") {
452
- let m = s.replace(/^\//, "").split("/");
453
- p = "/" + y.replace(/^\//, "").split("/").slice(m.length).join("/");
511
+ let h = _(), m;
512
+ m = h;
513
+ let y = m.pathname || "/", v = y;
514
+ if (d !== "/") {
515
+ let p = d.replace(/^\//, "").split("/");
516
+ v = "/" + y.replace(/^\//, "").split("/").slice(p.length).join("/");
454
517
  }
455
- let g = se(e, { pathname: p });
456
- return S(
457
- f || g != null,
458
- `No routes matched location "${h.pathname}${h.search}${h.hash}" `
459
- ), S(
518
+ let g = ge(e, { pathname: v });
519
+ return T(
520
+ c || g != null,
521
+ `No routes matched location "${m.pathname}${m.search}${m.hash}" `
522
+ ), T(
460
523
  g == null || g[g.length - 1].route.element !== void 0 || g[g.length - 1].route.Component !== void 0 || g[g.length - 1].route.lazy !== void 0,
461
- `Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
462
- ), ut(
524
+ `Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
525
+ ), St(
463
526
  g && g.map(
464
- (m) => Object.assign({}, m, {
465
- params: Object.assign({}, c, m.params),
466
- pathname: $([
467
- s,
468
- // Re-encode pathnames that were decoded inside matchRoutes
469
- r.encodeLocation ? r.encodeLocation(m.pathname).pathname : m.pathname
527
+ (p) => Object.assign({}, p, {
528
+ params: Object.assign({}, u, p.params),
529
+ pathname: D([
530
+ d,
531
+ // Re-encode pathnames that were decoded inside matchRoutes.
532
+ // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
533
+ // `new URL()` internally and we need to prevent it from treating
534
+ // them as separators
535
+ a.encodeLocation ? a.encodeLocation(
536
+ p.pathname.replace(/\?/g, "%3F").replace(/#/g, "%23")
537
+ ).pathname : p.pathname
470
538
  ]),
471
- pathnameBase: m.pathnameBase === "/" ? s : $([
472
- s,
539
+ pathnameBase: p.pathnameBase === "/" ? d : D([
540
+ d,
473
541
  // Re-encode pathnames that were decoded inside matchRoutes
474
- r.encodeLocation ? r.encodeLocation(m.pathnameBase).pathname : m.pathnameBase
542
+ // Pre-encode `?` and `#` ahead of `encodeLocation` because it uses
543
+ // `new URL()` internally and we need to prevent it from treating
544
+ // them as separators
545
+ a.encodeLocation ? a.encodeLocation(
546
+ p.pathnameBase.replace(/\?/g, "%3F").replace(/#/g, "%23")
547
+ ).pathname : p.pathnameBase
475
548
  ])
476
549
  })
477
550
  ),
478
- o,
551
+ l,
479
552
  n,
480
- a
553
+ r,
554
+ i
481
555
  );
482
556
  }
483
- function at() {
484
- let e = ht(), t = Xe(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, a = "rgba(200,200,200, 0.5)", r = { padding: "0.5rem", backgroundColor: a }, o = { padding: "2px 4px", backgroundColor: a }, l = null;
557
+ function Ct() {
558
+ let e = Dt(), t = ft(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, r = "rgba(200,200,200, 0.5)", i = { padding: "0.5rem", backgroundColor: r }, a = { padding: "2px 4px", backgroundColor: r }, l = null;
485
559
  return console.error(
486
560
  "Error handled by React Router default ErrorBoundary:",
487
561
  e
488
- ), l = /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ i.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ i.createElement("code", { style: o }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ i.createElement("code", { style: o }, "errorElement"), " prop on your route.")), /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ i.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ i.createElement("pre", { style: r }, n) : null, l);
562
+ ), l = /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ o.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ o.createElement("code", { style: a }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ o.createElement("code", { style: a }, "errorElement"), " prop on your route.")), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ o.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ o.createElement("pre", { style: i }, n) : null, l);
489
563
  }
490
- var ot = /* @__PURE__ */ i.createElement(at, null), it = class extends i.Component {
564
+ var bt = /* @__PURE__ */ o.createElement(Ct, null), Oe = class extends o.Component {
491
565
  constructor(e) {
492
566
  super(e), this.state = {
493
567
  location: e.location,
@@ -510,27 +584,67 @@ var ot = /* @__PURE__ */ i.createElement(at, null), it = class extends i.Compone
510
584
  };
511
585
  }
512
586
  componentDidCatch(e, t) {
513
- console.error(
587
+ this.props.onError ? this.props.onError(e, t) : console.error(
514
588
  "React Router caught the following error during render",
515
- e,
516
- t
589
+ e
517
590
  );
518
591
  }
519
592
  render() {
520
- return this.state.error !== void 0 ? /* @__PURE__ */ i.createElement(M.Provider, { value: this.props.routeContext }, /* @__PURE__ */ i.createElement(
521
- Q.Provider,
593
+ let e = this.state.error;
594
+ if (this.context && typeof e == "object" && e && "digest" in e && typeof e.digest == "string") {
595
+ const n = yt(e.digest);
596
+ n && (e = n);
597
+ }
598
+ let t = e !== void 0 ? /* @__PURE__ */ o.createElement(N.Provider, { value: this.props.routeContext }, /* @__PURE__ */ o.createElement(
599
+ re.Provider,
522
600
  {
523
- value: this.state.error,
601
+ value: e,
524
602
  children: this.props.component
525
603
  }
526
604
  )) : this.props.children;
605
+ return this.context ? /* @__PURE__ */ o.createElement(Pt, { error: e }, t) : t;
527
606
  }
528
607
  };
529
- function lt({ routeContext: e, match: t, children: n }) {
530
- let a = i.useContext(D);
531
- return a && a.static && a.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (a.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ i.createElement(M.Provider, { value: e }, n);
608
+ Oe.contextType = Le;
609
+ var Z = /* @__PURE__ */ new WeakMap();
610
+ function Pt({
611
+ children: e,
612
+ error: t
613
+ }) {
614
+ let { basename: n } = o.useContext(S);
615
+ if (typeof t == "object" && t && "digest" in t && typeof t.digest == "string") {
616
+ let r = gt(t.digest);
617
+ if (r) {
618
+ let i = Z.get(t);
619
+ if (i) throw i;
620
+ let a = be(r.location, n);
621
+ if (Ce && !Z.get(t))
622
+ if (a.isExternal || r.reloadDocument)
623
+ window.location.href = a.absoluteURL || a.to;
624
+ else {
625
+ const l = Promise.resolve().then(
626
+ () => window.__reactRouterDataRouter.navigate(a.to, {
627
+ replace: r.replace
628
+ })
629
+ );
630
+ throw Z.set(t, l), l;
631
+ }
632
+ return /* @__PURE__ */ o.createElement(
633
+ "meta",
634
+ {
635
+ httpEquiv: "refresh",
636
+ content: `0;url=${a.absoluteURL || a.to}`
637
+ }
638
+ );
639
+ }
640
+ }
641
+ return e;
642
+ }
643
+ function Lt({ routeContext: e, match: t, children: n }) {
644
+ let r = o.useContext(F);
645
+ return r && r.static && r.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (r.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ o.createElement(N.Provider, { value: e }, n);
532
646
  }
533
- function ut(e, t = [], n = null, a = null) {
647
+ function St(e, t = [], n = null, r = null, i = null) {
534
648
  if (e == null) {
535
649
  if (!n)
536
650
  return null;
@@ -541,136 +655,151 @@ function ut(e, t = [], n = null, a = null) {
541
655
  else
542
656
  return null;
543
657
  }
544
- let r = e, o = n == null ? void 0 : n.errors;
545
- if (o != null) {
546
- let u = r.findIndex(
547
- (s) => s.route.id && (o == null ? void 0 : o[s.route.id]) !== void 0
658
+ let a = e, l = n == null ? void 0 : n.errors;
659
+ if (l != null) {
660
+ let d = a.findIndex(
661
+ (c) => c.route.id && (l == null ? void 0 : l[c.route.id]) !== void 0
548
662
  );
549
- E(
550
- u >= 0,
663
+ C(
664
+ d >= 0,
551
665
  `Could not find a matching route for errors on route IDs: ${Object.keys(
552
- o
666
+ l
553
667
  ).join(",")}`
554
- ), r = r.slice(
668
+ ), a = a.slice(
555
669
  0,
556
- Math.min(r.length, u + 1)
670
+ Math.min(a.length, d + 1)
557
671
  );
558
672
  }
559
- let l = !1, c = -1;
673
+ let s = !1, u = -1;
560
674
  if (n)
561
- for (let u = 0; u < r.length; u++) {
562
- let s = r[u];
563
- if ((s.route.HydrateFallback || s.route.hydrateFallbackElement) && (c = u), s.route.id) {
564
- let { loaderData: f, errors: d } = n, h = s.route.loader && !f.hasOwnProperty(s.route.id) && (!d || d[s.route.id] === void 0);
565
- if (s.route.lazy || h) {
566
- l = !0, c >= 0 ? r = r.slice(0, c + 1) : r = [r[0]];
675
+ for (let d = 0; d < a.length; d++) {
676
+ let c = a[d];
677
+ if ((c.route.HydrateFallback || c.route.hydrateFallbackElement) && (u = d), c.route.id) {
678
+ let { loaderData: h, errors: m } = n, y = c.route.loader && !h.hasOwnProperty(c.route.id) && (!m || m[c.route.id] === void 0);
679
+ if (c.route.lazy || y) {
680
+ s = !0, u >= 0 ? a = a.slice(0, u + 1) : a = [a[0]];
567
681
  break;
568
682
  }
569
683
  }
570
684
  }
571
- return r.reduceRight(
572
- (u, s, f) => {
573
- let d, h = !1, y = null, p = null;
574
- n && (d = o && s.route.id ? o[s.route.id] : void 0, y = s.route.errorElement || ot, l && (c < 0 && f === 0 ? (ye(
685
+ let f = n && r ? (d, c) => {
686
+ var h, m;
687
+ r(d, {
688
+ location: n.location,
689
+ params: ((m = (h = n.matches) == null ? void 0 : h[0]) == null ? void 0 : m.params) ?? {},
690
+ unstable_pattern: xe(n.matches),
691
+ errorInfo: c
692
+ });
693
+ } : void 0;
694
+ return a.reduceRight(
695
+ (d, c, h) => {
696
+ let m, y = !1, v = null, g = null;
697
+ n && (m = l && c.route.id ? l[c.route.id] : void 0, v = c.route.errorElement || bt, s && (u < 0 && h === 0 ? (De(
575
698
  "route-fallback",
576
699
  !1,
577
700
  "No `HydrateFallback` element provided to render during initial hydration"
578
- ), h = !0, p = null) : c === f && (h = !0, p = s.route.hydrateFallbackElement || null)));
579
- let g = t.concat(r.slice(0, f + 1)), w = () => {
580
- let m;
581
- return d ? m = y : h ? m = p : s.route.Component ? m = /* @__PURE__ */ i.createElement(s.route.Component, null) : s.route.element ? m = s.route.element : m = u, /* @__PURE__ */ i.createElement(
582
- lt,
701
+ ), y = !0, g = null) : u === h && (y = !0, g = c.route.hydrateFallbackElement || null)));
702
+ let R = t.concat(a.slice(0, h + 1)), p = () => {
703
+ let w;
704
+ return m ? w = v : y ? w = g : c.route.Component ? w = /* @__PURE__ */ o.createElement(c.route.Component, null) : c.route.element ? w = c.route.element : w = d, /* @__PURE__ */ o.createElement(
705
+ Lt,
583
706
  {
584
- match: s,
707
+ match: c,
585
708
  routeContext: {
586
- outlet: u,
587
- matches: g,
709
+ outlet: d,
710
+ matches: R,
588
711
  isDataRoute: n != null
589
712
  },
590
- children: m
713
+ children: w
591
714
  }
592
715
  );
593
716
  };
594
- return n && (s.route.ErrorBoundary || s.route.errorElement || f === 0) ? /* @__PURE__ */ i.createElement(
595
- it,
717
+ return n && (c.route.ErrorBoundary || c.route.errorElement || h === 0) ? /* @__PURE__ */ o.createElement(
718
+ Oe,
596
719
  {
597
720
  location: n.location,
598
721
  revalidation: n.revalidation,
599
- component: y,
600
- error: d,
601
- children: w(),
602
- routeContext: { outlet: null, matches: g, isDataRoute: !0 }
722
+ component: v,
723
+ error: m,
724
+ children: p(),
725
+ routeContext: { outlet: null, matches: R, isDataRoute: !0 },
726
+ onError: f
603
727
  }
604
- ) : w();
728
+ ) : p();
605
729
  },
606
730
  null
607
731
  );
608
732
  }
609
- function Z(e) {
733
+ function ae(e) {
610
734
  return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
611
735
  }
612
- function st(e) {
613
- let t = i.useContext(D);
614
- return E(t, Z(e)), t;
736
+ function $t(e) {
737
+ let t = o.useContext(F);
738
+ return C(t, ae(e)), t;
615
739
  }
616
- function ct(e) {
617
- let t = i.useContext(B);
618
- return E(t, Z(e)), t;
740
+ function kt(e) {
741
+ let t = o.useContext(B);
742
+ return C(t, ae(e)), t;
619
743
  }
620
- function ft(e) {
621
- let t = i.useContext(M);
622
- return E(t, Z(e)), t;
744
+ function Tt(e) {
745
+ let t = o.useContext(N);
746
+ return C(t, ae(e)), t;
623
747
  }
624
- function ee(e) {
625
- let t = ft(e), n = t.matches[t.matches.length - 1];
626
- return E(
748
+ function ie(e) {
749
+ let t = Tt(e), n = t.matches[t.matches.length - 1];
750
+ return C(
627
751
  n.route.id,
628
752
  `${e} can only be used on routes that contain a unique "id"`
629
753
  ), n.route.id;
630
754
  }
631
- function dt() {
632
- return ee(
755
+ function Ot() {
756
+ return ie(
633
757
  "useRouteId"
634
758
  /* UseRouteId */
635
759
  );
636
760
  }
637
- function ht() {
638
- var a;
639
- let e = i.useContext(Q), t = ct(
761
+ function Dt() {
762
+ var r;
763
+ let e = o.useContext(re), t = kt(
640
764
  "useRouteError"
641
765
  /* UseRouteError */
642
- ), n = ee(
766
+ ), n = ie(
643
767
  "useRouteError"
644
768
  /* UseRouteError */
645
769
  );
646
- return e !== void 0 ? e : (a = t.errors) == null ? void 0 : a[n];
770
+ return e !== void 0 ? e : (r = t.errors) == null ? void 0 : r[n];
647
771
  }
648
- function mt() {
649
- let { router: e } = st(
772
+ function Mt() {
773
+ let { router: e } = $t(
650
774
  "useNavigate"
651
775
  /* UseNavigateStable */
652
- ), t = ee(
776
+ ), t = ie(
653
777
  "useNavigate"
654
778
  /* UseNavigateStable */
655
- ), n = i.useRef(!1);
656
- return ge(() => {
779
+ ), n = o.useRef(!1);
780
+ return Te(() => {
657
781
  n.current = !0;
658
- }), i.useCallback(
659
- async (r, o = {}) => {
660
- S(n.current, ve), n.current && (typeof r == "number" ? e.navigate(r) : await e.navigate(r, { fromRouteId: t, ...o }));
782
+ }), o.useCallback(
783
+ async (i, a = {}) => {
784
+ T(n.current, ke), n.current && (typeof i == "number" ? await e.navigate(i) : await e.navigate(i, { fromRouteId: t, ...a }));
661
785
  },
662
786
  [e, t]
663
787
  );
664
788
  }
665
- var oe = {};
666
- function ye(e, t, n) {
667
- !t && !oe[e] && (oe[e] = !0, S(!1, n));
789
+ var fe = {};
790
+ function De(e, t, n) {
791
+ !t && !fe[e] && (fe[e] = !0, T(!1, n));
668
792
  }
669
- var ie = {};
670
- function le(e, t) {
671
- !e && !ie[t] && (ie[t] = !0, console.warn(t));
793
+ var de = {};
794
+ function he(e, t) {
795
+ !e && !de[t] && (de[t] = !0, console.warn(t));
796
+ }
797
+ var Nt = "useOptimistic", me = o[Nt], It = () => {
798
+ };
799
+ function Ft(e) {
800
+ return me ? me(e) : [e, It];
672
801
  }
673
- var pt = class {
802
+ var _t = class {
674
803
  constructor() {
675
804
  this.status = "pending", this.promise = new Promise((e, t) => {
676
805
  this.resolve = (n) => {
@@ -681,264 +810,314 @@ var pt = class {
681
810
  });
682
811
  }
683
812
  };
684
- function vt({
813
+ function At({
685
814
  router: e,
686
- flushSync: t
815
+ flushSync: t,
816
+ onError: n,
817
+ unstable_useTransitions: r
687
818
  }) {
688
- let [n, a] = i.useState(e.state), [r, o] = i.useState(), [l, c] = i.useState({
819
+ r = ht() || r;
820
+ let [a, l] = o.useState(e.state), [s, u] = Ft(a), [f, d] = o.useState(), [c, h] = o.useState({
689
821
  isTransitioning: !1
690
- }), [u, s] = i.useState(), [f, d] = i.useState(), [h, y] = i.useState(), p = i.useRef(/* @__PURE__ */ new Map()), g = i.useCallback(
691
- (v, { deletedFetchers: C, flushSync: x, viewTransitionOpts: b }) => {
692
- v.fetchers.forEach((L, P) => {
693
- L.data !== void 0 && p.current.set(P, L.data);
694
- }), C.forEach((L) => p.current.delete(L)), le(
695
- x === !1 || t != null,
822
+ }), [m, y] = o.useState(), [v, g] = o.useState(), [R, p] = o.useState(), w = o.useRef(/* @__PURE__ */ new Map()), $ = o.useCallback(
823
+ (E, { deletedFetchers: P, newErrors: x, flushSync: U, viewTransitionOpts: I }) => {
824
+ x && n && Object.values(x).forEach(
825
+ (k) => {
826
+ var V;
827
+ return n(k, {
828
+ location: E.location,
829
+ params: ((V = E.matches[0]) == null ? void 0 : V.params) ?? {},
830
+ unstable_pattern: xe(E.matches)
831
+ });
832
+ }
833
+ ), E.fetchers.forEach((k, V) => {
834
+ k.data !== void 0 && w.current.set(V, k.data);
835
+ }), P.forEach((k) => w.current.delete(k)), he(
836
+ U === !1 || t != null,
696
837
  'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
697
838
  );
698
- let N = e.window != null && e.window.document != null && typeof e.window.document.startViewTransition == "function";
699
- if (le(
700
- b == null || N,
839
+ let se = e.window != null && e.window.document != null && typeof e.window.document.startViewTransition == "function";
840
+ if (he(
841
+ I == null || se,
701
842
  "You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."
702
- ), !b || !N) {
703
- t && x ? t(() => a(v)) : i.startTransition(() => a(v));
843
+ ), !I || !se) {
844
+ t && U ? t(() => l(E)) : r === !1 ? l(E) : o.startTransition(() => {
845
+ r === !0 && u((k) => pe(k, E)), l(E);
846
+ });
704
847
  return;
705
848
  }
706
- if (t && x) {
849
+ if (t && U) {
707
850
  t(() => {
708
- f && (u && u.resolve(), f.skipTransition()), c({
851
+ v && (m == null || m.resolve(), v.skipTransition()), h({
709
852
  isTransitioning: !0,
710
853
  flushSync: !0,
711
- currentLocation: b.currentLocation,
712
- nextLocation: b.nextLocation
854
+ currentLocation: I.currentLocation,
855
+ nextLocation: I.nextLocation
713
856
  });
714
857
  });
715
- let L = e.window.document.startViewTransition(() => {
716
- t(() => a(v));
858
+ let k = e.window.document.startViewTransition(() => {
859
+ t(() => l(E));
717
860
  });
718
- L.finished.finally(() => {
861
+ k.finished.finally(() => {
719
862
  t(() => {
720
- s(void 0), d(void 0), o(void 0), c({ isTransitioning: !1 });
863
+ y(void 0), g(void 0), d(void 0), h({ isTransitioning: !1 });
721
864
  });
722
- }), t(() => d(L));
865
+ }), t(() => g(k));
723
866
  return;
724
867
  }
725
- f ? (u && u.resolve(), f.skipTransition(), y({
726
- state: v,
727
- currentLocation: b.currentLocation,
728
- nextLocation: b.nextLocation
729
- })) : (o(v), c({
868
+ v ? (m == null || m.resolve(), v.skipTransition(), p({
869
+ state: E,
870
+ currentLocation: I.currentLocation,
871
+ nextLocation: I.nextLocation
872
+ })) : (d(E), h({
730
873
  isTransitioning: !0,
731
874
  flushSync: !1,
732
- currentLocation: b.currentLocation,
733
- nextLocation: b.nextLocation
875
+ currentLocation: I.currentLocation,
876
+ nextLocation: I.nextLocation
734
877
  }));
735
878
  },
736
- [e.window, t, f, u]
879
+ [
880
+ e.window,
881
+ t,
882
+ v,
883
+ m,
884
+ r,
885
+ u,
886
+ n
887
+ ]
737
888
  );
738
- i.useLayoutEffect(() => e.subscribe(g), [e, g]), i.useEffect(() => {
739
- l.isTransitioning && !l.flushSync && s(new pt());
740
- }, [l]), i.useEffect(() => {
741
- if (u && r && e.window) {
742
- let v = r, C = u.promise, x = e.window.document.startViewTransition(async () => {
743
- i.startTransition(() => a(v)), await C;
889
+ o.useLayoutEffect(() => e.subscribe($), [e, $]), o.useEffect(() => {
890
+ c.isTransitioning && !c.flushSync && y(new _t());
891
+ }, [c]), o.useEffect(() => {
892
+ if (m && f && e.window) {
893
+ let E = f, P = m.promise, x = e.window.document.startViewTransition(async () => {
894
+ r === !1 ? l(E) : o.startTransition(() => {
895
+ r === !0 && u((U) => pe(U, E)), l(E);
896
+ }), await P;
744
897
  });
745
898
  x.finished.finally(() => {
746
- s(void 0), d(void 0), o(void 0), c({ isTransitioning: !1 });
747
- }), d(x);
899
+ y(void 0), g(void 0), d(void 0), h({ isTransitioning: !1 });
900
+ }), g(x);
748
901
  }
749
- }, [r, u, e.window]), i.useEffect(() => {
750
- u && r && n.location.key === r.location.key && u.resolve();
751
- }, [u, f, n.location, r]), i.useEffect(() => {
752
- !l.isTransitioning && h && (o(h.state), c({
902
+ }, [
903
+ f,
904
+ m,
905
+ e.window,
906
+ r,
907
+ u
908
+ ]), o.useEffect(() => {
909
+ m && f && s.location.key === f.location.key && m.resolve();
910
+ }, [m, v, s.location, f]), o.useEffect(() => {
911
+ !c.isTransitioning && R && (d(R.state), h({
753
912
  isTransitioning: !0,
754
913
  flushSync: !1,
755
- currentLocation: h.currentLocation,
756
- nextLocation: h.nextLocation
757
- }), y(void 0));
758
- }, [l.isTransitioning, h]);
759
- let w = i.useMemo(() => ({
914
+ currentLocation: R.currentLocation,
915
+ nextLocation: R.nextLocation
916
+ }), p(void 0));
917
+ }, [c.isTransitioning, R]);
918
+ let b = o.useMemo(() => ({
760
919
  createHref: e.createHref,
761
920
  encodeLocation: e.encodeLocation,
762
- go: (v) => e.navigate(v),
763
- push: (v, C, x) => e.navigate(v, {
764
- state: C,
921
+ go: (E) => e.navigate(E),
922
+ push: (E, P, x) => e.navigate(E, {
923
+ state: P,
765
924
  preventScrollReset: x == null ? void 0 : x.preventScrollReset
766
925
  }),
767
- replace: (v, C, x) => e.navigate(v, {
926
+ replace: (E, P, x) => e.navigate(E, {
768
927
  replace: !0,
769
- state: C,
928
+ state: P,
770
929
  preventScrollReset: x == null ? void 0 : x.preventScrollReset
771
930
  })
772
- }), [e]), m = e.basename || "/", R = i.useMemo(
931
+ }), [e]), L = e.basename || "/", O = o.useMemo(
773
932
  () => ({
774
933
  router: e,
775
- navigator: w,
934
+ navigator: b,
776
935
  static: !1,
777
- basename: m
936
+ basename: L,
937
+ onError: n
778
938
  }),
779
- [e, w, m]
939
+ [e, b, L, n]
780
940
  );
781
- return /* @__PURE__ */ i.createElement(i.Fragment, null, /* @__PURE__ */ i.createElement(D.Provider, { value: R }, /* @__PURE__ */ i.createElement(B.Provider, { value: n }, /* @__PURE__ */ i.createElement(pe.Provider, { value: p.current }, /* @__PURE__ */ i.createElement(X.Provider, { value: l }, /* @__PURE__ */ i.createElement(
782
- wt,
941
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(F.Provider, { value: O }, /* @__PURE__ */ o.createElement(B.Provider, { value: s }, /* @__PURE__ */ o.createElement(Se.Provider, { value: w.current }, /* @__PURE__ */ o.createElement(ne.Provider, { value: c }, /* @__PURE__ */ o.createElement(
942
+ Bt,
783
943
  {
784
- basename: m,
785
- location: n.location,
786
- navigationType: n.historyAction,
787
- navigator: w
944
+ basename: L,
945
+ location: s.location,
946
+ navigationType: s.historyAction,
947
+ navigator: b,
948
+ unstable_useTransitions: r
788
949
  },
789
- /* @__PURE__ */ i.createElement(
790
- gt,
950
+ /* @__PURE__ */ o.createElement(
951
+ Ut,
791
952
  {
792
953
  routes: e.routes,
793
954
  future: e.future,
794
- state: n
955
+ state: s,
956
+ onError: n
795
957
  }
796
958
  )
797
959
  ))))), null);
798
960
  }
799
- var gt = i.memo(yt);
800
- function yt({
961
+ function pe(e, t) {
962
+ return {
963
+ // Don't surface "current location specific" stuff mid-navigation
964
+ // (historyAction, location, matches, loaderData, errors, initialized,
965
+ // restoreScroll, preventScrollReset, blockers, etc.)
966
+ ...e,
967
+ // Only surface "pending/in-flight stuff"
968
+ // (navigation, revalidation, actionData, fetchers, )
969
+ navigation: t.navigation.state !== "idle" ? t.navigation : e.navigation,
970
+ revalidation: t.revalidation !== "idle" ? t.revalidation : e.revalidation,
971
+ actionData: t.navigation.state !== "submitting" ? t.actionData : e.actionData,
972
+ fetchers: t.fetchers
973
+ };
974
+ }
975
+ var Ut = o.memo(Wt);
976
+ function Wt({
801
977
  routes: e,
802
978
  future: t,
803
- state: n
979
+ state: n,
980
+ onError: r
804
981
  }) {
805
- return rt(e, void 0, n, t);
982
+ return xt(e, void 0, n, r, t);
806
983
  }
807
- function wt({
984
+ function Bt({
808
985
  basename: e = "/",
809
986
  children: t = null,
810
987
  location: n,
811
- navigationType: a = "POP",
812
- navigator: r,
813
- static: o = !1
988
+ navigationType: r = "POP",
989
+ navigator: i,
990
+ static: a = !1,
991
+ unstable_useTransitions: l
814
992
  }) {
815
- E(
816
- !O(),
993
+ C(
994
+ !H(),
817
995
  "You cannot render a <Router> inside another <Router>. You should never have more than one in your app."
818
996
  );
819
- let l = e.replace(/^\/*/, "/"), c = i.useMemo(
997
+ let s = e.replace(/^\/*/, "/"), u = o.useMemo(
820
998
  () => ({
821
- basename: l,
822
- navigator: r,
823
- static: o,
999
+ basename: s,
1000
+ navigator: i,
1001
+ static: a,
1002
+ unstable_useTransitions: l,
824
1003
  future: {}
825
1004
  }),
826
- [l, r, o]
1005
+ [s, i, a, l]
827
1006
  );
828
- typeof n == "string" && (n = z(n));
1007
+ typeof n == "string" && (n = G(n));
829
1008
  let {
830
- pathname: u = "/",
831
- search: s = "",
832
- hash: f = "",
833
- state: d = null,
834
- key: h = "default"
835
- } = n, y = i.useMemo(() => {
836
- let p = T(u, l);
837
- return p == null ? null : {
1009
+ pathname: f = "/",
1010
+ search: d = "",
1011
+ hash: c = "",
1012
+ state: h = null,
1013
+ key: m = "default"
1014
+ } = n, y = o.useMemo(() => {
1015
+ let v = M(f, s);
1016
+ return v == null ? null : {
838
1017
  location: {
839
- pathname: p,
840
- search: s,
841
- hash: f,
842
- state: d,
843
- key: h
1018
+ pathname: v,
1019
+ search: d,
1020
+ hash: c,
1021
+ state: h,
1022
+ key: m
844
1023
  },
845
- navigationType: a
1024
+ navigationType: r
846
1025
  };
847
- }, [l, u, s, f, d, h, a]);
848
- return S(
1026
+ }, [s, f, d, c, h, m, r]);
1027
+ return T(
849
1028
  y != null,
850
- `<Router basename="${l}"> is not able to match the URL "${u}${s}${f}" because it does not start with the basename, so the <Router> won't render anything.`
851
- ), y == null ? null : /* @__PURE__ */ i.createElement(k.Provider, { value: c }, /* @__PURE__ */ i.createElement(Y.Provider, { children: t, value: y }));
1029
+ `<Router basename="${s}"> is not able to match the URL "${f}${d}${c}" because it does not start with the basename, so the <Router> won't render anything.`
1030
+ ), y == null ? null : /* @__PURE__ */ o.createElement(S.Provider, { value: u }, /* @__PURE__ */ o.createElement(q.Provider, { children: t, value: y }));
852
1031
  }
853
- var _ = "get", V = "application/x-www-form-urlencoded";
854
- function J(e) {
855
- return e != null && typeof e.tagName == "string";
1032
+ var J = "get", Y = "application/x-www-form-urlencoded";
1033
+ function X(e) {
1034
+ return typeof HTMLElement < "u" && e instanceof HTMLElement;
856
1035
  }
857
- function xt(e) {
858
- return J(e) && e.tagName.toLowerCase() === "button";
1036
+ function Ht(e) {
1037
+ return X(e) && e.tagName.toLowerCase() === "button";
859
1038
  }
860
- function Rt(e) {
861
- return J(e) && e.tagName.toLowerCase() === "form";
1039
+ function jt(e) {
1040
+ return X(e) && e.tagName.toLowerCase() === "form";
862
1041
  }
863
- function Ct(e) {
864
- return J(e) && e.tagName.toLowerCase() === "input";
1042
+ function Vt(e) {
1043
+ return X(e) && e.tagName.toLowerCase() === "input";
865
1044
  }
866
- function Et(e) {
1045
+ function zt(e) {
867
1046
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
868
1047
  }
869
- function bt(e, t) {
1048
+ function Jt(e, t) {
870
1049
  return e.button === 0 && // Ignore everything but left clicks
871
1050
  (!t || t === "_self") && // Let browser handle "target=_blank" etc.
872
- !Et(e);
1051
+ !zt(e);
873
1052
  }
874
- var H = null;
875
- function Pt() {
876
- if (H === null)
1053
+ var z = null;
1054
+ function Yt() {
1055
+ if (z === null)
877
1056
  try {
878
1057
  new FormData(
879
1058
  document.createElement("form"),
880
1059
  // @ts-expect-error if FormData supports the submitter parameter, this will throw
881
1060
  0
882
- ), H = !1;
1061
+ ), z = !1;
883
1062
  } catch {
884
- H = !0;
1063
+ z = !0;
885
1064
  }
886
- return H;
1065
+ return z;
887
1066
  }
888
- var Lt = /* @__PURE__ */ new Set([
1067
+ var Kt = /* @__PURE__ */ new Set([
889
1068
  "application/x-www-form-urlencoded",
890
1069
  "multipart/form-data",
891
1070
  "text/plain"
892
1071
  ]);
893
- function q(e) {
894
- return e != null && !Lt.has(e) ? (S(
1072
+ function ee(e) {
1073
+ return e != null && !Kt.has(e) ? (T(
895
1074
  !1,
896
- `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${V}"`
1075
+ `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Y}"`
897
1076
  ), null) : e;
898
1077
  }
899
- function St(e, t) {
900
- let n, a, r, o, l;
901
- if (Rt(e)) {
902
- let c = e.getAttribute("action");
903
- a = c ? T(c, t) : null, n = e.getAttribute("method") || _, r = q(e.getAttribute("enctype")) || V, o = new FormData(e);
904
- } else if (xt(e) || Ct(e) && (e.type === "submit" || e.type === "image")) {
905
- let c = e.form;
906
- if (c == null)
1078
+ function Gt(e, t) {
1079
+ let n, r, i, a, l;
1080
+ if (jt(e)) {
1081
+ let s = e.getAttribute("action");
1082
+ r = s ? M(s, t) : null, n = e.getAttribute("method") || J, i = ee(e.getAttribute("enctype")) || Y, a = new FormData(e);
1083
+ } else if (Ht(e) || Vt(e) && (e.type === "submit" || e.type === "image")) {
1084
+ let s = e.form;
1085
+ if (s == null)
907
1086
  throw new Error(
908
1087
  'Cannot submit a <button> or <input type="submit"> without a <form>'
909
1088
  );
910
- let u = e.getAttribute("formaction") || c.getAttribute("action");
911
- if (a = u ? T(u, t) : null, n = e.getAttribute("formmethod") || c.getAttribute("method") || _, r = q(e.getAttribute("formenctype")) || q(c.getAttribute("enctype")) || V, o = new FormData(c, e), !Pt()) {
912
- let { name: s, type: f, value: d } = e;
913
- if (f === "image") {
914
- let h = s ? `${s}.` : "";
915
- o.append(`${h}x`, "0"), o.append(`${h}y`, "0");
916
- } else s && o.append(s, d);
1089
+ let u = e.getAttribute("formaction") || s.getAttribute("action");
1090
+ if (r = u ? M(u, t) : null, n = e.getAttribute("formmethod") || s.getAttribute("method") || J, i = ee(e.getAttribute("formenctype")) || ee(s.getAttribute("enctype")) || Y, a = new FormData(s, e), !Yt()) {
1091
+ let { name: f, type: d, value: c } = e;
1092
+ if (d === "image") {
1093
+ let h = f ? `${f}.` : "";
1094
+ a.append(`${h}x`, "0"), a.append(`${h}y`, "0");
1095
+ } else f && a.append(f, c);
917
1096
  }
918
1097
  } else {
919
- if (J(e))
1098
+ if (X(e))
920
1099
  throw new Error(
921
1100
  'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
922
1101
  );
923
- n = _, a = null, r = V, l = e;
1102
+ n = J, r = null, i = Y, l = e;
924
1103
  }
925
- return o && r === "text/plain" && (l = o, o = void 0), { action: a, method: n.toLowerCase(), encType: r, formData: o, body: l };
1104
+ return a && i === "text/plain" && (l = a, a = void 0), { action: r, method: n.toLowerCase(), encType: i, formData: a, body: l };
926
1105
  }
927
1106
  Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
928
- function te(e, t) {
1107
+ function oe(e, t) {
929
1108
  if (e === !1 || e === null || typeof e > "u")
930
1109
  throw new Error(t);
931
1110
  }
932
- function kt(e, t, n) {
933
- let a = typeof e == "string" ? new URL(
1111
+ function qt(e, t, n, r) {
1112
+ let i = typeof e == "string" ? new URL(
934
1113
  e,
935
1114
  // This can be called during the SSR flow via PrefetchPageLinksImpl so
936
1115
  // don't assume window is available
937
1116
  typeof window > "u" ? "server://singlefetch/" : window.location.origin
938
1117
  ) : e;
939
- return a.pathname === "/" ? a.pathname = `_root.${n}` : t && T(a.pathname, t) === "/" ? a.pathname = `${t.replace(/\/$/, "")}/_root.${n}` : a.pathname = `${a.pathname.replace(/\/$/, "")}.${n}`, a;
1118
+ return n ? i.pathname.endsWith("/") ? i.pathname = `${i.pathname}_.${r}` : i.pathname = `${i.pathname}.${r}` : i.pathname === "/" ? i.pathname = `_root.${r}` : t && M(i.pathname, t) === "/" ? i.pathname = `${t.replace(/\/$/, "")}/_root.${r}` : i.pathname = `${i.pathname.replace(/\/$/, "")}.${r}`, i;
940
1119
  }
941
- async function $t(e, t) {
1120
+ async function Xt(e, t) {
942
1121
  if (e.id in t)
943
1122
  return t[e.id];
944
1123
  try {
@@ -955,52 +1134,52 @@ async function $t(e, t) {
955
1134
  });
956
1135
  }
957
1136
  }
958
- function Tt(e) {
1137
+ function Qt(e) {
959
1138
  return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
960
1139
  }
961
- async function Mt(e, t, n) {
962
- let a = await Promise.all(
963
- e.map(async (r) => {
964
- let o = t.routes[r.route.id];
965
- if (o) {
966
- let l = await $t(o, n);
1140
+ async function Zt(e, t, n) {
1141
+ let r = await Promise.all(
1142
+ e.map(async (i) => {
1143
+ let a = t.routes[i.route.id];
1144
+ if (a) {
1145
+ let l = await Xt(a, n);
967
1146
  return l.links ? l.links() : [];
968
1147
  }
969
1148
  return [];
970
1149
  })
971
1150
  );
972
- return At(
973
- a.flat(1).filter(Tt).filter((r) => r.rel === "stylesheet" || r.rel === "preload").map(
974
- (r) => r.rel === "stylesheet" ? { ...r, rel: "prefetch", as: "style" } : { ...r, rel: "prefetch" }
1151
+ return rn(
1152
+ r.flat(1).filter(Qt).filter((i) => i.rel === "stylesheet" || i.rel === "preload").map(
1153
+ (i) => i.rel === "stylesheet" ? { ...i, rel: "prefetch", as: "style" } : { ...i, rel: "prefetch" }
975
1154
  )
976
1155
  );
977
1156
  }
978
- function ue(e, t, n, a, r, o) {
979
- let l = (u, s) => n[s] ? u.route.id !== n[s].route.id : !0, c = (u, s) => {
980
- var f;
1157
+ function ve(e, t, n, r, i, a) {
1158
+ let l = (u, f) => n[f] ? u.route.id !== n[f].route.id : !0, s = (u, f) => {
1159
+ var d;
981
1160
  return (
982
1161
  // param change, /users/123 -> /users/456
983
- n[s].pathname !== u.pathname || // splat param changed, which is not present in match.path
1162
+ n[f].pathname !== u.pathname || // splat param changed, which is not present in match.path
984
1163
  // e.g. /files/images/avatar.jpg -> files/finances.xls
985
- ((f = n[s].route.path) == null ? void 0 : f.endsWith("*")) && n[s].params["*"] !== u.params["*"]
1164
+ ((d = n[f].route.path) == null ? void 0 : d.endsWith("*")) && n[f].params["*"] !== u.params["*"]
986
1165
  );
987
1166
  };
988
- return o === "assets" ? t.filter(
989
- (u, s) => l(u, s) || c(u, s)
990
- ) : o === "data" ? t.filter((u, s) => {
991
- var d;
992
- let f = a.routes[u.route.id];
993
- if (!f || !f.hasLoader)
1167
+ return a === "assets" ? t.filter(
1168
+ (u, f) => l(u, f) || s(u, f)
1169
+ ) : a === "data" ? t.filter((u, f) => {
1170
+ var c;
1171
+ let d = r.routes[u.route.id];
1172
+ if (!d || !d.hasLoader)
994
1173
  return !1;
995
- if (l(u, s) || c(u, s))
1174
+ if (l(u, f) || s(u, f))
996
1175
  return !0;
997
1176
  if (u.route.shouldRevalidate) {
998
1177
  let h = u.route.shouldRevalidate({
999
1178
  currentUrl: new URL(
1000
- r.pathname + r.search + r.hash,
1179
+ i.pathname + i.search + i.hash,
1001
1180
  window.origin
1002
1181
  ),
1003
- currentParams: ((d = n[0]) == null ? void 0 : d.params) || {},
1182
+ currentParams: ((c = n[0]) == null ? void 0 : c.params) || {},
1004
1183
  nextUrl: new URL(e, window.origin),
1005
1184
  nextParams: u.params,
1006
1185
  defaultShouldRevalidate: !0
@@ -1011,92 +1190,92 @@ function ue(e, t, n, a, r, o) {
1011
1190
  return !0;
1012
1191
  }) : [];
1013
1192
  }
1014
- function Nt(e, t, { includeHydrateFallback: n } = {}) {
1015
- return Dt(
1016
- e.map((a) => {
1017
- let r = t.routes[a.route.id];
1018
- if (!r) return [];
1019
- let o = [r.module];
1020
- return r.clientActionModule && (o = o.concat(r.clientActionModule)), r.clientLoaderModule && (o = o.concat(r.clientLoaderModule)), n && r.hydrateFallbackModule && (o = o.concat(r.hydrateFallbackModule)), r.imports && (o = o.concat(r.imports)), o;
1193
+ function en(e, t, { includeHydrateFallback: n } = {}) {
1194
+ return tn(
1195
+ e.map((r) => {
1196
+ let i = t.routes[r.route.id];
1197
+ if (!i) return [];
1198
+ let a = [i.module];
1199
+ return i.clientActionModule && (a = a.concat(i.clientActionModule)), i.clientLoaderModule && (a = a.concat(i.clientLoaderModule)), n && i.hydrateFallbackModule && (a = a.concat(i.hydrateFallbackModule)), i.imports && (a = a.concat(i.imports)), a;
1021
1200
  }).flat(1)
1022
1201
  );
1023
1202
  }
1024
- function Dt(e) {
1203
+ function tn(e) {
1025
1204
  return [...new Set(e)];
1026
1205
  }
1027
- function Ft(e) {
1206
+ function nn(e) {
1028
1207
  let t = {}, n = Object.keys(e).sort();
1029
- for (let a of n)
1030
- t[a] = e[a];
1208
+ for (let r of n)
1209
+ t[r] = e[r];
1031
1210
  return t;
1032
1211
  }
1033
- function At(e, t) {
1212
+ function rn(e, t) {
1034
1213
  let n = /* @__PURE__ */ new Set();
1035
- return new Set(t), e.reduce((a, r) => {
1036
- let o = JSON.stringify(Ft(r));
1037
- return n.has(o) || (n.add(o), a.push({ key: o, link: r })), a;
1214
+ return new Set(t), e.reduce((r, i) => {
1215
+ let a = JSON.stringify(nn(i));
1216
+ return n.has(a) || (n.add(a), r.push({ key: a, link: i })), r;
1038
1217
  }, []);
1039
1218
  }
1040
- function we() {
1041
- let e = i.useContext(D);
1042
- return te(
1219
+ function Me() {
1220
+ let e = o.useContext(F);
1221
+ return oe(
1043
1222
  e,
1044
1223
  "You must render this element inside a <DataRouterContext.Provider> element"
1045
1224
  ), e;
1046
1225
  }
1047
- function It() {
1048
- let e = i.useContext(B);
1049
- return te(
1226
+ function an() {
1227
+ let e = o.useContext(B);
1228
+ return oe(
1050
1229
  e,
1051
1230
  "You must render this element inside a <DataRouterStateContext.Provider> element"
1052
1231
  ), e;
1053
1232
  }
1054
- var ne = i.createContext(void 0);
1055
- ne.displayName = "FrameworkContext";
1056
- function xe() {
1057
- let e = i.useContext(ne);
1058
- return te(
1233
+ var le = o.createContext(void 0);
1234
+ le.displayName = "FrameworkContext";
1235
+ function Ne() {
1236
+ let e = o.useContext(le);
1237
+ return oe(
1059
1238
  e,
1060
1239
  "You must render this element inside a <HydratedRouter> element"
1061
1240
  ), e;
1062
1241
  }
1063
- function Wt(e, t) {
1064
- let n = i.useContext(ne), [a, r] = i.useState(!1), [o, l] = i.useState(!1), { onFocus: c, onBlur: u, onMouseEnter: s, onMouseLeave: f, onTouchStart: d } = t, h = i.useRef(null);
1065
- i.useEffect(() => {
1242
+ function on(e, t) {
1243
+ let n = o.useContext(le), [r, i] = o.useState(!1), [a, l] = o.useState(!1), { onFocus: s, onBlur: u, onMouseEnter: f, onMouseLeave: d, onTouchStart: c } = t, h = o.useRef(null);
1244
+ o.useEffect(() => {
1066
1245
  if (e === "render" && l(!0), e === "viewport") {
1067
- let g = (m) => {
1068
- m.forEach((R) => {
1069
- l(R.isIntersecting);
1246
+ let v = (R) => {
1247
+ R.forEach((p) => {
1248
+ l(p.isIntersecting);
1070
1249
  });
1071
- }, w = new IntersectionObserver(g, { threshold: 0.5 });
1072
- return h.current && w.observe(h.current), () => {
1073
- w.disconnect();
1250
+ }, g = new IntersectionObserver(v, { threshold: 0.5 });
1251
+ return h.current && g.observe(h.current), () => {
1252
+ g.disconnect();
1074
1253
  };
1075
1254
  }
1076
- }, [e]), i.useEffect(() => {
1077
- if (a) {
1078
- let g = setTimeout(() => {
1255
+ }, [e]), o.useEffect(() => {
1256
+ if (r) {
1257
+ let v = setTimeout(() => {
1079
1258
  l(!0);
1080
1259
  }, 100);
1081
1260
  return () => {
1082
- clearTimeout(g);
1261
+ clearTimeout(v);
1083
1262
  };
1084
1263
  }
1085
- }, [a]);
1086
- let y = () => {
1087
- r(!0);
1088
- }, p = () => {
1089
- r(!1), l(!1);
1264
+ }, [r]);
1265
+ let m = () => {
1266
+ i(!0);
1267
+ }, y = () => {
1268
+ i(!1), l(!1);
1090
1269
  };
1091
- return n ? e !== "intent" ? [o, h, {}] : [
1092
- o,
1270
+ return n ? e !== "intent" ? [a, h, {}] : [
1271
+ a,
1093
1272
  h,
1094
1273
  {
1095
- onFocus: W(c, y),
1096
- onBlur: W(u, p),
1097
- onMouseEnter: W(s, y),
1098
- onMouseLeave: W(f, p),
1099
- onTouchStart: W(d, y)
1274
+ onFocus: W(s, m),
1275
+ onBlur: W(u, y),
1276
+ onMouseEnter: W(f, m),
1277
+ onMouseLeave: W(d, y),
1278
+ onTouchStart: W(c, m)
1100
1279
  }
1101
1280
  ] : [!1, h, {}];
1102
1281
  }
@@ -1105,362 +1284,379 @@ function W(e, t) {
1105
1284
  e && e(n), n.defaultPrevented || t(n);
1106
1285
  };
1107
1286
  }
1108
- function Bt({ page: e, ...t }) {
1109
- let { router: n } = we(), a = i.useMemo(
1110
- () => se(n.routes, e, n.basename),
1287
+ function ln({ page: e, ...t }) {
1288
+ let { router: n } = Me(), r = o.useMemo(
1289
+ () => ge(n.routes, e, n.basename),
1111
1290
  [n.routes, e, n.basename]
1112
1291
  );
1113
- return a ? /* @__PURE__ */ i.createElement(Ut, { page: e, matches: a, ...t }) : null;
1292
+ return r ? /* @__PURE__ */ o.createElement(un, { page: e, matches: r, ...t }) : null;
1114
1293
  }
1115
- function Ot(e) {
1116
- let { manifest: t, routeModules: n } = xe(), [a, r] = i.useState([]);
1117
- return i.useEffect(() => {
1118
- let o = !1;
1119
- return Mt(e, t, n).then(
1294
+ function sn(e) {
1295
+ let { manifest: t, routeModules: n } = Ne(), [r, i] = o.useState([]);
1296
+ return o.useEffect(() => {
1297
+ let a = !1;
1298
+ return Zt(e, t, n).then(
1120
1299
  (l) => {
1121
- o || r(l);
1300
+ a || i(l);
1122
1301
  }
1123
1302
  ), () => {
1124
- o = !0;
1303
+ a = !0;
1125
1304
  };
1126
- }, [e, t, n]), a;
1305
+ }, [e, t, n]), r;
1127
1306
  }
1128
- function Ut({
1307
+ function un({
1129
1308
  page: e,
1130
1309
  matches: t,
1131
1310
  ...n
1132
1311
  }) {
1133
- let a = F(), { manifest: r, routeModules: o } = xe(), { basename: l } = we(), { loaderData: c, matches: u } = It(), s = i.useMemo(
1134
- () => ue(
1312
+ let r = _(), { future: i, manifest: a, routeModules: l } = Ne(), { basename: s } = Me(), { loaderData: u, matches: f } = an(), d = o.useMemo(
1313
+ () => ve(
1135
1314
  e,
1136
1315
  t,
1137
- u,
1138
- r,
1316
+ f,
1139
1317
  a,
1318
+ r,
1140
1319
  "data"
1141
1320
  ),
1142
- [e, t, u, r, a]
1143
- ), f = i.useMemo(
1144
- () => ue(
1321
+ [e, t, f, a, r]
1322
+ ), c = o.useMemo(
1323
+ () => ve(
1145
1324
  e,
1146
1325
  t,
1147
- u,
1148
- r,
1326
+ f,
1149
1327
  a,
1328
+ r,
1150
1329
  "assets"
1151
1330
  ),
1152
- [e, t, u, r, a]
1153
- ), d = i.useMemo(() => {
1154
- if (e === a.pathname + a.search + a.hash)
1331
+ [e, t, f, a, r]
1332
+ ), h = o.useMemo(() => {
1333
+ if (e === r.pathname + r.search + r.hash)
1155
1334
  return [];
1156
- let p = /* @__PURE__ */ new Set(), g = !1;
1157
- if (t.forEach((m) => {
1158
- var v;
1159
- let R = r.routes[m.route.id];
1160
- !R || !R.hasLoader || (!s.some((C) => C.route.id === m.route.id) && m.route.id in c && ((v = o[m.route.id]) != null && v.shouldRevalidate) || R.hasClientLoader ? g = !0 : p.add(m.route.id));
1161
- }), p.size === 0)
1335
+ let v = /* @__PURE__ */ new Set(), g = !1;
1336
+ if (t.forEach((p) => {
1337
+ var $;
1338
+ let w = a.routes[p.route.id];
1339
+ !w || !w.hasLoader || (!d.some((b) => b.route.id === p.route.id) && p.route.id in u && (($ = l[p.route.id]) != null && $.shouldRevalidate) || w.hasClientLoader ? g = !0 : v.add(p.route.id));
1340
+ }), v.size === 0)
1162
1341
  return [];
1163
- let w = kt(e, l, "data");
1164
- return g && p.size > 0 && w.searchParams.set(
1342
+ let R = qt(
1343
+ e,
1344
+ s,
1345
+ i.unstable_trailingSlashAwareDataRequests,
1346
+ "data"
1347
+ );
1348
+ return g && v.size > 0 && R.searchParams.set(
1165
1349
  "_routes",
1166
- t.filter((m) => p.has(m.route.id)).map((m) => m.route.id).join(",")
1167
- ), [w.pathname + w.search];
1350
+ t.filter((p) => v.has(p.route.id)).map((p) => p.route.id).join(",")
1351
+ ), [R.pathname + R.search];
1168
1352
  }, [
1169
- l,
1170
- c,
1171
- a,
1172
- r,
1173
1353
  s,
1354
+ i.unstable_trailingSlashAwareDataRequests,
1355
+ u,
1356
+ r,
1357
+ a,
1358
+ d,
1174
1359
  t,
1175
1360
  e,
1176
- o
1177
- ]), h = i.useMemo(
1178
- () => Nt(f, r),
1179
- [f, r]
1180
- ), y = Ot(f);
1181
- return /* @__PURE__ */ i.createElement(i.Fragment, null, d.map((p) => /* @__PURE__ */ i.createElement("link", { key: p, rel: "prefetch", as: "fetch", href: p, ...n })), h.map((p) => /* @__PURE__ */ i.createElement("link", { key: p, rel: "modulepreload", href: p, ...n })), y.map(({ key: p, link: g }) => (
1361
+ l
1362
+ ]), m = o.useMemo(
1363
+ () => en(c, a),
1364
+ [c, a]
1365
+ ), y = sn(c);
1366
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, h.map((v) => /* @__PURE__ */ o.createElement("link", { key: v, rel: "prefetch", as: "fetch", href: v, ...n })), m.map((v) => /* @__PURE__ */ o.createElement("link", { key: v, rel: "modulepreload", href: v, ...n })), y.map(({ key: v, link: g }) => (
1182
1367
  // these don't spread `linkProps` because they are full link descriptors
1183
1368
  // already with their own props
1184
- /* @__PURE__ */ i.createElement("link", { key: p, nonce: n.nonce, ...g })
1369
+ /* @__PURE__ */ o.createElement(
1370
+ "link",
1371
+ {
1372
+ key: v,
1373
+ nonce: n.nonce,
1374
+ ...g,
1375
+ crossOrigin: g.crossOrigin ?? n.crossOrigin
1376
+ }
1377
+ )
1185
1378
  )));
1186
1379
  }
1187
- function Ht(...e) {
1380
+ function cn(...e) {
1188
1381
  return (t) => {
1189
1382
  e.forEach((n) => {
1190
1383
  typeof n == "function" ? n(t) : n != null && (n.current = t);
1191
1384
  });
1192
1385
  };
1193
1386
  }
1194
- var Re = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1387
+ var fn = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
1195
1388
  try {
1196
- Re && (window.__reactRouterVersion = // @ts-expect-error
1197
- "7.8.1");
1389
+ fn && (window.__reactRouterVersion = // @ts-expect-error
1390
+ "7.13.0");
1198
1391
  } catch {
1199
1392
  }
1200
- var Ce = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Ee = i.forwardRef(
1393
+ var Ie = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Fe = o.forwardRef(
1201
1394
  function({
1202
1395
  onClick: t,
1203
1396
  discover: n = "render",
1204
- prefetch: a = "none",
1205
- relative: r,
1206
- reloadDocument: o,
1397
+ prefetch: r = "none",
1398
+ relative: i,
1399
+ reloadDocument: a,
1207
1400
  replace: l,
1208
- state: c,
1401
+ state: s,
1209
1402
  target: u,
1210
- to: s,
1211
- preventScrollReset: f,
1212
- viewTransition: d,
1213
- ...h
1403
+ to: f,
1404
+ preventScrollReset: d,
1405
+ viewTransition: c,
1406
+ unstable_defaultShouldRevalidate: h,
1407
+ ...m
1214
1408
  }, y) {
1215
- let { basename: p } = i.useContext(k), g = typeof s == "string" && Ce.test(s), w, m = !1;
1216
- if (typeof s == "string" && g && (w = s, Re))
1217
- try {
1218
- let P = new URL(window.location.href), A = s.startsWith("//") ? new URL(P.protocol + s) : new URL(s), re = T(A.pathname, p);
1219
- A.origin === P.origin && re != null ? s = re + A.search + A.hash : m = !0;
1220
- } catch {
1221
- S(
1222
- !1,
1223
- `<Link to="${s}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
1224
- );
1225
- }
1226
- let R = et(s, { relative: r }), [v, C, x] = Wt(
1227
- a,
1228
- h
1229
- ), b = zt(s, {
1409
+ let { basename: v, unstable_useTransitions: g } = o.useContext(S), R = typeof f == "string" && Ie.test(f), p = be(f, v);
1410
+ f = p.to;
1411
+ let w = Rt(f, { relative: i }), [$, b, L] = on(
1412
+ r,
1413
+ m
1414
+ ), O = pn(f, {
1230
1415
  replace: l,
1231
- state: c,
1416
+ state: s,
1232
1417
  target: u,
1233
- preventScrollReset: f,
1234
- relative: r,
1235
- viewTransition: d
1418
+ preventScrollReset: d,
1419
+ relative: i,
1420
+ viewTransition: c,
1421
+ unstable_defaultShouldRevalidate: h,
1422
+ unstable_useTransitions: g
1236
1423
  });
1237
- function N(P) {
1238
- t && t(P), P.defaultPrevented || b(P);
1424
+ function E(x) {
1425
+ t && t(x), x.defaultPrevented || O(x);
1239
1426
  }
1240
- let L = (
1427
+ let P = (
1241
1428
  // eslint-disable-next-line jsx-a11y/anchor-has-content
1242
- /* @__PURE__ */ i.createElement(
1429
+ /* @__PURE__ */ o.createElement(
1243
1430
  "a",
1244
1431
  {
1245
- ...h,
1246
- ...x,
1247
- href: w || R,
1248
- onClick: m || o ? t : N,
1249
- ref: Ht(y, C),
1432
+ ...m,
1433
+ ...L,
1434
+ href: p.absoluteURL || w,
1435
+ onClick: p.isExternal || a ? t : E,
1436
+ ref: cn(y, b),
1250
1437
  target: u,
1251
- "data-discover": !g && n === "render" ? "true" : void 0
1438
+ "data-discover": !R && n === "render" ? "true" : void 0
1252
1439
  }
1253
1440
  )
1254
1441
  );
1255
- return v && !g ? /* @__PURE__ */ i.createElement(i.Fragment, null, L, /* @__PURE__ */ i.createElement(Bt, { page: R })) : L;
1442
+ return $ && !R ? /* @__PURE__ */ o.createElement(o.Fragment, null, P, /* @__PURE__ */ o.createElement(ln, { page: w })) : P;
1256
1443
  }
1257
1444
  );
1258
- Ee.displayName = "Link";
1259
- var _t = i.forwardRef(
1445
+ Fe.displayName = "Link";
1446
+ var dn = o.forwardRef(
1260
1447
  function({
1261
1448
  "aria-current": t = "page",
1262
1449
  caseSensitive: n = !1,
1263
- className: a = "",
1264
- end: r = !1,
1265
- style: o,
1450
+ className: r = "",
1451
+ end: i = !1,
1452
+ style: a,
1266
1453
  to: l,
1267
- viewTransition: c,
1454
+ viewTransition: s,
1268
1455
  children: u,
1269
- ...s
1270
- }, f) {
1271
- let d = U(l, { relative: s.relative }), h = F(), y = i.useContext(B), { navigator: p, basename: g } = i.useContext(k), w = y != null && // Conditional usage is OK here because the usage of a data router is static
1456
+ ...f
1457
+ }, d) {
1458
+ let c = j(l, { relative: f.relative }), h = _(), m = o.useContext(B), { navigator: y, basename: v } = o.useContext(S), g = m != null && // Conditional usage is OK here because the usage of a data router is static
1272
1459
  // eslint-disable-next-line react-hooks/rules-of-hooks
1273
- Gt(d) && c === !0, m = p.encodeLocation ? p.encodeLocation(d).pathname : d.pathname, R = h.pathname, v = y && y.navigation && y.navigation.location ? y.navigation.location.pathname : null;
1274
- n || (R = R.toLowerCase(), v = v ? v.toLowerCase() : null, m = m.toLowerCase()), v && g && (v = T(v, g) || v);
1275
- const C = m !== "/" && m.endsWith("/") ? m.length - 1 : m.length;
1276
- let x = R === m || !r && R.startsWith(m) && R.charAt(C) === "/", b = v != null && (v === m || !r && v.startsWith(m) && v.charAt(m.length) === "/"), N = {
1277
- isActive: x,
1278
- isPending: b,
1279
- isTransitioning: w
1280
- }, L = x ? t : void 0, P;
1281
- typeof a == "function" ? P = a(N) : P = [
1282
- a,
1283
- x ? "active" : null,
1284
- b ? "pending" : null,
1285
- w ? "transitioning" : null
1460
+ wn(c) && s === !0, R = y.encodeLocation ? y.encodeLocation(c).pathname : c.pathname, p = h.pathname, w = m && m.navigation && m.navigation.location ? m.navigation.location.pathname : null;
1461
+ n || (p = p.toLowerCase(), w = w ? w.toLowerCase() : null, R = R.toLowerCase()), w && v && (w = M(w, v) || w);
1462
+ const $ = R !== "/" && R.endsWith("/") ? R.length - 1 : R.length;
1463
+ let b = p === R || !i && p.startsWith(R) && p.charAt($) === "/", L = w != null && (w === R || !i && w.startsWith(R) && w.charAt(R.length) === "/"), O = {
1464
+ isActive: b,
1465
+ isPending: L,
1466
+ isTransitioning: g
1467
+ }, E = b ? t : void 0, P;
1468
+ typeof r == "function" ? P = r(O) : P = [
1469
+ r,
1470
+ b ? "active" : null,
1471
+ L ? "pending" : null,
1472
+ g ? "transitioning" : null
1286
1473
  ].filter(Boolean).join(" ");
1287
- let A = typeof o == "function" ? o(N) : o;
1288
- return /* @__PURE__ */ i.createElement(
1289
- Ee,
1474
+ let x = typeof a == "function" ? a(O) : a;
1475
+ return /* @__PURE__ */ o.createElement(
1476
+ Fe,
1290
1477
  {
1291
- ...s,
1292
- "aria-current": L,
1478
+ ...f,
1479
+ "aria-current": E,
1293
1480
  className: P,
1294
- ref: f,
1295
- style: A,
1481
+ ref: d,
1482
+ style: x,
1296
1483
  to: l,
1297
- viewTransition: c
1484
+ viewTransition: s
1298
1485
  },
1299
- typeof u == "function" ? u(N) : u
1486
+ typeof u == "function" ? u(O) : u
1300
1487
  );
1301
1488
  }
1302
1489
  );
1303
- _t.displayName = "NavLink";
1304
- var Vt = i.forwardRef(
1490
+ dn.displayName = "NavLink";
1491
+ var hn = o.forwardRef(
1305
1492
  ({
1306
1493
  discover: e = "render",
1307
1494
  fetcherKey: t,
1308
1495
  navigate: n,
1309
- reloadDocument: a,
1310
- replace: r,
1311
- state: o,
1312
- method: l = _,
1313
- action: c,
1496
+ reloadDocument: r,
1497
+ replace: i,
1498
+ state: a,
1499
+ method: l = J,
1500
+ action: s,
1314
1501
  onSubmit: u,
1315
- relative: s,
1316
- preventScrollReset: f,
1317
- viewTransition: d,
1318
- ...h
1502
+ relative: f,
1503
+ preventScrollReset: d,
1504
+ viewTransition: c,
1505
+ unstable_defaultShouldRevalidate: h,
1506
+ ...m
1319
1507
  }, y) => {
1320
- let p = Kt(), g = qt(c, { relative: s }), w = l.toLowerCase() === "get" ? "get" : "post", m = typeof c == "string" && Ce.test(c), R = (v) => {
1321
- if (u && u(v), v.defaultPrevented) return;
1322
- v.preventDefault();
1323
- let C = v.nativeEvent.submitter, x = (C == null ? void 0 : C.getAttribute("formmethod")) || l;
1324
- p(C || v.currentTarget, {
1508
+ let { unstable_useTransitions: v } = o.useContext(S), g = yn(), R = Rn(s, { relative: f }), p = l.toLowerCase() === "get" ? "get" : "post", w = typeof s == "string" && Ie.test(s), $ = (b) => {
1509
+ if (u && u(b), b.defaultPrevented) return;
1510
+ b.preventDefault();
1511
+ let L = b.nativeEvent.submitter, O = (L == null ? void 0 : L.getAttribute("formmethod")) || l, E = () => g(L || b.currentTarget, {
1325
1512
  fetcherKey: t,
1326
- method: x,
1513
+ method: O,
1327
1514
  navigate: n,
1328
- replace: r,
1329
- state: o,
1330
- relative: s,
1331
- preventScrollReset: f,
1332
- viewTransition: d
1515
+ replace: i,
1516
+ state: a,
1517
+ relative: f,
1518
+ preventScrollReset: d,
1519
+ viewTransition: c,
1520
+ unstable_defaultShouldRevalidate: h
1333
1521
  });
1522
+ v && n !== !1 ? o.startTransition(() => E()) : E();
1334
1523
  };
1335
- return /* @__PURE__ */ i.createElement(
1524
+ return /* @__PURE__ */ o.createElement(
1336
1525
  "form",
1337
1526
  {
1338
1527
  ref: y,
1339
- method: w,
1340
- action: g,
1341
- onSubmit: a ? u : R,
1342
- ...h,
1343
- "data-discover": !m && e === "render" ? "true" : void 0
1528
+ method: p,
1529
+ action: R,
1530
+ onSubmit: r ? u : $,
1531
+ ...m,
1532
+ "data-discover": !w && e === "render" ? "true" : void 0
1344
1533
  }
1345
1534
  );
1346
1535
  }
1347
1536
  );
1348
- Vt.displayName = "Form";
1349
- function jt(e) {
1537
+ hn.displayName = "Form";
1538
+ function mn(e) {
1350
1539
  return `${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
1351
1540
  }
1352
- function be(e) {
1353
- let t = i.useContext(D);
1354
- return E(t, jt(e)), t;
1541
+ function _e(e) {
1542
+ let t = o.useContext(F);
1543
+ return C(t, mn(e)), t;
1355
1544
  }
1356
- function zt(e, {
1545
+ function pn(e, {
1357
1546
  target: t,
1358
1547
  replace: n,
1359
- state: a,
1360
- preventScrollReset: r,
1361
- relative: o,
1362
- viewTransition: l
1548
+ state: r,
1549
+ preventScrollReset: i,
1550
+ relative: a,
1551
+ viewTransition: l,
1552
+ unstable_defaultShouldRevalidate: s,
1553
+ unstable_useTransitions: u
1363
1554
  } = {}) {
1364
- let c = tt(), u = F(), s = U(e, { relative: o });
1365
- return i.useCallback(
1366
- (f) => {
1367
- if (bt(f, t)) {
1368
- f.preventDefault();
1369
- let d = n !== void 0 ? n : G(u) === G(s);
1370
- c(e, {
1371
- replace: d,
1372
- state: a,
1373
- preventScrollReset: r,
1374
- relative: o,
1375
- viewTransition: l
1555
+ let f = wt(), d = _(), c = j(e, { relative: a });
1556
+ return o.useCallback(
1557
+ (h) => {
1558
+ if (Jt(h, t)) {
1559
+ h.preventDefault();
1560
+ let m = n !== void 0 ? n : te(d) === te(c), y = () => f(e, {
1561
+ replace: m,
1562
+ state: r,
1563
+ preventScrollReset: i,
1564
+ relative: a,
1565
+ viewTransition: l,
1566
+ unstable_defaultShouldRevalidate: s
1376
1567
  });
1568
+ u ? o.startTransition(() => y()) : y();
1377
1569
  }
1378
1570
  },
1379
1571
  [
1380
- u,
1572
+ d,
1573
+ f,
1381
1574
  c,
1382
- s,
1383
1575
  n,
1384
- a,
1576
+ r,
1385
1577
  t,
1386
1578
  e,
1387
- r,
1388
- o,
1389
- l
1579
+ i,
1580
+ a,
1581
+ l,
1582
+ s,
1583
+ u
1390
1584
  ]
1391
1585
  );
1392
1586
  }
1393
- var Yt = 0, Jt = () => `__${String(++Yt)}__`;
1394
- function Kt() {
1395
- let { router: e } = be(
1587
+ var vn = 0, gn = () => `__${String(++vn)}__`;
1588
+ function yn() {
1589
+ let { router: e } = _e(
1396
1590
  "useSubmit"
1397
1591
  /* UseSubmit */
1398
- ), { basename: t } = i.useContext(k), n = dt();
1399
- return i.useCallback(
1400
- async (a, r = {}) => {
1401
- let { action: o, method: l, encType: c, formData: u, body: s } = St(
1592
+ ), { basename: t } = o.useContext(S), n = Ot(), r = e.fetch, i = e.navigate;
1593
+ return o.useCallback(
1594
+ async (a, l = {}) => {
1595
+ let { action: s, method: u, encType: f, formData: d, body: c } = Gt(
1402
1596
  a,
1403
1597
  t
1404
1598
  );
1405
- if (r.navigate === !1) {
1406
- let f = r.fetcherKey || Jt();
1407
- await e.fetch(f, n, r.action || o, {
1408
- preventScrollReset: r.preventScrollReset,
1409
- formData: u,
1410
- body: s,
1411
- formMethod: r.method || l,
1412
- formEncType: r.encType || c,
1413
- flushSync: r.flushSync
1599
+ if (l.navigate === !1) {
1600
+ let h = l.fetcherKey || gn();
1601
+ await r(h, n, l.action || s, {
1602
+ unstable_defaultShouldRevalidate: l.unstable_defaultShouldRevalidate,
1603
+ preventScrollReset: l.preventScrollReset,
1604
+ formData: d,
1605
+ body: c,
1606
+ formMethod: l.method || u,
1607
+ formEncType: l.encType || f,
1608
+ flushSync: l.flushSync
1414
1609
  });
1415
1610
  } else
1416
- await e.navigate(r.action || o, {
1417
- preventScrollReset: r.preventScrollReset,
1418
- formData: u,
1419
- body: s,
1420
- formMethod: r.method || l,
1421
- formEncType: r.encType || c,
1422
- replace: r.replace,
1423
- state: r.state,
1611
+ await i(l.action || s, {
1612
+ unstable_defaultShouldRevalidate: l.unstable_defaultShouldRevalidate,
1613
+ preventScrollReset: l.preventScrollReset,
1614
+ formData: d,
1615
+ body: c,
1616
+ formMethod: l.method || u,
1617
+ formEncType: l.encType || f,
1618
+ replace: l.replace,
1619
+ state: l.state,
1424
1620
  fromRouteId: n,
1425
- flushSync: r.flushSync,
1426
- viewTransition: r.viewTransition
1621
+ flushSync: l.flushSync,
1622
+ viewTransition: l.viewTransition
1427
1623
  });
1428
1624
  },
1429
- [e, t, n]
1625
+ [r, i, t, n]
1430
1626
  );
1431
1627
  }
1432
- function qt(e, { relative: t } = {}) {
1433
- let { basename: n } = i.useContext(k), a = i.useContext(M);
1434
- E(a, "useFormAction must be used inside a RouteContext");
1435
- let [r] = a.matches.slice(-1), o = { ...U(e || ".", { relative: t }) }, l = F();
1628
+ function Rn(e, { relative: t } = {}) {
1629
+ let { basename: n } = o.useContext(S), r = o.useContext(N);
1630
+ C(r, "useFormAction must be used inside a RouteContext");
1631
+ let [i] = r.matches.slice(-1), a = { ...j(e || ".", { relative: t }) }, l = _();
1436
1632
  if (e == null) {
1437
- o.search = l.search;
1438
- let c = new URLSearchParams(o.search), u = c.getAll("index");
1439
- if (u.some((f) => f === "")) {
1440
- c.delete("index"), u.filter((d) => d).forEach((d) => c.append("index", d));
1441
- let f = c.toString();
1442
- o.search = f ? `?${f}` : "";
1633
+ a.search = l.search;
1634
+ let s = new URLSearchParams(a.search), u = s.getAll("index");
1635
+ if (u.some((d) => d === "")) {
1636
+ s.delete("index"), u.filter((c) => c).forEach((c) => s.append("index", c));
1637
+ let d = s.toString();
1638
+ a.search = d ? `?${d}` : "";
1443
1639
  }
1444
1640
  }
1445
- return (!e || e === ".") && r.route.index && (o.search = o.search ? o.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (o.pathname = o.pathname === "/" ? n : $([n, o.pathname])), G(o);
1641
+ return (!e || e === ".") && i.route.index && (a.search = a.search ? a.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (a.pathname = a.pathname === "/" ? n : D([n, a.pathname])), te(a);
1446
1642
  }
1447
- function Gt(e, { relative: t } = {}) {
1448
- let n = i.useContext(X);
1449
- E(
1643
+ function wn(e, { relative: t } = {}) {
1644
+ let n = o.useContext(ne);
1645
+ C(
1450
1646
  n != null,
1451
1647
  "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1452
1648
  );
1453
- let { basename: a } = be(
1649
+ let { basename: r } = _e(
1454
1650
  "useViewTransitionState"
1455
1651
  /* useViewTransitionState */
1456
- ), r = U(e, { relative: t });
1652
+ ), i = j(e, { relative: t });
1457
1653
  if (!n.isTransitioning)
1458
1654
  return !1;
1459
- let o = T(n.currentLocation.pathname, a) || n.currentLocation.pathname, l = T(n.nextLocation.pathname, a) || n.nextLocation.pathname;
1460
- return j(r.pathname, l) != null || j(r.pathname, o) != null;
1655
+ let a = M(n.currentLocation.pathname, r) || n.currentLocation.pathname, l = M(n.nextLocation.pathname, r) || n.nextLocation.pathname;
1656
+ return K(i.pathname, l) != null || K(i.pathname, a) != null;
1461
1657
  }
1462
1658
  /**
1463
- * react-router v7.8.1
1659
+ * react-router v7.13.0
1464
1660
  *
1465
1661
  * Copyright (c) Remix Software Inc.
1466
1662
  *
@@ -1469,24 +1665,24 @@ function Gt(e, { relative: t } = {}) {
1469
1665
  *
1470
1666
  * @license MIT
1471
1667
  */
1472
- function Xt(e) {
1473
- return /* @__PURE__ */ i.createElement(vt, { flushSync: $e.flushSync, ...e });
1668
+ function En(e) {
1669
+ return /* @__PURE__ */ o.createElement(At, { flushSync: He.flushSync, ...e });
1474
1670
  }
1475
- function on({ theme: e = Se, store: t, router: n }) {
1476
- return /* @__PURE__ */ I(Le, { injectFirst: !0, children: /* @__PURE__ */ I(Pe, { theme: e, children: /* @__PURE__ */ I(Me, { store: t, children: /* @__PURE__ */ I(
1477
- ke,
1671
+ function kn({ theme: e = We, store: t, router: n }) {
1672
+ return /* @__PURE__ */ A(Ue, { injectFirst: !0, children: /* @__PURE__ */ A(Ae, { theme: e, children: /* @__PURE__ */ A(Ve, { store: t, children: /* @__PURE__ */ A(
1673
+ Be,
1478
1674
  {
1479
- fallback: /* @__PURE__ */ I(
1480
- Te,
1675
+ fallback: /* @__PURE__ */ A(
1676
+ je,
1481
1677
  {
1482
1678
  loading: !0,
1483
1679
  message: "..."
1484
1680
  }
1485
1681
  ),
1486
- children: /* @__PURE__ */ I(Xt, { router: n })
1682
+ children: /* @__PURE__ */ A(En, { router: n })
1487
1683
  }
1488
1684
  ) }) }) });
1489
1685
  }
1490
1686
  export {
1491
- on as default
1687
+ kn as default
1492
1688
  };