@shopify/shop-minis-react 0.0.27 → 0.0.29

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