@tanem/react-nprogress 4.0.13 → 5.0.0

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.
@@ -1,697 +1,659 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.NProgress = {}, global.React));
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.NProgress = {}, global.React));
5
5
  })(this, (function (exports, React) { 'use strict';
6
6
 
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () { return e[k]; }
17
- });
18
- }
19
- });
20
- }
21
- n["default"] = e;
22
- return Object.freeze(n);
23
- }
24
-
25
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
-
27
- function unwrapExports (x) {
28
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
29
- }
30
-
31
- function createCommonjsModule(fn, module) {
32
- return module = { exports: {} }, fn(module, module.exports), module.exports;
33
- }
34
-
35
- var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
36
- function _objectWithoutPropertiesLoose(source, excluded) {
37
- if (source == null) return {};
38
- var target = {};
39
- var sourceKeys = Object.keys(source);
40
- var key, i;
41
-
42
- for (i = 0; i < sourceKeys.length; i++) {
43
- key = sourceKeys[i];
44
- if (excluded.indexOf(key) >= 0) continue;
45
- target[key] = source[key];
46
- }
47
-
48
- return target;
49
- }
50
-
51
- module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
52
- });
53
-
54
- var _objectWithoutPropertiesLoose = unwrapExports(objectWithoutPropertiesLoose);
55
-
56
- var _extends_1 = createCommonjsModule(function (module) {
57
- function _extends() {
58
- module.exports = _extends = Object.assign || function (target) {
59
- for (var i = 1; i < arguments.length; i++) {
60
- var source = arguments[i];
61
-
62
- for (var key in source) {
63
- if (Object.prototype.hasOwnProperty.call(source, key)) {
64
- target[key] = source[key];
65
- }
66
- }
67
- }
68
-
69
- return target;
70
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
71
- return _extends.apply(this, arguments);
72
- }
73
-
74
- module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
75
- });
76
-
77
- var _extends = unwrapExports(_extends_1);
78
-
79
- var clamp = function clamp(num, lower, upper) {
80
- num = num <= upper ? num : upper;
81
- num = num >= lower ? num : lower;
82
- return num;
83
- };
84
-
85
- var createQueue = function createQueue() {
86
- var isRunning = false;
87
- var pending = [];
88
-
89
- var next = function next() {
90
- isRunning = true;
91
- var cb = pending.shift();
92
-
93
- if (cb) {
94
- return cb(next);
95
- }
96
-
97
- isRunning = false;
98
- };
99
-
100
- var clear = function clear() {
101
- isRunning = false;
102
- pending = [];
103
- };
104
-
105
- var enqueue = function enqueue(cb) {
106
- pending.push(cb);
107
-
108
- if (!isRunning && pending.length === 1) {
109
- next();
110
- }
111
- };
112
-
113
- return {
114
- clear: clear,
115
- enqueue: enqueue
116
- };
117
- };
118
-
119
- var createTimeout = function createTimeout() {
120
- var handle;
121
-
122
- var cancel = function cancel() {
123
- if (handle) {
124
- window.cancelAnimationFrame(handle);
125
- }
126
- };
127
-
128
- var schedule = function schedule(callback, delay) {
129
- var deltaTime;
130
- var start;
131
-
132
- var frame = function frame(time) {
133
- start = start || time;
134
- deltaTime = time - start;
135
-
136
- if (deltaTime > delay) {
137
- callback();
138
- return;
139
- }
140
-
141
- handle = window.requestAnimationFrame(frame);
142
- };
143
-
144
- handle = window.requestAnimationFrame(frame);
145
- };
146
-
147
- return {
148
- cancel: cancel,
149
- schedule: schedule
150
- };
151
- };
152
-
153
- var increment = function increment(progress) {
154
- var amount = 0;
155
-
156
- if (progress >= 0 && progress < 0.2) {
157
- amount = 0.1;
158
- } else if (progress >= 0.2 && progress < 0.5) {
159
- amount = 0.04;
160
- } else if (progress >= 0.5 && progress < 0.8) {
161
- amount = 0.02;
162
- } else if (progress >= 0.8 && progress < 0.99) {
163
- amount = 0.005;
164
- }
165
-
166
- return clamp(progress + amount, 0, 0.994);
167
- };
168
-
169
- // Hat-tip:
170
- var useEffectOnce = function useEffectOnce(effect) {
171
- // eslint-disable-next-line react-hooks/exhaustive-deps
172
- React.useEffect(effect, []);
173
- };
174
-
175
- var incrementParameter = function incrementParameter(num) {
176
- return ++num % 1000000;
177
- };
178
-
179
- var useUpdate = function useUpdate() {
180
- var _useState = React.useState(0),
181
- setState = _useState[1];
182
-
183
- return React.useCallback(function () {
184
- return setState(incrementParameter);
185
- }, []);
186
- };
187
-
188
- var useGetSetState = function useGetSetState(
189
- /* istanbul ignore next */
190
- initialState) {
191
- if (initialState === void 0) {
192
- initialState = {};
193
- }
194
-
195
- var update = useUpdate();
196
- var state = React.useRef(_extends({}, initialState));
197
- var get = React.useCallback(function () {
198
- return state.current;
199
- }, []);
200
- var set = React.useCallback(function (patch) {
201
- if (!patch) {
202
- return;
203
- }
204
-
205
- Object.assign(state.current, patch);
206
- update(); // eslint-disable-next-line react-hooks/exhaustive-deps
207
- }, []);
208
- return [get, set];
209
- };
210
-
211
- // Hat-tip:
212
-
213
- var useFirstMountState = function useFirstMountState() {
214
- var isFirst = React.useRef(true);
215
-
216
- if (isFirst.current) {
217
- isFirst.current = false;
218
- return true;
219
- }
220
-
221
- return isFirst.current;
222
- };
223
-
224
- var useUpdateEffect = function useUpdateEffect(effect, deps) {
225
- var isFirstMount = useFirstMountState();
226
- React.useEffect(function () {
227
- if (!isFirstMount) {
228
- return effect();
229
- } // eslint-disable-next-line react-hooks/exhaustive-deps
230
-
231
- }, deps);
232
- };
233
-
234
- /* istanbul ignore next */
235
-
236
- var noop = function noop() {
237
- return undefined;
238
- };
239
-
240
- var initialState = {
241
- isFinished: true,
242
- progress: 0,
243
- sideEffect: noop
244
- };
245
- var useNProgress = function useNProgress(_temp) {
246
- var _ref = _temp === void 0 ? {} : _temp,
247
- _ref$animationDuratio = _ref.animationDuration,
248
- animationDuration = _ref$animationDuratio === void 0 ? 200 : _ref$animationDuratio,
249
- _ref$incrementDuratio = _ref.incrementDuration,
250
- incrementDuration = _ref$incrementDuratio === void 0 ? 800 : _ref$incrementDuratio,
251
- _ref$isAnimating = _ref.isAnimating,
252
- isAnimating = _ref$isAnimating === void 0 ? false : _ref$isAnimating,
253
- _ref$minimum = _ref.minimum,
254
- minimum = _ref$minimum === void 0 ? 0.08 : _ref$minimum;
255
-
256
- var _useGetSetState = useGetSetState(initialState),
257
- get = _useGetSetState[0],
258
- setState = _useGetSetState[1];
259
-
260
- var queue = React.useRef(null);
261
- var timeout = React.useRef(null);
262
- useEffectOnce(function () {
263
- queue.current = createQueue();
264
- timeout.current = createTimeout();
265
- });
266
- var cleanup = React.useCallback(function () {
267
- var _timeout$current, _queue$current;
268
-
269
- (_timeout$current = timeout.current) == null ? void 0 : _timeout$current.cancel();
270
- (_queue$current = queue.current) == null ? void 0 : _queue$current.clear();
271
- }, []);
272
- var set = React.useCallback(function (n) {
273
- var _queue$current4;
274
-
275
- n = clamp(n, minimum, 1);
276
-
277
- if (n === 1) {
278
- var _queue$current2, _queue$current3;
279
-
280
- cleanup();
281
- (_queue$current2 = queue.current) == null ? void 0 : _queue$current2.enqueue(function (next) {
282
- setState({
283
- progress: n,
284
- sideEffect: function sideEffect() {
285
- var _timeout$current2;
286
-
287
- return (_timeout$current2 = timeout.current) == null ? void 0 : _timeout$current2.schedule(next, animationDuration);
288
- }
289
- });
290
- });
291
- (_queue$current3 = queue.current) == null ? void 0 : _queue$current3.enqueue(function () {
292
- setState({
293
- isFinished: true,
294
- sideEffect: cleanup
295
- });
296
- });
297
- return;
298
- }
299
-
300
- (_queue$current4 = queue.current) == null ? void 0 : _queue$current4.enqueue(function (next) {
301
- setState({
302
- isFinished: false,
303
- progress: n,
304
- sideEffect: function sideEffect() {
305
- var _timeout$current3;
306
-
307
- return (_timeout$current3 = timeout.current) == null ? void 0 : _timeout$current3.schedule(next, animationDuration);
308
- }
309
- });
310
- });
311
- }, [animationDuration, cleanup, minimum, queue, setState, timeout]);
312
- var trickle = React.useCallback(function () {
313
- set(increment(get().progress));
314
- }, [get, set]);
315
- var start = React.useCallback(function () {
316
- var work = function work() {
317
- var _queue$current5;
318
-
319
- trickle();
320
- (_queue$current5 = queue.current) == null ? void 0 : _queue$current5.enqueue(function (next) {
321
- var _timeout$current4;
322
-
323
- (_timeout$current4 = timeout.current) == null ? void 0 : _timeout$current4.schedule(function () {
324
- work();
325
- next();
326
- }, incrementDuration);
327
- });
328
- };
329
-
330
- work();
331
- }, [incrementDuration, queue, timeout, trickle]);
332
- var savedTrickle = React.useRef(noop);
333
- var sideEffect = get().sideEffect;
334
- React.useEffect(function () {
335
- savedTrickle.current = trickle;
336
- });
337
- useEffectOnce(function () {
338
- if (isAnimating) {
339
- start();
340
- }
341
-
342
- return cleanup;
343
- });
344
- useUpdateEffect(function () {
345
- get().sideEffect();
346
- }, [get, sideEffect]);
347
- useUpdateEffect(function () {
348
- if (!isAnimating) {
349
- set(1);
350
- } else {
351
- setState(_extends({}, initialState, {
352
- sideEffect: start
353
- }));
354
- }
355
- }, [isAnimating, set, setState, start]);
356
- return {
357
- animationDuration: animationDuration,
358
- isFinished: get().isFinished,
359
- progress: get().progress
360
- };
361
- };
362
-
363
- var _excluded = ["children"];
364
- var NProgress = function NProgress(_ref) {
365
- var children = _ref.children,
366
- restProps = _objectWithoutPropertiesLoose(_ref, _excluded);
367
-
368
- var renderProps = useNProgress(restProps);
369
- return children(renderProps);
370
- };
371
-
372
- var reactIs_development = createCommonjsModule(function (module, exports) {
373
-
374
-
375
-
376
- {
377
- (function() {
378
-
379
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
380
- // nor polyfill, then a plain number is used for performance.
381
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
382
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
383
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
384
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
385
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
386
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
387
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
388
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
389
- // (unstable) APIs that have been removed. Can we remove the symbols?
390
-
391
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
392
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
393
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
394
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
395
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
396
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
397
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
398
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
399
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
400
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
401
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
402
-
403
- function isValidElementType(type) {
404
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
405
- 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);
406
- }
407
-
408
- function typeOf(object) {
409
- if (typeof object === 'object' && object !== null) {
410
- var $$typeof = object.$$typeof;
411
-
412
- switch ($$typeof) {
413
- case REACT_ELEMENT_TYPE:
414
- var type = object.type;
415
-
416
- switch (type) {
417
- case REACT_ASYNC_MODE_TYPE:
418
- case REACT_CONCURRENT_MODE_TYPE:
419
- case REACT_FRAGMENT_TYPE:
420
- case REACT_PROFILER_TYPE:
421
- case REACT_STRICT_MODE_TYPE:
422
- case REACT_SUSPENSE_TYPE:
423
- return type;
424
-
425
- default:
426
- var $$typeofType = type && type.$$typeof;
427
-
428
- switch ($$typeofType) {
429
- case REACT_CONTEXT_TYPE:
430
- case REACT_FORWARD_REF_TYPE:
431
- case REACT_LAZY_TYPE:
432
- case REACT_MEMO_TYPE:
433
- case REACT_PROVIDER_TYPE:
434
- return $$typeofType;
435
-
436
- default:
437
- return $$typeof;
438
- }
439
-
440
- }
441
-
442
- case REACT_PORTAL_TYPE:
443
- return $$typeof;
444
- }
445
- }
446
-
447
- return undefined;
448
- } // AsyncMode is deprecated along with isAsyncMode
449
-
450
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
451
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
452
- var ContextConsumer = REACT_CONTEXT_TYPE;
453
- var ContextProvider = REACT_PROVIDER_TYPE;
454
- var Element = REACT_ELEMENT_TYPE;
455
- var ForwardRef = REACT_FORWARD_REF_TYPE;
456
- var Fragment = REACT_FRAGMENT_TYPE;
457
- var Lazy = REACT_LAZY_TYPE;
458
- var Memo = REACT_MEMO_TYPE;
459
- var Portal = REACT_PORTAL_TYPE;
460
- var Profiler = REACT_PROFILER_TYPE;
461
- var StrictMode = REACT_STRICT_MODE_TYPE;
462
- var Suspense = REACT_SUSPENSE_TYPE;
463
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
464
-
465
- function isAsyncMode(object) {
466
- {
467
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
468
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
469
-
470
- 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.');
471
- }
472
- }
473
-
474
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
475
- }
476
- function isConcurrentMode(object) {
477
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
478
- }
479
- function isContextConsumer(object) {
480
- return typeOf(object) === REACT_CONTEXT_TYPE;
481
- }
482
- function isContextProvider(object) {
483
- return typeOf(object) === REACT_PROVIDER_TYPE;
484
- }
485
- function isElement(object) {
486
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
487
- }
488
- function isForwardRef(object) {
489
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
490
- }
491
- function isFragment(object) {
492
- return typeOf(object) === REACT_FRAGMENT_TYPE;
493
- }
494
- function isLazy(object) {
495
- return typeOf(object) === REACT_LAZY_TYPE;
496
- }
497
- function isMemo(object) {
498
- return typeOf(object) === REACT_MEMO_TYPE;
499
- }
500
- function isPortal(object) {
501
- return typeOf(object) === REACT_PORTAL_TYPE;
502
- }
503
- function isProfiler(object) {
504
- return typeOf(object) === REACT_PROFILER_TYPE;
505
- }
506
- function isStrictMode(object) {
507
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
508
- }
509
- function isSuspense(object) {
510
- return typeOf(object) === REACT_SUSPENSE_TYPE;
511
- }
512
-
513
- exports.AsyncMode = AsyncMode;
514
- exports.ConcurrentMode = ConcurrentMode;
515
- exports.ContextConsumer = ContextConsumer;
516
- exports.ContextProvider = ContextProvider;
517
- exports.Element = Element;
518
- exports.ForwardRef = ForwardRef;
519
- exports.Fragment = Fragment;
520
- exports.Lazy = Lazy;
521
- exports.Memo = Memo;
522
- exports.Portal = Portal;
523
- exports.Profiler = Profiler;
524
- exports.StrictMode = StrictMode;
525
- exports.Suspense = Suspense;
526
- exports.isAsyncMode = isAsyncMode;
527
- exports.isConcurrentMode = isConcurrentMode;
528
- exports.isContextConsumer = isContextConsumer;
529
- exports.isContextProvider = isContextProvider;
530
- exports.isElement = isElement;
531
- exports.isForwardRef = isForwardRef;
532
- exports.isFragment = isFragment;
533
- exports.isLazy = isLazy;
534
- exports.isMemo = isMemo;
535
- exports.isPortal = isPortal;
536
- exports.isProfiler = isProfiler;
537
- exports.isStrictMode = isStrictMode;
538
- exports.isSuspense = isSuspense;
539
- exports.isValidElementType = isValidElementType;
540
- exports.typeOf = typeOf;
541
- })();
542
- }
543
- });
544
- reactIs_development.AsyncMode;
545
- reactIs_development.ConcurrentMode;
546
- reactIs_development.ContextConsumer;
547
- reactIs_development.ContextProvider;
548
- reactIs_development.Element;
549
- reactIs_development.ForwardRef;
550
- reactIs_development.Fragment;
551
- reactIs_development.Lazy;
552
- reactIs_development.Memo;
553
- reactIs_development.Portal;
554
- reactIs_development.Profiler;
555
- reactIs_development.StrictMode;
556
- reactIs_development.Suspense;
557
- reactIs_development.isAsyncMode;
558
- reactIs_development.isConcurrentMode;
559
- reactIs_development.isContextConsumer;
560
- reactIs_development.isContextProvider;
561
- reactIs_development.isElement;
562
- reactIs_development.isForwardRef;
563
- reactIs_development.isFragment;
564
- reactIs_development.isLazy;
565
- reactIs_development.isMemo;
566
- reactIs_development.isPortal;
567
- reactIs_development.isProfiler;
568
- reactIs_development.isStrictMode;
569
- reactIs_development.isSuspense;
570
- reactIs_development.isValidElementType;
571
- reactIs_development.typeOf;
572
-
573
- var reactIs = createCommonjsModule(function (module) {
574
-
575
- {
576
- module.exports = reactIs_development;
577
- }
578
- });
579
-
580
- /**
581
- * Copyright 2015, Yahoo! Inc.
582
- * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
583
- */
584
- var REACT_STATICS = {
585
- childContextTypes: true,
586
- contextType: true,
587
- contextTypes: true,
588
- defaultProps: true,
589
- displayName: true,
590
- getDefaultProps: true,
591
- getDerivedStateFromError: true,
592
- getDerivedStateFromProps: true,
593
- mixins: true,
594
- propTypes: true,
595
- type: true
596
- };
597
- var KNOWN_STATICS = {
598
- name: true,
599
- length: true,
600
- prototype: true,
601
- caller: true,
602
- callee: true,
603
- arguments: true,
604
- arity: true
605
- };
606
- var FORWARD_REF_STATICS = {
607
- '$$typeof': true,
608
- render: true,
609
- defaultProps: true,
610
- displayName: true,
611
- propTypes: true
612
- };
613
- var MEMO_STATICS = {
614
- '$$typeof': true,
615
- compare: true,
616
- defaultProps: true,
617
- displayName: true,
618
- propTypes: true,
619
- type: true
620
- };
621
- var TYPE_STATICS = {};
622
- TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
623
- TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
624
-
625
- function getStatics(component) {
626
- // React v16.11 and below
627
- if (reactIs.isMemo(component)) {
628
- return MEMO_STATICS;
629
- } // React v16.12 and above
630
-
631
-
632
- return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
633
- }
634
-
635
- var defineProperty = Object.defineProperty;
636
- var getOwnPropertyNames = Object.getOwnPropertyNames;
637
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
638
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
639
- var getPrototypeOf = Object.getPrototypeOf;
640
- var objectPrototype = Object.prototype;
641
- function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
642
- if (typeof sourceComponent !== 'string') {
643
- // don't hoist over string (html) components
644
- if (objectPrototype) {
645
- var inheritedComponent = getPrototypeOf(sourceComponent);
646
-
647
- if (inheritedComponent && inheritedComponent !== objectPrototype) {
648
- hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
649
- }
650
- }
651
-
652
- var keys = getOwnPropertyNames(sourceComponent);
653
-
654
- if (getOwnPropertySymbols) {
655
- keys = keys.concat(getOwnPropertySymbols(sourceComponent));
656
- }
657
-
658
- var targetStatics = getStatics(targetComponent);
659
- var sourceStatics = getStatics(sourceComponent);
660
-
661
- for (var i = 0; i < keys.length; ++i) {
662
- var key = keys[i];
663
-
664
- if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
665
- var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
666
-
667
- try {
668
- // Avoid failures from read-only properties
669
- defineProperty(targetComponent, key, descriptor);
670
- } catch (e) {}
671
- }
672
- }
673
- }
674
-
675
- return targetComponent;
676
- }
677
-
678
- var hoistNonReactStatics_cjs = hoistNonReactStatics;
679
-
680
- function withNProgress(BaseComponent) {
681
- var WithNProgress = function WithNProgress(props) {
682
- var hookProps = useNProgress(props);
683
- return /*#__PURE__*/React__namespace.createElement(BaseComponent, _extends({}, props, hookProps));
684
- };
685
-
686
- hoistNonReactStatics_cjs(WithNProgress, BaseComponent);
687
- return WithNProgress;
688
- }
689
-
690
- exports.NProgress = NProgress;
691
- exports.useNProgress = useNProgress;
692
- exports.withNProgress = withNProgress;
693
-
694
- Object.defineProperty(exports, '__esModule', { value: true });
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
26
+
27
+ function _objectWithoutPropertiesLoose(source, excluded) {
28
+ if (source == null) return {};
29
+ var target = {};
30
+ var sourceKeys = Object.keys(source);
31
+ var key, i;
32
+
33
+ for (i = 0; i < sourceKeys.length; i++) {
34
+ key = sourceKeys[i];
35
+ if (excluded.indexOf(key) >= 0) continue;
36
+ target[key] = source[key];
37
+ }
38
+
39
+ return target;
40
+ }
41
+
42
+ function _extends() {
43
+ _extends = Object.assign || function (target) {
44
+ for (var i = 1; i < arguments.length; i++) {
45
+ var source = arguments[i];
46
+
47
+ for (var key in source) {
48
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
49
+ target[key] = source[key];
50
+ }
51
+ }
52
+ }
53
+
54
+ return target;
55
+ };
56
+
57
+ return _extends.apply(this, arguments);
58
+ }
59
+
60
+ var clamp = function clamp(num, lower, upper) {
61
+ num = num <= upper ? num : upper;
62
+ num = num >= lower ? num : lower;
63
+ return num;
64
+ };
65
+
66
+ var createQueue = function createQueue() {
67
+ var isRunning = false;
68
+ var pending = [];
69
+
70
+ var next = function next() {
71
+ isRunning = true;
72
+ var cb = pending.shift();
73
+
74
+ if (cb) {
75
+ return cb(next);
76
+ }
77
+
78
+ isRunning = false;
79
+ };
80
+
81
+ var clear = function clear() {
82
+ isRunning = false;
83
+ pending = [];
84
+ };
85
+
86
+ var enqueue = function enqueue(cb) {
87
+ pending.push(cb);
88
+
89
+ if (!isRunning && pending.length === 1) {
90
+ next();
91
+ }
92
+ };
93
+
94
+ return {
95
+ clear: clear,
96
+ enqueue: enqueue
97
+ };
98
+ };
99
+
100
+ var createTimeout = function createTimeout() {
101
+ var handle;
102
+
103
+ var cancel = function cancel() {
104
+ if (handle) {
105
+ window.cancelAnimationFrame(handle);
106
+ }
107
+ };
108
+
109
+ var schedule = function schedule(callback, delay) {
110
+ var deltaTime;
111
+ var start;
112
+
113
+ var frame = function frame(time) {
114
+ start = start || time;
115
+ deltaTime = time - start;
116
+
117
+ if (deltaTime > delay) {
118
+ callback();
119
+ return;
120
+ }
121
+
122
+ handle = window.requestAnimationFrame(frame);
123
+ };
124
+
125
+ handle = window.requestAnimationFrame(frame);
126
+ };
127
+
128
+ return {
129
+ cancel: cancel,
130
+ schedule: schedule
131
+ };
132
+ };
133
+
134
+ var increment = function increment(progress) {
135
+ var amount = 0;
136
+
137
+ if (progress >= 0 && progress < 0.2) {
138
+ amount = 0.1;
139
+ } else if (progress >= 0.2 && progress < 0.5) {
140
+ amount = 0.04;
141
+ } else if (progress >= 0.5 && progress < 0.8) {
142
+ amount = 0.02;
143
+ } else if (progress >= 0.8 && progress < 0.99) {
144
+ amount = 0.005;
145
+ }
146
+
147
+ return clamp(progress + amount, 0, 0.994);
148
+ };
149
+
150
+ // Hat-tip:
151
+ var useEffectOnce = function useEffectOnce(effect) {
152
+ // eslint-disable-next-line react-hooks/exhaustive-deps
153
+ React.useEffect(effect, []);
154
+ };
155
+
156
+ var incrementParameter = function incrementParameter(num) {
157
+ return ++num % 1000000;
158
+ };
159
+
160
+ var useUpdate = function useUpdate() {
161
+ var _useState = React.useState(0),
162
+ setState = _useState[1];
163
+
164
+ return React.useCallback(function () {
165
+ return setState(incrementParameter);
166
+ }, []);
167
+ };
168
+
169
+ var useGetSetState = function useGetSetState(
170
+ /* istanbul ignore next */
171
+ initialState) {
172
+ if (initialState === void 0) {
173
+ initialState = {};
174
+ }
175
+
176
+ var update = useUpdate();
177
+ var state = React.useRef(_extends({}, initialState));
178
+ var get = React.useCallback(function () {
179
+ return state.current;
180
+ }, []);
181
+ var set = React.useCallback(function (patch) {
182
+ if (!patch) {
183
+ return;
184
+ }
185
+
186
+ Object.assign(state.current, patch);
187
+ update(); // eslint-disable-next-line react-hooks/exhaustive-deps
188
+ }, []);
189
+ return [get, set];
190
+ };
191
+
192
+ // Hat-tip:
193
+
194
+ var useFirstMountState = function useFirstMountState() {
195
+ var isFirst = React.useRef(true);
196
+
197
+ if (isFirst.current) {
198
+ isFirst.current = false;
199
+ return true;
200
+ }
201
+
202
+ return isFirst.current;
203
+ };
204
+
205
+ var useUpdateEffect = function useUpdateEffect(effect, deps) {
206
+ var isFirstMount = useFirstMountState();
207
+ React.useEffect(function () {
208
+ if (!isFirstMount) {
209
+ return effect();
210
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
211
+
212
+ }, deps);
213
+ };
214
+
215
+ /* istanbul ignore next */
216
+
217
+ var noop = function noop() {
218
+ return undefined;
219
+ };
220
+
221
+ var initialState = {
222
+ isFinished: true,
223
+ progress: 0,
224
+ sideEffect: noop
225
+ };
226
+ var useNProgress = function useNProgress(_temp) {
227
+ var _ref = _temp === void 0 ? {} : _temp,
228
+ _ref$animationDuratio = _ref.animationDuration,
229
+ animationDuration = _ref$animationDuratio === void 0 ? 200 : _ref$animationDuratio,
230
+ _ref$incrementDuratio = _ref.incrementDuration,
231
+ incrementDuration = _ref$incrementDuratio === void 0 ? 800 : _ref$incrementDuratio,
232
+ _ref$isAnimating = _ref.isAnimating,
233
+ isAnimating = _ref$isAnimating === void 0 ? false : _ref$isAnimating,
234
+ _ref$minimum = _ref.minimum,
235
+ minimum = _ref$minimum === void 0 ? 0.08 : _ref$minimum;
236
+
237
+ var _useGetSetState = useGetSetState(initialState),
238
+ get = _useGetSetState[0],
239
+ setState = _useGetSetState[1];
240
+
241
+ var queue = React.useRef(null);
242
+ var timeout = React.useRef(null);
243
+ useEffectOnce(function () {
244
+ queue.current = createQueue();
245
+ timeout.current = createTimeout();
246
+ });
247
+ var cleanup = React.useCallback(function () {
248
+ var _timeout$current, _queue$current;
249
+
250
+ (_timeout$current = timeout.current) == null ? void 0 : _timeout$current.cancel();
251
+ (_queue$current = queue.current) == null ? void 0 : _queue$current.clear();
252
+ }, []);
253
+ var set = React.useCallback(function (n) {
254
+ var _queue$current4;
255
+
256
+ n = clamp(n, minimum, 1);
257
+
258
+ if (n === 1) {
259
+ var _queue$current2, _queue$current3;
260
+
261
+ cleanup();
262
+ (_queue$current2 = queue.current) == null ? void 0 : _queue$current2.enqueue(function (next) {
263
+ setState({
264
+ progress: n,
265
+ sideEffect: function sideEffect() {
266
+ var _timeout$current2;
267
+
268
+ return (_timeout$current2 = timeout.current) == null ? void 0 : _timeout$current2.schedule(next, animationDuration);
269
+ }
270
+ });
271
+ });
272
+ (_queue$current3 = queue.current) == null ? void 0 : _queue$current3.enqueue(function () {
273
+ setState({
274
+ isFinished: true,
275
+ sideEffect: cleanup
276
+ });
277
+ });
278
+ return;
279
+ }
280
+
281
+ (_queue$current4 = queue.current) == null ? void 0 : _queue$current4.enqueue(function (next) {
282
+ setState({
283
+ isFinished: false,
284
+ progress: n,
285
+ sideEffect: function sideEffect() {
286
+ var _timeout$current3;
287
+
288
+ return (_timeout$current3 = timeout.current) == null ? void 0 : _timeout$current3.schedule(next, animationDuration);
289
+ }
290
+ });
291
+ });
292
+ }, [animationDuration, cleanup, minimum, queue, setState, timeout]);
293
+ var trickle = React.useCallback(function () {
294
+ set(increment(get().progress));
295
+ }, [get, set]);
296
+ var start = React.useCallback(function () {
297
+ var work = function work() {
298
+ var _queue$current5;
299
+
300
+ trickle();
301
+ (_queue$current5 = queue.current) == null ? void 0 : _queue$current5.enqueue(function (next) {
302
+ var _timeout$current4;
303
+
304
+ (_timeout$current4 = timeout.current) == null ? void 0 : _timeout$current4.schedule(function () {
305
+ work();
306
+ next();
307
+ }, incrementDuration);
308
+ });
309
+ };
310
+
311
+ work();
312
+ }, [incrementDuration, queue, timeout, trickle]);
313
+ var savedTrickle = React.useRef(noop);
314
+ var sideEffect = get().sideEffect;
315
+ React.useEffect(function () {
316
+ savedTrickle.current = trickle;
317
+ });
318
+ useEffectOnce(function () {
319
+ if (isAnimating) {
320
+ start();
321
+ }
322
+
323
+ return cleanup;
324
+ });
325
+ useUpdateEffect(function () {
326
+ get().sideEffect();
327
+ }, [get, sideEffect]);
328
+ useUpdateEffect(function () {
329
+ if (!isAnimating) {
330
+ set(1);
331
+ } else {
332
+ setState(_extends({}, initialState, {
333
+ sideEffect: start
334
+ }));
335
+ }
336
+ }, [isAnimating, set, setState, start]);
337
+ return {
338
+ animationDuration: animationDuration,
339
+ isFinished: get().isFinished,
340
+ progress: get().progress
341
+ };
342
+ };
343
+
344
+ var _excluded = ["children"];
345
+ var NProgress = function NProgress(_ref) {
346
+ var children = _ref.children,
347
+ restProps = _objectWithoutPropertiesLoose(_ref, _excluded);
348
+
349
+ var renderProps = useNProgress(restProps);
350
+ return children(renderProps);
351
+ };
352
+
353
+ var reactIs$1 = {exports: {}};
354
+
355
+ var reactIs_development = {};
356
+
357
+ /** @license React v16.13.1
358
+ * react-is.development.js
359
+ *
360
+ * Copyright (c) Facebook, Inc. and its affiliates.
361
+ *
362
+ * This source code is licensed under the MIT license found in the
363
+ * LICENSE file in the root directory of this source tree.
364
+ */
365
+
366
+
367
+
368
+ {
369
+ (function() {
370
+
371
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
372
+ // nor polyfill, then a plain number is used for performance.
373
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
374
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
375
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
376
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
377
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
378
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
379
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
380
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
381
+ // (unstable) APIs that have been removed. Can we remove the symbols?
382
+
383
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
384
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
385
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
386
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
387
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
388
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
389
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
390
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
391
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
392
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
393
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
394
+
395
+ function isValidElementType(type) {
396
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
397
+ 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);
398
+ }
399
+
400
+ function typeOf(object) {
401
+ if (typeof object === 'object' && object !== null) {
402
+ var $$typeof = object.$$typeof;
403
+
404
+ switch ($$typeof) {
405
+ case REACT_ELEMENT_TYPE:
406
+ var type = object.type;
407
+
408
+ switch (type) {
409
+ case REACT_ASYNC_MODE_TYPE:
410
+ case REACT_CONCURRENT_MODE_TYPE:
411
+ case REACT_FRAGMENT_TYPE:
412
+ case REACT_PROFILER_TYPE:
413
+ case REACT_STRICT_MODE_TYPE:
414
+ case REACT_SUSPENSE_TYPE:
415
+ return type;
416
+
417
+ default:
418
+ var $$typeofType = type && type.$$typeof;
419
+
420
+ switch ($$typeofType) {
421
+ case REACT_CONTEXT_TYPE:
422
+ case REACT_FORWARD_REF_TYPE:
423
+ case REACT_LAZY_TYPE:
424
+ case REACT_MEMO_TYPE:
425
+ case REACT_PROVIDER_TYPE:
426
+ return $$typeofType;
427
+
428
+ default:
429
+ return $$typeof;
430
+ }
431
+
432
+ }
433
+
434
+ case REACT_PORTAL_TYPE:
435
+ return $$typeof;
436
+ }
437
+ }
438
+
439
+ return undefined;
440
+ } // AsyncMode is deprecated along with isAsyncMode
441
+
442
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
443
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
444
+ var ContextConsumer = REACT_CONTEXT_TYPE;
445
+ var ContextProvider = REACT_PROVIDER_TYPE;
446
+ var Element = REACT_ELEMENT_TYPE;
447
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
448
+ var Fragment = REACT_FRAGMENT_TYPE;
449
+ var Lazy = REACT_LAZY_TYPE;
450
+ var Memo = REACT_MEMO_TYPE;
451
+ var Portal = REACT_PORTAL_TYPE;
452
+ var Profiler = REACT_PROFILER_TYPE;
453
+ var StrictMode = REACT_STRICT_MODE_TYPE;
454
+ var Suspense = REACT_SUSPENSE_TYPE;
455
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
456
+
457
+ function isAsyncMode(object) {
458
+ {
459
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
460
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
461
+
462
+ 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.');
463
+ }
464
+ }
465
+
466
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
467
+ }
468
+ function isConcurrentMode(object) {
469
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
470
+ }
471
+ function isContextConsumer(object) {
472
+ return typeOf(object) === REACT_CONTEXT_TYPE;
473
+ }
474
+ function isContextProvider(object) {
475
+ return typeOf(object) === REACT_PROVIDER_TYPE;
476
+ }
477
+ function isElement(object) {
478
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
479
+ }
480
+ function isForwardRef(object) {
481
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
482
+ }
483
+ function isFragment(object) {
484
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
485
+ }
486
+ function isLazy(object) {
487
+ return typeOf(object) === REACT_LAZY_TYPE;
488
+ }
489
+ function isMemo(object) {
490
+ return typeOf(object) === REACT_MEMO_TYPE;
491
+ }
492
+ function isPortal(object) {
493
+ return typeOf(object) === REACT_PORTAL_TYPE;
494
+ }
495
+ function isProfiler(object) {
496
+ return typeOf(object) === REACT_PROFILER_TYPE;
497
+ }
498
+ function isStrictMode(object) {
499
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
500
+ }
501
+ function isSuspense(object) {
502
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
503
+ }
504
+
505
+ reactIs_development.AsyncMode = AsyncMode;
506
+ reactIs_development.ConcurrentMode = ConcurrentMode;
507
+ reactIs_development.ContextConsumer = ContextConsumer;
508
+ reactIs_development.ContextProvider = ContextProvider;
509
+ reactIs_development.Element = Element;
510
+ reactIs_development.ForwardRef = ForwardRef;
511
+ reactIs_development.Fragment = Fragment;
512
+ reactIs_development.Lazy = Lazy;
513
+ reactIs_development.Memo = Memo;
514
+ reactIs_development.Portal = Portal;
515
+ reactIs_development.Profiler = Profiler;
516
+ reactIs_development.StrictMode = StrictMode;
517
+ reactIs_development.Suspense = Suspense;
518
+ reactIs_development.isAsyncMode = isAsyncMode;
519
+ reactIs_development.isConcurrentMode = isConcurrentMode;
520
+ reactIs_development.isContextConsumer = isContextConsumer;
521
+ reactIs_development.isContextProvider = isContextProvider;
522
+ reactIs_development.isElement = isElement;
523
+ reactIs_development.isForwardRef = isForwardRef;
524
+ reactIs_development.isFragment = isFragment;
525
+ reactIs_development.isLazy = isLazy;
526
+ reactIs_development.isMemo = isMemo;
527
+ reactIs_development.isPortal = isPortal;
528
+ reactIs_development.isProfiler = isProfiler;
529
+ reactIs_development.isStrictMode = isStrictMode;
530
+ reactIs_development.isSuspense = isSuspense;
531
+ reactIs_development.isValidElementType = isValidElementType;
532
+ reactIs_development.typeOf = typeOf;
533
+ })();
534
+ }
535
+
536
+ {
537
+ reactIs$1.exports = reactIs_development;
538
+ }
539
+
540
+ var reactIs = reactIs$1.exports;
541
+
542
+ /**
543
+ * Copyright 2015, Yahoo! Inc.
544
+ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
545
+ */
546
+ var REACT_STATICS = {
547
+ childContextTypes: true,
548
+ contextType: true,
549
+ contextTypes: true,
550
+ defaultProps: true,
551
+ displayName: true,
552
+ getDefaultProps: true,
553
+ getDerivedStateFromError: true,
554
+ getDerivedStateFromProps: true,
555
+ mixins: true,
556
+ propTypes: true,
557
+ type: true
558
+ };
559
+ var KNOWN_STATICS = {
560
+ name: true,
561
+ length: true,
562
+ prototype: true,
563
+ caller: true,
564
+ callee: true,
565
+ arguments: true,
566
+ arity: true
567
+ };
568
+ var FORWARD_REF_STATICS = {
569
+ '$$typeof': true,
570
+ render: true,
571
+ defaultProps: true,
572
+ displayName: true,
573
+ propTypes: true
574
+ };
575
+ var MEMO_STATICS = {
576
+ '$$typeof': true,
577
+ compare: true,
578
+ defaultProps: true,
579
+ displayName: true,
580
+ propTypes: true,
581
+ type: true
582
+ };
583
+ var TYPE_STATICS = {};
584
+ TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
585
+ TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
586
+
587
+ function getStatics(component) {
588
+ // React v16.11 and below
589
+ if (reactIs.isMemo(component)) {
590
+ return MEMO_STATICS;
591
+ } // React v16.12 and above
592
+
593
+
594
+ return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
595
+ }
596
+
597
+ var defineProperty = Object.defineProperty;
598
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
599
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
600
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
601
+ var getPrototypeOf = Object.getPrototypeOf;
602
+ var objectPrototype = Object.prototype;
603
+ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
604
+ if (typeof sourceComponent !== 'string') {
605
+ // don't hoist over string (html) components
606
+ if (objectPrototype) {
607
+ var inheritedComponent = getPrototypeOf(sourceComponent);
608
+
609
+ if (inheritedComponent && inheritedComponent !== objectPrototype) {
610
+ hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
611
+ }
612
+ }
613
+
614
+ var keys = getOwnPropertyNames(sourceComponent);
615
+
616
+ if (getOwnPropertySymbols) {
617
+ keys = keys.concat(getOwnPropertySymbols(sourceComponent));
618
+ }
619
+
620
+ var targetStatics = getStatics(targetComponent);
621
+ var sourceStatics = getStatics(sourceComponent);
622
+
623
+ for (var i = 0; i < keys.length; ++i) {
624
+ var key = keys[i];
625
+
626
+ if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
627
+ var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
628
+
629
+ try {
630
+ // Avoid failures from read-only properties
631
+ defineProperty(targetComponent, key, descriptor);
632
+ } catch (e) {}
633
+ }
634
+ }
635
+ }
636
+
637
+ return targetComponent;
638
+ }
639
+
640
+ var hoistNonReactStatics_cjs = hoistNonReactStatics;
641
+
642
+ function withNProgress(BaseComponent) {
643
+ var WithNProgress = function WithNProgress(props) {
644
+ var hookProps = useNProgress(props);
645
+ return /*#__PURE__*/React__namespace.createElement(BaseComponent, _extends({}, props, hookProps));
646
+ };
647
+
648
+ hoistNonReactStatics_cjs(WithNProgress, BaseComponent);
649
+ return WithNProgress;
650
+ }
651
+
652
+ exports.NProgress = NProgress;
653
+ exports.useNProgress = useNProgress;
654
+ exports.withNProgress = withNProgress;
655
+
656
+ Object.defineProperty(exports, '__esModule', { value: true });
695
657
 
696
658
  }));
697
659
  //# sourceMappingURL=react-nprogress.umd.development.js.map