@smakss/react-scroll-direction 0.0.2 → 0.0.4

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.
@@ -0,0 +1,4023 @@
1
+ 'use strict';
2
+
3
+ var react = {exports: {}};
4
+
5
+ var react_production_min = {};
6
+
7
+ /**
8
+ * @license React
9
+ * react.production.min.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+
17
+ var hasRequiredReact_production_min;
18
+
19
+ function requireReact_production_min () {
20
+ if (hasRequiredReact_production_min) return react_production_min;
21
+ hasRequiredReact_production_min = 1;
22
+ 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}
23
+ 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={};
24
+ 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;
25
+ 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};
26
+ 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}}
27
+ 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)}
28
+ 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=
29
+ 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}
30
+ 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;}
31
+ var U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};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;
32
+ react_production_min.Profiler=r;react_production_min.PureComponent=G;react_production_min.StrictMode=q;react_production_min.Suspense=w;react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;
33
+ 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);
34
+ 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}};
35
+ 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=function(){throw Error("act(...) is not supported in production builds of React.");};
36
+ react_production_min.useCallback=function(a,b){return U.current.useCallback(a,b)};react_production_min.useContext=function(a){return U.current.useContext(a)};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)};
37
+ 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)};
38
+ react_production_min.useTransition=function(){return U.current.useTransition()};react_production_min.version="18.2.0";
39
+ return react_production_min;
40
+ }
41
+
42
+ var react_development = {exports: {}};
43
+
44
+ /**
45
+ * @license React
46
+ * react.development.js
47
+ *
48
+ * Copyright (c) Facebook, Inc. and its affiliates.
49
+ *
50
+ * This source code is licensed under the MIT license found in the
51
+ * LICENSE file in the root directory of this source tree.
52
+ */
53
+
54
+ var hasRequiredReact_development;
55
+
56
+ function requireReact_development () {
57
+ if (hasRequiredReact_development) return react_development.exports;
58
+ hasRequiredReact_development = 1;
59
+ (function (module, exports) {
60
+
61
+ if (process.env.NODE_ENV !== "production") {
62
+ (function() {
63
+
64
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
65
+ if (
66
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
67
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
68
+ 'function'
69
+ ) {
70
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
71
+ }
72
+ var ReactVersion = '18.2.0';
73
+
74
+ // ATTENTION
75
+ // When adding new symbols to this file,
76
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
77
+ // The Symbol used to tag the ReactElement-like types.
78
+ var REACT_ELEMENT_TYPE = Symbol.for('react.element');
79
+ var REACT_PORTAL_TYPE = Symbol.for('react.portal');
80
+ var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
81
+ var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
82
+ var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
83
+ var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
84
+ var REACT_CONTEXT_TYPE = Symbol.for('react.context');
85
+ var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
86
+ var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
87
+ var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
88
+ var REACT_MEMO_TYPE = Symbol.for('react.memo');
89
+ var REACT_LAZY_TYPE = Symbol.for('react.lazy');
90
+ var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
91
+ var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
92
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
93
+ function getIteratorFn(maybeIterable) {
94
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
95
+ return null;
96
+ }
97
+
98
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
99
+
100
+ if (typeof maybeIterator === 'function') {
101
+ return maybeIterator;
102
+ }
103
+
104
+ return null;
105
+ }
106
+
107
+ /**
108
+ * Keeps track of the current dispatcher.
109
+ */
110
+ var ReactCurrentDispatcher = {
111
+ /**
112
+ * @internal
113
+ * @type {ReactComponent}
114
+ */
115
+ current: null
116
+ };
117
+
118
+ /**
119
+ * Keeps track of the current batch's configuration such as how long an update
120
+ * should suspend for if it needs to.
121
+ */
122
+ var ReactCurrentBatchConfig = {
123
+ transition: null
124
+ };
125
+
126
+ var ReactCurrentActQueue = {
127
+ current: null,
128
+ // Used to reproduce behavior of `batchedUpdates` in legacy mode.
129
+ isBatchingLegacy: false,
130
+ didScheduleLegacyUpdate: false
131
+ };
132
+
133
+ /**
134
+ * Keeps track of the current owner.
135
+ *
136
+ * The current owner is the component who should own any components that are
137
+ * currently being constructed.
138
+ */
139
+ var ReactCurrentOwner = {
140
+ /**
141
+ * @internal
142
+ * @type {ReactComponent}
143
+ */
144
+ current: null
145
+ };
146
+
147
+ var ReactDebugCurrentFrame = {};
148
+ var currentExtraStackFrame = null;
149
+ function setExtraStackFrame(stack) {
150
+ {
151
+ currentExtraStackFrame = stack;
152
+ }
153
+ }
154
+
155
+ {
156
+ ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
157
+ {
158
+ currentExtraStackFrame = stack;
159
+ }
160
+ }; // Stack implementation injected by the current renderer.
161
+
162
+
163
+ ReactDebugCurrentFrame.getCurrentStack = null;
164
+
165
+ ReactDebugCurrentFrame.getStackAddendum = function () {
166
+ var stack = ''; // Add an extra top frame while an element is being validated
167
+
168
+ if (currentExtraStackFrame) {
169
+ stack += currentExtraStackFrame;
170
+ } // Delegate to the injected renderer-specific implementation
171
+
172
+
173
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
174
+
175
+ if (impl) {
176
+ stack += impl() || '';
177
+ }
178
+
179
+ return stack;
180
+ };
181
+ }
182
+
183
+ // -----------------------------------------------------------------------------
184
+
185
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
186
+ var enableCacheElement = false;
187
+ var enableTransitionTracing = false; // No known bugs, but needs performance testing
188
+
189
+ var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
190
+ // stuff. Intended to enable React core members to more easily debug scheduling
191
+ // issues in DEV builds.
192
+
193
+ var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
194
+
195
+ var ReactSharedInternals = {
196
+ ReactCurrentDispatcher: ReactCurrentDispatcher,
197
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
198
+ ReactCurrentOwner: ReactCurrentOwner
199
+ };
200
+
201
+ {
202
+ ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
203
+ ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
204
+ }
205
+
206
+ // by calls to these methods by a Babel plugin.
207
+ //
208
+ // In PROD (or in packages without access to React internals),
209
+ // they are left as they are instead.
210
+
211
+ function warn(format) {
212
+ {
213
+ {
214
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
215
+ args[_key - 1] = arguments[_key];
216
+ }
217
+
218
+ printWarning('warn', format, args);
219
+ }
220
+ }
221
+ }
222
+ function error(format) {
223
+ {
224
+ {
225
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
226
+ args[_key2 - 1] = arguments[_key2];
227
+ }
228
+
229
+ printWarning('error', format, args);
230
+ }
231
+ }
232
+ }
233
+
234
+ function printWarning(level, format, args) {
235
+ // When changing this logic, you might want to also
236
+ // update consoleWithStackDev.www.js as well.
237
+ {
238
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
239
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
240
+
241
+ if (stack !== '') {
242
+ format += '%s';
243
+ args = args.concat([stack]);
244
+ } // eslint-disable-next-line react-internal/safe-string-coercion
245
+
246
+
247
+ var argsWithFormat = args.map(function (item) {
248
+ return String(item);
249
+ }); // Careful: RN currently depends on this prefix
250
+
251
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
252
+ // breaks IE9: https://github.com/facebook/react/issues/13610
253
+ // eslint-disable-next-line react-internal/no-production-logging
254
+
255
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
256
+ }
257
+ }
258
+
259
+ var didWarnStateUpdateForUnmountedComponent = {};
260
+
261
+ function warnNoop(publicInstance, callerName) {
262
+ {
263
+ var _constructor = publicInstance.constructor;
264
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
265
+ var warningKey = componentName + "." + callerName;
266
+
267
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
268
+ return;
269
+ }
270
+
271
+ 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);
272
+
273
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
274
+ }
275
+ }
276
+ /**
277
+ * This is the abstract API for an update queue.
278
+ */
279
+
280
+
281
+ var ReactNoopUpdateQueue = {
282
+ /**
283
+ * Checks whether or not this composite component is mounted.
284
+ * @param {ReactClass} publicInstance The instance we want to test.
285
+ * @return {boolean} True if mounted, false otherwise.
286
+ * @protected
287
+ * @final
288
+ */
289
+ isMounted: function (publicInstance) {
290
+ return false;
291
+ },
292
+
293
+ /**
294
+ * Forces an update. This should only be invoked when it is known with
295
+ * certainty that we are **not** in a DOM transaction.
296
+ *
297
+ * You may want to call this when you know that some deeper aspect of the
298
+ * component's state has changed but `setState` was not called.
299
+ *
300
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
301
+ * `componentWillUpdate` and `componentDidUpdate`.
302
+ *
303
+ * @param {ReactClass} publicInstance The instance that should rerender.
304
+ * @param {?function} callback Called after component is updated.
305
+ * @param {?string} callerName name of the calling function in the public API.
306
+ * @internal
307
+ */
308
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
309
+ warnNoop(publicInstance, 'forceUpdate');
310
+ },
311
+
312
+ /**
313
+ * Replaces all of the state. Always use this or `setState` to mutate state.
314
+ * You should treat `this.state` as immutable.
315
+ *
316
+ * There is no guarantee that `this.state` will be immediately updated, so
317
+ * accessing `this.state` after calling this method may return the old value.
318
+ *
319
+ * @param {ReactClass} publicInstance The instance that should rerender.
320
+ * @param {object} completeState Next state.
321
+ * @param {?function} callback Called after component is updated.
322
+ * @param {?string} callerName name of the calling function in the public API.
323
+ * @internal
324
+ */
325
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
326
+ warnNoop(publicInstance, 'replaceState');
327
+ },
328
+
329
+ /**
330
+ * Sets a subset of the state. This only exists because _pendingState is
331
+ * internal. This provides a merging strategy that is not available to deep
332
+ * properties which is confusing. TODO: Expose pendingState or don't use it
333
+ * during the merge.
334
+ *
335
+ * @param {ReactClass} publicInstance The instance that should rerender.
336
+ * @param {object} partialState Next partial state to be merged with state.
337
+ * @param {?function} callback Called after component is updated.
338
+ * @param {?string} Name of the calling function in the public API.
339
+ * @internal
340
+ */
341
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
342
+ warnNoop(publicInstance, 'setState');
343
+ }
344
+ };
345
+
346
+ var assign = Object.assign;
347
+
348
+ var emptyObject = {};
349
+
350
+ {
351
+ Object.freeze(emptyObject);
352
+ }
353
+ /**
354
+ * Base class helpers for the updating state of a component.
355
+ */
356
+
357
+
358
+ function Component(props, context, updater) {
359
+ this.props = props;
360
+ this.context = context; // If a component has string refs, we will assign a different object later.
361
+
362
+ this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
363
+ // renderer.
364
+
365
+ this.updater = updater || ReactNoopUpdateQueue;
366
+ }
367
+
368
+ Component.prototype.isReactComponent = {};
369
+ /**
370
+ * Sets a subset of the state. Always use this to mutate
371
+ * state. You should treat `this.state` as immutable.
372
+ *
373
+ * There is no guarantee that `this.state` will be immediately updated, so
374
+ * accessing `this.state` after calling this method may return the old value.
375
+ *
376
+ * There is no guarantee that calls to `setState` will run synchronously,
377
+ * as they may eventually be batched together. You can provide an optional
378
+ * callback that will be executed when the call to setState is actually
379
+ * completed.
380
+ *
381
+ * When a function is provided to setState, it will be called at some point in
382
+ * the future (not synchronously). It will be called with the up to date
383
+ * component arguments (state, props, context). These values can be different
384
+ * from this.* because your function may be called after receiveProps but before
385
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
386
+ * assigned to this.
387
+ *
388
+ * @param {object|function} partialState Next partial state or function to
389
+ * produce next partial state to be merged with current state.
390
+ * @param {?function} callback Called after state is updated.
391
+ * @final
392
+ * @protected
393
+ */
394
+
395
+ Component.prototype.setState = function (partialState, callback) {
396
+ if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
397
+ throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
398
+ }
399
+
400
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
401
+ };
402
+ /**
403
+ * Forces an update. This should only be invoked when it is known with
404
+ * certainty that we are **not** in a DOM transaction.
405
+ *
406
+ * You may want to call this when you know that some deeper aspect of the
407
+ * component's state has changed but `setState` was not called.
408
+ *
409
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
410
+ * `componentWillUpdate` and `componentDidUpdate`.
411
+ *
412
+ * @param {?function} callback Called after update is complete.
413
+ * @final
414
+ * @protected
415
+ */
416
+
417
+
418
+ Component.prototype.forceUpdate = function (callback) {
419
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
420
+ };
421
+ /**
422
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
423
+ * we would like to deprecate them, we're not going to move them over to this
424
+ * modern base class. Instead, we define a getter that warns if it's accessed.
425
+ */
426
+
427
+
428
+ {
429
+ var deprecatedAPIs = {
430
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
431
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
432
+ };
433
+
434
+ var defineDeprecationWarning = function (methodName, info) {
435
+ Object.defineProperty(Component.prototype, methodName, {
436
+ get: function () {
437
+ warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
438
+
439
+ return undefined;
440
+ }
441
+ });
442
+ };
443
+
444
+ for (var fnName in deprecatedAPIs) {
445
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
446
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
447
+ }
448
+ }
449
+ }
450
+
451
+ function ComponentDummy() {}
452
+
453
+ ComponentDummy.prototype = Component.prototype;
454
+ /**
455
+ * Convenience component with default shallow equality check for sCU.
456
+ */
457
+
458
+ function PureComponent(props, context, updater) {
459
+ this.props = props;
460
+ this.context = context; // If a component has string refs, we will assign a different object later.
461
+
462
+ this.refs = emptyObject;
463
+ this.updater = updater || ReactNoopUpdateQueue;
464
+ }
465
+
466
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
467
+ pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
468
+
469
+ assign(pureComponentPrototype, Component.prototype);
470
+ pureComponentPrototype.isPureReactComponent = true;
471
+
472
+ // an immutable object with a single mutable value
473
+ function createRef() {
474
+ var refObject = {
475
+ current: null
476
+ };
477
+
478
+ {
479
+ Object.seal(refObject);
480
+ }
481
+
482
+ return refObject;
483
+ }
484
+
485
+ var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
486
+
487
+ function isArray(a) {
488
+ return isArrayImpl(a);
489
+ }
490
+
491
+ /*
492
+ * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
493
+ * and Temporal.* types. See https://github.com/facebook/react/pull/22064.
494
+ *
495
+ * The functions in this module will throw an easier-to-understand,
496
+ * easier-to-debug exception with a clear errors message message explaining the
497
+ * problem. (Instead of a confusing exception thrown inside the implementation
498
+ * of the `value` object).
499
+ */
500
+ // $FlowFixMe only called in DEV, so void return is not possible.
501
+ function typeName(value) {
502
+ {
503
+ // toStringTag is needed for namespaced types like Temporal.Instant
504
+ var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
505
+ var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
506
+ return type;
507
+ }
508
+ } // $FlowFixMe only called in DEV, so void return is not possible.
509
+
510
+
511
+ function willCoercionThrow(value) {
512
+ {
513
+ try {
514
+ testStringCoercion(value);
515
+ return false;
516
+ } catch (e) {
517
+ return true;
518
+ }
519
+ }
520
+ }
521
+
522
+ function testStringCoercion(value) {
523
+ // If you ended up here by following an exception call stack, here's what's
524
+ // happened: you supplied an object or symbol value to React (as a prop, key,
525
+ // DOM attribute, CSS property, string ref, etc.) and when React tried to
526
+ // coerce it to a string using `'' + value`, an exception was thrown.
527
+ //
528
+ // The most common types that will cause this exception are `Symbol` instances
529
+ // and Temporal objects like `Temporal.Instant`. But any object that has a
530
+ // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
531
+ // exception. (Library authors do this to prevent users from using built-in
532
+ // numeric operators like `+` or comparison operators like `>=` because custom
533
+ // methods are needed to perform accurate arithmetic or comparison.)
534
+ //
535
+ // To fix the problem, coerce this object or symbol value to a string before
536
+ // passing it to React. The most reliable way is usually `String(value)`.
537
+ //
538
+ // To find which value is throwing, check the browser or debugger console.
539
+ // Before this exception was thrown, there should be `console.error` output
540
+ // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
541
+ // problem and how that type was used: key, atrribute, input value prop, etc.
542
+ // In most cases, this console output also shows the component and its
543
+ // ancestor components where the exception happened.
544
+ //
545
+ // eslint-disable-next-line react-internal/safe-string-coercion
546
+ return '' + value;
547
+ }
548
+ function checkKeyStringCoercion(value) {
549
+ {
550
+ if (willCoercionThrow(value)) {
551
+ error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
552
+
553
+ return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
554
+ }
555
+ }
556
+ }
557
+
558
+ function getWrappedName(outerType, innerType, wrapperName) {
559
+ var displayName = outerType.displayName;
560
+
561
+ if (displayName) {
562
+ return displayName;
563
+ }
564
+
565
+ var functionName = innerType.displayName || innerType.name || '';
566
+ return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
567
+ } // Keep in sync with react-reconciler/getComponentNameFromFiber
568
+
569
+
570
+ function getContextName(type) {
571
+ return type.displayName || 'Context';
572
+ } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
573
+
574
+
575
+ function getComponentNameFromType(type) {
576
+ if (type == null) {
577
+ // Host root, text node or just invalid type.
578
+ return null;
579
+ }
580
+
581
+ {
582
+ if (typeof type.tag === 'number') {
583
+ error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
584
+ }
585
+ }
586
+
587
+ if (typeof type === 'function') {
588
+ return type.displayName || type.name || null;
589
+ }
590
+
591
+ if (typeof type === 'string') {
592
+ return type;
593
+ }
594
+
595
+ switch (type) {
596
+ case REACT_FRAGMENT_TYPE:
597
+ return 'Fragment';
598
+
599
+ case REACT_PORTAL_TYPE:
600
+ return 'Portal';
601
+
602
+ case REACT_PROFILER_TYPE:
603
+ return 'Profiler';
604
+
605
+ case REACT_STRICT_MODE_TYPE:
606
+ return 'StrictMode';
607
+
608
+ case REACT_SUSPENSE_TYPE:
609
+ return 'Suspense';
610
+
611
+ case REACT_SUSPENSE_LIST_TYPE:
612
+ return 'SuspenseList';
613
+
614
+ }
615
+
616
+ if (typeof type === 'object') {
617
+ switch (type.$$typeof) {
618
+ case REACT_CONTEXT_TYPE:
619
+ var context = type;
620
+ return getContextName(context) + '.Consumer';
621
+
622
+ case REACT_PROVIDER_TYPE:
623
+ var provider = type;
624
+ return getContextName(provider._context) + '.Provider';
625
+
626
+ case REACT_FORWARD_REF_TYPE:
627
+ return getWrappedName(type, type.render, 'ForwardRef');
628
+
629
+ case REACT_MEMO_TYPE:
630
+ var outerName = type.displayName || null;
631
+
632
+ if (outerName !== null) {
633
+ return outerName;
634
+ }
635
+
636
+ return getComponentNameFromType(type.type) || 'Memo';
637
+
638
+ case REACT_LAZY_TYPE:
639
+ {
640
+ var lazyComponent = type;
641
+ var payload = lazyComponent._payload;
642
+ var init = lazyComponent._init;
643
+
644
+ try {
645
+ return getComponentNameFromType(init(payload));
646
+ } catch (x) {
647
+ return null;
648
+ }
649
+ }
650
+
651
+ // eslint-disable-next-line no-fallthrough
652
+ }
653
+ }
654
+
655
+ return null;
656
+ }
657
+
658
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
659
+
660
+ var RESERVED_PROPS = {
661
+ key: true,
662
+ ref: true,
663
+ __self: true,
664
+ __source: true
665
+ };
666
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
667
+
668
+ {
669
+ didWarnAboutStringRefs = {};
670
+ }
671
+
672
+ function hasValidRef(config) {
673
+ {
674
+ if (hasOwnProperty.call(config, 'ref')) {
675
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
676
+
677
+ if (getter && getter.isReactWarning) {
678
+ return false;
679
+ }
680
+ }
681
+ }
682
+
683
+ return config.ref !== undefined;
684
+ }
685
+
686
+ function hasValidKey(config) {
687
+ {
688
+ if (hasOwnProperty.call(config, 'key')) {
689
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
690
+
691
+ if (getter && getter.isReactWarning) {
692
+ return false;
693
+ }
694
+ }
695
+ }
696
+
697
+ return config.key !== undefined;
698
+ }
699
+
700
+ function defineKeyPropWarningGetter(props, displayName) {
701
+ var warnAboutAccessingKey = function () {
702
+ {
703
+ if (!specialPropKeyWarningShown) {
704
+ specialPropKeyWarningShown = true;
705
+
706
+ 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);
707
+ }
708
+ }
709
+ };
710
+
711
+ warnAboutAccessingKey.isReactWarning = true;
712
+ Object.defineProperty(props, 'key', {
713
+ get: warnAboutAccessingKey,
714
+ configurable: true
715
+ });
716
+ }
717
+
718
+ function defineRefPropWarningGetter(props, displayName) {
719
+ var warnAboutAccessingRef = function () {
720
+ {
721
+ if (!specialPropRefWarningShown) {
722
+ specialPropRefWarningShown = true;
723
+
724
+ 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);
725
+ }
726
+ }
727
+ };
728
+
729
+ warnAboutAccessingRef.isReactWarning = true;
730
+ Object.defineProperty(props, 'ref', {
731
+ get: warnAboutAccessingRef,
732
+ configurable: true
733
+ });
734
+ }
735
+
736
+ function warnIfStringRefCannotBeAutoConverted(config) {
737
+ {
738
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
739
+ var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
740
+
741
+ if (!didWarnAboutStringRefs[componentName]) {
742
+ 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);
743
+
744
+ didWarnAboutStringRefs[componentName] = true;
745
+ }
746
+ }
747
+ }
748
+ }
749
+ /**
750
+ * Factory method to create a new React element. This no longer adheres to
751
+ * the class pattern, so do not use new to call it. Also, instanceof check
752
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
753
+ * if something is a React Element.
754
+ *
755
+ * @param {*} type
756
+ * @param {*} props
757
+ * @param {*} key
758
+ * @param {string|object} ref
759
+ * @param {*} owner
760
+ * @param {*} self A *temporary* helper to detect places where `this` is
761
+ * different from the `owner` when React.createElement is called, so that we
762
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
763
+ * functions, and as long as `this` and owner are the same, there will be no
764
+ * change in behavior.
765
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
766
+ * indicating filename, line number, and/or other information.
767
+ * @internal
768
+ */
769
+
770
+
771
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
772
+ var element = {
773
+ // This tag allows us to uniquely identify this as a React Element
774
+ $$typeof: REACT_ELEMENT_TYPE,
775
+ // Built-in properties that belong on the element
776
+ type: type,
777
+ key: key,
778
+ ref: ref,
779
+ props: props,
780
+ // Record the component responsible for creating this element.
781
+ _owner: owner
782
+ };
783
+
784
+ {
785
+ // The validation flag is currently mutative. We put it on
786
+ // an external backing store so that we can freeze the whole object.
787
+ // This can be replaced with a WeakMap once they are implemented in
788
+ // commonly used development environments.
789
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
790
+ // the validation flag non-enumerable (where possible, which should
791
+ // include every environment we run tests in), so the test framework
792
+ // ignores it.
793
+
794
+ Object.defineProperty(element._store, 'validated', {
795
+ configurable: false,
796
+ enumerable: false,
797
+ writable: true,
798
+ value: false
799
+ }); // self and source are DEV only properties.
800
+
801
+ Object.defineProperty(element, '_self', {
802
+ configurable: false,
803
+ enumerable: false,
804
+ writable: false,
805
+ value: self
806
+ }); // Two elements created in two different places should be considered
807
+ // equal for testing purposes and therefore we hide it from enumeration.
808
+
809
+ Object.defineProperty(element, '_source', {
810
+ configurable: false,
811
+ enumerable: false,
812
+ writable: false,
813
+ value: source
814
+ });
815
+
816
+ if (Object.freeze) {
817
+ Object.freeze(element.props);
818
+ Object.freeze(element);
819
+ }
820
+ }
821
+
822
+ return element;
823
+ };
824
+ /**
825
+ * Create and return a new ReactElement of the given type.
826
+ * See https://reactjs.org/docs/react-api.html#createelement
827
+ */
828
+
829
+ function createElement(type, config, children) {
830
+ var propName; // Reserved names are extracted
831
+
832
+ var props = {};
833
+ var key = null;
834
+ var ref = null;
835
+ var self = null;
836
+ var source = null;
837
+
838
+ if (config != null) {
839
+ if (hasValidRef(config)) {
840
+ ref = config.ref;
841
+
842
+ {
843
+ warnIfStringRefCannotBeAutoConverted(config);
844
+ }
845
+ }
846
+
847
+ if (hasValidKey(config)) {
848
+ {
849
+ checkKeyStringCoercion(config.key);
850
+ }
851
+
852
+ key = '' + config.key;
853
+ }
854
+
855
+ self = config.__self === undefined ? null : config.__self;
856
+ source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
857
+
858
+ for (propName in config) {
859
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
860
+ props[propName] = config[propName];
861
+ }
862
+ }
863
+ } // Children can be more than one argument, and those are transferred onto
864
+ // the newly allocated props object.
865
+
866
+
867
+ var childrenLength = arguments.length - 2;
868
+
869
+ if (childrenLength === 1) {
870
+ props.children = children;
871
+ } else if (childrenLength > 1) {
872
+ var childArray = Array(childrenLength);
873
+
874
+ for (var i = 0; i < childrenLength; i++) {
875
+ childArray[i] = arguments[i + 2];
876
+ }
877
+
878
+ {
879
+ if (Object.freeze) {
880
+ Object.freeze(childArray);
881
+ }
882
+ }
883
+
884
+ props.children = childArray;
885
+ } // Resolve default props
886
+
887
+
888
+ if (type && type.defaultProps) {
889
+ var defaultProps = type.defaultProps;
890
+
891
+ for (propName in defaultProps) {
892
+ if (props[propName] === undefined) {
893
+ props[propName] = defaultProps[propName];
894
+ }
895
+ }
896
+ }
897
+
898
+ {
899
+ if (key || ref) {
900
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
901
+
902
+ if (key) {
903
+ defineKeyPropWarningGetter(props, displayName);
904
+ }
905
+
906
+ if (ref) {
907
+ defineRefPropWarningGetter(props, displayName);
908
+ }
909
+ }
910
+ }
911
+
912
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
913
+ }
914
+ function cloneAndReplaceKey(oldElement, newKey) {
915
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
916
+ return newElement;
917
+ }
918
+ /**
919
+ * Clone and return a new ReactElement using element as the starting point.
920
+ * See https://reactjs.org/docs/react-api.html#cloneelement
921
+ */
922
+
923
+ function cloneElement(element, config, children) {
924
+ if (element === null || element === undefined) {
925
+ throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
926
+ }
927
+
928
+ var propName; // Original props are copied
929
+
930
+ var props = assign({}, element.props); // Reserved names are extracted
931
+
932
+ var key = element.key;
933
+ var ref = element.ref; // Self is preserved since the owner is preserved.
934
+
935
+ var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
936
+ // transpiler, and the original source is probably a better indicator of the
937
+ // true owner.
938
+
939
+ var source = element._source; // Owner will be preserved, unless ref is overridden
940
+
941
+ var owner = element._owner;
942
+
943
+ if (config != null) {
944
+ if (hasValidRef(config)) {
945
+ // Silently steal the ref from the parent.
946
+ ref = config.ref;
947
+ owner = ReactCurrentOwner.current;
948
+ }
949
+
950
+ if (hasValidKey(config)) {
951
+ {
952
+ checkKeyStringCoercion(config.key);
953
+ }
954
+
955
+ key = '' + config.key;
956
+ } // Remaining properties override existing props
957
+
958
+
959
+ var defaultProps;
960
+
961
+ if (element.type && element.type.defaultProps) {
962
+ defaultProps = element.type.defaultProps;
963
+ }
964
+
965
+ for (propName in config) {
966
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
967
+ if (config[propName] === undefined && defaultProps !== undefined) {
968
+ // Resolve default props
969
+ props[propName] = defaultProps[propName];
970
+ } else {
971
+ props[propName] = config[propName];
972
+ }
973
+ }
974
+ }
975
+ } // Children can be more than one argument, and those are transferred onto
976
+ // the newly allocated props object.
977
+
978
+
979
+ var childrenLength = arguments.length - 2;
980
+
981
+ if (childrenLength === 1) {
982
+ props.children = children;
983
+ } else if (childrenLength > 1) {
984
+ var childArray = Array(childrenLength);
985
+
986
+ for (var i = 0; i < childrenLength; i++) {
987
+ childArray[i] = arguments[i + 2];
988
+ }
989
+
990
+ props.children = childArray;
991
+ }
992
+
993
+ return ReactElement(element.type, key, ref, self, source, owner, props);
994
+ }
995
+ /**
996
+ * Verifies the object is a ReactElement.
997
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
998
+ * @param {?object} object
999
+ * @return {boolean} True if `object` is a ReactElement.
1000
+ * @final
1001
+ */
1002
+
1003
+ function isValidElement(object) {
1004
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1005
+ }
1006
+
1007
+ var SEPARATOR = '.';
1008
+ var SUBSEPARATOR = ':';
1009
+ /**
1010
+ * Escape and wrap key so it is safe to use as a reactid
1011
+ *
1012
+ * @param {string} key to be escaped.
1013
+ * @return {string} the escaped key.
1014
+ */
1015
+
1016
+ function escape(key) {
1017
+ var escapeRegex = /[=:]/g;
1018
+ var escaperLookup = {
1019
+ '=': '=0',
1020
+ ':': '=2'
1021
+ };
1022
+ var escapedString = key.replace(escapeRegex, function (match) {
1023
+ return escaperLookup[match];
1024
+ });
1025
+ return '$' + escapedString;
1026
+ }
1027
+ /**
1028
+ * TODO: Test that a single child and an array with one item have the same key
1029
+ * pattern.
1030
+ */
1031
+
1032
+
1033
+ var didWarnAboutMaps = false;
1034
+ var userProvidedKeyEscapeRegex = /\/+/g;
1035
+
1036
+ function escapeUserProvidedKey(text) {
1037
+ return text.replace(userProvidedKeyEscapeRegex, '$&/');
1038
+ }
1039
+ /**
1040
+ * Generate a key string that identifies a element within a set.
1041
+ *
1042
+ * @param {*} element A element that could contain a manual key.
1043
+ * @param {number} index Index that is used if a manual key is not provided.
1044
+ * @return {string}
1045
+ */
1046
+
1047
+
1048
+ function getElementKey(element, index) {
1049
+ // Do some typechecking here since we call this blindly. We want to ensure
1050
+ // that we don't block potential future ES APIs.
1051
+ if (typeof element === 'object' && element !== null && element.key != null) {
1052
+ // Explicit key
1053
+ {
1054
+ checkKeyStringCoercion(element.key);
1055
+ }
1056
+
1057
+ return escape('' + element.key);
1058
+ } // Implicit key determined by the index in the set
1059
+
1060
+
1061
+ return index.toString(36);
1062
+ }
1063
+
1064
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1065
+ var type = typeof children;
1066
+
1067
+ if (type === 'undefined' || type === 'boolean') {
1068
+ // All of the above are perceived as null.
1069
+ children = null;
1070
+ }
1071
+
1072
+ var invokeCallback = false;
1073
+
1074
+ if (children === null) {
1075
+ invokeCallback = true;
1076
+ } else {
1077
+ switch (type) {
1078
+ case 'string':
1079
+ case 'number':
1080
+ invokeCallback = true;
1081
+ break;
1082
+
1083
+ case 'object':
1084
+ switch (children.$$typeof) {
1085
+ case REACT_ELEMENT_TYPE:
1086
+ case REACT_PORTAL_TYPE:
1087
+ invokeCallback = true;
1088
+ }
1089
+
1090
+ }
1091
+ }
1092
+
1093
+ if (invokeCallback) {
1094
+ var _child = children;
1095
+ var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1096
+ // so that it's consistent if the number of children grows:
1097
+
1098
+ var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1099
+
1100
+ if (isArray(mappedChild)) {
1101
+ var escapedChildKey = '';
1102
+
1103
+ if (childKey != null) {
1104
+ escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1105
+ }
1106
+
1107
+ mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1108
+ return c;
1109
+ });
1110
+ } else if (mappedChild != null) {
1111
+ if (isValidElement(mappedChild)) {
1112
+ {
1113
+ // The `if` statement here prevents auto-disabling of the safe
1114
+ // coercion ESLint rule, so we must manually disable it below.
1115
+ // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1116
+ if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
1117
+ checkKeyStringCoercion(mappedChild.key);
1118
+ }
1119
+ }
1120
+
1121
+ mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1122
+ // traverseAllChildren used to do for objects as children
1123
+ escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1124
+ mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1125
+ // eslint-disable-next-line react-internal/safe-string-coercion
1126
+ escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
1127
+ }
1128
+
1129
+ array.push(mappedChild);
1130
+ }
1131
+
1132
+ return 1;
1133
+ }
1134
+
1135
+ var child;
1136
+ var nextName;
1137
+ var subtreeCount = 0; // Count of children found in the current subtree.
1138
+
1139
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1140
+
1141
+ if (isArray(children)) {
1142
+ for (var i = 0; i < children.length; i++) {
1143
+ child = children[i];
1144
+ nextName = nextNamePrefix + getElementKey(child, i);
1145
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1146
+ }
1147
+ } else {
1148
+ var iteratorFn = getIteratorFn(children);
1149
+
1150
+ if (typeof iteratorFn === 'function') {
1151
+ var iterableChildren = children;
1152
+
1153
+ {
1154
+ // Warn about using Maps as children
1155
+ if (iteratorFn === iterableChildren.entries) {
1156
+ if (!didWarnAboutMaps) {
1157
+ warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1158
+ }
1159
+
1160
+ didWarnAboutMaps = true;
1161
+ }
1162
+ }
1163
+
1164
+ var iterator = iteratorFn.call(iterableChildren);
1165
+ var step;
1166
+ var ii = 0;
1167
+
1168
+ while (!(step = iterator.next()).done) {
1169
+ child = step.value;
1170
+ nextName = nextNamePrefix + getElementKey(child, ii++);
1171
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1172
+ }
1173
+ } else if (type === 'object') {
1174
+ // eslint-disable-next-line react-internal/safe-string-coercion
1175
+ var childrenString = String(children);
1176
+ 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.');
1177
+ }
1178
+ }
1179
+
1180
+ return subtreeCount;
1181
+ }
1182
+
1183
+ /**
1184
+ * Maps children that are typically specified as `props.children`.
1185
+ *
1186
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1187
+ *
1188
+ * The provided mapFunction(child, index) will be called for each
1189
+ * leaf child.
1190
+ *
1191
+ * @param {?*} children Children tree container.
1192
+ * @param {function(*, int)} func The map function.
1193
+ * @param {*} context Context for mapFunction.
1194
+ * @return {object} Object containing the ordered map of results.
1195
+ */
1196
+ function mapChildren(children, func, context) {
1197
+ if (children == null) {
1198
+ return children;
1199
+ }
1200
+
1201
+ var result = [];
1202
+ var count = 0;
1203
+ mapIntoArray(children, result, '', '', function (child) {
1204
+ return func.call(context, child, count++);
1205
+ });
1206
+ return result;
1207
+ }
1208
+ /**
1209
+ * Count the number of children that are typically specified as
1210
+ * `props.children`.
1211
+ *
1212
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
1213
+ *
1214
+ * @param {?*} children Children tree container.
1215
+ * @return {number} The number of children.
1216
+ */
1217
+
1218
+
1219
+ function countChildren(children) {
1220
+ var n = 0;
1221
+ mapChildren(children, function () {
1222
+ n++; // Don't return anything
1223
+ });
1224
+ return n;
1225
+ }
1226
+
1227
+ /**
1228
+ * Iterates through children that are typically specified as `props.children`.
1229
+ *
1230
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1231
+ *
1232
+ * The provided forEachFunc(child, index) will be called for each
1233
+ * leaf child.
1234
+ *
1235
+ * @param {?*} children Children tree container.
1236
+ * @param {function(*, int)} forEachFunc
1237
+ * @param {*} forEachContext Context for forEachContext.
1238
+ */
1239
+ function forEachChildren(children, forEachFunc, forEachContext) {
1240
+ mapChildren(children, function () {
1241
+ forEachFunc.apply(this, arguments); // Don't return anything.
1242
+ }, forEachContext);
1243
+ }
1244
+ /**
1245
+ * Flatten a children object (typically specified as `props.children`) and
1246
+ * return an array with appropriately re-keyed children.
1247
+ *
1248
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1249
+ */
1250
+
1251
+
1252
+ function toArray(children) {
1253
+ return mapChildren(children, function (child) {
1254
+ return child;
1255
+ }) || [];
1256
+ }
1257
+ /**
1258
+ * Returns the first child in a collection of children and verifies that there
1259
+ * is only one child in the collection.
1260
+ *
1261
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1262
+ *
1263
+ * The current implementation of this function assumes that a single child gets
1264
+ * passed without a wrapper, but the purpose of this helper function is to
1265
+ * abstract away the particular structure of children.
1266
+ *
1267
+ * @param {?object} children Child collection structure.
1268
+ * @return {ReactElement} The first and only `ReactElement` contained in the
1269
+ * structure.
1270
+ */
1271
+
1272
+
1273
+ function onlyChild(children) {
1274
+ if (!isValidElement(children)) {
1275
+ throw new Error('React.Children.only expected to receive a single React element child.');
1276
+ }
1277
+
1278
+ return children;
1279
+ }
1280
+
1281
+ function createContext(defaultValue) {
1282
+ // TODO: Second argument used to be an optional `calculateChangedBits`
1283
+ // function. Warn to reserve for future use?
1284
+ var context = {
1285
+ $$typeof: REACT_CONTEXT_TYPE,
1286
+ // As a workaround to support multiple concurrent renderers, we categorize
1287
+ // some renderers as primary and others as secondary. We only expect
1288
+ // there to be two concurrent renderers at most: React Native (primary) and
1289
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
1290
+ // Secondary renderers store their context values on separate fields.
1291
+ _currentValue: defaultValue,
1292
+ _currentValue2: defaultValue,
1293
+ // Used to track how many concurrent renderers this context currently
1294
+ // supports within in a single renderer. Such as parallel server rendering.
1295
+ _threadCount: 0,
1296
+ // These are circular
1297
+ Provider: null,
1298
+ Consumer: null,
1299
+ // Add these to use same hidden class in VM as ServerContext
1300
+ _defaultValue: null,
1301
+ _globalName: null
1302
+ };
1303
+ context.Provider = {
1304
+ $$typeof: REACT_PROVIDER_TYPE,
1305
+ _context: context
1306
+ };
1307
+ var hasWarnedAboutUsingNestedContextConsumers = false;
1308
+ var hasWarnedAboutUsingConsumerProvider = false;
1309
+ var hasWarnedAboutDisplayNameOnConsumer = false;
1310
+
1311
+ {
1312
+ // A separate object, but proxies back to the original context object for
1313
+ // backwards compatibility. It has a different $$typeof, so we can properly
1314
+ // warn for the incorrect usage of Context as a Consumer.
1315
+ var Consumer = {
1316
+ $$typeof: REACT_CONTEXT_TYPE,
1317
+ _context: context
1318
+ }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1319
+
1320
+ Object.defineProperties(Consumer, {
1321
+ Provider: {
1322
+ get: function () {
1323
+ if (!hasWarnedAboutUsingConsumerProvider) {
1324
+ hasWarnedAboutUsingConsumerProvider = true;
1325
+
1326
+ 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?');
1327
+ }
1328
+
1329
+ return context.Provider;
1330
+ },
1331
+ set: function (_Provider) {
1332
+ context.Provider = _Provider;
1333
+ }
1334
+ },
1335
+ _currentValue: {
1336
+ get: function () {
1337
+ return context._currentValue;
1338
+ },
1339
+ set: function (_currentValue) {
1340
+ context._currentValue = _currentValue;
1341
+ }
1342
+ },
1343
+ _currentValue2: {
1344
+ get: function () {
1345
+ return context._currentValue2;
1346
+ },
1347
+ set: function (_currentValue2) {
1348
+ context._currentValue2 = _currentValue2;
1349
+ }
1350
+ },
1351
+ _threadCount: {
1352
+ get: function () {
1353
+ return context._threadCount;
1354
+ },
1355
+ set: function (_threadCount) {
1356
+ context._threadCount = _threadCount;
1357
+ }
1358
+ },
1359
+ Consumer: {
1360
+ get: function () {
1361
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
1362
+ hasWarnedAboutUsingNestedContextConsumers = true;
1363
+
1364
+ 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?');
1365
+ }
1366
+
1367
+ return context.Consumer;
1368
+ }
1369
+ },
1370
+ displayName: {
1371
+ get: function () {
1372
+ return context.displayName;
1373
+ },
1374
+ set: function (displayName) {
1375
+ if (!hasWarnedAboutDisplayNameOnConsumer) {
1376
+ warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
1377
+
1378
+ hasWarnedAboutDisplayNameOnConsumer = true;
1379
+ }
1380
+ }
1381
+ }
1382
+ }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1383
+
1384
+ context.Consumer = Consumer;
1385
+ }
1386
+
1387
+ {
1388
+ context._currentRenderer = null;
1389
+ context._currentRenderer2 = null;
1390
+ }
1391
+
1392
+ return context;
1393
+ }
1394
+
1395
+ var Uninitialized = -1;
1396
+ var Pending = 0;
1397
+ var Resolved = 1;
1398
+ var Rejected = 2;
1399
+
1400
+ function lazyInitializer(payload) {
1401
+ if (payload._status === Uninitialized) {
1402
+ var ctor = payload._result;
1403
+ var thenable = ctor(); // Transition to the next state.
1404
+ // This might throw either because it's missing or throws. If so, we treat it
1405
+ // as still uninitialized and try again next time. Which is the same as what
1406
+ // happens if the ctor or any wrappers processing the ctor throws. This might
1407
+ // end up fixing it if the resolution was a concurrency bug.
1408
+
1409
+ thenable.then(function (moduleObject) {
1410
+ if (payload._status === Pending || payload._status === Uninitialized) {
1411
+ // Transition to the next state.
1412
+ var resolved = payload;
1413
+ resolved._status = Resolved;
1414
+ resolved._result = moduleObject;
1415
+ }
1416
+ }, function (error) {
1417
+ if (payload._status === Pending || payload._status === Uninitialized) {
1418
+ // Transition to the next state.
1419
+ var rejected = payload;
1420
+ rejected._status = Rejected;
1421
+ rejected._result = error;
1422
+ }
1423
+ });
1424
+
1425
+ if (payload._status === Uninitialized) {
1426
+ // In case, we're still uninitialized, then we're waiting for the thenable
1427
+ // to resolve. Set it as pending in the meantime.
1428
+ var pending = payload;
1429
+ pending._status = Pending;
1430
+ pending._result = thenable;
1431
+ }
1432
+ }
1433
+
1434
+ if (payload._status === Resolved) {
1435
+ var moduleObject = payload._result;
1436
+
1437
+ {
1438
+ if (moduleObject === undefined) {
1439
+ 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.
1440
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
1441
+ }
1442
+ }
1443
+
1444
+ {
1445
+ if (!('default' in moduleObject)) {
1446
+ 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.
1447
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
1448
+ }
1449
+ }
1450
+
1451
+ return moduleObject.default;
1452
+ } else {
1453
+ throw payload._result;
1454
+ }
1455
+ }
1456
+
1457
+ function lazy(ctor) {
1458
+ var payload = {
1459
+ // We use these fields to store the result.
1460
+ _status: Uninitialized,
1461
+ _result: ctor
1462
+ };
1463
+ var lazyType = {
1464
+ $$typeof: REACT_LAZY_TYPE,
1465
+ _payload: payload,
1466
+ _init: lazyInitializer
1467
+ };
1468
+
1469
+ {
1470
+ // In production, this would just set it on the object.
1471
+ var defaultProps;
1472
+ var propTypes; // $FlowFixMe
1473
+
1474
+ Object.defineProperties(lazyType, {
1475
+ defaultProps: {
1476
+ configurable: true,
1477
+ get: function () {
1478
+ return defaultProps;
1479
+ },
1480
+ set: function (newDefaultProps) {
1481
+ 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.');
1482
+
1483
+ defaultProps = newDefaultProps; // Match production behavior more closely:
1484
+ // $FlowFixMe
1485
+
1486
+ Object.defineProperty(lazyType, 'defaultProps', {
1487
+ enumerable: true
1488
+ });
1489
+ }
1490
+ },
1491
+ propTypes: {
1492
+ configurable: true,
1493
+ get: function () {
1494
+ return propTypes;
1495
+ },
1496
+ set: function (newPropTypes) {
1497
+ 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.');
1498
+
1499
+ propTypes = newPropTypes; // Match production behavior more closely:
1500
+ // $FlowFixMe
1501
+
1502
+ Object.defineProperty(lazyType, 'propTypes', {
1503
+ enumerable: true
1504
+ });
1505
+ }
1506
+ }
1507
+ });
1508
+ }
1509
+
1510
+ return lazyType;
1511
+ }
1512
+
1513
+ function forwardRef(render) {
1514
+ {
1515
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
1516
+ error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
1517
+ } else if (typeof render !== 'function') {
1518
+ error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
1519
+ } else {
1520
+ if (render.length !== 0 && render.length !== 2) {
1521
+ 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.');
1522
+ }
1523
+ }
1524
+
1525
+ if (render != null) {
1526
+ if (render.defaultProps != null || render.propTypes != null) {
1527
+ error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
1528
+ }
1529
+ }
1530
+ }
1531
+
1532
+ var elementType = {
1533
+ $$typeof: REACT_FORWARD_REF_TYPE,
1534
+ render: render
1535
+ };
1536
+
1537
+ {
1538
+ var ownName;
1539
+ Object.defineProperty(elementType, 'displayName', {
1540
+ enumerable: false,
1541
+ configurable: true,
1542
+ get: function () {
1543
+ return ownName;
1544
+ },
1545
+ set: function (name) {
1546
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1547
+ // because the component may be used elsewhere.
1548
+ // But it's nice for anonymous functions to inherit the name,
1549
+ // so that our component-stack generation logic will display their frames.
1550
+ // An anonymous function generally suggests a pattern like:
1551
+ // React.forwardRef((props, ref) => {...});
1552
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1553
+
1554
+ if (!render.name && !render.displayName) {
1555
+ render.displayName = name;
1556
+ }
1557
+ }
1558
+ });
1559
+ }
1560
+
1561
+ return elementType;
1562
+ }
1563
+
1564
+ var REACT_MODULE_REFERENCE;
1565
+
1566
+ {
1567
+ REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
1568
+ }
1569
+
1570
+ function isValidElementType(type) {
1571
+ if (typeof type === 'string' || typeof type === 'function') {
1572
+ return true;
1573
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
1574
+
1575
+
1576
+ 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 ) {
1577
+ return true;
1578
+ }
1579
+
1580
+ if (typeof type === 'object' && type !== null) {
1581
+ 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
1582
+ // types supported by any Flight configuration anywhere since
1583
+ // we don't know which Flight build this will end up being used
1584
+ // with.
1585
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
1586
+ return true;
1587
+ }
1588
+ }
1589
+
1590
+ return false;
1591
+ }
1592
+
1593
+ function memo(type, compare) {
1594
+ {
1595
+ if (!isValidElementType(type)) {
1596
+ error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
1597
+ }
1598
+ }
1599
+
1600
+ var elementType = {
1601
+ $$typeof: REACT_MEMO_TYPE,
1602
+ type: type,
1603
+ compare: compare === undefined ? null : compare
1604
+ };
1605
+
1606
+ {
1607
+ var ownName;
1608
+ Object.defineProperty(elementType, 'displayName', {
1609
+ enumerable: false,
1610
+ configurable: true,
1611
+ get: function () {
1612
+ return ownName;
1613
+ },
1614
+ set: function (name) {
1615
+ ownName = name; // The inner component shouldn't inherit this display name in most cases,
1616
+ // because the component may be used elsewhere.
1617
+ // But it's nice for anonymous functions to inherit the name,
1618
+ // so that our component-stack generation logic will display their frames.
1619
+ // An anonymous function generally suggests a pattern like:
1620
+ // React.memo((props) => {...});
1621
+ // This kind of inner function is not used elsewhere so the side effect is okay.
1622
+
1623
+ if (!type.name && !type.displayName) {
1624
+ type.displayName = name;
1625
+ }
1626
+ }
1627
+ });
1628
+ }
1629
+
1630
+ return elementType;
1631
+ }
1632
+
1633
+ function resolveDispatcher() {
1634
+ var dispatcher = ReactCurrentDispatcher.current;
1635
+
1636
+ {
1637
+ if (dispatcher === null) {
1638
+ 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.');
1639
+ }
1640
+ } // Will result in a null access error if accessed outside render phase. We
1641
+ // intentionally don't throw our own error because this is in a hot path.
1642
+ // Also helps ensure this is inlined.
1643
+
1644
+
1645
+ return dispatcher;
1646
+ }
1647
+ function useContext(Context) {
1648
+ var dispatcher = resolveDispatcher();
1649
+
1650
+ {
1651
+ // TODO: add a more generic warning for invalid values.
1652
+ if (Context._context !== undefined) {
1653
+ var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
1654
+ // and nobody should be using this in existing code.
1655
+
1656
+ if (realContext.Consumer === Context) {
1657
+ 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?');
1658
+ } else if (realContext.Provider === Context) {
1659
+ error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
1660
+ }
1661
+ }
1662
+ }
1663
+
1664
+ return dispatcher.useContext(Context);
1665
+ }
1666
+ function useState(initialState) {
1667
+ var dispatcher = resolveDispatcher();
1668
+ return dispatcher.useState(initialState);
1669
+ }
1670
+ function useReducer(reducer, initialArg, init) {
1671
+ var dispatcher = resolveDispatcher();
1672
+ return dispatcher.useReducer(reducer, initialArg, init);
1673
+ }
1674
+ function useRef(initialValue) {
1675
+ var dispatcher = resolveDispatcher();
1676
+ return dispatcher.useRef(initialValue);
1677
+ }
1678
+ function useEffect(create, deps) {
1679
+ var dispatcher = resolveDispatcher();
1680
+ return dispatcher.useEffect(create, deps);
1681
+ }
1682
+ function useInsertionEffect(create, deps) {
1683
+ var dispatcher = resolveDispatcher();
1684
+ return dispatcher.useInsertionEffect(create, deps);
1685
+ }
1686
+ function useLayoutEffect(create, deps) {
1687
+ var dispatcher = resolveDispatcher();
1688
+ return dispatcher.useLayoutEffect(create, deps);
1689
+ }
1690
+ function useCallback(callback, deps) {
1691
+ var dispatcher = resolveDispatcher();
1692
+ return dispatcher.useCallback(callback, deps);
1693
+ }
1694
+ function useMemo(create, deps) {
1695
+ var dispatcher = resolveDispatcher();
1696
+ return dispatcher.useMemo(create, deps);
1697
+ }
1698
+ function useImperativeHandle(ref, create, deps) {
1699
+ var dispatcher = resolveDispatcher();
1700
+ return dispatcher.useImperativeHandle(ref, create, deps);
1701
+ }
1702
+ function useDebugValue(value, formatterFn) {
1703
+ {
1704
+ var dispatcher = resolveDispatcher();
1705
+ return dispatcher.useDebugValue(value, formatterFn);
1706
+ }
1707
+ }
1708
+ function useTransition() {
1709
+ var dispatcher = resolveDispatcher();
1710
+ return dispatcher.useTransition();
1711
+ }
1712
+ function useDeferredValue(value) {
1713
+ var dispatcher = resolveDispatcher();
1714
+ return dispatcher.useDeferredValue(value);
1715
+ }
1716
+ function useId() {
1717
+ var dispatcher = resolveDispatcher();
1718
+ return dispatcher.useId();
1719
+ }
1720
+ function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
1721
+ var dispatcher = resolveDispatcher();
1722
+ return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
1723
+ }
1724
+
1725
+ // Helpers to patch console.logs to avoid logging during side-effect free
1726
+ // replaying on render function. This currently only patches the object
1727
+ // lazily which won't cover if the log function was extracted eagerly.
1728
+ // We could also eagerly patch the method.
1729
+ var disabledDepth = 0;
1730
+ var prevLog;
1731
+ var prevInfo;
1732
+ var prevWarn;
1733
+ var prevError;
1734
+ var prevGroup;
1735
+ var prevGroupCollapsed;
1736
+ var prevGroupEnd;
1737
+
1738
+ function disabledLog() {}
1739
+
1740
+ disabledLog.__reactDisabledLog = true;
1741
+ function disableLogs() {
1742
+ {
1743
+ if (disabledDepth === 0) {
1744
+ /* eslint-disable react-internal/no-production-logging */
1745
+ prevLog = console.log;
1746
+ prevInfo = console.info;
1747
+ prevWarn = console.warn;
1748
+ prevError = console.error;
1749
+ prevGroup = console.group;
1750
+ prevGroupCollapsed = console.groupCollapsed;
1751
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
1752
+
1753
+ var props = {
1754
+ configurable: true,
1755
+ enumerable: true,
1756
+ value: disabledLog,
1757
+ writable: true
1758
+ }; // $FlowFixMe Flow thinks console is immutable.
1759
+
1760
+ Object.defineProperties(console, {
1761
+ info: props,
1762
+ log: props,
1763
+ warn: props,
1764
+ error: props,
1765
+ group: props,
1766
+ groupCollapsed: props,
1767
+ groupEnd: props
1768
+ });
1769
+ /* eslint-enable react-internal/no-production-logging */
1770
+ }
1771
+
1772
+ disabledDepth++;
1773
+ }
1774
+ }
1775
+ function reenableLogs() {
1776
+ {
1777
+ disabledDepth--;
1778
+
1779
+ if (disabledDepth === 0) {
1780
+ /* eslint-disable react-internal/no-production-logging */
1781
+ var props = {
1782
+ configurable: true,
1783
+ enumerable: true,
1784
+ writable: true
1785
+ }; // $FlowFixMe Flow thinks console is immutable.
1786
+
1787
+ Object.defineProperties(console, {
1788
+ log: assign({}, props, {
1789
+ value: prevLog
1790
+ }),
1791
+ info: assign({}, props, {
1792
+ value: prevInfo
1793
+ }),
1794
+ warn: assign({}, props, {
1795
+ value: prevWarn
1796
+ }),
1797
+ error: assign({}, props, {
1798
+ value: prevError
1799
+ }),
1800
+ group: assign({}, props, {
1801
+ value: prevGroup
1802
+ }),
1803
+ groupCollapsed: assign({}, props, {
1804
+ value: prevGroupCollapsed
1805
+ }),
1806
+ groupEnd: assign({}, props, {
1807
+ value: prevGroupEnd
1808
+ })
1809
+ });
1810
+ /* eslint-enable react-internal/no-production-logging */
1811
+ }
1812
+
1813
+ if (disabledDepth < 0) {
1814
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
1815
+ }
1816
+ }
1817
+ }
1818
+
1819
+ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
1820
+ var prefix;
1821
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
1822
+ {
1823
+ if (prefix === undefined) {
1824
+ // Extract the VM specific prefix used by each line.
1825
+ try {
1826
+ throw Error();
1827
+ } catch (x) {
1828
+ var match = x.stack.trim().match(/\n( *(at )?)/);
1829
+ prefix = match && match[1] || '';
1830
+ }
1831
+ } // We use the prefix to ensure our stacks line up with native stack frames.
1832
+
1833
+
1834
+ return '\n' + prefix + name;
1835
+ }
1836
+ }
1837
+ var reentry = false;
1838
+ var componentFrameCache;
1839
+
1840
+ {
1841
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
1842
+ componentFrameCache = new PossiblyWeakMap();
1843
+ }
1844
+
1845
+ function describeNativeComponentFrame(fn, construct) {
1846
+ // If something asked for a stack inside a fake render, it should get ignored.
1847
+ if ( !fn || reentry) {
1848
+ return '';
1849
+ }
1850
+
1851
+ {
1852
+ var frame = componentFrameCache.get(fn);
1853
+
1854
+ if (frame !== undefined) {
1855
+ return frame;
1856
+ }
1857
+ }
1858
+
1859
+ var control;
1860
+ reentry = true;
1861
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
1862
+
1863
+ Error.prepareStackTrace = undefined;
1864
+ var previousDispatcher;
1865
+
1866
+ {
1867
+ previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
1868
+ // for warnings.
1869
+
1870
+ ReactCurrentDispatcher$1.current = null;
1871
+ disableLogs();
1872
+ }
1873
+
1874
+ try {
1875
+ // This should throw.
1876
+ if (construct) {
1877
+ // Something should be setting the props in the constructor.
1878
+ var Fake = function () {
1879
+ throw Error();
1880
+ }; // $FlowFixMe
1881
+
1882
+
1883
+ Object.defineProperty(Fake.prototype, 'props', {
1884
+ set: function () {
1885
+ // We use a throwing setter instead of frozen or non-writable props
1886
+ // because that won't throw in a non-strict mode function.
1887
+ throw Error();
1888
+ }
1889
+ });
1890
+
1891
+ if (typeof Reflect === 'object' && Reflect.construct) {
1892
+ // We construct a different control for this case to include any extra
1893
+ // frames added by the construct call.
1894
+ try {
1895
+ Reflect.construct(Fake, []);
1896
+ } catch (x) {
1897
+ control = x;
1898
+ }
1899
+
1900
+ Reflect.construct(fn, [], Fake);
1901
+ } else {
1902
+ try {
1903
+ Fake.call();
1904
+ } catch (x) {
1905
+ control = x;
1906
+ }
1907
+
1908
+ fn.call(Fake.prototype);
1909
+ }
1910
+ } else {
1911
+ try {
1912
+ throw Error();
1913
+ } catch (x) {
1914
+ control = x;
1915
+ }
1916
+
1917
+ fn();
1918
+ }
1919
+ } catch (sample) {
1920
+ // This is inlined manually because closure doesn't do it for us.
1921
+ if (sample && control && typeof sample.stack === 'string') {
1922
+ // This extracts the first frame from the sample that isn't also in the control.
1923
+ // Skipping one frame that we assume is the frame that calls the two.
1924
+ var sampleLines = sample.stack.split('\n');
1925
+ var controlLines = control.stack.split('\n');
1926
+ var s = sampleLines.length - 1;
1927
+ var c = controlLines.length - 1;
1928
+
1929
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
1930
+ // We expect at least one stack frame to be shared.
1931
+ // Typically this will be the root most one. However, stack frames may be
1932
+ // cut off due to maximum stack limits. In this case, one maybe cut off
1933
+ // earlier than the other. We assume that the sample is longer or the same
1934
+ // and there for cut off earlier. So we should find the root most frame in
1935
+ // the sample somewhere in the control.
1936
+ c--;
1937
+ }
1938
+
1939
+ for (; s >= 1 && c >= 0; s--, c--) {
1940
+ // Next we find the first one that isn't the same which should be the
1941
+ // frame that called our sample function and the control.
1942
+ if (sampleLines[s] !== controlLines[c]) {
1943
+ // In V8, the first line is describing the message but other VMs don't.
1944
+ // If we're about to return the first line, and the control is also on the same
1945
+ // line, that's a pretty good indicator that our sample threw at same line as
1946
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
1947
+ // This can happen if you passed a class to function component, or non-function.
1948
+ if (s !== 1 || c !== 1) {
1949
+ do {
1950
+ s--;
1951
+ c--; // We may still have similar intermediate frames from the construct call.
1952
+ // The next one that isn't the same should be our match though.
1953
+
1954
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
1955
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
1956
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
1957
+ // but we have a user-provided "displayName"
1958
+ // splice it in to make the stack more readable.
1959
+
1960
+
1961
+ if (fn.displayName && _frame.includes('<anonymous>')) {
1962
+ _frame = _frame.replace('<anonymous>', fn.displayName);
1963
+ }
1964
+
1965
+ {
1966
+ if (typeof fn === 'function') {
1967
+ componentFrameCache.set(fn, _frame);
1968
+ }
1969
+ } // Return the line we found.
1970
+
1971
+
1972
+ return _frame;
1973
+ }
1974
+ } while (s >= 1 && c >= 0);
1975
+ }
1976
+
1977
+ break;
1978
+ }
1979
+ }
1980
+ }
1981
+ } finally {
1982
+ reentry = false;
1983
+
1984
+ {
1985
+ ReactCurrentDispatcher$1.current = previousDispatcher;
1986
+ reenableLogs();
1987
+ }
1988
+
1989
+ Error.prepareStackTrace = previousPrepareStackTrace;
1990
+ } // Fallback to just using the name if we couldn't make it throw.
1991
+
1992
+
1993
+ var name = fn ? fn.displayName || fn.name : '';
1994
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
1995
+
1996
+ {
1997
+ if (typeof fn === 'function') {
1998
+ componentFrameCache.set(fn, syntheticFrame);
1999
+ }
2000
+ }
2001
+
2002
+ return syntheticFrame;
2003
+ }
2004
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
2005
+ {
2006
+ return describeNativeComponentFrame(fn, false);
2007
+ }
2008
+ }
2009
+
2010
+ function shouldConstruct(Component) {
2011
+ var prototype = Component.prototype;
2012
+ return !!(prototype && prototype.isReactComponent);
2013
+ }
2014
+
2015
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
2016
+
2017
+ if (type == null) {
2018
+ return '';
2019
+ }
2020
+
2021
+ if (typeof type === 'function') {
2022
+ {
2023
+ return describeNativeComponentFrame(type, shouldConstruct(type));
2024
+ }
2025
+ }
2026
+
2027
+ if (typeof type === 'string') {
2028
+ return describeBuiltInComponentFrame(type);
2029
+ }
2030
+
2031
+ switch (type) {
2032
+ case REACT_SUSPENSE_TYPE:
2033
+ return describeBuiltInComponentFrame('Suspense');
2034
+
2035
+ case REACT_SUSPENSE_LIST_TYPE:
2036
+ return describeBuiltInComponentFrame('SuspenseList');
2037
+ }
2038
+
2039
+ if (typeof type === 'object') {
2040
+ switch (type.$$typeof) {
2041
+ case REACT_FORWARD_REF_TYPE:
2042
+ return describeFunctionComponentFrame(type.render);
2043
+
2044
+ case REACT_MEMO_TYPE:
2045
+ // Memo may contain any component type so we recursively resolve it.
2046
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
2047
+
2048
+ case REACT_LAZY_TYPE:
2049
+ {
2050
+ var lazyComponent = type;
2051
+ var payload = lazyComponent._payload;
2052
+ var init = lazyComponent._init;
2053
+
2054
+ try {
2055
+ // Lazy may contain any component type so we recursively resolve it.
2056
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
2057
+ } catch (x) {}
2058
+ }
2059
+ }
2060
+ }
2061
+
2062
+ return '';
2063
+ }
2064
+
2065
+ var loggedTypeFailures = {};
2066
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2067
+
2068
+ function setCurrentlyValidatingElement(element) {
2069
+ {
2070
+ if (element) {
2071
+ var owner = element._owner;
2072
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2073
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2074
+ } else {
2075
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2076
+ }
2077
+ }
2078
+ }
2079
+
2080
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
2081
+ {
2082
+ // $FlowFixMe This is okay but Flow doesn't know it.
2083
+ var has = Function.call.bind(hasOwnProperty);
2084
+
2085
+ for (var typeSpecName in typeSpecs) {
2086
+ if (has(typeSpecs, typeSpecName)) {
2087
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
2088
+ // fail the render phase where it didn't fail before. So we log it.
2089
+ // After these have been cleaned up, we'll let them throw.
2090
+
2091
+ try {
2092
+ // This is intentionally an invariant that gets caught. It's the same
2093
+ // behavior as without this statement except with a better message.
2094
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
2095
+ // eslint-disable-next-line react-internal/prod-error-codes
2096
+ 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`.');
2097
+ err.name = 'Invariant Violation';
2098
+ throw err;
2099
+ }
2100
+
2101
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
2102
+ } catch (ex) {
2103
+ error$1 = ex;
2104
+ }
2105
+
2106
+ if (error$1 && !(error$1 instanceof Error)) {
2107
+ setCurrentlyValidatingElement(element);
2108
+
2109
+ 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);
2110
+
2111
+ setCurrentlyValidatingElement(null);
2112
+ }
2113
+
2114
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2115
+ // Only monitor this failure once because there tends to be a lot of the
2116
+ // same error.
2117
+ loggedTypeFailures[error$1.message] = true;
2118
+ setCurrentlyValidatingElement(element);
2119
+
2120
+ error('Failed %s type: %s', location, error$1.message);
2121
+
2122
+ setCurrentlyValidatingElement(null);
2123
+ }
2124
+ }
2125
+ }
2126
+ }
2127
+ }
2128
+
2129
+ function setCurrentlyValidatingElement$1(element) {
2130
+ {
2131
+ if (element) {
2132
+ var owner = element._owner;
2133
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2134
+ setExtraStackFrame(stack);
2135
+ } else {
2136
+ setExtraStackFrame(null);
2137
+ }
2138
+ }
2139
+ }
2140
+
2141
+ var propTypesMisspellWarningShown;
2142
+
2143
+ {
2144
+ propTypesMisspellWarningShown = false;
2145
+ }
2146
+
2147
+ function getDeclarationErrorAddendum() {
2148
+ if (ReactCurrentOwner.current) {
2149
+ var name = getComponentNameFromType(ReactCurrentOwner.current.type);
2150
+
2151
+ if (name) {
2152
+ return '\n\nCheck the render method of `' + name + '`.';
2153
+ }
2154
+ }
2155
+
2156
+ return '';
2157
+ }
2158
+
2159
+ function getSourceInfoErrorAddendum(source) {
2160
+ if (source !== undefined) {
2161
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2162
+ var lineNumber = source.lineNumber;
2163
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2164
+ }
2165
+
2166
+ return '';
2167
+ }
2168
+
2169
+ function getSourceInfoErrorAddendumForProps(elementProps) {
2170
+ if (elementProps !== null && elementProps !== undefined) {
2171
+ return getSourceInfoErrorAddendum(elementProps.__source);
2172
+ }
2173
+
2174
+ return '';
2175
+ }
2176
+ /**
2177
+ * Warn if there's no key explicitly set on dynamic arrays of children or
2178
+ * object keys are not valid. This allows us to keep track of children between
2179
+ * updates.
2180
+ */
2181
+
2182
+
2183
+ var ownerHasKeyUseWarning = {};
2184
+
2185
+ function getCurrentComponentErrorInfo(parentType) {
2186
+ var info = getDeclarationErrorAddendum();
2187
+
2188
+ if (!info) {
2189
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2190
+
2191
+ if (parentName) {
2192
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2193
+ }
2194
+ }
2195
+
2196
+ return info;
2197
+ }
2198
+ /**
2199
+ * Warn if the element doesn't have an explicit key assigned to it.
2200
+ * This element is in an array. The array could grow and shrink or be
2201
+ * reordered. All children that haven't already been validated are required to
2202
+ * have a "key" property assigned to it. Error statuses are cached so a warning
2203
+ * will only be shown once.
2204
+ *
2205
+ * @internal
2206
+ * @param {ReactElement} element Element that requires a key.
2207
+ * @param {*} parentType element's parent's type.
2208
+ */
2209
+
2210
+
2211
+ function validateExplicitKey(element, parentType) {
2212
+ if (!element._store || element._store.validated || element.key != null) {
2213
+ return;
2214
+ }
2215
+
2216
+ element._store.validated = true;
2217
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2218
+
2219
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2220
+ return;
2221
+ }
2222
+
2223
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2224
+ // property, it may be the creator of the child that's responsible for
2225
+ // assigning it a key.
2226
+
2227
+ var childOwner = '';
2228
+
2229
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2230
+ // Give the component that originally created this child.
2231
+ childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
2232
+ }
2233
+
2234
+ {
2235
+ setCurrentlyValidatingElement$1(element);
2236
+
2237
+ 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);
2238
+
2239
+ setCurrentlyValidatingElement$1(null);
2240
+ }
2241
+ }
2242
+ /**
2243
+ * Ensure that every element either is passed in a static location, in an
2244
+ * array with an explicit keys property defined, or in an object literal
2245
+ * with valid key property.
2246
+ *
2247
+ * @internal
2248
+ * @param {ReactNode} node Statically passed child of any type.
2249
+ * @param {*} parentType node's parent's type.
2250
+ */
2251
+
2252
+
2253
+ function validateChildKeys(node, parentType) {
2254
+ if (typeof node !== 'object') {
2255
+ return;
2256
+ }
2257
+
2258
+ if (isArray(node)) {
2259
+ for (var i = 0; i < node.length; i++) {
2260
+ var child = node[i];
2261
+
2262
+ if (isValidElement(child)) {
2263
+ validateExplicitKey(child, parentType);
2264
+ }
2265
+ }
2266
+ } else if (isValidElement(node)) {
2267
+ // This element was passed in a valid location.
2268
+ if (node._store) {
2269
+ node._store.validated = true;
2270
+ }
2271
+ } else if (node) {
2272
+ var iteratorFn = getIteratorFn(node);
2273
+
2274
+ if (typeof iteratorFn === 'function') {
2275
+ // Entry iterators used to provide implicit keys,
2276
+ // but now we print a separate warning for them later.
2277
+ if (iteratorFn !== node.entries) {
2278
+ var iterator = iteratorFn.call(node);
2279
+ var step;
2280
+
2281
+ while (!(step = iterator.next()).done) {
2282
+ if (isValidElement(step.value)) {
2283
+ validateExplicitKey(step.value, parentType);
2284
+ }
2285
+ }
2286
+ }
2287
+ }
2288
+ }
2289
+ }
2290
+ /**
2291
+ * Given an element, validate that its props follow the propTypes definition,
2292
+ * provided by the type.
2293
+ *
2294
+ * @param {ReactElement} element
2295
+ */
2296
+
2297
+
2298
+ function validatePropTypes(element) {
2299
+ {
2300
+ var type = element.type;
2301
+
2302
+ if (type === null || type === undefined || typeof type === 'string') {
2303
+ return;
2304
+ }
2305
+
2306
+ var propTypes;
2307
+
2308
+ if (typeof type === 'function') {
2309
+ propTypes = type.propTypes;
2310
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
2311
+ // Inner props are checked in the reconciler.
2312
+ type.$$typeof === REACT_MEMO_TYPE)) {
2313
+ propTypes = type.propTypes;
2314
+ } else {
2315
+ return;
2316
+ }
2317
+
2318
+ if (propTypes) {
2319
+ // Intentionally inside to avoid triggering lazy initializers:
2320
+ var name = getComponentNameFromType(type);
2321
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
2322
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2323
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
2324
+
2325
+ var _name = getComponentNameFromType(type);
2326
+
2327
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
2328
+ }
2329
+
2330
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2331
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2332
+ }
2333
+ }
2334
+ }
2335
+ /**
2336
+ * Given a fragment, validate that it can only be provided with fragment props
2337
+ * @param {ReactElement} fragment
2338
+ */
2339
+
2340
+
2341
+ function validateFragmentProps(fragment) {
2342
+ {
2343
+ var keys = Object.keys(fragment.props);
2344
+
2345
+ for (var i = 0; i < keys.length; i++) {
2346
+ var key = keys[i];
2347
+
2348
+ if (key !== 'children' && key !== 'key') {
2349
+ setCurrentlyValidatingElement$1(fragment);
2350
+
2351
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2352
+
2353
+ setCurrentlyValidatingElement$1(null);
2354
+ break;
2355
+ }
2356
+ }
2357
+
2358
+ if (fragment.ref !== null) {
2359
+ setCurrentlyValidatingElement$1(fragment);
2360
+
2361
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
2362
+
2363
+ setCurrentlyValidatingElement$1(null);
2364
+ }
2365
+ }
2366
+ }
2367
+ function createElementWithValidation(type, props, children) {
2368
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2369
+ // succeed and there will likely be errors in render.
2370
+
2371
+ if (!validType) {
2372
+ var info = '';
2373
+
2374
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2375
+ 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.";
2376
+ }
2377
+
2378
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2379
+
2380
+ if (sourceInfo) {
2381
+ info += sourceInfo;
2382
+ } else {
2383
+ info += getDeclarationErrorAddendum();
2384
+ }
2385
+
2386
+ var typeString;
2387
+
2388
+ if (type === null) {
2389
+ typeString = 'null';
2390
+ } else if (isArray(type)) {
2391
+ typeString = 'array';
2392
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2393
+ typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
2394
+ info = ' Did you accidentally export a JSX literal instead of a component?';
2395
+ } else {
2396
+ typeString = typeof type;
2397
+ }
2398
+
2399
+ {
2400
+ 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);
2401
+ }
2402
+ }
2403
+
2404
+ var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2405
+ // TODO: Drop this when these are no longer allowed as the type argument.
2406
+
2407
+ if (element == null) {
2408
+ return element;
2409
+ } // Skip key warning if the type isn't valid since our key validation logic
2410
+ // doesn't expect a non-string/function type and can throw confusing errors.
2411
+ // We don't want exception behavior to differ between dev and prod.
2412
+ // (Rendering will throw with a helpful message and as soon as the type is
2413
+ // fixed, the key warnings will appear.)
2414
+
2415
+
2416
+ if (validType) {
2417
+ for (var i = 2; i < arguments.length; i++) {
2418
+ validateChildKeys(arguments[i], type);
2419
+ }
2420
+ }
2421
+
2422
+ if (type === REACT_FRAGMENT_TYPE) {
2423
+ validateFragmentProps(element);
2424
+ } else {
2425
+ validatePropTypes(element);
2426
+ }
2427
+
2428
+ return element;
2429
+ }
2430
+ var didWarnAboutDeprecatedCreateFactory = false;
2431
+ function createFactoryWithValidation(type) {
2432
+ var validatedFactory = createElementWithValidation.bind(null, type);
2433
+ validatedFactory.type = type;
2434
+
2435
+ {
2436
+ if (!didWarnAboutDeprecatedCreateFactory) {
2437
+ didWarnAboutDeprecatedCreateFactory = true;
2438
+
2439
+ warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2440
+ } // Legacy hook: remove it
2441
+
2442
+
2443
+ Object.defineProperty(validatedFactory, 'type', {
2444
+ enumerable: false,
2445
+ get: function () {
2446
+ warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2447
+
2448
+ Object.defineProperty(this, 'type', {
2449
+ value: type
2450
+ });
2451
+ return type;
2452
+ }
2453
+ });
2454
+ }
2455
+
2456
+ return validatedFactory;
2457
+ }
2458
+ function cloneElementWithValidation(element, props, children) {
2459
+ var newElement = cloneElement.apply(this, arguments);
2460
+
2461
+ for (var i = 2; i < arguments.length; i++) {
2462
+ validateChildKeys(arguments[i], newElement.type);
2463
+ }
2464
+
2465
+ validatePropTypes(newElement);
2466
+ return newElement;
2467
+ }
2468
+
2469
+ function startTransition(scope, options) {
2470
+ var prevTransition = ReactCurrentBatchConfig.transition;
2471
+ ReactCurrentBatchConfig.transition = {};
2472
+ var currentTransition = ReactCurrentBatchConfig.transition;
2473
+
2474
+ {
2475
+ ReactCurrentBatchConfig.transition._updatedFibers = new Set();
2476
+ }
2477
+
2478
+ try {
2479
+ scope();
2480
+ } finally {
2481
+ ReactCurrentBatchConfig.transition = prevTransition;
2482
+
2483
+ {
2484
+ if (prevTransition === null && currentTransition._updatedFibers) {
2485
+ var updatedFibersCount = currentTransition._updatedFibers.size;
2486
+
2487
+ if (updatedFibersCount > 10) {
2488
+ 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.');
2489
+ }
2490
+
2491
+ currentTransition._updatedFibers.clear();
2492
+ }
2493
+ }
2494
+ }
2495
+ }
2496
+
2497
+ var didWarnAboutMessageChannel = false;
2498
+ var enqueueTaskImpl = null;
2499
+ function enqueueTask(task) {
2500
+ if (enqueueTaskImpl === null) {
2501
+ try {
2502
+ // read require off the module object to get around the bundlers.
2503
+ // we don't want them to detect a require and bundle a Node polyfill.
2504
+ var requireString = ('require' + Math.random()).slice(0, 7);
2505
+ var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
2506
+ // version of setImmediate, bypassing fake timers if any.
2507
+
2508
+ enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
2509
+ } catch (_err) {
2510
+ // we're in a browser
2511
+ // we can't use regular timers because they may still be faked
2512
+ // so we try MessageChannel+postMessage instead
2513
+ enqueueTaskImpl = function (callback) {
2514
+ {
2515
+ if (didWarnAboutMessageChannel === false) {
2516
+ didWarnAboutMessageChannel = true;
2517
+
2518
+ if (typeof MessageChannel === 'undefined') {
2519
+ 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.');
2520
+ }
2521
+ }
2522
+ }
2523
+
2524
+ var channel = new MessageChannel();
2525
+ channel.port1.onmessage = callback;
2526
+ channel.port2.postMessage(undefined);
2527
+ };
2528
+ }
2529
+ }
2530
+
2531
+ return enqueueTaskImpl(task);
2532
+ }
2533
+
2534
+ var actScopeDepth = 0;
2535
+ var didWarnNoAwaitAct = false;
2536
+ function act(callback) {
2537
+ {
2538
+ // `act` calls can be nested, so we track the depth. This represents the
2539
+ // number of `act` scopes on the stack.
2540
+ var prevActScopeDepth = actScopeDepth;
2541
+ actScopeDepth++;
2542
+
2543
+ if (ReactCurrentActQueue.current === null) {
2544
+ // This is the outermost `act` scope. Initialize the queue. The reconciler
2545
+ // will detect the queue and use it instead of Scheduler.
2546
+ ReactCurrentActQueue.current = [];
2547
+ }
2548
+
2549
+ var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;
2550
+ var result;
2551
+
2552
+ try {
2553
+ // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only
2554
+ // set to `true` while the given callback is executed, not for updates
2555
+ // triggered during an async event, because this is how the legacy
2556
+ // implementation of `act` behaved.
2557
+ ReactCurrentActQueue.isBatchingLegacy = true;
2558
+ result = callback(); // Replicate behavior of original `act` implementation in legacy mode,
2559
+ // which flushed updates immediately after the scope function exits, even
2560
+ // if it's an async function.
2561
+
2562
+ if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {
2563
+ var queue = ReactCurrentActQueue.current;
2564
+
2565
+ if (queue !== null) {
2566
+ ReactCurrentActQueue.didScheduleLegacyUpdate = false;
2567
+ flushActQueue(queue);
2568
+ }
2569
+ }
2570
+ } catch (error) {
2571
+ popActScope(prevActScopeDepth);
2572
+ throw error;
2573
+ } finally {
2574
+ ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
2575
+ }
2576
+
2577
+ if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
2578
+ var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
2579
+ // for it to resolve before exiting the current scope.
2580
+
2581
+ var wasAwaited = false;
2582
+ var thenable = {
2583
+ then: function (resolve, reject) {
2584
+ wasAwaited = true;
2585
+ thenableResult.then(function (returnValue) {
2586
+ popActScope(prevActScopeDepth);
2587
+
2588
+ if (actScopeDepth === 0) {
2589
+ // We've exited the outermost act scope. Recursively flush the
2590
+ // queue until there's no remaining work.
2591
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2592
+ } else {
2593
+ resolve(returnValue);
2594
+ }
2595
+ }, function (error) {
2596
+ // The callback threw an error.
2597
+ popActScope(prevActScopeDepth);
2598
+ reject(error);
2599
+ });
2600
+ }
2601
+ };
2602
+
2603
+ {
2604
+ if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
2605
+ // eslint-disable-next-line no-undef
2606
+ Promise.resolve().then(function () {}).then(function () {
2607
+ if (!wasAwaited) {
2608
+ didWarnNoAwaitAct = true;
2609
+
2610
+ 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 () => ...);');
2611
+ }
2612
+ });
2613
+ }
2614
+ }
2615
+
2616
+ return thenable;
2617
+ } else {
2618
+ var returnValue = result; // The callback is not an async function. Exit the current scope
2619
+ // immediately, without awaiting.
2620
+
2621
+ popActScope(prevActScopeDepth);
2622
+
2623
+ if (actScopeDepth === 0) {
2624
+ // Exiting the outermost act scope. Flush the queue.
2625
+ var _queue = ReactCurrentActQueue.current;
2626
+
2627
+ if (_queue !== null) {
2628
+ flushActQueue(_queue);
2629
+ ReactCurrentActQueue.current = null;
2630
+ } // Return a thenable. If the user awaits it, we'll flush again in
2631
+ // case additional work was scheduled by a microtask.
2632
+
2633
+
2634
+ var _thenable = {
2635
+ then: function (resolve, reject) {
2636
+ // Confirm we haven't re-entered another `act` scope, in case
2637
+ // the user does something weird like await the thenable
2638
+ // multiple times.
2639
+ if (ReactCurrentActQueue.current === null) {
2640
+ // Recursively flush the queue until there's no remaining work.
2641
+ ReactCurrentActQueue.current = [];
2642
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2643
+ } else {
2644
+ resolve(returnValue);
2645
+ }
2646
+ }
2647
+ };
2648
+ return _thenable;
2649
+ } else {
2650
+ // Since we're inside a nested `act` scope, the returned thenable
2651
+ // immediately resolves. The outer scope will flush the queue.
2652
+ var _thenable2 = {
2653
+ then: function (resolve, reject) {
2654
+ resolve(returnValue);
2655
+ }
2656
+ };
2657
+ return _thenable2;
2658
+ }
2659
+ }
2660
+ }
2661
+ }
2662
+
2663
+ function popActScope(prevActScopeDepth) {
2664
+ {
2665
+ if (prevActScopeDepth !== actScopeDepth - 1) {
2666
+ error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
2667
+ }
2668
+
2669
+ actScopeDepth = prevActScopeDepth;
2670
+ }
2671
+ }
2672
+
2673
+ function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
2674
+ {
2675
+ var queue = ReactCurrentActQueue.current;
2676
+
2677
+ if (queue !== null) {
2678
+ try {
2679
+ flushActQueue(queue);
2680
+ enqueueTask(function () {
2681
+ if (queue.length === 0) {
2682
+ // No additional work was scheduled. Finish.
2683
+ ReactCurrentActQueue.current = null;
2684
+ resolve(returnValue);
2685
+ } else {
2686
+ // Keep flushing work until there's none left.
2687
+ recursivelyFlushAsyncActWork(returnValue, resolve, reject);
2688
+ }
2689
+ });
2690
+ } catch (error) {
2691
+ reject(error);
2692
+ }
2693
+ } else {
2694
+ resolve(returnValue);
2695
+ }
2696
+ }
2697
+ }
2698
+
2699
+ var isFlushing = false;
2700
+
2701
+ function flushActQueue(queue) {
2702
+ {
2703
+ if (!isFlushing) {
2704
+ // Prevent re-entrance.
2705
+ isFlushing = true;
2706
+ var i = 0;
2707
+
2708
+ try {
2709
+ for (; i < queue.length; i++) {
2710
+ var callback = queue[i];
2711
+
2712
+ do {
2713
+ callback = callback(true);
2714
+ } while (callback !== null);
2715
+ }
2716
+
2717
+ queue.length = 0;
2718
+ } catch (error) {
2719
+ // If something throws, leave the remaining callbacks on the queue.
2720
+ queue = queue.slice(i + 1);
2721
+ throw error;
2722
+ } finally {
2723
+ isFlushing = false;
2724
+ }
2725
+ }
2726
+ }
2727
+ }
2728
+
2729
+ var createElement$1 = createElementWithValidation ;
2730
+ var cloneElement$1 = cloneElementWithValidation ;
2731
+ var createFactory = createFactoryWithValidation ;
2732
+ var Children = {
2733
+ map: mapChildren,
2734
+ forEach: forEachChildren,
2735
+ count: countChildren,
2736
+ toArray: toArray,
2737
+ only: onlyChild
2738
+ };
2739
+
2740
+ exports.Children = Children;
2741
+ exports.Component = Component;
2742
+ exports.Fragment = REACT_FRAGMENT_TYPE;
2743
+ exports.Profiler = REACT_PROFILER_TYPE;
2744
+ exports.PureComponent = PureComponent;
2745
+ exports.StrictMode = REACT_STRICT_MODE_TYPE;
2746
+ exports.Suspense = REACT_SUSPENSE_TYPE;
2747
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
2748
+ exports.cloneElement = cloneElement$1;
2749
+ exports.createContext = createContext;
2750
+ exports.createElement = createElement$1;
2751
+ exports.createFactory = createFactory;
2752
+ exports.createRef = createRef;
2753
+ exports.forwardRef = forwardRef;
2754
+ exports.isValidElement = isValidElement;
2755
+ exports.lazy = lazy;
2756
+ exports.memo = memo;
2757
+ exports.startTransition = startTransition;
2758
+ exports.unstable_act = act;
2759
+ exports.useCallback = useCallback;
2760
+ exports.useContext = useContext;
2761
+ exports.useDebugValue = useDebugValue;
2762
+ exports.useDeferredValue = useDeferredValue;
2763
+ exports.useEffect = useEffect;
2764
+ exports.useId = useId;
2765
+ exports.useImperativeHandle = useImperativeHandle;
2766
+ exports.useInsertionEffect = useInsertionEffect;
2767
+ exports.useLayoutEffect = useLayoutEffect;
2768
+ exports.useMemo = useMemo;
2769
+ exports.useReducer = useReducer;
2770
+ exports.useRef = useRef;
2771
+ exports.useState = useState;
2772
+ exports.useSyncExternalStore = useSyncExternalStore;
2773
+ exports.useTransition = useTransition;
2774
+ exports.version = ReactVersion;
2775
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
2776
+ if (
2777
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
2778
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
2779
+ 'function'
2780
+ ) {
2781
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
2782
+ }
2783
+
2784
+ })();
2785
+ }
2786
+ } (react_development, react_development.exports));
2787
+ return react_development.exports;
2788
+ }
2789
+
2790
+ (function (module) {
2791
+
2792
+ if (process.env.NODE_ENV === 'production') {
2793
+ module.exports = requireReact_production_min();
2794
+ } else {
2795
+ module.exports = requireReact_development();
2796
+ }
2797
+ } (react));
2798
+
2799
+ var propTypes = {exports: {}};
2800
+
2801
+ var reactIs = {exports: {}};
2802
+
2803
+ var reactIs_production_min = {};
2804
+
2805
+ /** @license React v16.13.1
2806
+ * react-is.production.min.js
2807
+ *
2808
+ * Copyright (c) Facebook, Inc. and its affiliates.
2809
+ *
2810
+ * This source code is licensed under the MIT license found in the
2811
+ * LICENSE file in the root directory of this source tree.
2812
+ */
2813
+
2814
+ var hasRequiredReactIs_production_min;
2815
+
2816
+ function requireReactIs_production_min () {
2817
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
2818
+ hasRequiredReactIs_production_min = 1;
2819
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
2820
+ Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
2821
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
2822
+ reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
2823
+ reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
2824
+ reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
2825
+ return reactIs_production_min;
2826
+ }
2827
+
2828
+ var reactIs_development = {};
2829
+
2830
+ /** @license React v16.13.1
2831
+ * react-is.development.js
2832
+ *
2833
+ * Copyright (c) Facebook, Inc. and its affiliates.
2834
+ *
2835
+ * This source code is licensed under the MIT license found in the
2836
+ * LICENSE file in the root directory of this source tree.
2837
+ */
2838
+
2839
+ var hasRequiredReactIs_development;
2840
+
2841
+ function requireReactIs_development () {
2842
+ if (hasRequiredReactIs_development) return reactIs_development;
2843
+ hasRequiredReactIs_development = 1;
2844
+
2845
+
2846
+
2847
+ if (process.env.NODE_ENV !== "production") {
2848
+ (function() {
2849
+
2850
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
2851
+ // nor polyfill, then a plain number is used for performance.
2852
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
2853
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
2854
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
2855
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
2856
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
2857
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
2858
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
2859
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
2860
+ // (unstable) APIs that have been removed. Can we remove the symbols?
2861
+
2862
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
2863
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
2864
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
2865
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
2866
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
2867
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
2868
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
2869
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
2870
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
2871
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
2872
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
2873
+
2874
+ function isValidElementType(type) {
2875
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
2876
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (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_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
2877
+ }
2878
+
2879
+ function typeOf(object) {
2880
+ if (typeof object === 'object' && object !== null) {
2881
+ var $$typeof = object.$$typeof;
2882
+
2883
+ switch ($$typeof) {
2884
+ case REACT_ELEMENT_TYPE:
2885
+ var type = object.type;
2886
+
2887
+ switch (type) {
2888
+ case REACT_ASYNC_MODE_TYPE:
2889
+ case REACT_CONCURRENT_MODE_TYPE:
2890
+ case REACT_FRAGMENT_TYPE:
2891
+ case REACT_PROFILER_TYPE:
2892
+ case REACT_STRICT_MODE_TYPE:
2893
+ case REACT_SUSPENSE_TYPE:
2894
+ return type;
2895
+
2896
+ default:
2897
+ var $$typeofType = type && type.$$typeof;
2898
+
2899
+ switch ($$typeofType) {
2900
+ case REACT_CONTEXT_TYPE:
2901
+ case REACT_FORWARD_REF_TYPE:
2902
+ case REACT_LAZY_TYPE:
2903
+ case REACT_MEMO_TYPE:
2904
+ case REACT_PROVIDER_TYPE:
2905
+ return $$typeofType;
2906
+
2907
+ default:
2908
+ return $$typeof;
2909
+ }
2910
+
2911
+ }
2912
+
2913
+ case REACT_PORTAL_TYPE:
2914
+ return $$typeof;
2915
+ }
2916
+ }
2917
+
2918
+ return undefined;
2919
+ } // AsyncMode is deprecated along with isAsyncMode
2920
+
2921
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
2922
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
2923
+ var ContextConsumer = REACT_CONTEXT_TYPE;
2924
+ var ContextProvider = REACT_PROVIDER_TYPE;
2925
+ var Element = REACT_ELEMENT_TYPE;
2926
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
2927
+ var Fragment = REACT_FRAGMENT_TYPE;
2928
+ var Lazy = REACT_LAZY_TYPE;
2929
+ var Memo = REACT_MEMO_TYPE;
2930
+ var Portal = REACT_PORTAL_TYPE;
2931
+ var Profiler = REACT_PROFILER_TYPE;
2932
+ var StrictMode = REACT_STRICT_MODE_TYPE;
2933
+ var Suspense = REACT_SUSPENSE_TYPE;
2934
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
2935
+
2936
+ function isAsyncMode(object) {
2937
+ {
2938
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
2939
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
2940
+
2941
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
2942
+ }
2943
+ }
2944
+
2945
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
2946
+ }
2947
+ function isConcurrentMode(object) {
2948
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
2949
+ }
2950
+ function isContextConsumer(object) {
2951
+ return typeOf(object) === REACT_CONTEXT_TYPE;
2952
+ }
2953
+ function isContextProvider(object) {
2954
+ return typeOf(object) === REACT_PROVIDER_TYPE;
2955
+ }
2956
+ function isElement(object) {
2957
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2958
+ }
2959
+ function isForwardRef(object) {
2960
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
2961
+ }
2962
+ function isFragment(object) {
2963
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
2964
+ }
2965
+ function isLazy(object) {
2966
+ return typeOf(object) === REACT_LAZY_TYPE;
2967
+ }
2968
+ function isMemo(object) {
2969
+ return typeOf(object) === REACT_MEMO_TYPE;
2970
+ }
2971
+ function isPortal(object) {
2972
+ return typeOf(object) === REACT_PORTAL_TYPE;
2973
+ }
2974
+ function isProfiler(object) {
2975
+ return typeOf(object) === REACT_PROFILER_TYPE;
2976
+ }
2977
+ function isStrictMode(object) {
2978
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
2979
+ }
2980
+ function isSuspense(object) {
2981
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
2982
+ }
2983
+
2984
+ reactIs_development.AsyncMode = AsyncMode;
2985
+ reactIs_development.ConcurrentMode = ConcurrentMode;
2986
+ reactIs_development.ContextConsumer = ContextConsumer;
2987
+ reactIs_development.ContextProvider = ContextProvider;
2988
+ reactIs_development.Element = Element;
2989
+ reactIs_development.ForwardRef = ForwardRef;
2990
+ reactIs_development.Fragment = Fragment;
2991
+ reactIs_development.Lazy = Lazy;
2992
+ reactIs_development.Memo = Memo;
2993
+ reactIs_development.Portal = Portal;
2994
+ reactIs_development.Profiler = Profiler;
2995
+ reactIs_development.StrictMode = StrictMode;
2996
+ reactIs_development.Suspense = Suspense;
2997
+ reactIs_development.isAsyncMode = isAsyncMode;
2998
+ reactIs_development.isConcurrentMode = isConcurrentMode;
2999
+ reactIs_development.isContextConsumer = isContextConsumer;
3000
+ reactIs_development.isContextProvider = isContextProvider;
3001
+ reactIs_development.isElement = isElement;
3002
+ reactIs_development.isForwardRef = isForwardRef;
3003
+ reactIs_development.isFragment = isFragment;
3004
+ reactIs_development.isLazy = isLazy;
3005
+ reactIs_development.isMemo = isMemo;
3006
+ reactIs_development.isPortal = isPortal;
3007
+ reactIs_development.isProfiler = isProfiler;
3008
+ reactIs_development.isStrictMode = isStrictMode;
3009
+ reactIs_development.isSuspense = isSuspense;
3010
+ reactIs_development.isValidElementType = isValidElementType;
3011
+ reactIs_development.typeOf = typeOf;
3012
+ })();
3013
+ }
3014
+ return reactIs_development;
3015
+ }
3016
+
3017
+ var hasRequiredReactIs;
3018
+
3019
+ function requireReactIs () {
3020
+ if (hasRequiredReactIs) return reactIs.exports;
3021
+ hasRequiredReactIs = 1;
3022
+ (function (module) {
3023
+
3024
+ if (process.env.NODE_ENV === 'production') {
3025
+ module.exports = requireReactIs_production_min();
3026
+ } else {
3027
+ module.exports = requireReactIs_development();
3028
+ }
3029
+ } (reactIs));
3030
+ return reactIs.exports;
3031
+ }
3032
+
3033
+ /*
3034
+ object-assign
3035
+ (c) Sindre Sorhus
3036
+ @license MIT
3037
+ */
3038
+
3039
+ var objectAssign;
3040
+ var hasRequiredObjectAssign;
3041
+
3042
+ function requireObjectAssign () {
3043
+ if (hasRequiredObjectAssign) return objectAssign;
3044
+ hasRequiredObjectAssign = 1;
3045
+ /* eslint-disable no-unused-vars */
3046
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
3047
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
3048
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
3049
+
3050
+ function toObject(val) {
3051
+ if (val === null || val === undefined) {
3052
+ throw new TypeError('Object.assign cannot be called with null or undefined');
3053
+ }
3054
+
3055
+ return Object(val);
3056
+ }
3057
+
3058
+ function shouldUseNative() {
3059
+ try {
3060
+ if (!Object.assign) {
3061
+ return false;
3062
+ }
3063
+
3064
+ // Detect buggy property enumeration order in older V8 versions.
3065
+
3066
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
3067
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
3068
+ test1[5] = 'de';
3069
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
3070
+ return false;
3071
+ }
3072
+
3073
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3074
+ var test2 = {};
3075
+ for (var i = 0; i < 10; i++) {
3076
+ test2['_' + String.fromCharCode(i)] = i;
3077
+ }
3078
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
3079
+ return test2[n];
3080
+ });
3081
+ if (order2.join('') !== '0123456789') {
3082
+ return false;
3083
+ }
3084
+
3085
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
3086
+ var test3 = {};
3087
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
3088
+ test3[letter] = letter;
3089
+ });
3090
+ if (Object.keys(Object.assign({}, test3)).join('') !==
3091
+ 'abcdefghijklmnopqrst') {
3092
+ return false;
3093
+ }
3094
+
3095
+ return true;
3096
+ } catch (err) {
3097
+ // We don't expect any of the above to throw, but better to be safe.
3098
+ return false;
3099
+ }
3100
+ }
3101
+
3102
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
3103
+ var from;
3104
+ var to = toObject(target);
3105
+ var symbols;
3106
+
3107
+ for (var s = 1; s < arguments.length; s++) {
3108
+ from = Object(arguments[s]);
3109
+
3110
+ for (var key in from) {
3111
+ if (hasOwnProperty.call(from, key)) {
3112
+ to[key] = from[key];
3113
+ }
3114
+ }
3115
+
3116
+ if (getOwnPropertySymbols) {
3117
+ symbols = getOwnPropertySymbols(from);
3118
+ for (var i = 0; i < symbols.length; i++) {
3119
+ if (propIsEnumerable.call(from, symbols[i])) {
3120
+ to[symbols[i]] = from[symbols[i]];
3121
+ }
3122
+ }
3123
+ }
3124
+ }
3125
+
3126
+ return to;
3127
+ };
3128
+ return objectAssign;
3129
+ }
3130
+
3131
+ /**
3132
+ * Copyright (c) 2013-present, Facebook, Inc.
3133
+ *
3134
+ * This source code is licensed under the MIT license found in the
3135
+ * LICENSE file in the root directory of this source tree.
3136
+ */
3137
+
3138
+ var ReactPropTypesSecret_1;
3139
+ var hasRequiredReactPropTypesSecret;
3140
+
3141
+ function requireReactPropTypesSecret () {
3142
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
3143
+ hasRequiredReactPropTypesSecret = 1;
3144
+
3145
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
3146
+
3147
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
3148
+ return ReactPropTypesSecret_1;
3149
+ }
3150
+
3151
+ var has;
3152
+ var hasRequiredHas;
3153
+
3154
+ function requireHas () {
3155
+ if (hasRequiredHas) return has;
3156
+ hasRequiredHas = 1;
3157
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
3158
+ return has;
3159
+ }
3160
+
3161
+ /**
3162
+ * Copyright (c) 2013-present, Facebook, Inc.
3163
+ *
3164
+ * This source code is licensed under the MIT license found in the
3165
+ * LICENSE file in the root directory of this source tree.
3166
+ */
3167
+
3168
+ var checkPropTypes_1;
3169
+ var hasRequiredCheckPropTypes;
3170
+
3171
+ function requireCheckPropTypes () {
3172
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
3173
+ hasRequiredCheckPropTypes = 1;
3174
+
3175
+ var printWarning = function() {};
3176
+
3177
+ if (process.env.NODE_ENV !== 'production') {
3178
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
3179
+ var loggedTypeFailures = {};
3180
+ var has = requireHas();
3181
+
3182
+ printWarning = function(text) {
3183
+ var message = 'Warning: ' + text;
3184
+ if (typeof console !== 'undefined') {
3185
+ console.error(message);
3186
+ }
3187
+ try {
3188
+ // --- Welcome to debugging React ---
3189
+ // This error was thrown as a convenience so that you can use this stack
3190
+ // to find the callsite that caused this warning to fire.
3191
+ throw new Error(message);
3192
+ } catch (x) { /**/ }
3193
+ };
3194
+ }
3195
+
3196
+ /**
3197
+ * Assert that the values match with the type specs.
3198
+ * Error messages are memorized and will only be shown once.
3199
+ *
3200
+ * @param {object} typeSpecs Map of name to a ReactPropType
3201
+ * @param {object} values Runtime values that need to be type-checked
3202
+ * @param {string} location e.g. "prop", "context", "child context"
3203
+ * @param {string} componentName Name of the component for error messages.
3204
+ * @param {?Function} getStack Returns the component stack.
3205
+ * @private
3206
+ */
3207
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
3208
+ if (process.env.NODE_ENV !== 'production') {
3209
+ for (var typeSpecName in typeSpecs) {
3210
+ if (has(typeSpecs, typeSpecName)) {
3211
+ var error;
3212
+ // Prop type validation may throw. In case they do, we don't want to
3213
+ // fail the render phase where it didn't fail before. So we log it.
3214
+ // After these have been cleaned up, we'll let them throw.
3215
+ try {
3216
+ // This is intentionally an invariant that gets caught. It's the same
3217
+ // behavior as without this statement except with a better message.
3218
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
3219
+ var err = Error(
3220
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
3221
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
3222
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
3223
+ );
3224
+ err.name = 'Invariant Violation';
3225
+ throw err;
3226
+ }
3227
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
3228
+ } catch (ex) {
3229
+ error = ex;
3230
+ }
3231
+ if (error && !(error instanceof Error)) {
3232
+ printWarning(
3233
+ (componentName || 'React class') + ': type specification of ' +
3234
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
3235
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
3236
+ 'You may have forgotten to pass an argument to the type checker ' +
3237
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
3238
+ 'shape all require an argument).'
3239
+ );
3240
+ }
3241
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
3242
+ // Only monitor this failure once because there tends to be a lot of the
3243
+ // same error.
3244
+ loggedTypeFailures[error.message] = true;
3245
+
3246
+ var stack = getStack ? getStack() : '';
3247
+
3248
+ printWarning(
3249
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
3250
+ );
3251
+ }
3252
+ }
3253
+ }
3254
+ }
3255
+ }
3256
+
3257
+ /**
3258
+ * Resets warning cache when testing.
3259
+ *
3260
+ * @private
3261
+ */
3262
+ checkPropTypes.resetWarningCache = function() {
3263
+ if (process.env.NODE_ENV !== 'production') {
3264
+ loggedTypeFailures = {};
3265
+ }
3266
+ };
3267
+
3268
+ checkPropTypes_1 = checkPropTypes;
3269
+ return checkPropTypes_1;
3270
+ }
3271
+
3272
+ /**
3273
+ * Copyright (c) 2013-present, Facebook, Inc.
3274
+ *
3275
+ * This source code is licensed under the MIT license found in the
3276
+ * LICENSE file in the root directory of this source tree.
3277
+ */
3278
+
3279
+ var factoryWithTypeCheckers;
3280
+ var hasRequiredFactoryWithTypeCheckers;
3281
+
3282
+ function requireFactoryWithTypeCheckers () {
3283
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
3284
+ hasRequiredFactoryWithTypeCheckers = 1;
3285
+
3286
+ var ReactIs = requireReactIs();
3287
+ var assign = requireObjectAssign();
3288
+
3289
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
3290
+ var has = requireHas();
3291
+ var checkPropTypes = requireCheckPropTypes();
3292
+
3293
+ var printWarning = function() {};
3294
+
3295
+ if (process.env.NODE_ENV !== 'production') {
3296
+ printWarning = function(text) {
3297
+ var message = 'Warning: ' + text;
3298
+ if (typeof console !== 'undefined') {
3299
+ console.error(message);
3300
+ }
3301
+ try {
3302
+ // --- Welcome to debugging React ---
3303
+ // This error was thrown as a convenience so that you can use this stack
3304
+ // to find the callsite that caused this warning to fire.
3305
+ throw new Error(message);
3306
+ } catch (x) {}
3307
+ };
3308
+ }
3309
+
3310
+ function emptyFunctionThatReturnsNull() {
3311
+ return null;
3312
+ }
3313
+
3314
+ factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
3315
+ /* global Symbol */
3316
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
3317
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
3318
+
3319
+ /**
3320
+ * Returns the iterator method function contained on the iterable object.
3321
+ *
3322
+ * Be sure to invoke the function with the iterable as context:
3323
+ *
3324
+ * var iteratorFn = getIteratorFn(myIterable);
3325
+ * if (iteratorFn) {
3326
+ * var iterator = iteratorFn.call(myIterable);
3327
+ * ...
3328
+ * }
3329
+ *
3330
+ * @param {?object} maybeIterable
3331
+ * @return {?function}
3332
+ */
3333
+ function getIteratorFn(maybeIterable) {
3334
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
3335
+ if (typeof iteratorFn === 'function') {
3336
+ return iteratorFn;
3337
+ }
3338
+ }
3339
+
3340
+ /**
3341
+ * Collection of methods that allow declaration and validation of props that are
3342
+ * supplied to React components. Example usage:
3343
+ *
3344
+ * var Props = require('ReactPropTypes');
3345
+ * var MyArticle = React.createClass({
3346
+ * propTypes: {
3347
+ * // An optional string prop named "description".
3348
+ * description: Props.string,
3349
+ *
3350
+ * // A required enum prop named "category".
3351
+ * category: Props.oneOf(['News','Photos']).isRequired,
3352
+ *
3353
+ * // A prop named "dialog" that requires an instance of Dialog.
3354
+ * dialog: Props.instanceOf(Dialog).isRequired
3355
+ * },
3356
+ * render: function() { ... }
3357
+ * });
3358
+ *
3359
+ * A more formal specification of how these methods are used:
3360
+ *
3361
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
3362
+ * decl := ReactPropTypes.{type}(.isRequired)?
3363
+ *
3364
+ * Each and every declaration produces a function with the same signature. This
3365
+ * allows the creation of custom validation functions. For example:
3366
+ *
3367
+ * var MyLink = React.createClass({
3368
+ * propTypes: {
3369
+ * // An optional string or URI prop named "href".
3370
+ * href: function(props, propName, componentName) {
3371
+ * var propValue = props[propName];
3372
+ * if (propValue != null && typeof propValue !== 'string' &&
3373
+ * !(propValue instanceof URI)) {
3374
+ * return new Error(
3375
+ * 'Expected a string or an URI for ' + propName + ' in ' +
3376
+ * componentName
3377
+ * );
3378
+ * }
3379
+ * }
3380
+ * },
3381
+ * render: function() {...}
3382
+ * });
3383
+ *
3384
+ * @internal
3385
+ */
3386
+
3387
+ var ANONYMOUS = '<<anonymous>>';
3388
+
3389
+ // Important!
3390
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
3391
+ var ReactPropTypes = {
3392
+ array: createPrimitiveTypeChecker('array'),
3393
+ bigint: createPrimitiveTypeChecker('bigint'),
3394
+ bool: createPrimitiveTypeChecker('boolean'),
3395
+ func: createPrimitiveTypeChecker('function'),
3396
+ number: createPrimitiveTypeChecker('number'),
3397
+ object: createPrimitiveTypeChecker('object'),
3398
+ string: createPrimitiveTypeChecker('string'),
3399
+ symbol: createPrimitiveTypeChecker('symbol'),
3400
+
3401
+ any: createAnyTypeChecker(),
3402
+ arrayOf: createArrayOfTypeChecker,
3403
+ element: createElementTypeChecker(),
3404
+ elementType: createElementTypeTypeChecker(),
3405
+ instanceOf: createInstanceTypeChecker,
3406
+ node: createNodeChecker(),
3407
+ objectOf: createObjectOfTypeChecker,
3408
+ oneOf: createEnumTypeChecker,
3409
+ oneOfType: createUnionTypeChecker,
3410
+ shape: createShapeTypeChecker,
3411
+ exact: createStrictShapeTypeChecker,
3412
+ };
3413
+
3414
+ /**
3415
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
3416
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
3417
+ */
3418
+ /*eslint-disable no-self-compare*/
3419
+ function is(x, y) {
3420
+ // SameValue algorithm
3421
+ if (x === y) {
3422
+ // Steps 1-5, 7-10
3423
+ // Steps 6.b-6.e: +0 != -0
3424
+ return x !== 0 || 1 / x === 1 / y;
3425
+ } else {
3426
+ // Step 6.a: NaN == NaN
3427
+ return x !== x && y !== y;
3428
+ }
3429
+ }
3430
+ /*eslint-enable no-self-compare*/
3431
+
3432
+ /**
3433
+ * We use an Error-like object for backward compatibility as people may call
3434
+ * PropTypes directly and inspect their output. However, we don't use real
3435
+ * Errors anymore. We don't inspect their stack anyway, and creating them
3436
+ * is prohibitively expensive if they are created too often, such as what
3437
+ * happens in oneOfType() for any type before the one that matched.
3438
+ */
3439
+ function PropTypeError(message, data) {
3440
+ this.message = message;
3441
+ this.data = data && typeof data === 'object' ? data: {};
3442
+ this.stack = '';
3443
+ }
3444
+ // Make `instanceof Error` still work for returned errors.
3445
+ PropTypeError.prototype = Error.prototype;
3446
+
3447
+ function createChainableTypeChecker(validate) {
3448
+ if (process.env.NODE_ENV !== 'production') {
3449
+ var manualPropTypeCallCache = {};
3450
+ var manualPropTypeWarningCount = 0;
3451
+ }
3452
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
3453
+ componentName = componentName || ANONYMOUS;
3454
+ propFullName = propFullName || propName;
3455
+
3456
+ if (secret !== ReactPropTypesSecret) {
3457
+ if (throwOnDirectAccess) {
3458
+ // New behavior only for users of `prop-types` package
3459
+ var err = new Error(
3460
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
3461
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
3462
+ 'Read more at http://fb.me/use-check-prop-types'
3463
+ );
3464
+ err.name = 'Invariant Violation';
3465
+ throw err;
3466
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
3467
+ // Old behavior for people using React.PropTypes
3468
+ var cacheKey = componentName + ':' + propName;
3469
+ if (
3470
+ !manualPropTypeCallCache[cacheKey] &&
3471
+ // Avoid spamming the console because they are often not actionable except for lib authors
3472
+ manualPropTypeWarningCount < 3
3473
+ ) {
3474
+ printWarning(
3475
+ 'You are manually calling a React.PropTypes validation ' +
3476
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
3477
+ 'and will throw in the standalone `prop-types` package. ' +
3478
+ 'You may be seeing this warning due to a third-party PropTypes ' +
3479
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
3480
+ );
3481
+ manualPropTypeCallCache[cacheKey] = true;
3482
+ manualPropTypeWarningCount++;
3483
+ }
3484
+ }
3485
+ }
3486
+ if (props[propName] == null) {
3487
+ if (isRequired) {
3488
+ if (props[propName] === null) {
3489
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
3490
+ }
3491
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
3492
+ }
3493
+ return null;
3494
+ } else {
3495
+ return validate(props, propName, componentName, location, propFullName);
3496
+ }
3497
+ }
3498
+
3499
+ var chainedCheckType = checkType.bind(null, false);
3500
+ chainedCheckType.isRequired = checkType.bind(null, true);
3501
+
3502
+ return chainedCheckType;
3503
+ }
3504
+
3505
+ function createPrimitiveTypeChecker(expectedType) {
3506
+ function validate(props, propName, componentName, location, propFullName, secret) {
3507
+ var propValue = props[propName];
3508
+ var propType = getPropType(propValue);
3509
+ if (propType !== expectedType) {
3510
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
3511
+ // check, but we can offer a more precise error message here rather than
3512
+ // 'of type `object`'.
3513
+ var preciseType = getPreciseType(propValue);
3514
+
3515
+ return new PropTypeError(
3516
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
3517
+ {expectedType: expectedType}
3518
+ );
3519
+ }
3520
+ return null;
3521
+ }
3522
+ return createChainableTypeChecker(validate);
3523
+ }
3524
+
3525
+ function createAnyTypeChecker() {
3526
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
3527
+ }
3528
+
3529
+ function createArrayOfTypeChecker(typeChecker) {
3530
+ function validate(props, propName, componentName, location, propFullName) {
3531
+ if (typeof typeChecker !== 'function') {
3532
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
3533
+ }
3534
+ var propValue = props[propName];
3535
+ if (!Array.isArray(propValue)) {
3536
+ var propType = getPropType(propValue);
3537
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
3538
+ }
3539
+ for (var i = 0; i < propValue.length; i++) {
3540
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
3541
+ if (error instanceof Error) {
3542
+ return error;
3543
+ }
3544
+ }
3545
+ return null;
3546
+ }
3547
+ return createChainableTypeChecker(validate);
3548
+ }
3549
+
3550
+ function createElementTypeChecker() {
3551
+ function validate(props, propName, componentName, location, propFullName) {
3552
+ var propValue = props[propName];
3553
+ if (!isValidElement(propValue)) {
3554
+ var propType = getPropType(propValue);
3555
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
3556
+ }
3557
+ return null;
3558
+ }
3559
+ return createChainableTypeChecker(validate);
3560
+ }
3561
+
3562
+ function createElementTypeTypeChecker() {
3563
+ function validate(props, propName, componentName, location, propFullName) {
3564
+ var propValue = props[propName];
3565
+ if (!ReactIs.isValidElementType(propValue)) {
3566
+ var propType = getPropType(propValue);
3567
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
3568
+ }
3569
+ return null;
3570
+ }
3571
+ return createChainableTypeChecker(validate);
3572
+ }
3573
+
3574
+ function createInstanceTypeChecker(expectedClass) {
3575
+ function validate(props, propName, componentName, location, propFullName) {
3576
+ if (!(props[propName] instanceof expectedClass)) {
3577
+ var expectedClassName = expectedClass.name || ANONYMOUS;
3578
+ var actualClassName = getClassName(props[propName]);
3579
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
3580
+ }
3581
+ return null;
3582
+ }
3583
+ return createChainableTypeChecker(validate);
3584
+ }
3585
+
3586
+ function createEnumTypeChecker(expectedValues) {
3587
+ if (!Array.isArray(expectedValues)) {
3588
+ if (process.env.NODE_ENV !== 'production') {
3589
+ if (arguments.length > 1) {
3590
+ printWarning(
3591
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
3592
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
3593
+ );
3594
+ } else {
3595
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
3596
+ }
3597
+ }
3598
+ return emptyFunctionThatReturnsNull;
3599
+ }
3600
+
3601
+ function validate(props, propName, componentName, location, propFullName) {
3602
+ var propValue = props[propName];
3603
+ for (var i = 0; i < expectedValues.length; i++) {
3604
+ if (is(propValue, expectedValues[i])) {
3605
+ return null;
3606
+ }
3607
+ }
3608
+
3609
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
3610
+ var type = getPreciseType(value);
3611
+ if (type === 'symbol') {
3612
+ return String(value);
3613
+ }
3614
+ return value;
3615
+ });
3616
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
3617
+ }
3618
+ return createChainableTypeChecker(validate);
3619
+ }
3620
+
3621
+ function createObjectOfTypeChecker(typeChecker) {
3622
+ function validate(props, propName, componentName, location, propFullName) {
3623
+ if (typeof typeChecker !== 'function') {
3624
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
3625
+ }
3626
+ var propValue = props[propName];
3627
+ var propType = getPropType(propValue);
3628
+ if (propType !== 'object') {
3629
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
3630
+ }
3631
+ for (var key in propValue) {
3632
+ if (has(propValue, key)) {
3633
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3634
+ if (error instanceof Error) {
3635
+ return error;
3636
+ }
3637
+ }
3638
+ }
3639
+ return null;
3640
+ }
3641
+ return createChainableTypeChecker(validate);
3642
+ }
3643
+
3644
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
3645
+ if (!Array.isArray(arrayOfTypeCheckers)) {
3646
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
3647
+ return emptyFunctionThatReturnsNull;
3648
+ }
3649
+
3650
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3651
+ var checker = arrayOfTypeCheckers[i];
3652
+ if (typeof checker !== 'function') {
3653
+ printWarning(
3654
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
3655
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
3656
+ );
3657
+ return emptyFunctionThatReturnsNull;
3658
+ }
3659
+ }
3660
+
3661
+ function validate(props, propName, componentName, location, propFullName) {
3662
+ var expectedTypes = [];
3663
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
3664
+ var checker = arrayOfTypeCheckers[i];
3665
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
3666
+ if (checkerResult == null) {
3667
+ return null;
3668
+ }
3669
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
3670
+ expectedTypes.push(checkerResult.data.expectedType);
3671
+ }
3672
+ }
3673
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
3674
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
3675
+ }
3676
+ return createChainableTypeChecker(validate);
3677
+ }
3678
+
3679
+ function createNodeChecker() {
3680
+ function validate(props, propName, componentName, location, propFullName) {
3681
+ if (!isNode(props[propName])) {
3682
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
3683
+ }
3684
+ return null;
3685
+ }
3686
+ return createChainableTypeChecker(validate);
3687
+ }
3688
+
3689
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
3690
+ return new PropTypeError(
3691
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
3692
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
3693
+ );
3694
+ }
3695
+
3696
+ function createShapeTypeChecker(shapeTypes) {
3697
+ function validate(props, propName, componentName, location, propFullName) {
3698
+ var propValue = props[propName];
3699
+ var propType = getPropType(propValue);
3700
+ if (propType !== 'object') {
3701
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3702
+ }
3703
+ for (var key in shapeTypes) {
3704
+ var checker = shapeTypes[key];
3705
+ if (typeof checker !== 'function') {
3706
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3707
+ }
3708
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3709
+ if (error) {
3710
+ return error;
3711
+ }
3712
+ }
3713
+ return null;
3714
+ }
3715
+ return createChainableTypeChecker(validate);
3716
+ }
3717
+
3718
+ function createStrictShapeTypeChecker(shapeTypes) {
3719
+ function validate(props, propName, componentName, location, propFullName) {
3720
+ var propValue = props[propName];
3721
+ var propType = getPropType(propValue);
3722
+ if (propType !== 'object') {
3723
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
3724
+ }
3725
+ // We need to check all keys in case some are required but missing from props.
3726
+ var allKeys = assign({}, props[propName], shapeTypes);
3727
+ for (var key in allKeys) {
3728
+ var checker = shapeTypes[key];
3729
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
3730
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
3731
+ }
3732
+ if (!checker) {
3733
+ return new PropTypeError(
3734
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
3735
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
3736
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
3737
+ );
3738
+ }
3739
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
3740
+ if (error) {
3741
+ return error;
3742
+ }
3743
+ }
3744
+ return null;
3745
+ }
3746
+
3747
+ return createChainableTypeChecker(validate);
3748
+ }
3749
+
3750
+ function isNode(propValue) {
3751
+ switch (typeof propValue) {
3752
+ case 'number':
3753
+ case 'string':
3754
+ case 'undefined':
3755
+ return true;
3756
+ case 'boolean':
3757
+ return !propValue;
3758
+ case 'object':
3759
+ if (Array.isArray(propValue)) {
3760
+ return propValue.every(isNode);
3761
+ }
3762
+ if (propValue === null || isValidElement(propValue)) {
3763
+ return true;
3764
+ }
3765
+
3766
+ var iteratorFn = getIteratorFn(propValue);
3767
+ if (iteratorFn) {
3768
+ var iterator = iteratorFn.call(propValue);
3769
+ var step;
3770
+ if (iteratorFn !== propValue.entries) {
3771
+ while (!(step = iterator.next()).done) {
3772
+ if (!isNode(step.value)) {
3773
+ return false;
3774
+ }
3775
+ }
3776
+ } else {
3777
+ // Iterator will provide entry [k,v] tuples rather than values.
3778
+ while (!(step = iterator.next()).done) {
3779
+ var entry = step.value;
3780
+ if (entry) {
3781
+ if (!isNode(entry[1])) {
3782
+ return false;
3783
+ }
3784
+ }
3785
+ }
3786
+ }
3787
+ } else {
3788
+ return false;
3789
+ }
3790
+
3791
+ return true;
3792
+ default:
3793
+ return false;
3794
+ }
3795
+ }
3796
+
3797
+ function isSymbol(propType, propValue) {
3798
+ // Native Symbol.
3799
+ if (propType === 'symbol') {
3800
+ return true;
3801
+ }
3802
+
3803
+ // falsy value can't be a Symbol
3804
+ if (!propValue) {
3805
+ return false;
3806
+ }
3807
+
3808
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
3809
+ if (propValue['@@toStringTag'] === 'Symbol') {
3810
+ return true;
3811
+ }
3812
+
3813
+ // Fallback for non-spec compliant Symbols which are polyfilled.
3814
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
3815
+ return true;
3816
+ }
3817
+
3818
+ return false;
3819
+ }
3820
+
3821
+ // Equivalent of `typeof` but with special handling for array and regexp.
3822
+ function getPropType(propValue) {
3823
+ var propType = typeof propValue;
3824
+ if (Array.isArray(propValue)) {
3825
+ return 'array';
3826
+ }
3827
+ if (propValue instanceof RegExp) {
3828
+ // Old webkits (at least until Android 4.0) return 'function' rather than
3829
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
3830
+ // passes PropTypes.object.
3831
+ return 'object';
3832
+ }
3833
+ if (isSymbol(propType, propValue)) {
3834
+ return 'symbol';
3835
+ }
3836
+ return propType;
3837
+ }
3838
+
3839
+ // This handles more types than `getPropType`. Only used for error messages.
3840
+ // See `createPrimitiveTypeChecker`.
3841
+ function getPreciseType(propValue) {
3842
+ if (typeof propValue === 'undefined' || propValue === null) {
3843
+ return '' + propValue;
3844
+ }
3845
+ var propType = getPropType(propValue);
3846
+ if (propType === 'object') {
3847
+ if (propValue instanceof Date) {
3848
+ return 'date';
3849
+ } else if (propValue instanceof RegExp) {
3850
+ return 'regexp';
3851
+ }
3852
+ }
3853
+ return propType;
3854
+ }
3855
+
3856
+ // Returns a string that is postfixed to a warning about an invalid type.
3857
+ // For example, "undefined" or "of type array"
3858
+ function getPostfixForTypeWarning(value) {
3859
+ var type = getPreciseType(value);
3860
+ switch (type) {
3861
+ case 'array':
3862
+ case 'object':
3863
+ return 'an ' + type;
3864
+ case 'boolean':
3865
+ case 'date':
3866
+ case 'regexp':
3867
+ return 'a ' + type;
3868
+ default:
3869
+ return type;
3870
+ }
3871
+ }
3872
+
3873
+ // Returns class name of the object, if any.
3874
+ function getClassName(propValue) {
3875
+ if (!propValue.constructor || !propValue.constructor.name) {
3876
+ return ANONYMOUS;
3877
+ }
3878
+ return propValue.constructor.name;
3879
+ }
3880
+
3881
+ ReactPropTypes.checkPropTypes = checkPropTypes;
3882
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
3883
+ ReactPropTypes.PropTypes = ReactPropTypes;
3884
+
3885
+ return ReactPropTypes;
3886
+ };
3887
+ return factoryWithTypeCheckers;
3888
+ }
3889
+
3890
+ /**
3891
+ * Copyright (c) 2013-present, Facebook, Inc.
3892
+ *
3893
+ * This source code is licensed under the MIT license found in the
3894
+ * LICENSE file in the root directory of this source tree.
3895
+ */
3896
+
3897
+ var factoryWithThrowingShims;
3898
+ var hasRequiredFactoryWithThrowingShims;
3899
+
3900
+ function requireFactoryWithThrowingShims () {
3901
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
3902
+ hasRequiredFactoryWithThrowingShims = 1;
3903
+
3904
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
3905
+
3906
+ function emptyFunction() {}
3907
+ function emptyFunctionWithReset() {}
3908
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
3909
+
3910
+ factoryWithThrowingShims = function() {
3911
+ function shim(props, propName, componentName, location, propFullName, secret) {
3912
+ if (secret === ReactPropTypesSecret) {
3913
+ // It is still safe when called from React.
3914
+ return;
3915
+ }
3916
+ var err = new Error(
3917
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
3918
+ 'Use PropTypes.checkPropTypes() to call them. ' +
3919
+ 'Read more at http://fb.me/use-check-prop-types'
3920
+ );
3921
+ err.name = 'Invariant Violation';
3922
+ throw err;
3923
+ } shim.isRequired = shim;
3924
+ function getShim() {
3925
+ return shim;
3926
+ } // Important!
3927
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
3928
+ var ReactPropTypes = {
3929
+ array: shim,
3930
+ bigint: shim,
3931
+ bool: shim,
3932
+ func: shim,
3933
+ number: shim,
3934
+ object: shim,
3935
+ string: shim,
3936
+ symbol: shim,
3937
+
3938
+ any: shim,
3939
+ arrayOf: getShim,
3940
+ element: shim,
3941
+ elementType: shim,
3942
+ instanceOf: getShim,
3943
+ node: shim,
3944
+ objectOf: getShim,
3945
+ oneOf: getShim,
3946
+ oneOfType: getShim,
3947
+ shape: getShim,
3948
+ exact: getShim,
3949
+
3950
+ checkPropTypes: emptyFunctionWithReset,
3951
+ resetWarningCache: emptyFunction
3952
+ };
3953
+
3954
+ ReactPropTypes.PropTypes = ReactPropTypes;
3955
+
3956
+ return ReactPropTypes;
3957
+ };
3958
+ return factoryWithThrowingShims;
3959
+ }
3960
+
3961
+ /**
3962
+ * Copyright (c) 2013-present, Facebook, Inc.
3963
+ *
3964
+ * This source code is licensed under the MIT license found in the
3965
+ * LICENSE file in the root directory of this source tree.
3966
+ */
3967
+
3968
+ if (process.env.NODE_ENV !== 'production') {
3969
+ var ReactIs = requireReactIs();
3970
+
3971
+ // By explicitly using `prop-types` you are opting into new development behavior.
3972
+ // http://fb.me/prop-types-in-prod
3973
+ var throwOnDirectAccess = true;
3974
+ propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
3975
+ } else {
3976
+ // By explicitly using `prop-types` you are opting into new production behavior.
3977
+ // http://fb.me/prop-types-in-prod
3978
+ propTypes.exports = requireFactoryWithThrowingShims()();
3979
+ }
3980
+
3981
+ function useDetectScroll({ thr = 0, up = "up", down = "down" }) {
3982
+ const [scrollDir, setScrollDir] = react.exports.useState(down);
3983
+
3984
+ react.exports.useEffect(() => {
3985
+ const threshold = thr >= 0 ? 0 : thr;
3986
+ let lastScrollY = window.pageYOffset;
3987
+ let ticking = false;
3988
+
3989
+ const updateScrollDir = () => {
3990
+ const scrollY = window.pageYOffset;
3991
+
3992
+ if (Math.abs(scrollY - lastScrollY) < threshold) {
3993
+ ticking = false;
3994
+ return;
3995
+ }
3996
+ setScrollDir(scrollY > lastScrollY ? down : up);
3997
+ lastScrollY = scrollY > 0 ? scrollY : 0;
3998
+ ticking = false;
3999
+ };
4000
+
4001
+ const onScroll = () => {
4002
+ if (!ticking) {
4003
+ window.requestAnimationFrame(updateScrollDir);
4004
+ ticking = true;
4005
+ }
4006
+ };
4007
+
4008
+ window.addEventListener("scroll", onScroll);
4009
+
4010
+ return () => window.removeEventListener("scroll", onScroll);
4011
+ }, [scrollDir]);
4012
+
4013
+ return [scrollDir];
4014
+ }
4015
+
4016
+ useDetectScroll.propTypes = {
4017
+ thr: propTypes.exports.number,
4018
+ up: propTypes.exports.string,
4019
+ down: propTypes.exports.string,
4020
+ };
4021
+
4022
+ exports.useDetectScroll = useDetectScroll;
4023
+ //# sourceMappingURL=index.js.map