@rqdhw3n/react-auth-flow 1.0.2 → 1.0.3
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/index.cjs.js +99 -1020
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +63 -984
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -2
package/dist/index.es.js
CHANGED
|
@@ -1,927 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { createContext, useReducer, useCallback, useEffect, useContext, useState } from "react";
|
|
2
3
|
import { Navigate } from "react-router-dom";
|
|
3
|
-
var jsxRuntime = { exports: {} };
|
|
4
|
-
var reactJsxRuntime_production_min = {};
|
|
5
|
-
/**
|
|
6
|
-
* @license React
|
|
7
|
-
* react-jsx-runtime.production.min.js
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the MIT license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/
|
|
14
|
-
var hasRequiredReactJsxRuntime_production_min;
|
|
15
|
-
function requireReactJsxRuntime_production_min() {
|
|
16
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
17
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
|
18
|
-
var f = require$$0, 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 };
|
|
19
|
-
function q(c, a, g) {
|
|
20
|
-
var b, d = {}, e = null, h = null;
|
|
21
|
-
void 0 !== g && (e = "" + g);
|
|
22
|
-
void 0 !== a.key && (e = "" + a.key);
|
|
23
|
-
void 0 !== a.ref && (h = a.ref);
|
|
24
|
-
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
25
|
-
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
26
|
-
return { $$typeof: k, type: c, key: e, ref: h, props: d, _owner: n.current };
|
|
27
|
-
}
|
|
28
|
-
reactJsxRuntime_production_min.Fragment = l;
|
|
29
|
-
reactJsxRuntime_production_min.jsx = q;
|
|
30
|
-
reactJsxRuntime_production_min.jsxs = q;
|
|
31
|
-
return reactJsxRuntime_production_min;
|
|
32
|
-
}
|
|
33
|
-
var reactJsxRuntime_development = {};
|
|
34
|
-
/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-jsx-runtime.development.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/
|
|
43
|
-
var hasRequiredReactJsxRuntime_development;
|
|
44
|
-
function requireReactJsxRuntime_development() {
|
|
45
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
46
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
47
|
-
if (process.env.NODE_ENV !== "production") {
|
|
48
|
-
(function() {
|
|
49
|
-
var React = require$$0;
|
|
50
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
51
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
52
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
53
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
54
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
55
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
56
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
57
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
58
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
59
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
60
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
61
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
62
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
63
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
64
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
65
|
-
function getIteratorFn(maybeIterable) {
|
|
66
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
70
|
-
if (typeof maybeIterator === "function") {
|
|
71
|
-
return maybeIterator;
|
|
72
|
-
}
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
76
|
-
function error(format) {
|
|
77
|
-
{
|
|
78
|
-
{
|
|
79
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
80
|
-
args[_key2 - 1] = arguments[_key2];
|
|
81
|
-
}
|
|
82
|
-
printWarning("error", format, args);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function printWarning(level, format, args) {
|
|
87
|
-
{
|
|
88
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
89
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
|
90
|
-
if (stack !== "") {
|
|
91
|
-
format += "%s";
|
|
92
|
-
args = args.concat([stack]);
|
|
93
|
-
}
|
|
94
|
-
var argsWithFormat = args.map(function(item) {
|
|
95
|
-
return String(item);
|
|
96
|
-
});
|
|
97
|
-
argsWithFormat.unshift("Warning: " + format);
|
|
98
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
var enableScopeAPI = false;
|
|
102
|
-
var enableCacheElement = false;
|
|
103
|
-
var enableTransitionTracing = false;
|
|
104
|
-
var enableLegacyHidden = false;
|
|
105
|
-
var enableDebugTracing = false;
|
|
106
|
-
var REACT_MODULE_REFERENCE;
|
|
107
|
-
{
|
|
108
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
109
|
-
}
|
|
110
|
-
function isValidElementType(type) {
|
|
111
|
-
if (typeof type === "string" || typeof type === "function") {
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
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) {
|
|
115
|
-
return true;
|
|
116
|
-
}
|
|
117
|
-
if (typeof type === "object" && type !== null) {
|
|
118
|
-
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
|
|
119
|
-
// types supported by any Flight configuration anywhere since
|
|
120
|
-
// we don't know which Flight build this will end up being used
|
|
121
|
-
// with.
|
|
122
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
123
|
-
return true;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
|
129
|
-
var displayName = outerType.displayName;
|
|
130
|
-
if (displayName) {
|
|
131
|
-
return displayName;
|
|
132
|
-
}
|
|
133
|
-
var functionName = innerType.displayName || innerType.name || "";
|
|
134
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
135
|
-
}
|
|
136
|
-
function getContextName(type) {
|
|
137
|
-
return type.displayName || "Context";
|
|
138
|
-
}
|
|
139
|
-
function getComponentNameFromType(type) {
|
|
140
|
-
if (type == null) {
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
{
|
|
144
|
-
if (typeof type.tag === "number") {
|
|
145
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (typeof type === "function") {
|
|
149
|
-
return type.displayName || type.name || null;
|
|
150
|
-
}
|
|
151
|
-
if (typeof type === "string") {
|
|
152
|
-
return type;
|
|
153
|
-
}
|
|
154
|
-
switch (type) {
|
|
155
|
-
case REACT_FRAGMENT_TYPE:
|
|
156
|
-
return "Fragment";
|
|
157
|
-
case REACT_PORTAL_TYPE:
|
|
158
|
-
return "Portal";
|
|
159
|
-
case REACT_PROFILER_TYPE:
|
|
160
|
-
return "Profiler";
|
|
161
|
-
case REACT_STRICT_MODE_TYPE:
|
|
162
|
-
return "StrictMode";
|
|
163
|
-
case REACT_SUSPENSE_TYPE:
|
|
164
|
-
return "Suspense";
|
|
165
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
166
|
-
return "SuspenseList";
|
|
167
|
-
}
|
|
168
|
-
if (typeof type === "object") {
|
|
169
|
-
switch (type.$$typeof) {
|
|
170
|
-
case REACT_CONTEXT_TYPE:
|
|
171
|
-
var context = type;
|
|
172
|
-
return getContextName(context) + ".Consumer";
|
|
173
|
-
case REACT_PROVIDER_TYPE:
|
|
174
|
-
var provider = type;
|
|
175
|
-
return getContextName(provider._context) + ".Provider";
|
|
176
|
-
case REACT_FORWARD_REF_TYPE:
|
|
177
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
|
178
|
-
case REACT_MEMO_TYPE:
|
|
179
|
-
var outerName = type.displayName || null;
|
|
180
|
-
if (outerName !== null) {
|
|
181
|
-
return outerName;
|
|
182
|
-
}
|
|
183
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
184
|
-
case REACT_LAZY_TYPE: {
|
|
185
|
-
var lazyComponent = type;
|
|
186
|
-
var payload = lazyComponent._payload;
|
|
187
|
-
var init = lazyComponent._init;
|
|
188
|
-
try {
|
|
189
|
-
return getComponentNameFromType(init(payload));
|
|
190
|
-
} catch (x) {
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return null;
|
|
197
|
-
}
|
|
198
|
-
var assign = Object.assign;
|
|
199
|
-
var disabledDepth = 0;
|
|
200
|
-
var prevLog;
|
|
201
|
-
var prevInfo;
|
|
202
|
-
var prevWarn;
|
|
203
|
-
var prevError;
|
|
204
|
-
var prevGroup;
|
|
205
|
-
var prevGroupCollapsed;
|
|
206
|
-
var prevGroupEnd;
|
|
207
|
-
function disabledLog() {
|
|
208
|
-
}
|
|
209
|
-
disabledLog.__reactDisabledLog = true;
|
|
210
|
-
function disableLogs() {
|
|
211
|
-
{
|
|
212
|
-
if (disabledDepth === 0) {
|
|
213
|
-
prevLog = console.log;
|
|
214
|
-
prevInfo = console.info;
|
|
215
|
-
prevWarn = console.warn;
|
|
216
|
-
prevError = console.error;
|
|
217
|
-
prevGroup = console.group;
|
|
218
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
219
|
-
prevGroupEnd = console.groupEnd;
|
|
220
|
-
var props = {
|
|
221
|
-
configurable: true,
|
|
222
|
-
enumerable: true,
|
|
223
|
-
value: disabledLog,
|
|
224
|
-
writable: true
|
|
225
|
-
};
|
|
226
|
-
Object.defineProperties(console, {
|
|
227
|
-
info: props,
|
|
228
|
-
log: props,
|
|
229
|
-
warn: props,
|
|
230
|
-
error: props,
|
|
231
|
-
group: props,
|
|
232
|
-
groupCollapsed: props,
|
|
233
|
-
groupEnd: props
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
disabledDepth++;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
function reenableLogs() {
|
|
240
|
-
{
|
|
241
|
-
disabledDepth--;
|
|
242
|
-
if (disabledDepth === 0) {
|
|
243
|
-
var props = {
|
|
244
|
-
configurable: true,
|
|
245
|
-
enumerable: true,
|
|
246
|
-
writable: true
|
|
247
|
-
};
|
|
248
|
-
Object.defineProperties(console, {
|
|
249
|
-
log: assign({}, props, {
|
|
250
|
-
value: prevLog
|
|
251
|
-
}),
|
|
252
|
-
info: assign({}, props, {
|
|
253
|
-
value: prevInfo
|
|
254
|
-
}),
|
|
255
|
-
warn: assign({}, props, {
|
|
256
|
-
value: prevWarn
|
|
257
|
-
}),
|
|
258
|
-
error: assign({}, props, {
|
|
259
|
-
value: prevError
|
|
260
|
-
}),
|
|
261
|
-
group: assign({}, props, {
|
|
262
|
-
value: prevGroup
|
|
263
|
-
}),
|
|
264
|
-
groupCollapsed: assign({}, props, {
|
|
265
|
-
value: prevGroupCollapsed
|
|
266
|
-
}),
|
|
267
|
-
groupEnd: assign({}, props, {
|
|
268
|
-
value: prevGroupEnd
|
|
269
|
-
})
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
if (disabledDepth < 0) {
|
|
273
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
278
|
-
var prefix;
|
|
279
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
280
|
-
{
|
|
281
|
-
if (prefix === void 0) {
|
|
282
|
-
try {
|
|
283
|
-
throw Error();
|
|
284
|
-
} catch (x) {
|
|
285
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
286
|
-
prefix = match && match[1] || "";
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return "\n" + prefix + name;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
var reentry = false;
|
|
293
|
-
var componentFrameCache;
|
|
294
|
-
{
|
|
295
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
296
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
297
|
-
}
|
|
298
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
299
|
-
if (!fn || reentry) {
|
|
300
|
-
return "";
|
|
301
|
-
}
|
|
302
|
-
{
|
|
303
|
-
var frame = componentFrameCache.get(fn);
|
|
304
|
-
if (frame !== void 0) {
|
|
305
|
-
return frame;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
var control;
|
|
309
|
-
reentry = true;
|
|
310
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
311
|
-
Error.prepareStackTrace = void 0;
|
|
312
|
-
var previousDispatcher;
|
|
313
|
-
{
|
|
314
|
-
previousDispatcher = ReactCurrentDispatcher.current;
|
|
315
|
-
ReactCurrentDispatcher.current = null;
|
|
316
|
-
disableLogs();
|
|
317
|
-
}
|
|
318
|
-
try {
|
|
319
|
-
if (construct) {
|
|
320
|
-
var Fake = function() {
|
|
321
|
-
throw Error();
|
|
322
|
-
};
|
|
323
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
324
|
-
set: function() {
|
|
325
|
-
throw Error();
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
|
329
|
-
try {
|
|
330
|
-
Reflect.construct(Fake, []);
|
|
331
|
-
} catch (x) {
|
|
332
|
-
control = x;
|
|
333
|
-
}
|
|
334
|
-
Reflect.construct(fn, [], Fake);
|
|
335
|
-
} else {
|
|
336
|
-
try {
|
|
337
|
-
Fake.call();
|
|
338
|
-
} catch (x) {
|
|
339
|
-
control = x;
|
|
340
|
-
}
|
|
341
|
-
fn.call(Fake.prototype);
|
|
342
|
-
}
|
|
343
|
-
} else {
|
|
344
|
-
try {
|
|
345
|
-
throw Error();
|
|
346
|
-
} catch (x) {
|
|
347
|
-
control = x;
|
|
348
|
-
}
|
|
349
|
-
fn();
|
|
350
|
-
}
|
|
351
|
-
} catch (sample) {
|
|
352
|
-
if (sample && control && typeof sample.stack === "string") {
|
|
353
|
-
var sampleLines = sample.stack.split("\n");
|
|
354
|
-
var controlLines = control.stack.split("\n");
|
|
355
|
-
var s = sampleLines.length - 1;
|
|
356
|
-
var c = controlLines.length - 1;
|
|
357
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
358
|
-
c--;
|
|
359
|
-
}
|
|
360
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
361
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
362
|
-
if (s !== 1 || c !== 1) {
|
|
363
|
-
do {
|
|
364
|
-
s--;
|
|
365
|
-
c--;
|
|
366
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
367
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
|
368
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
|
369
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
|
370
|
-
}
|
|
371
|
-
{
|
|
372
|
-
if (typeof fn === "function") {
|
|
373
|
-
componentFrameCache.set(fn, _frame);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
return _frame;
|
|
377
|
-
}
|
|
378
|
-
} while (s >= 1 && c >= 0);
|
|
379
|
-
}
|
|
380
|
-
break;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
} finally {
|
|
385
|
-
reentry = false;
|
|
386
|
-
{
|
|
387
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
388
|
-
reenableLogs();
|
|
389
|
-
}
|
|
390
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
391
|
-
}
|
|
392
|
-
var name = fn ? fn.displayName || fn.name : "";
|
|
393
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
|
394
|
-
{
|
|
395
|
-
if (typeof fn === "function") {
|
|
396
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
return syntheticFrame;
|
|
400
|
-
}
|
|
401
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
402
|
-
{
|
|
403
|
-
return describeNativeComponentFrame(fn, false);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
function shouldConstruct(Component) {
|
|
407
|
-
var prototype = Component.prototype;
|
|
408
|
-
return !!(prototype && prototype.isReactComponent);
|
|
409
|
-
}
|
|
410
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
411
|
-
if (type == null) {
|
|
412
|
-
return "";
|
|
413
|
-
}
|
|
414
|
-
if (typeof type === "function") {
|
|
415
|
-
{
|
|
416
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
if (typeof type === "string") {
|
|
420
|
-
return describeBuiltInComponentFrame(type);
|
|
421
|
-
}
|
|
422
|
-
switch (type) {
|
|
423
|
-
case REACT_SUSPENSE_TYPE:
|
|
424
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
425
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
426
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
427
|
-
}
|
|
428
|
-
if (typeof type === "object") {
|
|
429
|
-
switch (type.$$typeof) {
|
|
430
|
-
case REACT_FORWARD_REF_TYPE:
|
|
431
|
-
return describeFunctionComponentFrame(type.render);
|
|
432
|
-
case REACT_MEMO_TYPE:
|
|
433
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
434
|
-
case REACT_LAZY_TYPE: {
|
|
435
|
-
var lazyComponent = type;
|
|
436
|
-
var payload = lazyComponent._payload;
|
|
437
|
-
var init = lazyComponent._init;
|
|
438
|
-
try {
|
|
439
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
440
|
-
} catch (x) {
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
return "";
|
|
446
|
-
}
|
|
447
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
448
|
-
var loggedTypeFailures = {};
|
|
449
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
450
|
-
function setCurrentlyValidatingElement(element) {
|
|
451
|
-
{
|
|
452
|
-
if (element) {
|
|
453
|
-
var owner = element._owner;
|
|
454
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
455
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
456
|
-
} else {
|
|
457
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
462
|
-
{
|
|
463
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
464
|
-
for (var typeSpecName in typeSpecs) {
|
|
465
|
-
if (has(typeSpecs, typeSpecName)) {
|
|
466
|
-
var error$1 = void 0;
|
|
467
|
-
try {
|
|
468
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
469
|
-
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`.");
|
|
470
|
-
err.name = "Invariant Violation";
|
|
471
|
-
throw err;
|
|
472
|
-
}
|
|
473
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
474
|
-
} catch (ex) {
|
|
475
|
-
error$1 = ex;
|
|
476
|
-
}
|
|
477
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
|
478
|
-
setCurrentlyValidatingElement(element);
|
|
479
|
-
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);
|
|
480
|
-
setCurrentlyValidatingElement(null);
|
|
481
|
-
}
|
|
482
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
483
|
-
loggedTypeFailures[error$1.message] = true;
|
|
484
|
-
setCurrentlyValidatingElement(element);
|
|
485
|
-
error("Failed %s type: %s", location, error$1.message);
|
|
486
|
-
setCurrentlyValidatingElement(null);
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
var isArrayImpl = Array.isArray;
|
|
493
|
-
function isArray(a) {
|
|
494
|
-
return isArrayImpl(a);
|
|
495
|
-
}
|
|
496
|
-
function typeName(value) {
|
|
497
|
-
{
|
|
498
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
|
499
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
500
|
-
return type;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
function willCoercionThrow(value) {
|
|
504
|
-
{
|
|
505
|
-
try {
|
|
506
|
-
testStringCoercion(value);
|
|
507
|
-
return false;
|
|
508
|
-
} catch (e) {
|
|
509
|
-
return true;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
function testStringCoercion(value) {
|
|
514
|
-
return "" + value;
|
|
515
|
-
}
|
|
516
|
-
function checkKeyStringCoercion(value) {
|
|
517
|
-
{
|
|
518
|
-
if (willCoercionThrow(value)) {
|
|
519
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
|
520
|
-
return testStringCoercion(value);
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
525
|
-
var RESERVED_PROPS = {
|
|
526
|
-
key: true,
|
|
527
|
-
ref: true,
|
|
528
|
-
__self: true,
|
|
529
|
-
__source: true
|
|
530
|
-
};
|
|
531
|
-
var specialPropKeyWarningShown;
|
|
532
|
-
var specialPropRefWarningShown;
|
|
533
|
-
function hasValidRef(config) {
|
|
534
|
-
{
|
|
535
|
-
if (hasOwnProperty.call(config, "ref")) {
|
|
536
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
|
537
|
-
if (getter && getter.isReactWarning) {
|
|
538
|
-
return false;
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
return config.ref !== void 0;
|
|
543
|
-
}
|
|
544
|
-
function hasValidKey(config) {
|
|
545
|
-
{
|
|
546
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
547
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
548
|
-
if (getter && getter.isReactWarning) {
|
|
549
|
-
return false;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
return config.key !== void 0;
|
|
554
|
-
}
|
|
555
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
556
|
-
{
|
|
557
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && self) ;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
561
|
-
{
|
|
562
|
-
var warnAboutAccessingKey = function() {
|
|
563
|
-
if (!specialPropKeyWarningShown) {
|
|
564
|
-
specialPropKeyWarningShown = true;
|
|
565
|
-
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);
|
|
566
|
-
}
|
|
567
|
-
};
|
|
568
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
569
|
-
Object.defineProperty(props, "key", {
|
|
570
|
-
get: warnAboutAccessingKey,
|
|
571
|
-
configurable: true
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
576
|
-
{
|
|
577
|
-
var warnAboutAccessingRef = function() {
|
|
578
|
-
if (!specialPropRefWarningShown) {
|
|
579
|
-
specialPropRefWarningShown = true;
|
|
580
|
-
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);
|
|
581
|
-
}
|
|
582
|
-
};
|
|
583
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
584
|
-
Object.defineProperty(props, "ref", {
|
|
585
|
-
get: warnAboutAccessingRef,
|
|
586
|
-
configurable: true
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
591
|
-
var element = {
|
|
592
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
593
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
594
|
-
// Built-in properties that belong on the element
|
|
595
|
-
type,
|
|
596
|
-
key,
|
|
597
|
-
ref,
|
|
598
|
-
props,
|
|
599
|
-
// Record the component responsible for creating this element.
|
|
600
|
-
_owner: owner
|
|
601
|
-
};
|
|
602
|
-
{
|
|
603
|
-
element._store = {};
|
|
604
|
-
Object.defineProperty(element._store, "validated", {
|
|
605
|
-
configurable: false,
|
|
606
|
-
enumerable: false,
|
|
607
|
-
writable: true,
|
|
608
|
-
value: false
|
|
609
|
-
});
|
|
610
|
-
Object.defineProperty(element, "_self", {
|
|
611
|
-
configurable: false,
|
|
612
|
-
enumerable: false,
|
|
613
|
-
writable: false,
|
|
614
|
-
value: self
|
|
615
|
-
});
|
|
616
|
-
Object.defineProperty(element, "_source", {
|
|
617
|
-
configurable: false,
|
|
618
|
-
enumerable: false,
|
|
619
|
-
writable: false,
|
|
620
|
-
value: source
|
|
621
|
-
});
|
|
622
|
-
if (Object.freeze) {
|
|
623
|
-
Object.freeze(element.props);
|
|
624
|
-
Object.freeze(element);
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
return element;
|
|
628
|
-
};
|
|
629
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
|
630
|
-
{
|
|
631
|
-
var propName;
|
|
632
|
-
var props = {};
|
|
633
|
-
var key = null;
|
|
634
|
-
var ref = null;
|
|
635
|
-
if (maybeKey !== void 0) {
|
|
636
|
-
{
|
|
637
|
-
checkKeyStringCoercion(maybeKey);
|
|
638
|
-
}
|
|
639
|
-
key = "" + maybeKey;
|
|
640
|
-
}
|
|
641
|
-
if (hasValidKey(config)) {
|
|
642
|
-
{
|
|
643
|
-
checkKeyStringCoercion(config.key);
|
|
644
|
-
}
|
|
645
|
-
key = "" + config.key;
|
|
646
|
-
}
|
|
647
|
-
if (hasValidRef(config)) {
|
|
648
|
-
ref = config.ref;
|
|
649
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
650
|
-
}
|
|
651
|
-
for (propName in config) {
|
|
652
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
653
|
-
props[propName] = config[propName];
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
if (type && type.defaultProps) {
|
|
657
|
-
var defaultProps = type.defaultProps;
|
|
658
|
-
for (propName in defaultProps) {
|
|
659
|
-
if (props[propName] === void 0) {
|
|
660
|
-
props[propName] = defaultProps[propName];
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
if (key || ref) {
|
|
665
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
|
666
|
-
if (key) {
|
|
667
|
-
defineKeyPropWarningGetter(props, displayName);
|
|
668
|
-
}
|
|
669
|
-
if (ref) {
|
|
670
|
-
defineRefPropWarningGetter(props, displayName);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
677
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
678
|
-
function setCurrentlyValidatingElement$1(element) {
|
|
679
|
-
{
|
|
680
|
-
if (element) {
|
|
681
|
-
var owner = element._owner;
|
|
682
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
683
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
684
|
-
} else {
|
|
685
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
}
|
|
689
|
-
var propTypesMisspellWarningShown;
|
|
690
|
-
{
|
|
691
|
-
propTypesMisspellWarningShown = false;
|
|
692
|
-
}
|
|
693
|
-
function isValidElement(object) {
|
|
694
|
-
{
|
|
695
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
function getDeclarationErrorAddendum() {
|
|
699
|
-
{
|
|
700
|
-
if (ReactCurrentOwner$1.current) {
|
|
701
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
702
|
-
if (name) {
|
|
703
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
return "";
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
function getSourceInfoErrorAddendum(source) {
|
|
710
|
-
{
|
|
711
|
-
return "";
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
var ownerHasKeyUseWarning = {};
|
|
715
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
716
|
-
{
|
|
717
|
-
var info = getDeclarationErrorAddendum();
|
|
718
|
-
if (!info) {
|
|
719
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
|
720
|
-
if (parentName) {
|
|
721
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
return info;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
function validateExplicitKey(element, parentType) {
|
|
728
|
-
{
|
|
729
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
element._store.validated = true;
|
|
733
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
734
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
735
|
-
return;
|
|
736
|
-
}
|
|
737
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
738
|
-
var childOwner = "";
|
|
739
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
740
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
741
|
-
}
|
|
742
|
-
setCurrentlyValidatingElement$1(element);
|
|
743
|
-
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);
|
|
744
|
-
setCurrentlyValidatingElement$1(null);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
function validateChildKeys(node, parentType) {
|
|
748
|
-
{
|
|
749
|
-
if (typeof node !== "object") {
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
|
-
if (isArray(node)) {
|
|
753
|
-
for (var i = 0; i < node.length; i++) {
|
|
754
|
-
var child = node[i];
|
|
755
|
-
if (isValidElement(child)) {
|
|
756
|
-
validateExplicitKey(child, parentType);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
} else if (isValidElement(node)) {
|
|
760
|
-
if (node._store) {
|
|
761
|
-
node._store.validated = true;
|
|
762
|
-
}
|
|
763
|
-
} else if (node) {
|
|
764
|
-
var iteratorFn = getIteratorFn(node);
|
|
765
|
-
if (typeof iteratorFn === "function") {
|
|
766
|
-
if (iteratorFn !== node.entries) {
|
|
767
|
-
var iterator = iteratorFn.call(node);
|
|
768
|
-
var step;
|
|
769
|
-
while (!(step = iterator.next()).done) {
|
|
770
|
-
if (isValidElement(step.value)) {
|
|
771
|
-
validateExplicitKey(step.value, parentType);
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
}
|
|
779
|
-
function validatePropTypes(element) {
|
|
780
|
-
{
|
|
781
|
-
var type = element.type;
|
|
782
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
|
783
|
-
return;
|
|
784
|
-
}
|
|
785
|
-
var propTypes;
|
|
786
|
-
if (typeof type === "function") {
|
|
787
|
-
propTypes = type.propTypes;
|
|
788
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
789
|
-
// Inner props are checked in the reconciler.
|
|
790
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
791
|
-
propTypes = type.propTypes;
|
|
792
|
-
} else {
|
|
793
|
-
return;
|
|
794
|
-
}
|
|
795
|
-
if (propTypes) {
|
|
796
|
-
var name = getComponentNameFromType(type);
|
|
797
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
|
798
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
|
799
|
-
propTypesMisspellWarningShown = true;
|
|
800
|
-
var _name = getComponentNameFromType(type);
|
|
801
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
|
802
|
-
}
|
|
803
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
|
804
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
function validateFragmentProps(fragment) {
|
|
809
|
-
{
|
|
810
|
-
var keys = Object.keys(fragment.props);
|
|
811
|
-
for (var i = 0; i < keys.length; i++) {
|
|
812
|
-
var key = keys[i];
|
|
813
|
-
if (key !== "children" && key !== "key") {
|
|
814
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
815
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
|
816
|
-
setCurrentlyValidatingElement$1(null);
|
|
817
|
-
break;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
if (fragment.ref !== null) {
|
|
821
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
822
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
|
823
|
-
setCurrentlyValidatingElement$1(null);
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
var didWarnAboutKeySpread = {};
|
|
828
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
829
|
-
{
|
|
830
|
-
var validType = isValidElementType(type);
|
|
831
|
-
if (!validType) {
|
|
832
|
-
var info = "";
|
|
833
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
|
834
|
-
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.";
|
|
835
|
-
}
|
|
836
|
-
var sourceInfo = getSourceInfoErrorAddendum();
|
|
837
|
-
if (sourceInfo) {
|
|
838
|
-
info += sourceInfo;
|
|
839
|
-
} else {
|
|
840
|
-
info += getDeclarationErrorAddendum();
|
|
841
|
-
}
|
|
842
|
-
var typeString;
|
|
843
|
-
if (type === null) {
|
|
844
|
-
typeString = "null";
|
|
845
|
-
} else if (isArray(type)) {
|
|
846
|
-
typeString = "array";
|
|
847
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
848
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
849
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
|
850
|
-
} else {
|
|
851
|
-
typeString = typeof type;
|
|
852
|
-
}
|
|
853
|
-
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);
|
|
854
|
-
}
|
|
855
|
-
var element = jsxDEV(type, props, key, source, self);
|
|
856
|
-
if (element == null) {
|
|
857
|
-
return element;
|
|
858
|
-
}
|
|
859
|
-
if (validType) {
|
|
860
|
-
var children = props.children;
|
|
861
|
-
if (children !== void 0) {
|
|
862
|
-
if (isStaticChildren) {
|
|
863
|
-
if (isArray(children)) {
|
|
864
|
-
for (var i = 0; i < children.length; i++) {
|
|
865
|
-
validateChildKeys(children[i], type);
|
|
866
|
-
}
|
|
867
|
-
if (Object.freeze) {
|
|
868
|
-
Object.freeze(children);
|
|
869
|
-
}
|
|
870
|
-
} else {
|
|
871
|
-
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.");
|
|
872
|
-
}
|
|
873
|
-
} else {
|
|
874
|
-
validateChildKeys(children, type);
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
{
|
|
879
|
-
if (hasOwnProperty.call(props, "key")) {
|
|
880
|
-
var componentName = getComponentNameFromType(type);
|
|
881
|
-
var keys = Object.keys(props).filter(function(k) {
|
|
882
|
-
return k !== "key";
|
|
883
|
-
});
|
|
884
|
-
var beforeExample = keys.length > 0 ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
885
|
-
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
886
|
-
var afterExample = keys.length > 0 ? "{" + keys.join(": ..., ") + ": ...}" : "{}";
|
|
887
|
-
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);
|
|
888
|
-
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
|
893
|
-
validateFragmentProps(element);
|
|
894
|
-
} else {
|
|
895
|
-
validatePropTypes(element);
|
|
896
|
-
}
|
|
897
|
-
return element;
|
|
898
|
-
}
|
|
899
|
-
}
|
|
900
|
-
function jsxWithValidationStatic(type, props, key) {
|
|
901
|
-
{
|
|
902
|
-
return jsxWithValidation(type, props, key, true);
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
function jsxWithValidationDynamic(type, props, key) {
|
|
906
|
-
{
|
|
907
|
-
return jsxWithValidation(type, props, key, false);
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
var jsx = jsxWithValidationDynamic;
|
|
911
|
-
var jsxs = jsxWithValidationStatic;
|
|
912
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
913
|
-
reactJsxRuntime_development.jsx = jsx;
|
|
914
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
|
915
|
-
})();
|
|
916
|
-
}
|
|
917
|
-
return reactJsxRuntime_development;
|
|
918
|
-
}
|
|
919
|
-
if (process.env.NODE_ENV === "production") {
|
|
920
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
921
|
-
} else {
|
|
922
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
923
|
-
}
|
|
924
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
|
925
4
|
const AuthContext = createContext(
|
|
926
5
|
void 0
|
|
927
6
|
);
|
|
@@ -1157,7 +236,7 @@ const AuthProvider = ({
|
|
|
1157
236
|
// 5 minutes
|
|
1158
237
|
}) => {
|
|
1159
238
|
const [state, dispatch] = useReducer(authReducer, initialState);
|
|
1160
|
-
const clientRef =
|
|
239
|
+
const clientRef = React.useRef(
|
|
1161
240
|
createAuthClient({
|
|
1162
241
|
baseURL,
|
|
1163
242
|
endpoints,
|
|
@@ -1315,7 +394,7 @@ const AuthProvider = ({
|
|
|
1315
394
|
restoreSession,
|
|
1316
395
|
setUser
|
|
1317
396
|
};
|
|
1318
|
-
return /* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ jsx(AuthContext.Provider, { value, children });
|
|
1319
398
|
};
|
|
1320
399
|
function useAuth() {
|
|
1321
400
|
const context = useContext(AuthContext);
|
|
@@ -1358,10 +437,10 @@ const LoginForm = ({
|
|
|
1358
437
|
});
|
|
1359
438
|
}
|
|
1360
439
|
};
|
|
1361
|
-
return /* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
440
|
+
return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className, children: [
|
|
441
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
442
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "email", className: "auth-form-label", children: labels.email || "Email" }),
|
|
443
|
+
/* @__PURE__ */ jsx(
|
|
1365
444
|
"input",
|
|
1366
445
|
{
|
|
1367
446
|
id: "email",
|
|
@@ -1375,9 +454,9 @@ const LoginForm = ({
|
|
|
1375
454
|
}
|
|
1376
455
|
)
|
|
1377
456
|
] }),
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
457
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
458
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "password", className: "auth-form-label", children: labels.password || "Password" }),
|
|
459
|
+
/* @__PURE__ */ jsx(
|
|
1381
460
|
"input",
|
|
1382
461
|
{
|
|
1383
462
|
id: "password",
|
|
@@ -1391,8 +470,8 @@ const LoginForm = ({
|
|
|
1391
470
|
}
|
|
1392
471
|
)
|
|
1393
472
|
] }),
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group auth-form-checkbox", children: [
|
|
474
|
+
/* @__PURE__ */ jsx(
|
|
1396
475
|
"input",
|
|
1397
476
|
{
|
|
1398
477
|
id: "rememberMe",
|
|
@@ -1403,10 +482,10 @@ const LoginForm = ({
|
|
|
1403
482
|
className: "auth-form-input"
|
|
1404
483
|
}
|
|
1405
484
|
),
|
|
1406
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "rememberMe", className: "auth-form-label", children: labels.rememberMe || "Remember me" })
|
|
1407
486
|
] }),
|
|
1408
|
-
error && /* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
487
|
+
error && /* @__PURE__ */ jsx("div", { className: "auth-form-error", children: error }),
|
|
488
|
+
/* @__PURE__ */ jsx(
|
|
1410
489
|
"button",
|
|
1411
490
|
{
|
|
1412
491
|
type: "submit",
|
|
@@ -1466,10 +545,10 @@ const RegisterForm = ({
|
|
|
1466
545
|
});
|
|
1467
546
|
}
|
|
1468
547
|
};
|
|
1469
|
-
return /* @__PURE__ */
|
|
1470
|
-
/* @__PURE__ */
|
|
1471
|
-
/* @__PURE__ */
|
|
1472
|
-
/* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className, children: [
|
|
549
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
550
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "name", className: "auth-form-label", children: labels.name || "Full Name" }),
|
|
551
|
+
/* @__PURE__ */ jsx(
|
|
1473
552
|
"input",
|
|
1474
553
|
{
|
|
1475
554
|
id: "name",
|
|
@@ -1483,9 +562,9 @@ const RegisterForm = ({
|
|
|
1483
562
|
}
|
|
1484
563
|
)
|
|
1485
564
|
] }),
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1488
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
566
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "email", className: "auth-form-label", children: labels.email || "Email" }),
|
|
567
|
+
/* @__PURE__ */ jsx(
|
|
1489
568
|
"input",
|
|
1490
569
|
{
|
|
1491
570
|
id: "email",
|
|
@@ -1499,9 +578,9 @@ const RegisterForm = ({
|
|
|
1499
578
|
}
|
|
1500
579
|
)
|
|
1501
580
|
] }),
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
/* @__PURE__ */
|
|
581
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
582
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "password", className: "auth-form-label", children: labels.password || "Password" }),
|
|
583
|
+
/* @__PURE__ */ jsx(
|
|
1505
584
|
"input",
|
|
1506
585
|
{
|
|
1507
586
|
id: "password",
|
|
@@ -1515,9 +594,9 @@ const RegisterForm = ({
|
|
|
1515
594
|
}
|
|
1516
595
|
)
|
|
1517
596
|
] }),
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
598
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "confirmPassword", className: "auth-form-label", children: labels.confirmPassword || "Confirm Password" }),
|
|
599
|
+
/* @__PURE__ */ jsx(
|
|
1521
600
|
"input",
|
|
1522
601
|
{
|
|
1523
602
|
id: "confirmPassword",
|
|
@@ -1531,8 +610,8 @@ const RegisterForm = ({
|
|
|
1531
610
|
}
|
|
1532
611
|
)
|
|
1533
612
|
] }),
|
|
1534
|
-
error && /* @__PURE__ */
|
|
1535
|
-
/* @__PURE__ */
|
|
613
|
+
error && /* @__PURE__ */ jsx("div", { className: "auth-form-error", children: error }),
|
|
614
|
+
/* @__PURE__ */ jsx(
|
|
1536
615
|
"button",
|
|
1537
616
|
{
|
|
1538
617
|
type: "submit",
|
|
@@ -1585,12 +664,12 @@ const ForgotPasswordForm = ({
|
|
|
1585
664
|
}
|
|
1586
665
|
};
|
|
1587
666
|
if (successMessage) {
|
|
1588
|
-
return /* @__PURE__ */
|
|
667
|
+
return /* @__PURE__ */ jsx("div", { className: `auth-form-success ${className}`, children: /* @__PURE__ */ jsx("p", { className: "auth-form-success-message", children: successMessage }) });
|
|
1589
668
|
}
|
|
1590
|
-
return /* @__PURE__ */
|
|
1591
|
-
/* @__PURE__ */
|
|
1592
|
-
/* @__PURE__ */
|
|
1593
|
-
/* @__PURE__ */
|
|
669
|
+
return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className, children: [
|
|
670
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
671
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "email", className: "auth-form-label", children: labels.email || "Email" }),
|
|
672
|
+
/* @__PURE__ */ jsx(
|
|
1594
673
|
"input",
|
|
1595
674
|
{
|
|
1596
675
|
id: "email",
|
|
@@ -1604,8 +683,8 @@ const ForgotPasswordForm = ({
|
|
|
1604
683
|
}
|
|
1605
684
|
)
|
|
1606
685
|
] }),
|
|
1607
|
-
error && /* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
686
|
+
error && /* @__PURE__ */ jsx("div", { className: "auth-form-error", children: error }),
|
|
687
|
+
/* @__PURE__ */ jsx(
|
|
1609
688
|
"button",
|
|
1610
689
|
{
|
|
1611
690
|
type: "submit",
|
|
@@ -1669,12 +748,12 @@ const ResetPasswordForm = ({
|
|
|
1669
748
|
}
|
|
1670
749
|
};
|
|
1671
750
|
if (successMessage) {
|
|
1672
|
-
return /* @__PURE__ */
|
|
751
|
+
return /* @__PURE__ */ jsx("div", { className: `auth-form-success ${className}`, children: /* @__PURE__ */ jsx("p", { className: "auth-form-success-message", children: successMessage }) });
|
|
1673
752
|
}
|
|
1674
|
-
return /* @__PURE__ */
|
|
1675
|
-
/* @__PURE__ */
|
|
1676
|
-
/* @__PURE__ */
|
|
1677
|
-
/* @__PURE__ */
|
|
753
|
+
return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className, children: [
|
|
754
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
755
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "password", className: "auth-form-label", children: labels.password || "New Password" }),
|
|
756
|
+
/* @__PURE__ */ jsx(
|
|
1678
757
|
"input",
|
|
1679
758
|
{
|
|
1680
759
|
id: "password",
|
|
@@ -1688,9 +767,9 @@ const ResetPasswordForm = ({
|
|
|
1688
767
|
}
|
|
1689
768
|
)
|
|
1690
769
|
] }),
|
|
1691
|
-
/* @__PURE__ */
|
|
1692
|
-
/* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */
|
|
770
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
771
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "confirmPassword", className: "auth-form-label", children: labels.confirmPassword || "Confirm Password" }),
|
|
772
|
+
/* @__PURE__ */ jsx(
|
|
1694
773
|
"input",
|
|
1695
774
|
{
|
|
1696
775
|
id: "confirmPassword",
|
|
@@ -1704,8 +783,8 @@ const ResetPasswordForm = ({
|
|
|
1704
783
|
}
|
|
1705
784
|
)
|
|
1706
785
|
] }),
|
|
1707
|
-
error && /* @__PURE__ */
|
|
1708
|
-
/* @__PURE__ */
|
|
786
|
+
error && /* @__PURE__ */ jsx("div", { className: "auth-form-error", children: error }),
|
|
787
|
+
/* @__PURE__ */ jsx(
|
|
1709
788
|
"button",
|
|
1710
789
|
{
|
|
1711
790
|
type: "submit",
|
|
@@ -1770,12 +849,12 @@ const VerifyEmailForm = ({
|
|
|
1770
849
|
}
|
|
1771
850
|
};
|
|
1772
851
|
if (successMessage) {
|
|
1773
|
-
return /* @__PURE__ */
|
|
852
|
+
return /* @__PURE__ */ jsx("div", { className: `auth-form-success ${className}`, children: /* @__PURE__ */ jsx("p", { className: "auth-form-success-message", children: successMessage }) });
|
|
1774
853
|
}
|
|
1775
|
-
return /* @__PURE__ */
|
|
1776
|
-
/* @__PURE__ */
|
|
1777
|
-
/* @__PURE__ */
|
|
1778
|
-
/* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className, children: [
|
|
855
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
856
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "email", className: "auth-form-label", children: labels.email || "Email" }),
|
|
857
|
+
/* @__PURE__ */ jsx(
|
|
1779
858
|
"input",
|
|
1780
859
|
{
|
|
1781
860
|
id: "email",
|
|
@@ -1789,9 +868,9 @@ const VerifyEmailForm = ({
|
|
|
1789
868
|
}
|
|
1790
869
|
)
|
|
1791
870
|
] }),
|
|
1792
|
-
/* @__PURE__ */
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
/* @__PURE__ */
|
|
871
|
+
/* @__PURE__ */ jsxs("div", { className: "auth-form-group", children: [
|
|
872
|
+
/* @__PURE__ */ jsx("label", { htmlFor: "token", className: "auth-form-label", children: labels.token || "Verification Code" }),
|
|
873
|
+
/* @__PURE__ */ jsx(
|
|
1795
874
|
"input",
|
|
1796
875
|
{
|
|
1797
876
|
id: "token",
|
|
@@ -1805,8 +884,8 @@ const VerifyEmailForm = ({
|
|
|
1805
884
|
}
|
|
1806
885
|
)
|
|
1807
886
|
] }),
|
|
1808
|
-
error && /* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
887
|
+
error && /* @__PURE__ */ jsx("div", { className: "auth-form-error", children: error }),
|
|
888
|
+
/* @__PURE__ */ jsx(
|
|
1810
889
|
"button",
|
|
1811
890
|
{
|
|
1812
891
|
type: "submit",
|
|
@@ -1827,15 +906,15 @@ const ProtectedRoute = ({
|
|
|
1827
906
|
}) => {
|
|
1828
907
|
const { isAuthenticated, isLoading, user } = useAuth();
|
|
1829
908
|
if (isLoading) {
|
|
1830
|
-
return fallback || /* @__PURE__ */
|
|
909
|
+
return fallback || /* @__PURE__ */ jsx("div", { className: "auth-loading", children: "Loading..." });
|
|
1831
910
|
}
|
|
1832
911
|
if (!isAuthenticated) {
|
|
1833
|
-
return /* @__PURE__ */
|
|
912
|
+
return /* @__PURE__ */ jsx(Navigate, { to: redirectTo, replace: true });
|
|
1834
913
|
}
|
|
1835
914
|
if (roles && roles.length > 0) {
|
|
1836
915
|
const hasRole = user?.roles?.some((role) => roles.includes(role));
|
|
1837
916
|
if (!hasRole) {
|
|
1838
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ jsx("div", { className: "auth-forbidden", children: /* @__PURE__ */ jsx("p", { children: "You do not have permission to access this page." }) });
|
|
1839
918
|
}
|
|
1840
919
|
}
|
|
1841
920
|
if (permissions && permissions.length > 0) {
|
|
@@ -1843,10 +922,10 @@ const ProtectedRoute = ({
|
|
|
1843
922
|
(permission) => permissions.includes(permission)
|
|
1844
923
|
);
|
|
1845
924
|
if (!hasPermission) {
|
|
1846
|
-
return /* @__PURE__ */
|
|
925
|
+
return /* @__PURE__ */ jsx("div", { className: "auth-forbidden", children: /* @__PURE__ */ jsx("p", { children: "You do not have permission to access this page." }) });
|
|
1847
926
|
}
|
|
1848
927
|
}
|
|
1849
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
1850
929
|
};
|
|
1851
930
|
ProtectedRoute.displayName = "ProtectedRoute";
|
|
1852
931
|
export {
|