Socket
Socket
Sign inDemoInstall

react-router

Package Overview
Dependencies
4
Maintainers
3
Versions
421
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.0-experimental-e960cf1a to 0.0.0-experimental-edf416237

223

CHANGELOG.md
# `react-router`
## 6.23.1
### Patch Changes
- allow undefined to be resolved with `<Await>` ([#11513](https://github.com/remix-run/react-router/pull/11513))
- Updated dependencies:
- `@remix-run/router@1.16.1`
## 6.23.0
### Minor Changes
- Add a new `unstable_dataStrategy` configuration option ([#11098](https://github.com/remix-run/react-router/pull/11098))
- This option allows Data Router applications to take control over the approach for executing route loaders and actions
- The default implementation is today's behavior, to fetch all loaders in parallel, but this option allows users to implement more advanced data flows including Remix single-fetch, middleware/context APIs, automatic loader caching, and more
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.16.0`
## 6.22.3
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.15.3`
## 6.22.2
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.15.2`
## 6.22.1
### Patch Changes
- Fix encoding/decoding issues with pre-encoded dynamic parameter values ([#11199](https://github.com/remix-run/react-router/pull/11199))
- Updated dependencies:
- `@remix-run/router@1.15.1`
## 6.22.0
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.15.0`
## 6.21.3
### Patch Changes
- Remove leftover `unstable_` prefix from `Blocker`/`BlockerFunction` types ([#11187](https://github.com/remix-run/react-router/pull/11187))
## 6.21.2
### Patch Changes
- Updated dependencies:
- `@remix-run/router@1.14.2`
## 6.21.1
### Patch Changes
- Fix bug with `route.lazy` not working correctly on initial SPA load when `v7_partialHydration` is specified ([#11121](https://github.com/remix-run/react-router/pull/11121))
- Updated dependencies:
- `@remix-run/router@1.14.1`
## 6.21.0
### Minor Changes
- Add a new `future.v7_relativeSplatPath` flag to implement a breaking bug fix to relative routing when inside a splat route. ([#11087](https://github.com/remix-run/react-router/pull/11087))
This fix was originally added in [#10983](https://github.com/remix-run/react-router/issues/10983) and was later reverted in [#11078](https://github.com/remix-run/react-router/pull/11078) because it was determined that a large number of existing applications were relying on the buggy behavior (see [#11052](https://github.com/remix-run/react-router/issues/11052))
**The Bug**
The buggy behavior is that without this flag, the default behavior when resolving relative paths is to _ignore_ any splat (`*`) portion of the current route path.
**The Background**
This decision was originally made thinking that it would make the concept of nested different sections of your apps in `<Routes>` easier if relative routing would _replace_ the current splat:
```jsx
<BrowserRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route path="dashboard/*" element={<Dashboard />} />
</Routes>
</BrowserRouter>
```
Any paths like `/dashboard`, `/dashboard/team`, `/dashboard/projects` will match the `Dashboard` route. The dashboard component itself can then render nested `<Routes>`:
```jsx
function Dashboard() {
return (
<div>
<h2>Dashboard</h2>
<nav>
<Link to="/">Dashboard Home</Link>
<Link to="team">Team</Link>
<Link to="projects">Projects</Link>
</nav>
<Routes>
<Route path="/" element={<DashboardHome />} />
<Route path="team" element={<DashboardTeam />} />
<Route path="projects" element={<DashboardProjects />} />
</Routes>
</div>
);
}
```
Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the `Dashboard` as its own independent app, or embed it into your large app without making any changes to it.
**The Problem**
The problem is that this concept of ignoring part of a path breaks a lot of other assumptions in React Router - namely that `"."` always means the current location pathname for that route. When we ignore the splat portion, we start getting invalid paths when using `"."`:
```jsx
// If we are on URL /dashboard/team, and we want to link to /dashboard/team:
function DashboardTeam() {
// ❌ This is broken and results in <a href="/dashboard">
return <Link to=".">A broken link to the Current URL</Link>;
// ✅ This is fixed but super unintuitive since we're already at /dashboard/team!
return <Link to="./team">A broken link to the Current URL</Link>;
}
```
We've also introduced an issue that we can no longer move our `DashboardTeam` component around our route hierarchy easily - since it behaves differently if we're underneath a non-splat route, such as `/dashboard/:widget`. Now, our `"."` links will, properly point to ourself _inclusive of the dynamic param value_ so behavior will break from it's corresponding usage in a `/dashboard/*` route.
Even worse, consider a nested splat route configuration:
```jsx
<BrowserRouter>
<Routes>
<Route path="dashboard">
<Route path="*" element={<Dashboard />} />
</Route>
</Routes>
</BrowserRouter>
```
Now, a `<Link to=".">` and a `<Link to="..">` inside the `Dashboard` component go to the same place! That is definitely not correct!
Another common issue arose in Data Routers (and Remix) where any `<Form>` should post to it's own route `action` if you the user doesn't specify a form action:
```jsx
let router = createBrowserRouter({
path: "/dashboard",
children: [
{
path: "*",
action: dashboardAction,
Component() {
// ❌ This form is broken! It throws a 405 error when it submits because
// it tries to submit to /dashboard (without the splat value) and the parent
// `/dashboard` route doesn't have an action
return <Form method="post">...</Form>;
},
},
],
});
```
This is just a compounded issue from the above because the default location for a `Form` to submit to is itself (`"."`) - and if we ignore the splat portion, that now resolves to the parent route.
**The Solution**
If you are leveraging this behavior, it's recommended to enable the future flag, move your splat to it's own route, and leverage `../` for any links to "sibling" pages:
```jsx
<BrowserRouter>
<Routes>
<Route path="dashboard">
<Route index path="*" element={<Dashboard />} />
</Route>
</Routes>
</BrowserRouter>
function Dashboard() {
return (
<div>
<h2>Dashboard</h2>
<nav>
<Link to="..">Dashboard Home</Link>
<Link to="../team">Team</Link>
<Link to="../projects">Projects</Link>
</nav>
<Routes>
<Route path="/" element={<DashboardHome />} />
<Route path="team" element={<DashboardTeam />} />
<Route path="projects" element={<DashboardProjects />} />
</Router>
</div>
);
}
```
This way, `.` means "the full current pathname for my route" in all cases (including static, dynamic, and splat routes) and `..` always means "my parents pathname".
### Patch Changes
- Properly handle falsy error values in ErrorBoundary's ([#11071](https://github.com/remix-run/react-router/pull/11071))
- Updated dependencies:
- `@remix-run/router@1.14.0`
## 6.20.1

@@ -7,3 +219,3 @@

- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329). We plan to re-introduce this fix behind a future flag in the next minor version. ([#11078](https://github.com/remix-run/react-router/pull/11078))
- Revert the `useResolvedPath` fix for splat routes due to a large number of applications that were relying on the buggy behavior (see <https://github.com/remix-run/react-router/issues/11052#issuecomment-1836589329>). We plan to re-introduce this fix behind a future flag in the next minor version. ([#11078](https://github.com/remix-run/react-router/pull/11078))
- Updated dependencies:

@@ -36,2 +248,3 @@ - `@remix-run/router@1.13.1`

- Fix `useActionData` so it returns proper contextual action data and not _any_ action data in the tree ([#11023](https://github.com/remix-run/react-router/pull/11023))
- Fix bug in `useResolvedPath` that would cause `useResolvedPath(".")` in a splat route to lose the splat portion of the URL path. ([#10983](https://github.com/remix-run/react-router/pull/10983))

@@ -149,3 +362,3 @@

> [!WARNING]
> \[!WARNING]
> Please use version `6.13.0` or later instead of `6.12.1`. This version suffers from a `webpack`/`terser` minification issue resulting in invalid minified code in your resulting production bundles which can cause issues in your application. See [#10579](https://github.com/remix-run/react-router/issues/10579) for more details.

@@ -482,3 +695,3 @@

Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs][rr-docs], especially the [feature overview][rr-feature-overview] and the [tutorial][rr-tutorial].
Whoa this is a big one! `6.4.0` brings all the data loading and mutation APIs over from Remix. Here's a quick high level overview, but it's recommended you go check out the [docs](https://reactrouter.com), especially the [feature overview](https://reactrouter.com/start/overview) and the [tutorial](https://reactrouter.com/start/tutorial).

@@ -501,5 +714,1 @@ **New APIs**

- `@remix-run/router@1.0.0`
[rr-docs]: https://reactrouter.com
[rr-feature-overview]: https://reactrouter.com/start/overview
[rr-tutorial]: https://reactrouter.com/start/tutorial

7

dist/index.d.ts

@@ -1,2 +0,2 @@

import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, DataStrategyFunction, ErrorResponse, Fetcher, HydrationState, InitialEntry, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, Router as RemixRouter, FutureConfig as RouterFutureConfig, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch } from "@remix-run/router";
import type { ActionFunction, ActionFunctionArgs, Blocker, BlockerFunction, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, HydrationState, InitialEntry, JsonFunction, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, Navigation, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, RedirectFunction, RelativeRoutingType, Router as RemixRouter, FutureConfig as RouterFutureConfig, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, unstable_HandlerResult, unstable_PatchRoutesOnMissFunction } from "@remix-run/router";
import { AbortedDeferredError, Action as NavigationType, createPath, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, resolvePath } from "@remix-run/router";

@@ -12,3 +12,3 @@ import type { AwaitProps, FutureConfig, IndexRouteProps, LayoutRouteProps, MemoryRouterProps, NavigateProps, OutletProps, PathRouteProps, RouteProps, RouterProps, RouterProviderProps, RoutesProps } from "./lib/components";

type Search = string;
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker as unstable_Blocker, BlockerFunction as unstable_BlockerFunction, };
export type { ActionFunction, ActionFunctionArgs, AwaitProps, DataRouteMatch, DataRouteObject, unstable_DataStrategyFunction, unstable_DataStrategyFunctionArgs, unstable_DataStrategyMatch, ErrorResponse, Fetcher, FutureConfig, Hash, IndexRouteObject, IndexRouteProps, JsonFunction, LayoutRouteProps, LazyRouteFunction, LoaderFunction, LoaderFunctionArgs, Location, MemoryRouterProps, NavigateFunction, NavigateOptions, NavigateProps, Navigation, Navigator, NonIndexRouteObject, OutletProps, ParamParseKey, Params, Path, PathMatch, PathParam, PathPattern, PathRouteProps, Pathname, RedirectFunction, RelativeRoutingType, RouteMatch, RouteObject, RouteProps, RouterProps, RouterProviderProps, RoutesProps, Search, ShouldRevalidateFunction, ShouldRevalidateFunctionArgs, To, UIMatch, Blocker, BlockerFunction, unstable_HandlerResult, };
export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, createPath, createRoutesFromChildren, createRoutesFromChildren as createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, redirectDocument, renderMatches, resolvePath, useBlocker, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes, };

@@ -24,5 +24,6 @@ declare function mapRouteProperties(route: RouteObject): Partial<RouteObject> & {

initialIndex?: number;
unstable_dataStrategy?: DataStrategyFunction;
unstable_dataStrategy?: unstable_DataStrategyFunction;
unstable_patchRoutesOnMiss: unstable_PatchRoutesOnMissFunction;
}): RemixRouter;
/** @internal */
export { DataRouterContext as UNSAFE_DataRouterContext, DataRouterStateContext as UNSAFE_DataRouterStateContext, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, mapRouteProperties as UNSAFE_mapRouteProperties, useRouteId as UNSAFE_useRouteId, useRoutesImpl as UNSAFE_useRoutesImpl, };
/**
* React Router v0.0.0-experimental-e960cf1a
* React Router v0.0.0-experimental-edf416237
*

@@ -375,3 +375,22 @@ * Copyright (c) Remix Software Inc.

let pathname = location.pathname || "/";
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
let remainingPathname = pathname;
if (parentPathnameBase !== "/") {
// Determine the remaining pathname by removing the # of URL segments the
// parentPathnameBase has, instead of removing based on character count.
// This is because we can't guarantee that incoming/outgoing encodings/
// decodings will match exactly.
// We decode paths before matching on a per-segment basis with
// decodeURIComponent(), but we re-encode pathnames via `new URL()` so they
// match what `window.location.pathname` would reflect. Those don't 100%
// align when it comes to encoded URI characters such as % and &.
//
// So we may end up with:
// pathname: "/descendant/a%25b/match"
// parentPathnameBase: "/descendant/a%b"
//
// And the direct substring removal approach won't work :/
let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
let segments = pathname.replace(/^\//, "").split("/");
remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
}
let matches = matchRoutes(routes, {

@@ -382,3 +401,3 @@ pathname: remainingPathname

process.env.NODE_ENV !== "production" ? UNSAFE_warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") : void 0;
process.env.NODE_ENV !== "production" ? UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" " + "does not have an element or Component. This means it will render an <Outlet /> with a " + "null value by default resulting in an \"empty\" page.") : void 0;
process.env.NODE_ENV !== "production" ? UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined || matches[matches.length - 1].route.lazy !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" " + "does not have an element or Component. This means it will render an <Outlet /> with a " + "null value by default resulting in an \"empty\" page.") : void 0;
}

@@ -541,3 +560,3 @@ let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {

if (errors != null) {
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined);
!(errorIndex >= 0) ? process.env.NODE_ENV !== "production" ? UNSAFE_invariant(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : UNSAFE_invariant(false) : void 0;

@@ -558,13 +577,20 @@ renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));

}
if (match.route.loader && match.route.id && dataRouterState.loaderData[match.route.id] === undefined && (!dataRouterState.errors || dataRouterState.errors[match.route.id] === undefined)) {
// We found the first route without data/errors which means it's loader
// still needs to run. Flag that we need to render a fallback and
// render up until the appropriate fallback
renderFallback = true;
if (fallbackIndex >= 0) {
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
} else {
renderedMatches = [renderedMatches[0]];
if (match.route.id) {
let {
loaderData,
errors
} = dataRouterState;
let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined);
if (match.route.lazy || needsToRunLoader) {
// We found the first route that's not ready to render (waiting on
// lazy, or has a loader that hasn't run yet). Flag that we need to
// render a fallback and render up until the appropriate fallback
renderFallback = true;
if (fallbackIndex >= 0) {
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
} else {
renderedMatches = [renderedMatches[0]];
}
break;
}
break;
}

@@ -947,3 +973,3 @@ }

React.useEffect(() => {
process.env.NODE_ENV !== "production" ? UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`") : void 0;
process.env.NODE_ENV !== "production" ? UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using " + "`v7_partialHydration`, use a `HydrateFallback` component instead") : void 0;
// Only log this once on initial mount

@@ -973,6 +999,3 @@ // eslint-disable-next-line react-hooks/exhaustive-deps

static: false,
basename,
future: {
v7_relativeSplatPath: router.future.v7_relativeSplatPath
}
basename
}), [router, navigator, basename]);

@@ -994,4 +1017,7 @@

navigationType: state.historyAction,
navigator: navigator
}, state.initialized ? /*#__PURE__*/React.createElement(DataRoutes, {
navigator: navigator,
future: {
v7_relativeSplatPath: router.future.v7_relativeSplatPath
}
}, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(DataRoutes, {
routes: router.routes,

@@ -1262,3 +1288,3 @@ future: router.future,

promise = resolve;
status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
} else {

@@ -1432,3 +1458,4 @@ // Raw (untracked) promise - track it

mapRouteProperties,
unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy
unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy,
unstable_patchRoutesOnMiss: opts == null ? void 0 : opts.unstable_patchRoutesOnMiss
}).initialize();

@@ -1435,0 +1462,0 @@ }

@@ -110,5 +110,3 @@ import type { InitialEntry, LazyRouteFunction, Location, RelativeRoutingType, Router as RemixRouter, To, TrackedPromise } from "@remix-run/router";

static?: boolean;
future?: {
v7_relativeSplatPath?: boolean;
};
future?: Partial<Pick<FutureConfig, "v7_relativeSplatPath">>;
}

@@ -115,0 +113,0 @@ /**

@@ -50,3 +50,3 @@ import * as React from "react";

}
export interface DataRouterContextObject extends NavigationContextObject {
export interface DataRouterContextObject extends Omit<NavigationContextObject, "future"> {
router: Router;

@@ -53,0 +53,0 @@ staticContext?: StaticHandlerContext;

/**
* React Router v0.0.0-experimental-e960cf1a
* React Router v0.0.0-experimental-edf416237
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

/**
* React Router v0.0.0-experimental-e960cf1a
* React Router v0.0.0-experimental-edf416237
*

@@ -326,3 +326,22 @@ * Copyright (c) Remix Software Inc.

let pathname = location.pathname || "/";
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
let remainingPathname = pathname;
if (parentPathnameBase !== "/") {
// Determine the remaining pathname by removing the # of URL segments the
// parentPathnameBase has, instead of removing based on character count.
// This is because we can't guarantee that incoming/outgoing encodings/
// decodings will match exactly.
// We decode paths before matching on a per-segment basis with
// decodeURIComponent(), but we re-encode pathnames via `new URL()` so they
// match what `window.location.pathname` would reflect. Those don't 100%
// align when it comes to encoded URI characters such as % and &.
//
// So we may end up with:
// pathname: "/descendant/a%25b/match"
// parentPathnameBase: "/descendant/a%b"
//
// And the direct substring removal approach won't work :/
let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
let segments = pathname.replace(/^\//, "").split("/");
remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
}
let matches = matchRoutes(routes, {

@@ -333,3 +352,3 @@ pathname: remainingPathname

UNSAFE_warning(parentRoute || matches != null, `No routes matched location "${location.pathname}${location.search}${location.hash}" `) ;
UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined, `Matched leaf route at location "${location.pathname}${location.search}${location.hash}" ` + `does not have an element or Component. This means it will render an <Outlet /> with a ` + `null value by default resulting in an "empty" page.`) ;
UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined || matches[matches.length - 1].route.lazy !== undefined, `Matched leaf route at location "${location.pathname}${location.search}${location.hash}" ` + `does not have an element or Component. This means it will render an <Outlet /> with a ` + `null value by default resulting in an "empty" page.`) ;
}

@@ -477,3 +496,3 @@ let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {

if (errors != null) {
let errorIndex = renderedMatches.findIndex(m => m.route.id && errors?.[m.route.id]);
let errorIndex = renderedMatches.findIndex(m => m.route.id && errors?.[m.route.id] !== undefined);
!(errorIndex >= 0) ? UNSAFE_invariant(false, `Could not find a matching route for errors on route IDs: ${Object.keys(errors).join(",")}`) : void 0;

@@ -493,13 +512,20 @@ renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));

}
if (match.route.loader && match.route.id && dataRouterState.loaderData[match.route.id] === undefined && (!dataRouterState.errors || dataRouterState.errors[match.route.id] === undefined)) {
// We found the first route without data/errors which means it's loader
// still needs to run. Flag that we need to render a fallback and
// render up until the appropriate fallback
renderFallback = true;
if (fallbackIndex >= 0) {
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
} else {
renderedMatches = [renderedMatches[0]];
if (match.route.id) {
let {
loaderData,
errors: _errors
} = dataRouterState;
let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!_errors || _errors[match.route.id] === undefined);
if (match.route.lazy || needsToRunLoader) {
// We found the first route that's not ready to render (waiting on
// lazy, or has a loader that hasn't run yet). Flag that we need to
// render a fallback and render up until the appropriate fallback
renderFallback = true;
if (fallbackIndex >= 0) {
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
} else {
renderedMatches = [renderedMatches[0]];
}
break;
}
break;
}

@@ -858,3 +884,3 @@ }

React.useEffect(() => {
UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`") ;
UNSAFE_warning(fallbackElement == null || !router.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using " + "`v7_partialHydration`, use a `HydrateFallback` component instead") ;
// Only log this once on initial mount

@@ -884,6 +910,3 @@ // eslint-disable-next-line react-hooks/exhaustive-deps

static: false,
basename,
future: {
v7_relativeSplatPath: router.future.v7_relativeSplatPath
}
basename
}), [router, navigator, basename]);

@@ -904,4 +927,7 @@ // The fragment and {null} here are important! We need them to keep React 18's

navigationType: state.historyAction,
navigator: navigator
}, state.initialized ? /*#__PURE__*/React.createElement(DataRoutes, {
navigator: navigator,
future: {
v7_relativeSplatPath: router.future.v7_relativeSplatPath
}
}, state.initialized || router.future.v7_partialHydration ? /*#__PURE__*/React.createElement(DataRoutes, {
routes: router.routes,

@@ -1166,3 +1192,3 @@ future: router.future,

promise = resolve;
status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
} else {

@@ -1328,3 +1354,4 @@ // Raw (untracked) promise - track it

mapRouteProperties,
unstable_dataStrategy: opts?.unstable_dataStrategy
unstable_dataStrategy: opts?.unstable_dataStrategy,
unstable_patchRoutesOnMiss: opts?.unstable_patchRoutesOnMiss
}).initialize();

@@ -1331,0 +1358,0 @@ }

/**
* React Router v0.0.0-experimental-e960cf1a
* React Router v0.0.0-experimental-edf416237
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
import*as e from"react";import{UNSAFE_invariant as t,joinPaths as r,matchPath as n,UNSAFE_getResolveToMatches as a,resolveTo as o,parsePath as i,matchRoutes as l,Action as u,UNSAFE_convertRouteMatchToUiMatch as s,stripBasename as c,IDLE_BLOCKER as d,isRouteErrorResponse as p,createMemoryHistory as m,AbortedDeferredError as h,createRouter as f}from"@remix-run/router";export{AbortedDeferredError,Action as NavigationType,createPath,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,redirectDocument,resolvePath}from"@remix-run/router";const v=e.createContext(null),E=e.createContext(null),g=e.createContext(null),y=e.createContext(null),x=e.createContext(null),C=e.createContext({outlet:null,matches:[],isDataRoute:!1}),b=e.createContext(null);function R(n,{relative:a}={}){S()||t(!1);let{basename:o,navigator:i}=e.useContext(y),{hash:l,pathname:u,search:s}=O(n,{relative:a}),c=u;return"/"!==o&&(c="/"===u?o:r([o,u])),i.createHref({pathname:c,search:s,hash:l})}function S(){return null!=e.useContext(x)}function P(){return S()||t(!1),e.useContext(x).location}function U(){return e.useContext(x).navigationType}function _(r){S()||t(!1);let{pathname:a}=P();return e.useMemo((()=>n(r,a)),[a,r])}function k(t){e.useContext(y).static||e.useLayoutEffect(t)}function D(){let{isDataRoute:n}=e.useContext(C);return n?function(){let{router:t}=$(J.UseNavigateStable),r=W(z.UseNavigateStable),n=e.useRef(!1);return k((()=>{n.current=!0})),e.useCallback(((e,a={})=>{n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){S()||t(!1);let n=e.useContext(v),{basename:i,future:l,navigator:u}=e.useContext(y),{matches:s}=e.useContext(C),{pathname:c}=P(),d=JSON.stringify(a(s,l.v7_relativeSplatPath)),p=e.useRef(!1);return k((()=>{p.current=!0})),e.useCallback(((e,t={})=>{if(!p.current)return;if("number"==typeof e)return void u.go(e);let a=o(e,JSON.parse(d),c,"path"===t.relative);null==n&&"/"!==i&&(a.pathname="/"===a.pathname?i:r([i,a.pathname])),(t.replace?u.replace:u.push)(a,t.state,t)}),[i,u,d,c,n])}()}const B=e.createContext(null);function N(){return e.useContext(B)}function F(t){let r=e.useContext(C).outlet;return r?e.createElement(B.Provider,{value:t},r):r}function L(){let{matches:t}=e.useContext(C),r=t[t.length-1];return r?r.params:{}}function O(t,{relative:r}={}){let{future:n}=e.useContext(y),{matches:i}=e.useContext(C),{pathname:l}=P(),u=JSON.stringify(a(i,n.v7_relativeSplatPath));return e.useMemo((()=>o(t,JSON.parse(u),l,"path"===r)),[t,u,l,r])}function A(e,t){return j(e,t)}function j(n,a,o,s){S()||t(!1);let{navigator:c}=e.useContext(y),{matches:d}=e.useContext(C),p=d[d.length-1],m=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let f,v=P();if(a){let e="string"==typeof a?i(a):a;"/"===h||e.pathname?.startsWith(h)||t(!1),f=e}else f=v;let E=f.pathname||"/",g="/"===h?E:E.slice(h.length)||"/",b=l(n,{pathname:g}),R=w(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:r([h,c.encodeLocation?c.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r([h,c.encodeLocation?c.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),d,o,s);return a&&R?e.createElement(x.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:u.Pop}},R):R}function I(){let t=ee(),r=p(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const M=e.createElement(I,null);class T extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(C.Provider,{value:this.props.routeContext},e.createElement(b.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function H({routeContext:t,match:r,children:n}){let a=e.useContext(v);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(C.Provider,{value:t},n)}function w(r,n=[],a=null,o=null){if(null==r){if(!a?.errors)return null;r=a.matches}let i=r,l=a?.errors;if(null!=l){let e=i.findIndex((e=>e.route.id&&l?.[e.route.id]));e>=0||t(!1),i=i.slice(0,Math.min(i.length,e+1))}let u=!1,s=-1;if(a&&o&&o.v7_partialHydration)for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.loader&&t.route.id&&void 0===a.loaderData[t.route.id]&&(!a.errors||void 0===a.errors[t.route.id])){u=!0,i=s>=0?i.slice(0,s+1):[i[0]];break}}return i.reduceRight(((t,r,o)=>{let c,d=!1,p=null,m=null;var h;a&&(c=l&&r.route.id?l[r.route.id]:void 0,p=r.route.errorElement||M,u&&(s<0&&0===o?(h="route-fallback",!1||oe[h]||(oe[h]=!0),d=!0,m=null):s===o&&(d=!0,m=r.route.hydrateFallbackElement||null)));let f=n.concat(i.slice(0,o+1)),v=()=>{let n;return n=c?p:d?m:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(H,{match:r,routeContext:{outlet:t,matches:f,isDataRoute:null!=a},children:n})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?e.createElement(T,{location:a.location,revalidation:a.revalidation,component:p,error:c,children:v(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):v()}),null)}var J=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(J||{}),z=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(z||{});function $(r){let n=e.useContext(v);return n||t(!1),n}function V(r){let n=e.useContext(E);return n||t(!1),n}function W(r){let n=function(r){let n=e.useContext(C);return n||t(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||t(!1),a.route.id}function Y(){return W(z.UseRouteId)}function q(){return V(z.UseNavigation).navigation}function G(){let t=$(J.UseRevalidator),r=V(z.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function K(){let{matches:t,loaderData:r}=V(z.UseMatches);return e.useMemo((()=>t.map((e=>s(e,r)))),[t,r])}function Q(){let e=V(z.UseLoaderData),t=W(z.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error(`You cannot \`useLoaderData\` in an errorElement (routeId: ${t})`)}function X(e){return V(z.UseRouteLoaderData).loaderData[e]}function Z(){let e=V(z.UseActionData),t=W(z.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function ee(){let t=e.useContext(b),r=V(z.UseRouteError),n=W(z.UseRouteError);return void 0!==t?t:r.errors?.[n]}function te(){return e.useContext(g)?._data}function re(){return e.useContext(g)?._error}let ne=0;function ae(t){let{router:r,basename:n}=$(J.UseBlocker),a=V(z.UseBlocker),[o,i]=e.useState(""),l=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:a,historyAction:o}=e;return t({currentLocation:{...r,pathname:c(r.pathname,n)||r.pathname},nextLocation:{...a,pathname:c(a.pathname,n)||a.pathname},historyAction:o})}),[n,t]);return e.useEffect((()=>{let e=String(++ne);return i(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,l)}),[r,o,l]),o&&a.blockers.has(o)?a.blockers.get(o):d}const oe={};const ie=e.startTransition;function le({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),{v7_startTransition:i}=n||{},l=e.useCallback((e=>{i&&ie?ie((()=>o(e))):o(e)}),[o,i]);e.useLayoutEffect((()=>r.subscribe(l)),[r,l]),e.useEffect((()=>{}),[]);let u=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),s=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:u,static:!1,basename:s,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}})),[r,u,s]);return e.createElement(e.Fragment,null,e.createElement(v.Provider,{value:c},e.createElement(E.Provider,{value:a},e.createElement(me,{basename:s,location:a.location,navigationType:a.historyAction,navigator:u},a.initialized?e.createElement(ue,{routes:r.routes,future:r.future,state:a}):t))),null)}function ue({routes:e,future:t,state:r}){return j(e,void 0,r,t)}function se({basename:t,children:r,initialEntries:n,initialIndex:a,future:o}){let i=e.useRef();null==i.current&&(i.current=m({initialEntries:n,initialIndex:a,v5Compat:!0}));let l=i.current,[u,s]=e.useState({action:l.action,location:l.location}),{v7_startTransition:c}=o||{},d=e.useCallback((e=>{c&&ie?ie((()=>s(e))):s(e)}),[s,c]);return e.useLayoutEffect((()=>l.listen(d)),[l,d]),e.createElement(me,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:l,future:o})}function ce({to:r,replace:n,state:i,relative:l}){S()||t(!1);let{future:u,static:s}=e.useContext(y),{matches:c}=e.useContext(C),{pathname:d}=P(),p=D(),m=o(r,a(c,u.v7_relativeSplatPath),d,"path"===l),h=JSON.stringify(m);return e.useEffect((()=>p(JSON.parse(h),{replace:n,state:i,relative:l})),[p,h,l,n,i]),null}function de(e){return F(e.context)}function pe(e){t(!1)}function me({basename:r="/",children:n=null,location:a,navigationType:o=u.Pop,navigator:l,static:s=!1,future:d}){S()&&t(!1);let p=r.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:p,navigator:l,static:s,future:{v7_relativeSplatPath:!1,...d}})),[p,d,l,s]);"string"==typeof a&&(a=i(a));let{pathname:h="/",search:f="",hash:v="",state:E=null,key:g="default"}=a,C=e.useMemo((()=>{let e=c(h,p);return null==e?null:{location:{pathname:e,search:f,hash:v,state:E,key:g},navigationType:o}}),[p,h,f,v,E,g,o]);return null==C?null:e.createElement(y.Provider,{value:m},e.createElement(x.Provider,{children:n,value:C}))}function he({children:e,location:t}){return A(xe(e),t)}function fe({children:t,errorElement:r,resolve:n}){return e.createElement(ge,{resolve:n,errorElement:r},e.createElement(ye,null,t))}var ve=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(ve||{});const Ee=new Promise((()=>{}));class ge extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,o=ve.pending;if(n instanceof Promise)if(this.state.error){o=ve.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o=void 0!==a._error?ve.error:void 0!==a._data?ve.success:ve.pending):(o=ve.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=ve.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===ve.error&&a._error instanceof h)throw Ee;if(o===ve.error&&!r)throw a._error;if(o===ve.error)return e.createElement(g.Provider,{value:a,children:r});if(o===ve.success)return e.createElement(g.Provider,{value:a,children:t});throw a}}function ye({children:t}){let r=te(),n="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,n)}function xe(r,n=[]){let a=[];return e.Children.forEach(r,((r,o)=>{if(!e.isValidElement(r))return;let i=[...n,o];if(r.type===e.Fragment)return void a.push.apply(a,xe(r.props.children,i));r.type!==pe&&t(!1),r.props.index&&r.props.children&&t(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:null!=r.props.ErrorBoundary||null!=r.props.errorElement,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=xe(r.props.children,i)),a.push(l)})),a}function Ce(e){return w(e)}function be(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Re(e,t){return f({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:m({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:be,unstable_dataStrategy:t?.unstable_dataStrategy}).initialize()}export{fe as Await,se as MemoryRouter,ce as Navigate,de as Outlet,pe as Route,me as Router,le as RouterProvider,he as Routes,v as UNSAFE_DataRouterContext,E as UNSAFE_DataRouterStateContext,x as UNSAFE_LocationContext,y as UNSAFE_NavigationContext,C as UNSAFE_RouteContext,be as UNSAFE_mapRouteProperties,Y as UNSAFE_useRouteId,j as UNSAFE_useRoutesImpl,Re as createMemoryRouter,xe as createRoutesFromChildren,xe as createRoutesFromElements,Ce as renderMatches,Z as useActionData,re as useAsyncError,te as useAsyncValue,ae as useBlocker,R as useHref,S as useInRouterContext,Q as useLoaderData,P as useLocation,_ as useMatch,K as useMatches,D as useNavigate,q as useNavigation,U as useNavigationType,F as useOutlet,N as useOutletContext,L as useParams,O as useResolvedPath,G as useRevalidator,ee as useRouteError,X as useRouteLoaderData,A as useRoutes};
import*as e from"react";import{UNSAFE_invariant as t,joinPaths as r,matchPath as n,UNSAFE_getResolveToMatches as a,resolveTo as o,parsePath as l,matchRoutes as i,Action as u,UNSAFE_convertRouteMatchToUiMatch as s,stripBasename as c,IDLE_BLOCKER as d,isRouteErrorResponse as p,createMemoryHistory as m,AbortedDeferredError as h,createRouter as f}from"@remix-run/router";export{AbortedDeferredError,Action as NavigationType,createPath,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,redirectDocument,resolvePath}from"@remix-run/router";const v=e.createContext(null),E=e.createContext(null),g=e.createContext(null),y=e.createContext(null),x=e.createContext(null),C=e.createContext({outlet:null,matches:[],isDataRoute:!1}),b=e.createContext(null);function R(n,{relative:a}={}){S()||t(!1);let{basename:o,navigator:l}=e.useContext(y),{hash:i,pathname:u,search:s}=O(n,{relative:a}),c=u;return"/"!==o&&(c="/"===u?o:r([o,u])),l.createHref({pathname:c,search:s,hash:i})}function S(){return null!=e.useContext(x)}function P(){return S()||t(!1),e.useContext(x).location}function U(){return e.useContext(x).navigationType}function _(r){S()||t(!1);let{pathname:a}=P();return e.useMemo((()=>n(r,a)),[a,r])}function k(t){e.useContext(y).static||e.useLayoutEffect(t)}function D(){let{isDataRoute:n}=e.useContext(C);return n?function(){let{router:t}=$(J.UseNavigateStable),r=W(z.UseNavigateStable),n=e.useRef(!1);return k((()=>{n.current=!0})),e.useCallback(((e,a={})=>{n.current&&("number"==typeof e?t.navigate(e):t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){S()||t(!1);let n=e.useContext(v),{basename:l,future:i,navigator:u}=e.useContext(y),{matches:s}=e.useContext(C),{pathname:c}=P(),d=JSON.stringify(a(s,i.v7_relativeSplatPath)),p=e.useRef(!1);return k((()=>{p.current=!0})),e.useCallback(((e,t={})=>{if(!p.current)return;if("number"==typeof e)return void u.go(e);let a=o(e,JSON.parse(d),c,"path"===t.relative);null==n&&"/"!==l&&(a.pathname="/"===a.pathname?l:r([l,a.pathname])),(t.replace?u.replace:u.push)(a,t.state,t)}),[l,u,d,c,n])}()}const B=e.createContext(null);function N(){return e.useContext(B)}function F(t){let r=e.useContext(C).outlet;return r?e.createElement(B.Provider,{value:t},r):r}function L(){let{matches:t}=e.useContext(C),r=t[t.length-1];return r?r.params:{}}function O(t,{relative:r}={}){let{future:n}=e.useContext(y),{matches:l}=e.useContext(C),{pathname:i}=P(),u=JSON.stringify(a(l,n.v7_relativeSplatPath));return e.useMemo((()=>o(t,JSON.parse(u),i,"path"===r)),[t,u,i,r])}function A(e,t){return j(e,t)}function j(n,a,o,s){S()||t(!1);let{navigator:c}=e.useContext(y),{matches:d}=e.useContext(C),p=d[d.length-1],m=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let f,v=P();if(a){let e="string"==typeof a?l(a):a;"/"===h||e.pathname?.startsWith(h)||t(!1),f=e}else f=v;let E=f.pathname||"/",g=E;if("/"!==h){let e=h.replace(/^\//,"").split("/");g="/"+E.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=i(n,{pathname:g}),R=w(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:r([h,c.encodeLocation?c.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r([h,c.encodeLocation?c.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),d,o,s);return a&&R?e.createElement(x.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...f},navigationType:u.Pop}},R):R}function M(){let t=ee(),r=p(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:a},n):null,null)}const I=e.createElement(M,null);class T extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(C.Provider,{value:this.props.routeContext},e.createElement(b.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function H({routeContext:t,match:r,children:n}){let a=e.useContext(v);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(C.Provider,{value:t},n)}function w(r,n=[],a=null,o=null){if(null==r){if(!a?.errors)return null;r=a.matches}let l=r,i=a?.errors;if(null!=i){let e=l.findIndex((e=>e.route.id&&void 0!==i?.[e.route.id]));e>=0||t(!1),l=l.slice(0,Math.min(l.length,e+1))}let u=!1,s=-1;if(a&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:r}=a,n=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||n){u=!0,l=s>=0?l.slice(0,s+1):[l[0]];break}}}return l.reduceRight(((t,r,o)=>{let c,d=!1,p=null,m=null;var h;a&&(c=i&&r.route.id?i[r.route.id]:void 0,p=r.route.errorElement||I,u&&(s<0&&0===o?(h="route-fallback",!1||oe[h]||(oe[h]=!0),d=!0,m=null):s===o&&(d=!0,m=r.route.hydrateFallbackElement||null)));let f=n.concat(l.slice(0,o+1)),v=()=>{let n;return n=c?p:d?m:r.route.Component?e.createElement(r.route.Component,null):r.route.element?r.route.element:t,e.createElement(H,{match:r,routeContext:{outlet:t,matches:f,isDataRoute:null!=a},children:n})};return a&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?e.createElement(T,{location:a.location,revalidation:a.revalidation,component:p,error:c,children:v(),routeContext:{outlet:null,matches:f,isDataRoute:!0}}):v()}),null)}var J=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(J||{}),z=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(z||{});function $(r){let n=e.useContext(v);return n||t(!1),n}function V(r){let n=e.useContext(E);return n||t(!1),n}function W(r){let n=function(r){let n=e.useContext(C);return n||t(!1),n}(),a=n.matches[n.matches.length-1];return a.route.id||t(!1),a.route.id}function Y(){return W(z.UseRouteId)}function q(){return V(z.UseNavigation).navigation}function G(){let t=$(J.UseRevalidator),r=V(z.UseRevalidator);return e.useMemo((()=>({revalidate:t.router.revalidate,state:r.revalidation})),[t.router.revalidate,r.revalidation])}function K(){let{matches:t,loaderData:r}=V(z.UseMatches);return e.useMemo((()=>t.map((e=>s(e,r)))),[t,r])}function Q(){let e=V(z.UseLoaderData),t=W(z.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error(`You cannot \`useLoaderData\` in an errorElement (routeId: ${t})`)}function X(e){return V(z.UseRouteLoaderData).loaderData[e]}function Z(){let e=V(z.UseActionData),t=W(z.UseLoaderData);return e.actionData?e.actionData[t]:void 0}function ee(){let t=e.useContext(b),r=V(z.UseRouteError),n=W(z.UseRouteError);return void 0!==t?t:r.errors?.[n]}function te(){return e.useContext(g)?._data}function re(){return e.useContext(g)?._error}let ne=0;function ae(t){let{router:r,basename:n}=$(J.UseBlocker),a=V(z.UseBlocker),[o,l]=e.useState(""),i=e.useCallback((e=>{if("function"!=typeof t)return!!t;if("/"===n)return t(e);let{currentLocation:r,nextLocation:a,historyAction:o}=e;return t({currentLocation:{...r,pathname:c(r.pathname,n)||r.pathname},nextLocation:{...a,pathname:c(a.pathname,n)||a.pathname},historyAction:o})}),[n,t]);return e.useEffect((()=>{let e=String(++ne);return l(e),()=>r.deleteBlocker(e)}),[r]),e.useEffect((()=>{""!==o&&r.getBlocker(o,i)}),[r,o,i]),o&&a.blockers.has(o)?a.blockers.get(o):d}const oe={};const le=e.startTransition;function ie({fallbackElement:t,router:r,future:n}){let[a,o]=e.useState(r.state),{v7_startTransition:l}=n||{},i=e.useCallback((e=>{l&&le?le((()=>o(e))):o(e)}),[o,l]);e.useLayoutEffect((()=>r.subscribe(i)),[r,i]),e.useEffect((()=>{}),[]);let u=e.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:n?.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:n?.preventScrollReset})})),[r]),s=r.basename||"/",c=e.useMemo((()=>({router:r,navigator:u,static:!1,basename:s})),[r,u,s]);return e.createElement(e.Fragment,null,e.createElement(v.Provider,{value:c},e.createElement(E.Provider,{value:a},e.createElement(me,{basename:s,location:a.location,navigationType:a.historyAction,navigator:u,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},a.initialized||r.future.v7_partialHydration?e.createElement(ue,{routes:r.routes,future:r.future,state:a}):t))),null)}function ue({routes:e,future:t,state:r}){return j(e,void 0,r,t)}function se({basename:t,children:r,initialEntries:n,initialIndex:a,future:o}){let l=e.useRef();null==l.current&&(l.current=m({initialEntries:n,initialIndex:a,v5Compat:!0}));let i=l.current,[u,s]=e.useState({action:i.action,location:i.location}),{v7_startTransition:c}=o||{},d=e.useCallback((e=>{c&&le?le((()=>s(e))):s(e)}),[s,c]);return e.useLayoutEffect((()=>i.listen(d)),[i,d]),e.createElement(me,{basename:t,children:r,location:u.location,navigationType:u.action,navigator:i,future:o})}function ce({to:r,replace:n,state:l,relative:i}){S()||t(!1);let{future:u,static:s}=e.useContext(y),{matches:c}=e.useContext(C),{pathname:d}=P(),p=D(),m=o(r,a(c,u.v7_relativeSplatPath),d,"path"===i),h=JSON.stringify(m);return e.useEffect((()=>p(JSON.parse(h),{replace:n,state:l,relative:i})),[p,h,i,n,l]),null}function de(e){return F(e.context)}function pe(e){t(!1)}function me({basename:r="/",children:n=null,location:a,navigationType:o=u.Pop,navigator:i,static:s=!1,future:d}){S()&&t(!1);let p=r.replace(/^\/*/,"/"),m=e.useMemo((()=>({basename:p,navigator:i,static:s,future:{v7_relativeSplatPath:!1,...d}})),[p,d,i,s]);"string"==typeof a&&(a=l(a));let{pathname:h="/",search:f="",hash:v="",state:E=null,key:g="default"}=a,C=e.useMemo((()=>{let e=c(h,p);return null==e?null:{location:{pathname:e,search:f,hash:v,state:E,key:g},navigationType:o}}),[p,h,f,v,E,g,o]);return null==C?null:e.createElement(y.Provider,{value:m},e.createElement(x.Provider,{children:n,value:C}))}function he({children:e,location:t}){return A(xe(e),t)}function fe({children:t,errorElement:r,resolve:n}){return e.createElement(ge,{resolve:n,errorElement:r},e.createElement(ye,null,t))}var ve=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(ve||{});const Ee=new Promise((()=>{}));class ge extends e.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:t,errorElement:r,resolve:n}=this.props,a=null,o=ve.pending;if(n instanceof Promise)if(this.state.error){o=ve.error;let e=this.state.error;a=Promise.reject().catch((()=>{})),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_error",{get:()=>e})}else n._tracked?(a=n,o="_error"in a?ve.error:"_data"in a?ve.success:ve.pending):(o=ve.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),a=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else o=ve.success,a=Promise.resolve(),Object.defineProperty(a,"_tracked",{get:()=>!0}),Object.defineProperty(a,"_data",{get:()=>n});if(o===ve.error&&a._error instanceof h)throw Ee;if(o===ve.error&&!r)throw a._error;if(o===ve.error)return e.createElement(g.Provider,{value:a,children:r});if(o===ve.success)return e.createElement(g.Provider,{value:a,children:t});throw a}}function ye({children:t}){let r=te(),n="function"==typeof t?t(r):t;return e.createElement(e.Fragment,null,n)}function xe(r,n=[]){let a=[];return e.Children.forEach(r,((r,o)=>{if(!e.isValidElement(r))return;let l=[...n,o];if(r.type===e.Fragment)return void a.push.apply(a,xe(r.props.children,l));r.type!==pe&&t(!1),r.props.index&&r.props.children&&t(!1);let i={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:null!=r.props.ErrorBoundary||null!=r.props.errorElement,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=xe(r.props.children,l)),a.push(i)})),a}function Ce(e){return w(e)}function be(t){let r={hasErrorBoundary:null!=t.ErrorBoundary||null!=t.errorElement};return t.Component&&Object.assign(r,{element:e.createElement(t.Component),Component:void 0}),t.HydrateFallback&&Object.assign(r,{hydrateFallbackElement:e.createElement(t.HydrateFallback),HydrateFallback:void 0}),t.ErrorBoundary&&Object.assign(r,{errorElement:e.createElement(t.ErrorBoundary),ErrorBoundary:void 0}),r}function Re(e,t){return f({basename:t?.basename,future:{...t?.future,v7_prependBasename:!0},history:m({initialEntries:t?.initialEntries,initialIndex:t?.initialIndex}),hydrationData:t?.hydrationData,routes:e,mapRouteProperties:be,unstable_dataStrategy:t?.unstable_dataStrategy,unstable_patchRoutesOnMiss:t?.unstable_patchRoutesOnMiss}).initialize()}export{fe as Await,se as MemoryRouter,ce as Navigate,de as Outlet,pe as Route,me as Router,ie as RouterProvider,he as Routes,v as UNSAFE_DataRouterContext,E as UNSAFE_DataRouterStateContext,x as UNSAFE_LocationContext,y as UNSAFE_NavigationContext,C as UNSAFE_RouteContext,be as UNSAFE_mapRouteProperties,Y as UNSAFE_useRouteId,j as UNSAFE_useRoutesImpl,Re as createMemoryRouter,xe as createRoutesFromChildren,xe as createRoutesFromElements,Ce as renderMatches,Z as useActionData,re as useAsyncError,te as useAsyncValue,ae as useBlocker,R as useHref,S as useInRouterContext,Q as useLoaderData,P as useLocation,_ as useMatch,K as useMatches,D as useNavigate,q as useNavigation,U as useNavigationType,F as useOutlet,N as useOutletContext,L as useParams,O as useResolvedPath,G as useRevalidator,ee as useRouteError,X as useRouteLoaderData,A as useRoutes};
//# sourceMappingURL=react-router.production.min.js.map
/**
* React Router v0.0.0-experimental-e960cf1a
* React Router v0.0.0-experimental-edf416237
*

@@ -397,3 +397,22 @@ * Copyright (c) Remix Software Inc.

let pathname = location.pathname || "/";
let remainingPathname = parentPathnameBase === "/" ? pathname : pathname.slice(parentPathnameBase.length) || "/";
let remainingPathname = pathname;
if (parentPathnameBase !== "/") {
// Determine the remaining pathname by removing the # of URL segments the
// parentPathnameBase has, instead of removing based on character count.
// This is because we can't guarantee that incoming/outgoing encodings/
// decodings will match exactly.
// We decode paths before matching on a per-segment basis with
// decodeURIComponent(), but we re-encode pathnames via `new URL()` so they
// match what `window.location.pathname` would reflect. Those don't 100%
// align when it comes to encoded URI characters such as % and &.
//
// So we may end up with:
// pathname: "/descendant/a%25b/match"
// parentPathnameBase: "/descendant/a%b"
//
// And the direct substring removal approach won't work :/
let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
let segments = pathname.replace(/^\//, "").split("/");
remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
}
let matches = router.matchRoutes(routes, {

@@ -404,3 +423,3 @@ pathname: remainingPathname

router.UNSAFE_warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") ;
router.UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" " + "does not have an element or Component. This means it will render an <Outlet /> with a " + "null value by default resulting in an \"empty\" page.") ;
router.UNSAFE_warning(matches == null || matches[matches.length - 1].route.element !== undefined || matches[matches.length - 1].route.Component !== undefined || matches[matches.length - 1].route.lazy !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" " + "does not have an element or Component. This means it will render an <Outlet /> with a " + "null value by default resulting in an \"empty\" page.") ;
}

@@ -563,3 +582,3 @@ let renderedMatches = _renderMatches(matches && matches.map(match => Object.assign({}, match, {

if (errors != null) {
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]));
let errorIndex = renderedMatches.findIndex(m => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== undefined);
!(errorIndex >= 0) ? router.UNSAFE_invariant(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : void 0;

@@ -580,13 +599,20 @@ renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));

}
if (match.route.loader && match.route.id && dataRouterState.loaderData[match.route.id] === undefined && (!dataRouterState.errors || dataRouterState.errors[match.route.id] === undefined)) {
// We found the first route without data/errors which means it's loader
// still needs to run. Flag that we need to render a fallback and
// render up until the appropriate fallback
renderFallback = true;
if (fallbackIndex >= 0) {
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
} else {
renderedMatches = [renderedMatches[0]];
if (match.route.id) {
let {
loaderData,
errors
} = dataRouterState;
let needsToRunLoader = match.route.loader && loaderData[match.route.id] === undefined && (!errors || errors[match.route.id] === undefined);
if (match.route.lazy || needsToRunLoader) {
// We found the first route that's not ready to render (waiting on
// lazy, or has a loader that hasn't run yet). Flag that we need to
// render a fallback and render up until the appropriate fallback
renderFallback = true;
if (fallbackIndex >= 0) {
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
} else {
renderedMatches = [renderedMatches[0]];
}
break;
}
break;
}

@@ -969,3 +995,3 @@ }

React__namespace.useEffect(() => {
router.UNSAFE_warning(fallbackElement == null || !router$1.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`") ;
router.UNSAFE_warning(fallbackElement == null || !router$1.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using " + "`v7_partialHydration`, use a `HydrateFallback` component instead") ;
// Only log this once on initial mount

@@ -995,6 +1021,3 @@ // eslint-disable-next-line react-hooks/exhaustive-deps

static: false,
basename,
future: {
v7_relativeSplatPath: router$1.future.v7_relativeSplatPath
}
basename
}), [router$1, navigator, basename]);

@@ -1016,4 +1039,7 @@

navigationType: state.historyAction,
navigator: navigator
}, state.initialized ? /*#__PURE__*/React__namespace.createElement(DataRoutes, {
navigator: navigator,
future: {
v7_relativeSplatPath: router$1.future.v7_relativeSplatPath
}
}, state.initialized || router$1.future.v7_partialHydration ? /*#__PURE__*/React__namespace.createElement(DataRoutes, {
routes: router$1.routes,

@@ -1284,3 +1310,3 @@ future: router$1.future,

promise = resolve;
status = promise._error !== undefined ? AwaitRenderStatus.error : promise._data !== undefined ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
} else {

@@ -1454,3 +1480,4 @@ // Raw (untracked) promise - track it

mapRouteProperties,
unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy
unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy,
unstable_patchRoutesOnMiss: opts == null ? void 0 : opts.unstable_patchRoutesOnMiss
}).initialize();

@@ -1457,0 +1484,0 @@ }

/**
* React Router v0.0.0-experimental-e960cf1a
* React Router v0.0.0-experimental-edf416237
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.RemixRouter)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(t);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=a.createContext(null),u=a.createContext(null),l=a.createContext(null),s=a.createContext(null),c=a.createContext(null),d=a.createContext({outlet:null,matches:[],isDataRoute:!1}),p=a.createContext(null);function f(){return null!=a.useContext(c)}function m(){return f()||r.UNSAFE_invariant(!1),a.useContext(c).location}function v(e){a.useContext(s).static||a.useLayoutEffect(e)}function h(){let{isDataRoute:e}=a.useContext(d);return e?function(){let{router:e}=O(U.UseNavigateStable),t=F(N.UseNavigateStable),r=a.useRef(!1);return v((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,o({fromRouteId:t},a)))}),[e,t])}():function(){f()||r.UNSAFE_invariant(!1);let e=a.useContext(i),{basename:t,future:n,navigator:o}=a.useContext(s),{matches:u}=a.useContext(d),{pathname:l}=m(),c=JSON.stringify(r.UNSAFE_getResolveToMatches(u,n.v7_relativeSplatPath)),p=a.useRef(!1);return v((()=>{p.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!p.current)return;if("number"==typeof n)return void o.go(n);let i=r.resolveTo(n,JSON.parse(c),l,"path"===a.relative);null==e&&"/"!==t&&(i.pathname="/"===i.pathname?t:r.joinPaths([t,i.pathname])),(a.replace?o.replace:o.push)(i,a.state,a)}),[t,o,c,l,e])}()}const E=a.createContext(null);function g(e){let t=a.useContext(d).outlet;return t?a.createElement(E.Provider,{value:e},t):t}function y(e,t){let{relative:n}=void 0===t?{}:t,{future:o}=a.useContext(s),{matches:i}=a.useContext(d),{pathname:u}=m(),l=JSON.stringify(r.UNSAFE_getResolveToMatches(i,o.v7_relativeSplatPath));return a.useMemo((()=>r.resolveTo(e,JSON.parse(l),u,"path"===n)),[e,l,u,n])}function b(e,t){return R(e,t)}function R(e,t,n,i){f()||r.UNSAFE_invariant(!1);let{navigator:u}=a.useContext(s),{matches:l}=a.useContext(d),p=l[l.length-1],v=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let E,g=m();if(t){var y;let e="string"==typeof t?r.parsePath(t):t;"/"===h||(null==(y=e.pathname)?void 0:y.startsWith(h))||r.UNSAFE_invariant(!1),E=e}else E=g;let b=E.pathname||"/",R="/"===h?b:b.slice(h.length)||"/",P=r.matchRoutes(e,{pathname:R}),x=_(P&&P.map((e=>Object.assign({},e,{params:Object.assign({},v,e.params),pathname:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,n,i);return t&&x?a.createElement(c.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},E),navigationType:r.Action.Pop}},x):x}function P(){let e=j(),t=r.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,null)}const x=a.createElement(P,null);class C extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(d.Provider,{value:this.props.routeContext},a.createElement(p.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function S(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(i);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(d.Provider,{value:t},n)}function _(e,t,n,o){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===o&&(o=null),null==e){var u;if(null==(u=n)||!u.errors)return null;e=n.matches}let l=e,s=null==(i=n)?void 0:i.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||r.UNSAFE_invariant(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,d=-1;if(n&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(d=e),t.route.loader&&t.route.id&&void 0===n.loaderData[t.route.id]&&(!n.errors||void 0===n.errors[t.route.id])){c=!0,l=d>=0?l.slice(0,d+1):[l[0]];break}}return l.reduceRight(((e,r,o)=>{let i,u=!1,p=null,f=null;var m;n&&(i=s&&r.route.id?s[r.route.id]:void 0,p=r.route.errorElement||x,c&&(d<0&&0===o?(m="route-fallback",!1||B[m]||(B[m]=!0),u=!0,f=null):d===o&&(u=!0,f=r.route.hydrateFallbackElement||null)));let v=t.concat(l.slice(0,o+1)),h=()=>{let t;return t=i?p:u?f:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(S,{match:r,routeContext:{outlet:e,matches:v,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(C,{location:n.location,revalidation:n.revalidation,component:p,error:i,children:h(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):h()}),null)}var U=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(U||{}),N=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(N||{});function O(e){let t=a.useContext(i);return t||r.UNSAFE_invariant(!1),t}function A(e){let t=a.useContext(u);return t||r.UNSAFE_invariant(!1),t}function F(e){let t=function(e){let t=a.useContext(d);return t||r.UNSAFE_invariant(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||r.UNSAFE_invariant(!1),n.route.id}function j(){var e;let t=a.useContext(p),r=A(N.UseRouteError),n=F(N.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function D(){let e=a.useContext(l);return null==e?void 0:e._data}let k=0;const B={};const L=a.startTransition;function M(e){let{routes:t,future:r,state:n}=e;return R(t,void 0,n,r)}function T(e){r.UNSAFE_invariant(!1)}function I(e){let{basename:t="/",children:n=null,location:i,navigationType:u=r.Action.Pop,navigator:l,static:d=!1,future:p}=e;f()&&r.UNSAFE_invariant(!1);let m=t.replace(/^\/*/,"/"),v=a.useMemo((()=>({basename:m,navigator:l,static:d,future:o({v7_relativeSplatPath:!1},p)})),[m,p,l,d]);"string"==typeof i&&(i=r.parsePath(i));let{pathname:h="/",search:E="",hash:g="",state:y=null,key:b="default"}=i,R=a.useMemo((()=>{let e=r.stripBasename(h,m);return null==e?null:{location:{pathname:e,search:E,hash:g,state:y,key:b},navigationType:u}}),[m,h,E,g,y,b,u]);return null==R?null:a.createElement(s.Provider,{value:v},a.createElement(c.Provider,{children:n,value:R}))}var H=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(H||{});const w=new Promise((()=>{}));class J extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,o=null,i=H.pending;if(n instanceof Promise)if(this.state.error){i=H.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i=void 0!==o._error?H.error:void 0!==o._data?H.success:H.pending):(i=H.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=H.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===H.error&&o._error instanceof r.AbortedDeferredError)throw w;if(i===H.error&&!t)throw o._error;if(i===H.error)return a.createElement(l.Provider,{value:o,children:t});if(i===H.success)return a.createElement(l.Provider,{value:o,children:e});throw o}}function z(e){let{children:t}=e,r=D(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function q(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;let i=[...t,o];if(e.type===a.Fragment)return void n.push.apply(n,q(e.props.children,i));e.type!==T&&r.UNSAFE_invariant(!1),e.props.index&&e.props.children&&r.UNSAFE_invariant(!1);let u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(u.children=q(e.props.children,i)),n.push(u)})),n}function V(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return r.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return r.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return r.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return r.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return r.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return r.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return r.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return r.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return r.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return r.redirect}}),Object.defineProperty(e,"redirectDocument",{enumerable:!0,get:function(){return r.redirectDocument}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return r.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(J,{resolve:n,errorElement:r},a.createElement(z,null,t))},e.MemoryRouter=function(e){let{basename:t,children:n,initialEntries:o,initialIndex:i,future:u}=e,l=a.useRef();null==l.current&&(l.current=r.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let s=l.current,[c,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:p}=u||{},f=a.useCallback((e=>{p&&L?L((()=>d(e))):d(e)}),[d,p]);return a.useLayoutEffect((()=>s.listen(f)),[s,f]),a.createElement(I,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s,future:u})},e.Navigate=function(e){let{to:t,replace:n,state:o,relative:i}=e;f()||r.UNSAFE_invariant(!1);let{future:u,static:l}=a.useContext(s),{matches:c}=a.useContext(d),{pathname:p}=m(),v=h(),E=r.resolveTo(t,r.UNSAFE_getResolveToMatches(c,u.v7_relativeSplatPath),p,"path"===i),g=JSON.stringify(E);return a.useEffect((()=>v(JSON.parse(g),{replace:n,state:o,relative:i})),[v,g,i,n,o]),null},e.Outlet=function(e){return g(e.context)},e.Route=T,e.Router=I,e.RouterProvider=function(e){let{fallbackElement:t,router:r,future:n}=e,[o,l]=a.useState(r.state),{v7_startTransition:s}=n||{},c=a.useCallback((e=>{s&&L?L((()=>l(e))):l(e)}),[l,s]);a.useLayoutEffect((()=>r.subscribe(c)),[r,c]),a.useEffect((()=>{}),[]);let d=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),p=r.basename||"/",f=a.useMemo((()=>({router:r,navigator:d,static:!1,basename:p,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}})),[r,d,p]);return a.createElement(a.Fragment,null,a.createElement(i.Provider,{value:f},a.createElement(u.Provider,{value:o},a.createElement(I,{basename:p,location:o.location,navigationType:o.historyAction,navigator:d},o.initialized?a.createElement(M,{routes:r.routes,future:r.future,state:o}):t))),null)},e.Routes=function(e){let{children:t,location:r}=e;return b(q(t),r)},e.UNSAFE_DataRouterContext=i,e.UNSAFE_DataRouterStateContext=u,e.UNSAFE_LocationContext=c,e.UNSAFE_NavigationContext=s,e.UNSAFE_RouteContext=d,e.UNSAFE_mapRouteProperties=V,e.UNSAFE_useRouteId=function(){return F(N.UseRouteId)},e.UNSAFE_useRoutesImpl=R,e.createMemoryRouter=function(e,t){return r.createRouter({basename:null==t?void 0:t.basename,future:o({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:r.createMemoryHistory({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:V,unstable_dataStrategy:null==t?void 0:t.unstable_dataStrategy}).initialize()},e.createRoutesFromChildren=q,e.createRoutesFromElements=q,e.renderMatches=function(e){return _(e)},e.useActionData=function(){let e=A(N.UseActionData),t=F(N.UseLoaderData);return e.actionData?e.actionData[t]:void 0},e.useAsyncError=function(){let e=a.useContext(l);return null==e?void 0:e._error},e.useAsyncValue=D,e.useBlocker=function(e){let{router:t,basename:n}=O(U.UseBlocker),i=A(N.UseBlocker),[u,l]=a.useState(""),s=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===n)return e(t);let{currentLocation:a,nextLocation:i,historyAction:u}=t;return e({currentLocation:o({},a,{pathname:r.stripBasename(a.pathname,n)||a.pathname}),nextLocation:o({},i,{pathname:r.stripBasename(i.pathname,n)||i.pathname}),historyAction:u})}),[n,e]);return a.useEffect((()=>{let e=String(++k);return l(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==u&&t.getBlocker(u,s)}),[t,u,s]),u&&i.blockers.has(u)?i.blockers.get(u):r.IDLE_BLOCKER},e.useHref=function(e,t){let{relative:n}=void 0===t?{}:t;f()||r.UNSAFE_invariant(!1);let{basename:o,navigator:i}=a.useContext(s),{hash:u,pathname:l,search:c}=y(e,{relative:n}),d=l;return"/"!==o&&(d="/"===l?o:r.joinPaths([o,l])),i.createHref({pathname:d,search:c,hash:u})},e.useInRouterContext=f,e.useLoaderData=function(){let e=A(N.UseLoaderData),t=F(N.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=m,e.useMatch=function(e){f()||r.UNSAFE_invariant(!1);let{pathname:t}=m();return a.useMemo((()=>r.matchPath(e,t)),[t,e])},e.useMatches=function(){let{matches:e,loaderData:t}=A(N.UseMatches);return a.useMemo((()=>e.map((e=>r.UNSAFE_convertRouteMatchToUiMatch(e,t)))),[e,t])},e.useNavigate=h,e.useNavigation=function(){return A(N.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(c).navigationType},e.useOutlet=g,e.useOutletContext=function(){return a.useContext(E)},e.useParams=function(){let{matches:e}=a.useContext(d),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=y,e.useRevalidator=function(){let e=O(U.UseRevalidator),t=A(N.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])},e.useRouteError=j,e.useRouteLoaderData=function(e){return A(N.UseRouteLoaderData).loaderData[e]},e.useRoutes=b,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.RemixRouter)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(t);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o.apply(this,arguments)}const i=a.createContext(null),u=a.createContext(null),l=a.createContext(null),s=a.createContext(null),c=a.createContext(null),d=a.createContext({outlet:null,matches:[],isDataRoute:!1}),p=a.createContext(null);function f(){return null!=a.useContext(c)}function v(){return f()||r.UNSAFE_invariant(!1),a.useContext(c).location}function m(e){a.useContext(s).static||a.useLayoutEffect(e)}function h(){let{isDataRoute:e}=a.useContext(d);return e?function(){let{router:e}=O(U.UseNavigateStable),t=j(N.UseNavigateStable),r=a.useRef(!1);return m((()=>{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,o({fromRouteId:t},a)))}),[e,t])}():function(){f()||r.UNSAFE_invariant(!1);let e=a.useContext(i),{basename:t,future:n,navigator:o}=a.useContext(s),{matches:u}=a.useContext(d),{pathname:l}=v(),c=JSON.stringify(r.UNSAFE_getResolveToMatches(u,n.v7_relativeSplatPath)),p=a.useRef(!1);return m((()=>{p.current=!0})),a.useCallback((function(n,a){if(void 0===a&&(a={}),!p.current)return;if("number"==typeof n)return void o.go(n);let i=r.resolveTo(n,JSON.parse(c),l,"path"===a.relative);null==e&&"/"!==t&&(i.pathname="/"===i.pathname?t:r.joinPaths([t,i.pathname])),(a.replace?o.replace:o.push)(i,a.state,a)}),[t,o,c,l,e])}()}const E=a.createContext(null);function g(e){let t=a.useContext(d).outlet;return t?a.createElement(E.Provider,{value:e},t):t}function y(e,t){let{relative:n}=void 0===t?{}:t,{future:o}=a.useContext(s),{matches:i}=a.useContext(d),{pathname:u}=v(),l=JSON.stringify(r.UNSAFE_getResolveToMatches(i,o.v7_relativeSplatPath));return a.useMemo((()=>r.resolveTo(e,JSON.parse(l),u,"path"===n)),[e,l,u,n])}function b(e,t){return R(e,t)}function R(e,t,n,i){f()||r.UNSAFE_invariant(!1);let{navigator:u}=a.useContext(s),{matches:l}=a.useContext(d),p=l[l.length-1],m=p?p.params:{};!p||p.pathname;let h=p?p.pathnameBase:"/";p&&p.route;let E,g=v();if(t){var y;let e="string"==typeof t?r.parsePath(t):t;"/"===h||(null==(y=e.pathname)?void 0:y.startsWith(h))||r.UNSAFE_invariant(!1),E=e}else E=g;let b=E.pathname||"/",R=b;if("/"!==h){let e=h.replace(/^\//,"").split("/");R="/"+b.replace(/^\//,"").split("/").slice(e.length).join("/")}let P=r.matchRoutes(e,{pathname:R}),x=S(P&&P.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?h:r.joinPaths([h,u.encodeLocation?u.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),l,n,i);return t&&x?a.createElement(c.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},E),navigationType:r.Action.Pop}},x):x}function P(){let e=F(),t=r.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,null)}const x=a.createElement(P,null);class C extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(d.Provider,{value:this.props.routeContext},a.createElement(p.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(i);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(d.Provider,{value:t},n)}function S(e,t,n,o){var i;if(void 0===t&&(t=[]),void 0===n&&(n=null),void 0===o&&(o=null),null==e){var u;if(null==(u=n)||!u.errors)return null;e=n.matches}let l=e,s=null==(i=n)?void 0:i.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&void 0!==(null==s?void 0:s[e.route.id])));e>=0||r.UNSAFE_invariant(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,d=-1;if(n&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(d=e),t.route.id){let{loaderData:e,errors:r}=n,a=t.route.loader&&void 0===e[t.route.id]&&(!r||void 0===r[t.route.id]);if(t.route.lazy||a){c=!0,l=d>=0?l.slice(0,d+1):[l[0]];break}}}return l.reduceRight(((e,r,o)=>{let i,u=!1,p=null,f=null;var v;n&&(i=s&&r.route.id?s[r.route.id]:void 0,p=r.route.errorElement||x,c&&(d<0&&0===o?(v="route-fallback",!1||B[v]||(B[v]=!0),u=!0,f=null):d===o&&(u=!0,f=r.route.hydrateFallbackElement||null)));let m=t.concat(l.slice(0,o+1)),h=()=>{let t;return t=i?p:u?f:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(_,{match:r,routeContext:{outlet:e,matches:m,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(C,{location:n.location,revalidation:n.revalidation,component:p,error:i,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):h()}),null)}var U=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(U||{}),N=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(N||{});function O(e){let t=a.useContext(i);return t||r.UNSAFE_invariant(!1),t}function A(e){let t=a.useContext(u);return t||r.UNSAFE_invariant(!1),t}function j(e){let t=function(e){let t=a.useContext(d);return t||r.UNSAFE_invariant(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||r.UNSAFE_invariant(!1),n.route.id}function F(){var e;let t=a.useContext(p),r=A(N.UseRouteError),n=j(N.UseRouteError);return void 0!==t?t:null==(e=r.errors)?void 0:e[n]}function D(){let e=a.useContext(l);return null==e?void 0:e._data}let k=0;const B={};const L=a.startTransition;function M(e){let{routes:t,future:r,state:n}=e;return R(t,void 0,n,r)}function T(e){r.UNSAFE_invariant(!1)}function I(e){let{basename:t="/",children:n=null,location:i,navigationType:u=r.Action.Pop,navigator:l,static:d=!1,future:p}=e;f()&&r.UNSAFE_invariant(!1);let v=t.replace(/^\/*/,"/"),m=a.useMemo((()=>({basename:v,navigator:l,static:d,future:o({v7_relativeSplatPath:!1},p)})),[v,p,l,d]);"string"==typeof i&&(i=r.parsePath(i));let{pathname:h="/",search:E="",hash:g="",state:y=null,key:b="default"}=i,R=a.useMemo((()=>{let e=r.stripBasename(h,v);return null==e?null:{location:{pathname:e,search:E,hash:g,state:y,key:b},navigationType:u}}),[v,h,E,g,y,b,u]);return null==R?null:a.createElement(s.Provider,{value:m},a.createElement(c.Provider,{children:n,value:R}))}var H=function(e){return e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error",e}(H||{});const w=new Promise((()=>{}));class J extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("<Await> caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,o=null,i=H.pending;if(n instanceof Promise)if(this.state.error){i=H.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i="_error"in o?H.error:"_data"in o?H.success:H.pending):(i=H.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=H.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===H.error&&o._error instanceof r.AbortedDeferredError)throw w;if(i===H.error&&!t)throw o._error;if(i===H.error)return a.createElement(l.Provider,{value:o,children:t});if(i===H.success)return a.createElement(l.Provider,{value:o,children:e});throw o}}function z(e){let{children:t}=e,r=D(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function q(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;let i=[...t,o];if(e.type===a.Fragment)return void n.push.apply(n,q(e.props.children,i));e.type!==T&&r.UNSAFE_invariant(!1),e.props.index&&e.props.children&&r.UNSAFE_invariant(!1);let u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(u.children=q(e.props.children,i)),n.push(u)})),n}function V(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:a.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return r.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return r.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return r.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return r.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return r.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return r.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return r.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return r.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return r.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return r.redirect}}),Object.defineProperty(e,"redirectDocument",{enumerable:!0,get:function(){return r.redirectDocument}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return r.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(J,{resolve:n,errorElement:r},a.createElement(z,null,t))},e.MemoryRouter=function(e){let{basename:t,children:n,initialEntries:o,initialIndex:i,future:u}=e,l=a.useRef();null==l.current&&(l.current=r.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let s=l.current,[c,d]=a.useState({action:s.action,location:s.location}),{v7_startTransition:p}=u||{},f=a.useCallback((e=>{p&&L?L((()=>d(e))):d(e)}),[d,p]);return a.useLayoutEffect((()=>s.listen(f)),[s,f]),a.createElement(I,{basename:t,children:n,location:c.location,navigationType:c.action,navigator:s,future:u})},e.Navigate=function(e){let{to:t,replace:n,state:o,relative:i}=e;f()||r.UNSAFE_invariant(!1);let{future:u,static:l}=a.useContext(s),{matches:c}=a.useContext(d),{pathname:p}=v(),m=h(),E=r.resolveTo(t,r.UNSAFE_getResolveToMatches(c,u.v7_relativeSplatPath),p,"path"===i),g=JSON.stringify(E);return a.useEffect((()=>m(JSON.parse(g),{replace:n,state:o,relative:i})),[m,g,i,n,o]),null},e.Outlet=function(e){return g(e.context)},e.Route=T,e.Router=I,e.RouterProvider=function(e){let{fallbackElement:t,router:r,future:n}=e,[o,l]=a.useState(r.state),{v7_startTransition:s}=n||{},c=a.useCallback((e=>{s&&L?L((()=>l(e))):l(e)}),[l,s]);a.useLayoutEffect((()=>r.subscribe(c)),[r,c]),a.useEffect((()=>{}),[]);let d=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),p=r.basename||"/",f=a.useMemo((()=>({router:r,navigator:d,static:!1,basename:p})),[r,d,p]);return a.createElement(a.Fragment,null,a.createElement(i.Provider,{value:f},a.createElement(u.Provider,{value:o},a.createElement(I,{basename:p,location:o.location,navigationType:o.historyAction,navigator:d,future:{v7_relativeSplatPath:r.future.v7_relativeSplatPath}},o.initialized||r.future.v7_partialHydration?a.createElement(M,{routes:r.routes,future:r.future,state:o}):t))),null)},e.Routes=function(e){let{children:t,location:r}=e;return b(q(t),r)},e.UNSAFE_DataRouterContext=i,e.UNSAFE_DataRouterStateContext=u,e.UNSAFE_LocationContext=c,e.UNSAFE_NavigationContext=s,e.UNSAFE_RouteContext=d,e.UNSAFE_mapRouteProperties=V,e.UNSAFE_useRouteId=function(){return j(N.UseRouteId)},e.UNSAFE_useRoutesImpl=R,e.createMemoryRouter=function(e,t){return r.createRouter({basename:null==t?void 0:t.basename,future:o({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:r.createMemoryHistory({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:V,unstable_dataStrategy:null==t?void 0:t.unstable_dataStrategy,unstable_patchRoutesOnMiss:null==t?void 0:t.unstable_patchRoutesOnMiss}).initialize()},e.createRoutesFromChildren=q,e.createRoutesFromElements=q,e.renderMatches=function(e){return S(e)},e.useActionData=function(){let e=A(N.UseActionData),t=j(N.UseLoaderData);return e.actionData?e.actionData[t]:void 0},e.useAsyncError=function(){let e=a.useContext(l);return null==e?void 0:e._error},e.useAsyncValue=D,e.useBlocker=function(e){let{router:t,basename:n}=O(U.UseBlocker),i=A(N.UseBlocker),[u,l]=a.useState(""),s=a.useCallback((t=>{if("function"!=typeof e)return!!e;if("/"===n)return e(t);let{currentLocation:a,nextLocation:i,historyAction:u}=t;return e({currentLocation:o({},a,{pathname:r.stripBasename(a.pathname,n)||a.pathname}),nextLocation:o({},i,{pathname:r.stripBasename(i.pathname,n)||i.pathname}),historyAction:u})}),[n,e]);return a.useEffect((()=>{let e=String(++k);return l(e),()=>t.deleteBlocker(e)}),[t]),a.useEffect((()=>{""!==u&&t.getBlocker(u,s)}),[t,u,s]),u&&i.blockers.has(u)?i.blockers.get(u):r.IDLE_BLOCKER},e.useHref=function(e,t){let{relative:n}=void 0===t?{}:t;f()||r.UNSAFE_invariant(!1);let{basename:o,navigator:i}=a.useContext(s),{hash:u,pathname:l,search:c}=y(e,{relative:n}),d=l;return"/"!==o&&(d="/"===l?o:r.joinPaths([o,l])),i.createHref({pathname:d,search:c,hash:u})},e.useInRouterContext=f,e.useLoaderData=function(){let e=A(N.UseLoaderData),t=j(N.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=v,e.useMatch=function(e){f()||r.UNSAFE_invariant(!1);let{pathname:t}=v();return a.useMemo((()=>r.matchPath(e,t)),[t,e])},e.useMatches=function(){let{matches:e,loaderData:t}=A(N.UseMatches);return a.useMemo((()=>e.map((e=>r.UNSAFE_convertRouteMatchToUiMatch(e,t)))),[e,t])},e.useNavigate=h,e.useNavigation=function(){return A(N.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(c).navigationType},e.useOutlet=g,e.useOutletContext=function(){return a.useContext(E)},e.useParams=function(){let{matches:e}=a.useContext(d),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=y,e.useRevalidator=function(){let e=O(U.UseRevalidator),t=A(N.UseRevalidator);return a.useMemo((()=>({revalidate:e.router.revalidate,state:t.revalidation})),[e.router.revalidate,t.revalidation])},e.useRouteError=F,e.useRouteLoaderData=function(e){return A(N.UseRouteLoaderData).loaderData[e]},e.useRoutes=b,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=react-router.production.min.js.map
{
"name": "react-router",
"version": "0.0.0-experimental-e960cf1a",
"version": "0.0.0-experimental-edf416237",
"description": "Declarative routing for React",

@@ -26,6 +26,7 @@ "keywords": [

"dependencies": {
"@remix-run/router": "0.0.0-experimental-e960cf1a"
"@remix-run/router": "0.0.0-experimental-edf416237"
},
"devDependencies": {
"react": "^18.2.0"
"react": "^18.2.0",
"react-router-dom": "0.0.0-experimental-edf416237"
},

@@ -44,2 +45,2 @@ "peerDependencies": {

}
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc