react-router-dom 5.2.0 → 6.11.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 (70) hide show
  1. package/CHANGELOG.md +345 -0
  2. package/{LICENSE → LICENSE.md} +3 -1
  3. package/README.md +4 -36
  4. package/dist/dom.d.ts +76 -0
  5. package/dist/index.d.ts +246 -0
  6. package/dist/index.js +1058 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/main.js +19 -0
  9. package/dist/react-router-dom.development.js +1005 -0
  10. package/dist/react-router-dom.development.js.map +1 -0
  11. package/dist/react-router-dom.production.min.js +12 -0
  12. package/dist/react-router-dom.production.min.js.map +1 -0
  13. package/dist/server.d.ts +28 -0
  14. package/dist/server.js +319 -0
  15. package/dist/server.mjs +291 -0
  16. package/dist/umd/react-router-dom.development.js +1306 -0
  17. package/dist/umd/react-router-dom.development.js.map +1 -0
  18. package/dist/umd/react-router-dom.production.min.js +12 -0
  19. package/dist/umd/react-router-dom.production.min.js.map +1 -0
  20. package/package.json +38 -54
  21. package/server.d.ts +28 -0
  22. package/server.js +319 -0
  23. package/server.mjs +291 -0
  24. package/BrowserRouter.js +0 -3
  25. package/HashRouter.js +0 -3
  26. package/Link.js +0 -3
  27. package/MemoryRouter.js +0 -3
  28. package/NavLink.js +0 -3
  29. package/Prompt.js +0 -3
  30. package/Redirect.js +0 -3
  31. package/Route.js +0 -3
  32. package/Router.js +0 -3
  33. package/StaticRouter.js +0 -3
  34. package/Switch.js +0 -3
  35. package/cjs/react-router-dom.js +0 -443
  36. package/cjs/react-router-dom.js.map +0 -1
  37. package/cjs/react-router-dom.min.js +0 -2
  38. package/cjs/react-router-dom.min.js.map +0 -1
  39. package/es/BrowserRouter.js +0 -5
  40. package/es/HashRouter.js +0 -5
  41. package/es/Link.js +0 -5
  42. package/es/MemoryRouter.js +0 -5
  43. package/es/NavLink.js +0 -5
  44. package/es/Prompt.js +0 -5
  45. package/es/Redirect.js +0 -5
  46. package/es/Route.js +0 -5
  47. package/es/Router.js +0 -5
  48. package/es/StaticRouter.js +0 -5
  49. package/es/Switch.js +0 -5
  50. package/es/generatePath.js +0 -5
  51. package/es/matchPath.js +0 -5
  52. package/es/warnAboutDeprecatedESMImport.js +0 -34
  53. package/es/withRouter.js +0 -5
  54. package/esm/react-router-dom.js +0 -317
  55. package/esm/react-router-dom.js.map +0 -1
  56. package/generatePath.js +0 -3
  57. package/index.js +0 -7
  58. package/matchPath.js +0 -3
  59. package/modules/BrowserRouter.js +0 -36
  60. package/modules/HashRouter.js +0 -35
  61. package/modules/Link.js +0 -146
  62. package/modules/NavLink.js +0 -125
  63. package/modules/index.js +0 -21
  64. package/modules/utils/locationUtils.js +0 -10
  65. package/umd/react-router-dom.js +0 -3969
  66. package/umd/react-router-dom.js.map +0 -1
  67. package/umd/react-router-dom.min.js +0 -2
  68. package/umd/react-router-dom.min.js.map +0 -1
  69. package/warnAboutDeprecatedCJSRequire.js +0 -36
  70. package/withRouter.js +0 -3
@@ -0,0 +1,1306 @@
1
+ /**
2
+ * React Router DOM v6.11.2
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ (function (global, factory) {
12
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-router'), require('@remix-run/router')) :
13
+ typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-router', '@remix-run/router'], factory) :
14
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactRouterDOM = {}, global.React, global.ReactRouter, global.RemixRouter));
15
+ })(this, (function (exports, React, reactRouter, router) { 'use strict';
16
+
17
+ function _interopNamespace(e) {
18
+ if (e && e.__esModule) return e;
19
+ var n = Object.create(null);
20
+ if (e) {
21
+ Object.keys(e).forEach(function (k) {
22
+ if (k !== 'default') {
23
+ var d = Object.getOwnPropertyDescriptor(e, k);
24
+ Object.defineProperty(n, k, d.get ? d : {
25
+ enumerable: true,
26
+ get: function () { return e[k]; }
27
+ });
28
+ }
29
+ });
30
+ }
31
+ n["default"] = e;
32
+ return Object.freeze(n);
33
+ }
34
+
35
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
36
+
37
+ function _extends() {
38
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
39
+ for (var i = 1; i < arguments.length; i++) {
40
+ var source = arguments[i];
41
+
42
+ for (var key in source) {
43
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
44
+ target[key] = source[key];
45
+ }
46
+ }
47
+ }
48
+
49
+ return target;
50
+ };
51
+ return _extends.apply(this, arguments);
52
+ }
53
+
54
+ function _objectWithoutPropertiesLoose(source, excluded) {
55
+ if (source == null) return {};
56
+ var target = {};
57
+ var sourceKeys = Object.keys(source);
58
+ var key, i;
59
+
60
+ for (i = 0; i < sourceKeys.length; i++) {
61
+ key = sourceKeys[i];
62
+ if (excluded.indexOf(key) >= 0) continue;
63
+ target[key] = source[key];
64
+ }
65
+
66
+ return target;
67
+ }
68
+
69
+ const defaultMethod = "get";
70
+ const defaultEncType = "application/x-www-form-urlencoded";
71
+ function isHtmlElement(object) {
72
+ return object != null && typeof object.tagName === "string";
73
+ }
74
+ function isButtonElement(object) {
75
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
76
+ }
77
+ function isFormElement(object) {
78
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
79
+ }
80
+ function isInputElement(object) {
81
+ return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
82
+ }
83
+
84
+ function isModifiedEvent(event) {
85
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
86
+ }
87
+
88
+ function shouldProcessLinkClick(event, target) {
89
+ return event.button === 0 && ( // Ignore everything but left clicks
90
+ !target || target === "_self") && // Let browser handle "target=_blank" etc.
91
+ !isModifiedEvent(event) // Ignore clicks with modifier keys
92
+ ;
93
+ }
94
+
95
+ /**
96
+ * Creates a URLSearchParams object using the given initializer.
97
+ *
98
+ * This is identical to `new URLSearchParams(init)` except it also
99
+ * supports arrays as values in the object form of the initializer
100
+ * instead of just strings. This is convenient when you need multiple
101
+ * values for a given key, but don't want to use an array initializer.
102
+ *
103
+ * For example, instead of:
104
+ *
105
+ * let searchParams = new URLSearchParams([
106
+ * ['sort', 'name'],
107
+ * ['sort', 'price']
108
+ * ]);
109
+ *
110
+ * you can do:
111
+ *
112
+ * let searchParams = createSearchParams({
113
+ * sort: ['name', 'price']
114
+ * });
115
+ */
116
+ function createSearchParams(init) {
117
+ if (init === void 0) {
118
+ init = "";
119
+ }
120
+
121
+ return new URLSearchParams(typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {
122
+ let value = init[key];
123
+ return memo.concat(Array.isArray(value) ? value.map(v => [key, v]) : [[key, value]]);
124
+ }, []));
125
+ }
126
+ function getSearchParamsForLocation(locationSearch, defaultSearchParams) {
127
+ let searchParams = createSearchParams(locationSearch);
128
+
129
+ if (defaultSearchParams) {
130
+ for (let key of defaultSearchParams.keys()) {
131
+ if (!searchParams.has(key)) {
132
+ defaultSearchParams.getAll(key).forEach(value => {
133
+ searchParams.append(key, value);
134
+ });
135
+ }
136
+ }
137
+ }
138
+
139
+ return searchParams;
140
+ }
141
+ function getFormSubmissionInfo(target, options, basename) {
142
+ let method;
143
+ let action = null;
144
+ let encType;
145
+ let formData;
146
+
147
+ if (isFormElement(target)) {
148
+ let submissionTrigger = options.submissionTrigger;
149
+
150
+ if (options.action) {
151
+ action = options.action;
152
+ } else {
153
+ // When grabbing the action from the element, it will have had the basename
154
+ // prefixed to ensure non-JS scenarios work, so strip it since we'll
155
+ // re-prefix in the router
156
+ let attr = target.getAttribute("action");
157
+ action = attr ? router.stripBasename(attr, basename) : null;
158
+ }
159
+
160
+ method = options.method || target.getAttribute("method") || defaultMethod;
161
+ encType = options.encType || target.getAttribute("enctype") || defaultEncType;
162
+ formData = new FormData(target);
163
+
164
+ if (submissionTrigger && submissionTrigger.name) {
165
+ formData.append(submissionTrigger.name, submissionTrigger.value);
166
+ }
167
+ } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
168
+ let form = target.form;
169
+
170
+ if (form == null) {
171
+ throw new Error("Cannot submit a <button> or <input type=\"submit\"> without a <form>");
172
+ } // <button>/<input type="submit"> may override attributes of <form>
173
+
174
+
175
+ if (options.action) {
176
+ action = options.action;
177
+ } else {
178
+ // When grabbing the action from the element, it will have had the basename
179
+ // prefixed to ensure non-JS scenarios work, so strip it since we'll
180
+ // re-prefix in the router
181
+ let attr = target.getAttribute("formaction") || form.getAttribute("action");
182
+ action = attr ? router.stripBasename(attr, basename) : null;
183
+ }
184
+
185
+ method = options.method || target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
186
+ encType = options.encType || target.getAttribute("formenctype") || form.getAttribute("enctype") || defaultEncType;
187
+ formData = new FormData(form); // Include name + value from a <button>, appending in case the button name
188
+ // matches an existing input name
189
+
190
+ if (target.name) {
191
+ formData.append(target.name, target.value);
192
+ }
193
+ } else if (isHtmlElement(target)) {
194
+ throw new Error("Cannot submit element that is not <form>, <button>, or " + "<input type=\"submit|image\">");
195
+ } else {
196
+ method = options.method || defaultMethod;
197
+ action = options.action || null;
198
+ encType = options.encType || defaultEncType;
199
+
200
+ if (target instanceof FormData) {
201
+ formData = target;
202
+ } else {
203
+ formData = new FormData();
204
+
205
+ if (target instanceof URLSearchParams) {
206
+ for (let [name, value] of target) {
207
+ formData.append(name, value);
208
+ }
209
+ } else if (target != null) {
210
+ for (let name of Object.keys(target)) {
211
+ formData.append(name, target[name]);
212
+ }
213
+ }
214
+ }
215
+ }
216
+
217
+ return {
218
+ action,
219
+ method: method.toLowerCase(),
220
+ encType,
221
+ formData
222
+ };
223
+ }
224
+
225
+ const _excluded = ["onClick", "relative", "reloadDocument", "replace", "state", "target", "to", "preventScrollReset"],
226
+ _excluded2 = ["aria-current", "caseSensitive", "className", "end", "style", "to", "children"],
227
+ _excluded3 = ["reloadDocument", "replace", "method", "action", "onSubmit", "fetcherKey", "routeId", "relative", "preventScrollReset"];
228
+
229
+ function createBrowserRouter(routes, opts) {
230
+ return router.createRouter({
231
+ basename: opts == null ? void 0 : opts.basename,
232
+ future: _extends({}, opts == null ? void 0 : opts.future, {
233
+ v7_prependBasename: true
234
+ }),
235
+ history: router.createBrowserHistory({
236
+ window: opts == null ? void 0 : opts.window
237
+ }),
238
+ hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),
239
+ routes,
240
+ mapRouteProperties: reactRouter.UNSAFE_mapRouteProperties
241
+ }).initialize();
242
+ }
243
+ function createHashRouter(routes, opts) {
244
+ return router.createRouter({
245
+ basename: opts == null ? void 0 : opts.basename,
246
+ future: _extends({}, opts == null ? void 0 : opts.future, {
247
+ v7_prependBasename: true
248
+ }),
249
+ history: router.createHashHistory({
250
+ window: opts == null ? void 0 : opts.window
251
+ }),
252
+ hydrationData: (opts == null ? void 0 : opts.hydrationData) || parseHydrationData(),
253
+ routes,
254
+ mapRouteProperties: reactRouter.UNSAFE_mapRouteProperties
255
+ }).initialize();
256
+ }
257
+
258
+ function parseHydrationData() {
259
+ var _window;
260
+
261
+ let state = (_window = window) == null ? void 0 : _window.__staticRouterHydrationData;
262
+
263
+ if (state && state.errors) {
264
+ state = _extends({}, state, {
265
+ errors: deserializeErrors(state.errors)
266
+ });
267
+ }
268
+
269
+ return state;
270
+ }
271
+
272
+ function deserializeErrors(errors) {
273
+ if (!errors) return null;
274
+ let entries = Object.entries(errors);
275
+ let serialized = {};
276
+
277
+ for (let [key, val] of entries) {
278
+ // Hey you! If you change this, please change the corresponding logic in
279
+ // serializeErrors in react-router-dom/server.tsx :)
280
+ if (val && val.__type === "RouteErrorResponse") {
281
+ serialized[key] = new router.ErrorResponse(val.status, val.statusText, val.data, val.internal === true);
282
+ } else if (val && val.__type === "Error") {
283
+ let error = new Error(val.message); // Wipe away the client-side stack trace. Nothing to fill it in with
284
+ // because we don't serialize SSR stack traces for security reasons
285
+
286
+ error.stack = "";
287
+ serialized[key] = error;
288
+ } else {
289
+ serialized[key] = val;
290
+ }
291
+ }
292
+
293
+ return serialized;
294
+ } //#endregion
295
+ ////////////////////////////////////////////////////////////////////////////////
296
+ //#region Components
297
+ ////////////////////////////////////////////////////////////////////////////////
298
+
299
+
300
+ /**
301
+ * A `<Router>` for use in web browsers. Provides the cleanest URLs.
302
+ */
303
+ function BrowserRouter(_ref) {
304
+ let {
305
+ basename,
306
+ children,
307
+ window
308
+ } = _ref;
309
+ let historyRef = React__namespace.useRef();
310
+
311
+ if (historyRef.current == null) {
312
+ historyRef.current = router.createBrowserHistory({
313
+ window,
314
+ v5Compat: true
315
+ });
316
+ }
317
+
318
+ let history = historyRef.current;
319
+ let [state, setState] = React__namespace.useState({
320
+ action: history.action,
321
+ location: history.location
322
+ });
323
+ React__namespace.useLayoutEffect(() => history.listen(setState), [history]);
324
+ return /*#__PURE__*/React__namespace.createElement(reactRouter.Router, {
325
+ basename: basename,
326
+ children: children,
327
+ location: state.location,
328
+ navigationType: state.action,
329
+ navigator: history
330
+ });
331
+ }
332
+
333
+ /**
334
+ * A `<Router>` for use in web browsers. Stores the location in the hash
335
+ * portion of the URL so it is not sent to the server.
336
+ */
337
+ function HashRouter(_ref2) {
338
+ let {
339
+ basename,
340
+ children,
341
+ window
342
+ } = _ref2;
343
+ let historyRef = React__namespace.useRef();
344
+
345
+ if (historyRef.current == null) {
346
+ historyRef.current = router.createHashHistory({
347
+ window,
348
+ v5Compat: true
349
+ });
350
+ }
351
+
352
+ let history = historyRef.current;
353
+ let [state, setState] = React__namespace.useState({
354
+ action: history.action,
355
+ location: history.location
356
+ });
357
+ React__namespace.useLayoutEffect(() => history.listen(setState), [history]);
358
+ return /*#__PURE__*/React__namespace.createElement(reactRouter.Router, {
359
+ basename: basename,
360
+ children: children,
361
+ location: state.location,
362
+ navigationType: state.action,
363
+ navigator: history
364
+ });
365
+ }
366
+
367
+ /**
368
+ * A `<Router>` that accepts a pre-instantiated history object. It's important
369
+ * to note that using your own history object is highly discouraged and may add
370
+ * two versions of the history library to your bundles unless you use the same
371
+ * version of the history library that React Router uses internally.
372
+ */
373
+ function HistoryRouter(_ref3) {
374
+ let {
375
+ basename,
376
+ children,
377
+ history
378
+ } = _ref3;
379
+ const [state, setState] = React__namespace.useState({
380
+ action: history.action,
381
+ location: history.location
382
+ });
383
+ React__namespace.useLayoutEffect(() => history.listen(setState), [history]);
384
+ return /*#__PURE__*/React__namespace.createElement(reactRouter.Router, {
385
+ basename: basename,
386
+ children: children,
387
+ location: state.location,
388
+ navigationType: state.action,
389
+ navigator: history
390
+ });
391
+ }
392
+
393
+ {
394
+ HistoryRouter.displayName = "unstable_HistoryRouter";
395
+ }
396
+ const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
397
+ const ABSOLUTE_URL_REGEX = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
398
+ /**
399
+ * The public API for rendering a history-aware <a>.
400
+ */
401
+
402
+ const Link = /*#__PURE__*/React__namespace.forwardRef(function LinkWithRef(_ref4, ref) {
403
+ let {
404
+ onClick,
405
+ relative,
406
+ reloadDocument,
407
+ replace,
408
+ state,
409
+ target,
410
+ to,
411
+ preventScrollReset
412
+ } = _ref4,
413
+ rest = _objectWithoutPropertiesLoose(_ref4, _excluded);
414
+
415
+ let {
416
+ basename
417
+ } = React__namespace.useContext(reactRouter.UNSAFE_NavigationContext); // Rendered into <a href> for absolute URLs
418
+
419
+ let absoluteHref;
420
+ let isExternal = false;
421
+
422
+ if (typeof to === "string" && ABSOLUTE_URL_REGEX.test(to)) {
423
+ // Render the absolute href server- and client-side
424
+ absoluteHref = to; // Only check for external origins client-side
425
+
426
+ if (isBrowser) {
427
+ try {
428
+ let currentUrl = new URL(window.location.href);
429
+ let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
430
+ let path = router.stripBasename(targetUrl.pathname, basename);
431
+
432
+ if (targetUrl.origin === currentUrl.origin && path != null) {
433
+ // Strip the protocol/origin/basename for same-origin absolute URLs
434
+ to = path + targetUrl.search + targetUrl.hash;
435
+ } else {
436
+ isExternal = true;
437
+ }
438
+ } catch (e) {
439
+ // We can't do external URL detection without a valid URL
440
+ router.UNSAFE_warning(false, "<Link to=\"" + to + "\"> contains an invalid URL which will probably break " + "when clicked - please update to a valid URL path.") ;
441
+ }
442
+ }
443
+ } // Rendered into <a href> for relative URLs
444
+
445
+
446
+ let href = reactRouter.useHref(to, {
447
+ relative
448
+ });
449
+ let internalOnClick = useLinkClickHandler(to, {
450
+ replace,
451
+ state,
452
+ target,
453
+ preventScrollReset,
454
+ relative
455
+ });
456
+
457
+ function handleClick(event) {
458
+ if (onClick) onClick(event);
459
+
460
+ if (!event.defaultPrevented) {
461
+ internalOnClick(event);
462
+ }
463
+ }
464
+
465
+ return (
466
+ /*#__PURE__*/
467
+ // eslint-disable-next-line jsx-a11y/anchor-has-content
468
+ React__namespace.createElement("a", _extends({}, rest, {
469
+ href: absoluteHref || href,
470
+ onClick: isExternal || reloadDocument ? onClick : handleClick,
471
+ ref: ref,
472
+ target: target
473
+ }))
474
+ );
475
+ });
476
+
477
+ {
478
+ Link.displayName = "Link";
479
+ }
480
+
481
+ /**
482
+ * A <Link> wrapper that knows if it's "active" or not.
483
+ */
484
+ const NavLink = /*#__PURE__*/React__namespace.forwardRef(function NavLinkWithRef(_ref5, ref) {
485
+ let {
486
+ "aria-current": ariaCurrentProp = "page",
487
+ caseSensitive = false,
488
+ className: classNameProp = "",
489
+ end = false,
490
+ style: styleProp,
491
+ to,
492
+ children
493
+ } = _ref5,
494
+ rest = _objectWithoutPropertiesLoose(_ref5, _excluded2);
495
+
496
+ let path = reactRouter.useResolvedPath(to, {
497
+ relative: rest.relative
498
+ });
499
+ let location = reactRouter.useLocation();
500
+ let routerState = React__namespace.useContext(reactRouter.UNSAFE_DataRouterStateContext);
501
+ let {
502
+ navigator
503
+ } = React__namespace.useContext(reactRouter.UNSAFE_NavigationContext);
504
+ let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
505
+ let locationPathname = location.pathname;
506
+ let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
507
+
508
+ if (!caseSensitive) {
509
+ locationPathname = locationPathname.toLowerCase();
510
+ nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
511
+ toPathname = toPathname.toLowerCase();
512
+ }
513
+
514
+ let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(toPathname.length) === "/";
515
+ let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
516
+ let ariaCurrent = isActive ? ariaCurrentProp : undefined;
517
+ let className;
518
+
519
+ if (typeof classNameProp === "function") {
520
+ className = classNameProp({
521
+ isActive,
522
+ isPending
523
+ });
524
+ } else {
525
+ // If the className prop is not a function, we use a default `active`
526
+ // class for <NavLink />s that are active. In v5 `active` was the default
527
+ // value for `activeClassName`, but we are removing that API and can still
528
+ // use the old default behavior for a cleaner upgrade path and keep the
529
+ // simple styling rules working as they currently do.
530
+ className = [classNameProp, isActive ? "active" : null, isPending ? "pending" : null].filter(Boolean).join(" ");
531
+ }
532
+
533
+ let style = typeof styleProp === "function" ? styleProp({
534
+ isActive,
535
+ isPending
536
+ }) : styleProp;
537
+ return /*#__PURE__*/React__namespace.createElement(Link, _extends({}, rest, {
538
+ "aria-current": ariaCurrent,
539
+ className: className,
540
+ ref: ref,
541
+ style: style,
542
+ to: to
543
+ }), typeof children === "function" ? children({
544
+ isActive,
545
+ isPending
546
+ }) : children);
547
+ });
548
+
549
+ {
550
+ NavLink.displayName = "NavLink";
551
+ }
552
+
553
+ /**
554
+ * A `@remix-run/router`-aware `<form>`. It behaves like a normal form except
555
+ * that the interaction with the server is with `fetch` instead of new document
556
+ * requests, allowing components to add nicer UX to the page as the form is
557
+ * submitted and returns with data.
558
+ */
559
+ const Form = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
560
+ return /*#__PURE__*/React__namespace.createElement(FormImpl, _extends({}, props, {
561
+ ref: ref
562
+ }));
563
+ });
564
+
565
+ {
566
+ Form.displayName = "Form";
567
+ }
568
+
569
+ const FormImpl = /*#__PURE__*/React__namespace.forwardRef((_ref6, forwardedRef) => {
570
+ let {
571
+ reloadDocument,
572
+ replace,
573
+ method = defaultMethod,
574
+ action,
575
+ onSubmit,
576
+ fetcherKey,
577
+ routeId,
578
+ relative,
579
+ preventScrollReset
580
+ } = _ref6,
581
+ props = _objectWithoutPropertiesLoose(_ref6, _excluded3);
582
+
583
+ let submit = useSubmitImpl(fetcherKey, routeId);
584
+ let formMethod = method.toLowerCase() === "get" ? "get" : "post";
585
+ let formAction = useFormAction(action, {
586
+ relative
587
+ });
588
+
589
+ let submitHandler = event => {
590
+ onSubmit && onSubmit(event);
591
+ if (event.defaultPrevented) return;
592
+ event.preventDefault();
593
+ let submitter = event.nativeEvent.submitter;
594
+ let submitMethod = (submitter == null ? void 0 : submitter.getAttribute("formmethod")) || method;
595
+ submit(submitter || event.currentTarget, {
596
+ method: submitMethod,
597
+ replace,
598
+ relative,
599
+ preventScrollReset
600
+ });
601
+ };
602
+
603
+ return /*#__PURE__*/React__namespace.createElement("form", _extends({
604
+ ref: forwardedRef,
605
+ method: formMethod,
606
+ action: formAction,
607
+ onSubmit: reloadDocument ? onSubmit : submitHandler
608
+ }, props));
609
+ });
610
+
611
+ {
612
+ FormImpl.displayName = "FormImpl";
613
+ }
614
+
615
+ /**
616
+ * This component will emulate the browser's scroll restoration on location
617
+ * changes.
618
+ */
619
+ function ScrollRestoration(_ref7) {
620
+ let {
621
+ getKey,
622
+ storageKey
623
+ } = _ref7;
624
+ useScrollRestoration({
625
+ getKey,
626
+ storageKey
627
+ });
628
+ return null;
629
+ }
630
+
631
+ {
632
+ ScrollRestoration.displayName = "ScrollRestoration";
633
+ } //#endregion
634
+ ////////////////////////////////////////////////////////////////////////////////
635
+ //#region Hooks
636
+ ////////////////////////////////////////////////////////////////////////////////
637
+
638
+
639
+ var DataRouterHook;
640
+
641
+ (function (DataRouterHook) {
642
+ DataRouterHook["UseScrollRestoration"] = "useScrollRestoration";
643
+ DataRouterHook["UseSubmitImpl"] = "useSubmitImpl";
644
+ DataRouterHook["UseFetcher"] = "useFetcher";
645
+ })(DataRouterHook || (DataRouterHook = {}));
646
+
647
+ var DataRouterStateHook;
648
+
649
+ (function (DataRouterStateHook) {
650
+ DataRouterStateHook["UseFetchers"] = "useFetchers";
651
+ DataRouterStateHook["UseScrollRestoration"] = "useScrollRestoration";
652
+ })(DataRouterStateHook || (DataRouterStateHook = {}));
653
+
654
+ function getDataRouterConsoleError(hookName) {
655
+ return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
656
+ }
657
+
658
+ function useDataRouterContext(hookName) {
659
+ let ctx = React__namespace.useContext(reactRouter.UNSAFE_DataRouterContext);
660
+ !ctx ? router.UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : void 0;
661
+ return ctx;
662
+ }
663
+
664
+ function useDataRouterState(hookName) {
665
+ let state = React__namespace.useContext(reactRouter.UNSAFE_DataRouterStateContext);
666
+ !state ? router.UNSAFE_invariant(false, getDataRouterConsoleError(hookName)) : void 0;
667
+ return state;
668
+ }
669
+ /**
670
+ * Handles the click behavior for router `<Link>` components. This is useful if
671
+ * you need to create custom `<Link>` components with the same click behavior we
672
+ * use in our exported `<Link>`.
673
+ */
674
+
675
+
676
+ function useLinkClickHandler(to, _temp) {
677
+ let {
678
+ target,
679
+ replace: replaceProp,
680
+ state,
681
+ preventScrollReset,
682
+ relative
683
+ } = _temp === void 0 ? {} : _temp;
684
+ let navigate = reactRouter.useNavigate();
685
+ let location = reactRouter.useLocation();
686
+ let path = reactRouter.useResolvedPath(to, {
687
+ relative
688
+ });
689
+ return React__namespace.useCallback(event => {
690
+ if (shouldProcessLinkClick(event, target)) {
691
+ event.preventDefault(); // If the URL hasn't changed, a regular <a> will do a replace instead of
692
+ // a push, so do the same here unless the replace prop is explicitly set
693
+
694
+ let replace = replaceProp !== undefined ? replaceProp : reactRouter.createPath(location) === reactRouter.createPath(path);
695
+ navigate(to, {
696
+ replace,
697
+ state,
698
+ preventScrollReset,
699
+ relative
700
+ });
701
+ }
702
+ }, [location, navigate, path, replaceProp, state, target, to, preventScrollReset, relative]);
703
+ }
704
+ /**
705
+ * A convenient wrapper for reading and writing search parameters via the
706
+ * URLSearchParams interface.
707
+ */
708
+
709
+ function useSearchParams(defaultInit) {
710
+ router.UNSAFE_warning(typeof URLSearchParams !== "undefined", "You cannot use the `useSearchParams` hook in a browser that does not " + "support the URLSearchParams API. If you need to support Internet " + "Explorer 11, we recommend you load a polyfill such as " + "https://github.com/ungap/url-search-params\n\n" + "If you're unsure how to load polyfills, we recommend you check out " + "https://polyfill.io/v3/ which provides some recommendations about how " + "to load polyfills only for users that need them, instead of for every " + "user.") ;
711
+ let defaultSearchParamsRef = React__namespace.useRef(createSearchParams(defaultInit));
712
+ let hasSetSearchParamsRef = React__namespace.useRef(false);
713
+ let location = reactRouter.useLocation();
714
+ let searchParams = React__namespace.useMemo(() => // Only merge in the defaults if we haven't yet called setSearchParams.
715
+ // Once we call that we want those to take precedence, otherwise you can't
716
+ // remove a param with setSearchParams({}) if it has an initial value
717
+ getSearchParamsForLocation(location.search, hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current), [location.search]);
718
+ let navigate = reactRouter.useNavigate();
719
+ let setSearchParams = React__namespace.useCallback((nextInit, navigateOptions) => {
720
+ const newSearchParams = createSearchParams(typeof nextInit === "function" ? nextInit(searchParams) : nextInit);
721
+ hasSetSearchParamsRef.current = true;
722
+ navigate("?" + newSearchParams, navigateOptions);
723
+ }, [navigate, searchParams]);
724
+ return [searchParams, setSearchParams];
725
+ }
726
+
727
+ /**
728
+ * Returns a function that may be used to programmatically submit a form (or
729
+ * some arbitrary data) to the server.
730
+ */
731
+ function useSubmit() {
732
+ return useSubmitImpl();
733
+ }
734
+
735
+ function useSubmitImpl(fetcherKey, fetcherRouteId) {
736
+ let {
737
+ router: router$1
738
+ } = useDataRouterContext(DataRouterHook.UseSubmitImpl);
739
+ let {
740
+ basename
741
+ } = React__namespace.useContext(reactRouter.UNSAFE_NavigationContext);
742
+ let currentRouteId = reactRouter.UNSAFE_useRouteId();
743
+ return React__namespace.useCallback(function (target, options) {
744
+ if (options === void 0) {
745
+ options = {};
746
+ }
747
+
748
+ if (typeof document === "undefined") {
749
+ throw new Error("You are calling submit during the server render. " + "Try calling submit within a `useEffect` or callback instead.");
750
+ }
751
+
752
+ let {
753
+ action,
754
+ method,
755
+ encType,
756
+ formData
757
+ } = getFormSubmissionInfo(target, options, basename); // Base options shared between fetch() and navigate()
758
+
759
+ let opts = {
760
+ preventScrollReset: options.preventScrollReset,
761
+ formData,
762
+ formMethod: method,
763
+ formEncType: encType
764
+ };
765
+
766
+ if (fetcherKey) {
767
+ !(fetcherRouteId != null) ? router.UNSAFE_invariant(false, "No routeId available for useFetcher()") : void 0;
768
+ router$1.fetch(fetcherKey, fetcherRouteId, action, opts);
769
+ } else {
770
+ router$1.navigate(action, _extends({}, opts, {
771
+ replace: options.replace,
772
+ fromRouteId: currentRouteId
773
+ }));
774
+ }
775
+ }, [router$1, basename, fetcherKey, fetcherRouteId, currentRouteId]);
776
+ } // v7: Eventually we should deprecate this entirely in favor of using the
777
+ // router method directly?
778
+
779
+
780
+ function useFormAction(action, _temp2) {
781
+ let {
782
+ relative
783
+ } = _temp2 === void 0 ? {} : _temp2;
784
+ let {
785
+ basename
786
+ } = React__namespace.useContext(reactRouter.UNSAFE_NavigationContext);
787
+ let routeContext = React__namespace.useContext(reactRouter.UNSAFE_RouteContext);
788
+ !routeContext ? router.UNSAFE_invariant(false, "useFormAction must be used inside a RouteContext") : void 0;
789
+ let [match] = routeContext.matches.slice(-1); // Shallow clone path so we can modify it below, otherwise we modify the
790
+ // object referenced by useMemo inside useResolvedPath
791
+
792
+ let path = _extends({}, reactRouter.useResolvedPath(action ? action : ".", {
793
+ relative
794
+ })); // Previously we set the default action to ".". The problem with this is that
795
+ // `useResolvedPath(".")` excludes search params and the hash of the resolved
796
+ // URL. This is the intended behavior of when "." is specifically provided as
797
+ // the form action, but inconsistent w/ browsers when the action is omitted.
798
+ // https://github.com/remix-run/remix/issues/927
799
+
800
+
801
+ let location = reactRouter.useLocation();
802
+
803
+ if (action == null) {
804
+ // Safe to write to these directly here since if action was undefined, we
805
+ // would have called useResolvedPath(".") which will never include a search
806
+ // or hash
807
+ path.search = location.search;
808
+ path.hash = location.hash; // When grabbing search params from the URL, remove the automatically
809
+ // inserted ?index param so we match the useResolvedPath search behavior
810
+ // which would not include ?index
811
+
812
+ if (match.route.index) {
813
+ let params = new URLSearchParams(path.search);
814
+ params.delete("index");
815
+ path.search = params.toString() ? "?" + params.toString() : "";
816
+ }
817
+ }
818
+
819
+ if ((!action || action === ".") && match.route.index) {
820
+ path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
821
+ } // If we're operating within a basename, prepend it to the pathname prior
822
+ // to creating the form action. If this is a root navigation, then just use
823
+ // the raw basename which allows the basename to have full control over the
824
+ // presence of a trailing slash on root actions
825
+
826
+
827
+ if (basename !== "/") {
828
+ path.pathname = path.pathname === "/" ? basename : router.joinPaths([basename, path.pathname]);
829
+ }
830
+
831
+ return reactRouter.createPath(path);
832
+ }
833
+
834
+ function createFetcherForm(fetcherKey, routeId) {
835
+ let FetcherForm = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
836
+ return /*#__PURE__*/React__namespace.createElement(FormImpl, _extends({}, props, {
837
+ ref: ref,
838
+ fetcherKey: fetcherKey,
839
+ routeId: routeId
840
+ }));
841
+ });
842
+
843
+ {
844
+ FetcherForm.displayName = "fetcher.Form";
845
+ }
846
+
847
+ return FetcherForm;
848
+ }
849
+
850
+ let fetcherId = 0;
851
+
852
+ /**
853
+ * Interacts with route loaders and actions without causing a navigation. Great
854
+ * for any interaction that stays on the same page.
855
+ */
856
+ function useFetcher() {
857
+ var _route$matches;
858
+
859
+ let {
860
+ router: router$1
861
+ } = useDataRouterContext(DataRouterHook.UseFetcher);
862
+ let route = React__namespace.useContext(reactRouter.UNSAFE_RouteContext);
863
+ !route ? router.UNSAFE_invariant(false, "useFetcher must be used inside a RouteContext") : void 0;
864
+ let routeId = (_route$matches = route.matches[route.matches.length - 1]) == null ? void 0 : _route$matches.route.id;
865
+ !(routeId != null) ? router.UNSAFE_invariant(false, "useFetcher can only be used on routes that contain a unique \"id\"") : void 0;
866
+ let [fetcherKey] = React__namespace.useState(() => String(++fetcherId));
867
+ let [Form] = React__namespace.useState(() => {
868
+ !routeId ? router.UNSAFE_invariant(false, "No routeId available for fetcher.Form()") : void 0;
869
+ return createFetcherForm(fetcherKey, routeId);
870
+ });
871
+ let [load] = React__namespace.useState(() => href => {
872
+ !router$1 ? router.UNSAFE_invariant(false, "No router available for fetcher.load()") : void 0;
873
+ !routeId ? router.UNSAFE_invariant(false, "No routeId available for fetcher.load()") : void 0;
874
+ router$1.fetch(fetcherKey, routeId, href);
875
+ });
876
+ let submit = useSubmitImpl(fetcherKey, routeId);
877
+ let fetcher = router$1.getFetcher(fetcherKey);
878
+ let fetcherWithComponents = React__namespace.useMemo(() => _extends({
879
+ Form,
880
+ submit,
881
+ load
882
+ }, fetcher), [fetcher, Form, submit, load]);
883
+ React__namespace.useEffect(() => {
884
+ // Is this busted when the React team gets real weird and calls effects
885
+ // twice on mount? We really just need to garbage collect here when this
886
+ // fetcher is no longer around.
887
+ return () => {
888
+ if (!router$1) {
889
+ console.warn("No router available to clean up from useFetcher()");
890
+ return;
891
+ }
892
+
893
+ router$1.deleteFetcher(fetcherKey);
894
+ };
895
+ }, [router$1, fetcherKey]);
896
+ return fetcherWithComponents;
897
+ }
898
+ /**
899
+ * Provides all fetchers currently on the page. Useful for layouts and parent
900
+ * routes that need to provide pending/optimistic UI regarding the fetch.
901
+ */
902
+
903
+ function useFetchers() {
904
+ let state = useDataRouterState(DataRouterStateHook.UseFetchers);
905
+ return [...state.fetchers.values()];
906
+ }
907
+ const SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
908
+ let savedScrollPositions = {};
909
+ /**
910
+ * When rendered inside a RouterProvider, will restore scroll positions on navigations
911
+ */
912
+
913
+ function useScrollRestoration(_temp3) {
914
+ let {
915
+ getKey,
916
+ storageKey
917
+ } = _temp3 === void 0 ? {} : _temp3;
918
+ let {
919
+ router
920
+ } = useDataRouterContext(DataRouterHook.UseScrollRestoration);
921
+ let {
922
+ restoreScrollPosition,
923
+ preventScrollReset
924
+ } = useDataRouterState(DataRouterStateHook.UseScrollRestoration);
925
+ let location = reactRouter.useLocation();
926
+ let matches = reactRouter.useMatches();
927
+ let navigation = reactRouter.useNavigation(); // Trigger manual scroll restoration while we're active
928
+
929
+ React__namespace.useEffect(() => {
930
+ window.history.scrollRestoration = "manual";
931
+ return () => {
932
+ window.history.scrollRestoration = "auto";
933
+ };
934
+ }, []); // Save positions on pagehide
935
+
936
+ usePageHide(React__namespace.useCallback(() => {
937
+ if (navigation.state === "idle") {
938
+ let key = (getKey ? getKey(location, matches) : null) || location.key;
939
+ savedScrollPositions[key] = window.scrollY;
940
+ }
941
+
942
+ sessionStorage.setItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY, JSON.stringify(savedScrollPositions));
943
+ window.history.scrollRestoration = "auto";
944
+ }, [storageKey, getKey, navigation.state, location, matches])); // Read in any saved scroll locations
945
+
946
+ if (typeof document !== "undefined") {
947
+ // eslint-disable-next-line react-hooks/rules-of-hooks
948
+ React__namespace.useLayoutEffect(() => {
949
+ try {
950
+ let sessionPositions = sessionStorage.getItem(storageKey || SCROLL_RESTORATION_STORAGE_KEY);
951
+
952
+ if (sessionPositions) {
953
+ savedScrollPositions = JSON.parse(sessionPositions);
954
+ }
955
+ } catch (e) {// no-op, use default empty object
956
+ }
957
+ }, [storageKey]); // Enable scroll restoration in the router
958
+ // eslint-disable-next-line react-hooks/rules-of-hooks
959
+
960
+ React__namespace.useLayoutEffect(() => {
961
+ let disableScrollRestoration = router == null ? void 0 : router.enableScrollRestoration(savedScrollPositions, () => window.scrollY, getKey);
962
+ return () => disableScrollRestoration && disableScrollRestoration();
963
+ }, [router, getKey]); // Restore scrolling when state.restoreScrollPosition changes
964
+ // eslint-disable-next-line react-hooks/rules-of-hooks
965
+
966
+ React__namespace.useLayoutEffect(() => {
967
+ // Explicit false means don't do anything (used for submissions)
968
+ if (restoreScrollPosition === false) {
969
+ return;
970
+ } // been here before, scroll to it
971
+
972
+
973
+ if (typeof restoreScrollPosition === "number") {
974
+ window.scrollTo(0, restoreScrollPosition);
975
+ return;
976
+ } // try to scroll to the hash
977
+
978
+
979
+ if (location.hash) {
980
+ let el = document.getElementById(location.hash.slice(1));
981
+
982
+ if (el) {
983
+ el.scrollIntoView();
984
+ return;
985
+ }
986
+ } // Don't reset if this navigation opted out
987
+
988
+
989
+ if (preventScrollReset === true) {
990
+ return;
991
+ } // otherwise go to the top on new locations
992
+
993
+
994
+ window.scrollTo(0, 0);
995
+ }, [location, restoreScrollPosition, preventScrollReset]);
996
+ }
997
+ }
998
+ /**
999
+ * Setup a callback to be fired on the window's `beforeunload` event. This is
1000
+ * useful for saving some data to `window.localStorage` just before the page
1001
+ * refreshes.
1002
+ *
1003
+ * Note: The `callback` argument should be a function created with
1004
+ * `React.useCallback()`.
1005
+ */
1006
+
1007
+ function useBeforeUnload(callback, options) {
1008
+ let {
1009
+ capture
1010
+ } = options || {};
1011
+ React__namespace.useEffect(() => {
1012
+ let opts = capture != null ? {
1013
+ capture
1014
+ } : undefined;
1015
+ window.addEventListener("beforeunload", callback, opts);
1016
+ return () => {
1017
+ window.removeEventListener("beforeunload", callback, opts);
1018
+ };
1019
+ }, [callback, capture]);
1020
+ }
1021
+ /**
1022
+ * Setup a callback to be fired on the window's `pagehide` event. This is
1023
+ * useful for saving some data to `window.localStorage` just before the page
1024
+ * refreshes. This event is better supported than beforeunload across browsers.
1025
+ *
1026
+ * Note: The `callback` argument should be a function created with
1027
+ * `React.useCallback()`.
1028
+ */
1029
+
1030
+ function usePageHide(callback, options) {
1031
+ let {
1032
+ capture
1033
+ } = options || {};
1034
+ React__namespace.useEffect(() => {
1035
+ let opts = capture != null ? {
1036
+ capture
1037
+ } : undefined;
1038
+ window.addEventListener("pagehide", callback, opts);
1039
+ return () => {
1040
+ window.removeEventListener("pagehide", callback, opts);
1041
+ };
1042
+ }, [callback, capture]);
1043
+ }
1044
+ /**
1045
+ * Wrapper around useBlocker to show a window.confirm prompt to users instead
1046
+ * of building a custom UI with useBlocker.
1047
+ *
1048
+ * Warning: This has *a lot of rough edges* and behaves very differently (and
1049
+ * very incorrectly in some cases) across browsers if user click addition
1050
+ * back/forward navigations while the confirm is open. Use at your own risk.
1051
+ */
1052
+
1053
+
1054
+ function usePrompt(_ref8) {
1055
+ let {
1056
+ when,
1057
+ message
1058
+ } = _ref8;
1059
+ let blocker = reactRouter.unstable_useBlocker(when);
1060
+ React__namespace.useEffect(() => {
1061
+ if (blocker.state === "blocked" && !when) {
1062
+ blocker.reset();
1063
+ }
1064
+ }, [blocker, when]);
1065
+ React__namespace.useEffect(() => {
1066
+ if (blocker.state === "blocked") {
1067
+ let proceed = window.confirm(message);
1068
+
1069
+ if (proceed) {
1070
+ setTimeout(blocker.proceed, 0);
1071
+ } else {
1072
+ blocker.reset();
1073
+ }
1074
+ }
1075
+ }, [blocker, message]);
1076
+ }
1077
+ //#endregion
1078
+
1079
+ Object.defineProperty(exports, 'AbortedDeferredError', {
1080
+ enumerable: true,
1081
+ get: function () { return reactRouter.AbortedDeferredError; }
1082
+ });
1083
+ Object.defineProperty(exports, 'Await', {
1084
+ enumerable: true,
1085
+ get: function () { return reactRouter.Await; }
1086
+ });
1087
+ Object.defineProperty(exports, 'MemoryRouter', {
1088
+ enumerable: true,
1089
+ get: function () { return reactRouter.MemoryRouter; }
1090
+ });
1091
+ Object.defineProperty(exports, 'Navigate', {
1092
+ enumerable: true,
1093
+ get: function () { return reactRouter.Navigate; }
1094
+ });
1095
+ Object.defineProperty(exports, 'NavigationType', {
1096
+ enumerable: true,
1097
+ get: function () { return reactRouter.NavigationType; }
1098
+ });
1099
+ Object.defineProperty(exports, 'Outlet', {
1100
+ enumerable: true,
1101
+ get: function () { return reactRouter.Outlet; }
1102
+ });
1103
+ Object.defineProperty(exports, 'Route', {
1104
+ enumerable: true,
1105
+ get: function () { return reactRouter.Route; }
1106
+ });
1107
+ Object.defineProperty(exports, 'Router', {
1108
+ enumerable: true,
1109
+ get: function () { return reactRouter.Router; }
1110
+ });
1111
+ Object.defineProperty(exports, 'RouterProvider', {
1112
+ enumerable: true,
1113
+ get: function () { return reactRouter.RouterProvider; }
1114
+ });
1115
+ Object.defineProperty(exports, 'Routes', {
1116
+ enumerable: true,
1117
+ get: function () { return reactRouter.Routes; }
1118
+ });
1119
+ Object.defineProperty(exports, 'UNSAFE_DataRouterContext', {
1120
+ enumerable: true,
1121
+ get: function () { return reactRouter.UNSAFE_DataRouterContext; }
1122
+ });
1123
+ Object.defineProperty(exports, 'UNSAFE_DataRouterStateContext', {
1124
+ enumerable: true,
1125
+ get: function () { return reactRouter.UNSAFE_DataRouterStateContext; }
1126
+ });
1127
+ Object.defineProperty(exports, 'UNSAFE_LocationContext', {
1128
+ enumerable: true,
1129
+ get: function () { return reactRouter.UNSAFE_LocationContext; }
1130
+ });
1131
+ Object.defineProperty(exports, 'UNSAFE_NavigationContext', {
1132
+ enumerable: true,
1133
+ get: function () { return reactRouter.UNSAFE_NavigationContext; }
1134
+ });
1135
+ Object.defineProperty(exports, 'UNSAFE_RouteContext', {
1136
+ enumerable: true,
1137
+ get: function () { return reactRouter.UNSAFE_RouteContext; }
1138
+ });
1139
+ Object.defineProperty(exports, 'UNSAFE_useRouteId', {
1140
+ enumerable: true,
1141
+ get: function () { return reactRouter.UNSAFE_useRouteId; }
1142
+ });
1143
+ Object.defineProperty(exports, 'createMemoryRouter', {
1144
+ enumerable: true,
1145
+ get: function () { return reactRouter.createMemoryRouter; }
1146
+ });
1147
+ Object.defineProperty(exports, 'createPath', {
1148
+ enumerable: true,
1149
+ get: function () { return reactRouter.createPath; }
1150
+ });
1151
+ Object.defineProperty(exports, 'createRoutesFromChildren', {
1152
+ enumerable: true,
1153
+ get: function () { return reactRouter.createRoutesFromChildren; }
1154
+ });
1155
+ Object.defineProperty(exports, 'createRoutesFromElements', {
1156
+ enumerable: true,
1157
+ get: function () { return reactRouter.createRoutesFromElements; }
1158
+ });
1159
+ Object.defineProperty(exports, 'defer', {
1160
+ enumerable: true,
1161
+ get: function () { return reactRouter.defer; }
1162
+ });
1163
+ Object.defineProperty(exports, 'generatePath', {
1164
+ enumerable: true,
1165
+ get: function () { return reactRouter.generatePath; }
1166
+ });
1167
+ Object.defineProperty(exports, 'isRouteErrorResponse', {
1168
+ enumerable: true,
1169
+ get: function () { return reactRouter.isRouteErrorResponse; }
1170
+ });
1171
+ Object.defineProperty(exports, 'json', {
1172
+ enumerable: true,
1173
+ get: function () { return reactRouter.json; }
1174
+ });
1175
+ Object.defineProperty(exports, 'matchPath', {
1176
+ enumerable: true,
1177
+ get: function () { return reactRouter.matchPath; }
1178
+ });
1179
+ Object.defineProperty(exports, 'matchRoutes', {
1180
+ enumerable: true,
1181
+ get: function () { return reactRouter.matchRoutes; }
1182
+ });
1183
+ Object.defineProperty(exports, 'parsePath', {
1184
+ enumerable: true,
1185
+ get: function () { return reactRouter.parsePath; }
1186
+ });
1187
+ Object.defineProperty(exports, 'redirect', {
1188
+ enumerable: true,
1189
+ get: function () { return reactRouter.redirect; }
1190
+ });
1191
+ Object.defineProperty(exports, 'renderMatches', {
1192
+ enumerable: true,
1193
+ get: function () { return reactRouter.renderMatches; }
1194
+ });
1195
+ Object.defineProperty(exports, 'resolvePath', {
1196
+ enumerable: true,
1197
+ get: function () { return reactRouter.resolvePath; }
1198
+ });
1199
+ Object.defineProperty(exports, 'unstable_useBlocker', {
1200
+ enumerable: true,
1201
+ get: function () { return reactRouter.unstable_useBlocker; }
1202
+ });
1203
+ Object.defineProperty(exports, 'useActionData', {
1204
+ enumerable: true,
1205
+ get: function () { return reactRouter.useActionData; }
1206
+ });
1207
+ Object.defineProperty(exports, 'useAsyncError', {
1208
+ enumerable: true,
1209
+ get: function () { return reactRouter.useAsyncError; }
1210
+ });
1211
+ Object.defineProperty(exports, 'useAsyncValue', {
1212
+ enumerable: true,
1213
+ get: function () { return reactRouter.useAsyncValue; }
1214
+ });
1215
+ Object.defineProperty(exports, 'useHref', {
1216
+ enumerable: true,
1217
+ get: function () { return reactRouter.useHref; }
1218
+ });
1219
+ Object.defineProperty(exports, 'useInRouterContext', {
1220
+ enumerable: true,
1221
+ get: function () { return reactRouter.useInRouterContext; }
1222
+ });
1223
+ Object.defineProperty(exports, 'useLoaderData', {
1224
+ enumerable: true,
1225
+ get: function () { return reactRouter.useLoaderData; }
1226
+ });
1227
+ Object.defineProperty(exports, 'useLocation', {
1228
+ enumerable: true,
1229
+ get: function () { return reactRouter.useLocation; }
1230
+ });
1231
+ Object.defineProperty(exports, 'useMatch', {
1232
+ enumerable: true,
1233
+ get: function () { return reactRouter.useMatch; }
1234
+ });
1235
+ Object.defineProperty(exports, 'useMatches', {
1236
+ enumerable: true,
1237
+ get: function () { return reactRouter.useMatches; }
1238
+ });
1239
+ Object.defineProperty(exports, 'useNavigate', {
1240
+ enumerable: true,
1241
+ get: function () { return reactRouter.useNavigate; }
1242
+ });
1243
+ Object.defineProperty(exports, 'useNavigation', {
1244
+ enumerable: true,
1245
+ get: function () { return reactRouter.useNavigation; }
1246
+ });
1247
+ Object.defineProperty(exports, 'useNavigationType', {
1248
+ enumerable: true,
1249
+ get: function () { return reactRouter.useNavigationType; }
1250
+ });
1251
+ Object.defineProperty(exports, 'useOutlet', {
1252
+ enumerable: true,
1253
+ get: function () { return reactRouter.useOutlet; }
1254
+ });
1255
+ Object.defineProperty(exports, 'useOutletContext', {
1256
+ enumerable: true,
1257
+ get: function () { return reactRouter.useOutletContext; }
1258
+ });
1259
+ Object.defineProperty(exports, 'useParams', {
1260
+ enumerable: true,
1261
+ get: function () { return reactRouter.useParams; }
1262
+ });
1263
+ Object.defineProperty(exports, 'useResolvedPath', {
1264
+ enumerable: true,
1265
+ get: function () { return reactRouter.useResolvedPath; }
1266
+ });
1267
+ Object.defineProperty(exports, 'useRevalidator', {
1268
+ enumerable: true,
1269
+ get: function () { return reactRouter.useRevalidator; }
1270
+ });
1271
+ Object.defineProperty(exports, 'useRouteError', {
1272
+ enumerable: true,
1273
+ get: function () { return reactRouter.useRouteError; }
1274
+ });
1275
+ Object.defineProperty(exports, 'useRouteLoaderData', {
1276
+ enumerable: true,
1277
+ get: function () { return reactRouter.useRouteLoaderData; }
1278
+ });
1279
+ Object.defineProperty(exports, 'useRoutes', {
1280
+ enumerable: true,
1281
+ get: function () { return reactRouter.useRoutes; }
1282
+ });
1283
+ exports.BrowserRouter = BrowserRouter;
1284
+ exports.Form = Form;
1285
+ exports.HashRouter = HashRouter;
1286
+ exports.Link = Link;
1287
+ exports.NavLink = NavLink;
1288
+ exports.ScrollRestoration = ScrollRestoration;
1289
+ exports.UNSAFE_useScrollRestoration = useScrollRestoration;
1290
+ exports.createBrowserRouter = createBrowserRouter;
1291
+ exports.createHashRouter = createHashRouter;
1292
+ exports.createSearchParams = createSearchParams;
1293
+ exports.unstable_HistoryRouter = HistoryRouter;
1294
+ exports.unstable_usePrompt = usePrompt;
1295
+ exports.useBeforeUnload = useBeforeUnload;
1296
+ exports.useFetcher = useFetcher;
1297
+ exports.useFetchers = useFetchers;
1298
+ exports.useFormAction = useFormAction;
1299
+ exports.useLinkClickHandler = useLinkClickHandler;
1300
+ exports.useSearchParams = useSearchParams;
1301
+ exports.useSubmit = useSubmit;
1302
+
1303
+ Object.defineProperty(exports, '__esModule', { value: true });
1304
+
1305
+ }));
1306
+ //# sourceMappingURL=react-router-dom.development.js.map