react-router 7.13.1 → 7.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/dist/{production/browser-DzsJABDQ.d.mts → development/browser-Bfn3xw9E.d.ts} +2 -1
  3. package/dist/development/{browser-DzsJABDQ.d.mts → browser-Di6-vSl-.d.mts} +2 -1
  4. package/dist/development/{chunk-XOLAXE2Z.js → chunk-GO74ODU3.js} +190 -111
  5. package/dist/{production/chunk-B5UMK6O7.js → development/chunk-HPFFRPKK.js} +100 -99
  6. package/dist/development/{chunk-KSEWV2VO.js → chunk-LLP6DRWX.js} +7 -7
  7. package/dist/{production/chunk-TXB4YXR2.mjs → development/chunk-UALY5CBT.mjs} +83 -49
  8. package/dist/development/{chunk-LFPYN7LY.mjs → chunk-UVKPFVEO.mjs} +124 -44
  9. package/dist/development/context-phCt_zmH.d.mts +1713 -0
  10. package/dist/development/dom-export.d.mts +3 -2
  11. package/dist/development/dom-export.d.ts +3 -2
  12. package/dist/development/dom-export.js +45 -29
  13. package/dist/development/dom-export.mjs +21 -5
  14. package/dist/development/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-BcrVT7Dd.d.mts} +4 -2
  15. package/dist/{production/index-react-server-client-EzWJGpN_.d.mts → development/index-react-server-client-CCwMoQIT.d.ts} +1067 -10
  16. package/dist/development/index-react-server-client.d.mts +3 -2
  17. package/dist/development/index-react-server-client.d.ts +3 -2
  18. package/dist/development/index-react-server-client.js +4 -4
  19. package/dist/development/index-react-server-client.mjs +2 -2
  20. package/dist/development/index-react-server.d.mts +293 -246
  21. package/dist/development/index-react-server.d.ts +293 -246
  22. package/dist/development/index-react-server.js +121 -43
  23. package/dist/development/index-react-server.mjs +121 -43
  24. package/dist/development/index.d.mts +15 -13
  25. package/dist/development/index.d.ts +15 -13
  26. package/dist/development/index.js +176 -142
  27. package/dist/development/index.mjs +3 -3
  28. package/dist/development/instrumentation-BYr6ff5D.d.ts +657 -0
  29. package/dist/development/lib/types/internal.d.mts +2 -2
  30. package/dist/development/lib/types/internal.d.ts +2 -2
  31. package/dist/development/lib/types/internal.js +1 -1
  32. package/dist/development/lib/types/internal.mjs +1 -1
  33. package/dist/development/{register-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
  34. package/dist/development/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
  35. package/dist/development/routeModules-BRrCYrSL.d.mts +1693 -0
  36. package/dist/development/routeModules-CA7kSxJJ.d.ts +1693 -0
  37. package/dist/production/{browser-sPQ7eaK4.d.ts → browser-Bfn3xw9E.d.ts} +2 -1
  38. package/dist/{development/browser-sPQ7eaK4.d.ts → production/browser-Di6-vSl-.d.mts} +2 -1
  39. package/dist/production/{chunk-RJCJ3EYF.mjs → chunk-2BDJPJTA.mjs} +124 -44
  40. package/dist/production/{chunk-ZJMCM6KT.js → chunk-CAFVLUDY.js} +7 -7
  41. package/dist/production/{chunk-772H4TVR.js → chunk-LKUVSIBA.js} +190 -111
  42. package/dist/{development/chunk-JPUPSTYD.mjs → production/chunk-PY35PE22.mjs} +83 -49
  43. package/dist/{development/chunk-2YMDXNOJ.js → production/chunk-XAAX7KIK.js} +100 -99
  44. package/dist/production/context-phCt_zmH.d.mts +1713 -0
  45. package/dist/production/dom-export.d.mts +3 -2
  46. package/dist/production/dom-export.d.ts +3 -2
  47. package/dist/production/dom-export.js +45 -29
  48. package/dist/production/dom-export.mjs +21 -5
  49. package/dist/{development/index-react-server-client-EzWJGpN_.d.mts → production/index-react-server-client-BcrVT7Dd.d.mts} +4 -2
  50. package/dist/production/{index-react-server-client-C4tCIird.d.ts → index-react-server-client-CCwMoQIT.d.ts} +1067 -10
  51. package/dist/production/index-react-server-client.d.mts +3 -2
  52. package/dist/production/index-react-server-client.d.ts +3 -2
  53. package/dist/production/index-react-server-client.js +4 -4
  54. package/dist/production/index-react-server-client.mjs +2 -2
  55. package/dist/production/index-react-server.d.mts +293 -246
  56. package/dist/production/index-react-server.d.ts +293 -246
  57. package/dist/production/index-react-server.js +121 -43
  58. package/dist/production/index-react-server.mjs +121 -43
  59. package/dist/production/index.d.mts +15 -13
  60. package/dist/production/index.d.ts +15 -13
  61. package/dist/production/index.js +176 -142
  62. package/dist/production/index.mjs +3 -3
  63. package/dist/production/instrumentation-BYr6ff5D.d.ts +657 -0
  64. package/dist/production/lib/types/internal.d.mts +2 -2
  65. package/dist/production/lib/types/internal.d.ts +2 -2
  66. package/dist/production/lib/types/internal.js +1 -1
  67. package/dist/production/lib/types/internal.mjs +1 -1
  68. package/dist/production/{register-CBoanF80.d.ts → register-CTxsJBKQ.d.mts} +1 -1
  69. package/dist/production/{register-cRYJ3CjG.d.mts → register-CkcGwv27.d.ts} +1 -1
  70. package/dist/production/routeModules-BRrCYrSL.d.mts +1693 -0
  71. package/dist/production/routeModules-CA7kSxJJ.d.ts +1693 -0
  72. package/package.json +1 -1
  73. package/dist/development/instrumentation--6Pioq_G.d.ts +0 -3344
  74. package/dist/development/router-cLsU7kHk.d.mts +0 -3344
  75. package/dist/production/instrumentation--6Pioq_G.d.ts +0 -3344
  76. package/dist/production/router-cLsU7kHk.d.mts +0 -3344
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
- import { f as RouterProviderProps$1, e as RouterInit, u as unstable_ClientInstrumentation, g as ClientOnErrorFunction } from './router-cLsU7kHk.mjs';
3
- export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-DzsJABDQ.mjs';
2
+ import { a as RouterProviderProps$1, R as RouterInit, u as unstable_ClientInstrumentation, C as ClientOnErrorFunction } from './context-phCt_zmH.mjs';
3
+ export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-Di6-vSl-.mjs';
4
+ import './routeModules-BRrCYrSL.mjs';
4
5
 
5
6
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
6
7
  declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { RouterProviderProps as RouterProviderProps$1, RouterInit, ClientOnErrorFunction } from 'react-router';
3
- import { u as unstable_ClientInstrumentation } from './instrumentation--6Pioq_G.js';
4
- export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-sPQ7eaK4.js';
3
+ import { u as unstable_ClientInstrumentation } from './instrumentation-BYr6ff5D.js';
4
+ export { D as unstable_DecodeActionFunction, a as unstable_DecodeFormStateFunction, b as unstable_DecodeReplyFunction, R as unstable_RSCHydratedRouter, d as unstable_RSCManifestPayload, e as unstable_RSCPayload, f as unstable_RSCRenderPayload, c as unstable_createCallServer } from './browser-Bfn3xw9E.js';
5
+ import './routeModules-CA7kSxJJ.js';
5
6
 
6
7
  type RouterProviderProps = Omit<RouterProviderProps$1, "flushSync">;
7
8
  declare function RouterProvider(props: Omit<RouterProviderProps, "flushSync">): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
2
- * react-router v7.13.1
2
+ * react-router v7.13.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -13,7 +13,7 @@
13
13
 
14
14
 
15
15
 
16
- var _chunkKSEWV2VOjs = require('./chunk-KSEWV2VO.js');
16
+ var _chunkLLP6DRWXjs = require('./chunk-LLP6DRWX.js');
17
17
 
18
18
 
19
19
 
@@ -32,7 +32,8 @@ var _chunkKSEWV2VOjs = require('./chunk-KSEWV2VO.js');
32
32
 
33
33
 
34
34
 
35
- var _chunkXOLAXE2Zjs = require('./chunk-XOLAXE2Z.js');
35
+
36
+ var _chunkGO74ODU3js = require('./chunk-GO74ODU3.js');
36
37
 
37
38
  // lib/dom-export/dom-router-provider.tsx
38
39
  var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
@@ -165,7 +166,7 @@ function createHydratedRouter({
165
166
  unstable_instrumentations,
166
167
  mapRouteProperties: _reactrouter.UNSAFE_mapRouteProperties,
167
168
  future: {
168
- middleware: ssrInfo.context.future.v8_middleware
169
+ unstable_passThroughRequests: ssrInfo.context.future.unstable_passThroughRequests
169
170
  },
170
171
  dataStrategy: _reactrouter.UNSAFE_getTurboStreamSingleFetchDataStrategy.call(void 0,
171
172
  () => router2,
@@ -212,7 +213,7 @@ function HydratedRouter(props) {
212
213
  }, []);
213
214
  React2.useEffect(() => {
214
215
  if (process.env.NODE_ENV === "development" && criticalCss === void 0) {
215
- document.querySelectorAll(`[${_chunkXOLAXE2Zjs.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
216
+ document.querySelectorAll(`[${_chunkGO74ODU3js.CRITICAL_CSS_DATA_ATTRIBUTE}]`).forEach((element) => element.remove());
216
217
  }
217
218
  }, [criticalCss]);
218
219
  let [location2, setLocation] = React2.useState(router.state.location);
@@ -305,6 +306,9 @@ function createCallServer({
305
306
  Promise.resolve(payloadPromise).then(async (payload) => {
306
307
  if (payload.type === "redirect") {
307
308
  if (payload.reload || isExternalLocation(payload.location)) {
309
+ if (hasInvalidProtocol(payload.location)) {
310
+ throw new Error("Invalid redirect location");
311
+ }
308
312
  window.location.href = payload.location;
309
313
  return;
310
314
  }
@@ -322,6 +326,9 @@ function createCallServer({
322
326
  if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
323
327
  if (rerender.type === "redirect") {
324
328
  if (rerender.reload || isExternalLocation(rerender.location)) {
329
+ if (hasInvalidProtocol(rerender.location)) {
330
+ throw new Error("Invalid redirect location");
331
+ }
325
332
  window.location.href = rerender.location;
326
333
  return;
327
334
  }
@@ -384,10 +391,10 @@ function createRouterFromPayload({
384
391
  };
385
392
  if (payload.type !== "render") throw new Error("Invalid payload type");
386
393
  globalVar.__reactRouterRouteModules = _nullishCoalesce(globalVar.__reactRouterRouteModules, () => ( {}));
387
- _chunkKSEWV2VOjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
394
+ _chunkLLP6DRWXjs.populateRSCRouteModules.call(void 0, globalVar.__reactRouterRouteModules, payload.matches);
388
395
  let patches = /* @__PURE__ */ new Map();
389
396
  _optionalChain([payload, 'access', _22 => _22.patches, 'optionalAccess', _23 => _23.forEach, 'call', _24 => _24((patch) => {
390
- _chunkXOLAXE2Zjs.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
397
+ _chunkGO74ODU3js.invariant.call(void 0, patch.parentId, "Invalid patch parentId");
391
398
  if (!patches.has(patch.parentId)) {
392
399
  patches.set(patch.parentId, []);
393
400
  }
@@ -409,12 +416,12 @@ function createRouterFromPayload({
409
416
  }
410
417
  return [route];
411
418
  }, []);
412
- globalVar.__reactRouterDataRouter = _chunkXOLAXE2Zjs.createRouter.call(void 0, {
419
+ globalVar.__reactRouterDataRouter = _chunkGO74ODU3js.createRouter.call(void 0, {
413
420
  routes,
414
421
  getContext,
415
422
  basename: payload.basename,
416
- history: _chunkXOLAXE2Zjs.createBrowserHistory.call(void 0, ),
417
- hydrationData: _chunkKSEWV2VOjs.getHydrationData.call(void 0, {
423
+ history: _chunkGO74ODU3js.createBrowserHistory.call(void 0, ),
424
+ hydrationData: _chunkLLP6DRWXjs.getHydrationData.call(void 0, {
418
425
  state: {
419
426
  loaderData: payload.loaderData,
420
427
  actionData: payload.actionData,
@@ -423,7 +430,7 @@ function createRouterFromPayload({
423
430
  routes,
424
431
  getRouteInfo: (routeId) => {
425
432
  let match = payload.matches.find((m) => m.id === routeId);
426
- _chunkXOLAXE2Zjs.invariant.call(void 0, match, "Route not found in payload");
433
+ _chunkGO74ODU3js.invariant.call(void 0, match, "Route not found in payload");
427
434
  return {
428
435
  clientLoader: match.clientLoader,
429
436
  hasLoader: match.hasLoader,
@@ -521,9 +528,9 @@ function createRouterFromPayload({
521
528
  routeModules: globalVar.__reactRouterRouteModules
522
529
  };
523
530
  }
524
- var renderedRoutesContext = _chunkXOLAXE2Zjs.createContext.call(void 0, );
531
+ var renderedRoutesContext = _chunkGO74ODU3js.createContext.call(void 0, );
525
532
  function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReadableStream, fetchImplementation) {
526
- let dataStrategy = _chunkXOLAXE2Zjs.getSingleFetchDataStrategyImpl.call(void 0,
533
+ let dataStrategy = _chunkGO74ODU3js.getSingleFetchDataStrategyImpl.call(void 0,
527
534
  getRouter,
528
535
  (match) => {
529
536
  let M = match;
@@ -581,20 +588,20 @@ function getRSCSingleFetchDataStrategy(getRouter, ssr, basename, createFromReada
581
588
  function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation) {
582
589
  return async (args, basename, trailingSlashAware, targetRoutes) => {
583
590
  let { request, context } = args;
584
- let url = _chunkXOLAXE2Zjs.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
591
+ let url = _chunkGO74ODU3js.singleFetchUrl.call(void 0, request.url, basename, trailingSlashAware, "rsc");
585
592
  if (request.method === "GET") {
586
- url = _chunkXOLAXE2Zjs.stripIndexParam.call(void 0, url);
593
+ url = _chunkGO74ODU3js.stripIndexParam.call(void 0, url);
587
594
  if (targetRoutes) {
588
595
  url.searchParams.set("_routes", targetRoutes.join(","));
589
596
  }
590
597
  }
591
598
  let res = await fetchImplementation(
592
- new Request(url, await _chunkXOLAXE2Zjs.createRequestInit.call(void 0, request))
599
+ new Request(url, await _chunkGO74ODU3js.createRequestInit.call(void 0, request))
593
600
  );
594
601
  if (res.status >= 400 && !res.headers.has("X-Remix-Response")) {
595
- throw new (0, _chunkXOLAXE2Zjs.ErrorResponseImpl)(res.status, res.statusText, await res.text());
602
+ throw new (0, _chunkGO74ODU3js.ErrorResponseImpl)(res.status, res.statusText, await res.text());
596
603
  }
597
- _chunkXOLAXE2Zjs.invariant.call(void 0, res.body, "No response body to decode");
604
+ _chunkGO74ODU3js.invariant.call(void 0, res.body, "No response body to decode");
598
605
  try {
599
606
  const payload = await createFromReadableStream(res.body, {
600
607
  temporaryReferences: void 0
@@ -618,7 +625,7 @@ function getFetchAndDecodeViaRSC(createFromReadableStream, fetchImplementation)
618
625
  }
619
626
  context.get(renderedRoutesContext).push(...payload.matches);
620
627
  let results = { routes: {} };
621
- const dataKey = _chunkXOLAXE2Zjs.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
628
+ const dataKey = _chunkGO74ODU3js.isMutationMethod.call(void 0, request.method) ? "actionData" : "loaderData";
622
629
  for (let [routeId, data] of Object.entries(payload[dataKey] || {})) {
623
630
  results.routes[routeId] = { data };
624
631
  }
@@ -651,7 +658,7 @@ function RSCHydratedRouter({
651
658
  [createFromReadableStream, payload, fetchImplementation, getContext]
652
659
  );
653
660
  React3.useEffect(() => {
654
- _chunkXOLAXE2Zjs.setIsHydrated.call(void 0, );
661
+ _chunkGO74ODU3js.setIsHydrated.call(void 0, );
655
662
  }, []);
656
663
  React3.useLayoutEffect(() => {
657
664
  const globalVar = window;
@@ -737,7 +744,9 @@ function RSCHydratedRouter({
737
744
  // flags that drive runtime behavior they'll need to be proxied through.
738
745
  v8_middleware: false,
739
746
  unstable_subResourceIntegrity: false,
740
- unstable_trailingSlashAwareDataRequests: true
747
+ unstable_trailingSlashAwareDataRequests: true,
748
+ // always on for RSC
749
+ unstable_passThroughRequests: true
741
750
  // always on for RSC
742
751
  },
743
752
  isSpaMode: false,
@@ -755,8 +764,8 @@ function RSCHydratedRouter({
755
764
  routeDiscovery: { mode: "lazy", manifestPath: "/__manifest" },
756
765
  routeModules
757
766
  };
758
- return /* @__PURE__ */ React3.createElement(_chunkXOLAXE2Zjs.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkKSEWV2VOjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkXOLAXE2Zjs.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
759
- _chunkXOLAXE2Zjs.RouterProvider,
767
+ return /* @__PURE__ */ React3.createElement(_chunkGO74ODU3js.RSCRouterContext.Provider, { value: true }, /* @__PURE__ */ React3.createElement(_chunkLLP6DRWXjs.RSCRouterGlobalErrorBoundary, { location: state.location }, /* @__PURE__ */ React3.createElement(_chunkGO74ODU3js.FrameworkContext.Provider, { value: frameworkContext }, /* @__PURE__ */ React3.createElement(
768
+ _chunkGO74ODU3js.RouterProvider,
760
769
  {
761
770
  router: transitionEnabledRouter,
762
771
  flushSync: ReactDOM2.flushSync
@@ -772,8 +781,8 @@ function createRouteFromServerManifest(match, payload) {
772
781
  // the server loader flow regardless of whether the client loader calls
773
782
  // `serverLoader` or not, otherwise we'll have nothing to render.
774
783
  match.hasComponent && !match.element;
775
- _chunkXOLAXE2Zjs.invariant.call(void 0, window.__reactRouterRouteModules);
776
- _chunkKSEWV2VOjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
784
+ _chunkGO74ODU3js.invariant.call(void 0, window.__reactRouterRouteModules);
785
+ _chunkLLP6DRWXjs.populateRSCRouteModules.call(void 0, window.__reactRouterRouteModules, match);
777
786
  let dataRoute = {
778
787
  id: match.id,
779
788
  element: match.element,
@@ -823,7 +832,7 @@ function createRouteFromServerManifest(match, payload) {
823
832
  return await callSingleFetch(singleFetch);
824
833
  }
825
834
  }) : match.hasAction ? (_, singleFetch) => callSingleFetch(singleFetch) : () => {
826
- throw _chunkXOLAXE2Zjs.noActionDefinedError.call(void 0, "action", match.id);
835
+ throw _chunkGO74ODU3js.noActionDefinedError.call(void 0, "action", match.id);
827
836
  },
828
837
  path: match.path,
829
838
  shouldRevalidate: match.shouldRevalidate,
@@ -836,7 +845,7 @@ function createRouteFromServerManifest(match, payload) {
836
845
  hasShouldRevalidate: match.shouldRevalidate != null
837
846
  };
838
847
  if (typeof dataRoute.loader === "function") {
839
- dataRoute.loader.hydrate = _chunkXOLAXE2Zjs.shouldHydrateRouteLoader.call(void 0,
848
+ dataRoute.loader.hydrate = _chunkGO74ODU3js.shouldHydrateRouteLoader.call(void 0,
840
849
  match.id,
841
850
  match.clientLoader,
842
851
  match.hasLoader,
@@ -846,7 +855,7 @@ function createRouteFromServerManifest(match, payload) {
846
855
  return dataRoute;
847
856
  }
848
857
  function callSingleFetch(singleFetch) {
849
- _chunkXOLAXE2Zjs.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
858
+ _chunkGO74ODU3js.invariant.call(void 0, typeof singleFetch === "function", "Invalid singleFetch parameter");
850
859
  return singleFetch();
851
860
  }
852
861
  function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
@@ -854,7 +863,7 @@ function preventInvalidServerHandlerCall(type, routeId, hasHandler) {
854
863
  let fn = type === "action" ? "serverAction()" : "serverLoader()";
855
864
  let msg = `You are trying to call ${fn} on a route that does not have a server ${type} (routeId: "${routeId}")`;
856
865
  console.error(msg);
857
- throw new (0, _chunkXOLAXE2Zjs.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
866
+ throw new (0, _chunkGO74ODU3js.ErrorResponseImpl)(400, "Bad Request", new Error(msg), true);
858
867
  }
859
868
  }
860
869
  var nextPaths = /* @__PURE__ */ new Set();
@@ -924,6 +933,13 @@ function isExternalLocation(location2) {
924
933
  const newLocation = new URL(location2, window.location.href);
925
934
  return newLocation.origin !== window.location.origin;
926
935
  }
936
+ function hasInvalidProtocol(location2) {
937
+ try {
938
+ return _chunkGO74ODU3js.invalidProtocols.includes(new URL(location2).protocol);
939
+ } catch (e2) {
940
+ return false;
941
+ }
942
+ }
927
943
  function cloneRoutes(routes) {
928
944
  if (!routes) return void 0;
929
945
  return routes.map((route) => ({
@@ -1,5 +1,5 @@
1
1
  /**
2
- * react-router v7.13.1
2
+ * react-router v7.13.2
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -14,7 +14,7 @@ import {
14
14
  deserializeErrors,
15
15
  getHydrationData,
16
16
  populateRSCRouteModules
17
- } from "./chunk-JPUPSTYD.mjs";
17
+ } from "./chunk-UALY5CBT.mjs";
18
18
  import {
19
19
  CRITICAL_CSS_DATA_ATTRIBUTE,
20
20
  ErrorResponseImpl,
@@ -33,6 +33,7 @@ import {
33
33
  getSingleFetchDataStrategyImpl,
34
34
  getTurboStreamSingleFetchDataStrategy,
35
35
  hydrationRouteProperties,
36
+ invalidProtocols,
36
37
  invariant,
37
38
  isMutationMethod,
38
39
  mapRouteProperties,
@@ -42,7 +43,7 @@ import {
42
43
  singleFetchUrl,
43
44
  stripIndexParam,
44
45
  useFogOFWarDiscovery
45
- } from "./chunk-LFPYN7LY.mjs";
46
+ } from "./chunk-UVKPFVEO.mjs";
46
47
 
47
48
  // lib/dom-export/dom-router-provider.tsx
48
49
  import * as React from "react";
@@ -157,7 +158,7 @@ function createHydratedRouter({
157
158
  unstable_instrumentations,
158
159
  mapRouteProperties,
159
160
  future: {
160
- middleware: ssrInfo.context.future.v8_middleware
161
+ unstable_passThroughRequests: ssrInfo.context.future.unstable_passThroughRequests
161
162
  },
162
163
  dataStrategy: getTurboStreamSingleFetchDataStrategy(
163
164
  () => router2,
@@ -297,6 +298,9 @@ function createCallServer({
297
298
  Promise.resolve(payloadPromise).then(async (payload) => {
298
299
  if (payload.type === "redirect") {
299
300
  if (payload.reload || isExternalLocation(payload.location)) {
301
+ if (hasInvalidProtocol(payload.location)) {
302
+ throw new Error("Invalid redirect location");
303
+ }
300
304
  window.location.href = payload.location;
301
305
  return;
302
306
  }
@@ -314,6 +318,9 @@ function createCallServer({
314
318
  if (rerender && landedActionId < actionId && globalVar.__routerActionID <= actionId) {
315
319
  if (rerender.type === "redirect") {
316
320
  if (rerender.reload || isExternalLocation(rerender.location)) {
321
+ if (hasInvalidProtocol(rerender.location)) {
322
+ throw new Error("Invalid redirect location");
323
+ }
317
324
  window.location.href = rerender.location;
318
325
  return;
319
326
  }
@@ -729,7 +736,9 @@ function RSCHydratedRouter({
729
736
  // flags that drive runtime behavior they'll need to be proxied through.
730
737
  v8_middleware: false,
731
738
  unstable_subResourceIntegrity: false,
732
- unstable_trailingSlashAwareDataRequests: true
739
+ unstable_trailingSlashAwareDataRequests: true,
740
+ // always on for RSC
741
+ unstable_passThroughRequests: true
733
742
  // always on for RSC
734
743
  },
735
744
  isSpaMode: false,
@@ -916,6 +925,13 @@ function isExternalLocation(location2) {
916
925
  const newLocation = new URL(location2, window.location.href);
917
926
  return newLocation.origin !== window.location.origin;
918
927
  }
928
+ function hasInvalidProtocol(location2) {
929
+ try {
930
+ return invalidProtocols.includes(new URL(location2).protocol);
931
+ } catch {
932
+ return false;
933
+ }
934
+ }
919
935
  function cloneRoutes(routes) {
920
936
  if (!routes) return void 0;
921
937
  return routes.map((route) => ({
@@ -1,5 +1,6 @@
1
- import { bG as RouteManifest, o as RouteModules, Q as HydrationState, a1 as DataRouteObject, a as ClientLoaderFunction, a5 as StaticHandlerContext, bH as ServerRouteModule, q as MiddlewareEnabled, c as RouterContextProvider, r as AppLoadContext, al as LoaderFunctionArgs, ac as ActionFunctionArgs, au as unstable_ServerInstrumentation, aj as HTMLFormMethod, ah as FormEncType, w as RelativeRoutingType, bh as PageLinkDescriptor, T as To, bI as History, a4 as GetScrollRestorationKeyFunction, e as RouterInit, bJ as FutureConfig$1, u as unstable_ClientInstrumentation, p as DataStrategyFunction, a0 as PatchRoutesOnNavigationFunction, s as NavigateOptions, a6 as Fetcher, K as RouteObject, n as Router, v as SerializeFrom, B as BlockerFunction, L as Location, bK as CreateStaticHandlerOptions$1, a2 as StaticHandler } from './instrumentation--6Pioq_G.js';
1
+ import { H as HydrationState, h as StaticHandlerContext, n as unstable_ServerInstrumentation, d as RelativeRoutingType, g as GetScrollRestorationKeyFunction, R as RouterInit, ah as FutureConfig$1, u as unstable_ClientInstrumentation, N as NavigateOptions, F as Fetcher, b as Router, B as BlockerFunction, ai as CreateStaticHandlerOptions$1, S as StaticHandler } from './context-phCt_zmH.mjs';
2
2
  import * as React from 'react';
3
+ import { aD as RouteManifest, X as RouteModules, E as DataRouteObject, a as ClientLoaderFunction, aE as ServerRouteModule, p as MiddlewareEnabled, c as RouterContextProvider, q as AppLoadContext, o as LoaderFunctionArgs, a1 as ActionFunctionArgs, m as HTMLFormMethod, n as FormEncType, au as PageLinkDescriptor, T as To, s as History, z as DataStrategyFunction, B as PatchRoutesOnNavigationFunction, r as RouteObject, Y as SerializeFrom, L as Location } from './routeModules-BRrCYrSL.mjs';
3
4
 
4
5
  interface Route {
5
6
  index?: boolean;
@@ -58,6 +59,7 @@ interface EntryContext extends FrameworkContextObject {
58
59
  serverHandoffStream?: ReadableStream<Uint8Array>;
59
60
  }
60
61
  interface FutureConfig {
62
+ unstable_passThroughRequests: boolean;
61
63
  unstable_subResourceIntegrity: boolean;
62
64
  unstable_trailingSlashAwareDataRequests: boolean;
63
65
  v8_middleware: boolean;
@@ -1305,7 +1307,7 @@ interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>,
1305
1307
  */
1306
1308
  unstable_defaultShouldRevalidate?: boolean;
1307
1309
  /**
1308
- * Masked path for for this navigation, when you want to navigate the router to
1310
+ * Masked path for this navigation, when you want to navigate the router to
1309
1311
  * one location but display a separate location in the URL bar.
1310
1312
  *
1311
1313
  * This is useful for contextual navigations such as opening an image in a modal