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