react-router 7.1.3 → 7.1.4

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 (36) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/dist/development/{chunk-SYFQ2XB5.mjs → chunk-W3FMU5Y5.mjs} +52 -47
  3. package/dist/development/dom-export.d.mts +2 -2
  4. package/dist/development/dom-export.d.ts +2 -2
  5. package/dist/development/dom-export.js +35 -36
  6. package/dist/development/dom-export.mjs +2 -2
  7. package/dist/{production/fog-of-war-Ckdfl79L.d.ts → development/fog-of-war-CCAcUMgB.d.ts} +1 -1
  8. package/dist/development/{fog-of-war-Ckdfl79L.d.ts → fog-of-war-D6dP9JIt.d.mts} +1 -1
  9. package/dist/development/index.d.mts +5 -41
  10. package/dist/development/index.d.ts +5 -41
  11. package/dist/development/index.js +52 -47
  12. package/dist/development/index.mjs +2 -2
  13. package/dist/development/lib/types/route-module.d.mts +1 -1
  14. package/dist/development/lib/types/route-module.d.ts +1 -1
  15. package/dist/development/lib/types/route-module.js +1 -1
  16. package/dist/development/lib/types/route-module.mjs +1 -1
  17. package/dist/development/{route-data-Cw8htKcF.d.ts → route-data-Cq_b5feC.d.mts} +27 -1
  18. package/dist/{production/route-data-Cw8htKcF.d.mts → development/route-data-Cq_b5feC.d.ts} +27 -1
  19. package/dist/production/{chunk-OKQ6KMOJ.mjs → chunk-FIUQORTV.mjs} +52 -47
  20. package/dist/production/dom-export.d.mts +2 -2
  21. package/dist/production/dom-export.d.ts +2 -2
  22. package/dist/production/dom-export.js +35 -36
  23. package/dist/production/dom-export.mjs +2 -2
  24. package/dist/{development/fog-of-war-ClXvjZ4E.d.mts → production/fog-of-war-CCAcUMgB.d.ts} +1 -1
  25. package/dist/production/{fog-of-war-ClXvjZ4E.d.mts → fog-of-war-D6dP9JIt.d.mts} +1 -1
  26. package/dist/production/index.d.mts +5 -41
  27. package/dist/production/index.d.ts +5 -41
  28. package/dist/production/index.js +52 -47
  29. package/dist/production/index.mjs +2 -2
  30. package/dist/production/lib/types/route-module.d.mts +1 -1
  31. package/dist/production/lib/types/route-module.d.ts +1 -1
  32. package/dist/production/lib/types/route-module.js +1 -1
  33. package/dist/production/lib/types/route-module.mjs +1 -1
  34. package/dist/production/{route-data-Cw8htKcF.d.ts → route-data-Cq_b5feC.d.mts} +27 -1
  35. package/dist/{development/route-data-Cw8htKcF.d.mts → production/route-data-Cq_b5feC.d.ts} +27 -1
  36. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.3
2
+ * react-router v7.1.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -776,6 +776,7 @@ function createRouter(init) {
776
776
  let getScrollPosition = null;
777
777
  let initialScrollRestored = init.hydrationData != null;
778
778
  let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
779
+ let initialMatchesIsFOW = false;
779
780
  let initialErrors = null;
780
781
  if (initialMatches == null && !patchRoutesOnNavigationImpl) {
781
782
  let error = getInternalRouterError(404, {
@@ -805,6 +806,7 @@ function createRouter(init) {
805
806
  init.history.location.pathname
806
807
  );
807
808
  if (fogOfWar.active && fogOfWar.matches) {
809
+ initialMatchesIsFOW = true;
808
810
  initialMatches = fogOfWar.matches;
809
811
  }
810
812
  } else if (initialMatches.some((m) => m.route.lazy)) {
@@ -1170,7 +1172,10 @@ function createRouter(init) {
1170
1172
  pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;
1171
1173
  let routesToUse = inFlightDataRoutes || dataRoutes;
1172
1174
  let loadingNavigation = opts && opts.overrideNavigation;
1173
- let matches = matchRoutes(routesToUse, location, basename);
1175
+ let matches = opts?.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ? (
1176
+ // `matchRoutes()` has already been called if we're in here via `router.initialize()`
1177
+ state.matches
1178
+ ) : matchRoutes(routesToUse, location, basename);
1174
1179
  let flushSync2 = (opts && opts.flushSync) === true;
1175
1180
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1176
1181
  if (fogOfWar.active && fogOfWar.matches) {
@@ -2973,14 +2978,20 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
2973
2978
  return {
2974
2979
  type: "error" /* error */,
2975
2980
  error: result.data,
2976
- statusCode: result.init?.status
2981
+ statusCode: result.init?.status,
2982
+ headers: result.init?.headers ? new Headers(result.init.headers) : void 0
2977
2983
  };
2978
2984
  }
2979
- result = new ErrorResponseImpl(
2980
- result.init?.status || 500,
2981
- void 0,
2982
- result.data
2983
- );
2985
+ return {
2986
+ type: "error" /* error */,
2987
+ error: new ErrorResponseImpl(
2988
+ result.init?.status || 500,
2989
+ void 0,
2990
+ result.data
2991
+ ),
2992
+ statusCode: isRouteErrorResponse(result) ? result.status : void 0,
2993
+ headers: result.init?.headers ? new Headers(result.init.headers) : void 0
2994
+ };
2984
2995
  }
2985
2996
  return {
2986
2997
  type: "error" /* error */,
@@ -3549,7 +3560,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
3549
3560
  // router loaded. We can help them understand how to avoid that.
3550
3561
  `useRoutes() may be used only in the context of a <Router> component.`
3551
3562
  );
3552
- let { navigator: navigator2 } = React2.useContext(NavigationContext);
3563
+ let { navigator: navigator2, static: isStatic } = React2.useContext(NavigationContext);
3553
3564
  let { matches: parentMatches } = React2.useContext(RouteContext);
3554
3565
  let routeMatch = parentMatches[parentMatches.length - 1];
3555
3566
  let parentParams = routeMatch ? routeMatch.params : {};
@@ -3585,7 +3596,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
3585
3596
  let segments = pathname.replace(/^\//, "").split("/");
3586
3597
  remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
3587
3598
  }
3588
- let matches = matchRoutes(routes, { pathname: remainingPathname });
3599
+ let matches = !isStatic && dataRouterState && dataRouterState.matches && dataRouterState.matches.length > 0 ? dataRouterState.matches : matchRoutes(routes, { pathname: remainingPathname });
3589
3600
  if (ENABLE_DEV_WARNINGS) {
3590
3601
  warning(
3591
3602
  parentRoute || matches != null,
@@ -4481,6 +4492,14 @@ async function fetchAndDecode(url, init) {
4481
4492
  if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
4482
4493
  throw new ErrorResponseImpl(404, "Not Found", true);
4483
4494
  }
4495
+ const NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([100, 101, 204, 205]);
4496
+ if (NO_BODY_STATUS_CODES.has(res.status)) {
4497
+ if (!init.method || init.method === "GET") {
4498
+ return { status: res.status, data: {} };
4499
+ } else {
4500
+ return { status: res.status, data: { data: void 0 } };
4501
+ }
4502
+ }
4484
4503
  invariant2(res.body, "No response body to decode");
4485
4504
  try {
4486
4505
  let decoded = await decodeViaTurboStream(res.body, window);
@@ -5056,12 +5075,13 @@ function useFogOFWarDiscovery(router2, manifest, routeModules, isSpaMode) {
5056
5075
  if (!path) {
5057
5076
  return;
5058
5077
  }
5059
- let url = new URL(path, window.location.origin);
5060
- if (!discoveredPaths.has(url.pathname)) {
5061
- nextPaths.add(url.pathname);
5078
+ let pathname = el.tagName === "A" ? el.pathname : new URL(path, window.location.origin).pathname;
5079
+ if (!discoveredPaths.has(pathname)) {
5080
+ nextPaths.add(pathname);
5062
5081
  }
5063
5082
  }
5064
5083
  async function fetchPatches() {
5084
+ document.querySelectorAll("a[data-discover], form[data-discover]").forEach(registerElement);
5065
5085
  let lazyPaths = Array.from(nextPaths.keys()).filter((path) => {
5066
5086
  if (discoveredPaths.has(path)) {
5067
5087
  nextPaths.delete(path);
@@ -5085,30 +5105,9 @@ function useFogOFWarDiscovery(router2, manifest, routeModules, isSpaMode) {
5085
5105
  console.error("Failed to fetch manifest patches", e);
5086
5106
  }
5087
5107
  }
5088
- document.body.querySelectorAll("a[data-discover], form[data-discover]").forEach((el) => registerElement(el));
5089
- fetchPatches();
5090
5108
  let debouncedFetchPatches = debounce(fetchPatches, 100);
5091
- function isElement(node) {
5092
- return node.nodeType === Node.ELEMENT_NODE;
5093
- }
5094
- let observer = new MutationObserver((records) => {
5095
- let elements = /* @__PURE__ */ new Set();
5096
- records.forEach((r) => {
5097
- [r.target, ...r.addedNodes].forEach((node) => {
5098
- if (!isElement(node)) return;
5099
- if (node.tagName === "A" && node.getAttribute("data-discover")) {
5100
- elements.add(node);
5101
- } else if (node.tagName === "FORM" && node.getAttribute("data-discover")) {
5102
- elements.add(node);
5103
- }
5104
- if (node.tagName !== "A") {
5105
- node.querySelectorAll("a[data-discover], form[data-discover]").forEach((el) => elements.add(el));
5106
- }
5107
- });
5108
- });
5109
- elements.forEach((el) => registerElement(el));
5110
- debouncedFetchPatches();
5111
- });
5109
+ fetchPatches();
5110
+ let observer = new MutationObserver(() => debouncedFetchPatches());
5112
5111
  observer.observe(document.documentElement, {
5113
5112
  subtree: true,
5114
5113
  childList: true,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.3
2
+ * react-router v7.1.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -25,7 +25,7 @@ import {
25
25
  matchRoutes,
26
26
  shouldHydrateRouteLoader,
27
27
  useFogOFWarDiscovery
28
- } from "./chunk-OKQ6KMOJ.mjs";
28
+ } from "./chunk-FIUQORTV.mjs";
29
29
 
30
30
  // lib/dom-export/dom-router-provider.tsx
31
31
  import * as React from "react";
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { n as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, g as RelativeRoutingType, v as NonIndexRouteObject, a0 as LazyRouteFunction, u as IndexRouteObject, h as Location, i as Action, al as Navigator, ao as RouteMatch, r as StaticHandlerContext, d as RouteManifest, R as RouteModules, ak as DataRouteObject, aH as RouteModule, $ as HTMLFormMethod, Z as FormEncType, at as PageLinkDescriptor, aI as History, x as GetScrollRestorationKeyFunction, N as NavigateOptions, y as Fetcher, S as SerializeFrom, B as BlockerFunction } from './route-data-Cw8htKcF.mjs';
2
+ import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, al as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, $ as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, ak as Navigator, an as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, aj as DataRouteObject, aK as RouteModule, _ as HTMLFormMethod, Y as FormEncType, aw as PageLinkDescriptor, aL as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-Cq_b5feC.js';
3
3
 
4
4
  /**
5
5
  * @private
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { n as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, am as PatchRoutesOnNavigationFunction, a as Router$1, T as To, g as RelativeRoutingType, v as NonIndexRouteObject, a0 as LazyRouteFunction, u as IndexRouteObject, h as Location, i as Action, al as Navigator, ao as RouteMatch, r as StaticHandlerContext, d as RouteManifest, R as RouteModules, ak as DataRouteObject, aH as RouteModule, $ as HTMLFormMethod, Z as FormEncType, at as PageLinkDescriptor, aI as History, x as GetScrollRestorationKeyFunction, N as NavigateOptions, y as Fetcher, S as SerializeFrom, B as BlockerFunction } from './route-data-Cw8htKcF.mjs';
2
+ import { j as RouteObject, F as FutureConfig$1, H as HydrationState, I as InitialEntry, D as DataStrategyFunction, al as PatchRoutesOnNavigationFunction, a as Router$1, T as To, c as RelativeRoutingType, u as NonIndexRouteObject, $ as LazyRouteFunction, q as IndexRouteObject, d as Location, e as Action, ak as Navigator, an as RouteMatch, o as StaticHandlerContext, b as RouteManifest, R as RouteModules, aj as DataRouteObject, aK as RouteModule, _ as HTMLFormMethod, Y as FormEncType, aw as PageLinkDescriptor, aL as History, w as GetScrollRestorationKeyFunction, N as NavigateOptions, x as Fetcher, m as SerializeFrom, B as BlockerFunction } from './route-data-Cq_b5feC.mjs';
3
3
 
4
4
  /**
5
5
  * @private
@@ -1,7 +1,7 @@
1
- import { R as RouteModules, a as Router, D as DataStrategyFunction, A as ActionFunction, L as LoaderFunction, C as ClientActionFunction, b as ClientLoaderFunction, c as LinksFunction, M as MetaFunction, d as RouteManifest, e as LoaderFunctionArgs, f as ActionFunctionArgs, T as To, g as RelativeRoutingType, h as Location, i as Action, P as ParamParseKey, j as Path, k as PathPattern, l as PathMatch, N as NavigateOptions, m as Params, n as RouteObject, o as Navigation, p as RevalidationState, U as UIMatch, S as SerializeFrom, B as BlockerFunction, q as Blocker, r as StaticHandlerContext, s as StaticHandler, F as FutureConfig$1, t as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, u as IndexRouteObject, v as NonIndexRouteObject, w as RouterState } from './route-data-Cw8htKcF.mjs';
2
- export { ap as ClientActionFunctionArgs, aq as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, y as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, x as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, au as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, av as LinkDescriptor, ar as MetaArgs, as as MetaDescriptor, z as NavigationStates, al as Navigator, at as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, E as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aA as UNSAFE_DataRouterContext, aB as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, az as UNSAFE_ErrorResponseImpl, aC as UNSAFE_FetchersContext, aD as UNSAFE_LocationContext, aE as UNSAFE_NavigationContext, aF as UNSAFE_RouteContext, aG as UNSAFE_ViewTransitionContext, aw as UNSAFE_createBrowserHistory, ay as UNSAFE_createRouter, ax as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath } from './route-data-Cw8htKcF.mjs';
3
- import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-ClXvjZ4E.mjs';
4
- export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-ClXvjZ4E.mjs';
1
+ import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-Cq_b5feC.mjs';
2
+ export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-Cq_b5feC.mjs';
3
+ import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-D6dP9JIt.mjs';
4
+ export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-D6dP9JIt.mjs';
5
5
  import * as React from 'react';
6
6
  import { ReactElement } from 'react';
7
7
  import { ParseOptions, SerializeOptions } from 'cookie';
@@ -24,42 +24,6 @@ declare enum ServerMode {
24
24
  Test = "test"
25
25
  }
26
26
 
27
- type HeadersArgs = {
28
- loaderHeaders: Headers;
29
- parentHeaders: Headers;
30
- actionHeaders: Headers;
31
- errorHeaders: Headers | undefined;
32
- };
33
- /**
34
- * A function that returns HTTP headers to be used for a route. These headers
35
- * will be merged with (and take precedence over) headers from parent routes.
36
- */
37
- interface HeadersFunction {
38
- (args: HeadersArgs): Headers | HeadersInit;
39
- }
40
- /**
41
- * An arbitrary object that is associated with a route.
42
- */
43
- type RouteHandle = unknown;
44
- interface EntryRouteModule {
45
- clientAction?: ClientActionFunction;
46
- clientLoader?: ClientLoaderFunction;
47
- ErrorBoundary?: any;
48
- HydrateFallback?: any;
49
- Layout?: any;
50
- default: any;
51
- handle?: RouteHandle;
52
- links?: LinksFunction;
53
- meta?: MetaFunction;
54
- }
55
- interface ServerRouteModule extends EntryRouteModule {
56
- action?: ActionFunction;
57
- headers?: HeadersFunction | {
58
- [name: string]: string;
59
- };
60
- loader?: LoaderFunction;
61
- }
62
-
63
27
  type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
64
28
  interface ServerRoute extends Route {
65
29
  children: ServerRoute[];
@@ -836,4 +800,4 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
836
800
  render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
837
801
  }
838
802
 
839
- export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, ClientActionFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, type HeadersArgs, type HeadersFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
803
+ export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
@@ -1,7 +1,7 @@
1
- import { R as RouteModules, a as Router, D as DataStrategyFunction, A as ActionFunction, L as LoaderFunction, C as ClientActionFunction, b as ClientLoaderFunction, c as LinksFunction, M as MetaFunction, d as RouteManifest, e as LoaderFunctionArgs, f as ActionFunctionArgs, T as To, g as RelativeRoutingType, h as Location, i as Action, P as ParamParseKey, j as Path, k as PathPattern, l as PathMatch, N as NavigateOptions, m as Params, n as RouteObject, o as Navigation, p as RevalidationState, U as UIMatch, S as SerializeFrom, B as BlockerFunction, q as Blocker, r as StaticHandlerContext, s as StaticHandler, F as FutureConfig$1, t as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, u as IndexRouteObject, v as NonIndexRouteObject, w as RouterState } from './route-data-Cw8htKcF.js';
2
- export { ap as ClientActionFunctionArgs, aq as ClientLoaderFunctionArgs, aj as DataRouteMatch, ak as DataRouteObject, Q as DataStrategyFunctionArgs, V as DataStrategyMatch, W as DataStrategyResult, Y as ErrorResponse, y as Fetcher, Z as FormEncType, _ as FormMethod, G as GetScrollPositionFunction, x as GetScrollRestorationKeyFunction, $ as HTMLFormMethod, au as HtmlLinkDescriptor, a9 as IDLE_BLOCKER, a8 as IDLE_FETCHER, a7 as IDLE_NAVIGATION, a0 as LazyRouteFunction, av as LinkDescriptor, ar as MetaArgs, as as MetaDescriptor, z as NavigationStates, al as Navigator, at as PageLinkDescriptor, am as PatchRoutesOnNavigationFunction, an as PatchRoutesOnNavigationFunctionArgs, a1 as PathParam, a2 as RedirectFunction, ao as RouteMatch, O as RouterFetchOptions, E as RouterInit, K as RouterNavigateOptions, J as RouterSubscriber, a3 as ShouldRevalidateFunction, a4 as ShouldRevalidateFunctionArgs, aA as UNSAFE_DataRouterContext, aB as UNSAFE_DataRouterStateContext, X as UNSAFE_DataWithResponseInit, az as UNSAFE_ErrorResponseImpl, aC as UNSAFE_FetchersContext, aD as UNSAFE_LocationContext, aE as UNSAFE_NavigationContext, aF as UNSAFE_RouteContext, aG as UNSAFE_ViewTransitionContext, aw as UNSAFE_createBrowserHistory, ay as UNSAFE_createRouter, ax as UNSAFE_invariant, a5 as createPath, aa as data, ab as generatePath, ac as isRouteErrorResponse, ad as matchPath, ae as matchRoutes, a6 as parsePath, af as redirect, ag as redirectDocument, ah as replace, ai as resolvePath } from './route-data-Cw8htKcF.js';
3
- import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-Ckdfl79L.js';
4
- export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-Ckdfl79L.js';
1
+ import { R as RouteModules, a as Router, D as DataStrategyFunction, b as RouteManifest, S as ServerRouteModule, L as LoaderFunctionArgs, A as ActionFunctionArgs, T as To, c as RelativeRoutingType, d as Location, e as Action, P as ParamParseKey, f as Path, g as PathPattern, h as PathMatch, N as NavigateOptions, i as Params, j as RouteObject, k as Navigation, l as RevalidationState, U as UIMatch, m as SerializeFrom, B as BlockerFunction, n as Blocker, o as StaticHandlerContext, p as StaticHandler, F as FutureConfig$1, C as CreateStaticHandlerOptions$1, I as InitialEntry, H as HydrationState, q as IndexRouteObject, r as LoaderFunction, s as ActionFunction, M as MetaFunction, t as LinksFunction, u as NonIndexRouteObject, v as RouterState } from './route-data-Cq_b5feC.js';
2
+ export { ao as ClientActionFunction, ap as ClientActionFunctionArgs, aq as ClientLoaderFunction, ar as ClientLoaderFunctionArgs, ai as DataRouteMatch, aj as DataRouteObject, O as DataStrategyFunctionArgs, Q as DataStrategyMatch, V as DataStrategyResult, X as ErrorResponse, x as Fetcher, Y as FormEncType, Z as FormMethod, G as GetScrollPositionFunction, w as GetScrollRestorationKeyFunction, _ as HTMLFormMethod, as as HeadersArgs, at as HeadersFunction, ax as HtmlLinkDescriptor, a8 as IDLE_BLOCKER, a7 as IDLE_FETCHER, a6 as IDLE_NAVIGATION, $ as LazyRouteFunction, ay as LinkDescriptor, au as MetaArgs, av as MetaDescriptor, y as NavigationStates, ak as Navigator, aw as PageLinkDescriptor, al as PatchRoutesOnNavigationFunction, am as PatchRoutesOnNavigationFunctionArgs, a0 as PathParam, a1 as RedirectFunction, an as RouteMatch, K as RouterFetchOptions, z as RouterInit, J as RouterNavigateOptions, E as RouterSubscriber, a2 as ShouldRevalidateFunction, a3 as ShouldRevalidateFunctionArgs, aD as UNSAFE_DataRouterContext, aE as UNSAFE_DataRouterStateContext, W as UNSAFE_DataWithResponseInit, aC as UNSAFE_ErrorResponseImpl, aF as UNSAFE_FetchersContext, aG as UNSAFE_LocationContext, aH as UNSAFE_NavigationContext, aI as UNSAFE_RouteContext, aJ as UNSAFE_ViewTransitionContext, az as UNSAFE_createBrowserHistory, aB as UNSAFE_createRouter, aA as UNSAFE_invariant, a4 as createPath, a9 as data, aa as generatePath, ab as isRouteErrorResponse, ac as matchPath, ad as matchRoutes, a5 as parsePath, ae as redirect, af as redirectDocument, ag as replace, ah as resolvePath } from './route-data-Cq_b5feC.js';
3
+ import { A as AssetsManifest, a as Route, F as FutureConfig, E as EntryContext } from './fog-of-war-CCAcUMgB.js';
4
+ export { f as Await, b as AwaitProps, J as BrowserRouter, B as BrowserRouterProps, v as FetcherFormProps, z as FetcherSubmitFunction, a4 as FetcherSubmitOptions, C as FetcherWithComponents, V as Form, w as FormProps, K as HashRouter, H as HashRouterProps, q as HistoryRouterProps, I as IndexRouteProps, L as LayoutRouteProps, Q as Link, s as LinkProps, ab as Links, g as MemoryRouter, M as MemoryRouterProps, aa as Meta, U as NavLink, t as NavLinkProps, u as NavLinkRenderProps, h as Navigate, N as NavigateProps, i as Outlet, O as OutletProps, a5 as ParamKeyValuePair, P as PathRouteProps, ad as PrefetchPageLinks, j as Route, c as RouteProps, k as Router, d as RouterProps, l as RouterProvider, R as RouterProviderProps, m as Routes, e as RoutesProps, ac as Scripts, ae as ScriptsProps, W as ScrollRestoration, S as ScrollRestorationProps, x as SetURLSearchParams, y as SubmitFunction, a6 as SubmitOptions, a8 as SubmitTarget, ag as UNSAFE_FrameworkContext, aj as UNSAFE_createClientRoutes, ak as UNSAFE_createClientRoutesWithHMRRevalidationOptOut, ah as UNSAFE_getPatchRoutesOnNavigationFunction, af as UNSAFE_mapRouteProperties, al as UNSAFE_shouldHydrateRouteLoader, ai as UNSAFE_useFogOFWarDiscovery, am as UNSAFE_useScrollRestoration, a7 as URLSearchParamsInit, D as createBrowserRouter, G as createHashRouter, n as createMemoryRouter, o as createRoutesFromChildren, p as createRoutesFromElements, a9 as createSearchParams, r as renderMatches, T as unstable_HistoryRouter, a2 as unstable_usePrompt, a1 as useBeforeUnload, $ as useFetcher, a0 as useFetchers, _ as useFormAction, X as useLinkClickHandler, Y as useSearchParams, Z as useSubmit, a3 as useViewTransitionState } from './fog-of-war-CCAcUMgB.js';
5
5
  import * as React from 'react';
6
6
  import { ReactElement } from 'react';
7
7
  import { ParseOptions, SerializeOptions } from 'cookie';
@@ -24,42 +24,6 @@ declare enum ServerMode {
24
24
  Test = "test"
25
25
  }
26
26
 
27
- type HeadersArgs = {
28
- loaderHeaders: Headers;
29
- parentHeaders: Headers;
30
- actionHeaders: Headers;
31
- errorHeaders: Headers | undefined;
32
- };
33
- /**
34
- * A function that returns HTTP headers to be used for a route. These headers
35
- * will be merged with (and take precedence over) headers from parent routes.
36
- */
37
- interface HeadersFunction {
38
- (args: HeadersArgs): Headers | HeadersInit;
39
- }
40
- /**
41
- * An arbitrary object that is associated with a route.
42
- */
43
- type RouteHandle = unknown;
44
- interface EntryRouteModule {
45
- clientAction?: ClientActionFunction;
46
- clientLoader?: ClientLoaderFunction;
47
- ErrorBoundary?: any;
48
- HydrateFallback?: any;
49
- Layout?: any;
50
- default: any;
51
- handle?: RouteHandle;
52
- links?: LinksFunction;
53
- meta?: MetaFunction;
54
- }
55
- interface ServerRouteModule extends EntryRouteModule {
56
- action?: ActionFunction;
57
- headers?: HeadersFunction | {
58
- [name: string]: string;
59
- };
60
- loader?: LoaderFunction;
61
- }
62
-
63
27
  type ServerRouteManifest = RouteManifest<Omit<ServerRoute, "children">>;
64
28
  interface ServerRoute extends Route {
65
29
  children: ServerRoute[];
@@ -836,4 +800,4 @@ declare class RemixErrorBoundary extends React.Component<RemixErrorBoundaryProps
836
800
  render(): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
837
801
  }
838
802
 
839
- export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, ClientActionFunction, ClientLoaderFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, type HeadersArgs, type HeadersFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
803
+ export { ActionFunction, ActionFunctionArgs, AppLoadContext$1 as AppLoadContext, Blocker, BlockerFunction, type Cookie, type CookieOptions, type CookieSignatureOptions, type CreateRequestHandlerFunction, Router as DataRouter, DataStrategyFunction, EntryContext, type FlashSessionData, type HandleDataRequestFunction, type HandleDocumentRequestFunction, type HandleErrorFunction, HydrationState, IndexRouteObject, InitialEntry, type IsCookieFunction, type IsSessionFunction, LinksFunction, LoaderFunction, LoaderFunctionArgs, Location, MetaFunction, type NavigateFunction, NavigateOptions, Navigation, Action as NavigationType, NonIndexRouteObject, ParamParseKey, Params, Path, PathMatch, PathPattern, RelativeRoutingType, type RequestHandler, RevalidationState, RouteObject, RouterState, type RoutesTestStubProps, type ServerBuild, type ServerEntryModule, ServerRouter, type ServerRouterProps, type Session, type SessionData, type SessionIdStorageStrategy, type SessionStorage, StaticHandler, StaticHandlerContext, StaticRouter, type StaticRouterProps, StaticRouterProvider, type StaticRouterProviderProps, To, UIMatch, AssetsManifest as UNSAFE_AssetsManifest, RemixErrorBoundary as UNSAFE_RemixErrorBoundary, RouteModules as UNSAFE_RouteModules, ServerMode as UNSAFE_ServerMode, SingleFetchRedirectSymbol as UNSAFE_SingleFetchRedirectSymbol, decodeViaTurboStream as UNSAFE_decodeViaTurboStream, deserializeErrors as UNSAFE_deserializeErrors, getSingleFetchDataStrategy as UNSAFE_getSingleFetchDataStrategy, createCookie, createCookieSessionStorage, createMemorySessionStorage, createRequestHandler, createRoutesStub, createSession, createSessionStorage, createStaticHandler, createStaticRouter, isCookie, isSession, setDevServerHooks as unstable_setDevServerHooks, useActionData, useAsyncError, useAsyncValue, useBlocker, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.3
2
+ * react-router v7.1.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1064,6 +1064,7 @@ function createRouter(init) {
1064
1064
  let getScrollPosition = null;
1065
1065
  let initialScrollRestored = init.hydrationData != null;
1066
1066
  let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
1067
+ let initialMatchesIsFOW = false;
1067
1068
  let initialErrors = null;
1068
1069
  if (initialMatches == null && !patchRoutesOnNavigationImpl) {
1069
1070
  let error = getInternalRouterError(404, {
@@ -1093,6 +1094,7 @@ function createRouter(init) {
1093
1094
  init.history.location.pathname
1094
1095
  );
1095
1096
  if (fogOfWar.active && fogOfWar.matches) {
1097
+ initialMatchesIsFOW = true;
1096
1098
  initialMatches = fogOfWar.matches;
1097
1099
  }
1098
1100
  } else if (initialMatches.some((m) => m.route.lazy)) {
@@ -1458,7 +1460,10 @@ function createRouter(init) {
1458
1460
  pendingViewTransitionEnabled = (opts && opts.enableViewTransition) === true;
1459
1461
  let routesToUse = inFlightDataRoutes || dataRoutes;
1460
1462
  let loadingNavigation = opts && opts.overrideNavigation;
1461
- let matches = matchRoutes(routesToUse, location, basename);
1463
+ let matches = opts?.initialHydration && state.matches && state.matches.length > 0 && !initialMatchesIsFOW ? (
1464
+ // `matchRoutes()` has already been called if we're in here via `router.initialize()`
1465
+ state.matches
1466
+ ) : matchRoutes(routesToUse, location, basename);
1462
1467
  let flushSync = (opts && opts.flushSync) === true;
1463
1468
  let fogOfWar = checkFogOfWar(matches, routesToUse, location.pathname);
1464
1469
  if (fogOfWar.active && fogOfWar.matches) {
@@ -3642,14 +3647,20 @@ async function convertDataStrategyResultToDataResult(dataStrategyResult) {
3642
3647
  return {
3643
3648
  type: "error" /* error */,
3644
3649
  error: result.data,
3645
- statusCode: result.init?.status
3650
+ statusCode: result.init?.status,
3651
+ headers: result.init?.headers ? new Headers(result.init.headers) : void 0
3646
3652
  };
3647
3653
  }
3648
- result = new ErrorResponseImpl(
3649
- result.init?.status || 500,
3650
- void 0,
3651
- result.data
3652
- );
3654
+ return {
3655
+ type: "error" /* error */,
3656
+ error: new ErrorResponseImpl(
3657
+ result.init?.status || 500,
3658
+ void 0,
3659
+ result.data
3660
+ ),
3661
+ statusCode: isRouteErrorResponse(result) ? result.status : void 0,
3662
+ headers: result.init?.headers ? new Headers(result.init.headers) : void 0
3663
+ };
3653
3664
  }
3654
3665
  return {
3655
3666
  type: "error" /* error */,
@@ -4350,7 +4361,7 @@ function useRoutesImpl(routes, locationArg, dataRouterState, future) {
4350
4361
  // router loaded. We can help them understand how to avoid that.
4351
4362
  `useRoutes() may be used only in the context of a <Router> component.`
4352
4363
  );
4353
- let { navigator: navigator2 } = React2.useContext(NavigationContext);
4364
+ let { navigator: navigator2, static: isStatic } = React2.useContext(NavigationContext);
4354
4365
  let { matches: parentMatches } = React2.useContext(RouteContext);
4355
4366
  let routeMatch = parentMatches[parentMatches.length - 1];
4356
4367
  let parentParams = routeMatch ? routeMatch.params : {};
@@ -4386,7 +4397,7 @@ Please change the parent <Route path="${parentPath}"> to <Route path="${parentPa
4386
4397
  let segments = pathname.replace(/^\//, "").split("/");
4387
4398
  remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
4388
4399
  }
4389
- let matches = matchRoutes(routes, { pathname: remainingPathname });
4400
+ let matches = !isStatic && dataRouterState && dataRouterState.matches && dataRouterState.matches.length > 0 ? dataRouterState.matches : matchRoutes(routes, { pathname: remainingPathname });
4390
4401
  if (ENABLE_DEV_WARNINGS) {
4391
4402
  warning(
4392
4403
  parentRoute || matches != null,
@@ -5966,6 +5977,14 @@ async function fetchAndDecode(url, init) {
5966
5977
  if (res.status === 404 && !res.headers.has("X-Remix-Response")) {
5967
5978
  throw new ErrorResponseImpl(404, "Not Found", true);
5968
5979
  }
5980
+ const NO_BODY_STATUS_CODES2 = /* @__PURE__ */ new Set([100, 101, 204, 205]);
5981
+ if (NO_BODY_STATUS_CODES2.has(res.status)) {
5982
+ if (!init.method || init.method === "GET") {
5983
+ return { status: res.status, data: {} };
5984
+ } else {
5985
+ return { status: res.status, data: { data: void 0 } };
5986
+ }
5987
+ }
5969
5988
  invariant2(res.body, "No response body to decode");
5970
5989
  try {
5971
5990
  let decoded = await decodeViaTurboStream(res.body, window);
@@ -6581,12 +6600,13 @@ function useFogOFWarDiscovery(router, manifest, routeModules, isSpaMode) {
6581
6600
  if (!path) {
6582
6601
  return;
6583
6602
  }
6584
- let url = new URL(path, window.location.origin);
6585
- if (!discoveredPaths.has(url.pathname)) {
6586
- nextPaths.add(url.pathname);
6603
+ let pathname = el.tagName === "A" ? el.pathname : new URL(path, window.location.origin).pathname;
6604
+ if (!discoveredPaths.has(pathname)) {
6605
+ nextPaths.add(pathname);
6587
6606
  }
6588
6607
  }
6589
6608
  async function fetchPatches() {
6609
+ document.querySelectorAll("a[data-discover], form[data-discover]").forEach(registerElement);
6590
6610
  let lazyPaths = Array.from(nextPaths.keys()).filter((path) => {
6591
6611
  if (discoveredPaths.has(path)) {
6592
6612
  nextPaths.delete(path);
@@ -6610,30 +6630,9 @@ function useFogOFWarDiscovery(router, manifest, routeModules, isSpaMode) {
6610
6630
  console.error("Failed to fetch manifest patches", e);
6611
6631
  }
6612
6632
  }
6613
- document.body.querySelectorAll("a[data-discover], form[data-discover]").forEach((el) => registerElement(el));
6614
- fetchPatches();
6615
6633
  let debouncedFetchPatches = debounce(fetchPatches, 100);
6616
- function isElement(node) {
6617
- return node.nodeType === Node.ELEMENT_NODE;
6618
- }
6619
- let observer = new MutationObserver((records) => {
6620
- let elements = /* @__PURE__ */ new Set();
6621
- records.forEach((r) => {
6622
- [r.target, ...r.addedNodes].forEach((node) => {
6623
- if (!isElement(node)) return;
6624
- if (node.tagName === "A" && node.getAttribute("data-discover")) {
6625
- elements.add(node);
6626
- } else if (node.tagName === "FORM" && node.getAttribute("data-discover")) {
6627
- elements.add(node);
6628
- }
6629
- if (node.tagName !== "A") {
6630
- node.querySelectorAll("a[data-discover], form[data-discover]").forEach((el) => elements.add(el));
6631
- }
6632
- });
6633
- });
6634
- elements.forEach((el) => registerElement(el));
6635
- debouncedFetchPatches();
6636
- });
6634
+ fetchPatches();
6635
+ let observer = new MutationObserver(() => debouncedFetchPatches());
6637
6636
  observer.observe(document.documentElement, {
6638
6637
  subtree: true,
6639
6638
  childList: true,
@@ -7127,7 +7126,7 @@ function mergeRefs(...refs) {
7127
7126
  var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
7128
7127
  try {
7129
7128
  if (isBrowser) {
7130
- window.__reactRouterVersion = "7.1.3";
7129
+ window.__reactRouterVersion = "7.1.4";
7131
7130
  }
7132
7131
  } catch (e) {
7133
7132
  }
@@ -8847,8 +8846,11 @@ function prependCookies(parentHeaders, childHeaders) {
8847
8846
  let parentSetCookieString = parentHeaders.get("Set-Cookie");
8848
8847
  if (parentSetCookieString) {
8849
8848
  let cookies = (0, import_set_cookie_parser.splitCookiesString)(parentSetCookieString);
8849
+ let childCookies = new Set(childHeaders.getSetCookie());
8850
8850
  cookies.forEach((cookie) => {
8851
- childHeaders.append("Set-Cookie", cookie);
8851
+ if (!childCookies.has(cookie)) {
8852
+ childHeaders.append("Set-Cookie", cookie);
8853
+ }
8852
8854
  });
8853
8855
  }
8854
8856
  }
@@ -9078,6 +9080,7 @@ function encodeViaTurboStream(data2, requestSignal, streamTimeout, serverMode) {
9078
9080
  }
9079
9081
 
9080
9082
  // lib/server-runtime/server.ts
9083
+ var NO_BODY_STATUS_CODES = /* @__PURE__ */ new Set([100, 101, 204, 205, 304]);
9081
9084
  function derive(build, mode) {
9082
9085
  let routes = createRoutes(build.routes);
9083
9086
  let dataRoutes = createStaticHandlerDataRoutes(build.routes, build.future);
@@ -9276,8 +9279,8 @@ async function handleSingleFetchRequest(serverMode, build, staticHandler, reques
9276
9279
  );
9277
9280
  let resultHeaders = new Headers(headers);
9278
9281
  resultHeaders.set("X-Remix-Response", "yes");
9279
- if (status === 304) {
9280
- return new Response(null, { status: 304, headers: resultHeaders });
9282
+ if (NO_BODY_STATUS_CODES.has(status)) {
9283
+ return new Response(null, { status, headers: resultHeaders });
9281
9284
  }
9282
9285
  resultHeaders.set("Content-Type", "text/x-script");
9283
9286
  return new Response(
@@ -9307,8 +9310,8 @@ async function handleDocumentRequest(serverMode, build, staticHandler, request,
9307
9310
  return context;
9308
9311
  }
9309
9312
  let headers = getDocumentHeaders(build, context);
9310
- if (context.statusCode === 304) {
9311
- return new Response(null, { status: 304, headers });
9313
+ if (NO_BODY_STATUS_CODES.has(context.statusCode)) {
9314
+ return new Response(null, { status: context.statusCode, headers });
9312
9315
  }
9313
9316
  if (context.errors) {
9314
9317
  Object.values(context.errors).forEach((err) => {
@@ -9417,11 +9420,13 @@ async function handleResourceRequest(serverMode, staticHandler, routeId, request
9417
9420
  routeId,
9418
9421
  requestContext: loadContext
9419
9422
  });
9420
- invariant3(
9421
- isResponse(response),
9422
- "Expected a Response to be returned from resource route handler"
9423
- );
9424
- return response;
9423
+ if (isResponse(response)) {
9424
+ return response;
9425
+ }
9426
+ if (typeof response === "string") {
9427
+ return new Response(response);
9428
+ }
9429
+ return Response.json(response);
9425
9430
  } catch (error) {
9426
9431
  if (isResponse(error)) {
9427
9432
  error.headers.set("X-Remix-Catch", "yes");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.3
2
+ * react-router v7.1.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -120,7 +120,7 @@ import {
120
120
  useSearchParams,
121
121
  useSubmit,
122
122
  useViewTransitionState
123
- } from "./chunk-OKQ6KMOJ.mjs";
123
+ } from "./chunk-FIUQORTV.mjs";
124
124
  export {
125
125
  Await,
126
126
  BrowserRouter,
@@ -1,4 +1,4 @@
1
- import { av as LinkDescriptor, as as MetaDescriptor, aJ as ServerDataFrom, aK as ClientDataFrom, aL as Func, aM as Equal, aN as Pretty } from '../../route-data-Cw8htKcF.mjs';
1
+ import { ay as LinkDescriptor, av as MetaDescriptor, aM as ServerDataFrom, aN as ClientDataFrom, aO as Func, aP as Equal, aQ as Pretty } from '../../route-data-Cq_b5feC.mjs';
2
2
  import { A as AppLoadContext } from '../../data-CQbyyGzl.mjs';
3
3
  import 'react';
4
4
 
@@ -1,4 +1,4 @@
1
- import { av as LinkDescriptor, as as MetaDescriptor, aJ as ServerDataFrom, aK as ClientDataFrom, aL as Func, aM as Equal, aN as Pretty } from '../../route-data-Cw8htKcF.js';
1
+ import { ay as LinkDescriptor, av as MetaDescriptor, aM as ServerDataFrom, aN as ClientDataFrom, aO as Func, aP as Equal, aQ as Pretty } from '../../route-data-Cq_b5feC.js';
2
2
  import { A as AppLoadContext } from '../../data-CQbyyGzl.js';
3
3
  import 'react';
4
4
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.3
2
+ * react-router v7.1.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.1.3
2
+ * react-router v7.1.4
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *