willba-component-library 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +312 -626
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +312 -626
- package/dist/esm/index.js.map +1 -1
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -8,8 +8,105 @@ var react = {exports: {}};
|
|
|
8
8
|
|
|
9
9
|
var react_production_min = {};
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/*
|
|
12
|
+
object-assign
|
|
13
|
+
(c) Sindre Sorhus
|
|
14
|
+
@license MIT
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var objectAssign;
|
|
18
|
+
var hasRequiredObjectAssign;
|
|
19
|
+
|
|
20
|
+
function requireObjectAssign () {
|
|
21
|
+
if (hasRequiredObjectAssign) return objectAssign;
|
|
22
|
+
hasRequiredObjectAssign = 1;
|
|
23
|
+
/* eslint-disable no-unused-vars */
|
|
24
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
25
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
26
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
27
|
+
|
|
28
|
+
function toObject(val) {
|
|
29
|
+
if (val === null || val === undefined) {
|
|
30
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return Object(val);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function shouldUseNative() {
|
|
37
|
+
try {
|
|
38
|
+
if (!Object.assign) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
43
|
+
|
|
44
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
45
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
46
|
+
test1[5] = 'de';
|
|
47
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
52
|
+
var test2 = {};
|
|
53
|
+
for (var i = 0; i < 10; i++) {
|
|
54
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
55
|
+
}
|
|
56
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
57
|
+
return test2[n];
|
|
58
|
+
});
|
|
59
|
+
if (order2.join('') !== '0123456789') {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
64
|
+
var test3 = {};
|
|
65
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
66
|
+
test3[letter] = letter;
|
|
67
|
+
});
|
|
68
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
69
|
+
'abcdefghijklmnopqrst') {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return true;
|
|
74
|
+
} catch (err) {
|
|
75
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
81
|
+
var from;
|
|
82
|
+
var to = toObject(target);
|
|
83
|
+
var symbols;
|
|
84
|
+
|
|
85
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
86
|
+
from = Object(arguments[s]);
|
|
87
|
+
|
|
88
|
+
for (var key in from) {
|
|
89
|
+
if (hasOwnProperty.call(from, key)) {
|
|
90
|
+
to[key] = from[key];
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (getOwnPropertySymbols) {
|
|
95
|
+
symbols = getOwnPropertySymbols(from);
|
|
96
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
97
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
98
|
+
to[symbols[i]] = from[symbols[i]];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return to;
|
|
105
|
+
};
|
|
106
|
+
return objectAssign;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** @license React v17.0.2
|
|
13
110
|
* react.production.min.js
|
|
14
111
|
*
|
|
15
112
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -23,30 +120,27 @@ var hasRequiredReact_production_min;
|
|
|
23
120
|
function requireReact_production_min () {
|
|
24
121
|
if (hasRequiredReact_production_min) return react_production_min;
|
|
25
122
|
hasRequiredReact_production_min = 1;
|
|
26
|
-
var l=
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
function
|
|
32
|
-
function
|
|
33
|
-
a
|
|
34
|
-
|
|
35
|
-
var
|
|
36
|
-
react_production_min.
|
|
37
|
-
react_production_min.cloneElement=function(a,b,
|
|
38
|
-
|
|
39
|
-
react_production_min.
|
|
40
|
-
react_production_min.
|
|
41
|
-
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)};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)};
|
|
42
|
-
react_production_min.useTransition=function(){return U.current.useTransition()};react_production_min.version="18.2.0";
|
|
123
|
+
var l=requireObjectAssign(),n=60103,p=60106;react_production_min.Fragment=60107;react_production_min.StrictMode=60108;react_production_min.Profiler=60114;var q=60109,r=60110,t=60112;react_production_min.Suspense=60113;var u=60115,v=60116;
|
|
124
|
+
if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");react_production_min.Fragment=w("react.fragment");react_production_min.StrictMode=w("react.strict_mode");react_production_min.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");react_production_min.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;
|
|
125
|
+
function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
|
126
|
+
var A={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState");};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
|
|
127
|
+
function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}var F=E.prototype=new D;F.constructor=E;l(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
|
|
128
|
+
function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f;}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return {$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
|
|
129
|
+
function K(a,b){return {$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return "object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
|
|
130
|
+
function O(a,b,c,e,d){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 n:case p:h=!0;}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
|
|
131
|
+
0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d);}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
|
|
132
|
+
function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b);},function(b){0===a._status&&(a._status=2,a._result=b);});}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:l};
|
|
133
|
+
react_production_min.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments);},c);},count:function(a){var b=0;P(a,function(){b++;});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};react_production_min.Component=C;react_production_min.PureComponent=E;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
|
|
134
|
+
react_production_min.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=l({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g;}return {$$typeof:n,type:a.type,
|
|
135
|
+
key:d,ref:k,props:e,_owner:h}};react_production_min.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};react_production_min.createElement=J;react_production_min.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};react_production_min.createRef=function(){return {current:null}};react_production_min.forwardRef=function(a){return {$$typeof:t,render:a}};react_production_min.isValidElement=L;
|
|
136
|
+
react_production_min.lazy=function(a){return {$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};react_production_min.memo=function(a,b){return {$$typeof:u,type:a,compare:void 0===b?null:b}};react_production_min.useCallback=function(a,b){return S().useCallback(a,b)};react_production_min.useContext=function(a,b){return S().useContext(a,b)};react_production_min.useDebugValue=function(){};react_production_min.useEffect=function(a,b){return S().useEffect(a,b)};react_production_min.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
|
|
137
|
+
react_production_min.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};react_production_min.useMemo=function(a,b){return S().useMemo(a,b)};react_production_min.useReducer=function(a,b,c){return S().useReducer(a,b,c)};react_production_min.useRef=function(a){return S().useRef(a)};react_production_min.useState=function(a){return S().useState(a)};react_production_min.version="17.0.2";
|
|
43
138
|
return react_production_min;
|
|
44
139
|
}
|
|
45
140
|
|
|
46
|
-
var react_development = {
|
|
141
|
+
var react_development = {};
|
|
47
142
|
|
|
48
|
-
/**
|
|
49
|
-
* @license React
|
|
143
|
+
/** @license React v17.0.2
|
|
50
144
|
* react.development.js
|
|
51
145
|
*
|
|
52
146
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -54,46 +148,70 @@ var react_development = {exports: {}};
|
|
|
54
148
|
* This source code is licensed under the MIT license found in the
|
|
55
149
|
* LICENSE file in the root directory of this source tree.
|
|
56
150
|
*/
|
|
57
|
-
react_development.exports;
|
|
58
151
|
|
|
59
152
|
var hasRequiredReact_development;
|
|
60
153
|
|
|
61
154
|
function requireReact_development () {
|
|
62
|
-
if (hasRequiredReact_development) return react_development
|
|
155
|
+
if (hasRequiredReact_development) return react_development;
|
|
63
156
|
hasRequiredReact_development = 1;
|
|
64
|
-
(function (
|
|
157
|
+
(function (exports) {
|
|
65
158
|
|
|
66
159
|
if (process.env.NODE_ENV !== "production") {
|
|
67
160
|
(function() {
|
|
68
161
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'function'
|
|
74
|
-
) {
|
|
75
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
76
|
-
}
|
|
77
|
-
var ReactVersion = '18.2.0';
|
|
162
|
+
var _assign = requireObjectAssign();
|
|
163
|
+
|
|
164
|
+
// TODO: this is special because it gets imported during build.
|
|
165
|
+
var ReactVersion = '17.0.2';
|
|
78
166
|
|
|
79
167
|
// ATTENTION
|
|
80
168
|
// When adding new symbols to this file,
|
|
81
169
|
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
82
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
83
|
-
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
var
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
var
|
|
170
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
171
|
+
// nor polyfill, then a plain number is used for performance.
|
|
172
|
+
var REACT_ELEMENT_TYPE = 0xeac7;
|
|
173
|
+
var REACT_PORTAL_TYPE = 0xeaca;
|
|
174
|
+
exports.Fragment = 0xeacb;
|
|
175
|
+
exports.StrictMode = 0xeacc;
|
|
176
|
+
exports.Profiler = 0xead2;
|
|
177
|
+
var REACT_PROVIDER_TYPE = 0xeacd;
|
|
178
|
+
var REACT_CONTEXT_TYPE = 0xeace;
|
|
179
|
+
var REACT_FORWARD_REF_TYPE = 0xead0;
|
|
180
|
+
exports.Suspense = 0xead1;
|
|
181
|
+
var REACT_SUSPENSE_LIST_TYPE = 0xead8;
|
|
182
|
+
var REACT_MEMO_TYPE = 0xead3;
|
|
183
|
+
var REACT_LAZY_TYPE = 0xead4;
|
|
184
|
+
var REACT_BLOCK_TYPE = 0xead9;
|
|
185
|
+
var REACT_SERVER_BLOCK_TYPE = 0xeada;
|
|
186
|
+
var REACT_FUNDAMENTAL_TYPE = 0xead5;
|
|
187
|
+
var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
|
|
188
|
+
var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
|
|
189
|
+
|
|
190
|
+
if (typeof Symbol === 'function' && Symbol.for) {
|
|
191
|
+
var symbolFor = Symbol.for;
|
|
192
|
+
REACT_ELEMENT_TYPE = symbolFor('react.element');
|
|
193
|
+
REACT_PORTAL_TYPE = symbolFor('react.portal');
|
|
194
|
+
exports.Fragment = symbolFor('react.fragment');
|
|
195
|
+
exports.StrictMode = symbolFor('react.strict_mode');
|
|
196
|
+
exports.Profiler = symbolFor('react.profiler');
|
|
197
|
+
REACT_PROVIDER_TYPE = symbolFor('react.provider');
|
|
198
|
+
REACT_CONTEXT_TYPE = symbolFor('react.context');
|
|
199
|
+
REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
|
|
200
|
+
exports.Suspense = symbolFor('react.suspense');
|
|
201
|
+
REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
|
|
202
|
+
REACT_MEMO_TYPE = symbolFor('react.memo');
|
|
203
|
+
REACT_LAZY_TYPE = symbolFor('react.lazy');
|
|
204
|
+
REACT_BLOCK_TYPE = symbolFor('react.block');
|
|
205
|
+
REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
|
|
206
|
+
REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
|
|
207
|
+
symbolFor('react.scope');
|
|
208
|
+
symbolFor('react.opaque.id');
|
|
209
|
+
REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
|
|
210
|
+
symbolFor('react.offscreen');
|
|
211
|
+
REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
97
215
|
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
98
216
|
function getIteratorFn(maybeIterable) {
|
|
99
217
|
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
@@ -125,14 +243,7 @@ function requireReact_development () {
|
|
|
125
243
|
* should suspend for if it needs to.
|
|
126
244
|
*/
|
|
127
245
|
var ReactCurrentBatchConfig = {
|
|
128
|
-
transition:
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
var ReactCurrentActQueue = {
|
|
132
|
-
current: null,
|
|
133
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
134
|
-
isBatchingLegacy: false,
|
|
135
|
-
didScheduleLegacyUpdate: false
|
|
246
|
+
transition: 0
|
|
136
247
|
};
|
|
137
248
|
|
|
138
249
|
/**
|
|
@@ -185,27 +296,24 @@ function requireReact_development () {
|
|
|
185
296
|
};
|
|
186
297
|
}
|
|
187
298
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
195
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
196
|
-
// issues in DEV builds.
|
|
197
|
-
|
|
198
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
299
|
+
/**
|
|
300
|
+
* Used by act() to track whether you're inside an act() scope.
|
|
301
|
+
*/
|
|
302
|
+
var IsSomeRendererActing = {
|
|
303
|
+
current: false
|
|
304
|
+
};
|
|
199
305
|
|
|
200
306
|
var ReactSharedInternals = {
|
|
201
307
|
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
202
308
|
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
203
|
-
ReactCurrentOwner: ReactCurrentOwner
|
|
309
|
+
ReactCurrentOwner: ReactCurrentOwner,
|
|
310
|
+
IsSomeRendererActing: IsSomeRendererActing,
|
|
311
|
+
// Used by renderers to avoid bundling object-assign twice in UMD bundles:
|
|
312
|
+
assign: _assign
|
|
204
313
|
};
|
|
205
314
|
|
|
206
315
|
{
|
|
207
316
|
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
208
|
-
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
209
317
|
}
|
|
210
318
|
|
|
211
319
|
// by calls to these methods by a Babel plugin.
|
|
@@ -215,24 +323,20 @@ function requireReact_development () {
|
|
|
215
323
|
|
|
216
324
|
function warn(format) {
|
|
217
325
|
{
|
|
218
|
-
{
|
|
219
|
-
|
|
220
|
-
args[_key - 1] = arguments[_key];
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
printWarning('warn', format, args);
|
|
326
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
327
|
+
args[_key - 1] = arguments[_key];
|
|
224
328
|
}
|
|
329
|
+
|
|
330
|
+
printWarning('warn', format, args);
|
|
225
331
|
}
|
|
226
332
|
}
|
|
227
333
|
function error(format) {
|
|
228
334
|
{
|
|
229
|
-
{
|
|
230
|
-
|
|
231
|
-
args[_key2 - 1] = arguments[_key2];
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
printWarning('error', format, args);
|
|
335
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
336
|
+
args[_key2 - 1] = arguments[_key2];
|
|
235
337
|
}
|
|
338
|
+
|
|
339
|
+
printWarning('error', format, args);
|
|
236
340
|
}
|
|
237
341
|
}
|
|
238
342
|
|
|
@@ -246,11 +350,10 @@ function requireReact_development () {
|
|
|
246
350
|
if (stack !== '') {
|
|
247
351
|
format += '%s';
|
|
248
352
|
args = args.concat([stack]);
|
|
249
|
-
}
|
|
250
|
-
|
|
353
|
+
}
|
|
251
354
|
|
|
252
355
|
var argsWithFormat = args.map(function (item) {
|
|
253
|
-
return
|
|
356
|
+
return '' + item;
|
|
254
357
|
}); // Careful: RN currently depends on this prefix
|
|
255
358
|
|
|
256
359
|
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
@@ -348,8 +451,6 @@ function requireReact_development () {
|
|
|
348
451
|
}
|
|
349
452
|
};
|
|
350
453
|
|
|
351
|
-
var assign = Object.assign;
|
|
352
|
-
|
|
353
454
|
var emptyObject = {};
|
|
354
455
|
|
|
355
456
|
{
|
|
@@ -398,8 +499,10 @@ function requireReact_development () {
|
|
|
398
499
|
*/
|
|
399
500
|
|
|
400
501
|
Component.prototype.setState = function (partialState, callback) {
|
|
401
|
-
if (typeof partialState
|
|
402
|
-
|
|
502
|
+
if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
|
|
503
|
+
{
|
|
504
|
+
throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
|
|
505
|
+
}
|
|
403
506
|
}
|
|
404
507
|
|
|
405
508
|
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
@@ -471,7 +574,8 @@ function requireReact_development () {
|
|
|
471
574
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
472
575
|
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
473
576
|
|
|
474
|
-
|
|
577
|
+
_assign(pureComponentPrototype, Component.prototype);
|
|
578
|
+
|
|
475
579
|
pureComponentPrototype.isPureReactComponent = true;
|
|
476
580
|
|
|
477
581
|
// an immutable object with a single mutable value
|
|
@@ -487,97 +591,16 @@ function requireReact_development () {
|
|
|
487
591
|
return refObject;
|
|
488
592
|
}
|
|
489
593
|
|
|
490
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
491
|
-
|
|
492
|
-
function isArray(a) {
|
|
493
|
-
return isArrayImpl(a);
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
/*
|
|
497
|
-
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
498
|
-
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
499
|
-
*
|
|
500
|
-
* The functions in this module will throw an easier-to-understand,
|
|
501
|
-
* easier-to-debug exception with a clear errors message message explaining the
|
|
502
|
-
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
503
|
-
* of the `value` object).
|
|
504
|
-
*/
|
|
505
|
-
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
506
|
-
function typeName(value) {
|
|
507
|
-
{
|
|
508
|
-
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
509
|
-
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
510
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
511
|
-
return type;
|
|
512
|
-
}
|
|
513
|
-
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
function willCoercionThrow(value) {
|
|
517
|
-
{
|
|
518
|
-
try {
|
|
519
|
-
testStringCoercion(value);
|
|
520
|
-
return false;
|
|
521
|
-
} catch (e) {
|
|
522
|
-
return true;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
function testStringCoercion(value) {
|
|
528
|
-
// If you ended up here by following an exception call stack, here's what's
|
|
529
|
-
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
530
|
-
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
531
|
-
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
532
|
-
//
|
|
533
|
-
// The most common types that will cause this exception are `Symbol` instances
|
|
534
|
-
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
535
|
-
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
536
|
-
// exception. (Library authors do this to prevent users from using built-in
|
|
537
|
-
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
538
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
539
|
-
//
|
|
540
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
541
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
542
|
-
//
|
|
543
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
544
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
545
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
546
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
547
|
-
// In most cases, this console output also shows the component and its
|
|
548
|
-
// ancestor components where the exception happened.
|
|
549
|
-
//
|
|
550
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
551
|
-
return '' + value;
|
|
552
|
-
}
|
|
553
|
-
function checkKeyStringCoercion(value) {
|
|
554
|
-
{
|
|
555
|
-
if (willCoercionThrow(value)) {
|
|
556
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
557
|
-
|
|
558
|
-
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
594
|
function getWrappedName(outerType, innerType, wrapperName) {
|
|
564
|
-
var displayName = outerType.displayName;
|
|
565
|
-
|
|
566
|
-
if (displayName) {
|
|
567
|
-
return displayName;
|
|
568
|
-
}
|
|
569
|
-
|
|
570
595
|
var functionName = innerType.displayName || innerType.name || '';
|
|
571
|
-
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
572
|
-
}
|
|
573
|
-
|
|
596
|
+
return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
|
|
597
|
+
}
|
|
574
598
|
|
|
575
599
|
function getContextName(type) {
|
|
576
600
|
return type.displayName || 'Context';
|
|
577
|
-
}
|
|
578
|
-
|
|
601
|
+
}
|
|
579
602
|
|
|
580
|
-
function
|
|
603
|
+
function getComponentName(type) {
|
|
581
604
|
if (type == null) {
|
|
582
605
|
// Host root, text node or just invalid type.
|
|
583
606
|
return null;
|
|
@@ -585,7 +608,7 @@ function requireReact_development () {
|
|
|
585
608
|
|
|
586
609
|
{
|
|
587
610
|
if (typeof type.tag === 'number') {
|
|
588
|
-
error('Received an unexpected object in
|
|
611
|
+
error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
589
612
|
}
|
|
590
613
|
}
|
|
591
614
|
|
|
@@ -598,24 +621,23 @@ function requireReact_development () {
|
|
|
598
621
|
}
|
|
599
622
|
|
|
600
623
|
switch (type) {
|
|
601
|
-
case
|
|
624
|
+
case exports.Fragment:
|
|
602
625
|
return 'Fragment';
|
|
603
626
|
|
|
604
627
|
case REACT_PORTAL_TYPE:
|
|
605
628
|
return 'Portal';
|
|
606
629
|
|
|
607
|
-
case
|
|
630
|
+
case exports.Profiler:
|
|
608
631
|
return 'Profiler';
|
|
609
632
|
|
|
610
|
-
case
|
|
633
|
+
case exports.StrictMode:
|
|
611
634
|
return 'StrictMode';
|
|
612
635
|
|
|
613
|
-
case
|
|
636
|
+
case exports.Suspense:
|
|
614
637
|
return 'Suspense';
|
|
615
638
|
|
|
616
639
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
617
640
|
return 'SuspenseList';
|
|
618
|
-
|
|
619
641
|
}
|
|
620
642
|
|
|
621
643
|
if (typeof type === 'object') {
|
|
@@ -632,13 +654,10 @@ function requireReact_development () {
|
|
|
632
654
|
return getWrappedName(type, type.render, 'ForwardRef');
|
|
633
655
|
|
|
634
656
|
case REACT_MEMO_TYPE:
|
|
635
|
-
|
|
657
|
+
return getComponentName(type.type);
|
|
636
658
|
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
return getComponentNameFromType(type.type) || 'Memo';
|
|
659
|
+
case REACT_BLOCK_TYPE:
|
|
660
|
+
return getComponentName(type._render);
|
|
642
661
|
|
|
643
662
|
case REACT_LAZY_TYPE:
|
|
644
663
|
{
|
|
@@ -647,13 +666,11 @@ function requireReact_development () {
|
|
|
647
666
|
var init = lazyComponent._init;
|
|
648
667
|
|
|
649
668
|
try {
|
|
650
|
-
return
|
|
669
|
+
return getComponentName(init(payload));
|
|
651
670
|
} catch (x) {
|
|
652
671
|
return null;
|
|
653
672
|
}
|
|
654
673
|
}
|
|
655
|
-
|
|
656
|
-
// eslint-disable-next-line no-fallthrough
|
|
657
674
|
}
|
|
658
675
|
}
|
|
659
676
|
|
|
@@ -661,7 +678,6 @@ function requireReact_development () {
|
|
|
661
678
|
}
|
|
662
679
|
|
|
663
680
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
664
|
-
|
|
665
681
|
var RESERVED_PROPS = {
|
|
666
682
|
key: true,
|
|
667
683
|
ref: true,
|
|
@@ -741,7 +757,7 @@ function requireReact_development () {
|
|
|
741
757
|
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
742
758
|
{
|
|
743
759
|
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
744
|
-
var componentName =
|
|
760
|
+
var componentName = getComponentName(ReactCurrentOwner.current.type);
|
|
745
761
|
|
|
746
762
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
747
763
|
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);
|
|
@@ -850,10 +866,6 @@ function requireReact_development () {
|
|
|
850
866
|
}
|
|
851
867
|
|
|
852
868
|
if (hasValidKey(config)) {
|
|
853
|
-
{
|
|
854
|
-
checkKeyStringCoercion(config.key);
|
|
855
|
-
}
|
|
856
|
-
|
|
857
869
|
key = '' + config.key;
|
|
858
870
|
}
|
|
859
871
|
|
|
@@ -926,13 +938,16 @@ function requireReact_development () {
|
|
|
926
938
|
*/
|
|
927
939
|
|
|
928
940
|
function cloneElement(element, config, children) {
|
|
929
|
-
if (element === null || element === undefined) {
|
|
930
|
-
|
|
941
|
+
if (!!(element === null || element === undefined)) {
|
|
942
|
+
{
|
|
943
|
+
throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
|
|
944
|
+
}
|
|
931
945
|
}
|
|
932
946
|
|
|
933
947
|
var propName; // Original props are copied
|
|
934
948
|
|
|
935
|
-
var props =
|
|
949
|
+
var props = _assign({}, element.props); // Reserved names are extracted
|
|
950
|
+
|
|
936
951
|
|
|
937
952
|
var key = element.key;
|
|
938
953
|
var ref = element.ref; // Self is preserved since the owner is preserved.
|
|
@@ -953,10 +968,6 @@ function requireReact_development () {
|
|
|
953
968
|
}
|
|
954
969
|
|
|
955
970
|
if (hasValidKey(config)) {
|
|
956
|
-
{
|
|
957
|
-
checkKeyStringCoercion(config.key);
|
|
958
|
-
}
|
|
959
|
-
|
|
960
971
|
key = '' + config.key;
|
|
961
972
|
} // Remaining properties override existing props
|
|
962
973
|
|
|
@@ -1055,10 +1066,6 @@ function requireReact_development () {
|
|
|
1055
1066
|
// that we don't block potential future ES APIs.
|
|
1056
1067
|
if (typeof element === 'object' && element !== null && element.key != null) {
|
|
1057
1068
|
// Explicit key
|
|
1058
|
-
{
|
|
1059
|
-
checkKeyStringCoercion(element.key);
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
1069
|
return escape('' + element.key);
|
|
1063
1070
|
} // Implicit key determined by the index in the set
|
|
1064
1071
|
|
|
@@ -1102,7 +1109,7 @@ function requireReact_development () {
|
|
|
1102
1109
|
|
|
1103
1110
|
var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
1104
1111
|
|
|
1105
|
-
if (isArray(mappedChild)) {
|
|
1112
|
+
if (Array.isArray(mappedChild)) {
|
|
1106
1113
|
var escapedChildKey = '';
|
|
1107
1114
|
|
|
1108
1115
|
if (childKey != null) {
|
|
@@ -1114,20 +1121,10 @@ function requireReact_development () {
|
|
|
1114
1121
|
});
|
|
1115
1122
|
} else if (mappedChild != null) {
|
|
1116
1123
|
if (isValidElement(mappedChild)) {
|
|
1117
|
-
{
|
|
1118
|
-
// The `if` statement here prevents auto-disabling of the safe
|
|
1119
|
-
// coercion ESLint rule, so we must manually disable it below.
|
|
1120
|
-
// $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1121
|
-
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
1122
|
-
checkKeyStringCoercion(mappedChild.key);
|
|
1123
|
-
}
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
1124
|
mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
|
|
1127
1125
|
// traverseAllChildren used to do for objects as children
|
|
1128
1126
|
escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1129
1127
|
mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
|
|
1130
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
1131
1128
|
escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
|
1132
1129
|
}
|
|
1133
1130
|
|
|
@@ -1143,7 +1140,7 @@ function requireReact_development () {
|
|
|
1143
1140
|
|
|
1144
1141
|
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1145
1142
|
|
|
1146
|
-
if (isArray(children)) {
|
|
1143
|
+
if (Array.isArray(children)) {
|
|
1147
1144
|
for (var i = 0; i < children.length; i++) {
|
|
1148
1145
|
child = children[i];
|
|
1149
1146
|
nextName = nextNamePrefix + getElementKey(child, i);
|
|
@@ -1176,9 +1173,13 @@ function requireReact_development () {
|
|
|
1176
1173
|
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1177
1174
|
}
|
|
1178
1175
|
} else if (type === 'object') {
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1176
|
+
var childrenString = '' + children;
|
|
1177
|
+
|
|
1178
|
+
{
|
|
1179
|
+
{
|
|
1180
|
+
throw 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." );
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1182
1183
|
}
|
|
1183
1184
|
}
|
|
1184
1185
|
|
|
@@ -1277,17 +1278,28 @@ function requireReact_development () {
|
|
|
1277
1278
|
|
|
1278
1279
|
function onlyChild(children) {
|
|
1279
1280
|
if (!isValidElement(children)) {
|
|
1280
|
-
|
|
1281
|
+
{
|
|
1282
|
+
throw Error( "React.Children.only expected to receive a single React element child." );
|
|
1283
|
+
}
|
|
1281
1284
|
}
|
|
1282
1285
|
|
|
1283
1286
|
return children;
|
|
1284
1287
|
}
|
|
1285
1288
|
|
|
1286
|
-
function createContext(defaultValue) {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
+
function createContext(defaultValue, calculateChangedBits) {
|
|
1290
|
+
if (calculateChangedBits === undefined) {
|
|
1291
|
+
calculateChangedBits = null;
|
|
1292
|
+
} else {
|
|
1293
|
+
{
|
|
1294
|
+
if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
|
|
1295
|
+
error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1289
1300
|
var context = {
|
|
1290
1301
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
1302
|
+
_calculateChangedBits: calculateChangedBits,
|
|
1291
1303
|
// As a workaround to support multiple concurrent renderers, we categorize
|
|
1292
1304
|
// some renderers as primary and others as secondary. We only expect
|
|
1293
1305
|
// there to be two concurrent renderers at most: React Native (primary) and
|
|
@@ -1300,10 +1312,7 @@ function requireReact_development () {
|
|
|
1300
1312
|
_threadCount: 0,
|
|
1301
1313
|
// These are circular
|
|
1302
1314
|
Provider: null,
|
|
1303
|
-
Consumer: null
|
|
1304
|
-
// Add these to use same hidden class in VM as ServerContext
|
|
1305
|
-
_defaultValue: null,
|
|
1306
|
-
_globalName: null
|
|
1315
|
+
Consumer: null
|
|
1307
1316
|
};
|
|
1308
1317
|
context.Provider = {
|
|
1309
1318
|
$$typeof: REACT_PROVIDER_TYPE,
|
|
@@ -1319,7 +1328,8 @@ function requireReact_development () {
|
|
|
1319
1328
|
// warn for the incorrect usage of Context as a Consumer.
|
|
1320
1329
|
var Consumer = {
|
|
1321
1330
|
$$typeof: REACT_CONTEXT_TYPE,
|
|
1322
|
-
_context: context
|
|
1331
|
+
_context: context,
|
|
1332
|
+
_calculateChangedBits: context._calculateChangedBits
|
|
1323
1333
|
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
1324
1334
|
|
|
1325
1335
|
Object.defineProperties(Consumer, {
|
|
@@ -1406,54 +1416,38 @@ function requireReact_development () {
|
|
|
1406
1416
|
if (payload._status === Uninitialized) {
|
|
1407
1417
|
var ctor = payload._result;
|
|
1408
1418
|
var thenable = ctor(); // Transition to the next state.
|
|
1409
|
-
// This might throw either because it's missing or throws. If so, we treat it
|
|
1410
|
-
// as still uninitialized and try again next time. Which is the same as what
|
|
1411
|
-
// happens if the ctor or any wrappers processing the ctor throws. This might
|
|
1412
|
-
// end up fixing it if the resolution was a concurrency bug.
|
|
1413
1419
|
|
|
1420
|
+
var pending = payload;
|
|
1421
|
+
pending._status = Pending;
|
|
1422
|
+
pending._result = thenable;
|
|
1414
1423
|
thenable.then(function (moduleObject) {
|
|
1415
|
-
if (payload._status === Pending
|
|
1416
|
-
|
|
1424
|
+
if (payload._status === Pending) {
|
|
1425
|
+
var defaultExport = moduleObject.default;
|
|
1426
|
+
|
|
1427
|
+
{
|
|
1428
|
+
if (defaultExport === undefined) {
|
|
1429
|
+
error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1430
|
+
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1431
|
+
}
|
|
1432
|
+
} // Transition to the next state.
|
|
1433
|
+
|
|
1434
|
+
|
|
1417
1435
|
var resolved = payload;
|
|
1418
1436
|
resolved._status = Resolved;
|
|
1419
|
-
resolved._result =
|
|
1437
|
+
resolved._result = defaultExport;
|
|
1420
1438
|
}
|
|
1421
1439
|
}, function (error) {
|
|
1422
|
-
if (payload._status === Pending
|
|
1440
|
+
if (payload._status === Pending) {
|
|
1423
1441
|
// Transition to the next state.
|
|
1424
1442
|
var rejected = payload;
|
|
1425
1443
|
rejected._status = Rejected;
|
|
1426
1444
|
rejected._result = error;
|
|
1427
1445
|
}
|
|
1428
1446
|
});
|
|
1429
|
-
|
|
1430
|
-
if (payload._status === Uninitialized) {
|
|
1431
|
-
// In case, we're still uninitialized, then we're waiting for the thenable
|
|
1432
|
-
// to resolve. Set it as pending in the meantime.
|
|
1433
|
-
var pending = payload;
|
|
1434
|
-
pending._status = Pending;
|
|
1435
|
-
pending._result = thenable;
|
|
1436
|
-
}
|
|
1437
1447
|
}
|
|
1438
1448
|
|
|
1439
1449
|
if (payload._status === Resolved) {
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
{
|
|
1443
|
-
if (moduleObject === undefined) {
|
|
1444
|
-
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.
|
|
1445
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
|
1446
|
-
}
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
|
-
{
|
|
1450
|
-
if (!('default' in moduleObject)) {
|
|
1451
|
-
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.
|
|
1452
|
-
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
return moduleObject.default;
|
|
1450
|
+
return payload._result;
|
|
1457
1451
|
} else {
|
|
1458
1452
|
throw payload._result;
|
|
1459
1453
|
}
|
|
@@ -1462,7 +1456,7 @@ function requireReact_development () {
|
|
|
1462
1456
|
function lazy(ctor) {
|
|
1463
1457
|
var payload = {
|
|
1464
1458
|
// We use these fields to store the result.
|
|
1465
|
-
_status:
|
|
1459
|
+
_status: -1,
|
|
1466
1460
|
_result: ctor
|
|
1467
1461
|
};
|
|
1468
1462
|
var lazyType = {
|
|
@@ -1548,15 +1542,9 @@ function requireReact_development () {
|
|
|
1548
1542
|
return ownName;
|
|
1549
1543
|
},
|
|
1550
1544
|
set: function (name) {
|
|
1551
|
-
ownName = name;
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
// so that our component-stack generation logic will display their frames.
|
|
1555
|
-
// An anonymous function generally suggests a pattern like:
|
|
1556
|
-
// React.forwardRef((props, ref) => {...});
|
|
1557
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1558
|
-
|
|
1559
|
-
if (!render.name && !render.displayName) {
|
|
1545
|
+
ownName = name;
|
|
1546
|
+
|
|
1547
|
+
if (render.displayName == null) {
|
|
1560
1548
|
render.displayName = name;
|
|
1561
1549
|
}
|
|
1562
1550
|
}
|
|
@@ -1566,11 +1554,9 @@ function requireReact_development () {
|
|
|
1566
1554
|
return elementType;
|
|
1567
1555
|
}
|
|
1568
1556
|
|
|
1569
|
-
|
|
1557
|
+
// Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
|
|
1570
1558
|
|
|
1571
|
-
|
|
1572
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
1573
|
-
}
|
|
1559
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
1574
1560
|
|
|
1575
1561
|
function isValidElementType(type) {
|
|
1576
1562
|
if (typeof type === 'string' || typeof type === 'function') {
|
|
@@ -1578,16 +1564,12 @@ function requireReact_development () {
|
|
|
1578
1564
|
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1579
1565
|
|
|
1580
1566
|
|
|
1581
|
-
if (type ===
|
|
1567
|
+
if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
|
|
1582
1568
|
return true;
|
|
1583
1569
|
}
|
|
1584
1570
|
|
|
1585
1571
|
if (typeof type === 'object' && type !== null) {
|
|
1586
|
-
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 ||
|
|
1587
|
-
// types supported by any Flight configuration anywhere since
|
|
1588
|
-
// we don't know which Flight build this will end up being used
|
|
1589
|
-
// with.
|
|
1590
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
1572
|
+
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 || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
|
|
1591
1573
|
return true;
|
|
1592
1574
|
}
|
|
1593
1575
|
}
|
|
@@ -1617,15 +1599,9 @@ function requireReact_development () {
|
|
|
1617
1599
|
return ownName;
|
|
1618
1600
|
},
|
|
1619
1601
|
set: function (name) {
|
|
1620
|
-
ownName = name;
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
// so that our component-stack generation logic will display their frames.
|
|
1624
|
-
// An anonymous function generally suggests a pattern like:
|
|
1625
|
-
// React.memo((props) => {...});
|
|
1626
|
-
// This kind of inner function is not used elsewhere so the side effect is okay.
|
|
1627
|
-
|
|
1628
|
-
if (!type.name && !type.displayName) {
|
|
1602
|
+
ownName = name;
|
|
1603
|
+
|
|
1604
|
+
if (type.displayName == null) {
|
|
1629
1605
|
type.displayName = name;
|
|
1630
1606
|
}
|
|
1631
1607
|
}
|
|
@@ -1638,22 +1614,24 @@ function requireReact_development () {
|
|
|
1638
1614
|
function resolveDispatcher() {
|
|
1639
1615
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
1640
1616
|
|
|
1641
|
-
{
|
|
1642
|
-
|
|
1643
|
-
|
|
1617
|
+
if (!(dispatcher !== null)) {
|
|
1618
|
+
{
|
|
1619
|
+
throw Error( "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
|
|
1644
1620
|
}
|
|
1645
|
-
}
|
|
1646
|
-
// intentionally don't throw our own error because this is in a hot path.
|
|
1647
|
-
// Also helps ensure this is inlined.
|
|
1648
|
-
|
|
1621
|
+
}
|
|
1649
1622
|
|
|
1650
1623
|
return dispatcher;
|
|
1651
1624
|
}
|
|
1652
|
-
|
|
1625
|
+
|
|
1626
|
+
function useContext(Context, unstable_observedBits) {
|
|
1653
1627
|
var dispatcher = resolveDispatcher();
|
|
1654
1628
|
|
|
1655
1629
|
{
|
|
1656
|
-
|
|
1630
|
+
if (unstable_observedBits !== undefined) {
|
|
1631
|
+
error('useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://reactjs.org/link/rules-of-hooks' : '');
|
|
1632
|
+
} // TODO: add a more generic warning for invalid values.
|
|
1633
|
+
|
|
1634
|
+
|
|
1657
1635
|
if (Context._context !== undefined) {
|
|
1658
1636
|
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1659
1637
|
// and nobody should be using this in existing code.
|
|
@@ -1666,7 +1644,7 @@ function requireReact_development () {
|
|
|
1666
1644
|
}
|
|
1667
1645
|
}
|
|
1668
1646
|
|
|
1669
|
-
return dispatcher.useContext(Context);
|
|
1647
|
+
return dispatcher.useContext(Context, unstable_observedBits);
|
|
1670
1648
|
}
|
|
1671
1649
|
function useState(initialState) {
|
|
1672
1650
|
var dispatcher = resolveDispatcher();
|
|
@@ -1684,10 +1662,6 @@ function requireReact_development () {
|
|
|
1684
1662
|
var dispatcher = resolveDispatcher();
|
|
1685
1663
|
return dispatcher.useEffect(create, deps);
|
|
1686
1664
|
}
|
|
1687
|
-
function useInsertionEffect(create, deps) {
|
|
1688
|
-
var dispatcher = resolveDispatcher();
|
|
1689
|
-
return dispatcher.useInsertionEffect(create, deps);
|
|
1690
|
-
}
|
|
1691
1665
|
function useLayoutEffect(create, deps) {
|
|
1692
1666
|
var dispatcher = resolveDispatcher();
|
|
1693
1667
|
return dispatcher.useLayoutEffect(create, deps);
|
|
@@ -1710,22 +1684,6 @@ function requireReact_development () {
|
|
|
1710
1684
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
1711
1685
|
}
|
|
1712
1686
|
}
|
|
1713
|
-
function useTransition() {
|
|
1714
|
-
var dispatcher = resolveDispatcher();
|
|
1715
|
-
return dispatcher.useTransition();
|
|
1716
|
-
}
|
|
1717
|
-
function useDeferredValue(value) {
|
|
1718
|
-
var dispatcher = resolveDispatcher();
|
|
1719
|
-
return dispatcher.useDeferredValue(value);
|
|
1720
|
-
}
|
|
1721
|
-
function useId() {
|
|
1722
|
-
var dispatcher = resolveDispatcher();
|
|
1723
|
-
return dispatcher.useId();
|
|
1724
|
-
}
|
|
1725
|
-
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1726
|
-
var dispatcher = resolveDispatcher();
|
|
1727
|
-
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1728
|
-
}
|
|
1729
1687
|
|
|
1730
1688
|
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1731
1689
|
// replaying on render function. This currently only patches the object
|
|
@@ -1790,25 +1748,25 @@ function requireReact_development () {
|
|
|
1790
1748
|
}; // $FlowFixMe Flow thinks console is immutable.
|
|
1791
1749
|
|
|
1792
1750
|
Object.defineProperties(console, {
|
|
1793
|
-
log:
|
|
1751
|
+
log: _assign({}, props, {
|
|
1794
1752
|
value: prevLog
|
|
1795
1753
|
}),
|
|
1796
|
-
info:
|
|
1754
|
+
info: _assign({}, props, {
|
|
1797
1755
|
value: prevInfo
|
|
1798
1756
|
}),
|
|
1799
|
-
warn:
|
|
1757
|
+
warn: _assign({}, props, {
|
|
1800
1758
|
value: prevWarn
|
|
1801
1759
|
}),
|
|
1802
|
-
error:
|
|
1760
|
+
error: _assign({}, props, {
|
|
1803
1761
|
value: prevError
|
|
1804
1762
|
}),
|
|
1805
|
-
group:
|
|
1763
|
+
group: _assign({}, props, {
|
|
1806
1764
|
value: prevGroup
|
|
1807
1765
|
}),
|
|
1808
|
-
groupCollapsed:
|
|
1766
|
+
groupCollapsed: _assign({}, props, {
|
|
1809
1767
|
value: prevGroupCollapsed
|
|
1810
1768
|
}),
|
|
1811
|
-
groupEnd:
|
|
1769
|
+
groupEnd: _assign({}, props, {
|
|
1812
1770
|
value: prevGroupEnd
|
|
1813
1771
|
})
|
|
1814
1772
|
});
|
|
@@ -1849,7 +1807,7 @@ function requireReact_development () {
|
|
|
1849
1807
|
|
|
1850
1808
|
function describeNativeComponentFrame(fn, construct) {
|
|
1851
1809
|
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1852
|
-
if (
|
|
1810
|
+
if (!fn || reentry) {
|
|
1853
1811
|
return '';
|
|
1854
1812
|
}
|
|
1855
1813
|
|
|
@@ -1958,14 +1916,7 @@ function requireReact_development () {
|
|
|
1958
1916
|
|
|
1959
1917
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1960
1918
|
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1961
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
1962
|
-
// but we have a user-provided "displayName"
|
|
1963
|
-
// splice it in to make the stack more readable.
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
1967
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
1968
|
-
}
|
|
1919
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
1969
1920
|
|
|
1970
1921
|
{
|
|
1971
1922
|
if (typeof fn === 'function') {
|
|
@@ -2034,7 +1985,7 @@ function requireReact_development () {
|
|
|
2034
1985
|
}
|
|
2035
1986
|
|
|
2036
1987
|
switch (type) {
|
|
2037
|
-
case
|
|
1988
|
+
case exports.Suspense:
|
|
2038
1989
|
return describeBuiltInComponentFrame('Suspense');
|
|
2039
1990
|
|
|
2040
1991
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
@@ -2050,6 +2001,9 @@ function requireReact_development () {
|
|
|
2050
2001
|
// Memo may contain any component type so we recursively resolve it.
|
|
2051
2002
|
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2052
2003
|
|
|
2004
|
+
case REACT_BLOCK_TYPE:
|
|
2005
|
+
return describeFunctionComponentFrame(type._render);
|
|
2006
|
+
|
|
2053
2007
|
case REACT_LAZY_TYPE:
|
|
2054
2008
|
{
|
|
2055
2009
|
var lazyComponent = type;
|
|
@@ -2085,7 +2039,7 @@ function requireReact_development () {
|
|
|
2085
2039
|
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
2086
2040
|
{
|
|
2087
2041
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
2088
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
2042
|
+
var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2089
2043
|
|
|
2090
2044
|
for (var typeSpecName in typeSpecs) {
|
|
2091
2045
|
if (has(typeSpecs, typeSpecName)) {
|
|
@@ -2097,7 +2051,6 @@ function requireReact_development () {
|
|
|
2097
2051
|
// This is intentionally an invariant that gets caught. It's the same
|
|
2098
2052
|
// behavior as without this statement except with a better message.
|
|
2099
2053
|
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
2100
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
2101
2054
|
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`.');
|
|
2102
2055
|
err.name = 'Invariant Violation';
|
|
2103
2056
|
throw err;
|
|
@@ -2151,7 +2104,7 @@ function requireReact_development () {
|
|
|
2151
2104
|
|
|
2152
2105
|
function getDeclarationErrorAddendum() {
|
|
2153
2106
|
if (ReactCurrentOwner.current) {
|
|
2154
|
-
var name =
|
|
2107
|
+
var name = getComponentName(ReactCurrentOwner.current.type);
|
|
2155
2108
|
|
|
2156
2109
|
if (name) {
|
|
2157
2110
|
return '\n\nCheck the render method of `' + name + '`.';
|
|
@@ -2233,7 +2186,7 @@ function requireReact_development () {
|
|
|
2233
2186
|
|
|
2234
2187
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
2235
2188
|
// Give the component that originally created this child.
|
|
2236
|
-
childOwner = " It was passed a child from " +
|
|
2189
|
+
childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
|
|
2237
2190
|
}
|
|
2238
2191
|
|
|
2239
2192
|
{
|
|
@@ -2260,7 +2213,7 @@ function requireReact_development () {
|
|
|
2260
2213
|
return;
|
|
2261
2214
|
}
|
|
2262
2215
|
|
|
2263
|
-
if (isArray(node)) {
|
|
2216
|
+
if (Array.isArray(node)) {
|
|
2264
2217
|
for (var i = 0; i < node.length; i++) {
|
|
2265
2218
|
var child = node[i];
|
|
2266
2219
|
|
|
@@ -2322,12 +2275,12 @@ function requireReact_development () {
|
|
|
2322
2275
|
|
|
2323
2276
|
if (propTypes) {
|
|
2324
2277
|
// Intentionally inside to avoid triggering lazy initializers:
|
|
2325
|
-
var name =
|
|
2278
|
+
var name = getComponentName(type);
|
|
2326
2279
|
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
2327
2280
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
2328
2281
|
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
2329
2282
|
|
|
2330
|
-
var _name =
|
|
2283
|
+
var _name = getComponentName(type);
|
|
2331
2284
|
|
|
2332
2285
|
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
2333
2286
|
}
|
|
@@ -2392,10 +2345,10 @@ function requireReact_development () {
|
|
|
2392
2345
|
|
|
2393
2346
|
if (type === null) {
|
|
2394
2347
|
typeString = 'null';
|
|
2395
|
-
} else if (isArray(type)) {
|
|
2348
|
+
} else if (Array.isArray(type)) {
|
|
2396
2349
|
typeString = 'array';
|
|
2397
2350
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
2398
|
-
typeString = "<" + (
|
|
2351
|
+
typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
|
|
2399
2352
|
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
2400
2353
|
} else {
|
|
2401
2354
|
typeString = typeof type;
|
|
@@ -2424,7 +2377,7 @@ function requireReact_development () {
|
|
|
2424
2377
|
}
|
|
2425
2378
|
}
|
|
2426
2379
|
|
|
2427
|
-
if (type ===
|
|
2380
|
+
if (type === exports.Fragment) {
|
|
2428
2381
|
validateFragmentProps(element);
|
|
2429
2382
|
} else {
|
|
2430
2383
|
validatePropTypes(element);
|
|
@@ -2471,263 +2424,16 @@ function requireReact_development () {
|
|
|
2471
2424
|
return newElement;
|
|
2472
2425
|
}
|
|
2473
2426
|
|
|
2474
|
-
|
|
2475
|
-
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
2476
|
-
ReactCurrentBatchConfig.transition = {};
|
|
2477
|
-
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
2478
|
-
|
|
2479
|
-
{
|
|
2480
|
-
ReactCurrentBatchConfig.transition._updatedFibers = new Set();
|
|
2481
|
-
}
|
|
2427
|
+
{
|
|
2482
2428
|
|
|
2483
2429
|
try {
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
ReactCurrentBatchConfig.transition = prevTransition;
|
|
2487
|
-
|
|
2488
|
-
{
|
|
2489
|
-
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
2490
|
-
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
2491
|
-
|
|
2492
|
-
if (updatedFibersCount > 10) {
|
|
2493
|
-
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.');
|
|
2494
|
-
}
|
|
2430
|
+
var frozenObject = Object.freeze({});
|
|
2431
|
+
/* eslint-disable no-new */
|
|
2495
2432
|
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
}
|
|
2500
|
-
}
|
|
2501
|
-
|
|
2502
|
-
var didWarnAboutMessageChannel = false;
|
|
2503
|
-
var enqueueTaskImpl = null;
|
|
2504
|
-
function enqueueTask(task) {
|
|
2505
|
-
if (enqueueTaskImpl === null) {
|
|
2506
|
-
try {
|
|
2507
|
-
// read require off the module object to get around the bundlers.
|
|
2508
|
-
// we don't want them to detect a require and bundle a Node polyfill.
|
|
2509
|
-
var requireString = ('require' + Math.random()).slice(0, 7);
|
|
2510
|
-
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
|
|
2511
|
-
// version of setImmediate, bypassing fake timers if any.
|
|
2512
|
-
|
|
2513
|
-
enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
|
|
2514
|
-
} catch (_err) {
|
|
2515
|
-
// we're in a browser
|
|
2516
|
-
// we can't use regular timers because they may still be faked
|
|
2517
|
-
// so we try MessageChannel+postMessage instead
|
|
2518
|
-
enqueueTaskImpl = function (callback) {
|
|
2519
|
-
{
|
|
2520
|
-
if (didWarnAboutMessageChannel === false) {
|
|
2521
|
-
didWarnAboutMessageChannel = true;
|
|
2522
|
-
|
|
2523
|
-
if (typeof MessageChannel === 'undefined') {
|
|
2524
|
-
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.');
|
|
2525
|
-
}
|
|
2526
|
-
}
|
|
2527
|
-
}
|
|
2528
|
-
|
|
2529
|
-
var channel = new MessageChannel();
|
|
2530
|
-
channel.port1.onmessage = callback;
|
|
2531
|
-
channel.port2.postMessage(undefined);
|
|
2532
|
-
};
|
|
2533
|
-
}
|
|
2534
|
-
}
|
|
2535
|
-
|
|
2536
|
-
return enqueueTaskImpl(task);
|
|
2537
|
-
}
|
|
2538
|
-
|
|
2539
|
-
var actScopeDepth = 0;
|
|
2540
|
-
var didWarnNoAwaitAct = false;
|
|
2541
|
-
function act(callback) {
|
|
2542
|
-
{
|
|
2543
|
-
// `act` calls can be nested, so we track the depth. This represents the
|
|
2544
|
-
// number of `act` scopes on the stack.
|
|
2545
|
-
var prevActScopeDepth = actScopeDepth;
|
|
2546
|
-
actScopeDepth++;
|
|
2547
|
-
|
|
2548
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2549
|
-
// This is the outermost `act` scope. Initialize the queue. The reconciler
|
|
2550
|
-
// will detect the queue and use it instead of Scheduler.
|
|
2551
|
-
ReactCurrentActQueue.current = [];
|
|
2552
|
-
}
|
|
2553
|
-
|
|
2554
|
-
var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
|
|
2555
|
-
var result;
|
|
2556
|
-
|
|
2557
|
-
try {
|
|
2558
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
|
|
2559
|
-
// set to `true` while the given callback is executed, not for updates
|
|
2560
|
-
// triggered during an async event, because this is how the legacy
|
|
2561
|
-
// implementation of `act` behaved.
|
|
2562
|
-
ReactCurrentActQueue.isBatchingLegacy = true;
|
|
2563
|
-
result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
|
|
2564
|
-
// which flushed updates immediately after the scope function exits, even
|
|
2565
|
-
// if it's an async function.
|
|
2566
|
-
|
|
2567
|
-
if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
|
|
2568
|
-
var queue = ReactCurrentActQueue.current;
|
|
2569
|
-
|
|
2570
|
-
if (queue !== null) {
|
|
2571
|
-
ReactCurrentActQueue.didScheduleLegacyUpdate = false;
|
|
2572
|
-
flushActQueue(queue);
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
|
-
} catch (error) {
|
|
2576
|
-
popActScope(prevActScopeDepth);
|
|
2577
|
-
throw error;
|
|
2578
|
-
} finally {
|
|
2579
|
-
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
2580
|
-
}
|
|
2581
|
-
|
|
2582
|
-
if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
|
2583
|
-
var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
|
|
2584
|
-
// for it to resolve before exiting the current scope.
|
|
2585
|
-
|
|
2586
|
-
var wasAwaited = false;
|
|
2587
|
-
var thenable = {
|
|
2588
|
-
then: function (resolve, reject) {
|
|
2589
|
-
wasAwaited = true;
|
|
2590
|
-
thenableResult.then(function (returnValue) {
|
|
2591
|
-
popActScope(prevActScopeDepth);
|
|
2592
|
-
|
|
2593
|
-
if (actScopeDepth === 0) {
|
|
2594
|
-
// We've exited the outermost act scope. Recursively flush the
|
|
2595
|
-
// queue until there's no remaining work.
|
|
2596
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2597
|
-
} else {
|
|
2598
|
-
resolve(returnValue);
|
|
2599
|
-
}
|
|
2600
|
-
}, function (error) {
|
|
2601
|
-
// The callback threw an error.
|
|
2602
|
-
popActScope(prevActScopeDepth);
|
|
2603
|
-
reject(error);
|
|
2604
|
-
});
|
|
2605
|
-
}
|
|
2606
|
-
};
|
|
2607
|
-
|
|
2608
|
-
{
|
|
2609
|
-
if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
|
|
2610
|
-
// eslint-disable-next-line no-undef
|
|
2611
|
-
Promise.resolve().then(function () {}).then(function () {
|
|
2612
|
-
if (!wasAwaited) {
|
|
2613
|
-
didWarnNoAwaitAct = true;
|
|
2614
|
-
|
|
2615
|
-
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 () => ...);');
|
|
2616
|
-
}
|
|
2617
|
-
});
|
|
2618
|
-
}
|
|
2619
|
-
}
|
|
2620
|
-
|
|
2621
|
-
return thenable;
|
|
2622
|
-
} else {
|
|
2623
|
-
var returnValue = result; // The callback is not an async function. Exit the current scope
|
|
2624
|
-
// immediately, without awaiting.
|
|
2625
|
-
|
|
2626
|
-
popActScope(prevActScopeDepth);
|
|
2627
|
-
|
|
2628
|
-
if (actScopeDepth === 0) {
|
|
2629
|
-
// Exiting the outermost act scope. Flush the queue.
|
|
2630
|
-
var _queue = ReactCurrentActQueue.current;
|
|
2631
|
-
|
|
2632
|
-
if (_queue !== null) {
|
|
2633
|
-
flushActQueue(_queue);
|
|
2634
|
-
ReactCurrentActQueue.current = null;
|
|
2635
|
-
} // Return a thenable. If the user awaits it, we'll flush again in
|
|
2636
|
-
// case additional work was scheduled by a microtask.
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
var _thenable = {
|
|
2640
|
-
then: function (resolve, reject) {
|
|
2641
|
-
// Confirm we haven't re-entered another `act` scope, in case
|
|
2642
|
-
// the user does something weird like await the thenable
|
|
2643
|
-
// multiple times.
|
|
2644
|
-
if (ReactCurrentActQueue.current === null) {
|
|
2645
|
-
// Recursively flush the queue until there's no remaining work.
|
|
2646
|
-
ReactCurrentActQueue.current = [];
|
|
2647
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2648
|
-
} else {
|
|
2649
|
-
resolve(returnValue);
|
|
2650
|
-
}
|
|
2651
|
-
}
|
|
2652
|
-
};
|
|
2653
|
-
return _thenable;
|
|
2654
|
-
} else {
|
|
2655
|
-
// Since we're inside a nested `act` scope, the returned thenable
|
|
2656
|
-
// immediately resolves. The outer scope will flush the queue.
|
|
2657
|
-
var _thenable2 = {
|
|
2658
|
-
then: function (resolve, reject) {
|
|
2659
|
-
resolve(returnValue);
|
|
2660
|
-
}
|
|
2661
|
-
};
|
|
2662
|
-
return _thenable2;
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
}
|
|
2667
|
-
|
|
2668
|
-
function popActScope(prevActScopeDepth) {
|
|
2669
|
-
{
|
|
2670
|
-
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
2671
|
-
error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
|
|
2672
|
-
}
|
|
2673
|
-
|
|
2674
|
-
actScopeDepth = prevActScopeDepth;
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
|
|
2678
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2679
|
-
{
|
|
2680
|
-
var queue = ReactCurrentActQueue.current;
|
|
2681
|
-
|
|
2682
|
-
if (queue !== null) {
|
|
2683
|
-
try {
|
|
2684
|
-
flushActQueue(queue);
|
|
2685
|
-
enqueueTask(function () {
|
|
2686
|
-
if (queue.length === 0) {
|
|
2687
|
-
// No additional work was scheduled. Finish.
|
|
2688
|
-
ReactCurrentActQueue.current = null;
|
|
2689
|
-
resolve(returnValue);
|
|
2690
|
-
} else {
|
|
2691
|
-
// Keep flushing work until there's none left.
|
|
2692
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2693
|
-
}
|
|
2694
|
-
});
|
|
2695
|
-
} catch (error) {
|
|
2696
|
-
reject(error);
|
|
2697
|
-
}
|
|
2698
|
-
} else {
|
|
2699
|
-
resolve(returnValue);
|
|
2700
|
-
}
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
|
|
2704
|
-
var isFlushing = false;
|
|
2705
|
-
|
|
2706
|
-
function flushActQueue(queue) {
|
|
2707
|
-
{
|
|
2708
|
-
if (!isFlushing) {
|
|
2709
|
-
// Prevent re-entrance.
|
|
2710
|
-
isFlushing = true;
|
|
2711
|
-
var i = 0;
|
|
2712
|
-
|
|
2713
|
-
try {
|
|
2714
|
-
for (; i < queue.length; i++) {
|
|
2715
|
-
var callback = queue[i];
|
|
2716
|
-
|
|
2717
|
-
do {
|
|
2718
|
-
callback = callback(true);
|
|
2719
|
-
} while (callback !== null);
|
|
2720
|
-
}
|
|
2721
|
-
|
|
2722
|
-
queue.length = 0;
|
|
2723
|
-
} catch (error) {
|
|
2724
|
-
// If something throws, leave the remaining callbacks on the queue.
|
|
2725
|
-
queue = queue.slice(i + 1);
|
|
2726
|
-
throw error;
|
|
2727
|
-
} finally {
|
|
2728
|
-
isFlushing = false;
|
|
2729
|
-
}
|
|
2730
|
-
}
|
|
2433
|
+
new Map([[frozenObject, null]]);
|
|
2434
|
+
new Set([frozenObject]);
|
|
2435
|
+
/* eslint-enable no-new */
|
|
2436
|
+
} catch (e) {
|
|
2731
2437
|
}
|
|
2732
2438
|
}
|
|
2733
2439
|
|
|
@@ -2744,11 +2450,7 @@ function requireReact_development () {
|
|
|
2744
2450
|
|
|
2745
2451
|
exports.Children = Children;
|
|
2746
2452
|
exports.Component = Component;
|
|
2747
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2748
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2749
2453
|
exports.PureComponent = PureComponent;
|
|
2750
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2751
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2752
2454
|
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2753
2455
|
exports.cloneElement = cloneElement$1;
|
|
2754
2456
|
exports.createContext = createContext;
|
|
@@ -2759,37 +2461,21 @@ function requireReact_development () {
|
|
|
2759
2461
|
exports.isValidElement = isValidElement;
|
|
2760
2462
|
exports.lazy = lazy;
|
|
2761
2463
|
exports.memo = memo;
|
|
2762
|
-
exports.startTransition = startTransition;
|
|
2763
|
-
exports.unstable_act = act;
|
|
2764
2464
|
exports.useCallback = useCallback;
|
|
2765
2465
|
exports.useContext = useContext;
|
|
2766
2466
|
exports.useDebugValue = useDebugValue;
|
|
2767
|
-
exports.useDeferredValue = useDeferredValue;
|
|
2768
2467
|
exports.useEffect = useEffect;
|
|
2769
|
-
exports.useId = useId;
|
|
2770
2468
|
exports.useImperativeHandle = useImperativeHandle;
|
|
2771
|
-
exports.useInsertionEffect = useInsertionEffect;
|
|
2772
2469
|
exports.useLayoutEffect = useLayoutEffect;
|
|
2773
2470
|
exports.useMemo = useMemo;
|
|
2774
2471
|
exports.useReducer = useReducer;
|
|
2775
2472
|
exports.useRef = useRef;
|
|
2776
2473
|
exports.useState = useState;
|
|
2777
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2778
|
-
exports.useTransition = useTransition;
|
|
2779
2474
|
exports.version = ReactVersion;
|
|
2780
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
|
2781
|
-
if (
|
|
2782
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
|
|
2783
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
|
|
2784
|
-
'function'
|
|
2785
|
-
) {
|
|
2786
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2787
|
-
}
|
|
2788
|
-
|
|
2789
2475
|
})();
|
|
2790
2476
|
}
|
|
2791
|
-
} (react_development
|
|
2792
|
-
return react_development
|
|
2477
|
+
} (react_development));
|
|
2478
|
+
return react_development;
|
|
2793
2479
|
}
|
|
2794
2480
|
|
|
2795
2481
|
if (process.env.NODE_ENV === 'production') {
|