zudoku 0.3.0-dev.55 → 0.3.0-dev.56
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.
- package/dist/config/validators/validate.d.ts +12 -12
- package/dist/lib/components/DeveloperHint.d.ts +5 -0
- package/dist/lib/components/DeveloperHint.js +10 -0
- package/dist/lib/components/DeveloperHint.js.map +1 -0
- package/dist/lib/components/NotFoundPage.js +2 -2
- package/dist/lib/components/NotFoundPage.js.map +1 -1
- package/dist/lib/plugins/api-keys/ProtectedRoute.d.ts +1 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js +14 -0
- package/dist/lib/plugins/api-keys/ProtectedRoute.js.map +1 -0
- package/dist/lib/plugins/api-keys/index.js +2 -12
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +2 -2
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +3 -3
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/lib/AnchorLink-GNsUeGSX.js +705 -0
- package/lib/{AnchorLink-BaXHjhF-.js.map → AnchorLink-GNsUeGSX.js.map} +1 -1
- package/lib/Button-DpHMZvVs.js +4571 -0
- package/lib/Button-DpHMZvVs.js.map +1 -0
- package/lib/DevPortalProvider-Do9oJqme.js +1081 -0
- package/lib/{DevPortalProvider-GjdO0Xr-.js.map → DevPortalProvider-Do9oJqme.js.map} +1 -1
- package/lib/Markdown-DtLFdxD1.js +15031 -0
- package/lib/Markdown-DtLFdxD1.js.map +1 -0
- package/lib/MdxPage-CbwYRKf5.js +190 -0
- package/lib/{MdxPage-Dlujuj-J.js.map → MdxPage-CbwYRKf5.js.map} +1 -1
- package/lib/OperationList-DpR4KzIJ.js +5570 -0
- package/lib/OperationList-DpR4KzIJ.js.map +1 -0
- package/lib/Route-C1LyvITr.js +13 -0
- package/lib/{Route-CR6TEwVC.js.map → Route-C1LyvITr.js.map} +1 -1
- package/lib/Spinner-Bhbs5aPI.js +182 -0
- package/lib/Spinner-Bhbs5aPI.js.map +1 -0
- package/lib/_commonjsHelpers-BVfed4GL.js +29 -0
- package/lib/_commonjsHelpers-BVfed4GL.js.map +1 -0
- package/lib/assets/index-BPdJm2ty.js +4765 -0
- package/lib/assets/{index-CpIig0AX.js.map → index-BPdJm2ty.js.map} +1 -1
- package/lib/assets/worker-BjPv-hjP.js +14897 -0
- package/lib/assets/{worker-B5k2aBV9.js.map → worker-BjPv-hjP.js.map} +1 -1
- package/lib/context-_fYfJFgk.js +14 -0
- package/lib/{context-BoN_3uxi.js.map → context-_fYfJFgk.js.map} +1 -1
- package/lib/hook-Biq3zYel.js +92 -0
- package/lib/hook-Biq3zYel.js.map +1 -0
- package/lib/{index-Dih8IAqw.js → index-DZ910ttL.js} +83 -103
- package/lib/{index-Dih8IAqw.js.map → index-DZ910ttL.js.map} +1 -1
- package/lib/index-gsAuUwQh.js +418 -0
- package/lib/index-gsAuUwQh.js.map +1 -0
- package/lib/index-pI9JkN46.js +4765 -0
- package/lib/{index-Bn03IPZt.js.map → index-pI9JkN46.js.map} +1 -1
- package/lib/jsx-runtime-CJZJivg2.js +1526 -0
- package/lib/{jsx-runtime-DvZ6OKMM.js.map → jsx-runtime-CJZJivg2.js.map} +1 -1
- package/lib/prism-bash.min-DadFsM4Z.js +7 -0
- package/lib/{prism-bash.min-BtBk0onv.js.map → prism-bash.min-DadFsM4Z.js.map} +1 -1
- package/lib/prism-csharp.min-Yizuc34Y.js +35 -0
- package/lib/{prism-csharp.min-Cv7D49bv.js.map → prism-csharp.min-Yizuc34Y.js.map} +1 -1
- package/lib/prism-java.min-d5iT_mOd.js +7 -0
- package/lib/{prism-java.min-tNK-JX6x.js.map → prism-java.min-d5iT_mOd.js.map} +1 -1
- package/lib/prism-json.min-B1GJqK1k.js +2 -0
- package/lib/{prism-json.min-Cdtv-CME.js.map → prism-json.min-B1GJqK1k.js.map} +1 -1
- package/lib/prism-markup-templating-DZrrEs0A.js +62 -0
- package/lib/{prism-markup-templating-iotg2sCU.js.map → prism-markup-templating-DZrrEs0A.js.map} +1 -1
- package/lib/prism-objectivec.min-BXSWqpJJ.js +2 -0
- package/lib/{prism-objectivec.min-CY4WGixz.js.map → prism-objectivec.min-BXSWqpJJ.js.map} +1 -1
- package/lib/prism-php.min-o7FpoMP_.js +11 -0
- package/lib/{prism-php.min-T6sIVgED.js.map → prism-php.min-o7FpoMP_.js.map} +1 -1
- package/lib/prism-ruby.min-C7LwcKyz.js +10 -0
- package/lib/{prism-ruby.min-B-2KAa4y.js.map → prism-ruby.min-C7LwcKyz.js.map} +1 -1
- package/lib/router-CBw2vqJE.js +2973 -0
- package/lib/{router-ButO1QyY.js.map → router-CBw2vqJE.js.map} +1 -1
- package/lib/slugify-CiPVjteN.js +28 -0
- package/lib/{slugify-CmS97Vy8.js.map → slugify-CiPVjteN.js.map} +1 -1
- package/lib/state-DKdaQzvh.js +288 -0
- package/lib/{state-CmGfNKhR.js.map → state-DKdaQzvh.js.map} +1 -1
- package/lib/urql-DMlBWUKL.js +1592 -0
- package/lib/{urql-DtVKPBx_.js.map → urql-DMlBWUKL.js.map} +1 -1
- package/lib/util-_jwUlTBU.js +41 -0
- package/lib/{util-B5KX4h4M.js.map → util-_jwUlTBU.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +18 -24
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +34 -43
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +734 -1121
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +822 -1076
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +9691 -13786
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +171 -208
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +33 -41
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +6 -6
- package/lib/zudoku.plugin-redirect.js +8 -10
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/DeveloperHint.tsx +25 -0
- package/src/lib/components/NotFoundPage.tsx +8 -14
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +29 -0
- package/src/lib/plugins/api-keys/index.tsx +2 -21
- package/src/lib/plugins/openapi/OperationList.tsx +5 -8
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +3 -5
- package/lib/AnchorLink-BaXHjhF-.js +0 -989
- package/lib/Combination-BfufJFkX.js +0 -1365
- package/lib/Combination-BfufJFkX.js.map +0 -1
- package/lib/DevPortalProvider-GjdO0Xr-.js +0 -1610
- package/lib/Markdown-B8nPVql1.js +0 -19708
- package/lib/Markdown-B8nPVql1.js.map +0 -1
- package/lib/MdxPage-Dlujuj-J.js +0 -223
- package/lib/OperationList-krPgt6sE.js +0 -8041
- package/lib/OperationList-krPgt6sE.js.map +0 -1
- package/lib/Playground-DOHxca0P.js +0 -539
- package/lib/Playground-DOHxca0P.js.map +0 -1
- package/lib/Route-CR6TEwVC.js +0 -13
- package/lib/Select-Boi_pe3L.js +0 -5298
- package/lib/Select-Boi_pe3L.js.map +0 -1
- package/lib/Spinner-oU0QJmi_.js +0 -16
- package/lib/Spinner-oU0QJmi_.js.map +0 -1
- package/lib/_commonjsHelpers-BxmBWJD2.js +0 -34
- package/lib/_commonjsHelpers-BxmBWJD2.js.map +0 -1
- package/lib/assets/index-CpIig0AX.js +0 -6341
- package/lib/assets/worker-B5k2aBV9.js +0 -18921
- package/lib/context-BoN_3uxi.js +0 -17
- package/lib/hook-CIuFuyBT.js +0 -90
- package/lib/hook-CIuFuyBT.js.map +0 -1
- package/lib/index-BL1P4Gqq.js +0 -280
- package/lib/index-BL1P4Gqq.js.map +0 -1
- package/lib/index-Bn03IPZt.js +0 -6341
- package/lib/index-FprhHF51.js +0 -253
- package/lib/index-FprhHF51.js.map +0 -1
- package/lib/jsx-runtime-DvZ6OKMM.js +0 -2110
- package/lib/mutation-DWY9x2Uc.js +0 -250
- package/lib/mutation-DWY9x2Uc.js.map +0 -1
- package/lib/prism-bash.min-BtBk0onv.js +0 -7
- package/lib/prism-csharp.min-Cv7D49bv.js +0 -30
- package/lib/prism-java.min-tNK-JX6x.js +0 -7
- package/lib/prism-json.min-Cdtv-CME.js +0 -2
- package/lib/prism-markup-templating-iotg2sCU.js +0 -94
- package/lib/prism-objectivec.min-CY4WGixz.js +0 -2
- package/lib/prism-php.min-T6sIVgED.js +0 -11
- package/lib/prism-ruby.min-B-2KAa4y.js +0 -8
- package/lib/router-ButO1QyY.js +0 -4062
- package/lib/slugify-CmS97Vy8.js +0 -50
- package/lib/state-CmGfNKhR.js +0 -436
- package/lib/urql-DtVKPBx_.js +0 -2567
- package/lib/util-B5KX4h4M.js +0 -55
|
@@ -1,2110 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import React__default from "react";
|
|
3
|
-
import { a as invariant, j as joinPaths, g as getResolveToMatches, w as warning, b as resolveTo, c as matchRoutes, A as Action, p as parsePath, s as stripBasename, i as isRouteErrorResponse, m as matchPath, d as convertRouteMatchToUiMatch, I as IDLE_BLOCKER, e as createMemoryHistory, f as AbortedDeferredError, h as createRouter, k as createPath, l as defer, n as generatePath, o as json, q as redirect, t as redirectDocument, u as resolvePath } from "./router-ButO1QyY.js";
|
|
4
|
-
/**
|
|
5
|
-
* React Router v6.24.1
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Remix Software Inc.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
11
|
-
*
|
|
12
|
-
* @license MIT
|
|
13
|
-
*/
|
|
14
|
-
function _extends() {
|
|
15
|
-
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
16
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
17
|
-
var source = arguments[i];
|
|
18
|
-
for (var key in source) {
|
|
19
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
20
|
-
target[key] = source[key];
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return target;
|
|
25
|
-
};
|
|
26
|
-
return _extends.apply(this, arguments);
|
|
27
|
-
}
|
|
28
|
-
const DataRouterContext = /* @__PURE__ */ React.createContext(null);
|
|
29
|
-
if (process.env.NODE_ENV !== "production") {
|
|
30
|
-
DataRouterContext.displayName = "DataRouter";
|
|
31
|
-
}
|
|
32
|
-
const DataRouterStateContext = /* @__PURE__ */ React.createContext(null);
|
|
33
|
-
if (process.env.NODE_ENV !== "production") {
|
|
34
|
-
DataRouterStateContext.displayName = "DataRouterState";
|
|
35
|
-
}
|
|
36
|
-
const AwaitContext = /* @__PURE__ */ React.createContext(null);
|
|
37
|
-
if (process.env.NODE_ENV !== "production") {
|
|
38
|
-
AwaitContext.displayName = "Await";
|
|
39
|
-
}
|
|
40
|
-
const NavigationContext = /* @__PURE__ */ React.createContext(null);
|
|
41
|
-
if (process.env.NODE_ENV !== "production") {
|
|
42
|
-
NavigationContext.displayName = "Navigation";
|
|
43
|
-
}
|
|
44
|
-
const LocationContext = /* @__PURE__ */ React.createContext(null);
|
|
45
|
-
if (process.env.NODE_ENV !== "production") {
|
|
46
|
-
LocationContext.displayName = "Location";
|
|
47
|
-
}
|
|
48
|
-
const RouteContext = /* @__PURE__ */ React.createContext({
|
|
49
|
-
outlet: null,
|
|
50
|
-
matches: [],
|
|
51
|
-
isDataRoute: false
|
|
52
|
-
});
|
|
53
|
-
if (process.env.NODE_ENV !== "production") {
|
|
54
|
-
RouteContext.displayName = "Route";
|
|
55
|
-
}
|
|
56
|
-
const RouteErrorContext = /* @__PURE__ */ React.createContext(null);
|
|
57
|
-
if (process.env.NODE_ENV !== "production") {
|
|
58
|
-
RouteErrorContext.displayName = "RouteError";
|
|
59
|
-
}
|
|
60
|
-
function useHref(to, _temp) {
|
|
61
|
-
let {
|
|
62
|
-
relative
|
|
63
|
-
} = _temp === void 0 ? {} : _temp;
|
|
64
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
65
|
-
false,
|
|
66
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
67
|
-
// router loaded. We can help them understand how to avoid that.
|
|
68
|
-
"useHref() may be used only in the context of a <Router> component."
|
|
69
|
-
) : invariant(false) : void 0;
|
|
70
|
-
let {
|
|
71
|
-
basename,
|
|
72
|
-
navigator
|
|
73
|
-
} = React.useContext(NavigationContext);
|
|
74
|
-
let {
|
|
75
|
-
hash,
|
|
76
|
-
pathname,
|
|
77
|
-
search
|
|
78
|
-
} = useResolvedPath(to, {
|
|
79
|
-
relative
|
|
80
|
-
});
|
|
81
|
-
let joinedPathname = pathname;
|
|
82
|
-
if (basename !== "/") {
|
|
83
|
-
joinedPathname = pathname === "/" ? basename : joinPaths([basename, pathname]);
|
|
84
|
-
}
|
|
85
|
-
return navigator.createHref({
|
|
86
|
-
pathname: joinedPathname,
|
|
87
|
-
search,
|
|
88
|
-
hash
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function useInRouterContext() {
|
|
92
|
-
return React.useContext(LocationContext) != null;
|
|
93
|
-
}
|
|
94
|
-
function useLocation() {
|
|
95
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
96
|
-
false,
|
|
97
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
98
|
-
// router loaded. We can help them understand how to avoid that.
|
|
99
|
-
"useLocation() may be used only in the context of a <Router> component."
|
|
100
|
-
) : invariant(false) : void 0;
|
|
101
|
-
return React.useContext(LocationContext).location;
|
|
102
|
-
}
|
|
103
|
-
function useNavigationType() {
|
|
104
|
-
return React.useContext(LocationContext).navigationType;
|
|
105
|
-
}
|
|
106
|
-
function useMatch(pattern) {
|
|
107
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
108
|
-
false,
|
|
109
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
110
|
-
// router loaded. We can help them understand how to avoid that.
|
|
111
|
-
"useMatch() may be used only in the context of a <Router> component."
|
|
112
|
-
) : invariant(false) : void 0;
|
|
113
|
-
let {
|
|
114
|
-
pathname
|
|
115
|
-
} = useLocation();
|
|
116
|
-
return React.useMemo(() => matchPath(pattern, pathname), [pathname, pattern]);
|
|
117
|
-
}
|
|
118
|
-
const navigateEffectWarning = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
|
|
119
|
-
function useIsomorphicLayoutEffect(cb) {
|
|
120
|
-
let isStatic = React.useContext(NavigationContext).static;
|
|
121
|
-
if (!isStatic) {
|
|
122
|
-
React.useLayoutEffect(cb);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function useNavigate() {
|
|
126
|
-
let {
|
|
127
|
-
isDataRoute
|
|
128
|
-
} = React.useContext(RouteContext);
|
|
129
|
-
return isDataRoute ? useNavigateStable() : useNavigateUnstable();
|
|
130
|
-
}
|
|
131
|
-
function useNavigateUnstable() {
|
|
132
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
133
|
-
false,
|
|
134
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
135
|
-
// router loaded. We can help them understand how to avoid that.
|
|
136
|
-
"useNavigate() may be used only in the context of a <Router> component."
|
|
137
|
-
) : invariant(false) : void 0;
|
|
138
|
-
let dataRouterContext = React.useContext(DataRouterContext);
|
|
139
|
-
let {
|
|
140
|
-
basename,
|
|
141
|
-
future,
|
|
142
|
-
navigator
|
|
143
|
-
} = React.useContext(NavigationContext);
|
|
144
|
-
let {
|
|
145
|
-
matches
|
|
146
|
-
} = React.useContext(RouteContext);
|
|
147
|
-
let {
|
|
148
|
-
pathname: locationPathname
|
|
149
|
-
} = useLocation();
|
|
150
|
-
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
151
|
-
let activeRef = React.useRef(false);
|
|
152
|
-
useIsomorphicLayoutEffect(() => {
|
|
153
|
-
activeRef.current = true;
|
|
154
|
-
});
|
|
155
|
-
let navigate = React.useCallback(function(to, options) {
|
|
156
|
-
if (options === void 0) {
|
|
157
|
-
options = {};
|
|
158
|
-
}
|
|
159
|
-
process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
|
|
160
|
-
if (!activeRef.current) return;
|
|
161
|
-
if (typeof to === "number") {
|
|
162
|
-
navigator.go(to);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
let path = resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, options.relative === "path");
|
|
166
|
-
if (dataRouterContext == null && basename !== "/") {
|
|
167
|
-
path.pathname = path.pathname === "/" ? basename : joinPaths([basename, path.pathname]);
|
|
168
|
-
}
|
|
169
|
-
(!!options.replace ? navigator.replace : navigator.push)(path, options.state, options);
|
|
170
|
-
}, [basename, navigator, routePathnamesJson, locationPathname, dataRouterContext]);
|
|
171
|
-
return navigate;
|
|
172
|
-
}
|
|
173
|
-
const OutletContext = /* @__PURE__ */ React.createContext(null);
|
|
174
|
-
function useOutletContext() {
|
|
175
|
-
return React.useContext(OutletContext);
|
|
176
|
-
}
|
|
177
|
-
function useOutlet(context) {
|
|
178
|
-
let outlet = React.useContext(RouteContext).outlet;
|
|
179
|
-
if (outlet) {
|
|
180
|
-
return /* @__PURE__ */ React.createElement(OutletContext.Provider, {
|
|
181
|
-
value: context
|
|
182
|
-
}, outlet);
|
|
183
|
-
}
|
|
184
|
-
return outlet;
|
|
185
|
-
}
|
|
186
|
-
function useParams() {
|
|
187
|
-
let {
|
|
188
|
-
matches
|
|
189
|
-
} = React.useContext(RouteContext);
|
|
190
|
-
let routeMatch = matches[matches.length - 1];
|
|
191
|
-
return routeMatch ? routeMatch.params : {};
|
|
192
|
-
}
|
|
193
|
-
function useResolvedPath(to, _temp2) {
|
|
194
|
-
let {
|
|
195
|
-
relative
|
|
196
|
-
} = _temp2 === void 0 ? {} : _temp2;
|
|
197
|
-
let {
|
|
198
|
-
future
|
|
199
|
-
} = React.useContext(NavigationContext);
|
|
200
|
-
let {
|
|
201
|
-
matches
|
|
202
|
-
} = React.useContext(RouteContext);
|
|
203
|
-
let {
|
|
204
|
-
pathname: locationPathname
|
|
205
|
-
} = useLocation();
|
|
206
|
-
let routePathnamesJson = JSON.stringify(getResolveToMatches(matches, future.v7_relativeSplatPath));
|
|
207
|
-
return React.useMemo(() => resolveTo(to, JSON.parse(routePathnamesJson), locationPathname, relative === "path"), [to, routePathnamesJson, locationPathname, relative]);
|
|
208
|
-
}
|
|
209
|
-
function useRoutes(routes, locationArg) {
|
|
210
|
-
return useRoutesImpl(routes, locationArg);
|
|
211
|
-
}
|
|
212
|
-
function useRoutesImpl(routes, locationArg, dataRouterState, future) {
|
|
213
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
214
|
-
false,
|
|
215
|
-
// TODO: This error is probably because they somehow have 2 versions of the
|
|
216
|
-
// router loaded. We can help them understand how to avoid that.
|
|
217
|
-
"useRoutes() may be used only in the context of a <Router> component."
|
|
218
|
-
) : invariant(false) : void 0;
|
|
219
|
-
let {
|
|
220
|
-
navigator
|
|
221
|
-
} = React.useContext(NavigationContext);
|
|
222
|
-
let {
|
|
223
|
-
matches: parentMatches
|
|
224
|
-
} = React.useContext(RouteContext);
|
|
225
|
-
let routeMatch = parentMatches[parentMatches.length - 1];
|
|
226
|
-
let parentParams = routeMatch ? routeMatch.params : {};
|
|
227
|
-
let parentPathname = routeMatch ? routeMatch.pathname : "/";
|
|
228
|
-
let parentPathnameBase = routeMatch ? routeMatch.pathnameBase : "/";
|
|
229
|
-
let parentRoute = routeMatch && routeMatch.route;
|
|
230
|
-
if (process.env.NODE_ENV !== "production") {
|
|
231
|
-
let parentPath = parentRoute && parentRoute.path || "";
|
|
232
|
-
warningOnce(parentPathname, !parentRoute || parentPath.endsWith("*"), "You rendered descendant <Routes> (or called `useRoutes()`) at " + ('"' + parentPathname + '" (under <Route path="' + parentPath + '">) but the ') + `parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
233
|
-
|
|
234
|
-
` + ('Please change the parent <Route path="' + parentPath + '"> to <Route ') + ('path="' + (parentPath === "/" ? "*" : parentPath + "/*") + '">.'));
|
|
235
|
-
}
|
|
236
|
-
let locationFromContext = useLocation();
|
|
237
|
-
let location;
|
|
238
|
-
if (locationArg) {
|
|
239
|
-
var _parsedLocationArg$pa;
|
|
240
|
-
let parsedLocationArg = typeof locationArg === "string" ? parsePath(locationArg) : locationArg;
|
|
241
|
-
!(parentPathnameBase === "/" || ((_parsedLocationArg$pa = parsedLocationArg.pathname) == null ? void 0 : _parsedLocationArg$pa.startsWith(parentPathnameBase))) ? process.env.NODE_ENV !== "production" ? invariant(false, "When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was " + ('matched by all parent routes. The current pathname base is "' + parentPathnameBase + '" ') + ('but pathname "' + parsedLocationArg.pathname + '" was given in the `location` prop.')) : invariant(false) : void 0;
|
|
242
|
-
location = parsedLocationArg;
|
|
243
|
-
} else {
|
|
244
|
-
location = locationFromContext;
|
|
245
|
-
}
|
|
246
|
-
let pathname = location.pathname || "/";
|
|
247
|
-
let remainingPathname = pathname;
|
|
248
|
-
if (parentPathnameBase !== "/") {
|
|
249
|
-
let parentSegments = parentPathnameBase.replace(/^\//, "").split("/");
|
|
250
|
-
let segments = pathname.replace(/^\//, "").split("/");
|
|
251
|
-
remainingPathname = "/" + segments.slice(parentSegments.length).join("/");
|
|
252
|
-
}
|
|
253
|
-
let matches = matchRoutes(routes, {
|
|
254
|
-
pathname: remainingPathname
|
|
255
|
-
});
|
|
256
|
-
if (process.env.NODE_ENV !== "production") {
|
|
257
|
-
process.env.NODE_ENV !== "production" ? warning(parentRoute || matches != null, 'No routes matched location "' + location.pathname + location.search + location.hash + '" ') : void 0;
|
|
258
|
-
process.env.NODE_ENV !== "production" ? warning(matches == null || matches[matches.length - 1].route.element !== void 0 || matches[matches.length - 1].route.Component !== void 0 || matches[matches.length - 1].route.lazy !== void 0, 'Matched leaf route at location "' + location.pathname + location.search + location.hash + '" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.') : void 0;
|
|
259
|
-
}
|
|
260
|
-
let renderedMatches = _renderMatches(matches && matches.map((match) => Object.assign({}, match, {
|
|
261
|
-
params: Object.assign({}, parentParams, match.params),
|
|
262
|
-
pathname: joinPaths([
|
|
263
|
-
parentPathnameBase,
|
|
264
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
265
|
-
navigator.encodeLocation ? navigator.encodeLocation(match.pathname).pathname : match.pathname
|
|
266
|
-
]),
|
|
267
|
-
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([
|
|
268
|
-
parentPathnameBase,
|
|
269
|
-
// Re-encode pathnames that were decoded inside matchRoutes
|
|
270
|
-
navigator.encodeLocation ? navigator.encodeLocation(match.pathnameBase).pathname : match.pathnameBase
|
|
271
|
-
])
|
|
272
|
-
})), parentMatches, dataRouterState, future);
|
|
273
|
-
if (locationArg && renderedMatches) {
|
|
274
|
-
return /* @__PURE__ */ React.createElement(LocationContext.Provider, {
|
|
275
|
-
value: {
|
|
276
|
-
location: _extends({
|
|
277
|
-
pathname: "/",
|
|
278
|
-
search: "",
|
|
279
|
-
hash: "",
|
|
280
|
-
state: null,
|
|
281
|
-
key: "default"
|
|
282
|
-
}, location),
|
|
283
|
-
navigationType: Action.Pop
|
|
284
|
-
}
|
|
285
|
-
}, renderedMatches);
|
|
286
|
-
}
|
|
287
|
-
return renderedMatches;
|
|
288
|
-
}
|
|
289
|
-
function DefaultErrorComponent() {
|
|
290
|
-
let error = useRouteError();
|
|
291
|
-
let message = isRouteErrorResponse(error) ? error.status + " " + error.statusText : error instanceof Error ? error.message : JSON.stringify(error);
|
|
292
|
-
let stack = error instanceof Error ? error.stack : null;
|
|
293
|
-
let lightgrey = "rgba(200,200,200, 0.5)";
|
|
294
|
-
let preStyles = {
|
|
295
|
-
padding: "0.5rem",
|
|
296
|
-
backgroundColor: lightgrey
|
|
297
|
-
};
|
|
298
|
-
let codeStyles = {
|
|
299
|
-
padding: "2px 4px",
|
|
300
|
-
backgroundColor: lightgrey
|
|
301
|
-
};
|
|
302
|
-
let devInfo = null;
|
|
303
|
-
if (process.env.NODE_ENV !== "production") {
|
|
304
|
-
console.error("Error handled by React Router default ErrorBoundary:", error);
|
|
305
|
-
devInfo = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ React.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ React.createElement("code", {
|
|
306
|
-
style: codeStyles
|
|
307
|
-
}, "ErrorBoundary"), " or", " ", /* @__PURE__ */ React.createElement("code", {
|
|
308
|
-
style: codeStyles
|
|
309
|
-
}, "errorElement"), " prop on your route."));
|
|
310
|
-
}
|
|
311
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ React.createElement("h3", {
|
|
312
|
-
style: {
|
|
313
|
-
fontStyle: "italic"
|
|
314
|
-
}
|
|
315
|
-
}, message), stack ? /* @__PURE__ */ React.createElement("pre", {
|
|
316
|
-
style: preStyles
|
|
317
|
-
}, stack) : null, devInfo);
|
|
318
|
-
}
|
|
319
|
-
const defaultErrorElement = /* @__PURE__ */ React.createElement(DefaultErrorComponent, null);
|
|
320
|
-
class RenderErrorBoundary extends React.Component {
|
|
321
|
-
constructor(props) {
|
|
322
|
-
super(props);
|
|
323
|
-
this.state = {
|
|
324
|
-
location: props.location,
|
|
325
|
-
revalidation: props.revalidation,
|
|
326
|
-
error: props.error
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
static getDerivedStateFromError(error) {
|
|
330
|
-
return {
|
|
331
|
-
error
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
static getDerivedStateFromProps(props, state) {
|
|
335
|
-
if (state.location !== props.location || state.revalidation !== "idle" && props.revalidation === "idle") {
|
|
336
|
-
return {
|
|
337
|
-
error: props.error,
|
|
338
|
-
location: props.location,
|
|
339
|
-
revalidation: props.revalidation
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
return {
|
|
343
|
-
error: props.error !== void 0 ? props.error : state.error,
|
|
344
|
-
location: state.location,
|
|
345
|
-
revalidation: props.revalidation || state.revalidation
|
|
346
|
-
};
|
|
347
|
-
}
|
|
348
|
-
componentDidCatch(error, errorInfo) {
|
|
349
|
-
console.error("React Router caught the following error during render", error, errorInfo);
|
|
350
|
-
}
|
|
351
|
-
render() {
|
|
352
|
-
return this.state.error !== void 0 ? /* @__PURE__ */ React.createElement(RouteContext.Provider, {
|
|
353
|
-
value: this.props.routeContext
|
|
354
|
-
}, /* @__PURE__ */ React.createElement(RouteErrorContext.Provider, {
|
|
355
|
-
value: this.state.error,
|
|
356
|
-
children: this.props.component
|
|
357
|
-
})) : this.props.children;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
function RenderedRoute(_ref) {
|
|
361
|
-
let {
|
|
362
|
-
routeContext,
|
|
363
|
-
match,
|
|
364
|
-
children
|
|
365
|
-
} = _ref;
|
|
366
|
-
let dataRouterContext = React.useContext(DataRouterContext);
|
|
367
|
-
if (dataRouterContext && dataRouterContext.static && dataRouterContext.staticContext && (match.route.errorElement || match.route.ErrorBoundary)) {
|
|
368
|
-
dataRouterContext.staticContext._deepestRenderedBoundaryId = match.route.id;
|
|
369
|
-
}
|
|
370
|
-
return /* @__PURE__ */ React.createElement(RouteContext.Provider, {
|
|
371
|
-
value: routeContext
|
|
372
|
-
}, children);
|
|
373
|
-
}
|
|
374
|
-
function _renderMatches(matches, parentMatches, dataRouterState, future) {
|
|
375
|
-
var _dataRouterState2;
|
|
376
|
-
if (parentMatches === void 0) {
|
|
377
|
-
parentMatches = [];
|
|
378
|
-
}
|
|
379
|
-
if (dataRouterState === void 0) {
|
|
380
|
-
dataRouterState = null;
|
|
381
|
-
}
|
|
382
|
-
if (future === void 0) {
|
|
383
|
-
future = null;
|
|
384
|
-
}
|
|
385
|
-
if (matches == null) {
|
|
386
|
-
var _dataRouterState;
|
|
387
|
-
if ((_dataRouterState = dataRouterState) != null && _dataRouterState.errors) {
|
|
388
|
-
matches = dataRouterState.matches;
|
|
389
|
-
} else {
|
|
390
|
-
return null;
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
let renderedMatches = matches;
|
|
394
|
-
let errors = (_dataRouterState2 = dataRouterState) == null ? void 0 : _dataRouterState2.errors;
|
|
395
|
-
if (errors != null) {
|
|
396
|
-
let errorIndex = renderedMatches.findIndex((m) => m.route.id && (errors == null ? void 0 : errors[m.route.id]) !== void 0);
|
|
397
|
-
!(errorIndex >= 0) ? process.env.NODE_ENV !== "production" ? invariant(false, "Could not find a matching route for errors on route IDs: " + Object.keys(errors).join(",")) : invariant(false) : void 0;
|
|
398
|
-
renderedMatches = renderedMatches.slice(0, Math.min(renderedMatches.length, errorIndex + 1));
|
|
399
|
-
}
|
|
400
|
-
let renderFallback = false;
|
|
401
|
-
let fallbackIndex = -1;
|
|
402
|
-
if (dataRouterState && future && future.v7_partialHydration) {
|
|
403
|
-
for (let i = 0; i < renderedMatches.length; i++) {
|
|
404
|
-
let match = renderedMatches[i];
|
|
405
|
-
if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
|
|
406
|
-
fallbackIndex = i;
|
|
407
|
-
}
|
|
408
|
-
if (match.route.id) {
|
|
409
|
-
let {
|
|
410
|
-
loaderData,
|
|
411
|
-
errors: errors2
|
|
412
|
-
} = dataRouterState;
|
|
413
|
-
let needsToRunLoader = match.route.loader && loaderData[match.route.id] === void 0 && (!errors2 || errors2[match.route.id] === void 0);
|
|
414
|
-
if (match.route.lazy || needsToRunLoader) {
|
|
415
|
-
renderFallback = true;
|
|
416
|
-
if (fallbackIndex >= 0) {
|
|
417
|
-
renderedMatches = renderedMatches.slice(0, fallbackIndex + 1);
|
|
418
|
-
} else {
|
|
419
|
-
renderedMatches = [renderedMatches[0]];
|
|
420
|
-
}
|
|
421
|
-
break;
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return renderedMatches.reduceRight((outlet, match, index) => {
|
|
427
|
-
let error;
|
|
428
|
-
let shouldRenderHydrateFallback = false;
|
|
429
|
-
let errorElement = null;
|
|
430
|
-
let hydrateFallbackElement = null;
|
|
431
|
-
if (dataRouterState) {
|
|
432
|
-
error = errors && match.route.id ? errors[match.route.id] : void 0;
|
|
433
|
-
errorElement = match.route.errorElement || defaultErrorElement;
|
|
434
|
-
if (renderFallback) {
|
|
435
|
-
if (fallbackIndex < 0 && index === 0) {
|
|
436
|
-
warningOnce("route-fallback", false, "No `HydrateFallback` element provided to render during initial hydration");
|
|
437
|
-
shouldRenderHydrateFallback = true;
|
|
438
|
-
hydrateFallbackElement = null;
|
|
439
|
-
} else if (fallbackIndex === index) {
|
|
440
|
-
shouldRenderHydrateFallback = true;
|
|
441
|
-
hydrateFallbackElement = match.route.hydrateFallbackElement || null;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
let matches2 = parentMatches.concat(renderedMatches.slice(0, index + 1));
|
|
446
|
-
let getChildren = () => {
|
|
447
|
-
let children;
|
|
448
|
-
if (error) {
|
|
449
|
-
children = errorElement;
|
|
450
|
-
} else if (shouldRenderHydrateFallback) {
|
|
451
|
-
children = hydrateFallbackElement;
|
|
452
|
-
} else if (match.route.Component) {
|
|
453
|
-
children = /* @__PURE__ */ React.createElement(match.route.Component, null);
|
|
454
|
-
} else if (match.route.element) {
|
|
455
|
-
children = match.route.element;
|
|
456
|
-
} else {
|
|
457
|
-
children = outlet;
|
|
458
|
-
}
|
|
459
|
-
return /* @__PURE__ */ React.createElement(RenderedRoute, {
|
|
460
|
-
match,
|
|
461
|
-
routeContext: {
|
|
462
|
-
outlet,
|
|
463
|
-
matches: matches2,
|
|
464
|
-
isDataRoute: dataRouterState != null
|
|
465
|
-
},
|
|
466
|
-
children
|
|
467
|
-
});
|
|
468
|
-
};
|
|
469
|
-
return dataRouterState && (match.route.ErrorBoundary || match.route.errorElement || index === 0) ? /* @__PURE__ */ React.createElement(RenderErrorBoundary, {
|
|
470
|
-
location: dataRouterState.location,
|
|
471
|
-
revalidation: dataRouterState.revalidation,
|
|
472
|
-
component: errorElement,
|
|
473
|
-
error,
|
|
474
|
-
children: getChildren(),
|
|
475
|
-
routeContext: {
|
|
476
|
-
outlet: null,
|
|
477
|
-
matches: matches2,
|
|
478
|
-
isDataRoute: true
|
|
479
|
-
}
|
|
480
|
-
}) : getChildren();
|
|
481
|
-
}, null);
|
|
482
|
-
}
|
|
483
|
-
var DataRouterHook = /* @__PURE__ */ function(DataRouterHook2) {
|
|
484
|
-
DataRouterHook2["UseBlocker"] = "useBlocker";
|
|
485
|
-
DataRouterHook2["UseRevalidator"] = "useRevalidator";
|
|
486
|
-
DataRouterHook2["UseNavigateStable"] = "useNavigate";
|
|
487
|
-
return DataRouterHook2;
|
|
488
|
-
}(DataRouterHook || {});
|
|
489
|
-
var DataRouterStateHook = /* @__PURE__ */ function(DataRouterStateHook2) {
|
|
490
|
-
DataRouterStateHook2["UseBlocker"] = "useBlocker";
|
|
491
|
-
DataRouterStateHook2["UseLoaderData"] = "useLoaderData";
|
|
492
|
-
DataRouterStateHook2["UseActionData"] = "useActionData";
|
|
493
|
-
DataRouterStateHook2["UseRouteError"] = "useRouteError";
|
|
494
|
-
DataRouterStateHook2["UseNavigation"] = "useNavigation";
|
|
495
|
-
DataRouterStateHook2["UseRouteLoaderData"] = "useRouteLoaderData";
|
|
496
|
-
DataRouterStateHook2["UseMatches"] = "useMatches";
|
|
497
|
-
DataRouterStateHook2["UseRevalidator"] = "useRevalidator";
|
|
498
|
-
DataRouterStateHook2["UseNavigateStable"] = "useNavigate";
|
|
499
|
-
DataRouterStateHook2["UseRouteId"] = "useRouteId";
|
|
500
|
-
return DataRouterStateHook2;
|
|
501
|
-
}(DataRouterStateHook || {});
|
|
502
|
-
function getDataRouterConsoleError(hookName) {
|
|
503
|
-
return hookName + " must be used within a data router. See https://reactrouter.com/routers/picking-a-router.";
|
|
504
|
-
}
|
|
505
|
-
function useDataRouterContext(hookName) {
|
|
506
|
-
let ctx = React.useContext(DataRouterContext);
|
|
507
|
-
!ctx ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
|
|
508
|
-
return ctx;
|
|
509
|
-
}
|
|
510
|
-
function useDataRouterState(hookName) {
|
|
511
|
-
let state = React.useContext(DataRouterStateContext);
|
|
512
|
-
!state ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
|
|
513
|
-
return state;
|
|
514
|
-
}
|
|
515
|
-
function useRouteContext(hookName) {
|
|
516
|
-
let route = React.useContext(RouteContext);
|
|
517
|
-
!route ? process.env.NODE_ENV !== "production" ? invariant(false, getDataRouterConsoleError(hookName)) : invariant(false) : void 0;
|
|
518
|
-
return route;
|
|
519
|
-
}
|
|
520
|
-
function useCurrentRouteId(hookName) {
|
|
521
|
-
let route = useRouteContext(hookName);
|
|
522
|
-
let thisRoute = route.matches[route.matches.length - 1];
|
|
523
|
-
!thisRoute.route.id ? process.env.NODE_ENV !== "production" ? invariant(false, hookName + ' can only be used on routes that contain a unique "id"') : invariant(false) : void 0;
|
|
524
|
-
return thisRoute.route.id;
|
|
525
|
-
}
|
|
526
|
-
function useRouteId() {
|
|
527
|
-
return useCurrentRouteId(DataRouterStateHook.UseRouteId);
|
|
528
|
-
}
|
|
529
|
-
function useNavigation() {
|
|
530
|
-
let state = useDataRouterState(DataRouterStateHook.UseNavigation);
|
|
531
|
-
return state.navigation;
|
|
532
|
-
}
|
|
533
|
-
function useRevalidator() {
|
|
534
|
-
let dataRouterContext = useDataRouterContext(DataRouterHook.UseRevalidator);
|
|
535
|
-
let state = useDataRouterState(DataRouterStateHook.UseRevalidator);
|
|
536
|
-
return React.useMemo(() => ({
|
|
537
|
-
revalidate: dataRouterContext.router.revalidate,
|
|
538
|
-
state: state.revalidation
|
|
539
|
-
}), [dataRouterContext.router.revalidate, state.revalidation]);
|
|
540
|
-
}
|
|
541
|
-
function useMatches() {
|
|
542
|
-
let {
|
|
543
|
-
matches,
|
|
544
|
-
loaderData
|
|
545
|
-
} = useDataRouterState(DataRouterStateHook.UseMatches);
|
|
546
|
-
return React.useMemo(() => matches.map((m) => convertRouteMatchToUiMatch(m, loaderData)), [matches, loaderData]);
|
|
547
|
-
}
|
|
548
|
-
function useLoaderData() {
|
|
549
|
-
let state = useDataRouterState(DataRouterStateHook.UseLoaderData);
|
|
550
|
-
let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);
|
|
551
|
-
if (state.errors && state.errors[routeId] != null) {
|
|
552
|
-
console.error("You cannot `useLoaderData` in an errorElement (routeId: " + routeId + ")");
|
|
553
|
-
return void 0;
|
|
554
|
-
}
|
|
555
|
-
return state.loaderData[routeId];
|
|
556
|
-
}
|
|
557
|
-
function useRouteLoaderData(routeId) {
|
|
558
|
-
let state = useDataRouterState(DataRouterStateHook.UseRouteLoaderData);
|
|
559
|
-
return state.loaderData[routeId];
|
|
560
|
-
}
|
|
561
|
-
function useActionData() {
|
|
562
|
-
let state = useDataRouterState(DataRouterStateHook.UseActionData);
|
|
563
|
-
let routeId = useCurrentRouteId(DataRouterStateHook.UseLoaderData);
|
|
564
|
-
return state.actionData ? state.actionData[routeId] : void 0;
|
|
565
|
-
}
|
|
566
|
-
function useRouteError() {
|
|
567
|
-
var _state$errors;
|
|
568
|
-
let error = React.useContext(RouteErrorContext);
|
|
569
|
-
let state = useDataRouterState(DataRouterStateHook.UseRouteError);
|
|
570
|
-
let routeId = useCurrentRouteId(DataRouterStateHook.UseRouteError);
|
|
571
|
-
if (error !== void 0) {
|
|
572
|
-
return error;
|
|
573
|
-
}
|
|
574
|
-
return (_state$errors = state.errors) == null ? void 0 : _state$errors[routeId];
|
|
575
|
-
}
|
|
576
|
-
function useAsyncValue() {
|
|
577
|
-
let value = React.useContext(AwaitContext);
|
|
578
|
-
return value == null ? void 0 : value._data;
|
|
579
|
-
}
|
|
580
|
-
function useAsyncError() {
|
|
581
|
-
let value = React.useContext(AwaitContext);
|
|
582
|
-
return value == null ? void 0 : value._error;
|
|
583
|
-
}
|
|
584
|
-
let blockerId = 0;
|
|
585
|
-
function useBlocker(shouldBlock) {
|
|
586
|
-
let {
|
|
587
|
-
router,
|
|
588
|
-
basename
|
|
589
|
-
} = useDataRouterContext(DataRouterHook.UseBlocker);
|
|
590
|
-
let state = useDataRouterState(DataRouterStateHook.UseBlocker);
|
|
591
|
-
let [blockerKey, setBlockerKey] = React.useState("");
|
|
592
|
-
let blockerFunction = React.useCallback((arg) => {
|
|
593
|
-
if (typeof shouldBlock !== "function") {
|
|
594
|
-
return !!shouldBlock;
|
|
595
|
-
}
|
|
596
|
-
if (basename === "/") {
|
|
597
|
-
return shouldBlock(arg);
|
|
598
|
-
}
|
|
599
|
-
let {
|
|
600
|
-
currentLocation,
|
|
601
|
-
nextLocation,
|
|
602
|
-
historyAction
|
|
603
|
-
} = arg;
|
|
604
|
-
return shouldBlock({
|
|
605
|
-
currentLocation: _extends({}, currentLocation, {
|
|
606
|
-
pathname: stripBasename(currentLocation.pathname, basename) || currentLocation.pathname
|
|
607
|
-
}),
|
|
608
|
-
nextLocation: _extends({}, nextLocation, {
|
|
609
|
-
pathname: stripBasename(nextLocation.pathname, basename) || nextLocation.pathname
|
|
610
|
-
}),
|
|
611
|
-
historyAction
|
|
612
|
-
});
|
|
613
|
-
}, [basename, shouldBlock]);
|
|
614
|
-
React.useEffect(() => {
|
|
615
|
-
let key = String(++blockerId);
|
|
616
|
-
setBlockerKey(key);
|
|
617
|
-
return () => router.deleteBlocker(key);
|
|
618
|
-
}, [router]);
|
|
619
|
-
React.useEffect(() => {
|
|
620
|
-
if (blockerKey !== "") {
|
|
621
|
-
router.getBlocker(blockerKey, blockerFunction);
|
|
622
|
-
}
|
|
623
|
-
}, [router, blockerKey, blockerFunction]);
|
|
624
|
-
return blockerKey && state.blockers.has(blockerKey) ? state.blockers.get(blockerKey) : IDLE_BLOCKER;
|
|
625
|
-
}
|
|
626
|
-
function useNavigateStable() {
|
|
627
|
-
let {
|
|
628
|
-
router
|
|
629
|
-
} = useDataRouterContext(DataRouterHook.UseNavigateStable);
|
|
630
|
-
let id = useCurrentRouteId(DataRouterStateHook.UseNavigateStable);
|
|
631
|
-
let activeRef = React.useRef(false);
|
|
632
|
-
useIsomorphicLayoutEffect(() => {
|
|
633
|
-
activeRef.current = true;
|
|
634
|
-
});
|
|
635
|
-
let navigate = React.useCallback(function(to, options) {
|
|
636
|
-
if (options === void 0) {
|
|
637
|
-
options = {};
|
|
638
|
-
}
|
|
639
|
-
process.env.NODE_ENV !== "production" ? warning(activeRef.current, navigateEffectWarning) : void 0;
|
|
640
|
-
if (!activeRef.current) return;
|
|
641
|
-
if (typeof to === "number") {
|
|
642
|
-
router.navigate(to);
|
|
643
|
-
} else {
|
|
644
|
-
router.navigate(to, _extends({
|
|
645
|
-
fromRouteId: id
|
|
646
|
-
}, options));
|
|
647
|
-
}
|
|
648
|
-
}, [router, id]);
|
|
649
|
-
return navigate;
|
|
650
|
-
}
|
|
651
|
-
const alreadyWarned = {};
|
|
652
|
-
function warningOnce(key, cond, message) {
|
|
653
|
-
if (!cond && !alreadyWarned[key]) {
|
|
654
|
-
alreadyWarned[key] = true;
|
|
655
|
-
process.env.NODE_ENV !== "production" ? warning(false, message) : void 0;
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
const START_TRANSITION = "startTransition";
|
|
659
|
-
const startTransitionImpl = React[START_TRANSITION];
|
|
660
|
-
function RouterProvider(_ref) {
|
|
661
|
-
let {
|
|
662
|
-
fallbackElement,
|
|
663
|
-
router,
|
|
664
|
-
future
|
|
665
|
-
} = _ref;
|
|
666
|
-
let [state, setStateImpl] = React.useState(router.state);
|
|
667
|
-
let {
|
|
668
|
-
v7_startTransition
|
|
669
|
-
} = future || {};
|
|
670
|
-
let setState = React.useCallback((newState) => {
|
|
671
|
-
if (v7_startTransition && startTransitionImpl) {
|
|
672
|
-
startTransitionImpl(() => setStateImpl(newState));
|
|
673
|
-
} else {
|
|
674
|
-
setStateImpl(newState);
|
|
675
|
-
}
|
|
676
|
-
}, [setStateImpl, v7_startTransition]);
|
|
677
|
-
React.useLayoutEffect(() => router.subscribe(setState), [router, setState]);
|
|
678
|
-
React.useEffect(() => {
|
|
679
|
-
process.env.NODE_ENV !== "production" ? warning(fallbackElement == null || !router.future.v7_partialHydration, "`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead") : void 0;
|
|
680
|
-
}, []);
|
|
681
|
-
let navigator = React.useMemo(() => {
|
|
682
|
-
return {
|
|
683
|
-
createHref: router.createHref,
|
|
684
|
-
encodeLocation: router.encodeLocation,
|
|
685
|
-
go: (n) => router.navigate(n),
|
|
686
|
-
push: (to, state2, opts) => router.navigate(to, {
|
|
687
|
-
state: state2,
|
|
688
|
-
preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
|
|
689
|
-
}),
|
|
690
|
-
replace: (to, state2, opts) => router.navigate(to, {
|
|
691
|
-
replace: true,
|
|
692
|
-
state: state2,
|
|
693
|
-
preventScrollReset: opts == null ? void 0 : opts.preventScrollReset
|
|
694
|
-
})
|
|
695
|
-
};
|
|
696
|
-
}, [router]);
|
|
697
|
-
let basename = router.basename || "/";
|
|
698
|
-
let dataRouterContext = React.useMemo(() => ({
|
|
699
|
-
router,
|
|
700
|
-
navigator,
|
|
701
|
-
static: false,
|
|
702
|
-
basename
|
|
703
|
-
}), [router, navigator, basename]);
|
|
704
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DataRouterContext.Provider, {
|
|
705
|
-
value: dataRouterContext
|
|
706
|
-
}, /* @__PURE__ */ React.createElement(DataRouterStateContext.Provider, {
|
|
707
|
-
value: state
|
|
708
|
-
}, /* @__PURE__ */ React.createElement(Router, {
|
|
709
|
-
basename,
|
|
710
|
-
location: state.location,
|
|
711
|
-
navigationType: state.historyAction,
|
|
712
|
-
navigator,
|
|
713
|
-
future: {
|
|
714
|
-
v7_relativeSplatPath: router.future.v7_relativeSplatPath
|
|
715
|
-
}
|
|
716
|
-
}, state.initialized || router.future.v7_partialHydration ? /* @__PURE__ */ React.createElement(DataRoutes, {
|
|
717
|
-
routes: router.routes,
|
|
718
|
-
future: router.future,
|
|
719
|
-
state
|
|
720
|
-
}) : fallbackElement))), null);
|
|
721
|
-
}
|
|
722
|
-
function DataRoutes(_ref2) {
|
|
723
|
-
let {
|
|
724
|
-
routes,
|
|
725
|
-
future,
|
|
726
|
-
state
|
|
727
|
-
} = _ref2;
|
|
728
|
-
return useRoutesImpl(routes, void 0, state, future);
|
|
729
|
-
}
|
|
730
|
-
function MemoryRouter(_ref3) {
|
|
731
|
-
let {
|
|
732
|
-
basename,
|
|
733
|
-
children,
|
|
734
|
-
initialEntries,
|
|
735
|
-
initialIndex,
|
|
736
|
-
future
|
|
737
|
-
} = _ref3;
|
|
738
|
-
let historyRef = React.useRef();
|
|
739
|
-
if (historyRef.current == null) {
|
|
740
|
-
historyRef.current = createMemoryHistory({
|
|
741
|
-
initialEntries,
|
|
742
|
-
initialIndex,
|
|
743
|
-
v5Compat: true
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
let history = historyRef.current;
|
|
747
|
-
let [state, setStateImpl] = React.useState({
|
|
748
|
-
action: history.action,
|
|
749
|
-
location: history.location
|
|
750
|
-
});
|
|
751
|
-
let {
|
|
752
|
-
v7_startTransition
|
|
753
|
-
} = future || {};
|
|
754
|
-
let setState = React.useCallback((newState) => {
|
|
755
|
-
v7_startTransition && startTransitionImpl ? startTransitionImpl(() => setStateImpl(newState)) : setStateImpl(newState);
|
|
756
|
-
}, [setStateImpl, v7_startTransition]);
|
|
757
|
-
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
758
|
-
return /* @__PURE__ */ React.createElement(Router, {
|
|
759
|
-
basename,
|
|
760
|
-
children,
|
|
761
|
-
location: state.location,
|
|
762
|
-
navigationType: state.action,
|
|
763
|
-
navigator: history,
|
|
764
|
-
future
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function Navigate(_ref4) {
|
|
768
|
-
let {
|
|
769
|
-
to,
|
|
770
|
-
replace,
|
|
771
|
-
state,
|
|
772
|
-
relative
|
|
773
|
-
} = _ref4;
|
|
774
|
-
!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(
|
|
775
|
-
false,
|
|
776
|
-
// TODO: This error is probably because they somehow have 2 versions of
|
|
777
|
-
// the router loaded. We can help them understand how to avoid that.
|
|
778
|
-
"<Navigate> may be used only in the context of a <Router> component."
|
|
779
|
-
) : invariant(false) : void 0;
|
|
780
|
-
let {
|
|
781
|
-
future,
|
|
782
|
-
static: isStatic
|
|
783
|
-
} = React.useContext(NavigationContext);
|
|
784
|
-
process.env.NODE_ENV !== "production" ? warning(!isStatic, "<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.") : void 0;
|
|
785
|
-
let {
|
|
786
|
-
matches
|
|
787
|
-
} = React.useContext(RouteContext);
|
|
788
|
-
let {
|
|
789
|
-
pathname: locationPathname
|
|
790
|
-
} = useLocation();
|
|
791
|
-
let navigate = useNavigate();
|
|
792
|
-
let path = resolveTo(to, getResolveToMatches(matches, future.v7_relativeSplatPath), locationPathname, relative === "path");
|
|
793
|
-
let jsonPath = JSON.stringify(path);
|
|
794
|
-
React.useEffect(() => navigate(JSON.parse(jsonPath), {
|
|
795
|
-
replace,
|
|
796
|
-
state,
|
|
797
|
-
relative
|
|
798
|
-
}), [navigate, jsonPath, relative, replace, state]);
|
|
799
|
-
return null;
|
|
800
|
-
}
|
|
801
|
-
function Outlet(props) {
|
|
802
|
-
return useOutlet(props.context);
|
|
803
|
-
}
|
|
804
|
-
function Route(_props) {
|
|
805
|
-
process.env.NODE_ENV !== "production" ? invariant(false, "A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.") : invariant(false);
|
|
806
|
-
}
|
|
807
|
-
function Router(_ref5) {
|
|
808
|
-
let {
|
|
809
|
-
basename: basenameProp = "/",
|
|
810
|
-
children = null,
|
|
811
|
-
location: locationProp,
|
|
812
|
-
navigationType = Action.Pop,
|
|
813
|
-
navigator,
|
|
814
|
-
static: staticProp = false,
|
|
815
|
-
future
|
|
816
|
-
} = _ref5;
|
|
817
|
-
!!useInRouterContext() ? process.env.NODE_ENV !== "production" ? invariant(false, "You cannot render a <Router> inside another <Router>. You should never have more than one in your app.") : invariant(false) : void 0;
|
|
818
|
-
let basename = basenameProp.replace(/^\/*/, "/");
|
|
819
|
-
let navigationContext = React.useMemo(() => ({
|
|
820
|
-
basename,
|
|
821
|
-
navigator,
|
|
822
|
-
static: staticProp,
|
|
823
|
-
future: _extends({
|
|
824
|
-
v7_relativeSplatPath: false
|
|
825
|
-
}, future)
|
|
826
|
-
}), [basename, future, navigator, staticProp]);
|
|
827
|
-
if (typeof locationProp === "string") {
|
|
828
|
-
locationProp = parsePath(locationProp);
|
|
829
|
-
}
|
|
830
|
-
let {
|
|
831
|
-
pathname = "/",
|
|
832
|
-
search = "",
|
|
833
|
-
hash = "",
|
|
834
|
-
state = null,
|
|
835
|
-
key = "default"
|
|
836
|
-
} = locationProp;
|
|
837
|
-
let locationContext = React.useMemo(() => {
|
|
838
|
-
let trailingPathname = stripBasename(pathname, basename);
|
|
839
|
-
if (trailingPathname == null) {
|
|
840
|
-
return null;
|
|
841
|
-
}
|
|
842
|
-
return {
|
|
843
|
-
location: {
|
|
844
|
-
pathname: trailingPathname,
|
|
845
|
-
search,
|
|
846
|
-
hash,
|
|
847
|
-
state,
|
|
848
|
-
key
|
|
849
|
-
},
|
|
850
|
-
navigationType
|
|
851
|
-
};
|
|
852
|
-
}, [basename, pathname, search, hash, state, key, navigationType]);
|
|
853
|
-
process.env.NODE_ENV !== "production" ? warning(locationContext != null, '<Router basename="' + basename + '"> is not able to match the URL ' + ('"' + pathname + search + hash + '" because it does not start with the ') + "basename, so the <Router> won't render anything.") : void 0;
|
|
854
|
-
if (locationContext == null) {
|
|
855
|
-
return null;
|
|
856
|
-
}
|
|
857
|
-
return /* @__PURE__ */ React.createElement(NavigationContext.Provider, {
|
|
858
|
-
value: navigationContext
|
|
859
|
-
}, /* @__PURE__ */ React.createElement(LocationContext.Provider, {
|
|
860
|
-
children,
|
|
861
|
-
value: locationContext
|
|
862
|
-
}));
|
|
863
|
-
}
|
|
864
|
-
function Routes(_ref6) {
|
|
865
|
-
let {
|
|
866
|
-
children,
|
|
867
|
-
location
|
|
868
|
-
} = _ref6;
|
|
869
|
-
return useRoutes(createRoutesFromChildren(children), location);
|
|
870
|
-
}
|
|
871
|
-
function Await(_ref7) {
|
|
872
|
-
let {
|
|
873
|
-
children,
|
|
874
|
-
errorElement,
|
|
875
|
-
resolve
|
|
876
|
-
} = _ref7;
|
|
877
|
-
return /* @__PURE__ */ React.createElement(AwaitErrorBoundary, {
|
|
878
|
-
resolve,
|
|
879
|
-
errorElement
|
|
880
|
-
}, /* @__PURE__ */ React.createElement(ResolveAwait, null, children));
|
|
881
|
-
}
|
|
882
|
-
var AwaitRenderStatus = /* @__PURE__ */ function(AwaitRenderStatus2) {
|
|
883
|
-
AwaitRenderStatus2[AwaitRenderStatus2["pending"] = 0] = "pending";
|
|
884
|
-
AwaitRenderStatus2[AwaitRenderStatus2["success"] = 1] = "success";
|
|
885
|
-
AwaitRenderStatus2[AwaitRenderStatus2["error"] = 2] = "error";
|
|
886
|
-
return AwaitRenderStatus2;
|
|
887
|
-
}(AwaitRenderStatus || {});
|
|
888
|
-
const neverSettledPromise = new Promise(() => {
|
|
889
|
-
});
|
|
890
|
-
class AwaitErrorBoundary extends React.Component {
|
|
891
|
-
constructor(props) {
|
|
892
|
-
super(props);
|
|
893
|
-
this.state = {
|
|
894
|
-
error: null
|
|
895
|
-
};
|
|
896
|
-
}
|
|
897
|
-
static getDerivedStateFromError(error) {
|
|
898
|
-
return {
|
|
899
|
-
error
|
|
900
|
-
};
|
|
901
|
-
}
|
|
902
|
-
componentDidCatch(error, errorInfo) {
|
|
903
|
-
console.error("<Await> caught the following error during render", error, errorInfo);
|
|
904
|
-
}
|
|
905
|
-
render() {
|
|
906
|
-
let {
|
|
907
|
-
children,
|
|
908
|
-
errorElement,
|
|
909
|
-
resolve
|
|
910
|
-
} = this.props;
|
|
911
|
-
let promise = null;
|
|
912
|
-
let status = AwaitRenderStatus.pending;
|
|
913
|
-
if (!(resolve instanceof Promise)) {
|
|
914
|
-
status = AwaitRenderStatus.success;
|
|
915
|
-
promise = Promise.resolve();
|
|
916
|
-
Object.defineProperty(promise, "_tracked", {
|
|
917
|
-
get: () => true
|
|
918
|
-
});
|
|
919
|
-
Object.defineProperty(promise, "_data", {
|
|
920
|
-
get: () => resolve
|
|
921
|
-
});
|
|
922
|
-
} else if (this.state.error) {
|
|
923
|
-
status = AwaitRenderStatus.error;
|
|
924
|
-
let renderError = this.state.error;
|
|
925
|
-
promise = Promise.reject().catch(() => {
|
|
926
|
-
});
|
|
927
|
-
Object.defineProperty(promise, "_tracked", {
|
|
928
|
-
get: () => true
|
|
929
|
-
});
|
|
930
|
-
Object.defineProperty(promise, "_error", {
|
|
931
|
-
get: () => renderError
|
|
932
|
-
});
|
|
933
|
-
} else if (resolve._tracked) {
|
|
934
|
-
promise = resolve;
|
|
935
|
-
status = "_error" in promise ? AwaitRenderStatus.error : "_data" in promise ? AwaitRenderStatus.success : AwaitRenderStatus.pending;
|
|
936
|
-
} else {
|
|
937
|
-
status = AwaitRenderStatus.pending;
|
|
938
|
-
Object.defineProperty(resolve, "_tracked", {
|
|
939
|
-
get: () => true
|
|
940
|
-
});
|
|
941
|
-
promise = resolve.then((data) => Object.defineProperty(resolve, "_data", {
|
|
942
|
-
get: () => data
|
|
943
|
-
}), (error) => Object.defineProperty(resolve, "_error", {
|
|
944
|
-
get: () => error
|
|
945
|
-
}));
|
|
946
|
-
}
|
|
947
|
-
if (status === AwaitRenderStatus.error && promise._error instanceof AbortedDeferredError) {
|
|
948
|
-
throw neverSettledPromise;
|
|
949
|
-
}
|
|
950
|
-
if (status === AwaitRenderStatus.error && !errorElement) {
|
|
951
|
-
throw promise._error;
|
|
952
|
-
}
|
|
953
|
-
if (status === AwaitRenderStatus.error) {
|
|
954
|
-
return /* @__PURE__ */ React.createElement(AwaitContext.Provider, {
|
|
955
|
-
value: promise,
|
|
956
|
-
children: errorElement
|
|
957
|
-
});
|
|
958
|
-
}
|
|
959
|
-
if (status === AwaitRenderStatus.success) {
|
|
960
|
-
return /* @__PURE__ */ React.createElement(AwaitContext.Provider, {
|
|
961
|
-
value: promise,
|
|
962
|
-
children
|
|
963
|
-
});
|
|
964
|
-
}
|
|
965
|
-
throw promise;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
function ResolveAwait(_ref8) {
|
|
969
|
-
let {
|
|
970
|
-
children
|
|
971
|
-
} = _ref8;
|
|
972
|
-
let data = useAsyncValue();
|
|
973
|
-
let toRender = typeof children === "function" ? children(data) : children;
|
|
974
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, toRender);
|
|
975
|
-
}
|
|
976
|
-
function createRoutesFromChildren(children, parentPath) {
|
|
977
|
-
if (parentPath === void 0) {
|
|
978
|
-
parentPath = [];
|
|
979
|
-
}
|
|
980
|
-
let routes = [];
|
|
981
|
-
React.Children.forEach(children, (element, index) => {
|
|
982
|
-
if (!/* @__PURE__ */ React.isValidElement(element)) {
|
|
983
|
-
return;
|
|
984
|
-
}
|
|
985
|
-
let treePath = [...parentPath, index];
|
|
986
|
-
if (element.type === React.Fragment) {
|
|
987
|
-
routes.push.apply(routes, createRoutesFromChildren(element.props.children, treePath));
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
!(element.type === Route) ? process.env.NODE_ENV !== "production" ? invariant(false, "[" + (typeof element.type === "string" ? element.type : element.type.name) + "] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>") : invariant(false) : void 0;
|
|
991
|
-
!(!element.props.index || !element.props.children) ? process.env.NODE_ENV !== "production" ? invariant(false, "An index route cannot have child routes.") : invariant(false) : void 0;
|
|
992
|
-
let route = {
|
|
993
|
-
id: element.props.id || treePath.join("-"),
|
|
994
|
-
caseSensitive: element.props.caseSensitive,
|
|
995
|
-
element: element.props.element,
|
|
996
|
-
Component: element.props.Component,
|
|
997
|
-
index: element.props.index,
|
|
998
|
-
path: element.props.path,
|
|
999
|
-
loader: element.props.loader,
|
|
1000
|
-
action: element.props.action,
|
|
1001
|
-
errorElement: element.props.errorElement,
|
|
1002
|
-
ErrorBoundary: element.props.ErrorBoundary,
|
|
1003
|
-
hasErrorBoundary: element.props.ErrorBoundary != null || element.props.errorElement != null,
|
|
1004
|
-
shouldRevalidate: element.props.shouldRevalidate,
|
|
1005
|
-
handle: element.props.handle,
|
|
1006
|
-
lazy: element.props.lazy
|
|
1007
|
-
};
|
|
1008
|
-
if (element.props.children) {
|
|
1009
|
-
route.children = createRoutesFromChildren(element.props.children, treePath);
|
|
1010
|
-
}
|
|
1011
|
-
routes.push(route);
|
|
1012
|
-
});
|
|
1013
|
-
return routes;
|
|
1014
|
-
}
|
|
1015
|
-
function renderMatches(matches) {
|
|
1016
|
-
return _renderMatches(matches);
|
|
1017
|
-
}
|
|
1018
|
-
function mapRouteProperties(route) {
|
|
1019
|
-
let updates = {
|
|
1020
|
-
// Note: this check also occurs in createRoutesFromChildren so update
|
|
1021
|
-
// there if you change this -- please and thank you!
|
|
1022
|
-
hasErrorBoundary: route.ErrorBoundary != null || route.errorElement != null
|
|
1023
|
-
};
|
|
1024
|
-
if (route.Component) {
|
|
1025
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1026
|
-
if (route.element) {
|
|
1027
|
-
process.env.NODE_ENV !== "production" ? warning(false, "You should not include both `Component` and `element` on your route - `Component` will be used.") : void 0;
|
|
1028
|
-
}
|
|
1029
|
-
}
|
|
1030
|
-
Object.assign(updates, {
|
|
1031
|
-
element: /* @__PURE__ */ React.createElement(route.Component),
|
|
1032
|
-
Component: void 0
|
|
1033
|
-
});
|
|
1034
|
-
}
|
|
1035
|
-
if (route.HydrateFallback) {
|
|
1036
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1037
|
-
if (route.hydrateFallbackElement) {
|
|
1038
|
-
process.env.NODE_ENV !== "production" ? warning(false, "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used.") : void 0;
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
Object.assign(updates, {
|
|
1042
|
-
hydrateFallbackElement: /* @__PURE__ */ React.createElement(route.HydrateFallback),
|
|
1043
|
-
HydrateFallback: void 0
|
|
1044
|
-
});
|
|
1045
|
-
}
|
|
1046
|
-
if (route.ErrorBoundary) {
|
|
1047
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1048
|
-
if (route.errorElement) {
|
|
1049
|
-
process.env.NODE_ENV !== "production" ? warning(false, "You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used.") : void 0;
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
Object.assign(updates, {
|
|
1053
|
-
errorElement: /* @__PURE__ */ React.createElement(route.ErrorBoundary),
|
|
1054
|
-
ErrorBoundary: void 0
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1057
|
-
return updates;
|
|
1058
|
-
}
|
|
1059
|
-
function createMemoryRouter(routes, opts) {
|
|
1060
|
-
return createRouter({
|
|
1061
|
-
basename: opts == null ? void 0 : opts.basename,
|
|
1062
|
-
future: _extends({}, opts == null ? void 0 : opts.future, {
|
|
1063
|
-
v7_prependBasename: true
|
|
1064
|
-
}),
|
|
1065
|
-
history: createMemoryHistory({
|
|
1066
|
-
initialEntries: opts == null ? void 0 : opts.initialEntries,
|
|
1067
|
-
initialIndex: opts == null ? void 0 : opts.initialIndex
|
|
1068
|
-
}),
|
|
1069
|
-
hydrationData: opts == null ? void 0 : opts.hydrationData,
|
|
1070
|
-
routes,
|
|
1071
|
-
mapRouteProperties,
|
|
1072
|
-
unstable_dataStrategy: opts == null ? void 0 : opts.unstable_dataStrategy,
|
|
1073
|
-
unstable_patchRoutesOnMiss: opts == null ? void 0 : opts.unstable_patchRoutesOnMiss
|
|
1074
|
-
}).initialize();
|
|
1075
|
-
}
|
|
1076
|
-
const dist = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1077
|
-
__proto__: null,
|
|
1078
|
-
AbortedDeferredError,
|
|
1079
|
-
Await,
|
|
1080
|
-
MemoryRouter,
|
|
1081
|
-
Navigate,
|
|
1082
|
-
get NavigationType() {
|
|
1083
|
-
return Action;
|
|
1084
|
-
},
|
|
1085
|
-
Outlet,
|
|
1086
|
-
Route,
|
|
1087
|
-
Router,
|
|
1088
|
-
RouterProvider,
|
|
1089
|
-
Routes,
|
|
1090
|
-
UNSAFE_DataRouterContext: DataRouterContext,
|
|
1091
|
-
UNSAFE_DataRouterStateContext: DataRouterStateContext,
|
|
1092
|
-
UNSAFE_LocationContext: LocationContext,
|
|
1093
|
-
UNSAFE_NavigationContext: NavigationContext,
|
|
1094
|
-
UNSAFE_RouteContext: RouteContext,
|
|
1095
|
-
UNSAFE_mapRouteProperties: mapRouteProperties,
|
|
1096
|
-
UNSAFE_useRouteId: useRouteId,
|
|
1097
|
-
UNSAFE_useRoutesImpl: useRoutesImpl,
|
|
1098
|
-
createMemoryRouter,
|
|
1099
|
-
createPath,
|
|
1100
|
-
createRoutesFromChildren,
|
|
1101
|
-
createRoutesFromElements: createRoutesFromChildren,
|
|
1102
|
-
defer,
|
|
1103
|
-
generatePath,
|
|
1104
|
-
isRouteErrorResponse,
|
|
1105
|
-
json,
|
|
1106
|
-
matchPath,
|
|
1107
|
-
matchRoutes,
|
|
1108
|
-
parsePath,
|
|
1109
|
-
redirect,
|
|
1110
|
-
redirectDocument,
|
|
1111
|
-
renderMatches,
|
|
1112
|
-
resolvePath,
|
|
1113
|
-
useActionData,
|
|
1114
|
-
useAsyncError,
|
|
1115
|
-
useAsyncValue,
|
|
1116
|
-
useBlocker,
|
|
1117
|
-
useHref,
|
|
1118
|
-
useInRouterContext,
|
|
1119
|
-
useLoaderData,
|
|
1120
|
-
useLocation,
|
|
1121
|
-
useMatch,
|
|
1122
|
-
useMatches,
|
|
1123
|
-
useNavigate,
|
|
1124
|
-
useNavigation,
|
|
1125
|
-
useNavigationType,
|
|
1126
|
-
useOutlet,
|
|
1127
|
-
useOutletContext,
|
|
1128
|
-
useParams,
|
|
1129
|
-
useResolvedPath,
|
|
1130
|
-
useRevalidator,
|
|
1131
|
-
useRouteError,
|
|
1132
|
-
useRouteLoaderData,
|
|
1133
|
-
useRoutes
|
|
1134
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1135
|
-
var jsxRuntime = { exports: {} };
|
|
1136
|
-
var reactJsxRuntime_production_min = {};
|
|
1137
|
-
/**
|
|
1138
|
-
* @license React
|
|
1139
|
-
* react-jsx-runtime.production.min.js
|
|
1140
|
-
*
|
|
1141
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1142
|
-
*
|
|
1143
|
-
* This source code is licensed under the MIT license found in the
|
|
1144
|
-
* LICENSE file in the root directory of this source tree.
|
|
1145
|
-
*/
|
|
1146
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
1147
|
-
function requireReactJsxRuntime_production_min() {
|
|
1148
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
1149
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
1150
|
-
var f = React__default, k = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p = { key: true, ref: true, __self: true, __source: true };
|
|
1151
|
-
function q(c, a, g) {
|
|
1152
|
-
var b, d = {}, e = null, h = null;
|
|
1153
|
-
void 0 !== g && (e = "" + g);
|
|
1154
|
-
void 0 !== a.key && (e = "" + a.key);
|
|
1155
|
-
void 0 !== a.ref && (h = a.ref);
|
|
1156
|
-
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
1157
|
-
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
1158
|
-
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
1159
|
-
}
|
|
1160
|
-
reactJsxRuntime_production_min.Fragment = l;
|
|
1161
|
-
reactJsxRuntime_production_min.jsx = q;
|
|
1162
|
-
reactJsxRuntime_production_min.jsxs = q;
|
|
1163
|
-
return reactJsxRuntime_production_min;
|
|
1164
|
-
}
|
|
1165
|
-
var reactJsxRuntime_development = {};
|
|
1166
|
-
/**
|
|
1167
|
-
* @license React
|
|
1168
|
-
* react-jsx-runtime.development.js
|
|
1169
|
-
*
|
|
1170
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1171
|
-
*
|
|
1172
|
-
* This source code is licensed under the MIT license found in the
|
|
1173
|
-
* LICENSE file in the root directory of this source tree.
|
|
1174
|
-
*/
|
|
1175
|
-
var hasRequiredReactJsxRuntime_development;
|
|
1176
|
-
function requireReactJsxRuntime_development() {
|
|
1177
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
1178
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
1179
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1180
|
-
(function() {
|
|
1181
|
-
var React2 = React__default;
|
|
1182
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
1183
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
1184
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
1185
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
1186
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
1187
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
1188
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
1189
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
1190
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
1191
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
1192
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
1193
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
1194
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
1195
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
1196
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
1197
|
-
function getIteratorFn(maybeIterable) {
|
|
1198
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
1199
|
-
return null;
|
|
1200
|
-
}
|
|
1201
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
1202
|
-
if (typeof maybeIterator === "function") {
|
|
1203
|
-
return maybeIterator;
|
|
1204
|
-
}
|
|
1205
|
-
return null;
|
|
1206
|
-
}
|
|
1207
|
-
var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
1208
|
-
function error(format) {
|
|
1209
|
-
{
|
|
1210
|
-
{
|
|
1211
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
1212
|
-
args[_key2 - 1] = arguments[_key2];
|
|
1213
|
-
}
|
|
1214
|
-
printWarning("error", format, args);
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
function printWarning(level, format, args) {
|
|
1219
|
-
{
|
|
1220
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1221
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
1222
|
-
if (stack !== "") {
|
|
1223
|
-
format += "%s";
|
|
1224
|
-
args = args.concat([stack]);
|
|
1225
|
-
}
|
|
1226
|
-
var argsWithFormat = args.map(function(item) {
|
|
1227
|
-
return String(item);
|
|
1228
|
-
});
|
|
1229
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
1230
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
var enableScopeAPI = false;
|
|
1234
|
-
var enableCacheElement = false;
|
|
1235
|
-
var enableTransitionTracing = false;
|
|
1236
|
-
var enableLegacyHidden = false;
|
|
1237
|
-
var enableDebugTracing = false;
|
|
1238
|
-
var REACT_MODULE_REFERENCE;
|
|
1239
|
-
{
|
|
1240
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
1241
|
-
}
|
|
1242
|
-
function isValidElementType(type) {
|
|
1243
|
-
if (typeof type === "string" || typeof type === "function") {
|
|
1244
|
-
return true;
|
|
1245
|
-
}
|
|
1246
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
1247
|
-
return true;
|
|
1248
|
-
}
|
|
1249
|
-
if (typeof type === "object" && type !== null) {
|
|
1250
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
1251
|
-
// types supported by any Flight configuration anywhere since
|
|
1252
|
-
// we don't know which Flight build this will end up being used
|
|
1253
|
-
// with.
|
|
1254
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
1255
|
-
return true;
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
return false;
|
|
1259
|
-
}
|
|
1260
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
1261
|
-
var displayName = outerType.displayName;
|
|
1262
|
-
if (displayName) {
|
|
1263
|
-
return displayName;
|
|
1264
|
-
}
|
|
1265
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
1266
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
1267
|
-
}
|
|
1268
|
-
function getContextName(type) {
|
|
1269
|
-
return type.displayName || "Context";
|
|
1270
|
-
}
|
|
1271
|
-
function getComponentNameFromType(type) {
|
|
1272
|
-
if (type == null) {
|
|
1273
|
-
return null;
|
|
1274
|
-
}
|
|
1275
|
-
{
|
|
1276
|
-
if (typeof type.tag === "number") {
|
|
1277
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
if (typeof type === "function") {
|
|
1281
|
-
return type.displayName || type.name || null;
|
|
1282
|
-
}
|
|
1283
|
-
if (typeof type === "string") {
|
|
1284
|
-
return type;
|
|
1285
|
-
}
|
|
1286
|
-
switch (type) {
|
|
1287
|
-
case REACT_FRAGMENT_TYPE:
|
|
1288
|
-
return "Fragment";
|
|
1289
|
-
case REACT_PORTAL_TYPE:
|
|
1290
|
-
return "Portal";
|
|
1291
|
-
case REACT_PROFILER_TYPE:
|
|
1292
|
-
return "Profiler";
|
|
1293
|
-
case REACT_STRICT_MODE_TYPE:
|
|
1294
|
-
return "StrictMode";
|
|
1295
|
-
case REACT_SUSPENSE_TYPE:
|
|
1296
|
-
return "Suspense";
|
|
1297
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1298
|
-
return "SuspenseList";
|
|
1299
|
-
}
|
|
1300
|
-
if (typeof type === "object") {
|
|
1301
|
-
switch (type.$$typeof) {
|
|
1302
|
-
case REACT_CONTEXT_TYPE:
|
|
1303
|
-
var context = type;
|
|
1304
|
-
return getContextName(context) + ".Consumer";
|
|
1305
|
-
case REACT_PROVIDER_TYPE:
|
|
1306
|
-
var provider = type;
|
|
1307
|
-
return getContextName(provider._context) + ".Provider";
|
|
1308
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1309
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
|
1310
|
-
case REACT_MEMO_TYPE:
|
|
1311
|
-
var outerName = type.displayName || null;
|
|
1312
|
-
if (outerName !== null) {
|
|
1313
|
-
return outerName;
|
|
1314
|
-
}
|
|
1315
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
1316
|
-
case REACT_LAZY_TYPE: {
|
|
1317
|
-
var lazyComponent = type;
|
|
1318
|
-
var payload = lazyComponent._payload;
|
|
1319
|
-
var init = lazyComponent._init;
|
|
1320
|
-
try {
|
|
1321
|
-
return getComponentNameFromType(init(payload));
|
|
1322
|
-
} catch (x) {
|
|
1323
|
-
return null;
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
return null;
|
|
1329
|
-
}
|
|
1330
|
-
var assign = Object.assign;
|
|
1331
|
-
var disabledDepth = 0;
|
|
1332
|
-
var prevLog;
|
|
1333
|
-
var prevInfo;
|
|
1334
|
-
var prevWarn;
|
|
1335
|
-
var prevError;
|
|
1336
|
-
var prevGroup;
|
|
1337
|
-
var prevGroupCollapsed;
|
|
1338
|
-
var prevGroupEnd;
|
|
1339
|
-
function disabledLog() {
|
|
1340
|
-
}
|
|
1341
|
-
disabledLog.__reactDisabledLog = true;
|
|
1342
|
-
function disableLogs() {
|
|
1343
|
-
{
|
|
1344
|
-
if (disabledDepth === 0) {
|
|
1345
|
-
prevLog = console.log;
|
|
1346
|
-
prevInfo = console.info;
|
|
1347
|
-
prevWarn = console.warn;
|
|
1348
|
-
prevError = console.error;
|
|
1349
|
-
prevGroup = console.group;
|
|
1350
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
1351
|
-
prevGroupEnd = console.groupEnd;
|
|
1352
|
-
var props = {
|
|
1353
|
-
configurable: true,
|
|
1354
|
-
enumerable: true,
|
|
1355
|
-
value: disabledLog,
|
|
1356
|
-
writable: true
|
|
1357
|
-
};
|
|
1358
|
-
Object.defineProperties(console, {
|
|
1359
|
-
info: props,
|
|
1360
|
-
log: props,
|
|
1361
|
-
warn: props,
|
|
1362
|
-
error: props,
|
|
1363
|
-
group: props,
|
|
1364
|
-
groupCollapsed: props,
|
|
1365
|
-
groupEnd: props
|
|
1366
|
-
});
|
|
1367
|
-
}
|
|
1368
|
-
disabledDepth++;
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
function reenableLogs() {
|
|
1372
|
-
{
|
|
1373
|
-
disabledDepth--;
|
|
1374
|
-
if (disabledDepth === 0) {
|
|
1375
|
-
var props = {
|
|
1376
|
-
configurable: true,
|
|
1377
|
-
enumerable: true,
|
|
1378
|
-
writable: true
|
|
1379
|
-
};
|
|
1380
|
-
Object.defineProperties(console, {
|
|
1381
|
-
log: assign({}, props, {
|
|
1382
|
-
value: prevLog
|
|
1383
|
-
}),
|
|
1384
|
-
info: assign({}, props, {
|
|
1385
|
-
value: prevInfo
|
|
1386
|
-
}),
|
|
1387
|
-
warn: assign({}, props, {
|
|
1388
|
-
value: prevWarn
|
|
1389
|
-
}),
|
|
1390
|
-
error: assign({}, props, {
|
|
1391
|
-
value: prevError
|
|
1392
|
-
}),
|
|
1393
|
-
group: assign({}, props, {
|
|
1394
|
-
value: prevGroup
|
|
1395
|
-
}),
|
|
1396
|
-
groupCollapsed: assign({}, props, {
|
|
1397
|
-
value: prevGroupCollapsed
|
|
1398
|
-
}),
|
|
1399
|
-
groupEnd: assign({}, props, {
|
|
1400
|
-
value: prevGroupEnd
|
|
1401
|
-
})
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
if (disabledDepth < 0) {
|
|
1405
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1410
|
-
var prefix;
|
|
1411
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1412
|
-
{
|
|
1413
|
-
if (prefix === void 0) {
|
|
1414
|
-
try {
|
|
1415
|
-
throw Error();
|
|
1416
|
-
} catch (x) {
|
|
1417
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1418
|
-
prefix = match && match[1] || "";
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
return "\n" + prefix + name;
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
var reentry = false;
|
|
1425
|
-
var componentFrameCache;
|
|
1426
|
-
{
|
|
1427
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
1428
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
1429
|
-
}
|
|
1430
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
1431
|
-
if (!fn || reentry) {
|
|
1432
|
-
return "";
|
|
1433
|
-
}
|
|
1434
|
-
{
|
|
1435
|
-
var frame = componentFrameCache.get(fn);
|
|
1436
|
-
if (frame !== void 0) {
|
|
1437
|
-
return frame;
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
var control;
|
|
1441
|
-
reentry = true;
|
|
1442
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
1443
|
-
Error.prepareStackTrace = void 0;
|
|
1444
|
-
var previousDispatcher;
|
|
1445
|
-
{
|
|
1446
|
-
previousDispatcher = ReactCurrentDispatcher.current;
|
|
1447
|
-
ReactCurrentDispatcher.current = null;
|
|
1448
|
-
disableLogs();
|
|
1449
|
-
}
|
|
1450
|
-
try {
|
|
1451
|
-
if (construct) {
|
|
1452
|
-
var Fake = function() {
|
|
1453
|
-
throw Error();
|
|
1454
|
-
};
|
|
1455
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
1456
|
-
set: function() {
|
|
1457
|
-
throw Error();
|
|
1458
|
-
}
|
|
1459
|
-
});
|
|
1460
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
1461
|
-
try {
|
|
1462
|
-
Reflect.construct(Fake, []);
|
|
1463
|
-
} catch (x) {
|
|
1464
|
-
control = x;
|
|
1465
|
-
}
|
|
1466
|
-
Reflect.construct(fn, [], Fake);
|
|
1467
|
-
} else {
|
|
1468
|
-
try {
|
|
1469
|
-
Fake.call();
|
|
1470
|
-
} catch (x) {
|
|
1471
|
-
control = x;
|
|
1472
|
-
}
|
|
1473
|
-
fn.call(Fake.prototype);
|
|
1474
|
-
}
|
|
1475
|
-
} else {
|
|
1476
|
-
try {
|
|
1477
|
-
throw Error();
|
|
1478
|
-
} catch (x) {
|
|
1479
|
-
control = x;
|
|
1480
|
-
}
|
|
1481
|
-
fn();
|
|
1482
|
-
}
|
|
1483
|
-
} catch (sample) {
|
|
1484
|
-
if (sample && control && typeof sample.stack === "string") {
|
|
1485
|
-
var sampleLines = sample.stack.split("\n");
|
|
1486
|
-
var controlLines = control.stack.split("\n");
|
|
1487
|
-
var s = sampleLines.length - 1;
|
|
1488
|
-
var c = controlLines.length - 1;
|
|
1489
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
1490
|
-
c--;
|
|
1491
|
-
}
|
|
1492
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
1493
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
1494
|
-
if (s !== 1 || c !== 1) {
|
|
1495
|
-
do {
|
|
1496
|
-
s--;
|
|
1497
|
-
c--;
|
|
1498
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1499
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
1500
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
1501
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
1502
|
-
}
|
|
1503
|
-
{
|
|
1504
|
-
if (typeof fn === "function") {
|
|
1505
|
-
componentFrameCache.set(fn, _frame);
|
|
1506
|
-
}
|
|
1507
|
-
}
|
|
1508
|
-
return _frame;
|
|
1509
|
-
}
|
|
1510
|
-
} while (s >= 1 && c >= 0);
|
|
1511
|
-
}
|
|
1512
|
-
break;
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
} finally {
|
|
1517
|
-
reentry = false;
|
|
1518
|
-
{
|
|
1519
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
1520
|
-
reenableLogs();
|
|
1521
|
-
}
|
|
1522
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1523
|
-
}
|
|
1524
|
-
var name = fn ? fn.displayName || fn.name : "";
|
|
1525
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
1526
|
-
{
|
|
1527
|
-
if (typeof fn === "function") {
|
|
1528
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
return syntheticFrame;
|
|
1532
|
-
}
|
|
1533
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1534
|
-
{
|
|
1535
|
-
return describeNativeComponentFrame(fn, false);
|
|
1536
|
-
}
|
|
1537
|
-
}
|
|
1538
|
-
function shouldConstruct(Component) {
|
|
1539
|
-
var prototype = Component.prototype;
|
|
1540
|
-
return !!(prototype && prototype.isReactComponent);
|
|
1541
|
-
}
|
|
1542
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1543
|
-
if (type == null) {
|
|
1544
|
-
return "";
|
|
1545
|
-
}
|
|
1546
|
-
if (typeof type === "function") {
|
|
1547
|
-
{
|
|
1548
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1549
|
-
}
|
|
1550
|
-
}
|
|
1551
|
-
if (typeof type === "string") {
|
|
1552
|
-
return describeBuiltInComponentFrame(type);
|
|
1553
|
-
}
|
|
1554
|
-
switch (type) {
|
|
1555
|
-
case REACT_SUSPENSE_TYPE:
|
|
1556
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
1557
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1558
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
1559
|
-
}
|
|
1560
|
-
if (typeof type === "object") {
|
|
1561
|
-
switch (type.$$typeof) {
|
|
1562
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1563
|
-
return describeFunctionComponentFrame(type.render);
|
|
1564
|
-
case REACT_MEMO_TYPE:
|
|
1565
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1566
|
-
case REACT_LAZY_TYPE: {
|
|
1567
|
-
var lazyComponent = type;
|
|
1568
|
-
var payload = lazyComponent._payload;
|
|
1569
|
-
var init = lazyComponent._init;
|
|
1570
|
-
try {
|
|
1571
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1572
|
-
} catch (x) {
|
|
1573
|
-
}
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
return "";
|
|
1578
|
-
}
|
|
1579
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1580
|
-
var loggedTypeFailures = {};
|
|
1581
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1582
|
-
function setCurrentlyValidatingElement(element) {
|
|
1583
|
-
{
|
|
1584
|
-
if (element) {
|
|
1585
|
-
var owner = element._owner;
|
|
1586
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1587
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
1588
|
-
} else {
|
|
1589
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1594
|
-
{
|
|
1595
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
1596
|
-
for (var typeSpecName in typeSpecs) {
|
|
1597
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
1598
|
-
var error$1 = void 0;
|
|
1599
|
-
try {
|
|
1600
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
1601
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
1602
|
-
err.name = "Invariant Violation";
|
|
1603
|
-
throw err;
|
|
1604
|
-
}
|
|
1605
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
1606
|
-
} catch (ex) {
|
|
1607
|
-
error$1 = ex;
|
|
1608
|
-
}
|
|
1609
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
1610
|
-
setCurrentlyValidatingElement(element);
|
|
1611
|
-
error("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", componentName || "React class", location, typeSpecName, typeof error$1);
|
|
1612
|
-
setCurrentlyValidatingElement(null);
|
|
1613
|
-
}
|
|
1614
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1615
|
-
loggedTypeFailures[error$1.message] = true;
|
|
1616
|
-
setCurrentlyValidatingElement(element);
|
|
1617
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
1618
|
-
setCurrentlyValidatingElement(null);
|
|
1619
|
-
}
|
|
1620
|
-
}
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
var isArrayImpl = Array.isArray;
|
|
1625
|
-
function isArray(a) {
|
|
1626
|
-
return isArrayImpl(a);
|
|
1627
|
-
}
|
|
1628
|
-
function typeName(value) {
|
|
1629
|
-
{
|
|
1630
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
1631
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
1632
|
-
return type;
|
|
1633
|
-
}
|
|
1634
|
-
}
|
|
1635
|
-
function willCoercionThrow(value) {
|
|
1636
|
-
{
|
|
1637
|
-
try {
|
|
1638
|
-
testStringCoercion(value);
|
|
1639
|
-
return false;
|
|
1640
|
-
} catch (e) {
|
|
1641
|
-
return true;
|
|
1642
|
-
}
|
|
1643
|
-
}
|
|
1644
|
-
}
|
|
1645
|
-
function testStringCoercion(value) {
|
|
1646
|
-
return "" + value;
|
|
1647
|
-
}
|
|
1648
|
-
function checkKeyStringCoercion(value) {
|
|
1649
|
-
{
|
|
1650
|
-
if (willCoercionThrow(value)) {
|
|
1651
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
1652
|
-
return testStringCoercion(value);
|
|
1653
|
-
}
|
|
1654
|
-
}
|
|
1655
|
-
}
|
|
1656
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
1657
|
-
var RESERVED_PROPS = {
|
|
1658
|
-
key: true,
|
|
1659
|
-
ref: true,
|
|
1660
|
-
__self: true,
|
|
1661
|
-
__source: true
|
|
1662
|
-
};
|
|
1663
|
-
var specialPropKeyWarningShown;
|
|
1664
|
-
var specialPropRefWarningShown;
|
|
1665
|
-
var didWarnAboutStringRefs;
|
|
1666
|
-
{
|
|
1667
|
-
didWarnAboutStringRefs = {};
|
|
1668
|
-
}
|
|
1669
|
-
function hasValidRef(config) {
|
|
1670
|
-
{
|
|
1671
|
-
if (hasOwnProperty.call(config, "ref")) {
|
|
1672
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
1673
|
-
if (getter && getter.isReactWarning) {
|
|
1674
|
-
return false;
|
|
1675
|
-
}
|
|
1676
|
-
}
|
|
1677
|
-
}
|
|
1678
|
-
return config.ref !== void 0;
|
|
1679
|
-
}
|
|
1680
|
-
function hasValidKey(config) {
|
|
1681
|
-
{
|
|
1682
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
1683
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
1684
|
-
if (getter && getter.isReactWarning) {
|
|
1685
|
-
return false;
|
|
1686
|
-
}
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
return config.key !== void 0;
|
|
1690
|
-
}
|
|
1691
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
1692
|
-
{
|
|
1693
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
1694
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
1695
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
1696
|
-
error('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
1697
|
-
didWarnAboutStringRefs[componentName] = true;
|
|
1698
|
-
}
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
}
|
|
1702
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
1703
|
-
{
|
|
1704
|
-
var warnAboutAccessingKey = function() {
|
|
1705
|
-
if (!specialPropKeyWarningShown) {
|
|
1706
|
-
specialPropKeyWarningShown = true;
|
|
1707
|
-
error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
1708
|
-
}
|
|
1709
|
-
};
|
|
1710
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
1711
|
-
Object.defineProperty(props, "key", {
|
|
1712
|
-
get: warnAboutAccessingKey,
|
|
1713
|
-
configurable: true
|
|
1714
|
-
});
|
|
1715
|
-
}
|
|
1716
|
-
}
|
|
1717
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
1718
|
-
{
|
|
1719
|
-
var warnAboutAccessingRef = function() {
|
|
1720
|
-
if (!specialPropRefWarningShown) {
|
|
1721
|
-
specialPropRefWarningShown = true;
|
|
1722
|
-
error("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", displayName);
|
|
1723
|
-
}
|
|
1724
|
-
};
|
|
1725
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
1726
|
-
Object.defineProperty(props, "ref", {
|
|
1727
|
-
get: warnAboutAccessingRef,
|
|
1728
|
-
configurable: true
|
|
1729
|
-
});
|
|
1730
|
-
}
|
|
1731
|
-
}
|
|
1732
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
1733
|
-
var element = {
|
|
1734
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
1735
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
1736
|
-
// Built-in properties that belong on the element
|
|
1737
|
-
type,
|
|
1738
|
-
key,
|
|
1739
|
-
ref,
|
|
1740
|
-
props,
|
|
1741
|
-
// Record the component responsible for creating this element.
|
|
1742
|
-
_owner: owner
|
|
1743
|
-
};
|
|
1744
|
-
{
|
|
1745
|
-
element._store = {};
|
|
1746
|
-
Object.defineProperty(element._store, "validated", {
|
|
1747
|
-
configurable: false,
|
|
1748
|
-
enumerable: false,
|
|
1749
|
-
writable: true,
|
|
1750
|
-
value: false
|
|
1751
|
-
});
|
|
1752
|
-
Object.defineProperty(element, "_self", {
|
|
1753
|
-
configurable: false,
|
|
1754
|
-
enumerable: false,
|
|
1755
|
-
writable: false,
|
|
1756
|
-
value: self
|
|
1757
|
-
});
|
|
1758
|
-
Object.defineProperty(element, "_source", {
|
|
1759
|
-
configurable: false,
|
|
1760
|
-
enumerable: false,
|
|
1761
|
-
writable: false,
|
|
1762
|
-
value: source
|
|
1763
|
-
});
|
|
1764
|
-
if (Object.freeze) {
|
|
1765
|
-
Object.freeze(element.props);
|
|
1766
|
-
Object.freeze(element);
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
return element;
|
|
1770
|
-
};
|
|
1771
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
1772
|
-
{
|
|
1773
|
-
var propName;
|
|
1774
|
-
var props = {};
|
|
1775
|
-
var key = null;
|
|
1776
|
-
var ref = null;
|
|
1777
|
-
if (maybeKey !== void 0) {
|
|
1778
|
-
{
|
|
1779
|
-
checkKeyStringCoercion(maybeKey);
|
|
1780
|
-
}
|
|
1781
|
-
key = "" + maybeKey;
|
|
1782
|
-
}
|
|
1783
|
-
if (hasValidKey(config)) {
|
|
1784
|
-
{
|
|
1785
|
-
checkKeyStringCoercion(config.key);
|
|
1786
|
-
}
|
|
1787
|
-
key = "" + config.key;
|
|
1788
|
-
}
|
|
1789
|
-
if (hasValidRef(config)) {
|
|
1790
|
-
ref = config.ref;
|
|
1791
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
1792
|
-
}
|
|
1793
|
-
for (propName in config) {
|
|
1794
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
1795
|
-
props[propName] = config[propName];
|
|
1796
|
-
}
|
|
1797
|
-
}
|
|
1798
|
-
if (type && type.defaultProps) {
|
|
1799
|
-
var defaultProps = type.defaultProps;
|
|
1800
|
-
for (propName in defaultProps) {
|
|
1801
|
-
if (props[propName] === void 0) {
|
|
1802
|
-
props[propName] = defaultProps[propName];
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
}
|
|
1806
|
-
if (key || ref) {
|
|
1807
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
1808
|
-
if (key) {
|
|
1809
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
1810
|
-
}
|
|
1811
|
-
if (ref) {
|
|
1812
|
-
defineRefPropWarningGetter(props, displayName);
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
1819
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1820
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
1821
|
-
{
|
|
1822
|
-
if (element) {
|
|
1823
|
-
var owner = element._owner;
|
|
1824
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
1825
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
1826
|
-
} else {
|
|
1827
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
var propTypesMisspellWarningShown;
|
|
1832
|
-
{
|
|
1833
|
-
propTypesMisspellWarningShown = false;
|
|
1834
|
-
}
|
|
1835
|
-
function isValidElement(object) {
|
|
1836
|
-
{
|
|
1837
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1838
|
-
}
|
|
1839
|
-
}
|
|
1840
|
-
function getDeclarationErrorAddendum() {
|
|
1841
|
-
{
|
|
1842
|
-
if (ReactCurrentOwner$1.current) {
|
|
1843
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1844
|
-
if (name) {
|
|
1845
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
return "";
|
|
1849
|
-
}
|
|
1850
|
-
}
|
|
1851
|
-
function getSourceInfoErrorAddendum(source) {
|
|
1852
|
-
{
|
|
1853
|
-
return "";
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
var ownerHasKeyUseWarning = {};
|
|
1857
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1858
|
-
{
|
|
1859
|
-
var info = getDeclarationErrorAddendum();
|
|
1860
|
-
if (!info) {
|
|
1861
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
1862
|
-
if (parentName) {
|
|
1863
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
|
-
return info;
|
|
1867
|
-
}
|
|
1868
|
-
}
|
|
1869
|
-
function validateExplicitKey(element, parentType) {
|
|
1870
|
-
{
|
|
1871
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1872
|
-
return;
|
|
1873
|
-
}
|
|
1874
|
-
element._store.validated = true;
|
|
1875
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
1876
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1877
|
-
return;
|
|
1878
|
-
}
|
|
1879
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
1880
|
-
var childOwner = "";
|
|
1881
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1882
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1883
|
-
}
|
|
1884
|
-
setCurrentlyValidatingElement$1(element);
|
|
1885
|
-
error('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1886
|
-
setCurrentlyValidatingElement$1(null);
|
|
1887
|
-
}
|
|
1888
|
-
}
|
|
1889
|
-
function validateChildKeys(node, parentType) {
|
|
1890
|
-
{
|
|
1891
|
-
if (typeof node !== "object") {
|
|
1892
|
-
return;
|
|
1893
|
-
}
|
|
1894
|
-
if (isArray(node)) {
|
|
1895
|
-
for (var i = 0; i < node.length; i++) {
|
|
1896
|
-
var child = node[i];
|
|
1897
|
-
if (isValidElement(child)) {
|
|
1898
|
-
validateExplicitKey(child, parentType);
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
} else if (isValidElement(node)) {
|
|
1902
|
-
if (node._store) {
|
|
1903
|
-
node._store.validated = true;
|
|
1904
|
-
}
|
|
1905
|
-
} else if (node) {
|
|
1906
|
-
var iteratorFn = getIteratorFn(node);
|
|
1907
|
-
if (typeof iteratorFn === "function") {
|
|
1908
|
-
if (iteratorFn !== node.entries) {
|
|
1909
|
-
var iterator = iteratorFn.call(node);
|
|
1910
|
-
var step;
|
|
1911
|
-
while (!(step = iterator.next()).done) {
|
|
1912
|
-
if (isValidElement(step.value)) {
|
|
1913
|
-
validateExplicitKey(step.value, parentType);
|
|
1914
|
-
}
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
function validatePropTypes(element) {
|
|
1922
|
-
{
|
|
1923
|
-
var type = element.type;
|
|
1924
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
|
1925
|
-
return;
|
|
1926
|
-
}
|
|
1927
|
-
var propTypes;
|
|
1928
|
-
if (typeof type === "function") {
|
|
1929
|
-
propTypes = type.propTypes;
|
|
1930
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1931
|
-
// Inner props are checked in the reconciler.
|
|
1932
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1933
|
-
propTypes = type.propTypes;
|
|
1934
|
-
} else {
|
|
1935
|
-
return;
|
|
1936
|
-
}
|
|
1937
|
-
if (propTypes) {
|
|
1938
|
-
var name = getComponentNameFromType(type);
|
|
1939
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
1940
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
1941
|
-
propTypesMisspellWarningShown = true;
|
|
1942
|
-
var _name = getComponentNameFromType(type);
|
|
1943
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
1944
|
-
}
|
|
1945
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
1946
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
function validateFragmentProps(fragment) {
|
|
1951
|
-
{
|
|
1952
|
-
var keys = Object.keys(fragment.props);
|
|
1953
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1954
|
-
var key = keys[i];
|
|
1955
|
-
if (key !== "children" && key !== "key") {
|
|
1956
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1957
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
1958
|
-
setCurrentlyValidatingElement$1(null);
|
|
1959
|
-
break;
|
|
1960
|
-
}
|
|
1961
|
-
}
|
|
1962
|
-
if (fragment.ref !== null) {
|
|
1963
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1964
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
1965
|
-
setCurrentlyValidatingElement$1(null);
|
|
1966
|
-
}
|
|
1967
|
-
}
|
|
1968
|
-
}
|
|
1969
|
-
var didWarnAboutKeySpread = {};
|
|
1970
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1971
|
-
{
|
|
1972
|
-
var validType = isValidElementType(type);
|
|
1973
|
-
if (!validType) {
|
|
1974
|
-
var info = "";
|
|
1975
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
1976
|
-
info += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1977
|
-
}
|
|
1978
|
-
var sourceInfo = getSourceInfoErrorAddendum();
|
|
1979
|
-
if (sourceInfo) {
|
|
1980
|
-
info += sourceInfo;
|
|
1981
|
-
} else {
|
|
1982
|
-
info += getDeclarationErrorAddendum();
|
|
1983
|
-
}
|
|
1984
|
-
var typeString;
|
|
1985
|
-
if (type === null) {
|
|
1986
|
-
typeString = "null";
|
|
1987
|
-
} else if (isArray(type)) {
|
|
1988
|
-
typeString = "array";
|
|
1989
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1990
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
1991
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
1992
|
-
} else {
|
|
1993
|
-
typeString = typeof type;
|
|
1994
|
-
}
|
|
1995
|
-
error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
|
1996
|
-
}
|
|
1997
|
-
var element = jsxDEV(type, props, key, source, self);
|
|
1998
|
-
if (element == null) {
|
|
1999
|
-
return element;
|
|
2000
|
-
}
|
|
2001
|
-
if (validType) {
|
|
2002
|
-
var children = props.children;
|
|
2003
|
-
if (children !== void 0) {
|
|
2004
|
-
if (isStaticChildren) {
|
|
2005
|
-
if (isArray(children)) {
|
|
2006
|
-
for (var i = 0; i < children.length; i++) {
|
|
2007
|
-
validateChildKeys(children[i], type);
|
|
2008
|
-
}
|
|
2009
|
-
if (Object.freeze) {
|
|
2010
|
-
Object.freeze(children);
|
|
2011
|
-
}
|
|
2012
|
-
} else {
|
|
2013
|
-
error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
2014
|
-
}
|
|
2015
|
-
} else {
|
|
2016
|
-
validateChildKeys(children, type);
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
}
|
|
2020
|
-
{
|
|
2021
|
-
if (hasOwnProperty.call(props, "key")) {
|
|
2022
|
-
var componentName = getComponentNameFromType(type);
|
|
2023
|
-
var keys = Object.keys(props).filter(function(k) {
|
|
2024
|
-
return k !== "key";
|
|
2025
|
-
});
|
|
2026
|
-
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
2027
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
2028
|
-
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
|
2029
|
-
error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
2030
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
2031
|
-
}
|
|
2032
|
-
}
|
|
2033
|
-
}
|
|
2034
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
2035
|
-
validateFragmentProps(element);
|
|
2036
|
-
} else {
|
|
2037
|
-
validatePropTypes(element);
|
|
2038
|
-
}
|
|
2039
|
-
return element;
|
|
2040
|
-
}
|
|
2041
|
-
}
|
|
2042
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
2043
|
-
{
|
|
2044
|
-
return jsxWithValidation(type, props, key, true);
|
|
2045
|
-
}
|
|
2046
|
-
}
|
|
2047
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
2048
|
-
{
|
|
2049
|
-
return jsxWithValidation(type, props, key, false);
|
|
2050
|
-
}
|
|
2051
|
-
}
|
|
2052
|
-
var jsx = jsxWithValidationDynamic;
|
|
2053
|
-
var jsxs = jsxWithValidationStatic;
|
|
2054
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
2055
|
-
reactJsxRuntime_development.jsx = jsx;
|
|
2056
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
2057
|
-
})();
|
|
2058
|
-
}
|
|
2059
|
-
return reactJsxRuntime_development;
|
|
2060
|
-
}
|
|
2061
|
-
if (process.env.NODE_ENV === "production") {
|
|
2062
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
2063
|
-
} else {
|
|
2064
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
2065
|
-
}
|
|
2066
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
2067
|
-
export {
|
|
2068
|
-
Await as A,
|
|
2069
|
-
useLoaderData as B,
|
|
2070
|
-
useMatch as C,
|
|
2071
|
-
DataRouterStateContext as D,
|
|
2072
|
-
useNavigationType as E,
|
|
2073
|
-
useOutlet as F,
|
|
2074
|
-
useOutletContext as G,
|
|
2075
|
-
useRevalidator as H,
|
|
2076
|
-
useRouteLoaderData as I,
|
|
2077
|
-
useRoutes as J,
|
|
2078
|
-
LocationContext as L,
|
|
2079
|
-
MemoryRouter as M,
|
|
2080
|
-
Navigate as N,
|
|
2081
|
-
Outlet as O,
|
|
2082
|
-
Router as R,
|
|
2083
|
-
useNavigate as a,
|
|
2084
|
-
useParams as b,
|
|
2085
|
-
useRouteError as c,
|
|
2086
|
-
dist as d,
|
|
2087
|
-
NavigationContext as e,
|
|
2088
|
-
useHref as f,
|
|
2089
|
-
useResolvedPath as g,
|
|
2090
|
-
DataRouterContext as h,
|
|
2091
|
-
useRoutesImpl as i,
|
|
2092
|
-
jsxRuntimeExports as j,
|
|
2093
|
-
useRouteId as k,
|
|
2094
|
-
RouteContext as l,
|
|
2095
|
-
mapRouteProperties as m,
|
|
2096
|
-
useMatches as n,
|
|
2097
|
-
useNavigation as o,
|
|
2098
|
-
useBlocker as p,
|
|
2099
|
-
Route as q,
|
|
2100
|
-
Routes as r,
|
|
2101
|
-
createMemoryRouter as s,
|
|
2102
|
-
createRoutesFromChildren as t,
|
|
2103
|
-
useLocation as u,
|
|
2104
|
-
renderMatches as v,
|
|
2105
|
-
useActionData as w,
|
|
2106
|
-
useAsyncError as x,
|
|
2107
|
-
useAsyncValue as y,
|
|
2108
|
-
useInRouterContext as z
|
|
2109
|
-
};
|
|
2110
|
-
//# sourceMappingURL=jsx-runtime-DvZ6OKMM.js.map
|