react-router-dom 6.4.1-pre.0 → 6.4.2-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.4.1-pre.0
2
+ * React Router DOM v6.4.2-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -9,9 +9,9 @@
9
9
  * @license MIT
10
10
  */
11
11
  import * as React from 'react';
12
- import { UNSAFE_enhanceManualRouteObjects, Router, useHref, createPath, useResolvedPath, useMatch, UNSAFE_DataRouterStateContext, useNavigate, useLocation, UNSAFE_DataRouterContext, UNSAFE_RouteContext, useMatches, useNavigation } from 'react-router';
12
+ import { UNSAFE_enhanceManualRouteObjects, Router, useHref, createPath, useResolvedPath, useMatch, UNSAFE_DataRouterStateContext, useNavigate, useLocation, UNSAFE_NavigationContext, UNSAFE_RouteContext, useMatches, useNavigation, UNSAFE_DataRouterContext } from 'react-router';
13
13
  export { AbortedDeferredError, Await, MemoryRouter, Navigate, NavigationType, Outlet, Route, Router, RouterProvider, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_DataStaticRouterContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_enhanceManualRouteObjects, createMemoryRouter, createPath, createRoutesFromChildren, createRoutesFromElements, defer, generatePath, isRouteErrorResponse, json, matchPath, matchRoutes, parsePath, redirect, renderMatches, resolvePath, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes } from 'react-router';
14
- import { createRouter, createBrowserHistory, createHashHistory, matchPath, invariant } from '@remix-run/router';
14
+ import { createRouter, createBrowserHistory, createHashHistory, matchPath, invariant, joinPaths } from '@remix-run/router';
15
15
 
16
16
  const defaultMethod = "get";
17
17
  const defaultEncType = "application/x-www-form-urlencoded";
@@ -469,6 +469,37 @@ function ScrollRestoration({
469
469
  //#region Hooks
470
470
  ////////////////////////////////////////////////////////////////////////////////
471
471
 
472
+
473
+ var DataRouterHook;
474
+
475
+ (function (DataRouterHook) {
476
+ DataRouterHook["UseScrollRestoration"] = "useScrollRestoration";
477
+ DataRouterHook["UseSubmitImpl"] = "useSubmitImpl";
478
+ DataRouterHook["UseFetcher"] = "useFetcher";
479
+ })(DataRouterHook || (DataRouterHook = {}));
480
+
481
+ var DataRouterStateHook;
482
+
483
+ (function (DataRouterStateHook) {
484
+ DataRouterStateHook["UseFetchers"] = "useFetchers";
485
+ DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration";
486
+ })(DataRouterStateHook || (DataRouterStateHook = {}));
487
+
488
+ function getDataRouterConsoleError(hookName) {
489
+ return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
490
+ }
491
+
492
+ function useDataRouterContext(hookName) {
493
+ let ctx = React.useContext(UNSAFE_DataRouterContext);
494
+ !ctx ? invariant(false, getDataRouterConsoleError(hookName)) : void 0;
495
+ return ctx;
496
+ }
497
+
498
+ function useDataRouterState(hookName) {
499
+ let state = React.useContext(UNSAFE_DataRouterStateContext);
500
+ !state ? invariant(false, getDataRouterConsoleError(hookName)) : void 0;
501
+ return state;
502
+ }
472
503
  /**
473
504
  * Handles the click behavior for router `<Link>` components. This is useful if
474
505
  * you need to create custom `<Link>` components with the same click behavior we
@@ -530,11 +561,9 @@ function useSubmit() {
530
561
  }
531
562
 
532
563
  function useSubmitImpl(fetcherKey, routeId) {
533
- let dataRouterContext = React.useContext(UNSAFE_DataRouterContext);
534
- !dataRouterContext ? invariant(false, "useSubmitImpl must be used within a Data Router") : void 0;
535
564
  let {
536
565
  router
537
- } = dataRouterContext;
566
+ } = useDataRouterContext(DataRouterHook.UseSubmitImpl);
538
567
  let defaultAction = useFormAction();
539
568
  return React.useCallback((target, options = {}) => {
540
569
  if (typeof document === "undefined") {
@@ -567,13 +596,19 @@ function useSubmitImpl(fetcherKey, routeId) {
567
596
  function useFormAction(action, {
568
597
  relative
569
598
  } = {}) {
599
+ let {
600
+ basename
601
+ } = React.useContext(UNSAFE_NavigationContext);
570
602
  let routeContext = React.useContext(UNSAFE_RouteContext);
571
603
  !routeContext ? invariant(false, "useFormAction must be used inside a RouteContext") : void 0;
572
604
  let [match] = routeContext.matches.slice(-1);
573
- let resolvedAction = action ?? ".";
574
- let path = useResolvedPath(resolvedAction, {
575
- relative
576
- }); // Previously we set the default action to ".". The problem with this is that
605
+ let resolvedAction = action ?? "."; // Shallow clone path so we can modify it below, otherwise we modify the
606
+ // object referenced by useMemo inside useResolvedPath
607
+
608
+ let path = { ...useResolvedPath(resolvedAction, {
609
+ relative
610
+ })
611
+ }; // Previously we set the default action to ".". The problem with this is that
577
612
  // `useResolvedPath(".")` excludes search params and the hash of the resolved
578
613
  // URL. This is the intended behavior of when "." is specifically provided as
579
614
  // the form action, but inconsistent w/ browsers when the action is omitted.
@@ -599,6 +634,14 @@ function useFormAction(action, {
599
634
 
600
635
  if ((!action || action === ".") && match.route.index) {
601
636
  path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
637
+ } // If we're operating within a basename, prepend it to the pathname prior
638
+ // to creating the form action. If this is a root navigation, then just use
639
+ // the raw basename which allows the basename to have full control over the
640
+ // presence of a trailing slash on root actions
641
+
642
+
643
+ if (basename !== "/") {
644
+ path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
602
645
  }
603
646
 
604
647
  return createPath(path);
@@ -627,11 +670,9 @@ let fetcherId = 0;
627
670
  * for any interaction that stays on the same page.
628
671
  */
629
672
  function useFetcher() {
630
- let dataRouterContext = React.useContext(UNSAFE_DataRouterContext);
631
- !dataRouterContext ? invariant(false, `useFetcher must be used within a Data Router`) : void 0;
632
673
  let {
633
674
  router
634
- } = dataRouterContext;
675
+ } = useDataRouterContext(DataRouterHook.UseFetcher);
635
676
  let route = React.useContext(UNSAFE_RouteContext);
636
677
  !route ? invariant(false, `useFetcher must be used inside a RouteContext`) : void 0;
637
678
  let routeId = route.matches[route.matches.length - 1]?.route.id;
@@ -675,8 +716,7 @@ function useFetcher() {
675
716
  */
676
717
 
677
718
  function useFetchers() {
678
- let state = React.useContext(UNSAFE_DataRouterStateContext);
679
- !state ? invariant(false, `useFetchers must be used within a DataRouterStateContext`) : void 0;
719
+ let state = useDataRouterState(DataRouterStateHook.UseFetchers);
680
720
  return [...state.fetchers.values()];
681
721
  }
682
722
  const SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
@@ -689,20 +729,16 @@ function useScrollRestoration({
689
729
  getKey,
690
730
  storageKey
691
731
  } = {}) {
692
- let location = useLocation();
693
- let matches = useMatches();
694
- let navigation = useNavigation();
695
- let dataRouterContext = React.useContext(UNSAFE_DataRouterContext);
696
- !dataRouterContext ? invariant(false, "useScrollRestoration must be used within a DataRouterContext") : void 0;
697
732
  let {
698
733
  router
699
- } = dataRouterContext;
700
- let state = React.useContext(UNSAFE_DataRouterStateContext);
701
- !(router != null && state != null) ? invariant(false, "useScrollRestoration must be used within a DataRouterStateContext") : void 0;
734
+ } = useDataRouterContext(DataRouterHook.UseScrollRestoration);
702
735
  let {
703
736
  restoreScrollPosition,
704
737
  preventScrollReset
705
- } = state; // Trigger manual scroll restoration while we're active
738
+ } = useDataRouterState(DataRouterStateHook.UseScrollRestoration);
739
+ let location = useLocation();
740
+ let matches = useMatches();
741
+ let navigation = useNavigation(); // Trigger manual scroll restoration while we're active
706
742
 
707
743
  React.useEffect(() => {
708
744
  window.history.scrollRestoration = "manual";
@@ -1 +1 @@
1
- {"version":3,"file":"react-router-dom.development.js","sources":["../dom.ts","../index.tsx"],"sourcesContent":["import type { FormEncType, FormMethod } from \"@remix-run/router\";\nimport type { RelativeRoutingType } from \"react-router\";\n\nexport const defaultMethod = \"get\";\nconst defaultEncType = \"application/x-www-form-urlencoded\";\n\nexport function isHtmlElement(object: any): object is HTMLElement {\n return object != null && typeof object.tagName === \"string\";\n}\n\nexport function isButtonElement(object: any): object is HTMLButtonElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\n\nexport function isFormElement(object: any): object is HTMLFormElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\n\nexport function isInputElement(object: any): object is HTMLInputElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\n\ntype LimitedMouseEvent = Pick<\n MouseEvent,\n \"button\" | \"metaKey\" | \"altKey\" | \"ctrlKey\" | \"shiftKey\"\n>;\n\nfunction isModifiedEvent(event: LimitedMouseEvent) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nexport function shouldProcessLinkClick(\n event: LimitedMouseEvent,\n target?: string\n) {\n return (\n event.button === 0 && // Ignore everything but left clicks\n (!target || target === \"_self\") && // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n );\n}\n\nexport type ParamKeyValuePair = [string, string];\n\nexport type URLSearchParamsInit =\n | string\n | ParamKeyValuePair[]\n | Record<string, string | string[]>\n | URLSearchParams;\n\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\nexport function createSearchParams(\n init: URLSearchParamsInit = \"\"\n): URLSearchParams {\n return new URLSearchParams(\n typeof init === \"string\" ||\n Array.isArray(init) ||\n init instanceof URLSearchParams\n ? init\n : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n );\n }, [] as ParamKeyValuePair[])\n );\n}\n\nexport function getSearchParamsForLocation(\n locationSearch: string,\n defaultSearchParams: URLSearchParams\n) {\n let searchParams = createSearchParams(locationSearch);\n\n for (let key of defaultSearchParams.keys()) {\n if (!searchParams.has(key)) {\n defaultSearchParams.getAll(key).forEach((value) => {\n searchParams.append(key, value);\n });\n }\n }\n\n return searchParams;\n}\n\nexport interface SubmitOptions {\n /**\n * The HTTP method used to submit the form. Overrides `<form method>`.\n * Defaults to \"GET\".\n */\n method?: FormMethod;\n\n /**\n * The action URL path used to submit the form. Overrides `<form action>`.\n * Defaults to the path of the current route.\n *\n * Note: It is assumed the path is already resolved. If you need to resolve a\n * relative path, use `useFormAction`.\n */\n action?: string;\n\n /**\n * The action URL used to submit the form. Overrides `<form encType>`.\n * Defaults to \"application/x-www-form-urlencoded\".\n */\n encType?: FormEncType;\n\n /**\n * Set `true` to replace the current entry in the browser's history stack\n * instead of creating a new one (i.e. stay on \"the same page\"). Defaults\n * to `false`.\n */\n replace?: boolean;\n\n /**\n * Determines whether the form action is relative to the route hierarchy or\n * the pathname. Use this if you want to opt out of navigating the route\n * hierarchy and want to instead route based on /-delimited URL segments\n */\n relative?: RelativeRoutingType;\n}\n\nexport function getFormSubmissionInfo(\n target:\n | HTMLFormElement\n | HTMLButtonElement\n | HTMLInputElement\n | FormData\n | URLSearchParams\n | { [name: string]: string }\n | null,\n defaultAction: string,\n options: SubmitOptions\n): {\n url: URL;\n method: string;\n encType: string;\n formData: FormData;\n} {\n let method: string;\n let action: string;\n let encType: string;\n let formData: FormData;\n\n if (isFormElement(target)) {\n let submissionTrigger: HTMLButtonElement | HTMLInputElement = (\n options as any\n ).submissionTrigger;\n\n method = options.method || target.getAttribute(\"method\") || defaultMethod;\n action = options.action || target.getAttribute(\"action\") || defaultAction;\n encType =\n options.encType || target.getAttribute(\"enctype\") || defaultEncType;\n\n formData = new FormData(target);\n\n if (submissionTrigger && submissionTrigger.name) {\n formData.append(submissionTrigger.name, submissionTrigger.value);\n }\n } else if (\n isButtonElement(target) ||\n (isInputElement(target) &&\n (target.type === \"submit\" || target.type === \"image\"))\n ) {\n let form = target.form;\n\n if (form == null) {\n throw new Error(\n `Cannot submit a <button> or <input type=\"submit\"> without a <form>`\n );\n }\n\n // <button>/<input type=\"submit\"> may override attributes of <form>\n\n method =\n options.method ||\n target.getAttribute(\"formmethod\") ||\n form.getAttribute(\"method\") ||\n defaultMethod;\n action =\n options.action ||\n target.getAttribute(\"formaction\") ||\n form.getAttribute(\"action\") ||\n defaultAction;\n encType =\n options.encType ||\n target.getAttribute(\"formenctype\") ||\n form.getAttribute(\"enctype\") ||\n defaultEncType;\n\n formData = new FormData(form);\n\n // Include name + value from a <button>, appending in case the button name\n // matches an existing input name\n if (target.name) {\n formData.append(target.name, target.value);\n }\n } else if (isHtmlElement(target)) {\n throw new Error(\n `Cannot submit element that is not <form>, <button>, or ` +\n `<input type=\"submit|image\">`\n );\n } else {\n method = options.method || defaultMethod;\n action = options.action || defaultAction;\n encType = options.encType || defaultEncType;\n\n if (target instanceof FormData) {\n formData = target;\n } else {\n formData = new FormData();\n\n if (target instanceof URLSearchParams) {\n for (let [name, value] of target) {\n formData.append(name, value);\n }\n } else if (target != null) {\n for (let name of Object.keys(target)) {\n formData.append(name, target[name]);\n }\n }\n }\n }\n\n let { protocol, host } = window.location;\n let url = new URL(action, `${protocol}//${host}`);\n\n return { url, method, encType, formData };\n}\n","/**\n * NOTE: If you refactor this to split up the modules into separate files,\n * you'll need to update the rollup config for react-router-dom-v5-compat.\n */\nimport * as React from \"react\";\nimport type {\n NavigateOptions,\n RelativeRoutingType,\n RouteObject,\n To,\n} from \"react-router\";\nimport {\n Router,\n createPath,\n useHref,\n useLocation,\n useMatch,\n useMatches,\n useNavigate,\n useNavigation,\n useResolvedPath,\n UNSAFE_DataRouterContext as DataRouterContext,\n UNSAFE_DataRouterStateContext as DataRouterStateContext,\n UNSAFE_RouteContext as RouteContext,\n UNSAFE_enhanceManualRouteObjects as enhanceManualRouteObjects,\n} from \"react-router\";\nimport type {\n BrowserHistory,\n Fetcher,\n FormEncType,\n FormMethod,\n GetScrollRestorationKeyFunction,\n HashHistory,\n History,\n HydrationState,\n Router as RemixRouter,\n} from \"@remix-run/router\";\nimport {\n createRouter,\n createBrowserHistory,\n createHashHistory,\n invariant,\n matchPath,\n} from \"@remix-run/router\";\n\nimport type {\n SubmitOptions,\n ParamKeyValuePair,\n URLSearchParamsInit,\n} from \"./dom\";\nimport {\n createSearchParams,\n defaultMethod,\n getFormSubmissionInfo,\n getSearchParamsForLocation,\n shouldProcessLinkClick,\n} from \"./dom\";\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Re-exports\n////////////////////////////////////////////////////////////////////////////////\n\nexport type {\n FormEncType,\n FormMethod,\n ParamKeyValuePair,\n SubmitOptions,\n URLSearchParamsInit,\n};\nexport { createSearchParams };\n\n// Note: Keep in sync with react-router exports!\nexport type {\n ActionFunction,\n ActionFunctionArgs,\n AwaitProps,\n DataRouteMatch,\n DataRouteObject,\n Fetcher,\n Hash,\n IndexRouteProps,\n JsonFunction,\n LayoutRouteProps,\n LoaderFunction,\n LoaderFunctionArgs,\n Location,\n MemoryRouterProps,\n NavigateFunction,\n NavigateOptions,\n NavigateProps,\n Navigation,\n Navigator,\n OutletProps,\n Params,\n ParamParseKey,\n Path,\n PathMatch,\n Pathname,\n PathPattern,\n PathRouteProps,\n RedirectFunction,\n RelativeRoutingType,\n RouteMatch,\n RouteObject,\n RouteProps,\n RouterProps,\n RouterProviderProps,\n RoutesProps,\n Search,\n ShouldRevalidateFunction,\n To,\n} from \"react-router\";\nexport {\n AbortedDeferredError,\n Await,\n MemoryRouter,\n Navigate,\n NavigationType,\n Outlet,\n Route,\n Router,\n RouterProvider,\n Routes,\n createMemoryRouter,\n createPath,\n createRoutesFromChildren,\n createRoutesFromElements,\n defer,\n isRouteErrorResponse,\n generatePath,\n json,\n matchPath,\n matchRoutes,\n parsePath,\n redirect,\n renderMatches,\n resolvePath,\n useActionData,\n useAsyncError,\n useAsyncValue,\n useHref,\n useInRouterContext,\n useLoaderData,\n useLocation,\n useMatch,\n useMatches,\n useNavigate,\n useNavigation,\n useNavigationType,\n useOutlet,\n useOutletContext,\n useParams,\n useResolvedPath,\n useRevalidator,\n useRouteError,\n useRouteLoaderData,\n useRoutes,\n} from \"react-router\";\n\n///////////////////////////////////////////////////////////////////////////////\n// DANGER! PLEASE READ ME!\n// We provide these exports as an escape hatch in the event that you need any\n// routing data that we don't provide an explicit API for. With that said, we\n// want to cover your use case if we can, so if you feel the need to use these\n// we want to hear from you. Let us know what you're building and we'll do our\n// best to make sure we can support you!\n//\n// We consider these exports an implementation detail and do not guarantee\n// against any breaking changes, regardless of the semver release. Use with\n// extreme caution and only if you understand the consequences. Godspeed.\n///////////////////////////////////////////////////////////////////////////////\n\n/** @internal */\nexport {\n UNSAFE_DataRouterContext,\n UNSAFE_DataRouterStateContext,\n UNSAFE_DataStaticRouterContext,\n UNSAFE_NavigationContext,\n UNSAFE_LocationContext,\n UNSAFE_RouteContext,\n UNSAFE_enhanceManualRouteObjects,\n} from \"react-router\";\n//#endregion\n\ndeclare global {\n var __staticRouterHydrationData: HydrationState | undefined;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Routers\n////////////////////////////////////////////////////////////////////////////////\n\nexport function createBrowserRouter(\n routes: RouteObject[],\n opts?: {\n basename?: string;\n hydrationData?: HydrationState;\n window?: Window;\n }\n): RemixRouter {\n return createRouter({\n basename: opts?.basename,\n history: createBrowserHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || window?.__staticRouterHydrationData,\n routes: enhanceManualRouteObjects(routes),\n }).initialize();\n}\n\nexport function createHashRouter(\n routes: RouteObject[],\n opts?: {\n basename?: string;\n hydrationData?: HydrationState;\n window?: Window;\n }\n): RemixRouter {\n return createRouter({\n basename: opts?.basename,\n history: createHashHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || window?.__staticRouterHydrationData,\n routes: enhanceManualRouteObjects(routes),\n }).initialize();\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Components\n////////////////////////////////////////////////////////////////////////////////\n\nexport interface BrowserRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\nexport function BrowserRouter({\n basename,\n children,\n window,\n}: BrowserRouterProps) {\n let historyRef = React.useRef<BrowserHistory>();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({ window, v5Compat: true });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HashRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nexport function HashRouter({ basename, children, window }: HashRouterProps) {\n let historyRef = React.useRef<HashHistory>();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({ window, v5Compat: true });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HistoryRouterProps {\n basename?: string;\n children?: React.ReactNode;\n history: History;\n}\n\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter({ basename, children, history }: HistoryRouterProps) {\n const [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nif (__DEV__) {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\n\nexport { HistoryRouter as unstable_HistoryRouter };\n\nexport interface LinkProps\n extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n reloadDocument?: boolean;\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n to: To;\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n function LinkWithRef(\n {\n onClick,\n relative,\n reloadDocument,\n replace,\n state,\n target,\n to,\n preventScrollReset,\n ...rest\n },\n ref\n ) {\n let href = useHref(to, { relative });\n let internalOnClick = useLinkClickHandler(to, {\n replace,\n state,\n target,\n preventScrollReset,\n relative,\n });\n function handleClick(\n event: React.MouseEvent<HTMLAnchorElement, MouseEvent>\n ) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented) {\n internalOnClick(event);\n }\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a\n {...rest}\n href={href}\n onClick={reloadDocument ? onClick : handleClick}\n ref={ref}\n target={target}\n />\n );\n }\n);\n\nif (__DEV__) {\n Link.displayName = \"Link\";\n}\n\nexport interface NavLinkProps\n extends Omit<LinkProps, \"className\" | \"style\" | \"children\"> {\n children?:\n | React.ReactNode\n | ((props: { isActive: boolean; isPending: boolean }) => React.ReactNode);\n caseSensitive?: boolean;\n className?:\n | string\n | ((props: {\n isActive: boolean;\n isPending: boolean;\n }) => string | undefined);\n end?: boolean;\n style?:\n | React.CSSProperties\n | ((props: {\n isActive: boolean;\n isPending: boolean;\n }) => React.CSSProperties | undefined);\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nexport const NavLink = React.forwardRef<HTMLAnchorElement, NavLinkProps>(\n function NavLinkWithRef(\n {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n children,\n ...rest\n },\n ref\n ) {\n let path = useResolvedPath(to);\n let match = useMatch({ path: path.pathname, end, caseSensitive });\n\n let routerState = React.useContext(DataRouterStateContext);\n let nextLocation = routerState?.navigation.location;\n let nextPath = useResolvedPath(nextLocation || \"\");\n let nextMatch = React.useMemo(\n () =>\n nextLocation\n ? matchPath(\n { path: path.pathname, end, caseSensitive },\n nextPath.pathname\n )\n : null,\n [nextLocation, path.pathname, caseSensitive, end, nextPath.pathname]\n );\n\n let isPending = nextMatch != null;\n let isActive = match != null;\n\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n\n let className: string | undefined;\n if (typeof classNameProp === \"function\") {\n className = classNameProp({ isActive, isPending });\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for <NavLink />s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [\n classNameProp,\n isActive ? \"active\" : null,\n isPending ? \"pending\" : null,\n ]\n .filter(Boolean)\n .join(\" \");\n }\n\n let style =\n typeof styleProp === \"function\"\n ? styleProp({ isActive, isPending })\n : styleProp;\n\n return (\n <Link\n {...rest}\n aria-current={ariaCurrent}\n className={className}\n ref={ref}\n style={style}\n to={to}\n >\n {typeof children === \"function\"\n ? children({ isActive, isPending })\n : children}\n </Link>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n}\n\nexport interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {\n /**\n * The HTTP verb to use when the form is submit. Supports \"get\", \"post\",\n * \"put\", \"delete\", \"patch\".\n */\n method?: FormMethod;\n\n /**\n * Normal `<form action>` but supports React Router's relative paths.\n */\n action?: string;\n\n /**\n * Forces a full document navigation instead of a fetch.\n */\n reloadDocument?: boolean;\n\n /**\n * Replaces the current entry in the browser history stack when the form\n * navigates. Use this if you don't want the user to be able to click \"back\"\n * to the page with the form on it.\n */\n replace?: boolean;\n\n /**\n * Determines whether the form action is relative to the route hierarchy or\n * the pathname. Use this if you want to opt out of navigating the route\n * hierarchy and want to instead route based on /-delimited URL segments\n */\n relative?: RelativeRoutingType;\n\n /**\n * A function to call when the form is submitted. If you call\n * `event.preventDefault()` then this form will not do anything.\n */\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\n/**\n * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except\n * that the interaction with the server is with `fetch` instead of new document\n * requests, allowing components to add nicer UX to the page as the form is\n * submitted and returns with data.\n */\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n return <FormImpl {...props} ref={ref} />;\n }\n);\n\nif (__DEV__) {\n Form.displayName = \"Form\";\n}\n\ntype HTMLSubmitEvent = React.BaseSyntheticEvent<\n SubmitEvent,\n Event,\n HTMLFormElement\n>;\n\ntype HTMLFormSubmitter = HTMLButtonElement | HTMLInputElement;\n\ninterface FormImplProps extends FormProps {\n fetcherKey?: string;\n routeId?: string;\n}\n\nconst FormImpl = React.forwardRef<HTMLFormElement, FormImplProps>(\n (\n {\n reloadDocument,\n replace,\n method = defaultMethod,\n action,\n onSubmit,\n fetcherKey,\n routeId,\n relative,\n ...props\n },\n forwardedRef\n ) => {\n let submit = useSubmitImpl(fetcherKey, routeId);\n let formMethod: FormMethod =\n method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n let formAction = useFormAction(action, { relative });\n let submitHandler: React.FormEventHandler<HTMLFormElement> = (event) => {\n onSubmit && onSubmit(event);\n if (event.defaultPrevented) return;\n event.preventDefault();\n\n let submitter = (event as unknown as HTMLSubmitEvent).nativeEvent\n .submitter as HTMLFormSubmitter | null;\n\n submit(submitter || event.currentTarget, { method, replace, relative });\n };\n\n return (\n <form\n ref={forwardedRef}\n method={formMethod}\n action={formAction}\n onSubmit={reloadDocument ? onSubmit : submitHandler}\n {...props}\n />\n );\n }\n);\n\nif (__DEV__) {\n Form.displayName = \"Form\";\n}\n\ninterface ScrollRestorationProps {\n getKey?: GetScrollRestorationKeyFunction;\n storageKey?: string;\n}\n\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n */\nexport function ScrollRestoration({\n getKey,\n storageKey,\n}: ScrollRestorationProps) {\n useScrollRestoration({ getKey, storageKey });\n return null;\n}\n\nif (__DEV__) {\n ScrollRestoration.displayName = \"ScrollRestoration\";\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Hooks\n////////////////////////////////////////////////////////////////////////////////\n\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\nexport function useLinkClickHandler<E extends Element = HTMLAnchorElement>(\n to: To,\n {\n target,\n replace: replaceProp,\n state,\n preventScrollReset,\n relative,\n }: {\n target?: React.HTMLAttributeAnchorTarget;\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n } = {}\n): (event: React.MouseEvent<E, MouseEvent>) => void {\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to, { relative });\n\n return React.useCallback(\n (event: React.MouseEvent<E, MouseEvent>) => {\n if (shouldProcessLinkClick(event, target)) {\n event.preventDefault();\n\n // If the URL hasn't changed, a regular <a> will do a replace instead of\n // a push, so do the same here unless the replace prop is explicitly set\n let replace =\n replaceProp !== undefined\n ? replaceProp\n : createPath(location) === createPath(path);\n\n navigate(to, { replace, state, preventScrollReset, relative });\n }\n },\n [\n location,\n navigate,\n path,\n replaceProp,\n state,\n target,\n to,\n preventScrollReset,\n relative,\n ]\n );\n}\n\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nexport function useSearchParams(\n defaultInit?: URLSearchParamsInit\n): [URLSearchParams, SetURLSearchParams] {\n warning(\n typeof URLSearchParams !== \"undefined\",\n `You cannot use the \\`useSearchParams\\` hook in a browser that does not ` +\n `support the URLSearchParams API. If you need to support Internet ` +\n `Explorer 11, we recommend you load a polyfill such as ` +\n `https://github.com/ungap/url-search-params\\n\\n` +\n `If you're unsure how to load polyfills, we recommend you check out ` +\n `https://polyfill.io/v3/ which provides some recommendations about how ` +\n `to load polyfills only for users that need them, instead of for every ` +\n `user.`\n );\n\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n\n let location = useLocation();\n let searchParams = React.useMemo(\n () =>\n getSearchParamsForLocation(\n location.search,\n defaultSearchParamsRef.current\n ),\n [location.search]\n );\n\n let navigate = useNavigate();\n let setSearchParams = React.useCallback<SetURLSearchParams>(\n (nextInit, navigateOptions) => {\n const newSearchParams = createSearchParams(\n typeof nextInit === \"function\" ? nextInit(searchParams) : nextInit\n );\n navigate(\"?\" + newSearchParams, navigateOptions);\n },\n [navigate, searchParams]\n );\n\n return [searchParams, setSearchParams];\n}\n\ntype SetURLSearchParams = (\n nextInit?:\n | URLSearchParamsInit\n | ((prev: URLSearchParams) => URLSearchParamsInit),\n navigateOpts?: NavigateOptions\n) => void;\n\ntype SubmitTarget =\n | HTMLFormElement\n | HTMLButtonElement\n | HTMLInputElement\n | FormData\n | URLSearchParams\n | { [name: string]: string }\n | null;\n\n/**\n * Submits a HTML `<form>` to the server without reloading the page.\n */\nexport interface SubmitFunction {\n (\n /**\n * Specifies the `<form>` to be submitted to the server, a specific\n * `<button>` or `<input type=\"submit\">` to use to submit the form, or some\n * arbitrary data to submit.\n *\n * Note: When using a `<button>` its `name` and `value` will also be\n * included in the form data that is submitted.\n */\n target: SubmitTarget,\n\n /**\n * Options that override the `<form>`'s own attributes. Required when\n * submitting arbitrary data without a backing `<form>`.\n */\n options?: SubmitOptions\n ): void;\n}\n\n/**\n * Returns a function that may be used to programmatically submit a form (or\n * some arbitrary data) to the server.\n */\nexport function useSubmit(): SubmitFunction {\n return useSubmitImpl();\n}\n\nfunction useSubmitImpl(fetcherKey?: string, routeId?: string): SubmitFunction {\n let dataRouterContext = React.useContext(DataRouterContext);\n invariant(\n dataRouterContext,\n \"useSubmitImpl must be used within a Data Router\"\n );\n let { router } = dataRouterContext;\n let defaultAction = useFormAction();\n\n return React.useCallback(\n (target, options = {}) => {\n if (typeof document === \"undefined\") {\n throw new Error(\n \"You are calling submit during the server render. \" +\n \"Try calling submit within a `useEffect` or callback instead.\"\n );\n }\n\n let { method, encType, formData, url } = getFormSubmissionInfo(\n target,\n defaultAction,\n options\n );\n\n let href = url.pathname + url.search;\n let opts = {\n replace: options.replace,\n formData,\n formMethod: method as FormMethod,\n formEncType: encType as FormEncType,\n };\n if (fetcherKey) {\n invariant(routeId != null, \"No routeId available for useFetcher()\");\n router.fetch(fetcherKey, routeId, href, opts);\n } else {\n router.navigate(href, opts);\n }\n },\n [defaultAction, router, fetcherKey, routeId]\n );\n}\n\nexport function useFormAction(\n action?: string,\n { relative }: { relative?: RelativeRoutingType } = {}\n): string {\n let routeContext = React.useContext(RouteContext);\n invariant(routeContext, \"useFormAction must be used inside a RouteContext\");\n\n let [match] = routeContext.matches.slice(-1);\n let resolvedAction = action ?? \".\";\n let path = useResolvedPath(resolvedAction, { relative });\n\n // Previously we set the default action to \".\". The problem with this is that\n // `useResolvedPath(\".\")` excludes search params and the hash of the resolved\n // URL. This is the intended behavior of when \".\" is specifically provided as\n // the form action, but inconsistent w/ browsers when the action is omitted.\n // https://github.com/remix-run/remix/issues/927\n let location = useLocation();\n if (action == null) {\n // Safe to write to these directly here since if action was undefined, we\n // would have called useResolvedPath(\".\") which will never include a search\n // or hash\n path.search = location.search;\n path.hash = location.hash;\n\n // When grabbing search params from the URL, remove the automatically\n // inserted ?index param so we match the useResolvedPath search behavior\n // which would not include ?index\n if (match.route.index) {\n let params = new URLSearchParams(path.search);\n params.delete(\"index\");\n path.search = params.toString() ? `?${params.toString()}` : \"\";\n }\n }\n\n if ((!action || action === \".\") && match.route.index) {\n path.search = path.search\n ? path.search.replace(/^\\?/, \"?index&\")\n : \"?index\";\n }\n\n return createPath(path);\n}\n\nfunction createFetcherForm(fetcherKey: string, routeId: string) {\n let FetcherForm = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n return (\n <FormImpl\n {...props}\n ref={ref}\n fetcherKey={fetcherKey}\n routeId={routeId}\n />\n );\n }\n );\n if (__DEV__) {\n FetcherForm.displayName = \"fetcher.Form\";\n }\n return FetcherForm;\n}\n\nlet fetcherId = 0;\n\nexport type FetcherWithComponents<TData> = Fetcher<TData> & {\n Form: ReturnType<typeof createFetcherForm>;\n submit: (\n target: SubmitTarget,\n // Fetchers cannot replace because they are not navigation events\n options?: Omit<SubmitOptions, \"replace\">\n ) => void;\n load: (href: string) => void;\n};\n\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n */\nexport function useFetcher<TData = any>(): FetcherWithComponents<TData> {\n let dataRouterContext = React.useContext(DataRouterContext);\n invariant(dataRouterContext, `useFetcher must be used within a Data Router`);\n let { router } = dataRouterContext;\n\n let route = React.useContext(RouteContext);\n invariant(route, `useFetcher must be used inside a RouteContext`);\n\n let routeId = route.matches[route.matches.length - 1]?.route.id;\n invariant(\n routeId != null,\n `useFetcher can only be used on routes that contain a unique \"id\"`\n );\n\n let [fetcherKey] = React.useState(() => String(++fetcherId));\n let [Form] = React.useState(() => {\n invariant(routeId, `No routeId available for fetcher.Form()`);\n return createFetcherForm(fetcherKey, routeId);\n });\n let [load] = React.useState(() => (href: string) => {\n invariant(router, \"No router available for fetcher.load()\");\n invariant(routeId, \"No routeId available for fetcher.load()\");\n router.fetch(fetcherKey, routeId, href);\n });\n let submit = useSubmitImpl(fetcherKey, routeId);\n\n let fetcher = router.getFetcher<TData>(fetcherKey);\n\n let fetcherWithComponents = React.useMemo(\n () => ({\n Form,\n submit,\n load,\n ...fetcher,\n }),\n [fetcher, Form, submit, load]\n );\n\n React.useEffect(() => {\n // Is this busted when the React team gets real weird and calls effects\n // twice on mount? We really just need to garbage collect here when this\n // fetcher is no longer around.\n return () => {\n if (!router) {\n console.warn(`No fetcher available to clean up from useFetcher()`);\n return;\n }\n router.deleteFetcher(fetcherKey);\n };\n }, [router, fetcherKey]);\n\n return fetcherWithComponents;\n}\n\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n */\nexport function useFetchers(): Fetcher[] {\n let state = React.useContext(DataRouterStateContext);\n invariant(state, `useFetchers must be used within a DataRouterStateContext`);\n return [...state.fetchers.values()];\n}\n\nconst SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nlet savedScrollPositions: Record<string, number> = {};\n\n/**\n * When rendered inside a RouterProvider, will restore scroll positions on navigations\n */\nfunction useScrollRestoration({\n getKey,\n storageKey,\n}: {\n getKey?: GetScrollRestorationKeyFunction;\n storageKey?: string;\n} = {}) {\n let location = useLocation();\n let matches = useMatches();\n let navigation = useNavigation();\n let dataRouterContext = React.useContext(DataRouterContext);\n invariant(\n dataRouterContext,\n \"useScrollRestoration must be used within a DataRouterContext\"\n );\n let { router } = dataRouterContext;\n let state = React.useContext(DataRouterStateContext);\n\n invariant(\n router != null && state != null,\n \"useScrollRestoration must be used within a DataRouterStateContext\"\n );\n let { restoreScrollPosition, preventScrollReset } = state;\n\n // Trigger manual scroll restoration while we're active\n React.useEffect(() => {\n window.history.scrollRestoration = \"manual\";\n return () => {\n window.history.scrollRestoration = \"auto\";\n };\n }, []);\n\n // Save positions on unload\n useBeforeUnload(\n React.useCallback(() => {\n if (navigation.state === \"idle\") {\n let key = (getKey ? getKey(location, matches) : null) || location.key;\n savedScrollPositions[key] = window.scrollY;\n }\n sessionStorage.setItem(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY,\n JSON.stringify(savedScrollPositions)\n );\n window.history.scrollRestoration = \"auto\";\n }, [storageKey, getKey, navigation.state, location, matches])\n );\n\n // Read in any saved scroll locations\n React.useLayoutEffect(() => {\n try {\n let sessionPositions = sessionStorage.getItem(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY\n );\n if (sessionPositions) {\n savedScrollPositions = JSON.parse(sessionPositions);\n }\n } catch (e) {\n // no-op, use default empty object\n }\n }, [storageKey]);\n\n // Enable scroll restoration in the router\n React.useLayoutEffect(() => {\n let disableScrollRestoration = router?.enableScrollRestoration(\n savedScrollPositions,\n () => window.scrollY,\n getKey\n );\n return () => disableScrollRestoration && disableScrollRestoration();\n }, [router, getKey]);\n\n // Restore scrolling when state.restoreScrollPosition changes\n React.useLayoutEffect(() => {\n // Explicit false means don't do anything (used for submissions)\n if (restoreScrollPosition === false) {\n return;\n }\n\n // been here before, scroll to it\n if (typeof restoreScrollPosition === \"number\") {\n window.scrollTo(0, restoreScrollPosition);\n return;\n }\n\n // try to scroll to the hash\n if (location.hash) {\n let el = document.getElementById(location.hash.slice(1));\n if (el) {\n el.scrollIntoView();\n return;\n }\n }\n\n // Opt out of scroll reset if this link requested it\n if (preventScrollReset === true) {\n return;\n }\n\n // otherwise go to the top on new locations\n window.scrollTo(0, 0);\n }, [location, restoreScrollPosition, preventScrollReset]);\n}\n\nfunction useBeforeUnload(callback: () => any): void {\n React.useEffect(() => {\n window.addEventListener(\"beforeunload\", callback);\n return () => {\n window.removeEventListener(\"beforeunload\", callback);\n };\n }, [callback]);\n}\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Utils\n////////////////////////////////////////////////////////////////////////////////\n\nfunction warning(cond: boolean, message: string): void {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging React Router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n//#endregion\n"],"names":["defaultMethod","defaultEncType","isHtmlElement","object","tagName","isButtonElement","toLowerCase","isFormElement","isInputElement","isModifiedEvent","event","metaKey","altKey","ctrlKey","shiftKey","shouldProcessLinkClick","target","button","createSearchParams","init","URLSearchParams","Array","isArray","Object","keys","reduce","memo","key","value","concat","map","v","getSearchParamsForLocation","locationSearch","defaultSearchParams","searchParams","has","getAll","forEach","append","getFormSubmissionInfo","defaultAction","options","method","action","encType","formData","submissionTrigger","getAttribute","FormData","name","type","form","Error","protocol","host","window","location","url","URL","createBrowserRouter","routes","opts","createRouter","basename","history","createBrowserHistory","hydrationData","__staticRouterHydrationData","enhanceManualRouteObjects","initialize","createHashRouter","createHashHistory","BrowserRouter","children","historyRef","React","useRef","current","v5Compat","state","setState","useState","useLayoutEffect","listen","HashRouter","HistoryRouter","displayName","Link","forwardRef","LinkWithRef","onClick","relative","reloadDocument","replace","to","preventScrollReset","rest","ref","href","useHref","internalOnClick","useLinkClickHandler","handleClick","defaultPrevented","NavLink","NavLinkWithRef","ariaCurrentProp","caseSensitive","className","classNameProp","end","style","styleProp","path","useResolvedPath","match","useMatch","pathname","routerState","useContext","DataRouterStateContext","nextLocation","navigation","nextPath","nextMatch","useMemo","matchPath","isPending","isActive","ariaCurrent","undefined","filter","Boolean","join","Form","props","FormImpl","onSubmit","fetcherKey","routeId","forwardedRef","submit","useSubmitImpl","formMethod","formAction","useFormAction","submitHandler","preventDefault","submitter","nativeEvent","currentTarget","ScrollRestoration","getKey","storageKey","useScrollRestoration","replaceProp","navigate","useNavigate","useLocation","useCallback","createPath","useSearchParams","defaultInit","warning","defaultSearchParamsRef","search","setSearchParams","nextInit","navigateOptions","newSearchParams","useSubmit","dataRouterContext","DataRouterContext","invariant","router","document","formEncType","fetch","routeContext","RouteContext","matches","slice","resolvedAction","hash","route","index","params","delete","toString","createFetcherForm","FetcherForm","fetcherId","useFetcher","length","id","String","load","fetcher","getFetcher","fetcherWithComponents","useEffect","console","warn","deleteFetcher","useFetchers","fetchers","values","SCROLL_RESTORATION_STORAGE_KEY","savedScrollPositions","useMatches","useNavigation","restoreScrollPosition","scrollRestoration","useBeforeUnload","scrollY","sessionStorage","setItem","JSON","stringify","sessionPositions","getItem","parse","e","disableScrollRestoration","enableScrollRestoration","scrollTo","el","getElementById","scrollIntoView","callback","addEventListener","removeEventListener","cond","message"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAMA,aAAa,GAAG,KAAtB,CAAA;AACP,MAAMC,cAAc,GAAG,mCAAvB,CAAA;AAEO,SAASC,aAAT,CAAuBC,MAAvB,EAA2D;EAChE,OAAOA,MAAM,IAAI,IAAV,IAAkB,OAAOA,MAAM,CAACC,OAAd,KAA0B,QAAnD,CAAA;AACD,CAAA;AAEM,SAASC,eAAT,CAAyBF,MAAzB,EAAmE;EACxE,OAAOD,aAAa,CAACC,MAAD,CAAb,IAAyBA,MAAM,CAACC,OAAP,CAAeE,WAAf,EAAA,KAAiC,QAAjE,CAAA;AACD,CAAA;AAEM,SAASC,aAAT,CAAuBJ,MAAvB,EAA+D;EACpE,OAAOD,aAAa,CAACC,MAAD,CAAb,IAAyBA,MAAM,CAACC,OAAP,CAAeE,WAAf,EAAA,KAAiC,MAAjE,CAAA;AACD,CAAA;AAEM,SAASE,cAAT,CAAwBL,MAAxB,EAAiE;EACtE,OAAOD,aAAa,CAACC,MAAD,CAAb,IAAyBA,MAAM,CAACC,OAAP,CAAeE,WAAf,EAAA,KAAiC,OAAjE,CAAA;AACD,CAAA;;AAOD,SAASG,eAAT,CAAyBC,KAAzB,EAAmD;AACjD,EAAA,OAAO,CAAC,EAAEA,KAAK,CAACC,OAAN,IAAiBD,KAAK,CAACE,MAAvB,IAAiCF,KAAK,CAACG,OAAvC,IAAkDH,KAAK,CAACI,QAA1D,CAAR,CAAA;AACD,CAAA;;AAEM,SAASC,sBAAT,CACLL,KADK,EAELM,MAFK,EAGL;AACA,EAAA,OACEN,KAAK,CAACO,MAAN,KAAiB,CAAjB;AACC,EAAA,CAACD,MAAD,IAAWA,MAAM,KAAK,OADvB,CACmC;AACnC,EAAA,CAACP,eAAe,CAACC,KAAD,CAHlB;AAAA,GAAA;AAKD,CAAA;;AAUD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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Content":["import type { FormEncType, FormMethod } from \"@remix-run/router\";\nimport type { RelativeRoutingType } from \"react-router\";\n\nexport const defaultMethod = \"get\";\nconst defaultEncType = \"application/x-www-form-urlencoded\";\n\nexport function isHtmlElement(object: any): object is HTMLElement {\n return object != null && typeof object.tagName === \"string\";\n}\n\nexport function isButtonElement(object: any): object is HTMLButtonElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"button\";\n}\n\nexport function isFormElement(object: any): object is HTMLFormElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"form\";\n}\n\nexport function isInputElement(object: any): object is HTMLInputElement {\n return isHtmlElement(object) && object.tagName.toLowerCase() === \"input\";\n}\n\ntype LimitedMouseEvent = Pick<\n MouseEvent,\n \"button\" | \"metaKey\" | \"altKey\" | \"ctrlKey\" | \"shiftKey\"\n>;\n\nfunction isModifiedEvent(event: LimitedMouseEvent) {\n return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);\n}\n\nexport function shouldProcessLinkClick(\n event: LimitedMouseEvent,\n target?: string\n) {\n return (\n event.button === 0 && // Ignore everything but left clicks\n (!target || target === \"_self\") && // Let browser handle \"target=_blank\" etc.\n !isModifiedEvent(event) // Ignore clicks with modifier keys\n );\n}\n\nexport type ParamKeyValuePair = [string, string];\n\nexport type URLSearchParamsInit =\n | string\n | ParamKeyValuePair[]\n | Record<string, string | string[]>\n | URLSearchParams;\n\n/**\n * Creates a URLSearchParams object using the given initializer.\n *\n * This is identical to `new URLSearchParams(init)` except it also\n * supports arrays as values in the object form of the initializer\n * instead of just strings. This is convenient when you need multiple\n * values for a given key, but don't want to use an array initializer.\n *\n * For example, instead of:\n *\n * let searchParams = new URLSearchParams([\n * ['sort', 'name'],\n * ['sort', 'price']\n * ]);\n *\n * you can do:\n *\n * let searchParams = createSearchParams({\n * sort: ['name', 'price']\n * });\n */\nexport function createSearchParams(\n init: URLSearchParamsInit = \"\"\n): URLSearchParams {\n return new URLSearchParams(\n typeof init === \"string\" ||\n Array.isArray(init) ||\n init instanceof URLSearchParams\n ? init\n : Object.keys(init).reduce((memo, key) => {\n let value = init[key];\n return memo.concat(\n Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]\n );\n }, [] as ParamKeyValuePair[])\n );\n}\n\nexport function getSearchParamsForLocation(\n locationSearch: string,\n defaultSearchParams: URLSearchParams\n) {\n let searchParams = createSearchParams(locationSearch);\n\n for (let key of defaultSearchParams.keys()) {\n if (!searchParams.has(key)) {\n defaultSearchParams.getAll(key).forEach((value) => {\n searchParams.append(key, value);\n });\n }\n }\n\n return searchParams;\n}\n\nexport interface SubmitOptions {\n /**\n * The HTTP method used to submit the form. Overrides `<form method>`.\n * Defaults to \"GET\".\n */\n method?: FormMethod;\n\n /**\n * The action URL path used to submit the form. Overrides `<form action>`.\n * Defaults to the path of the current route.\n *\n * Note: It is assumed the path is already resolved. If you need to resolve a\n * relative path, use `useFormAction`.\n */\n action?: string;\n\n /**\n * The action URL used to submit the form. Overrides `<form encType>`.\n * Defaults to \"application/x-www-form-urlencoded\".\n */\n encType?: FormEncType;\n\n /**\n * Set `true` to replace the current entry in the browser's history stack\n * instead of creating a new one (i.e. stay on \"the same page\"). Defaults\n * to `false`.\n */\n replace?: boolean;\n\n /**\n * Determines whether the form action is relative to the route hierarchy or\n * the pathname. Use this if you want to opt out of navigating the route\n * hierarchy and want to instead route based on /-delimited URL segments\n */\n relative?: RelativeRoutingType;\n}\n\nexport function getFormSubmissionInfo(\n target:\n | HTMLFormElement\n | HTMLButtonElement\n | HTMLInputElement\n | FormData\n | URLSearchParams\n | { [name: string]: string }\n | null,\n defaultAction: string,\n options: SubmitOptions\n): {\n url: URL;\n method: string;\n encType: string;\n formData: FormData;\n} {\n let method: string;\n let action: string;\n let encType: string;\n let formData: FormData;\n\n if (isFormElement(target)) {\n let submissionTrigger: HTMLButtonElement | HTMLInputElement = (\n options as any\n ).submissionTrigger;\n\n method = options.method || target.getAttribute(\"method\") || defaultMethod;\n action = options.action || target.getAttribute(\"action\") || defaultAction;\n encType =\n options.encType || target.getAttribute(\"enctype\") || defaultEncType;\n\n formData = new FormData(target);\n\n if (submissionTrigger && submissionTrigger.name) {\n formData.append(submissionTrigger.name, submissionTrigger.value);\n }\n } else if (\n isButtonElement(target) ||\n (isInputElement(target) &&\n (target.type === \"submit\" || target.type === \"image\"))\n ) {\n let form = target.form;\n\n if (form == null) {\n throw new Error(\n `Cannot submit a <button> or <input type=\"submit\"> without a <form>`\n );\n }\n\n // <button>/<input type=\"submit\"> may override attributes of <form>\n\n method =\n options.method ||\n target.getAttribute(\"formmethod\") ||\n form.getAttribute(\"method\") ||\n defaultMethod;\n action =\n options.action ||\n target.getAttribute(\"formaction\") ||\n form.getAttribute(\"action\") ||\n defaultAction;\n encType =\n options.encType ||\n target.getAttribute(\"formenctype\") ||\n form.getAttribute(\"enctype\") ||\n defaultEncType;\n\n formData = new FormData(form);\n\n // Include name + value from a <button>, appending in case the button name\n // matches an existing input name\n if (target.name) {\n formData.append(target.name, target.value);\n }\n } else if (isHtmlElement(target)) {\n throw new Error(\n `Cannot submit element that is not <form>, <button>, or ` +\n `<input type=\"submit|image\">`\n );\n } else {\n method = options.method || defaultMethod;\n action = options.action || defaultAction;\n encType = options.encType || defaultEncType;\n\n if (target instanceof FormData) {\n formData = target;\n } else {\n formData = new FormData();\n\n if (target instanceof URLSearchParams) {\n for (let [name, value] of target) {\n formData.append(name, value);\n }\n } else if (target != null) {\n for (let name of Object.keys(target)) {\n formData.append(name, target[name]);\n }\n }\n }\n }\n\n let { protocol, host } = window.location;\n let url = new URL(action, `${protocol}//${host}`);\n\n return { url, method, encType, formData };\n}\n","/**\n * NOTE: If you refactor this to split up the modules into separate files,\n * you'll need to update the rollup config for react-router-dom-v5-compat.\n */\nimport * as React from \"react\";\nimport type {\n NavigateOptions,\n RelativeRoutingType,\n RouteObject,\n To,\n} from \"react-router\";\nimport {\n Router,\n createPath,\n useHref,\n useLocation,\n useMatch,\n useMatches,\n useNavigate,\n useNavigation,\n useResolvedPath,\n UNSAFE_DataRouterContext as DataRouterContext,\n UNSAFE_DataRouterStateContext as DataRouterStateContext,\n UNSAFE_NavigationContext as NavigationContext,\n UNSAFE_RouteContext as RouteContext,\n UNSAFE_enhanceManualRouteObjects as enhanceManualRouteObjects,\n} from \"react-router\";\nimport type {\n BrowserHistory,\n Fetcher,\n FormEncType,\n FormMethod,\n GetScrollRestorationKeyFunction,\n HashHistory,\n History,\n HydrationState,\n Router as RemixRouter,\n} from \"@remix-run/router\";\nimport {\n createRouter,\n createBrowserHistory,\n createHashHistory,\n invariant,\n joinPaths,\n matchPath,\n} from \"@remix-run/router\";\n\nimport type {\n SubmitOptions,\n ParamKeyValuePair,\n URLSearchParamsInit,\n} from \"./dom\";\nimport {\n createSearchParams,\n defaultMethod,\n getFormSubmissionInfo,\n getSearchParamsForLocation,\n shouldProcessLinkClick,\n} from \"./dom\";\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Re-exports\n////////////////////////////////////////////////////////////////////////////////\n\nexport type {\n FormEncType,\n FormMethod,\n ParamKeyValuePair,\n SubmitOptions,\n URLSearchParamsInit,\n};\nexport { createSearchParams };\n\n// Note: Keep in sync with react-router exports!\nexport type {\n ActionFunction,\n ActionFunctionArgs,\n AwaitProps,\n DataRouteMatch,\n DataRouteObject,\n Fetcher,\n Hash,\n IndexRouteObject,\n IndexRouteProps,\n JsonFunction,\n LayoutRouteProps,\n LoaderFunction,\n LoaderFunctionArgs,\n Location,\n MemoryRouterProps,\n NavigateFunction,\n NavigateOptions,\n NavigateProps,\n Navigation,\n Navigator,\n NonIndexRouteObject,\n OutletProps,\n Params,\n ParamParseKey,\n Path,\n PathMatch,\n Pathname,\n PathPattern,\n PathRouteProps,\n RedirectFunction,\n RelativeRoutingType,\n RouteMatch,\n RouteObject,\n RouteProps,\n RouterProps,\n RouterProviderProps,\n RoutesProps,\n Search,\n ShouldRevalidateFunction,\n To,\n} from \"react-router\";\nexport {\n AbortedDeferredError,\n Await,\n MemoryRouter,\n Navigate,\n NavigationType,\n Outlet,\n Route,\n Router,\n RouterProvider,\n Routes,\n createMemoryRouter,\n createPath,\n createRoutesFromChildren,\n createRoutesFromElements,\n defer,\n isRouteErrorResponse,\n generatePath,\n json,\n matchPath,\n matchRoutes,\n parsePath,\n redirect,\n renderMatches,\n resolvePath,\n useActionData,\n useAsyncError,\n useAsyncValue,\n useHref,\n useInRouterContext,\n useLoaderData,\n useLocation,\n useMatch,\n useMatches,\n useNavigate,\n useNavigation,\n useNavigationType,\n useOutlet,\n useOutletContext,\n useParams,\n useResolvedPath,\n useRevalidator,\n useRouteError,\n useRouteLoaderData,\n useRoutes,\n} from \"react-router\";\n\n///////////////////////////////////////////////////////////////////////////////\n// DANGER! PLEASE READ ME!\n// We provide these exports as an escape hatch in the event that you need any\n// routing data that we don't provide an explicit API for. With that said, we\n// want to cover your use case if we can, so if you feel the need to use these\n// we want to hear from you. Let us know what you're building and we'll do our\n// best to make sure we can support you!\n//\n// We consider these exports an implementation detail and do not guarantee\n// against any breaking changes, regardless of the semver release. Use with\n// extreme caution and only if you understand the consequences. Godspeed.\n///////////////////////////////////////////////////////////////////////////////\n\n/** @internal */\nexport {\n UNSAFE_DataRouterContext,\n UNSAFE_DataRouterStateContext,\n UNSAFE_DataStaticRouterContext,\n UNSAFE_NavigationContext,\n UNSAFE_LocationContext,\n UNSAFE_RouteContext,\n UNSAFE_enhanceManualRouteObjects,\n} from \"react-router\";\n//#endregion\n\ndeclare global {\n var __staticRouterHydrationData: HydrationState | undefined;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Routers\n////////////////////////////////////////////////////////////////////////////////\n\nexport function createBrowserRouter(\n routes: RouteObject[],\n opts?: {\n basename?: string;\n hydrationData?: HydrationState;\n window?: Window;\n }\n): RemixRouter {\n return createRouter({\n basename: opts?.basename,\n history: createBrowserHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || window?.__staticRouterHydrationData,\n routes: enhanceManualRouteObjects(routes),\n }).initialize();\n}\n\nexport function createHashRouter(\n routes: RouteObject[],\n opts?: {\n basename?: string;\n hydrationData?: HydrationState;\n window?: Window;\n }\n): RemixRouter {\n return createRouter({\n basename: opts?.basename,\n history: createHashHistory({ window: opts?.window }),\n hydrationData: opts?.hydrationData || window?.__staticRouterHydrationData,\n routes: enhanceManualRouteObjects(routes),\n }).initialize();\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Components\n////////////////////////////////////////////////////////////////////////////////\n\nexport interface BrowserRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Provides the cleanest URLs.\n */\nexport function BrowserRouter({\n basename,\n children,\n window,\n}: BrowserRouterProps) {\n let historyRef = React.useRef<BrowserHistory>();\n if (historyRef.current == null) {\n historyRef.current = createBrowserHistory({ window, v5Compat: true });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HashRouterProps {\n basename?: string;\n children?: React.ReactNode;\n window?: Window;\n}\n\n/**\n * A `<Router>` for use in web browsers. Stores the location in the hash\n * portion of the URL so it is not sent to the server.\n */\nexport function HashRouter({ basename, children, window }: HashRouterProps) {\n let historyRef = React.useRef<HashHistory>();\n if (historyRef.current == null) {\n historyRef.current = createHashHistory({ window, v5Compat: true });\n }\n\n let history = historyRef.current;\n let [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nexport interface HistoryRouterProps {\n basename?: string;\n children?: React.ReactNode;\n history: History;\n}\n\n/**\n * A `<Router>` that accepts a pre-instantiated history object. It's important\n * to note that using your own history object is highly discouraged and may add\n * two versions of the history library to your bundles unless you use the same\n * version of the history library that React Router uses internally.\n */\nfunction HistoryRouter({ basename, children, history }: HistoryRouterProps) {\n const [state, setState] = React.useState({\n action: history.action,\n location: history.location,\n });\n\n React.useLayoutEffect(() => history.listen(setState), [history]);\n\n return (\n <Router\n basename={basename}\n children={children}\n location={state.location}\n navigationType={state.action}\n navigator={history}\n />\n );\n}\n\nif (__DEV__) {\n HistoryRouter.displayName = \"unstable_HistoryRouter\";\n}\n\nexport { HistoryRouter as unstable_HistoryRouter };\n\nexport interface LinkProps\n extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"href\"> {\n reloadDocument?: boolean;\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n to: To;\n}\n\n/**\n * The public API for rendering a history-aware <a>.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n function LinkWithRef(\n {\n onClick,\n relative,\n reloadDocument,\n replace,\n state,\n target,\n to,\n preventScrollReset,\n ...rest\n },\n ref\n ) {\n let href = useHref(to, { relative });\n let internalOnClick = useLinkClickHandler(to, {\n replace,\n state,\n target,\n preventScrollReset,\n relative,\n });\n function handleClick(\n event: React.MouseEvent<HTMLAnchorElement, MouseEvent>\n ) {\n if (onClick) onClick(event);\n if (!event.defaultPrevented) {\n internalOnClick(event);\n }\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a\n {...rest}\n href={href}\n onClick={reloadDocument ? onClick : handleClick}\n ref={ref}\n target={target}\n />\n );\n }\n);\n\nif (__DEV__) {\n Link.displayName = \"Link\";\n}\n\nexport interface NavLinkProps\n extends Omit<LinkProps, \"className\" | \"style\" | \"children\"> {\n children?:\n | React.ReactNode\n | ((props: { isActive: boolean; isPending: boolean }) => React.ReactNode);\n caseSensitive?: boolean;\n className?:\n | string\n | ((props: {\n isActive: boolean;\n isPending: boolean;\n }) => string | undefined);\n end?: boolean;\n style?:\n | React.CSSProperties\n | ((props: {\n isActive: boolean;\n isPending: boolean;\n }) => React.CSSProperties | undefined);\n}\n\n/**\n * A <Link> wrapper that knows if it's \"active\" or not.\n */\nexport const NavLink = React.forwardRef<HTMLAnchorElement, NavLinkProps>(\n function NavLinkWithRef(\n {\n \"aria-current\": ariaCurrentProp = \"page\",\n caseSensitive = false,\n className: classNameProp = \"\",\n end = false,\n style: styleProp,\n to,\n children,\n ...rest\n },\n ref\n ) {\n let path = useResolvedPath(to);\n let match = useMatch({ path: path.pathname, end, caseSensitive });\n\n let routerState = React.useContext(DataRouterStateContext);\n let nextLocation = routerState?.navigation.location;\n let nextPath = useResolvedPath(nextLocation || \"\");\n let nextMatch = React.useMemo(\n () =>\n nextLocation\n ? matchPath(\n { path: path.pathname, end, caseSensitive },\n nextPath.pathname\n )\n : null,\n [nextLocation, path.pathname, caseSensitive, end, nextPath.pathname]\n );\n\n let isPending = nextMatch != null;\n let isActive = match != null;\n\n let ariaCurrent = isActive ? ariaCurrentProp : undefined;\n\n let className: string | undefined;\n if (typeof classNameProp === \"function\") {\n className = classNameProp({ isActive, isPending });\n } else {\n // If the className prop is not a function, we use a default `active`\n // class for <NavLink />s that are active. In v5 `active` was the default\n // value for `activeClassName`, but we are removing that API and can still\n // use the old default behavior for a cleaner upgrade path and keep the\n // simple styling rules working as they currently do.\n className = [\n classNameProp,\n isActive ? \"active\" : null,\n isPending ? \"pending\" : null,\n ]\n .filter(Boolean)\n .join(\" \");\n }\n\n let style =\n typeof styleProp === \"function\"\n ? styleProp({ isActive, isPending })\n : styleProp;\n\n return (\n <Link\n {...rest}\n aria-current={ariaCurrent}\n className={className}\n ref={ref}\n style={style}\n to={to}\n >\n {typeof children === \"function\"\n ? children({ isActive, isPending })\n : children}\n </Link>\n );\n }\n);\n\nif (__DEV__) {\n NavLink.displayName = \"NavLink\";\n}\n\nexport interface FormProps extends React.FormHTMLAttributes<HTMLFormElement> {\n /**\n * The HTTP verb to use when the form is submit. Supports \"get\", \"post\",\n * \"put\", \"delete\", \"patch\".\n */\n method?: FormMethod;\n\n /**\n * Normal `<form action>` but supports React Router's relative paths.\n */\n action?: string;\n\n /**\n * Forces a full document navigation instead of a fetch.\n */\n reloadDocument?: boolean;\n\n /**\n * Replaces the current entry in the browser history stack when the form\n * navigates. Use this if you don't want the user to be able to click \"back\"\n * to the page with the form on it.\n */\n replace?: boolean;\n\n /**\n * Determines whether the form action is relative to the route hierarchy or\n * the pathname. Use this if you want to opt out of navigating the route\n * hierarchy and want to instead route based on /-delimited URL segments\n */\n relative?: RelativeRoutingType;\n\n /**\n * A function to call when the form is submitted. If you call\n * `event.preventDefault()` then this form will not do anything.\n */\n onSubmit?: React.FormEventHandler<HTMLFormElement>;\n}\n\n/**\n * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except\n * that the interaction with the server is with `fetch` instead of new document\n * requests, allowing components to add nicer UX to the page as the form is\n * submitted and returns with data.\n */\nexport const Form = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n return <FormImpl {...props} ref={ref} />;\n }\n);\n\nif (__DEV__) {\n Form.displayName = \"Form\";\n}\n\ntype HTMLSubmitEvent = React.BaseSyntheticEvent<\n SubmitEvent,\n Event,\n HTMLFormElement\n>;\n\ntype HTMLFormSubmitter = HTMLButtonElement | HTMLInputElement;\n\ninterface FormImplProps extends FormProps {\n fetcherKey?: string;\n routeId?: string;\n}\n\nconst FormImpl = React.forwardRef<HTMLFormElement, FormImplProps>(\n (\n {\n reloadDocument,\n replace,\n method = defaultMethod,\n action,\n onSubmit,\n fetcherKey,\n routeId,\n relative,\n ...props\n },\n forwardedRef\n ) => {\n let submit = useSubmitImpl(fetcherKey, routeId);\n let formMethod: FormMethod =\n method.toLowerCase() === \"get\" ? \"get\" : \"post\";\n let formAction = useFormAction(action, { relative });\n let submitHandler: React.FormEventHandler<HTMLFormElement> = (event) => {\n onSubmit && onSubmit(event);\n if (event.defaultPrevented) return;\n event.preventDefault();\n\n let submitter = (event as unknown as HTMLSubmitEvent).nativeEvent\n .submitter as HTMLFormSubmitter | null;\n\n submit(submitter || event.currentTarget, { method, replace, relative });\n };\n\n return (\n <form\n ref={forwardedRef}\n method={formMethod}\n action={formAction}\n onSubmit={reloadDocument ? onSubmit : submitHandler}\n {...props}\n />\n );\n }\n);\n\nif (__DEV__) {\n Form.displayName = \"Form\";\n}\n\ninterface ScrollRestorationProps {\n getKey?: GetScrollRestorationKeyFunction;\n storageKey?: string;\n}\n\n/**\n * This component will emulate the browser's scroll restoration on location\n * changes.\n */\nexport function ScrollRestoration({\n getKey,\n storageKey,\n}: ScrollRestorationProps) {\n useScrollRestoration({ getKey, storageKey });\n return null;\n}\n\nif (__DEV__) {\n ScrollRestoration.displayName = \"ScrollRestoration\";\n}\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Hooks\n////////////////////////////////////////////////////////////////////////////////\n\nenum DataRouterHook {\n UseScrollRestoration = \"useScrollRestoration\",\n UseSubmitImpl = \"useSubmitImpl\",\n UseFetcher = \"useFetcher\",\n}\n\nenum DataRouterStateHook {\n UseFetchers = \"useFetchers\",\n UseScrollRestoration = \"useScrollRestoration\",\n}\n\nfunction getDataRouterConsoleError(\n hookName: DataRouterHook | DataRouterStateHook\n) {\n return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;\n}\n\nfunction useDataRouterContext(hookName: DataRouterHook) {\n let ctx = React.useContext(DataRouterContext);\n invariant(ctx, getDataRouterConsoleError(hookName));\n return ctx;\n}\n\nfunction useDataRouterState(hookName: DataRouterStateHook) {\n let state = React.useContext(DataRouterStateContext);\n invariant(state, getDataRouterConsoleError(hookName));\n return state;\n}\n\n/**\n * Handles the click behavior for router `<Link>` components. This is useful if\n * you need to create custom `<Link>` components with the same click behavior we\n * use in our exported `<Link>`.\n */\nexport function useLinkClickHandler<E extends Element = HTMLAnchorElement>(\n to: To,\n {\n target,\n replace: replaceProp,\n state,\n preventScrollReset,\n relative,\n }: {\n target?: React.HTMLAttributeAnchorTarget;\n replace?: boolean;\n state?: any;\n preventScrollReset?: boolean;\n relative?: RelativeRoutingType;\n } = {}\n): (event: React.MouseEvent<E, MouseEvent>) => void {\n let navigate = useNavigate();\n let location = useLocation();\n let path = useResolvedPath(to, { relative });\n\n return React.useCallback(\n (event: React.MouseEvent<E, MouseEvent>) => {\n if (shouldProcessLinkClick(event, target)) {\n event.preventDefault();\n\n // If the URL hasn't changed, a regular <a> will do a replace instead of\n // a push, so do the same here unless the replace prop is explicitly set\n let replace =\n replaceProp !== undefined\n ? replaceProp\n : createPath(location) === createPath(path);\n\n navigate(to, { replace, state, preventScrollReset, relative });\n }\n },\n [\n location,\n navigate,\n path,\n replaceProp,\n state,\n target,\n to,\n preventScrollReset,\n relative,\n ]\n );\n}\n\n/**\n * A convenient wrapper for reading and writing search parameters via the\n * URLSearchParams interface.\n */\nexport function useSearchParams(\n defaultInit?: URLSearchParamsInit\n): [URLSearchParams, SetURLSearchParams] {\n warning(\n typeof URLSearchParams !== \"undefined\",\n `You cannot use the \\`useSearchParams\\` hook in a browser that does not ` +\n `support the URLSearchParams API. If you need to support Internet ` +\n `Explorer 11, we recommend you load a polyfill such as ` +\n `https://github.com/ungap/url-search-params\\n\\n` +\n `If you're unsure how to load polyfills, we recommend you check out ` +\n `https://polyfill.io/v3/ which provides some recommendations about how ` +\n `to load polyfills only for users that need them, instead of for every ` +\n `user.`\n );\n\n let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));\n\n let location = useLocation();\n let searchParams = React.useMemo(\n () =>\n getSearchParamsForLocation(\n location.search,\n defaultSearchParamsRef.current\n ),\n [location.search]\n );\n\n let navigate = useNavigate();\n let setSearchParams = React.useCallback<SetURLSearchParams>(\n (nextInit, navigateOptions) => {\n const newSearchParams = createSearchParams(\n typeof nextInit === \"function\" ? nextInit(searchParams) : nextInit\n );\n navigate(\"?\" + newSearchParams, navigateOptions);\n },\n [navigate, searchParams]\n );\n\n return [searchParams, setSearchParams];\n}\n\ntype SetURLSearchParams = (\n nextInit?:\n | URLSearchParamsInit\n | ((prev: URLSearchParams) => URLSearchParamsInit),\n navigateOpts?: NavigateOptions\n) => void;\n\ntype SubmitTarget =\n | HTMLFormElement\n | HTMLButtonElement\n | HTMLInputElement\n | FormData\n | URLSearchParams\n | { [name: string]: string }\n | null;\n\n/**\n * Submits a HTML `<form>` to the server without reloading the page.\n */\nexport interface SubmitFunction {\n (\n /**\n * Specifies the `<form>` to be submitted to the server, a specific\n * `<button>` or `<input type=\"submit\">` to use to submit the form, or some\n * arbitrary data to submit.\n *\n * Note: When using a `<button>` its `name` and `value` will also be\n * included in the form data that is submitted.\n */\n target: SubmitTarget,\n\n /**\n * Options that override the `<form>`'s own attributes. Required when\n * submitting arbitrary data without a backing `<form>`.\n */\n options?: SubmitOptions\n ): void;\n}\n\n/**\n * Returns a function that may be used to programmatically submit a form (or\n * some arbitrary data) to the server.\n */\nexport function useSubmit(): SubmitFunction {\n return useSubmitImpl();\n}\n\nfunction useSubmitImpl(fetcherKey?: string, routeId?: string): SubmitFunction {\n let { router } = useDataRouterContext(DataRouterHook.UseSubmitImpl);\n let defaultAction = useFormAction();\n\n return React.useCallback(\n (target, options = {}) => {\n if (typeof document === \"undefined\") {\n throw new Error(\n \"You are calling submit during the server render. \" +\n \"Try calling submit within a `useEffect` or callback instead.\"\n );\n }\n\n let { method, encType, formData, url } = getFormSubmissionInfo(\n target,\n defaultAction,\n options\n );\n\n let href = url.pathname + url.search;\n let opts = {\n replace: options.replace,\n formData,\n formMethod: method as FormMethod,\n formEncType: encType as FormEncType,\n };\n if (fetcherKey) {\n invariant(routeId != null, \"No routeId available for useFetcher()\");\n router.fetch(fetcherKey, routeId, href, opts);\n } else {\n router.navigate(href, opts);\n }\n },\n [defaultAction, router, fetcherKey, routeId]\n );\n}\n\nexport function useFormAction(\n action?: string,\n { relative }: { relative?: RelativeRoutingType } = {}\n): string {\n let { basename } = React.useContext(NavigationContext);\n let routeContext = React.useContext(RouteContext);\n invariant(routeContext, \"useFormAction must be used inside a RouteContext\");\n\n let [match] = routeContext.matches.slice(-1);\n let resolvedAction = action ?? \".\";\n // Shallow clone path so we can modify it below, otherwise we modify the\n // object referenced by useMemo inside useResolvedPath\n let path = { ...useResolvedPath(resolvedAction, { relative }) };\n\n // Previously we set the default action to \".\". The problem with this is that\n // `useResolvedPath(\".\")` excludes search params and the hash of the resolved\n // URL. This is the intended behavior of when \".\" is specifically provided as\n // the form action, but inconsistent w/ browsers when the action is omitted.\n // https://github.com/remix-run/remix/issues/927\n let location = useLocation();\n if (action == null) {\n // Safe to write to these directly here since if action was undefined, we\n // would have called useResolvedPath(\".\") which will never include a search\n // or hash\n path.search = location.search;\n path.hash = location.hash;\n\n // When grabbing search params from the URL, remove the automatically\n // inserted ?index param so we match the useResolvedPath search behavior\n // which would not include ?index\n if (match.route.index) {\n let params = new URLSearchParams(path.search);\n params.delete(\"index\");\n path.search = params.toString() ? `?${params.toString()}` : \"\";\n }\n }\n\n if ((!action || action === \".\") && match.route.index) {\n path.search = path.search\n ? path.search.replace(/^\\?/, \"?index&\")\n : \"?index\";\n }\n\n // If we're operating within a basename, prepend it to the pathname prior\n // to creating the form action. If this is a root navigation, then just use\n // the raw basename which allows the basename to have full control over the\n // presence of a trailing slash on root actions\n if (basename !== \"/\") {\n path.pathname =\n path.pathname === \"/\" ? basename : joinPaths([basename, path.pathname]);\n }\n\n return createPath(path);\n}\n\nfunction createFetcherForm(fetcherKey: string, routeId: string) {\n let FetcherForm = React.forwardRef<HTMLFormElement, FormProps>(\n (props, ref) => {\n return (\n <FormImpl\n {...props}\n ref={ref}\n fetcherKey={fetcherKey}\n routeId={routeId}\n />\n );\n }\n );\n if (__DEV__) {\n FetcherForm.displayName = \"fetcher.Form\";\n }\n return FetcherForm;\n}\n\nlet fetcherId = 0;\n\nexport type FetcherWithComponents<TData> = Fetcher<TData> & {\n Form: ReturnType<typeof createFetcherForm>;\n submit: (\n target: SubmitTarget,\n // Fetchers cannot replace because they are not navigation events\n options?: Omit<SubmitOptions, \"replace\">\n ) => void;\n load: (href: string) => void;\n};\n\n/**\n * Interacts with route loaders and actions without causing a navigation. Great\n * for any interaction that stays on the same page.\n */\nexport function useFetcher<TData = any>(): FetcherWithComponents<TData> {\n let { router } = useDataRouterContext(DataRouterHook.UseFetcher);\n\n let route = React.useContext(RouteContext);\n invariant(route, `useFetcher must be used inside a RouteContext`);\n\n let routeId = route.matches[route.matches.length - 1]?.route.id;\n invariant(\n routeId != null,\n `useFetcher can only be used on routes that contain a unique \"id\"`\n );\n\n let [fetcherKey] = React.useState(() => String(++fetcherId));\n let [Form] = React.useState(() => {\n invariant(routeId, `No routeId available for fetcher.Form()`);\n return createFetcherForm(fetcherKey, routeId);\n });\n let [load] = React.useState(() => (href: string) => {\n invariant(router, \"No router available for fetcher.load()\");\n invariant(routeId, \"No routeId available for fetcher.load()\");\n router.fetch(fetcherKey, routeId, href);\n });\n let submit = useSubmitImpl(fetcherKey, routeId);\n\n let fetcher = router.getFetcher<TData>(fetcherKey);\n\n let fetcherWithComponents = React.useMemo(\n () => ({\n Form,\n submit,\n load,\n ...fetcher,\n }),\n [fetcher, Form, submit, load]\n );\n\n React.useEffect(() => {\n // Is this busted when the React team gets real weird and calls effects\n // twice on mount? We really just need to garbage collect here when this\n // fetcher is no longer around.\n return () => {\n if (!router) {\n console.warn(`No fetcher available to clean up from useFetcher()`);\n return;\n }\n router.deleteFetcher(fetcherKey);\n };\n }, [router, fetcherKey]);\n\n return fetcherWithComponents;\n}\n\n/**\n * Provides all fetchers currently on the page. Useful for layouts and parent\n * routes that need to provide pending/optimistic UI regarding the fetch.\n */\nexport function useFetchers(): Fetcher[] {\n let state = useDataRouterState(DataRouterStateHook.UseFetchers);\n return [...state.fetchers.values()];\n}\n\nconst SCROLL_RESTORATION_STORAGE_KEY = \"react-router-scroll-positions\";\nlet savedScrollPositions: Record<string, number> = {};\n\n/**\n * When rendered inside a RouterProvider, will restore scroll positions on navigations\n */\nfunction useScrollRestoration({\n getKey,\n storageKey,\n}: {\n getKey?: GetScrollRestorationKeyFunction;\n storageKey?: string;\n} = {}) {\n let { router } = useDataRouterContext(DataRouterHook.UseScrollRestoration);\n let { restoreScrollPosition, preventScrollReset } = useDataRouterState(\n DataRouterStateHook.UseScrollRestoration\n );\n let location = useLocation();\n let matches = useMatches();\n let navigation = useNavigation();\n\n // Trigger manual scroll restoration while we're active\n React.useEffect(() => {\n window.history.scrollRestoration = \"manual\";\n return () => {\n window.history.scrollRestoration = \"auto\";\n };\n }, []);\n\n // Save positions on unload\n useBeforeUnload(\n React.useCallback(() => {\n if (navigation.state === \"idle\") {\n let key = (getKey ? getKey(location, matches) : null) || location.key;\n savedScrollPositions[key] = window.scrollY;\n }\n sessionStorage.setItem(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY,\n JSON.stringify(savedScrollPositions)\n );\n window.history.scrollRestoration = \"auto\";\n }, [storageKey, getKey, navigation.state, location, matches])\n );\n\n // Read in any saved scroll locations\n React.useLayoutEffect(() => {\n try {\n let sessionPositions = sessionStorage.getItem(\n storageKey || SCROLL_RESTORATION_STORAGE_KEY\n );\n if (sessionPositions) {\n savedScrollPositions = JSON.parse(sessionPositions);\n }\n } catch (e) {\n // no-op, use default empty object\n }\n }, [storageKey]);\n\n // Enable scroll restoration in the router\n React.useLayoutEffect(() => {\n let disableScrollRestoration = router?.enableScrollRestoration(\n savedScrollPositions,\n () => window.scrollY,\n getKey\n );\n return () => disableScrollRestoration && disableScrollRestoration();\n }, [router, getKey]);\n\n // Restore scrolling when state.restoreScrollPosition changes\n React.useLayoutEffect(() => {\n // Explicit false means don't do anything (used for submissions)\n if (restoreScrollPosition === false) {\n return;\n }\n\n // been here before, scroll to it\n if (typeof restoreScrollPosition === \"number\") {\n window.scrollTo(0, restoreScrollPosition);\n return;\n }\n\n // try to scroll to the hash\n if (location.hash) {\n let el = document.getElementById(location.hash.slice(1));\n if (el) {\n el.scrollIntoView();\n return;\n }\n }\n\n // Opt out of scroll reset if this link requested it\n if (preventScrollReset === true) {\n return;\n }\n\n // otherwise go to the top on new locations\n window.scrollTo(0, 0);\n }, [location, restoreScrollPosition, preventScrollReset]);\n}\n\nfunction useBeforeUnload(callback: () => any): void {\n React.useEffect(() => {\n window.addEventListener(\"beforeunload\", callback);\n return () => {\n window.removeEventListener(\"beforeunload\", callback);\n };\n }, [callback]);\n}\n\n//#endregion\n\n////////////////////////////////////////////////////////////////////////////////\n//#region Utils\n////////////////////////////////////////////////////////////////////////////////\n\nfunction warning(cond: boolean, message: string): void {\n if (!cond) {\n // eslint-disable-next-line no-console\n if (typeof console !== \"undefined\") console.warn(message);\n\n try {\n // Welcome to debugging React Router!\n //\n // This error is thrown as a convenience so you can more easily\n // find the source for a warning that appears in the console by\n // enabling \"pause on exceptions\" in your JavaScript debugger.\n throw new Error(message);\n // eslint-disable-next-line no-empty\n } catch (e) {}\n }\n}\n//#endregion\n"],"names":["defaultMethod","defaultEncType","isHtmlElement","object","tagName","isButtonElement","toLowerCase","isFormElement","isInputElement","isModifiedEvent","event","metaKey","altKey","ctrlKey","shiftKey","shouldProcessLinkClick","target","button","createSearchParams","init","URLSearchParams","Array","isArray","Object","keys","reduce","memo","key","value","concat","map","v","getSearchParamsForLocation","locationSearch","defaultSearchParams","searchParams","has","getAll","forEach","append","getFormSubmissionInfo","defaultAction","options","method","action","encType","formData","submissionTrigger","getAttribute","FormData","name","type","form","Error","protocol","host","window","location","url","URL","createBrowserRouter","routes","opts","createRouter","basename","history","createBrowserHistory","hydrationData","__staticRouterHydrationData","enhanceManualRouteObjects","initialize","createHashRouter","createHashHistory","BrowserRouter","children","historyRef","React","useRef","current","v5Compat","state","setState","useState","useLayoutEffect","listen","HashRouter","HistoryRouter","displayName","Link","forwardRef","LinkWithRef","onClick","relative","reloadDocument","replace","to","preventScrollReset","rest","ref","href","useHref","internalOnClick","useLinkClickHandler","handleClick","defaultPrevented","NavLink","NavLinkWithRef","ariaCurrentProp","caseSensitive","className","classNameProp","end","style","styleProp","path","useResolvedPath","match","useMatch","pathname","routerState","useContext","DataRouterStateContext","nextLocation","navigation","nextPath","nextMatch","useMemo","matchPath","isPending","isActive","ariaCurrent","undefined","filter","Boolean","join","Form","props","FormImpl","onSubmit","fetcherKey","routeId","forwardedRef","submit","useSubmitImpl","formMethod","formAction","useFormAction","submitHandler","preventDefault","submitter","nativeEvent","currentTarget","ScrollRestoration","getKey","storageKey","useScrollRestoration","DataRouterHook","DataRouterStateHook","getDataRouterConsoleError","hookName","useDataRouterContext","ctx","DataRouterContext","invariant","useDataRouterState","replaceProp","navigate","useNavigate","useLocation","useCallback","createPath","useSearchParams","defaultInit","warning","defaultSearchParamsRef","search","setSearchParams","nextInit","navigateOptions","newSearchParams","useSubmit","router","UseSubmitImpl","document","formEncType","fetch","NavigationContext","routeContext","RouteContext","matches","slice","resolvedAction","hash","route","index","params","delete","toString","joinPaths","createFetcherForm","FetcherForm","fetcherId","useFetcher","UseFetcher","length","id","String","load","fetcher","getFetcher","fetcherWithComponents","useEffect","console","warn","deleteFetcher","useFetchers","UseFetchers","fetchers","values","SCROLL_RESTORATION_STORAGE_KEY","savedScrollPositions","UseScrollRestoration","restoreScrollPosition","useMatches","useNavigation","scrollRestoration","useBeforeUnload","scrollY","sessionStorage","setItem","JSON","stringify","sessionPositions","getItem","parse","e","disableScrollRestoration","enableScrollRestoration","scrollTo","el","getElementById","scrollIntoView","callback","addEventListener","removeEventListener","cond","message"],"mappings":";;;;;;;;;;;;;;;AAGO,MAAMA,aAAa,GAAG,KAAtB,CAAA;AACP,MAAMC,cAAc,GAAG,mCAAvB,CAAA;AAEO,SAASC,aAAT,CAAuBC,MAAvB,EAA2D;EAChE,OAAOA,MAAM,IAAI,IAAV,IAAkB,OAAOA,MAAM,CAACC,OAAd,KAA0B,QAAnD,CAAA;AACD,CAAA;AAEM,SAASC,eAAT,CAAyBF,MAAzB,EAAmE;EACxE,OAAOD,aAAa,CAACC,MAAD,CAAb,IAAyBA,MAAM,CAACC,OAAP,CAAeE,WAAf,EAAA,KAAiC,QAAjE,CAAA;AACD,CAAA;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 +1,5 @@
1
1
  /**
2
- * React Router DOM v6.4.1-pre.0
2
+ * React Router DOM v6.4.2-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -8,5 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import*as e from"react";import{UNSAFE_enhanceManualRouteObjects as t,Router as r,useHref as n,createPath as a,useResolvedPath as o,useMatch as i,UNSAFE_DataRouterStateContext as u,useNavigate as s,useLocation as l,UNSAFE_DataRouterContext as c,UNSAFE_RouteContext as f,useMatches as m,useNavigation as d}from"react-router";export{AbortedDeferredError,Await,MemoryRouter,Navigate,NavigationType,Outlet,Route,Router,RouterProvider,Routes,UNSAFE_DataRouterContext,UNSAFE_DataRouterStateContext,UNSAFE_DataStaticRouterContext,UNSAFE_LocationContext,UNSAFE_NavigationContext,UNSAFE_RouteContext,UNSAFE_enhanceManualRouteObjects,createMemoryRouter,createPath,createRoutesFromChildren,createRoutesFromElements,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,renderMatches,resolvePath,useActionData,useAsyncError,useAsyncValue,useHref,useInRouterContext,useLoaderData,useLocation,useMatch,useMatches,useNavigate,useNavigation,useNavigationType,useOutlet,useOutletContext,useParams,useResolvedPath,useRevalidator,useRouteError,useRouteLoaderData,useRoutes}from"react-router";import{createRouter as h,createBrowserHistory as p,createHashHistory as g,matchPath as y,invariant as w}from"@remix-run/router";const v="application/x-www-form-urlencoded";function b(e){return null!=e&&"string"==typeof e.tagName}function R(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}function E(e,t,r){let n,a,o,i;if(b(u=e)&&"form"===u.tagName.toLowerCase()){let u=r.submissionTrigger;n=r.method||e.getAttribute("method")||"get",a=r.action||e.getAttribute("action")||t,o=r.encType||e.getAttribute("enctype")||v,i=new FormData(e),u&&u.name&&i.append(u.name,u.value)}else if(function(e){return b(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return b(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let u=e.form;if(null==u)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');n=r.method||e.getAttribute("formmethod")||u.getAttribute("method")||"get",a=r.action||e.getAttribute("formaction")||u.getAttribute("action")||t,o=r.encType||e.getAttribute("formenctype")||u.getAttribute("enctype")||v,i=new FormData(u),e.name&&i.append(e.name,e.value)}else{if(b(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');if(n=r.method||"get",a=r.action||t,o=r.encType||v,e instanceof FormData)i=e;else if(i=new FormData,e instanceof URLSearchParams)for(let[t,r]of e)i.append(t,r);else if(null!=e)for(let t of Object.keys(e))i.append(t,e[t])}var u;let{protocol:s,host:l}=window.location;return{url:new URL(a,`${s}//${l}`),method:n,encType:o,formData:i}}function S(e,r){return h({basename:r?.basename,history:p({window:r?.window}),hydrationData:r?.hydrationData||window?.__staticRouterHydrationData,routes:t(e)}).initialize()}function C(e,r){return h({basename:r?.basename,history:g({window:r?.window}),hydrationData:r?.hydrationData||window?.__staticRouterHydrationData,routes:t(e)}).initialize()}function A({basename:t,children:n,window:a}){let o=e.useRef();null==o.current&&(o.current=p({window:a,v5Compat:!0}));let i=o.current,[u,s]=e.useState({action:i.action,location:i.location});return e.useLayoutEffect((()=>i.listen(s)),[i]),e.createElement(r,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:i})}function x({basename:t,children:n,window:a}){let o=e.useRef();null==o.current&&(o.current=g({window:a,v5Compat:!0}));let i=o.current,[u,s]=e.useState({action:i.action,location:i.location});return e.useLayoutEffect((()=>i.listen(s)),[i]),e.createElement(r,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:i})}function D({basename:t,children:n,history:a}){const[o,i]=e.useState({action:a.action,location:a.location});return e.useLayoutEffect((()=>a.listen(i)),[a]),e.createElement(r,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:a})}const N=e.forwardRef((function({onClick:t,relative:r,reloadDocument:a,replace:o,state:i,target:u,to:s,preventScrollReset:l,...c},f){let m=n(s,{relative:r}),d=O(s,{replace:o,state:i,target:u,preventScrollReset:l,relative:r});return e.createElement("a",Object.assign({},c,{href:m,onClick:a?t:function(e){t&&t(e),e.defaultPrevented||d(e)},ref:f,target:u}))})),L=e.forwardRef((function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:s,to:l,children:c,...f},m){let d,h=o(l),p=i({path:h.pathname,end:a,caseSensitive:r}),g=e.useContext(u)?.navigation.location,w=o(g||""),v=null!=e.useMemo((()=>g?y({path:h.pathname,end:a,caseSensitive:r},w.pathname):null),[g,h.pathname,r,a,w.pathname]),b=null!=p,R=b?t:void 0;d="function"==typeof n?n({isActive:b,isPending:v}):[n,b?"active":null,v?"pending":null].filter(Boolean).join(" ");let E="function"==typeof s?s({isActive:b,isPending:v}):s;return e.createElement(N,Object.assign({},f,{"aria-current":R,className:d,ref:m,style:E,to:l}),"function"==typeof c?c({isActive:b,isPending:v}):c)})),P=e.forwardRef(((t,r)=>e.createElement(F,Object.assign({},t,{ref:r})))),F=e.forwardRef((({reloadDocument:t,replace:r,method:n="get",action:a,onSubmit:o,fetcherKey:i,routeId:u,relative:s,...l},c)=>{let f=U(i,u),m="get"===n.toLowerCase()?"get":"post",d=k(a,{relative:s});return e.createElement("form",Object.assign({ref:c,method:m,action:d,onSubmit:t?o:e=>{if(o&&o(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter;f(t||e.currentTarget,{method:n,replace:r,relative:s})}},l))}));function T({getKey:t,storageKey:r}){return function({getKey:t,storageKey:r}={}){let n=l(),a=m(),o=d(),i=e.useContext(c);i||w(!1);let{router:s}=i,f=e.useContext(u);(null==s||null==f)&&w(!1);let{restoreScrollPosition:h,preventScrollReset:p}=f;e.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),g=e.useCallback((()=>{if("idle"===o.state){let e=(t?t(n,a):null)||n.key;H[e]=window.scrollY}sessionStorage.setItem(r||"react-router-scroll-positions",JSON.stringify(H)),window.history.scrollRestoration="auto"}),[r,t,o.state,n,a]),e.useEffect((()=>(window.addEventListener("beforeunload",g),()=>{window.removeEventListener("beforeunload",g)})),[g]),e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||"react-router-scroll-positions");e&&(H=JSON.parse(e))}catch(e){}}),[r]),e.useLayoutEffect((()=>{let e=s?.enableScrollRestoration(H,(()=>window.scrollY),t);return()=>e&&e()}),[s,t]),e.useLayoutEffect((()=>{if(!1!==h)if("number"!=typeof h){if(n.hash){let e=document.getElementById(n.hash.slice(1));if(e)return void e.scrollIntoView()}!0!==p&&window.scrollTo(0,0)}else window.scrollTo(0,h)}),[n,h,p]);var g}({getKey:t,storageKey:r}),null}function O(t,{target:r,replace:n,state:i,preventScrollReset:u,relative:c}={}){let f=s(),m=l(),d=o(t,{relative:c});return e.useCallback((e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,r)){e.preventDefault();let r=void 0!==n?n:a(m)===a(d);f(t,{replace:r,state:i,preventScrollReset:u,relative:c})}}),[m,f,d,n,i,r,t,u,c])}function _(t){let r=e.useRef(R(t)),n=l(),a=e.useMemo((()=>function(e,t){let r=R(e);for(let n of t.keys())r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}));return r}(n.search,r.current)),[n.search]),o=s(),i=e.useCallback(((e,t)=>{const r=R("function"==typeof e?e(a):e);o("?"+r,t)}),[o,a]);return[a,i]}function K(){return U()}function U(t,r){let n=e.useContext(c);n||w(!1);let{router:a}=n,o=k();return e.useCallback(((e,n={})=>{if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{method:i,encType:u,formData:s,url:l}=E(e,o,n),c=l.pathname+l.search,f={replace:n.replace,formData:s,formMethod:i,formEncType:u};t?(null==r&&w(!1),a.fetch(t,r,c,f)):a.navigate(c,f)}),[o,a,t,r])}function k(t,{relative:r}={}){let n=e.useContext(f);n||w(!1);let[i]=n.matches.slice(-1),u=o(t??".",{relative:r}),s=l();if(null==t&&(u.search=s.search,u.hash=s.hash,i.route.index)){let e=new URLSearchParams(u.search);e.delete("index"),u.search=e.toString()?`?${e.toString()}`:""}return t&&"."!==t||!i.route.index||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),a(u)}let j=0;function M(){let t=e.useContext(c);t||w(!1);let{router:r}=t,n=e.useContext(f);n||w(!1);let a=n.matches[n.matches.length-1]?.route.id;null==a&&w(!1);let[o]=e.useState((()=>String(++j))),[i]=e.useState((()=>(a||w(!1),function(t,r){return e.forwardRef(((n,a)=>e.createElement(F,Object.assign({},n,{ref:a,fetcherKey:t,routeId:r}))))}(o,a)))),[u]=e.useState((()=>e=>{r||w(!1),a||w(!1),r.fetch(o,a,e)})),s=U(o,a),l=r.getFetcher(o),m=e.useMemo((()=>({Form:i,submit:s,load:u,...l})),[l,i,s,u]);return e.useEffect((()=>()=>{r?r.deleteFetcher(o):console.warn("No fetcher available to clean up from useFetcher()")}),[r,o]),m}function I(){let t=e.useContext(u);return t||w(!1),[...t.fetchers.values()]}let H={};export{A as BrowserRouter,P as Form,x as HashRouter,N as Link,L as NavLink,T as ScrollRestoration,S as createBrowserRouter,C as createHashRouter,R as createSearchParams,D as unstable_HistoryRouter,M as useFetcher,I as useFetchers,k as useFormAction,O as useLinkClickHandler,_ as useSearchParams,K as useSubmit};
11
+ import*as e from"react";import{UNSAFE_enhanceManualRouteObjects as t,Router as r,useHref as n,createPath as o,useResolvedPath as a,useMatch as i,UNSAFE_DataRouterStateContext as s,useNavigate as u,useLocation as c,UNSAFE_NavigationContext as l,UNSAFE_RouteContext as f,useMatches as m,useNavigation as d,UNSAFE_DataRouterContext as h}from"react-router";export{AbortedDeferredError,Await,MemoryRouter,Navigate,NavigationType,Outlet,Route,Router,RouterProvider,Routes,UNSAFE_DataRouterContext,UNSAFE_DataRouterStateContext,UNSAFE_DataStaticRouterContext,UNSAFE_LocationContext,UNSAFE_NavigationContext,UNSAFE_RouteContext,UNSAFE_enhanceManualRouteObjects,createMemoryRouter,createPath,createRoutesFromChildren,createRoutesFromElements,defer,generatePath,isRouteErrorResponse,json,matchPath,matchRoutes,parsePath,redirect,renderMatches,resolvePath,useActionData,useAsyncError,useAsyncValue,useHref,useInRouterContext,useLoaderData,useLocation,useMatch,useMatches,useNavigate,useNavigation,useNavigationType,useOutlet,useOutletContext,useParams,useResolvedPath,useRevalidator,useRouteError,useRouteLoaderData,useRoutes}from"react-router";import{createRouter as p,createBrowserHistory as g,createHashHistory as y,matchPath as w,invariant as v,joinPaths as b}from"@remix-run/router";const R="application/x-www-form-urlencoded";function S(e){return null!=e&&"string"==typeof e.tagName}function E(e=""){return new URLSearchParams("string"==typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce(((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map((e=>[r,e])):[[r,n]])}),[]))}function A(e,t,r){let n,o,a,i;if(S(s=e)&&"form"===s.tagName.toLowerCase()){let s=r.submissionTrigger;n=r.method||e.getAttribute("method")||"get",o=r.action||e.getAttribute("action")||t,a=r.encType||e.getAttribute("enctype")||R,i=new FormData(e),s&&s.name&&i.append(s.name,s.value)}else if(function(e){return S(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return S(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let s=e.form;if(null==s)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');n=r.method||e.getAttribute("formmethod")||s.getAttribute("method")||"get",o=r.action||e.getAttribute("formaction")||s.getAttribute("action")||t,a=r.encType||e.getAttribute("formenctype")||s.getAttribute("enctype")||R,i=new FormData(s),e.name&&i.append(e.name,e.value)}else{if(S(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');if(n=r.method||"get",o=r.action||t,a=r.encType||R,e instanceof FormData)i=e;else if(i=new FormData,e instanceof URLSearchParams)for(let[t,r]of e)i.append(t,r);else if(null!=e)for(let t of Object.keys(e))i.append(t,e[t])}var s;let{protocol:u,host:c}=window.location;return{url:new URL(o,`${u}//${c}`),method:n,encType:a,formData:i}}function C(e,r){return p({basename:r?.basename,history:g({window:r?.window}),hydrationData:r?.hydrationData||window?.__staticRouterHydrationData,routes:t(e)}).initialize()}function D(e,r){return p({basename:r?.basename,history:y({window:r?.window}),hydrationData:r?.hydrationData||window?.__staticRouterHydrationData,routes:t(e)}).initialize()}function x({basename:t,children:n,window:o}){let a=e.useRef();null==a.current&&(a.current=g({window:o,v5Compat:!0}));let i=a.current,[s,u]=e.useState({action:i.action,location:i.location});return e.useLayoutEffect((()=>i.listen(u)),[i]),e.createElement(r,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:i})}function F({basename:t,children:n,window:o}){let a=e.useRef();null==a.current&&(a.current=y({window:o,v5Compat:!0}));let i=a.current,[s,u]=e.useState({action:i.action,location:i.location});return e.useLayoutEffect((()=>i.listen(u)),[i]),e.createElement(r,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:i})}function N({basename:t,children:n,history:o}){const[a,i]=e.useState({action:o.action,location:o.location});return e.useLayoutEffect((()=>o.listen(i)),[o]),e.createElement(r,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o})}const U=e.forwardRef((function({onClick:t,relative:r,reloadDocument:o,replace:a,state:i,target:s,to:u,preventScrollReset:c,...l},f){let m=n(u,{relative:r}),d=I(u,{replace:a,state:i,target:s,preventScrollReset:c,relative:r});return e.createElement("a",Object.assign({},l,{href:m,onClick:o?t:function(e){t&&t(e),e.defaultPrevented||d(e)},ref:f,target:s}))})),L=e.forwardRef((function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:u,to:c,children:l,...f},m){let d,h=a(c),p=i({path:h.pathname,end:o,caseSensitive:r}),g=e.useContext(s)?.navigation.location,y=a(g||""),v=null!=e.useMemo((()=>g?w({path:h.pathname,end:o,caseSensitive:r},y.pathname):null),[g,h.pathname,r,o,y.pathname]),b=null!=p,R=b?t:void 0;d="function"==typeof n?n({isActive:b,isPending:v}):[n,b?"active":null,v?"pending":null].filter(Boolean).join(" ");let S="function"==typeof u?u({isActive:b,isPending:v}):u;return e.createElement(U,Object.assign({},f,{"aria-current":R,className:d,ref:m,style:S,to:c}),"function"==typeof l?l({isActive:b,isPending:v}):l)})),P=e.forwardRef(((t,r)=>e.createElement(T,Object.assign({},t,{ref:r})))),T=e.forwardRef((({reloadDocument:t,replace:r,method:n="get",action:o,onSubmit:a,fetcherKey:i,routeId:s,relative:u,...c},l)=>{let f=Y(i,s),m="get"===n.toLowerCase()?"get":"post",d=$(o,{relative:u});return e.createElement("form",Object.assign({ref:l,method:m,action:d,onSubmit:t?a:e=>{if(a&&a(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter;f(t||e.currentTarget,{method:n,replace:r,relative:u})}},c))}));function O({getKey:t,storageKey:r}){return function({getKey:t,storageKey:r}={}){let{router:n}=k(_.UseScrollRestoration),{restoreScrollPosition:o,preventScrollReset:a}=j(K.UseScrollRestoration),i=c(),s=m(),u=d();e.useEffect((()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"})),[]),l=e.useCallback((()=>{if("idle"===u.state){let e=(t?t(i,s):null)||i.key;V[e]=window.scrollY}sessionStorage.setItem(r||"react-router-scroll-positions",JSON.stringify(V)),window.history.scrollRestoration="auto"}),[r,t,u.state,i,s]),e.useEffect((()=>(window.addEventListener("beforeunload",l),()=>{window.removeEventListener("beforeunload",l)})),[l]),e.useLayoutEffect((()=>{try{let e=sessionStorage.getItem(r||"react-router-scroll-positions");e&&(V=JSON.parse(e))}catch(e){}}),[r]),e.useLayoutEffect((()=>{let e=n?.enableScrollRestoration(V,(()=>window.scrollY),t);return()=>e&&e()}),[n,t]),e.useLayoutEffect((()=>{if(!1!==o)if("number"!=typeof o){if(i.hash){let e=document.getElementById(i.hash.slice(1));if(e)return void e.scrollIntoView()}!0!==a&&window.scrollTo(0,0)}else window.scrollTo(0,o)}),[i,o,a]);var l}({getKey:t,storageKey:r}),null}var _,K;function k(t){let r=e.useContext(h);return r||v(!1),r}function j(t){let r=e.useContext(s);return r||v(!1),r}function I(t,{target:r,replace:n,state:i,preventScrollReset:s,relative:l}={}){let f=u(),m=c(),d=a(t,{relative:l});return e.useCallback((e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,r)){e.preventDefault();let r=void 0!==n?n:o(m)===o(d);f(t,{replace:r,state:i,preventScrollReset:s,relative:l})}}),[m,f,d,n,i,r,t,s,l])}function M(t){let r=e.useRef(E(t)),n=c(),o=e.useMemo((()=>function(e,t){let r=E(e);for(let n of t.keys())r.has(n)||t.getAll(n).forEach((e=>{r.append(n,e)}));return r}(n.search,r.current)),[n.search]),a=u(),i=e.useCallback(((e,t)=>{const r=E("function"==typeof e?e(o):e);a("?"+r,t)}),[a,o]);return[o,i]}function H(){return Y()}function Y(t,r){let{router:n}=k(_.UseSubmitImpl),o=$();return e.useCallback(((e,a={})=>{if("undefined"==typeof document)throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.");let{method:i,encType:s,formData:u,url:c}=A(e,o,a),l=c.pathname+c.search,f={replace:a.replace,formData:u,formMethod:i,formEncType:s};t?(null==r&&v(!1),n.fetch(t,r,l,f)):n.navigate(l,f)}),[o,n,t,r])}function $(t,{relative:r}={}){let{basename:n}=e.useContext(l),i=e.useContext(f);i||v(!1);let[s]=i.matches.slice(-1),u={...a(t??".",{relative:r})},m=c();if(null==t&&(u.search=m.search,u.hash=m.hash,s.route.index)){let e=new URLSearchParams(u.search);e.delete("index"),u.search=e.toString()?`?${e.toString()}`:""}return t&&"."!==t||!s.route.index||(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),"/"!==n&&(u.pathname="/"===u.pathname?n:b([n,u.pathname])),o(u)}!function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"}(_||(_={})),function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(K||(K={}));let z=0;function B(){let{router:t}=k(_.UseFetcher),r=e.useContext(f);r||v(!1);let n=r.matches[r.matches.length-1]?.route.id;null==n&&v(!1);let[o]=e.useState((()=>String(++z))),[a]=e.useState((()=>(n||v(!1),function(t,r){return e.forwardRef(((n,o)=>e.createElement(T,Object.assign({},n,{ref:o,fetcherKey:t,routeId:r}))))}(o,n)))),[i]=e.useState((()=>e=>{t||v(!1),n||v(!1),t.fetch(o,n,e)})),s=Y(o,n),u=t.getFetcher(o),c=e.useMemo((()=>({Form:a,submit:s,load:i,...u})),[u,a,s,i]);return e.useEffect((()=>()=>{t?t.deleteFetcher(o):console.warn("No fetcher available to clean up from useFetcher()")}),[t,o]),c}function J(){return[...j(K.UseFetchers).fetchers.values()]}let V={};export{x as BrowserRouter,P as Form,F as HashRouter,U as Link,L as NavLink,O as ScrollRestoration,C as createBrowserRouter,D as createHashRouter,E as createSearchParams,N as unstable_HistoryRouter,B as useFetcher,J as useFetchers,$ as useFormAction,I as useLinkClickHandler,M as useSearchParams,H as useSubmit};
12
12
  //# sourceMappingURL=react-router-dom.production.min.js.map