@movable/react-popupbox 2.0.8-1 → 3.0.1

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,2948 +0,0 @@
1
- (function webpackUniversalModuleDefinition(root, factory) {
2
- if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory();
4
- else if(typeof define === 'function' && define.amd)
5
- define([], factory);
6
- else {
7
- var a = factory();
8
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9
- }
10
- })(this, function() {
11
- return /******/ (function(modules) { // webpackBootstrap
12
- /******/ // The module cache
13
- /******/ var installedModules = {};
14
- /******/
15
- /******/ // The require function
16
- /******/ function __webpack_require__(moduleId) {
17
- /******/
18
- /******/ // Check if module is in cache
19
- /******/ if(installedModules[moduleId])
20
- /******/ return installedModules[moduleId].exports;
21
- /******/
22
- /******/ // Create a new module (and put it into the cache)
23
- /******/ var module = installedModules[moduleId] = {
24
- /******/ i: moduleId,
25
- /******/ l: false,
26
- /******/ exports: {}
27
- /******/ };
28
- /******/
29
- /******/ // Execute the module function
30
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
- /******/
32
- /******/ // Flag the module as loaded
33
- /******/ module.l = true;
34
- /******/
35
- /******/ // Return the exports of the module
36
- /******/ return module.exports;
37
- /******/ }
38
- /******/
39
- /******/
40
- /******/ // expose the modules object (__webpack_modules__)
41
- /******/ __webpack_require__.m = modules;
42
- /******/
43
- /******/ // expose the module cache
44
- /******/ __webpack_require__.c = installedModules;
45
- /******/
46
- /******/ // identity function for calling harmony imports with the correct context
47
- /******/ __webpack_require__.i = function(value) { return value; };
48
- /******/
49
- /******/ // define getter function for harmony exports
50
- /******/ __webpack_require__.d = function(exports, name, getter) {
51
- /******/ if(!__webpack_require__.o(exports, name)) {
52
- /******/ Object.defineProperty(exports, name, {
53
- /******/ configurable: false,
54
- /******/ enumerable: true,
55
- /******/ get: getter
56
- /******/ });
57
- /******/ }
58
- /******/ };
59
- /******/
60
- /******/ // getDefaultExport function for compatibility with non-harmony modules
61
- /******/ __webpack_require__.n = function(module) {
62
- /******/ var getter = module && module.__esModule ?
63
- /******/ function getDefault() { return module['default']; } :
64
- /******/ function getModuleExports() { return module; };
65
- /******/ __webpack_require__.d(getter, 'a', getter);
66
- /******/ return getter;
67
- /******/ };
68
- /******/
69
- /******/ // Object.prototype.hasOwnProperty.call
70
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
71
- /******/
72
- /******/ // __webpack_public_path__
73
- /******/ __webpack_require__.p = "";
74
- /******/
75
- /******/ // Load entry module and return exports
76
- /******/ return __webpack_require__(__webpack_require__.s = 9);
77
- /******/ })
78
- /************************************************************************/
79
- /******/ ([
80
- /* 0 */
81
- /***/ (function(module, exports) {
82
-
83
- // shim for using process in browser
84
- var process = module.exports = {};
85
-
86
- // cached from whatever global is present so that test runners that stub it
87
- // don't break things. But we need to wrap it in a try catch in case it is
88
- // wrapped in strict mode code which doesn't define any globals. It's inside a
89
- // function because try/catches deoptimize in certain engines.
90
-
91
- var cachedSetTimeout;
92
- var cachedClearTimeout;
93
-
94
- function defaultSetTimout() {
95
- throw new Error('setTimeout has not been defined');
96
- }
97
- function defaultClearTimeout () {
98
- throw new Error('clearTimeout has not been defined');
99
- }
100
- (function () {
101
- try {
102
- if (typeof setTimeout === 'function') {
103
- cachedSetTimeout = setTimeout;
104
- } else {
105
- cachedSetTimeout = defaultSetTimout;
106
- }
107
- } catch (e) {
108
- cachedSetTimeout = defaultSetTimout;
109
- }
110
- try {
111
- if (typeof clearTimeout === 'function') {
112
- cachedClearTimeout = clearTimeout;
113
- } else {
114
- cachedClearTimeout = defaultClearTimeout;
115
- }
116
- } catch (e) {
117
- cachedClearTimeout = defaultClearTimeout;
118
- }
119
- } ())
120
- function runTimeout(fun) {
121
- if (cachedSetTimeout === setTimeout) {
122
- //normal enviroments in sane situations
123
- return setTimeout(fun, 0);
124
- }
125
- // if setTimeout wasn't available but was latter defined
126
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
127
- cachedSetTimeout = setTimeout;
128
- return setTimeout(fun, 0);
129
- }
130
- try {
131
- // when when somebody has screwed with setTimeout but no I.E. maddness
132
- return cachedSetTimeout(fun, 0);
133
- } catch(e){
134
- try {
135
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
136
- return cachedSetTimeout.call(null, fun, 0);
137
- } catch(e){
138
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
139
- return cachedSetTimeout.call(this, fun, 0);
140
- }
141
- }
142
-
143
-
144
- }
145
- function runClearTimeout(marker) {
146
- if (cachedClearTimeout === clearTimeout) {
147
- //normal enviroments in sane situations
148
- return clearTimeout(marker);
149
- }
150
- // if clearTimeout wasn't available but was latter defined
151
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
152
- cachedClearTimeout = clearTimeout;
153
- return clearTimeout(marker);
154
- }
155
- try {
156
- // when when somebody has screwed with setTimeout but no I.E. maddness
157
- return cachedClearTimeout(marker);
158
- } catch (e){
159
- try {
160
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
161
- return cachedClearTimeout.call(null, marker);
162
- } catch (e){
163
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
164
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
165
- return cachedClearTimeout.call(this, marker);
166
- }
167
- }
168
-
169
-
170
-
171
- }
172
- var queue = [];
173
- var draining = false;
174
- var currentQueue;
175
- var queueIndex = -1;
176
-
177
- function cleanUpNextTick() {
178
- if (!draining || !currentQueue) {
179
- return;
180
- }
181
- draining = false;
182
- if (currentQueue.length) {
183
- queue = currentQueue.concat(queue);
184
- } else {
185
- queueIndex = -1;
186
- }
187
- if (queue.length) {
188
- drainQueue();
189
- }
190
- }
191
-
192
- function drainQueue() {
193
- if (draining) {
194
- return;
195
- }
196
- var timeout = runTimeout(cleanUpNextTick);
197
- draining = true;
198
-
199
- var len = queue.length;
200
- while(len) {
201
- currentQueue = queue;
202
- queue = [];
203
- while (++queueIndex < len) {
204
- if (currentQueue) {
205
- currentQueue[queueIndex].run();
206
- }
207
- }
208
- queueIndex = -1;
209
- len = queue.length;
210
- }
211
- currentQueue = null;
212
- draining = false;
213
- runClearTimeout(timeout);
214
- }
215
-
216
- process.nextTick = function (fun) {
217
- var args = new Array(arguments.length - 1);
218
- if (arguments.length > 1) {
219
- for (var i = 1; i < arguments.length; i++) {
220
- args[i - 1] = arguments[i];
221
- }
222
- }
223
- queue.push(new Item(fun, args));
224
- if (queue.length === 1 && !draining) {
225
- runTimeout(drainQueue);
226
- }
227
- };
228
-
229
- // v8 likes predictible objects
230
- function Item(fun, array) {
231
- this.fun = fun;
232
- this.array = array;
233
- }
234
- Item.prototype.run = function () {
235
- this.fun.apply(null, this.array);
236
- };
237
- process.title = 'browser';
238
- process.browser = true;
239
- process.env = {};
240
- process.argv = [];
241
- process.version = ''; // empty string to avoid regexp issues
242
- process.versions = {};
243
-
244
- function noop() {}
245
-
246
- process.on = noop;
247
- process.addListener = noop;
248
- process.once = noop;
249
- process.off = noop;
250
- process.removeListener = noop;
251
- process.removeAllListeners = noop;
252
- process.emit = noop;
253
-
254
- process.binding = function (name) {
255
- throw new Error('process.binding is not supported');
256
- };
257
-
258
- process.cwd = function () { return '/' };
259
- process.chdir = function (dir) {
260
- throw new Error('process.chdir is not supported');
261
- };
262
- process.umask = function() { return 0; };
263
-
264
-
265
- /***/ }),
266
- /* 1 */
267
- /***/ (function(module, exports, __webpack_require__) {
268
-
269
- "use strict";
270
-
271
-
272
- /**
273
- * Copyright (c) 2013-present, Facebook, Inc.
274
- *
275
- * This source code is licensed under the MIT license found in the
276
- * LICENSE file in the root directory of this source tree.
277
- *
278
- *
279
- */
280
-
281
- function makeEmptyFunction(arg) {
282
- return function () {
283
- return arg;
284
- };
285
- }
286
-
287
- /**
288
- * This function accepts and discards inputs; it has no side effects. This is
289
- * primarily useful idiomatically for overridable function endpoints which
290
- * always need to be callable, since JS lacks a null-call idiom ala Cocoa.
291
- */
292
- var emptyFunction = function emptyFunction() {};
293
-
294
- emptyFunction.thatReturns = makeEmptyFunction;
295
- emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
296
- emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
297
- emptyFunction.thatReturnsNull = makeEmptyFunction(null);
298
- emptyFunction.thatReturnsThis = function () {
299
- return this;
300
- };
301
- emptyFunction.thatReturnsArgument = function (arg) {
302
- return arg;
303
- };
304
-
305
- module.exports = emptyFunction;
306
-
307
- /***/ }),
308
- /* 2 */
309
- /***/ (function(module, exports, __webpack_require__) {
310
-
311
- "use strict";
312
- /* WEBPACK VAR INJECTION */(function(process) {/**
313
- * Copyright (c) 2013-present, Facebook, Inc.
314
- *
315
- * This source code is licensed under the MIT license found in the
316
- * LICENSE file in the root directory of this source tree.
317
- *
318
- */
319
-
320
-
321
-
322
- /**
323
- * Use invariant() to assert state which your program assumes to be true.
324
- *
325
- * Provide sprintf-style format (only %s is supported) and arguments
326
- * to provide information about what broke and what you were
327
- * expecting.
328
- *
329
- * The invariant message will be stripped in production, but the invariant
330
- * will remain to ensure logic does not differ in production.
331
- */
332
-
333
- var validateFormat = function validateFormat(format) {};
334
-
335
- if (process.env.NODE_ENV !== 'production') {
336
- validateFormat = function validateFormat(format) {
337
- if (format === undefined) {
338
- throw new Error('invariant requires an error message argument');
339
- }
340
- };
341
- }
342
-
343
- function invariant(condition, format, a, b, c, d, e, f) {
344
- validateFormat(format);
345
-
346
- if (!condition) {
347
- var error;
348
- if (format === undefined) {
349
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
350
- } else {
351
- var args = [a, b, c, d, e, f];
352
- var argIndex = 0;
353
- error = new Error(format.replace(/%s/g, function () {
354
- return args[argIndex++];
355
- }));
356
- error.name = 'Invariant Violation';
357
- }
358
-
359
- error.framesToPop = 1; // we don't care about invariant's own frame
360
- throw error;
361
- }
362
- }
363
-
364
- module.exports = invariant;
365
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
366
-
367
- /***/ }),
368
- /* 3 */
369
- /***/ (function(module, exports, __webpack_require__) {
370
-
371
- "use strict";
372
-
373
-
374
- Object.defineProperty(exports, "__esModule", {
375
- value: true
376
- });
377
-
378
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
379
-
380
- var _events = __webpack_require__(10);
381
-
382
- var _deepmerge = __webpack_require__(4);
383
-
384
- var _deepmerge2 = _interopRequireDefault(_deepmerge);
385
-
386
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
387
-
388
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
389
-
390
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
391
-
392
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
393
-
394
- var Constants = {
395
- OPEN: 'open',
396
- CLOSE: 'close',
397
- CHANGE: 'change'
398
- };
399
-
400
- var Manager = function (_EventEmitter) {
401
- _inherits(Manager, _EventEmitter);
402
-
403
- function Manager() {
404
- _classCallCheck(this, Manager);
405
-
406
- var _this = _possibleConstructorReturn(this, (Manager.__proto__ || Object.getPrototypeOf(Manager)).call(this));
407
-
408
- _this.content = null;
409
- _this.config = {};
410
- _this.show = false;
411
-
412
- _this._defaultConfig = null;
413
-
414
- _this.open = _this.open.bind(_this);
415
- _this.update = _this.update.bind(_this);
416
- _this.close = _this.close.bind(_this);
417
- return _this;
418
- }
419
-
420
- _createClass(Manager, [{
421
- key: 'setDefault',
422
- value: function setDefault(defaultConfig) {
423
- this._defaultConfig = defaultConfig;
424
- }
425
- }, {
426
- key: 'open',
427
- value: function open(_ref) {
428
- var _ref$content = _ref.content,
429
- content = _ref$content === undefined ? null : _ref$content,
430
- _ref$config = _ref.config,
431
- config = _ref$config === undefined ? {} : _ref$config;
432
-
433
- if (!content) {
434
- console.warn('[popupbox.open] parameter \'content\' is required.');
435
- return false;
436
- }
437
- this.content = content || null;
438
- this.config = config || this._defaultConfig;
439
- this.show = true;
440
- this.emitChange();
441
- }
442
- }, {
443
- key: 'update',
444
- value: function update(_ref2) {
445
- var _ref2$content = _ref2.content,
446
- content = _ref2$content === undefined ? null : _ref2$content,
447
- _ref2$config = _ref2.config,
448
- config = _ref2$config === undefined ? {} : _ref2$config;
449
-
450
- this.content = content || this.content;
451
- this.config = (0, _deepmerge2.default)(this.config, config);
452
- this.emitChange();
453
- }
454
- }, {
455
- key: 'close',
456
- value: function close() {
457
- this.show = false;
458
- this.emitChange();
459
- }
460
- }, {
461
- key: 'emitChange',
462
- value: function emitChange() {
463
- this.emit(Constants.CHANGE, {
464
- children: this.content,
465
- config: this.config,
466
- show: this.show
467
- });
468
- }
469
- }, {
470
- key: 'addChangeListener',
471
- value: function addChangeListener(callback) {
472
- this.addListener(Constants.CHANGE, callback);
473
- }
474
- }, {
475
- key: 'removeChangeListener',
476
- value: function removeChangeListener(callback) {
477
- this.removeListener(Constants.CHANGE, callback);
478
- }
479
- }]);
480
-
481
- return Manager;
482
- }(_events.EventEmitter);
483
-
484
- exports.default = new Manager();
485
-
486
- /***/ }),
487
- /* 4 */
488
- /***/ (function(module, exports, __webpack_require__) {
489
-
490
- var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory) {
491
- if (true) {
492
- !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
493
- __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
494
- (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
495
- __WEBPACK_AMD_DEFINE_FACTORY__),
496
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
497
- } else if (typeof exports === 'object') {
498
- module.exports = factory();
499
- } else {
500
- root.deepmerge = factory();
501
- }
502
- }(this, function () {
503
-
504
- function isMergeableObject(val) {
505
- var nonNullObject = val && typeof val === 'object'
506
-
507
- return nonNullObject
508
- && Object.prototype.toString.call(val) !== '[object RegExp]'
509
- && Object.prototype.toString.call(val) !== '[object Date]'
510
- }
511
-
512
- function emptyTarget(val) {
513
- return Array.isArray(val) ? [] : {}
514
- }
515
-
516
- function cloneIfNecessary(value, optionsArgument) {
517
- var clone = optionsArgument && optionsArgument.clone === true
518
- return (clone && isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, optionsArgument) : value
519
- }
520
-
521
- function defaultArrayMerge(target, source, optionsArgument) {
522
- var destination = target.slice()
523
- source.forEach(function(e, i) {
524
- if (typeof destination[i] === 'undefined') {
525
- destination[i] = cloneIfNecessary(e, optionsArgument)
526
- } else if (isMergeableObject(e)) {
527
- destination[i] = deepmerge(target[i], e, optionsArgument)
528
- } else if (target.indexOf(e) === -1) {
529
- destination.push(cloneIfNecessary(e, optionsArgument))
530
- }
531
- })
532
- return destination
533
- }
534
-
535
- function mergeObject(target, source, optionsArgument) {
536
- var destination = {}
537
- if (isMergeableObject(target)) {
538
- Object.keys(target).forEach(function (key) {
539
- destination[key] = cloneIfNecessary(target[key], optionsArgument)
540
- })
541
- }
542
- Object.keys(source).forEach(function (key) {
543
- if (!isMergeableObject(source[key]) || !target[key]) {
544
- destination[key] = cloneIfNecessary(source[key], optionsArgument)
545
- } else {
546
- destination[key] = deepmerge(target[key], source[key], optionsArgument)
547
- }
548
- })
549
- return destination
550
- }
551
-
552
- function deepmerge(target, source, optionsArgument) {
553
- var array = Array.isArray(source);
554
- var options = optionsArgument || { arrayMerge: defaultArrayMerge }
555
- var arrayMerge = options.arrayMerge || defaultArrayMerge
556
-
557
- if (array) {
558
- return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument)
559
- } else {
560
- return mergeObject(target, source, optionsArgument)
561
- }
562
- }
563
-
564
- deepmerge.all = function deepmergeAll(array, optionsArgument) {
565
- if (!Array.isArray(array) || array.length < 2) {
566
- throw new Error('first argument should be an array with at least two elements')
567
- }
568
-
569
- // we are sure there are at least 2 values, so it is safe to have no initial value
570
- return array.reduce(function(prev, next) {
571
- return deepmerge(prev, next, optionsArgument)
572
- })
573
- }
574
-
575
- return deepmerge
576
-
577
- }));
578
-
579
-
580
- /***/ }),
581
- /* 5 */
582
- /***/ (function(module, exports, __webpack_require__) {
583
-
584
- "use strict";
585
- /* WEBPACK VAR INJECTION */(function(process) {/**
586
- * Copyright (c) 2013-present, Facebook, Inc.
587
- *
588
- * This source code is licensed under the MIT license found in the
589
- * LICENSE file in the root directory of this source tree.
590
- *
591
- */
592
-
593
-
594
-
595
- var emptyObject = {};
596
-
597
- if (process.env.NODE_ENV !== 'production') {
598
- Object.freeze(emptyObject);
599
- }
600
-
601
- module.exports = emptyObject;
602
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
603
-
604
- /***/ }),
605
- /* 6 */
606
- /***/ (function(module, exports, __webpack_require__) {
607
-
608
- "use strict";
609
- /* WEBPACK VAR INJECTION */(function(process) {/**
610
- * Copyright (c) 2014-present, Facebook, Inc.
611
- *
612
- * This source code is licensed under the MIT license found in the
613
- * LICENSE file in the root directory of this source tree.
614
- *
615
- */
616
-
617
-
618
-
619
- var emptyFunction = __webpack_require__(1);
620
-
621
- /**
622
- * Similar to invariant but only logs a warning if the condition is not met.
623
- * This can be used to log issues in development environments in critical
624
- * paths. Removing the logging code for production environments will keep the
625
- * same logic and follow the same code paths.
626
- */
627
-
628
- var warning = emptyFunction;
629
-
630
- if (process.env.NODE_ENV !== 'production') {
631
- var printWarning = function printWarning(format) {
632
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
633
- args[_key - 1] = arguments[_key];
634
- }
635
-
636
- var argIndex = 0;
637
- var message = 'Warning: ' + format.replace(/%s/g, function () {
638
- return args[argIndex++];
639
- });
640
- if (typeof console !== 'undefined') {
641
- console.error(message);
642
- }
643
- try {
644
- // --- Welcome to debugging React ---
645
- // This error was thrown as a convenience so that you can use this stack
646
- // to find the callsite that caused this warning to fire.
647
- throw new Error(message);
648
- } catch (x) {}
649
- };
650
-
651
- warning = function warning(condition, format) {
652
- if (format === undefined) {
653
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
654
- }
655
-
656
- if (format.indexOf('Failed Composite propType: ') === 0) {
657
- return; // Ignore CompositeComponent proptype check.
658
- }
659
-
660
- if (!condition) {
661
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
662
- args[_key2 - 2] = arguments[_key2];
663
- }
664
-
665
- printWarning.apply(undefined, [format].concat(args));
666
- }
667
- };
668
- }
669
-
670
- module.exports = warning;
671
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
672
-
673
- /***/ }),
674
- /* 7 */
675
- /***/ (function(module, exports, __webpack_require__) {
676
-
677
- "use strict";
678
- /*
679
- object-assign
680
- (c) Sindre Sorhus
681
- @license MIT
682
- */
683
-
684
-
685
- /* eslint-disable no-unused-vars */
686
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
687
- var hasOwnProperty = Object.prototype.hasOwnProperty;
688
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
689
-
690
- function toObject(val) {
691
- if (val === null || val === undefined) {
692
- throw new TypeError('Object.assign cannot be called with null or undefined');
693
- }
694
-
695
- return Object(val);
696
- }
697
-
698
- function shouldUseNative() {
699
- try {
700
- if (!Object.assign) {
701
- return false;
702
- }
703
-
704
- // Detect buggy property enumeration order in older V8 versions.
705
-
706
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
707
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
708
- test1[5] = 'de';
709
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
710
- return false;
711
- }
712
-
713
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
714
- var test2 = {};
715
- for (var i = 0; i < 10; i++) {
716
- test2['_' + String.fromCharCode(i)] = i;
717
- }
718
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
719
- return test2[n];
720
- });
721
- if (order2.join('') !== '0123456789') {
722
- return false;
723
- }
724
-
725
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
726
- var test3 = {};
727
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
728
- test3[letter] = letter;
729
- });
730
- if (Object.keys(Object.assign({}, test3)).join('') !==
731
- 'abcdefghijklmnopqrst') {
732
- return false;
733
- }
734
-
735
- return true;
736
- } catch (err) {
737
- // We don't expect any of the above to throw, but better to be safe.
738
- return false;
739
- }
740
- }
741
-
742
- module.exports = shouldUseNative() ? Object.assign : function (target, source) {
743
- var from;
744
- var to = toObject(target);
745
- var symbols;
746
-
747
- for (var s = 1; s < arguments.length; s++) {
748
- from = Object(arguments[s]);
749
-
750
- for (var key in from) {
751
- if (hasOwnProperty.call(from, key)) {
752
- to[key] = from[key];
753
- }
754
- }
755
-
756
- if (getOwnPropertySymbols) {
757
- symbols = getOwnPropertySymbols(from);
758
- for (var i = 0; i < symbols.length; i++) {
759
- if (propIsEnumerable.call(from, symbols[i])) {
760
- to[symbols[i]] = from[symbols[i]];
761
- }
762
- }
763
- }
764
- }
765
-
766
- return to;
767
- };
768
-
769
-
770
- /***/ }),
771
- /* 8 */
772
- /***/ (function(module, exports, __webpack_require__) {
773
-
774
- "use strict";
775
-
776
-
777
- Object.defineProperty(exports, "__esModule", {
778
- value: true
779
- });
780
- exports.Container = undefined;
781
-
782
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
783
-
784
- var _react = __webpack_require__(15);
785
-
786
- var _react2 = _interopRequireDefault(_react);
787
-
788
- var _manager = __webpack_require__(3);
789
-
790
- var _manager2 = _interopRequireDefault(_manager);
791
-
792
- var _deepmerge = __webpack_require__(4);
793
-
794
- var _deepmerge2 = _interopRequireDefault(_deepmerge);
795
-
796
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
797
-
798
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
799
-
800
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
801
-
802
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
803
-
804
- var Container = exports.Container = function (_Component) {
805
- _inherits(Container, _Component);
806
-
807
- function Container(props) {
808
- _classCallCheck(this, Container);
809
-
810
- var _this = _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).call(this, props));
811
-
812
- _this._defaultState = _this.getConfig({ params: props, isInit: true });
813
- _this.state = _this._defaultState;
814
- _manager2.default.setDefault(_this._defaultState);
815
-
816
- _this.handleStoreChange = _this.handleStoreChange.bind(_this);
817
- _manager2.default.addChangeListener(_this.handleStoreChange);
818
-
819
- _this.closeImagebox = _manager2.default.close.bind(_manager2.default);
820
- return _this;
821
- }
822
-
823
- _createClass(Container, [{
824
- key: 'getConfig',
825
- value: function getConfig(_ref) {
826
- var params = _ref.params,
827
- isInit = _ref.isInit;
828
-
829
- var defaultConfig = {
830
- overlayOpacity: 0.75,
831
- show: false,
832
- fadeIn: false,
833
- fadeInSpeed: 500,
834
- fadeOut: true,
835
- fadeOutSpeed: 500,
836
- overlayClose: true,
837
- escClose: true,
838
- titleBar: {
839
- enable: false,
840
- closeButton: true,
841
- closeText: '✕',
842
- position: 'top'
843
- },
844
- content: {}
845
- };
846
-
847
- if (isInit && !params) return defaultConfig;
848
-
849
- return (0, _deepmerge2.default)(isInit ? defaultConfig : this._defaultState, params);
850
- }
851
- }, {
852
- key: 'onKeyDown',
853
- value: function onKeyDown(e) {
854
- if (!this.state.escClose) return;
855
- if (this.state.show && e.keyCode === 27) {
856
- this.closeImagebox();
857
- }
858
- }
859
- }, {
860
- key: 'componentDidMount',
861
- value: function componentDidMount() {
862
- document.addEventListener('keydown', this.onKeyDown.bind(this));
863
- }
864
- }, {
865
- key: 'componentWillUnmount',
866
- value: function componentWillUnmount() {
867
- document.removeEventListener('keydown', this.onKeyDown.bind(this));
868
- _manager2.default.removeChangeListener(this.handleStoreChange);
869
- }
870
- }, {
871
- key: 'handleStoreChange',
872
- value: function handleStoreChange(params) {
873
- var _this2 = this;
874
-
875
- this.cleanUp();
876
-
877
- var children = params.children,
878
- show = params.show,
879
- config = params.config;
880
-
881
- var currentConfig = this.getConfig({ params: config, isInit: false });
882
- var fadeIn = currentConfig.fadeIn,
883
- fadeInSpeed = currentConfig.fadeInSpeed,
884
- fadeOut = currentConfig.fadeOut,
885
- fadeOutSpeed = currentConfig.fadeOutSpeed;
886
-
887
-
888
- if (show) {
889
- var onComplete = currentConfig.onComplete,
890
- onOpen = currentConfig.onOpen;
891
-
892
- this.setState((0, _deepmerge2.default)(currentConfig, {
893
- children: children,
894
- show: true,
895
- transition: fadeIn ? 'all ' + fadeInSpeed / 1000 + 's ease-in-out' : 'none',
896
- callback: setTimeout(function () {
897
- onComplete && onComplete();
898
- }, fadeInSpeed + 1)
899
- }));
900
- onOpen && onOpen();
901
- } else {
902
- var onCleanUp = currentConfig.onCleanUp;
903
-
904
- onCleanUp && onCleanUp();
905
- this.setState({
906
- show: false,
907
- transition: fadeOut ? 'all ' + fadeOutSpeed / 1000 + 's ease-in-out' : 'none',
908
- callback: setTimeout(function () {
909
- _this2.onClosed();
910
- }, fadeOutSpeed + 1)
911
- });
912
- }
913
- }
914
- }, {
915
- key: 'onClosed',
916
- value: function onClosed() {
917
- var onClosed = this.state.onClosed;
918
-
919
- onClosed && onClosed();
920
- this.setState(this._defaultState);
921
- }
922
- }, {
923
- key: 'cleanUp',
924
- value: function cleanUp() {
925
- clearTimeout(this.state.callback);
926
- }
927
- }, {
928
- key: 'renderTitleBar',
929
- value: function renderTitleBar() {
930
- var _state$titleBar = this.state.titleBar,
931
- className = _state$titleBar.className,
932
- text = _state$titleBar.text,
933
- closeText = _state$titleBar.closeText,
934
- closeButton = _state$titleBar.closeButton,
935
- closeButtonClassName = _state$titleBar.closeButtonClassName;
936
-
937
-
938
- return _react2.default.createElement(
939
- 'div',
940
- { className: 'popupbox-titleBar' + (className ? ' ' + className : '') },
941
- _react2.default.createElement(
942
- 'span',
943
- null,
944
- text && text.length ? text : _react2.default.createElement('br', null)
945
- ),
946
- closeButton && _react2.default.createElement(
947
- 'button',
948
- {
949
- onClick: this.closeImagebox,
950
- className: 'popupbox-btn--close' + (closeButtonClassName ? ' ' + closeButtonClassName : '') },
951
- closeText
952
- )
953
- );
954
- }
955
- }, {
956
- key: 'render',
957
- value: function render() {
958
- var _state = this.state,
959
- overlayOpacity = _state.overlayOpacity,
960
- show = _state.show,
961
- children = _state.children,
962
- style = _state.style,
963
- className = _state.className,
964
- titleBar = _state.titleBar,
965
- content = _state.content;
966
-
967
-
968
- return _react2.default.createElement(
969
- 'div',
970
- {
971
- 'data-title': titleBar.enable ? titleBar.position : null,
972
- style: { transition: this.state.transition },
973
- className: 'popupbox' + (show ? ' is-active' : '')
974
- },
975
- _react2.default.createElement(
976
- 'div',
977
- {
978
- className: 'popupbox-wrapper' + (className ? ' ' + className : ''),
979
- style: style ? style : undefined
980
- },
981
- titleBar.enable && this.renderTitleBar(),
982
- _react2.default.createElement(
983
- 'div',
984
- {
985
- className: 'popupbox-content' + (content.className ? ' ' + content.className : ''),
986
- style: content.style ? content.style : undefined
987
- },
988
- children
989
- )
990
- ),
991
- _react2.default.createElement('div', {
992
- className: 'popupbox-overlay',
993
- style: { opacity: overlayOpacity },
994
- onClick: this.state.overlayClose ? this.closeImagebox : undefined
995
- })
996
- );
997
- }
998
- }]);
999
-
1000
- return Container;
1001
- }(_react.Component);
1002
-
1003
- /***/ }),
1004
- /* 9 */
1005
- /***/ (function(module, exports, __webpack_require__) {
1006
-
1007
- "use strict";
1008
-
1009
-
1010
- Object.defineProperty(exports, "__esModule", {
1011
- value: true
1012
- });
1013
- exports.PopupboxManager = exports.PopupboxContainer = undefined;
1014
-
1015
- var _container = __webpack_require__(8);
1016
-
1017
- var _manager = __webpack_require__(3);
1018
-
1019
- var _manager2 = _interopRequireDefault(_manager);
1020
-
1021
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1022
-
1023
- var PopupboxContainer = exports.PopupboxContainer = _container.Container;
1024
- var PopupboxManager = exports.PopupboxManager = _manager2.default;
1025
-
1026
- /***/ }),
1027
- /* 10 */
1028
- /***/ (function(module, exports) {
1029
-
1030
- // Copyright Joyent, Inc. and other Node contributors.
1031
- //
1032
- // Permission is hereby granted, free of charge, to any person obtaining a
1033
- // copy of this software and associated documentation files (the
1034
- // "Software"), to deal in the Software without restriction, including
1035
- // without limitation the rights to use, copy, modify, merge, publish,
1036
- // distribute, sublicense, and/or sell copies of the Software, and to permit
1037
- // persons to whom the Software is furnished to do so, subject to the
1038
- // following conditions:
1039
- //
1040
- // The above copyright notice and this permission notice shall be included
1041
- // in all copies or substantial portions of the Software.
1042
- //
1043
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1044
- // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1045
- // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
1046
- // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
1047
- // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
1048
- // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
1049
- // USE OR OTHER DEALINGS IN THE SOFTWARE.
1050
-
1051
- function EventEmitter() {
1052
- this._events = this._events || {};
1053
- this._maxListeners = this._maxListeners || undefined;
1054
- }
1055
- module.exports = EventEmitter;
1056
-
1057
- // Backwards-compat with node 0.10.x
1058
- EventEmitter.EventEmitter = EventEmitter;
1059
-
1060
- EventEmitter.prototype._events = undefined;
1061
- EventEmitter.prototype._maxListeners = undefined;
1062
-
1063
- // By default EventEmitters will print a warning if more than 10 listeners are
1064
- // added to it. This is a useful default which helps finding memory leaks.
1065
- EventEmitter.defaultMaxListeners = 10;
1066
-
1067
- // Obviously not all Emitters should be limited to 10. This function allows
1068
- // that to be increased. Set to zero for unlimited.
1069
- EventEmitter.prototype.setMaxListeners = function(n) {
1070
- if (!isNumber(n) || n < 0 || isNaN(n))
1071
- throw TypeError('n must be a positive number');
1072
- this._maxListeners = n;
1073
- return this;
1074
- };
1075
-
1076
- EventEmitter.prototype.emit = function(type) {
1077
- var er, handler, len, args, i, listeners;
1078
-
1079
- if (!this._events)
1080
- this._events = {};
1081
-
1082
- // If there is no 'error' event listener then throw.
1083
- if (type === 'error') {
1084
- if (!this._events.error ||
1085
- (isObject(this._events.error) && !this._events.error.length)) {
1086
- er = arguments[1];
1087
- if (er instanceof Error) {
1088
- throw er; // Unhandled 'error' event
1089
- } else {
1090
- // At least give some kind of context to the user
1091
- var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
1092
- err.context = er;
1093
- throw err;
1094
- }
1095
- }
1096
- }
1097
-
1098
- handler = this._events[type];
1099
-
1100
- if (isUndefined(handler))
1101
- return false;
1102
-
1103
- if (isFunction(handler)) {
1104
- switch (arguments.length) {
1105
- // fast cases
1106
- case 1:
1107
- handler.call(this);
1108
- break;
1109
- case 2:
1110
- handler.call(this, arguments[1]);
1111
- break;
1112
- case 3:
1113
- handler.call(this, arguments[1], arguments[2]);
1114
- break;
1115
- // slower
1116
- default:
1117
- args = Array.prototype.slice.call(arguments, 1);
1118
- handler.apply(this, args);
1119
- }
1120
- } else if (isObject(handler)) {
1121
- args = Array.prototype.slice.call(arguments, 1);
1122
- listeners = handler.slice();
1123
- len = listeners.length;
1124
- for (i = 0; i < len; i++)
1125
- listeners[i].apply(this, args);
1126
- }
1127
-
1128
- return true;
1129
- };
1130
-
1131
- EventEmitter.prototype.addListener = function(type, listener) {
1132
- var m;
1133
-
1134
- if (!isFunction(listener))
1135
- throw TypeError('listener must be a function');
1136
-
1137
- if (!this._events)
1138
- this._events = {};
1139
-
1140
- // To avoid recursion in the case that type === "newListener"! Before
1141
- // adding it to the listeners, first emit "newListener".
1142
- if (this._events.newListener)
1143
- this.emit('newListener', type,
1144
- isFunction(listener.listener) ?
1145
- listener.listener : listener);
1146
-
1147
- if (!this._events[type])
1148
- // Optimize the case of one listener. Don't need the extra array object.
1149
- this._events[type] = listener;
1150
- else if (isObject(this._events[type]))
1151
- // If we've already got an array, just append.
1152
- this._events[type].push(listener);
1153
- else
1154
- // Adding the second element, need to change to array.
1155
- this._events[type] = [this._events[type], listener];
1156
-
1157
- // Check for listener leak
1158
- if (isObject(this._events[type]) && !this._events[type].warned) {
1159
- if (!isUndefined(this._maxListeners)) {
1160
- m = this._maxListeners;
1161
- } else {
1162
- m = EventEmitter.defaultMaxListeners;
1163
- }
1164
-
1165
- if (m && m > 0 && this._events[type].length > m) {
1166
- this._events[type].warned = true;
1167
- console.error('(node) warning: possible EventEmitter memory ' +
1168
- 'leak detected. %d listeners added. ' +
1169
- 'Use emitter.setMaxListeners() to increase limit.',
1170
- this._events[type].length);
1171
- if (typeof console.trace === 'function') {
1172
- // not supported in IE 10
1173
- console.trace();
1174
- }
1175
- }
1176
- }
1177
-
1178
- return this;
1179
- };
1180
-
1181
- EventEmitter.prototype.on = EventEmitter.prototype.addListener;
1182
-
1183
- EventEmitter.prototype.once = function(type, listener) {
1184
- if (!isFunction(listener))
1185
- throw TypeError('listener must be a function');
1186
-
1187
- var fired = false;
1188
-
1189
- function g() {
1190
- this.removeListener(type, g);
1191
-
1192
- if (!fired) {
1193
- fired = true;
1194
- listener.apply(this, arguments);
1195
- }
1196
- }
1197
-
1198
- g.listener = listener;
1199
- this.on(type, g);
1200
-
1201
- return this;
1202
- };
1203
-
1204
- // emits a 'removeListener' event iff the listener was removed
1205
- EventEmitter.prototype.removeListener = function(type, listener) {
1206
- var list, position, length, i;
1207
-
1208
- if (!isFunction(listener))
1209
- throw TypeError('listener must be a function');
1210
-
1211
- if (!this._events || !this._events[type])
1212
- return this;
1213
-
1214
- list = this._events[type];
1215
- length = list.length;
1216
- position = -1;
1217
-
1218
- if (list === listener ||
1219
- (isFunction(list.listener) && list.listener === listener)) {
1220
- delete this._events[type];
1221
- if (this._events.removeListener)
1222
- this.emit('removeListener', type, listener);
1223
-
1224
- } else if (isObject(list)) {
1225
- for (i = length; i-- > 0;) {
1226
- if (list[i] === listener ||
1227
- (list[i].listener && list[i].listener === listener)) {
1228
- position = i;
1229
- break;
1230
- }
1231
- }
1232
-
1233
- if (position < 0)
1234
- return this;
1235
-
1236
- if (list.length === 1) {
1237
- list.length = 0;
1238
- delete this._events[type];
1239
- } else {
1240
- list.splice(position, 1);
1241
- }
1242
-
1243
- if (this._events.removeListener)
1244
- this.emit('removeListener', type, listener);
1245
- }
1246
-
1247
- return this;
1248
- };
1249
-
1250
- EventEmitter.prototype.removeAllListeners = function(type) {
1251
- var key, listeners;
1252
-
1253
- if (!this._events)
1254
- return this;
1255
-
1256
- // not listening for removeListener, no need to emit
1257
- if (!this._events.removeListener) {
1258
- if (arguments.length === 0)
1259
- this._events = {};
1260
- else if (this._events[type])
1261
- delete this._events[type];
1262
- return this;
1263
- }
1264
-
1265
- // emit removeListener for all listeners on all events
1266
- if (arguments.length === 0) {
1267
- for (key in this._events) {
1268
- if (key === 'removeListener') continue;
1269
- this.removeAllListeners(key);
1270
- }
1271
- this.removeAllListeners('removeListener');
1272
- this._events = {};
1273
- return this;
1274
- }
1275
-
1276
- listeners = this._events[type];
1277
-
1278
- if (isFunction(listeners)) {
1279
- this.removeListener(type, listeners);
1280
- } else if (listeners) {
1281
- // LIFO order
1282
- while (listeners.length)
1283
- this.removeListener(type, listeners[listeners.length - 1]);
1284
- }
1285
- delete this._events[type];
1286
-
1287
- return this;
1288
- };
1289
-
1290
- EventEmitter.prototype.listeners = function(type) {
1291
- var ret;
1292
- if (!this._events || !this._events[type])
1293
- ret = [];
1294
- else if (isFunction(this._events[type]))
1295
- ret = [this._events[type]];
1296
- else
1297
- ret = this._events[type].slice();
1298
- return ret;
1299
- };
1300
-
1301
- EventEmitter.prototype.listenerCount = function(type) {
1302
- if (this._events) {
1303
- var evlistener = this._events[type];
1304
-
1305
- if (isFunction(evlistener))
1306
- return 1;
1307
- else if (evlistener)
1308
- return evlistener.length;
1309
- }
1310
- return 0;
1311
- };
1312
-
1313
- EventEmitter.listenerCount = function(emitter, type) {
1314
- return emitter.listenerCount(type);
1315
- };
1316
-
1317
- function isFunction(arg) {
1318
- return typeof arg === 'function';
1319
- }
1320
-
1321
- function isNumber(arg) {
1322
- return typeof arg === 'number';
1323
- }
1324
-
1325
- function isObject(arg) {
1326
- return typeof arg === 'object' && arg !== null;
1327
- }
1328
-
1329
- function isUndefined(arg) {
1330
- return arg === void 0;
1331
- }
1332
-
1333
-
1334
- /***/ }),
1335
- /* 11 */
1336
- /***/ (function(module, exports, __webpack_require__) {
1337
-
1338
- "use strict";
1339
- /* WEBPACK VAR INJECTION */(function(process) {/**
1340
- * Copyright (c) 2013-present, Facebook, Inc.
1341
- *
1342
- * This source code is licensed under the MIT license found in the
1343
- * LICENSE file in the root directory of this source tree.
1344
- */
1345
-
1346
-
1347
-
1348
- if (process.env.NODE_ENV !== 'production') {
1349
- var invariant = __webpack_require__(2);
1350
- var warning = __webpack_require__(6);
1351
- var ReactPropTypesSecret = __webpack_require__(12);
1352
- var loggedTypeFailures = {};
1353
- }
1354
-
1355
- /**
1356
- * Assert that the values match with the type specs.
1357
- * Error messages are memorized and will only be shown once.
1358
- *
1359
- * @param {object} typeSpecs Map of name to a ReactPropType
1360
- * @param {object} values Runtime values that need to be type-checked
1361
- * @param {string} location e.g. "prop", "context", "child context"
1362
- * @param {string} componentName Name of the component for error messages.
1363
- * @param {?Function} getStack Returns the component stack.
1364
- * @private
1365
- */
1366
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1367
- if (process.env.NODE_ENV !== 'production') {
1368
- for (var typeSpecName in typeSpecs) {
1369
- if (typeSpecs.hasOwnProperty(typeSpecName)) {
1370
- var error;
1371
- // Prop type validation may throw. In case they do, we don't want to
1372
- // fail the render phase where it didn't fail before. So we log it.
1373
- // After these have been cleaned up, we'll let them throw.
1374
- try {
1375
- // This is intentionally an invariant that gets caught. It's the same
1376
- // behavior as without this statement except with a better message.
1377
- invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
1378
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1379
- } catch (ex) {
1380
- error = ex;
1381
- }
1382
- warning(!error || error instanceof 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);
1383
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1384
- // Only monitor this failure once because there tends to be a lot of the
1385
- // same error.
1386
- loggedTypeFailures[error.message] = true;
1387
-
1388
- var stack = getStack ? getStack() : '';
1389
-
1390
- warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');
1391
- }
1392
- }
1393
- }
1394
- }
1395
- }
1396
-
1397
- module.exports = checkPropTypes;
1398
-
1399
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
1400
-
1401
- /***/ }),
1402
- /* 12 */
1403
- /***/ (function(module, exports, __webpack_require__) {
1404
-
1405
- "use strict";
1406
- /**
1407
- * Copyright (c) 2013-present, Facebook, Inc.
1408
- *
1409
- * This source code is licensed under the MIT license found in the
1410
- * LICENSE file in the root directory of this source tree.
1411
- */
1412
-
1413
-
1414
-
1415
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1416
-
1417
- module.exports = ReactPropTypesSecret;
1418
-
1419
-
1420
- /***/ }),
1421
- /* 13 */
1422
- /***/ (function(module, exports, __webpack_require__) {
1423
-
1424
- "use strict";
1425
- /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.4.0
1426
- * react.development.js
1427
- *
1428
- * Copyright (c) 2013-present, Facebook, Inc.
1429
- *
1430
- * This source code is licensed under the MIT license found in the
1431
- * LICENSE file in the root directory of this source tree.
1432
- */
1433
-
1434
-
1435
-
1436
-
1437
-
1438
- if (process.env.NODE_ENV !== "production") {
1439
- (function() {
1440
- 'use strict';
1441
-
1442
- var _assign = __webpack_require__(7);
1443
- var invariant = __webpack_require__(2);
1444
- var emptyObject = __webpack_require__(5);
1445
- var warning = __webpack_require__(6);
1446
- var emptyFunction = __webpack_require__(1);
1447
- var checkPropTypes = __webpack_require__(11);
1448
-
1449
- // TODO: this is special because it gets imported during build.
1450
-
1451
- var ReactVersion = '16.4.0';
1452
-
1453
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1454
- // nor polyfill, then a plain number is used for performance.
1455
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
1456
-
1457
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
1458
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
1459
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
1460
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
1461
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
1462
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
1463
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
1464
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
1465
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
1466
- var REACT_TIMEOUT_TYPE = hasSymbol ? Symbol.for('react.timeout') : 0xead1;
1467
-
1468
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1469
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
1470
-
1471
- function getIteratorFn(maybeIterable) {
1472
- if (maybeIterable === null || typeof maybeIterable === 'undefined') {
1473
- return null;
1474
- }
1475
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1476
- if (typeof maybeIterator === 'function') {
1477
- return maybeIterator;
1478
- }
1479
- return null;
1480
- }
1481
-
1482
- // Relying on the `invariant()` implementation lets us
1483
- // have preserve the format and params in the www builds.
1484
-
1485
- // Exports ReactDOM.createRoot
1486
-
1487
-
1488
- // Experimental error-boundary API that can recover from errors within a single
1489
- // render phase
1490
-
1491
- // Suspense
1492
- var enableSuspense = false;
1493
- // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:
1494
-
1495
-
1496
- // In some cases, StrictMode should also double-render lifecycles.
1497
- // This can be confusing for tests though,
1498
- // And it can be bad for performance in production.
1499
- // This feature flag can be used to control the behavior:
1500
-
1501
-
1502
- // To preserve the "Pause on caught exceptions" behavior of the debugger, we
1503
- // replay the begin phase of a failed component inside invokeGuardedCallback.
1504
-
1505
-
1506
- // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
1507
-
1508
-
1509
- // Warn about legacy context API
1510
-
1511
-
1512
- // Gather advanced timing metrics for Profiler subtrees.
1513
-
1514
-
1515
- // Fires getDerivedStateFromProps for state *or* props changes
1516
-
1517
-
1518
- // Only used in www builds.
1519
-
1520
- /**
1521
- * Forked from fbjs/warning:
1522
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
1523
- *
1524
- * Only change is we use console.warn instead of console.error,
1525
- * and do nothing when 'console' is not supported.
1526
- * This really simplifies the code.
1527
- * ---
1528
- * Similar to invariant but only logs a warning if the condition is not met.
1529
- * This can be used to log issues in development environments in critical
1530
- * paths. Removing the logging code for production environments will keep the
1531
- * same logic and follow the same code paths.
1532
- */
1533
-
1534
- var lowPriorityWarning = function () {};
1535
-
1536
- {
1537
- var printWarning = function (format) {
1538
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
1539
- args[_key - 1] = arguments[_key];
1540
- }
1541
-
1542
- var argIndex = 0;
1543
- var message = 'Warning: ' + format.replace(/%s/g, function () {
1544
- return args[argIndex++];
1545
- });
1546
- if (typeof console !== 'undefined') {
1547
- console.warn(message);
1548
- }
1549
- try {
1550
- // --- Welcome to debugging React ---
1551
- // This error was thrown as a convenience so that you can use this stack
1552
- // to find the callsite that caused this warning to fire.
1553
- throw new Error(message);
1554
- } catch (x) {}
1555
- };
1556
-
1557
- lowPriorityWarning = function (condition, format) {
1558
- if (format === undefined) {
1559
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
1560
- }
1561
- if (!condition) {
1562
- for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
1563
- args[_key2 - 2] = arguments[_key2];
1564
- }
1565
-
1566
- printWarning.apply(undefined, [format].concat(args));
1567
- }
1568
- };
1569
- }
1570
-
1571
- var lowPriorityWarning$1 = lowPriorityWarning;
1572
-
1573
- var didWarnStateUpdateForUnmountedComponent = {};
1574
-
1575
- function warnNoop(publicInstance, callerName) {
1576
- {
1577
- var _constructor = publicInstance.constructor;
1578
- var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
1579
- var warningKey = componentName + '.' + callerName;
1580
- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
1581
- return;
1582
- }
1583
- warning(false, "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);
1584
- didWarnStateUpdateForUnmountedComponent[warningKey] = true;
1585
- }
1586
- }
1587
-
1588
- /**
1589
- * This is the abstract API for an update queue.
1590
- */
1591
- var ReactNoopUpdateQueue = {
1592
- /**
1593
- * Checks whether or not this composite component is mounted.
1594
- * @param {ReactClass} publicInstance The instance we want to test.
1595
- * @return {boolean} True if mounted, false otherwise.
1596
- * @protected
1597
- * @final
1598
- */
1599
- isMounted: function (publicInstance) {
1600
- return false;
1601
- },
1602
-
1603
- /**
1604
- * Forces an update. This should only be invoked when it is known with
1605
- * certainty that we are **not** in a DOM transaction.
1606
- *
1607
- * You may want to call this when you know that some deeper aspect of the
1608
- * component's state has changed but `setState` was not called.
1609
- *
1610
- * This will not invoke `shouldComponentUpdate`, but it will invoke
1611
- * `componentWillUpdate` and `componentDidUpdate`.
1612
- *
1613
- * @param {ReactClass} publicInstance The instance that should rerender.
1614
- * @param {?function} callback Called after component is updated.
1615
- * @param {?string} callerName name of the calling function in the public API.
1616
- * @internal
1617
- */
1618
- enqueueForceUpdate: function (publicInstance, callback, callerName) {
1619
- warnNoop(publicInstance, 'forceUpdate');
1620
- },
1621
-
1622
- /**
1623
- * Replaces all of the state. Always use this or `setState` to mutate state.
1624
- * You should treat `this.state` as immutable.
1625
- *
1626
- * There is no guarantee that `this.state` will be immediately updated, so
1627
- * accessing `this.state` after calling this method may return the old value.
1628
- *
1629
- * @param {ReactClass} publicInstance The instance that should rerender.
1630
- * @param {object} completeState Next state.
1631
- * @param {?function} callback Called after component is updated.
1632
- * @param {?string} callerName name of the calling function in the public API.
1633
- * @internal
1634
- */
1635
- enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
1636
- warnNoop(publicInstance, 'replaceState');
1637
- },
1638
-
1639
- /**
1640
- * Sets a subset of the state. This only exists because _pendingState is
1641
- * internal. This provides a merging strategy that is not available to deep
1642
- * properties which is confusing. TODO: Expose pendingState or don't use it
1643
- * during the merge.
1644
- *
1645
- * @param {ReactClass} publicInstance The instance that should rerender.
1646
- * @param {object} partialState Next partial state to be merged with state.
1647
- * @param {?function} callback Called after component is updated.
1648
- * @param {?string} Name of the calling function in the public API.
1649
- * @internal
1650
- */
1651
- enqueueSetState: function (publicInstance, partialState, callback, callerName) {
1652
- warnNoop(publicInstance, 'setState');
1653
- }
1654
- };
1655
-
1656
- /**
1657
- * Base class helpers for the updating state of a component.
1658
- */
1659
- function Component(props, context, updater) {
1660
- this.props = props;
1661
- this.context = context;
1662
- this.refs = emptyObject;
1663
- // We initialize the default updater but the real one gets injected by the
1664
- // renderer.
1665
- this.updater = updater || ReactNoopUpdateQueue;
1666
- }
1667
-
1668
- Component.prototype.isReactComponent = {};
1669
-
1670
- /**
1671
- * Sets a subset of the state. Always use this to mutate
1672
- * state. You should treat `this.state` as immutable.
1673
- *
1674
- * There is no guarantee that `this.state` will be immediately updated, so
1675
- * accessing `this.state` after calling this method may return the old value.
1676
- *
1677
- * There is no guarantee that calls to `setState` will run synchronously,
1678
- * as they may eventually be batched together. You can provide an optional
1679
- * callback that will be executed when the call to setState is actually
1680
- * completed.
1681
- *
1682
- * When a function is provided to setState, it will be called at some point in
1683
- * the future (not synchronously). It will be called with the up to date
1684
- * component arguments (state, props, context). These values can be different
1685
- * from this.* because your function may be called after receiveProps but before
1686
- * shouldComponentUpdate, and this new state, props, and context will not yet be
1687
- * assigned to this.
1688
- *
1689
- * @param {object|function} partialState Next partial state or function to
1690
- * produce next partial state to be merged with current state.
1691
- * @param {?function} callback Called after state is updated.
1692
- * @final
1693
- * @protected
1694
- */
1695
- Component.prototype.setState = function (partialState, callback) {
1696
- !(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null) ? invariant(false, 'setState(...): takes an object of state variables to update or a function which returns an object of state variables.') : void 0;
1697
- this.updater.enqueueSetState(this, partialState, callback, 'setState');
1698
- };
1699
-
1700
- /**
1701
- * Forces an update. This should only be invoked when it is known with
1702
- * certainty that we are **not** in a DOM transaction.
1703
- *
1704
- * You may want to call this when you know that some deeper aspect of the
1705
- * component's state has changed but `setState` was not called.
1706
- *
1707
- * This will not invoke `shouldComponentUpdate`, but it will invoke
1708
- * `componentWillUpdate` and `componentDidUpdate`.
1709
- *
1710
- * @param {?function} callback Called after update is complete.
1711
- * @final
1712
- * @protected
1713
- */
1714
- Component.prototype.forceUpdate = function (callback) {
1715
- this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
1716
- };
1717
-
1718
- /**
1719
- * Deprecated APIs. These APIs used to exist on classic React classes but since
1720
- * we would like to deprecate them, we're not going to move them over to this
1721
- * modern base class. Instead, we define a getter that warns if it's accessed.
1722
- */
1723
- {
1724
- var deprecatedAPIs = {
1725
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
1726
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
1727
- };
1728
- var defineDeprecationWarning = function (methodName, info) {
1729
- Object.defineProperty(Component.prototype, methodName, {
1730
- get: function () {
1731
- lowPriorityWarning$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
1732
- return undefined;
1733
- }
1734
- });
1735
- };
1736
- for (var fnName in deprecatedAPIs) {
1737
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
1738
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1739
- }
1740
- }
1741
- }
1742
-
1743
- function ComponentDummy() {}
1744
- ComponentDummy.prototype = Component.prototype;
1745
-
1746
- /**
1747
- * Convenience component with default shallow equality check for sCU.
1748
- */
1749
- function PureComponent(props, context, updater) {
1750
- this.props = props;
1751
- this.context = context;
1752
- this.refs = emptyObject;
1753
- this.updater = updater || ReactNoopUpdateQueue;
1754
- }
1755
-
1756
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
1757
- pureComponentPrototype.constructor = PureComponent;
1758
- // Avoid an extra prototype jump for these methods.
1759
- _assign(pureComponentPrototype, Component.prototype);
1760
- pureComponentPrototype.isPureReactComponent = true;
1761
-
1762
- // an immutable object with a single mutable value
1763
- function createRef() {
1764
- var refObject = {
1765
- current: null
1766
- };
1767
- {
1768
- Object.seal(refObject);
1769
- }
1770
- return refObject;
1771
- }
1772
-
1773
- /**
1774
- * Keeps track of the current owner.
1775
- *
1776
- * The current owner is the component who should own any components that are
1777
- * currently being constructed.
1778
- */
1779
- var ReactCurrentOwner = {
1780
- /**
1781
- * @internal
1782
- * @type {ReactComponent}
1783
- */
1784
- current: null
1785
- };
1786
-
1787
- var hasOwnProperty = Object.prototype.hasOwnProperty;
1788
-
1789
- var RESERVED_PROPS = {
1790
- key: true,
1791
- ref: true,
1792
- __self: true,
1793
- __source: true
1794
- };
1795
-
1796
- var specialPropKeyWarningShown = void 0;
1797
- var specialPropRefWarningShown = void 0;
1798
-
1799
- function hasValidRef(config) {
1800
- {
1801
- if (hasOwnProperty.call(config, 'ref')) {
1802
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1803
- if (getter && getter.isReactWarning) {
1804
- return false;
1805
- }
1806
- }
1807
- }
1808
- return config.ref !== undefined;
1809
- }
1810
-
1811
- function hasValidKey(config) {
1812
- {
1813
- if (hasOwnProperty.call(config, 'key')) {
1814
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1815
- if (getter && getter.isReactWarning) {
1816
- return false;
1817
- }
1818
- }
1819
- }
1820
- return config.key !== undefined;
1821
- }
1822
-
1823
- function defineKeyPropWarningGetter(props, displayName) {
1824
- var warnAboutAccessingKey = function () {
1825
- if (!specialPropKeyWarningShown) {
1826
- specialPropKeyWarningShown = true;
1827
- warning(false, '%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://fb.me/react-special-props)', displayName);
1828
- }
1829
- };
1830
- warnAboutAccessingKey.isReactWarning = true;
1831
- Object.defineProperty(props, 'key', {
1832
- get: warnAboutAccessingKey,
1833
- configurable: true
1834
- });
1835
- }
1836
-
1837
- function defineRefPropWarningGetter(props, displayName) {
1838
- var warnAboutAccessingRef = function () {
1839
- if (!specialPropRefWarningShown) {
1840
- specialPropRefWarningShown = true;
1841
- warning(false, '%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://fb.me/react-special-props)', displayName);
1842
- }
1843
- };
1844
- warnAboutAccessingRef.isReactWarning = true;
1845
- Object.defineProperty(props, 'ref', {
1846
- get: warnAboutAccessingRef,
1847
- configurable: true
1848
- });
1849
- }
1850
-
1851
- /**
1852
- * Factory method to create a new React element. This no longer adheres to
1853
- * the class pattern, so do not use new to call it. Also, no instanceof check
1854
- * will work. Instead test $$typeof field against Symbol.for('react.element') to check
1855
- * if something is a React Element.
1856
- *
1857
- * @param {*} type
1858
- * @param {*} key
1859
- * @param {string|object} ref
1860
- * @param {*} self A *temporary* helper to detect places where `this` is
1861
- * different from the `owner` when React.createElement is called, so that we
1862
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
1863
- * functions, and as long as `this` and owner are the same, there will be no
1864
- * change in behavior.
1865
- * @param {*} source An annotation object (added by a transpiler or otherwise)
1866
- * indicating filename, line number, and/or other information.
1867
- * @param {*} owner
1868
- * @param {*} props
1869
- * @internal
1870
- */
1871
- var ReactElement = function (type, key, ref, self, source, owner, props) {
1872
- var element = {
1873
- // This tag allows us to uniquely identify this as a React Element
1874
- $$typeof: REACT_ELEMENT_TYPE,
1875
-
1876
- // Built-in properties that belong on the element
1877
- type: type,
1878
- key: key,
1879
- ref: ref,
1880
- props: props,
1881
-
1882
- // Record the component responsible for creating this element.
1883
- _owner: owner
1884
- };
1885
-
1886
- {
1887
- // The validation flag is currently mutative. We put it on
1888
- // an external backing store so that we can freeze the whole object.
1889
- // This can be replaced with a WeakMap once they are implemented in
1890
- // commonly used development environments.
1891
- element._store = {};
1892
-
1893
- // To make comparing ReactElements easier for testing purposes, we make
1894
- // the validation flag non-enumerable (where possible, which should
1895
- // include every environment we run tests in), so the test framework
1896
- // ignores it.
1897
- Object.defineProperty(element._store, 'validated', {
1898
- configurable: false,
1899
- enumerable: false,
1900
- writable: true,
1901
- value: false
1902
- });
1903
- // self and source are DEV only properties.
1904
- Object.defineProperty(element, '_self', {
1905
- configurable: false,
1906
- enumerable: false,
1907
- writable: false,
1908
- value: self
1909
- });
1910
- // Two elements created in two different places should be considered
1911
- // equal for testing purposes and therefore we hide it from enumeration.
1912
- Object.defineProperty(element, '_source', {
1913
- configurable: false,
1914
- enumerable: false,
1915
- writable: false,
1916
- value: source
1917
- });
1918
- if (Object.freeze) {
1919
- Object.freeze(element.props);
1920
- Object.freeze(element);
1921
- }
1922
- }
1923
-
1924
- return element;
1925
- };
1926
-
1927
- /**
1928
- * Create and return a new ReactElement of the given type.
1929
- * See https://reactjs.org/docs/react-api.html#createelement
1930
- */
1931
- function createElement(type, config, children) {
1932
- var propName = void 0;
1933
-
1934
- // Reserved names are extracted
1935
- var props = {};
1936
-
1937
- var key = null;
1938
- var ref = null;
1939
- var self = null;
1940
- var source = null;
1941
-
1942
- if (config != null) {
1943
- if (hasValidRef(config)) {
1944
- ref = config.ref;
1945
- }
1946
- if (hasValidKey(config)) {
1947
- key = '' + config.key;
1948
- }
1949
-
1950
- self = config.__self === undefined ? null : config.__self;
1951
- source = config.__source === undefined ? null : config.__source;
1952
- // Remaining properties are added to a new props object
1953
- for (propName in config) {
1954
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1955
- props[propName] = config[propName];
1956
- }
1957
- }
1958
- }
1959
-
1960
- // Children can be more than one argument, and those are transferred onto
1961
- // the newly allocated props object.
1962
- var childrenLength = arguments.length - 2;
1963
- if (childrenLength === 1) {
1964
- props.children = children;
1965
- } else if (childrenLength > 1) {
1966
- var childArray = Array(childrenLength);
1967
- for (var i = 0; i < childrenLength; i++) {
1968
- childArray[i] = arguments[i + 2];
1969
- }
1970
- {
1971
- if (Object.freeze) {
1972
- Object.freeze(childArray);
1973
- }
1974
- }
1975
- props.children = childArray;
1976
- }
1977
-
1978
- // Resolve default props
1979
- if (type && type.defaultProps) {
1980
- var defaultProps = type.defaultProps;
1981
- for (propName in defaultProps) {
1982
- if (props[propName] === undefined) {
1983
- props[propName] = defaultProps[propName];
1984
- }
1985
- }
1986
- }
1987
- {
1988
- if (key || ref) {
1989
- if (typeof props.$$typeof === 'undefined' || props.$$typeof !== REACT_ELEMENT_TYPE) {
1990
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1991
- if (key) {
1992
- defineKeyPropWarningGetter(props, displayName);
1993
- }
1994
- if (ref) {
1995
- defineRefPropWarningGetter(props, displayName);
1996
- }
1997
- }
1998
- }
1999
- }
2000
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
2001
- }
2002
-
2003
- /**
2004
- * Return a function that produces ReactElements of a given type.
2005
- * See https://reactjs.org/docs/react-api.html#createfactory
2006
- */
2007
-
2008
-
2009
- function cloneAndReplaceKey(oldElement, newKey) {
2010
- var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
2011
-
2012
- return newElement;
2013
- }
2014
-
2015
- /**
2016
- * Clone and return a new ReactElement using element as the starting point.
2017
- * See https://reactjs.org/docs/react-api.html#cloneelement
2018
- */
2019
- function cloneElement(element, config, children) {
2020
- !!(element === null || element === undefined) ? invariant(false, 'React.cloneElement(...): The argument must be a React element, but you passed %s.', element) : void 0;
2021
-
2022
- var propName = void 0;
2023
-
2024
- // Original props are copied
2025
- var props = _assign({}, element.props);
2026
-
2027
- // Reserved names are extracted
2028
- var key = element.key;
2029
- var ref = element.ref;
2030
- // Self is preserved since the owner is preserved.
2031
- var self = element._self;
2032
- // Source is preserved since cloneElement is unlikely to be targeted by a
2033
- // transpiler, and the original source is probably a better indicator of the
2034
- // true owner.
2035
- var source = element._source;
2036
-
2037
- // Owner will be preserved, unless ref is overridden
2038
- var owner = element._owner;
2039
-
2040
- if (config != null) {
2041
- if (hasValidRef(config)) {
2042
- // Silently steal the ref from the parent.
2043
- ref = config.ref;
2044
- owner = ReactCurrentOwner.current;
2045
- }
2046
- if (hasValidKey(config)) {
2047
- key = '' + config.key;
2048
- }
2049
-
2050
- // Remaining properties override existing props
2051
- var defaultProps = void 0;
2052
- if (element.type && element.type.defaultProps) {
2053
- defaultProps = element.type.defaultProps;
2054
- }
2055
- for (propName in config) {
2056
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2057
- if (config[propName] === undefined && defaultProps !== undefined) {
2058
- // Resolve default props
2059
- props[propName] = defaultProps[propName];
2060
- } else {
2061
- props[propName] = config[propName];
2062
- }
2063
- }
2064
- }
2065
- }
2066
-
2067
- // Children can be more than one argument, and those are transferred onto
2068
- // the newly allocated props object.
2069
- var childrenLength = arguments.length - 2;
2070
- if (childrenLength === 1) {
2071
- props.children = children;
2072
- } else if (childrenLength > 1) {
2073
- var childArray = Array(childrenLength);
2074
- for (var i = 0; i < childrenLength; i++) {
2075
- childArray[i] = arguments[i + 2];
2076
- }
2077
- props.children = childArray;
2078
- }
2079
-
2080
- return ReactElement(element.type, key, ref, self, source, owner, props);
2081
- }
2082
-
2083
- /**
2084
- * Verifies the object is a ReactElement.
2085
- * See https://reactjs.org/docs/react-api.html#isvalidelement
2086
- * @param {?object} object
2087
- * @return {boolean} True if `object` is a valid component.
2088
- * @final
2089
- */
2090
- function isValidElement(object) {
2091
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2092
- }
2093
-
2094
- var ReactDebugCurrentFrame = {};
2095
-
2096
- {
2097
- // Component that is being worked on
2098
- ReactDebugCurrentFrame.getCurrentStack = null;
2099
-
2100
- ReactDebugCurrentFrame.getStackAddendum = function () {
2101
- var impl = ReactDebugCurrentFrame.getCurrentStack;
2102
- if (impl) {
2103
- return impl();
2104
- }
2105
- return null;
2106
- };
2107
- }
2108
-
2109
- var SEPARATOR = '.';
2110
- var SUBSEPARATOR = ':';
2111
-
2112
- /**
2113
- * Escape and wrap key so it is safe to use as a reactid
2114
- *
2115
- * @param {string} key to be escaped.
2116
- * @return {string} the escaped key.
2117
- */
2118
- function escape(key) {
2119
- var escapeRegex = /[=:]/g;
2120
- var escaperLookup = {
2121
- '=': '=0',
2122
- ':': '=2'
2123
- };
2124
- var escapedString = ('' + key).replace(escapeRegex, function (match) {
2125
- return escaperLookup[match];
2126
- });
2127
-
2128
- return '$' + escapedString;
2129
- }
2130
-
2131
- /**
2132
- * TODO: Test that a single child and an array with one item have the same key
2133
- * pattern.
2134
- */
2135
-
2136
- var didWarnAboutMaps = false;
2137
-
2138
- var userProvidedKeyEscapeRegex = /\/+/g;
2139
- function escapeUserProvidedKey(text) {
2140
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
2141
- }
2142
-
2143
- var POOL_SIZE = 10;
2144
- var traverseContextPool = [];
2145
- function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
2146
- if (traverseContextPool.length) {
2147
- var traverseContext = traverseContextPool.pop();
2148
- traverseContext.result = mapResult;
2149
- traverseContext.keyPrefix = keyPrefix;
2150
- traverseContext.func = mapFunction;
2151
- traverseContext.context = mapContext;
2152
- traverseContext.count = 0;
2153
- return traverseContext;
2154
- } else {
2155
- return {
2156
- result: mapResult,
2157
- keyPrefix: keyPrefix,
2158
- func: mapFunction,
2159
- context: mapContext,
2160
- count: 0
2161
- };
2162
- }
2163
- }
2164
-
2165
- function releaseTraverseContext(traverseContext) {
2166
- traverseContext.result = null;
2167
- traverseContext.keyPrefix = null;
2168
- traverseContext.func = null;
2169
- traverseContext.context = null;
2170
- traverseContext.count = 0;
2171
- if (traverseContextPool.length < POOL_SIZE) {
2172
- traverseContextPool.push(traverseContext);
2173
- }
2174
- }
2175
-
2176
- /**
2177
- * @param {?*} children Children tree container.
2178
- * @param {!string} nameSoFar Name of the key path so far.
2179
- * @param {!function} callback Callback to invoke with each child found.
2180
- * @param {?*} traverseContext Used to pass information throughout the traversal
2181
- * process.
2182
- * @return {!number} The number of children in this subtree.
2183
- */
2184
- function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
2185
- var type = typeof children;
2186
-
2187
- if (type === 'undefined' || type === 'boolean') {
2188
- // All of the above are perceived as null.
2189
- children = null;
2190
- }
2191
-
2192
- var invokeCallback = false;
2193
-
2194
- if (children === null) {
2195
- invokeCallback = true;
2196
- } else {
2197
- switch (type) {
2198
- case 'string':
2199
- case 'number':
2200
- invokeCallback = true;
2201
- break;
2202
- case 'object':
2203
- switch (children.$$typeof) {
2204
- case REACT_ELEMENT_TYPE:
2205
- case REACT_PORTAL_TYPE:
2206
- invokeCallback = true;
2207
- }
2208
- }
2209
- }
2210
-
2211
- if (invokeCallback) {
2212
- callback(traverseContext, children,
2213
- // If it's the only child, treat the name as if it was wrapped in an array
2214
- // so that it's consistent if the number of children grows.
2215
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
2216
- return 1;
2217
- }
2218
-
2219
- var child = void 0;
2220
- var nextName = void 0;
2221
- var subtreeCount = 0; // Count of children found in the current subtree.
2222
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
2223
-
2224
- if (Array.isArray(children)) {
2225
- for (var i = 0; i < children.length; i++) {
2226
- child = children[i];
2227
- nextName = nextNamePrefix + getComponentKey(child, i);
2228
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
2229
- }
2230
- } else {
2231
- var iteratorFn = getIteratorFn(children);
2232
- if (typeof iteratorFn === 'function') {
2233
- {
2234
- // Warn about using Maps as children
2235
- if (iteratorFn === children.entries) {
2236
- !didWarnAboutMaps ? warning(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.%s', ReactDebugCurrentFrame.getStackAddendum()) : void 0;
2237
- didWarnAboutMaps = true;
2238
- }
2239
- }
2240
-
2241
- var iterator = iteratorFn.call(children);
2242
- var step = void 0;
2243
- var ii = 0;
2244
- while (!(step = iterator.next()).done) {
2245
- child = step.value;
2246
- nextName = nextNamePrefix + getComponentKey(child, ii++);
2247
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
2248
- }
2249
- } else if (type === 'object') {
2250
- var addendum = '';
2251
- {
2252
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
2253
- }
2254
- var childrenString = '' + children;
2255
- invariant(false, 'Objects are not valid as a React child (found: %s).%s', childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString, addendum);
2256
- }
2257
- }
2258
-
2259
- return subtreeCount;
2260
- }
2261
-
2262
- /**
2263
- * Traverses children that are typically specified as `props.children`, but
2264
- * might also be specified through attributes:
2265
- *
2266
- * - `traverseAllChildren(this.props.children, ...)`
2267
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
2268
- *
2269
- * The `traverseContext` is an optional argument that is passed through the
2270
- * entire traversal. It can be used to store accumulations or anything else that
2271
- * the callback might find relevant.
2272
- *
2273
- * @param {?*} children Children tree object.
2274
- * @param {!function} callback To invoke upon traversing each child.
2275
- * @param {?*} traverseContext Context for traversal.
2276
- * @return {!number} The number of children in this subtree.
2277
- */
2278
- function traverseAllChildren(children, callback, traverseContext) {
2279
- if (children == null) {
2280
- return 0;
2281
- }
2282
-
2283
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
2284
- }
2285
-
2286
- /**
2287
- * Generate a key string that identifies a component within a set.
2288
- *
2289
- * @param {*} component A component that could contain a manual key.
2290
- * @param {number} index Index that is used if a manual key is not provided.
2291
- * @return {string}
2292
- */
2293
- function getComponentKey(component, index) {
2294
- // Do some typechecking here since we call this blindly. We want to ensure
2295
- // that we don't block potential future ES APIs.
2296
- if (typeof component === 'object' && component !== null && component.key != null) {
2297
- // Explicit key
2298
- return escape(component.key);
2299
- }
2300
- // Implicit key determined by the index in the set
2301
- return index.toString(36);
2302
- }
2303
-
2304
- function forEachSingleChild(bookKeeping, child, name) {
2305
- var func = bookKeeping.func,
2306
- context = bookKeeping.context;
2307
-
2308
- func.call(context, child, bookKeeping.count++);
2309
- }
2310
-
2311
- /**
2312
- * Iterates through children that are typically specified as `props.children`.
2313
- *
2314
- * See https://reactjs.org/docs/react-api.html#react.children.foreach
2315
- *
2316
- * The provided forEachFunc(child, index) will be called for each
2317
- * leaf child.
2318
- *
2319
- * @param {?*} children Children tree container.
2320
- * @param {function(*, int)} forEachFunc
2321
- * @param {*} forEachContext Context for forEachContext.
2322
- */
2323
- function forEachChildren(children, forEachFunc, forEachContext) {
2324
- if (children == null) {
2325
- return children;
2326
- }
2327
- var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
2328
- traverseAllChildren(children, forEachSingleChild, traverseContext);
2329
- releaseTraverseContext(traverseContext);
2330
- }
2331
-
2332
- function mapSingleChildIntoContext(bookKeeping, child, childKey) {
2333
- var result = bookKeeping.result,
2334
- keyPrefix = bookKeeping.keyPrefix,
2335
- func = bookKeeping.func,
2336
- context = bookKeeping.context;
2337
-
2338
-
2339
- var mappedChild = func.call(context, child, bookKeeping.count++);
2340
- if (Array.isArray(mappedChild)) {
2341
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, emptyFunction.thatReturnsArgument);
2342
- } else if (mappedChild != null) {
2343
- if (isValidElement(mappedChild)) {
2344
- mappedChild = cloneAndReplaceKey(mappedChild,
2345
- // Keep both the (mapped) and old keys if they differ, just as
2346
- // traverseAllChildren used to do for objects as children
2347
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
2348
- }
2349
- result.push(mappedChild);
2350
- }
2351
- }
2352
-
2353
- function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
2354
- var escapedPrefix = '';
2355
- if (prefix != null) {
2356
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
2357
- }
2358
- var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
2359
- traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
2360
- releaseTraverseContext(traverseContext);
2361
- }
2362
-
2363
- /**
2364
- * Maps children that are typically specified as `props.children`.
2365
- *
2366
- * See https://reactjs.org/docs/react-api.html#react.children.map
2367
- *
2368
- * The provided mapFunction(child, key, index) will be called for each
2369
- * leaf child.
2370
- *
2371
- * @param {?*} children Children tree container.
2372
- * @param {function(*, int)} func The map function.
2373
- * @param {*} context Context for mapFunction.
2374
- * @return {object} Object containing the ordered map of results.
2375
- */
2376
- function mapChildren(children, func, context) {
2377
- if (children == null) {
2378
- return children;
2379
- }
2380
- var result = [];
2381
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
2382
- return result;
2383
- }
2384
-
2385
- /**
2386
- * Count the number of children that are typically specified as
2387
- * `props.children`.
2388
- *
2389
- * See https://reactjs.org/docs/react-api.html#react.children.count
2390
- *
2391
- * @param {?*} children Children tree container.
2392
- * @return {number} The number of children.
2393
- */
2394
- function countChildren(children) {
2395
- return traverseAllChildren(children, emptyFunction.thatReturnsNull, null);
2396
- }
2397
-
2398
- /**
2399
- * Flatten a children object (typically specified as `props.children`) and
2400
- * return an array with appropriately re-keyed children.
2401
- *
2402
- * See https://reactjs.org/docs/react-api.html#react.children.toarray
2403
- */
2404
- function toArray(children) {
2405
- var result = [];
2406
- mapIntoWithKeyPrefixInternal(children, result, null, emptyFunction.thatReturnsArgument);
2407
- return result;
2408
- }
2409
-
2410
- /**
2411
- * Returns the first child in a collection of children and verifies that there
2412
- * is only one child in the collection.
2413
- *
2414
- * See https://reactjs.org/docs/react-api.html#react.children.only
2415
- *
2416
- * The current implementation of this function assumes that a single child gets
2417
- * passed without a wrapper, but the purpose of this helper function is to
2418
- * abstract away the particular structure of children.
2419
- *
2420
- * @param {?object} children Child collection structure.
2421
- * @return {ReactElement} The first and only `ReactElement` contained in the
2422
- * structure.
2423
- */
2424
- function onlyChild(children) {
2425
- !isValidElement(children) ? invariant(false, 'React.Children.only expected to receive a single React element child.') : void 0;
2426
- return children;
2427
- }
2428
-
2429
- function createContext(defaultValue, calculateChangedBits) {
2430
- if (calculateChangedBits === undefined) {
2431
- calculateChangedBits = null;
2432
- } else {
2433
- {
2434
- !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warning(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
2435
- }
2436
- }
2437
-
2438
- var context = {
2439
- $$typeof: REACT_CONTEXT_TYPE,
2440
- _calculateChangedBits: calculateChangedBits,
2441
- _defaultValue: defaultValue,
2442
- _currentValue: defaultValue,
2443
- // As a workaround to support multiple concurrent renderers, we categorize
2444
- // some renderers as primary and others as secondary. We only expect
2445
- // there to be two concurrent renderers at most: React Native (primary) and
2446
- // Fabric (secondary); React DOM (primary) and React ART (secondary).
2447
- // Secondary renderers store their context values on separate fields.
2448
- _currentValue2: defaultValue,
2449
- _changedBits: 0,
2450
- _changedBits2: 0,
2451
- // These are circular
2452
- Provider: null,
2453
- Consumer: null
2454
- };
2455
-
2456
- context.Provider = {
2457
- $$typeof: REACT_PROVIDER_TYPE,
2458
- _context: context
2459
- };
2460
- context.Consumer = context;
2461
-
2462
- {
2463
- context._currentRenderer = null;
2464
- context._currentRenderer2 = null;
2465
- }
2466
-
2467
- return context;
2468
- }
2469
-
2470
- function forwardRef(render) {
2471
- {
2472
- !(typeof render === 'function') ? warning(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render) : void 0;
2473
-
2474
- if (render != null) {
2475
- !(render.defaultProps == null && render.propTypes == null) ? warning(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
2476
- }
2477
- }
2478
-
2479
- return {
2480
- $$typeof: REACT_FORWARD_REF_TYPE,
2481
- render: render
2482
- };
2483
- }
2484
-
2485
- var describeComponentFrame = function (name, source, ownerName) {
2486
- return '\n in ' + (name || 'Unknown') + (source ? ' (at ' + source.fileName.replace(/^.*[\\\/]/, '') + ':' + source.lineNumber + ')' : ownerName ? ' (created by ' + ownerName + ')' : '');
2487
- };
2488
-
2489
- function isValidElementType(type) {
2490
- return typeof type === 'string' || typeof type === 'function' ||
2491
- // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
2492
- type === REACT_FRAGMENT_TYPE || type === REACT_ASYNC_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_TIMEOUT_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE);
2493
- }
2494
-
2495
- function getComponentName(fiber) {
2496
- var type = fiber.type;
2497
-
2498
- if (typeof type === 'function') {
2499
- return type.displayName || type.name;
2500
- }
2501
- if (typeof type === 'string') {
2502
- return type;
2503
- }
2504
- switch (type) {
2505
- case REACT_ASYNC_MODE_TYPE:
2506
- return 'AsyncMode';
2507
- case REACT_CONTEXT_TYPE:
2508
- return 'Context.Consumer';
2509
- case REACT_FRAGMENT_TYPE:
2510
- return 'ReactFragment';
2511
- case REACT_PORTAL_TYPE:
2512
- return 'ReactPortal';
2513
- case REACT_PROFILER_TYPE:
2514
- return 'Profiler(' + fiber.pendingProps.id + ')';
2515
- case REACT_PROVIDER_TYPE:
2516
- return 'Context.Provider';
2517
- case REACT_STRICT_MODE_TYPE:
2518
- return 'StrictMode';
2519
- case REACT_TIMEOUT_TYPE:
2520
- return 'Timeout';
2521
- }
2522
- if (typeof type === 'object' && type !== null) {
2523
- switch (type.$$typeof) {
2524
- case REACT_FORWARD_REF_TYPE:
2525
- var functionName = type.render.displayName || type.render.name || '';
2526
- return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
2527
- }
2528
- }
2529
- return null;
2530
- }
2531
-
2532
- /**
2533
- * ReactElementValidator provides a wrapper around a element factory
2534
- * which validates the props passed to the element. This is intended to be
2535
- * used only in DEV and could be replaced by a static type checker for languages
2536
- * that support it.
2537
- */
2538
-
2539
- var currentlyValidatingElement = void 0;
2540
- var propTypesMisspellWarningShown = void 0;
2541
-
2542
- var getDisplayName = function () {};
2543
- var getStackAddendum = function () {};
2544
-
2545
- {
2546
- currentlyValidatingElement = null;
2547
-
2548
- propTypesMisspellWarningShown = false;
2549
-
2550
- getDisplayName = function (element) {
2551
- if (element == null) {
2552
- return '#empty';
2553
- } else if (typeof element === 'string' || typeof element === 'number') {
2554
- return '#text';
2555
- } else if (typeof element.type === 'string') {
2556
- return element.type;
2557
- } else if (element.type === REACT_FRAGMENT_TYPE) {
2558
- return 'React.Fragment';
2559
- } else {
2560
- return element.type.displayName || element.type.name || 'Unknown';
2561
- }
2562
- };
2563
-
2564
- getStackAddendum = function () {
2565
- var stack = '';
2566
- if (currentlyValidatingElement) {
2567
- var name = getDisplayName(currentlyValidatingElement);
2568
- var owner = currentlyValidatingElement._owner;
2569
- stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner));
2570
- }
2571
- stack += ReactDebugCurrentFrame.getStackAddendum() || '';
2572
- return stack;
2573
- };
2574
- }
2575
-
2576
- function getDeclarationErrorAddendum() {
2577
- if (ReactCurrentOwner.current) {
2578
- var name = getComponentName(ReactCurrentOwner.current);
2579
- if (name) {
2580
- return '\n\nCheck the render method of `' + name + '`.';
2581
- }
2582
- }
2583
- return '';
2584
- }
2585
-
2586
- function getSourceInfoErrorAddendum(elementProps) {
2587
- if (elementProps !== null && elementProps !== undefined && elementProps.__source !== undefined) {
2588
- var source = elementProps.__source;
2589
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2590
- var lineNumber = source.lineNumber;
2591
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2592
- }
2593
- return '';
2594
- }
2595
-
2596
- /**
2597
- * Warn if there's no key explicitly set on dynamic arrays of children or
2598
- * object keys are not valid. This allows us to keep track of children between
2599
- * updates.
2600
- */
2601
- var ownerHasKeyUseWarning = {};
2602
-
2603
- function getCurrentComponentErrorInfo(parentType) {
2604
- var info = getDeclarationErrorAddendum();
2605
-
2606
- if (!info) {
2607
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2608
- if (parentName) {
2609
- info = '\n\nCheck the top-level render call using <' + parentName + '>.';
2610
- }
2611
- }
2612
- return info;
2613
- }
2614
-
2615
- /**
2616
- * Warn if the element doesn't have an explicit key assigned to it.
2617
- * This element is in an array. The array could grow and shrink or be
2618
- * reordered. All children that haven't already been validated are required to
2619
- * have a "key" property assigned to it. Error statuses are cached so a warning
2620
- * will only be shown once.
2621
- *
2622
- * @internal
2623
- * @param {ReactElement} element Element that requires a key.
2624
- * @param {*} parentType element's parent's type.
2625
- */
2626
- function validateExplicitKey(element, parentType) {
2627
- if (!element._store || element._store.validated || element.key != null) {
2628
- return;
2629
- }
2630
- element._store.validated = true;
2631
-
2632
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2633
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2634
- return;
2635
- }
2636
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
2637
-
2638
- // Usually the current owner is the offender, but if it accepts children as a
2639
- // property, it may be the creator of the child that's responsible for
2640
- // assigning it a key.
2641
- var childOwner = '';
2642
- if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2643
- // Give the component that originally created this child.
2644
- childOwner = ' It was passed a child from ' + getComponentName(element._owner) + '.';
2645
- }
2646
-
2647
- currentlyValidatingElement = element;
2648
- {
2649
- warning(false, 'Each child in an array or iterator should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.%s', currentComponentErrorInfo, childOwner, getStackAddendum());
2650
- }
2651
- currentlyValidatingElement = null;
2652
- }
2653
-
2654
- /**
2655
- * Ensure that every element either is passed in a static location, in an
2656
- * array with an explicit keys property defined, or in an object literal
2657
- * with valid key property.
2658
- *
2659
- * @internal
2660
- * @param {ReactNode} node Statically passed child of any type.
2661
- * @param {*} parentType node's parent's type.
2662
- */
2663
- function validateChildKeys(node, parentType) {
2664
- if (typeof node !== 'object') {
2665
- return;
2666
- }
2667
- if (Array.isArray(node)) {
2668
- for (var i = 0; i < node.length; i++) {
2669
- var child = node[i];
2670
- if (isValidElement(child)) {
2671
- validateExplicitKey(child, parentType);
2672
- }
2673
- }
2674
- } else if (isValidElement(node)) {
2675
- // This element was passed in a valid location.
2676
- if (node._store) {
2677
- node._store.validated = true;
2678
- }
2679
- } else if (node) {
2680
- var iteratorFn = getIteratorFn(node);
2681
- if (typeof iteratorFn === 'function') {
2682
- // Entry iterators used to provide implicit keys,
2683
- // but now we print a separate warning for them later.
2684
- if (iteratorFn !== node.entries) {
2685
- var iterator = iteratorFn.call(node);
2686
- var step = void 0;
2687
- while (!(step = iterator.next()).done) {
2688
- if (isValidElement(step.value)) {
2689
- validateExplicitKey(step.value, parentType);
2690
- }
2691
- }
2692
- }
2693
- }
2694
- }
2695
- }
2696
-
2697
- /**
2698
- * Given an element, validate that its props follow the propTypes definition,
2699
- * provided by the type.
2700
- *
2701
- * @param {ReactElement} element
2702
- */
2703
- function validatePropTypes(element) {
2704
- var componentClass = element.type;
2705
- if (typeof componentClass !== 'function') {
2706
- return;
2707
- }
2708
- var name = componentClass.displayName || componentClass.name;
2709
- var propTypes = componentClass.propTypes;
2710
- if (propTypes) {
2711
- currentlyValidatingElement = element;
2712
- checkPropTypes(propTypes, element.props, 'prop', name, getStackAddendum);
2713
- currentlyValidatingElement = null;
2714
- } else if (componentClass.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2715
- propTypesMisspellWarningShown = true;
2716
- warning(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
2717
- }
2718
- if (typeof componentClass.getDefaultProps === 'function') {
2719
- !componentClass.getDefaultProps.isReactClassApproved ? warning(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
2720
- }
2721
- }
2722
-
2723
- /**
2724
- * Given a fragment, validate that it can only be provided with fragment props
2725
- * @param {ReactElement} fragment
2726
- */
2727
- function validateFragmentProps(fragment) {
2728
- currentlyValidatingElement = fragment;
2729
-
2730
- var keys = Object.keys(fragment.props);
2731
- for (var i = 0; i < keys.length; i++) {
2732
- var key = keys[i];
2733
- if (key !== 'children' && key !== 'key') {
2734
- warning(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.%s', key, getStackAddendum());
2735
- break;
2736
- }
2737
- }
2738
-
2739
- if (fragment.ref !== null) {
2740
- warning(false, 'Invalid attribute `ref` supplied to `React.Fragment`.%s', getStackAddendum());
2741
- }
2742
-
2743
- currentlyValidatingElement = null;
2744
- }
2745
-
2746
- function createElementWithValidation(type, props, children) {
2747
- var validType = isValidElementType(type);
2748
-
2749
- // We warn in this case but don't throw. We expect the element creation to
2750
- // succeed and there will likely be errors in render.
2751
- if (!validType) {
2752
- var info = '';
2753
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2754
- 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.";
2755
- }
2756
-
2757
- var sourceInfo = getSourceInfoErrorAddendum(props);
2758
- if (sourceInfo) {
2759
- info += sourceInfo;
2760
- } else {
2761
- info += getDeclarationErrorAddendum();
2762
- }
2763
-
2764
- info += getStackAddendum() || '';
2765
-
2766
- var typeString = void 0;
2767
- if (type === null) {
2768
- typeString = 'null';
2769
- } else if (Array.isArray(type)) {
2770
- typeString = 'array';
2771
- } else {
2772
- typeString = typeof type;
2773
- }
2774
-
2775
- warning(false, '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);
2776
- }
2777
-
2778
- var element = createElement.apply(this, arguments);
2779
-
2780
- // The result can be nullish if a mock or a custom function is used.
2781
- // TODO: Drop this when these are no longer allowed as the type argument.
2782
- if (element == null) {
2783
- return element;
2784
- }
2785
-
2786
- // Skip key warning if the type isn't valid since our key validation logic
2787
- // doesn't expect a non-string/function type and can throw confusing errors.
2788
- // We don't want exception behavior to differ between dev and prod.
2789
- // (Rendering will throw with a helpful message and as soon as the type is
2790
- // fixed, the key warnings will appear.)
2791
- if (validType) {
2792
- for (var i = 2; i < arguments.length; i++) {
2793
- validateChildKeys(arguments[i], type);
2794
- }
2795
- }
2796
-
2797
- if (type === REACT_FRAGMENT_TYPE) {
2798
- validateFragmentProps(element);
2799
- } else {
2800
- validatePropTypes(element);
2801
- }
2802
-
2803
- return element;
2804
- }
2805
-
2806
- function createFactoryWithValidation(type) {
2807
- var validatedFactory = createElementWithValidation.bind(null, type);
2808
- validatedFactory.type = type;
2809
- // Legacy hook: remove it
2810
- {
2811
- Object.defineProperty(validatedFactory, 'type', {
2812
- enumerable: false,
2813
- get: function () {
2814
- lowPriorityWarning$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2815
- Object.defineProperty(this, 'type', {
2816
- value: type
2817
- });
2818
- return type;
2819
- }
2820
- });
2821
- }
2822
-
2823
- return validatedFactory;
2824
- }
2825
-
2826
- function cloneElementWithValidation(element, props, children) {
2827
- var newElement = cloneElement.apply(this, arguments);
2828
- for (var i = 2; i < arguments.length; i++) {
2829
- validateChildKeys(arguments[i], newElement.type);
2830
- }
2831
- validatePropTypes(newElement);
2832
- return newElement;
2833
- }
2834
-
2835
- var React = {
2836
- Children: {
2837
- map: mapChildren,
2838
- forEach: forEachChildren,
2839
- count: countChildren,
2840
- toArray: toArray,
2841
- only: onlyChild
2842
- },
2843
-
2844
- createRef: createRef,
2845
- Component: Component,
2846
- PureComponent: PureComponent,
2847
-
2848
- createContext: createContext,
2849
- forwardRef: forwardRef,
2850
-
2851
- Fragment: REACT_FRAGMENT_TYPE,
2852
- StrictMode: REACT_STRICT_MODE_TYPE,
2853
- unstable_AsyncMode: REACT_ASYNC_MODE_TYPE,
2854
- unstable_Profiler: REACT_PROFILER_TYPE,
2855
-
2856
- createElement: createElementWithValidation,
2857
- cloneElement: cloneElementWithValidation,
2858
- createFactory: createFactoryWithValidation,
2859
- isValidElement: isValidElement,
2860
-
2861
- version: ReactVersion,
2862
-
2863
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
2864
- ReactCurrentOwner: ReactCurrentOwner,
2865
- // Used by renderers to avoid bundling object-assign twice in UMD bundles:
2866
- assign: _assign
2867
- }
2868
- };
2869
-
2870
- if (enableSuspense) {
2871
- React.Timeout = REACT_TIMEOUT_TYPE;
2872
- }
2873
-
2874
- {
2875
- _assign(React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, {
2876
- // These should not be included in production.
2877
- ReactDebugCurrentFrame: ReactDebugCurrentFrame,
2878
- // Shim for React DOM 16.0.0 which still destructured (but not used) this.
2879
- // TODO: remove in React 17.0.
2880
- ReactComponentTreeHook: {}
2881
- });
2882
- }
2883
-
2884
-
2885
-
2886
- var React$2 = Object.freeze({
2887
- default: React
2888
- });
2889
-
2890
- var React$3 = ( React$2 && React ) || React$2;
2891
-
2892
- // TODO: decide on the top-level export form.
2893
- // This is hacky but makes it work with both Rollup and Jest.
2894
- var react = React$3.default ? React$3.default : React$3;
2895
-
2896
- module.exports = react;
2897
- })();
2898
- }
2899
-
2900
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
2901
-
2902
- /***/ }),
2903
- /* 14 */
2904
- /***/ (function(module, exports, __webpack_require__) {
2905
-
2906
- "use strict";
2907
- /** @license React v16.4.0
2908
- * react.production.min.js
2909
- *
2910
- * Copyright (c) 2013-present, Facebook, Inc.
2911
- *
2912
- * This source code is licensed under the MIT license found in the
2913
- * LICENSE file in the root directory of this source tree.
2914
- */
2915
-
2916
- var k=__webpack_require__(7),n=__webpack_require__(2),p=__webpack_require__(5),q=__webpack_require__(1),r="function"===typeof Symbol&&Symbol.for,t=r?Symbol.for("react.element"):60103,u=r?Symbol.for("react.portal"):60106,v=r?Symbol.for("react.fragment"):60107,w=r?Symbol.for("react.strict_mode"):60108,x=r?Symbol.for("react.profiler"):60114,y=r?Symbol.for("react.provider"):60109,z=r?Symbol.for("react.context"):60110,A=r?Symbol.for("react.async_mode"):60111,B=
2917
- r?Symbol.for("react.forward_ref"):60112;r&&Symbol.for("react.timeout");var C="function"===typeof Symbol&&Symbol.iterator;function D(a){for(var b=arguments.length-1,e="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)e+="&args[]="+encodeURIComponent(arguments[c+1]);n(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",e)}
2918
- var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function F(a,b,e){this.props=a;this.context=b;this.refs=p;this.updater=e||E}F.prototype.isReactComponent={};F.prototype.setState=function(a,b){"object"!==typeof a&&"function"!==typeof a&&null!=a?D("85"):void 0;this.updater.enqueueSetState(this,a,b,"setState")};F.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function G(){}
2919
- G.prototype=F.prototype;function H(a,b,e){this.props=a;this.context=b;this.refs=p;this.updater=e||E}var I=H.prototype=new G;I.constructor=H;k(I,F.prototype);I.isPureReactComponent=!0;var J={current:null},K=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};
2920
- function M(a,b,e){var c=void 0,d={},g=null,h=null;if(null!=b)for(c in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(g=""+b.key),b)K.call(b,c)&&!L.hasOwnProperty(c)&&(d[c]=b[c]);var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){for(var l=Array(f),m=0;m<f;m++)l[m]=arguments[m+2];d.children=l}if(a&&a.defaultProps)for(c in f=a.defaultProps,f)void 0===d[c]&&(d[c]=f[c]);return{$$typeof:t,type:a,key:g,ref:h,props:d,_owner:J.current}}
2921
- function N(a){return"object"===typeof a&&null!==a&&a.$$typeof===t}function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var O=/\/+/g,P=[];function Q(a,b,e,c){if(P.length){var d=P.pop();d.result=a;d.keyPrefix=b;d.func=e;d.context=c;d.count=0;return d}return{result:a,keyPrefix:b,func:e,context:c,count:0}}function R(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>P.length&&P.push(a)}
2922
- function S(a,b,e,c){var d=typeof a;if("undefined"===d||"boolean"===d)a=null;var g=!1;if(null===a)g=!0;else switch(d){case "string":case "number":g=!0;break;case "object":switch(a.$$typeof){case t:case u:g=!0}}if(g)return e(c,a,""===b?"."+T(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var h=0;h<a.length;h++){d=a[h];var f=b+T(d,h);g+=S(d,f,e,c)}else if(null===a||"undefined"===typeof a?f=null:(f=C&&a[C]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),
2923
- h=0;!(d=a.next()).done;)d=d.value,f=b+T(d,h++),g+=S(d,f,e,c);else"object"===d&&(e=""+a,D("31","[object Object]"===e?"object with keys {"+Object.keys(a).join(", ")+"}":e,""));return g}function T(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function U(a,b){a.func.call(a.context,b,a.count++)}
2924
- function V(a,b,e){var c=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?W(a,c,e,q.thatReturnsArgument):null!=a&&(N(a)&&(b=d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+e,a={$$typeof:t,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}),c.push(a))}function W(a,b,e,c,d){var g="";null!=e&&(g=(""+e).replace(O,"$&/")+"/");b=Q(b,g,c,d);null==a||S(a,"",V,b);R(b)}
2925
- var X={Children:{map:function(a,b,e){if(null==a)return a;var c=[];W(a,c,null,b,e);return c},forEach:function(a,b,e){if(null==a)return a;b=Q(null,null,b,e);null==a||S(a,"",U,b);R(b)},count:function(a){return null==a?0:S(a,"",q.thatReturnsNull,null)},toArray:function(a){var b=[];W(a,b,null,q.thatReturnsArgument);return b},only:function(a){N(a)?void 0:D("143");return a}},createRef:function(){return{current:null}},Component:F,PureComponent:H,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:z,
2926
- _calculateChangedBits:b,_defaultValue:a,_currentValue:a,_currentValue2:a,_changedBits:0,_changedBits2:0,Provider:null,Consumer:null};a.Provider={$$typeof:y,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:B,render:a}},Fragment:v,StrictMode:w,unstable_AsyncMode:A,unstable_Profiler:x,createElement:M,cloneElement:function(a,b,e){null===a||void 0===a?D("267",a):void 0;var c=void 0,d=k({},a.props),g=a.key,h=a.ref,f=a._owner;if(null!=b){void 0!==b.ref&&(h=b.ref,f=J.current);void 0!==
2927
- b.key&&(g=""+b.key);var l=void 0;a.type&&a.type.defaultProps&&(l=a.type.defaultProps);for(c in b)K.call(b,c)&&!L.hasOwnProperty(c)&&(d[c]=void 0===b[c]&&void 0!==l?l[c]:b[c])}c=arguments.length-2;if(1===c)d.children=e;else if(1<c){l=Array(c);for(var m=0;m<c;m++)l[m]=arguments[m+2];d.children=l}return{$$typeof:t,type:a.type,key:g,ref:h,props:d,_owner:f}},createFactory:function(a){var b=M.bind(null,a);b.type=a;return b},isValidElement:N,version:"16.4.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:J,
2928
- assign:k}},Y={default:X},Z=Y&&X||Y;module.exports=Z.default?Z.default:Z;
2929
-
2930
-
2931
- /***/ }),
2932
- /* 15 */
2933
- /***/ (function(module, exports, __webpack_require__) {
2934
-
2935
- "use strict";
2936
- /* WEBPACK VAR INJECTION */(function(process) {
2937
-
2938
- if (process.env.NODE_ENV === 'production') {
2939
- module.exports = __webpack_require__(14);
2940
- } else {
2941
- module.exports = __webpack_require__(13);
2942
- }
2943
-
2944
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0)))
2945
-
2946
- /***/ })
2947
- /******/ ]);
2948
- });