@bcrumbs.net/bc-shared 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.esm.js +37 -2853
  2. package/package.json +6 -7
package/index.esm.js CHANGED
@@ -1,23 +1,10 @@
1
1
  import * as ReactJSXRuntime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import React__default, { forwardRef, useContext, Component } from 'react';
2
4
  import i18n from 'i18next';
3
5
  import { initReactI18next } from 'react-i18next';
4
6
  import Backend from 'i18next-http-backend';
5
7
 
6
- function _mergeNamespaces(n, m) {
7
- m.forEach(function (e) {
8
- e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
9
- if (k !== 'default' && !(k in n)) {
10
- var d = Object.getOwnPropertyDescriptor(e, k);
11
- Object.defineProperty(n, k, d.get ? d : {
12
- enumerable: true,
13
- get: function () { return e[k]; }
14
- });
15
- }
16
- });
17
- });
18
- return Object.freeze(n);
19
- }
20
-
21
8
  const Dashboard = '/dashboard';
22
9
  const AccountPortalRoot = '/account';
23
10
  const ShowcasePortalRoot = '/showcase';
@@ -1193,2809 +1180,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
1193
1180
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
1194
1181
  };
1195
1182
 
1196
- var react = {exports: {}};
1197
-
1198
- var react_production_min = {};
1199
-
1200
- /**
1201
- * @license React
1202
- * react.production.min.js
1203
- *
1204
- * Copyright (c) Facebook, Inc. and its affiliates.
1205
- *
1206
- * This source code is licensed under the MIT license found in the
1207
- * LICENSE file in the root directory of this source tree.
1208
- */
1209
-
1210
- var hasRequiredReact_production_min;
1211
-
1212
- function requireReact_production_min () {
1213
- if (hasRequiredReact_production_min) return react_production_min;
1214
- hasRequiredReact_production_min = 1;
1215
- var l=Symbol.for("react.element"),n=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),t=Symbol.for("react.provider"),u=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),z=Symbol.iterator;function A(a){if(null===a||"object"!==typeof a)return null;a=z&&a[z]||a["@@iterator"];return "function"===typeof a?a:null}
1216
- var B={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B;}E.prototype.isReactComponent={};
1217
- E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,a,b,"setState");};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B;}var H=G.prototype=new F;
1218
- H.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};
1219
- function M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f;}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return {$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}
1220
- function N(a,b){return {$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return "object"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\/+/g;function Q(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
1221
- function R(a,b,e,d,c){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case l:case n:h=!0;}}if(h)return h=a,c=c(h),a=""===d?"."+Q(h,0):d,I(c)?(e="",null!=a&&(e=a.replace(P,"$&/")+"/"),R(c,b,e,"",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?"":(""+c.key).replace(P,"$&/")+"/")+a)),b.push(c)),1;h=0;d=""===d?".":d+":";if(I(a))for(var g=0;g<a.length;g++){k=
1222
- a[g];var f=d+Q(k,g);h+=R(k,b,e,f,c);}else if(f=A(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if("object"===k)throw b=String(a),Error("Objects are not valid as a React child (found: "+("[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b)+"). If you meant to render a collection of children, use an array instead.");return h}
1223
- function S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,"","",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b;},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b;});-1===a._status&&(a._status=0,a._result=b);}if(1===a._status)return a._result.default;throw a._result;}
1224
- var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error("act(...) is not supported in production builds of React.");}
1225
- react_production_min.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments);},e);},count:function(a){var b=0;S(a,function(){b++;});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error("React.Children.only expected to receive a single React element child.");return a}};react_production_min.Component=E;react_production_min.Fragment=p;react_production_min.Profiler=r;react_production_min.PureComponent=G;react_production_min.StrictMode=q;react_production_min.Suspense=w;
1226
- react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;react_production_min.act=X;
1227
- react_production_min.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+a+".");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);
1228
- for(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g;}return {$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};react_production_min.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};react_production_min.createElement=M;react_production_min.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};
1229
- react_production_min.forwardRef=function(a){return {$$typeof:v,render:a}};react_production_min.isValidElement=O;react_production_min.lazy=function(a){return {$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};react_production_min.memo=function(a,b){return {$$typeof:x,type:a,compare:void 0===b?null:b}};react_production_min.startTransition=function(a){var b=V.transition;V.transition={};try{a();}finally{V.transition=b;}};react_production_min.unstable_act=X;react_production_min.useCallback=function(a,b){return U.current.useCallback(a,b)};react_production_min.useContext=function(a){return U.current.useContext(a)};
1230
- react_production_min.useDebugValue=function(){};react_production_min.useDeferredValue=function(a){return U.current.useDeferredValue(a)};react_production_min.useEffect=function(a,b){return U.current.useEffect(a,b)};react_production_min.useId=function(){return U.current.useId()};react_production_min.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};react_production_min.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};react_production_min.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};
1231
- react_production_min.useMemo=function(a,b){return U.current.useMemo(a,b)};react_production_min.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};react_production_min.useRef=function(a){return U.current.useRef(a)};react_production_min.useState=function(a){return U.current.useState(a)};react_production_min.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};react_production_min.useTransition=function(){return U.current.useTransition()};react_production_min.version="18.3.1";
1232
- return react_production_min;
1233
- }
1234
-
1235
- var react_development = {exports: {}};
1236
-
1237
- /**
1238
- * @license React
1239
- * react.development.js
1240
- *
1241
- * Copyright (c) Facebook, Inc. and its affiliates.
1242
- *
1243
- * This source code is licensed under the MIT license found in the
1244
- * LICENSE file in the root directory of this source tree.
1245
- */
1246
- react_development.exports;
1247
-
1248
- var hasRequiredReact_development;
1249
-
1250
- function requireReact_development () {
1251
- if (hasRequiredReact_development) return react_development.exports;
1252
- hasRequiredReact_development = 1;
1253
- (function (module, exports) {
1254
-
1255
- if (process.env.NODE_ENV !== "production") {
1256
- (function() {
1257
-
1258
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
1259
- if (
1260
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
1261
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
1262
- 'function'
1263
- ) {
1264
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
1265
- }
1266
- var ReactVersion = '18.3.1';
1267
-
1268
- // ATTENTION
1269
- // When adding new symbols to this file,
1270
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
1271
- // The Symbol used to tag the ReactElement-like types.
1272
- var REACT_ELEMENT_TYPE = Symbol.for('react.element');
1273
- var REACT_PORTAL_TYPE = Symbol.for('react.portal');
1274
- var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
1275
- var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
1276
- var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
1277
- var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
1278
- var REACT_CONTEXT_TYPE = Symbol.for('react.context');
1279
- var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
1280
- var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
1281
- var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
1282
- var REACT_MEMO_TYPE = Symbol.for('react.memo');
1283
- var REACT_LAZY_TYPE = Symbol.for('react.lazy');
1284
- var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
1285
- var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
1286
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
1287
- function getIteratorFn(maybeIterable) {
1288
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
1289
- return null;
1290
- }
1291
-
1292
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1293
-
1294
- if (typeof maybeIterator === 'function') {
1295
- return maybeIterator;
1296
- }
1297
-
1298
- return null;
1299
- }
1300
-
1301
- /**
1302
- * Keeps track of the current dispatcher.
1303
- */
1304
- var ReactCurrentDispatcher = {
1305
- /**
1306
- * @internal
1307
- * @type {ReactComponent}
1308
- */
1309
- current: null
1310
- };
1311
-
1312
- /**
1313
- * Keeps track of the current batch's configuration such as how long an update
1314
- * should suspend for if it needs to.
1315
- */
1316
- var ReactCurrentBatchConfig = {
1317
- transition: null
1318
- };
1319
-
1320
- var ReactCurrentActQueue = {
1321
- current: null,
1322
- // Used to reproduce behavior of `batchedUpdates` in legacy mode.
1323
- isBatchingLegacy: false,
1324
- didScheduleLegacyUpdate: false
1325
- };
1326
-
1327
- /**
1328
- * Keeps track of the current owner.
1329
- *
1330
- * The current owner is the component who should own any components that are
1331
- * currently being constructed.
1332
- */
1333
- var ReactCurrentOwner = {
1334
- /**
1335
- * @internal
1336
- * @type {ReactComponent}
1337
- */
1338
- current: null
1339
- };
1340
-
1341
- var ReactDebugCurrentFrame = {};
1342
- var currentExtraStackFrame = null;
1343
- function setExtraStackFrame(stack) {
1344
- {
1345
- currentExtraStackFrame = stack;
1346
- }
1347
- }
1348
-
1349
- {
1350
- ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
1351
- {
1352
- currentExtraStackFrame = stack;
1353
- }
1354
- }; // Stack implementation injected by the current renderer.
1355
-
1356
-
1357
- ReactDebugCurrentFrame.getCurrentStack = null;
1358
-
1359
- ReactDebugCurrentFrame.getStackAddendum = function () {
1360
- var stack = ''; // Add an extra top frame while an element is being validated
1361
-
1362
- if (currentExtraStackFrame) {
1363
- stack += currentExtraStackFrame;
1364
- } // Delegate to the injected renderer-specific implementation
1365
-
1366
-
1367
- var impl = ReactDebugCurrentFrame.getCurrentStack;
1368
-
1369
- if (impl) {
1370
- stack += impl() || '';
1371
- }
1372
-
1373
- return stack;
1374
- };
1375
- }
1376
-
1377
- // -----------------------------------------------------------------------------
1378
-
1379
- var enableScopeAPI = false; // Experimental Create Event Handle API.
1380
- var enableCacheElement = false;
1381
- var enableTransitionTracing = false; // No known bugs, but needs performance testing
1382
-
1383
- var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
1384
- // stuff. Intended to enable React core members to more easily debug scheduling
1385
- // issues in DEV builds.
1386
-
1387
- var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
1388
-
1389
- var ReactSharedInternals = {
1390
- ReactCurrentDispatcher: ReactCurrentDispatcher,
1391
- ReactCurrentBatchConfig: ReactCurrentBatchConfig,
1392
- ReactCurrentOwner: ReactCurrentOwner
1393
- };
1394
-
1395
- {
1396
- ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
1397
- ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
1398
- }
1399
-
1400
- // by calls to these methods by a Babel plugin.
1401
- //
1402
- // In PROD (or in packages without access to React internals),
1403
- // they are left as they are instead.
1404
-
1405
- function warn(format) {
1406
- {
1407
- {
1408
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1409
- args[_key - 1] = arguments[_key];
1410
- }
1411
-
1412
- printWarning('warn', format, args);
1413
- }
1414
- }
1415
- }
1416
- function error(format) {
1417
- {
1418
- {
1419
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1420
- args[_key2 - 1] = arguments[_key2];
1421
- }
1422
-
1423
- printWarning('error', format, args);
1424
- }
1425
- }
1426
- }
1427
-
1428
- function printWarning(level, format, args) {
1429
- // When changing this logic, you might want to also
1430
- // update consoleWithStackDev.www.js as well.
1431
- {
1432
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1433
- var stack = ReactDebugCurrentFrame.getStackAddendum();
1434
-
1435
- if (stack !== '') {
1436
- format += '%s';
1437
- args = args.concat([stack]);
1438
- } // eslint-disable-next-line react-internal/safe-string-coercion
1439
-
1440
-
1441
- var argsWithFormat = args.map(function (item) {
1442
- return String(item);
1443
- }); // Careful: RN currently depends on this prefix
1444
-
1445
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
1446
- // breaks IE9: https://github.com/facebook/react/issues/13610
1447
- // eslint-disable-next-line react-internal/no-production-logging
1448
-
1449
- Function.prototype.apply.call(console[level], console, argsWithFormat);
1450
- }
1451
- }
1452
-
1453
- var didWarnStateUpdateForUnmountedComponent = {};
1454
-
1455
- function warnNoop(publicInstance, callerName) {
1456
- {
1457
- var _constructor = publicInstance.constructor;
1458
- var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
1459
- var warningKey = componentName + "." + callerName;
1460
-
1461
- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
1462
- return;
1463
- }
1464
-
1465
- 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);
1466
-
1467
- didWarnStateUpdateForUnmountedComponent[warningKey] = true;
1468
- }
1469
- }
1470
- /**
1471
- * This is the abstract API for an update queue.
1472
- */
1473
-
1474
-
1475
- var ReactNoopUpdateQueue = {
1476
- /**
1477
- * Checks whether or not this composite component is mounted.
1478
- * @param {ReactClass} publicInstance The instance we want to test.
1479
- * @return {boolean} True if mounted, false otherwise.
1480
- * @protected
1481
- * @final
1482
- */
1483
- isMounted: function (publicInstance) {
1484
- return false;
1485
- },
1486
-
1487
- /**
1488
- * Forces an update. This should only be invoked when it is known with
1489
- * certainty that we are **not** in a DOM transaction.
1490
- *
1491
- * You may want to call this when you know that some deeper aspect of the
1492
- * component's state has changed but `setState` was not called.
1493
- *
1494
- * This will not invoke `shouldComponentUpdate`, but it will invoke
1495
- * `componentWillUpdate` and `componentDidUpdate`.
1496
- *
1497
- * @param {ReactClass} publicInstance The instance that should rerender.
1498
- * @param {?function} callback Called after component is updated.
1499
- * @param {?string} callerName name of the calling function in the public API.
1500
- * @internal
1501
- */
1502
- enqueueForceUpdate: function (publicInstance, callback, callerName) {
1503
- warnNoop(publicInstance, 'forceUpdate');
1504
- },
1505
-
1506
- /**
1507
- * Replaces all of the state. Always use this or `setState` to mutate state.
1508
- * You should treat `this.state` as immutable.
1509
- *
1510
- * There is no guarantee that `this.state` will be immediately updated, so
1511
- * accessing `this.state` after calling this method may return the old value.
1512
- *
1513
- * @param {ReactClass} publicInstance The instance that should rerender.
1514
- * @param {object} completeState Next state.
1515
- * @param {?function} callback Called after component is updated.
1516
- * @param {?string} callerName name of the calling function in the public API.
1517
- * @internal
1518
- */
1519
- enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
1520
- warnNoop(publicInstance, 'replaceState');
1521
- },
1522
-
1523
- /**
1524
- * Sets a subset of the state. This only exists because _pendingState is
1525
- * internal. This provides a merging strategy that is not available to deep
1526
- * properties which is confusing. TODO: Expose pendingState or don't use it
1527
- * during the merge.
1528
- *
1529
- * @param {ReactClass} publicInstance The instance that should rerender.
1530
- * @param {object} partialState Next partial state to be merged with state.
1531
- * @param {?function} callback Called after component is updated.
1532
- * @param {?string} Name of the calling function in the public API.
1533
- * @internal
1534
- */
1535
- enqueueSetState: function (publicInstance, partialState, callback, callerName) {
1536
- warnNoop(publicInstance, 'setState');
1537
- }
1538
- };
1539
-
1540
- var assign = Object.assign;
1541
-
1542
- var emptyObject = {};
1543
-
1544
- {
1545
- Object.freeze(emptyObject);
1546
- }
1547
- /**
1548
- * Base class helpers for the updating state of a component.
1549
- */
1550
-
1551
-
1552
- function Component(props, context, updater) {
1553
- this.props = props;
1554
- this.context = context; // If a component has string refs, we will assign a different object later.
1555
-
1556
- this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
1557
- // renderer.
1558
-
1559
- this.updater = updater || ReactNoopUpdateQueue;
1560
- }
1561
-
1562
- Component.prototype.isReactComponent = {};
1563
- /**
1564
- * Sets a subset of the state. Always use this to mutate
1565
- * state. You should treat `this.state` as immutable.
1566
- *
1567
- * There is no guarantee that `this.state` will be immediately updated, so
1568
- * accessing `this.state` after calling this method may return the old value.
1569
- *
1570
- * There is no guarantee that calls to `setState` will run synchronously,
1571
- * as they may eventually be batched together. You can provide an optional
1572
- * callback that will be executed when the call to setState is actually
1573
- * completed.
1574
- *
1575
- * When a function is provided to setState, it will be called at some point in
1576
- * the future (not synchronously). It will be called with the up to date
1577
- * component arguments (state, props, context). These values can be different
1578
- * from this.* because your function may be called after receiveProps but before
1579
- * shouldComponentUpdate, and this new state, props, and context will not yet be
1580
- * assigned to this.
1581
- *
1582
- * @param {object|function} partialState Next partial state or function to
1583
- * produce next partial state to be merged with current state.
1584
- * @param {?function} callback Called after state is updated.
1585
- * @final
1586
- * @protected
1587
- */
1588
-
1589
- Component.prototype.setState = function (partialState, callback) {
1590
- if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
1591
- throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
1592
- }
1593
-
1594
- this.updater.enqueueSetState(this, partialState, callback, 'setState');
1595
- };
1596
- /**
1597
- * Forces an update. This should only be invoked when it is known with
1598
- * certainty that we are **not** in a DOM transaction.
1599
- *
1600
- * You may want to call this when you know that some deeper aspect of the
1601
- * component's state has changed but `setState` was not called.
1602
- *
1603
- * This will not invoke `shouldComponentUpdate`, but it will invoke
1604
- * `componentWillUpdate` and `componentDidUpdate`.
1605
- *
1606
- * @param {?function} callback Called after update is complete.
1607
- * @final
1608
- * @protected
1609
- */
1610
-
1611
-
1612
- Component.prototype.forceUpdate = function (callback) {
1613
- this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
1614
- };
1615
- /**
1616
- * Deprecated APIs. These APIs used to exist on classic React classes but since
1617
- * we would like to deprecate them, we're not going to move them over to this
1618
- * modern base class. Instead, we define a getter that warns if it's accessed.
1619
- */
1620
-
1621
-
1622
- {
1623
- var deprecatedAPIs = {
1624
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
1625
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
1626
- };
1627
-
1628
- var defineDeprecationWarning = function (methodName, info) {
1629
- Object.defineProperty(Component.prototype, methodName, {
1630
- get: function () {
1631
- warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
1632
-
1633
- return undefined;
1634
- }
1635
- });
1636
- };
1637
-
1638
- for (var fnName in deprecatedAPIs) {
1639
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
1640
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1641
- }
1642
- }
1643
- }
1644
-
1645
- function ComponentDummy() {}
1646
-
1647
- ComponentDummy.prototype = Component.prototype;
1648
- /**
1649
- * Convenience component with default shallow equality check for sCU.
1650
- */
1651
-
1652
- function PureComponent(props, context, updater) {
1653
- this.props = props;
1654
- this.context = context; // If a component has string refs, we will assign a different object later.
1655
-
1656
- this.refs = emptyObject;
1657
- this.updater = updater || ReactNoopUpdateQueue;
1658
- }
1659
-
1660
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
1661
- pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
1662
-
1663
- assign(pureComponentPrototype, Component.prototype);
1664
- pureComponentPrototype.isPureReactComponent = true;
1665
-
1666
- // an immutable object with a single mutable value
1667
- function createRef() {
1668
- var refObject = {
1669
- current: null
1670
- };
1671
-
1672
- {
1673
- Object.seal(refObject);
1674
- }
1675
-
1676
- return refObject;
1677
- }
1678
-
1679
- var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
1680
-
1681
- function isArray(a) {
1682
- return isArrayImpl(a);
1683
- }
1684
-
1685
- /*
1686
- * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
1687
- * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
1688
- *
1689
- * The functions in this module will throw an easier-to-understand,
1690
- * easier-to-debug exception with a clear errors message message explaining the
1691
- * problem. (Instead of a confusing exception thrown inside the implementation
1692
- * of the `value` object).
1693
- */
1694
- // $FlowFixMe only called in DEV, so void return is not possible.
1695
- function typeName(value) {
1696
- {
1697
- // toStringTag is needed for namespaced types like Temporal.Instant
1698
- var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
1699
- var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
1700
- return type;
1701
- }
1702
- } // $FlowFixMe only called in DEV, so void return is not possible.
1703
-
1704
-
1705
- function willCoercionThrow(value) {
1706
- {
1707
- try {
1708
- testStringCoercion(value);
1709
- return false;
1710
- } catch (e) {
1711
- return true;
1712
- }
1713
- }
1714
- }
1715
-
1716
- function testStringCoercion(value) {
1717
- // If you ended up here by following an exception call stack, here's what's
1718
- // happened: you supplied an object or symbol value to React (as a prop, key,
1719
- // DOM attribute, CSS property, string ref, etc.) and when React tried to
1720
- // coerce it to a string using `'' + value`, an exception was thrown.
1721
- //
1722
- // The most common types that will cause this exception are `Symbol` instances
1723
- // and Temporal objects like `Temporal.Instant`. But any object that has a
1724
- // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
1725
- // exception. (Library authors do this to prevent users from using built-in
1726
- // numeric operators like `+` or comparison operators like `>=` because custom
1727
- // methods are needed to perform accurate arithmetic or comparison.)
1728
- //
1729
- // To fix the problem, coerce this object or symbol value to a string before
1730
- // passing it to React. The most reliable way is usually `String(value)`.
1731
- //
1732
- // To find which value is throwing, check the browser or debugger console.
1733
- // Before this exception was thrown, there should be `console.error` output
1734
- // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
1735
- // problem and how that type was used: key, atrribute, input value prop, etc.
1736
- // In most cases, this console output also shows the component and its
1737
- // ancestor components where the exception happened.
1738
- //
1739
- // eslint-disable-next-line react-internal/safe-string-coercion
1740
- return '' + value;
1741
- }
1742
- function checkKeyStringCoercion(value) {
1743
- {
1744
- if (willCoercionThrow(value)) {
1745
- error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
1746
-
1747
- return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
1748
- }
1749
- }
1750
- }
1751
-
1752
- function getWrappedName(outerType, innerType, wrapperName) {
1753
- var displayName = outerType.displayName;
1754
-
1755
- if (displayName) {
1756
- return displayName;
1757
- }
1758
-
1759
- var functionName = innerType.displayName || innerType.name || '';
1760
- return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
1761
- } // Keep in sync with react-reconciler/getComponentNameFromFiber
1762
-
1763
-
1764
- function getContextName(type) {
1765
- return type.displayName || 'Context';
1766
- } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
1767
-
1768
-
1769
- function getComponentNameFromType(type) {
1770
- if (type == null) {
1771
- // Host root, text node or just invalid type.
1772
- return null;
1773
- }
1774
-
1775
- {
1776
- if (typeof type.tag === 'number') {
1777
- error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
1778
- }
1779
- }
1780
-
1781
- if (typeof type === 'function') {
1782
- return type.displayName || type.name || null;
1783
- }
1784
-
1785
- if (typeof type === 'string') {
1786
- return type;
1787
- }
1788
-
1789
- switch (type) {
1790
- case REACT_FRAGMENT_TYPE:
1791
- return 'Fragment';
1792
-
1793
- case REACT_PORTAL_TYPE:
1794
- return 'Portal';
1795
-
1796
- case REACT_PROFILER_TYPE:
1797
- return 'Profiler';
1798
-
1799
- case REACT_STRICT_MODE_TYPE:
1800
- return 'StrictMode';
1801
-
1802
- case REACT_SUSPENSE_TYPE:
1803
- return 'Suspense';
1804
-
1805
- case REACT_SUSPENSE_LIST_TYPE:
1806
- return 'SuspenseList';
1807
-
1808
- }
1809
-
1810
- if (typeof type === 'object') {
1811
- switch (type.$$typeof) {
1812
- case REACT_CONTEXT_TYPE:
1813
- var context = type;
1814
- return getContextName(context) + '.Consumer';
1815
-
1816
- case REACT_PROVIDER_TYPE:
1817
- var provider = type;
1818
- return getContextName(provider._context) + '.Provider';
1819
-
1820
- case REACT_FORWARD_REF_TYPE:
1821
- return getWrappedName(type, type.render, 'ForwardRef');
1822
-
1823
- case REACT_MEMO_TYPE:
1824
- var outerName = type.displayName || null;
1825
-
1826
- if (outerName !== null) {
1827
- return outerName;
1828
- }
1829
-
1830
- return getComponentNameFromType(type.type) || 'Memo';
1831
-
1832
- case REACT_LAZY_TYPE:
1833
- {
1834
- var lazyComponent = type;
1835
- var payload = lazyComponent._payload;
1836
- var init = lazyComponent._init;
1837
-
1838
- try {
1839
- return getComponentNameFromType(init(payload));
1840
- } catch (x) {
1841
- return null;
1842
- }
1843
- }
1844
-
1845
- // eslint-disable-next-line no-fallthrough
1846
- }
1847
- }
1848
-
1849
- return null;
1850
- }
1851
-
1852
- var hasOwnProperty = Object.prototype.hasOwnProperty;
1853
-
1854
- var RESERVED_PROPS = {
1855
- key: true,
1856
- ref: true,
1857
- __self: true,
1858
- __source: true
1859
- };
1860
- var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
1861
-
1862
- {
1863
- didWarnAboutStringRefs = {};
1864
- }
1865
-
1866
- function hasValidRef(config) {
1867
- {
1868
- if (hasOwnProperty.call(config, 'ref')) {
1869
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1870
-
1871
- if (getter && getter.isReactWarning) {
1872
- return false;
1873
- }
1874
- }
1875
- }
1876
-
1877
- return config.ref !== undefined;
1878
- }
1879
-
1880
- function hasValidKey(config) {
1881
- {
1882
- if (hasOwnProperty.call(config, 'key')) {
1883
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1884
-
1885
- if (getter && getter.isReactWarning) {
1886
- return false;
1887
- }
1888
- }
1889
- }
1890
-
1891
- return config.key !== undefined;
1892
- }
1893
-
1894
- function defineKeyPropWarningGetter(props, displayName) {
1895
- var warnAboutAccessingKey = function () {
1896
- {
1897
- if (!specialPropKeyWarningShown) {
1898
- specialPropKeyWarningShown = true;
1899
-
1900
- 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);
1901
- }
1902
- }
1903
- };
1904
-
1905
- warnAboutAccessingKey.isReactWarning = true;
1906
- Object.defineProperty(props, 'key', {
1907
- get: warnAboutAccessingKey,
1908
- configurable: true
1909
- });
1910
- }
1911
-
1912
- function defineRefPropWarningGetter(props, displayName) {
1913
- var warnAboutAccessingRef = function () {
1914
- {
1915
- if (!specialPropRefWarningShown) {
1916
- specialPropRefWarningShown = true;
1917
-
1918
- 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);
1919
- }
1920
- }
1921
- };
1922
-
1923
- warnAboutAccessingRef.isReactWarning = true;
1924
- Object.defineProperty(props, 'ref', {
1925
- get: warnAboutAccessingRef,
1926
- configurable: true
1927
- });
1928
- }
1929
-
1930
- function warnIfStringRefCannotBeAutoConverted(config) {
1931
- {
1932
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
1933
- var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
1934
-
1935
- if (!didWarnAboutStringRefs[componentName]) {
1936
- 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);
1937
-
1938
- didWarnAboutStringRefs[componentName] = true;
1939
- }
1940
- }
1941
- }
1942
- }
1943
- /**
1944
- * Factory method to create a new React element. This no longer adheres to
1945
- * the class pattern, so do not use new to call it. Also, instanceof check
1946
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
1947
- * if something is a React Element.
1948
- *
1949
- * @param {*} type
1950
- * @param {*} props
1951
- * @param {*} key
1952
- * @param {string|object} ref
1953
- * @param {*} owner
1954
- * @param {*} self A *temporary* helper to detect places where `this` is
1955
- * different from the `owner` when React.createElement is called, so that we
1956
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
1957
- * functions, and as long as `this` and owner are the same, there will be no
1958
- * change in behavior.
1959
- * @param {*} source An annotation object (added by a transpiler or otherwise)
1960
- * indicating filename, line number, and/or other information.
1961
- * @internal
1962
- */
1963
-
1964
-
1965
- var ReactElement = function (type, key, ref, self, source, owner, props) {
1966
- var element = {
1967
- // This tag allows us to uniquely identify this as a React Element
1968
- $$typeof: REACT_ELEMENT_TYPE,
1969
- // Built-in properties that belong on the element
1970
- type: type,
1971
- key: key,
1972
- ref: ref,
1973
- props: props,
1974
- // Record the component responsible for creating this element.
1975
- _owner: owner
1976
- };
1977
-
1978
- {
1979
- // The validation flag is currently mutative. We put it on
1980
- // an external backing store so that we can freeze the whole object.
1981
- // This can be replaced with a WeakMap once they are implemented in
1982
- // commonly used development environments.
1983
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1984
- // the validation flag non-enumerable (where possible, which should
1985
- // include every environment we run tests in), so the test framework
1986
- // ignores it.
1987
-
1988
- Object.defineProperty(element._store, 'validated', {
1989
- configurable: false,
1990
- enumerable: false,
1991
- writable: true,
1992
- value: false
1993
- }); // self and source are DEV only properties.
1994
-
1995
- Object.defineProperty(element, '_self', {
1996
- configurable: false,
1997
- enumerable: false,
1998
- writable: false,
1999
- value: self
2000
- }); // Two elements created in two different places should be considered
2001
- // equal for testing purposes and therefore we hide it from enumeration.
2002
-
2003
- Object.defineProperty(element, '_source', {
2004
- configurable: false,
2005
- enumerable: false,
2006
- writable: false,
2007
- value: source
2008
- });
2009
-
2010
- if (Object.freeze) {
2011
- Object.freeze(element.props);
2012
- Object.freeze(element);
2013
- }
2014
- }
2015
-
2016
- return element;
2017
- };
2018
- /**
2019
- * Create and return a new ReactElement of the given type.
2020
- * See https://reactjs.org/docs/react-api.html#createelement
2021
- */
2022
-
2023
- function createElement(type, config, children) {
2024
- var propName; // Reserved names are extracted
2025
-
2026
- var props = {};
2027
- var key = null;
2028
- var ref = null;
2029
- var self = null;
2030
- var source = null;
2031
-
2032
- if (config != null) {
2033
- if (hasValidRef(config)) {
2034
- ref = config.ref;
2035
-
2036
- {
2037
- warnIfStringRefCannotBeAutoConverted(config);
2038
- }
2039
- }
2040
-
2041
- if (hasValidKey(config)) {
2042
- {
2043
- checkKeyStringCoercion(config.key);
2044
- }
2045
-
2046
- key = '' + config.key;
2047
- }
2048
-
2049
- self = config.__self === undefined ? null : config.__self;
2050
- source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
2051
-
2052
- for (propName in config) {
2053
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2054
- props[propName] = config[propName];
2055
- }
2056
- }
2057
- } // Children can be more than one argument, and those are transferred onto
2058
- // the newly allocated props object.
2059
-
2060
-
2061
- var childrenLength = arguments.length - 2;
2062
-
2063
- if (childrenLength === 1) {
2064
- props.children = children;
2065
- } else if (childrenLength > 1) {
2066
- var childArray = Array(childrenLength);
2067
-
2068
- for (var i = 0; i < childrenLength; i++) {
2069
- childArray[i] = arguments[i + 2];
2070
- }
2071
-
2072
- {
2073
- if (Object.freeze) {
2074
- Object.freeze(childArray);
2075
- }
2076
- }
2077
-
2078
- props.children = childArray;
2079
- } // Resolve default props
2080
-
2081
-
2082
- if (type && type.defaultProps) {
2083
- var defaultProps = type.defaultProps;
2084
-
2085
- for (propName in defaultProps) {
2086
- if (props[propName] === undefined) {
2087
- props[propName] = defaultProps[propName];
2088
- }
2089
- }
2090
- }
2091
-
2092
- {
2093
- if (key || ref) {
2094
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
2095
-
2096
- if (key) {
2097
- defineKeyPropWarningGetter(props, displayName);
2098
- }
2099
-
2100
- if (ref) {
2101
- defineRefPropWarningGetter(props, displayName);
2102
- }
2103
- }
2104
- }
2105
-
2106
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
2107
- }
2108
- function cloneAndReplaceKey(oldElement, newKey) {
2109
- var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
2110
- return newElement;
2111
- }
2112
- /**
2113
- * Clone and return a new ReactElement using element as the starting point.
2114
- * See https://reactjs.org/docs/react-api.html#cloneelement
2115
- */
2116
-
2117
- function cloneElement(element, config, children) {
2118
- if (element === null || element === undefined) {
2119
- throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
2120
- }
2121
-
2122
- var propName; // Original props are copied
2123
-
2124
- var props = assign({}, element.props); // Reserved names are extracted
2125
-
2126
- var key = element.key;
2127
- var ref = element.ref; // Self is preserved since the owner is preserved.
2128
-
2129
- var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
2130
- // transpiler, and the original source is probably a better indicator of the
2131
- // true owner.
2132
-
2133
- var source = element._source; // Owner will be preserved, unless ref is overridden
2134
-
2135
- var owner = element._owner;
2136
-
2137
- if (config != null) {
2138
- if (hasValidRef(config)) {
2139
- // Silently steal the ref from the parent.
2140
- ref = config.ref;
2141
- owner = ReactCurrentOwner.current;
2142
- }
2143
-
2144
- if (hasValidKey(config)) {
2145
- {
2146
- checkKeyStringCoercion(config.key);
2147
- }
2148
-
2149
- key = '' + config.key;
2150
- } // Remaining properties override existing props
2151
-
2152
-
2153
- var defaultProps;
2154
-
2155
- if (element.type && element.type.defaultProps) {
2156
- defaultProps = element.type.defaultProps;
2157
- }
2158
-
2159
- for (propName in config) {
2160
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2161
- if (config[propName] === undefined && defaultProps !== undefined) {
2162
- // Resolve default props
2163
- props[propName] = defaultProps[propName];
2164
- } else {
2165
- props[propName] = config[propName];
2166
- }
2167
- }
2168
- }
2169
- } // Children can be more than one argument, and those are transferred onto
2170
- // the newly allocated props object.
2171
-
2172
-
2173
- var childrenLength = arguments.length - 2;
2174
-
2175
- if (childrenLength === 1) {
2176
- props.children = children;
2177
- } else if (childrenLength > 1) {
2178
- var childArray = Array(childrenLength);
2179
-
2180
- for (var i = 0; i < childrenLength; i++) {
2181
- childArray[i] = arguments[i + 2];
2182
- }
2183
-
2184
- props.children = childArray;
2185
- }
2186
-
2187
- return ReactElement(element.type, key, ref, self, source, owner, props);
2188
- }
2189
- /**
2190
- * Verifies the object is a ReactElement.
2191
- * See https://reactjs.org/docs/react-api.html#isvalidelement
2192
- * @param {?object} object
2193
- * @return {boolean} True if `object` is a ReactElement.
2194
- * @final
2195
- */
2196
-
2197
- function isValidElement(object) {
2198
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2199
- }
2200
-
2201
- var SEPARATOR = '.';
2202
- var SUBSEPARATOR = ':';
2203
- /**
2204
- * Escape and wrap key so it is safe to use as a reactid
2205
- *
2206
- * @param {string} key to be escaped.
2207
- * @return {string} the escaped key.
2208
- */
2209
-
2210
- function escape(key) {
2211
- var escapeRegex = /[=:]/g;
2212
- var escaperLookup = {
2213
- '=': '=0',
2214
- ':': '=2'
2215
- };
2216
- var escapedString = key.replace(escapeRegex, function (match) {
2217
- return escaperLookup[match];
2218
- });
2219
- return '$' + escapedString;
2220
- }
2221
- /**
2222
- * TODO: Test that a single child and an array with one item have the same key
2223
- * pattern.
2224
- */
2225
-
2226
-
2227
- var didWarnAboutMaps = false;
2228
- var userProvidedKeyEscapeRegex = /\/+/g;
2229
-
2230
- function escapeUserProvidedKey(text) {
2231
- return text.replace(userProvidedKeyEscapeRegex, '$&/');
2232
- }
2233
- /**
2234
- * Generate a key string that identifies a element within a set.
2235
- *
2236
- * @param {*} element A element that could contain a manual key.
2237
- * @param {number} index Index that is used if a manual key is not provided.
2238
- * @return {string}
2239
- */
2240
-
2241
-
2242
- function getElementKey(element, index) {
2243
- // Do some typechecking here since we call this blindly. We want to ensure
2244
- // that we don't block potential future ES APIs.
2245
- if (typeof element === 'object' && element !== null && element.key != null) {
2246
- // Explicit key
2247
- {
2248
- checkKeyStringCoercion(element.key);
2249
- }
2250
-
2251
- return escape('' + element.key);
2252
- } // Implicit key determined by the index in the set
2253
-
2254
-
2255
- return index.toString(36);
2256
- }
2257
-
2258
- function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
2259
- var type = typeof children;
2260
-
2261
- if (type === 'undefined' || type === 'boolean') {
2262
- // All of the above are perceived as null.
2263
- children = null;
2264
- }
2265
-
2266
- var invokeCallback = false;
2267
-
2268
- if (children === null) {
2269
- invokeCallback = true;
2270
- } else {
2271
- switch (type) {
2272
- case 'string':
2273
- case 'number':
2274
- invokeCallback = true;
2275
- break;
2276
-
2277
- case 'object':
2278
- switch (children.$$typeof) {
2279
- case REACT_ELEMENT_TYPE:
2280
- case REACT_PORTAL_TYPE:
2281
- invokeCallback = true;
2282
- }
2283
-
2284
- }
2285
- }
2286
-
2287
- if (invokeCallback) {
2288
- var _child = children;
2289
- var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
2290
- // so that it's consistent if the number of children grows:
2291
-
2292
- var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
2293
-
2294
- if (isArray(mappedChild)) {
2295
- var escapedChildKey = '';
2296
-
2297
- if (childKey != null) {
2298
- escapedChildKey = escapeUserProvidedKey(childKey) + '/';
2299
- }
2300
-
2301
- mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
2302
- return c;
2303
- });
2304
- } else if (mappedChild != null) {
2305
- if (isValidElement(mappedChild)) {
2306
- {
2307
- // The `if` statement here prevents auto-disabling of the safe
2308
- // coercion ESLint rule, so we must manually disable it below.
2309
- // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
2310
- if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
2311
- checkKeyStringCoercion(mappedChild.key);
2312
- }
2313
- }
2314
-
2315
- mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
2316
- // traverseAllChildren used to do for objects as children
2317
- escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
2318
- mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
2319
- // eslint-disable-next-line react-internal/safe-string-coercion
2320
- escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
2321
- }
2322
-
2323
- array.push(mappedChild);
2324
- }
2325
-
2326
- return 1;
2327
- }
2328
-
2329
- var child;
2330
- var nextName;
2331
- var subtreeCount = 0; // Count of children found in the current subtree.
2332
-
2333
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
2334
-
2335
- if (isArray(children)) {
2336
- for (var i = 0; i < children.length; i++) {
2337
- child = children[i];
2338
- nextName = nextNamePrefix + getElementKey(child, i);
2339
- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
2340
- }
2341
- } else {
2342
- var iteratorFn = getIteratorFn(children);
2343
-
2344
- if (typeof iteratorFn === 'function') {
2345
- var iterableChildren = children;
2346
-
2347
- {
2348
- // Warn about using Maps as children
2349
- if (iteratorFn === iterableChildren.entries) {
2350
- if (!didWarnAboutMaps) {
2351
- warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
2352
- }
2353
-
2354
- didWarnAboutMaps = true;
2355
- }
2356
- }
2357
-
2358
- var iterator = iteratorFn.call(iterableChildren);
2359
- var step;
2360
- var ii = 0;
2361
-
2362
- while (!(step = iterator.next()).done) {
2363
- child = step.value;
2364
- nextName = nextNamePrefix + getElementKey(child, ii++);
2365
- subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
2366
- }
2367
- } else if (type === 'object') {
2368
- // eslint-disable-next-line react-internal/safe-string-coercion
2369
- var childrenString = String(children);
2370
- 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.');
2371
- }
2372
- }
2373
-
2374
- return subtreeCount;
2375
- }
2376
-
2377
- /**
2378
- * Maps children that are typically specified as `props.children`.
2379
- *
2380
- * See https://reactjs.org/docs/react-api.html#reactchildrenmap
2381
- *
2382
- * The provided mapFunction(child, index) will be called for each
2383
- * leaf child.
2384
- *
2385
- * @param {?*} children Children tree container.
2386
- * @param {function(*, int)} func The map function.
2387
- * @param {*} context Context for mapFunction.
2388
- * @return {object} Object containing the ordered map of results.
2389
- */
2390
- function mapChildren(children, func, context) {
2391
- if (children == null) {
2392
- return children;
2393
- }
2394
-
2395
- var result = [];
2396
- var count = 0;
2397
- mapIntoArray(children, result, '', '', function (child) {
2398
- return func.call(context, child, count++);
2399
- });
2400
- return result;
2401
- }
2402
- /**
2403
- * Count the number of children that are typically specified as
2404
- * `props.children`.
2405
- *
2406
- * See https://reactjs.org/docs/react-api.html#reactchildrencount
2407
- *
2408
- * @param {?*} children Children tree container.
2409
- * @return {number} The number of children.
2410
- */
2411
-
2412
-
2413
- function countChildren(children) {
2414
- var n = 0;
2415
- mapChildren(children, function () {
2416
- n++; // Don't return anything
2417
- });
2418
- return n;
2419
- }
2420
-
2421
- /**
2422
- * Iterates through children that are typically specified as `props.children`.
2423
- *
2424
- * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
2425
- *
2426
- * The provided forEachFunc(child, index) will be called for each
2427
- * leaf child.
2428
- *
2429
- * @param {?*} children Children tree container.
2430
- * @param {function(*, int)} forEachFunc
2431
- * @param {*} forEachContext Context for forEachContext.
2432
- */
2433
- function forEachChildren(children, forEachFunc, forEachContext) {
2434
- mapChildren(children, function () {
2435
- forEachFunc.apply(this, arguments); // Don't return anything.
2436
- }, forEachContext);
2437
- }
2438
- /**
2439
- * Flatten a children object (typically specified as `props.children`) and
2440
- * return an array with appropriately re-keyed children.
2441
- *
2442
- * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
2443
- */
2444
-
2445
-
2446
- function toArray(children) {
2447
- return mapChildren(children, function (child) {
2448
- return child;
2449
- }) || [];
2450
- }
2451
- /**
2452
- * Returns the first child in a collection of children and verifies that there
2453
- * is only one child in the collection.
2454
- *
2455
- * See https://reactjs.org/docs/react-api.html#reactchildrenonly
2456
- *
2457
- * The current implementation of this function assumes that a single child gets
2458
- * passed without a wrapper, but the purpose of this helper function is to
2459
- * abstract away the particular structure of children.
2460
- *
2461
- * @param {?object} children Child collection structure.
2462
- * @return {ReactElement} The first and only `ReactElement` contained in the
2463
- * structure.
2464
- */
2465
-
2466
-
2467
- function onlyChild(children) {
2468
- if (!isValidElement(children)) {
2469
- throw new Error('React.Children.only expected to receive a single React element child.');
2470
- }
2471
-
2472
- return children;
2473
- }
2474
-
2475
- function createContext(defaultValue) {
2476
- // TODO: Second argument used to be an optional `calculateChangedBits`
2477
- // function. Warn to reserve for future use?
2478
- var context = {
2479
- $$typeof: REACT_CONTEXT_TYPE,
2480
- // As a workaround to support multiple concurrent renderers, we categorize
2481
- // some renderers as primary and others as secondary. We only expect
2482
- // there to be two concurrent renderers at most: React Native (primary) and
2483
- // Fabric (secondary); React DOM (primary) and React ART (secondary).
2484
- // Secondary renderers store their context values on separate fields.
2485
- _currentValue: defaultValue,
2486
- _currentValue2: defaultValue,
2487
- // Used to track how many concurrent renderers this context currently
2488
- // supports within in a single renderer. Such as parallel server rendering.
2489
- _threadCount: 0,
2490
- // These are circular
2491
- Provider: null,
2492
- Consumer: null,
2493
- // Add these to use same hidden class in VM as ServerContext
2494
- _defaultValue: null,
2495
- _globalName: null
2496
- };
2497
- context.Provider = {
2498
- $$typeof: REACT_PROVIDER_TYPE,
2499
- _context: context
2500
- };
2501
- var hasWarnedAboutUsingNestedContextConsumers = false;
2502
- var hasWarnedAboutUsingConsumerProvider = false;
2503
- var hasWarnedAboutDisplayNameOnConsumer = false;
2504
-
2505
- {
2506
- // A separate object, but proxies back to the original context object for
2507
- // backwards compatibility. It has a different $$typeof, so we can properly
2508
- // warn for the incorrect usage of Context as a Consumer.
2509
- var Consumer = {
2510
- $$typeof: REACT_CONTEXT_TYPE,
2511
- _context: context
2512
- }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
2513
-
2514
- Object.defineProperties(Consumer, {
2515
- Provider: {
2516
- get: function () {
2517
- if (!hasWarnedAboutUsingConsumerProvider) {
2518
- hasWarnedAboutUsingConsumerProvider = true;
2519
-
2520
- 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?');
2521
- }
2522
-
2523
- return context.Provider;
2524
- },
2525
- set: function (_Provider) {
2526
- context.Provider = _Provider;
2527
- }
2528
- },
2529
- _currentValue: {
2530
- get: function () {
2531
- return context._currentValue;
2532
- },
2533
- set: function (_currentValue) {
2534
- context._currentValue = _currentValue;
2535
- }
2536
- },
2537
- _currentValue2: {
2538
- get: function () {
2539
- return context._currentValue2;
2540
- },
2541
- set: function (_currentValue2) {
2542
- context._currentValue2 = _currentValue2;
2543
- }
2544
- },
2545
- _threadCount: {
2546
- get: function () {
2547
- return context._threadCount;
2548
- },
2549
- set: function (_threadCount) {
2550
- context._threadCount = _threadCount;
2551
- }
2552
- },
2553
- Consumer: {
2554
- get: function () {
2555
- if (!hasWarnedAboutUsingNestedContextConsumers) {
2556
- hasWarnedAboutUsingNestedContextConsumers = true;
2557
-
2558
- 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?');
2559
- }
2560
-
2561
- return context.Consumer;
2562
- }
2563
- },
2564
- displayName: {
2565
- get: function () {
2566
- return context.displayName;
2567
- },
2568
- set: function (displayName) {
2569
- if (!hasWarnedAboutDisplayNameOnConsumer) {
2570
- warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
2571
-
2572
- hasWarnedAboutDisplayNameOnConsumer = true;
2573
- }
2574
- }
2575
- }
2576
- }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
2577
-
2578
- context.Consumer = Consumer;
2579
- }
2580
-
2581
- {
2582
- context._currentRenderer = null;
2583
- context._currentRenderer2 = null;
2584
- }
2585
-
2586
- return context;
2587
- }
2588
-
2589
- var Uninitialized = -1;
2590
- var Pending = 0;
2591
- var Resolved = 1;
2592
- var Rejected = 2;
2593
-
2594
- function lazyInitializer(payload) {
2595
- if (payload._status === Uninitialized) {
2596
- var ctor = payload._result;
2597
- var thenable = ctor(); // Transition to the next state.
2598
- // This might throw either because it's missing or throws. If so, we treat it
2599
- // as still uninitialized and try again next time. Which is the same as what
2600
- // happens if the ctor or any wrappers processing the ctor throws. This might
2601
- // end up fixing it if the resolution was a concurrency bug.
2602
-
2603
- thenable.then(function (moduleObject) {
2604
- if (payload._status === Pending || payload._status === Uninitialized) {
2605
- // Transition to the next state.
2606
- var resolved = payload;
2607
- resolved._status = Resolved;
2608
- resolved._result = moduleObject;
2609
- }
2610
- }, function (error) {
2611
- if (payload._status === Pending || payload._status === Uninitialized) {
2612
- // Transition to the next state.
2613
- var rejected = payload;
2614
- rejected._status = Rejected;
2615
- rejected._result = error;
2616
- }
2617
- });
2618
-
2619
- if (payload._status === Uninitialized) {
2620
- // In case, we're still uninitialized, then we're waiting for the thenable
2621
- // to resolve. Set it as pending in the meantime.
2622
- var pending = payload;
2623
- pending._status = Pending;
2624
- pending._result = thenable;
2625
- }
2626
- }
2627
-
2628
- if (payload._status === Resolved) {
2629
- var moduleObject = payload._result;
2630
-
2631
- {
2632
- if (moduleObject === undefined) {
2633
- 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.
2634
- 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
2635
- }
2636
- }
2637
-
2638
- {
2639
- if (!('default' in moduleObject)) {
2640
- 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.
2641
- 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
2642
- }
2643
- }
2644
-
2645
- return moduleObject.default;
2646
- } else {
2647
- throw payload._result;
2648
- }
2649
- }
2650
-
2651
- function lazy(ctor) {
2652
- var payload = {
2653
- // We use these fields to store the result.
2654
- _status: Uninitialized,
2655
- _result: ctor
2656
- };
2657
- var lazyType = {
2658
- $$typeof: REACT_LAZY_TYPE,
2659
- _payload: payload,
2660
- _init: lazyInitializer
2661
- };
2662
-
2663
- {
2664
- // In production, this would just set it on the object.
2665
- var defaultProps;
2666
- var propTypes; // $FlowFixMe
2667
-
2668
- Object.defineProperties(lazyType, {
2669
- defaultProps: {
2670
- configurable: true,
2671
- get: function () {
2672
- return defaultProps;
2673
- },
2674
- set: function (newDefaultProps) {
2675
- 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.');
2676
-
2677
- defaultProps = newDefaultProps; // Match production behavior more closely:
2678
- // $FlowFixMe
2679
-
2680
- Object.defineProperty(lazyType, 'defaultProps', {
2681
- enumerable: true
2682
- });
2683
- }
2684
- },
2685
- propTypes: {
2686
- configurable: true,
2687
- get: function () {
2688
- return propTypes;
2689
- },
2690
- set: function (newPropTypes) {
2691
- 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.');
2692
-
2693
- propTypes = newPropTypes; // Match production behavior more closely:
2694
- // $FlowFixMe
2695
-
2696
- Object.defineProperty(lazyType, 'propTypes', {
2697
- enumerable: true
2698
- });
2699
- }
2700
- }
2701
- });
2702
- }
2703
-
2704
- return lazyType;
2705
- }
2706
-
2707
- function forwardRef(render) {
2708
- {
2709
- if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
2710
- error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
2711
- } else if (typeof render !== 'function') {
2712
- error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
2713
- } else {
2714
- if (render.length !== 0 && render.length !== 2) {
2715
- 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.');
2716
- }
2717
- }
2718
-
2719
- if (render != null) {
2720
- if (render.defaultProps != null || render.propTypes != null) {
2721
- error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
2722
- }
2723
- }
2724
- }
2725
-
2726
- var elementType = {
2727
- $$typeof: REACT_FORWARD_REF_TYPE,
2728
- render: render
2729
- };
2730
-
2731
- {
2732
- var ownName;
2733
- Object.defineProperty(elementType, 'displayName', {
2734
- enumerable: false,
2735
- configurable: true,
2736
- get: function () {
2737
- return ownName;
2738
- },
2739
- set: function (name) {
2740
- ownName = name; // The inner component shouldn't inherit this display name in most cases,
2741
- // because the component may be used elsewhere.
2742
- // But it's nice for anonymous functions to inherit the name,
2743
- // so that our component-stack generation logic will display their frames.
2744
- // An anonymous function generally suggests a pattern like:
2745
- // React.forwardRef((props, ref) => {...});
2746
- // This kind of inner function is not used elsewhere so the side effect is okay.
2747
-
2748
- if (!render.name && !render.displayName) {
2749
- render.displayName = name;
2750
- }
2751
- }
2752
- });
2753
- }
2754
-
2755
- return elementType;
2756
- }
2757
-
2758
- var REACT_MODULE_REFERENCE;
2759
-
2760
- {
2761
- REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
2762
- }
2763
-
2764
- function isValidElementType(type) {
2765
- if (typeof type === 'string' || typeof type === 'function') {
2766
- return true;
2767
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
2768
-
2769
-
2770
- 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 ) {
2771
- return true;
2772
- }
2773
-
2774
- if (typeof type === 'object' && type !== null) {
2775
- 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
2776
- // types supported by any Flight configuration anywhere since
2777
- // we don't know which Flight build this will end up being used
2778
- // with.
2779
- type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
2780
- return true;
2781
- }
2782
- }
2783
-
2784
- return false;
2785
- }
2786
-
2787
- function memo(type, compare) {
2788
- {
2789
- if (!isValidElementType(type)) {
2790
- error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
2791
- }
2792
- }
2793
-
2794
- var elementType = {
2795
- $$typeof: REACT_MEMO_TYPE,
2796
- type: type,
2797
- compare: compare === undefined ? null : compare
2798
- };
2799
-
2800
- {
2801
- var ownName;
2802
- Object.defineProperty(elementType, 'displayName', {
2803
- enumerable: false,
2804
- configurable: true,
2805
- get: function () {
2806
- return ownName;
2807
- },
2808
- set: function (name) {
2809
- ownName = name; // The inner component shouldn't inherit this display name in most cases,
2810
- // because the component may be used elsewhere.
2811
- // But it's nice for anonymous functions to inherit the name,
2812
- // so that our component-stack generation logic will display their frames.
2813
- // An anonymous function generally suggests a pattern like:
2814
- // React.memo((props) => {...});
2815
- // This kind of inner function is not used elsewhere so the side effect is okay.
2816
-
2817
- if (!type.name && !type.displayName) {
2818
- type.displayName = name;
2819
- }
2820
- }
2821
- });
2822
- }
2823
-
2824
- return elementType;
2825
- }
2826
-
2827
- function resolveDispatcher() {
2828
- var dispatcher = ReactCurrentDispatcher.current;
2829
-
2830
- {
2831
- if (dispatcher === null) {
2832
- 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.');
2833
- }
2834
- } // Will result in a null access error if accessed outside render phase. We
2835
- // intentionally don't throw our own error because this is in a hot path.
2836
- // Also helps ensure this is inlined.
2837
-
2838
-
2839
- return dispatcher;
2840
- }
2841
- function useContext(Context) {
2842
- var dispatcher = resolveDispatcher();
2843
-
2844
- {
2845
- // TODO: add a more generic warning for invalid values.
2846
- if (Context._context !== undefined) {
2847
- var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
2848
- // and nobody should be using this in existing code.
2849
-
2850
- if (realContext.Consumer === Context) {
2851
- 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?');
2852
- } else if (realContext.Provider === Context) {
2853
- error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
2854
- }
2855
- }
2856
- }
2857
-
2858
- return dispatcher.useContext(Context);
2859
- }
2860
- function useState(initialState) {
2861
- var dispatcher = resolveDispatcher();
2862
- return dispatcher.useState(initialState);
2863
- }
2864
- function useReducer(reducer, initialArg, init) {
2865
- var dispatcher = resolveDispatcher();
2866
- return dispatcher.useReducer(reducer, initialArg, init);
2867
- }
2868
- function useRef(initialValue) {
2869
- var dispatcher = resolveDispatcher();
2870
- return dispatcher.useRef(initialValue);
2871
- }
2872
- function useEffect(create, deps) {
2873
- var dispatcher = resolveDispatcher();
2874
- return dispatcher.useEffect(create, deps);
2875
- }
2876
- function useInsertionEffect(create, deps) {
2877
- var dispatcher = resolveDispatcher();
2878
- return dispatcher.useInsertionEffect(create, deps);
2879
- }
2880
- function useLayoutEffect(create, deps) {
2881
- var dispatcher = resolveDispatcher();
2882
- return dispatcher.useLayoutEffect(create, deps);
2883
- }
2884
- function useCallback(callback, deps) {
2885
- var dispatcher = resolveDispatcher();
2886
- return dispatcher.useCallback(callback, deps);
2887
- }
2888
- function useMemo(create, deps) {
2889
- var dispatcher = resolveDispatcher();
2890
- return dispatcher.useMemo(create, deps);
2891
- }
2892
- function useImperativeHandle(ref, create, deps) {
2893
- var dispatcher = resolveDispatcher();
2894
- return dispatcher.useImperativeHandle(ref, create, deps);
2895
- }
2896
- function useDebugValue(value, formatterFn) {
2897
- {
2898
- var dispatcher = resolveDispatcher();
2899
- return dispatcher.useDebugValue(value, formatterFn);
2900
- }
2901
- }
2902
- function useTransition() {
2903
- var dispatcher = resolveDispatcher();
2904
- return dispatcher.useTransition();
2905
- }
2906
- function useDeferredValue(value) {
2907
- var dispatcher = resolveDispatcher();
2908
- return dispatcher.useDeferredValue(value);
2909
- }
2910
- function useId() {
2911
- var dispatcher = resolveDispatcher();
2912
- return dispatcher.useId();
2913
- }
2914
- function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
2915
- var dispatcher = resolveDispatcher();
2916
- return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
2917
- }
2918
-
2919
- // Helpers to patch console.logs to avoid logging during side-effect free
2920
- // replaying on render function. This currently only patches the object
2921
- // lazily which won't cover if the log function was extracted eagerly.
2922
- // We could also eagerly patch the method.
2923
- var disabledDepth = 0;
2924
- var prevLog;
2925
- var prevInfo;
2926
- var prevWarn;
2927
- var prevError;
2928
- var prevGroup;
2929
- var prevGroupCollapsed;
2930
- var prevGroupEnd;
2931
-
2932
- function disabledLog() {}
2933
-
2934
- disabledLog.__reactDisabledLog = true;
2935
- function disableLogs() {
2936
- {
2937
- if (disabledDepth === 0) {
2938
- /* eslint-disable react-internal/no-production-logging */
2939
- prevLog = console.log;
2940
- prevInfo = console.info;
2941
- prevWarn = console.warn;
2942
- prevError = console.error;
2943
- prevGroup = console.group;
2944
- prevGroupCollapsed = console.groupCollapsed;
2945
- prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
2946
-
2947
- var props = {
2948
- configurable: true,
2949
- enumerable: true,
2950
- value: disabledLog,
2951
- writable: true
2952
- }; // $FlowFixMe Flow thinks console is immutable.
2953
-
2954
- Object.defineProperties(console, {
2955
- info: props,
2956
- log: props,
2957
- warn: props,
2958
- error: props,
2959
- group: props,
2960
- groupCollapsed: props,
2961
- groupEnd: props
2962
- });
2963
- /* eslint-enable react-internal/no-production-logging */
2964
- }
2965
-
2966
- disabledDepth++;
2967
- }
2968
- }
2969
- function reenableLogs() {
2970
- {
2971
- disabledDepth--;
2972
-
2973
- if (disabledDepth === 0) {
2974
- /* eslint-disable react-internal/no-production-logging */
2975
- var props = {
2976
- configurable: true,
2977
- enumerable: true,
2978
- writable: true
2979
- }; // $FlowFixMe Flow thinks console is immutable.
2980
-
2981
- Object.defineProperties(console, {
2982
- log: assign({}, props, {
2983
- value: prevLog
2984
- }),
2985
- info: assign({}, props, {
2986
- value: prevInfo
2987
- }),
2988
- warn: assign({}, props, {
2989
- value: prevWarn
2990
- }),
2991
- error: assign({}, props, {
2992
- value: prevError
2993
- }),
2994
- group: assign({}, props, {
2995
- value: prevGroup
2996
- }),
2997
- groupCollapsed: assign({}, props, {
2998
- value: prevGroupCollapsed
2999
- }),
3000
- groupEnd: assign({}, props, {
3001
- value: prevGroupEnd
3002
- })
3003
- });
3004
- /* eslint-enable react-internal/no-production-logging */
3005
- }
3006
-
3007
- if (disabledDepth < 0) {
3008
- error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
3009
- }
3010
- }
3011
- }
3012
-
3013
- var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
3014
- var prefix;
3015
- function describeBuiltInComponentFrame(name, source, ownerFn) {
3016
- {
3017
- if (prefix === undefined) {
3018
- // Extract the VM specific prefix used by each line.
3019
- try {
3020
- throw Error();
3021
- } catch (x) {
3022
- var match = x.stack.trim().match(/\n( *(at )?)/);
3023
- prefix = match && match[1] || '';
3024
- }
3025
- } // We use the prefix to ensure our stacks line up with native stack frames.
3026
-
3027
-
3028
- return '\n' + prefix + name;
3029
- }
3030
- }
3031
- var reentry = false;
3032
- var componentFrameCache;
3033
-
3034
- {
3035
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
3036
- componentFrameCache = new PossiblyWeakMap();
3037
- }
3038
-
3039
- function describeNativeComponentFrame(fn, construct) {
3040
- // If something asked for a stack inside a fake render, it should get ignored.
3041
- if ( !fn || reentry) {
3042
- return '';
3043
- }
3044
-
3045
- {
3046
- var frame = componentFrameCache.get(fn);
3047
-
3048
- if (frame !== undefined) {
3049
- return frame;
3050
- }
3051
- }
3052
-
3053
- var control;
3054
- reentry = true;
3055
- var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
3056
-
3057
- Error.prepareStackTrace = undefined;
3058
- var previousDispatcher;
3059
-
3060
- {
3061
- previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
3062
- // for warnings.
3063
-
3064
- ReactCurrentDispatcher$1.current = null;
3065
- disableLogs();
3066
- }
3067
-
3068
- try {
3069
- // This should throw.
3070
- if (construct) {
3071
- // Something should be setting the props in the constructor.
3072
- var Fake = function () {
3073
- throw Error();
3074
- }; // $FlowFixMe
3075
-
3076
-
3077
- Object.defineProperty(Fake.prototype, 'props', {
3078
- set: function () {
3079
- // We use a throwing setter instead of frozen or non-writable props
3080
- // because that won't throw in a non-strict mode function.
3081
- throw Error();
3082
- }
3083
- });
3084
-
3085
- if (typeof Reflect === 'object' && Reflect.construct) {
3086
- // We construct a different control for this case to include any extra
3087
- // frames added by the construct call.
3088
- try {
3089
- Reflect.construct(Fake, []);
3090
- } catch (x) {
3091
- control = x;
3092
- }
3093
-
3094
- Reflect.construct(fn, [], Fake);
3095
- } else {
3096
- try {
3097
- Fake.call();
3098
- } catch (x) {
3099
- control = x;
3100
- }
3101
-
3102
- fn.call(Fake.prototype);
3103
- }
3104
- } else {
3105
- try {
3106
- throw Error();
3107
- } catch (x) {
3108
- control = x;
3109
- }
3110
-
3111
- fn();
3112
- }
3113
- } catch (sample) {
3114
- // This is inlined manually because closure doesn't do it for us.
3115
- if (sample && control && typeof sample.stack === 'string') {
3116
- // This extracts the first frame from the sample that isn't also in the control.
3117
- // Skipping one frame that we assume is the frame that calls the two.
3118
- var sampleLines = sample.stack.split('\n');
3119
- var controlLines = control.stack.split('\n');
3120
- var s = sampleLines.length - 1;
3121
- var c = controlLines.length - 1;
3122
-
3123
- while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
3124
- // We expect at least one stack frame to be shared.
3125
- // Typically this will be the root most one. However, stack frames may be
3126
- // cut off due to maximum stack limits. In this case, one maybe cut off
3127
- // earlier than the other. We assume that the sample is longer or the same
3128
- // and there for cut off earlier. So we should find the root most frame in
3129
- // the sample somewhere in the control.
3130
- c--;
3131
- }
3132
-
3133
- for (; s >= 1 && c >= 0; s--, c--) {
3134
- // Next we find the first one that isn't the same which should be the
3135
- // frame that called our sample function and the control.
3136
- if (sampleLines[s] !== controlLines[c]) {
3137
- // In V8, the first line is describing the message but other VMs don't.
3138
- // If we're about to return the first line, and the control is also on the same
3139
- // line, that's a pretty good indicator that our sample threw at same line as
3140
- // the control. I.e. before we entered the sample frame. So we ignore this result.
3141
- // This can happen if you passed a class to function component, or non-function.
3142
- if (s !== 1 || c !== 1) {
3143
- do {
3144
- s--;
3145
- c--; // We may still have similar intermediate frames from the construct call.
3146
- // The next one that isn't the same should be our match though.
3147
-
3148
- if (c < 0 || sampleLines[s] !== controlLines[c]) {
3149
- // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
3150
- var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
3151
- // but we have a user-provided "displayName"
3152
- // splice it in to make the stack more readable.
3153
-
3154
-
3155
- if (fn.displayName && _frame.includes('<anonymous>')) {
3156
- _frame = _frame.replace('<anonymous>', fn.displayName);
3157
- }
3158
-
3159
- {
3160
- if (typeof fn === 'function') {
3161
- componentFrameCache.set(fn, _frame);
3162
- }
3163
- } // Return the line we found.
3164
-
3165
-
3166
- return _frame;
3167
- }
3168
- } while (s >= 1 && c >= 0);
3169
- }
3170
-
3171
- break;
3172
- }
3173
- }
3174
- }
3175
- } finally {
3176
- reentry = false;
3177
-
3178
- {
3179
- ReactCurrentDispatcher$1.current = previousDispatcher;
3180
- reenableLogs();
3181
- }
3182
-
3183
- Error.prepareStackTrace = previousPrepareStackTrace;
3184
- } // Fallback to just using the name if we couldn't make it throw.
3185
-
3186
-
3187
- var name = fn ? fn.displayName || fn.name : '';
3188
- var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
3189
-
3190
- {
3191
- if (typeof fn === 'function') {
3192
- componentFrameCache.set(fn, syntheticFrame);
3193
- }
3194
- }
3195
-
3196
- return syntheticFrame;
3197
- }
3198
- function describeFunctionComponentFrame(fn, source, ownerFn) {
3199
- {
3200
- return describeNativeComponentFrame(fn, false);
3201
- }
3202
- }
3203
-
3204
- function shouldConstruct(Component) {
3205
- var prototype = Component.prototype;
3206
- return !!(prototype && prototype.isReactComponent);
3207
- }
3208
-
3209
- function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
3210
-
3211
- if (type == null) {
3212
- return '';
3213
- }
3214
-
3215
- if (typeof type === 'function') {
3216
- {
3217
- return describeNativeComponentFrame(type, shouldConstruct(type));
3218
- }
3219
- }
3220
-
3221
- if (typeof type === 'string') {
3222
- return describeBuiltInComponentFrame(type);
3223
- }
3224
-
3225
- switch (type) {
3226
- case REACT_SUSPENSE_TYPE:
3227
- return describeBuiltInComponentFrame('Suspense');
3228
-
3229
- case REACT_SUSPENSE_LIST_TYPE:
3230
- return describeBuiltInComponentFrame('SuspenseList');
3231
- }
3232
-
3233
- if (typeof type === 'object') {
3234
- switch (type.$$typeof) {
3235
- case REACT_FORWARD_REF_TYPE:
3236
- return describeFunctionComponentFrame(type.render);
3237
-
3238
- case REACT_MEMO_TYPE:
3239
- // Memo may contain any component type so we recursively resolve it.
3240
- return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
3241
-
3242
- case REACT_LAZY_TYPE:
3243
- {
3244
- var lazyComponent = type;
3245
- var payload = lazyComponent._payload;
3246
- var init = lazyComponent._init;
3247
-
3248
- try {
3249
- // Lazy may contain any component type so we recursively resolve it.
3250
- return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
3251
- } catch (x) {}
3252
- }
3253
- }
3254
- }
3255
-
3256
- return '';
3257
- }
3258
-
3259
- var loggedTypeFailures = {};
3260
- var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
3261
-
3262
- function setCurrentlyValidatingElement(element) {
3263
- {
3264
- if (element) {
3265
- var owner = element._owner;
3266
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
3267
- ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
3268
- } else {
3269
- ReactDebugCurrentFrame$1.setExtraStackFrame(null);
3270
- }
3271
- }
3272
- }
3273
-
3274
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
3275
- {
3276
- // $FlowFixMe This is okay but Flow doesn't know it.
3277
- var has = Function.call.bind(hasOwnProperty);
3278
-
3279
- for (var typeSpecName in typeSpecs) {
3280
- if (has(typeSpecs, typeSpecName)) {
3281
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
3282
- // fail the render phase where it didn't fail before. So we log it.
3283
- // After these have been cleaned up, we'll let them throw.
3284
-
3285
- try {
3286
- // This is intentionally an invariant that gets caught. It's the same
3287
- // behavior as without this statement except with a better message.
3288
- if (typeof typeSpecs[typeSpecName] !== 'function') {
3289
- // eslint-disable-next-line react-internal/prod-error-codes
3290
- 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`.');
3291
- err.name = 'Invariant Violation';
3292
- throw err;
3293
- }
3294
-
3295
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
3296
- } catch (ex) {
3297
- error$1 = ex;
3298
- }
3299
-
3300
- if (error$1 && !(error$1 instanceof Error)) {
3301
- setCurrentlyValidatingElement(element);
3302
-
3303
- 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);
3304
-
3305
- setCurrentlyValidatingElement(null);
3306
- }
3307
-
3308
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
3309
- // Only monitor this failure once because there tends to be a lot of the
3310
- // same error.
3311
- loggedTypeFailures[error$1.message] = true;
3312
- setCurrentlyValidatingElement(element);
3313
-
3314
- error('Failed %s type: %s', location, error$1.message);
3315
-
3316
- setCurrentlyValidatingElement(null);
3317
- }
3318
- }
3319
- }
3320
- }
3321
- }
3322
-
3323
- function setCurrentlyValidatingElement$1(element) {
3324
- {
3325
- if (element) {
3326
- var owner = element._owner;
3327
- var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
3328
- setExtraStackFrame(stack);
3329
- } else {
3330
- setExtraStackFrame(null);
3331
- }
3332
- }
3333
- }
3334
-
3335
- var propTypesMisspellWarningShown;
3336
-
3337
- {
3338
- propTypesMisspellWarningShown = false;
3339
- }
3340
-
3341
- function getDeclarationErrorAddendum() {
3342
- if (ReactCurrentOwner.current) {
3343
- var name = getComponentNameFromType(ReactCurrentOwner.current.type);
3344
-
3345
- if (name) {
3346
- return '\n\nCheck the render method of `' + name + '`.';
3347
- }
3348
- }
3349
-
3350
- return '';
3351
- }
3352
-
3353
- function getSourceInfoErrorAddendum(source) {
3354
- if (source !== undefined) {
3355
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
3356
- var lineNumber = source.lineNumber;
3357
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
3358
- }
3359
-
3360
- return '';
3361
- }
3362
-
3363
- function getSourceInfoErrorAddendumForProps(elementProps) {
3364
- if (elementProps !== null && elementProps !== undefined) {
3365
- return getSourceInfoErrorAddendum(elementProps.__source);
3366
- }
3367
-
3368
- return '';
3369
- }
3370
- /**
3371
- * Warn if there's no key explicitly set on dynamic arrays of children or
3372
- * object keys are not valid. This allows us to keep track of children between
3373
- * updates.
3374
- */
3375
-
3376
-
3377
- var ownerHasKeyUseWarning = {};
3378
-
3379
- function getCurrentComponentErrorInfo(parentType) {
3380
- var info = getDeclarationErrorAddendum();
3381
-
3382
- if (!info) {
3383
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
3384
-
3385
- if (parentName) {
3386
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
3387
- }
3388
- }
3389
-
3390
- return info;
3391
- }
3392
- /**
3393
- * Warn if the element doesn't have an explicit key assigned to it.
3394
- * This element is in an array. The array could grow and shrink or be
3395
- * reordered. All children that haven't already been validated are required to
3396
- * have a "key" property assigned to it. Error statuses are cached so a warning
3397
- * will only be shown once.
3398
- *
3399
- * @internal
3400
- * @param {ReactElement} element Element that requires a key.
3401
- * @param {*} parentType element's parent's type.
3402
- */
3403
-
3404
-
3405
- function validateExplicitKey(element, parentType) {
3406
- if (!element._store || element._store.validated || element.key != null) {
3407
- return;
3408
- }
3409
-
3410
- element._store.validated = true;
3411
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
3412
-
3413
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
3414
- return;
3415
- }
3416
-
3417
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
3418
- // property, it may be the creator of the child that's responsible for
3419
- // assigning it a key.
3420
-
3421
- var childOwner = '';
3422
-
3423
- if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
3424
- // Give the component that originally created this child.
3425
- childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
3426
- }
3427
-
3428
- {
3429
- setCurrentlyValidatingElement$1(element);
3430
-
3431
- 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);
3432
-
3433
- setCurrentlyValidatingElement$1(null);
3434
- }
3435
- }
3436
- /**
3437
- * Ensure that every element either is passed in a static location, in an
3438
- * array with an explicit keys property defined, or in an object literal
3439
- * with valid key property.
3440
- *
3441
- * @internal
3442
- * @param {ReactNode} node Statically passed child of any type.
3443
- * @param {*} parentType node's parent's type.
3444
- */
3445
-
3446
-
3447
- function validateChildKeys(node, parentType) {
3448
- if (typeof node !== 'object') {
3449
- return;
3450
- }
3451
-
3452
- if (isArray(node)) {
3453
- for (var i = 0; i < node.length; i++) {
3454
- var child = node[i];
3455
-
3456
- if (isValidElement(child)) {
3457
- validateExplicitKey(child, parentType);
3458
- }
3459
- }
3460
- } else if (isValidElement(node)) {
3461
- // This element was passed in a valid location.
3462
- if (node._store) {
3463
- node._store.validated = true;
3464
- }
3465
- } else if (node) {
3466
- var iteratorFn = getIteratorFn(node);
3467
-
3468
- if (typeof iteratorFn === 'function') {
3469
- // Entry iterators used to provide implicit keys,
3470
- // but now we print a separate warning for them later.
3471
- if (iteratorFn !== node.entries) {
3472
- var iterator = iteratorFn.call(node);
3473
- var step;
3474
-
3475
- while (!(step = iterator.next()).done) {
3476
- if (isValidElement(step.value)) {
3477
- validateExplicitKey(step.value, parentType);
3478
- }
3479
- }
3480
- }
3481
- }
3482
- }
3483
- }
3484
- /**
3485
- * Given an element, validate that its props follow the propTypes definition,
3486
- * provided by the type.
3487
- *
3488
- * @param {ReactElement} element
3489
- */
3490
-
3491
-
3492
- function validatePropTypes(element) {
3493
- {
3494
- var type = element.type;
3495
-
3496
- if (type === null || type === undefined || typeof type === 'string') {
3497
- return;
3498
- }
3499
-
3500
- var propTypes;
3501
-
3502
- if (typeof type === 'function') {
3503
- propTypes = type.propTypes;
3504
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
3505
- // Inner props are checked in the reconciler.
3506
- type.$$typeof === REACT_MEMO_TYPE)) {
3507
- propTypes = type.propTypes;
3508
- } else {
3509
- return;
3510
- }
3511
-
3512
- if (propTypes) {
3513
- // Intentionally inside to avoid triggering lazy initializers:
3514
- var name = getComponentNameFromType(type);
3515
- checkPropTypes(propTypes, element.props, 'prop', name, element);
3516
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
3517
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
3518
-
3519
- var _name = getComponentNameFromType(type);
3520
-
3521
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
3522
- }
3523
-
3524
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
3525
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
3526
- }
3527
- }
3528
- }
3529
- /**
3530
- * Given a fragment, validate that it can only be provided with fragment props
3531
- * @param {ReactElement} fragment
3532
- */
3533
-
3534
-
3535
- function validateFragmentProps(fragment) {
3536
- {
3537
- var keys = Object.keys(fragment.props);
3538
-
3539
- for (var i = 0; i < keys.length; i++) {
3540
- var key = keys[i];
3541
-
3542
- if (key !== 'children' && key !== 'key') {
3543
- setCurrentlyValidatingElement$1(fragment);
3544
-
3545
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
3546
-
3547
- setCurrentlyValidatingElement$1(null);
3548
- break;
3549
- }
3550
- }
3551
-
3552
- if (fragment.ref !== null) {
3553
- setCurrentlyValidatingElement$1(fragment);
3554
-
3555
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
3556
-
3557
- setCurrentlyValidatingElement$1(null);
3558
- }
3559
- }
3560
- }
3561
- function createElementWithValidation(type, props, children) {
3562
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
3563
- // succeed and there will likely be errors in render.
3564
-
3565
- if (!validType) {
3566
- var info = '';
3567
-
3568
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
3569
- 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.";
3570
- }
3571
-
3572
- var sourceInfo = getSourceInfoErrorAddendumForProps(props);
3573
-
3574
- if (sourceInfo) {
3575
- info += sourceInfo;
3576
- } else {
3577
- info += getDeclarationErrorAddendum();
3578
- }
3579
-
3580
- var typeString;
3581
-
3582
- if (type === null) {
3583
- typeString = 'null';
3584
- } else if (isArray(type)) {
3585
- typeString = 'array';
3586
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
3587
- typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
3588
- info = ' Did you accidentally export a JSX literal instead of a component?';
3589
- } else {
3590
- typeString = typeof type;
3591
- }
3592
-
3593
- {
3594
- 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);
3595
- }
3596
- }
3597
-
3598
- var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
3599
- // TODO: Drop this when these are no longer allowed as the type argument.
3600
-
3601
- if (element == null) {
3602
- return element;
3603
- } // Skip key warning if the type isn't valid since our key validation logic
3604
- // doesn't expect a non-string/function type and can throw confusing errors.
3605
- // We don't want exception behavior to differ between dev and prod.
3606
- // (Rendering will throw with a helpful message and as soon as the type is
3607
- // fixed, the key warnings will appear.)
3608
-
3609
-
3610
- if (validType) {
3611
- for (var i = 2; i < arguments.length; i++) {
3612
- validateChildKeys(arguments[i], type);
3613
- }
3614
- }
3615
-
3616
- if (type === REACT_FRAGMENT_TYPE) {
3617
- validateFragmentProps(element);
3618
- } else {
3619
- validatePropTypes(element);
3620
- }
3621
-
3622
- return element;
3623
- }
3624
- var didWarnAboutDeprecatedCreateFactory = false;
3625
- function createFactoryWithValidation(type) {
3626
- var validatedFactory = createElementWithValidation.bind(null, type);
3627
- validatedFactory.type = type;
3628
-
3629
- {
3630
- if (!didWarnAboutDeprecatedCreateFactory) {
3631
- didWarnAboutDeprecatedCreateFactory = true;
3632
-
3633
- warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
3634
- } // Legacy hook: remove it
3635
-
3636
-
3637
- Object.defineProperty(validatedFactory, 'type', {
3638
- enumerable: false,
3639
- get: function () {
3640
- warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
3641
-
3642
- Object.defineProperty(this, 'type', {
3643
- value: type
3644
- });
3645
- return type;
3646
- }
3647
- });
3648
- }
3649
-
3650
- return validatedFactory;
3651
- }
3652
- function cloneElementWithValidation(element, props, children) {
3653
- var newElement = cloneElement.apply(this, arguments);
3654
-
3655
- for (var i = 2; i < arguments.length; i++) {
3656
- validateChildKeys(arguments[i], newElement.type);
3657
- }
3658
-
3659
- validatePropTypes(newElement);
3660
- return newElement;
3661
- }
3662
-
3663
- function startTransition(scope, options) {
3664
- var prevTransition = ReactCurrentBatchConfig.transition;
3665
- ReactCurrentBatchConfig.transition = {};
3666
- var currentTransition = ReactCurrentBatchConfig.transition;
3667
-
3668
- {
3669
- ReactCurrentBatchConfig.transition._updatedFibers = new Set();
3670
- }
3671
-
3672
- try {
3673
- scope();
3674
- } finally {
3675
- ReactCurrentBatchConfig.transition = prevTransition;
3676
-
3677
- {
3678
- if (prevTransition === null && currentTransition._updatedFibers) {
3679
- var updatedFibersCount = currentTransition._updatedFibers.size;
3680
-
3681
- if (updatedFibersCount > 10) {
3682
- 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.');
3683
- }
3684
-
3685
- currentTransition._updatedFibers.clear();
3686
- }
3687
- }
3688
- }
3689
- }
3690
-
3691
- var didWarnAboutMessageChannel = false;
3692
- var enqueueTaskImpl = null;
3693
- function enqueueTask(task) {
3694
- if (enqueueTaskImpl === null) {
3695
- try {
3696
- // read require off the module object to get around the bundlers.
3697
- // we don't want them to detect a require and bundle a Node polyfill.
3698
- var requireString = ('require' + Math.random()).slice(0, 7);
3699
- var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
3700
- // version of setImmediate, bypassing fake timers if any.
3701
-
3702
- enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
3703
- } catch (_err) {
3704
- // we're in a browser
3705
- // we can't use regular timers because they may still be faked
3706
- // so we try MessageChannel+postMessage instead
3707
- enqueueTaskImpl = function (callback) {
3708
- {
3709
- if (didWarnAboutMessageChannel === false) {
3710
- didWarnAboutMessageChannel = true;
3711
-
3712
- if (typeof MessageChannel === 'undefined') {
3713
- 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.');
3714
- }
3715
- }
3716
- }
3717
-
3718
- var channel = new MessageChannel();
3719
- channel.port1.onmessage = callback;
3720
- channel.port2.postMessage(undefined);
3721
- };
3722
- }
3723
- }
3724
-
3725
- return enqueueTaskImpl(task);
3726
- }
3727
-
3728
- var actScopeDepth = 0;
3729
- var didWarnNoAwaitAct = false;
3730
- function act(callback) {
3731
- {
3732
- // `act` calls can be nested, so we track the depth. This represents the
3733
- // number of `act` scopes on the stack.
3734
- var prevActScopeDepth = actScopeDepth;
3735
- actScopeDepth++;
3736
-
3737
- if (ReactCurrentActQueue.current === null) {
3738
- // This is the outermost `act` scope. Initialize the queue. The reconciler
3739
- // will detect the queue and use it instead of Scheduler.
3740
- ReactCurrentActQueue.current = [];
3741
- }
3742
-
3743
- var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
3744
- var result;
3745
-
3746
- try {
3747
- // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
3748
- // set to `true` while the given callback is executed, not for updates
3749
- // triggered during an async event, because this is how the legacy
3750
- // implementation of `act` behaved.
3751
- ReactCurrentActQueue.isBatchingLegacy = true;
3752
- result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
3753
- // which flushed updates immediately after the scope function exits, even
3754
- // if it's an async function.
3755
-
3756
- if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
3757
- var queue = ReactCurrentActQueue.current;
3758
-
3759
- if (queue !== null) {
3760
- ReactCurrentActQueue.didScheduleLegacyUpdate = false;
3761
- flushActQueue(queue);
3762
- }
3763
- }
3764
- } catch (error) {
3765
- popActScope(prevActScopeDepth);
3766
- throw error;
3767
- } finally {
3768
- ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
3769
- }
3770
-
3771
- if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
3772
- var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
3773
- // for it to resolve before exiting the current scope.
3774
-
3775
- var wasAwaited = false;
3776
- var thenable = {
3777
- then: function (resolve, reject) {
3778
- wasAwaited = true;
3779
- thenableResult.then(function (returnValue) {
3780
- popActScope(prevActScopeDepth);
3781
-
3782
- if (actScopeDepth === 0) {
3783
- // We've exited the outermost act scope. Recursively flush the
3784
- // queue until there's no remaining work.
3785
- recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3786
- } else {
3787
- resolve(returnValue);
3788
- }
3789
- }, function (error) {
3790
- // The callback threw an error.
3791
- popActScope(prevActScopeDepth);
3792
- reject(error);
3793
- });
3794
- }
3795
- };
3796
-
3797
- {
3798
- if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
3799
- // eslint-disable-next-line no-undef
3800
- Promise.resolve().then(function () {}).then(function () {
3801
- if (!wasAwaited) {
3802
- didWarnNoAwaitAct = true;
3803
-
3804
- 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 () => ...);');
3805
- }
3806
- });
3807
- }
3808
- }
3809
-
3810
- return thenable;
3811
- } else {
3812
- var returnValue = result; // The callback is not an async function. Exit the current scope
3813
- // immediately, without awaiting.
3814
-
3815
- popActScope(prevActScopeDepth);
3816
-
3817
- if (actScopeDepth === 0) {
3818
- // Exiting the outermost act scope. Flush the queue.
3819
- var _queue = ReactCurrentActQueue.current;
3820
-
3821
- if (_queue !== null) {
3822
- flushActQueue(_queue);
3823
- ReactCurrentActQueue.current = null;
3824
- } // Return a thenable. If the user awaits it, we'll flush again in
3825
- // case additional work was scheduled by a microtask.
3826
-
3827
-
3828
- var _thenable = {
3829
- then: function (resolve, reject) {
3830
- // Confirm we haven't re-entered another `act` scope, in case
3831
- // the user does something weird like await the thenable
3832
- // multiple times.
3833
- if (ReactCurrentActQueue.current === null) {
3834
- // Recursively flush the queue until there's no remaining work.
3835
- ReactCurrentActQueue.current = [];
3836
- recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3837
- } else {
3838
- resolve(returnValue);
3839
- }
3840
- }
3841
- };
3842
- return _thenable;
3843
- } else {
3844
- // Since we're inside a nested `act` scope, the returned thenable
3845
- // immediately resolves. The outer scope will flush the queue.
3846
- var _thenable2 = {
3847
- then: function (resolve, reject) {
3848
- resolve(returnValue);
3849
- }
3850
- };
3851
- return _thenable2;
3852
- }
3853
- }
3854
- }
3855
- }
3856
-
3857
- function popActScope(prevActScopeDepth) {
3858
- {
3859
- if (prevActScopeDepth !== actScopeDepth - 1) {
3860
- error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
3861
- }
3862
-
3863
- actScopeDepth = prevActScopeDepth;
3864
- }
3865
- }
3866
-
3867
- function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
3868
- {
3869
- var queue = ReactCurrentActQueue.current;
3870
-
3871
- if (queue !== null) {
3872
- try {
3873
- flushActQueue(queue);
3874
- enqueueTask(function () {
3875
- if (queue.length === 0) {
3876
- // No additional work was scheduled. Finish.
3877
- ReactCurrentActQueue.current = null;
3878
- resolve(returnValue);
3879
- } else {
3880
- // Keep flushing work until there's none left.
3881
- recursivelyFlushAsyncActWork(returnValue, resolve, reject);
3882
- }
3883
- });
3884
- } catch (error) {
3885
- reject(error);
3886
- }
3887
- } else {
3888
- resolve(returnValue);
3889
- }
3890
- }
3891
- }
3892
-
3893
- var isFlushing = false;
3894
-
3895
- function flushActQueue(queue) {
3896
- {
3897
- if (!isFlushing) {
3898
- // Prevent re-entrance.
3899
- isFlushing = true;
3900
- var i = 0;
3901
-
3902
- try {
3903
- for (; i < queue.length; i++) {
3904
- var callback = queue[i];
3905
-
3906
- do {
3907
- callback = callback(true);
3908
- } while (callback !== null);
3909
- }
3910
-
3911
- queue.length = 0;
3912
- } catch (error) {
3913
- // If something throws, leave the remaining callbacks on the queue.
3914
- queue = queue.slice(i + 1);
3915
- throw error;
3916
- } finally {
3917
- isFlushing = false;
3918
- }
3919
- }
3920
- }
3921
- }
3922
-
3923
- var createElement$1 = createElementWithValidation ;
3924
- var cloneElement$1 = cloneElementWithValidation ;
3925
- var createFactory = createFactoryWithValidation ;
3926
- var Children = {
3927
- map: mapChildren,
3928
- forEach: forEachChildren,
3929
- count: countChildren,
3930
- toArray: toArray,
3931
- only: onlyChild
3932
- };
3933
-
3934
- exports.Children = Children;
3935
- exports.Component = Component;
3936
- exports.Fragment = REACT_FRAGMENT_TYPE;
3937
- exports.Profiler = REACT_PROFILER_TYPE;
3938
- exports.PureComponent = PureComponent;
3939
- exports.StrictMode = REACT_STRICT_MODE_TYPE;
3940
- exports.Suspense = REACT_SUSPENSE_TYPE;
3941
- exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
3942
- exports.act = act;
3943
- exports.cloneElement = cloneElement$1;
3944
- exports.createContext = createContext;
3945
- exports.createElement = createElement$1;
3946
- exports.createFactory = createFactory;
3947
- exports.createRef = createRef;
3948
- exports.forwardRef = forwardRef;
3949
- exports.isValidElement = isValidElement;
3950
- exports.lazy = lazy;
3951
- exports.memo = memo;
3952
- exports.startTransition = startTransition;
3953
- exports.unstable_act = act;
3954
- exports.useCallback = useCallback;
3955
- exports.useContext = useContext;
3956
- exports.useDebugValue = useDebugValue;
3957
- exports.useDeferredValue = useDeferredValue;
3958
- exports.useEffect = useEffect;
3959
- exports.useId = useId;
3960
- exports.useImperativeHandle = useImperativeHandle;
3961
- exports.useInsertionEffect = useInsertionEffect;
3962
- exports.useLayoutEffect = useLayoutEffect;
3963
- exports.useMemo = useMemo;
3964
- exports.useReducer = useReducer;
3965
- exports.useRef = useRef;
3966
- exports.useState = useState;
3967
- exports.useSyncExternalStore = useSyncExternalStore;
3968
- exports.useTransition = useTransition;
3969
- exports.version = ReactVersion;
3970
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
3971
- if (
3972
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
3973
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
3974
- 'function'
3975
- ) {
3976
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
3977
- }
3978
-
3979
- })();
3980
- }
3981
- } (react_development, react_development.exports));
3982
- return react_development.exports;
3983
- }
3984
-
3985
- if (process.env.NODE_ENV === 'production') {
3986
- react.exports = requireReact_production_min();
3987
- } else {
3988
- react.exports = requireReact_development();
3989
- }
3990
-
3991
- var reactExports = react.exports;
3992
- var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
3993
-
3994
- var React$1 = /*#__PURE__*/_mergeNamespaces({
3995
- __proto__: null,
3996
- default: React
3997
- }, [reactExports]);
3998
-
3999
1183
  /*
4000
1184
 
4001
1185
  Based off glamor's StyleSheet, thanks Sunil ❤️
@@ -6134,13 +3318,13 @@ var syncFallback = function syncFallback(create) {
6134
3318
  return create();
6135
3319
  };
6136
3320
 
6137
- var useInsertionEffect = React$1['useInsertion' + 'Effect'] ? React$1['useInsertion' + 'Effect'] : false;
3321
+ var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;
6138
3322
  var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$1 ? syncFallback : useInsertionEffect || syncFallback;
6139
3323
 
6140
3324
  var isBrowser = typeof document !== 'undefined';
6141
3325
  var hasOwnProperty = {}.hasOwnProperty;
6142
3326
 
6143
- var EmotionCacheContext = /* #__PURE__ */reactExports.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
3327
+ var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
6144
3328
  // because this module is primarily intended for the browser and node
6145
3329
  // but it's also required in react native and similar environments sometimes
6146
3330
  // and we could have a special build just for that
@@ -6158,9 +3342,9 @@ EmotionCacheContext.Provider;
6158
3342
 
6159
3343
  var withEmotionCache = function withEmotionCache(func) {
6160
3344
  // $FlowFixMe
6161
- return /*#__PURE__*/reactExports.forwardRef(function (props, ref) {
3345
+ return /*#__PURE__*/forwardRef(function (props, ref) {
6162
3346
  // the cache will never be null in the browser
6163
- var cache = reactExports.useContext(EmotionCacheContext);
3347
+ var cache = useContext(EmotionCacheContext);
6164
3348
  return func(props, cache, ref);
6165
3349
  });
6166
3350
  };
@@ -6168,7 +3352,7 @@ var withEmotionCache = function withEmotionCache(func) {
6168
3352
  if (!isBrowser) {
6169
3353
  withEmotionCache = function withEmotionCache(func) {
6170
3354
  return function (props) {
6171
- var cache = reactExports.useContext(EmotionCacheContext);
3355
+ var cache = useContext(EmotionCacheContext);
6172
3356
 
6173
3357
  if (cache === null) {
6174
3358
  // yes, we're potentially creating this on every render
@@ -6179,7 +3363,7 @@ if (!isBrowser) {
6179
3363
  cache = createCache({
6180
3364
  key: 'css'
6181
3365
  });
6182
- return /*#__PURE__*/reactExports.createElement(EmotionCacheContext.Provider, {
3366
+ return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {
6183
3367
  value: cache
6184
3368
  }, func(props, cache));
6185
3369
  } else {
@@ -6189,7 +3373,7 @@ if (!isBrowser) {
6189
3373
  };
6190
3374
  }
6191
3375
 
6192
- var ThemeContext = /* #__PURE__ */reactExports.createContext({});
3376
+ var ThemeContext = /* #__PURE__ */React.createContext({});
6193
3377
 
6194
3378
  if (process.env.NODE_ENV !== 'production') {
6195
3379
  ThemeContext.displayName = 'EmotionThemeContext';
@@ -6285,7 +3469,7 @@ var Insertion = function Insertion(_ref) {
6285
3469
  next = next.next;
6286
3470
  }
6287
3471
 
6288
- return /*#__PURE__*/reactExports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
3472
+ return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
6289
3473
  __html: rules
6290
3474
  }, _ref2.nonce = cache.sheet.nonce, _ref2));
6291
3475
  }
@@ -6312,7 +3496,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
6312
3496
  className = props.className + " ";
6313
3497
  }
6314
3498
 
6315
- var serialized = serializeStyles(registeredStyles, undefined, reactExports.useContext(ThemeContext));
3499
+ var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));
6316
3500
 
6317
3501
  if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
6318
3502
  var labelFromStack = props[labelPropName];
@@ -6333,11 +3517,11 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
6333
3517
 
6334
3518
  newProps.ref = ref;
6335
3519
  newProps.className = className;
6336
- return /*#__PURE__*/reactExports.createElement(reactExports.Fragment, null, /*#__PURE__*/reactExports.createElement(Insertion, {
3520
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
6337
3521
  cache: cache,
6338
3522
  serialized: serialized,
6339
3523
  isStringTag: typeof WrappedComponent === 'string'
6340
- }), /*#__PURE__*/reactExports.createElement(WrappedComponent, newProps));
3524
+ }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));
6341
3525
  });
6342
3526
 
6343
3527
  if (process.env.NODE_ENV !== 'production') {
@@ -8088,7 +5272,7 @@ function createReactContext(defaultValue, calculateChangedBits) {
8088
5272
  };
8089
5273
 
8090
5274
  return Provider;
8091
- }(reactExports.Component);
5275
+ }(Component);
8092
5276
 
8093
5277
  Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = PropTypes.object.isRequired, _Provider$childContex);
8094
5278
 
@@ -8151,7 +5335,7 @@ function createReactContext(defaultValue, calculateChangedBits) {
8151
5335
  };
8152
5336
 
8153
5337
  return Consumer;
8154
- }(reactExports.Component);
5338
+ }(Component);
8155
5339
 
8156
5340
  Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = PropTypes.object, _Consumer$contextType);
8157
5341
  return {
@@ -8160,7 +5344,7 @@ function createReactContext(defaultValue, calculateChangedBits) {
8160
5344
  };
8161
5345
  }
8162
5346
 
8163
- var index = React.createContext || createReactContext;
5347
+ var index = React__default.createContext || createReactContext;
8164
5348
 
8165
5349
  var pathToRegexp$2 = {exports: {}};
8166
5350
 
@@ -8921,21 +6105,21 @@ function (_React$Component) {
8921
6105
  };
8922
6106
 
8923
6107
  _proto.render = function render() {
8924
- return React.createElement(context.Provider, {
6108
+ return React__default.createElement(context.Provider, {
8925
6109
  value: {
8926
6110
  history: this.props.history,
8927
6111
  location: this.state.location,
8928
6112
  match: Router.computeRootMatch(this.state.location.pathname),
8929
6113
  staticContext: this.props.staticContext
8930
6114
  }
8931
- }, React.createElement(historyContext.Provider, {
6115
+ }, React__default.createElement(historyContext.Provider, {
8932
6116
  children: this.props.children || null,
8933
6117
  value: this.props.history
8934
6118
  }));
8935
6119
  };
8936
6120
 
8937
6121
  return Router;
8938
- }(React.Component);
6122
+ }(React__default.Component);
8939
6123
 
8940
6124
  if (process.env.NODE_ENV !== "production") {
8941
6125
  Router.propTypes = {
@@ -8973,14 +6157,14 @@ function (_React$Component) {
8973
6157
  var _proto = MemoryRouter.prototype;
8974
6158
 
8975
6159
  _proto.render = function render() {
8976
- return React.createElement(Router, {
6160
+ return React__default.createElement(Router, {
8977
6161
  history: this.history,
8978
6162
  children: this.props.children
8979
6163
  });
8980
6164
  };
8981
6165
 
8982
6166
  return MemoryRouter;
8983
- }(React.Component);
6167
+ }(React__default.Component);
8984
6168
 
8985
6169
  if (process.env.NODE_ENV !== "production") {
8986
6170
  MemoryRouter.propTypes = {
@@ -9024,7 +6208,7 @@ function (_React$Component) {
9024
6208
  };
9025
6209
 
9026
6210
  return Lifecycle;
9027
- }(React.Component);
6211
+ }(React__default.Component);
9028
6212
 
9029
6213
  if (process.env.NODE_ENV !== "production") {
9030
6214
  var messageType = PropTypes.oneOfType([PropTypes.func, PropTypes.string]);
@@ -9077,7 +6261,7 @@ function Redirect(_ref) {
9077
6261
  to = _ref.to,
9078
6262
  _ref$push = _ref.push,
9079
6263
  push = _ref$push === void 0 ? false : _ref$push;
9080
- return React.createElement(context.Consumer, null, function (context) {
6264
+ return React__default.createElement(context.Consumer, null, function (context) {
9081
6265
  !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Redirect> outside a <Router>") : invariant() : void 0;
9082
6266
  var history = context.history,
9083
6267
  staticContext = context.staticContext;
@@ -9092,7 +6276,7 @@ function Redirect(_ref) {
9092
6276
  return null;
9093
6277
  }
9094
6278
 
9095
- return React.createElement(Lifecycle, {
6279
+ return React__default.createElement(Lifecycle, {
9096
6280
  onMount: function onMount() {
9097
6281
  method(location);
9098
6282
  },
@@ -9199,7 +6383,7 @@ function matchPath(pathname, options) {
9199
6383
  }
9200
6384
 
9201
6385
  function isEmptyChildren(children) {
9202
- return React.Children.count(children) === 0;
6386
+ return React__default.Children.count(children) === 0;
9203
6387
  }
9204
6388
 
9205
6389
  function evalChildrenDev(children, props, path) {
@@ -9226,7 +6410,7 @@ function (_React$Component) {
9226
6410
  _proto.render = function render() {
9227
6411
  var _this = this;
9228
6412
 
9229
- return React.createElement(context.Consumer, null, function (context$1) {
6413
+ return React__default.createElement(context.Consumer, null, function (context$1) {
9230
6414
  !context$1 ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Route> outside a <Router>") : invariant() : void 0;
9231
6415
  var location = _this.props.location || context$1.location;
9232
6416
  var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
@@ -9247,14 +6431,14 @@ function (_React$Component) {
9247
6431
  children = null;
9248
6432
  }
9249
6433
 
9250
- return React.createElement(context.Provider, {
6434
+ return React__default.createElement(context.Provider, {
9251
6435
  value: props
9252
- }, props.match ? children ? typeof children === "function" ? process.env.NODE_ENV !== "production" ? evalChildrenDev(children, props, _this.props.path) : children(props) : children : component ? React.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? process.env.NODE_ENV !== "production" ? evalChildrenDev(children, props, _this.props.path) : children(props) : null);
6436
+ }, props.match ? children ? typeof children === "function" ? process.env.NODE_ENV !== "production" ? evalChildrenDev(children, props, _this.props.path) : children(props) : children : component ? React__default.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? process.env.NODE_ENV !== "production" ? evalChildrenDev(children, props, _this.props.path) : children(props) : null);
9253
6437
  });
9254
6438
  };
9255
6439
 
9256
6440
  return Route;
9257
- }(React.Component);
6441
+ }(React__default.Component);
9258
6442
 
9259
6443
  if (process.env.NODE_ENV !== "production") {
9260
6444
  Route.propTypes = {
@@ -9393,14 +6577,14 @@ function (_React$Component) {
9393
6577
  listen: this.handleListen,
9394
6578
  block: this.handleBlock
9395
6579
  };
9396
- return React.createElement(Router, _extends({}, rest, {
6580
+ return React__default.createElement(Router, _extends({}, rest, {
9397
6581
  history: history,
9398
6582
  staticContext: context
9399
6583
  }));
9400
6584
  };
9401
6585
 
9402
6586
  return StaticRouter;
9403
- }(React.Component);
6587
+ }(React__default.Component);
9404
6588
 
9405
6589
  if (process.env.NODE_ENV !== "production") {
9406
6590
  StaticRouter.propTypes = {
@@ -9432,7 +6616,7 @@ function (_React$Component) {
9432
6616
  _proto.render = function render() {
9433
6617
  var _this = this;
9434
6618
 
9435
- return React.createElement(context.Consumer, null, function (context) {
6619
+ return React__default.createElement(context.Consumer, null, function (context) {
9436
6620
  !context ? process.env.NODE_ENV !== "production" ? invariant(false, "You should not use <Switch> outside a <Router>") : invariant() : void 0;
9437
6621
  var location = _this.props.location || context.location;
9438
6622
  var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
@@ -9440,8 +6624,8 @@ function (_React$Component) {
9440
6624
  // to trigger an unmount/remount for two <Route>s that render the same
9441
6625
  // component at different URLs.
9442
6626
 
9443
- React.Children.forEach(_this.props.children, function (child) {
9444
- if (match == null && React.isValidElement(child)) {
6627
+ React__default.Children.forEach(_this.props.children, function (child) {
6628
+ if (match == null && React__default.isValidElement(child)) {
9445
6629
  element = child;
9446
6630
  var path = child.props.path || child.props.from;
9447
6631
  match = path ? matchPath(location.pathname, _extends({}, child.props, {
@@ -9449,7 +6633,7 @@ function (_React$Component) {
9449
6633
  })) : context.match;
9450
6634
  }
9451
6635
  });
9452
- return match ? React.cloneElement(element, {
6636
+ return match ? React__default.cloneElement(element, {
9453
6637
  location: location,
9454
6638
  computedMatch: match
9455
6639
  }) : null;
@@ -9457,7 +6641,7 @@ function (_React$Component) {
9457
6641
  };
9458
6642
 
9459
6643
  return Switch;
9460
- }(React.Component);
6644
+ }(React__default.Component);
9461
6645
 
9462
6646
  if (process.env.NODE_ENV !== "production") {
9463
6647
  Switch.propTypes = {
@@ -9471,7 +6655,7 @@ if (process.env.NODE_ENV !== "production") {
9471
6655
  };
9472
6656
  }
9473
6657
 
9474
- React.useContext;
6658
+ React__default.useContext;
9475
6659
 
9476
6660
  if (process.env.NODE_ENV !== "production") {
9477
6661
  if (typeof window !== "undefined") {