react-router 7.10.1 → 7.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/development/{browser-BpxEZgZC.d.ts → browser-Cv4JZyZ5.d.mts} +4 -3
  3. package/dist/{production/browser-BpxEZgZC.d.ts → development/browser-o-qhcuhA.d.ts} +4 -3
  4. package/dist/{production/chunk-B3F6YMOF.js → development/chunk-2JY4UAJA.js} +111 -121
  5. package/dist/{production/chunk-YO5R3LGQ.js → development/chunk-GNDLROV6.js} +7 -7
  6. package/dist/development/{chunk-WWGJGFF6.mjs → chunk-JMJ3UQ3L.mjs} +231 -74
  7. package/dist/development/{chunk-RBZI3ZHD.js → chunk-SZQUWNVJ.js} +279 -110
  8. package/dist/development/{chunk-PMGK554W.mjs → chunk-YNUBSHFH.mjs} +147 -38
  9. package/dist/development/dom-export.d.mts +11 -10
  10. package/dist/development/dom-export.d.ts +12 -11
  11. package/dist/development/dom-export.js +30 -31
  12. package/dist/development/dom-export.mjs +6 -7
  13. package/dist/{production/index-react-server-client-CCjKYJTH.d.ts → development/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
  14. package/dist/development/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +4 -2
  20. package/dist/development/index-react-server.d.ts +4 -2
  21. package/dist/development/index-react-server.js +72 -19
  22. package/dist/development/index-react-server.mjs +72 -19
  23. package/dist/development/index.d.mts +17 -16
  24. package/dist/development/index.d.ts +17 -16
  25. package/dist/development/index.js +220 -111
  26. package/dist/development/index.mjs +3 -3
  27. package/dist/{production/instrumentation-BB0wRuqz.d.ts → development/instrumentation-BlrVzjbg.d.ts} +30 -15
  28. package/dist/development/lib/types/internal.d.mts +2 -2
  29. package/dist/development/lib/types/internal.d.ts +2 -2
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
  33. package/dist/development/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
  34. package/dist/development/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
  35. package/dist/{development/browser-C5z6FZmz.d.mts → production/browser-Cv4JZyZ5.d.mts} +4 -3
  36. package/dist/production/{browser-C5z6FZmz.d.mts → browser-o-qhcuhA.d.ts} +4 -3
  37. package/dist/production/{chunk-UQPBOMFP.js → chunk-2HFJAX7U.js} +279 -110
  38. package/dist/{development/chunk-FKYGG5Z2.js → production/chunk-BEXOWXJO.js} +7 -7
  39. package/dist/production/{chunk-TDCOAFPJ.mjs → chunk-E6GYEQUT.mjs} +147 -38
  40. package/dist/production/{chunk-ANIOYBQK.mjs → chunk-TINMVEA2.mjs} +231 -74
  41. package/dist/{development/chunk-HMTWJNYB.js → production/chunk-ZMYPVUNZ.js} +111 -121
  42. package/dist/production/dom-export.d.mts +11 -10
  43. package/dist/production/dom-export.d.ts +12 -11
  44. package/dist/production/dom-export.js +30 -31
  45. package/dist/production/dom-export.mjs +6 -7
  46. package/dist/{development/index-react-server-client-CCjKYJTH.d.ts → production/index-react-server-client-Cv5Q9lf0.d.ts} +60 -14
  47. package/dist/production/{index-react-server-client-CipGfVBI.d.mts → index-react-server-client-P7VgYu6T.d.mts} +60 -14
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +4 -2
  53. package/dist/production/index-react-server.d.ts +4 -2
  54. package/dist/production/index-react-server.js +72 -19
  55. package/dist/production/index-react-server.mjs +72 -19
  56. package/dist/production/index.d.mts +17 -16
  57. package/dist/production/index.d.ts +17 -16
  58. package/dist/production/index.js +220 -111
  59. package/dist/production/index.mjs +3 -3
  60. package/dist/{development/instrumentation-BB0wRuqz.d.ts → production/instrumentation-BlrVzjbg.d.ts} +30 -15
  61. package/dist/production/lib/types/internal.d.mts +2 -2
  62. package/dist/production/lib/types/internal.d.ts +2 -2
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-ODDAAYlf.d.ts → register-BGQUMCK4.d.ts} +1 -1
  66. package/dist/production/{register-C1RwVJAt.d.mts → register-DTJJbt1o.d.mts} +1 -1
  67. package/dist/production/{router-CwNp5l9u.d.mts → router-5fbeEIMQ.d.mts} +30 -15
  68. package/package.json +5 -4
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
2
- * react-router v7.10.1
2
+ * react-router v7.11.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -48,7 +48,8 @@
48
48
 
49
49
 
50
50
 
51
- var _chunkUQPBOMFPjs = require('./chunk-UQPBOMFP.js');
51
+
52
+ var _chunkSZQUWNVJjs = require('./chunk-SZQUWNVJ.js');
52
53
 
53
54
  // lib/dom/dom.ts
54
55
  var defaultMethod = "get";
@@ -119,7 +120,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
119
120
  ]);
120
121
  function getFormEncType(encType) {
121
122
  if (encType != null && !supportedFormEncTypes.has(encType)) {
122
- _chunkUQPBOMFPjs.warning.call(void 0,
123
+ _chunkSZQUWNVJjs.warning.call(void 0,
123
124
  false,
124
125
  `"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
125
126
  );
@@ -135,7 +136,7 @@ function getFormSubmissionInfo(target, basename) {
135
136
  let body;
136
137
  if (isFormElement(target)) {
137
138
  let attr = target.getAttribute("action");
138
- action = attr ? _chunkUQPBOMFPjs.stripBasename.call(void 0, attr, basename) : null;
139
+ action = attr ? _chunkSZQUWNVJjs.stripBasename.call(void 0, attr, basename) : null;
139
140
  method = target.getAttribute("method") || defaultMethod;
140
141
  encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
141
142
  formData = new FormData(target);
@@ -147,7 +148,7 @@ function getFormSubmissionInfo(target, basename) {
147
148
  );
148
149
  }
149
150
  let attr = target.getAttribute("formaction") || form.getAttribute("action");
150
- action = attr ? _chunkUQPBOMFPjs.stripBasename.call(void 0, attr, basename) : null;
151
+ action = attr ? _chunkSZQUWNVJjs.stripBasename.call(void 0, attr, basename) : null;
151
152
  method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
152
153
  encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
153
154
  formData = new FormData(form, target);
@@ -184,20 +185,20 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
184
185
  try {
185
186
  if (isBrowser) {
186
187
  window.__reactRouterVersion = // @ts-expect-error
187
- "7.10.1";
188
+ "7.11.0";
188
189
  }
189
190
  } catch (e) {
190
191
  }
191
192
  function createBrowserRouter(routes, opts) {
192
- return _chunkUQPBOMFPjs.createRouter.call(void 0, {
193
+ return _chunkSZQUWNVJjs.createRouter.call(void 0, {
193
194
  basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
194
195
  getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
195
196
  future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
196
- history: _chunkUQPBOMFPjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
197
+ history: _chunkSZQUWNVJjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
197
198
  hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
198
199
  routes,
199
- mapRouteProperties: _chunkUQPBOMFPjs.mapRouteProperties,
200
- hydrationRouteProperties: _chunkUQPBOMFPjs.hydrationRouteProperties,
200
+ mapRouteProperties: _chunkSZQUWNVJjs.mapRouteProperties,
201
+ hydrationRouteProperties: _chunkSZQUWNVJjs.hydrationRouteProperties,
201
202
  dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
202
203
  patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
203
204
  window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
@@ -205,15 +206,15 @@ function createBrowserRouter(routes, opts) {
205
206
  }).initialize();
206
207
  }
207
208
  function createHashRouter(routes, opts) {
208
- return _chunkUQPBOMFPjs.createRouter.call(void 0, {
209
+ return _chunkSZQUWNVJjs.createRouter.call(void 0, {
209
210
  basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
210
211
  getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
211
212
  future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
212
- history: _chunkUQPBOMFPjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
213
+ history: _chunkSZQUWNVJjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
213
214
  hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
214
215
  routes,
215
- mapRouteProperties: _chunkUQPBOMFPjs.mapRouteProperties,
216
- hydrationRouteProperties: _chunkUQPBOMFPjs.hydrationRouteProperties,
216
+ mapRouteProperties: _chunkSZQUWNVJjs.mapRouteProperties,
217
+ hydrationRouteProperties: _chunkSZQUWNVJjs.hydrationRouteProperties,
217
218
  dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
218
219
  patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
219
220
  window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
@@ -236,7 +237,7 @@ function deserializeErrors(errors) {
236
237
  let serialized = {};
237
238
  for (let [key, val] of entries) {
238
239
  if (val && val.__type === "RouteErrorResponse") {
239
- serialized[key] = new (0, _chunkUQPBOMFPjs.ErrorResponseImpl)(
240
+ serialized[key] = new (0, _chunkSZQUWNVJjs.ErrorResponseImpl)(
240
241
  val.status,
241
242
  val.statusText,
242
243
  val.data,
@@ -273,7 +274,7 @@ function BrowserRouter({
273
274
  }) {
274
275
  let historyRef = React.useRef();
275
276
  if (historyRef.current == null) {
276
- historyRef.current = _chunkUQPBOMFPjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
277
+ historyRef.current = _chunkSZQUWNVJjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
277
278
  }
278
279
  let history = historyRef.current;
279
280
  let [state, setStateImpl] = React.useState({
@@ -292,14 +293,14 @@ function BrowserRouter({
292
293
  );
293
294
  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
294
295
  return /* @__PURE__ */ React.createElement(
295
- _chunkUQPBOMFPjs.Router,
296
+ _chunkSZQUWNVJjs.Router,
296
297
  {
297
298
  basename,
298
299
  children,
299
300
  location: state.location,
300
301
  navigationType: state.action,
301
302
  navigator: history,
302
- unstable_useTransitions: unstable_useTransitions === true
303
+ unstable_useTransitions
303
304
  }
304
305
  );
305
306
  }
@@ -311,7 +312,7 @@ function HashRouter({
311
312
  }) {
312
313
  let historyRef = React.useRef();
313
314
  if (historyRef.current == null) {
314
- historyRef.current = _chunkUQPBOMFPjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
315
+ historyRef.current = _chunkSZQUWNVJjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
315
316
  }
316
317
  let history = historyRef.current;
317
318
  let [state, setStateImpl] = React.useState({
@@ -330,14 +331,14 @@ function HashRouter({
330
331
  );
331
332
  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
332
333
  return /* @__PURE__ */ React.createElement(
333
- _chunkUQPBOMFPjs.Router,
334
+ _chunkSZQUWNVJjs.Router,
334
335
  {
335
336
  basename,
336
337
  children,
337
338
  location: state.location,
338
339
  navigationType: state.action,
339
340
  navigator: history,
340
- unstable_useTransitions: unstable_useTransitions === true
341
+ unstable_useTransitions
341
342
  }
342
343
  );
343
344
  }
@@ -363,14 +364,14 @@ function HistoryRouter({
363
364
  );
364
365
  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
365
366
  return /* @__PURE__ */ React.createElement(
366
- _chunkUQPBOMFPjs.Router,
367
+ _chunkSZQUWNVJjs.Router,
367
368
  {
368
369
  basename,
369
370
  children,
370
371
  location: state.location,
371
372
  navigationType: state.action,
372
373
  navigator: history,
373
- unstable_useTransitions: unstable_useTransitions === true
374
+ unstable_useTransitions
374
375
  }
375
376
  );
376
377
  }
@@ -389,34 +390,15 @@ var Link = React.forwardRef(
389
390
  to,
390
391
  preventScrollReset,
391
392
  viewTransition,
393
+ unstable_defaultShouldRevalidate,
392
394
  ...rest
393
395
  }, forwardedRef) {
394
- let { basename, unstable_useTransitions } = React.useContext(_chunkUQPBOMFPjs.NavigationContext);
396
+ let { basename, unstable_useTransitions } = React.useContext(_chunkSZQUWNVJjs.NavigationContext);
395
397
  let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
396
- let absoluteHref;
397
- let isExternal = false;
398
- if (typeof to === "string" && isAbsolute) {
399
- absoluteHref = to;
400
- if (isBrowser) {
401
- try {
402
- let currentUrl = new URL(window.location.href);
403
- let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
404
- let path = _chunkUQPBOMFPjs.stripBasename.call(void 0, targetUrl.pathname, basename);
405
- if (targetUrl.origin === currentUrl.origin && path != null) {
406
- to = path + targetUrl.search + targetUrl.hash;
407
- } else {
408
- isExternal = true;
409
- }
410
- } catch (e) {
411
- _chunkUQPBOMFPjs.warning.call(void 0,
412
- false,
413
- `<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
414
- );
415
- }
416
- }
417
- }
418
- let href = _chunkUQPBOMFPjs.useHref.call(void 0, to, { relative });
419
- let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkUQPBOMFPjs.usePrefetchBehavior.call(void 0,
398
+ let parsed = _chunkSZQUWNVJjs.parseToInfo.call(void 0, to, basename);
399
+ to = parsed.to;
400
+ let href = _chunkSZQUWNVJjs.useHref.call(void 0, to, { relative });
401
+ let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkSZQUWNVJjs.usePrefetchBehavior.call(void 0,
420
402
  prefetch,
421
403
  rest
422
404
  );
@@ -427,6 +409,7 @@ var Link = React.forwardRef(
427
409
  preventScrollReset,
428
410
  relative,
429
411
  viewTransition,
412
+ unstable_defaultShouldRevalidate,
430
413
  unstable_useTransitions
431
414
  });
432
415
  function handleClick(event) {
@@ -442,15 +425,15 @@ var Link = React.forwardRef(
442
425
  {
443
426
  ...rest,
444
427
  ...prefetchHandlers,
445
- href: absoluteHref || href,
446
- onClick: isExternal || reloadDocument ? onClick : handleClick,
447
- ref: _chunkUQPBOMFPjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
428
+ href: parsed.absoluteURL || href,
429
+ onClick: parsed.isExternal || reloadDocument ? onClick : handleClick,
430
+ ref: _chunkSZQUWNVJjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
448
431
  target,
449
432
  "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
450
433
  }
451
434
  )
452
435
  );
453
- return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkUQPBOMFPjs.PrefetchPageLinks, { page: href })) : link;
436
+ return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkSZQUWNVJjs.PrefetchPageLinks, { page: href })) : link;
454
437
  }
455
438
  );
456
439
  Link.displayName = "Link";
@@ -466,10 +449,10 @@ var NavLink = React.forwardRef(
466
449
  children,
467
450
  ...rest
468
451
  }, ref) {
469
- let path = _chunkUQPBOMFPjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
470
- let location = _chunkUQPBOMFPjs.useLocation.call(void 0, );
471
- let routerState = React.useContext(_chunkUQPBOMFPjs.DataRouterStateContext);
472
- let { navigator, basename } = React.useContext(_chunkUQPBOMFPjs.NavigationContext);
452
+ let path = _chunkSZQUWNVJjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
453
+ let location = _chunkSZQUWNVJjs.useLocation.call(void 0, );
454
+ let routerState = React.useContext(_chunkSZQUWNVJjs.DataRouterStateContext);
455
+ let { navigator, basename } = React.useContext(_chunkSZQUWNVJjs.NavigationContext);
473
456
  let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
474
457
  // eslint-disable-next-line react-hooks/rules-of-hooks
475
458
  useViewTransitionState(path) && viewTransition === true;
@@ -482,7 +465,7 @@ var NavLink = React.forwardRef(
482
465
  toPathname = toPathname.toLowerCase();
483
466
  }
484
467
  if (nextLocationPathname && basename) {
485
- nextLocationPathname = _chunkUQPBOMFPjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
468
+ nextLocationPathname = _chunkSZQUWNVJjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
486
469
  }
487
470
  const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
488
471
  let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
@@ -535,9 +518,10 @@ var Form = React.forwardRef(
535
518
  relative,
536
519
  preventScrollReset,
537
520
  viewTransition,
521
+ unstable_defaultShouldRevalidate,
538
522
  ...props
539
523
  }, forwardedRef) => {
540
- let { unstable_useTransitions } = React.useContext(_chunkUQPBOMFPjs.NavigationContext);
524
+ let { unstable_useTransitions } = React.useContext(_chunkSZQUWNVJjs.NavigationContext);
541
525
  let submit = useSubmit();
542
526
  let formAction = useFormAction(action, { relative });
543
527
  let formMethod = method.toLowerCase() === "get" ? "get" : "post";
@@ -556,7 +540,8 @@ var Form = React.forwardRef(
556
540
  state,
557
541
  relative,
558
542
  preventScrollReset,
559
- viewTransition
543
+ viewTransition,
544
+ unstable_defaultShouldRevalidate
560
545
  });
561
546
  if (unstable_useTransitions && navigate !== false) {
562
547
  React.startTransition(() => doSubmit());
@@ -583,10 +568,10 @@ function ScrollRestoration({
583
568
  storageKey,
584
569
  ...props
585
570
  }) {
586
- let remixContext = React.useContext(_chunkUQPBOMFPjs.FrameworkContext);
587
- let { basename } = React.useContext(_chunkUQPBOMFPjs.NavigationContext);
588
- let location = _chunkUQPBOMFPjs.useLocation.call(void 0, );
589
- let matches = _chunkUQPBOMFPjs.useMatches.call(void 0, );
571
+ let remixContext = React.useContext(_chunkSZQUWNVJjs.FrameworkContext);
572
+ let { basename } = React.useContext(_chunkSZQUWNVJjs.NavigationContext);
573
+ let location = _chunkSZQUWNVJjs.useLocation.call(void 0, );
574
+ let matches = _chunkSZQUWNVJjs.useMatches.call(void 0, );
590
575
  useScrollRestoration({ getKey, storageKey });
591
576
  let ssrKey = React.useMemo(
592
577
  () => {
@@ -640,13 +625,13 @@ function getDataRouterConsoleError(hookName) {
640
625
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
641
626
  }
642
627
  function useDataRouterContext(hookName) {
643
- let ctx = React.useContext(_chunkUQPBOMFPjs.DataRouterContext);
644
- _chunkUQPBOMFPjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
628
+ let ctx = React.useContext(_chunkSZQUWNVJjs.DataRouterContext);
629
+ _chunkSZQUWNVJjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
645
630
  return ctx;
646
631
  }
647
632
  function useDataRouterState(hookName) {
648
- let state = React.useContext(_chunkUQPBOMFPjs.DataRouterStateContext);
649
- _chunkUQPBOMFPjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
633
+ let state = React.useContext(_chunkSZQUWNVJjs.DataRouterStateContext);
634
+ _chunkSZQUWNVJjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
650
635
  return state;
651
636
  }
652
637
  function useLinkClickHandler(to, {
@@ -656,22 +641,24 @@ function useLinkClickHandler(to, {
656
641
  preventScrollReset,
657
642
  relative,
658
643
  viewTransition,
644
+ unstable_defaultShouldRevalidate,
659
645
  unstable_useTransitions
660
646
  } = {}) {
661
- let navigate = _chunkUQPBOMFPjs.useNavigate.call(void 0, );
662
- let location = _chunkUQPBOMFPjs.useLocation.call(void 0, );
663
- let path = _chunkUQPBOMFPjs.useResolvedPath.call(void 0, to, { relative });
647
+ let navigate = _chunkSZQUWNVJjs.useNavigate.call(void 0, );
648
+ let location = _chunkSZQUWNVJjs.useLocation.call(void 0, );
649
+ let path = _chunkSZQUWNVJjs.useResolvedPath.call(void 0, to, { relative });
664
650
  return React.useCallback(
665
651
  (event) => {
666
652
  if (shouldProcessLinkClick(event, target)) {
667
653
  event.preventDefault();
668
- let replace = replaceProp !== void 0 ? replaceProp : _chunkUQPBOMFPjs.createPath.call(void 0, location) === _chunkUQPBOMFPjs.createPath.call(void 0, path);
654
+ let replace = replaceProp !== void 0 ? replaceProp : _chunkSZQUWNVJjs.createPath.call(void 0, location) === _chunkSZQUWNVJjs.createPath.call(void 0, path);
669
655
  let doNavigate = () => navigate(to, {
670
656
  replace,
671
657
  state,
672
658
  preventScrollReset,
673
659
  relative,
674
- viewTransition
660
+ viewTransition,
661
+ unstable_defaultShouldRevalidate
675
662
  });
676
663
  if (unstable_useTransitions) {
677
664
  React.startTransition(() => doNavigate());
@@ -691,18 +678,19 @@ function useLinkClickHandler(to, {
691
678
  preventScrollReset,
692
679
  relative,
693
680
  viewTransition,
681
+ unstable_defaultShouldRevalidate,
694
682
  unstable_useTransitions
695
683
  ]
696
684
  );
697
685
  }
698
686
  function useSearchParams(defaultInit) {
699
- _chunkUQPBOMFPjs.warning.call(void 0,
687
+ _chunkSZQUWNVJjs.warning.call(void 0,
700
688
  typeof URLSearchParams !== "undefined",
701
689
  `You cannot use the \`useSearchParams\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`
702
690
  );
703
691
  let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
704
692
  let hasSetSearchParamsRef = React.useRef(false);
705
- let location = _chunkUQPBOMFPjs.useLocation.call(void 0, );
693
+ let location = _chunkSZQUWNVJjs.useLocation.call(void 0, );
706
694
  let searchParams = React.useMemo(
707
695
  () => (
708
696
  // Only merge in the defaults if we haven't yet called setSearchParams.
@@ -715,7 +703,7 @@ function useSearchParams(defaultInit) {
715
703
  ),
716
704
  [location.search]
717
705
  );
718
- let navigate = _chunkUQPBOMFPjs.useNavigate.call(void 0, );
706
+ let navigate = _chunkSZQUWNVJjs.useNavigate.call(void 0, );
719
707
  let setSearchParams = React.useCallback(
720
708
  (nextInit, navigateOptions) => {
721
709
  const newSearchParams = createSearchParams(
@@ -732,8 +720,8 @@ var fetcherId = 0;
732
720
  var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
733
721
  function useSubmit() {
734
722
  let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
735
- let { basename } = React.useContext(_chunkUQPBOMFPjs.NavigationContext);
736
- let currentRouteId = _chunkUQPBOMFPjs.useRouteId.call(void 0, );
723
+ let { basename } = React.useContext(_chunkSZQUWNVJjs.NavigationContext);
724
+ let currentRouteId = _chunkSZQUWNVJjs.useRouteId.call(void 0, );
737
725
  let routerFetch = router.fetch;
738
726
  let routerNavigate = router.navigate;
739
727
  return React.useCallback(
@@ -745,6 +733,7 @@ function useSubmit() {
745
733
  if (options.navigate === false) {
746
734
  let key = options.fetcherKey || getUniqueFetcherId();
747
735
  await routerFetch(key, currentRouteId, options.action || action, {
736
+ unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
748
737
  preventScrollReset: options.preventScrollReset,
749
738
  formData,
750
739
  body,
@@ -754,6 +743,7 @@ function useSubmit() {
754
743
  });
755
744
  } else {
756
745
  await routerNavigate(options.action || action, {
746
+ unstable_defaultShouldRevalidate: options.unstable_defaultShouldRevalidate,
757
747
  preventScrollReset: options.preventScrollReset,
758
748
  formData,
759
749
  body,
@@ -771,12 +761,12 @@ function useSubmit() {
771
761
  );
772
762
  }
773
763
  function useFormAction(action, { relative } = {}) {
774
- let { basename } = React.useContext(_chunkUQPBOMFPjs.NavigationContext);
775
- let routeContext = React.useContext(_chunkUQPBOMFPjs.RouteContext);
776
- _chunkUQPBOMFPjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
764
+ let { basename } = React.useContext(_chunkSZQUWNVJjs.NavigationContext);
765
+ let routeContext = React.useContext(_chunkSZQUWNVJjs.RouteContext);
766
+ _chunkSZQUWNVJjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
777
767
  let [match] = routeContext.matches.slice(-1);
778
- let path = { ..._chunkUQPBOMFPjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
779
- let location = _chunkUQPBOMFPjs.useLocation.call(void 0, );
768
+ let path = { ..._chunkSZQUWNVJjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
769
+ let location = _chunkSZQUWNVJjs.useLocation.call(void 0, );
780
770
  if (action == null) {
781
771
  path.search = location.search;
782
772
  let params = new URLSearchParams(path.search);
@@ -793,21 +783,21 @@ function useFormAction(action, { relative } = {}) {
793
783
  path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
794
784
  }
795
785
  if (basename !== "/") {
796
- path.pathname = path.pathname === "/" ? basename : _chunkUQPBOMFPjs.joinPaths.call(void 0, [basename, path.pathname]);
786
+ path.pathname = path.pathname === "/" ? basename : _chunkSZQUWNVJjs.joinPaths.call(void 0, [basename, path.pathname]);
797
787
  }
798
- return _chunkUQPBOMFPjs.createPath.call(void 0, path);
788
+ return _chunkSZQUWNVJjs.createPath.call(void 0, path);
799
789
  }
800
790
  function useFetcher({
801
791
  key
802
792
  } = {}) {
803
793
  let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
804
794
  let state = useDataRouterState("useFetcher" /* UseFetcher */);
805
- let fetcherData = React.useContext(_chunkUQPBOMFPjs.FetchersContext);
806
- let route = React.useContext(_chunkUQPBOMFPjs.RouteContext);
795
+ let fetcherData = React.useContext(_chunkSZQUWNVJjs.FetchersContext);
796
+ let route = React.useContext(_chunkSZQUWNVJjs.RouteContext);
807
797
  let routeId = _optionalChain([route, 'access', _23 => _23.matches, 'access', _24 => _24[route.matches.length - 1], 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id]);
808
- _chunkUQPBOMFPjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
809
- _chunkUQPBOMFPjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
810
- _chunkUQPBOMFPjs.invariant.call(void 0,
798
+ _chunkSZQUWNVJjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
799
+ _chunkSZQUWNVJjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
800
+ _chunkSZQUWNVJjs.invariant.call(void 0,
811
801
  routeId != null,
812
802
  `useFetcher can only be used on routes that contain a unique "id"`
813
803
  );
@@ -823,7 +813,7 @@ function useFetcher({
823
813
  }, [deleteFetcher, getFetcher, fetcherKey]);
824
814
  let load = React.useCallback(
825
815
  async (href, opts) => {
826
- _chunkUQPBOMFPjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
816
+ _chunkSZQUWNVJjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
827
817
  await routerFetch(fetcherKey, routeId, href, opts);
828
818
  },
829
819
  [fetcherKey, routeId, routerFetch]
@@ -852,7 +842,7 @@ function useFetcher({
852
842
  FetcherForm2.displayName = "fetcher.Form";
853
843
  return FetcherForm2;
854
844
  }, [fetcherKey]);
855
- let fetcher = state.fetchers.get(fetcherKey) || _chunkUQPBOMFPjs.IDLE_FETCHER;
845
+ let fetcher = state.fetchers.get(fetcherKey) || _chunkSZQUWNVJjs.IDLE_FETCHER;
856
846
  let data = fetcherData.get(fetcherKey);
857
847
  let fetcherWithComponents = React.useMemo(
858
848
  () => ({
@@ -883,7 +873,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
883
873
  key = getKey(
884
874
  {
885
875
  ...location,
886
- pathname: _chunkUQPBOMFPjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
876
+ pathname: _chunkSZQUWNVJjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
887
877
  },
888
878
  matches
889
879
  );
@@ -904,10 +894,10 @@ function useScrollRestoration({
904
894
  let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
905
895
  "useScrollRestoration" /* UseScrollRestoration */
906
896
  );
907
- let { basename } = React.useContext(_chunkUQPBOMFPjs.NavigationContext);
908
- let location = _chunkUQPBOMFPjs.useLocation.call(void 0, );
909
- let matches = _chunkUQPBOMFPjs.useMatches.call(void 0, );
910
- let navigation = _chunkUQPBOMFPjs.useNavigation.call(void 0, );
897
+ let { basename } = React.useContext(_chunkSZQUWNVJjs.NavigationContext);
898
+ let location = _chunkSZQUWNVJjs.useLocation.call(void 0, );
899
+ let matches = _chunkSZQUWNVJjs.useMatches.call(void 0, );
900
+ let navigation = _chunkSZQUWNVJjs.useNavigation.call(void 0, );
911
901
  React.useEffect(() => {
912
902
  window.history.scrollRestoration = "manual";
913
903
  return () => {
@@ -926,7 +916,7 @@ function useScrollRestoration({
926
916
  JSON.stringify(savedScrollPositions)
927
917
  );
928
918
  } catch (error) {
929
- _chunkUQPBOMFPjs.warning.call(void 0,
919
+ _chunkSZQUWNVJjs.warning.call(void 0,
930
920
  false,
931
921
  `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
932
922
  );
@@ -973,7 +963,7 @@ function useScrollRestoration({
973
963
  }
974
964
  }
975
965
  } catch (e2) {
976
- _chunkUQPBOMFPjs.warning.call(void 0,
966
+ _chunkSZQUWNVJjs.warning.call(void 0,
977
967
  false,
978
968
  `"${location.hash.slice(
979
969
  1
@@ -1011,7 +1001,7 @@ function usePrompt({
1011
1001
  when,
1012
1002
  message
1013
1003
  }) {
1014
- let blocker = _chunkUQPBOMFPjs.useBlocker.call(void 0, when);
1004
+ let blocker = _chunkSZQUWNVJjs.useBlocker.call(void 0, when);
1015
1005
  React.useEffect(() => {
1016
1006
  if (blocker.state === "blocked") {
1017
1007
  let proceed = window.confirm(message);
@@ -1029,21 +1019,21 @@ function usePrompt({
1029
1019
  }, [blocker, when]);
1030
1020
  }
1031
1021
  function useViewTransitionState(to, { relative } = {}) {
1032
- let vtContext = React.useContext(_chunkUQPBOMFPjs.ViewTransitionContext);
1033
- _chunkUQPBOMFPjs.invariant.call(void 0,
1022
+ let vtContext = React.useContext(_chunkSZQUWNVJjs.ViewTransitionContext);
1023
+ _chunkSZQUWNVJjs.invariant.call(void 0,
1034
1024
  vtContext != null,
1035
1025
  "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1036
1026
  );
1037
1027
  let { basename } = useDataRouterContext(
1038
1028
  "useViewTransitionState" /* useViewTransitionState */
1039
1029
  );
1040
- let path = _chunkUQPBOMFPjs.useResolvedPath.call(void 0, to, { relative });
1030
+ let path = _chunkSZQUWNVJjs.useResolvedPath.call(void 0, to, { relative });
1041
1031
  if (!vtContext.isTransitioning) {
1042
1032
  return false;
1043
1033
  }
1044
- let currentPath = _chunkUQPBOMFPjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
1045
- let nextPath = _chunkUQPBOMFPjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
1046
- return _chunkUQPBOMFPjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkUQPBOMFPjs.matchPath.call(void 0, path.pathname, currentPath) != null;
1034
+ let currentPath = _chunkSZQUWNVJjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
1035
+ let nextPath = _chunkSZQUWNVJjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
1036
+ return _chunkSZQUWNVJjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkSZQUWNVJjs.matchPath.call(void 0, path.pathname, currentPath) != null;
1047
1037
  }
1048
1038
 
1049
1039
  // lib/dom/server.tsx
@@ -1054,7 +1044,7 @@ function StaticRouter({
1054
1044
  location: locationProp = "/"
1055
1045
  }) {
1056
1046
  if (typeof locationProp === "string") {
1057
- locationProp = _chunkUQPBOMFPjs.parsePath.call(void 0, locationProp);
1047
+ locationProp = _chunkSZQUWNVJjs.parsePath.call(void 0, locationProp);
1058
1048
  }
1059
1049
  let action = "POP" /* Pop */;
1060
1050
  let location = {
@@ -1066,7 +1056,7 @@ function StaticRouter({
1066
1056
  };
1067
1057
  let staticNavigator = getStatelessNavigator();
1068
1058
  return /* @__PURE__ */ React2.createElement(
1069
- _chunkUQPBOMFPjs.Router,
1059
+ _chunkSZQUWNVJjs.Router,
1070
1060
  {
1071
1061
  basename,
1072
1062
  children,
@@ -1084,7 +1074,7 @@ function StaticRouterProvider({
1084
1074
  hydrate = true,
1085
1075
  nonce
1086
1076
  }) {
1087
- _chunkUQPBOMFPjs.invariant.call(void 0,
1077
+ _chunkSZQUWNVJjs.invariant.call(void 0,
1088
1078
  router && context,
1089
1079
  "You must provide `router` and `context` to <StaticRouterProvider>"
1090
1080
  );
@@ -1107,8 +1097,8 @@ function StaticRouterProvider({
1107
1097
  hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
1108
1098
  }
1109
1099
  let { state } = dataRouterContext.router;
1110
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkUQPBOMFPjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkUQPBOMFPjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkUQPBOMFPjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkUQPBOMFPjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
1111
- _chunkUQPBOMFPjs.Router,
1100
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkSZQUWNVJjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkSZQUWNVJjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkSZQUWNVJjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkSZQUWNVJjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
1101
+ _chunkSZQUWNVJjs.Router,
1112
1102
  {
1113
1103
  basename: dataRouterContext.basename,
1114
1104
  location: state.location,
@@ -1139,14 +1129,14 @@ function DataRoutes({
1139
1129
  future,
1140
1130
  state
1141
1131
  }) {
1142
- return _chunkUQPBOMFPjs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
1132
+ return _chunkSZQUWNVJjs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
1143
1133
  }
1144
1134
  function serializeErrors(errors) {
1145
1135
  if (!errors) return null;
1146
1136
  let entries = Object.entries(errors);
1147
1137
  let serialized = {};
1148
1138
  for (let [key, val] of entries) {
1149
- if (_chunkUQPBOMFPjs.isRouteErrorResponse.call(void 0, val)) {
1139
+ if (_chunkSZQUWNVJjs.isRouteErrorResponse.call(void 0, val)) {
1150
1140
  serialized[key] = { ...val, __type: "RouteErrorResponse" };
1151
1141
  } else if (val instanceof Error) {
1152
1142
  serialized[key] = {
@@ -1196,16 +1186,16 @@ function getStatelessNavigator() {
1196
1186
  };
1197
1187
  }
1198
1188
  function createStaticHandler2(routes, opts) {
1199
- return _chunkUQPBOMFPjs.createStaticHandler.call(void 0, routes, {
1189
+ return _chunkSZQUWNVJjs.createStaticHandler.call(void 0, routes, {
1200
1190
  ...opts,
1201
- mapRouteProperties: _chunkUQPBOMFPjs.mapRouteProperties
1191
+ mapRouteProperties: _chunkSZQUWNVJjs.mapRouteProperties
1202
1192
  });
1203
1193
  }
1204
1194
  function createStaticRouter(routes, context, opts = {}) {
1205
1195
  let manifest = {};
1206
- let dataRoutes = _chunkUQPBOMFPjs.convertRoutesToDataRoutes.call(void 0,
1196
+ let dataRoutes = _chunkSZQUWNVJjs.convertRoutesToDataRoutes.call(void 0,
1207
1197
  routes,
1208
- _chunkUQPBOMFPjs.mapRouteProperties,
1198
+ _chunkSZQUWNVJjs.mapRouteProperties,
1209
1199
  void 0,
1210
1200
  manifest
1211
1201
  );
@@ -1236,7 +1226,7 @@ function createStaticRouter(routes, context, opts = {}) {
1236
1226
  actionData: context.actionData,
1237
1227
  errors: context.errors,
1238
1228
  initialized: true,
1239
- navigation: _chunkUQPBOMFPjs.IDLE_NAVIGATION,
1229
+ navigation: _chunkSZQUWNVJjs.IDLE_NAVIGATION,
1240
1230
  restoreScrollPosition: null,
1241
1231
  preventScrollReset: false,
1242
1232
  revalidation: "idle",
@@ -1271,7 +1261,7 @@ function createStaticRouter(routes, context, opts = {}) {
1271
1261
  createHref,
1272
1262
  encodeLocation,
1273
1263
  getFetcher() {
1274
- return _chunkUQPBOMFPjs.IDLE_FETCHER;
1264
+ return _chunkSZQUWNVJjs.IDLE_FETCHER;
1275
1265
  },
1276
1266
  deleteFetcher() {
1277
1267
  throw msg("deleteFetcher");
@@ -1283,7 +1273,7 @@ function createStaticRouter(routes, context, opts = {}) {
1283
1273
  throw msg("dispose");
1284
1274
  },
1285
1275
  getBlocker() {
1286
- return _chunkUQPBOMFPjs.IDLE_BLOCKER;
1276
+ return _chunkSZQUWNVJjs.IDLE_BLOCKER;
1287
1277
  },
1288
1278
  deleteBlocker() {
1289
1279
  throw msg("deleteBlocker");
@@ -1301,10 +1291,10 @@ function createStaticRouter(routes, context, opts = {}) {
1301
1291
  };
1302
1292
  }
1303
1293
  function createHref(to) {
1304
- return typeof to === "string" ? to : _chunkUQPBOMFPjs.createPath.call(void 0, to);
1294
+ return typeof to === "string" ? to : _chunkSZQUWNVJjs.createPath.call(void 0, to);
1305
1295
  }
1306
1296
  function encodeLocation(to) {
1307
- let href = typeof to === "string" ? to : _chunkUQPBOMFPjs.createPath.call(void 0, to);
1297
+ let href = typeof to === "string" ? to : _chunkSZQUWNVJjs.createPath.call(void 0, to);
1308
1298
  href = href.replace(/ $/, "%20");
1309
1299
  let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
1310
1300
  return {