Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/.vite/deps/react-router-dom.js

    rd565449 r0c6b92a  
    11import {
    22  require_react_dom
    3 } from "./chunk-6VWAHX6D.js";
     3} from "./chunk-GKJBSOWT.js";
    44import {
    55  require_react
     
    10771077  let inFlightDataRoutes;
    10781078  let basename = init.basename || "/";
    1079   let dataStrategyImpl = init.unstable_dataStrategy || defaultDataStrategy;
    1080   let patchRoutesOnMissImpl = init.unstable_patchRoutesOnMiss;
     1079  let dataStrategyImpl = init.dataStrategy || defaultDataStrategy;
     1080  let patchRoutesOnNavigationImpl = init.patchRoutesOnNavigation;
    10811081  let future = _extends({
    10821082    v7_fetcherPersist: false,
     
    10951095  let initialMatches = matchRoutes(dataRoutes, init.history.location, basename);
    10961096  let initialErrors = null;
    1097   if (initialMatches == null && !patchRoutesOnMissImpl) {
     1097  if (initialMatches == null && !patchRoutesOnNavigationImpl) {
    10981098    let error = getInternalRouterError(404, {
    10991099      pathname: init.history.location.pathname
     
    11311131    let loaderData = init.hydrationData ? init.hydrationData.loaderData : null;
    11321132    let errors = init.hydrationData ? init.hydrationData.errors : null;
    1133     let isRouteInitialized = (m) => {
    1134       if (!m.route.loader) {
    1135         return true;
    1136       }
    1137       if (typeof m.route.loader === "function" && m.route.loader.hydrate === true) {
    1138         return false;
    1139       }
    1140       return loaderData && loaderData[m.route.id] !== void 0 || errors && errors[m.route.id] !== void 0;
    1141     };
    11421133    if (errors) {
    11431134      let idx = initialMatches.findIndex((m) => errors[m.route.id] !== void 0);
    1144       initialized = initialMatches.slice(0, idx + 1).every(isRouteInitialized);
     1135      initialized = initialMatches.slice(0, idx + 1).every((m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors));
    11451136    } else {
    1146       initialized = initialMatches.every(isRouteInitialized);
     1137      initialized = initialMatches.every((m) => !shouldLoadRouteOnHydration(m.route, loaderData, errors));
    11471138    }
    11481139  } else {
     
    11861177  let activeDeferreds = /* @__PURE__ */ new Map();
    11871178  let blockerFunctions = /* @__PURE__ */ new Map();
    1188   let pendingPatchRoutes = /* @__PURE__ */ new Map();
    1189   let ignoreNextHistoryUpdate = false;
     1179  let unblockBlockerHistoryUpdate = void 0;
    11901180  function initialize() {
    11911181    unlistenHistory = init.history.listen((_ref) => {
     
    11951185        delta
    11961186      } = _ref;
    1197       if (ignoreNextHistoryUpdate) {
    1198         ignoreNextHistoryUpdate = false;
     1187      if (unblockBlockerHistoryUpdate) {
     1188        unblockBlockerHistoryUpdate();
     1189        unblockBlockerHistoryUpdate = void 0;
    11991190        return;
    12001191      }
     
    12061197      });
    12071198      if (blockerKey && delta != null) {
    1208         ignoreNextHistoryUpdate = true;
     1199        let nextHistoryUpdatePromise = new Promise((resolve) => {
     1200          unblockBlockerHistoryUpdate = resolve;
     1201        });
    12091202        init.history.go(delta * -1);
    12101203        updateBlocker(blockerKey, {
     
    12181211              location
    12191212            });
    1220             init.history.go(delta);
     1213            nextHistoryUpdatePromise.then(() => init.history.go(delta));
    12211214          },
    12221215          reset() {
     
    12811274    [...subscribers].forEach((subscriber) => subscriber(state, {
    12821275      deletedFetchers: deletedFetchersKeys,
    1283       unstable_viewTransitionOpts: opts.viewTransitionOpts,
    1284       unstable_flushSync: opts.flushSync === true
     1276      viewTransitionOpts: opts.viewTransitionOpts,
     1277      flushSync: opts.flushSync === true
    12851278    }));
    12861279    if (future.v7_fetcherPersist) {
     
    13971390    }
    13981391    let preventScrollReset = opts && "preventScrollReset" in opts ? opts.preventScrollReset === true : void 0;
    1399     let flushSync = (opts && opts.unstable_flushSync) === true;
     1392    let flushSync = (opts && opts.flushSync) === true;
    14001393    let blockerKey = shouldBlockNavigation({
    14011394      currentLocation,
     
    14331426      preventScrollReset,
    14341427      replace: opts && opts.replace,
    1435       enableViewTransition: opts && opts.unstable_viewTransition,
     1428      enableViewTransition: opts && opts.viewTransition,
    14361429      flushSync
    14371430    });
     
    14521445    }
    14531446    startNavigation(pendingAction || state.historyAction, state.navigation.location, {
    1454       overrideNavigation: state.navigation
     1447      overrideNavigation: state.navigation,
     1448      // Proxy through any rending view transition
     1449      enableViewTransition: pendingViewTransitionEnabled === true
    14551450    });
    14561451  }
     
    15681563        };
    15691564      } else if (discoverResult.type === "error") {
    1570         let {
    1571           boundaryId,
    1572           error
    1573         } = handleDiscoverRouteError(location.pathname, discoverResult);
     1565        let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;
    15741566        return {
    15751567          matches: discoverResult.partialMatches,
    15761568          pendingActionResult: [boundaryId, {
    15771569            type: ResultType.error,
    1578             error
     1570            error: discoverResult.error
    15791571          }]
    15801572        };
     
    16081600      };
    16091601    } else {
    1610       let results = await callDataStrategy("action", request, [actionMatch], matches);
    1611       result = results[0];
     1602      let results = await callDataStrategy("action", state, request, [actionMatch], matches, null);
     1603      result = results[actionMatch.route.id];
    16121604      if (request.signal.aborted) {
    16131605        return {
     
    16241616        replace2 = location2 === state.location.pathname + state.location.search;
    16251617      }
    1626       await startRedirectNavigation(request, result, {
     1618      await startRedirectNavigation(request, result, true, {
    16271619        submission,
    16281620        replace: replace2
     
    16731665        };
    16741666      } else if (discoverResult.type === "error") {
    1675         let {
    1676           boundaryId,
    1677           error
    1678         } = handleDiscoverRouteError(location.pathname, discoverResult);
     1667        let boundaryId = findNearestBoundary(discoverResult.partialMatches).route.id;
    16791668        return {
    16801669          matches: discoverResult.partialMatches,
    16811670          loaderData: {},
    16821671          errors: {
    1683             [boundaryId]: error
     1672            [boundaryId]: discoverResult.error
    16841673          }
    16851674        };
     
    17401729    }
    17411730    revalidatingFetchers.forEach((rf) => {
    1742       if (fetchControllers.has(rf.key)) {
    1743         abortFetcher(rf.key);
    1744       }
     1731      abortFetcher(rf.key);
    17451732      if (rf.controller) {
    17461733        fetchControllers.set(rf.key, rf.controller);
     
    17541741      loaderResults,
    17551742      fetcherResults
    1756     } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, request);
     1743    } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, request);
    17571744    if (request.signal.aborted) {
    17581745      return {
     
    17641751    }
    17651752    revalidatingFetchers.forEach((rf) => fetchControllers.delete(rf.key));
    1766     let redirect3 = findRedirect([...loaderResults, ...fetcherResults]);
     1753    let redirect3 = findRedirect(loaderResults);
    17671754    if (redirect3) {
    1768       if (redirect3.idx >= matchesToLoad.length) {
    1769         let fetcherKey = revalidatingFetchers[redirect3.idx - matchesToLoad.length].key;
    1770         fetchRedirectIds.add(fetcherKey);
    1771       }
    1772       await startRedirectNavigation(request, redirect3.result, {
     1755      await startRedirectNavigation(request, redirect3.result, true, {
    17731756        replace: replace2
    17741757      });
     
    17771760      };
    17781761    }
     1762    redirect3 = findRedirect(fetcherResults);
     1763    if (redirect3) {
     1764      fetchRedirectIds.add(redirect3.key);
     1765      await startRedirectNavigation(request, redirect3.result, true, {
     1766        replace: replace2
     1767      });
     1768      return {
     1769        shortCircuited: true
     1770      };
     1771    }
    17791772    let {
    17801773      loaderData,
    17811774      errors
    1782     } = processLoaderData(state, matches, matchesToLoad, loaderResults, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds);
     1775    } = processLoaderData(state, matches, loaderResults, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds);
    17831776    activeDeferreds.forEach((deferredData, routeId) => {
    17841777      deferredData.subscribe((aborted) => {
     
    17891782    });
    17901783    if (future.v7_partialHydration && initialHydration && state.errors) {
    1791       Object.entries(state.errors).filter((_ref2) => {
    1792         let [id] = _ref2;
    1793         return !matchesToLoad.some((m) => m.route.id === id);
    1794       }).forEach((_ref3) => {
    1795         let [routeId, error] = _ref3;
    1796         errors = Object.assign(errors || {}, {
    1797           [routeId]: error
    1798         });
    1799       });
     1784      errors = _extends({}, state.errors, errors);
    18001785    }
    18011786    let updatedFetchers = markFetchRedirectsDone();
     
    18351820      throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");
    18361821    }
    1837     if (fetchControllers.has(key)) abortFetcher(key);
    1838     let flushSync = (opts && opts.unstable_flushSync) === true;
     1822    abortFetcher(key);
     1823    let flushSync = (opts && opts.flushSync) === true;
    18391824    let routesToUse = inFlightDataRoutes || dataRoutes;
    18401825    let normalizedPath = normalizeTo(state.location, state.matches, basename, future.v7_prependBasename, href, future.v7_relativeSplatPath, routeId, opts == null ? void 0 : opts.relative);
     
    18641849    }
    18651850    let match = getTargetMatch(matches, path);
    1866     pendingPreventScrollReset = (opts && opts.preventScrollReset) === true;
     1851    let preventScrollReset = (opts && opts.preventScrollReset) === true;
    18671852    if (submission && isMutationMethod(submission.formMethod)) {
    1868       handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, submission);
     1853      handleFetcherAction(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);
    18691854      return;
    18701855    }
     
    18731858      path
    18741859    });
    1875     handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, submission);
    1876   }
    1877   async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, submission) {
     1860    handleFetcherLoader(key, routeId, path, match, matches, fogOfWar.active, flushSync, preventScrollReset, submission);
     1861  }
     1862  async function handleFetcherAction(key, routeId, path, match, requestMatches, isFogOfWar, flushSync, preventScrollReset, submission) {
    18781863    interruptActiveLoads();
    18791864    fetchLoadMatches.delete(key);
     
    19061891        return;
    19071892      } else if (discoverResult.type === "error") {
    1908         let {
    1909           error
    1910         } = handleDiscoverRouteError(path, discoverResult);
    1911         setFetcherError(key, routeId, error, {
     1893        setFetcherError(key, routeId, discoverResult.error, {
    19121894          flushSync
    19131895        });
     
    19301912    fetchControllers.set(key, abortController);
    19311913    let originatingLoadId = incrementingLoadId;
    1932     let actionResults = await callDataStrategy("action", fetchRequest, [match], requestMatches);
    1933     let actionResult = actionResults[0];
     1914    let actionResults = await callDataStrategy("action", state, fetchRequest, [match], requestMatches, key);
     1915    let actionResult = actionResults[match.route.id];
    19341916    if (fetchRequest.signal.aborted) {
    19351917      if (fetchControllers.get(key) === abortController) {
     
    19521934          fetchRedirectIds.add(key);
    19531935          updateFetcherState(key, getLoadingFetcher(submission));
    1954           return startRedirectNavigation(fetchRequest, actionResult, {
    1955             fetcherSubmission: submission
     1936          return startRedirectNavigation(fetchRequest, actionResult, false, {
     1937            fetcherSubmission: submission,
     1938            preventScrollReset
    19561939          });
    19571940        }
     
    19821965      let revalidatingFetcher = getLoadingFetcher(void 0, existingFetcher2 ? existingFetcher2.data : void 0);
    19831966      state.fetchers.set(staleKey, revalidatingFetcher);
    1984       if (fetchControllers.has(staleKey)) {
    1985         abortFetcher(staleKey);
    1986       }
     1967      abortFetcher(staleKey);
    19871968      if (rf.controller) {
    19881969        fetchControllers.set(staleKey, rf.controller);
     
    19971978      loaderResults,
    19981979      fetcherResults
    1999     } = await callLoadersAndMaybeResolveData(state.matches, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);
     1980    } = await callLoadersAndMaybeResolveData(state, matches, matchesToLoad, revalidatingFetchers, revalidationRequest);
    20001981    if (abortController.signal.aborted) {
    20011982      return;
     
    20051986    fetchControllers.delete(key);
    20061987    revalidatingFetchers.forEach((r) => fetchControllers.delete(r.key));
    2007     let redirect3 = findRedirect([...loaderResults, ...fetcherResults]);
     1988    let redirect3 = findRedirect(loaderResults);
    20081989    if (redirect3) {
    2009       if (redirect3.idx >= matchesToLoad.length) {
    2010         let fetcherKey = revalidatingFetchers[redirect3.idx - matchesToLoad.length].key;
    2011         fetchRedirectIds.add(fetcherKey);
    2012       }
    2013       return startRedirectNavigation(revalidationRequest, redirect3.result);
     1990      return startRedirectNavigation(revalidationRequest, redirect3.result, false, {
     1991        preventScrollReset
     1992      });
     1993    }
     1994    redirect3 = findRedirect(fetcherResults);
     1995    if (redirect3) {
     1996      fetchRedirectIds.add(redirect3.key);
     1997      return startRedirectNavigation(revalidationRequest, redirect3.result, false, {
     1998        preventScrollReset
     1999      });
    20142000    }
    20152001    let {
    20162002      loaderData,
    20172003      errors
    2018     } = processLoaderData(state, state.matches, matchesToLoad, loaderResults, void 0, revalidatingFetchers, fetcherResults, activeDeferreds);
     2004    } = processLoaderData(state, matches, loaderResults, void 0, revalidatingFetchers, fetcherResults, activeDeferreds);
    20192005    if (state.fetchers.has(key)) {
    20202006      let doneFetcher = getDoneFetcher(actionResult.data);
     
    20402026    }
    20412027  }
    2042   async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, submission) {
     2028  async function handleFetcherLoader(key, routeId, path, match, matches, isFogOfWar, flushSync, preventScrollReset, submission) {
    20432029    let existingFetcher = state.fetchers.get(key);
    20442030    updateFetcherState(key, getLoadingFetcher(submission, existingFetcher ? existingFetcher.data : void 0), {
     
    20522038        return;
    20532039      } else if (discoverResult.type === "error") {
    2054         let {
    2055           error
    2056         } = handleDiscoverRouteError(path, discoverResult);
    2057         setFetcherError(key, routeId, error, {
     2040        setFetcherError(key, routeId, discoverResult.error, {
    20582041          flushSync
    20592042        });
     
    20732056    fetchControllers.set(key, abortController);
    20742057    let originatingLoadId = incrementingLoadId;
    2075     let results = await callDataStrategy("loader", fetchRequest, [match], matches);
    2076     let result = results[0];
     2058    let results = await callDataStrategy("loader", state, fetchRequest, [match], matches, key);
     2059    let result = results[match.route.id];
    20772060    if (isDeferredResult(result)) {
    20782061      result = await resolveDeferredData(result, fetchRequest.signal, true) || result;
     
    20942077      } else {
    20952078        fetchRedirectIds.add(key);
    2096         await startRedirectNavigation(fetchRequest, result);
     2079        await startRedirectNavigation(fetchRequest, result, false, {
     2080          preventScrollReset
     2081        });
    20972082        return;
    20982083      }
     
    21052090    updateFetcherState(key, getDoneFetcher(result.data));
    21062091  }
    2107   async function startRedirectNavigation(request, redirect3, _temp2) {
     2092  async function startRedirectNavigation(request, redirect3, isNavigation, _temp2) {
    21082093    let {
    21092094      submission,
    21102095      fetcherSubmission,
     2096      preventScrollReset,
    21112097      replace: replace2
    21122098    } = _temp2 === void 0 ? {} : _temp2;
     
    21552141          formAction: location
    21562142        }),
    2157         // Preserve this flag across redirects
    2158         preventScrollReset: pendingPreventScrollReset
     2143        // Preserve these flags across redirects
     2144        preventScrollReset: preventScrollReset || pendingPreventScrollReset,
     2145        enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0
    21592146      });
    21602147    } else {
     
    21642151        // Send fetcher submissions through for shouldRevalidate
    21652152        fetcherSubmission,
    2166         // Preserve this flag across redirects
    2167         preventScrollReset: pendingPreventScrollReset
    2168       });
    2169     }
    2170   }
    2171   async function callDataStrategy(type, request, matchesToLoad, matches) {
     2153        // Preserve these flags across redirects
     2154        preventScrollReset: preventScrollReset || pendingPreventScrollReset,
     2155        enableViewTransition: isNavigation ? pendingViewTransitionEnabled : void 0
     2156      });
     2157    }
     2158  }
     2159  async function callDataStrategy(type, state2, request, matchesToLoad, matches, fetcherKey) {
     2160    let results;
     2161    let dataResults = {};
    21722162    try {
    2173       let results = await callDataStrategyImpl(dataStrategyImpl, type, request, matchesToLoad, matches, manifest, mapRouteProperties2);
    2174       return await Promise.all(results.map((result, i) => {
    2175         if (isRedirectHandlerResult(result)) {
    2176           let response = result.result;
    2177           return {
    2178             type: ResultType.redirect,
    2179             response: normalizeRelativeRoutingRedirectResponse(response, request, matchesToLoad[i].route.id, matches, basename, future.v7_relativeSplatPath)
    2180           };
    2181         }
    2182         return convertHandlerResultToDataResult(result);
    2183       }));
     2163      results = await callDataStrategyImpl(dataStrategyImpl, type, state2, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties2);
    21842164    } catch (e) {
    2185       return matchesToLoad.map(() => ({
    2186         type: ResultType.error,
    2187         error: e
    2188       }));
    2189     }
    2190   }
    2191   async function callLoadersAndMaybeResolveData(currentMatches, matches, matchesToLoad, fetchersToLoad, request) {
    2192     let [loaderResults, ...fetcherResults] = await Promise.all([matchesToLoad.length ? callDataStrategy("loader", request, matchesToLoad, matches) : [], ...fetchersToLoad.map((f) => {
     2165      matchesToLoad.forEach((m) => {
     2166        dataResults[m.route.id] = {
     2167          type: ResultType.error,
     2168          error: e
     2169        };
     2170      });
     2171      return dataResults;
     2172    }
     2173    for (let [routeId, result] of Object.entries(results)) {
     2174      if (isRedirectDataStrategyResultResult(result)) {
     2175        let response = result.result;
     2176        dataResults[routeId] = {
     2177          type: ResultType.redirect,
     2178          response: normalizeRelativeRoutingRedirectResponse(response, request, routeId, matches, basename, future.v7_relativeSplatPath)
     2179        };
     2180      } else {
     2181        dataResults[routeId] = await convertDataStrategyResultToDataResult(result);
     2182      }
     2183    }
     2184    return dataResults;
     2185  }
     2186  async function callLoadersAndMaybeResolveData(state2, matches, matchesToLoad, fetchersToLoad, request) {
     2187    let currentMatches = state2.matches;
     2188    let loaderResultsPromise = callDataStrategy("loader", state2, request, matchesToLoad, matches, null);
     2189    let fetcherResultsPromise = Promise.all(fetchersToLoad.map(async (f) => {
    21932190      if (f.matches && f.match && f.controller) {
    2194         let fetcherRequest = createClientSideRequest(init.history, f.path, f.controller.signal);
    2195         return callDataStrategy("loader", fetcherRequest, [f.match], f.matches).then((r) => r[0]);
     2191        let results = await callDataStrategy("loader", state2, createClientSideRequest(init.history, f.path, f.controller.signal), [f.match], f.matches, f.key);
     2192        let result = results[f.match.route.id];
     2193        return {
     2194          [f.key]: result
     2195        };
    21962196      } else {
    21972197        return Promise.resolve({
    2198           type: ResultType.error,
    2199           error: getInternalRouterError(404, {
    2200             pathname: f.path
    2201           })
     2198          [f.key]: {
     2199            type: ResultType.error,
     2200            error: getInternalRouterError(404, {
     2201              pathname: f.path
     2202            })
     2203          }
    22022204        });
    22032205      }
    2204     })]);
    2205     await Promise.all([resolveDeferredResults(currentMatches, matchesToLoad, loaderResults, loaderResults.map(() => request.signal), false, state.loaderData), resolveDeferredResults(currentMatches, fetchersToLoad.map((f) => f.match), fetcherResults, fetchersToLoad.map((f) => f.controller ? f.controller.signal : null), true)]);
     2206    }));
     2207    let loaderResults = await loaderResultsPromise;
     2208    let fetcherResults = (await fetcherResultsPromise).reduce((acc, r) => Object.assign(acc, r), {});
     2209    await Promise.all([resolveNavigationDeferredResults(matches, loaderResults, request.signal, currentMatches, state2.loaderData), resolveFetcherDeferredResults(matches, fetcherResults, fetchersToLoad)]);
    22062210    return {
    22072211      loaderResults,
     
    22152219      if (fetchControllers.has(key)) {
    22162220        cancelledFetcherLoads.add(key);
    2217         abortFetcher(key);
    2218       }
     2221      }
     2222      abortFetcher(key);
    22192223    });
    22202224  }
     
    22842288  function abortFetcher(key) {
    22852289    let controller = fetchControllers.get(key);
    2286     invariant(controller, "Expected fetch controller: " + key);
    2287     controller.abort();
    2288     fetchControllers.delete(key);
     2290    if (controller) {
     2291      controller.abort();
     2292      fetchControllers.delete(key);
     2293    }
    22892294  }
    22902295  function markFetchersDone(keys) {
     
    23462351    });
    23472352  }
    2348   function shouldBlockNavigation(_ref4) {
     2353  function shouldBlockNavigation(_ref2) {
    23492354    let {
    23502355      currentLocation,
    23512356      nextLocation,
    23522357      historyAction
    2353     } = _ref4;
     2358    } = _ref2;
    23542359    if (blockerFunctions.size === 0) {
    23552360      return;
     
    23882393    };
    23892394  }
    2390   function handleDiscoverRouteError(pathname, discoverResult) {
    2391     return {
    2392       boundaryId: findNearestBoundary(discoverResult.partialMatches).route.id,
    2393       error: getInternalRouterError(400, {
    2394         type: "route-discovery",
    2395         pathname,
    2396         message: discoverResult.error != null && "message" in discoverResult.error ? discoverResult.error : String(discoverResult.error)
    2397       })
    2398     };
    2399   }
    24002395  function cancelActiveDeferreds(predicate) {
    24012396    let cancelledRouteIds = [];
     
    24522447  }
    24532448  function checkFogOfWar(matches, routesToUse, pathname) {
    2454     if (patchRoutesOnMissImpl) {
     2449    if (patchRoutesOnNavigationImpl) {
    24552450      if (!matches) {
    24562451        let fogMatches = matchRoutesImpl(routesToUse, pathname, basename, true);
     
    24602455        };
    24612456      } else {
    2462         let leafRoute = matches[matches.length - 1].route;
    2463         if (leafRoute.path && (leafRoute.path === "*" || leafRoute.path.endsWith("/*"))) {
     2457        if (Object.keys(matches[0].params).length > 0) {
    24642458          let partialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);
    24652459          return {
     
    24762470  }
    24772471  async function discoverRoutes(matches, pathname, signal) {
     2472    if (!patchRoutesOnNavigationImpl) {
     2473      return {
     2474        type: "success",
     2475        matches
     2476      };
     2477    }
    24782478    let partialMatches = matches;
    2479     let route = partialMatches.length > 0 ? partialMatches[partialMatches.length - 1].route : null;
    24802479    while (true) {
    24812480      let isNonHMR = inFlightDataRoutes == null;
    24822481      let routesToUse = inFlightDataRoutes || dataRoutes;
     2482      let localManifest = manifest;
    24832483      try {
    2484         await loadLazyRouteChildren(patchRoutesOnMissImpl, pathname, partialMatches, routesToUse, manifest, mapRouteProperties2, pendingPatchRoutes, signal);
     2484        await patchRoutesOnNavigationImpl({
     2485          path: pathname,
     2486          matches: partialMatches,
     2487          patch: (routeId, children) => {
     2488            if (signal.aborted) return;
     2489            patchRoutesImpl(routeId, children, routesToUse, localManifest, mapRouteProperties2);
     2490          }
     2491        });
    24852492      } catch (e) {
    24862493        return {
     
    24902497        };
    24912498      } finally {
    2492         if (isNonHMR) {
     2499        if (isNonHMR && !signal.aborted) {
    24932500          dataRoutes = [...dataRoutes];
    24942501        }
     
    25002507      }
    25012508      let newMatches = matchRoutes(routesToUse, pathname, basename);
    2502       let matchedSplat = false;
    25032509      if (newMatches) {
    2504         let leafRoute = newMatches[newMatches.length - 1].route;
    2505         if (leafRoute.index) {
    2506           return {
    2507             type: "success",
    2508             matches: newMatches
    2509           };
    2510         }
    2511         if (leafRoute.path && leafRoute.path.length > 0) {
    2512           if (leafRoute.path === "*") {
    2513             matchedSplat = true;
    2514           } else {
    2515             return {
    2516               type: "success",
    2517               matches: newMatches
    2518             };
    2519           }
    2520         }
    2521       }
    2522       let newPartialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);
    2523       if (!newPartialMatches || partialMatches.map((m) => m.route.id).join("-") === newPartialMatches.map((m) => m.route.id).join("-")) {
    25242510        return {
    25252511          type: "success",
    2526           matches: matchedSplat ? newMatches : null
     2512          matches: newMatches
    25272513        };
    25282514      }
    2529       partialMatches = newPartialMatches;
    2530       route = partialMatches[partialMatches.length - 1].route;
    2531       if (route.path === "*") {
     2515      let newPartialMatches = matchRoutesImpl(routesToUse, pathname, basename, true);
     2516      if (!newPartialMatches || partialMatches.length === newPartialMatches.length && partialMatches.every((m, i) => m.route.id === newPartialMatches[i].route.id)) {
    25322517        return {
    25332518          type: "success",
    2534           matches: partialMatches
     2519          matches: null
    25352520        };
    25362521      }
     2522      partialMatches = newPartialMatches;
    25372523    }
    25382524  }
     
    26152601    path.hash = location.hash;
    26162602  }
    2617   if ((to == null || to === "" || to === ".") && activeRouteMatch && activeRouteMatch.route.index && !hasNakedIndexQuery(path.search)) {
    2618     path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
     2603  if ((to == null || to === "" || to === ".") && activeRouteMatch) {
     2604    let nakedIndex = hasNakedIndexQuery(path.search);
     2605    if (activeRouteMatch.route.index && !nakedIndex) {
     2606      path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
     2607    } else if (!activeRouteMatch.route.index && nakedIndex) {
     2608      let params = new URLSearchParams(path.search);
     2609      let indexValues = params.getAll("index");
     2610      params.delete("index");
     2611      indexValues.filter((v) => v).forEach((v) => params.append("index", v));
     2612      let qs = params.toString();
     2613      path.search = qs ? "?" + qs : "";
     2614    }
    26192615  }
    26202616  if (prependBasename && basename !== "/") {
     
    26532649      let text = typeof opts.body === "string" ? opts.body : opts.body instanceof FormData || opts.body instanceof URLSearchParams ? (
    26542650        // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#plain-text-form-data
    2655         Array.from(opts.body.entries()).reduce((acc, _ref5) => {
    2656           let [name, value] = _ref5;
     2651        Array.from(opts.body.entries()).reduce((acc, _ref3) => {
     2652          let [name, value] = _ref3;
    26572653          return "" + acc + name + "=" + value + "\n";
    26582654        }, "")
     
    27382734  };
    27392735}
    2740 function getLoaderMatchesUntilBoundary(matches, boundaryId) {
    2741   let boundaryMatches = matches;
    2742   if (boundaryId) {
    2743     let index = matches.findIndex((m) => m.route.id === boundaryId);
    2744     if (index >= 0) {
    2745       boundaryMatches = matches.slice(0, index);
    2746     }
    2747   }
    2748   return boundaryMatches;
    2749 }
    2750 function getMatchesToLoad(history, state, matches, submission, location, isInitialLoad, skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult) {
     2736function getLoaderMatchesUntilBoundary(matches, boundaryId, includeBoundary) {
     2737  if (includeBoundary === void 0) {
     2738    includeBoundary = false;
     2739  }
     2740  let index = matches.findIndex((m) => m.route.id === boundaryId);
     2741  if (index >= 0) {
     2742    return matches.slice(0, includeBoundary ? index + 1 : index);
     2743  }
     2744  return matches;
     2745}
     2746function getMatchesToLoad(history, state, matches, submission, location, initialHydration, skipActionErrorRevalidation, isRevalidationRequired, cancelledDeferredRoutes, cancelledFetcherLoads, deletedFetchers, fetchLoadMatches, fetchRedirectIds, routesToUse, basename, pendingActionResult) {
    27512747  let actionResult = pendingActionResult ? isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : pendingActionResult[1].data : void 0;
    27522748  let currentUrl = history.createURL(state.location);
    27532749  let nextUrl = history.createURL(location);
    2754   let boundaryId = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[0] : void 0;
    2755   let boundaryMatches = boundaryId ? getLoaderMatchesUntilBoundary(matches, boundaryId) : matches;
     2750  let boundaryMatches = matches;
     2751  if (initialHydration && state.errors) {
     2752    boundaryMatches = getLoaderMatchesUntilBoundary(matches, Object.keys(state.errors)[0], true);
     2753  } else if (pendingActionResult && isErrorResult(pendingActionResult[1])) {
     2754    boundaryMatches = getLoaderMatchesUntilBoundary(matches, pendingActionResult[0]);
     2755  }
    27562756  let actionStatus = pendingActionResult ? pendingActionResult[1].statusCode : void 0;
    27572757  let shouldSkipRevalidation = skipActionErrorRevalidation && actionStatus && actionStatus >= 400;
     
    27662766      return false;
    27672767    }
    2768     if (isInitialLoad) {
    2769       if (typeof route.loader !== "function" || route.loader.hydrate) {
    2770         return true;
    2771       }
    2772       return state.loaderData[route.id] === void 0 && // Don't re-run if the loader ran and threw an error
    2773       (!state.errors || state.errors[route.id] === void 0);
     2768    if (initialHydration) {
     2769      return shouldLoadRouteOnHydration(route, state.loaderData, state.errors);
    27742770    }
    27752771    if (isNewLoader(state.loaderData, state.matches[index], match) || cancelledDeferredRoutes.some((id) => id === match.route.id)) {
     
    27952791  let revalidatingFetchers = [];
    27962792  fetchLoadMatches.forEach((f, key) => {
    2797     if (isInitialLoad || !matches.some((m) => m.route.id === f.routeId) || deletedFetchers.has(key)) {
     2793    if (initialHydration || !matches.some((m) => m.route.id === f.routeId) || deletedFetchers.has(key)) {
    27982794      return;
    27992795    }
     
    28452841  return [navigationMatches, revalidatingFetchers];
    28462842}
     2843function shouldLoadRouteOnHydration(route, loaderData, errors) {
     2844  if (route.lazy) {
     2845    return true;
     2846  }
     2847  if (!route.loader) {
     2848    return false;
     2849  }
     2850  let hasData = loaderData != null && loaderData[route.id] !== void 0;
     2851  let hasError = errors != null && errors[route.id] !== void 0;
     2852  if (!hasData && hasError) {
     2853    return false;
     2854  }
     2855  if (typeof route.loader === "function" && route.loader.hydrate === true) {
     2856    return true;
     2857  }
     2858  return !hasData && !hasError;
     2859}
    28472860function isNewLoader(currentLoaderData, currentMatch, match) {
    28482861  let isNew = (
     
    28722885  return arg.defaultShouldRevalidate;
    28732886}
    2874 async function loadLazyRouteChildren(patchRoutesOnMissImpl, path, matches, routes, manifest, mapRouteProperties2, pendingRouteChildren, signal) {
    2875   let key = [path, ...matches.map((m) => m.route.id)].join("-");
    2876   try {
    2877     let pending = pendingRouteChildren.get(key);
    2878     if (!pending) {
    2879       pending = patchRoutesOnMissImpl({
    2880         path,
    2881         matches,
    2882         patch: (routeId, children) => {
    2883           if (!signal.aborted) {
    2884             patchRoutesImpl(routeId, children, routes, manifest, mapRouteProperties2);
    2885           }
    2886         }
    2887       });
    2888       pendingRouteChildren.set(key, pending);
    2889     }
    2890     if (pending && isPromise(pending)) {
    2891       await pending;
    2892     }
    2893   } finally {
    2894     pendingRouteChildren.delete(key);
    2895   }
    2896 }
    28972887function patchRoutesImpl(routeId, children, routesToUse, manifest, mapRouteProperties2) {
     2888  var _childrenToPatch;
     2889  let childrenToPatch;
    28982890  if (routeId) {
    2899     var _route$children;
    29002891    let route = manifest[routeId];
    29012892    invariant(route, "No route found to patch children into: routeId = " + routeId);
    2902     let dataChildren = convertRoutesToDataRoutes(children, mapRouteProperties2, [routeId, "patch", String(((_route$children = route.children) == null ? void 0 : _route$children.length) || "0")], manifest);
    2903     if (route.children) {
    2904       route.children.push(...dataChildren);
    2905     } else {
    2906       route.children = dataChildren;
    2907     }
     2893    if (!route.children) {
     2894      route.children = [];
     2895    }
     2896    childrenToPatch = route.children;
    29082897  } else {
    2909     let dataChildren = convertRoutesToDataRoutes(children, mapRouteProperties2, ["patch", String(routesToUse.length || "0")], manifest);
    2910     routesToUse.push(...dataChildren);
    2911   }
     2898    childrenToPatch = routesToUse;
     2899  }
     2900  let uniqueChildren = children.filter((newRoute) => !childrenToPatch.some((existingRoute) => isSameRoute(newRoute, existingRoute)));
     2901  let newRoutes = convertRoutesToDataRoutes(uniqueChildren, mapRouteProperties2, [routeId || "_", "patch", String(((_childrenToPatch = childrenToPatch) == null ? void 0 : _childrenToPatch.length) || "0")], manifest);
     2902  childrenToPatch.push(...newRoutes);
     2903}
     2904function isSameRoute(newRoute, existingRoute) {
     2905  if ("id" in newRoute && "id" in existingRoute && newRoute.id === existingRoute.id) {
     2906    return true;
     2907  }
     2908  if (!(newRoute.index === existingRoute.index && newRoute.path === existingRoute.path && newRoute.caseSensitive === existingRoute.caseSensitive)) {
     2909    return false;
     2910  }
     2911  if ((!newRoute.children || newRoute.children.length === 0) && (!existingRoute.children || existingRoute.children.length === 0)) {
     2912    return true;
     2913  }
     2914  return newRoute.children.every((aChild, i) => {
     2915    var _existingRoute$childr;
     2916    return (_existingRoute$childr = existingRoute.children) == null ? void 0 : _existingRoute$childr.some((bChild) => isSameRoute(aChild, bChild));
     2917  });
    29122918}
    29132919async function loadLazyRouteModule(route, mapRouteProperties2, manifest) {
     
    29372943  }));
    29382944}
    2939 function defaultDataStrategy(opts) {
    2940   return Promise.all(opts.matches.map((m) => m.resolve()));
    2941 }
    2942 async function callDataStrategyImpl(dataStrategyImpl, type, request, matchesToLoad, matches, manifest, mapRouteProperties2, requestContext) {
    2943   let routeIdsToLoad = matchesToLoad.reduce((acc, m) => acc.add(m.route.id), /* @__PURE__ */ new Set());
    2944   let loadedMatches = /* @__PURE__ */ new Set();
     2945async function defaultDataStrategy(_ref4) {
     2946  let {
     2947    matches
     2948  } = _ref4;
     2949  let matchesToLoad = matches.filter((m) => m.shouldLoad);
     2950  let results = await Promise.all(matchesToLoad.map((m) => m.resolve()));
     2951  return results.reduce((acc, result, i) => Object.assign(acc, {
     2952    [matchesToLoad[i].route.id]: result
     2953  }), {});
     2954}
     2955async function callDataStrategyImpl(dataStrategyImpl, type, state, request, matchesToLoad, matches, fetcherKey, manifest, mapRouteProperties2, requestContext) {
     2956  let loadRouteDefinitionsPromises = matches.map((m) => m.route.lazy ? loadLazyRouteModule(m.route, mapRouteProperties2, manifest) : void 0);
     2957  let dsMatches = matches.map((match, i) => {
     2958    let loadRoutePromise = loadRouteDefinitionsPromises[i];
     2959    let shouldLoad = matchesToLoad.some((m) => m.route.id === match.route.id);
     2960    let resolve = async (handlerOverride) => {
     2961      if (handlerOverride && request.method === "GET" && (match.route.lazy || match.route.loader)) {
     2962        shouldLoad = true;
     2963      }
     2964      return shouldLoad ? callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, requestContext) : Promise.resolve({
     2965        type: ResultType.data,
     2966        result: void 0
     2967      });
     2968    };
     2969    return _extends({}, match, {
     2970      shouldLoad,
     2971      resolve
     2972    });
     2973  });
    29452974  let results = await dataStrategyImpl({
    2946     matches: matches.map((match) => {
    2947       let shouldLoad = routeIdsToLoad.has(match.route.id);
    2948       let resolve = (handlerOverride) => {
    2949         loadedMatches.add(match.route.id);
    2950         return shouldLoad ? callLoaderOrAction(type, request, match, manifest, mapRouteProperties2, handlerOverride, requestContext) : Promise.resolve({
    2951           type: ResultType.data,
    2952           result: void 0
    2953         });
    2954       };
    2955       return _extends({}, match, {
    2956         shouldLoad,
    2957         resolve
    2958       });
    2959     }),
     2975    matches: dsMatches,
    29602976    request,
    29612977    params: matches[0].params,
     2978    fetcherKey,
    29622979    context: requestContext
    29632980  });
    2964   matches.forEach((m) => invariant(loadedMatches.has(m.route.id), '`match.resolve()` was not called for route id "' + m.route.id + '". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.'));
    2965   return results.filter((_, i) => routeIdsToLoad.has(matches[i].route.id));
    2966 }
    2967 async function callLoaderOrAction(type, request, match, manifest, mapRouteProperties2, handlerOverride, staticContext) {
     2981  try {
     2982    await Promise.all(loadRouteDefinitionsPromises);
     2983  } catch (e) {
     2984  }
     2985  return results;
     2986}
     2987async function callLoaderOrAction(type, request, match, loadRoutePromise, handlerOverride, staticContext) {
    29682988  let result;
    29692989  let onReject;
     
    29833003      }, ...ctx !== void 0 ? [ctx] : []);
    29843004    };
    2985     let handlerPromise;
    2986     if (handlerOverride) {
    2987       handlerPromise = handlerOverride((ctx) => actualHandler(ctx));
    2988     } else {
    2989       handlerPromise = (async () => {
    2990         try {
    2991           let val = await actualHandler();
    2992           return {
    2993             type: "data",
    2994             result: val
    2995           };
    2996         } catch (e) {
    2997           return {
    2998             type: "error",
    2999             result: e
    3000           };
    3001         }
    3002       })();
    3003     }
     3005    let handlerPromise = (async () => {
     3006      try {
     3007        let val = await (handlerOverride ? handlerOverride((ctx) => actualHandler(ctx)) : actualHandler());
     3008        return {
     3009          type: "data",
     3010          result: val
     3011        };
     3012      } catch (e) {
     3013        return {
     3014          type: "error",
     3015          result: e
     3016        };
     3017      }
     3018    })();
    30043019    return Promise.race([handlerPromise, abortPromise]);
    30053020  };
    30063021  try {
    30073022    let handler = match.route[type];
    3008     if (match.route.lazy) {
     3023    if (loadRoutePromise) {
    30093024      if (handler) {
    30103025        let handlerError;
     
    30163031            handlerError = e;
    30173032          }),
    3018           loadLazyRouteModule(match.route, mapRouteProperties2, manifest)
     3033          loadRoutePromise
    30193034        ]);
    30203035        if (handlerError !== void 0) {
     
    30233038        result = value;
    30243039      } else {
    3025         await loadLazyRouteModule(match.route, mapRouteProperties2, manifest);
     3040        await loadRoutePromise;
    30263041        handler = match.route[type];
    30273042        if (handler) {
     
    30643079  return result;
    30653080}
    3066 async function convertHandlerResultToDataResult(handlerResult) {
     3081async function convertDataStrategyResultToDataResult(dataStrategyResult) {
    30673082  let {
    30683083    result,
    30693084    type
    3070   } = handlerResult;
     3085  } = dataStrategyResult;
    30713086  if (isResponse(result)) {
    30723087    let data;
     
    32063221  return formData;
    32073222}
    3208 function processRouteLoaderData(matches, matchesToLoad, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling) {
     3223function processRouteLoaderData(matches, results, pendingActionResult, activeDeferreds, skipLoaderErrorBubbling) {
    32093224  let loaderData = {};
    32103225  let errors = null;
     
    32133228  let loaderHeaders = {};
    32143229  let pendingError = pendingActionResult && isErrorResult(pendingActionResult[1]) ? pendingActionResult[1].error : void 0;
    3215   results.forEach((result, index) => {
    3216     let id = matchesToLoad[index].route.id;
     3230  matches.forEach((match) => {
     3231    if (!(match.route.id in results)) {
     3232      return;
     3233    }
     3234    let id = match.route.id;
     3235    let result = results[id];
    32173236    invariant(!isRedirectResult(result), "Cannot handle redirect results in processLoaderData");
    32183237    if (isErrorResult(result)) {
     
    32733292  };
    32743293}
    3275 function processLoaderData(state, matches, matchesToLoad, results, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds) {
     3294function processLoaderData(state, matches, results, pendingActionResult, revalidatingFetchers, fetcherResults, activeDeferreds) {
    32763295  let {
    32773296    loaderData,
     
    32793298  } = processRouteLoaderData(
    32803299    matches,
    3281     matchesToLoad,
    32823300    results,
    32833301    pendingActionResult,
     
    32863304    // This method is only called client side so we always want to bubble
    32873305  );
    3288   for (let index = 0; index < revalidatingFetchers.length; index++) {
     3306  revalidatingFetchers.forEach((rf) => {
    32893307    let {
    32903308      key,
    32913309      match,
    32923310      controller
    3293     } = revalidatingFetchers[index];
    3294     invariant(fetcherResults !== void 0 && fetcherResults[index] !== void 0, "Did not find corresponding fetcher result");
    3295     let result = fetcherResults[index];
     3311    } = rf;
     3312    let result = fetcherResults[key];
     3313    invariant(result, "Did not find corresponding fetcher result");
    32963314    if (controller && controller.signal.aborted) {
    3297       continue;
     3315      return;
    32983316    } else if (isErrorResult(result)) {
    32993317      let boundaryMatch = findNearestBoundary(state.matches, match == null ? void 0 : match.route.id);
     
    33123330      state.fetchers.set(key, doneFetcher);
    33133331    }
    3314   }
     3332  });
    33153333  return {
    33163334    loaderData,
     
    33783396  if (status === 400) {
    33793397    statusText = "Bad Request";
    3380     if (type === "route-discovery") {
    3381       errorMessage = 'Unable to match URL "' + pathname + '" - the `unstable_patchRoutesOnMiss()` ' + ("function threw the following error:\n" + message);
    3382     } else if (method && pathname && routeId) {
     3398    if (method && pathname && routeId) {
    33833399      errorMessage = "You made a " + method + ' request to "' + pathname + '" but ' + ('did not provide a `loader` for route "' + routeId + '", ') + "so there is no way to handle the request.";
    33843400    } else if (type === "defer-action") {
     
    34043420}
    34053421function findRedirect(results) {
    3406   for (let i = results.length - 1; i >= 0; i--) {
    3407     let result = results[i];
     3422  let entries = Object.entries(results);
     3423  for (let i = entries.length - 1; i >= 0; i--) {
     3424    let [key, result] = entries[i];
    34083425    if (isRedirectResult(result)) {
    34093426      return {
    3410         result,
    3411         idx: i
     3427        key,
     3428        result
    34123429      };
    34133430    }
     
    34333450  return false;
    34343451}
    3435 function isPromise(val) {
    3436   return typeof val === "object" && val != null && "then" in val;
    3437 }
    3438 function isRedirectHandlerResult(result) {
     3452function isRedirectDataStrategyResultResult(result) {
    34393453  return isResponse(result.result) && redirectStatusCodes.has(result.result.status);
    34403454}
     
    34643478  return validMutationMethods.has(method.toLowerCase());
    34653479}
    3466 async function resolveDeferredResults(currentMatches, matchesToLoad, results, signals, isFetcher, currentLoaderData) {
    3467   for (let index = 0; index < results.length; index++) {
    3468     let result = results[index];
    3469     let match = matchesToLoad[index];
     3480async function resolveNavigationDeferredResults(matches, results, signal, currentMatches, currentLoaderData) {
     3481  let entries = Object.entries(results);
     3482  for (let index = 0; index < entries.length; index++) {
     3483    let [routeId, result] = entries[index];
     3484    let match = matches.find((m) => (m == null ? void 0 : m.route.id) === routeId);
    34703485    if (!match) {
    34713486      continue;
     
    34733488    let currentMatch = currentMatches.find((m) => m.route.id === match.route.id);
    34743489    let isRevalidatingLoader = currentMatch != null && !isNewRouteInstance(currentMatch, match) && (currentLoaderData && currentLoaderData[match.route.id]) !== void 0;
    3475     if (isDeferredResult(result) && (isFetcher || isRevalidatingLoader)) {
    3476       let signal = signals[index];
    3477       invariant(signal, "Expected an AbortSignal for revalidating fetcher deferred result");
    3478       await resolveDeferredData(result, signal, isFetcher).then((result2) => {
     3490    if (isDeferredResult(result) && isRevalidatingLoader) {
     3491      await resolveDeferredData(result, signal, false).then((result2) => {
    34793492        if (result2) {
    3480           results[index] = result2 || results[index];
     3493          results[routeId] = result2;
     3494        }
     3495      });
     3496    }
     3497  }
     3498}
     3499async function resolveFetcherDeferredResults(matches, results, revalidatingFetchers) {
     3500  for (let index = 0; index < revalidatingFetchers.length; index++) {
     3501    let {
     3502      key,
     3503      routeId,
     3504      controller
     3505    } = revalidatingFetchers[index];
     3506    let result = results[key];
     3507    let match = matches.find((m) => (m == null ? void 0 : m.route.id) === routeId);
     3508    if (!match) {
     3509      continue;
     3510    }
     3511    if (isDeferredResult(result)) {
     3512      invariant(controller, "Expected an AbortController for revalidating fetcher deferred result");
     3513      await resolveDeferredData(result, controller.signal, true).then((result2) => {
     3514        if (result2) {
     3515          results[key] = result2;
    34813516        }
    34823517      });
     
    41784213}(DataRouterStateHook || {});
    41794214function getDataRouterConsoleError(hookName) {
    4180   return hookName + " must be used within a data router.  See https://reactrouter.com/routers/picking-a-router.";
     4215  return hookName + " must be used within a data router.  See https://reactrouter.com/v6/routers/picking-a-router.";
    41814216}
    41824217function useDataRouterContext(hookName) {
     
    43264361  return navigate;
    43274362}
     4363var alreadyWarned$1 = {};
     4364function warningOnce(key, cond, message) {
     4365  if (!cond && !alreadyWarned$1[key]) {
     4366    alreadyWarned$1[key] = true;
     4367    true ? warning(false, message) : void 0;
     4368  }
     4369}
    43284370var alreadyWarned = {};
    4329 function warningOnce(key, cond, message) {
    4330   if (!cond && !alreadyWarned[key]) {
    4331     alreadyWarned[key] = true;
    4332     true ? warning(false, message) : void 0;
     4371function warnOnce(key, message) {
     4372  if (!alreadyWarned[message]) {
     4373    alreadyWarned[message] = true;
     4374    console.warn(message);
     4375  }
     4376}
     4377var logDeprecation = (flag, msg, link) => warnOnce(flag, "⚠️ React Router Future Flag Warning: " + msg + ". " + ("You can use the `" + flag + "` future flag to opt-in early. ") + ("For more information, see " + link + "."));
     4378function logV6DeprecationWarnings(renderFuture, routerFuture) {
     4379  if (!(renderFuture != null && renderFuture.v7_startTransition)) {
     4380    logDeprecation("v7_startTransition", "React Router will begin wrapping state updates in `React.startTransition` in v7", "https://reactrouter.com/v6/upgrading/future#v7_starttransition");
     4381  }
     4382  if (!(renderFuture != null && renderFuture.v7_relativeSplatPath) && (!routerFuture || !routerFuture.v7_relativeSplatPath)) {
     4383    logDeprecation("v7_relativeSplatPath", "Relative route resolution within Splat routes is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath");
     4384  }
     4385  if (routerFuture) {
     4386    if (!routerFuture.v7_fetcherPersist) {
     4387      logDeprecation("v7_fetcherPersist", "The persistence behavior of fetchers is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist");
     4388    }
     4389    if (!routerFuture.v7_normalizeFormMethod) {
     4390      logDeprecation("v7_normalizeFormMethod", "Casing of `formMethod` fields is being normalized to uppercase in v7", "https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod");
     4391    }
     4392    if (!routerFuture.v7_partialHydration) {
     4393      logDeprecation("v7_partialHydration", "`RouterProvider` hydration behavior is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_partialhydration");
     4394    }
     4395    if (!routerFuture.v7_skipActionErrorRevalidation) {
     4396      logDeprecation("v7_skipActionErrorRevalidation", "The revalidation behavior after 4xx/5xx `action` responses is changing in v7", "https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation");
     4397    }
    43334398  }
    43344399}
     
    43634428  }, [setStateImpl, v7_startTransition]);
    43644429  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
     4430  React.useEffect(() => logV6DeprecationWarnings(future), [future]);
    43654431  return React.createElement(Router, {
    43664432    basename,
     
    46774743    routes,
    46784744    mapRouteProperties,
    4679     unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy,
    4680     unstable_patchRoutesOnMiss: opts == null ? void 0 : opts.unstable_patchRoutesOnMiss
     4745    dataStrategy: opts == null ? void 0 : opts.dataStrategy,
     4746    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation
    46814747  }).initialize();
    46824748}
     
    48334899  };
    48344900}
    4835 var _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "unstable_viewTransition"];
    4836 var _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "unstable_viewTransition", "children"];
    4837 var _excluded3 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "unstable_viewTransition"];
     4901var _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset", "viewTransition"];
     4902var _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "viewTransition", "children"];
     4903var _excluded3 = ["fetcherKey", "navigate", "reloadDocument", "replace", "state", "method", "action", "onSubmit", "relative", "preventScrollReset", "viewTransition"];
    48384904var REACT_ROUTER_VERSION = "6";
    48394905try {
     
    48534919    routes,
    48544920    mapRouteProperties,
    4855     unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy,
    4856     unstable_patchRoutesOnMiss: opts == null ? void 0 : opts.unstable_patchRoutesOnMiss,
     4921    dataStrategy: opts == null ? void 0 : opts.dataStrategy,
     4922    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,
    48574923    window: opts == null ? void 0 : opts.window
    48584924  }).initialize();
     
    48704936    routes,
    48714937    mapRouteProperties,
    4872     unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy,
    4873     unstable_patchRoutesOnMiss: opts == null ? void 0 : opts.unstable_patchRoutesOnMiss,
     4938    dataStrategy: opts == null ? void 0 : opts.dataStrategy,
     4939    patchRoutesOnNavigation: opts == null ? void 0 : opts.patchRoutesOnNavigation,
    48744940    window: opts == null ? void 0 : opts.window
    48754941  }).initialize();
     
    49925058    let {
    49935059      deletedFetchers,
    4994       unstable_flushSync: flushSync,
    4995       unstable_viewTransitionOpts: viewTransitionOpts
     5060      flushSync,
     5061      viewTransitionOpts
    49965062    } = _ref2;
    49975063    deletedFetchers.forEach((key) => fetcherData.current.delete(key));
     
    51285194    v7_relativeSplatPath: router.future.v7_relativeSplatPath
    51295195  }), [router.future.v7_relativeSplatPath]);
     5196  React2.useEffect(() => logV6DeprecationWarnings(future, router.future), [future, router.future]);
    51305197  return React2.createElement(React2.Fragment, null, React2.createElement(DataRouterContext.Provider, {
    51315198    value: dataRouterContext
     
    51835250  }, [setStateImpl, v7_startTransition]);
    51845251  React2.useLayoutEffect(() => history.listen(setState), [history, setState]);
     5252  React2.useEffect(() => logV6DeprecationWarnings(future), [future]);
    51855253  return React2.createElement(Router, {
    51865254    basename,
     
    52185286  }, [setStateImpl, v7_startTransition]);
    52195287  React2.useLayoutEffect(() => history.listen(setState), [history, setState]);
     5288  React2.useEffect(() => logV6DeprecationWarnings(future), [future]);
    52205289  return React2.createElement(Router, {
    52215290    basename,
     
    52455314  }, [setStateImpl, v7_startTransition]);
    52465315  React2.useLayoutEffect(() => history.listen(setState), [history, setState]);
     5316  React2.useEffect(() => logV6DeprecationWarnings(future), [future]);
    52475317  return React2.createElement(Router, {
    52485318    basename,
     
    52695339    to,
    52705340    preventScrollReset,
    5271     unstable_viewTransition
     5341    viewTransition
    52725342  } = _ref7, rest = _objectWithoutPropertiesLoose(_ref7, _excluded);
    52735343  let {
     
    53025372    preventScrollReset,
    53035373    relative,
    5304     unstable_viewTransition
     5374    viewTransition
    53055375  });
    53065376  function handleClick(event) {
     
    53315401    style: styleProp,
    53325402    to,
    5333     unstable_viewTransition,
     5403    viewTransition,
    53345404    children
    53355405  } = _ref8, rest = _objectWithoutPropertiesLoose(_ref8, _excluded2);
     
    53455415  let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
    53465416  // eslint-disable-next-line react-hooks/rules-of-hooks
    5347   useViewTransitionState(path) && unstable_viewTransition === true;
     5417  useViewTransitionState(path) && viewTransition === true;
    53485418  let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
    53495419  let locationPathname = location.pathname;
     
    53795449    style,
    53805450    to,
    5381     unstable_viewTransition
     5451    viewTransition
    53825452  }), typeof children === "function" ? children(renderProps) : children);
    53835453});
     
    53975467    relative,
    53985468    preventScrollReset,
    5399     unstable_viewTransition
     5469    viewTransition
    54005470  } = _ref9, props = _objectWithoutPropertiesLoose(_ref9, _excluded3);
    54015471  let submit = useSubmit();
     
    54185488      relative,
    54195489      preventScrollReset,
    5420       unstable_viewTransition
     5490      viewTransition
    54215491    });
    54225492  };
     
    54605530})(DataRouterStateHook2 || (DataRouterStateHook2 = {}));
    54615531function getDataRouterConsoleError2(hookName) {
    5462   return hookName + " must be used within a data router.  See https://reactrouter.com/routers/picking-a-router.";
     5532  return hookName + " must be used within a data router.  See https://reactrouter.com/v6/routers/picking-a-router.";
    54635533}
    54645534function useDataRouterContext2(hookName) {
     
    54795549    preventScrollReset,
    54805550    relative,
    5481     unstable_viewTransition
     5551    viewTransition
    54825552  } = _temp === void 0 ? {} : _temp;
    54835553  let navigate = useNavigate();
     
    54955565        preventScrollReset,
    54965566        relative,
    5497         unstable_viewTransition
    5498       });
    5499     }
    5500   }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, unstable_viewTransition]);
     5567        viewTransition
     5568      });
     5569    }
     5570  }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative, viewTransition]);
    55015571}
    55025572function useSearchParams(defaultInit) {
     
    55545624        formMethod: options.method || method,
    55555625        formEncType: options.encType || encType,
    5556         unstable_flushSync: options.unstable_flushSync
     5626        flushSync: options.flushSync
    55575627      });
    55585628    } else {
     
    55665636        state: options.state,
    55675637        fromRouteId: currentRouteId,
    5568         unstable_flushSync: options.unstable_flushSync,
    5569         unstable_viewTransition: options.unstable_viewTransition
     5638        flushSync: options.flushSync,
     5639        viewTransition: options.viewTransition
    55705640      });
    55715641    }
     
    55895659    path.search = location.search;
    55905660    let params = new URLSearchParams(path.search);
    5591     if (params.has("index") && params.get("index") === "") {
     5661    let indexValues = params.getAll("index");
     5662    let hasNakedIndexParam = indexValues.some((v) => v === "");
     5663    if (hasNakedIndexParam) {
    55925664      params.delete("index");
    5593       path.search = params.toString() ? "?" + params.toString() : "";
     5665      indexValues.filter((v) => v).forEach((v) => params.append("index", v));
     5666      let qs = params.toString();
     5667      path.search = qs ? "?" + qs : "";
    55945668    }
    55955669  }
     
    58105884  }
    58115885  let vtContext = React2.useContext(ViewTransitionContext);
    5812   !(vtContext != null) ? true ? invariant(false, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?") : invariant(false) : void 0;
     5886  !(vtContext != null) ? true ? invariant(false, "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?") : invariant(false) : void 0;
    58135887  let {
    58145888    basename
     
    58725946  HistoryRouter as unstable_HistoryRouter,
    58735947  usePrompt as unstable_usePrompt,
    5874   useViewTransitionState as unstable_useViewTransitionState,
    58755948  useActionData,
    58765949  useAsyncError,
     
    59005973  useRoutes,
    59015974  useSearchParams,
    5902   useSubmit
     5975  useSubmit,
     5976  useViewTransitionState
    59035977};
    59045978/*! Bundled license information:
     
    59065980@remix-run/router/dist/router.js:
    59075981  (**
    5908    * @remix-run/router v1.19.0
     5982   * @remix-run/router v1.21.0
    59095983   *
    59105984   * Copyright (c) Remix Software Inc.
     
    59185992react-router/dist/index.js:
    59195993  (**
    5920    * React Router v6.26.0
     5994   * React Router v6.28.0
    59215995   *
    59225996   * Copyright (c) Remix Software Inc.
     
    59306004react-router-dom/dist/index.js:
    59316005  (**
    5932    * React Router DOM v6.26.0
     6006   * React Router DOM v6.28.0
    59336007   *
    59346008   * Copyright (c) Remix Software Inc.
Note: See TracChangeset for help on using the changeset viewer.