@schematichq/schematic-react 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/schematic-react.cjs.js +24 -2816
- package/dist/schematic-react.d.ts +33 -0
- package/dist/schematic-react.esm.js +37 -2837
- package/package.json +4 -4
@@ -1,2804 +1,3 @@
|
|
1
|
-
var __create = Object.create;
|
2
|
-
var __defProp = Object.defineProperty;
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
9
|
-
};
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
-
for (let key of __getOwnPropNames(from))
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
-
}
|
16
|
-
return to;
|
17
|
-
};
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
24
|
-
mod
|
25
|
-
));
|
26
|
-
|
27
|
-
// node_modules/react/cjs/react.development.js
|
28
|
-
var require_react_development = __commonJS({
|
29
|
-
"node_modules/react/cjs/react.development.js"(exports, module) {
|
30
|
-
"use strict";
|
31
|
-
if (true) {
|
32
|
-
(function() {
|
33
|
-
"use strict";
|
34
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
35
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
36
|
-
}
|
37
|
-
var ReactVersion = "18.2.0";
|
38
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
39
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
40
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
41
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
42
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
43
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
44
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
45
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
46
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
47
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
48
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
49
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
50
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
51
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
52
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
53
|
-
function getIteratorFn(maybeIterable) {
|
54
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
55
|
-
return null;
|
56
|
-
}
|
57
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
58
|
-
if (typeof maybeIterator === "function") {
|
59
|
-
return maybeIterator;
|
60
|
-
}
|
61
|
-
return null;
|
62
|
-
}
|
63
|
-
var ReactCurrentDispatcher = {
|
64
|
-
/**
|
65
|
-
* @internal
|
66
|
-
* @type {ReactComponent}
|
67
|
-
*/
|
68
|
-
current: null
|
69
|
-
};
|
70
|
-
var ReactCurrentBatchConfig = {
|
71
|
-
transition: null
|
72
|
-
};
|
73
|
-
var ReactCurrentActQueue = {
|
74
|
-
current: null,
|
75
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
76
|
-
isBatchingLegacy: false,
|
77
|
-
didScheduleLegacyUpdate: false
|
78
|
-
};
|
79
|
-
var ReactCurrentOwner = {
|
80
|
-
/**
|
81
|
-
* @internal
|
82
|
-
* @type {ReactComponent}
|
83
|
-
*/
|
84
|
-
current: null
|
85
|
-
};
|
86
|
-
var ReactDebugCurrentFrame = {};
|
87
|
-
var currentExtraStackFrame = null;
|
88
|
-
function setExtraStackFrame(stack) {
|
89
|
-
{
|
90
|
-
currentExtraStackFrame = stack;
|
91
|
-
}
|
92
|
-
}
|
93
|
-
{
|
94
|
-
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
|
95
|
-
{
|
96
|
-
currentExtraStackFrame = stack;
|
97
|
-
}
|
98
|
-
};
|
99
|
-
ReactDebugCurrentFrame.getCurrentStack = null;
|
100
|
-
ReactDebugCurrentFrame.getStackAddendum = function() {
|
101
|
-
var stack = "";
|
102
|
-
if (currentExtraStackFrame) {
|
103
|
-
stack += currentExtraStackFrame;
|
104
|
-
}
|
105
|
-
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
106
|
-
if (impl) {
|
107
|
-
stack += impl() || "";
|
108
|
-
}
|
109
|
-
return stack;
|
110
|
-
};
|
111
|
-
}
|
112
|
-
var enableScopeAPI = false;
|
113
|
-
var enableCacheElement = false;
|
114
|
-
var enableTransitionTracing = false;
|
115
|
-
var enableLegacyHidden = false;
|
116
|
-
var enableDebugTracing = false;
|
117
|
-
var ReactSharedInternals = {
|
118
|
-
ReactCurrentDispatcher,
|
119
|
-
ReactCurrentBatchConfig,
|
120
|
-
ReactCurrentOwner
|
121
|
-
};
|
122
|
-
{
|
123
|
-
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
124
|
-
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
125
|
-
}
|
126
|
-
function warn(format) {
|
127
|
-
{
|
128
|
-
{
|
129
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
130
|
-
args[_key - 1] = arguments[_key];
|
131
|
-
}
|
132
|
-
printWarning("warn", format, args);
|
133
|
-
}
|
134
|
-
}
|
135
|
-
}
|
136
|
-
function error(format) {
|
137
|
-
{
|
138
|
-
{
|
139
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
140
|
-
args[_key2 - 1] = arguments[_key2];
|
141
|
-
}
|
142
|
-
printWarning("error", format, args);
|
143
|
-
}
|
144
|
-
}
|
145
|
-
}
|
146
|
-
function printWarning(level, format, args) {
|
147
|
-
{
|
148
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
149
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
150
|
-
if (stack !== "") {
|
151
|
-
format += "%s";
|
152
|
-
args = args.concat([stack]);
|
153
|
-
}
|
154
|
-
var argsWithFormat = args.map(function(item) {
|
155
|
-
return String(item);
|
156
|
-
});
|
157
|
-
argsWithFormat.unshift("Warning: " + format);
|
158
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
159
|
-
}
|
160
|
-
}
|
161
|
-
var didWarnStateUpdateForUnmountedComponent = {};
|
162
|
-
function warnNoop(publicInstance, callerName) {
|
163
|
-
{
|
164
|
-
var _constructor = publicInstance.constructor;
|
165
|
-
var componentName = _constructor && (_constructor.displayName || _constructor.name) || "ReactClass";
|
166
|
-
var warningKey = componentName + "." + callerName;
|
167
|
-
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
168
|
-
return;
|
169
|
-
}
|
170
|
-
error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", callerName, componentName);
|
171
|
-
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
172
|
-
}
|
173
|
-
}
|
174
|
-
var ReactNoopUpdateQueue = {
|
175
|
-
/**
|
176
|
-
* Checks whether or not this composite component is mounted.
|
177
|
-
* @param {ReactClass} publicInstance The instance we want to test.
|
178
|
-
* @return {boolean} True if mounted, false otherwise.
|
179
|
-
* @protected
|
180
|
-
* @final
|
181
|
-
*/
|
182
|
-
isMounted: function(publicInstance) {
|
183
|
-
return false;
|
184
|
-
},
|
185
|
-
/**
|
186
|
-
* Forces an update. This should only be invoked when it is known with
|
187
|
-
* certainty that we are **not** in a DOM transaction.
|
188
|
-
*
|
189
|
-
* You may want to call this when you know that some deeper aspect of the
|
190
|
-
* component's state has changed but `setState` was not called.
|
191
|
-
*
|
192
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
193
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
194
|
-
*
|
195
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
196
|
-
* @param {?function} callback Called after component is updated.
|
197
|
-
* @param {?string} callerName name of the calling function in the public API.
|
198
|
-
* @internal
|
199
|
-
*/
|
200
|
-
enqueueForceUpdate: function(publicInstance, callback, callerName) {
|
201
|
-
warnNoop(publicInstance, "forceUpdate");
|
202
|
-
},
|
203
|
-
/**
|
204
|
-
* Replaces all of the state. Always use this or `setState` to mutate state.
|
205
|
-
* You should treat `this.state` as immutable.
|
206
|
-
*
|
207
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
208
|
-
* accessing `this.state` after calling this method may return the old value.
|
209
|
-
*
|
210
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
211
|
-
* @param {object} completeState Next state.
|
212
|
-
* @param {?function} callback Called after component is updated.
|
213
|
-
* @param {?string} callerName name of the calling function in the public API.
|
214
|
-
* @internal
|
215
|
-
*/
|
216
|
-
enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
|
217
|
-
warnNoop(publicInstance, "replaceState");
|
218
|
-
},
|
219
|
-
/**
|
220
|
-
* Sets a subset of the state. This only exists because _pendingState is
|
221
|
-
* internal. This provides a merging strategy that is not available to deep
|
222
|
-
* properties which is confusing. TODO: Expose pendingState or don't use it
|
223
|
-
* during the merge.
|
224
|
-
*
|
225
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
226
|
-
* @param {object} partialState Next partial state to be merged with state.
|
227
|
-
* @param {?function} callback Called after component is updated.
|
228
|
-
* @param {?string} Name of the calling function in the public API.
|
229
|
-
* @internal
|
230
|
-
*/
|
231
|
-
enqueueSetState: function(publicInstance, partialState, callback, callerName) {
|
232
|
-
warnNoop(publicInstance, "setState");
|
233
|
-
}
|
234
|
-
};
|
235
|
-
var assign = Object.assign;
|
236
|
-
var emptyObject = {};
|
237
|
-
{
|
238
|
-
Object.freeze(emptyObject);
|
239
|
-
}
|
240
|
-
function Component(props, context, updater) {
|
241
|
-
this.props = props;
|
242
|
-
this.context = context;
|
243
|
-
this.refs = emptyObject;
|
244
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
245
|
-
}
|
246
|
-
Component.prototype.isReactComponent = {};
|
247
|
-
Component.prototype.setState = function(partialState, callback) {
|
248
|
-
if (typeof partialState !== "object" && typeof partialState !== "function" && partialState != null) {
|
249
|
-
throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
250
|
-
}
|
251
|
-
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
252
|
-
};
|
253
|
-
Component.prototype.forceUpdate = function(callback) {
|
254
|
-
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
255
|
-
};
|
256
|
-
{
|
257
|
-
var deprecatedAPIs = {
|
258
|
-
isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
|
259
|
-
replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
|
260
|
-
};
|
261
|
-
var defineDeprecationWarning = function(methodName, info) {
|
262
|
-
Object.defineProperty(Component.prototype, methodName, {
|
263
|
-
get: function() {
|
264
|
-
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
265
|
-
return void 0;
|
266
|
-
}
|
267
|
-
});
|
268
|
-
};
|
269
|
-
for (var fnName in deprecatedAPIs) {
|
270
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
271
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
272
|
-
}
|
273
|
-
}
|
274
|
-
}
|
275
|
-
function ComponentDummy() {
|
276
|
-
}
|
277
|
-
ComponentDummy.prototype = Component.prototype;
|
278
|
-
function PureComponent(props, context, updater) {
|
279
|
-
this.props = props;
|
280
|
-
this.context = context;
|
281
|
-
this.refs = emptyObject;
|
282
|
-
this.updater = updater || ReactNoopUpdateQueue;
|
283
|
-
}
|
284
|
-
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
285
|
-
pureComponentPrototype.constructor = PureComponent;
|
286
|
-
assign(pureComponentPrototype, Component.prototype);
|
287
|
-
pureComponentPrototype.isPureReactComponent = true;
|
288
|
-
function createRef() {
|
289
|
-
var refObject = {
|
290
|
-
current: null
|
291
|
-
};
|
292
|
-
{
|
293
|
-
Object.seal(refObject);
|
294
|
-
}
|
295
|
-
return refObject;
|
296
|
-
}
|
297
|
-
var isArrayImpl = Array.isArray;
|
298
|
-
function isArray(a) {
|
299
|
-
return isArrayImpl(a);
|
300
|
-
}
|
301
|
-
function typeName(value) {
|
302
|
-
{
|
303
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
304
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
305
|
-
return type;
|
306
|
-
}
|
307
|
-
}
|
308
|
-
function willCoercionThrow(value) {
|
309
|
-
{
|
310
|
-
try {
|
311
|
-
testStringCoercion(value);
|
312
|
-
return false;
|
313
|
-
} catch (e) {
|
314
|
-
return true;
|
315
|
-
}
|
316
|
-
}
|
317
|
-
}
|
318
|
-
function testStringCoercion(value) {
|
319
|
-
return "" + value;
|
320
|
-
}
|
321
|
-
function checkKeyStringCoercion(value) {
|
322
|
-
{
|
323
|
-
if (willCoercionThrow(value)) {
|
324
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
325
|
-
return testStringCoercion(value);
|
326
|
-
}
|
327
|
-
}
|
328
|
-
}
|
329
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
330
|
-
var displayName = outerType.displayName;
|
331
|
-
if (displayName) {
|
332
|
-
return displayName;
|
333
|
-
}
|
334
|
-
var functionName = innerType.displayName || innerType.name || "";
|
335
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
336
|
-
}
|
337
|
-
function getContextName(type) {
|
338
|
-
return type.displayName || "Context";
|
339
|
-
}
|
340
|
-
function getComponentNameFromType(type) {
|
341
|
-
if (type == null) {
|
342
|
-
return null;
|
343
|
-
}
|
344
|
-
{
|
345
|
-
if (typeof type.tag === "number") {
|
346
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
347
|
-
}
|
348
|
-
}
|
349
|
-
if (typeof type === "function") {
|
350
|
-
return type.displayName || type.name || null;
|
351
|
-
}
|
352
|
-
if (typeof type === "string") {
|
353
|
-
return type;
|
354
|
-
}
|
355
|
-
switch (type) {
|
356
|
-
case REACT_FRAGMENT_TYPE:
|
357
|
-
return "Fragment";
|
358
|
-
case REACT_PORTAL_TYPE:
|
359
|
-
return "Portal";
|
360
|
-
case REACT_PROFILER_TYPE:
|
361
|
-
return "Profiler";
|
362
|
-
case REACT_STRICT_MODE_TYPE:
|
363
|
-
return "StrictMode";
|
364
|
-
case REACT_SUSPENSE_TYPE:
|
365
|
-
return "Suspense";
|
366
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
367
|
-
return "SuspenseList";
|
368
|
-
}
|
369
|
-
if (typeof type === "object") {
|
370
|
-
switch (type.$$typeof) {
|
371
|
-
case REACT_CONTEXT_TYPE:
|
372
|
-
var context = type;
|
373
|
-
return getContextName(context) + ".Consumer";
|
374
|
-
case REACT_PROVIDER_TYPE:
|
375
|
-
var provider = type;
|
376
|
-
return getContextName(provider._context) + ".Provider";
|
377
|
-
case REACT_FORWARD_REF_TYPE:
|
378
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
379
|
-
case REACT_MEMO_TYPE:
|
380
|
-
var outerName = type.displayName || null;
|
381
|
-
if (outerName !== null) {
|
382
|
-
return outerName;
|
383
|
-
}
|
384
|
-
return getComponentNameFromType(type.type) || "Memo";
|
385
|
-
case REACT_LAZY_TYPE: {
|
386
|
-
var lazyComponent = type;
|
387
|
-
var payload = lazyComponent._payload;
|
388
|
-
var init = lazyComponent._init;
|
389
|
-
try {
|
390
|
-
return getComponentNameFromType(init(payload));
|
391
|
-
} catch (x) {
|
392
|
-
return null;
|
393
|
-
}
|
394
|
-
}
|
395
|
-
}
|
396
|
-
}
|
397
|
-
return null;
|
398
|
-
}
|
399
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
400
|
-
var RESERVED_PROPS = {
|
401
|
-
key: true,
|
402
|
-
ref: true,
|
403
|
-
__self: true,
|
404
|
-
__source: true
|
405
|
-
};
|
406
|
-
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
407
|
-
{
|
408
|
-
didWarnAboutStringRefs = {};
|
409
|
-
}
|
410
|
-
function hasValidRef(config) {
|
411
|
-
{
|
412
|
-
if (hasOwnProperty.call(config, "ref")) {
|
413
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
414
|
-
if (getter && getter.isReactWarning) {
|
415
|
-
return false;
|
416
|
-
}
|
417
|
-
}
|
418
|
-
}
|
419
|
-
return config.ref !== void 0;
|
420
|
-
}
|
421
|
-
function hasValidKey(config) {
|
422
|
-
{
|
423
|
-
if (hasOwnProperty.call(config, "key")) {
|
424
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
425
|
-
if (getter && getter.isReactWarning) {
|
426
|
-
return false;
|
427
|
-
}
|
428
|
-
}
|
429
|
-
}
|
430
|
-
return config.key !== void 0;
|
431
|
-
}
|
432
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
433
|
-
var warnAboutAccessingKey = function() {
|
434
|
-
{
|
435
|
-
if (!specialPropKeyWarningShown) {
|
436
|
-
specialPropKeyWarningShown = true;
|
437
|
-
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);
|
438
|
-
}
|
439
|
-
}
|
440
|
-
};
|
441
|
-
warnAboutAccessingKey.isReactWarning = true;
|
442
|
-
Object.defineProperty(props, "key", {
|
443
|
-
get: warnAboutAccessingKey,
|
444
|
-
configurable: true
|
445
|
-
});
|
446
|
-
}
|
447
|
-
function defineRefPropWarningGetter(props, displayName) {
|
448
|
-
var warnAboutAccessingRef = function() {
|
449
|
-
{
|
450
|
-
if (!specialPropRefWarningShown) {
|
451
|
-
specialPropRefWarningShown = true;
|
452
|
-
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);
|
453
|
-
}
|
454
|
-
}
|
455
|
-
};
|
456
|
-
warnAboutAccessingRef.isReactWarning = true;
|
457
|
-
Object.defineProperty(props, "ref", {
|
458
|
-
get: warnAboutAccessingRef,
|
459
|
-
configurable: true
|
460
|
-
});
|
461
|
-
}
|
462
|
-
function warnIfStringRefCannotBeAutoConverted(config) {
|
463
|
-
{
|
464
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
465
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
466
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
467
|
-
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', componentName, config.ref);
|
468
|
-
didWarnAboutStringRefs[componentName] = true;
|
469
|
-
}
|
470
|
-
}
|
471
|
-
}
|
472
|
-
}
|
473
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
474
|
-
var element = {
|
475
|
-
// This tag allows us to uniquely identify this as a React Element
|
476
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
477
|
-
// Built-in properties that belong on the element
|
478
|
-
type,
|
479
|
-
key,
|
480
|
-
ref,
|
481
|
-
props,
|
482
|
-
// Record the component responsible for creating this element.
|
483
|
-
_owner: owner
|
484
|
-
};
|
485
|
-
{
|
486
|
-
element._store = {};
|
487
|
-
Object.defineProperty(element._store, "validated", {
|
488
|
-
configurable: false,
|
489
|
-
enumerable: false,
|
490
|
-
writable: true,
|
491
|
-
value: false
|
492
|
-
});
|
493
|
-
Object.defineProperty(element, "_self", {
|
494
|
-
configurable: false,
|
495
|
-
enumerable: false,
|
496
|
-
writable: false,
|
497
|
-
value: self
|
498
|
-
});
|
499
|
-
Object.defineProperty(element, "_source", {
|
500
|
-
configurable: false,
|
501
|
-
enumerable: false,
|
502
|
-
writable: false,
|
503
|
-
value: source
|
504
|
-
});
|
505
|
-
if (Object.freeze) {
|
506
|
-
Object.freeze(element.props);
|
507
|
-
Object.freeze(element);
|
508
|
-
}
|
509
|
-
}
|
510
|
-
return element;
|
511
|
-
};
|
512
|
-
function createElement(type, config, children) {
|
513
|
-
var propName;
|
514
|
-
var props = {};
|
515
|
-
var key = null;
|
516
|
-
var ref = null;
|
517
|
-
var self = null;
|
518
|
-
var source = null;
|
519
|
-
if (config != null) {
|
520
|
-
if (hasValidRef(config)) {
|
521
|
-
ref = config.ref;
|
522
|
-
{
|
523
|
-
warnIfStringRefCannotBeAutoConverted(config);
|
524
|
-
}
|
525
|
-
}
|
526
|
-
if (hasValidKey(config)) {
|
527
|
-
{
|
528
|
-
checkKeyStringCoercion(config.key);
|
529
|
-
}
|
530
|
-
key = "" + config.key;
|
531
|
-
}
|
532
|
-
self = config.__self === void 0 ? null : config.__self;
|
533
|
-
source = config.__source === void 0 ? null : config.__source;
|
534
|
-
for (propName in config) {
|
535
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
536
|
-
props[propName] = config[propName];
|
537
|
-
}
|
538
|
-
}
|
539
|
-
}
|
540
|
-
var childrenLength = arguments.length - 2;
|
541
|
-
if (childrenLength === 1) {
|
542
|
-
props.children = children;
|
543
|
-
} else if (childrenLength > 1) {
|
544
|
-
var childArray = Array(childrenLength);
|
545
|
-
for (var i = 0; i < childrenLength; i++) {
|
546
|
-
childArray[i] = arguments[i + 2];
|
547
|
-
}
|
548
|
-
{
|
549
|
-
if (Object.freeze) {
|
550
|
-
Object.freeze(childArray);
|
551
|
-
}
|
552
|
-
}
|
553
|
-
props.children = childArray;
|
554
|
-
}
|
555
|
-
if (type && type.defaultProps) {
|
556
|
-
var defaultProps = type.defaultProps;
|
557
|
-
for (propName in defaultProps) {
|
558
|
-
if (props[propName] === void 0) {
|
559
|
-
props[propName] = defaultProps[propName];
|
560
|
-
}
|
561
|
-
}
|
562
|
-
}
|
563
|
-
{
|
564
|
-
if (key || ref) {
|
565
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
566
|
-
if (key) {
|
567
|
-
defineKeyPropWarningGetter(props, displayName);
|
568
|
-
}
|
569
|
-
if (ref) {
|
570
|
-
defineRefPropWarningGetter(props, displayName);
|
571
|
-
}
|
572
|
-
}
|
573
|
-
}
|
574
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
575
|
-
}
|
576
|
-
function cloneAndReplaceKey(oldElement, newKey) {
|
577
|
-
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
578
|
-
return newElement;
|
579
|
-
}
|
580
|
-
function cloneElement(element, config, children) {
|
581
|
-
if (element === null || element === void 0) {
|
582
|
-
throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
|
583
|
-
}
|
584
|
-
var propName;
|
585
|
-
var props = assign({}, element.props);
|
586
|
-
var key = element.key;
|
587
|
-
var ref = element.ref;
|
588
|
-
var self = element._self;
|
589
|
-
var source = element._source;
|
590
|
-
var owner = element._owner;
|
591
|
-
if (config != null) {
|
592
|
-
if (hasValidRef(config)) {
|
593
|
-
ref = config.ref;
|
594
|
-
owner = ReactCurrentOwner.current;
|
595
|
-
}
|
596
|
-
if (hasValidKey(config)) {
|
597
|
-
{
|
598
|
-
checkKeyStringCoercion(config.key);
|
599
|
-
}
|
600
|
-
key = "" + config.key;
|
601
|
-
}
|
602
|
-
var defaultProps;
|
603
|
-
if (element.type && element.type.defaultProps) {
|
604
|
-
defaultProps = element.type.defaultProps;
|
605
|
-
}
|
606
|
-
for (propName in config) {
|
607
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
608
|
-
if (config[propName] === void 0 && defaultProps !== void 0) {
|
609
|
-
props[propName] = defaultProps[propName];
|
610
|
-
} else {
|
611
|
-
props[propName] = config[propName];
|
612
|
-
}
|
613
|
-
}
|
614
|
-
}
|
615
|
-
}
|
616
|
-
var childrenLength = arguments.length - 2;
|
617
|
-
if (childrenLength === 1) {
|
618
|
-
props.children = children;
|
619
|
-
} else if (childrenLength > 1) {
|
620
|
-
var childArray = Array(childrenLength);
|
621
|
-
for (var i = 0; i < childrenLength; i++) {
|
622
|
-
childArray[i] = arguments[i + 2];
|
623
|
-
}
|
624
|
-
props.children = childArray;
|
625
|
-
}
|
626
|
-
return ReactElement(element.type, key, ref, self, source, owner, props);
|
627
|
-
}
|
628
|
-
function isValidElement(object) {
|
629
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
630
|
-
}
|
631
|
-
var SEPARATOR = ".";
|
632
|
-
var SUBSEPARATOR = ":";
|
633
|
-
function escape(key) {
|
634
|
-
var escapeRegex = /[=:]/g;
|
635
|
-
var escaperLookup = {
|
636
|
-
"=": "=0",
|
637
|
-
":": "=2"
|
638
|
-
};
|
639
|
-
var escapedString = key.replace(escapeRegex, function(match) {
|
640
|
-
return escaperLookup[match];
|
641
|
-
});
|
642
|
-
return "$" + escapedString;
|
643
|
-
}
|
644
|
-
var didWarnAboutMaps = false;
|
645
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
646
|
-
function escapeUserProvidedKey(text) {
|
647
|
-
return text.replace(userProvidedKeyEscapeRegex, "$&/");
|
648
|
-
}
|
649
|
-
function getElementKey(element, index) {
|
650
|
-
if (typeof element === "object" && element !== null && element.key != null) {
|
651
|
-
{
|
652
|
-
checkKeyStringCoercion(element.key);
|
653
|
-
}
|
654
|
-
return escape("" + element.key);
|
655
|
-
}
|
656
|
-
return index.toString(36);
|
657
|
-
}
|
658
|
-
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
659
|
-
var type = typeof children;
|
660
|
-
if (type === "undefined" || type === "boolean") {
|
661
|
-
children = null;
|
662
|
-
}
|
663
|
-
var invokeCallback = false;
|
664
|
-
if (children === null) {
|
665
|
-
invokeCallback = true;
|
666
|
-
} else {
|
667
|
-
switch (type) {
|
668
|
-
case "string":
|
669
|
-
case "number":
|
670
|
-
invokeCallback = true;
|
671
|
-
break;
|
672
|
-
case "object":
|
673
|
-
switch (children.$$typeof) {
|
674
|
-
case REACT_ELEMENT_TYPE:
|
675
|
-
case REACT_PORTAL_TYPE:
|
676
|
-
invokeCallback = true;
|
677
|
-
}
|
678
|
-
}
|
679
|
-
}
|
680
|
-
if (invokeCallback) {
|
681
|
-
var _child = children;
|
682
|
-
var mappedChild = callback(_child);
|
683
|
-
var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
684
|
-
if (isArray(mappedChild)) {
|
685
|
-
var escapedChildKey = "";
|
686
|
-
if (childKey != null) {
|
687
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
|
688
|
-
}
|
689
|
-
mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
|
690
|
-
return c;
|
691
|
-
});
|
692
|
-
} else if (mappedChild != null) {
|
693
|
-
if (isValidElement(mappedChild)) {
|
694
|
-
{
|
695
|
-
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
696
|
-
checkKeyStringCoercion(mappedChild.key);
|
697
|
-
}
|
698
|
-
}
|
699
|
-
mappedChild = cloneAndReplaceKey(
|
700
|
-
mappedChild,
|
701
|
-
// Keep both the (mapped) and old keys if they differ, just as
|
702
|
-
// traverseAllChildren used to do for objects as children
|
703
|
-
escapedPrefix + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
704
|
-
(mappedChild.key && (!_child || _child.key !== mappedChild.key) ? (
|
705
|
-
// $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
706
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
707
|
-
escapeUserProvidedKey("" + mappedChild.key) + "/"
|
708
|
-
) : "") + childKey
|
709
|
-
);
|
710
|
-
}
|
711
|
-
array.push(mappedChild);
|
712
|
-
}
|
713
|
-
return 1;
|
714
|
-
}
|
715
|
-
var child;
|
716
|
-
var nextName;
|
717
|
-
var subtreeCount = 0;
|
718
|
-
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
719
|
-
if (isArray(children)) {
|
720
|
-
for (var i = 0; i < children.length; i++) {
|
721
|
-
child = children[i];
|
722
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
723
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
724
|
-
}
|
725
|
-
} else {
|
726
|
-
var iteratorFn = getIteratorFn(children);
|
727
|
-
if (typeof iteratorFn === "function") {
|
728
|
-
var iterableChildren = children;
|
729
|
-
{
|
730
|
-
if (iteratorFn === iterableChildren.entries) {
|
731
|
-
if (!didWarnAboutMaps) {
|
732
|
-
warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead.");
|
733
|
-
}
|
734
|
-
didWarnAboutMaps = true;
|
735
|
-
}
|
736
|
-
}
|
737
|
-
var iterator = iteratorFn.call(iterableChildren);
|
738
|
-
var step;
|
739
|
-
var ii = 0;
|
740
|
-
while (!(step = iterator.next()).done) {
|
741
|
-
child = step.value;
|
742
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
743
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
744
|
-
}
|
745
|
-
} else if (type === "object") {
|
746
|
-
var childrenString = String(children);
|
747
|
-
throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). If you meant to render a collection of children, use an array instead.");
|
748
|
-
}
|
749
|
-
}
|
750
|
-
return subtreeCount;
|
751
|
-
}
|
752
|
-
function mapChildren(children, func, context) {
|
753
|
-
if (children == null) {
|
754
|
-
return children;
|
755
|
-
}
|
756
|
-
var result = [];
|
757
|
-
var count = 0;
|
758
|
-
mapIntoArray(children, result, "", "", function(child) {
|
759
|
-
return func.call(context, child, count++);
|
760
|
-
});
|
761
|
-
return result;
|
762
|
-
}
|
763
|
-
function countChildren(children) {
|
764
|
-
var n = 0;
|
765
|
-
mapChildren(children, function() {
|
766
|
-
n++;
|
767
|
-
});
|
768
|
-
return n;
|
769
|
-
}
|
770
|
-
function forEachChildren(children, forEachFunc, forEachContext) {
|
771
|
-
mapChildren(children, function() {
|
772
|
-
forEachFunc.apply(this, arguments);
|
773
|
-
}, forEachContext);
|
774
|
-
}
|
775
|
-
function toArray(children) {
|
776
|
-
return mapChildren(children, function(child) {
|
777
|
-
return child;
|
778
|
-
}) || [];
|
779
|
-
}
|
780
|
-
function onlyChild(children) {
|
781
|
-
if (!isValidElement(children)) {
|
782
|
-
throw new Error("React.Children.only expected to receive a single React element child.");
|
783
|
-
}
|
784
|
-
return children;
|
785
|
-
}
|
786
|
-
function createContext2(defaultValue) {
|
787
|
-
var context = {
|
788
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
789
|
-
// As a workaround to support multiple concurrent renderers, we categorize
|
790
|
-
// some renderers as primary and others as secondary. We only expect
|
791
|
-
// there to be two concurrent renderers at most: React Native (primary) and
|
792
|
-
// Fabric (secondary); React DOM (primary) and React ART (secondary).
|
793
|
-
// Secondary renderers store their context values on separate fields.
|
794
|
-
_currentValue: defaultValue,
|
795
|
-
_currentValue2: defaultValue,
|
796
|
-
// Used to track how many concurrent renderers this context currently
|
797
|
-
// supports within in a single renderer. Such as parallel server rendering.
|
798
|
-
_threadCount: 0,
|
799
|
-
// These are circular
|
800
|
-
Provider: null,
|
801
|
-
Consumer: null,
|
802
|
-
// Add these to use same hidden class in VM as ServerContext
|
803
|
-
_defaultValue: null,
|
804
|
-
_globalName: null
|
805
|
-
};
|
806
|
-
context.Provider = {
|
807
|
-
$$typeof: REACT_PROVIDER_TYPE,
|
808
|
-
_context: context
|
809
|
-
};
|
810
|
-
var hasWarnedAboutUsingNestedContextConsumers = false;
|
811
|
-
var hasWarnedAboutUsingConsumerProvider = false;
|
812
|
-
var hasWarnedAboutDisplayNameOnConsumer = false;
|
813
|
-
{
|
814
|
-
var Consumer = {
|
815
|
-
$$typeof: REACT_CONTEXT_TYPE,
|
816
|
-
_context: context
|
817
|
-
};
|
818
|
-
Object.defineProperties(Consumer, {
|
819
|
-
Provider: {
|
820
|
-
get: function() {
|
821
|
-
if (!hasWarnedAboutUsingConsumerProvider) {
|
822
|
-
hasWarnedAboutUsingConsumerProvider = true;
|
823
|
-
error("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?");
|
824
|
-
}
|
825
|
-
return context.Provider;
|
826
|
-
},
|
827
|
-
set: function(_Provider) {
|
828
|
-
context.Provider = _Provider;
|
829
|
-
}
|
830
|
-
},
|
831
|
-
_currentValue: {
|
832
|
-
get: function() {
|
833
|
-
return context._currentValue;
|
834
|
-
},
|
835
|
-
set: function(_currentValue) {
|
836
|
-
context._currentValue = _currentValue;
|
837
|
-
}
|
838
|
-
},
|
839
|
-
_currentValue2: {
|
840
|
-
get: function() {
|
841
|
-
return context._currentValue2;
|
842
|
-
},
|
843
|
-
set: function(_currentValue2) {
|
844
|
-
context._currentValue2 = _currentValue2;
|
845
|
-
}
|
846
|
-
},
|
847
|
-
_threadCount: {
|
848
|
-
get: function() {
|
849
|
-
return context._threadCount;
|
850
|
-
},
|
851
|
-
set: function(_threadCount) {
|
852
|
-
context._threadCount = _threadCount;
|
853
|
-
}
|
854
|
-
},
|
855
|
-
Consumer: {
|
856
|
-
get: function() {
|
857
|
-
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
858
|
-
hasWarnedAboutUsingNestedContextConsumers = true;
|
859
|
-
error("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?");
|
860
|
-
}
|
861
|
-
return context.Consumer;
|
862
|
-
}
|
863
|
-
},
|
864
|
-
displayName: {
|
865
|
-
get: function() {
|
866
|
-
return context.displayName;
|
867
|
-
},
|
868
|
-
set: function(displayName) {
|
869
|
-
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
870
|
-
warn("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
871
|
-
hasWarnedAboutDisplayNameOnConsumer = true;
|
872
|
-
}
|
873
|
-
}
|
874
|
-
}
|
875
|
-
});
|
876
|
-
context.Consumer = Consumer;
|
877
|
-
}
|
878
|
-
{
|
879
|
-
context._currentRenderer = null;
|
880
|
-
context._currentRenderer2 = null;
|
881
|
-
}
|
882
|
-
return context;
|
883
|
-
}
|
884
|
-
var Uninitialized = -1;
|
885
|
-
var Pending = 0;
|
886
|
-
var Resolved = 1;
|
887
|
-
var Rejected = 2;
|
888
|
-
function lazyInitializer(payload) {
|
889
|
-
if (payload._status === Uninitialized) {
|
890
|
-
var ctor = payload._result;
|
891
|
-
var thenable = ctor();
|
892
|
-
thenable.then(function(moduleObject2) {
|
893
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
894
|
-
var resolved = payload;
|
895
|
-
resolved._status = Resolved;
|
896
|
-
resolved._result = moduleObject2;
|
897
|
-
}
|
898
|
-
}, function(error2) {
|
899
|
-
if (payload._status === Pending || payload._status === Uninitialized) {
|
900
|
-
var rejected = payload;
|
901
|
-
rejected._status = Rejected;
|
902
|
-
rejected._result = error2;
|
903
|
-
}
|
904
|
-
});
|
905
|
-
if (payload._status === Uninitialized) {
|
906
|
-
var pending = payload;
|
907
|
-
pending._status = Pending;
|
908
|
-
pending._result = thenable;
|
909
|
-
}
|
910
|
-
}
|
911
|
-
if (payload._status === Resolved) {
|
912
|
-
var moduleObject = payload._result;
|
913
|
-
{
|
914
|
-
if (moduleObject === void 0) {
|
915
|
-
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?", moduleObject);
|
916
|
-
}
|
917
|
-
}
|
918
|
-
{
|
919
|
-
if (!("default" in moduleObject)) {
|
920
|
-
error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
|
921
|
-
}
|
922
|
-
}
|
923
|
-
return moduleObject.default;
|
924
|
-
} else {
|
925
|
-
throw payload._result;
|
926
|
-
}
|
927
|
-
}
|
928
|
-
function lazy(ctor) {
|
929
|
-
var payload = {
|
930
|
-
// We use these fields to store the result.
|
931
|
-
_status: Uninitialized,
|
932
|
-
_result: ctor
|
933
|
-
};
|
934
|
-
var lazyType = {
|
935
|
-
$$typeof: REACT_LAZY_TYPE,
|
936
|
-
_payload: payload,
|
937
|
-
_init: lazyInitializer
|
938
|
-
};
|
939
|
-
{
|
940
|
-
var defaultProps;
|
941
|
-
var propTypes;
|
942
|
-
Object.defineProperties(lazyType, {
|
943
|
-
defaultProps: {
|
944
|
-
configurable: true,
|
945
|
-
get: function() {
|
946
|
-
return defaultProps;
|
947
|
-
},
|
948
|
-
set: function(newDefaultProps) {
|
949
|
-
error("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
950
|
-
defaultProps = newDefaultProps;
|
951
|
-
Object.defineProperty(lazyType, "defaultProps", {
|
952
|
-
enumerable: true
|
953
|
-
});
|
954
|
-
}
|
955
|
-
},
|
956
|
-
propTypes: {
|
957
|
-
configurable: true,
|
958
|
-
get: function() {
|
959
|
-
return propTypes;
|
960
|
-
},
|
961
|
-
set: function(newPropTypes) {
|
962
|
-
error("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it.");
|
963
|
-
propTypes = newPropTypes;
|
964
|
-
Object.defineProperty(lazyType, "propTypes", {
|
965
|
-
enumerable: true
|
966
|
-
});
|
967
|
-
}
|
968
|
-
}
|
969
|
-
});
|
970
|
-
}
|
971
|
-
return lazyType;
|
972
|
-
}
|
973
|
-
function forwardRef(render) {
|
974
|
-
{
|
975
|
-
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
976
|
-
error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).");
|
977
|
-
} else if (typeof render !== "function") {
|
978
|
-
error("forwardRef requires a render function but was given %s.", render === null ? "null" : typeof render);
|
979
|
-
} else {
|
980
|
-
if (render.length !== 0 && render.length !== 2) {
|
981
|
-
error("forwardRef render functions accept exactly two parameters: props and ref. %s", render.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined.");
|
982
|
-
}
|
983
|
-
}
|
984
|
-
if (render != null) {
|
985
|
-
if (render.defaultProps != null || render.propTypes != null) {
|
986
|
-
error("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
|
987
|
-
}
|
988
|
-
}
|
989
|
-
}
|
990
|
-
var elementType = {
|
991
|
-
$$typeof: REACT_FORWARD_REF_TYPE,
|
992
|
-
render
|
993
|
-
};
|
994
|
-
{
|
995
|
-
var ownName;
|
996
|
-
Object.defineProperty(elementType, "displayName", {
|
997
|
-
enumerable: false,
|
998
|
-
configurable: true,
|
999
|
-
get: function() {
|
1000
|
-
return ownName;
|
1001
|
-
},
|
1002
|
-
set: function(name) {
|
1003
|
-
ownName = name;
|
1004
|
-
if (!render.name && !render.displayName) {
|
1005
|
-
render.displayName = name;
|
1006
|
-
}
|
1007
|
-
}
|
1008
|
-
});
|
1009
|
-
}
|
1010
|
-
return elementType;
|
1011
|
-
}
|
1012
|
-
var REACT_MODULE_REFERENCE;
|
1013
|
-
{
|
1014
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
1015
|
-
}
|
1016
|
-
function isValidElementType(type) {
|
1017
|
-
if (typeof type === "string" || typeof type === "function") {
|
1018
|
-
return true;
|
1019
|
-
}
|
1020
|
-
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) {
|
1021
|
-
return true;
|
1022
|
-
}
|
1023
|
-
if (typeof type === "object" && type !== null) {
|
1024
|
-
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
|
1025
|
-
// types supported by any Flight configuration anywhere since
|
1026
|
-
// we don't know which Flight build this will end up being used
|
1027
|
-
// with.
|
1028
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
1029
|
-
return true;
|
1030
|
-
}
|
1031
|
-
}
|
1032
|
-
return false;
|
1033
|
-
}
|
1034
|
-
function memo(type, compare) {
|
1035
|
-
{
|
1036
|
-
if (!isValidElementType(type)) {
|
1037
|
-
error("memo: The first argument must be a component. Instead received: %s", type === null ? "null" : typeof type);
|
1038
|
-
}
|
1039
|
-
}
|
1040
|
-
var elementType = {
|
1041
|
-
$$typeof: REACT_MEMO_TYPE,
|
1042
|
-
type,
|
1043
|
-
compare: compare === void 0 ? null : compare
|
1044
|
-
};
|
1045
|
-
{
|
1046
|
-
var ownName;
|
1047
|
-
Object.defineProperty(elementType, "displayName", {
|
1048
|
-
enumerable: false,
|
1049
|
-
configurable: true,
|
1050
|
-
get: function() {
|
1051
|
-
return ownName;
|
1052
|
-
},
|
1053
|
-
set: function(name) {
|
1054
|
-
ownName = name;
|
1055
|
-
if (!type.name && !type.displayName) {
|
1056
|
-
type.displayName = name;
|
1057
|
-
}
|
1058
|
-
}
|
1059
|
-
});
|
1060
|
-
}
|
1061
|
-
return elementType;
|
1062
|
-
}
|
1063
|
-
function resolveDispatcher() {
|
1064
|
-
var dispatcher = ReactCurrentDispatcher.current;
|
1065
|
-
{
|
1066
|
-
if (dispatcher === null) {
|
1067
|
-
error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");
|
1068
|
-
}
|
1069
|
-
}
|
1070
|
-
return dispatcher;
|
1071
|
-
}
|
1072
|
-
function useContext2(Context) {
|
1073
|
-
var dispatcher = resolveDispatcher();
|
1074
|
-
{
|
1075
|
-
if (Context._context !== void 0) {
|
1076
|
-
var realContext = Context._context;
|
1077
|
-
if (realContext.Consumer === Context) {
|
1078
|
-
error("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?");
|
1079
|
-
} else if (realContext.Provider === Context) {
|
1080
|
-
error("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
|
1081
|
-
}
|
1082
|
-
}
|
1083
|
-
}
|
1084
|
-
return dispatcher.useContext(Context);
|
1085
|
-
}
|
1086
|
-
function useState2(initialState) {
|
1087
|
-
var dispatcher = resolveDispatcher();
|
1088
|
-
return dispatcher.useState(initialState);
|
1089
|
-
}
|
1090
|
-
function useReducer(reducer, initialArg, init) {
|
1091
|
-
var dispatcher = resolveDispatcher();
|
1092
|
-
return dispatcher.useReducer(reducer, initialArg, init);
|
1093
|
-
}
|
1094
|
-
function useRef(initialValue) {
|
1095
|
-
var dispatcher = resolveDispatcher();
|
1096
|
-
return dispatcher.useRef(initialValue);
|
1097
|
-
}
|
1098
|
-
function useEffect2(create, deps) {
|
1099
|
-
var dispatcher = resolveDispatcher();
|
1100
|
-
return dispatcher.useEffect(create, deps);
|
1101
|
-
}
|
1102
|
-
function useInsertionEffect(create, deps) {
|
1103
|
-
var dispatcher = resolveDispatcher();
|
1104
|
-
return dispatcher.useInsertionEffect(create, deps);
|
1105
|
-
}
|
1106
|
-
function useLayoutEffect(create, deps) {
|
1107
|
-
var dispatcher = resolveDispatcher();
|
1108
|
-
return dispatcher.useLayoutEffect(create, deps);
|
1109
|
-
}
|
1110
|
-
function useCallback(callback, deps) {
|
1111
|
-
var dispatcher = resolveDispatcher();
|
1112
|
-
return dispatcher.useCallback(callback, deps);
|
1113
|
-
}
|
1114
|
-
function useMemo(create, deps) {
|
1115
|
-
var dispatcher = resolveDispatcher();
|
1116
|
-
return dispatcher.useMemo(create, deps);
|
1117
|
-
}
|
1118
|
-
function useImperativeHandle(ref, create, deps) {
|
1119
|
-
var dispatcher = resolveDispatcher();
|
1120
|
-
return dispatcher.useImperativeHandle(ref, create, deps);
|
1121
|
-
}
|
1122
|
-
function useDebugValue(value, formatterFn) {
|
1123
|
-
{
|
1124
|
-
var dispatcher = resolveDispatcher();
|
1125
|
-
return dispatcher.useDebugValue(value, formatterFn);
|
1126
|
-
}
|
1127
|
-
}
|
1128
|
-
function useTransition() {
|
1129
|
-
var dispatcher = resolveDispatcher();
|
1130
|
-
return dispatcher.useTransition();
|
1131
|
-
}
|
1132
|
-
function useDeferredValue(value) {
|
1133
|
-
var dispatcher = resolveDispatcher();
|
1134
|
-
return dispatcher.useDeferredValue(value);
|
1135
|
-
}
|
1136
|
-
function useId() {
|
1137
|
-
var dispatcher = resolveDispatcher();
|
1138
|
-
return dispatcher.useId();
|
1139
|
-
}
|
1140
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
1141
|
-
var dispatcher = resolveDispatcher();
|
1142
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
1143
|
-
}
|
1144
|
-
var disabledDepth = 0;
|
1145
|
-
var prevLog;
|
1146
|
-
var prevInfo;
|
1147
|
-
var prevWarn;
|
1148
|
-
var prevError;
|
1149
|
-
var prevGroup;
|
1150
|
-
var prevGroupCollapsed;
|
1151
|
-
var prevGroupEnd;
|
1152
|
-
function disabledLog() {
|
1153
|
-
}
|
1154
|
-
disabledLog.__reactDisabledLog = true;
|
1155
|
-
function disableLogs() {
|
1156
|
-
{
|
1157
|
-
if (disabledDepth === 0) {
|
1158
|
-
prevLog = console.log;
|
1159
|
-
prevInfo = console.info;
|
1160
|
-
prevWarn = console.warn;
|
1161
|
-
prevError = console.error;
|
1162
|
-
prevGroup = console.group;
|
1163
|
-
prevGroupCollapsed = console.groupCollapsed;
|
1164
|
-
prevGroupEnd = console.groupEnd;
|
1165
|
-
var props = {
|
1166
|
-
configurable: true,
|
1167
|
-
enumerable: true,
|
1168
|
-
value: disabledLog,
|
1169
|
-
writable: true
|
1170
|
-
};
|
1171
|
-
Object.defineProperties(console, {
|
1172
|
-
info: props,
|
1173
|
-
log: props,
|
1174
|
-
warn: props,
|
1175
|
-
error: props,
|
1176
|
-
group: props,
|
1177
|
-
groupCollapsed: props,
|
1178
|
-
groupEnd: props
|
1179
|
-
});
|
1180
|
-
}
|
1181
|
-
disabledDepth++;
|
1182
|
-
}
|
1183
|
-
}
|
1184
|
-
function reenableLogs() {
|
1185
|
-
{
|
1186
|
-
disabledDepth--;
|
1187
|
-
if (disabledDepth === 0) {
|
1188
|
-
var props = {
|
1189
|
-
configurable: true,
|
1190
|
-
enumerable: true,
|
1191
|
-
writable: true
|
1192
|
-
};
|
1193
|
-
Object.defineProperties(console, {
|
1194
|
-
log: assign({}, props, {
|
1195
|
-
value: prevLog
|
1196
|
-
}),
|
1197
|
-
info: assign({}, props, {
|
1198
|
-
value: prevInfo
|
1199
|
-
}),
|
1200
|
-
warn: assign({}, props, {
|
1201
|
-
value: prevWarn
|
1202
|
-
}),
|
1203
|
-
error: assign({}, props, {
|
1204
|
-
value: prevError
|
1205
|
-
}),
|
1206
|
-
group: assign({}, props, {
|
1207
|
-
value: prevGroup
|
1208
|
-
}),
|
1209
|
-
groupCollapsed: assign({}, props, {
|
1210
|
-
value: prevGroupCollapsed
|
1211
|
-
}),
|
1212
|
-
groupEnd: assign({}, props, {
|
1213
|
-
value: prevGroupEnd
|
1214
|
-
})
|
1215
|
-
});
|
1216
|
-
}
|
1217
|
-
if (disabledDepth < 0) {
|
1218
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
1219
|
-
}
|
1220
|
-
}
|
1221
|
-
}
|
1222
|
-
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
1223
|
-
var prefix;
|
1224
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
1225
|
-
{
|
1226
|
-
if (prefix === void 0) {
|
1227
|
-
try {
|
1228
|
-
throw Error();
|
1229
|
-
} catch (x) {
|
1230
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
1231
|
-
prefix = match && match[1] || "";
|
1232
|
-
}
|
1233
|
-
}
|
1234
|
-
return "\n" + prefix + name;
|
1235
|
-
}
|
1236
|
-
}
|
1237
|
-
var reentry = false;
|
1238
|
-
var componentFrameCache;
|
1239
|
-
{
|
1240
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
1241
|
-
componentFrameCache = new PossiblyWeakMap();
|
1242
|
-
}
|
1243
|
-
function describeNativeComponentFrame(fn, construct) {
|
1244
|
-
if (!fn || reentry) {
|
1245
|
-
return "";
|
1246
|
-
}
|
1247
|
-
{
|
1248
|
-
var frame = componentFrameCache.get(fn);
|
1249
|
-
if (frame !== void 0) {
|
1250
|
-
return frame;
|
1251
|
-
}
|
1252
|
-
}
|
1253
|
-
var control;
|
1254
|
-
reentry = true;
|
1255
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
1256
|
-
Error.prepareStackTrace = void 0;
|
1257
|
-
var previousDispatcher;
|
1258
|
-
{
|
1259
|
-
previousDispatcher = ReactCurrentDispatcher$1.current;
|
1260
|
-
ReactCurrentDispatcher$1.current = null;
|
1261
|
-
disableLogs();
|
1262
|
-
}
|
1263
|
-
try {
|
1264
|
-
if (construct) {
|
1265
|
-
var Fake = function() {
|
1266
|
-
throw Error();
|
1267
|
-
};
|
1268
|
-
Object.defineProperty(Fake.prototype, "props", {
|
1269
|
-
set: function() {
|
1270
|
-
throw Error();
|
1271
|
-
}
|
1272
|
-
});
|
1273
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
1274
|
-
try {
|
1275
|
-
Reflect.construct(Fake, []);
|
1276
|
-
} catch (x) {
|
1277
|
-
control = x;
|
1278
|
-
}
|
1279
|
-
Reflect.construct(fn, [], Fake);
|
1280
|
-
} else {
|
1281
|
-
try {
|
1282
|
-
Fake.call();
|
1283
|
-
} catch (x) {
|
1284
|
-
control = x;
|
1285
|
-
}
|
1286
|
-
fn.call(Fake.prototype);
|
1287
|
-
}
|
1288
|
-
} else {
|
1289
|
-
try {
|
1290
|
-
throw Error();
|
1291
|
-
} catch (x) {
|
1292
|
-
control = x;
|
1293
|
-
}
|
1294
|
-
fn();
|
1295
|
-
}
|
1296
|
-
} catch (sample) {
|
1297
|
-
if (sample && control && typeof sample.stack === "string") {
|
1298
|
-
var sampleLines = sample.stack.split("\n");
|
1299
|
-
var controlLines = control.stack.split("\n");
|
1300
|
-
var s = sampleLines.length - 1;
|
1301
|
-
var c = controlLines.length - 1;
|
1302
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
1303
|
-
c--;
|
1304
|
-
}
|
1305
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
1306
|
-
if (sampleLines[s] !== controlLines[c]) {
|
1307
|
-
if (s !== 1 || c !== 1) {
|
1308
|
-
do {
|
1309
|
-
s--;
|
1310
|
-
c--;
|
1311
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
1312
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
1313
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
1314
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
1315
|
-
}
|
1316
|
-
{
|
1317
|
-
if (typeof fn === "function") {
|
1318
|
-
componentFrameCache.set(fn, _frame);
|
1319
|
-
}
|
1320
|
-
}
|
1321
|
-
return _frame;
|
1322
|
-
}
|
1323
|
-
} while (s >= 1 && c >= 0);
|
1324
|
-
}
|
1325
|
-
break;
|
1326
|
-
}
|
1327
|
-
}
|
1328
|
-
}
|
1329
|
-
} finally {
|
1330
|
-
reentry = false;
|
1331
|
-
{
|
1332
|
-
ReactCurrentDispatcher$1.current = previousDispatcher;
|
1333
|
-
reenableLogs();
|
1334
|
-
}
|
1335
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
1336
|
-
}
|
1337
|
-
var name = fn ? fn.displayName || fn.name : "";
|
1338
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
1339
|
-
{
|
1340
|
-
if (typeof fn === "function") {
|
1341
|
-
componentFrameCache.set(fn, syntheticFrame);
|
1342
|
-
}
|
1343
|
-
}
|
1344
|
-
return syntheticFrame;
|
1345
|
-
}
|
1346
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
1347
|
-
{
|
1348
|
-
return describeNativeComponentFrame(fn, false);
|
1349
|
-
}
|
1350
|
-
}
|
1351
|
-
function shouldConstruct(Component2) {
|
1352
|
-
var prototype = Component2.prototype;
|
1353
|
-
return !!(prototype && prototype.isReactComponent);
|
1354
|
-
}
|
1355
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
1356
|
-
if (type == null) {
|
1357
|
-
return "";
|
1358
|
-
}
|
1359
|
-
if (typeof type === "function") {
|
1360
|
-
{
|
1361
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
1362
|
-
}
|
1363
|
-
}
|
1364
|
-
if (typeof type === "string") {
|
1365
|
-
return describeBuiltInComponentFrame(type);
|
1366
|
-
}
|
1367
|
-
switch (type) {
|
1368
|
-
case REACT_SUSPENSE_TYPE:
|
1369
|
-
return describeBuiltInComponentFrame("Suspense");
|
1370
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
1371
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
1372
|
-
}
|
1373
|
-
if (typeof type === "object") {
|
1374
|
-
switch (type.$$typeof) {
|
1375
|
-
case REACT_FORWARD_REF_TYPE:
|
1376
|
-
return describeFunctionComponentFrame(type.render);
|
1377
|
-
case REACT_MEMO_TYPE:
|
1378
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
1379
|
-
case REACT_LAZY_TYPE: {
|
1380
|
-
var lazyComponent = type;
|
1381
|
-
var payload = lazyComponent._payload;
|
1382
|
-
var init = lazyComponent._init;
|
1383
|
-
try {
|
1384
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
1385
|
-
} catch (x) {
|
1386
|
-
}
|
1387
|
-
}
|
1388
|
-
}
|
1389
|
-
}
|
1390
|
-
return "";
|
1391
|
-
}
|
1392
|
-
var loggedTypeFailures = {};
|
1393
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
1394
|
-
function setCurrentlyValidatingElement(element) {
|
1395
|
-
{
|
1396
|
-
if (element) {
|
1397
|
-
var owner = element._owner;
|
1398
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
1399
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
1400
|
-
} else {
|
1401
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
1402
|
-
}
|
1403
|
-
}
|
1404
|
-
}
|
1405
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
1406
|
-
{
|
1407
|
-
var has = Function.call.bind(hasOwnProperty);
|
1408
|
-
for (var typeSpecName in typeSpecs) {
|
1409
|
-
if (has(typeSpecs, typeSpecName)) {
|
1410
|
-
var error$1 = void 0;
|
1411
|
-
try {
|
1412
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
1413
|
-
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`.");
|
1414
|
-
err.name = "Invariant Violation";
|
1415
|
-
throw err;
|
1416
|
-
}
|
1417
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1418
|
-
} catch (ex) {
|
1419
|
-
error$1 = ex;
|
1420
|
-
}
|
1421
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
1422
|
-
setCurrentlyValidatingElement(element);
|
1423
|
-
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);
|
1424
|
-
setCurrentlyValidatingElement(null);
|
1425
|
-
}
|
1426
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
1427
|
-
loggedTypeFailures[error$1.message] = true;
|
1428
|
-
setCurrentlyValidatingElement(element);
|
1429
|
-
error("Failed %s type: %s", location, error$1.message);
|
1430
|
-
setCurrentlyValidatingElement(null);
|
1431
|
-
}
|
1432
|
-
}
|
1433
|
-
}
|
1434
|
-
}
|
1435
|
-
}
|
1436
|
-
function setCurrentlyValidatingElement$1(element) {
|
1437
|
-
{
|
1438
|
-
if (element) {
|
1439
|
-
var owner = element._owner;
|
1440
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
1441
|
-
setExtraStackFrame(stack);
|
1442
|
-
} else {
|
1443
|
-
setExtraStackFrame(null);
|
1444
|
-
}
|
1445
|
-
}
|
1446
|
-
}
|
1447
|
-
var propTypesMisspellWarningShown;
|
1448
|
-
{
|
1449
|
-
propTypesMisspellWarningShown = false;
|
1450
|
-
}
|
1451
|
-
function getDeclarationErrorAddendum() {
|
1452
|
-
if (ReactCurrentOwner.current) {
|
1453
|
-
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
1454
|
-
if (name) {
|
1455
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
1456
|
-
}
|
1457
|
-
}
|
1458
|
-
return "";
|
1459
|
-
}
|
1460
|
-
function getSourceInfoErrorAddendum(source) {
|
1461
|
-
if (source !== void 0) {
|
1462
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
1463
|
-
var lineNumber = source.lineNumber;
|
1464
|
-
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
1465
|
-
}
|
1466
|
-
return "";
|
1467
|
-
}
|
1468
|
-
function getSourceInfoErrorAddendumForProps(elementProps) {
|
1469
|
-
if (elementProps !== null && elementProps !== void 0) {
|
1470
|
-
return getSourceInfoErrorAddendum(elementProps.__source);
|
1471
|
-
}
|
1472
|
-
return "";
|
1473
|
-
}
|
1474
|
-
var ownerHasKeyUseWarning = {};
|
1475
|
-
function getCurrentComponentErrorInfo(parentType) {
|
1476
|
-
var info = getDeclarationErrorAddendum();
|
1477
|
-
if (!info) {
|
1478
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
1479
|
-
if (parentName) {
|
1480
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
1481
|
-
}
|
1482
|
-
}
|
1483
|
-
return info;
|
1484
|
-
}
|
1485
|
-
function validateExplicitKey(element, parentType) {
|
1486
|
-
if (!element._store || element._store.validated || element.key != null) {
|
1487
|
-
return;
|
1488
|
-
}
|
1489
|
-
element._store.validated = true;
|
1490
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
1491
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
1492
|
-
return;
|
1493
|
-
}
|
1494
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
1495
|
-
var childOwner = "";
|
1496
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
1497
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
1498
|
-
}
|
1499
|
-
{
|
1500
|
-
setCurrentlyValidatingElement$1(element);
|
1501
|
-
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);
|
1502
|
-
setCurrentlyValidatingElement$1(null);
|
1503
|
-
}
|
1504
|
-
}
|
1505
|
-
function validateChildKeys(node, parentType) {
|
1506
|
-
if (typeof node !== "object") {
|
1507
|
-
return;
|
1508
|
-
}
|
1509
|
-
if (isArray(node)) {
|
1510
|
-
for (var i = 0; i < node.length; i++) {
|
1511
|
-
var child = node[i];
|
1512
|
-
if (isValidElement(child)) {
|
1513
|
-
validateExplicitKey(child, parentType);
|
1514
|
-
}
|
1515
|
-
}
|
1516
|
-
} else if (isValidElement(node)) {
|
1517
|
-
if (node._store) {
|
1518
|
-
node._store.validated = true;
|
1519
|
-
}
|
1520
|
-
} else if (node) {
|
1521
|
-
var iteratorFn = getIteratorFn(node);
|
1522
|
-
if (typeof iteratorFn === "function") {
|
1523
|
-
if (iteratorFn !== node.entries) {
|
1524
|
-
var iterator = iteratorFn.call(node);
|
1525
|
-
var step;
|
1526
|
-
while (!(step = iterator.next()).done) {
|
1527
|
-
if (isValidElement(step.value)) {
|
1528
|
-
validateExplicitKey(step.value, parentType);
|
1529
|
-
}
|
1530
|
-
}
|
1531
|
-
}
|
1532
|
-
}
|
1533
|
-
}
|
1534
|
-
}
|
1535
|
-
function validatePropTypes(element) {
|
1536
|
-
{
|
1537
|
-
var type = element.type;
|
1538
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
1539
|
-
return;
|
1540
|
-
}
|
1541
|
-
var propTypes;
|
1542
|
-
if (typeof type === "function") {
|
1543
|
-
propTypes = type.propTypes;
|
1544
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
1545
|
-
// Inner props are checked in the reconciler.
|
1546
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
1547
|
-
propTypes = type.propTypes;
|
1548
|
-
} else {
|
1549
|
-
return;
|
1550
|
-
}
|
1551
|
-
if (propTypes) {
|
1552
|
-
var name = getComponentNameFromType(type);
|
1553
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
1554
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
1555
|
-
propTypesMisspellWarningShown = true;
|
1556
|
-
var _name = getComponentNameFromType(type);
|
1557
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
1558
|
-
}
|
1559
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
1560
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1561
|
-
}
|
1562
|
-
}
|
1563
|
-
}
|
1564
|
-
function validateFragmentProps(fragment) {
|
1565
|
-
{
|
1566
|
-
var keys = Object.keys(fragment.props);
|
1567
|
-
for (var i = 0; i < keys.length; i++) {
|
1568
|
-
var key = keys[i];
|
1569
|
-
if (key !== "children" && key !== "key") {
|
1570
|
-
setCurrentlyValidatingElement$1(fragment);
|
1571
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
1572
|
-
setCurrentlyValidatingElement$1(null);
|
1573
|
-
break;
|
1574
|
-
}
|
1575
|
-
}
|
1576
|
-
if (fragment.ref !== null) {
|
1577
|
-
setCurrentlyValidatingElement$1(fragment);
|
1578
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
1579
|
-
setCurrentlyValidatingElement$1(null);
|
1580
|
-
}
|
1581
|
-
}
|
1582
|
-
}
|
1583
|
-
function createElementWithValidation(type, props, children) {
|
1584
|
-
var validType = isValidElementType(type);
|
1585
|
-
if (!validType) {
|
1586
|
-
var info = "";
|
1587
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
1588
|
-
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.";
|
1589
|
-
}
|
1590
|
-
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
1591
|
-
if (sourceInfo) {
|
1592
|
-
info += sourceInfo;
|
1593
|
-
} else {
|
1594
|
-
info += getDeclarationErrorAddendum();
|
1595
|
-
}
|
1596
|
-
var typeString;
|
1597
|
-
if (type === null) {
|
1598
|
-
typeString = "null";
|
1599
|
-
} else if (isArray(type)) {
|
1600
|
-
typeString = "array";
|
1601
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
1602
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
1603
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
1604
|
-
} else {
|
1605
|
-
typeString = typeof type;
|
1606
|
-
}
|
1607
|
-
{
|
1608
|
-
error("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", typeString, info);
|
1609
|
-
}
|
1610
|
-
}
|
1611
|
-
var element = createElement.apply(this, arguments);
|
1612
|
-
if (element == null) {
|
1613
|
-
return element;
|
1614
|
-
}
|
1615
|
-
if (validType) {
|
1616
|
-
for (var i = 2; i < arguments.length; i++) {
|
1617
|
-
validateChildKeys(arguments[i], type);
|
1618
|
-
}
|
1619
|
-
}
|
1620
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
1621
|
-
validateFragmentProps(element);
|
1622
|
-
} else {
|
1623
|
-
validatePropTypes(element);
|
1624
|
-
}
|
1625
|
-
return element;
|
1626
|
-
}
|
1627
|
-
var didWarnAboutDeprecatedCreateFactory = false;
|
1628
|
-
function createFactoryWithValidation(type) {
|
1629
|
-
var validatedFactory = createElementWithValidation.bind(null, type);
|
1630
|
-
validatedFactory.type = type;
|
1631
|
-
{
|
1632
|
-
if (!didWarnAboutDeprecatedCreateFactory) {
|
1633
|
-
didWarnAboutDeprecatedCreateFactory = true;
|
1634
|
-
warn("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.");
|
1635
|
-
}
|
1636
|
-
Object.defineProperty(validatedFactory, "type", {
|
1637
|
-
enumerable: false,
|
1638
|
-
get: function() {
|
1639
|
-
warn("Factory.type is deprecated. Access the class directly before passing it to createFactory.");
|
1640
|
-
Object.defineProperty(this, "type", {
|
1641
|
-
value: type
|
1642
|
-
});
|
1643
|
-
return type;
|
1644
|
-
}
|
1645
|
-
});
|
1646
|
-
}
|
1647
|
-
return validatedFactory;
|
1648
|
-
}
|
1649
|
-
function cloneElementWithValidation(element, props, children) {
|
1650
|
-
var newElement = cloneElement.apply(this, arguments);
|
1651
|
-
for (var i = 2; i < arguments.length; i++) {
|
1652
|
-
validateChildKeys(arguments[i], newElement.type);
|
1653
|
-
}
|
1654
|
-
validatePropTypes(newElement);
|
1655
|
-
return newElement;
|
1656
|
-
}
|
1657
|
-
function startTransition(scope, options) {
|
1658
|
-
var prevTransition = ReactCurrentBatchConfig.transition;
|
1659
|
-
ReactCurrentBatchConfig.transition = {};
|
1660
|
-
var currentTransition = ReactCurrentBatchConfig.transition;
|
1661
|
-
{
|
1662
|
-
ReactCurrentBatchConfig.transition._updatedFibers = /* @__PURE__ */ new Set();
|
1663
|
-
}
|
1664
|
-
try {
|
1665
|
-
scope();
|
1666
|
-
} finally {
|
1667
|
-
ReactCurrentBatchConfig.transition = prevTransition;
|
1668
|
-
{
|
1669
|
-
if (prevTransition === null && currentTransition._updatedFibers) {
|
1670
|
-
var updatedFibersCount = currentTransition._updatedFibers.size;
|
1671
|
-
if (updatedFibersCount > 10) {
|
1672
|
-
warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.");
|
1673
|
-
}
|
1674
|
-
currentTransition._updatedFibers.clear();
|
1675
|
-
}
|
1676
|
-
}
|
1677
|
-
}
|
1678
|
-
}
|
1679
|
-
var didWarnAboutMessageChannel = false;
|
1680
|
-
var enqueueTaskImpl = null;
|
1681
|
-
function enqueueTask(task) {
|
1682
|
-
if (enqueueTaskImpl === null) {
|
1683
|
-
try {
|
1684
|
-
var requireString = ("require" + Math.random()).slice(0, 7);
|
1685
|
-
var nodeRequire = module && module[requireString];
|
1686
|
-
enqueueTaskImpl = nodeRequire.call(module, "timers").setImmediate;
|
1687
|
-
} catch (_err) {
|
1688
|
-
enqueueTaskImpl = function(callback) {
|
1689
|
-
{
|
1690
|
-
if (didWarnAboutMessageChannel === false) {
|
1691
|
-
didWarnAboutMessageChannel = true;
|
1692
|
-
if (typeof MessageChannel === "undefined") {
|
1693
|
-
error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning.");
|
1694
|
-
}
|
1695
|
-
}
|
1696
|
-
}
|
1697
|
-
var channel = new MessageChannel();
|
1698
|
-
channel.port1.onmessage = callback;
|
1699
|
-
channel.port2.postMessage(void 0);
|
1700
|
-
};
|
1701
|
-
}
|
1702
|
-
}
|
1703
|
-
return enqueueTaskImpl(task);
|
1704
|
-
}
|
1705
|
-
var actScopeDepth = 0;
|
1706
|
-
var didWarnNoAwaitAct = false;
|
1707
|
-
function act(callback) {
|
1708
|
-
{
|
1709
|
-
var prevActScopeDepth = actScopeDepth;
|
1710
|
-
actScopeDepth++;
|
1711
|
-
if (ReactCurrentActQueue.current === null) {
|
1712
|
-
ReactCurrentActQueue.current = [];
|
1713
|
-
}
|
1714
|
-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
1715
|
-
var result;
|
1716
|
-
try {
|
1717
|
-
ReactCurrentActQueue.isBatchingLegacy = true;
|
1718
|
-
result = callback();
|
1719
|
-
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
1720
|
-
var queue = ReactCurrentActQueue.current;
|
1721
|
-
if (queue !== null) {
|
1722
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
1723
|
-
flushActQueue(queue);
|
1724
|
-
}
|
1725
|
-
}
|
1726
|
-
} catch (error2) {
|
1727
|
-
popActScope(prevActScopeDepth);
|
1728
|
-
throw error2;
|
1729
|
-
} finally {
|
1730
|
-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
1731
|
-
}
|
1732
|
-
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
1733
|
-
var thenableResult = result;
|
1734
|
-
var wasAwaited = false;
|
1735
|
-
var thenable = {
|
1736
|
-
then: function(resolve, reject) {
|
1737
|
-
wasAwaited = true;
|
1738
|
-
thenableResult.then(function(returnValue2) {
|
1739
|
-
popActScope(prevActScopeDepth);
|
1740
|
-
if (actScopeDepth === 0) {
|
1741
|
-
recursivelyFlushAsyncActWork(returnValue2, resolve, reject);
|
1742
|
-
} else {
|
1743
|
-
resolve(returnValue2);
|
1744
|
-
}
|
1745
|
-
}, function(error2) {
|
1746
|
-
popActScope(prevActScopeDepth);
|
1747
|
-
reject(error2);
|
1748
|
-
});
|
1749
|
-
}
|
1750
|
-
};
|
1751
|
-
{
|
1752
|
-
if (!didWarnNoAwaitAct && typeof Promise !== "undefined") {
|
1753
|
-
Promise.resolve().then(function() {
|
1754
|
-
}).then(function() {
|
1755
|
-
if (!wasAwaited) {
|
1756
|
-
didWarnNoAwaitAct = true;
|
1757
|
-
error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);");
|
1758
|
-
}
|
1759
|
-
});
|
1760
|
-
}
|
1761
|
-
}
|
1762
|
-
return thenable;
|
1763
|
-
} else {
|
1764
|
-
var returnValue = result;
|
1765
|
-
popActScope(prevActScopeDepth);
|
1766
|
-
if (actScopeDepth === 0) {
|
1767
|
-
var _queue = ReactCurrentActQueue.current;
|
1768
|
-
if (_queue !== null) {
|
1769
|
-
flushActQueue(_queue);
|
1770
|
-
ReactCurrentActQueue.current = null;
|
1771
|
-
}
|
1772
|
-
var _thenable = {
|
1773
|
-
then: function(resolve, reject) {
|
1774
|
-
if (ReactCurrentActQueue.current === null) {
|
1775
|
-
ReactCurrentActQueue.current = [];
|
1776
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
1777
|
-
} else {
|
1778
|
-
resolve(returnValue);
|
1779
|
-
}
|
1780
|
-
}
|
1781
|
-
};
|
1782
|
-
return _thenable;
|
1783
|
-
} else {
|
1784
|
-
var _thenable2 = {
|
1785
|
-
then: function(resolve, reject) {
|
1786
|
-
resolve(returnValue);
|
1787
|
-
}
|
1788
|
-
};
|
1789
|
-
return _thenable2;
|
1790
|
-
}
|
1791
|
-
}
|
1792
|
-
}
|
1793
|
-
}
|
1794
|
-
function popActScope(prevActScopeDepth) {
|
1795
|
-
{
|
1796
|
-
if (prevActScopeDepth !== actScopeDepth - 1) {
|
1797
|
-
error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. ");
|
1798
|
-
}
|
1799
|
-
actScopeDepth = prevActScopeDepth;
|
1800
|
-
}
|
1801
|
-
}
|
1802
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
1803
|
-
{
|
1804
|
-
var queue = ReactCurrentActQueue.current;
|
1805
|
-
if (queue !== null) {
|
1806
|
-
try {
|
1807
|
-
flushActQueue(queue);
|
1808
|
-
enqueueTask(function() {
|
1809
|
-
if (queue.length === 0) {
|
1810
|
-
ReactCurrentActQueue.current = null;
|
1811
|
-
resolve(returnValue);
|
1812
|
-
} else {
|
1813
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
1814
|
-
}
|
1815
|
-
});
|
1816
|
-
} catch (error2) {
|
1817
|
-
reject(error2);
|
1818
|
-
}
|
1819
|
-
} else {
|
1820
|
-
resolve(returnValue);
|
1821
|
-
}
|
1822
|
-
}
|
1823
|
-
}
|
1824
|
-
var isFlushing = false;
|
1825
|
-
function flushActQueue(queue) {
|
1826
|
-
{
|
1827
|
-
if (!isFlushing) {
|
1828
|
-
isFlushing = true;
|
1829
|
-
var i = 0;
|
1830
|
-
try {
|
1831
|
-
for (; i < queue.length; i++) {
|
1832
|
-
var callback = queue[i];
|
1833
|
-
do {
|
1834
|
-
callback = callback(true);
|
1835
|
-
} while (callback !== null);
|
1836
|
-
}
|
1837
|
-
queue.length = 0;
|
1838
|
-
} catch (error2) {
|
1839
|
-
queue = queue.slice(i + 1);
|
1840
|
-
throw error2;
|
1841
|
-
} finally {
|
1842
|
-
isFlushing = false;
|
1843
|
-
}
|
1844
|
-
}
|
1845
|
-
}
|
1846
|
-
}
|
1847
|
-
var createElement$1 = createElementWithValidation;
|
1848
|
-
var cloneElement$1 = cloneElementWithValidation;
|
1849
|
-
var createFactory = createFactoryWithValidation;
|
1850
|
-
var Children = {
|
1851
|
-
map: mapChildren,
|
1852
|
-
forEach: forEachChildren,
|
1853
|
-
count: countChildren,
|
1854
|
-
toArray,
|
1855
|
-
only: onlyChild
|
1856
|
-
};
|
1857
|
-
exports.Children = Children;
|
1858
|
-
exports.Component = Component;
|
1859
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
1860
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
1861
|
-
exports.PureComponent = PureComponent;
|
1862
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
1863
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
1864
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
1865
|
-
exports.cloneElement = cloneElement$1;
|
1866
|
-
exports.createContext = createContext2;
|
1867
|
-
exports.createElement = createElement$1;
|
1868
|
-
exports.createFactory = createFactory;
|
1869
|
-
exports.createRef = createRef;
|
1870
|
-
exports.forwardRef = forwardRef;
|
1871
|
-
exports.isValidElement = isValidElement;
|
1872
|
-
exports.lazy = lazy;
|
1873
|
-
exports.memo = memo;
|
1874
|
-
exports.startTransition = startTransition;
|
1875
|
-
exports.unstable_act = act;
|
1876
|
-
exports.useCallback = useCallback;
|
1877
|
-
exports.useContext = useContext2;
|
1878
|
-
exports.useDebugValue = useDebugValue;
|
1879
|
-
exports.useDeferredValue = useDeferredValue;
|
1880
|
-
exports.useEffect = useEffect2;
|
1881
|
-
exports.useId = useId;
|
1882
|
-
exports.useImperativeHandle = useImperativeHandle;
|
1883
|
-
exports.useInsertionEffect = useInsertionEffect;
|
1884
|
-
exports.useLayoutEffect = useLayoutEffect;
|
1885
|
-
exports.useMemo = useMemo;
|
1886
|
-
exports.useReducer = useReducer;
|
1887
|
-
exports.useRef = useRef;
|
1888
|
-
exports.useState = useState2;
|
1889
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
1890
|
-
exports.useTransition = useTransition;
|
1891
|
-
exports.version = ReactVersion;
|
1892
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
1893
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
1894
|
-
}
|
1895
|
-
})();
|
1896
|
-
}
|
1897
|
-
}
|
1898
|
-
});
|
1899
|
-
|
1900
|
-
// node_modules/react/index.js
|
1901
|
-
var require_react = __commonJS({
|
1902
|
-
"node_modules/react/index.js"(exports, module) {
|
1903
|
-
"use strict";
|
1904
|
-
if (false) {
|
1905
|
-
module.exports = null;
|
1906
|
-
} else {
|
1907
|
-
module.exports = require_react_development();
|
1908
|
-
}
|
1909
|
-
}
|
1910
|
-
});
|
1911
|
-
|
1912
|
-
// node_modules/react/cjs/react-jsx-runtime.development.js
|
1913
|
-
var require_react_jsx_runtime_development = __commonJS({
|
1914
|
-
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
1915
|
-
"use strict";
|
1916
|
-
if (true) {
|
1917
|
-
(function() {
|
1918
|
-
"use strict";
|
1919
|
-
var React2 = require_react();
|
1920
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
1921
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
1922
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
1923
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
1924
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
1925
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
1926
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
1927
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
1928
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
1929
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
1930
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
1931
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
1932
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
1933
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
1934
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
1935
|
-
function getIteratorFn(maybeIterable) {
|
1936
|
-
if (maybeIterable === null || typeof maybeIterable !== "object") {
|
1937
|
-
return null;
|
1938
|
-
}
|
1939
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
1940
|
-
if (typeof maybeIterator === "function") {
|
1941
|
-
return maybeIterator;
|
1942
|
-
}
|
1943
|
-
return null;
|
1944
|
-
}
|
1945
|
-
var ReactSharedInternals = React2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
1946
|
-
function error(format) {
|
1947
|
-
{
|
1948
|
-
{
|
1949
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
1950
|
-
args[_key2 - 1] = arguments[_key2];
|
1951
|
-
}
|
1952
|
-
printWarning("error", format, args);
|
1953
|
-
}
|
1954
|
-
}
|
1955
|
-
}
|
1956
|
-
function printWarning(level, format, args) {
|
1957
|
-
{
|
1958
|
-
var ReactDebugCurrentFrame2 = ReactSharedInternals.ReactDebugCurrentFrame;
|
1959
|
-
var stack = ReactDebugCurrentFrame2.getStackAddendum();
|
1960
|
-
if (stack !== "") {
|
1961
|
-
format += "%s";
|
1962
|
-
args = args.concat([stack]);
|
1963
|
-
}
|
1964
|
-
var argsWithFormat = args.map(function(item) {
|
1965
|
-
return String(item);
|
1966
|
-
});
|
1967
|
-
argsWithFormat.unshift("Warning: " + format);
|
1968
|
-
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
1969
|
-
}
|
1970
|
-
}
|
1971
|
-
var enableScopeAPI = false;
|
1972
|
-
var enableCacheElement = false;
|
1973
|
-
var enableTransitionTracing = false;
|
1974
|
-
var enableLegacyHidden = false;
|
1975
|
-
var enableDebugTracing = false;
|
1976
|
-
var REACT_MODULE_REFERENCE;
|
1977
|
-
{
|
1978
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
1979
|
-
}
|
1980
|
-
function isValidElementType(type) {
|
1981
|
-
if (typeof type === "string" || typeof type === "function") {
|
1982
|
-
return true;
|
1983
|
-
}
|
1984
|
-
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) {
|
1985
|
-
return true;
|
1986
|
-
}
|
1987
|
-
if (typeof type === "object" && type !== null) {
|
1988
|
-
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
|
1989
|
-
// types supported by any Flight configuration anywhere since
|
1990
|
-
// we don't know which Flight build this will end up being used
|
1991
|
-
// with.
|
1992
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
1993
|
-
return true;
|
1994
|
-
}
|
1995
|
-
}
|
1996
|
-
return false;
|
1997
|
-
}
|
1998
|
-
function getWrappedName(outerType, innerType, wrapperName) {
|
1999
|
-
var displayName = outerType.displayName;
|
2000
|
-
if (displayName) {
|
2001
|
-
return displayName;
|
2002
|
-
}
|
2003
|
-
var functionName = innerType.displayName || innerType.name || "";
|
2004
|
-
return functionName !== "" ? wrapperName + "(" + functionName + ")" : wrapperName;
|
2005
|
-
}
|
2006
|
-
function getContextName(type) {
|
2007
|
-
return type.displayName || "Context";
|
2008
|
-
}
|
2009
|
-
function getComponentNameFromType(type) {
|
2010
|
-
if (type == null) {
|
2011
|
-
return null;
|
2012
|
-
}
|
2013
|
-
{
|
2014
|
-
if (typeof type.tag === "number") {
|
2015
|
-
error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue.");
|
2016
|
-
}
|
2017
|
-
}
|
2018
|
-
if (typeof type === "function") {
|
2019
|
-
return type.displayName || type.name || null;
|
2020
|
-
}
|
2021
|
-
if (typeof type === "string") {
|
2022
|
-
return type;
|
2023
|
-
}
|
2024
|
-
switch (type) {
|
2025
|
-
case REACT_FRAGMENT_TYPE:
|
2026
|
-
return "Fragment";
|
2027
|
-
case REACT_PORTAL_TYPE:
|
2028
|
-
return "Portal";
|
2029
|
-
case REACT_PROFILER_TYPE:
|
2030
|
-
return "Profiler";
|
2031
|
-
case REACT_STRICT_MODE_TYPE:
|
2032
|
-
return "StrictMode";
|
2033
|
-
case REACT_SUSPENSE_TYPE:
|
2034
|
-
return "Suspense";
|
2035
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
2036
|
-
return "SuspenseList";
|
2037
|
-
}
|
2038
|
-
if (typeof type === "object") {
|
2039
|
-
switch (type.$$typeof) {
|
2040
|
-
case REACT_CONTEXT_TYPE:
|
2041
|
-
var context = type;
|
2042
|
-
return getContextName(context) + ".Consumer";
|
2043
|
-
case REACT_PROVIDER_TYPE:
|
2044
|
-
var provider = type;
|
2045
|
-
return getContextName(provider._context) + ".Provider";
|
2046
|
-
case REACT_FORWARD_REF_TYPE:
|
2047
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
2048
|
-
case REACT_MEMO_TYPE:
|
2049
|
-
var outerName = type.displayName || null;
|
2050
|
-
if (outerName !== null) {
|
2051
|
-
return outerName;
|
2052
|
-
}
|
2053
|
-
return getComponentNameFromType(type.type) || "Memo";
|
2054
|
-
case REACT_LAZY_TYPE: {
|
2055
|
-
var lazyComponent = type;
|
2056
|
-
var payload = lazyComponent._payload;
|
2057
|
-
var init = lazyComponent._init;
|
2058
|
-
try {
|
2059
|
-
return getComponentNameFromType(init(payload));
|
2060
|
-
} catch (x) {
|
2061
|
-
return null;
|
2062
|
-
}
|
2063
|
-
}
|
2064
|
-
}
|
2065
|
-
}
|
2066
|
-
return null;
|
2067
|
-
}
|
2068
|
-
var assign = Object.assign;
|
2069
|
-
var disabledDepth = 0;
|
2070
|
-
var prevLog;
|
2071
|
-
var prevInfo;
|
2072
|
-
var prevWarn;
|
2073
|
-
var prevError;
|
2074
|
-
var prevGroup;
|
2075
|
-
var prevGroupCollapsed;
|
2076
|
-
var prevGroupEnd;
|
2077
|
-
function disabledLog() {
|
2078
|
-
}
|
2079
|
-
disabledLog.__reactDisabledLog = true;
|
2080
|
-
function disableLogs() {
|
2081
|
-
{
|
2082
|
-
if (disabledDepth === 0) {
|
2083
|
-
prevLog = console.log;
|
2084
|
-
prevInfo = console.info;
|
2085
|
-
prevWarn = console.warn;
|
2086
|
-
prevError = console.error;
|
2087
|
-
prevGroup = console.group;
|
2088
|
-
prevGroupCollapsed = console.groupCollapsed;
|
2089
|
-
prevGroupEnd = console.groupEnd;
|
2090
|
-
var props = {
|
2091
|
-
configurable: true,
|
2092
|
-
enumerable: true,
|
2093
|
-
value: disabledLog,
|
2094
|
-
writable: true
|
2095
|
-
};
|
2096
|
-
Object.defineProperties(console, {
|
2097
|
-
info: props,
|
2098
|
-
log: props,
|
2099
|
-
warn: props,
|
2100
|
-
error: props,
|
2101
|
-
group: props,
|
2102
|
-
groupCollapsed: props,
|
2103
|
-
groupEnd: props
|
2104
|
-
});
|
2105
|
-
}
|
2106
|
-
disabledDepth++;
|
2107
|
-
}
|
2108
|
-
}
|
2109
|
-
function reenableLogs() {
|
2110
|
-
{
|
2111
|
-
disabledDepth--;
|
2112
|
-
if (disabledDepth === 0) {
|
2113
|
-
var props = {
|
2114
|
-
configurable: true,
|
2115
|
-
enumerable: true,
|
2116
|
-
writable: true
|
2117
|
-
};
|
2118
|
-
Object.defineProperties(console, {
|
2119
|
-
log: assign({}, props, {
|
2120
|
-
value: prevLog
|
2121
|
-
}),
|
2122
|
-
info: assign({}, props, {
|
2123
|
-
value: prevInfo
|
2124
|
-
}),
|
2125
|
-
warn: assign({}, props, {
|
2126
|
-
value: prevWarn
|
2127
|
-
}),
|
2128
|
-
error: assign({}, props, {
|
2129
|
-
value: prevError
|
2130
|
-
}),
|
2131
|
-
group: assign({}, props, {
|
2132
|
-
value: prevGroup
|
2133
|
-
}),
|
2134
|
-
groupCollapsed: assign({}, props, {
|
2135
|
-
value: prevGroupCollapsed
|
2136
|
-
}),
|
2137
|
-
groupEnd: assign({}, props, {
|
2138
|
-
value: prevGroupEnd
|
2139
|
-
})
|
2140
|
-
});
|
2141
|
-
}
|
2142
|
-
if (disabledDepth < 0) {
|
2143
|
-
error("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
2144
|
-
}
|
2145
|
-
}
|
2146
|
-
}
|
2147
|
-
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
2148
|
-
var prefix;
|
2149
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
2150
|
-
{
|
2151
|
-
if (prefix === void 0) {
|
2152
|
-
try {
|
2153
|
-
throw Error();
|
2154
|
-
} catch (x) {
|
2155
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
2156
|
-
prefix = match && match[1] || "";
|
2157
|
-
}
|
2158
|
-
}
|
2159
|
-
return "\n" + prefix + name;
|
2160
|
-
}
|
2161
|
-
}
|
2162
|
-
var reentry = false;
|
2163
|
-
var componentFrameCache;
|
2164
|
-
{
|
2165
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
2166
|
-
componentFrameCache = new PossiblyWeakMap();
|
2167
|
-
}
|
2168
|
-
function describeNativeComponentFrame(fn, construct) {
|
2169
|
-
if (!fn || reentry) {
|
2170
|
-
return "";
|
2171
|
-
}
|
2172
|
-
{
|
2173
|
-
var frame = componentFrameCache.get(fn);
|
2174
|
-
if (frame !== void 0) {
|
2175
|
-
return frame;
|
2176
|
-
}
|
2177
|
-
}
|
2178
|
-
var control;
|
2179
|
-
reentry = true;
|
2180
|
-
var previousPrepareStackTrace = Error.prepareStackTrace;
|
2181
|
-
Error.prepareStackTrace = void 0;
|
2182
|
-
var previousDispatcher;
|
2183
|
-
{
|
2184
|
-
previousDispatcher = ReactCurrentDispatcher.current;
|
2185
|
-
ReactCurrentDispatcher.current = null;
|
2186
|
-
disableLogs();
|
2187
|
-
}
|
2188
|
-
try {
|
2189
|
-
if (construct) {
|
2190
|
-
var Fake = function() {
|
2191
|
-
throw Error();
|
2192
|
-
};
|
2193
|
-
Object.defineProperty(Fake.prototype, "props", {
|
2194
|
-
set: function() {
|
2195
|
-
throw Error();
|
2196
|
-
}
|
2197
|
-
});
|
2198
|
-
if (typeof Reflect === "object" && Reflect.construct) {
|
2199
|
-
try {
|
2200
|
-
Reflect.construct(Fake, []);
|
2201
|
-
} catch (x) {
|
2202
|
-
control = x;
|
2203
|
-
}
|
2204
|
-
Reflect.construct(fn, [], Fake);
|
2205
|
-
} else {
|
2206
|
-
try {
|
2207
|
-
Fake.call();
|
2208
|
-
} catch (x) {
|
2209
|
-
control = x;
|
2210
|
-
}
|
2211
|
-
fn.call(Fake.prototype);
|
2212
|
-
}
|
2213
|
-
} else {
|
2214
|
-
try {
|
2215
|
-
throw Error();
|
2216
|
-
} catch (x) {
|
2217
|
-
control = x;
|
2218
|
-
}
|
2219
|
-
fn();
|
2220
|
-
}
|
2221
|
-
} catch (sample) {
|
2222
|
-
if (sample && control && typeof sample.stack === "string") {
|
2223
|
-
var sampleLines = sample.stack.split("\n");
|
2224
|
-
var controlLines = control.stack.split("\n");
|
2225
|
-
var s = sampleLines.length - 1;
|
2226
|
-
var c = controlLines.length - 1;
|
2227
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
2228
|
-
c--;
|
2229
|
-
}
|
2230
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
2231
|
-
if (sampleLines[s] !== controlLines[c]) {
|
2232
|
-
if (s !== 1 || c !== 1) {
|
2233
|
-
do {
|
2234
|
-
s--;
|
2235
|
-
c--;
|
2236
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
2237
|
-
var _frame = "\n" + sampleLines[s].replace(" at new ", " at ");
|
2238
|
-
if (fn.displayName && _frame.includes("<anonymous>")) {
|
2239
|
-
_frame = _frame.replace("<anonymous>", fn.displayName);
|
2240
|
-
}
|
2241
|
-
{
|
2242
|
-
if (typeof fn === "function") {
|
2243
|
-
componentFrameCache.set(fn, _frame);
|
2244
|
-
}
|
2245
|
-
}
|
2246
|
-
return _frame;
|
2247
|
-
}
|
2248
|
-
} while (s >= 1 && c >= 0);
|
2249
|
-
}
|
2250
|
-
break;
|
2251
|
-
}
|
2252
|
-
}
|
2253
|
-
}
|
2254
|
-
} finally {
|
2255
|
-
reentry = false;
|
2256
|
-
{
|
2257
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
2258
|
-
reenableLogs();
|
2259
|
-
}
|
2260
|
-
Error.prepareStackTrace = previousPrepareStackTrace;
|
2261
|
-
}
|
2262
|
-
var name = fn ? fn.displayName || fn.name : "";
|
2263
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : "";
|
2264
|
-
{
|
2265
|
-
if (typeof fn === "function") {
|
2266
|
-
componentFrameCache.set(fn, syntheticFrame);
|
2267
|
-
}
|
2268
|
-
}
|
2269
|
-
return syntheticFrame;
|
2270
|
-
}
|
2271
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
2272
|
-
{
|
2273
|
-
return describeNativeComponentFrame(fn, false);
|
2274
|
-
}
|
2275
|
-
}
|
2276
|
-
function shouldConstruct(Component) {
|
2277
|
-
var prototype = Component.prototype;
|
2278
|
-
return !!(prototype && prototype.isReactComponent);
|
2279
|
-
}
|
2280
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
2281
|
-
if (type == null) {
|
2282
|
-
return "";
|
2283
|
-
}
|
2284
|
-
if (typeof type === "function") {
|
2285
|
-
{
|
2286
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
2287
|
-
}
|
2288
|
-
}
|
2289
|
-
if (typeof type === "string") {
|
2290
|
-
return describeBuiltInComponentFrame(type);
|
2291
|
-
}
|
2292
|
-
switch (type) {
|
2293
|
-
case REACT_SUSPENSE_TYPE:
|
2294
|
-
return describeBuiltInComponentFrame("Suspense");
|
2295
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
2296
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
2297
|
-
}
|
2298
|
-
if (typeof type === "object") {
|
2299
|
-
switch (type.$$typeof) {
|
2300
|
-
case REACT_FORWARD_REF_TYPE:
|
2301
|
-
return describeFunctionComponentFrame(type.render);
|
2302
|
-
case REACT_MEMO_TYPE:
|
2303
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
2304
|
-
case REACT_LAZY_TYPE: {
|
2305
|
-
var lazyComponent = type;
|
2306
|
-
var payload = lazyComponent._payload;
|
2307
|
-
var init = lazyComponent._init;
|
2308
|
-
try {
|
2309
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
2310
|
-
} catch (x) {
|
2311
|
-
}
|
2312
|
-
}
|
2313
|
-
}
|
2314
|
-
}
|
2315
|
-
return "";
|
2316
|
-
}
|
2317
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
2318
|
-
var loggedTypeFailures = {};
|
2319
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
2320
|
-
function setCurrentlyValidatingElement(element) {
|
2321
|
-
{
|
2322
|
-
if (element) {
|
2323
|
-
var owner = element._owner;
|
2324
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2325
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
2326
|
-
} else {
|
2327
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
2328
|
-
}
|
2329
|
-
}
|
2330
|
-
}
|
2331
|
-
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
2332
|
-
{
|
2333
|
-
var has = Function.call.bind(hasOwnProperty);
|
2334
|
-
for (var typeSpecName in typeSpecs) {
|
2335
|
-
if (has(typeSpecs, typeSpecName)) {
|
2336
|
-
var error$1 = void 0;
|
2337
|
-
try {
|
2338
|
-
if (typeof typeSpecs[typeSpecName] !== "function") {
|
2339
|
-
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`.");
|
2340
|
-
err.name = "Invariant Violation";
|
2341
|
-
throw err;
|
2342
|
-
}
|
2343
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
2344
|
-
} catch (ex) {
|
2345
|
-
error$1 = ex;
|
2346
|
-
}
|
2347
|
-
if (error$1 && !(error$1 instanceof Error)) {
|
2348
|
-
setCurrentlyValidatingElement(element);
|
2349
|
-
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);
|
2350
|
-
setCurrentlyValidatingElement(null);
|
2351
|
-
}
|
2352
|
-
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
2353
|
-
loggedTypeFailures[error$1.message] = true;
|
2354
|
-
setCurrentlyValidatingElement(element);
|
2355
|
-
error("Failed %s type: %s", location, error$1.message);
|
2356
|
-
setCurrentlyValidatingElement(null);
|
2357
|
-
}
|
2358
|
-
}
|
2359
|
-
}
|
2360
|
-
}
|
2361
|
-
}
|
2362
|
-
var isArrayImpl = Array.isArray;
|
2363
|
-
function isArray(a) {
|
2364
|
-
return isArrayImpl(a);
|
2365
|
-
}
|
2366
|
-
function typeName(value) {
|
2367
|
-
{
|
2368
|
-
var hasToStringTag = typeof Symbol === "function" && Symbol.toStringTag;
|
2369
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
2370
|
-
return type;
|
2371
|
-
}
|
2372
|
-
}
|
2373
|
-
function willCoercionThrow(value) {
|
2374
|
-
{
|
2375
|
-
try {
|
2376
|
-
testStringCoercion(value);
|
2377
|
-
return false;
|
2378
|
-
} catch (e) {
|
2379
|
-
return true;
|
2380
|
-
}
|
2381
|
-
}
|
2382
|
-
}
|
2383
|
-
function testStringCoercion(value) {
|
2384
|
-
return "" + value;
|
2385
|
-
}
|
2386
|
-
function checkKeyStringCoercion(value) {
|
2387
|
-
{
|
2388
|
-
if (willCoercionThrow(value)) {
|
2389
|
-
error("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", typeName(value));
|
2390
|
-
return testStringCoercion(value);
|
2391
|
-
}
|
2392
|
-
}
|
2393
|
-
}
|
2394
|
-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
2395
|
-
var RESERVED_PROPS = {
|
2396
|
-
key: true,
|
2397
|
-
ref: true,
|
2398
|
-
__self: true,
|
2399
|
-
__source: true
|
2400
|
-
};
|
2401
|
-
var specialPropKeyWarningShown;
|
2402
|
-
var specialPropRefWarningShown;
|
2403
|
-
var didWarnAboutStringRefs;
|
2404
|
-
{
|
2405
|
-
didWarnAboutStringRefs = {};
|
2406
|
-
}
|
2407
|
-
function hasValidRef(config) {
|
2408
|
-
{
|
2409
|
-
if (hasOwnProperty.call(config, "ref")) {
|
2410
|
-
var getter = Object.getOwnPropertyDescriptor(config, "ref").get;
|
2411
|
-
if (getter && getter.isReactWarning) {
|
2412
|
-
return false;
|
2413
|
-
}
|
2414
|
-
}
|
2415
|
-
}
|
2416
|
-
return config.ref !== void 0;
|
2417
|
-
}
|
2418
|
-
function hasValidKey(config) {
|
2419
|
-
{
|
2420
|
-
if (hasOwnProperty.call(config, "key")) {
|
2421
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
2422
|
-
if (getter && getter.isReactWarning) {
|
2423
|
-
return false;
|
2424
|
-
}
|
2425
|
-
}
|
2426
|
-
}
|
2427
|
-
return config.key !== void 0;
|
2428
|
-
}
|
2429
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
2430
|
-
{
|
2431
|
-
if (typeof config.ref === "string" && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
2432
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
2433
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
2434
|
-
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);
|
2435
|
-
didWarnAboutStringRefs[componentName] = true;
|
2436
|
-
}
|
2437
|
-
}
|
2438
|
-
}
|
2439
|
-
}
|
2440
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
2441
|
-
{
|
2442
|
-
var warnAboutAccessingKey = function() {
|
2443
|
-
if (!specialPropKeyWarningShown) {
|
2444
|
-
specialPropKeyWarningShown = true;
|
2445
|
-
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);
|
2446
|
-
}
|
2447
|
-
};
|
2448
|
-
warnAboutAccessingKey.isReactWarning = true;
|
2449
|
-
Object.defineProperty(props, "key", {
|
2450
|
-
get: warnAboutAccessingKey,
|
2451
|
-
configurable: true
|
2452
|
-
});
|
2453
|
-
}
|
2454
|
-
}
|
2455
|
-
function defineRefPropWarningGetter(props, displayName) {
|
2456
|
-
{
|
2457
|
-
var warnAboutAccessingRef = function() {
|
2458
|
-
if (!specialPropRefWarningShown) {
|
2459
|
-
specialPropRefWarningShown = true;
|
2460
|
-
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);
|
2461
|
-
}
|
2462
|
-
};
|
2463
|
-
warnAboutAccessingRef.isReactWarning = true;
|
2464
|
-
Object.defineProperty(props, "ref", {
|
2465
|
-
get: warnAboutAccessingRef,
|
2466
|
-
configurable: true
|
2467
|
-
});
|
2468
|
-
}
|
2469
|
-
}
|
2470
|
-
var ReactElement = function(type, key, ref, self, source, owner, props) {
|
2471
|
-
var element = {
|
2472
|
-
// This tag allows us to uniquely identify this as a React Element
|
2473
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
2474
|
-
// Built-in properties that belong on the element
|
2475
|
-
type,
|
2476
|
-
key,
|
2477
|
-
ref,
|
2478
|
-
props,
|
2479
|
-
// Record the component responsible for creating this element.
|
2480
|
-
_owner: owner
|
2481
|
-
};
|
2482
|
-
{
|
2483
|
-
element._store = {};
|
2484
|
-
Object.defineProperty(element._store, "validated", {
|
2485
|
-
configurable: false,
|
2486
|
-
enumerable: false,
|
2487
|
-
writable: true,
|
2488
|
-
value: false
|
2489
|
-
});
|
2490
|
-
Object.defineProperty(element, "_self", {
|
2491
|
-
configurable: false,
|
2492
|
-
enumerable: false,
|
2493
|
-
writable: false,
|
2494
|
-
value: self
|
2495
|
-
});
|
2496
|
-
Object.defineProperty(element, "_source", {
|
2497
|
-
configurable: false,
|
2498
|
-
enumerable: false,
|
2499
|
-
writable: false,
|
2500
|
-
value: source
|
2501
|
-
});
|
2502
|
-
if (Object.freeze) {
|
2503
|
-
Object.freeze(element.props);
|
2504
|
-
Object.freeze(element);
|
2505
|
-
}
|
2506
|
-
}
|
2507
|
-
return element;
|
2508
|
-
};
|
2509
|
-
function jsxDEV(type, config, maybeKey, source, self) {
|
2510
|
-
{
|
2511
|
-
var propName;
|
2512
|
-
var props = {};
|
2513
|
-
var key = null;
|
2514
|
-
var ref = null;
|
2515
|
-
if (maybeKey !== void 0) {
|
2516
|
-
{
|
2517
|
-
checkKeyStringCoercion(maybeKey);
|
2518
|
-
}
|
2519
|
-
key = "" + maybeKey;
|
2520
|
-
}
|
2521
|
-
if (hasValidKey(config)) {
|
2522
|
-
{
|
2523
|
-
checkKeyStringCoercion(config.key);
|
2524
|
-
}
|
2525
|
-
key = "" + config.key;
|
2526
|
-
}
|
2527
|
-
if (hasValidRef(config)) {
|
2528
|
-
ref = config.ref;
|
2529
|
-
warnIfStringRefCannotBeAutoConverted(config, self);
|
2530
|
-
}
|
2531
|
-
for (propName in config) {
|
2532
|
-
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
2533
|
-
props[propName] = config[propName];
|
2534
|
-
}
|
2535
|
-
}
|
2536
|
-
if (type && type.defaultProps) {
|
2537
|
-
var defaultProps = type.defaultProps;
|
2538
|
-
for (propName in defaultProps) {
|
2539
|
-
if (props[propName] === void 0) {
|
2540
|
-
props[propName] = defaultProps[propName];
|
2541
|
-
}
|
2542
|
-
}
|
2543
|
-
}
|
2544
|
-
if (key || ref) {
|
2545
|
-
var displayName = typeof type === "function" ? type.displayName || type.name || "Unknown" : type;
|
2546
|
-
if (key) {
|
2547
|
-
defineKeyPropWarningGetter(props, displayName);
|
2548
|
-
}
|
2549
|
-
if (ref) {
|
2550
|
-
defineRefPropWarningGetter(props, displayName);
|
2551
|
-
}
|
2552
|
-
}
|
2553
|
-
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
2554
|
-
}
|
2555
|
-
}
|
2556
|
-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
2557
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
2558
|
-
function setCurrentlyValidatingElement$1(element) {
|
2559
|
-
{
|
2560
|
-
if (element) {
|
2561
|
-
var owner = element._owner;
|
2562
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
2563
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
2564
|
-
} else {
|
2565
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
2566
|
-
}
|
2567
|
-
}
|
2568
|
-
}
|
2569
|
-
var propTypesMisspellWarningShown;
|
2570
|
-
{
|
2571
|
-
propTypesMisspellWarningShown = false;
|
2572
|
-
}
|
2573
|
-
function isValidElement(object) {
|
2574
|
-
{
|
2575
|
-
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
2576
|
-
}
|
2577
|
-
}
|
2578
|
-
function getDeclarationErrorAddendum() {
|
2579
|
-
{
|
2580
|
-
if (ReactCurrentOwner$1.current) {
|
2581
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
2582
|
-
if (name) {
|
2583
|
-
return "\n\nCheck the render method of `" + name + "`.";
|
2584
|
-
}
|
2585
|
-
}
|
2586
|
-
return "";
|
2587
|
-
}
|
2588
|
-
}
|
2589
|
-
function getSourceInfoErrorAddendum(source) {
|
2590
|
-
{
|
2591
|
-
if (source !== void 0) {
|
2592
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/, "");
|
2593
|
-
var lineNumber = source.lineNumber;
|
2594
|
-
return "\n\nCheck your code at " + fileName + ":" + lineNumber + ".";
|
2595
|
-
}
|
2596
|
-
return "";
|
2597
|
-
}
|
2598
|
-
}
|
2599
|
-
var ownerHasKeyUseWarning = {};
|
2600
|
-
function getCurrentComponentErrorInfo(parentType) {
|
2601
|
-
{
|
2602
|
-
var info = getDeclarationErrorAddendum();
|
2603
|
-
if (!info) {
|
2604
|
-
var parentName = typeof parentType === "string" ? parentType : parentType.displayName || parentType.name;
|
2605
|
-
if (parentName) {
|
2606
|
-
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
2607
|
-
}
|
2608
|
-
}
|
2609
|
-
return info;
|
2610
|
-
}
|
2611
|
-
}
|
2612
|
-
function validateExplicitKey(element, parentType) {
|
2613
|
-
{
|
2614
|
-
if (!element._store || element._store.validated || element.key != null) {
|
2615
|
-
return;
|
2616
|
-
}
|
2617
|
-
element._store.validated = true;
|
2618
|
-
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
2619
|
-
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
2620
|
-
return;
|
2621
|
-
}
|
2622
|
-
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
2623
|
-
var childOwner = "";
|
2624
|
-
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
2625
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
2626
|
-
}
|
2627
|
-
setCurrentlyValidatingElement$1(element);
|
2628
|
-
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);
|
2629
|
-
setCurrentlyValidatingElement$1(null);
|
2630
|
-
}
|
2631
|
-
}
|
2632
|
-
function validateChildKeys(node, parentType) {
|
2633
|
-
{
|
2634
|
-
if (typeof node !== "object") {
|
2635
|
-
return;
|
2636
|
-
}
|
2637
|
-
if (isArray(node)) {
|
2638
|
-
for (var i = 0; i < node.length; i++) {
|
2639
|
-
var child = node[i];
|
2640
|
-
if (isValidElement(child)) {
|
2641
|
-
validateExplicitKey(child, parentType);
|
2642
|
-
}
|
2643
|
-
}
|
2644
|
-
} else if (isValidElement(node)) {
|
2645
|
-
if (node._store) {
|
2646
|
-
node._store.validated = true;
|
2647
|
-
}
|
2648
|
-
} else if (node) {
|
2649
|
-
var iteratorFn = getIteratorFn(node);
|
2650
|
-
if (typeof iteratorFn === "function") {
|
2651
|
-
if (iteratorFn !== node.entries) {
|
2652
|
-
var iterator = iteratorFn.call(node);
|
2653
|
-
var step;
|
2654
|
-
while (!(step = iterator.next()).done) {
|
2655
|
-
if (isValidElement(step.value)) {
|
2656
|
-
validateExplicitKey(step.value, parentType);
|
2657
|
-
}
|
2658
|
-
}
|
2659
|
-
}
|
2660
|
-
}
|
2661
|
-
}
|
2662
|
-
}
|
2663
|
-
}
|
2664
|
-
function validatePropTypes(element) {
|
2665
|
-
{
|
2666
|
-
var type = element.type;
|
2667
|
-
if (type === null || type === void 0 || typeof type === "string") {
|
2668
|
-
return;
|
2669
|
-
}
|
2670
|
-
var propTypes;
|
2671
|
-
if (typeof type === "function") {
|
2672
|
-
propTypes = type.propTypes;
|
2673
|
-
} else if (typeof type === "object" && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
2674
|
-
// Inner props are checked in the reconciler.
|
2675
|
-
type.$$typeof === REACT_MEMO_TYPE)) {
|
2676
|
-
propTypes = type.propTypes;
|
2677
|
-
} else {
|
2678
|
-
return;
|
2679
|
-
}
|
2680
|
-
if (propTypes) {
|
2681
|
-
var name = getComponentNameFromType(type);
|
2682
|
-
checkPropTypes(propTypes, element.props, "prop", name, element);
|
2683
|
-
} else if (type.PropTypes !== void 0 && !propTypesMisspellWarningShown) {
|
2684
|
-
propTypesMisspellWarningShown = true;
|
2685
|
-
var _name = getComponentNameFromType(type);
|
2686
|
-
error("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _name || "Unknown");
|
2687
|
-
}
|
2688
|
-
if (typeof type.getDefaultProps === "function" && !type.getDefaultProps.isReactClassApproved) {
|
2689
|
-
error("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
2690
|
-
}
|
2691
|
-
}
|
2692
|
-
}
|
2693
|
-
function validateFragmentProps(fragment) {
|
2694
|
-
{
|
2695
|
-
var keys = Object.keys(fragment.props);
|
2696
|
-
for (var i = 0; i < keys.length; i++) {
|
2697
|
-
var key = keys[i];
|
2698
|
-
if (key !== "children" && key !== "key") {
|
2699
|
-
setCurrentlyValidatingElement$1(fragment);
|
2700
|
-
error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", key);
|
2701
|
-
setCurrentlyValidatingElement$1(null);
|
2702
|
-
break;
|
2703
|
-
}
|
2704
|
-
}
|
2705
|
-
if (fragment.ref !== null) {
|
2706
|
-
setCurrentlyValidatingElement$1(fragment);
|
2707
|
-
error("Invalid attribute `ref` supplied to `React.Fragment`.");
|
2708
|
-
setCurrentlyValidatingElement$1(null);
|
2709
|
-
}
|
2710
|
-
}
|
2711
|
-
}
|
2712
|
-
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
2713
|
-
{
|
2714
|
-
var validType = isValidElementType(type);
|
2715
|
-
if (!validType) {
|
2716
|
-
var info = "";
|
2717
|
-
if (type === void 0 || typeof type === "object" && type !== null && Object.keys(type).length === 0) {
|
2718
|
-
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.";
|
2719
|
-
}
|
2720
|
-
var sourceInfo = getSourceInfoErrorAddendum(source);
|
2721
|
-
if (sourceInfo) {
|
2722
|
-
info += sourceInfo;
|
2723
|
-
} else {
|
2724
|
-
info += getDeclarationErrorAddendum();
|
2725
|
-
}
|
2726
|
-
var typeString;
|
2727
|
-
if (type === null) {
|
2728
|
-
typeString = "null";
|
2729
|
-
} else if (isArray(type)) {
|
2730
|
-
typeString = "array";
|
2731
|
-
} else if (type !== void 0 && type.$$typeof === REACT_ELEMENT_TYPE) {
|
2732
|
-
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
2733
|
-
info = " Did you accidentally export a JSX literal instead of a component?";
|
2734
|
-
} else {
|
2735
|
-
typeString = typeof type;
|
2736
|
-
}
|
2737
|
-
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);
|
2738
|
-
}
|
2739
|
-
var element = jsxDEV(type, props, key, source, self);
|
2740
|
-
if (element == null) {
|
2741
|
-
return element;
|
2742
|
-
}
|
2743
|
-
if (validType) {
|
2744
|
-
var children = props.children;
|
2745
|
-
if (children !== void 0) {
|
2746
|
-
if (isStaticChildren) {
|
2747
|
-
if (isArray(children)) {
|
2748
|
-
for (var i = 0; i < children.length; i++) {
|
2749
|
-
validateChildKeys(children[i], type);
|
2750
|
-
}
|
2751
|
-
if (Object.freeze) {
|
2752
|
-
Object.freeze(children);
|
2753
|
-
}
|
2754
|
-
} else {
|
2755
|
-
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.");
|
2756
|
-
}
|
2757
|
-
} else {
|
2758
|
-
validateChildKeys(children, type);
|
2759
|
-
}
|
2760
|
-
}
|
2761
|
-
}
|
2762
|
-
if (type === REACT_FRAGMENT_TYPE) {
|
2763
|
-
validateFragmentProps(element);
|
2764
|
-
} else {
|
2765
|
-
validatePropTypes(element);
|
2766
|
-
}
|
2767
|
-
return element;
|
2768
|
-
}
|
2769
|
-
}
|
2770
|
-
function jsxWithValidationStatic(type, props, key) {
|
2771
|
-
{
|
2772
|
-
return jsxWithValidation(type, props, key, true);
|
2773
|
-
}
|
2774
|
-
}
|
2775
|
-
function jsxWithValidationDynamic(type, props, key) {
|
2776
|
-
{
|
2777
|
-
return jsxWithValidation(type, props, key, false);
|
2778
|
-
}
|
2779
|
-
}
|
2780
|
-
var jsx2 = jsxWithValidationDynamic;
|
2781
|
-
var jsxs = jsxWithValidationStatic;
|
2782
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
2783
|
-
exports.jsx = jsx2;
|
2784
|
-
exports.jsxs = jsxs;
|
2785
|
-
})();
|
2786
|
-
}
|
2787
|
-
}
|
2788
|
-
});
|
2789
|
-
|
2790
|
-
// node_modules/react/jsx-runtime.js
|
2791
|
-
var require_jsx_runtime = __commonJS({
|
2792
|
-
"node_modules/react/jsx-runtime.js"(exports, module) {
|
2793
|
-
"use strict";
|
2794
|
-
if (false) {
|
2795
|
-
module.exports = null;
|
2796
|
-
} else {
|
2797
|
-
module.exports = require_react_jsx_runtime_development();
|
2798
|
-
}
|
2799
|
-
}
|
2800
|
-
});
|
2801
|
-
|
2802
1
|
// node_modules/@schematichq/schematic-js/dist/schematic.esm.js
|
2803
2
|
var getRandomValues;
|
2804
3
|
var rnds8 = new Uint8Array(16);
|
@@ -2843,6 +42,8 @@ var v4_default = v4;
|
|
2843
42
|
var anonymousIdKey = "schematicId";
|
2844
43
|
var Schematic = class {
|
2845
44
|
apiKey;
|
45
|
+
apiUrl = "api.schematichq.com";
|
46
|
+
eventUrl = "c.schematichq.com";
|
2846
47
|
conn = null;
|
2847
48
|
context = {};
|
2848
49
|
eventQueue;
|
@@ -2860,6 +61,12 @@ var Schematic = class {
|
|
2860
61
|
} else if (typeof localStorage !== "undefined") {
|
2861
62
|
this.storage = localStorage;
|
2862
63
|
}
|
64
|
+
if (options?.apiUrl !== void 0) {
|
65
|
+
this.apiUrl = options.apiUrl;
|
66
|
+
}
|
67
|
+
if (options?.eventUrl !== void 0) {
|
68
|
+
this.eventUrl = options.eventUrl;
|
69
|
+
}
|
2863
70
|
if (typeof window !== "undefined") {
|
2864
71
|
window.addEventListener("beforeunload", () => {
|
2865
72
|
this.flushEventQueue();
|
@@ -2873,7 +80,7 @@ var Schematic = class {
|
|
2873
80
|
const contextVals = this.values[contextString(context)] ?? {};
|
2874
81
|
return typeof contextVals[key] === "undefined" ? fallback : contextVals[key];
|
2875
82
|
}
|
2876
|
-
const requestUrl =
|
83
|
+
const requestUrl = this.getUrl(this.apiUrl, `flags/${key}/check`);
|
2877
84
|
return fetch(requestUrl, {
|
2878
85
|
method: "POST",
|
2879
86
|
headers: {
|
@@ -2896,7 +103,7 @@ var Schematic = class {
|
|
2896
103
|
// Make a REST API call to fetch all flag values for a given context
|
2897
104
|
checkFlags = async (context) => {
|
2898
105
|
context = context || this.context;
|
2899
|
-
const requestUrl =
|
106
|
+
const requestUrl = this.getUrl(this.apiUrl, "flags/check");
|
2900
107
|
const requestBody = JSON.stringify(context);
|
2901
108
|
return fetch(requestUrl, {
|
2902
109
|
method: "POST",
|
@@ -2952,6 +159,16 @@ var Schematic = class {
|
|
2952
159
|
track = (body) => {
|
2953
160
|
this.handleEvent("track", body);
|
2954
161
|
};
|
162
|
+
getUrl = (domain, path, urlType) => {
|
163
|
+
let scheme = "http";
|
164
|
+
if (urlType === "ws") {
|
165
|
+
scheme = "ws";
|
166
|
+
}
|
167
|
+
if (typeof window === "undefined" || window.location.protocol === "https:") {
|
168
|
+
return `${scheme}s://${domain}/${path}`;
|
169
|
+
}
|
170
|
+
return `${scheme}://${domain}/${path}`;
|
171
|
+
};
|
2955
172
|
flushEventQueue = () => {
|
2956
173
|
while (this.eventQueue.length > 0) {
|
2957
174
|
const event = this.eventQueue.shift();
|
@@ -2988,7 +205,7 @@ var Schematic = class {
|
|
2988
205
|
}
|
2989
206
|
};
|
2990
207
|
sendEvent = (event) => {
|
2991
|
-
const captureUrl =
|
208
|
+
const captureUrl = this.getUrl(this.apiUrl, "e");
|
2992
209
|
const payload = JSON.stringify(event);
|
2993
210
|
fetch(captureUrl, {
|
2994
211
|
method: "POST",
|
@@ -3014,7 +231,7 @@ var Schematic = class {
|
|
3014
231
|
if (this.conn) {
|
3015
232
|
resolve();
|
3016
233
|
}
|
3017
|
-
const wsUrl =
|
234
|
+
const wsUrl = this.getUrl(this.apiUrl, "flags/bootstrap", "ws");
|
3018
235
|
const webSocket = new WebSocket(wsUrl);
|
3019
236
|
this.conn = webSocket;
|
3020
237
|
webSocket.onopen = () => {
|
@@ -3090,18 +307,23 @@ function contextString(context) {
|
|
3090
307
|
}
|
3091
308
|
|
3092
309
|
// src/index.tsx
|
3093
|
-
|
3094
|
-
|
3095
|
-
|
310
|
+
import {
|
311
|
+
createContext,
|
312
|
+
useContext,
|
313
|
+
useEffect,
|
314
|
+
useState
|
315
|
+
} from "react";
|
316
|
+
import { jsx } from "react/jsx-runtime";
|
317
|
+
var SchematicContext = createContext({
|
3096
318
|
flagValues: {}
|
3097
319
|
});
|
3098
320
|
var SchematicProvider = ({
|
3099
321
|
publishableKey,
|
3100
322
|
children
|
3101
323
|
}) => {
|
3102
|
-
const [client, setClient] =
|
3103
|
-
const [flagValues, setFlagValues] =
|
3104
|
-
|
324
|
+
const [client, setClient] = useState();
|
325
|
+
const [flagValues, setFlagValues] = useState({});
|
326
|
+
useEffect(() => {
|
3105
327
|
if (publishableKey === void 0) {
|
3106
328
|
return;
|
3107
329
|
}
|
@@ -3116,9 +338,9 @@ var SchematicProvider = ({
|
|
3116
338
|
client,
|
3117
339
|
flagValues
|
3118
340
|
};
|
3119
|
-
return /* @__PURE__ */
|
341
|
+
return /* @__PURE__ */ jsx(SchematicContext.Provider, { value: contextValue, children });
|
3120
342
|
};
|
3121
|
-
var useSchematic = () =>
|
343
|
+
var useSchematic = () => useContext(SchematicContext);
|
3122
344
|
var useSchematicContext = () => {
|
3123
345
|
const { client } = useSchematic();
|
3124
346
|
const { setContext } = client ?? {};
|
@@ -3131,9 +353,9 @@ var useSchematicEvents = () => {
|
|
3131
353
|
};
|
3132
354
|
var useSchematicFlag = (key, fallback) => {
|
3133
355
|
const { flagValues } = useSchematic();
|
3134
|
-
const [value, setValue] =
|
356
|
+
const [value, setValue] = useState(fallback ?? false);
|
3135
357
|
const flagValue = flagValues[key];
|
3136
|
-
|
358
|
+
useEffect(() => {
|
3137
359
|
typeof flagValue === "undefined" ? setValue(fallback ?? false) : setValue(flagValue);
|
3138
360
|
}, [key, fallback, flagValue]);
|
3139
361
|
return value;
|
@@ -3147,28 +369,6 @@ export {
|
|
3147
369
|
};
|
3148
370
|
/*! Bundled license information:
|
3149
371
|
|
3150
|
-
react/cjs/react.development.js:
|
3151
|
-
(**
|
3152
|
-
* @license React
|
3153
|
-
* react.development.js
|
3154
|
-
*
|
3155
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
3156
|
-
*
|
3157
|
-
* This source code is licensed under the MIT license found in the
|
3158
|
-
* LICENSE file in the root directory of this source tree.
|
3159
|
-
*)
|
3160
|
-
|
3161
|
-
react/cjs/react-jsx-runtime.development.js:
|
3162
|
-
(**
|
3163
|
-
* @license React
|
3164
|
-
* react-jsx-runtime.development.js
|
3165
|
-
*
|
3166
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
3167
|
-
*
|
3168
|
-
* This source code is licensed under the MIT license found in the
|
3169
|
-
* LICENSE file in the root directory of this source tree.
|
3170
|
-
*)
|
3171
|
-
|
3172
372
|
@schematichq/schematic-js/dist/schematic.esm.js:
|
3173
373
|
(* @preserve *)
|
3174
374
|
*/
|