AdSense Plugin WP QUADS - Version 2.0.2

Version Description

Download this release

Release Info

Developer wpquads
Plugin Icon 128x128 AdSense Plugin WP QUADS
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

Files changed (3) hide show
  1. README.md +36 -36
  2. admin/assets/js/.babelrc +10 -10
  3. admin/assets/js/dist/adminscript.js +2887 -24069
README.md CHANGED
@@ -1,36 +1,36 @@
1
- # [WP QUADS (Quick AdSense Reloaded)](https://wordpress.org/support/plugin/quick-adsense-reloaded)
2
-
3
- ### Welcome to WP QUADS GitHub Repository
4
-
5
- A further development of Quick Adsense! Insert Google AdSense or any Ads code into your website.
6
-
7
- More information can be found at [wordpress.org](https://wordpress.org/support/plugin/quick-adsense-reloaded).
8
-
9
- ## Note ##
10
-
11
- This is the latest developer version of WP QUADS.
12
- if you just want to use WP QUADS install the productive version which you get at [wordpress.org](https://wordpress.org/support/plugin/quick-adsense-reloaded)
13
-
14
- ## Installation ##
15
-
16
- 1. You can clone the GitHub repository: `https://github.com/rene-hermenau/quick-adsense-reloaded.git`
17
- 2. Or download it directly as a ZIP file: `https://github.com/rene-hermenau/quick-adsense-reloaded/archive/master.zip`
18
-
19
- This will download the latest developer copy of Quick AdSense Reloaded.
20
-
21
- ## Bugs ##
22
- If you find an issue, let us know [here](https://github.com/rene-hermenau/quick-adsense-reloaded/issues)!
23
-
24
- ## Support ##
25
- This is a developer's portal for WP QUADS and should _not_ be used for support.
26
- Please visit the [support forums](https://wordpress.org/support/plugin/quick-adsense-reloaded/).
27
-
28
- ## Contributions ##
29
- Anyone is welcome to contribute to WP QUADS. Please read the [guidelines for contributing](https://github.com/rene-hermenau/quick-adsense-reloaded/blob/master/CONTRIBUTING.md) to this repository.
30
-
31
- There are various ways you can contribute:
32
-
33
- 1. Raise an [Issue](https://github.com/rene-hermenau/quick-adsense-reloaded/issues) on GitHub
34
- 2. Send us a Pull Request with your bug fixes and/or new features to the dev branch
35
- 3. Translate WP QUADS into different languages
36
- 4. Provide feedback and suggestions on [enhancements](https://github.com/rene-hermenau/quick-adsense-reloaded/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open)
1
+ # [WP QUADS (Quick AdSense Reloaded)](https://wordpress.org/support/plugin/quick-adsense-reloaded)
2
+
3
+ ### Welcome to WP QUADS GitHub Repository
4
+
5
+ A further development of Quick Adsense! Insert Google AdSense or any Ads code into your website.
6
+
7
+ More information can be found at [wordpress.org](https://wordpress.org/support/plugin/quick-adsense-reloaded).
8
+
9
+ ## Note ##
10
+
11
+ This is the latest developer version of WP QUADS.
12
+ if you just want to use WP QUADS install the productive version which you get at [wordpress.org](https://wordpress.org/support/plugin/quick-adsense-reloaded)
13
+
14
+ ## Installation ##
15
+
16
+ 1. You can clone the GitHub repository: `https://github.com/rene-hermenau/quick-adsense-reloaded.git`
17
+ 2. Or download it directly as a ZIP file: `https://github.com/rene-hermenau/quick-adsense-reloaded/archive/master.zip`
18
+
19
+ This will download the latest developer copy of Quick AdSense Reloaded.
20
+
21
+ ## Bugs ##
22
+ If you find an issue, let us know [here](https://github.com/rene-hermenau/quick-adsense-reloaded/issues)!
23
+
24
+ ## Support ##
25
+ This is a developer's portal for WP QUADS and should _not_ be used for support.
26
+ Please visit the [support forums](https://wordpress.org/support/plugin/quick-adsense-reloaded/).
27
+
28
+ ## Contributions ##
29
+ Anyone is welcome to contribute to WP QUADS. Please read the [guidelines for contributing](https://github.com/rene-hermenau/quick-adsense-reloaded/blob/master/CONTRIBUTING.md) to this repository.
30
+
31
+ There are various ways you can contribute:
32
+
33
+ 1. Raise an [Issue](https://github.com/rene-hermenau/quick-adsense-reloaded/issues) on GitHub
34
+ 2. Send us a Pull Request with your bug fixes and/or new features to the dev branch
35
+ 3. Translate WP QUADS into different languages
36
+ 4. Provide feedback and suggestions on [enhancements](https://github.com/rene-hermenau/quick-adsense-reloaded/issues?direction=desc&labels=Enhancement&page=1&sort=created&state=open)
admin/assets/js/.babelrc CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env",
4
- "@babel/preset-react"
5
- ],
6
- "plugins": [
7
- [
8
- "@babel/plugin-proposal-class-properties"
9
- ]
10
- ]
11
  }
1
+ {
2
+ "presets": [
3
+ "@babel/preset-env",
4
+ "@babel/preset-react"
5
+ ],
6
+ "plugins": [
7
+ [
8
+ "@babel/plugin-proposal-class-properties"
9
+ ]
10
+ ]
11
  }
admin/assets/js/dist/adminscript.js CHANGED
@@ -68,13 +68,13 @@
68
  /***/ (function(module, exports, __webpack_require__) {
69
 
70
  "use strict";
71
- /* WEBPACK VAR INJECTION */(function(process) {
72
-
73
- if (process.env.NODE_ENV === 'production') {
74
- module.exports = __webpack_require__(297);
75
- } else {
76
- module.exports = __webpack_require__(298);
77
- }
78
 
79
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
80
 
@@ -82,215 +82,215 @@ if (process.env.NODE_ENV === 'production') {
82
  /* 1 */
83
  /***/ (function(module, exports) {
84
 
85
- // shim for using process in browser
86
- var process = module.exports = {};
87
-
88
- // cached from whatever global is present so that test runners that stub it
89
- // don't break things. But we need to wrap it in a try catch in case it is
90
- // wrapped in strict mode code which doesn't define any globals. It's inside a
91
- // function because try/catches deoptimize in certain engines.
92
-
93
- var cachedSetTimeout;
94
- var cachedClearTimeout;
95
-
96
- function defaultSetTimout() {
97
- throw new Error('setTimeout has not been defined');
98
- }
99
- function defaultClearTimeout () {
100
- throw new Error('clearTimeout has not been defined');
101
- }
102
- (function () {
103
- try {
104
- if (typeof setTimeout === 'function') {
105
- cachedSetTimeout = setTimeout;
106
- } else {
107
- cachedSetTimeout = defaultSetTimout;
108
- }
109
- } catch (e) {
110
- cachedSetTimeout = defaultSetTimout;
111
- }
112
- try {
113
- if (typeof clearTimeout === 'function') {
114
- cachedClearTimeout = clearTimeout;
115
- } else {
116
- cachedClearTimeout = defaultClearTimeout;
117
- }
118
- } catch (e) {
119
- cachedClearTimeout = defaultClearTimeout;
120
- }
121
- } ())
122
- function runTimeout(fun) {
123
- if (cachedSetTimeout === setTimeout) {
124
- //normal enviroments in sane situations
125
- return setTimeout(fun, 0);
126
- }
127
- // if setTimeout wasn't available but was latter defined
128
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
129
- cachedSetTimeout = setTimeout;
130
- return setTimeout(fun, 0);
131
- }
132
- try {
133
- // when when somebody has screwed with setTimeout but no I.E. maddness
134
- return cachedSetTimeout(fun, 0);
135
- } catch(e){
136
- try {
137
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
138
- return cachedSetTimeout.call(null, fun, 0);
139
- } catch(e){
140
- // 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
141
- return cachedSetTimeout.call(this, fun, 0);
142
- }
143
- }
144
-
145
-
146
- }
147
- function runClearTimeout(marker) {
148
- if (cachedClearTimeout === clearTimeout) {
149
- //normal enviroments in sane situations
150
- return clearTimeout(marker);
151
- }
152
- // if clearTimeout wasn't available but was latter defined
153
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
154
- cachedClearTimeout = clearTimeout;
155
- return clearTimeout(marker);
156
- }
157
- try {
158
- // when when somebody has screwed with setTimeout but no I.E. maddness
159
- return cachedClearTimeout(marker);
160
- } catch (e){
161
- try {
162
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
163
- return cachedClearTimeout.call(null, marker);
164
- } catch (e){
165
- // 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.
166
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
167
- return cachedClearTimeout.call(this, marker);
168
- }
169
- }
170
-
171
-
172
-
173
- }
174
- var queue = [];
175
- var draining = false;
176
- var currentQueue;
177
- var queueIndex = -1;
178
-
179
- function cleanUpNextTick() {
180
- if (!draining || !currentQueue) {
181
- return;
182
- }
183
- draining = false;
184
- if (currentQueue.length) {
185
- queue = currentQueue.concat(queue);
186
- } else {
187
- queueIndex = -1;
188
- }
189
- if (queue.length) {
190
- drainQueue();
191
- }
192
- }
193
-
194
- function drainQueue() {
195
- if (draining) {
196
- return;
197
- }
198
- var timeout = runTimeout(cleanUpNextTick);
199
- draining = true;
200
-
201
- var len = queue.length;
202
- while(len) {
203
- currentQueue = queue;
204
- queue = [];
205
- while (++queueIndex < len) {
206
- if (currentQueue) {
207
- currentQueue[queueIndex].run();
208
- }
209
- }
210
- queueIndex = -1;
211
- len = queue.length;
212
- }
213
- currentQueue = null;
214
- draining = false;
215
- runClearTimeout(timeout);
216
- }
217
-
218
- process.nextTick = function (fun) {
219
- var args = new Array(arguments.length - 1);
220
- if (arguments.length > 1) {
221
- for (var i = 1; i < arguments.length; i++) {
222
- args[i - 1] = arguments[i];
223
- }
224
- }
225
- queue.push(new Item(fun, args));
226
- if (queue.length === 1 && !draining) {
227
- runTimeout(drainQueue);
228
- }
229
- };
230
-
231
- // v8 likes predictible objects
232
- function Item(fun, array) {
233
- this.fun = fun;
234
- this.array = array;
235
- }
236
- Item.prototype.run = function () {
237
- this.fun.apply(null, this.array);
238
- };
239
- process.title = 'browser';
240
- process.browser = true;
241
- process.env = {};
242
- process.argv = [];
243
- process.version = ''; // empty string to avoid regexp issues
244
- process.versions = {};
245
-
246
- function noop() {}
247
-
248
- process.on = noop;
249
- process.addListener = noop;
250
- process.once = noop;
251
- process.off = noop;
252
- process.removeListener = noop;
253
- process.removeAllListeners = noop;
254
- process.emit = noop;
255
- process.prependListener = noop;
256
- process.prependOnceListener = noop;
257
-
258
- process.listeners = function (name) { return [] }
259
-
260
- process.binding = function (name) {
261
- throw new Error('process.binding is not supported');
262
- };
263
-
264
- process.cwd = function () { return '/' };
265
- process.chdir = function (dir) {
266
- throw new Error('process.chdir is not supported');
267
- };
268
- process.umask = function() { return 0; };
269
 
270
 
271
  /***/ }),
272
  /* 2 */
273
  /***/ (function(module, exports, __webpack_require__) {
274
 
275
- /* WEBPACK VAR INJECTION */(function(process) {/**
276
- * Copyright (c) 2013-present, Facebook, Inc.
277
- *
278
- * This source code is licensed under the MIT license found in the
279
- * LICENSE file in the root directory of this source tree.
280
- */
281
-
282
- if (process.env.NODE_ENV !== 'production') {
283
- var ReactIs = __webpack_require__(14);
284
-
285
- // By explicitly using `prop-types` you are opting into new development behavior.
286
- // http://fb.me/prop-types-in-prod
287
- var throwOnDirectAccess = true;
288
- module.exports = __webpack_require__(309)(ReactIs.isElement, throwOnDirectAccess);
289
- } else {
290
- // By explicitly using `prop-types` you are opting into new production behavior.
291
- // http://fb.me/prop-types-in-prod
292
- module.exports = __webpack_require__(310)();
293
- }
294
 
295
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
296
 
@@ -300,22 +300,22 @@ if (process.env.NODE_ENV !== 'production') {
300
 
301
  "use strict";
302
  /* harmony export (immutable) */ __webpack_exports__["a"] = _extends;
303
- function _extends() {
304
- _extends = Object.assign || function (target) {
305
- for (var i = 1; i < arguments.length; i++) {
306
- var source = arguments[i];
307
-
308
- for (var key in source) {
309
- if (Object.prototype.hasOwnProperty.call(source, key)) {
310
- target[key] = source[key];
311
- }
312
- }
313
- }
314
-
315
- return target;
316
- };
317
-
318
- return _extends.apply(this, arguments);
319
  }
320
 
321
  /***/ }),
@@ -325,24 +325,24 @@ function _extends() {
325
  "use strict";
326
  /* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutProperties;
327
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__objectWithoutPropertiesLoose__ = __webpack_require__(25);
328
-
329
- function _objectWithoutProperties(source, excluded) {
330
- if (source == null) return {};
331
- var target = Object(__WEBPACK_IMPORTED_MODULE_0__objectWithoutPropertiesLoose__["a" /* default */])(source, excluded);
332
- var key, i;
333
-
334
- if (Object.getOwnPropertySymbols) {
335
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
336
-
337
- for (i = 0; i < sourceSymbolKeys.length; i++) {
338
- key = sourceSymbolKeys[i];
339
- if (excluded.indexOf(key) >= 0) continue;
340
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
341
- target[key] = source[key];
342
- }
343
- }
344
-
345
- return target;
346
  }
347
 
348
  /***/ }),
@@ -524,44 +524,44 @@ function capitalize(string) {
524
  /***/ (function(module, exports, __webpack_require__) {
525
 
526
  "use strict";
527
- /* WEBPACK VAR INJECTION */(function(process) {
528
-
529
- function checkDCE() {
530
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
531
- if (
532
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
533
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
534
- ) {
535
- return;
536
- }
537
- if (process.env.NODE_ENV !== 'production') {
538
- // This branch is unreachable because this function is only called
539
- // in production, but the condition is true only in development.
540
- // Therefore if the branch is still here, dead code elimination wasn't
541
- // properly applied.
542
- // Don't change the message. React DevTools relies on it. Also make sure
543
- // this message doesn't occur elsewhere in this function, or it will cause
544
- // a false positive.
545
- throw new Error('^_^');
546
- }
547
- try {
548
- // Verify that the code above has been dead code eliminated (DCE'd).
549
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
550
- } catch (err) {
551
- // DevTools shouldn't crash React, no matter what.
552
- // We should still report in case we break this code.
553
- console.error(err);
554
- }
555
- }
556
-
557
- if (process.env.NODE_ENV === 'production') {
558
- // DCE check should happen before ReactDOM bundle executes so that
559
- // DevTools can report bad minification during injection.
560
- checkDCE();
561
- module.exports = __webpack_require__(299);
562
- } else {
563
- module.exports = __webpack_require__(302);
564
- }
565
 
566
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
567
 
@@ -600,19 +600,19 @@ function useForkRef(refA, refB) {
600
 
601
  "use strict";
602
  /* harmony export (immutable) */ __webpack_exports__["a"] = _defineProperty;
603
- function _defineProperty(obj, key, value) {
604
- if (key in obj) {
605
- Object.defineProperty(obj, key, {
606
- value: value,
607
- enumerable: true,
608
- configurable: true,
609
- writable: true
610
- });
611
- } else {
612
- obj[key] = value;
613
- }
614
-
615
- return obj;
616
  }
617
 
618
  /***/ }),
@@ -645,13 +645,13 @@ function useTheme() {
645
  /***/ (function(module, exports, __webpack_require__) {
646
 
647
  "use strict";
648
- /* WEBPACK VAR INJECTION */(function(process) {
649
-
650
- if (process.env.NODE_ENV === 'production') {
651
- module.exports = __webpack_require__(307);
652
- } else {
653
- module.exports = __webpack_require__(308);
654
- }
655
 
656
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
657
 
@@ -1020,11 +1020,11 @@ function lighten(color, coefficient) {
1020
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__ = __webpack_require__(360);
1021
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArray__ = __webpack_require__(143);
1022
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nonIterableSpread__ = __webpack_require__(361);
1023
-
1024
-
1025
-
1026
- function _toConsumableArray(arr) {
1027
- return Object(__WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__iterableToArray__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_2__nonIterableSpread__["a" /* default */])();
1028
  }
1029
 
1030
  /***/ }),
@@ -1175,211 +1175,211 @@ if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test' &&
1175
  /***/ (function(module, exports, __webpack_require__) {
1176
 
1177
  "use strict";
1178
-
1179
- var strictUriEncode = __webpack_require__(332);
1180
- var objectAssign = __webpack_require__(43);
1181
-
1182
- function encoderForArrayFormat(opts) {
1183
- switch (opts.arrayFormat) {
1184
- case 'index':
1185
- return function (key, value, index) {
1186
- return value === null ? [
1187
- encode(key, opts),
1188
- '[',
1189
- index,
1190
- ']'
1191
- ].join('') : [
1192
- encode(key, opts),
1193
- '[',
1194
- encode(index, opts),
1195
- ']=',
1196
- encode(value, opts)
1197
- ].join('');
1198
- };
1199
-
1200
- case 'bracket':
1201
- return function (key, value) {
1202
- return value === null ? encode(key, opts) : [
1203
- encode(key, opts),
1204
- '[]=',
1205
- encode(value, opts)
1206
- ].join('');
1207
- };
1208
-
1209
- default:
1210
- return function (key, value) {
1211
- return value === null ? encode(key, opts) : [
1212
- encode(key, opts),
1213
- '=',
1214
- encode(value, opts)
1215
- ].join('');
1216
- };
1217
- }
1218
- }
1219
-
1220
- function parserForArrayFormat(opts) {
1221
- var result;
1222
-
1223
- switch (opts.arrayFormat) {
1224
- case 'index':
1225
- return function (key, value, accumulator) {
1226
- result = /\[(\d*)\]$/.exec(key);
1227
-
1228
- key = key.replace(/\[\d*\]$/, '');
1229
-
1230
- if (!result) {
1231
- accumulator[key] = value;
1232
- return;
1233
- }
1234
-
1235
- if (accumulator[key] === undefined) {
1236
- accumulator[key] = {};
1237
- }
1238
-
1239
- accumulator[key][result[1]] = value;
1240
- };
1241
-
1242
- case 'bracket':
1243
- return function (key, value, accumulator) {
1244
- result = /(\[\])$/.exec(key);
1245
- key = key.replace(/\[\]$/, '');
1246
-
1247
- if (!result) {
1248
- accumulator[key] = value;
1249
- return;
1250
- } else if (accumulator[key] === undefined) {
1251
- accumulator[key] = [value];
1252
- return;
1253
- }
1254
-
1255
- accumulator[key] = [].concat(accumulator[key], value);
1256
- };
1257
-
1258
- default:
1259
- return function (key, value, accumulator) {
1260
- if (accumulator[key] === undefined) {
1261
- accumulator[key] = value;
1262
- return;
1263
- }
1264
-
1265
- accumulator[key] = [].concat(accumulator[key], value);
1266
- };
1267
- }
1268
- }
1269
-
1270
- function encode(value, opts) {
1271
- if (opts.encode) {
1272
- return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
1273
- }
1274
-
1275
- return value;
1276
- }
1277
-
1278
- function keysSorter(input) {
1279
- if (Array.isArray(input)) {
1280
- return input.sort();
1281
- } else if (typeof input === 'object') {
1282
- return keysSorter(Object.keys(input)).sort(function (a, b) {
1283
- return Number(a) - Number(b);
1284
- }).map(function (key) {
1285
- return input[key];
1286
- });
1287
- }
1288
-
1289
- return input;
1290
- }
1291
-
1292
- exports.extract = function (str) {
1293
- return str.split('?')[1] || '';
1294
- };
1295
-
1296
- exports.parse = function (str, opts) {
1297
- opts = objectAssign({arrayFormat: 'none'}, opts);
1298
-
1299
- var formatter = parserForArrayFormat(opts);
1300
-
1301
- // Create an object with no prototype
1302
- // https://github.com/sindresorhus/query-string/issues/47
1303
- var ret = Object.create(null);
1304
-
1305
- if (typeof str !== 'string') {
1306
- return ret;
1307
- }
1308
-
1309
- str = str.trim().replace(/^(\?|#|&)/, '');
1310
-
1311
- if (!str) {
1312
- return ret;
1313
- }
1314
-
1315
- str.split('&').forEach(function (param) {
1316
- var parts = param.replace(/\+/g, ' ').split('=');
1317
- // Firefox (pre 40) decodes `%3D` to `=`
1318
- // https://github.com/sindresorhus/query-string/pull/37
1319
- var key = parts.shift();
1320
- var val = parts.length > 0 ? parts.join('=') : undefined;
1321
-
1322
- // missing `=` should be `null`:
1323
- // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
1324
- val = val === undefined ? null : decodeURIComponent(val);
1325
-
1326
- formatter(decodeURIComponent(key), val, ret);
1327
- });
1328
-
1329
- return Object.keys(ret).sort().reduce(function (result, key) {
1330
- var val = ret[key];
1331
- if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {
1332
- // Sort object keys, not values
1333
- result[key] = keysSorter(val);
1334
- } else {
1335
- result[key] = val;
1336
- }
1337
-
1338
- return result;
1339
- }, Object.create(null));
1340
- };
1341
-
1342
- exports.stringify = function (obj, opts) {
1343
- var defaults = {
1344
- encode: true,
1345
- strict: true,
1346
- arrayFormat: 'none'
1347
- };
1348
-
1349
- opts = objectAssign(defaults, opts);
1350
-
1351
- var formatter = encoderForArrayFormat(opts);
1352
-
1353
- return obj ? Object.keys(obj).sort().map(function (key) {
1354
- var val = obj[key];
1355
-
1356
- if (val === undefined) {
1357
- return '';
1358
- }
1359
-
1360
- if (val === null) {
1361
- return encode(key, opts);
1362
- }
1363
-
1364
- if (Array.isArray(val)) {
1365
- var result = [];
1366
-
1367
- val.slice().forEach(function (val2) {
1368
- if (val2 === undefined) {
1369
- return;
1370
- }
1371
-
1372
- result.push(formatter(key, val2, result.length));
1373
- });
1374
-
1375
- return result.join('&');
1376
- }
1377
-
1378
- return encode(key, opts) + '=' + encode(val, opts);
1379
- }).filter(function (x) {
1380
- return x.length > 0;
1381
- }).join('&') : '';
1382
- };
1383
 
1384
 
1385
  /***/ }),
@@ -1398,19 +1398,19 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1398
 
1399
  "use strict";
1400
  /* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutPropertiesLoose;
1401
- function _objectWithoutPropertiesLoose(source, excluded) {
1402
- if (source == null) return {};
1403
- var target = {};
1404
- var sourceKeys = Object.keys(source);
1405
- var key, i;
1406
-
1407
- for (i = 0; i < sourceKeys.length; i++) {
1408
- key = sourceKeys[i];
1409
- if (excluded.indexOf(key) >= 0) continue;
1410
- target[key] = source[key];
1411
- }
1412
-
1413
- return target;
1414
  }
1415
 
1416
  /***/ }),
@@ -1419,10 +1419,10 @@ function _objectWithoutPropertiesLoose(source, excluded) {
1419
 
1420
  "use strict";
1421
  /* harmony export (immutable) */ __webpack_exports__["a"] = _inheritsLoose;
1422
- function _inheritsLoose(subClass, superClass) {
1423
- subClass.prototype = Object.create(superClass.prototype);
1424
- subClass.prototype.constructor = subClass;
1425
- subClass.__proto__ = superClass;
1426
  }
1427
 
1428
  /***/ }),
@@ -1505,11 +1505,11 @@ function style(options) {
1505
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithHoles__ = __webpack_require__(171);
1506
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArrayLimit__ = __webpack_require__(383);
1507
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nonIterableRest__ = __webpack_require__(172);
1508
-
1509
-
1510
-
1511
- function _slicedToArray(arr, i) {
1512
- return Object(__WEBPACK_IMPORTED_MODULE_0__arrayWithHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__iterableToArrayLimit__["a" /* default */])(arr, i) || Object(__WEBPACK_IMPORTED_MODULE_2__nonIterableRest__["a" /* default */])();
1513
  }
1514
 
1515
  /***/ }),
@@ -1748,33 +1748,33 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1748
  /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_12__matchPath__["a"]; });
1749
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__withRouter__ = __webpack_require__(329);
1750
  /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_13__withRouter__["a"]; });
1751
-
1752
-
1753
-
1754
-
1755
-
1756
-
1757
-
1758
-
1759
-
1760
-
1761
-
1762
-
1763
-
1764
-
1765
-
1766
-
1767
-
1768
-
1769
-
1770
-
1771
-
1772
-
1773
-
1774
-
1775
-
1776
-
1777
-
1778
 
1779
 
1780
  /***/ }),
@@ -1782,68 +1782,68 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
1782
  /***/ (function(module, exports, __webpack_require__) {
1783
 
1784
  "use strict";
1785
- /* WEBPACK VAR INJECTION */(function(process) {/**
1786
- * Copyright (c) 2014-present, Facebook, Inc.
1787
- *
1788
- * This source code is licensed under the MIT license found in the
1789
- * LICENSE file in the root directory of this source tree.
1790
- */
1791
-
1792
-
1793
-
1794
- /**
1795
- * Similar to invariant but only logs a warning if the condition is not met.
1796
- * This can be used to log issues in development environments in critical
1797
- * paths. Removing the logging code for production environments will keep the
1798
- * same logic and follow the same code paths.
1799
- */
1800
-
1801
- var __DEV__ = process.env.NODE_ENV !== 'production';
1802
-
1803
- var warning = function() {};
1804
-
1805
- if (__DEV__) {
1806
- var printWarning = function printWarning(format, args) {
1807
- var len = arguments.length;
1808
- args = new Array(len > 1 ? len - 1 : 0);
1809
- for (var key = 1; key < len; key++) {
1810
- args[key - 1] = arguments[key];
1811
- }
1812
- var argIndex = 0;
1813
- var message = 'Warning: ' +
1814
- format.replace(/%s/g, function() {
1815
- return args[argIndex++];
1816
- });
1817
- if (typeof console !== 'undefined') {
1818
- console.error(message);
1819
- }
1820
- try {
1821
- // --- Welcome to debugging React ---
1822
- // This error was thrown as a convenience so that you can use this stack
1823
- // to find the callsite that caused this warning to fire.
1824
- throw new Error(message);
1825
- } catch (x) {}
1826
- }
1827
-
1828
- warning = function(condition, format, args) {
1829
- var len = arguments.length;
1830
- args = new Array(len > 2 ? len - 2 : 0);
1831
- for (var key = 2; key < len; key++) {
1832
- args[key - 2] = arguments[key];
1833
- }
1834
- if (format === undefined) {
1835
- throw new Error(
1836
- '`warning(condition, format, ...args)` requires a warning ' +
1837
- 'message argument'
1838
- );
1839
- }
1840
- if (!condition) {
1841
- printWarning.apply(null, [format].concat(args));
1842
- }
1843
- };
1844
- }
1845
-
1846
- module.exports = warning;
1847
 
1848
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
1849
 
@@ -1852,55 +1852,55 @@ module.exports = warning;
1852
  /***/ (function(module, exports, __webpack_require__) {
1853
 
1854
  "use strict";
1855
- /* WEBPACK VAR INJECTION */(function(process) {/**
1856
- * Copyright (c) 2013-present, Facebook, Inc.
1857
- *
1858
- * This source code is licensed under the MIT license found in the
1859
- * LICENSE file in the root directory of this source tree.
1860
- */
1861
-
1862
-
1863
-
1864
- /**
1865
- * Use invariant() to assert state which your program assumes to be true.
1866
- *
1867
- * Provide sprintf-style format (only %s is supported) and arguments
1868
- * to provide information about what broke and what you were
1869
- * expecting.
1870
- *
1871
- * The invariant message will be stripped in production, but the invariant
1872
- * will remain to ensure logic does not differ in production.
1873
- */
1874
-
1875
- var invariant = function(condition, format, a, b, c, d, e, f) {
1876
- if (process.env.NODE_ENV !== 'production') {
1877
- if (format === undefined) {
1878
- throw new Error('invariant requires an error message argument');
1879
- }
1880
- }
1881
-
1882
- if (!condition) {
1883
- var error;
1884
- if (format === undefined) {
1885
- error = new Error(
1886
- 'Minified exception occurred; use the non-minified dev environment ' +
1887
- 'for the full error message and additional helpful warnings.'
1888
- );
1889
- } else {
1890
- var args = [a, b, c, d, e, f];
1891
- var argIndex = 0;
1892
- error = new Error(
1893
- format.replace(/%s/g, function() { return args[argIndex++]; })
1894
- );
1895
- error.name = 'Invariant Violation';
1896
- }
1897
-
1898
- error.framesToPop = 1; // we don't care about invariant's own frame
1899
- throw error;
1900
- }
1901
- };
1902
-
1903
- module.exports = invariant;
1904
 
1905
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
1906
 
@@ -1910,18 +1910,18 @@ module.exports = invariant;
1910
 
1911
  "use strict";
1912
  /* harmony export (immutable) */ __webpack_exports__["a"] = _typeof;
1913
- function _typeof(obj) {
1914
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1915
- _typeof = function _typeof(obj) {
1916
- return typeof obj;
1917
- };
1918
- } else {
1919
- _typeof = function _typeof(obj) {
1920
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1921
- };
1922
- }
1923
-
1924
- return _typeof(obj);
1925
  }
1926
 
1927
  /***/ }),
@@ -4301,96 +4301,96 @@ function useFormControl() {
4301
  /***/ (function(module, exports, __webpack_require__) {
4302
 
4303
  "use strict";
4304
- /*
4305
- object-assign
4306
- (c) Sindre Sorhus
4307
- @license MIT
4308
- */
4309
-
4310
-
4311
- /* eslint-disable no-unused-vars */
4312
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
4313
- var hasOwnProperty = Object.prototype.hasOwnProperty;
4314
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
4315
-
4316
- function toObject(val) {
4317
- if (val === null || val === undefined) {
4318
- throw new TypeError('Object.assign cannot be called with null or undefined');
4319
- }
4320
-
4321
- return Object(val);
4322
- }
4323
-
4324
- function shouldUseNative() {
4325
- try {
4326
- if (!Object.assign) {
4327
- return false;
4328
- }
4329
-
4330
- // Detect buggy property enumeration order in older V8 versions.
4331
-
4332
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
4333
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
4334
- test1[5] = 'de';
4335
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
4336
- return false;
4337
- }
4338
-
4339
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4340
- var test2 = {};
4341
- for (var i = 0; i < 10; i++) {
4342
- test2['_' + String.fromCharCode(i)] = i;
4343
- }
4344
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
4345
- return test2[n];
4346
- });
4347
- if (order2.join('') !== '0123456789') {
4348
- return false;
4349
- }
4350
-
4351
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4352
- var test3 = {};
4353
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
4354
- test3[letter] = letter;
4355
- });
4356
- if (Object.keys(Object.assign({}, test3)).join('') !==
4357
- 'abcdefghijklmnopqrst') {
4358
- return false;
4359
- }
4360
-
4361
- return true;
4362
- } catch (err) {
4363
- // We don't expect any of the above to throw, but better to be safe.
4364
- return false;
4365
- }
4366
- }
4367
-
4368
- module.exports = shouldUseNative() ? Object.assign : function (target, source) {
4369
- var from;
4370
- var to = toObject(target);
4371
- var symbols;
4372
-
4373
- for (var s = 1; s < arguments.length; s++) {
4374
- from = Object(arguments[s]);
4375
-
4376
- for (var key in from) {
4377
- if (hasOwnProperty.call(from, key)) {
4378
- to[key] = from[key];
4379
- }
4380
- }
4381
-
4382
- if (getOwnPropertySymbols) {
4383
- symbols = getOwnPropertySymbols(from);
4384
- for (var i = 0; i < symbols.length; i++) {
4385
- if (propIsEnumerable.call(from, symbols[i])) {
4386
- to[symbols[i]] = from[symbols[i]];
4387
- }
4388
- }
4389
- }
4390
- }
4391
-
4392
- return to;
4393
- };
4394
 
4395
 
4396
  /***/ }),
@@ -4410,925 +4410,925 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
4410
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_value_equal__ = __webpack_require__(312);
4411
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_tiny_warning__ = __webpack_require__(64);
4412
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tiny_invariant__ = __webpack_require__(313);
4413
-
4414
-
4415
-
4416
-
4417
-
4418
-
4419
- function addLeadingSlash(path) {
4420
- return path.charAt(0) === '/' ? path : '/' + path;
4421
- }
4422
- function stripLeadingSlash(path) {
4423
- return path.charAt(0) === '/' ? path.substr(1) : path;
4424
- }
4425
- function hasBasename(path, prefix) {
4426
- return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
4427
- }
4428
- function stripBasename(path, prefix) {
4429
- return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
4430
- }
4431
- function stripTrailingSlash(path) {
4432
- return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
4433
- }
4434
- function parsePath(path) {
4435
- var pathname = path || '/';
4436
- var search = '';
4437
- var hash = '';
4438
- var hashIndex = pathname.indexOf('#');
4439
-
4440
- if (hashIndex !== -1) {
4441
- hash = pathname.substr(hashIndex);
4442
- pathname = pathname.substr(0, hashIndex);
4443
- }
4444
-
4445
- var searchIndex = pathname.indexOf('?');
4446
-
4447
- if (searchIndex !== -1) {
4448
- search = pathname.substr(searchIndex);
4449
- pathname = pathname.substr(0, searchIndex);
4450
- }
4451
-
4452
- return {
4453
- pathname: pathname,
4454
- search: search === '?' ? '' : search,
4455
- hash: hash === '#' ? '' : hash
4456
- };
4457
- }
4458
- function createPath(location) {
4459
- var pathname = location.pathname,
4460
- search = location.search,
4461
- hash = location.hash;
4462
- var path = pathname || '/';
4463
- if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
4464
- if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
4465
- return path;
4466
- }
4467
-
4468
- function createLocation(path, state, key, currentLocation) {
4469
- var location;
4470
-
4471
- if (typeof path === 'string') {
4472
- // Two-arg form: push(path, state)
4473
- location = parsePath(path);
4474
- location.state = state;
4475
- } else {
4476
- // One-arg form: push(location)
4477
- location = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, path);
4478
- if (location.pathname === undefined) location.pathname = '';
4479
-
4480
- if (location.search) {
4481
- if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
4482
- } else {
4483
- location.search = '';
4484
- }
4485
-
4486
- if (location.hash) {
4487
- if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
4488
- } else {
4489
- location.hash = '';
4490
- }
4491
-
4492
- if (state !== undefined && location.state === undefined) location.state = state;
4493
- }
4494
-
4495
- try {
4496
- location.pathname = decodeURI(location.pathname);
4497
- } catch (e) {
4498
- if (e instanceof URIError) {
4499
- throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
4500
- } else {
4501
- throw e;
4502
- }
4503
- }
4504
-
4505
- if (key) location.key = key;
4506
-
4507
- if (currentLocation) {
4508
- // Resolve incomplete/relative pathname relative to current location.
4509
- if (!location.pathname) {
4510
- location.pathname = currentLocation.pathname;
4511
- } else if (location.pathname.charAt(0) !== '/') {
4512
- location.pathname = Object(__WEBPACK_IMPORTED_MODULE_1_resolve_pathname__["a" /* default */])(location.pathname, currentLocation.pathname);
4513
- }
4514
- } else {
4515
- // When there is no prior location and pathname is empty, set it to /
4516
- if (!location.pathname) {
4517
- location.pathname = '/';
4518
- }
4519
- }
4520
-
4521
- return location;
4522
- }
4523
- function locationsAreEqual(a, b) {
4524
- return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && Object(__WEBPACK_IMPORTED_MODULE_2_value_equal__["a" /* default */])(a.state, b.state);
4525
- }
4526
-
4527
- function createTransitionManager() {
4528
- var prompt = null;
4529
-
4530
- function setPrompt(nextPrompt) {
4531
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(prompt == null, 'A history supports only one prompt at a time') : void 0;
4532
- prompt = nextPrompt;
4533
- return function () {
4534
- if (prompt === nextPrompt) prompt = null;
4535
- };
4536
- }
4537
-
4538
- function confirmTransitionTo(location, action, getUserConfirmation, callback) {
4539
- // TODO: If another transition starts while we're still confirming
4540
- // the previous one, we may end up in a weird state. Figure out the
4541
- // best way to handle this.
4542
- if (prompt != null) {
4543
- var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
4544
-
4545
- if (typeof result === 'string') {
4546
- if (typeof getUserConfirmation === 'function') {
4547
- getUserConfirmation(result, callback);
4548
- } else {
4549
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
4550
- callback(true);
4551
- }
4552
- } else {
4553
- // Return false from a transition hook to cancel the transition.
4554
- callback(result !== false);
4555
- }
4556
- } else {
4557
- callback(true);
4558
- }
4559
- }
4560
-
4561
- var listeners = [];
4562
-
4563
- function appendListener(fn) {
4564
- var isActive = true;
4565
-
4566
- function listener() {
4567
- if (isActive) fn.apply(void 0, arguments);
4568
- }
4569
-
4570
- listeners.push(listener);
4571
- return function () {
4572
- isActive = false;
4573
- listeners = listeners.filter(function (item) {
4574
- return item !== listener;
4575
- });
4576
- };
4577
- }
4578
-
4579
- function notifyListeners() {
4580
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4581
- args[_key] = arguments[_key];
4582
- }
4583
-
4584
- listeners.forEach(function (listener) {
4585
- return listener.apply(void 0, args);
4586
- });
4587
- }
4588
-
4589
- return {
4590
- setPrompt: setPrompt,
4591
- confirmTransitionTo: confirmTransitionTo,
4592
- appendListener: appendListener,
4593
- notifyListeners: notifyListeners
4594
- };
4595
- }
4596
-
4597
- var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
4598
- function getConfirmation(message, callback) {
4599
- callback(window.confirm(message)); // eslint-disable-line no-alert
4600
- }
4601
- /**
4602
- * Returns true if the HTML5 history API is supported. Taken from Modernizr.
4603
- *
4604
- * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
4605
- * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
4606
- * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
4607
- */
4608
-
4609
- function supportsHistory() {
4610
- var ua = window.navigator.userAgent;
4611
- if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
4612
- return window.history && 'pushState' in window.history;
4613
- }
4614
- /**
4615
- * Returns true if browser fires popstate on hash change.
4616
- * IE10 and IE11 do not.
4617
- */
4618
-
4619
- function supportsPopStateOnHashChange() {
4620
- return window.navigator.userAgent.indexOf('Trident') === -1;
4621
- }
4622
- /**
4623
- * Returns false if using go(n) with hash history causes a full page reload.
4624
- */
4625
-
4626
- function supportsGoWithoutReloadUsingHash() {
4627
- return window.navigator.userAgent.indexOf('Firefox') === -1;
4628
- }
4629
- /**
4630
- * Returns true if a given popstate event is an extraneous WebKit event.
4631
- * Accounts for the fact that Chrome on iOS fires real popstate events
4632
- * containing undefined state when pressing the back button.
4633
- */
4634
-
4635
- function isExtraneousPopstateEvent(event) {
4636
- return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
4637
- }
4638
-
4639
- var PopStateEvent = 'popstate';
4640
- var HashChangeEvent = 'hashchange';
4641
-
4642
- function getHistoryState() {
4643
- try {
4644
- return window.history.state || {};
4645
- } catch (e) {
4646
- // IE 11 sometimes throws when accessing window.history.state
4647
- // See https://github.com/ReactTraining/history/pull/289
4648
- return {};
4649
- }
4650
- }
4651
- /**
4652
- * Creates a history object that uses the HTML5 history API including
4653
- * pushState, replaceState, and the popstate event.
4654
- */
4655
-
4656
-
4657
- function createBrowserHistory(props) {
4658
- if (props === void 0) {
4659
- props = {};
4660
- }
4661
-
4662
- !canUseDOM ? process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false, 'Browser history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
4663
- var globalHistory = window.history;
4664
- var canUseHistory = supportsHistory();
4665
- var needsHashChangeListener = !supportsPopStateOnHashChange();
4666
- var _props = props,
4667
- _props$forceRefresh = _props.forceRefresh,
4668
- forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
4669
- _props$getUserConfirm = _props.getUserConfirmation,
4670
- getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
4671
- _props$keyLength = _props.keyLength,
4672
- keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
4673
- var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
4674
-
4675
- function getDOMLocation(historyState) {
4676
- var _ref = historyState || {},
4677
- key = _ref.key,
4678
- state = _ref.state;
4679
-
4680
- var _window$location = window.location,
4681
- pathname = _window$location.pathname,
4682
- search = _window$location.search,
4683
- hash = _window$location.hash;
4684
- var path = pathname + search + hash;
4685
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
4686
- if (basename) path = stripBasename(path, basename);
4687
- return createLocation(path, state, key);
4688
- }
4689
-
4690
- function createKey() {
4691
- return Math.random().toString(36).substr(2, keyLength);
4692
- }
4693
-
4694
- var transitionManager = createTransitionManager();
4695
-
4696
- function setState(nextState) {
4697
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);
4698
-
4699
- history.length = globalHistory.length;
4700
- transitionManager.notifyListeners(history.location, history.action);
4701
- }
4702
-
4703
- function handlePopState(event) {
4704
- // Ignore extraneous popstate events in WebKit.
4705
- if (isExtraneousPopstateEvent(event)) return;
4706
- handlePop(getDOMLocation(event.state));
4707
- }
4708
-
4709
- function handleHashChange() {
4710
- handlePop(getDOMLocation(getHistoryState()));
4711
- }
4712
-
4713
- var forceNextPop = false;
4714
-
4715
- function handlePop(location) {
4716
- if (forceNextPop) {
4717
- forceNextPop = false;
4718
- setState();
4719
- } else {
4720
- var action = 'POP';
4721
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
4722
- if (ok) {
4723
- setState({
4724
- action: action,
4725
- location: location
4726
- });
4727
- } else {
4728
- revertPop(location);
4729
- }
4730
- });
4731
- }
4732
- }
4733
-
4734
- function revertPop(fromLocation) {
4735
- var toLocation = history.location; // TODO: We could probably make this more reliable by
4736
- // keeping a list of keys we've seen in sessionStorage.
4737
- // Instead, we just default to 0 for keys we don't know.
4738
-
4739
- var toIndex = allKeys.indexOf(toLocation.key);
4740
- if (toIndex === -1) toIndex = 0;
4741
- var fromIndex = allKeys.indexOf(fromLocation.key);
4742
- if (fromIndex === -1) fromIndex = 0;
4743
- var delta = toIndex - fromIndex;
4744
-
4745
- if (delta) {
4746
- forceNextPop = true;
4747
- go(delta);
4748
- }
4749
- }
4750
-
4751
- var initialLocation = getDOMLocation(getHistoryState());
4752
- var allKeys = [initialLocation.key]; // Public interface
4753
-
4754
- function createHref(location) {
4755
- return basename + createPath(location);
4756
- }
4757
-
4758
- function push(path, state) {
4759
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
4760
- var action = 'PUSH';
4761
- var location = createLocation(path, state, createKey(), history.location);
4762
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
4763
- if (!ok) return;
4764
- var href = createHref(location);
4765
- var key = location.key,
4766
- state = location.state;
4767
-
4768
- if (canUseHistory) {
4769
- globalHistory.pushState({
4770
- key: key,
4771
- state: state
4772
- }, null, href);
4773
-
4774
- if (forceRefresh) {
4775
- window.location.href = href;
4776
- } else {
4777
- var prevIndex = allKeys.indexOf(history.location.key);
4778
- var nextKeys = allKeys.slice(0, prevIndex + 1);
4779
- nextKeys.push(location.key);
4780
- allKeys = nextKeys;
4781
- setState({
4782
- action: action,
4783
- location: location
4784
- });
4785
- }
4786
- } else {
4787
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
4788
- window.location.href = href;
4789
- }
4790
- });
4791
- }
4792
-
4793
- function replace(path, state) {
4794
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
4795
- var action = 'REPLACE';
4796
- var location = createLocation(path, state, createKey(), history.location);
4797
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
4798
- if (!ok) return;
4799
- var href = createHref(location);
4800
- var key = location.key,
4801
- state = location.state;
4802
-
4803
- if (canUseHistory) {
4804
- globalHistory.replaceState({
4805
- key: key,
4806
- state: state
4807
- }, null, href);
4808
-
4809
- if (forceRefresh) {
4810
- window.location.replace(href);
4811
- } else {
4812
- var prevIndex = allKeys.indexOf(history.location.key);
4813
- if (prevIndex !== -1) allKeys[prevIndex] = location.key;
4814
- setState({
4815
- action: action,
4816
- location: location
4817
- });
4818
- }
4819
- } else {
4820
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
4821
- window.location.replace(href);
4822
- }
4823
- });
4824
- }
4825
-
4826
- function go(n) {
4827
- globalHistory.go(n);
4828
- }
4829
-
4830
- function goBack() {
4831
- go(-1);
4832
- }
4833
-
4834
- function goForward() {
4835
- go(1);
4836
- }
4837
-
4838
- var listenerCount = 0;
4839
-
4840
- function checkDOMListeners(delta) {
4841
- listenerCount += delta;
4842
-
4843
- if (listenerCount === 1 && delta === 1) {
4844
- window.addEventListener(PopStateEvent, handlePopState);
4845
- if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
4846
- } else if (listenerCount === 0) {
4847
- window.removeEventListener(PopStateEvent, handlePopState);
4848
- if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
4849
- }
4850
- }
4851
-
4852
- var isBlocked = false;
4853
-
4854
- function block(prompt) {
4855
- if (prompt === void 0) {
4856
- prompt = false;
4857
- }
4858
-
4859
- var unblock = transitionManager.setPrompt(prompt);
4860
-
4861
- if (!isBlocked) {
4862
- checkDOMListeners(1);
4863
- isBlocked = true;
4864
- }
4865
-
4866
- return function () {
4867
- if (isBlocked) {
4868
- isBlocked = false;
4869
- checkDOMListeners(-1);
4870
- }
4871
-
4872
- return unblock();
4873
- };
4874
- }
4875
-
4876
- function listen(listener) {
4877
- var unlisten = transitionManager.appendListener(listener);
4878
- checkDOMListeners(1);
4879
- return function () {
4880
- checkDOMListeners(-1);
4881
- unlisten();
4882
- };
4883
- }
4884
-
4885
- var history = {
4886
- length: globalHistory.length,
4887
- action: 'POP',
4888
- location: initialLocation,
4889
- createHref: createHref,
4890
- push: push,
4891
- replace: replace,
4892
- go: go,
4893
- goBack: goBack,
4894
- goForward: goForward,
4895
- block: block,
4896
- listen: listen
4897
- };
4898
- return history;
4899
- }
4900
-
4901
- var HashChangeEvent$1 = 'hashchange';
4902
- var HashPathCoders = {
4903
- hashbang: {
4904
- encodePath: function encodePath(path) {
4905
- return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
4906
- },
4907
- decodePath: function decodePath(path) {
4908
- return path.charAt(0) === '!' ? path.substr(1) : path;
4909
- }
4910
- },
4911
- noslash: {
4912
- encodePath: stripLeadingSlash,
4913
- decodePath: addLeadingSlash
4914
- },
4915
- slash: {
4916
- encodePath: addLeadingSlash,
4917
- decodePath: addLeadingSlash
4918
- }
4919
- };
4920
-
4921
- function stripHash(url) {
4922
- var hashIndex = url.indexOf('#');
4923
- return hashIndex === -1 ? url : url.slice(0, hashIndex);
4924
- }
4925
-
4926
- function getHashPath() {
4927
- // We can't use window.location.hash here because it's not
4928
- // consistent across browsers - Firefox will pre-decode it!
4929
- var href = window.location.href;
4930
- var hashIndex = href.indexOf('#');
4931
- return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
4932
- }
4933
-
4934
- function pushHashPath(path) {
4935
- window.location.hash = path;
4936
- }
4937
-
4938
- function replaceHashPath(path) {
4939
- window.location.replace(stripHash(window.location.href) + '#' + path);
4940
- }
4941
-
4942
- function createHashHistory(props) {
4943
- if (props === void 0) {
4944
- props = {};
4945
- }
4946
-
4947
- !canUseDOM ? process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false, 'Hash history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
4948
- var globalHistory = window.history;
4949
- var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
4950
- var _props = props,
4951
- _props$getUserConfirm = _props.getUserConfirmation,
4952
- getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
4953
- _props$hashType = _props.hashType,
4954
- hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
4955
- var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
4956
- var _HashPathCoders$hashT = HashPathCoders[hashType],
4957
- encodePath = _HashPathCoders$hashT.encodePath,
4958
- decodePath = _HashPathCoders$hashT.decodePath;
4959
-
4960
- function getDOMLocation() {
4961
- var path = decodePath(getHashPath());
4962
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
4963
- if (basename) path = stripBasename(path, basename);
4964
- return createLocation(path);
4965
- }
4966
-
4967
- var transitionManager = createTransitionManager();
4968
-
4969
- function setState(nextState) {
4970
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);
4971
-
4972
- history.length = globalHistory.length;
4973
- transitionManager.notifyListeners(history.location, history.action);
4974
- }
4975
-
4976
- var forceNextPop = false;
4977
- var ignorePath = null;
4978
-
4979
- function locationsAreEqual$$1(a, b) {
4980
- return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
4981
- }
4982
-
4983
- function handleHashChange() {
4984
- var path = getHashPath();
4985
- var encodedPath = encodePath(path);
4986
-
4987
- if (path !== encodedPath) {
4988
- // Ensure we always have a properly-encoded hash.
4989
- replaceHashPath(encodedPath);
4990
- } else {
4991
- var location = getDOMLocation();
4992
- var prevLocation = history.location;
4993
- if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
4994
-
4995
- if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
4996
-
4997
- ignorePath = null;
4998
- handlePop(location);
4999
- }
5000
- }
5001
-
5002
- function handlePop(location) {
5003
- if (forceNextPop) {
5004
- forceNextPop = false;
5005
- setState();
5006
- } else {
5007
- var action = 'POP';
5008
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5009
- if (ok) {
5010
- setState({
5011
- action: action,
5012
- location: location
5013
- });
5014
- } else {
5015
- revertPop(location);
5016
- }
5017
- });
5018
- }
5019
- }
5020
-
5021
- function revertPop(fromLocation) {
5022
- var toLocation = history.location; // TODO: We could probably make this more reliable by
5023
- // keeping a list of paths we've seen in sessionStorage.
5024
- // Instead, we just default to 0 for paths we don't know.
5025
-
5026
- var toIndex = allPaths.lastIndexOf(createPath(toLocation));
5027
- if (toIndex === -1) toIndex = 0;
5028
- var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
5029
- if (fromIndex === -1) fromIndex = 0;
5030
- var delta = toIndex - fromIndex;
5031
-
5032
- if (delta) {
5033
- forceNextPop = true;
5034
- go(delta);
5035
- }
5036
- } // Ensure the hash is encoded properly before doing anything else.
5037
-
5038
-
5039
- var path = getHashPath();
5040
- var encodedPath = encodePath(path);
5041
- if (path !== encodedPath) replaceHashPath(encodedPath);
5042
- var initialLocation = getDOMLocation();
5043
- var allPaths = [createPath(initialLocation)]; // Public interface
5044
-
5045
- function createHref(location) {
5046
- var baseTag = document.querySelector('base');
5047
- var href = '';
5048
-
5049
- if (baseTag && baseTag.getAttribute('href')) {
5050
- href = stripHash(window.location.href);
5051
- }
5052
-
5053
- return href + '#' + encodePath(basename + createPath(location));
5054
- }
5055
-
5056
- function push(path, state) {
5057
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;
5058
- var action = 'PUSH';
5059
- var location = createLocation(path, undefined, undefined, history.location);
5060
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5061
- if (!ok) return;
5062
- var path = createPath(location);
5063
- var encodedPath = encodePath(basename + path);
5064
- var hashChanged = getHashPath() !== encodedPath;
5065
-
5066
- if (hashChanged) {
5067
- // We cannot tell if a hashchange was caused by a PUSH, so we'd
5068
- // rather setState here and ignore the hashchange. The caveat here
5069
- // is that other hash histories in the page will consider it a POP.
5070
- ignorePath = path;
5071
- pushHashPath(encodedPath);
5072
- var prevIndex = allPaths.lastIndexOf(createPath(history.location));
5073
- var nextPaths = allPaths.slice(0, prevIndex + 1);
5074
- nextPaths.push(path);
5075
- allPaths = nextPaths;
5076
- setState({
5077
- action: action,
5078
- location: location
5079
- });
5080
- } else {
5081
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;
5082
- setState();
5083
- }
5084
- });
5085
- }
5086
-
5087
- function replace(path, state) {
5088
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;
5089
- var action = 'REPLACE';
5090
- var location = createLocation(path, undefined, undefined, history.location);
5091
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5092
- if (!ok) return;
5093
- var path = createPath(location);
5094
- var encodedPath = encodePath(basename + path);
5095
- var hashChanged = getHashPath() !== encodedPath;
5096
-
5097
- if (hashChanged) {
5098
- // We cannot tell if a hashchange was caused by a REPLACE, so we'd
5099
- // rather setState here and ignore the hashchange. The caveat here
5100
- // is that other hash histories in the page will consider it a POP.
5101
- ignorePath = path;
5102
- replaceHashPath(encodedPath);
5103
- }
5104
-
5105
- var prevIndex = allPaths.indexOf(createPath(history.location));
5106
- if (prevIndex !== -1) allPaths[prevIndex] = path;
5107
- setState({
5108
- action: action,
5109
- location: location
5110
- });
5111
- });
5112
- }
5113
-
5114
- function go(n) {
5115
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;
5116
- globalHistory.go(n);
5117
- }
5118
-
5119
- function goBack() {
5120
- go(-1);
5121
- }
5122
-
5123
- function goForward() {
5124
- go(1);
5125
- }
5126
-
5127
- var listenerCount = 0;
5128
-
5129
- function checkDOMListeners(delta) {
5130
- listenerCount += delta;
5131
-
5132
- if (listenerCount === 1 && delta === 1) {
5133
- window.addEventListener(HashChangeEvent$1, handleHashChange);
5134
- } else if (listenerCount === 0) {
5135
- window.removeEventListener(HashChangeEvent$1, handleHashChange);
5136
- }
5137
- }
5138
-
5139
- var isBlocked = false;
5140
-
5141
- function block(prompt) {
5142
- if (prompt === void 0) {
5143
- prompt = false;
5144
- }
5145
-
5146
- var unblock = transitionManager.setPrompt(prompt);
5147
-
5148
- if (!isBlocked) {
5149
- checkDOMListeners(1);
5150
- isBlocked = true;
5151
- }
5152
-
5153
- return function () {
5154
- if (isBlocked) {
5155
- isBlocked = false;
5156
- checkDOMListeners(-1);
5157
- }
5158
-
5159
- return unblock();
5160
- };
5161
- }
5162
-
5163
- function listen(listener) {
5164
- var unlisten = transitionManager.appendListener(listener);
5165
- checkDOMListeners(1);
5166
- return function () {
5167
- checkDOMListeners(-1);
5168
- unlisten();
5169
- };
5170
- }
5171
-
5172
- var history = {
5173
- length: globalHistory.length,
5174
- action: 'POP',
5175
- location: initialLocation,
5176
- createHref: createHref,
5177
- push: push,
5178
- replace: replace,
5179
- go: go,
5180
- goBack: goBack,
5181
- goForward: goForward,
5182
- block: block,
5183
- listen: listen
5184
- };
5185
- return history;
5186
- }
5187
-
5188
- function clamp(n, lowerBound, upperBound) {
5189
- return Math.min(Math.max(n, lowerBound), upperBound);
5190
- }
5191
- /**
5192
- * Creates a history object that stores locations in memory.
5193
- */
5194
-
5195
-
5196
- function createMemoryHistory(props) {
5197
- if (props === void 0) {
5198
- props = {};
5199
- }
5200
-
5201
- var _props = props,
5202
- getUserConfirmation = _props.getUserConfirmation,
5203
- _props$initialEntries = _props.initialEntries,
5204
- initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
5205
- _props$initialIndex = _props.initialIndex,
5206
- initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
5207
- _props$keyLength = _props.keyLength,
5208
- keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
5209
- var transitionManager = createTransitionManager();
5210
-
5211
- function setState(nextState) {
5212
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);
5213
-
5214
- history.length = history.entries.length;
5215
- transitionManager.notifyListeners(history.location, history.action);
5216
- }
5217
-
5218
- function createKey() {
5219
- return Math.random().toString(36).substr(2, keyLength);
5220
- }
5221
-
5222
- var index = clamp(initialIndex, 0, initialEntries.length - 1);
5223
- var entries = initialEntries.map(function (entry) {
5224
- return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
5225
- }); // Public interface
5226
-
5227
- var createHref = createPath;
5228
-
5229
- function push(path, state) {
5230
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
5231
- var action = 'PUSH';
5232
- var location = createLocation(path, state, createKey(), history.location);
5233
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5234
- if (!ok) return;
5235
- var prevIndex = history.index;
5236
- var nextIndex = prevIndex + 1;
5237
- var nextEntries = history.entries.slice(0);
5238
-
5239
- if (nextEntries.length > nextIndex) {
5240
- nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
5241
- } else {
5242
- nextEntries.push(location);
5243
- }
5244
-
5245
- setState({
5246
- action: action,
5247
- location: location,
5248
- index: nextIndex,
5249
- entries: nextEntries
5250
- });
5251
- });
5252
- }
5253
-
5254
- function replace(path, state) {
5255
- process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
5256
- var action = 'REPLACE';
5257
- var location = createLocation(path, state, createKey(), history.location);
5258
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5259
- if (!ok) return;
5260
- history.entries[history.index] = location;
5261
- setState({
5262
- action: action,
5263
- location: location
5264
- });
5265
- });
5266
- }
5267
-
5268
- function go(n) {
5269
- var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
5270
- var action = 'POP';
5271
- var location = history.entries[nextIndex];
5272
- transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5273
- if (ok) {
5274
- setState({
5275
- action: action,
5276
- location: location,
5277
- index: nextIndex
5278
- });
5279
- } else {
5280
- // Mimic the behavior of DOM histories by
5281
- // causing a render after a cancelled POP.
5282
- setState();
5283
- }
5284
- });
5285
- }
5286
-
5287
- function goBack() {
5288
- go(-1);
5289
- }
5290
-
5291
- function goForward() {
5292
- go(1);
5293
- }
5294
-
5295
- function canGo(n) {
5296
- var nextIndex = history.index + n;
5297
- return nextIndex >= 0 && nextIndex < history.entries.length;
5298
- }
5299
-
5300
- function block(prompt) {
5301
- if (prompt === void 0) {
5302
- prompt = false;
5303
- }
5304
-
5305
- return transitionManager.setPrompt(prompt);
5306
- }
5307
-
5308
- function listen(listener) {
5309
- return transitionManager.appendListener(listener);
5310
- }
5311
-
5312
- var history = {
5313
- length: entries.length,
5314
- action: 'POP',
5315
- location: entries[index],
5316
- index: index,
5317
- entries: entries,
5318
- createHref: createHref,
5319
- push: push,
5320
- replace: replace,
5321
- go: go,
5322
- goBack: goBack,
5323
- goForward: goForward,
5324
- canGo: canGo,
5325
- block: block,
5326
- listen: listen
5327
- };
5328
- return history;
5329
- }
5330
-
5331
-
5332
 
5333
  /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
5334
 
@@ -5812,26 +5812,26 @@ if (process.env.NODE_ENV !== 'production') {
5812
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5813
 
5814
  "use strict";
5815
- /* WEBPACK VAR INJECTION */(function(process) {var isProduction = process.env.NODE_ENV === 'production';
5816
- function warning(condition, message) {
5817
- if (!isProduction) {
5818
- if (condition) {
5819
- return;
5820
- }
5821
-
5822
- var text = "Warning: " + message;
5823
-
5824
- if (typeof console !== 'undefined') {
5825
- console.warn(text);
5826
- }
5827
-
5828
- try {
5829
- throw Error(text);
5830
- } catch (x) {}
5831
- }
5832
- }
5833
-
5834
- /* harmony default export */ __webpack_exports__["a"] = (warning);
5835
 
5836
  /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
5837
 
@@ -5850,20 +5850,20 @@ function warning(condition, message) {
5850
 
5851
  "use strict";
5852
  /* harmony export (immutable) */ __webpack_exports__["a"] = _createClass;
5853
- function _defineProperties(target, props) {
5854
- for (var i = 0; i < props.length; i++) {
5855
- var descriptor = props[i];
5856
- descriptor.enumerable = descriptor.enumerable || false;
5857
- descriptor.configurable = true;
5858
- if ("value" in descriptor) descriptor.writable = true;
5859
- Object.defineProperty(target, descriptor.key, descriptor);
5860
- }
5861
- }
5862
-
5863
- function _createClass(Constructor, protoProps, staticProps) {
5864
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
5865
- if (staticProps) _defineProperties(Constructor, staticProps);
5866
- return Constructor;
5867
  }
5868
 
5869
  /***/ }),
@@ -5872,12 +5872,12 @@ function _createClass(Constructor, protoProps, staticProps) {
5872
 
5873
  "use strict";
5874
  /* harmony export (immutable) */ __webpack_exports__["a"] = _assertThisInitialized;
5875
- function _assertThisInitialized(self) {
5876
- if (self === void 0) {
5877
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5878
- }
5879
-
5880
- return self;
5881
  }
5882
 
5883
  /***/ }),
@@ -5905,109 +5905,109 @@ function _assertThisInitialized(self) {
5905
  /***/ (function(module, exports, __webpack_require__) {
5906
 
5907
  "use strict";
5908
-
5909
-
5910
- var reactIs = __webpack_require__(14);
5911
-
5912
- /**
5913
- * Copyright 2015, Yahoo! Inc.
5914
- * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
5915
- */
5916
- var REACT_STATICS = {
5917
- childContextTypes: true,
5918
- contextType: true,
5919
- contextTypes: true,
5920
- defaultProps: true,
5921
- displayName: true,
5922
- getDefaultProps: true,
5923
- getDerivedStateFromError: true,
5924
- getDerivedStateFromProps: true,
5925
- mixins: true,
5926
- propTypes: true,
5927
- type: true
5928
- };
5929
- var KNOWN_STATICS = {
5930
- name: true,
5931
- length: true,
5932
- prototype: true,
5933
- caller: true,
5934
- callee: true,
5935
- arguments: true,
5936
- arity: true
5937
- };
5938
- var FORWARD_REF_STATICS = {
5939
- '$$typeof': true,
5940
- render: true,
5941
- defaultProps: true,
5942
- displayName: true,
5943
- propTypes: true
5944
- };
5945
- var MEMO_STATICS = {
5946
- '$$typeof': true,
5947
- compare: true,
5948
- defaultProps: true,
5949
- displayName: true,
5950
- propTypes: true,
5951
- type: true
5952
- };
5953
- var TYPE_STATICS = {};
5954
- TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
5955
- TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
5956
-
5957
- function getStatics(component) {
5958
- // React v16.11 and below
5959
- if (reactIs.isMemo(component)) {
5960
- return MEMO_STATICS;
5961
- } // React v16.12 and above
5962
-
5963
-
5964
- return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
5965
- }
5966
-
5967
- var defineProperty = Object.defineProperty;
5968
- var getOwnPropertyNames = Object.getOwnPropertyNames;
5969
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
5970
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
5971
- var getPrototypeOf = Object.getPrototypeOf;
5972
- var objectPrototype = Object.prototype;
5973
- function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
5974
- if (typeof sourceComponent !== 'string') {
5975
- // don't hoist over string (html) components
5976
- if (objectPrototype) {
5977
- var inheritedComponent = getPrototypeOf(sourceComponent);
5978
-
5979
- if (inheritedComponent && inheritedComponent !== objectPrototype) {
5980
- hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
5981
- }
5982
- }
5983
-
5984
- var keys = getOwnPropertyNames(sourceComponent);
5985
-
5986
- if (getOwnPropertySymbols) {
5987
- keys = keys.concat(getOwnPropertySymbols(sourceComponent));
5988
- }
5989
-
5990
- var targetStatics = getStatics(targetComponent);
5991
- var sourceStatics = getStatics(sourceComponent);
5992
-
5993
- for (var i = 0; i < keys.length; ++i) {
5994
- var key = keys[i];
5995
-
5996
- if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
5997
- var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
5998
-
5999
- try {
6000
- // Avoid failures from read-only properties
6001
- defineProperty(targetComponent, key, descriptor);
6002
- } catch (e) {}
6003
- }
6004
- }
6005
- }
6006
-
6007
- return targetComponent;
6008
- }
6009
-
6010
- module.exports = hoistNonReactStatics;
6011
 
6012
 
6013
  /***/ }),
@@ -6295,108 +6295,108 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
6295
  /***/ (function(module, exports, __webpack_require__) {
6296
 
6297
  "use strict";
6298
- /* WEBPACK VAR INJECTION */(function(process) {/**
6299
- * Copyright (c) 2013-present, Facebook, Inc.
6300
- *
6301
- * This source code is licensed under the MIT license found in the
6302
- * LICENSE file in the root directory of this source tree.
6303
- */
6304
-
6305
-
6306
-
6307
- var printWarning = function() {};
6308
-
6309
- if (process.env.NODE_ENV !== 'production') {
6310
- var ReactPropTypesSecret = __webpack_require__(89);
6311
- var loggedTypeFailures = {};
6312
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
6313
-
6314
- printWarning = function(text) {
6315
- var message = 'Warning: ' + text;
6316
- if (typeof console !== 'undefined') {
6317
- console.error(message);
6318
- }
6319
- try {
6320
- // --- Welcome to debugging React ---
6321
- // This error was thrown as a convenience so that you can use this stack
6322
- // to find the callsite that caused this warning to fire.
6323
- throw new Error(message);
6324
- } catch (x) {}
6325
- };
6326
- }
6327
-
6328
- /**
6329
- * Assert that the values match with the type specs.
6330
- * Error messages are memorized and will only be shown once.
6331
- *
6332
- * @param {object} typeSpecs Map of name to a ReactPropType
6333
- * @param {object} values Runtime values that need to be type-checked
6334
- * @param {string} location e.g. "prop", "context", "child context"
6335
- * @param {string} componentName Name of the component for error messages.
6336
- * @param {?Function} getStack Returns the component stack.
6337
- * @private
6338
- */
6339
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
6340
- if (process.env.NODE_ENV !== 'production') {
6341
- for (var typeSpecName in typeSpecs) {
6342
- if (has(typeSpecs, typeSpecName)) {
6343
- var error;
6344
- // Prop type validation may throw. In case they do, we don't want to
6345
- // fail the render phase where it didn't fail before. So we log it.
6346
- // After these have been cleaned up, we'll let them throw.
6347
- try {
6348
- // This is intentionally an invariant that gets caught. It's the same
6349
- // behavior as without this statement except with a better message.
6350
- if (typeof typeSpecs[typeSpecName] !== 'function') {
6351
- var err = Error(
6352
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
6353
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
6354
- );
6355
- err.name = 'Invariant Violation';
6356
- throw err;
6357
- }
6358
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
6359
- } catch (ex) {
6360
- error = ex;
6361
- }
6362
- if (error && !(error instanceof Error)) {
6363
- printWarning(
6364
- (componentName || 'React class') + ': type specification of ' +
6365
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
6366
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
6367
- 'You may have forgotten to pass an argument to the type checker ' +
6368
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
6369
- 'shape all require an argument).'
6370
- );
6371
- }
6372
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
6373
- // Only monitor this failure once because there tends to be a lot of the
6374
- // same error.
6375
- loggedTypeFailures[error.message] = true;
6376
-
6377
- var stack = getStack ? getStack() : '';
6378
-
6379
- printWarning(
6380
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
6381
- );
6382
- }
6383
- }
6384
- }
6385
- }
6386
- }
6387
-
6388
- /**
6389
- * Resets warning cache when testing.
6390
- *
6391
- * @private
6392
- */
6393
- checkPropTypes.resetWarningCache = function() {
6394
- if (process.env.NODE_ENV !== 'production') {
6395
- loggedTypeFailures = {};
6396
- }
6397
- }
6398
-
6399
- module.exports = checkPropTypes;
6400
 
6401
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
6402
 
@@ -6405,18 +6405,18 @@ module.exports = checkPropTypes;
6405
  /***/ (function(module, exports, __webpack_require__) {
6406
 
6407
  "use strict";
6408
- /**
6409
- * Copyright (c) 2013-present, Facebook, Inc.
6410
- *
6411
- * This source code is licensed under the MIT license found in the
6412
- * LICENSE file in the root directory of this source tree.
6413
- */
6414
-
6415
-
6416
-
6417
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
6418
-
6419
- module.exports = ReactPropTypesSecret;
6420
 
6421
 
6422
  /***/ }),
@@ -6425,9 +6425,9 @@ module.exports = ReactPropTypesSecret;
6425
 
6426
  "use strict";
6427
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Router__ = __webpack_require__(91);
6428
- // Written in this round about way for babel-transform-imports
6429
-
6430
-
6431
  /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Router__["a" /* default */]);
6432
 
6433
  /***/ }),
@@ -6443,223 +6443,223 @@ module.exports = ReactPropTypesSecret;
6443
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
6444
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
6445
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
6446
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6447
-
6448
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6449
-
6450
- 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; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6451
 
6452
- 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; }
 
 
6453
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6454
 
 
 
 
6455
 
 
 
 
 
 
 
 
 
6456
 
 
 
 
 
 
6457
 
 
 
 
6458
 
6459
- /**
6460
- * The public API for putting history on context.
6461
- */
6462
 
6463
- var Router = function (_React$Component) {
6464
- _inherits(Router, _React$Component);
6465
 
6466
- function Router() {
6467
- var _temp, _this, _ret;
6468
-
6469
- _classCallCheck(this, Router);
6470
-
6471
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
6472
- args[_key] = arguments[_key];
6473
- }
6474
-
6475
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
6476
- match: _this.computeMatch(_this.props.history.location.pathname)
6477
- }, _temp), _possibleConstructorReturn(_this, _ret);
6478
- }
6479
-
6480
- Router.prototype.getChildContext = function getChildContext() {
6481
- return {
6482
- router: _extends({}, this.context.router, {
6483
- history: this.props.history,
6484
- route: {
6485
- location: this.props.history.location,
6486
- match: this.state.match
6487
- }
6488
- })
6489
- };
6490
- };
6491
-
6492
- Router.prototype.computeMatch = function computeMatch(pathname) {
6493
- return {
6494
- path: "/",
6495
- url: "/",
6496
- params: {},
6497
- isExact: pathname === "/"
6498
- };
6499
- };
6500
-
6501
- Router.prototype.componentWillMount = function componentWillMount() {
6502
- var _this2 = this;
6503
-
6504
- var _props = this.props,
6505
- children = _props.children,
6506
- history = _props.history;
6507
-
6508
-
6509
- __WEBPACK_IMPORTED_MODULE_1_invariant___default()(children == null || __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 1, "A <Router> may have only one child element");
6510
-
6511
- // Do this here so we can setState when a <Redirect> changes the
6512
- // location in componentWillMount. This happens e.g. when doing
6513
- // server rendering using a <StaticRouter>.
6514
- this.unlisten = history.listen(function () {
6515
- _this2.setState({
6516
- match: _this2.computeMatch(history.location.pathname)
6517
- });
6518
- });
6519
- };
6520
-
6521
- Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
6522
- __WEBPACK_IMPORTED_MODULE_0_warning___default()(this.props.history === nextProps.history, "You cannot change <Router history>");
6523
- };
6524
-
6525
- Router.prototype.componentWillUnmount = function componentWillUnmount() {
6526
- this.unlisten();
6527
- };
6528
-
6529
- Router.prototype.render = function render() {
6530
- var children = this.props.children;
6531
-
6532
- return children ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children) : null;
6533
- };
6534
-
6535
- return Router;
6536
- }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
6537
-
6538
- Router.propTypes = {
6539
- history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
6540
- children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node
6541
- };
6542
- Router.contextTypes = {
6543
- router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
6544
- };
6545
- Router.childContextTypes = {
6546
- router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
6547
- };
6548
-
6549
-
6550
- /* harmony default export */ __webpack_exports__["a"] = (Router);
6551
-
6552
- /***/ }),
6553
- /* 92 */
6554
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6555
-
6556
- "use strict";
6557
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(137);
6558
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
6559
-
6560
-
6561
- var patternCache = {};
6562
- var cacheLimit = 10000;
6563
- var cacheCount = 0;
6564
-
6565
- var compilePath = function compilePath(pattern, options) {
6566
- var cacheKey = "" + options.end + options.strict + options.sensitive;
6567
- var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
6568
-
6569
- if (cache[pattern]) return cache[pattern];
6570
-
6571
- var keys = [];
6572
- var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default()(pattern, keys, options);
6573
- var compiledPattern = { re: re, keys: keys };
6574
-
6575
- if (cacheCount < cacheLimit) {
6576
- cache[pattern] = compiledPattern;
6577
- cacheCount++;
6578
- }
6579
-
6580
- return compiledPattern;
6581
- };
6582
-
6583
- /**
6584
- * Public API for matching a URL pathname to a path pattern.
6585
- */
6586
- var matchPath = function matchPath(pathname) {
6587
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6588
- var parent = arguments[2];
6589
-
6590
- if (typeof options === "string") options = { path: options };
6591
-
6592
- var _options = options,
6593
- path = _options.path,
6594
- _options$exact = _options.exact,
6595
- exact = _options$exact === undefined ? false : _options$exact,
6596
- _options$strict = _options.strict,
6597
- strict = _options$strict === undefined ? false : _options$strict,
6598
- _options$sensitive = _options.sensitive,
6599
- sensitive = _options$sensitive === undefined ? false : _options$sensitive;
6600
-
6601
-
6602
- if (path == null) return parent;
6603
-
6604
- var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),
6605
- re = _compilePath.re,
6606
- keys = _compilePath.keys;
6607
-
6608
- var match = re.exec(pathname);
6609
-
6610
- if (!match) return null;
6611
-
6612
- var url = match[0],
6613
- values = match.slice(1);
6614
-
6615
- var isExact = pathname === url;
6616
-
6617
- if (exact && !isExact) return null;
6618
-
6619
- return {
6620
- path: path, // the path pattern used to match
6621
- url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
6622
- isExact: isExact, // whether or not we matched exactly
6623
- params: keys.reduce(function (memo, key, index) {
6624
- memo[key.name] = values[index];
6625
- return memo;
6626
- }, {})
6627
- };
6628
- };
6629
-
6630
- /* harmony default export */ __webpack_exports__["a"] = (matchPath);
6631
-
6632
- /***/ }),
6633
- /* 93 */
6634
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6635
-
6636
- "use strict";
6637
- /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = chainPropTypes;
6638
- function chainPropTypes(propType1, propType2) {
6639
- if (process.env.NODE_ENV === 'production') {
6640
- return function () {
6641
- return null;
6642
- };
6643
- }
6644
-
6645
- return function validate() {
6646
- return propType1.apply(void 0, arguments) || propType2.apply(void 0, arguments);
6647
- };
6648
- }
6649
- /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
6650
-
6651
- /***/ }),
6652
- /* 94 */
6653
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6654
-
6655
- "use strict";
6656
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getThemeProps__ = __webpack_require__(350);
6657
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__getThemeProps__["a"]; });
6658
-
6659
-
6660
- /***/ }),
6661
- /* 95 */
6662
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6663
 
6664
  "use strict";
6665
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__jssPreset__ = __webpack_require__(351);
@@ -6681,10 +6681,10 @@ function chainPropTypes(propType1, propType2) {
6681
 
6682
  "use strict";
6683
  /* harmony export (immutable) */ __webpack_exports__["a"] = _classCallCheck;
6684
- function _classCallCheck(instance, Constructor) {
6685
- if (!(instance instanceof Constructor)) {
6686
- throw new TypeError("Cannot call a class as a function");
6687
- }
6688
  }
6689
 
6690
  /***/ }),
@@ -8999,13 +8999,13 @@ function isAdornedStart(obj) {
8999
  /***/ (function(module, exports, __webpack_require__) {
9000
 
9001
  "use strict";
9002
- /* WEBPACK VAR INJECTION */(function(process) {
9003
-
9004
- if (process.env.NODE_ENV === 'production') {
9005
- module.exports = __webpack_require__(300);
9006
- } else {
9007
- module.exports = __webpack_require__(301);
9008
- }
9009
 
9010
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
9011
 
@@ -9021,109 +9021,109 @@ if (process.env.NODE_ENV === 'production') {
9021
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(35);
9022
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__);
9023
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history__ = __webpack_require__(44);
9024
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9025
-
9026
- function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
9027
-
9028
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9029
-
9030
- 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; }
9031
-
9032
- 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; }
9033
-
9034
-
9035
-
9036
-
9037
-
9038
-
9039
- var isModifiedEvent = function isModifiedEvent(event) {
9040
- return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
9041
- };
9042
-
9043
- /**
9044
- * The public API for rendering a history-aware <a>.
9045
- */
9046
-
9047
- var Link = function (_React$Component) {
9048
- _inherits(Link, _React$Component);
9049
-
9050
- function Link() {
9051
- var _temp, _this, _ret;
9052
-
9053
- _classCallCheck(this, Link);
9054
-
9055
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
9056
- args[_key] = arguments[_key];
9057
- }
9058
-
9059
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
9060
- if (_this.props.onClick) _this.props.onClick(event);
9061
-
9062
- if (!event.defaultPrevented && // onClick prevented default
9063
- event.button === 0 && // ignore everything but left clicks
9064
- !_this.props.target && // let browser handle "target=_blank" etc.
9065
- !isModifiedEvent(event) // ignore clicks with modifier keys
9066
- ) {
9067
- event.preventDefault();
9068
-
9069
- var history = _this.context.router.history;
9070
- var _this$props = _this.props,
9071
- replace = _this$props.replace,
9072
- to = _this$props.to;
9073
-
9074
-
9075
- if (replace) {
9076
- history.replace(to);
9077
- } else {
9078
- history.push(to);
9079
- }
9080
- }
9081
- }, _temp), _possibleConstructorReturn(_this, _ret);
9082
- }
9083
-
9084
- Link.prototype.render = function render() {
9085
- var _props = this.props,
9086
- replace = _props.replace,
9087
- to = _props.to,
9088
- innerRef = _props.innerRef,
9089
- props = _objectWithoutProperties(_props, ["replace", "to", "innerRef"]); // eslint-disable-line no-unused-vars
9090
-
9091
- __WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router, "You should not use <Link> outside a <Router>");
9092
-
9093
- __WEBPACK_IMPORTED_MODULE_2_invariant___default()(to !== undefined, 'You must specify the "to" property');
9094
-
9095
- var history = this.context.router.history;
9096
-
9097
- var location = typeof to === "string" ? Object(__WEBPACK_IMPORTED_MODULE_3_history__["c" /* createLocation */])(to, null, null, history.location) : to;
9098
-
9099
- var href = history.createHref(location);
9100
- return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
9101
- };
9102
-
9103
- return Link;
9104
- }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
9105
-
9106
- Link.propTypes = {
9107
- onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
9108
- target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
9109
- replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
9110
- to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired,
9111
- innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func])
9112
- };
9113
- Link.defaultProps = {
9114
- replace: false
9115
- };
9116
- Link.contextTypes = {
9117
- router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
9118
- history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
9119
- push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
9120
- replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
9121
- createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
9122
- }).isRequired
9123
- }).isRequired
9124
- };
9125
-
9126
-
9127
  /* harmony default export */ __webpack_exports__["a"] = (Link);
9128
 
9129
  /***/ }),
@@ -9132,9 +9132,9 @@ Link.contextTypes = {
9132
 
9133
  "use strict";
9134
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__ = __webpack_require__(136);
9135
- // Written in this round about way for babel-transform-imports
9136
-
9137
-
9138
  /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__["a" /* default */]);
9139
 
9140
  /***/ }),
@@ -9151,576 +9151,576 @@ Link.contextTypes = {
9151
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
9152
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
9153
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(92);
9154
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9155
-
9156
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9157
-
9158
- 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; }
9159
-
9160
- 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; }
9161
-
9162
-
9163
-
9164
-
9165
-
9166
-
9167
-
9168
- var isEmptyChildren = function isEmptyChildren(children) {
9169
- return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 0;
9170
- };
9171
-
9172
- /**
9173
- * The public API for matching a single path and rendering.
9174
- */
9175
-
9176
- var Route = function (_React$Component) {
9177
- _inherits(Route, _React$Component);
9178
-
9179
- function Route() {
9180
- var _temp, _this, _ret;
9181
-
9182
- _classCallCheck(this, Route);
9183
-
9184
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
9185
- args[_key] = arguments[_key];
9186
- }
9187
-
9188
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
9189
- match: _this.computeMatch(_this.props, _this.context.router)
9190
- }, _temp), _possibleConstructorReturn(_this, _ret);
9191
- }
9192
-
9193
- Route.prototype.getChildContext = function getChildContext() {
9194
- return {
9195
- router: _extends({}, this.context.router, {
9196
- route: {
9197
- location: this.props.location || this.context.router.route.location,
9198
- match: this.state.match
9199
- }
9200
- })
9201
- };
9202
- };
9203
-
9204
- Route.prototype.computeMatch = function computeMatch(_ref, router) {
9205
- var computedMatch = _ref.computedMatch,
9206
- location = _ref.location,
9207
- path = _ref.path,
9208
- strict = _ref.strict,
9209
- exact = _ref.exact,
9210
- sensitive = _ref.sensitive;
9211
-
9212
- if (computedMatch) return computedMatch; // <Switch> already computed the match for us
9213
-
9214
- __WEBPACK_IMPORTED_MODULE_1_invariant___default()(router, "You should not use <Route> or withRouter() outside a <Router>");
9215
-
9216
- var route = router.route;
9217
-
9218
- var pathname = (location || route.location).pathname;
9219
-
9220
- return Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" /* default */])(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
9221
- };
9222
-
9223
- Route.prototype.componentWillMount = function componentWillMount() {
9224
- __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
9225
-
9226
- __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
9227
-
9228
- __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
9229
- };
9230
-
9231
- Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
9232
- __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
9233
-
9234
- __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
9235
-
9236
- this.setState({
9237
- match: this.computeMatch(nextProps, nextContext.router)
9238
- });
9239
- };
9240
-
9241
- Route.prototype.render = function render() {
9242
- var match = this.state.match;
9243
- var _props = this.props,
9244
- children = _props.children,
9245
- component = _props.component,
9246
- render = _props.render;
9247
- var _context$router = this.context.router,
9248
- history = _context$router.history,
9249
- route = _context$router.route,
9250
- staticContext = _context$router.staticContext;
9251
-
9252
- var location = this.props.location || route.location;
9253
- var props = { match: match, location: location, history: history, staticContext: staticContext };
9254
-
9255
- if (component) return match ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(component, props) : null;
9256
-
9257
- if (render) return match ? render(props) : null;
9258
-
9259
- if (typeof children === "function") return children(props);
9260
-
9261
- if (children && !isEmptyChildren(children)) return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children);
9262
-
9263
- return null;
9264
- };
9265
-
9266
- return Route;
9267
- }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
9268
-
9269
- Route.propTypes = {
9270
- computedMatch: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object, // private, from <Switch>
9271
- path: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
9272
- exact: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
9273
- strict: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
9274
- sensitive: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
9275
- component: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
9276
- render: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
9277
- children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node]),
9278
- location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
9279
- };
9280
- Route.contextTypes = {
9281
- router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.shape({
9282
- history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
9283
- route: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
9284
- staticContext: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
9285
- })
9286
- };
9287
- Route.childContextTypes = {
9288
- router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
9289
- };
9290
-
9291
-
9292
  /* harmony default export */ __webpack_exports__["a"] = (Route);
9293
 
9294
  /***/ }),
9295
  /* 137 */
9296
  /***/ (function(module, exports, __webpack_require__) {
9297
 
9298
- var isarray = __webpack_require__(318)
9299
-
9300
- /**
9301
- * Expose `pathToRegexp`.
9302
- */
9303
- module.exports = pathToRegexp
9304
- module.exports.parse = parse
9305
- module.exports.compile = compile
9306
- module.exports.tokensToFunction = tokensToFunction
9307
- module.exports.tokensToRegExp = tokensToRegExp
9308
-
9309
- /**
9310
- * The main path matching regexp utility.
9311
- *
9312
- * @type {RegExp}
9313
- */
9314
- var PATH_REGEXP = new RegExp([
9315
- // Match escaped characters that would otherwise appear in future matches.
9316
- // This allows the user to escape special characters that won't transform.
9317
- '(\\\\.)',
9318
- // Match Express-style parameters and un-named parameters with a prefix
9319
- // and optional suffixes. Matches appear as:
9320
- //
9321
- // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
9322
- // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
9323
- // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
9324
- '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
9325
- ].join('|'), 'g')
9326
-
9327
- /**
9328
- * Parse a string for the raw tokens.
9329
- *
9330
- * @param {string} str
9331
- * @param {Object=} options
9332
- * @return {!Array}
9333
- */
9334
- function parse (str, options) {
9335
- var tokens = []
9336
- var key = 0
9337
- var index = 0
9338
- var path = ''
9339
- var defaultDelimiter = options && options.delimiter || '/'
9340
- var res
9341
-
9342
- while ((res = PATH_REGEXP.exec(str)) != null) {
9343
- var m = res[0]
9344
- var escaped = res[1]
9345
- var offset = res.index
9346
- path += str.slice(index, offset)
9347
- index = offset + m.length
9348
-
9349
- // Ignore already escaped sequences.
9350
- if (escaped) {
9351
- path += escaped[1]
9352
- continue
9353
- }
9354
-
9355
- var next = str[index]
9356
- var prefix = res[2]
9357
- var name = res[3]
9358
- var capture = res[4]
9359
- var group = res[5]
9360
- var modifier = res[6]
9361
- var asterisk = res[7]
9362
-
9363
- // Push the current path onto the tokens.
9364
- if (path) {
9365
- tokens.push(path)
9366
- path = ''
9367
- }
9368
-
9369
- var partial = prefix != null && next != null && next !== prefix
9370
- var repeat = modifier === '+' || modifier === '*'
9371
- var optional = modifier === '?' || modifier === '*'
9372
- var delimiter = res[2] || defaultDelimiter
9373
- var pattern = capture || group
9374
-
9375
- tokens.push({
9376
- name: name || key++,
9377
- prefix: prefix || '',
9378
- delimiter: delimiter,
9379
- optional: optional,
9380
- repeat: repeat,
9381
- partial: partial,
9382
- asterisk: !!asterisk,
9383
- pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
9384
- })
9385
- }
9386
-
9387
- // Match any characters still remaining.
9388
- if (index < str.length) {
9389
- path += str.substr(index)
9390
- }
9391
-
9392
- // If the path exists, push it onto the end.
9393
- if (path) {
9394
- tokens.push(path)
9395
- }
9396
-
9397
- return tokens
9398
- }
9399
-
9400
- /**
9401
- * Compile a string to a template function for the path.
9402
- *
9403
- * @param {string} str
9404
- * @param {Object=} options
9405
- * @return {!function(Object=, Object=)}
9406
- */
9407
- function compile (str, options) {
9408
- return tokensToFunction(parse(str, options), options)
9409
- }
9410
-
9411
- /**
9412
- * Prettier encoding of URI path segments.
9413
- *
9414
- * @param {string}
9415
- * @return {string}
9416
- */
9417
- function encodeURIComponentPretty (str) {
9418
- return encodeURI(str).replace(/[\/?#]/g, function (c) {
9419
- return '%' + c.charCodeAt(0).toString(16).toUpperCase()
9420
- })
9421
- }
9422
-
9423
- /**
9424
- * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
9425
- *
9426
- * @param {string}
9427
- * @return {string}
9428
- */
9429
- function encodeAsterisk (str) {
9430
- return encodeURI(str).replace(/[?#]/g, function (c) {
9431
- return '%' + c.charCodeAt(0).toString(16).toUpperCase()
9432
- })
9433
- }
9434
-
9435
- /**
9436
- * Expose a method for transforming tokens into the path function.
9437
- */
9438
- function tokensToFunction (tokens, options) {
9439
- // Compile all the tokens into regexps.
9440
- var matches = new Array(tokens.length)
9441
-
9442
- // Compile all the patterns before compilation.
9443
- for (var i = 0; i < tokens.length; i++) {
9444
- if (typeof tokens[i] === 'object') {
9445
- matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))
9446
- }
9447
- }
9448
-
9449
- return function (obj, opts) {
9450
- var path = ''
9451
- var data = obj || {}
9452
- var options = opts || {}
9453
- var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
9454
-
9455
- for (var i = 0; i < tokens.length; i++) {
9456
- var token = tokens[i]
9457
-
9458
- if (typeof token === 'string') {
9459
- path += token
9460
-
9461
- continue
9462
- }
9463
-
9464
- var value = data[token.name]
9465
- var segment
9466
-
9467
- if (value == null) {
9468
- if (token.optional) {
9469
- // Prepend partial segment prefixes.
9470
- if (token.partial) {
9471
- path += token.prefix
9472
- }
9473
-
9474
- continue
9475
- } else {
9476
- throw new TypeError('Expected "' + token.name + '" to be defined')
9477
- }
9478
- }
9479
-
9480
- if (isarray(value)) {
9481
- if (!token.repeat) {
9482
- throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
9483
- }
9484
-
9485
- if (value.length === 0) {
9486
- if (token.optional) {
9487
- continue
9488
- } else {
9489
- throw new TypeError('Expected "' + token.name + '" to not be empty')
9490
- }
9491
- }
9492
-
9493
- for (var j = 0; j < value.length; j++) {
9494
- segment = encode(value[j])
9495
-
9496
- if (!matches[i].test(segment)) {
9497
- throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
9498
- }
9499
-
9500
- path += (j === 0 ? token.prefix : token.delimiter) + segment
9501
- }
9502
-
9503
- continue
9504
- }
9505
-
9506
- segment = token.asterisk ? encodeAsterisk(value) : encode(value)
9507
-
9508
- if (!matches[i].test(segment)) {
9509
- throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
9510
- }
9511
-
9512
- path += token.prefix + segment
9513
- }
9514
-
9515
- return path
9516
- }
9517
- }
9518
-
9519
- /**
9520
- * Escape a regular expression string.
9521
- *
9522
- * @param {string} str
9523
- * @return {string}
9524
- */
9525
- function escapeString (str) {
9526
- return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
9527
- }
9528
-
9529
- /**
9530
- * Escape the capturing group by escaping special characters and meaning.
9531
- *
9532
- * @param {string} group
9533
- * @return {string}
9534
- */
9535
- function escapeGroup (group) {
9536
- return group.replace(/([=!:$\/()])/g, '\\$1')
9537
- }
9538
-
9539
- /**
9540
- * Attach the keys as a property of the regexp.
9541
- *
9542
- * @param {!RegExp} re
9543
- * @param {Array} keys
9544
- * @return {!RegExp}
9545
- */
9546
- function attachKeys (re, keys) {
9547
- re.keys = keys
9548
- return re
9549
- }
9550
-
9551
- /**
9552
- * Get the flags for a regexp from the options.
9553
- *
9554
- * @param {Object} options
9555
- * @return {string}
9556
- */
9557
- function flags (options) {
9558
- return options && options.sensitive ? '' : 'i'
9559
- }
9560
-
9561
- /**
9562
- * Pull out keys from a regexp.
9563
- *
9564
- * @param {!RegExp} path
9565
- * @param {!Array} keys
9566
- * @return {!RegExp}
9567
- */
9568
- function regexpToRegexp (path, keys) {
9569
- // Use a negative lookahead to match only capturing groups.
9570
- var groups = path.source.match(/\((?!\?)/g)
9571
-
9572
- if (groups) {
9573
- for (var i = 0; i < groups.length; i++) {
9574
- keys.push({
9575
- name: i,
9576
- prefix: null,
9577
- delimiter: null,
9578
- optional: false,
9579
- repeat: false,
9580
- partial: false,
9581
- asterisk: false,
9582
- pattern: null
9583
- })
9584
- }
9585
- }
9586
-
9587
- return attachKeys(path, keys)
9588
- }
9589
-
9590
- /**
9591
- * Transform an array into a regexp.
9592
- *
9593
- * @param {!Array} path
9594
- * @param {Array} keys
9595
- * @param {!Object} options
9596
- * @return {!RegExp}
9597
- */
9598
- function arrayToRegexp (path, keys, options) {
9599
- var parts = []
9600
-
9601
- for (var i = 0; i < path.length; i++) {
9602
- parts.push(pathToRegexp(path[i], keys, options).source)
9603
- }
9604
-
9605
- var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
9606
-
9607
- return attachKeys(regexp, keys)
9608
- }
9609
-
9610
- /**
9611
- * Create a path regexp from string input.
9612
- *
9613
- * @param {string} path
9614
- * @param {!Array} keys
9615
- * @param {!Object} options
9616
- * @return {!RegExp}
9617
- */
9618
- function stringToRegexp (path, keys, options) {
9619
- return tokensToRegExp(parse(path, options), keys, options)
9620
- }
9621
-
9622
- /**
9623
- * Expose a function for taking tokens and returning a RegExp.
9624
- *
9625
- * @param {!Array} tokens
9626
- * @param {(Array|Object)=} keys
9627
- * @param {Object=} options
9628
- * @return {!RegExp}
9629
- */
9630
- function tokensToRegExp (tokens, keys, options) {
9631
- if (!isarray(keys)) {
9632
- options = /** @type {!Object} */ (keys || options)
9633
- keys = []
9634
- }
9635
-
9636
- options = options || {}
9637
-
9638
- var strict = options.strict
9639
- var end = options.end !== false
9640
- var route = ''
9641
-
9642
- // Iterate over the tokens and create our regexp string.
9643
- for (var i = 0; i < tokens.length; i++) {
9644
- var token = tokens[i]
9645
-
9646
- if (typeof token === 'string') {
9647
- route += escapeString(token)
9648
- } else {
9649
- var prefix = escapeString(token.prefix)
9650
- var capture = '(?:' + token.pattern + ')'
9651
-
9652
- keys.push(token)
9653
-
9654
- if (token.repeat) {
9655
- capture += '(?:' + prefix + capture + ')*'
9656
- }
9657
-
9658
- if (token.optional) {
9659
- if (!token.partial) {
9660
- capture = '(?:' + prefix + '(' + capture + '))?'
9661
- } else {
9662
- capture = prefix + '(' + capture + ')?'
9663
- }
9664
- } else {
9665
- capture = prefix + '(' + capture + ')'
9666
- }
9667
-
9668
- route += capture
9669
- }
9670
- }
9671
-
9672
- var delimiter = escapeString(options.delimiter || '/')
9673
- var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
9674
-
9675
- // In non-strict mode we allow a slash at the end of match. If the path to
9676
- // match already ends with a slash, we remove it for consistency. The slash
9677
- // is valid at the end of a path match, not in the middle. This is important
9678
- // in non-ending mode, where "/test/" shouldn't match "/test//route".
9679
- if (!strict) {
9680
- route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
9681
- }
9682
-
9683
- if (end) {
9684
- route += '$'
9685
- } else {
9686
- // In non-ending mode, we need the capturing groups to match as much as
9687
- // possible by using a positive lookahead to the end or next path segment.
9688
- route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
9689
- }
9690
-
9691
- return attachKeys(new RegExp('^' + route, flags(options)), keys)
9692
- }
9693
-
9694
- /**
9695
- * Normalize the given path string, returning a regular expression.
9696
- *
9697
- * An empty array can be passed in for the keys, which will hold the
9698
- * placeholder key descriptions. For example, using `/user/:id`, `keys` will
9699
- * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
9700
- *
9701
- * @param {(string|RegExp|Array)} path
9702
- * @param {(Array|Object)=} keys
9703
- * @param {Object=} options
9704
- * @return {!RegExp}
9705
- */
9706
- function pathToRegexp (path, keys, options) {
9707
- if (!isarray(keys)) {
9708
- options = /** @type {!Object} */ (keys || options)
9709
- keys = []
9710
- }
9711
-
9712
- options = options || {}
9713
-
9714
- if (path instanceof RegExp) {
9715
- return regexpToRegexp(path, /** @type {!Array} */ (keys))
9716
- }
9717
-
9718
- if (isarray(path)) {
9719
- return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
9720
- }
9721
-
9722
- return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
9723
- }
9724
 
9725
 
9726
  /***/ }),
@@ -9730,42 +9730,42 @@ function pathToRegexp (path, keys, options) {
9730
  "use strict";
9731
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(137);
9732
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
9733
-
9734
-
9735
- var patternCache = {};
9736
- var cacheLimit = 10000;
9737
- var cacheCount = 0;
9738
-
9739
- var compileGenerator = function compileGenerator(pattern) {
9740
- var cacheKey = pattern;
9741
- var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
9742
-
9743
- if (cache[pattern]) return cache[pattern];
9744
-
9745
- var compiledGenerator = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a.compile(pattern);
9746
-
9747
- if (cacheCount < cacheLimit) {
9748
- cache[pattern] = compiledGenerator;
9749
- cacheCount++;
9750
- }
9751
-
9752
- return compiledGenerator;
9753
- };
9754
-
9755
- /**
9756
- * Public API for generating a URL pathname from a pattern and parameters.
9757
- */
9758
- var generatePath = function generatePath() {
9759
- var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "/";
9760
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9761
-
9762
- if (pattern === "/") {
9763
- return pattern;
9764
- }
9765
- var generator = compileGenerator(pattern);
9766
- return generator(params, { pretty: true });
9767
- };
9768
-
9769
  /* harmony default export */ __webpack_exports__["a"] = (generatePath);
9770
 
9771
  /***/ }),
@@ -10506,13 +10506,15 @@ var QuadsAdCreateRouter = /*#__PURE__*/function (_Component) {
10506
  return res.json();
10507
  }).then(function (result) {
10508
  var titleName = result.name;
 
10509
 
10510
  if (page.ad_type == 'random_ads') {
10511
  titleName = result.name + " (Random)";
10512
  }
10513
 
10514
  _this2.setState(Object.assign(_this2.state.quads_post_meta, {
10515
- label: titleName
 
10516
  }));
10517
  }, function (error) {});
10518
  }
@@ -10636,8 +10638,8 @@ var isBrowser = (typeof window === "undefined" ? "undefined" : _typeof(window))
10636
 
10637
  "use strict";
10638
  /* harmony export (immutable) */ __webpack_exports__["a"] = _iterableToArray;
10639
- function _iterableToArray(iter) {
10640
- if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
10641
  }
10642
 
10643
  /***/ }),
@@ -11756,8 +11758,8 @@ spacing.filterProps = spacingKeys;
11756
 
11757
  "use strict";
11758
  /* harmony export (immutable) */ __webpack_exports__["a"] = _arrayWithHoles;
11759
- function _arrayWithHoles(arr) {
11760
- if (Array.isArray(arr)) return arr;
11761
  }
11762
 
11763
  /***/ }),
@@ -11766,8 +11768,8 @@ function _arrayWithHoles(arr) {
11766
 
11767
  "use strict";
11768
  /* harmony export (immutable) */ __webpack_exports__["a"] = _nonIterableRest;
11769
- function _nonIterableRest() {
11770
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
11771
  }
11772
 
11773
  /***/ }),
@@ -21413,33026 +21415,31876 @@ var QuadsAdRootComponent = /*#__PURE__*/function (_Component) {
21413
  }]);
21414
 
21415
  return QuadsAdRootComponent;
21416
- }(_react.Component);
21417
-
21418
- _reactDom["default"].render( /*#__PURE__*/_react["default"].createElement(QuadsAdRootComponent, null), document.getElementById('quads-ad-content'));
21419
-
21420
- /***/ }),
21421
- /* 297 */
21422
- /***/ (function(module, exports, __webpack_require__) {
21423
-
21424
- "use strict";
21425
- /** @license React v16.12.0
21426
- * react.production.min.js
21427
- *
21428
- * Copyright (c) Facebook, Inc. and its affiliates.
21429
- *
21430
- * This source code is licensed under the MIT license found in the
21431
- * LICENSE file in the root directory of this source tree.
21432
- */
21433
-
21434
- var h=__webpack_require__(43),n="function"===typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,q=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,t=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,v=n?Symbol.for("react.provider"):60109,w=n?Symbol.for("react.context"):60110,x=n?Symbol.for("react.forward_ref"):60112,y=n?Symbol.for("react.suspense"):60113;n&&Symbol.for("react.suspense_list");
21435
- var z=n?Symbol.for("react.memo"):60115,aa=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.fundamental");n&&Symbol.for("react.responder");n&&Symbol.for("react.scope");var A="function"===typeof Symbol&&Symbol.iterator;
21436
- function B(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D={};
21437
- function E(a,b,c){this.props=a;this.context=b;this.refs=D;this.updater=c||C}E.prototype.isReactComponent={};E.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(B(85));this.updater.enqueueSetState(this,a,b,"setState")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate")};function F(){}F.prototype=E.prototype;function G(a,b,c){this.props=a;this.context=b;this.refs=D;this.updater=c||C}var H=G.prototype=new F;
21438
- H.constructor=G;h(H,E.prototype);H.isPureReactComponent=!0;var I={current:null},J={current:null},K=Object.prototype.hasOwnProperty,L={key:!0,ref:!0,__self:!0,__source:!0};
21439
- function M(a,b,c){var e,d={},g=null,l=null;if(null!=b)for(e in void 0!==b.ref&&(l=b.ref),void 0!==b.key&&(g=""+b.key),b)K.call(b,e)&&!L.hasOwnProperty(e)&&(d[e]=b[e]);var f=arguments.length-2;if(1===f)d.children=c;else if(1<f){for(var k=Array(f),m=0;m<f;m++)k[m]=arguments[m+2];d.children=k}if(a&&a.defaultProps)for(e in f=a.defaultProps,f)void 0===d[e]&&(d[e]=f[e]);return{$$typeof:p,type:a,key:g,ref:l,props:d,_owner:J.current}}
21440
- function ba(a,b){return{$$typeof:p,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function N(a){return"object"===typeof a&&null!==a&&a.$$typeof===p}function escape(a){var b={"=":"=0",":":"=2"};return"$"+(""+a).replace(/[=:]/g,function(a){return b[a]})}var O=/\/+/g,P=[];function Q(a,b,c,e){if(P.length){var d=P.pop();d.result=a;d.keyPrefix=b;d.func=c;d.context=e;d.count=0;return d}return{result:a,keyPrefix:b,func:c,context:e,count:0}}
21441
- function R(a){a.result=null;a.keyPrefix=null;a.func=null;a.context=null;a.count=0;10>P.length&&P.push(a)}
21442
- function S(a,b,c,e){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 p:case q:g=!0}}if(g)return c(e,a,""===b?"."+T(a,0):b),1;g=0;b=""===b?".":b+":";if(Array.isArray(a))for(var l=0;l<a.length;l++){d=a[l];var f=b+T(d,l);g+=S(d,f,c,e)}else if(null===a||"object"!==typeof a?f=null:(f=A&&a[A]||a["@@iterator"],f="function"===typeof f?f:null),"function"===typeof f)for(a=f.call(a),l=
21443
- 0;!(d=a.next()).done;)d=d.value,f=b+T(d,l++),g+=S(d,f,c,e);else if("object"===d)throw c=""+a,Error(B(31,"[object Object]"===c?"object with keys {"+Object.keys(a).join(", ")+"}":c,""));return g}function U(a,b,c){return null==a?0:S(a,"",b,c)}function T(a,b){return"object"===typeof a&&null!==a&&null!=a.key?escape(a.key):b.toString(36)}function ca(a,b){a.func.call(a.context,b,a.count++)}
21444
- function da(a,b,c){var e=a.result,d=a.keyPrefix;a=a.func.call(a.context,b,a.count++);Array.isArray(a)?V(a,e,c,function(a){return a}):null!=a&&(N(a)&&(a=ba(a,d+(!a.key||b&&b.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+c)),e.push(a))}function V(a,b,c,e,d){var g="";null!=c&&(g=(""+c).replace(O,"$&/")+"/");b=Q(b,g,e,d);U(a,da,b);R(b)}function W(){var a=I.current;if(null===a)throw Error(B(321));return a}
21445
- var X={Children:{map:function(a,b,c){if(null==a)return a;var e=[];V(a,e,null,b,c);return e},forEach:function(a,b,c){if(null==a)return a;b=Q(null,null,b,c);U(a,ca,b);R(b)},count:function(a){return U(a,function(){return null},null)},toArray:function(a){var b=[];V(a,b,null,function(a){return a});return b},only:function(a){if(!N(a))throw Error(B(143));return a}},createRef:function(){return{current:null}},Component:E,PureComponent:G,createContext:function(a,b){void 0===b&&(b=null);a={$$typeof:w,_calculateChangedBits:b,
21446
- _currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:v,_context:a};return a.Consumer=a},forwardRef:function(a){return{$$typeof:x,render:a}},lazy:function(a){return{$$typeof:aa,_ctor:a,_status:-1,_result:null}},memo:function(a,b){return{$$typeof:z,type:a,compare:void 0===b?null:b}},useCallback:function(a,b){return W().useCallback(a,b)},useContext:function(a,b){return W().useContext(a,b)},useEffect:function(a,b){return W().useEffect(a,b)},useImperativeHandle:function(a,
21447
- b,c){return W().useImperativeHandle(a,b,c)},useDebugValue:function(){},useLayoutEffect:function(a,b){return W().useLayoutEffect(a,b)},useMemo:function(a,b){return W().useMemo(a,b)},useReducer:function(a,b,c){return W().useReducer(a,b,c)},useRef:function(a){return W().useRef(a)},useState:function(a){return W().useState(a)},Fragment:r,Profiler:u,StrictMode:t,Suspense:y,createElement:M,cloneElement:function(a,b,c){if(null===a||void 0===a)throw Error(B(267,a));var e=h({},a.props),d=a.key,g=a.ref,l=a._owner;
21448
- if(null!=b){void 0!==b.ref&&(g=b.ref,l=J.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var f=a.type.defaultProps;for(k in b)K.call(b,k)&&!L.hasOwnProperty(k)&&(e[k]=void 0===b[k]&&void 0!==f?f[k]:b[k])}var k=arguments.length-2;if(1===k)e.children=c;else if(1<k){f=Array(k);for(var m=0;m<k;m++)f[m]=arguments[m+2];e.children=f}return{$$typeof:p,type:a.type,key:d,ref:g,props:e,_owner:l}},createFactory:function(a){var b=M.bind(null,a);b.type=a;return b},isValidElement:N,version:"16.12.0",
21449
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentDispatcher:I,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:J,IsSomeRendererActing:{current:!1},assign:h}},Y={default:X},Z=Y&&X||Y;module.exports=Z.default||Z;
21450
-
21451
-
21452
- /***/ }),
21453
- /* 298 */
21454
- /***/ (function(module, exports, __webpack_require__) {
21455
-
21456
- "use strict";
21457
- /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.12.0
21458
- * react.development.js
21459
- *
21460
- * Copyright (c) Facebook, Inc. and its affiliates.
21461
- *
21462
- * This source code is licensed under the MIT license found in the
21463
- * LICENSE file in the root directory of this source tree.
21464
- */
21465
-
21466
-
21467
-
21468
-
21469
-
21470
- if (process.env.NODE_ENV !== "production") {
21471
- (function() {
21472
- 'use strict';
21473
-
21474
- var _assign = __webpack_require__(43);
21475
- var checkPropTypes = __webpack_require__(88);
21476
-
21477
- // TODO: this is special because it gets imported during build.
21478
-
21479
- var ReactVersion = '16.12.0';
21480
-
21481
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
21482
- // nor polyfill, then a plain number is used for performance.
21483
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
21484
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
21485
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
21486
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
21487
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
21488
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
21489
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
21490
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
21491
- // (unstable) APIs that have been removed. Can we remove the symbols?
21492
-
21493
-
21494
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
21495
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
21496
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
21497
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
21498
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
21499
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
21500
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
21501
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
21502
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
21503
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
21504
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
21505
- function getIteratorFn(maybeIterable) {
21506
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
21507
- return null;
21508
- }
21509
-
21510
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
21511
-
21512
- if (typeof maybeIterator === 'function') {
21513
- return maybeIterator;
21514
- }
21515
-
21516
- return null;
21517
- }
21518
-
21519
- // Do not require this module directly! Use normal `invariant` calls with
21520
- // template literal strings. The messages will be replaced with error codes
21521
- // during build.
21522
-
21523
- /**
21524
- * Use invariant() to assert state which your program assumes to be true.
21525
- *
21526
- * Provide sprintf-style format (only %s is supported) and arguments
21527
- * to provide information about what broke and what you were
21528
- * expecting.
21529
- *
21530
- * The invariant message will be stripped in production, but the invariant
21531
- * will remain to ensure logic does not differ in production.
21532
- */
21533
-
21534
- /**
21535
- * Forked from fbjs/warning:
21536
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
21537
- *
21538
- * Only change is we use console.warn instead of console.error,
21539
- * and do nothing when 'console' is not supported.
21540
- * This really simplifies the code.
21541
- * ---
21542
- * Similar to invariant but only logs a warning if the condition is not met.
21543
- * This can be used to log issues in development environments in critical
21544
- * paths. Removing the logging code for production environments will keep the
21545
- * same logic and follow the same code paths.
21546
- */
21547
- var lowPriorityWarningWithoutStack = function () {};
21548
-
21549
- {
21550
- var printWarning = function (format) {
21551
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
21552
- args[_key - 1] = arguments[_key];
21553
- }
21554
-
21555
- var argIndex = 0;
21556
- var message = 'Warning: ' + format.replace(/%s/g, function () {
21557
- return args[argIndex++];
21558
- });
21559
-
21560
- if (typeof console !== 'undefined') {
21561
- console.warn(message);
21562
- }
21563
-
21564
- try {
21565
- // --- Welcome to debugging React ---
21566
- // This error was thrown as a convenience so that you can use this stack
21567
- // to find the callsite that caused this warning to fire.
21568
- throw new Error(message);
21569
- } catch (x) {}
21570
- };
21571
-
21572
- lowPriorityWarningWithoutStack = function (condition, format) {
21573
- if (format === undefined) {
21574
- throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
21575
- }
21576
-
21577
- if (!condition) {
21578
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
21579
- args[_key2 - 2] = arguments[_key2];
21580
- }
21581
-
21582
- printWarning.apply(void 0, [format].concat(args));
21583
- }
21584
- };
21585
- }
21586
-
21587
- var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
21588
-
21589
- /**
21590
- * Similar to invariant but only logs a warning if the condition is not met.
21591
- * This can be used to log issues in development environments in critical
21592
- * paths. Removing the logging code for production environments will keep the
21593
- * same logic and follow the same code paths.
21594
- */
21595
- var warningWithoutStack = function () {};
21596
-
21597
- {
21598
- warningWithoutStack = function (condition, format) {
21599
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
21600
- args[_key - 2] = arguments[_key];
21601
- }
21602
-
21603
- if (format === undefined) {
21604
- throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
21605
- }
21606
-
21607
- if (args.length > 8) {
21608
- // Check before the condition to catch violations early.
21609
- throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
21610
- }
21611
-
21612
- if (condition) {
21613
- return;
21614
- }
21615
-
21616
- if (typeof console !== 'undefined') {
21617
- var argsWithFormat = args.map(function (item) {
21618
- return '' + item;
21619
- });
21620
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
21621
- // breaks IE9: https://github.com/facebook/react/issues/13610
21622
-
21623
- Function.prototype.apply.call(console.error, console, argsWithFormat);
21624
- }
21625
-
21626
- try {
21627
- // --- Welcome to debugging React ---
21628
- // This error was thrown as a convenience so that you can use this stack
21629
- // to find the callsite that caused this warning to fire.
21630
- var argIndex = 0;
21631
- var message = 'Warning: ' + format.replace(/%s/g, function () {
21632
- return args[argIndex++];
21633
- });
21634
- throw new Error(message);
21635
- } catch (x) {}
21636
- };
21637
- }
21638
-
21639
- var warningWithoutStack$1 = warningWithoutStack;
21640
-
21641
- var didWarnStateUpdateForUnmountedComponent = {};
21642
-
21643
- function warnNoop(publicInstance, callerName) {
21644
- {
21645
- var _constructor = publicInstance.constructor;
21646
- var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
21647
- var warningKey = componentName + "." + callerName;
21648
-
21649
- if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
21650
- return;
21651
- }
21652
-
21653
- warningWithoutStack$1(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);
21654
- didWarnStateUpdateForUnmountedComponent[warningKey] = true;
21655
- }
21656
- }
21657
- /**
21658
- * This is the abstract API for an update queue.
21659
- */
21660
-
21661
-
21662
- var ReactNoopUpdateQueue = {
21663
- /**
21664
- * Checks whether or not this composite component is mounted.
21665
- * @param {ReactClass} publicInstance The instance we want to test.
21666
- * @return {boolean} True if mounted, false otherwise.
21667
- * @protected
21668
- * @final
21669
- */
21670
- isMounted: function (publicInstance) {
21671
- return false;
21672
- },
21673
-
21674
- /**
21675
- * Forces an update. This should only be invoked when it is known with
21676
- * certainty that we are **not** in a DOM transaction.
21677
- *
21678
- * You may want to call this when you know that some deeper aspect of the
21679
- * component's state has changed but `setState` was not called.
21680
- *
21681
- * This will not invoke `shouldComponentUpdate`, but it will invoke
21682
- * `componentWillUpdate` and `componentDidUpdate`.
21683
- *
21684
- * @param {ReactClass} publicInstance The instance that should rerender.
21685
- * @param {?function} callback Called after component is updated.
21686
- * @param {?string} callerName name of the calling function in the public API.
21687
- * @internal
21688
- */
21689
- enqueueForceUpdate: function (publicInstance, callback, callerName) {
21690
- warnNoop(publicInstance, 'forceUpdate');
21691
- },
21692
-
21693
- /**
21694
- * Replaces all of the state. Always use this or `setState` to mutate state.
21695
- * You should treat `this.state` as immutable.
21696
- *
21697
- * There is no guarantee that `this.state` will be immediately updated, so
21698
- * accessing `this.state` after calling this method may return the old value.
21699
- *
21700
- * @param {ReactClass} publicInstance The instance that should rerender.
21701
- * @param {object} completeState Next state.
21702
- * @param {?function} callback Called after component is updated.
21703
- * @param {?string} callerName name of the calling function in the public API.
21704
- * @internal
21705
- */
21706
- enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
21707
- warnNoop(publicInstance, 'replaceState');
21708
- },
21709
-
21710
- /**
21711
- * Sets a subset of the state. This only exists because _pendingState is
21712
- * internal. This provides a merging strategy that is not available to deep
21713
- * properties which is confusing. TODO: Expose pendingState or don't use it
21714
- * during the merge.
21715
- *
21716
- * @param {ReactClass} publicInstance The instance that should rerender.
21717
- * @param {object} partialState Next partial state to be merged with state.
21718
- * @param {?function} callback Called after component is updated.
21719
- * @param {?string} Name of the calling function in the public API.
21720
- * @internal
21721
- */
21722
- enqueueSetState: function (publicInstance, partialState, callback, callerName) {
21723
- warnNoop(publicInstance, 'setState');
21724
- }
21725
- };
21726
-
21727
- var emptyObject = {};
21728
-
21729
- {
21730
- Object.freeze(emptyObject);
21731
- }
21732
- /**
21733
- * Base class helpers for the updating state of a component.
21734
- */
21735
-
21736
-
21737
- function Component(props, context, updater) {
21738
- this.props = props;
21739
- this.context = context; // If a component has string refs, we will assign a different object later.
21740
-
21741
- this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
21742
- // renderer.
21743
-
21744
- this.updater = updater || ReactNoopUpdateQueue;
21745
- }
21746
-
21747
- Component.prototype.isReactComponent = {};
21748
- /**
21749
- * Sets a subset of the state. Always use this to mutate
21750
- * state. You should treat `this.state` as immutable.
21751
- *
21752
- * There is no guarantee that `this.state` will be immediately updated, so
21753
- * accessing `this.state` after calling this method may return the old value.
21754
- *
21755
- * There is no guarantee that calls to `setState` will run synchronously,
21756
- * as they may eventually be batched together. You can provide an optional
21757
- * callback that will be executed when the call to setState is actually
21758
- * completed.
21759
- *
21760
- * When a function is provided to setState, it will be called at some point in
21761
- * the future (not synchronously). It will be called with the up to date
21762
- * component arguments (state, props, context). These values can be different
21763
- * from this.* because your function may be called after receiveProps but before
21764
- * shouldComponentUpdate, and this new state, props, and context will not yet be
21765
- * assigned to this.
21766
- *
21767
- * @param {object|function} partialState Next partial state or function to
21768
- * produce next partial state to be merged with current state.
21769
- * @param {?function} callback Called after state is updated.
21770
- * @final
21771
- * @protected
21772
- */
21773
-
21774
- Component.prototype.setState = function (partialState, callback) {
21775
- if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
21776
- {
21777
- throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
21778
- }
21779
- }
21780
-
21781
- this.updater.enqueueSetState(this, partialState, callback, 'setState');
21782
- };
21783
- /**
21784
- * Forces an update. This should only be invoked when it is known with
21785
- * certainty that we are **not** in a DOM transaction.
21786
- *
21787
- * You may want to call this when you know that some deeper aspect of the
21788
- * component's state has changed but `setState` was not called.
21789
- *
21790
- * This will not invoke `shouldComponentUpdate`, but it will invoke
21791
- * `componentWillUpdate` and `componentDidUpdate`.
21792
- *
21793
- * @param {?function} callback Called after update is complete.
21794
- * @final
21795
- * @protected
21796
- */
21797
-
21798
-
21799
- Component.prototype.forceUpdate = function (callback) {
21800
- this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
21801
- };
21802
- /**
21803
- * Deprecated APIs. These APIs used to exist on classic React classes but since
21804
- * we would like to deprecate them, we're not going to move them over to this
21805
- * modern base class. Instead, we define a getter that warns if it's accessed.
21806
- */
21807
-
21808
-
21809
- {
21810
- var deprecatedAPIs = {
21811
- isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
21812
- replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
21813
- };
21814
-
21815
- var defineDeprecationWarning = function (methodName, info) {
21816
- Object.defineProperty(Component.prototype, methodName, {
21817
- get: function () {
21818
- lowPriorityWarningWithoutStack$1(false, '%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
21819
- return undefined;
21820
- }
21821
- });
21822
- };
21823
-
21824
- for (var fnName in deprecatedAPIs) {
21825
- if (deprecatedAPIs.hasOwnProperty(fnName)) {
21826
- defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
21827
- }
21828
- }
21829
- }
21830
-
21831
- function ComponentDummy() {}
21832
-
21833
- ComponentDummy.prototype = Component.prototype;
21834
- /**
21835
- * Convenience component with default shallow equality check for sCU.
21836
- */
21837
-
21838
- function PureComponent(props, context, updater) {
21839
- this.props = props;
21840
- this.context = context; // If a component has string refs, we will assign a different object later.
21841
-
21842
- this.refs = emptyObject;
21843
- this.updater = updater || ReactNoopUpdateQueue;
21844
- }
21845
-
21846
- var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
21847
- pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
21848
-
21849
- _assign(pureComponentPrototype, Component.prototype);
21850
-
21851
- pureComponentPrototype.isPureReactComponent = true;
21852
-
21853
- // an immutable object with a single mutable value
21854
- function createRef() {
21855
- var refObject = {
21856
- current: null
21857
- };
21858
-
21859
- {
21860
- Object.seal(refObject);
21861
- }
21862
-
21863
- return refObject;
21864
- }
21865
-
21866
- /**
21867
- * Keeps track of the current dispatcher.
21868
- */
21869
- var ReactCurrentDispatcher = {
21870
- /**
21871
- * @internal
21872
- * @type {ReactComponent}
21873
- */
21874
- current: null
21875
- };
21876
-
21877
- /**
21878
- * Keeps track of the current batch's configuration such as how long an update
21879
- * should suspend for if it needs to.
21880
- */
21881
- var ReactCurrentBatchConfig = {
21882
- suspense: null
21883
- };
21884
-
21885
- /**
21886
- * Keeps track of the current owner.
21887
- *
21888
- * The current owner is the component who should own any components that are
21889
- * currently being constructed.
21890
- */
21891
- var ReactCurrentOwner = {
21892
- /**
21893
- * @internal
21894
- * @type {ReactComponent}
21895
- */
21896
- current: null
21897
- };
21898
-
21899
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
21900
- var describeComponentFrame = function (name, source, ownerName) {
21901
- var sourceInfo = '';
21902
-
21903
- if (source) {
21904
- var path = source.fileName;
21905
- var fileName = path.replace(BEFORE_SLASH_RE, '');
21906
-
21907
- {
21908
- // In DEV, include code for a common special case:
21909
- // prefer "folder/index.js" instead of just "index.js".
21910
- if (/^index\./.test(fileName)) {
21911
- var match = path.match(BEFORE_SLASH_RE);
21912
-
21913
- if (match) {
21914
- var pathBeforeSlash = match[1];
21915
-
21916
- if (pathBeforeSlash) {
21917
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
21918
- fileName = folderName + '/' + fileName;
21919
- }
21920
- }
21921
- }
21922
- }
21923
-
21924
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
21925
- } else if (ownerName) {
21926
- sourceInfo = ' (created by ' + ownerName + ')';
21927
- }
21928
-
21929
- return '\n in ' + (name || 'Unknown') + sourceInfo;
21930
- };
21931
-
21932
- var Resolved = 1;
21933
-
21934
- function refineResolvedLazyComponent(lazyComponent) {
21935
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
21936
- }
21937
-
21938
- function getWrappedName(outerType, innerType, wrapperName) {
21939
- var functionName = innerType.displayName || innerType.name || '';
21940
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
21941
- }
21942
-
21943
- function getComponentName(type) {
21944
- if (type == null) {
21945
- // Host root, text node or just invalid type.
21946
- return null;
21947
- }
21948
-
21949
- {
21950
- if (typeof type.tag === 'number') {
21951
- warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
21952
- }
21953
- }
21954
-
21955
- if (typeof type === 'function') {
21956
- return type.displayName || type.name || null;
21957
- }
21958
-
21959
- if (typeof type === 'string') {
21960
- return type;
21961
- }
21962
-
21963
- switch (type) {
21964
- case REACT_FRAGMENT_TYPE:
21965
- return 'Fragment';
21966
-
21967
- case REACT_PORTAL_TYPE:
21968
- return 'Portal';
21969
-
21970
- case REACT_PROFILER_TYPE:
21971
- return "Profiler";
21972
-
21973
- case REACT_STRICT_MODE_TYPE:
21974
- return 'StrictMode';
21975
-
21976
- case REACT_SUSPENSE_TYPE:
21977
- return 'Suspense';
21978
-
21979
- case REACT_SUSPENSE_LIST_TYPE:
21980
- return 'SuspenseList';
21981
- }
21982
-
21983
- if (typeof type === 'object') {
21984
- switch (type.$$typeof) {
21985
- case REACT_CONTEXT_TYPE:
21986
- return 'Context.Consumer';
21987
-
21988
- case REACT_PROVIDER_TYPE:
21989
- return 'Context.Provider';
21990
-
21991
- case REACT_FORWARD_REF_TYPE:
21992
- return getWrappedName(type, type.render, 'ForwardRef');
21993
-
21994
- case REACT_MEMO_TYPE:
21995
- return getComponentName(type.type);
21996
-
21997
- case REACT_LAZY_TYPE:
21998
- {
21999
- var thenable = type;
22000
- var resolvedThenable = refineResolvedLazyComponent(thenable);
22001
-
22002
- if (resolvedThenable) {
22003
- return getComponentName(resolvedThenable);
22004
- }
22005
-
22006
- break;
22007
- }
22008
- }
22009
- }
22010
-
22011
- return null;
22012
- }
22013
-
22014
- var ReactDebugCurrentFrame = {};
22015
- var currentlyValidatingElement = null;
22016
- function setCurrentlyValidatingElement(element) {
22017
- {
22018
- currentlyValidatingElement = element;
22019
- }
22020
- }
22021
-
22022
- {
22023
- // Stack implementation injected by the current renderer.
22024
- ReactDebugCurrentFrame.getCurrentStack = null;
22025
-
22026
- ReactDebugCurrentFrame.getStackAddendum = function () {
22027
- var stack = ''; // Add an extra top frame while an element is being validated
22028
-
22029
- if (currentlyValidatingElement) {
22030
- var name = getComponentName(currentlyValidatingElement.type);
22031
- var owner = currentlyValidatingElement._owner;
22032
- stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
22033
- } // Delegate to the injected renderer-specific implementation
22034
-
22035
-
22036
- var impl = ReactDebugCurrentFrame.getCurrentStack;
22037
-
22038
- if (impl) {
22039
- stack += impl() || '';
22040
- }
22041
-
22042
- return stack;
22043
- };
22044
- }
22045
-
22046
- /**
22047
- * Used by act() to track whether you're inside an act() scope.
22048
- */
22049
- var IsSomeRendererActing = {
22050
- current: false
22051
- };
22052
-
22053
- var ReactSharedInternals = {
22054
- ReactCurrentDispatcher: ReactCurrentDispatcher,
22055
- ReactCurrentBatchConfig: ReactCurrentBatchConfig,
22056
- ReactCurrentOwner: ReactCurrentOwner,
22057
- IsSomeRendererActing: IsSomeRendererActing,
22058
- // Used by renderers to avoid bundling object-assign twice in UMD bundles:
22059
- assign: _assign
22060
- };
22061
-
22062
- {
22063
- _assign(ReactSharedInternals, {
22064
- // These should not be included in production.
22065
- ReactDebugCurrentFrame: ReactDebugCurrentFrame,
22066
- // Shim for React DOM 16.0.0 which still destructured (but not used) this.
22067
- // TODO: remove in React 17.0.
22068
- ReactComponentTreeHook: {}
22069
- });
22070
- }
22071
-
22072
- /**
22073
- * Similar to invariant but only logs a warning if the condition is not met.
22074
- * This can be used to log issues in development environments in critical
22075
- * paths. Removing the logging code for production environments will keep the
22076
- * same logic and follow the same code paths.
22077
- */
22078
-
22079
- var warning = warningWithoutStack$1;
22080
-
22081
- {
22082
- warning = function (condition, format) {
22083
- if (condition) {
22084
- return;
22085
- }
22086
-
22087
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
22088
- var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
22089
-
22090
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
22091
- args[_key - 2] = arguments[_key];
22092
- }
22093
-
22094
- warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
22095
- };
22096
- }
22097
-
22098
- var warning$1 = warning;
22099
-
22100
- var hasOwnProperty = Object.prototype.hasOwnProperty;
22101
- var RESERVED_PROPS = {
22102
- key: true,
22103
- ref: true,
22104
- __self: true,
22105
- __source: true
22106
- };
22107
- var specialPropKeyWarningShown;
22108
- var specialPropRefWarningShown;
22109
-
22110
- function hasValidRef(config) {
22111
- {
22112
- if (hasOwnProperty.call(config, 'ref')) {
22113
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
22114
-
22115
- if (getter && getter.isReactWarning) {
22116
- return false;
22117
- }
22118
- }
22119
- }
22120
-
22121
- return config.ref !== undefined;
22122
- }
22123
-
22124
- function hasValidKey(config) {
22125
- {
22126
- if (hasOwnProperty.call(config, 'key')) {
22127
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
22128
-
22129
- if (getter && getter.isReactWarning) {
22130
- return false;
22131
- }
22132
- }
22133
- }
22134
-
22135
- return config.key !== undefined;
22136
- }
22137
-
22138
- function defineKeyPropWarningGetter(props, displayName) {
22139
- var warnAboutAccessingKey = function () {
22140
- if (!specialPropKeyWarningShown) {
22141
- specialPropKeyWarningShown = true;
22142
- warningWithoutStack$1(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);
22143
- }
22144
- };
22145
-
22146
- warnAboutAccessingKey.isReactWarning = true;
22147
- Object.defineProperty(props, 'key', {
22148
- get: warnAboutAccessingKey,
22149
- configurable: true
22150
- });
22151
- }
22152
-
22153
- function defineRefPropWarningGetter(props, displayName) {
22154
- var warnAboutAccessingRef = function () {
22155
- if (!specialPropRefWarningShown) {
22156
- specialPropRefWarningShown = true;
22157
- warningWithoutStack$1(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);
22158
- }
22159
- };
22160
-
22161
- warnAboutAccessingRef.isReactWarning = true;
22162
- Object.defineProperty(props, 'ref', {
22163
- get: warnAboutAccessingRef,
22164
- configurable: true
22165
- });
22166
- }
22167
- /**
22168
- * Factory method to create a new React element. This no longer adheres to
22169
- * the class pattern, so do not use new to call it. Also, instanceof check
22170
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
22171
- * if something is a React Element.
22172
- *
22173
- * @param {*} type
22174
- * @param {*} props
22175
- * @param {*} key
22176
- * @param {string|object} ref
22177
- * @param {*} owner
22178
- * @param {*} self A *temporary* helper to detect places where `this` is
22179
- * different from the `owner` when React.createElement is called, so that we
22180
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
22181
- * functions, and as long as `this` and owner are the same, there will be no
22182
- * change in behavior.
22183
- * @param {*} source An annotation object (added by a transpiler or otherwise)
22184
- * indicating filename, line number, and/or other information.
22185
- * @internal
22186
- */
22187
-
22188
-
22189
- var ReactElement = function (type, key, ref, self, source, owner, props) {
22190
- var element = {
22191
- // This tag allows us to uniquely identify this as a React Element
22192
- $$typeof: REACT_ELEMENT_TYPE,
22193
- // Built-in properties that belong on the element
22194
- type: type,
22195
- key: key,
22196
- ref: ref,
22197
- props: props,
22198
- // Record the component responsible for creating this element.
22199
- _owner: owner
22200
- };
22201
-
22202
- {
22203
- // The validation flag is currently mutative. We put it on
22204
- // an external backing store so that we can freeze the whole object.
22205
- // This can be replaced with a WeakMap once they are implemented in
22206
- // commonly used development environments.
22207
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
22208
- // the validation flag non-enumerable (where possible, which should
22209
- // include every environment we run tests in), so the test framework
22210
- // ignores it.
22211
-
22212
- Object.defineProperty(element._store, 'validated', {
22213
- configurable: false,
22214
- enumerable: false,
22215
- writable: true,
22216
- value: false
22217
- }); // self and source are DEV only properties.
22218
-
22219
- Object.defineProperty(element, '_self', {
22220
- configurable: false,
22221
- enumerable: false,
22222
- writable: false,
22223
- value: self
22224
- }); // Two elements created in two different places should be considered
22225
- // equal for testing purposes and therefore we hide it from enumeration.
22226
-
22227
- Object.defineProperty(element, '_source', {
22228
- configurable: false,
22229
- enumerable: false,
22230
- writable: false,
22231
- value: source
22232
- });
22233
-
22234
- if (Object.freeze) {
22235
- Object.freeze(element.props);
22236
- Object.freeze(element);
22237
- }
22238
- }
22239
-
22240
- return element;
22241
- };
22242
- /**
22243
- * https://github.com/reactjs/rfcs/pull/107
22244
- * @param {*} type
22245
- * @param {object} props
22246
- * @param {string} key
22247
- */
22248
-
22249
-
22250
-
22251
- /**
22252
- * https://github.com/reactjs/rfcs/pull/107
22253
- * @param {*} type
22254
- * @param {object} props
22255
- * @param {string} key
22256
- */
22257
-
22258
- function jsxDEV(type, config, maybeKey, source, self) {
22259
- var propName; // Reserved names are extracted
22260
-
22261
- var props = {};
22262
- var key = null;
22263
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
22264
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
22265
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
22266
- // but as an intermediary step, we will use jsxDEV for everything except
22267
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
22268
- // key is explicitly declared to be undefined or not.
22269
-
22270
- if (maybeKey !== undefined) {
22271
- key = '' + maybeKey;
22272
- }
22273
-
22274
- if (hasValidKey(config)) {
22275
- key = '' + config.key;
22276
- }
22277
-
22278
- if (hasValidRef(config)) {
22279
- ref = config.ref;
22280
- } // Remaining properties are added to a new props object
22281
-
22282
-
22283
- for (propName in config) {
22284
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
22285
- props[propName] = config[propName];
22286
- }
22287
- } // Resolve default props
22288
-
22289
-
22290
- if (type && type.defaultProps) {
22291
- var defaultProps = type.defaultProps;
22292
-
22293
- for (propName in defaultProps) {
22294
- if (props[propName] === undefined) {
22295
- props[propName] = defaultProps[propName];
22296
- }
22297
- }
22298
- }
22299
-
22300
- if (key || ref) {
22301
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
22302
-
22303
- if (key) {
22304
- defineKeyPropWarningGetter(props, displayName);
22305
- }
22306
-
22307
- if (ref) {
22308
- defineRefPropWarningGetter(props, displayName);
22309
- }
22310
- }
22311
-
22312
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
22313
- }
22314
- /**
22315
- * Create and return a new ReactElement of the given type.
22316
- * See https://reactjs.org/docs/react-api.html#createelement
22317
- */
22318
-
22319
- function createElement(type, config, children) {
22320
- var propName; // Reserved names are extracted
22321
-
22322
- var props = {};
22323
- var key = null;
22324
- var ref = null;
22325
- var self = null;
22326
- var source = null;
22327
-
22328
- if (config != null) {
22329
- if (hasValidRef(config)) {
22330
- ref = config.ref;
22331
- }
22332
-
22333
- if (hasValidKey(config)) {
22334
- key = '' + config.key;
22335
- }
22336
-
22337
- self = config.__self === undefined ? null : config.__self;
22338
- source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
22339
-
22340
- for (propName in config) {
22341
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
22342
- props[propName] = config[propName];
22343
- }
22344
- }
22345
- } // Children can be more than one argument, and those are transferred onto
22346
- // the newly allocated props object.
22347
-
22348
-
22349
- var childrenLength = arguments.length - 2;
22350
-
22351
- if (childrenLength === 1) {
22352
- props.children = children;
22353
- } else if (childrenLength > 1) {
22354
- var childArray = Array(childrenLength);
22355
-
22356
- for (var i = 0; i < childrenLength; i++) {
22357
- childArray[i] = arguments[i + 2];
22358
- }
22359
-
22360
- {
22361
- if (Object.freeze) {
22362
- Object.freeze(childArray);
22363
- }
22364
- }
22365
-
22366
- props.children = childArray;
22367
- } // Resolve default props
22368
-
22369
-
22370
- if (type && type.defaultProps) {
22371
- var defaultProps = type.defaultProps;
22372
-
22373
- for (propName in defaultProps) {
22374
- if (props[propName] === undefined) {
22375
- props[propName] = defaultProps[propName];
22376
- }
22377
- }
22378
- }
22379
-
22380
- {
22381
- if (key || ref) {
22382
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
22383
-
22384
- if (key) {
22385
- defineKeyPropWarningGetter(props, displayName);
22386
- }
22387
-
22388
- if (ref) {
22389
- defineRefPropWarningGetter(props, displayName);
22390
- }
22391
- }
22392
- }
22393
-
22394
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
22395
- }
22396
- /**
22397
- * Return a function that produces ReactElements of a given type.
22398
- * See https://reactjs.org/docs/react-api.html#createfactory
22399
- */
22400
-
22401
-
22402
- function cloneAndReplaceKey(oldElement, newKey) {
22403
- var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
22404
- return newElement;
22405
- }
22406
- /**
22407
- * Clone and return a new ReactElement using element as the starting point.
22408
- * See https://reactjs.org/docs/react-api.html#cloneelement
22409
- */
22410
-
22411
- function cloneElement(element, config, children) {
22412
- if (!!(element === null || element === undefined)) {
22413
- {
22414
- throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + ".");
22415
- }
22416
- }
22417
-
22418
- var propName; // Original props are copied
22419
-
22420
- var props = _assign({}, element.props); // Reserved names are extracted
22421
-
22422
-
22423
- var key = element.key;
22424
- var ref = element.ref; // Self is preserved since the owner is preserved.
22425
-
22426
- var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
22427
- // transpiler, and the original source is probably a better indicator of the
22428
- // true owner.
22429
-
22430
- var source = element._source; // Owner will be preserved, unless ref is overridden
22431
-
22432
- var owner = element._owner;
22433
-
22434
- if (config != null) {
22435
- if (hasValidRef(config)) {
22436
- // Silently steal the ref from the parent.
22437
- ref = config.ref;
22438
- owner = ReactCurrentOwner.current;
22439
- }
22440
-
22441
- if (hasValidKey(config)) {
22442
- key = '' + config.key;
22443
- } // Remaining properties override existing props
22444
-
22445
-
22446
- var defaultProps;
22447
-
22448
- if (element.type && element.type.defaultProps) {
22449
- defaultProps = element.type.defaultProps;
22450
- }
22451
-
22452
- for (propName in config) {
22453
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
22454
- if (config[propName] === undefined && defaultProps !== undefined) {
22455
- // Resolve default props
22456
- props[propName] = defaultProps[propName];
22457
- } else {
22458
- props[propName] = config[propName];
22459
- }
22460
- }
22461
- }
22462
- } // Children can be more than one argument, and those are transferred onto
22463
- // the newly allocated props object.
22464
-
22465
-
22466
- var childrenLength = arguments.length - 2;
22467
-
22468
- if (childrenLength === 1) {
22469
- props.children = children;
22470
- } else if (childrenLength > 1) {
22471
- var childArray = Array(childrenLength);
22472
-
22473
- for (var i = 0; i < childrenLength; i++) {
22474
- childArray[i] = arguments[i + 2];
22475
- }
22476
-
22477
- props.children = childArray;
22478
- }
22479
-
22480
- return ReactElement(element.type, key, ref, self, source, owner, props);
22481
- }
22482
- /**
22483
- * Verifies the object is a ReactElement.
22484
- * See https://reactjs.org/docs/react-api.html#isvalidelement
22485
- * @param {?object} object
22486
- * @return {boolean} True if `object` is a ReactElement.
22487
- * @final
22488
- */
22489
-
22490
- function isValidElement(object) {
22491
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
22492
- }
22493
-
22494
- var SEPARATOR = '.';
22495
- var SUBSEPARATOR = ':';
22496
- /**
22497
- * Escape and wrap key so it is safe to use as a reactid
22498
- *
22499
- * @param {string} key to be escaped.
22500
- * @return {string} the escaped key.
22501
- */
22502
-
22503
- function escape(key) {
22504
- var escapeRegex = /[=:]/g;
22505
- var escaperLookup = {
22506
- '=': '=0',
22507
- ':': '=2'
22508
- };
22509
- var escapedString = ('' + key).replace(escapeRegex, function (match) {
22510
- return escaperLookup[match];
22511
- });
22512
- return '$' + escapedString;
22513
- }
22514
- /**
22515
- * TODO: Test that a single child and an array with one item have the same key
22516
- * pattern.
22517
- */
22518
-
22519
-
22520
- var didWarnAboutMaps = false;
22521
- var userProvidedKeyEscapeRegex = /\/+/g;
22522
-
22523
- function escapeUserProvidedKey(text) {
22524
- return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');
22525
- }
22526
-
22527
- var POOL_SIZE = 10;
22528
- var traverseContextPool = [];
22529
-
22530
- function getPooledTraverseContext(mapResult, keyPrefix, mapFunction, mapContext) {
22531
- if (traverseContextPool.length) {
22532
- var traverseContext = traverseContextPool.pop();
22533
- traverseContext.result = mapResult;
22534
- traverseContext.keyPrefix = keyPrefix;
22535
- traverseContext.func = mapFunction;
22536
- traverseContext.context = mapContext;
22537
- traverseContext.count = 0;
22538
- return traverseContext;
22539
- } else {
22540
- return {
22541
- result: mapResult,
22542
- keyPrefix: keyPrefix,
22543
- func: mapFunction,
22544
- context: mapContext,
22545
- count: 0
22546
- };
22547
- }
22548
- }
22549
-
22550
- function releaseTraverseContext(traverseContext) {
22551
- traverseContext.result = null;
22552
- traverseContext.keyPrefix = null;
22553
- traverseContext.func = null;
22554
- traverseContext.context = null;
22555
- traverseContext.count = 0;
22556
-
22557
- if (traverseContextPool.length < POOL_SIZE) {
22558
- traverseContextPool.push(traverseContext);
22559
- }
22560
- }
22561
- /**
22562
- * @param {?*} children Children tree container.
22563
- * @param {!string} nameSoFar Name of the key path so far.
22564
- * @param {!function} callback Callback to invoke with each child found.
22565
- * @param {?*} traverseContext Used to pass information throughout the traversal
22566
- * process.
22567
- * @return {!number} The number of children in this subtree.
22568
- */
22569
-
22570
-
22571
- function traverseAllChildrenImpl(children, nameSoFar, callback, traverseContext) {
22572
- var type = typeof children;
22573
-
22574
- if (type === 'undefined' || type === 'boolean') {
22575
- // All of the above are perceived as null.
22576
- children = null;
22577
- }
22578
-
22579
- var invokeCallback = false;
22580
-
22581
- if (children === null) {
22582
- invokeCallback = true;
22583
- } else {
22584
- switch (type) {
22585
- case 'string':
22586
- case 'number':
22587
- invokeCallback = true;
22588
- break;
22589
-
22590
- case 'object':
22591
- switch (children.$$typeof) {
22592
- case REACT_ELEMENT_TYPE:
22593
- case REACT_PORTAL_TYPE:
22594
- invokeCallback = true;
22595
- }
22596
-
22597
- }
22598
- }
22599
-
22600
- if (invokeCallback) {
22601
- callback(traverseContext, children, // If it's the only child, treat the name as if it was wrapped in an array
22602
- // so that it's consistent if the number of children grows.
22603
- nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar);
22604
- return 1;
22605
- }
22606
-
22607
- var child;
22608
- var nextName;
22609
- var subtreeCount = 0; // Count of children found in the current subtree.
22610
-
22611
- var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
22612
-
22613
- if (Array.isArray(children)) {
22614
- for (var i = 0; i < children.length; i++) {
22615
- child = children[i];
22616
- nextName = nextNamePrefix + getComponentKey(child, i);
22617
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
22618
- }
22619
- } else {
22620
- var iteratorFn = getIteratorFn(children);
22621
-
22622
- if (typeof iteratorFn === 'function') {
22623
- {
22624
- // Warn about using Maps as children
22625
- if (iteratorFn === children.entries) {
22626
- !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
22627
- didWarnAboutMaps = true;
22628
- }
22629
- }
22630
-
22631
- var iterator = iteratorFn.call(children);
22632
- var step;
22633
- var ii = 0;
22634
-
22635
- while (!(step = iterator.next()).done) {
22636
- child = step.value;
22637
- nextName = nextNamePrefix + getComponentKey(child, ii++);
22638
- subtreeCount += traverseAllChildrenImpl(child, nextName, callback, traverseContext);
22639
- }
22640
- } else if (type === 'object') {
22641
- var addendum = '';
22642
-
22643
- {
22644
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + ReactDebugCurrentFrame.getStackAddendum();
22645
- }
22646
-
22647
- var childrenString = '' + children;
22648
-
22649
- {
22650
- {
22651
- throw Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + ")." + addendum);
22652
- }
22653
- }
22654
- }
22655
- }
22656
-
22657
- return subtreeCount;
22658
- }
22659
- /**
22660
- * Traverses children that are typically specified as `props.children`, but
22661
- * might also be specified through attributes:
22662
- *
22663
- * - `traverseAllChildren(this.props.children, ...)`
22664
- * - `traverseAllChildren(this.props.leftPanelChildren, ...)`
22665
- *
22666
- * The `traverseContext` is an optional argument that is passed through the
22667
- * entire traversal. It can be used to store accumulations or anything else that
22668
- * the callback might find relevant.
22669
- *
22670
- * @param {?*} children Children tree object.
22671
- * @param {!function} callback To invoke upon traversing each child.
22672
- * @param {?*} traverseContext Context for traversal.
22673
- * @return {!number} The number of children in this subtree.
22674
- */
22675
-
22676
-
22677
- function traverseAllChildren(children, callback, traverseContext) {
22678
- if (children == null) {
22679
- return 0;
22680
- }
22681
-
22682
- return traverseAllChildrenImpl(children, '', callback, traverseContext);
22683
- }
22684
- /**
22685
- * Generate a key string that identifies a component within a set.
22686
- *
22687
- * @param {*} component A component that could contain a manual key.
22688
- * @param {number} index Index that is used if a manual key is not provided.
22689
- * @return {string}
22690
- */
22691
-
22692
-
22693
- function getComponentKey(component, index) {
22694
- // Do some typechecking here since we call this blindly. We want to ensure
22695
- // that we don't block potential future ES APIs.
22696
- if (typeof component === 'object' && component !== null && component.key != null) {
22697
- // Explicit key
22698
- return escape(component.key);
22699
- } // Implicit key determined by the index in the set
22700
-
22701
-
22702
- return index.toString(36);
22703
- }
22704
-
22705
- function forEachSingleChild(bookKeeping, child, name) {
22706
- var func = bookKeeping.func,
22707
- context = bookKeeping.context;
22708
- func.call(context, child, bookKeeping.count++);
22709
- }
22710
- /**
22711
- * Iterates through children that are typically specified as `props.children`.
22712
- *
22713
- * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
22714
- *
22715
- * The provided forEachFunc(child, index) will be called for each
22716
- * leaf child.
22717
- *
22718
- * @param {?*} children Children tree container.
22719
- * @param {function(*, int)} forEachFunc
22720
- * @param {*} forEachContext Context for forEachContext.
22721
- */
22722
-
22723
-
22724
- function forEachChildren(children, forEachFunc, forEachContext) {
22725
- if (children == null) {
22726
- return children;
22727
- }
22728
-
22729
- var traverseContext = getPooledTraverseContext(null, null, forEachFunc, forEachContext);
22730
- traverseAllChildren(children, forEachSingleChild, traverseContext);
22731
- releaseTraverseContext(traverseContext);
22732
- }
22733
-
22734
- function mapSingleChildIntoContext(bookKeeping, child, childKey) {
22735
- var result = bookKeeping.result,
22736
- keyPrefix = bookKeeping.keyPrefix,
22737
- func = bookKeeping.func,
22738
- context = bookKeeping.context;
22739
- var mappedChild = func.call(context, child, bookKeeping.count++);
22740
-
22741
- if (Array.isArray(mappedChild)) {
22742
- mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, function (c) {
22743
- return c;
22744
- });
22745
- } else if (mappedChild != null) {
22746
- if (isValidElement(mappedChild)) {
22747
- mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
22748
- // traverseAllChildren used to do for objects as children
22749
- keyPrefix + (mappedChild.key && (!child || child.key !== mappedChild.key) ? escapeUserProvidedKey(mappedChild.key) + '/' : '') + childKey);
22750
- }
22751
-
22752
- result.push(mappedChild);
22753
- }
22754
- }
22755
-
22756
- function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {
22757
- var escapedPrefix = '';
22758
-
22759
- if (prefix != null) {
22760
- escapedPrefix = escapeUserProvidedKey(prefix) + '/';
22761
- }
22762
-
22763
- var traverseContext = getPooledTraverseContext(array, escapedPrefix, func, context);
22764
- traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);
22765
- releaseTraverseContext(traverseContext);
22766
- }
22767
- /**
22768
- * Maps children that are typically specified as `props.children`.
22769
- *
22770
- * See https://reactjs.org/docs/react-api.html#reactchildrenmap
22771
- *
22772
- * The provided mapFunction(child, key, index) will be called for each
22773
- * leaf child.
22774
- *
22775
- * @param {?*} children Children tree container.
22776
- * @param {function(*, int)} func The map function.
22777
- * @param {*} context Context for mapFunction.
22778
- * @return {object} Object containing the ordered map of results.
22779
- */
22780
-
22781
-
22782
- function mapChildren(children, func, context) {
22783
- if (children == null) {
22784
- return children;
22785
- }
22786
-
22787
- var result = [];
22788
- mapIntoWithKeyPrefixInternal(children, result, null, func, context);
22789
- return result;
22790
- }
22791
- /**
22792
- * Count the number of children that are typically specified as
22793
- * `props.children`.
22794
- *
22795
- * See https://reactjs.org/docs/react-api.html#reactchildrencount
22796
- *
22797
- * @param {?*} children Children tree container.
22798
- * @return {number} The number of children.
22799
- */
22800
-
22801
-
22802
- function countChildren(children) {
22803
- return traverseAllChildren(children, function () {
22804
- return null;
22805
- }, null);
22806
- }
22807
- /**
22808
- * Flatten a children object (typically specified as `props.children`) and
22809
- * return an array with appropriately re-keyed children.
22810
- *
22811
- * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
22812
- */
22813
-
22814
-
22815
- function toArray(children) {
22816
- var result = [];
22817
- mapIntoWithKeyPrefixInternal(children, result, null, function (child) {
22818
- return child;
22819
- });
22820
- return result;
22821
- }
22822
- /**
22823
- * Returns the first child in a collection of children and verifies that there
22824
- * is only one child in the collection.
22825
- *
22826
- * See https://reactjs.org/docs/react-api.html#reactchildrenonly
22827
- *
22828
- * The current implementation of this function assumes that a single child gets
22829
- * passed without a wrapper, but the purpose of this helper function is to
22830
- * abstract away the particular structure of children.
22831
- *
22832
- * @param {?object} children Child collection structure.
22833
- * @return {ReactElement} The first and only `ReactElement` contained in the
22834
- * structure.
22835
- */
22836
-
22837
-
22838
- function onlyChild(children) {
22839
- if (!isValidElement(children)) {
22840
- {
22841
- throw Error("React.Children.only expected to receive a single React element child.");
22842
- }
22843
- }
22844
-
22845
- return children;
22846
- }
22847
-
22848
- function createContext(defaultValue, calculateChangedBits) {
22849
- if (calculateChangedBits === undefined) {
22850
- calculateChangedBits = null;
22851
- } else {
22852
- {
22853
- !(calculateChangedBits === null || typeof calculateChangedBits === 'function') ? warningWithoutStack$1(false, 'createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits) : void 0;
22854
- }
22855
- }
22856
-
22857
- var context = {
22858
- $$typeof: REACT_CONTEXT_TYPE,
22859
- _calculateChangedBits: calculateChangedBits,
22860
- // As a workaround to support multiple concurrent renderers, we categorize
22861
- // some renderers as primary and others as secondary. We only expect
22862
- // there to be two concurrent renderers at most: React Native (primary) and
22863
- // Fabric (secondary); React DOM (primary) and React ART (secondary).
22864
- // Secondary renderers store their context values on separate fields.
22865
- _currentValue: defaultValue,
22866
- _currentValue2: defaultValue,
22867
- // Used to track how many concurrent renderers this context currently
22868
- // supports within in a single renderer. Such as parallel server rendering.
22869
- _threadCount: 0,
22870
- // These are circular
22871
- Provider: null,
22872
- Consumer: null
22873
- };
22874
- context.Provider = {
22875
- $$typeof: REACT_PROVIDER_TYPE,
22876
- _context: context
22877
- };
22878
- var hasWarnedAboutUsingNestedContextConsumers = false;
22879
- var hasWarnedAboutUsingConsumerProvider = false;
22880
-
22881
- {
22882
- // A separate object, but proxies back to the original context object for
22883
- // backwards compatibility. It has a different $$typeof, so we can properly
22884
- // warn for the incorrect usage of Context as a Consumer.
22885
- var Consumer = {
22886
- $$typeof: REACT_CONTEXT_TYPE,
22887
- _context: context,
22888
- _calculateChangedBits: context._calculateChangedBits
22889
- }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
22890
-
22891
- Object.defineProperties(Consumer, {
22892
- Provider: {
22893
- get: function () {
22894
- if (!hasWarnedAboutUsingConsumerProvider) {
22895
- hasWarnedAboutUsingConsumerProvider = true;
22896
- warning$1(false, 'Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
22897
- }
22898
-
22899
- return context.Provider;
22900
- },
22901
- set: function (_Provider) {
22902
- context.Provider = _Provider;
22903
- }
22904
- },
22905
- _currentValue: {
22906
- get: function () {
22907
- return context._currentValue;
22908
- },
22909
- set: function (_currentValue) {
22910
- context._currentValue = _currentValue;
22911
- }
22912
- },
22913
- _currentValue2: {
22914
- get: function () {
22915
- return context._currentValue2;
22916
- },
22917
- set: function (_currentValue2) {
22918
- context._currentValue2 = _currentValue2;
22919
- }
22920
- },
22921
- _threadCount: {
22922
- get: function () {
22923
- return context._threadCount;
22924
- },
22925
- set: function (_threadCount) {
22926
- context._threadCount = _threadCount;
22927
- }
22928
- },
22929
- Consumer: {
22930
- get: function () {
22931
- if (!hasWarnedAboutUsingNestedContextConsumers) {
22932
- hasWarnedAboutUsingNestedContextConsumers = true;
22933
- warning$1(false, 'Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
22934
- }
22935
-
22936
- return context.Consumer;
22937
- }
22938
- }
22939
- }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
22940
-
22941
- context.Consumer = Consumer;
22942
- }
22943
-
22944
- {
22945
- context._currentRenderer = null;
22946
- context._currentRenderer2 = null;
22947
- }
22948
-
22949
- return context;
22950
- }
22951
-
22952
- function lazy(ctor) {
22953
- var lazyType = {
22954
- $$typeof: REACT_LAZY_TYPE,
22955
- _ctor: ctor,
22956
- // React uses these fields to store the result.
22957
- _status: -1,
22958
- _result: null
22959
- };
22960
-
22961
- {
22962
- // In production, this would just set it on the object.
22963
- var defaultProps;
22964
- var propTypes;
22965
- Object.defineProperties(lazyType, {
22966
- defaultProps: {
22967
- configurable: true,
22968
- get: function () {
22969
- return defaultProps;
22970
- },
22971
- set: function (newDefaultProps) {
22972
- warning$1(false, 'React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
22973
- defaultProps = newDefaultProps; // Match production behavior more closely:
22974
-
22975
- Object.defineProperty(lazyType, 'defaultProps', {
22976
- enumerable: true
22977
- });
22978
- }
22979
- },
22980
- propTypes: {
22981
- configurable: true,
22982
- get: function () {
22983
- return propTypes;
22984
- },
22985
- set: function (newPropTypes) {
22986
- warning$1(false, 'React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
22987
- propTypes = newPropTypes; // Match production behavior more closely:
22988
-
22989
- Object.defineProperty(lazyType, 'propTypes', {
22990
- enumerable: true
22991
- });
22992
- }
22993
- }
22994
- });
22995
- }
22996
-
22997
- return lazyType;
22998
- }
22999
-
23000
- function forwardRef(render) {
23001
- {
23002
- if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
23003
- warningWithoutStack$1(false, 'forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
23004
- } else if (typeof render !== 'function') {
23005
- warningWithoutStack$1(false, 'forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
23006
- } else {
23007
- !( // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
23008
- render.length === 0 || render.length === 2) ? warningWithoutStack$1(false, 'forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.') : void 0;
23009
- }
23010
-
23011
- if (render != null) {
23012
- !(render.defaultProps == null && render.propTypes == null) ? warningWithoutStack$1(false, 'forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?') : void 0;
23013
- }
23014
- }
23015
-
23016
- return {
23017
- $$typeof: REACT_FORWARD_REF_TYPE,
23018
- render: render
23019
- };
23020
- }
23021
-
23022
- function isValidElementType(type) {
23023
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
23024
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
23025
- }
23026
-
23027
- function memo(type, compare) {
23028
- {
23029
- if (!isValidElementType(type)) {
23030
- warningWithoutStack$1(false, 'memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
23031
- }
23032
- }
23033
-
23034
- return {
23035
- $$typeof: REACT_MEMO_TYPE,
23036
- type: type,
23037
- compare: compare === undefined ? null : compare
23038
- };
23039
- }
23040
-
23041
- function resolveDispatcher() {
23042
- var dispatcher = ReactCurrentDispatcher.current;
23043
-
23044
- if (!(dispatcher !== null)) {
23045
- {
23046
- throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
23047
- }
23048
- }
23049
-
23050
- return dispatcher;
23051
- }
23052
-
23053
- function useContext(Context, unstable_observedBits) {
23054
- var dispatcher = resolveDispatcher();
23055
-
23056
- {
23057
- !(unstable_observedBits === undefined) ? warning$1(false, 'useContext() second argument is reserved for future ' + 'use in React. Passing it is not supported. ' + 'You passed: %s.%s', unstable_observedBits, typeof unstable_observedBits === 'number' && Array.isArray(arguments[2]) ? '\n\nDid you call array.map(useContext)? ' + 'Calling Hooks inside a loop is not supported. ' + 'Learn more at https://fb.me/rules-of-hooks' : '') : void 0; // TODO: add a more generic warning for invalid values.
23058
-
23059
- if (Context._context !== undefined) {
23060
- var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
23061
- // and nobody should be using this in existing code.
23062
-
23063
- if (realContext.Consumer === Context) {
23064
- warning$1(false, 'Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
23065
- } else if (realContext.Provider === Context) {
23066
- warning$1(false, 'Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
23067
- }
23068
- }
23069
- }
23070
-
23071
- return dispatcher.useContext(Context, unstable_observedBits);
23072
- }
23073
- function useState(initialState) {
23074
- var dispatcher = resolveDispatcher();
23075
- return dispatcher.useState(initialState);
23076
- }
23077
- function useReducer(reducer, initialArg, init) {
23078
- var dispatcher = resolveDispatcher();
23079
- return dispatcher.useReducer(reducer, initialArg, init);
23080
- }
23081
- function useRef(initialValue) {
23082
- var dispatcher = resolveDispatcher();
23083
- return dispatcher.useRef(initialValue);
23084
- }
23085
- function useEffect(create, inputs) {
23086
- var dispatcher = resolveDispatcher();
23087
- return dispatcher.useEffect(create, inputs);
23088
- }
23089
- function useLayoutEffect(create, inputs) {
23090
- var dispatcher = resolveDispatcher();
23091
- return dispatcher.useLayoutEffect(create, inputs);
23092
- }
23093
- function useCallback(callback, inputs) {
23094
- var dispatcher = resolveDispatcher();
23095
- return dispatcher.useCallback(callback, inputs);
23096
- }
23097
- function useMemo(create, inputs) {
23098
- var dispatcher = resolveDispatcher();
23099
- return dispatcher.useMemo(create, inputs);
23100
- }
23101
- function useImperativeHandle(ref, create, inputs) {
23102
- var dispatcher = resolveDispatcher();
23103
- return dispatcher.useImperativeHandle(ref, create, inputs);
23104
- }
23105
- function useDebugValue(value, formatterFn) {
23106
- {
23107
- var dispatcher = resolveDispatcher();
23108
- return dispatcher.useDebugValue(value, formatterFn);
23109
- }
23110
- }
23111
- var emptyObject$1 = {};
23112
- function useResponder(responder, listenerProps) {
23113
- var dispatcher = resolveDispatcher();
23114
-
23115
- {
23116
- if (responder == null || responder.$$typeof !== REACT_RESPONDER_TYPE) {
23117
- warning$1(false, 'useResponder: invalid first argument. Expected an event responder, but instead got %s', responder);
23118
- return;
23119
- }
23120
- }
23121
-
23122
- return dispatcher.useResponder(responder, listenerProps || emptyObject$1);
23123
- }
23124
- function useTransition(config) {
23125
- var dispatcher = resolveDispatcher();
23126
- return dispatcher.useTransition(config);
23127
- }
23128
- function useDeferredValue(value, config) {
23129
- var dispatcher = resolveDispatcher();
23130
- return dispatcher.useDeferredValue(value, config);
23131
- }
23132
-
23133
- function withSuspenseConfig(scope, config) {
23134
- var previousConfig = ReactCurrentBatchConfig.suspense;
23135
- ReactCurrentBatchConfig.suspense = config === undefined ? null : config;
23136
-
23137
- try {
23138
- scope();
23139
- } finally {
23140
- ReactCurrentBatchConfig.suspense = previousConfig;
23141
- }
23142
- }
23143
-
23144
- /**
23145
- * ReactElementValidator provides a wrapper around a element factory
23146
- * which validates the props passed to the element. This is intended to be
23147
- * used only in DEV and could be replaced by a static type checker for languages
23148
- * that support it.
23149
- */
23150
- var propTypesMisspellWarningShown;
23151
-
23152
- {
23153
- propTypesMisspellWarningShown = false;
23154
- }
23155
-
23156
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
23157
-
23158
- function getDeclarationErrorAddendum() {
23159
- if (ReactCurrentOwner.current) {
23160
- var name = getComponentName(ReactCurrentOwner.current.type);
23161
-
23162
- if (name) {
23163
- return '\n\nCheck the render method of `' + name + '`.';
23164
- }
23165
- }
23166
-
23167
- return '';
23168
- }
23169
-
23170
- function getSourceInfoErrorAddendum(source) {
23171
- if (source !== undefined) {
23172
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
23173
- var lineNumber = source.lineNumber;
23174
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
23175
- }
23176
-
23177
- return '';
23178
- }
23179
-
23180
- function getSourceInfoErrorAddendumForProps(elementProps) {
23181
- if (elementProps !== null && elementProps !== undefined) {
23182
- return getSourceInfoErrorAddendum(elementProps.__source);
23183
- }
23184
-
23185
- return '';
23186
- }
23187
- /**
23188
- * Warn if there's no key explicitly set on dynamic arrays of children or
23189
- * object keys are not valid. This allows us to keep track of children between
23190
- * updates.
23191
- */
23192
-
23193
-
23194
- var ownerHasKeyUseWarning = {};
23195
-
23196
- function getCurrentComponentErrorInfo(parentType) {
23197
- var info = getDeclarationErrorAddendum();
23198
-
23199
- if (!info) {
23200
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
23201
-
23202
- if (parentName) {
23203
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
23204
- }
23205
- }
23206
-
23207
- return info;
23208
- }
23209
- /**
23210
- * Warn if the element doesn't have an explicit key assigned to it.
23211
- * This element is in an array. The array could grow and shrink or be
23212
- * reordered. All children that haven't already been validated are required to
23213
- * have a "key" property assigned to it. Error statuses are cached so a warning
23214
- * will only be shown once.
23215
- *
23216
- * @internal
23217
- * @param {ReactElement} element Element that requires a key.
23218
- * @param {*} parentType element's parent's type.
23219
- */
23220
-
23221
-
23222
- function validateExplicitKey(element, parentType) {
23223
- if (!element._store || element._store.validated || element.key != null) {
23224
- return;
23225
- }
23226
-
23227
- element._store.validated = true;
23228
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
23229
-
23230
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
23231
- return;
23232
- }
23233
-
23234
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
23235
- // property, it may be the creator of the child that's responsible for
23236
- // assigning it a key.
23237
-
23238
- var childOwner = '';
23239
-
23240
- if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
23241
- // Give the component that originally created this child.
23242
- childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
23243
- }
23244
-
23245
- setCurrentlyValidatingElement(element);
23246
-
23247
- {
23248
- warning$1(false, 'Each child in a list should have a unique "key" prop.' + '%s%s See https://fb.me/react-warning-keys for more information.', currentComponentErrorInfo, childOwner);
23249
- }
23250
-
23251
- setCurrentlyValidatingElement(null);
23252
- }
23253
- /**
23254
- * Ensure that every element either is passed in a static location, in an
23255
- * array with an explicit keys property defined, or in an object literal
23256
- * with valid key property.
23257
- *
23258
- * @internal
23259
- * @param {ReactNode} node Statically passed child of any type.
23260
- * @param {*} parentType node's parent's type.
23261
- */
23262
-
23263
-
23264
- function validateChildKeys(node, parentType) {
23265
- if (typeof node !== 'object') {
23266
- return;
23267
- }
23268
-
23269
- if (Array.isArray(node)) {
23270
- for (var i = 0; i < node.length; i++) {
23271
- var child = node[i];
23272
-
23273
- if (isValidElement(child)) {
23274
- validateExplicitKey(child, parentType);
23275
- }
23276
- }
23277
- } else if (isValidElement(node)) {
23278
- // This element was passed in a valid location.
23279
- if (node._store) {
23280
- node._store.validated = true;
23281
- }
23282
- } else if (node) {
23283
- var iteratorFn = getIteratorFn(node);
23284
-
23285
- if (typeof iteratorFn === 'function') {
23286
- // Entry iterators used to provide implicit keys,
23287
- // but now we print a separate warning for them later.
23288
- if (iteratorFn !== node.entries) {
23289
- var iterator = iteratorFn.call(node);
23290
- var step;
23291
-
23292
- while (!(step = iterator.next()).done) {
23293
- if (isValidElement(step.value)) {
23294
- validateExplicitKey(step.value, parentType);
23295
- }
23296
- }
23297
- }
23298
- }
23299
- }
23300
- }
23301
- /**
23302
- * Given an element, validate that its props follow the propTypes definition,
23303
- * provided by the type.
23304
- *
23305
- * @param {ReactElement} element
23306
- */
23307
-
23308
-
23309
- function validatePropTypes(element) {
23310
- var type = element.type;
23311
-
23312
- if (type === null || type === undefined || typeof type === 'string') {
23313
- return;
23314
- }
23315
-
23316
- var name = getComponentName(type);
23317
- var propTypes;
23318
-
23319
- if (typeof type === 'function') {
23320
- propTypes = type.propTypes;
23321
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
23322
- // Inner props are checked in the reconciler.
23323
- type.$$typeof === REACT_MEMO_TYPE)) {
23324
- propTypes = type.propTypes;
23325
- } else {
23326
- return;
23327
- }
23328
-
23329
- if (propTypes) {
23330
- setCurrentlyValidatingElement(element);
23331
- checkPropTypes(propTypes, element.props, 'prop', name, ReactDebugCurrentFrame.getStackAddendum);
23332
- setCurrentlyValidatingElement(null);
23333
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
23334
- propTypesMisspellWarningShown = true;
23335
- warningWithoutStack$1(false, 'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
23336
- }
23337
-
23338
- if (typeof type.getDefaultProps === 'function') {
23339
- !type.getDefaultProps.isReactClassApproved ? warningWithoutStack$1(false, 'getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.') : void 0;
23340
- }
23341
- }
23342
- /**
23343
- * Given a fragment, validate that it can only be provided with fragment props
23344
- * @param {ReactElement} fragment
23345
- */
23346
-
23347
-
23348
- function validateFragmentProps(fragment) {
23349
- setCurrentlyValidatingElement(fragment);
23350
- var keys = Object.keys(fragment.props);
23351
-
23352
- for (var i = 0; i < keys.length; i++) {
23353
- var key = keys[i];
23354
-
23355
- if (key !== 'children' && key !== 'key') {
23356
- warning$1(false, 'Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
23357
- break;
23358
- }
23359
- }
23360
-
23361
- if (fragment.ref !== null) {
23362
- warning$1(false, 'Invalid attribute `ref` supplied to `React.Fragment`.');
23363
- }
23364
-
23365
- setCurrentlyValidatingElement(null);
23366
- }
23367
-
23368
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
23369
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
23370
- // succeed and there will likely be errors in render.
23371
-
23372
- if (!validType) {
23373
- var info = '';
23374
-
23375
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
23376
- 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.";
23377
- }
23378
-
23379
- var sourceInfo = getSourceInfoErrorAddendum(source);
23380
-
23381
- if (sourceInfo) {
23382
- info += sourceInfo;
23383
- } else {
23384
- info += getDeclarationErrorAddendum();
23385
- }
23386
-
23387
- var typeString;
23388
-
23389
- if (type === null) {
23390
- typeString = 'null';
23391
- } else if (Array.isArray(type)) {
23392
- typeString = 'array';
23393
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
23394
- typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
23395
- info = ' Did you accidentally export a JSX literal instead of a component?';
23396
- } else {
23397
- typeString = typeof type;
23398
- }
23399
-
23400
- warning$1(false, 'React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
23401
- }
23402
-
23403
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
23404
- // TODO: Drop this when these are no longer allowed as the type argument.
23405
-
23406
- if (element == null) {
23407
- return element;
23408
- } // Skip key warning if the type isn't valid since our key validation logic
23409
- // doesn't expect a non-string/function type and can throw confusing errors.
23410
- // We don't want exception behavior to differ between dev and prod.
23411
- // (Rendering will throw with a helpful message and as soon as the type is
23412
- // fixed, the key warnings will appear.)
23413
-
23414
-
23415
- if (validType) {
23416
- var children = props.children;
23417
-
23418
- if (children !== undefined) {
23419
- if (isStaticChildren) {
23420
- if (Array.isArray(children)) {
23421
- for (var i = 0; i < children.length; i++) {
23422
- validateChildKeys(children[i], type);
23423
- }
23424
-
23425
- if (Object.freeze) {
23426
- Object.freeze(children);
23427
- }
23428
- } else {
23429
- warning$1(false, 'React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
23430
- }
23431
- } else {
23432
- validateChildKeys(children, type);
23433
- }
23434
- }
23435
- }
23436
-
23437
- if (hasOwnProperty$1.call(props, 'key')) {
23438
- warning$1(false, 'React.jsx: Spreading a key to JSX is a deprecated pattern. ' + 'Explicitly pass a key after spreading props in your JSX call. ' + 'E.g. <ComponentName {...props} key={key} />');
23439
- }
23440
-
23441
- if (type === REACT_FRAGMENT_TYPE) {
23442
- validateFragmentProps(element);
23443
- } else {
23444
- validatePropTypes(element);
23445
- }
23446
-
23447
- return element;
23448
- } // These two functions exist to still get child warnings in dev
23449
- // even with the prod transform. This means that jsxDEV is purely
23450
- // opt-in behavior for better messages but that we won't stop
23451
- // giving you warnings if you use production apis.
23452
-
23453
- function jsxWithValidationStatic(type, props, key) {
23454
- return jsxWithValidation(type, props, key, true);
23455
- }
23456
- function jsxWithValidationDynamic(type, props, key) {
23457
- return jsxWithValidation(type, props, key, false);
23458
- }
23459
- function createElementWithValidation(type, props, children) {
23460
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
23461
- // succeed and there will likely be errors in render.
23462
-
23463
- if (!validType) {
23464
- var info = '';
23465
-
23466
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
23467
- 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.";
23468
- }
23469
-
23470
- var sourceInfo = getSourceInfoErrorAddendumForProps(props);
23471
-
23472
- if (sourceInfo) {
23473
- info += sourceInfo;
23474
- } else {
23475
- info += getDeclarationErrorAddendum();
23476
- }
23477
-
23478
- var typeString;
23479
-
23480
- if (type === null) {
23481
- typeString = 'null';
23482
- } else if (Array.isArray(type)) {
23483
- typeString = 'array';
23484
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
23485
- typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
23486
- info = ' Did you accidentally export a JSX literal instead of a component?';
23487
- } else {
23488
- typeString = typeof type;
23489
- }
23490
-
23491
- warning$1(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);
23492
- }
23493
-
23494
- var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
23495
- // TODO: Drop this when these are no longer allowed as the type argument.
23496
-
23497
- if (element == null) {
23498
- return element;
23499
- } // Skip key warning if the type isn't valid since our key validation logic
23500
- // doesn't expect a non-string/function type and can throw confusing errors.
23501
- // We don't want exception behavior to differ between dev and prod.
23502
- // (Rendering will throw with a helpful message and as soon as the type is
23503
- // fixed, the key warnings will appear.)
23504
-
23505
-
23506
- if (validType) {
23507
- for (var i = 2; i < arguments.length; i++) {
23508
- validateChildKeys(arguments[i], type);
23509
- }
23510
- }
23511
-
23512
- if (type === REACT_FRAGMENT_TYPE) {
23513
- validateFragmentProps(element);
23514
- } else {
23515
- validatePropTypes(element);
23516
- }
23517
-
23518
- return element;
23519
- }
23520
- function createFactoryWithValidation(type) {
23521
- var validatedFactory = createElementWithValidation.bind(null, type);
23522
- validatedFactory.type = type; // Legacy hook: remove it
23523
-
23524
- {
23525
- Object.defineProperty(validatedFactory, 'type', {
23526
- enumerable: false,
23527
- get: function () {
23528
- lowPriorityWarningWithoutStack$1(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
23529
- Object.defineProperty(this, 'type', {
23530
- value: type
23531
- });
23532
- return type;
23533
- }
23534
- });
23535
- }
23536
-
23537
- return validatedFactory;
23538
- }
23539
- function cloneElementWithValidation(element, props, children) {
23540
- var newElement = cloneElement.apply(this, arguments);
23541
-
23542
- for (var i = 2; i < arguments.length; i++) {
23543
- validateChildKeys(arguments[i], newElement.type);
23544
- }
23545
-
23546
- validatePropTypes(newElement);
23547
- return newElement;
23548
- }
23549
-
23550
- var hasBadMapPolyfill;
23551
-
23552
- {
23553
- hasBadMapPolyfill = false;
23554
-
23555
- try {
23556
- var frozenObject = Object.freeze({});
23557
- var testMap = new Map([[frozenObject, null]]);
23558
- var testSet = new Set([frozenObject]); // This is necessary for Rollup to not consider these unused.
23559
- // https://github.com/rollup/rollup/issues/1771
23560
- // TODO: we can remove these if Rollup fixes the bug.
23561
-
23562
- testMap.set(0, 0);
23563
- testSet.add(0);
23564
- } catch (e) {
23565
- // TODO: Consider warning about bad polyfills
23566
- hasBadMapPolyfill = true;
23567
- }
23568
- }
23569
-
23570
- function createFundamentalComponent(impl) {
23571
- // We use responder as a Map key later on. When we have a bad
23572
- // polyfill, then we can't use it as a key as the polyfill tries
23573
- // to add a property to the object.
23574
- if (true && !hasBadMapPolyfill) {
23575
- Object.freeze(impl);
23576
- }
23577
-
23578
- var fundamantalComponent = {
23579
- $$typeof: REACT_FUNDAMENTAL_TYPE,
23580
- impl: impl
23581
- };
23582
-
23583
- {
23584
- Object.freeze(fundamantalComponent);
23585
- }
23586
-
23587
- return fundamantalComponent;
23588
- }
23589
-
23590
- function createEventResponder(displayName, responderConfig) {
23591
- var getInitialState = responderConfig.getInitialState,
23592
- onEvent = responderConfig.onEvent,
23593
- onMount = responderConfig.onMount,
23594
- onUnmount = responderConfig.onUnmount,
23595
- onRootEvent = responderConfig.onRootEvent,
23596
- rootEventTypes = responderConfig.rootEventTypes,
23597
- targetEventTypes = responderConfig.targetEventTypes,
23598
- targetPortalPropagation = responderConfig.targetPortalPropagation;
23599
- var eventResponder = {
23600
- $$typeof: REACT_RESPONDER_TYPE,
23601
- displayName: displayName,
23602
- getInitialState: getInitialState || null,
23603
- onEvent: onEvent || null,
23604
- onMount: onMount || null,
23605
- onRootEvent: onRootEvent || null,
23606
- onUnmount: onUnmount || null,
23607
- rootEventTypes: rootEventTypes || null,
23608
- targetEventTypes: targetEventTypes || null,
23609
- targetPortalPropagation: targetPortalPropagation || false
23610
- }; // We use responder as a Map key later on. When we have a bad
23611
- // polyfill, then we can't use it as a key as the polyfill tries
23612
- // to add a property to the object.
23613
-
23614
- if (true && !hasBadMapPolyfill) {
23615
- Object.freeze(eventResponder);
23616
- }
23617
-
23618
- return eventResponder;
23619
- }
23620
-
23621
- function createScope() {
23622
- var scopeComponent = {
23623
- $$typeof: REACT_SCOPE_TYPE
23624
- };
23625
-
23626
- {
23627
- Object.freeze(scopeComponent);
23628
- }
23629
-
23630
- return scopeComponent;
23631
- }
23632
-
23633
- // Helps identify side effects in render-phase lifecycle hooks and setState
23634
- // reducers by double invoking them in Strict Mode.
23635
-
23636
- // To preserve the "Pause on caught exceptions" behavior of the debugger, we
23637
- // replay the begin phase of a failed component inside invokeGuardedCallback.
23638
-
23639
- // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
23640
-
23641
- // Gather advanced timing metrics for Profiler subtrees.
23642
-
23643
- // Trace which interactions trigger each commit.
23644
-
23645
- // SSR experiments
23646
-
23647
-
23648
- // Only used in www builds.
23649
-
23650
- // Only used in www builds.
23651
-
23652
- // Disable javascript: URL strings in href for XSS protection.
23653
-
23654
- // React Fire: prevent the value and checked attributes from syncing
23655
- // with their related DOM properties
23656
-
23657
- // These APIs will no longer be "unstable" in the upcoming 16.7 release,
23658
- // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
23659
-
23660
- var exposeConcurrentModeAPIs = false;
23661
- // Experimental React Flare event system and event components support.
23662
-
23663
- var enableFlareAPI = false; // Experimental Host Component support.
23664
-
23665
- var enableFundamentalAPI = false; // Experimental Scope support.
23666
-
23667
- var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
23668
-
23669
- var enableJSXTransformAPI = false; // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
23670
- // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
23671
-
23672
- // For tests, we flush suspense fallbacks in an act scope;
23673
- // *except* in some of our own tests, where we test incremental loading states.
23674
-
23675
- // Add a callback property to suspense to notify which promises are currently
23676
- // in the update queue. This allows reporting and tracing of what is causing
23677
- // the user to see a loading state.
23678
- // Also allows hydration callbacks to fire when a dehydrated boundary gets
23679
- // hydrated or deleted.
23680
-
23681
- // Part of the simplification of React.createElement so we can eventually move
23682
- // from React.createElement to React.jsx
23683
- // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
23684
-
23685
-
23686
-
23687
-
23688
-
23689
- // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
23690
-
23691
- var React = {
23692
- Children: {
23693
- map: mapChildren,
23694
- forEach: forEachChildren,
23695
- count: countChildren,
23696
- toArray: toArray,
23697
- only: onlyChild
23698
- },
23699
- createRef: createRef,
23700
- Component: Component,
23701
- PureComponent: PureComponent,
23702
- createContext: createContext,
23703
- forwardRef: forwardRef,
23704
- lazy: lazy,
23705
- memo: memo,
23706
- useCallback: useCallback,
23707
- useContext: useContext,
23708
- useEffect: useEffect,
23709
- useImperativeHandle: useImperativeHandle,
23710
- useDebugValue: useDebugValue,
23711
- useLayoutEffect: useLayoutEffect,
23712
- useMemo: useMemo,
23713
- useReducer: useReducer,
23714
- useRef: useRef,
23715
- useState: useState,
23716
- Fragment: REACT_FRAGMENT_TYPE,
23717
- Profiler: REACT_PROFILER_TYPE,
23718
- StrictMode: REACT_STRICT_MODE_TYPE,
23719
- Suspense: REACT_SUSPENSE_TYPE,
23720
- createElement: createElementWithValidation,
23721
- cloneElement: cloneElementWithValidation,
23722
- createFactory: createFactoryWithValidation,
23723
- isValidElement: isValidElement,
23724
- version: ReactVersion,
23725
- __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals
23726
- };
23727
-
23728
- if (exposeConcurrentModeAPIs) {
23729
- React.useTransition = useTransition;
23730
- React.useDeferredValue = useDeferredValue;
23731
- React.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
23732
- React.unstable_withSuspenseConfig = withSuspenseConfig;
23733
- }
23734
-
23735
- if (enableFlareAPI) {
23736
- React.unstable_useResponder = useResponder;
23737
- React.unstable_createResponder = createEventResponder;
23738
- }
23739
-
23740
- if (enableFundamentalAPI) {
23741
- React.unstable_createFundamental = createFundamentalComponent;
23742
- }
23743
-
23744
- if (enableScopeAPI) {
23745
- React.unstable_createScope = createScope;
23746
- } // Note: some APIs are added with feature flags.
23747
- // Make sure that stable builds for open source
23748
- // don't modify the React object to avoid deopts.
23749
- // Also let's not expose their names in stable builds.
23750
-
23751
-
23752
- if (enableJSXTransformAPI) {
23753
- {
23754
- React.jsxDEV = jsxWithValidation;
23755
- React.jsx = jsxWithValidationDynamic;
23756
- React.jsxs = jsxWithValidationStatic;
23757
- }
23758
- }
23759
-
23760
-
23761
-
23762
- var React$2 = Object.freeze({
23763
- default: React
23764
- });
23765
-
23766
- var React$3 = ( React$2 && React ) || React$2;
23767
-
23768
- // TODO: decide on the top-level export form.
23769
- // This is hacky but makes it work with both Rollup and Jest.
23770
-
23771
-
23772
- var react = React$3.default || React$3;
23773
-
23774
- module.exports = react;
23775
- })();
23776
- }
23777
-
23778
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
23779
-
23780
- /***/ }),
23781
- /* 299 */
23782
- /***/ (function(module, exports, __webpack_require__) {
23783
-
23784
- "use strict";
23785
- /** @license React v16.12.0
23786
- * react-dom.production.min.js
23787
- *
23788
- * Copyright (c) Facebook, Inc. and its affiliates.
23789
- *
23790
- * This source code is licensed under the MIT license found in the
23791
- * LICENSE file in the root directory of this source tree.
23792
- */
23793
-
23794
- /*
23795
- Modernizr 3.0.0pre (Custom Build) | MIT
23796
- */
23797
- var aa=__webpack_require__(0),n=__webpack_require__(43),q=__webpack_require__(133);function u(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!aa)throw Error(u(227));var ba=null,ca={};
23798
- function da(){if(ba)for(var a in ca){var b=ca[a],c=ba.indexOf(a);if(!(-1<c))throw Error(u(96,a));if(!ea[c]){if(!b.extractEvents)throw Error(u(97,a));ea[c]=b;c=b.eventTypes;for(var d in c){var e=void 0;var f=c[d],g=b,h=d;if(fa.hasOwnProperty(h))throw Error(u(99,h));fa[h]=f;var k=f.phasedRegistrationNames;if(k){for(e in k)k.hasOwnProperty(e)&&ha(k[e],g,h);e=!0}else f.registrationName?(ha(f.registrationName,g,h),e=!0):e=!1;if(!e)throw Error(u(98,d,a));}}}}
23799
- function ha(a,b,c){if(ia[a])throw Error(u(100,a));ia[a]=b;ja[a]=b.eventTypes[c].dependencies}var ea=[],fa={},ia={},ja={};function ka(a,b,c,d,e,f,g,h,k){var l=Array.prototype.slice.call(arguments,3);try{b.apply(c,l)}catch(m){this.onError(m)}}var la=!1,ma=null,na=!1,oa=null,pa={onError:function(a){la=!0;ma=a}};function qa(a,b,c,d,e,f,g,h,k){la=!1;ma=null;ka.apply(pa,arguments)}
23800
- function ra(a,b,c,d,e,f,g,h,k){qa.apply(this,arguments);if(la){if(la){var l=ma;la=!1;ma=null}else throw Error(u(198));na||(na=!0,oa=l)}}var sa=null,ua=null,va=null;function wa(a,b,c){var d=a.type||"unknown-event";a.currentTarget=va(c);ra(d,b,void 0,a);a.currentTarget=null}function xa(a,b){if(null==b)throw Error(u(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}
23801
- function ya(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}var za=null;function Aa(a){if(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))for(var d=0;d<b.length&&!a.isPropagationStopped();d++)wa(a,b[d],c[d]);else b&&wa(a,b,c);a._dispatchListeners=null;a._dispatchInstances=null;a.isPersistent()||a.constructor.release(a)}}function Ba(a){null!==a&&(za=xa(za,a));a=za;za=null;if(a){ya(a,Aa);if(za)throw Error(u(95));if(na)throw a=oa,na=!1,oa=null,a;}}
23802
- var Ca={injectEventPluginOrder:function(a){if(ba)throw Error(u(101));ba=Array.prototype.slice.call(a);da()},injectEventPluginsByName:function(a){var b=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(!ca.hasOwnProperty(c)||ca[c]!==d){if(ca[c])throw Error(u(102,c));ca[c]=d;b=!0}}b&&da()}};
23803
- function Da(a,b){var c=a.stateNode;if(!c)return null;var d=sa(c);if(!d)return null;c=d[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(d=!d.disabled)||(a=a.type,d=!("button"===a||"input"===a||"select"===a||"textarea"===a));a=!d;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error(u(231,b,typeof c));
23804
- return c}var Ea=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Ea.hasOwnProperty("ReactCurrentDispatcher")||(Ea.ReactCurrentDispatcher={current:null});Ea.hasOwnProperty("ReactCurrentBatchConfig")||(Ea.ReactCurrentBatchConfig={suspense:null});
23805
- var Fa=/^(.*)[\\\/]/,w="function"===typeof Symbol&&Symbol.for,Ga=w?Symbol.for("react.element"):60103,Ha=w?Symbol.for("react.portal"):60106,Ia=w?Symbol.for("react.fragment"):60107,Ja=w?Symbol.for("react.strict_mode"):60108,Ka=w?Symbol.for("react.profiler"):60114,La=w?Symbol.for("react.provider"):60109,Ma=w?Symbol.for("react.context"):60110,Na=w?Symbol.for("react.concurrent_mode"):60111,Oa=w?Symbol.for("react.forward_ref"):60112,Pa=w?Symbol.for("react.suspense"):60113,Qa=w?Symbol.for("react.suspense_list"):
23806
- 60120,Ra=w?Symbol.for("react.memo"):60115,Sa=w?Symbol.for("react.lazy"):60116;w&&Symbol.for("react.fundamental");w&&Symbol.for("react.responder");w&&Symbol.for("react.scope");var Ta="function"===typeof Symbol&&Symbol.iterator;function Ua(a){if(null===a||"object"!==typeof a)return null;a=Ta&&a[Ta]||a["@@iterator"];return"function"===typeof a?a:null}
23807
- function Va(a){if(-1===a._status){a._status=0;var b=a._ctor;b=b();a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b)},function(b){0===a._status&&(a._status=2,a._result=b)})}}
23808
- function Wa(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case Ia:return"Fragment";case Ha:return"Portal";case Ka:return"Profiler";case Ja:return"StrictMode";case Pa:return"Suspense";case Qa:return"SuspenseList"}if("object"===typeof a)switch(a.$$typeof){case Ma:return"Context.Consumer";case La:return"Context.Provider";case Oa:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":
23809
- "ForwardRef");case Ra:return Wa(a.type);case Sa:if(a=1===a._status?a._result:null)return Wa(a)}return null}function Xa(a){var b="";do{a:switch(a.tag){case 3:case 4:case 6:case 7:case 10:case 9:var c="";break a;default:var d=a._debugOwner,e=a._debugSource,f=Wa(a.type);c=null;d&&(c=Wa(d.type));d=f;f="";e?f=" (at "+e.fileName.replace(Fa,"")+":"+e.lineNumber+")":c&&(f=" (created by "+c+")");c="\n in "+(d||"Unknown")+f}b+=c;a=a.return}while(a);return b}
23810
- var Ya=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),Za=null,$a=null,ab=null;function bb(a){if(a=ua(a)){if("function"!==typeof Za)throw Error(u(280));var b=sa(a.stateNode);Za(a.stateNode,a.type,b)}}function cb(a){$a?ab?ab.push(a):ab=[a]:$a=a}function db(){if($a){var a=$a,b=ab;ab=$a=null;bb(a);if(b)for(a=0;a<b.length;a++)bb(b[a])}}function eb(a,b){return a(b)}function fb(a,b,c,d){return a(b,c,d)}function gb(){}
23811
- var hb=eb,ib=!1,jb=!1;function kb(){if(null!==$a||null!==ab)gb(),db()}new Map;var lb=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,mb=Object.prototype.hasOwnProperty,nb={},ob={};
23812
- function pb(a){if(mb.call(ob,a))return!0;if(mb.call(nb,a))return!1;if(lb.test(a))return ob[a]=!0;nb[a]=!0;return!1}function qb(a,b,c,d){if(null!==c&&0===c.type)return!1;switch(typeof b){case "function":case "symbol":return!0;case "boolean":if(d)return!1;if(null!==c)return!c.acceptsBooleans;a=a.toLowerCase().slice(0,5);return"data-"!==a&&"aria-"!==a;default:return!1}}
23813
- function rb(a,b,c,d){if(null===b||"undefined"===typeof b||qb(a,b,c,d))return!0;if(d)return!1;if(null!==c)switch(c.type){case 3:return!b;case 4:return!1===b;case 5:return isNaN(b);case 6:return isNaN(b)||1>b}return!1}function B(a,b,c,d,e,f){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f}var D={};
23814
- "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1)});
23815
- ["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1)});
23816
- ["checked","multiple","muted","selected"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1)});["capture","download"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1)});["cols","rows","size","span"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1)});["rowSpan","start"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1)});var sb=/[\-:]([a-z])/g;function tb(a){return a[1].toUpperCase()}
23817
- "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(sb,
23818
- tb);D[b]=new B(b,1,!1,a,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(sb,tb);D[b]=new B(b,1,!1,a,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(sb,tb);D[b]=new B(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1)});
23819
- D.xlinkHref=new B("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0)});function ub(a){switch(typeof a){case "boolean":case "number":case "object":case "string":case "undefined":return a;default:return""}}
23820
- function vb(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2<b.length)||"o"!==b[0]&&"O"!==b[0]||"n"!==b[1]&&"N"!==b[1]?!1:!0;f||(rb(b,c,e,d)&&(c=null),d||null===e?pb(b)&&(null===c?a.removeAttribute(b):a.setAttribute(b,""+c)):e.mustUseProperty?a[e.propertyName]=null===c?3===e.type?!1:"":c:(b=e.attributeName,d=e.attributeNamespace,null===c?a.removeAttribute(b):(e=e.type,c=3===e||4===e&&!0===c?"":""+c,d?a.setAttributeNS(d,b,c):a.setAttribute(b,c))))}
23821
- function wb(a){var b=a.type;return(a=a.nodeName)&&"input"===a.toLowerCase()&&("checkbox"===b||"radio"===b)}
23822
- function xb(a){var b=wb(a)?"checked":"value",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=""+a[b];if(!a.hasOwnProperty(b)&&"undefined"!==typeof c&&"function"===typeof c.get&&"function"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=""+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=""+a},stopTracking:function(){a._valueTracker=
23823
- null;delete a[b]}}}}function yb(a){a._valueTracker||(a._valueTracker=xb(a))}function zb(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d="";a&&(d=wb(a)?a.checked?"true":"false":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Ab(a,b){var c=b.checked;return n({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}
23824
- function Bb(a,b){var c=null==b.defaultValue?"":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=ub(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:"checkbox"===b.type||"radio"===b.type?null!=b.checked:null!=b.value}}function Cb(a,b){b=b.checked;null!=b&&vb(a,"checked",b,!1)}
23825
- function Eb(a,b){Cb(a,b);var c=ub(b.value),d=b.type;if(null!=c)if("number"===d){if(0===c&&""===a.value||a.value!=c)a.value=""+c}else a.value!==""+c&&(a.value=""+c);else if("submit"===d||"reset"===d){a.removeAttribute("value");return}b.hasOwnProperty("value")?Fb(a,b.type,c):b.hasOwnProperty("defaultValue")&&Fb(a,b.type,ub(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}
23826
- function Gb(a,b,c){if(b.hasOwnProperty("value")||b.hasOwnProperty("defaultValue")){var d=b.type;if(!("submit"!==d&&"reset"!==d||void 0!==b.value&&null!==b.value))return;b=""+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;""!==c&&(a.name="");a.defaultChecked=!a.defaultChecked;a.defaultChecked=!!a._wrapperState.initialChecked;""!==c&&(a.name=c)}
23827
- function Fb(a,b,c){if("number"!==b||a.ownerDocument.activeElement!==a)null==c?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+c&&(a.defaultValue=""+c)}function Hb(a){var b="";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function Ib(a,b){a=n({children:void 0},b);if(b=Hb(b.children))a.children=b;return a}
23828
- function Jb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e<c.length;e++)b["$"+c[e]]=!0;for(c=0;c<a.length;c++)e=b.hasOwnProperty("$"+a[c].value),a[c].selected!==e&&(a[c].selected=e),e&&d&&(a[c].defaultSelected=!0)}else{c=""+ub(c);b=null;for(e=0;e<a.length;e++){if(a[e].value===c){a[e].selected=!0;d&&(a[e].defaultSelected=!0);return}null!==b||a[e].disabled||(b=a[e])}null!==b&&(b.selected=!0)}}
23829
- function Kb(a,b){if(null!=b.dangerouslySetInnerHTML)throw Error(u(91));return n({},b,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Lb(a,b){var c=b.value;if(null==c){c=b.defaultValue;b=b.children;if(null!=b){if(null!=c)throw Error(u(92));if(Array.isArray(b)){if(!(1>=b.length))throw Error(u(93));b=b[0]}c=b}null==c&&(c="")}a._wrapperState={initialValue:ub(c)}}
23830
- function Mb(a,b){var c=ub(b.value),d=ub(b.defaultValue);null!=c&&(c=""+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=""+d)}function Nb(a){var b=a.textContent;b===a._wrapperState.initialValue&&""!==b&&null!==b&&(a.value=b)}var Ob={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};
23831
- function Pb(a){switch(a){case "svg":return"http://www.w3.org/2000/svg";case "math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qb(a,b){return null==a||"http://www.w3.org/1999/xhtml"===a?Pb(b):"http://www.w3.org/2000/svg"===a&&"foreignObject"===b?"http://www.w3.org/1999/xhtml":a}
23832
- var Rb,Sb=function(a){return"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==Ob.svg||"innerHTML"in a)a.innerHTML=b;else{Rb=Rb||document.createElement("div");Rb.innerHTML="<svg>"+b.valueOf().toString()+"</svg>";for(b=Rb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});
23833
- function Tb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}function Ub(a,b){var c={};c[a.toLowerCase()]=b.toLowerCase();c["Webkit"+a]="webkit"+b;c["Moz"+a]="moz"+b;return c}var Vb={animationend:Ub("Animation","AnimationEnd"),animationiteration:Ub("Animation","AnimationIteration"),animationstart:Ub("Animation","AnimationStart"),transitionend:Ub("Transition","TransitionEnd")},Wb={},Xb={};
23834
- Ya&&(Xb=document.createElement("div").style,"AnimationEvent"in window||(delete Vb.animationend.animation,delete Vb.animationiteration.animation,delete Vb.animationstart.animation),"TransitionEvent"in window||delete Vb.transitionend.transition);function Yb(a){if(Wb[a])return Wb[a];if(!Vb[a])return a;var b=Vb[a],c;for(c in b)if(b.hasOwnProperty(c)&&c in Xb)return Wb[a]=b[c];return a}var Zb=Yb("animationend"),$b=Yb("animationiteration"),ac=Yb("animationstart"),bc=Yb("transitionend"),cc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" ");
23835
- function ec(a){var b=a,c=a;if(a.alternate)for(;b.return;)b=b.return;else{a=b;do b=a,0!==(b.effectTag&1026)&&(c=b.return),a=b.return;while(a)}return 3===b.tag?c:null}function fc(a){if(13===a.tag){var b=a.memoizedState;null===b&&(a=a.alternate,null!==a&&(b=a.memoizedState));if(null!==b)return b.dehydrated}return null}function gc(a){if(ec(a)!==a)throw Error(u(188));}
23836
- function hc(a){var b=a.alternate;if(!b){b=ec(a);if(null===b)throw Error(u(188));return b!==a?null:a}for(var c=a,d=b;;){var e=c.return;if(null===e)break;var f=e.alternate;if(null===f){d=e.return;if(null!==d){c=d;continue}break}if(e.child===f.child){for(f=e.child;f;){if(f===c)return gc(e),a;if(f===d)return gc(e),b;f=f.sibling}throw Error(u(188));}if(c.return!==d.return)c=e,d=f;else{for(var g=!1,h=e.child;h;){if(h===c){g=!0;c=e;d=f;break}if(h===d){g=!0;d=e;c=f;break}h=h.sibling}if(!g){for(h=f.child;h;){if(h===
23837
- c){g=!0;c=f;d=e;break}if(h===d){g=!0;d=f;c=e;break}h=h.sibling}if(!g)throw Error(u(189));}}if(c.alternate!==d)throw Error(u(190));}if(3!==c.tag)throw Error(u(188));return c.stateNode.current===c?a:b}function ic(a){a=hc(a);if(!a)return null;for(var b=a;;){if(5===b.tag||6===b.tag)return b;if(b.child)b.child.return=b,b=b.child;else{if(b===a)break;for(;!b.sibling;){if(!b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}}return null}
23838
- var jc,kc,lc,mc=!1,nc=[],oc=null,pc=null,qc=null,rc=new Map,sc=new Map,tc=[],uc="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),vc="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");
23839
- function wc(a){var b=xc(a);uc.forEach(function(c){yc(c,a,b)});vc.forEach(function(c){yc(c,a,b)})}function zc(a,b,c,d){return{blockedOn:a,topLevelType:b,eventSystemFlags:c|32,nativeEvent:d}}function Ac(a,b){switch(a){case "focus":case "blur":oc=null;break;case "dragenter":case "dragleave":pc=null;break;case "mouseover":case "mouseout":qc=null;break;case "pointerover":case "pointerout":rc.delete(b.pointerId);break;case "gotpointercapture":case "lostpointercapture":sc.delete(b.pointerId)}}
23840
- function Bc(a,b,c,d,e){if(null===a||a.nativeEvent!==e)return a=zc(b,c,d,e),null!==b&&(b=Cc(b),null!==b&&kc(b)),a;a.eventSystemFlags|=d;return a}function Dc(a,b,c,d){switch(b){case "focus":return oc=Bc(oc,a,b,c,d),!0;case "dragenter":return pc=Bc(pc,a,b,c,d),!0;case "mouseover":return qc=Bc(qc,a,b,c,d),!0;case "pointerover":var e=d.pointerId;rc.set(e,Bc(rc.get(e)||null,a,b,c,d));return!0;case "gotpointercapture":return e=d.pointerId,sc.set(e,Bc(sc.get(e)||null,a,b,c,d)),!0}return!1}
23841
- function Ec(a){var b=Fc(a.target);if(null!==b){var c=ec(b);if(null!==c)if(b=c.tag,13===b){if(b=fc(c),null!==b){a.blockedOn=b;q.unstable_runWithPriority(a.priority,function(){lc(c)});return}}else if(3===b&&c.stateNode.hydrate){a.blockedOn=3===c.tag?c.stateNode.containerInfo:null;return}}a.blockedOn=null}function Gc(a){if(null!==a.blockedOn)return!1;var b=Hc(a.topLevelType,a.eventSystemFlags,a.nativeEvent);if(null!==b){var c=Cc(b);null!==c&&kc(c);a.blockedOn=b;return!1}return!0}
23842
- function Ic(a,b,c){Gc(a)&&c.delete(b)}function Jc(){for(mc=!1;0<nc.length;){var a=nc[0];if(null!==a.blockedOn){a=Cc(a.blockedOn);null!==a&&jc(a);break}var b=Hc(a.topLevelType,a.eventSystemFlags,a.nativeEvent);null!==b?a.blockedOn=b:nc.shift()}null!==oc&&Gc(oc)&&(oc=null);null!==pc&&Gc(pc)&&(pc=null);null!==qc&&Gc(qc)&&(qc=null);rc.forEach(Ic);sc.forEach(Ic)}function Kc(a,b){a.blockedOn===b&&(a.blockedOn=null,mc||(mc=!0,q.unstable_scheduleCallback(q.unstable_NormalPriority,Jc)))}
23843
- function Lc(a){function b(b){return Kc(b,a)}if(0<nc.length){Kc(nc[0],a);for(var c=1;c<nc.length;c++){var d=nc[c];d.blockedOn===a&&(d.blockedOn=null)}}null!==oc&&Kc(oc,a);null!==pc&&Kc(pc,a);null!==qc&&Kc(qc,a);rc.forEach(b);sc.forEach(b);for(c=0;c<tc.length;c++)d=tc[c],d.blockedOn===a&&(d.blockedOn=null);for(;0<tc.length&&(c=tc[0],null===c.blockedOn);)Ec(c),null===c.blockedOn&&tc.shift()}
23844
- function Mc(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}function Nc(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function Oc(a,b,c){if(b=Da(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a)}
23845
- function Pc(a){if(a&&a.dispatchConfig.phasedRegistrationNames){for(var b=a._targetInst,c=[];b;)c.push(b),b=Nc(b);for(b=c.length;0<b--;)Oc(c[b],"captured",a);for(b=0;b<c.length;b++)Oc(c[b],"bubbled",a)}}function Qc(a,b,c){a&&c&&c.dispatchConfig.registrationName&&(b=Da(a,c.dispatchConfig.registrationName))&&(c._dispatchListeners=xa(c._dispatchListeners,b),c._dispatchInstances=xa(c._dispatchInstances,a))}function Rc(a){a&&a.dispatchConfig.registrationName&&Qc(a._targetInst,null,a)}
23846
- function Sc(a){ya(a,Pc)}function Tc(){return!0}function Uc(){return!1}function E(a,b,c,d){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var e in a)a.hasOwnProperty(e)&&((b=a[e])?this[e]=b(c):"target"===e?this.target=d:this[e]=c[e]);this.isDefaultPrevented=(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?Tc:Uc;this.isPropagationStopped=Uc;return this}
23847
- n(E.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=Tc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=Tc)},persist:function(){this.isPersistent=Tc},isPersistent:Uc,destructor:function(){var a=this.constructor.Interface,
23848
- b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=Uc;this._dispatchInstances=this._dispatchListeners=null}});E.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};
23849
- E.extend=function(a){function b(){}function c(){return d.apply(this,arguments)}var d=this;b.prototype=d.prototype;var e=new b;n(e,c.prototype);c.prototype=e;c.prototype.constructor=c;c.Interface=n({},d.Interface,a);c.extend=d.extend;Vc(c);return c};Vc(E);function Wc(a,b,c,d){if(this.eventPool.length){var e=this.eventPool.pop();this.call(e,a,b,c,d);return e}return new this(a,b,c,d)}
23850
- function Xc(a){if(!(a instanceof this))throw Error(u(279));a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function Vc(a){a.eventPool=[];a.getPooled=Wc;a.release=Xc}var Yc=E.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Zc=E.extend({clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),$c=E.extend({view:null,detail:null}),ad=$c.extend({relatedTarget:null});
23851
- function bd(a){var b=a.keyCode;"charCode"in a?(a=a.charCode,0===a&&13===b&&(a=13)):a=b;10===a&&(a=13);return 32<=a||13===a?a:0}
23852
- var cd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dd={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",
23853
- 116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ed={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gd(a){var b=this.nativeEvent;return b.getModifierState?b.getModifierState(a):(a=ed[a])?!!b[a]:!1}function hd(){return gd}
23854
- var id=$c.extend({key:function(a){if(a.key){var b=cd[a.key]||a.key;if("Unidentified"!==b)return b}return"keypress"===a.type?(a=bd(a),13===a?"Enter":String.fromCharCode(a)):"keydown"===a.type||"keyup"===a.type?dd[a.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:hd,charCode:function(a){return"keypress"===a.type?bd(a):0},keyCode:function(a){return"keydown"===a.type||"keyup"===a.type?a.keyCode:0},which:function(a){return"keypress"===
23855
- a.type?bd(a):"keydown"===a.type||"keyup"===a.type?a.keyCode:0}}),jd=0,kd=0,ld=!1,md=!1,nd=$c.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:hd,button:null,buttons:null,relatedTarget:function(a){return a.relatedTarget||(a.fromElement===a.srcElement?a.toElement:a.fromElement)},movementX:function(a){if("movementX"in a)return a.movementX;var b=jd;jd=a.screenX;return ld?"mousemove"===a.type?a.screenX-
23856
- b:0:(ld=!0,0)},movementY:function(a){if("movementY"in a)return a.movementY;var b=kd;kd=a.screenY;return md?"mousemove"===a.type?a.screenY-b:0:(md=!0,0)}}),od=nd.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),pd=nd.extend({dataTransfer:null}),qd=$c.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:hd}),rd=E.extend({propertyName:null,
23857
- elapsedTime:null,pseudoElement:null}),sd=nd.extend({deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:null,deltaMode:null}),td=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",
23858
- 0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",
23859
- 0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",
23860
- 2],[Zb,"animationEnd",2],[$b,"animationIteration",2],[ac,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress",
23861
- "progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[bc,"transitionEnd",2],["waiting","waiting",2]],ud={},vd={},wd=0;for(;wd<td.length;wd++){var yd=td[wd],zd=yd[0],Ad=yd[1],Bd=yd[2],Cd="on"+(Ad[0].toUpperCase()+Ad.slice(1)),Dd={phasedRegistrationNames:{bubbled:Cd,captured:Cd+"Capture"},dependencies:[zd],eventPriority:Bd};ud[Ad]=Dd;vd[zd]=Dd}
23862
- var Ed={eventTypes:ud,getEventPriority:function(a){a=vd[a];return void 0!==a?a.eventPriority:2},extractEvents:function(a,b,c,d){var e=vd[a];if(!e)return null;switch(a){case "keypress":if(0===bd(c))return null;case "keydown":case "keyup":a=id;break;case "blur":case "focus":a=ad;break;case "click":if(2===c.button)return null;case "auxclick":case "dblclick":case "mousedown":case "mousemove":case "mouseup":case "mouseout":case "mouseover":case "contextmenu":a=nd;break;case "drag":case "dragend":case "dragenter":case "dragexit":case "dragleave":case "dragover":case "dragstart":case "drop":a=
23863
- pd;break;case "touchcancel":case "touchend":case "touchmove":case "touchstart":a=qd;break;case Zb:case $b:case ac:a=Yc;break;case bc:a=rd;break;case "scroll":a=$c;break;case "wheel":a=sd;break;case "copy":case "cut":case "paste":a=Zc;break;case "gotpointercapture":case "lostpointercapture":case "pointercancel":case "pointerdown":case "pointermove":case "pointerout":case "pointerover":case "pointerup":a=od;break;default:a=E}b=a.getPooled(e,b,c,d);Sc(b);return b}},Fd=q.unstable_UserBlockingPriority,
23864
- Gd=q.unstable_runWithPriority,Hd=Ed.getEventPriority,Id=10,Jd=[];
23865
- function Kd(a){var b=a.targetInst,c=b;do{if(!c){a.ancestors.push(c);break}var d=c;if(3===d.tag)d=d.stateNode.containerInfo;else{for(;d.return;)d=d.return;d=3!==d.tag?null:d.stateNode.containerInfo}if(!d)break;b=c.tag;5!==b&&6!==b||a.ancestors.push(c);c=Fc(d)}while(c);for(c=0;c<a.ancestors.length;c++){b=a.ancestors[c];var e=Mc(a.nativeEvent);d=a.topLevelType;for(var f=a.nativeEvent,g=a.eventSystemFlags,h=null,k=0;k<ea.length;k++){var l=ea[k];l&&(l=l.extractEvents(d,b,f,e,g))&&(h=xa(h,l))}Ba(h)}}
23866
- var Ld=!0;function F(a,b){Md(b,a,!1)}function Md(a,b,c){switch(Hd(b)){case 0:var d=Nd.bind(null,b,1);break;case 1:d=Od.bind(null,b,1);break;default:d=Pd.bind(null,b,1)}c?a.addEventListener(b,d,!0):a.addEventListener(b,d,!1)}function Nd(a,b,c){ib||gb();var d=Pd,e=ib;ib=!0;try{fb(d,a,b,c)}finally{(ib=e)||kb()}}function Od(a,b,c){Gd(Fd,Pd.bind(null,a,b,c))}
23867
- function Qd(a,b,c,d){if(Jd.length){var e=Jd.pop();e.topLevelType=a;e.eventSystemFlags=b;e.nativeEvent=c;e.targetInst=d;a=e}else a={topLevelType:a,eventSystemFlags:b,nativeEvent:c,targetInst:d,ancestors:[]};try{if(b=Kd,c=a,jb)b(c,void 0);else{jb=!0;try{hb(b,c,void 0)}finally{jb=!1,kb()}}}finally{a.topLevelType=null,a.nativeEvent=null,a.targetInst=null,a.ancestors.length=0,Jd.length<Id&&Jd.push(a)}}
23868
- function Pd(a,b,c){if(Ld)if(0<nc.length&&-1<uc.indexOf(a))a=zc(null,a,b,c),nc.push(a);else{var d=Hc(a,b,c);null===d?Ac(a,c):-1<uc.indexOf(a)?(a=zc(d,a,b,c),nc.push(a)):Dc(d,a,b,c)||(Ac(a,c),Qd(a,b,c,null))}}function Hc(a,b,c){var d=Mc(c);d=Fc(d);if(null!==d){var e=ec(d);if(null===e)d=null;else{var f=e.tag;if(13===f){d=fc(e);if(null!==d)return d;d=null}else if(3===f){if(e.stateNode.hydrate)return 3===e.tag?e.stateNode.containerInfo:null;d=null}else e!==d&&(d=null)}}Qd(a,b,c,d);return null}
23869
- function Rd(a){if(!Ya)return!1;a="on"+a;var b=a in document;b||(b=document.createElement("div"),b.setAttribute(a,"return;"),b="function"===typeof b[a]);return b}var Sd=new ("function"===typeof WeakMap?WeakMap:Map);function xc(a){var b=Sd.get(a);void 0===b&&(b=new Set,Sd.set(a,b));return b}
23870
- function yc(a,b,c){if(!c.has(a)){switch(a){case "scroll":Md(b,"scroll",!0);break;case "focus":case "blur":Md(b,"focus",!0);Md(b,"blur",!0);c.add("blur");c.add("focus");break;case "cancel":case "close":Rd(a)&&Md(b,a,!0);break;case "invalid":case "submit":case "reset":break;default:-1===cc.indexOf(a)&&F(a,b)}c.add(a)}}
23871
- var Td={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,
23872
- floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ud=["Webkit","ms","Moz","O"];Object.keys(Td).forEach(function(a){Ud.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);Td[b]=Td[a]})});function Vd(a,b,c){return null==b||"boolean"===typeof b||""===b?"":c||"number"!==typeof b||0===b||Td.hasOwnProperty(a)&&Td[a]?(""+b).trim():b+"px"}
23873
- function Wd(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf("--"),e=Vd(c,b[c],d);"float"===c&&(c="cssFloat");d?a.setProperty(c,e):a[c]=e}}var Xd=n({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});
23874
- function Yd(a,b){if(b){if(Xd[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(u(137,a,""));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(u(60));if(!("object"===typeof b.dangerouslySetInnerHTML&&"__html"in b.dangerouslySetInnerHTML))throw Error(u(61));}if(null!=b.style&&"object"!==typeof b.style)throw Error(u(62,""));}}
23875
- function Zd(a,b){if(-1===a.indexOf("-"))return"string"===typeof b.is;switch(a){case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return!1;default:return!0}}function $d(a,b){a=9===a.nodeType||11===a.nodeType?a:a.ownerDocument;var c=xc(a);b=ja[b];for(var d=0;d<b.length;d++)yc(b[d],a,c)}function ae(){}
23876
- function be(a){a=a||("undefined"!==typeof document?document:void 0);if("undefined"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}function ce(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function de(a,b){var c=ce(a);a=0;for(var d;c;){if(3===c.nodeType){d=a+c.textContent.length;if(a<=b&&d>=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=ce(c)}}
23877
- function ee(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?ee(a,b.parentNode):"contains"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}function fe(){for(var a=window,b=be();b instanceof a.HTMLIFrameElement;){try{var c="string"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=be(a.document)}return b}
23878
- function ge(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&("input"===b&&("text"===a.type||"search"===a.type||"tel"===a.type||"url"===a.type||"password"===a.type)||"textarea"===b||"true"===a.contentEditable)}var he="$",ie="/$",je="$?",ke="$!",le=null,me=null;function ne(a,b){switch(a){case "button":case "input":case "select":case "textarea":return!!b.autoFocus}return!1}
23879
- function oe(a,b){return"textarea"===a||"option"===a||"noscript"===a||"string"===typeof b.children||"number"===typeof b.children||"object"===typeof b.dangerouslySetInnerHTML&&null!==b.dangerouslySetInnerHTML&&null!=b.dangerouslySetInnerHTML.__html}var pe="function"===typeof setTimeout?setTimeout:void 0,qe="function"===typeof clearTimeout?clearTimeout:void 0;function re(a){for(;null!=a;a=a.nextSibling){var b=a.nodeType;if(1===b||3===b)break}return a}
23880
- function se(a){a=a.previousSibling;for(var b=0;a;){if(8===a.nodeType){var c=a.data;if(c===he||c===ke||c===je){if(0===b)return a;b--}else c===ie&&b++}a=a.previousSibling}return null}var te=Math.random().toString(36).slice(2),ue="__reactInternalInstance$"+te,ve="__reactEventHandlers$"+te,we="__reactContainere$"+te;
23881
- function Fc(a){var b=a[ue];if(b)return b;for(var c=a.parentNode;c;){if(b=c[we]||c[ue]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=se(a);null!==a;){if(c=a[ue])return c;a=se(a)}return b}a=c;c=a.parentNode}return null}function Cc(a){a=a[ue]||a[we];return!a||5!==a.tag&&6!==a.tag&&13!==a.tag&&3!==a.tag?null:a}function xe(a){if(5===a.tag||6===a.tag)return a.stateNode;throw Error(u(33));}function ye(a){return a[ve]||null}var ze=null,Ae=null,Be=null;
23882
- function Ce(){if(Be)return Be;var a,b=Ae,c=b.length,d,e="value"in ze?ze.value:ze.textContent,f=e.length;for(a=0;a<c&&b[a]===e[a];a++);var g=c-a;for(d=1;d<=g&&b[c-d]===e[f-d];d++);return Be=e.slice(a,1<d?1-d:void 0)}var De=E.extend({data:null}),Ee=E.extend({data:null}),Fe=[9,13,27,32],Ge=Ya&&"CompositionEvent"in window,He=null;Ya&&"documentMode"in document&&(He=document.documentMode);
23883
- var Ie=Ya&&"TextEvent"in window&&!He,Je=Ya&&(!Ge||He&&8<He&&11>=He),Ke=String.fromCharCode(32),Le={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",
23884
- captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Me=!1;
23885
- function Ne(a,b){switch(a){case "keyup":return-1!==Fe.indexOf(b.keyCode);case "keydown":return 229!==b.keyCode;case "keypress":case "mousedown":case "blur":return!0;default:return!1}}function Oe(a){a=a.detail;return"object"===typeof a&&"data"in a?a.data:null}var Pe=!1;function Qe(a,b){switch(a){case "compositionend":return Oe(b);case "keypress":if(32!==b.which)return null;Me=!0;return Ke;case "textInput":return a=b.data,a===Ke&&Me?null:a;default:return null}}
23886
- function Re(a,b){if(Pe)return"compositionend"===a||!Ge&&Ne(a,b)?(a=Ce(),Be=Ae=ze=null,Pe=!1,a):null;switch(a){case "paste":return null;case "keypress":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1<b.char.length)return b.char;if(b.which)return String.fromCharCode(b.which)}return null;case "compositionend":return Je&&"ko"!==b.locale?null:b.data;default:return null}}
23887
- var Se={eventTypes:Le,extractEvents:function(a,b,c,d){var e;if(Ge)b:{switch(a){case "compositionstart":var f=Le.compositionStart;break b;case "compositionend":f=Le.compositionEnd;break b;case "compositionupdate":f=Le.compositionUpdate;break b}f=void 0}else Pe?Ne(a,c)&&(f=Le.compositionEnd):"keydown"===a&&229===c.keyCode&&(f=Le.compositionStart);f?(Je&&"ko"!==c.locale&&(Pe||f!==Le.compositionStart?f===Le.compositionEnd&&Pe&&(e=Ce()):(ze=d,Ae="value"in ze?ze.value:ze.textContent,Pe=!0)),f=De.getPooled(f,
23888
- b,c,d),e?f.data=e:(e=Oe(c),null!==e&&(f.data=e)),Sc(f),e=f):e=null;(a=Ie?Qe(a,c):Re(a,c))?(b=Ee.getPooled(Le.beforeInput,b,c,d),b.data=a,Sc(b)):b=null;return null===e?b:null===b?e:[e,b]}},Te={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ue(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return"input"===b?!!Te[a.type]:"textarea"===b?!0:!1}
23889
- var Ve={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function We(a,b,c){a=E.getPooled(Ve.change,a,b,c);a.type="change";cb(c);Sc(a);return a}var Xe=null,Ye=null;function Ze(a){Ba(a)}function $e(a){var b=xe(a);if(zb(b))return a}function af(a,b){if("change"===a)return b}var bf=!1;Ya&&(bf=Rd("input")&&(!document.documentMode||9<document.documentMode));
23890
- function cf(){Xe&&(Xe.detachEvent("onpropertychange",df),Ye=Xe=null)}function df(a){if("value"===a.propertyName&&$e(Ye))if(a=We(Ye,a,Mc(a)),ib)Ba(a);else{ib=!0;try{eb(Ze,a)}finally{ib=!1,kb()}}}function ef(a,b,c){"focus"===a?(cf(),Xe=b,Ye=c,Xe.attachEvent("onpropertychange",df)):"blur"===a&&cf()}function ff(a){if("selectionchange"===a||"keyup"===a||"keydown"===a)return $e(Ye)}function gf(a,b){if("click"===a)return $e(b)}function hf(a,b){if("input"===a||"change"===a)return $e(b)}
23891
- var jf={eventTypes:Ve,_isInputEventSupported:bf,extractEvents:function(a,b,c,d){var e=b?xe(b):window,f=e.nodeName&&e.nodeName.toLowerCase();if("select"===f||"input"===f&&"file"===e.type)var g=af;else if(Ue(e))if(bf)g=hf;else{g=ff;var h=ef}else(f=e.nodeName)&&"input"===f.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)&&(g=gf);if(g&&(g=g(a,b)))return We(g,c,d);h&&h(a,e,b);"blur"===a&&(a=e._wrapperState)&&a.controlled&&"number"===e.type&&Fb(e,"number",e.value)}},kf={mouseEnter:{registrationName:"onMouseEnter",
23892
- dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},lf,mf={eventTypes:kf,extractEvents:function(a,b,c,d,e){var f="mouseover"===a||"pointerover"===a,g="mouseout"===a||"pointerout"===a;if(f&&0===(e&32)&&(c.relatedTarget||c.fromElement)||!g&&!f)return null;
23893
- e=d.window===d?d:(e=d.ownerDocument)?e.defaultView||e.parentWindow:window;if(g){if(g=b,b=(b=c.relatedTarget||c.toElement)?Fc(b):null,null!==b&&(f=ec(b),b!==f||5!==b.tag&&6!==b.tag))b=null}else g=null;if(g===b)return null;if("mouseout"===a||"mouseover"===a){var h=nd;var k=kf.mouseLeave;var l=kf.mouseEnter;var m="mouse"}else if("pointerout"===a||"pointerover"===a)h=od,k=kf.pointerLeave,l=kf.pointerEnter,m="pointer";a=null==g?e:xe(g);e=null==b?e:xe(b);k=h.getPooled(k,g,c,d);k.type=m+"leave";k.target=
23894
- a;k.relatedTarget=e;d=h.getPooled(l,b,c,d);d.type=m+"enter";d.target=e;d.relatedTarget=a;h=g;m=b;if(h&&m)a:{l=h;a=m;g=0;for(b=l;b;b=Nc(b))g++;b=0;for(e=a;e;e=Nc(e))b++;for(;0<g-b;)l=Nc(l),g--;for(;0<b-g;)a=Nc(a),b--;for(;g--;){if(l===a||l===a.alternate)break a;l=Nc(l);a=Nc(a)}l=null}else l=null;a=l;for(l=[];h&&h!==a;){g=h.alternate;if(null!==g&&g===a)break;l.push(h);h=Nc(h)}for(h=[];m&&m!==a;){g=m.alternate;if(null!==g&&g===a)break;h.push(m);m=Nc(m)}for(m=0;m<l.length;m++)Qc(l[m],"bubbled",k);for(m=
23895
- h.length;0<m--;)Qc(h[m],"captured",d);if(c===lf)return lf=null,[k];lf=c;return[k,d]}};function nf(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var of="function"===typeof Object.is?Object.is:nf,pf=Object.prototype.hasOwnProperty;function qf(a,b){if(of(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(d=0;d<c.length;d++)if(!pf.call(b,c[d])||!of(a[c[d]],b[c[d]]))return!1;return!0}
23896
- var rf=Ya&&"documentMode"in document&&11>=document.documentMode,sf={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},tf=null,uf=null,vf=null,wf=!1;
23897
- function xf(a,b){var c=b.window===b?b.document:9===b.nodeType?b:b.ownerDocument;if(wf||null==tf||tf!==be(c))return null;c=tf;"selectionStart"in c&&ge(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset});return vf&&qf(vf,c)?null:(vf=c,a=E.getPooled(sf.select,uf,a,b),a.type="select",a.target=tf,Sc(a),a)}
23898
- var yf={eventTypes:sf,extractEvents:function(a,b,c,d){var e=d.window===d?d.document:9===d.nodeType?d:d.ownerDocument,f;if(!(f=!e)){a:{e=xc(e);f=ja.onSelect;for(var g=0;g<f.length;g++)if(!e.has(f[g])){e=!1;break a}e=!0}f=!e}if(f)return null;e=b?xe(b):window;switch(a){case "focus":if(Ue(e)||"true"===e.contentEditable)tf=e,uf=b,vf=null;break;case "blur":vf=uf=tf=null;break;case "mousedown":wf=!0;break;case "contextmenu":case "mouseup":case "dragend":return wf=!1,xf(c,d);case "selectionchange":if(rf)break;
23899
- case "keydown":case "keyup":return xf(c,d)}return null}};Ca.injectEventPluginOrder("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));var zf=Cc;sa=ye;ua=zf;va=xe;Ca.injectEventPluginsByName({SimpleEventPlugin:Ed,EnterLeaveEventPlugin:mf,ChangeEventPlugin:jf,SelectEventPlugin:yf,BeforeInputEventPlugin:Se});new Set;var Af=[],Bf=-1;function G(a){0>Bf||(a.current=Af[Bf],Af[Bf]=null,Bf--)}
23900
- function I(a,b){Bf++;Af[Bf]=a.current;a.current=b}var Cf={},J={current:Cf},K={current:!1},Df=Cf;function Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function L(a){a=a.childContextTypes;return null!==a&&void 0!==a}
23901
- function Ff(a){G(K,a);G(J,a)}function Gf(a){G(K,a);G(J,a)}function Hf(a,b,c){if(J.current!==Cf)throw Error(u(168));I(J,b,a);I(K,c,a)}function If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if("function"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(u(108,Wa(b)||"Unknown",e));return n({},c,{},d)}function Jf(a){var b=a.stateNode;b=b&&b.__reactInternalMemoizedMergedChildContext||Cf;Df=J.current;I(J,b,a);I(K,K.current,a);return!0}
23902
- function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(u(169));c?(b=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=b,G(K,a),G(J,a),I(J,b,a)):G(K,a);I(K,c,a)}
23903
- var Lf=q.unstable_runWithPriority,Mf=q.unstable_scheduleCallback,Nf=q.unstable_cancelCallback,Of=q.unstable_shouldYield,Pf=q.unstable_requestPaint,Qf=q.unstable_now,Rf=q.unstable_getCurrentPriorityLevel,Sf=q.unstable_ImmediatePriority,Tf=q.unstable_UserBlockingPriority,Uf=q.unstable_NormalPriority,Vf=q.unstable_LowPriority,Wf=q.unstable_IdlePriority,Xf={},Yf=void 0!==Pf?Pf:function(){},Zf=null,$f=null,ag=!1,bg=Qf(),cg=1E4>bg?Qf:function(){return Qf()-bg};
23904
- function dg(){switch(Rf()){case Sf:return 99;case Tf:return 98;case Uf:return 97;case Vf:return 96;case Wf:return 95;default:throw Error(u(332));}}function eg(a){switch(a){case 99:return Sf;case 98:return Tf;case 97:return Uf;case 96:return Vf;case 95:return Wf;default:throw Error(u(332));}}function fg(a,b){a=eg(a);return Lf(a,b)}function gg(a,b,c){a=eg(a);return Mf(a,b,c)}function hg(a){null===Zf?(Zf=[a],$f=Mf(Sf,ig)):Zf.push(a);return Xf}function jg(){if(null!==$f){var a=$f;$f=null;Nf(a)}ig()}
23905
- function ig(){if(!ag&&null!==Zf){ag=!0;var a=0;try{var b=Zf;fg(99,function(){for(;a<b.length;a++){var c=b[a];do c=c(!0);while(null!==c)}});Zf=null}catch(c){throw null!==Zf&&(Zf=Zf.slice(a+1)),Mf(Sf,jg),c;}finally{ag=!1}}}var kg=3;function lg(a,b,c){c/=10;return 1073741821-(((1073741821-a+b/10)/c|0)+1)*c}function mg(a,b){if(a&&a.defaultProps){b=n({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c])}return b}var ng={current:null},og=null,pg=null,qg=null;function rg(){qg=pg=og=null}
23906
- function sg(a,b){var c=a.type._context;I(ng,c._currentValue,a);c._currentValue=b}function tg(a){var b=ng.current;G(ng,a);a.type._context._currentValue=b}function ug(a,b){for(;null!==a;){var c=a.alternate;if(a.childExpirationTime<b)a.childExpirationTime=b,null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);else if(null!==c&&c.childExpirationTime<b)c.childExpirationTime=b;else break;a=a.return}}
23907
- function vg(a,b){og=a;qg=pg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(a.expirationTime>=b&&(wg=!0),a.firstContext=null)}function xg(a,b){if(qg!==a&&!1!==b&&0!==b){if("number"!==typeof b||1073741823===b)qg=a,b=1073741823;b={context:a,observedBits:b,next:null};if(null===pg){if(null===og)throw Error(u(308));pg=b;og.dependencies={expirationTime:0,firstContext:b,responders:null}}else pg=pg.next=b}return a._currentValue}var yg=!1;
23908
- function zg(a){return{baseState:a,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function Ag(a){return{baseState:a.baseState,firstUpdate:a.firstUpdate,lastUpdate:a.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}
23909
- function Bg(a,b){return{expirationTime:a,suspenseConfig:b,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function Cg(a,b){null===a.lastUpdate?a.firstUpdate=a.lastUpdate=b:(a.lastUpdate.next=b,a.lastUpdate=b)}
23910
- function Dg(a,b){var c=a.alternate;if(null===c){var d=a.updateQueue;var e=null;null===d&&(d=a.updateQueue=zg(a.memoizedState))}else d=a.updateQueue,e=c.updateQueue,null===d?null===e?(d=a.updateQueue=zg(a.memoizedState),e=c.updateQueue=zg(c.memoizedState)):d=a.updateQueue=Ag(e):null===e&&(e=c.updateQueue=Ag(d));null===e||d===e?Cg(d,b):null===d.lastUpdate||null===e.lastUpdate?(Cg(d,b),Cg(e,b)):(Cg(d,b),e.lastUpdate=b)}
23911
- function Eg(a,b){var c=a.updateQueue;c=null===c?a.updateQueue=zg(a.memoizedState):Fg(a,c);null===c.lastCapturedUpdate?c.firstCapturedUpdate=c.lastCapturedUpdate=b:(c.lastCapturedUpdate.next=b,c.lastCapturedUpdate=b)}function Fg(a,b){var c=a.alternate;null!==c&&b===c.updateQueue&&(b=a.updateQueue=Ag(b));return b}
23912
- function Gg(a,b,c,d,e,f){switch(c.tag){case 1:return a=c.payload,"function"===typeof a?a.call(f,d,e):a;case 3:a.effectTag=a.effectTag&-4097|64;case 0:a=c.payload;e="function"===typeof a?a.call(f,d,e):a;if(null===e||void 0===e)break;return n({},d,e);case 2:yg=!0}return d}
23913
- function Hg(a,b,c,d,e){yg=!1;b=Fg(a,b);for(var f=b.baseState,g=null,h=0,k=b.firstUpdate,l=f;null!==k;){var m=k.expirationTime;m<e?(null===g&&(g=k,f=l),h<m&&(h=m)):(Ig(m,k.suspenseConfig),l=Gg(a,b,k,l,c,d),null!==k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastEffect?b.firstEffect=b.lastEffect=k:(b.lastEffect.nextEffect=k,b.lastEffect=k)));k=k.next}m=null;for(k=b.firstCapturedUpdate;null!==k;){var C=k.expirationTime;C<e?(null===m&&(m=k,null===g&&(f=l)),h<C&&(h=C)):(l=Gg(a,b,k,l,c,d),null!==
23914
- k.callback&&(a.effectTag|=32,k.nextEffect=null,null===b.lastCapturedEffect?b.firstCapturedEffect=b.lastCapturedEffect=k:(b.lastCapturedEffect.nextEffect=k,b.lastCapturedEffect=k)));k=k.next}null===g&&(b.lastUpdate=null);null===m?b.lastCapturedUpdate=null:a.effectTag|=32;null===g&&null===m&&(f=l);b.baseState=f;b.firstUpdate=g;b.firstCapturedUpdate=m;Jg(h);a.expirationTime=h;a.memoizedState=l}
23915
- function Kg(a,b,c){null!==b.firstCapturedUpdate&&(null!==b.lastUpdate&&(b.lastUpdate.next=b.firstCapturedUpdate,b.lastUpdate=b.lastCapturedUpdate),b.firstCapturedUpdate=b.lastCapturedUpdate=null);Lg(b.firstEffect,c);b.firstEffect=b.lastEffect=null;Lg(b.firstCapturedEffect,c);b.firstCapturedEffect=b.lastCapturedEffect=null}function Lg(a,b){for(;null!==a;){var c=a.callback;if(null!==c){a.callback=null;var d=b;if("function"!==typeof c)throw Error(u(191,c));c.call(d)}a=a.nextEffect}}
23916
- var Mg=Ea.ReactCurrentBatchConfig,Ng=(new aa.Component).refs;function Og(a,b,c,d){b=a.memoizedState;c=c(d,b);c=null===c||void 0===c?b:n({},b,c);a.memoizedState=c;d=a.updateQueue;null!==d&&0===a.expirationTime&&(d.baseState=c)}
23917
- var Sg={isMounted:function(a){return(a=a._reactInternalFiber)?ec(a)===a:!1},enqueueSetState:function(a,b,c){a=a._reactInternalFiber;var d=Pg(),e=Mg.suspense;d=Qg(d,a,e);e=Bg(d,e);e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Dg(a,e);Rg(a,d)},enqueueReplaceState:function(a,b,c){a=a._reactInternalFiber;var d=Pg(),e=Mg.suspense;d=Qg(d,a,e);e=Bg(d,e);e.tag=1;e.payload=b;void 0!==c&&null!==c&&(e.callback=c);Dg(a,e);Rg(a,d)},enqueueForceUpdate:function(a,b){a=a._reactInternalFiber;var c=Pg(),d=Mg.suspense;
23918
- c=Qg(c,a,d);d=Bg(c,d);d.tag=2;void 0!==b&&null!==b&&(d.callback=b);Dg(a,d);Rg(a,c)}};function Tg(a,b,c,d,e,f,g){a=a.stateNode;return"function"===typeof a.shouldComponentUpdate?a.shouldComponentUpdate(d,f,g):b.prototype&&b.prototype.isPureReactComponent?!qf(c,d)||!qf(e,f):!0}
23919
- function Ug(a,b,c){var d=!1,e=Cf;var f=b.contextType;"object"===typeof f&&null!==f?f=xg(f):(e=L(b)?Df:J.current,d=b.contextTypes,f=(d=null!==d&&void 0!==d)?Ef(a,e):Cf);b=new b(c,f);a.memoizedState=null!==b.state&&void 0!==b.state?b.state:null;b.updater=Sg;a.stateNode=b;b._reactInternalFiber=a;d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=e,a.__reactInternalMemoizedMaskedChildContext=f);return b}
23920
- function Vg(a,b,c,d){a=b.state;"function"===typeof b.componentWillReceiveProps&&b.componentWillReceiveProps(c,d);"function"===typeof b.UNSAFE_componentWillReceiveProps&&b.UNSAFE_componentWillReceiveProps(c,d);b.state!==a&&Sg.enqueueReplaceState(b,b.state,null)}
23921
- function Wg(a,b,c,d){var e=a.stateNode;e.props=c;e.state=a.memoizedState;e.refs=Ng;var f=b.contextType;"object"===typeof f&&null!==f?e.context=xg(f):(f=L(b)?Df:J.current,e.context=Ef(a,f));f=a.updateQueue;null!==f&&(Hg(a,f,c,e,d),e.state=a.memoizedState);f=b.getDerivedStateFromProps;"function"===typeof f&&(Og(a,b,f,c),e.state=a.memoizedState);"function"===typeof b.getDerivedStateFromProps||"function"===typeof e.getSnapshotBeforeUpdate||"function"!==typeof e.UNSAFE_componentWillMount&&"function"!==
23922
- typeof e.componentWillMount||(b=e.state,"function"===typeof e.componentWillMount&&e.componentWillMount(),"function"===typeof e.UNSAFE_componentWillMount&&e.UNSAFE_componentWillMount(),b!==e.state&&Sg.enqueueReplaceState(e,e.state,null),f=a.updateQueue,null!==f&&(Hg(a,f,c,e,d),e.state=a.memoizedState));"function"===typeof e.componentDidMount&&(a.effectTag|=4)}var Xg=Array.isArray;
23923
- function Yg(a,b,c){a=c.ref;if(null!==a&&"function"!==typeof a&&"object"!==typeof a){if(c._owner){c=c._owner;if(c){if(1!==c.tag)throw Error(u(309));var d=c.stateNode}if(!d)throw Error(u(147,a));var e=""+a;if(null!==b&&null!==b.ref&&"function"===typeof b.ref&&b.ref._stringRef===e)return b.ref;b=function(a){var b=d.refs;b===Ng&&(b=d.refs={});null===a?delete b[e]:b[e]=a};b._stringRef=e;return b}if("string"!==typeof a)throw Error(u(284));if(!c._owner)throw Error(u(290,a));}return a}
23924
- function Zg(a,b){if("textarea"!==a.type)throw Error(u(31,"[object Object]"===Object.prototype.toString.call(b)?"object with keys {"+Object.keys(b).join(", ")+"}":b,""));}
23925
- function $g(a){function b(b,c){if(a){var d=b.lastEffect;null!==d?(d.nextEffect=c,b.lastEffect=c):b.firstEffect=b.lastEffect=c;c.nextEffect=null;c.effectTag=8}}function c(c,d){if(!a)return null;for(;null!==d;)b(c,d),d=d.sibling;return null}function d(a,b){for(a=new Map;null!==b;)null!==b.key?a.set(b.key,b):a.set(b.index,b),b=b.sibling;return a}function e(a,b,c){a=ah(a,b,c);a.index=0;a.sibling=null;return a}function f(b,c,d){b.index=d;if(!a)return c;d=b.alternate;if(null!==d)return d=d.index,d<c?(b.effectTag=
23926
- 2,c):d;b.effectTag=2;return c}function g(b){a&&null===b.alternate&&(b.effectTag=2);return b}function h(a,b,c,d){if(null===b||6!==b.tag)return b=bh(c,a.mode,d),b.return=a,b;b=e(b,c,d);b.return=a;return b}function k(a,b,c,d){if(null!==b&&b.elementType===c.type)return d=e(b,c.props,d),d.ref=Yg(a,b,c),d.return=a,d;d=ch(c.type,c.key,c.props,null,a.mode,d);d.ref=Yg(a,b,c);d.return=a;return d}function l(a,b,c,d){if(null===b||4!==b.tag||b.stateNode.containerInfo!==c.containerInfo||b.stateNode.implementation!==
23927
- c.implementation)return b=dh(c,a.mode,d),b.return=a,b;b=e(b,c.children||[],d);b.return=a;return b}function m(a,b,c,d,f){if(null===b||7!==b.tag)return b=eh(c,a.mode,d,f),b.return=a,b;b=e(b,c,d);b.return=a;return b}function C(a,b,c){if("string"===typeof b||"number"===typeof b)return b=bh(""+b,a.mode,c),b.return=a,b;if("object"===typeof b&&null!==b){switch(b.$$typeof){case Ga:return c=ch(b.type,b.key,b.props,null,a.mode,c),c.ref=Yg(a,null,b),c.return=a,c;case Ha:return b=dh(b,a.mode,c),b.return=a,b}if(Xg(b)||
23928
- Ua(b))return b=eh(b,a.mode,c,null),b.return=a,b;Zg(a,b)}return null}function y(a,b,c,d){var e=null!==b?b.key:null;if("string"===typeof c||"number"===typeof c)return null!==e?null:h(a,b,""+c,d);if("object"===typeof c&&null!==c){switch(c.$$typeof){case Ga:return c.key===e?c.type===Ia?m(a,b,c.props.children,d,e):k(a,b,c,d):null;case Ha:return c.key===e?l(a,b,c,d):null}if(Xg(c)||Ua(c))return null!==e?null:m(a,b,c,d,null);Zg(a,c)}return null}function H(a,b,c,d,e){if("string"===typeof d||"number"===typeof d)return a=
23929
- a.get(c)||null,h(b,a,""+d,e);if("object"===typeof d&&null!==d){switch(d.$$typeof){case Ga:return a=a.get(null===d.key?c:d.key)||null,d.type===Ia?m(b,a,d.props.children,e,d.key):k(b,a,d,e);case Ha:return a=a.get(null===d.key?c:d.key)||null,l(b,a,d,e)}if(Xg(d)||Ua(d))return a=a.get(c)||null,m(b,a,d,e,null);Zg(b,d)}return null}function z(e,g,h,k){for(var l=null,m=null,r=g,x=g=0,A=null;null!==r&&x<h.length;x++){r.index>x?(A=r,r=null):A=r.sibling;var p=y(e,r,h[x],k);if(null===p){null===r&&(r=A);break}a&&
23930
- r&&null===p.alternate&&b(e,r);g=f(p,g,x);null===m?l=p:m.sibling=p;m=p;r=A}if(x===h.length)return c(e,r),l;if(null===r){for(;x<h.length;x++)r=C(e,h[x],k),null!==r&&(g=f(r,g,x),null===m?l=r:m.sibling=r,m=r);return l}for(r=d(e,r);x<h.length;x++)A=H(r,e,x,h[x],k),null!==A&&(a&&null!==A.alternate&&r.delete(null===A.key?x:A.key),g=f(A,g,x),null===m?l=A:m.sibling=A,m=A);a&&r.forEach(function(a){return b(e,a)});return l}function ta(e,g,h,k){var l=Ua(h);if("function"!==typeof l)throw Error(u(150));h=l.call(h);
23931
- if(null==h)throw Error(u(151));for(var m=l=null,r=g,x=g=0,A=null,p=h.next();null!==r&&!p.done;x++,p=h.next()){r.index>x?(A=r,r=null):A=r.sibling;var z=y(e,r,p.value,k);if(null===z){null===r&&(r=A);break}a&&r&&null===z.alternate&&b(e,r);g=f(z,g,x);null===m?l=z:m.sibling=z;m=z;r=A}if(p.done)return c(e,r),l;if(null===r){for(;!p.done;x++,p=h.next())p=C(e,p.value,k),null!==p&&(g=f(p,g,x),null===m?l=p:m.sibling=p,m=p);return l}for(r=d(e,r);!p.done;x++,p=h.next())p=H(r,e,x,p.value,k),null!==p&&(a&&null!==
23932
- p.alternate&&r.delete(null===p.key?x:p.key),g=f(p,g,x),null===m?l=p:m.sibling=p,m=p);a&&r.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k="object"===typeof f&&null!==f&&f.type===Ia&&null===f.key;k&&(f=f.props.children);var l="object"===typeof f&&null!==f;if(l)switch(f.$$typeof){case Ga:a:{l=f.key;for(k=d;null!==k;){if(k.key===l)if(7===k.tag?f.type===Ia:k.elementType===f.type){c(a,k.sibling);d=e(k,f.type===Ia?f.props.children:f.props,h);d.ref=Yg(a,k,f);d.return=a;a=d;break a}else{c(a,
23933
- k);break}else b(a,k);k=k.sibling}f.type===Ia?(d=eh(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=ch(f.type,f.key,f.props,null,a.mode,h),h.ref=Yg(a,d,f),h.return=a,a=h)}return g(a);case Ha:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[],h);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=dh(f,a.mode,h);d.return=a;a=d}return g(a)}if("string"===
23934
- typeof f||"number"===typeof f)return f=""+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f,h),d.return=a,a=d):(c(a,d),d=bh(f,a.mode,h),d.return=a,a=d),g(a);if(Xg(f))return z(a,d,f,h);if(Ua(f))return ta(a,d,f,h);l&&Zg(a,f);if("undefined"===typeof f&&!k)switch(a.tag){case 1:case 0:throw a=a.type,Error(u(152,a.displayName||a.name||"Component"));}return c(a,d)}}var fh=$g(!0),gh=$g(!1),hh={},ih={current:hh},jh={current:hh},kh={current:hh};function lh(a){if(a===hh)throw Error(u(174));return a}
23935
- function mh(a,b){I(kh,b,a);I(jh,a,a);I(ih,hh,a);var c=b.nodeType;switch(c){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:Qb(null,"");break;default:c=8===c?b.parentNode:b,b=c.namespaceURI||null,c=c.tagName,b=Qb(b,c)}G(ih,a);I(ih,b,a)}function nh(a){G(ih,a);G(jh,a);G(kh,a)}function oh(a){lh(kh.current);var b=lh(ih.current);var c=Qb(b,a.type);b!==c&&(I(jh,a,a),I(ih,c,a))}function ph(a){jh.current===a&&(G(ih,a),G(jh,a))}var M={current:0};
23936
- function qh(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||c.data===je||c.data===ke))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.effectTag&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}function rh(a,b){return{responder:a,props:b}}
23937
- var sh=Ea.ReactCurrentDispatcher,N=Ea.ReactCurrentBatchConfig,th=0,uh=null,O=null,vh=null,wh=null,P=null,xh=null,yh=0,zh=null,Ah=0,Bh=!1,Ch=null,Gh=0;function Q(){throw Error(u(321));}function Hh(a,b){if(null===b)return!1;for(var c=0;c<b.length&&c<a.length;c++)if(!of(a[c],b[c]))return!1;return!0}
23938
- function Ih(a,b,c,d,e,f){th=f;uh=b;vh=null!==a?a.memoizedState:null;sh.current=null===vh?Jh:Kh;b=c(d,e);if(Bh){do Bh=!1,Gh+=1,vh=null!==a?a.memoizedState:null,xh=wh,zh=P=O=null,sh.current=Kh,b=c(d,e);while(Bh);Ch=null;Gh=0}sh.current=Lh;a=uh;a.memoizedState=wh;a.expirationTime=yh;a.updateQueue=zh;a.effectTag|=Ah;a=null!==O&&null!==O.next;th=0;xh=P=wh=vh=O=uh=null;yh=0;zh=null;Ah=0;if(a)throw Error(u(300));return b}
23939
- function Mh(){sh.current=Lh;th=0;xh=P=wh=vh=O=uh=null;yh=0;zh=null;Ah=0;Bh=!1;Ch=null;Gh=0}function Nh(){var a={memoizedState:null,baseState:null,queue:null,baseUpdate:null,next:null};null===P?wh=P=a:P=P.next=a;return P}function Oh(){if(null!==xh)P=xh,xh=P.next,O=vh,vh=null!==O?O.next:null;else{if(null===vh)throw Error(u(310));O=vh;var a={memoizedState:O.memoizedState,baseState:O.baseState,queue:O.queue,baseUpdate:O.baseUpdate,next:null};P=null===P?wh=a:P.next=a;vh=O.next}return P}
23940
- function Ph(a,b){return"function"===typeof b?b(a):b}
23941
- function Qh(a){var b=Oh(),c=b.queue;if(null===c)throw Error(u(311));c.lastRenderedReducer=a;if(0<Gh){var d=c.dispatch;if(null!==Ch){var e=Ch.get(c);if(void 0!==e){Ch.delete(c);var f=b.memoizedState;do f=a(f,e.action),e=e.next;while(null!==e);of(f,b.memoizedState)||(wg=!0);b.memoizedState=f;b.baseUpdate===c.last&&(b.baseState=f);c.lastRenderedState=f;return[f,d]}}return[b.memoizedState,d]}d=c.last;var g=b.baseUpdate;f=b.baseState;null!==g?(null!==d&&(d.next=null),d=g.next):d=null!==d?d.next:null;if(null!==
23942
- d){var h=e=null,k=d,l=!1;do{var m=k.expirationTime;m<th?(l||(l=!0,h=g,e=f),m>yh&&(yh=m,Jg(yh))):(Ig(m,k.suspenseConfig),f=k.eagerReducer===a?k.eagerState:a(f,k.action));g=k;k=k.next}while(null!==k&&k!==d);l||(h=g,e=f);of(f,b.memoizedState)||(wg=!0);b.memoizedState=f;b.baseUpdate=h;b.baseState=e;c.lastRenderedState=f}return[b.memoizedState,c.dispatch]}
23943
- function Rh(a){var b=Nh();"function"===typeof a&&(a=a());b.memoizedState=b.baseState=a;a=b.queue={last:null,dispatch:null,lastRenderedReducer:Ph,lastRenderedState:a};a=a.dispatch=Sh.bind(null,uh,a);return[b.memoizedState,a]}function Th(a){return Qh(Ph,a)}function Uh(a,b,c,d){a={tag:a,create:b,destroy:c,deps:d,next:null};null===zh?(zh={lastEffect:null},zh.lastEffect=a.next=a):(b=zh.lastEffect,null===b?zh.lastEffect=a.next=a:(c=b.next,b.next=a,a.next=c,zh.lastEffect=a));return a}
23944
- function Vh(a,b,c,d){var e=Nh();Ah|=a;e.memoizedState=Uh(b,c,void 0,void 0===d?null:d)}function Wh(a,b,c,d){var e=Oh();d=void 0===d?null:d;var f=void 0;if(null!==O){var g=O.memoizedState;f=g.destroy;if(null!==d&&Hh(d,g.deps)){Uh(0,c,f,d);return}}Ah|=a;e.memoizedState=Uh(b,c,f,d)}function Xh(a,b){return Vh(516,192,a,b)}function Yh(a,b){return Wh(516,192,a,b)}
23945
- function Zh(a,b){if("function"===typeof b)return a=a(),b(a),function(){b(null)};if(null!==b&&void 0!==b)return a=a(),b.current=a,function(){b.current=null}}function $h(){}function ai(a,b){Nh().memoizedState=[a,void 0===b?null:b];return a}function bi(a,b){var c=Oh();b=void 0===b?null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Hh(b,d[1]))return d[0];c.memoizedState=[a,b];return a}
23946
- function Sh(a,b,c){if(!(25>Gh))throw Error(u(301));var d=a.alternate;if(a===uh||null!==d&&d===uh)if(Bh=!0,a={expirationTime:th,suspenseConfig:null,action:c,eagerReducer:null,eagerState:null,next:null},null===Ch&&(Ch=new Map),c=Ch.get(b),void 0===c)Ch.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}else{var e=Pg(),f=Mg.suspense;e=Qg(e,a,f);f={expirationTime:e,suspenseConfig:f,action:c,eagerReducer:null,eagerState:null,next:null};var g=b.last;if(null===g)f.next=f;else{var h=g.next;null!==h&&
23947
- (f.next=h);g.next=f}b.last=f;if(0===a.expirationTime&&(null===d||0===d.expirationTime)&&(d=b.lastRenderedReducer,null!==d))try{var k=b.lastRenderedState,l=d(k,c);f.eagerReducer=d;f.eagerState=l;if(of(l,k))return}catch(m){}finally{}Rg(a,e)}}
23948
- var Lh={readContext:xg,useCallback:Q,useContext:Q,useEffect:Q,useImperativeHandle:Q,useLayoutEffect:Q,useMemo:Q,useReducer:Q,useRef:Q,useState:Q,useDebugValue:Q,useResponder:Q,useDeferredValue:Q,useTransition:Q},Jh={readContext:xg,useCallback:ai,useContext:xg,useEffect:Xh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Vh(4,36,Zh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Vh(4,36,a,b)},useMemo:function(a,b){var c=Nh();b=void 0===b?null:b;a=a();c.memoizedState=
23949
- [a,b];return a},useReducer:function(a,b,c){var d=Nh();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a=d.queue={last:null,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};a=a.dispatch=Sh.bind(null,uh,a);return[d.memoizedState,a]},useRef:function(a){var b=Nh();a={current:a};return b.memoizedState=a},useState:Rh,useDebugValue:$h,useResponder:rh,useDeferredValue:function(a,b){var c=Rh(a),d=c[0],e=c[1];Xh(function(){q.unstable_next(function(){var c=N.suspense;N.suspense=void 0===b?null:b;try{e(a)}finally{N.suspense=
23950
- c}})},[a,b]);return d},useTransition:function(a){var b=Rh(!1),c=b[0],d=b[1];return[ai(function(b){d(!0);q.unstable_next(function(){var c=N.suspense;N.suspense=void 0===a?null:a;try{d(!1),b()}finally{N.suspense=c}})},[a,c]),c]}},Kh={readContext:xg,useCallback:bi,useContext:xg,useEffect:Yh,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return Wh(4,36,Zh.bind(null,b,a),c)},useLayoutEffect:function(a,b){return Wh(4,36,a,b)},useMemo:function(a,b){var c=Oh();b=void 0===b?
23951
- null:b;var d=c.memoizedState;if(null!==d&&null!==b&&Hh(b,d[1]))return d[0];a=a();c.memoizedState=[a,b];return a},useReducer:Qh,useRef:function(){return Oh().memoizedState},useState:Th,useDebugValue:$h,useResponder:rh,useDeferredValue:function(a,b){var c=Th(a),d=c[0],e=c[1];Yh(function(){q.unstable_next(function(){var c=N.suspense;N.suspense=void 0===b?null:b;try{e(a)}finally{N.suspense=c}})},[a,b]);return d},useTransition:function(a){var b=Th(!1),c=b[0],d=b[1];return[bi(function(b){d(!0);q.unstable_next(function(){var c=
23952
- N.suspense;N.suspense=void 0===a?null:a;try{d(!1),b()}finally{N.suspense=c}})},[a,c]),c]}},ci=null,di=null,ei=!1;function fi(a,b){var c=gi(5,null,null,0);c.elementType="DELETED";c.type="DELETED";c.stateNode=b;c.return=a;c.effectTag=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}
23953
- function hi(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=""===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}
23954
- function ii(a){if(ei){var b=di;if(b){var c=b;if(!hi(a,b)){b=re(c.nextSibling);if(!b||!hi(a,b)){a.effectTag=a.effectTag&-1025|2;ei=!1;ci=a;return}fi(ci,c)}ci=a;di=re(b.firstChild)}else a.effectTag=a.effectTag&-1025|2,ei=!1,ci=a}}function ji(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;ci=a}
23955
- function ki(a){if(a!==ci)return!1;if(!ei)return ji(a),ei=!0,!1;var b=a.type;if(5!==a.tag||"head"!==b&&"body"!==b&&!oe(b,a.memoizedProps))for(b=di;b;)fi(a,b),b=re(b.nextSibling);ji(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(u(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(c===ie){if(0===b){di=re(a.nextSibling);break a}b--}else c!==he&&c!==ke&&c!==je||b++}a=a.nextSibling}di=null}}else di=ci?re(a.stateNode.nextSibling):null;return!0}
23956
- function li(){di=ci=null;ei=!1}var mi=Ea.ReactCurrentOwner,wg=!1;function R(a,b,c,d){b.child=null===a?gh(b,null,c,d):fh(b,a.child,c,d)}function ni(a,b,c,d,e){c=c.render;var f=b.ref;vg(b,e);d=Ih(a,b,c,d,f,e);if(null!==a&&!wg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),oi(a,b,e);b.effectTag|=1;R(a,b,d,e);return b.child}
23957
- function pi(a,b,c,d,e,f){if(null===a){var g=c.type;if("function"===typeof g&&!qi(g)&&void 0===g.defaultProps&&null===c.compare&&void 0===c.defaultProps)return b.tag=15,b.type=g,ri(a,b,g,d,e,f);a=ch(c.type,null,d,null,b.mode,f);a.ref=b.ref;a.return=b;return b.child=a}g=a.child;if(e<f&&(e=g.memoizedProps,c=c.compare,c=null!==c?c:qf,c(e,d)&&a.ref===b.ref))return oi(a,b,f);b.effectTag|=1;a=ah(g,d,f);a.ref=b.ref;a.return=b;return b.child=a}
23958
- function ri(a,b,c,d,e,f){return null!==a&&qf(a.memoizedProps,d)&&a.ref===b.ref&&(wg=!1,e<f)?oi(a,b,f):si(a,b,c,d,f)}function ti(a,b){var c=b.ref;if(null===a&&null!==c||null!==a&&a.ref!==c)b.effectTag|=128}function si(a,b,c,d,e){var f=L(c)?Df:J.current;f=Ef(b,f);vg(b,e);c=Ih(a,b,c,d,f,e);if(null!==a&&!wg)return b.updateQueue=a.updateQueue,b.effectTag&=-517,a.expirationTime<=e&&(a.expirationTime=0),oi(a,b,e);b.effectTag|=1;R(a,b,c,e);return b.child}
23959
- function ui(a,b,c,d,e){if(L(c)){var f=!0;Jf(b)}else f=!1;vg(b,e);if(null===b.stateNode)null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),Ug(b,c,d,e),Wg(b,c,d,e),d=!0;else if(null===a){var g=b.stateNode,h=b.memoizedProps;g.props=h;var k=g.context,l=c.contextType;"object"===typeof l&&null!==l?l=xg(l):(l=L(c)?Df:J.current,l=Ef(b,l));var m=c.getDerivedStateFromProps,C="function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate;C||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&
23960
- "function"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Vg(b,g,d,l);yg=!1;var y=b.memoizedState;k=g.state=y;var H=b.updateQueue;null!==H&&(Hg(b,H,d,g,e),k=b.memoizedState);h!==d||y!==k||K.current||yg?("function"===typeof m&&(Og(b,c,m,d),k=b.memoizedState),(h=yg||Tg(b,c,h,d,y,k,l))?(C||"function"!==typeof g.UNSAFE_componentWillMount&&"function"!==typeof g.componentWillMount||("function"===typeof g.componentWillMount&&g.componentWillMount(),"function"===typeof g.UNSAFE_componentWillMount&&
23961
- g.UNSAFE_componentWillMount()),"function"===typeof g.componentDidMount&&(b.effectTag|=4)):("function"===typeof g.componentDidMount&&(b.effectTag|=4),b.memoizedProps=d,b.memoizedState=k),g.props=d,g.state=k,g.context=l,d=h):("function"===typeof g.componentDidMount&&(b.effectTag|=4),d=!1)}else g=b.stateNode,h=b.memoizedProps,g.props=b.type===b.elementType?h:mg(b.type,h),k=g.context,l=c.contextType,"object"===typeof l&&null!==l?l=xg(l):(l=L(c)?Df:J.current,l=Ef(b,l)),m=c.getDerivedStateFromProps,(C=
23962
- "function"===typeof m||"function"===typeof g.getSnapshotBeforeUpdate)||"function"!==typeof g.UNSAFE_componentWillReceiveProps&&"function"!==typeof g.componentWillReceiveProps||(h!==d||k!==l)&&Vg(b,g,d,l),yg=!1,k=b.memoizedState,y=g.state=k,H=b.updateQueue,null!==H&&(Hg(b,H,d,g,e),y=b.memoizedState),h!==d||k!==y||K.current||yg?("function"===typeof m&&(Og(b,c,m,d),y=b.memoizedState),(m=yg||Tg(b,c,h,d,k,y,l))?(C||"function"!==typeof g.UNSAFE_componentWillUpdate&&"function"!==typeof g.componentWillUpdate||
23963
- ("function"===typeof g.componentWillUpdate&&g.componentWillUpdate(d,y,l),"function"===typeof g.UNSAFE_componentWillUpdate&&g.UNSAFE_componentWillUpdate(d,y,l)),"function"===typeof g.componentDidUpdate&&(b.effectTag|=4),"function"===typeof g.getSnapshotBeforeUpdate&&(b.effectTag|=256)):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),b.memoizedProps=
23964
- d,b.memoizedState=y),g.props=d,g.state=y,g.context=l,d=m):("function"!==typeof g.componentDidUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=4),"function"!==typeof g.getSnapshotBeforeUpdate||h===a.memoizedProps&&k===a.memoizedState||(b.effectTag|=256),d=!1);return vi(a,b,c,d,f,e)}
23965
- function vi(a,b,c,d,e,f){ti(a,b);var g=0!==(b.effectTag&64);if(!d&&!g)return e&&Kf(b,c,!1),oi(a,b,f);d=b.stateNode;mi.current=b;var h=g&&"function"!==typeof c.getDerivedStateFromError?null:d.render();b.effectTag|=1;null!==a&&g?(b.child=fh(b,a.child,null,f),b.child=fh(b,null,h,f)):R(a,b,h,f);b.memoizedState=d.state;e&&Kf(b,c,!0);return b.child}function wi(a){var b=a.stateNode;b.pendingContext?Hf(a,b.pendingContext,b.pendingContext!==b.context):b.context&&Hf(a,b.context,!1);mh(a,b.containerInfo)}
23966
- var xi={dehydrated:null,retryTime:0};
23967
- function yi(a,b,c){var d=b.mode,e=b.pendingProps,f=M.current,g=!1,h;(h=0!==(b.effectTag&64))||(h=0!==(f&2)&&(null===a||null!==a.memoizedState));h?(g=!0,b.effectTag&=-65):null!==a&&null===a.memoizedState||void 0===e.fallback||!0===e.unstable_avoidThisFallback||(f|=1);I(M,f&1,b);if(null===a){void 0!==e.fallback&&ii(b);if(g){g=e.fallback;e=eh(null,d,0,null);e.return=b;if(0===(b.mode&2))for(a=null!==b.memoizedState?b.child.child:b.child,e.child=a;null!==a;)a.return=e,a=a.sibling;c=eh(g,d,c,null);c.return=
23968
- b;e.sibling=c;b.memoizedState=xi;b.child=e;return c}d=e.children;b.memoizedState=null;return b.child=gh(b,null,d,c)}if(null!==a.memoizedState){a=a.child;d=a.sibling;if(g){e=e.fallback;c=ah(a,a.pendingProps,0);c.return=b;if(0===(b.mode&2)&&(g=null!==b.memoizedState?b.child.child:b.child,g!==a.child))for(c.child=g;null!==g;)g.return=c,g=g.sibling;d=ah(d,e,d.expirationTime);d.return=b;c.sibling=d;c.childExpirationTime=0;b.memoizedState=xi;b.child=c;return d}c=fh(b,a.child,e.children,c);b.memoizedState=
23969
- null;return b.child=c}a=a.child;if(g){g=e.fallback;e=eh(null,d,0,null);e.return=b;e.child=a;null!==a&&(a.return=e);if(0===(b.mode&2))for(a=null!==b.memoizedState?b.child.child:b.child,e.child=a;null!==a;)a.return=e,a=a.sibling;c=eh(g,d,c,null);c.return=b;e.sibling=c;c.effectTag|=2;e.childExpirationTime=0;b.memoizedState=xi;b.child=e;return c}b.memoizedState=null;return b.child=fh(b,a,e.children,c)}
23970
- function zi(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);ug(a.return,b)}function Ai(a,b,c,d,e,f){var g=a.memoizedState;null===g?a.memoizedState={isBackwards:b,rendering:null,last:d,tail:c,tailExpiration:0,tailMode:e,lastEffect:f}:(g.isBackwards=b,g.rendering=null,g.last=d,g.tail=c,g.tailExpiration=0,g.tailMode=e,g.lastEffect=f)}
23971
- function Bi(a,b,c){var d=b.pendingProps,e=d.revealOrder,f=d.tail;R(a,b,d.children,c);d=M.current;if(0!==(d&2))d=d&1|2,b.effectTag|=64;else{if(null!==a&&0!==(a.effectTag&64))a:for(a=b.child;null!==a;){if(13===a.tag)null!==a.memoizedState&&zi(a,c);else if(19===a.tag)zi(a,c);else if(null!==a.child){a.child.return=a;a=a.child;continue}if(a===b)break a;for(;null===a.sibling;){if(null===a.return||a.return===b)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}d&=1}I(M,d,b);if(0===(b.mode&2))b.memoizedState=
23972
- null;else switch(e){case "forwards":c=b.child;for(e=null;null!==c;)a=c.alternate,null!==a&&null===qh(a)&&(e=c),c=c.sibling;c=e;null===c?(e=b.child,b.child=null):(e=c.sibling,c.sibling=null);Ai(b,!1,e,c,f,b.lastEffect);break;case "backwards":c=null;e=b.child;for(b.child=null;null!==e;){a=e.alternate;if(null!==a&&null===qh(a)){b.child=e;break}a=e.sibling;e.sibling=c;c=e;e=a}Ai(b,!0,c,null,f,b.lastEffect);break;case "together":Ai(b,!1,null,null,void 0,b.lastEffect);break;default:b.memoizedState=null}return b.child}
23973
- function oi(a,b,c){null!==a&&(b.dependencies=a.dependencies);var d=b.expirationTime;0!==d&&Jg(d);if(b.childExpirationTime<c)return null;if(null!==a&&b.child!==a.child)throw Error(u(153));if(null!==b.child){a=b.child;c=ah(a,a.pendingProps,a.expirationTime);b.child=c;for(c.return=b;null!==a.sibling;)a=a.sibling,c=c.sibling=ah(a,a.pendingProps,a.expirationTime),c.return=b;c.sibling=null}return b.child}function Ci(a){a.effectTag|=4}var Hi,Ii,Ji,Ki;
23974
- Hi=function(a,b){for(var c=b.child;null!==c;){if(5===c.tag||6===c.tag)a.appendChild(c.stateNode);else if(4!==c.tag&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return}c.sibling.return=c.return;c=c.sibling}};Ii=function(){};
23975
- Ji=function(a,b,c,d,e){var f=a.memoizedProps;if(f!==d){var g=b.stateNode;lh(ih.current);a=null;switch(c){case "input":f=Ab(g,f);d=Ab(g,d);a=[];break;case "option":f=Ib(g,f);d=Ib(g,d);a=[];break;case "select":f=n({},f,{value:void 0});d=n({},d,{value:void 0});a=[];break;case "textarea":f=Kb(g,f);d=Kb(g,d);a=[];break;default:"function"!==typeof f.onClick&&"function"===typeof d.onClick&&(g.onclick=ae)}Yd(c,d);var h,k;c=null;for(h in f)if(!d.hasOwnProperty(h)&&f.hasOwnProperty(h)&&null!=f[h])if("style"===
23976
- h)for(k in g=f[h],g)g.hasOwnProperty(k)&&(c||(c={}),c[k]="");else"dangerouslySetInnerHTML"!==h&&"children"!==h&&"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(ia.hasOwnProperty(h)?a||(a=[]):(a=a||[]).push(h,null));for(h in d){var l=d[h];g=null!=f?f[h]:void 0;if(d.hasOwnProperty(h)&&l!==g&&(null!=l||null!=g))if("style"===h)if(g){for(k in g)!g.hasOwnProperty(k)||l&&l.hasOwnProperty(k)||(c||(c={}),c[k]="");for(k in l)l.hasOwnProperty(k)&&g[k]!==l[k]&&(c||(c={}),
23977
- c[k]=l[k])}else c||(a||(a=[]),a.push(h,c)),c=l;else"dangerouslySetInnerHTML"===h?(l=l?l.__html:void 0,g=g?g.__html:void 0,null!=l&&g!==l&&(a=a||[]).push(h,""+l)):"children"===h?g===l||"string"!==typeof l&&"number"!==typeof l||(a=a||[]).push(h,""+l):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&(ia.hasOwnProperty(h)?(null!=l&&$d(e,h),a||g===l||(a=[])):(a=a||[]).push(h,l))}c&&(a=a||[]).push("style",c);e=a;(b.updateQueue=e)&&Ci(b)}};Ki=function(a,b,c,d){c!==d&&Ci(b)};
23978
- function Li(a,b){switch(a.tailMode){case "hidden":b=a.tail;for(var c=null;null!==b;)null!==b.alternate&&(c=b),b=b.sibling;null===c?a.tail=null:c.sibling=null;break;case "collapsed":c=a.tail;for(var d=null;null!==c;)null!==c.alternate&&(d=c),c=c.sibling;null===d?b||null===a.tail?a.tail=null:a.tail.sibling=null:d.sibling=null}}
23979
- function Mi(a){switch(a.tag){case 1:L(a.type)&&Ff(a);var b=a.effectTag;return b&4096?(a.effectTag=b&-4097|64,a):null;case 3:nh(a);Gf(a);b=a.effectTag;if(0!==(b&64))throw Error(u(285));a.effectTag=b&-4097|64;return a;case 5:return ph(a),null;case 13:return G(M,a),b=a.effectTag,b&4096?(a.effectTag=b&-4097|64,a):null;case 19:return G(M,a),null;case 4:return nh(a),null;case 10:return tg(a),null;default:return null}}function Ni(a,b){return{value:a,source:b,stack:Xa(b)}}
23980
- var Oi="function"===typeof WeakSet?WeakSet:Set;function Pi(a,b){var c=b.source,d=b.stack;null===d&&null!==c&&(d=Xa(c));null!==c&&Wa(c.type);b=b.value;null!==a&&1===a.tag&&Wa(a.type);try{console.error(b)}catch(e){setTimeout(function(){throw e;})}}function Qi(a,b){try{b.props=a.memoizedProps,b.state=a.memoizedState,b.componentWillUnmount()}catch(c){Ri(a,c)}}function Si(a){var b=a.ref;if(null!==b)if("function"===typeof b)try{b(null)}catch(c){Ri(a,c)}else b.current=null}
23981
- function Ti(a,b){switch(b.tag){case 0:case 11:case 15:Ui(2,0,b);break;case 1:if(b.effectTag&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:mg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}break;case 3:case 5:case 6:case 4:case 17:break;default:throw Error(u(163));}}
23982
- function Ui(a,b,c){c=c.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do{if(0!==(d.tag&a)){var e=d.destroy;d.destroy=void 0;void 0!==e&&e()}0!==(d.tag&b)&&(e=d.create,d.destroy=e());d=d.next}while(d!==c)}}
23983
- function Vi(a,b,c){"function"===typeof Wi&&Wi(b);switch(b.tag){case 0:case 11:case 14:case 15:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var d=a.next;fg(97<c?97:c,function(){var a=d;do{var c=a.destroy;if(void 0!==c){var g=b;try{c()}catch(h){Ri(g,h)}}a=a.next}while(a!==d)})}break;case 1:Si(b);c=b.stateNode;"function"===typeof c.componentWillUnmount&&Qi(b,c);break;case 5:Si(b);break;case 4:Xi(a,b,c)}}
23984
- function Yi(a){var b=a.alternate;a.return=null;a.child=null;a.memoizedState=null;a.updateQueue=null;a.dependencies=null;a.alternate=null;a.firstEffect=null;a.lastEffect=null;a.pendingProps=null;a.memoizedProps=null;null!==b&&Yi(b)}function Zi(a){return 5===a.tag||3===a.tag||4===a.tag}
23985
- function $i(a){a:{for(var b=a.return;null!==b;){if(Zi(b)){var c=b;break a}b=b.return}throw Error(u(160));}b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(u(161));}c.effectTag&16&&(Tb(b,""),c.effectTag&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||Zi(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.effectTag&2)continue b;
23986
- if(null===c.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.effectTag&2)){c=c.stateNode;break a}}for(var e=a;;){var f=5===e.tag||6===e.tag;if(f){var g=f?e.stateNode:e.stateNode.instance;if(c)if(d){f=b;var h=g;g=c;8===f.nodeType?f.parentNode.insertBefore(h,g):f.insertBefore(h,g)}else b.insertBefore(g,c);else d?(h=b,8===h.nodeType?(f=h.parentNode,f.insertBefore(g,h)):(f=h,f.appendChild(g)),h=h._reactRootContainer,null!==h&&void 0!==h||null!==f.onclick||(f.onclick=ae)):b.appendChild(g)}else if(4!==
23987
- e.tag&&null!==e.child){e.child.return=e;e=e.child;continue}if(e===a)break;for(;null===e.sibling;){if(null===e.return||e.return===a)return;e=e.return}e.sibling.return=e.return;e=e.sibling}}
23988
- function Xi(a,b,c){for(var d=b,e=!1,f,g;;){if(!e){e=d.return;a:for(;;){if(null===e)throw Error(u(160));f=e.stateNode;switch(e.tag){case 5:g=!1;break a;case 3:f=f.containerInfo;g=!0;break a;case 4:f=f.containerInfo;g=!0;break a}e=e.return}e=!0}if(5===d.tag||6===d.tag){a:for(var h=a,k=d,l=c,m=k;;)if(Vi(h,m,l),null!==m.child&&4!==m.tag)m.child.return=m,m=m.child;else{if(m===k)break;for(;null===m.sibling;){if(null===m.return||m.return===k)break a;m=m.return}m.sibling.return=m.return;m=m.sibling}g?(h=
23989
- f,k=d.stateNode,8===h.nodeType?h.parentNode.removeChild(k):h.removeChild(k)):f.removeChild(d.stateNode)}else if(4===d.tag){if(null!==d.child){f=d.stateNode.containerInfo;g=!0;d.child.return=d;d=d.child;continue}}else if(Vi(a,d,c),null!==d.child){d.child.return=d;d=d.child;continue}if(d===b)break;for(;null===d.sibling;){if(null===d.return||d.return===b)return;d=d.return;4===d.tag&&(e=!1)}d.sibling.return=d.return;d=d.sibling}}
23990
- function aj(a,b){switch(b.tag){case 0:case 11:case 14:case 15:Ui(4,8,b);break;case 1:break;case 5:var c=b.stateNode;if(null!=c){var d=b.memoizedProps,e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[ve]=d;"input"===a&&"radio"===d.type&&null!=d.name&&Cb(c,d);Zd(a,e);b=Zd(a,d);for(e=0;e<f.length;e+=2){var g=f[e],h=f[e+1];"style"===g?Wd(c,h):"dangerouslySetInnerHTML"===g?Sb(c,h):"children"===g?Tb(c,h):vb(c,g,h,b)}switch(a){case "input":Eb(c,d);break;case "textarea":Mb(c,
23991
- d);break;case "select":b=c._wrapperState.wasMultiple,c._wrapperState.wasMultiple=!!d.multiple,a=d.value,null!=a?Jb(c,!!d.multiple,a,!1):b!==!!d.multiple&&(null!=d.defaultValue?Jb(c,!!d.multiple,d.defaultValue,!0):Jb(c,!!d.multiple,d.multiple?[]:"",!1))}}}break;case 6:if(null===b.stateNode)throw Error(u(162));b.stateNode.nodeValue=b.memoizedProps;break;case 3:b=b.stateNode;b.hydrate&&(b.hydrate=!1,Lc(b.containerInfo));break;case 12:break;case 13:c=b;null===b.memoizedState?d=!1:(d=!0,c=b.child,bj=cg());
23992
- if(null!==c)a:for(a=c;;){if(5===a.tag)f=a.stateNode,d?(f=f.style,"function"===typeof f.setProperty?f.setProperty("display","none","important"):f.display="none"):(f=a.stateNode,e=a.memoizedProps.style,e=void 0!==e&&null!==e&&e.hasOwnProperty("display")?e.display:null,f.style.display=Vd("display",e));else if(6===a.tag)a.stateNode.nodeValue=d?"":a.memoizedProps;else if(13===a.tag&&null!==a.memoizedState&&null===a.memoizedState.dehydrated){f=a.child.sibling;f.return=a;a=f;continue}else if(null!==a.child){a.child.return=
23993
- a;a=a.child;continue}if(a===c)break a;for(;null===a.sibling;){if(null===a.return||a.return===c)break a;a=a.return}a.sibling.return=a.return;a=a.sibling}cj(b);break;case 19:cj(b);break;case 17:break;case 20:break;case 21:break;default:throw Error(u(163));}}function cj(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Oi);b.forEach(function(b){var d=dj.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}var ej="function"===typeof WeakMap?WeakMap:Map;
23994
- function fj(a,b,c){c=Bg(c,null);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){gj||(gj=!0,hj=d);Pi(a,b)};return c}
23995
- function ij(a,b,c){c=Bg(c,null);c.tag=3;var d=a.type.getDerivedStateFromError;if("function"===typeof d){var e=b.value;c.payload=function(){Pi(a,b);return d(e)}}var f=a.stateNode;null!==f&&"function"===typeof f.componentDidCatch&&(c.callback=function(){"function"!==typeof d&&(null===jj?jj=new Set([this]):jj.add(this),Pi(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:""})});return c}
23996
- var kj=Math.ceil,lj=Ea.ReactCurrentDispatcher,mj=Ea.ReactCurrentOwner,S=0,nj=8,oj=16,pj=32,qj=0,rj=1,sj=2,tj=3,uj=4,vj=5,T=S,U=null,V=null,W=0,X=qj,wj=null,xj=1073741823,yj=1073741823,zj=null,Aj=0,Bj=!1,bj=0,Cj=500,Y=null,gj=!1,hj=null,jj=null,Dj=!1,Ej=null,Fj=90,Gj=null,Hj=0,Ij=null,Jj=0;function Pg(){return(T&(oj|pj))!==S?1073741821-(cg()/10|0):0!==Jj?Jj:Jj=1073741821-(cg()/10|0)}
23997
- function Qg(a,b,c){b=b.mode;if(0===(b&2))return 1073741823;var d=dg();if(0===(b&4))return 99===d?1073741823:1073741822;if((T&oj)!==S)return W;if(null!==c)a=lg(a,c.timeoutMs|0||5E3,250);else switch(d){case 99:a=1073741823;break;case 98:a=lg(a,150,100);break;case 97:case 96:a=lg(a,5E3,250);break;case 95:a=2;break;default:throw Error(u(326));}null!==U&&a===W&&--a;return a}
23998
- function Rg(a,b){if(50<Hj)throw Hj=0,Ij=null,Error(u(185));a=Kj(a,b);if(null!==a){var c=dg();1073741823===b?(T&nj)!==S&&(T&(oj|pj))===S?Lj(a):(Z(a),T===S&&jg()):Z(a);(T&4)===S||98!==c&&99!==c||(null===Gj?Gj=new Map([[a,b]]):(c=Gj.get(a),(void 0===c||c>b)&&Gj.set(a,b)))}}
23999
- function Kj(a,b){a.expirationTime<b&&(a.expirationTime=b);var c=a.alternate;null!==c&&c.expirationTime<b&&(c.expirationTime=b);var d=a.return,e=null;if(null===d&&3===a.tag)e=a.stateNode;else for(;null!==d;){c=d.alternate;d.childExpirationTime<b&&(d.childExpirationTime=b);null!==c&&c.childExpirationTime<b&&(c.childExpirationTime=b);if(null===d.return&&3===d.tag){e=d.stateNode;break}d=d.return}null!==e&&(U===e&&(Jg(b),X===uj&&Mj(e,W)),Nj(e,b));return e}
24000
- function Oj(a){var b=a.lastExpiredTime;if(0!==b)return b;b=a.firstPendingTime;if(!Pj(a,b))return b;b=a.lastPingedTime;a=a.nextKnownPendingLevel;return b>a?b:a}
24001
- function Z(a){if(0!==a.lastExpiredTime)a.callbackExpirationTime=1073741823,a.callbackPriority=99,a.callbackNode=hg(Lj.bind(null,a));else{var b=Oj(a),c=a.callbackNode;if(0===b)null!==c&&(a.callbackNode=null,a.callbackExpirationTime=0,a.callbackPriority=90);else{var d=Pg();1073741823===b?d=99:1===b||2===b?d=95:(d=10*(1073741821-b)-10*(1073741821-d),d=0>=d?99:250>=d?98:5250>=d?97:95);if(null!==c){var e=a.callbackPriority;if(a.callbackExpirationTime===b&&e>=d)return;c!==Xf&&Nf(c)}a.callbackExpirationTime=
24002
- b;a.callbackPriority=d;b=1073741823===b?hg(Lj.bind(null,a)):gg(d,Qj.bind(null,a),{timeout:10*(1073741821-b)-cg()});a.callbackNode=b}}}
24003
- function Qj(a,b){Jj=0;if(b)return b=Pg(),Rj(a,b),Z(a),null;var c=Oj(a);if(0!==c){b=a.callbackNode;if((T&(oj|pj))!==S)throw Error(u(327));Sj();a===U&&c===W||Tj(a,c);if(null!==V){var d=T;T|=oj;var e=Uj(a);do try{Vj();break}catch(h){Wj(a,h)}while(1);rg();T=d;lj.current=e;if(X===rj)throw b=wj,Tj(a,c),Mj(a,c),Z(a),b;if(null===V)switch(e=a.finishedWork=a.current.alternate,a.finishedExpirationTime=c,d=X,U=null,d){case qj:case rj:throw Error(u(345));case sj:Rj(a,2<c?2:c);break;case tj:Mj(a,c);d=a.lastSuspendedTime;
24004
- c===d&&(a.nextKnownPendingLevel=Xj(e));if(1073741823===xj&&(e=bj+Cj-cg(),10<e)){if(Bj){var f=a.lastPingedTime;if(0===f||f>=c){a.lastPingedTime=c;Tj(a,c);break}}f=Oj(a);if(0!==f&&f!==c)break;if(0!==d&&d!==c){a.lastPingedTime=d;break}a.timeoutHandle=pe(Yj.bind(null,a),e);break}Yj(a);break;case uj:Mj(a,c);d=a.lastSuspendedTime;c===d&&(a.nextKnownPendingLevel=Xj(e));if(Bj&&(e=a.lastPingedTime,0===e||e>=c)){a.lastPingedTime=c;Tj(a,c);break}e=Oj(a);if(0!==e&&e!==c)break;if(0!==d&&d!==c){a.lastPingedTime=
24005
- d;break}1073741823!==yj?d=10*(1073741821-yj)-cg():1073741823===xj?d=0:(d=10*(1073741821-xj)-5E3,e=cg(),c=10*(1073741821-c)-e,d=e-d,0>d&&(d=0),d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*kj(d/1960))-d,c<d&&(d=c));if(10<d){a.timeoutHandle=pe(Yj.bind(null,a),d);break}Yj(a);break;case vj:if(1073741823!==xj&&null!==zj){f=xj;var g=zj;d=g.busyMinDurationMs|0;0>=d?d=0:(e=g.busyDelayMs|0,f=cg()-(10*(1073741821-f)-(g.timeoutMs|0||5E3)),d=f<=e?0:e+d-f);if(10<d){Mj(a,c);a.timeoutHandle=
24006
- pe(Yj.bind(null,a),d);break}}Yj(a);break;default:throw Error(u(329));}Z(a);if(a.callbackNode===b)return Qj.bind(null,a)}}return null}
24007
- function Lj(a){var b=a.lastExpiredTime;b=0!==b?b:1073741823;if(a.finishedExpirationTime===b)Yj(a);else{if((T&(oj|pj))!==S)throw Error(u(327));Sj();a===U&&b===W||Tj(a,b);if(null!==V){var c=T;T|=oj;var d=Uj(a);do try{Zj();break}catch(e){Wj(a,e)}while(1);rg();T=c;lj.current=d;if(X===rj)throw c=wj,Tj(a,b),Mj(a,b),Z(a),c;if(null!==V)throw Error(u(261));a.finishedWork=a.current.alternate;a.finishedExpirationTime=b;U=null;Yj(a);Z(a)}}return null}
24008
- function ak(){if(null!==Gj){var a=Gj;Gj=null;a.forEach(function(a,c){Rj(c,a);Z(c)});jg()}}function bk(a,b){var c=T;T|=1;try{return a(b)}finally{T=c,T===S&&jg()}}function ck(a,b){var c=T;T&=-2;T|=nj;try{return a(b)}finally{T=c,T===S&&jg()}}
24009
- function Tj(a,b){a.finishedWork=null;a.finishedExpirationTime=0;var c=a.timeoutHandle;-1!==c&&(a.timeoutHandle=-1,qe(c));if(null!==V)for(c=V.return;null!==c;){var d=c;switch(d.tag){case 1:var e=d.type.childContextTypes;null!==e&&void 0!==e&&Ff(d);break;case 3:nh(d);Gf(d);break;case 5:ph(d);break;case 4:nh(d);break;case 13:G(M,d);break;case 19:G(M,d);break;case 10:tg(d)}c=c.return}U=a;V=ah(a.current,null,b);W=b;X=qj;wj=null;yj=xj=1073741823;zj=null;Aj=0;Bj=!1}
24010
- function Wj(a,b){do{try{rg();Mh();if(null===V||null===V.return)return X=rj,wj=b,null;a:{var c=a,d=V.return,e=V,f=b;b=W;e.effectTag|=2048;e.firstEffect=e.lastEffect=null;if(null!==f&&"object"===typeof f&&"function"===typeof f.then){var g=f,h=0!==(M.current&1),k=d;do{var l;if(l=13===k.tag){var m=k.memoizedState;if(null!==m)l=null!==m.dehydrated?!0:!1;else{var C=k.memoizedProps;l=void 0===C.fallback?!1:!0!==C.unstable_avoidThisFallback?!0:h?!1:!0}}if(l){var y=k.updateQueue;if(null===y){var H=new Set;
24011
- H.add(g);k.updateQueue=H}else y.add(g);if(0===(k.mode&2)){k.effectTag|=64;e.effectTag&=-2981;if(1===e.tag)if(null===e.alternate)e.tag=17;else{var z=Bg(1073741823,null);z.tag=2;Dg(e,z)}e.expirationTime=1073741823;break a}f=void 0;e=b;var ta=c.pingCache;null===ta?(ta=c.pingCache=new ej,f=new Set,ta.set(g,f)):(f=ta.get(g),void 0===f&&(f=new Set,ta.set(g,f)));if(!f.has(e)){f.add(e);var r=dk.bind(null,c,g,e);g.then(r,r)}k.effectTag|=4096;k.expirationTime=b;break a}k=k.return}while(null!==k);f=Error((Wa(e.type)||
24012
- "A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+Xa(e))}X!==vj&&(X=sj);f=Ni(f,e);k=d;do{switch(k.tag){case 3:g=f;k.effectTag|=4096;k.expirationTime=b;var x=fj(k,g,b);Eg(k,x);break a;case 1:g=f;var A=k.type,p=k.stateNode;if(0===(k.effectTag&64)&&("function"===typeof A.getDerivedStateFromError||null!==p&&"function"===typeof p.componentDidCatch&&
24013
- (null===jj||!jj.has(p)))){k.effectTag|=4096;k.expirationTime=b;var t=ij(k,g,b);Eg(k,t);break a}}k=k.return}while(null!==k)}V=ek(V)}catch(v){b=v;continue}break}while(1)}function Uj(){var a=lj.current;lj.current=Lh;return null===a?Lh:a}function Ig(a,b){a<xj&&2<a&&(xj=a);null!==b&&a<yj&&2<a&&(yj=a,zj=b)}function Jg(a){a>Aj&&(Aj=a)}function Zj(){for(;null!==V;)V=fk(V)}function Vj(){for(;null!==V&&!Of();)V=fk(V)}
24014
- function fk(a){var b=gk(a.alternate,a,W);a.memoizedProps=a.pendingProps;null===b&&(b=ek(a));mj.current=null;return b}
24015
- function ek(a){V=a;do{var b=V.alternate;a=V.return;if(0===(V.effectTag&2048)){a:{var c=b;b=V;var d=W;var e=b.pendingProps;switch(b.tag){case 2:break;case 16:break;case 15:case 0:break;case 1:L(b.type)&&Ff(b);break;case 3:nh(b);Gf(b);e=b.stateNode;e.pendingContext&&(e.context=e.pendingContext,e.pendingContext=null);(null===c||null===c.child)&&ki(b)&&Ci(b);Ii(b);break;case 5:ph(b);d=lh(kh.current);var f=b.type;if(null!==c&&null!=b.stateNode)Ji(c,b,f,e,d),c.ref!==b.ref&&(b.effectTag|=128);else if(e){var g=
24016
- lh(ih.current);if(ki(b)){e=b;var h=e.stateNode;c=e.type;var k=e.memoizedProps,l=d;h[ue]=e;h[ve]=k;f=void 0;d=h;switch(c){case "iframe":case "object":case "embed":F("load",d);break;case "video":case "audio":for(h=0;h<cc.length;h++)F(cc[h],d);break;case "source":F("error",d);break;case "img":case "image":case "link":F("error",d);F("load",d);break;case "form":F("reset",d);F("submit",d);break;case "details":F("toggle",d);break;case "input":Bb(d,k);F("invalid",d);$d(l,"onChange");break;case "select":d._wrapperState=
24017
- {wasMultiple:!!k.multiple};F("invalid",d);$d(l,"onChange");break;case "textarea":Lb(d,k),F("invalid",d),$d(l,"onChange")}Yd(c,k);h=null;for(f in k)k.hasOwnProperty(f)&&(g=k[f],"children"===f?"string"===typeof g?d.textContent!==g&&(h=["children",g]):"number"===typeof g&&d.textContent!==""+g&&(h=["children",""+g]):ia.hasOwnProperty(f)&&null!=g&&$d(l,f));switch(c){case "input":yb(d);Gb(d,k,!0);break;case "textarea":yb(d);Nb(d,k);break;case "select":case "option":break;default:"function"===typeof k.onClick&&
24018
- (d.onclick=ae)}f=h;e.updateQueue=f;e=null!==f?!0:!1;e&&Ci(b)}else{c=b;l=f;k=e;h=9===d.nodeType?d:d.ownerDocument;g===Ob.html&&(g=Pb(l));g===Ob.html?"script"===l?(k=h.createElement("div"),k.innerHTML="<script>\x3c/script>",h=k.removeChild(k.firstChild)):"string"===typeof k.is?h=h.createElement(l,{is:k.is}):(h=h.createElement(l),"select"===l&&(l=h,k.multiple?l.multiple=!0:k.size&&(l.size=k.size))):h=h.createElementNS(g,l);k=h;k[ue]=c;k[ve]=e;Hi(k,b,!1,!1);b.stateNode=k;l=f;c=e;var m=d,C=Zd(l,c);switch(l){case "iframe":case "object":case "embed":F("load",
24019
- k);d=c;break;case "video":case "audio":for(d=0;d<cc.length;d++)F(cc[d],k);d=c;break;case "source":F("error",k);d=c;break;case "img":case "image":case "link":F("error",k);F("load",k);d=c;break;case "form":F("reset",k);F("submit",k);d=c;break;case "details":F("toggle",k);d=c;break;case "input":Bb(k,c);d=Ab(k,c);F("invalid",k);$d(m,"onChange");break;case "option":d=Ib(k,c);break;case "select":k._wrapperState={wasMultiple:!!c.multiple};d=n({},c,{value:void 0});F("invalid",k);$d(m,"onChange");break;case "textarea":Lb(k,
24020
- c);d=Kb(k,c);F("invalid",k);$d(m,"onChange");break;default:d=c}Yd(l,d);h=void 0;g=l;var y=k,H=d;for(h in H)if(H.hasOwnProperty(h)){var z=H[h];"style"===h?Wd(y,z):"dangerouslySetInnerHTML"===h?(z=z?z.__html:void 0,null!=z&&Sb(y,z)):"children"===h?"string"===typeof z?("textarea"!==g||""!==z)&&Tb(y,z):"number"===typeof z&&Tb(y,""+z):"suppressContentEditableWarning"!==h&&"suppressHydrationWarning"!==h&&"autoFocus"!==h&&(ia.hasOwnProperty(h)?null!=z&&$d(m,h):null!=z&&vb(y,h,z,C))}switch(l){case "input":yb(k);
24021
- Gb(k,c,!1);break;case "textarea":yb(k);Nb(k,c);break;case "option":null!=c.value&&k.setAttribute("value",""+ub(c.value));break;case "select":d=k;d.multiple=!!c.multiple;k=c.value;null!=k?Jb(d,!!c.multiple,k,!1):null!=c.defaultValue&&Jb(d,!!c.multiple,c.defaultValue,!0);break;default:"function"===typeof d.onClick&&(k.onclick=ae)}(e=ne(f,e))&&Ci(b)}null!==b.ref&&(b.effectTag|=128)}else if(null===b.stateNode)throw Error(u(166));break;case 6:if(c&&null!=b.stateNode)Ki(c,b,c.memoizedProps,e);else{if("string"!==
24022
- typeof e&&null===b.stateNode)throw Error(u(166));d=lh(kh.current);lh(ih.current);ki(b)?(e=b,f=e.stateNode,d=e.memoizedProps,f[ue]=e,(e=f.nodeValue!==d)&&Ci(b)):(f=b,e=(9===d.nodeType?d:d.ownerDocument).createTextNode(e),e[ue]=f,b.stateNode=e)}break;case 11:break;case 13:G(M,b);e=b.memoizedState;if(0!==(b.effectTag&64)){b.expirationTime=d;break a}e=null!==e;f=!1;null===c?void 0!==b.memoizedProps.fallback&&ki(b):(d=c.memoizedState,f=null!==d,e||null===d||(d=c.child.sibling,null!==d&&(k=b.firstEffect,
24023
- null!==k?(b.firstEffect=d,d.nextEffect=k):(b.firstEffect=b.lastEffect=d,d.nextEffect=null),d.effectTag=8)));if(e&&!f&&0!==(b.mode&2))if(null===c&&!0!==b.memoizedProps.unstable_avoidThisFallback||0!==(M.current&1))X===qj&&(X=tj);else{if(X===qj||X===tj)X=uj;0!==Aj&&null!==U&&(Mj(U,W),Nj(U,Aj))}if(e||f)b.effectTag|=4;break;case 7:break;case 8:break;case 12:break;case 4:nh(b);Ii(b);break;case 10:tg(b);break;case 9:break;case 14:break;case 17:L(b.type)&&Ff(b);break;case 19:G(M,b);e=b.memoizedState;if(null===
24024
- e)break;f=0!==(b.effectTag&64);k=e.rendering;if(null===k)if(f)Li(e,!1);else{if(X!==qj||null!==c&&0!==(c.effectTag&64))for(c=b.child;null!==c;){k=qh(c);if(null!==k){b.effectTag|=64;Li(e,!1);f=k.updateQueue;null!==f&&(b.updateQueue=f,b.effectTag|=4);null===e.lastEffect&&(b.firstEffect=null);b.lastEffect=e.lastEffect;e=d;for(f=b.child;null!==f;)d=f,c=e,d.effectTag&=2,d.nextEffect=null,d.firstEffect=null,d.lastEffect=null,k=d.alternate,null===k?(d.childExpirationTime=0,d.expirationTime=c,d.child=null,
24025
- d.memoizedProps=null,d.memoizedState=null,d.updateQueue=null,d.dependencies=null):(d.childExpirationTime=k.childExpirationTime,d.expirationTime=k.expirationTime,d.child=k.child,d.memoizedProps=k.memoizedProps,d.memoizedState=k.memoizedState,d.updateQueue=k.updateQueue,c=k.dependencies,d.dependencies=null===c?null:{expirationTime:c.expirationTime,firstContext:c.firstContext,responders:c.responders}),f=f.sibling;I(M,M.current&1|2,b);b=b.child;break a}c=c.sibling}}else{if(!f)if(c=qh(k),null!==c){if(b.effectTag|=
24026
- 64,f=!0,d=c.updateQueue,null!==d&&(b.updateQueue=d,b.effectTag|=4),Li(e,!0),null===e.tail&&"hidden"===e.tailMode&&!k.alternate){b=b.lastEffect=e.lastEffect;null!==b&&(b.nextEffect=null);break}}else cg()>e.tailExpiration&&1<d&&(b.effectTag|=64,f=!0,Li(e,!1),b.expirationTime=b.childExpirationTime=d-1);e.isBackwards?(k.sibling=b.child,b.child=k):(d=e.last,null!==d?d.sibling=k:b.child=k,e.last=k)}if(null!==e.tail){0===e.tailExpiration&&(e.tailExpiration=cg()+500);d=e.tail;e.rendering=d;e.tail=d.sibling;
24027
- e.lastEffect=b.lastEffect;d.sibling=null;e=M.current;e=f?e&1|2:e&1;I(M,e,b);b=d;break a}break;case 20:break;case 21:break;default:throw Error(u(156,b.tag));}b=null}e=V;if(1===W||1!==e.childExpirationTime){f=0;for(d=e.child;null!==d;)c=d.expirationTime,k=d.childExpirationTime,c>f&&(f=c),k>f&&(f=k),d=d.sibling;e.childExpirationTime=f}if(null!==b)return b;null!==a&&0===(a.effectTag&2048)&&(null===a.firstEffect&&(a.firstEffect=V.firstEffect),null!==V.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=
24028
- V.firstEffect),a.lastEffect=V.lastEffect),1<V.effectTag&&(null!==a.lastEffect?a.lastEffect.nextEffect=V:a.firstEffect=V,a.lastEffect=V))}else{b=Mi(V,W);if(null!==b)return b.effectTag&=2047,b;null!==a&&(a.firstEffect=a.lastEffect=null,a.effectTag|=2048)}b=V.sibling;if(null!==b)return b;V=a}while(null!==V);X===qj&&(X=vj);return null}function Xj(a){var b=a.expirationTime;a=a.childExpirationTime;return b>a?b:a}function Yj(a){var b=dg();fg(99,ik.bind(null,a,b));return null}
24029
- function ik(a,b){do Sj();while(null!==Ej);if((T&(oj|pj))!==S)throw Error(u(327));var c=a.finishedWork,d=a.finishedExpirationTime;if(null===c)return null;a.finishedWork=null;a.finishedExpirationTime=0;if(c===a.current)throw Error(u(177));a.callbackNode=null;a.callbackExpirationTime=0;a.callbackPriority=90;a.nextKnownPendingLevel=0;var e=Xj(c);a.firstPendingTime=e;d<=a.lastSuspendedTime?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:d<=a.firstSuspendedTime&&(a.firstSuspendedTime=
24030
- d-1);d<=a.lastPingedTime&&(a.lastPingedTime=0);d<=a.lastExpiredTime&&(a.lastExpiredTime=0);a===U&&(V=U=null,W=0);1<c.effectTag?null!==c.lastEffect?(c.lastEffect.nextEffect=c,e=c.firstEffect):e=c:e=c.firstEffect;if(null!==e){var f=T;T|=pj;mj.current=null;le=Ld;var g=fe();if(ge(g)){if("selectionStart"in g)var h={start:g.selectionStart,end:g.selectionEnd};else a:{h=(h=g.ownerDocument)&&h.defaultView||window;var k=h.getSelection&&h.getSelection();if(k&&0!==k.rangeCount){h=k.anchorNode;var l=k.anchorOffset,
24031
- m=k.focusNode;k=k.focusOffset;try{h.nodeType,m.nodeType}catch(Db){h=null;break a}var C=0,y=-1,H=-1,z=0,ta=0,r=g,x=null;b:for(;;){for(var A;;){r!==h||0!==l&&3!==r.nodeType||(y=C+l);r!==m||0!==k&&3!==r.nodeType||(H=C+k);3===r.nodeType&&(C+=r.nodeValue.length);if(null===(A=r.firstChild))break;x=r;r=A}for(;;){if(r===g)break b;x===h&&++z===l&&(y=C);x===m&&++ta===k&&(H=C);if(null!==(A=r.nextSibling))break;r=x;x=r.parentNode}r=A}h=-1===y||-1===H?null:{start:y,end:H}}else h=null}h=h||{start:0,end:0}}else h=
24032
- null;me={focusedElem:g,selectionRange:h};Ld=!1;Y=e;do try{jk()}catch(Db){if(null===Y)throw Error(u(330));Ri(Y,Db);Y=Y.nextEffect}while(null!==Y);Y=e;do try{for(g=a,h=b;null!==Y;){var p=Y.effectTag;p&16&&Tb(Y.stateNode,"");if(p&128){var t=Y.alternate;if(null!==t){var v=t.ref;null!==v&&("function"===typeof v?v(null):v.current=null)}}switch(p&1038){case 2:$i(Y);Y.effectTag&=-3;break;case 6:$i(Y);Y.effectTag&=-3;aj(Y.alternate,Y);break;case 1024:Y.effectTag&=-1025;break;case 1028:Y.effectTag&=-1025;aj(Y.alternate,
24033
- Y);break;case 4:aj(Y.alternate,Y);break;case 8:l=Y,Xi(g,l,h),Yi(l)}Y=Y.nextEffect}}catch(Db){if(null===Y)throw Error(u(330));Ri(Y,Db);Y=Y.nextEffect}while(null!==Y);v=me;t=fe();p=v.focusedElem;h=v.selectionRange;if(t!==p&&p&&p.ownerDocument&&ee(p.ownerDocument.documentElement,p)){null!==h&&ge(p)&&(t=h.start,v=h.end,void 0===v&&(v=t),"selectionStart"in p?(p.selectionStart=t,p.selectionEnd=Math.min(v,p.value.length)):(v=(t=p.ownerDocument||document)&&t.defaultView||window,v.getSelection&&(v=v.getSelection(),
24034
- l=p.textContent.length,g=Math.min(h.start,l),h=void 0===h.end?g:Math.min(h.end,l),!v.extend&&g>h&&(l=h,h=g,g=l),l=de(p,g),m=de(p,h),l&&m&&(1!==v.rangeCount||v.anchorNode!==l.node||v.anchorOffset!==l.offset||v.focusNode!==m.node||v.focusOffset!==m.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),v.removeAllRanges(),g>h?(v.addRange(t),v.extend(m.node,m.offset)):(t.setEnd(m.node,m.offset),v.addRange(t))))));t=[];for(v=p;v=v.parentNode;)1===v.nodeType&&t.push({element:v,left:v.scrollLeft,top:v.scrollTop});
24035
- "function"===typeof p.focus&&p.focus();for(p=0;p<t.length;p++)v=t[p],v.element.scrollLeft=v.left,v.element.scrollTop=v.top}me=null;Ld=!!le;le=null;a.current=c;Y=e;do try{for(p=d;null!==Y;){var Dh=Y.effectTag;if(Dh&36){var dc=Y.alternate;t=Y;v=p;switch(t.tag){case 0:case 11:case 15:Ui(16,32,t);break;case 1:var fd=t.stateNode;if(t.effectTag&4)if(null===dc)fd.componentDidMount();else{var hk=t.elementType===t.type?dc.memoizedProps:mg(t.type,dc.memoizedProps);fd.componentDidUpdate(hk,dc.memoizedState,
24036
- fd.__reactInternalSnapshotBeforeUpdate)}var Eh=t.updateQueue;null!==Eh&&Kg(t,Eh,fd,v);break;case 3:var Fh=t.updateQueue;if(null!==Fh){g=null;if(null!==t.child)switch(t.child.tag){case 5:g=t.child.stateNode;break;case 1:g=t.child.stateNode}Kg(t,Fh,g,v)}break;case 5:var xk=t.stateNode;null===dc&&t.effectTag&4&&ne(t.type,t.memoizedProps)&&xk.focus();break;case 6:break;case 4:break;case 12:break;case 13:if(null===t.memoizedState){var Di=t.alternate;if(null!==Di){var Ei=Di.memoizedState;if(null!==Ei){var Fi=
24037
- Ei.dehydrated;null!==Fi&&Lc(Fi)}}}break;case 19:case 17:case 20:case 21:break;default:throw Error(u(163));}}if(Dh&128){t=void 0;var xd=Y.ref;if(null!==xd){var Gi=Y.stateNode;switch(Y.tag){case 5:t=Gi;break;default:t=Gi}"function"===typeof xd?xd(t):xd.current=t}}Y=Y.nextEffect}}catch(Db){if(null===Y)throw Error(u(330));Ri(Y,Db);Y=Y.nextEffect}while(null!==Y);Y=null;Yf();T=f}else a.current=c;if(Dj)Dj=!1,Ej=a,Fj=b;else for(Y=e;null!==Y;)b=Y.nextEffect,Y.nextEffect=null,Y=b;b=a.firstPendingTime;0===b&&
24038
- (jj=null);1073741823===b?a===Ij?Hj++:(Hj=0,Ij=a):Hj=0;"function"===typeof kk&&kk(c.stateNode,d);Z(a);if(gj)throw gj=!1,a=hj,hj=null,a;if((T&nj)!==S)return null;jg();return null}function jk(){for(;null!==Y;){var a=Y.effectTag;0!==(a&256)&&Ti(Y.alternate,Y);0===(a&512)||Dj||(Dj=!0,gg(97,function(){Sj();return null}));Y=Y.nextEffect}}function Sj(){if(90!==Fj){var a=97<Fj?97:Fj;Fj=90;return fg(a,lk)}}
24039
- function lk(){if(null===Ej)return!1;var a=Ej;Ej=null;if((T&(oj|pj))!==S)throw Error(u(331));var b=T;T|=pj;for(a=a.current.firstEffect;null!==a;){try{var c=a;if(0!==(c.effectTag&512))switch(c.tag){case 0:case 11:case 15:Ui(128,0,c),Ui(0,64,c)}}catch(d){if(null===a)throw Error(u(330));Ri(a,d)}c=a.nextEffect;a.nextEffect=null;a=c}T=b;jg();return!0}function mk(a,b,c){b=Ni(c,b);b=fj(a,b,1073741823);Dg(a,b);a=Kj(a,1073741823);null!==a&&Z(a)}
24040
- function Ri(a,b){if(3===a.tag)mk(a,a,b);else for(var c=a.return;null!==c;){if(3===c.tag){mk(c,a,b);break}else if(1===c.tag){var d=c.stateNode;if("function"===typeof c.type.getDerivedStateFromError||"function"===typeof d.componentDidCatch&&(null===jj||!jj.has(d))){a=Ni(b,a);a=ij(c,a,1073741823);Dg(c,a);c=Kj(c,1073741823);null!==c&&Z(c);break}}c=c.return}}
24041
- function dk(a,b,c){var d=a.pingCache;null!==d&&d.delete(b);U===a&&W===c?X===uj||X===tj&&1073741823===xj&&cg()-bj<Cj?Tj(a,W):Bj=!0:Pj(a,c)&&(b=a.lastPingedTime,0!==b&&b<c||(a.lastPingedTime=c,a.finishedExpirationTime===c&&(a.finishedExpirationTime=0,a.finishedWork=null),Z(a)))}function dj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=Pg(),b=Qg(b,a,null));a=Kj(a,b);null!==a&&Z(a)}var gk;
24042
- gk=function(a,b,c){var d=b.expirationTime;if(null!==a){var e=b.pendingProps;if(a.memoizedProps!==e||K.current)wg=!0;else{if(d<c){wg=!1;switch(b.tag){case 3:wi(b);li();break;case 5:oh(b);if(b.mode&4&&1!==c&&e.hidden)return b.expirationTime=b.childExpirationTime=1,null;break;case 1:L(b.type)&&Jf(b);break;case 4:mh(b,b.stateNode.containerInfo);break;case 10:sg(b,b.memoizedProps.value);break;case 13:if(null!==b.memoizedState){d=b.child.childExpirationTime;if(0!==d&&d>=c)return yi(a,b,c);I(M,M.current&
24043
- 1,b);b=oi(a,b,c);return null!==b?b.sibling:null}I(M,M.current&1,b);break;case 19:d=b.childExpirationTime>=c;if(0!==(a.effectTag&64)){if(d)return Bi(a,b,c);b.effectTag|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null);I(M,M.current,b);if(!d)return null}return oi(a,b,c)}wg=!1}}else wg=!1;b.expirationTime=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;e=Ef(b,J.current);vg(b,c);e=Ih(null,b,d,a,e,c);b.effectTag|=1;if("object"===
24044
- typeof e&&null!==e&&"function"===typeof e.render&&void 0===e.$$typeof){b.tag=1;Mh();if(L(d)){var f=!0;Jf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;var g=d.getDerivedStateFromProps;"function"===typeof g&&Og(b,d,g,a);e.updater=Sg;b.stateNode=e;e._reactInternalFiber=b;Wg(b,d,a,c);b=vi(null,b,d,!0,f,c)}else b.tag=0,R(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2);a=b.pendingProps;Va(e);if(1!==e._status)throw e._result;
24045
- e=e._result;b.type=e;f=b.tag=nk(e);a=mg(e,a);switch(f){case 0:b=si(null,b,e,a,c);break;case 1:b=ui(null,b,e,a,c);break;case 11:b=ni(null,b,e,a,c);break;case 14:b=pi(null,b,e,mg(e.type,a),d,c);break;default:throw Error(u(306,e,""));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:mg(d,e),si(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:mg(d,e),ui(a,b,d,e,c);case 3:wi(b);d=b.updateQueue;if(null===d)throw Error(u(282));e=b.memoizedState;e=null!==e?e.element:
24046
- null;Hg(b,d,b.pendingProps,null,c);d=b.memoizedState.element;if(d===e)li(),b=oi(a,b,c);else{if(e=b.stateNode.hydrate)di=re(b.stateNode.containerInfo.firstChild),ci=b,e=ei=!0;if(e)for(c=gh(b,null,d,c),b.child=c;c;)c.effectTag=c.effectTag&-3|1024,c=c.sibling;else R(a,b,d,c),li();b=b.child}return b;case 5:return oh(b),null===a&&ii(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,oe(d,e)?g=null:null!==f&&oe(d,f)&&(b.effectTag|=16),ti(a,b),b.mode&4&&1!==c&&e.hidden?(b.expirationTime=
24047
- b.childExpirationTime=1,b=null):(R(a,b,g,c),b=b.child),b;case 6:return null===a&&ii(b),null;case 13:return yi(a,b,c);case 4:return mh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=fh(b,null,d,c):R(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:mg(d,e),ni(a,b,d,e,c);case 7:return R(a,b,b.pendingProps,c),b.child;case 8:return R(a,b,b.pendingProps.children,c),b.child;case 12:return R(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;
24048
- e=b.pendingProps;g=b.memoizedProps;f=e.value;sg(b,f);if(null!==g){var h=g.value;f=of(h,f)?0:("function"===typeof d._calculateChangedBits?d._calculateChangedBits(h,f):1073741823)|0;if(0===f){if(g.children===e.children&&!K.current){b=oi(a,b,c);break a}}else for(h=b.child,null!==h&&(h.return=b);null!==h;){var k=h.dependencies;if(null!==k){g=h.child;for(var l=k.firstContext;null!==l;){if(l.context===d&&0!==(l.observedBits&f)){1===h.tag&&(l=Bg(c,null),l.tag=2,Dg(h,l));h.expirationTime<c&&(h.expirationTime=
24049
- c);l=h.alternate;null!==l&&l.expirationTime<c&&(l.expirationTime=c);ug(h.return,c);k.expirationTime<c&&(k.expirationTime=c);break}l=l.next}}else g=10===h.tag?h.type===b.type?null:h.child:h.child;if(null!==g)g.return=h;else for(g=h;null!==g;){if(g===b){g=null;break}h=g.sibling;if(null!==h){h.return=g.return;g=h;break}g=g.return}h=g}}R(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,f=b.pendingProps,d=f.children,vg(b,c),e=xg(e,f.unstable_observedBits),d=d(e),b.effectTag|=1,R(a,b,d,c),b.child;
24050
- case 14:return e=b.type,f=mg(e,b.pendingProps),f=mg(e.type,f),pi(a,b,e,f,d,c);case 15:return ri(a,b,b.type,b.pendingProps,d,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:mg(d,e),null!==a&&(a.alternate=null,b.alternate=null,b.effectTag|=2),b.tag=1,L(d)?(a=!0,Jf(b)):a=!1,vg(b,c),Ug(b,d,e,c),Wg(b,d,e,c),vi(null,b,d,!0,a,c);case 19:return Bi(a,b,c)}throw Error(u(156,b.tag));};var kk=null,Wi=null;
24051
- function ok(a){if("undefined"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var b=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(b.isDisabled||!b.supportsFiber)return!0;try{var c=b.inject(a);kk=function(a){try{b.onCommitFiberRoot(c,a,void 0,64===(a.current.effectTag&64))}catch(e){}};Wi=function(a){try{b.onCommitFiberUnmount(c,a)}catch(e){}}}catch(d){}return!0}
24052
- function pk(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.effectTag=0;this.lastEffect=this.firstEffect=this.nextEffect=null;this.childExpirationTime=this.expirationTime=0;this.alternate=null}function gi(a,b,c,d){return new pk(a,b,c,d)}
24053
- function qi(a){a=a.prototype;return!(!a||!a.isReactComponent)}function nk(a){if("function"===typeof a)return qi(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Oa)return 11;if(a===Ra)return 14}return 2}
24054
- function ah(a,b){var c=a.alternate;null===c?(c=gi(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.effectTag=0,c.nextEffect=null,c.firstEffect=null,c.lastEffect=null);c.childExpirationTime=a.childExpirationTime;c.expirationTime=a.expirationTime;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{expirationTime:b.expirationTime,
24055
- firstContext:b.firstContext,responders:b.responders};c.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}
24056
- function ch(a,b,c,d,e,f){var g=2;d=a;if("function"===typeof a)qi(a)&&(g=1);else if("string"===typeof a)g=5;else a:switch(a){case Ia:return eh(c.children,e,f,b);case Na:g=8;e|=7;break;case Ja:g=8;e|=1;break;case Ka:return a=gi(12,c,b,e|8),a.elementType=Ka,a.type=Ka,a.expirationTime=f,a;case Pa:return a=gi(13,c,b,e),a.type=Pa,a.elementType=Pa,a.expirationTime=f,a;case Qa:return a=gi(19,c,b,e),a.elementType=Qa,a.expirationTime=f,a;default:if("object"===typeof a&&null!==a)switch(a.$$typeof){case La:g=
24057
- 10;break a;case Ma:g=9;break a;case Oa:g=11;break a;case Ra:g=14;break a;case Sa:g=16;d=null;break a}throw Error(u(130,null==a?a:typeof a,""));}b=gi(g,c,b,e);b.elementType=a;b.type=d;b.expirationTime=f;return b}function eh(a,b,c,d){a=gi(7,a,d,b);a.expirationTime=c;return a}function bh(a,b,c){a=gi(6,a,null,b);a.expirationTime=c;return a}
24058
- function dh(a,b,c){b=gi(4,null!==a.children?a.children:[],a.key,b);b.expirationTime=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}
24059
- function qk(a,b,c){this.tag=b;this.current=null;this.containerInfo=a;this.pingCache=this.pendingChildren=null;this.finishedExpirationTime=0;this.finishedWork=null;this.timeoutHandle=-1;this.pendingContext=this.context=null;this.hydrate=c;this.callbackNode=null;this.callbackPriority=90;this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}
24060
- function Pj(a,b){var c=a.firstSuspendedTime;a=a.lastSuspendedTime;return 0!==c&&c>=b&&a<=b}function Mj(a,b){var c=a.firstSuspendedTime,d=a.lastSuspendedTime;c<b&&(a.firstSuspendedTime=b);if(d>b||0===c)a.lastSuspendedTime=b;b<=a.lastPingedTime&&(a.lastPingedTime=0);b<=a.lastExpiredTime&&(a.lastExpiredTime=0)}
24061
- function Nj(a,b){b>a.firstPendingTime&&(a.firstPendingTime=b);var c=a.firstSuspendedTime;0!==c&&(b>=c?a.firstSuspendedTime=a.lastSuspendedTime=a.nextKnownPendingLevel=0:b>=a.lastSuspendedTime&&(a.lastSuspendedTime=b+1),b>a.nextKnownPendingLevel&&(a.nextKnownPendingLevel=b))}function Rj(a,b){var c=a.lastExpiredTime;if(0===c||c>b)a.lastExpiredTime=b}
24062
- function rk(a,b,c,d){var e=b.current,f=Pg(),g=Mg.suspense;f=Qg(f,e,g);a:if(c){c=c._reactInternalFiber;b:{if(ec(c)!==c||1!==c.tag)throw Error(u(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break b;case 1:if(L(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break b}}h=h.return}while(null!==h);throw Error(u(171));}if(1===c.tag){var k=c.type;if(L(k)){c=If(c,k,h);break a}}c=h}else c=Cf;null===b.context?b.context=c:b.pendingContext=c;b=Bg(f,g);b.payload={element:a};d=void 0===
24063
- d?null:d;null!==d&&(b.callback=d);Dg(e,b);Rg(e,f);return f}function sk(a){a=a.current;if(!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function tk(a,b){a=a.memoizedState;null!==a&&null!==a.dehydrated&&a.retryTime<b&&(a.retryTime=b)}function uk(a,b){tk(a,b);(a=a.alternate)&&tk(a,b)}
24064
- function vk(a,b,c){c=null!=c&&!0===c.hydrate;var d=new qk(a,b,c),e=gi(3,null,null,2===b?7:1===b?3:0);d.current=e;e.stateNode=d;a[we]=d.current;c&&0!==b&&wc(9===a.nodeType?a:a.ownerDocument);this._internalRoot=d}vk.prototype.render=function(a,b){rk(a,this._internalRoot,null,void 0===b?null:b)};vk.prototype.unmount=function(a){var b=this._internalRoot,c=void 0===a?null:a,d=b.containerInfo;rk(null,b,null,function(){d[we]=null;null!==c&&c()})};
24065
- function wk(a){return!(!a||1!==a.nodeType&&9!==a.nodeType&&11!==a.nodeType&&(8!==a.nodeType||" react-mount-point-unstable "!==a.nodeValue))}function yk(a,b){b||(b=a?9===a.nodeType?a.documentElement:a.firstChild:null,b=!(!b||1!==b.nodeType||!b.hasAttribute("data-reactroot")));if(!b)for(var c;c=a.lastChild;)a.removeChild(c);return new vk(a,0,b?{hydrate:!0}:void 0)}
24066
- function zk(a,b,c,d,e){var f=c._reactRootContainer;if(f){var g=f._internalRoot;if("function"===typeof e){var h=e;e=function(){var a=sk(g);h.call(a)}}rk(b,g,a,e)}else{f=c._reactRootContainer=yk(c,d);g=f._internalRoot;if("function"===typeof e){var k=e;e=function(){var a=sk(g);k.call(a)}}ck(function(){rk(b,g,a,e)})}return sk(g)}function Ak(a,b,c){var d=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ha,key:null==d?null:""+d,children:a,containerInfo:b,implementation:c}}
24067
- jc=function(a){if(13===a.tag){var b=lg(Pg(),150,100);Rg(a,b);uk(a,b)}};kc=function(a){if(13===a.tag){Pg();var b=kg++;Rg(a,b);uk(a,b)}};lc=function(a){if(13===a.tag){var b=Pg();b=Qg(b,a,null);Rg(a,b);uk(a,b)}};
24068
- Za=function(a,b,c){switch(b){case "input":Eb(a,c);b=c.name;if("radio"===c.type&&null!=b){for(c=a;c.parentNode;)c=c.parentNode;c=c.querySelectorAll("input[name="+JSON.stringify(""+b)+'][type="radio"]');for(b=0;b<c.length;b++){var d=c[b];if(d!==a&&d.form===a.form){var e=ye(d);if(!e)throw Error(u(90));zb(d);Eb(d,e)}}}break;case "textarea":Mb(a,c);break;case "select":b=c.value,null!=b&&Jb(a,!!c.multiple,b,!1)}};eb=bk;
24069
- fb=function(a,b,c,d){var e=T;T|=4;try{return fg(98,a.bind(null,b,c,d))}finally{T=e,T===S&&jg()}};gb=function(){(T&(1|oj|pj))===S&&(ak(),Sj())};hb=function(a,b){var c=T;T|=2;try{return a(b)}finally{T=c,T===S&&jg()}};function Bk(a,b){var c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!wk(b))throw Error(u(200));return Ak(a,b,null,c)}
24070
- var Ck={createPortal:Bk,findDOMNode:function(a){if(null==a)return null;if(1===a.nodeType)return a;var b=a._reactInternalFiber;if(void 0===b){if("function"===typeof a.render)throw Error(u(188));throw Error(u(268,Object.keys(a)));}a=ic(b);a=null===a?null:a.stateNode;return a},hydrate:function(a,b,c){if(!wk(b))throw Error(u(200));return zk(null,a,b,!0,c)},render:function(a,b,c){if(!wk(b))throw Error(u(200));return zk(null,a,b,!1,c)},unstable_renderSubtreeIntoContainer:function(a,b,c,d){if(!wk(c))throw Error(u(200));
24071
- if(null==a||void 0===a._reactInternalFiber)throw Error(u(38));return zk(a,b,c,!1,d)},unmountComponentAtNode:function(a){if(!wk(a))throw Error(u(40));return a._reactRootContainer?(ck(function(){zk(null,null,a,!1,function(){a._reactRootContainer=null;a[we]=null})}),!0):!1},unstable_createPortal:function(){return Bk.apply(void 0,arguments)},unstable_batchedUpdates:bk,flushSync:function(a,b){if((T&(oj|pj))!==S)throw Error(u(187));var c=T;T|=1;try{return fg(99,a.bind(null,b))}finally{T=c,jg()}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[Cc,
24072
- xe,ye,Ca.injectEventPluginsByName,fa,Sc,function(a){ya(a,Rc)},cb,db,Pd,Ba,Sj,{current:!1}]}};
24073
- (function(a){var b=a.findFiberByHostInstance;return ok(n({},a,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ea.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=ic(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:Fc,bundleType:0,version:"16.12.0",
24074
- rendererPackageName:"react-dom"});var Dk={default:Ck},Ek=Dk&&Ck||Dk;module.exports=Ek.default||Ek;
24075
-
24076
-
24077
- /***/ }),
24078
- /* 300 */
24079
- /***/ (function(module, exports, __webpack_require__) {
24080
-
24081
- "use strict";
24082
- /** @license React v0.18.0
24083
- * scheduler.production.min.js
24084
- *
24085
- * Copyright (c) Facebook, Inc. and its affiliates.
24086
- *
24087
- * This source code is licensed under the MIT license found in the
24088
- * LICENSE file in the root directory of this source tree.
24089
- */
24090
-
24091
- Object.defineProperty(exports,"__esModule",{value:!0});var f,g,h,k,l;
24092
- if("undefined"===typeof window||"function"!==typeof MessageChannel){var p=null,q=null,t=function(){if(null!==p)try{var a=exports.unstable_now();p(!0,a);p=null}catch(b){throw setTimeout(t,0),b;}},u=Date.now();exports.unstable_now=function(){return Date.now()-u};f=function(a){null!==p?setTimeout(f,0,a):(p=a,setTimeout(t,0))};g=function(a,b){q=setTimeout(a,b)};h=function(){clearTimeout(q)};k=function(){return!1};l=exports.unstable_forceFrameRate=function(){}}else{var w=window.performance,x=window.Date,
24093
- y=window.setTimeout,z=window.clearTimeout;if("undefined"!==typeof console){var A=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills");"function"!==typeof A&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"===
24094
- typeof w&&"function"===typeof w.now)exports.unstable_now=function(){return w.now()};else{var B=x.now();exports.unstable_now=function(){return x.now()-B}}var C=!1,D=null,E=-1,F=5,G=0;k=function(){return exports.unstable_now()>=G};l=function(){};exports.unstable_forceFrameRate=function(a){0>a||125<a?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):F=0<a?Math.floor(1E3/a):5};var H=new MessageChannel,I=H.port2;H.port1.onmessage=
24095
- function(){if(null!==D){var a=exports.unstable_now();G=a+F;try{D(!0,a)?I.postMessage(null):(C=!1,D=null)}catch(b){throw I.postMessage(null),b;}}else C=!1};f=function(a){D=a;C||(C=!0,I.postMessage(null))};g=function(a,b){E=y(function(){a(exports.unstable_now())},b)};h=function(){z(E);E=-1}}function J(a,b){var c=a.length;a.push(b);a:for(;;){var d=Math.floor((c-1)/2),e=a[d];if(void 0!==e&&0<K(e,b))a[d]=b,a[c]=e,c=d;else break a}}function L(a){a=a[0];return void 0===a?null:a}
24096
- function M(a){var b=a[0];if(void 0!==b){var c=a.pop();if(c!==b){a[0]=c;a:for(var d=0,e=a.length;d<e;){var m=2*(d+1)-1,n=a[m],v=m+1,r=a[v];if(void 0!==n&&0>K(n,c))void 0!==r&&0>K(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>K(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function K(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var N=[],O=[],P=1,Q=null,R=3,S=!1,T=!1,U=!1;
24097
- function V(a){for(var b=L(O);null!==b;){if(null===b.callback)M(O);else if(b.startTime<=a)M(O),b.sortIndex=b.expirationTime,J(N,b);else break;b=L(O)}}function W(a){U=!1;V(a);if(!T)if(null!==L(N))T=!0,f(X);else{var b=L(O);null!==b&&g(W,b.startTime-a)}}
24098
- function X(a,b){T=!1;U&&(U=!1,h());S=!0;var c=R;try{V(b);for(Q=L(N);null!==Q&&(!(Q.expirationTime>b)||a&&!k());){var d=Q.callback;if(null!==d){Q.callback=null;R=Q.priorityLevel;var e=d(Q.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?Q.callback=e:Q===L(N)&&M(N);V(b)}else M(N);Q=L(N)}if(null!==Q)var m=!0;else{var n=L(O);null!==n&&g(W,n.startTime-b);m=!1}return m}finally{Q=null,R=c,S=!1}}
24099
- function Y(a){switch(a){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1E4;default:return 5E3}}var Z=l;exports.unstable_ImmediatePriority=1;exports.unstable_UserBlockingPriority=2;exports.unstable_NormalPriority=3;exports.unstable_IdlePriority=5;exports.unstable_LowPriority=4;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=R;R=a;try{return b()}finally{R=c}};
24100
- exports.unstable_next=function(a){switch(R){case 1:case 2:case 3:var b=3;break;default:b=R}var c=R;R=b;try{return a()}finally{R=c}};
24101
- exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();if("object"===typeof c&&null!==c){var e=c.delay;e="number"===typeof e&&0<e?d+e:d;c="number"===typeof c.timeout?c.timeout:Y(a)}else c=Y(a),e=d;c=e+c;a={id:P++,callback:b,priorityLevel:a,startTime:e,expirationTime:c,sortIndex:-1};e>d?(a.sortIndex=e,J(O,a),null===L(N)&&a===L(O)&&(U?h():U=!0,g(W,e-d))):(a.sortIndex=c,J(N,a),T||S||(T=!0,f(X)));return a};exports.unstable_cancelCallback=function(a){a.callback=null};
24102
- exports.unstable_wrapCallback=function(a){var b=R;return function(){var c=R;R=b;try{return a.apply(this,arguments)}finally{R=c}}};exports.unstable_getCurrentPriorityLevel=function(){return R};exports.unstable_shouldYield=function(){var a=exports.unstable_now();V(a);var b=L(N);return b!==Q&&null!==Q&&null!==b&&null!==b.callback&&b.startTime<=a&&b.expirationTime<Q.expirationTime||k()};exports.unstable_requestPaint=Z;exports.unstable_continueExecution=function(){T||S||(T=!0,f(X))};
24103
- exports.unstable_pauseExecution=function(){};exports.unstable_getFirstCallbackNode=function(){return L(N)};exports.unstable_Profiling=null;
24104
-
24105
-
24106
- /***/ }),
24107
- /* 301 */
24108
- /***/ (function(module, exports, __webpack_require__) {
24109
-
24110
- "use strict";
24111
- /* WEBPACK VAR INJECTION */(function(process) {/** @license React v0.18.0
24112
- * scheduler.development.js
24113
- *
24114
- * Copyright (c) Facebook, Inc. and its affiliates.
24115
- *
24116
- * This source code is licensed under the MIT license found in the
24117
- * LICENSE file in the root directory of this source tree.
24118
- */
24119
-
24120
-
24121
-
24122
-
24123
-
24124
- if (process.env.NODE_ENV !== "production") {
24125
- (function() {
24126
- 'use strict';
24127
-
24128
- Object.defineProperty(exports, '__esModule', { value: true });
24129
-
24130
- var enableSchedulerDebugging = false;
24131
- var enableIsInputPending = false;
24132
- var enableProfiling = true;
24133
-
24134
- var requestHostCallback;
24135
-
24136
- var requestHostTimeout;
24137
- var cancelHostTimeout;
24138
- var shouldYieldToHost;
24139
- var requestPaint;
24140
-
24141
-
24142
-
24143
- if ( // If Scheduler runs in a non-DOM environment, it falls back to a naive
24144
- // implementation using setTimeout.
24145
- typeof window === 'undefined' || // Check if MessageChannel is supported, too.
24146
- typeof MessageChannel !== 'function') {
24147
- // If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore,
24148
- // fallback to a naive implementation.
24149
- var _callback = null;
24150
- var _timeoutID = null;
24151
-
24152
- var _flushCallback = function () {
24153
- if (_callback !== null) {
24154
- try {
24155
- var currentTime = exports.unstable_now();
24156
- var hasRemainingTime = true;
24157
-
24158
- _callback(hasRemainingTime, currentTime);
24159
-
24160
- _callback = null;
24161
- } catch (e) {
24162
- setTimeout(_flushCallback, 0);
24163
- throw e;
24164
- }
24165
- }
24166
- };
24167
-
24168
- var initialTime = Date.now();
24169
-
24170
- exports.unstable_now = function () {
24171
- return Date.now() - initialTime;
24172
- };
24173
-
24174
- requestHostCallback = function (cb) {
24175
- if (_callback !== null) {
24176
- // Protect against re-entrancy.
24177
- setTimeout(requestHostCallback, 0, cb);
24178
- } else {
24179
- _callback = cb;
24180
- setTimeout(_flushCallback, 0);
24181
- }
24182
- };
24183
-
24184
- requestHostTimeout = function (cb, ms) {
24185
- _timeoutID = setTimeout(cb, ms);
24186
- };
24187
-
24188
- cancelHostTimeout = function () {
24189
- clearTimeout(_timeoutID);
24190
- };
24191
-
24192
- shouldYieldToHost = function () {
24193
- return false;
24194
- };
24195
-
24196
- requestPaint = exports.unstable_forceFrameRate = function () {};
24197
- } else {
24198
- // Capture local references to native APIs, in case a polyfill overrides them.
24199
- var performance = window.performance;
24200
- var _Date = window.Date;
24201
- var _setTimeout = window.setTimeout;
24202
- var _clearTimeout = window.clearTimeout;
24203
-
24204
- if (typeof console !== 'undefined') {
24205
- // TODO: Scheduler no longer requires these methods to be polyfilled. But
24206
- // maybe we want to continue warning if they don't exist, to preserve the
24207
- // option to rely on it in the future?
24208
- var requestAnimationFrame = window.requestAnimationFrame;
24209
- var cancelAnimationFrame = window.cancelAnimationFrame; // TODO: Remove fb.me link
24210
-
24211
- if (typeof requestAnimationFrame !== 'function') {
24212
- console.error("This browser doesn't support requestAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
24213
- }
24214
-
24215
- if (typeof cancelAnimationFrame !== 'function') {
24216
- console.error("This browser doesn't support cancelAnimationFrame. " + 'Make sure that you load a ' + 'polyfill in older browsers. https://fb.me/react-polyfills');
24217
- }
24218
- }
24219
-
24220
- if (typeof performance === 'object' && typeof performance.now === 'function') {
24221
- exports.unstable_now = function () {
24222
- return performance.now();
24223
- };
24224
- } else {
24225
- var _initialTime = _Date.now();
24226
-
24227
- exports.unstable_now = function () {
24228
- return _Date.now() - _initialTime;
24229
- };
24230
- }
24231
-
24232
- var isMessageLoopRunning = false;
24233
- var scheduledHostCallback = null;
24234
- var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main
24235
- // thread, like user events. By default, it yields multiple times per frame.
24236
- // It does not attempt to align with frame boundaries, since most tasks don't
24237
- // need to be frame aligned; for those that do, use requestAnimationFrame.
24238
-
24239
- var yieldInterval = 5;
24240
- var deadline = 0; // TODO: Make this configurable
24241
- // TODO: Adjust this based on priority?
24242
-
24243
- var maxYieldInterval = 300;
24244
- var needsPaint = false;
24245
-
24246
- if (enableIsInputPending && navigator !== undefined && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined) {
24247
- var scheduling = navigator.scheduling;
24248
-
24249
- shouldYieldToHost = function () {
24250
- var currentTime = exports.unstable_now();
24251
-
24252
- if (currentTime >= deadline) {
24253
- // There's no time left. We may want to yield control of the main
24254
- // thread, so the browser can perform high priority tasks. The main ones
24255
- // are painting and user input. If there's a pending paint or a pending
24256
- // input, then we should yield. But if there's neither, then we can
24257
- // yield less often while remaining responsive. We'll eventually yield
24258
- // regardless, since there could be a pending paint that wasn't
24259
- // accompanied by a call to `requestPaint`, or other main thread tasks
24260
- // like network events.
24261
- if (needsPaint || scheduling.isInputPending()) {
24262
- // There is either a pending paint or a pending input.
24263
- return true;
24264
- } // There's no pending input. Only yield if we've reached the max
24265
- // yield interval.
24266
-
24267
-
24268
- return currentTime >= maxYieldInterval;
24269
- } else {
24270
- // There's still time left in the frame.
24271
- return false;
24272
- }
24273
- };
24274
-
24275
- requestPaint = function () {
24276
- needsPaint = true;
24277
- };
24278
- } else {
24279
- // `isInputPending` is not available. Since we have no way of knowing if
24280
- // there's pending input, always yield at the end of the frame.
24281
- shouldYieldToHost = function () {
24282
- return exports.unstable_now() >= deadline;
24283
- }; // Since we yield every frame regardless, `requestPaint` has no effect.
24284
-
24285
-
24286
- requestPaint = function () {};
24287
- }
24288
-
24289
- exports.unstable_forceFrameRate = function (fps) {
24290
- if (fps < 0 || fps > 125) {
24291
- console.error('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing framerates higher than 125 fps is not unsupported');
24292
- return;
24293
- }
24294
-
24295
- if (fps > 0) {
24296
- yieldInterval = Math.floor(1000 / fps);
24297
- } else {
24298
- // reset the framerate
24299
- yieldInterval = 5;
24300
- }
24301
- };
24302
-
24303
- var performWorkUntilDeadline = function () {
24304
- if (scheduledHostCallback !== null) {
24305
- var currentTime = exports.unstable_now(); // Yield after `yieldInterval` ms, regardless of where we are in the vsync
24306
- // cycle. This means there's always time remaining at the beginning of
24307
- // the message event.
24308
-
24309
- deadline = currentTime + yieldInterval;
24310
- var hasTimeRemaining = true;
24311
-
24312
- try {
24313
- var hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime);
24314
-
24315
- if (!hasMoreWork) {
24316
- isMessageLoopRunning = false;
24317
- scheduledHostCallback = null;
24318
- } else {
24319
- // If there's more work, schedule the next message event at the end
24320
- // of the preceding one.
24321
- port.postMessage(null);
24322
- }
24323
- } catch (error) {
24324
- // If a scheduler task throws, exit the current browser task so the
24325
- // error can be observed.
24326
- port.postMessage(null);
24327
- throw error;
24328
- }
24329
- } else {
24330
- isMessageLoopRunning = false;
24331
- } // Yielding to the browser will give it a chance to paint, so we can
24332
- // reset this.
24333
-
24334
-
24335
- needsPaint = false;
24336
- };
24337
-
24338
- var channel = new MessageChannel();
24339
- var port = channel.port2;
24340
- channel.port1.onmessage = performWorkUntilDeadline;
24341
-
24342
- requestHostCallback = function (callback) {
24343
- scheduledHostCallback = callback;
24344
-
24345
- if (!isMessageLoopRunning) {
24346
- isMessageLoopRunning = true;
24347
- port.postMessage(null);
24348
- }
24349
- };
24350
-
24351
- requestHostTimeout = function (callback, ms) {
24352
- taskTimeoutID = _setTimeout(function () {
24353
- callback(exports.unstable_now());
24354
- }, ms);
24355
- };
24356
-
24357
- cancelHostTimeout = function () {
24358
- _clearTimeout(taskTimeoutID);
24359
-
24360
- taskTimeoutID = -1;
24361
- };
24362
- }
24363
-
24364
- function push(heap, node) {
24365
- var index = heap.length;
24366
- heap.push(node);
24367
- siftUp(heap, node, index);
24368
- }
24369
- function peek(heap) {
24370
- var first = heap[0];
24371
- return first === undefined ? null : first;
24372
- }
24373
- function pop(heap) {
24374
- var first = heap[0];
24375
-
24376
- if (first !== undefined) {
24377
- var last = heap.pop();
24378
-
24379
- if (last !== first) {
24380
- heap[0] = last;
24381
- siftDown(heap, last, 0);
24382
- }
24383
-
24384
- return first;
24385
- } else {
24386
- return null;
24387
- }
24388
- }
24389
-
24390
- function siftUp(heap, node, i) {
24391
- var index = i;
24392
-
24393
- while (true) {
24394
- var parentIndex = Math.floor((index - 1) / 2);
24395
- var parent = heap[parentIndex];
24396
-
24397
- if (parent !== undefined && compare(parent, node) > 0) {
24398
- // The parent is larger. Swap positions.
24399
- heap[parentIndex] = node;
24400
- heap[index] = parent;
24401
- index = parentIndex;
24402
- } else {
24403
- // The parent is smaller. Exit.
24404
- return;
24405
- }
24406
- }
24407
- }
24408
-
24409
- function siftDown(heap, node, i) {
24410
- var index = i;
24411
- var length = heap.length;
24412
-
24413
- while (index < length) {
24414
- var leftIndex = (index + 1) * 2 - 1;
24415
- var left = heap[leftIndex];
24416
- var rightIndex = leftIndex + 1;
24417
- var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those.
24418
-
24419
- if (left !== undefined && compare(left, node) < 0) {
24420
- if (right !== undefined && compare(right, left) < 0) {
24421
- heap[index] = right;
24422
- heap[rightIndex] = node;
24423
- index = rightIndex;
24424
- } else {
24425
- heap[index] = left;
24426
- heap[leftIndex] = node;
24427
- index = leftIndex;
24428
- }
24429
- } else if (right !== undefined && compare(right, node) < 0) {
24430
- heap[index] = right;
24431
- heap[rightIndex] = node;
24432
- index = rightIndex;
24433
- } else {
24434
- // Neither child is smaller. Exit.
24435
- return;
24436
- }
24437
- }
24438
- }
24439
-
24440
- function compare(a, b) {
24441
- // Compare sort index first, then task id.
24442
- var diff = a.sortIndex - b.sortIndex;
24443
- return diff !== 0 ? diff : a.id - b.id;
24444
- }
24445
-
24446
- // TODO: Use symbols?
24447
- var NoPriority = 0;
24448
- var ImmediatePriority = 1;
24449
- var UserBlockingPriority = 2;
24450
- var NormalPriority = 3;
24451
- var LowPriority = 4;
24452
- var IdlePriority = 5;
24453
-
24454
- var runIdCounter = 0;
24455
- var mainThreadIdCounter = 0;
24456
- var profilingStateSize = 4;
24457
- var sharedProfilingBuffer = enableProfiling ? // $FlowFixMe Flow doesn't know about SharedArrayBuffer
24458
- typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer
24459
- typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9
24460
- : null;
24461
- var profilingState = enableProfiling && sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks
24462
-
24463
- var PRIORITY = 0;
24464
- var CURRENT_TASK_ID = 1;
24465
- var CURRENT_RUN_ID = 2;
24466
- var QUEUE_SIZE = 3;
24467
-
24468
- if (enableProfiling) {
24469
- profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue
24470
- // array might include canceled tasks.
24471
-
24472
- profilingState[QUEUE_SIZE] = 0;
24473
- profilingState[CURRENT_TASK_ID] = 0;
24474
- } // Bytes per element is 4
24475
-
24476
-
24477
- var INITIAL_EVENT_LOG_SIZE = 131072;
24478
- var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes
24479
-
24480
- var eventLogSize = 0;
24481
- var eventLogBuffer = null;
24482
- var eventLog = null;
24483
- var eventLogIndex = 0;
24484
- var TaskStartEvent = 1;
24485
- var TaskCompleteEvent = 2;
24486
- var TaskErrorEvent = 3;
24487
- var TaskCancelEvent = 4;
24488
- var TaskRunEvent = 5;
24489
- var TaskYieldEvent = 6;
24490
- var SchedulerSuspendEvent = 7;
24491
- var SchedulerResumeEvent = 8;
24492
-
24493
- function logEvent(entries) {
24494
- if (eventLog !== null) {
24495
- var offset = eventLogIndex;
24496
- eventLogIndex += entries.length;
24497
-
24498
- if (eventLogIndex + 1 > eventLogSize) {
24499
- eventLogSize *= 2;
24500
-
24501
- if (eventLogSize > MAX_EVENT_LOG_SIZE) {
24502
- console.error("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.');
24503
- stopLoggingProfilingEvents();
24504
- return;
24505
- }
24506
-
24507
- var newEventLog = new Int32Array(eventLogSize * 4);
24508
- newEventLog.set(eventLog);
24509
- eventLogBuffer = newEventLog.buffer;
24510
- eventLog = newEventLog;
24511
- }
24512
-
24513
- eventLog.set(entries, offset);
24514
- }
24515
- }
24516
-
24517
- function startLoggingProfilingEvents() {
24518
- eventLogSize = INITIAL_EVENT_LOG_SIZE;
24519
- eventLogBuffer = new ArrayBuffer(eventLogSize * 4);
24520
- eventLog = new Int32Array(eventLogBuffer);
24521
- eventLogIndex = 0;
24522
- }
24523
- function stopLoggingProfilingEvents() {
24524
- var buffer = eventLogBuffer;
24525
- eventLogSize = 0;
24526
- eventLogBuffer = null;
24527
- eventLog = null;
24528
- eventLogIndex = 0;
24529
- return buffer;
24530
- }
24531
- function markTaskStart(task, ms) {
24532
- if (enableProfiling) {
24533
- profilingState[QUEUE_SIZE]++;
24534
-
24535
- if (eventLog !== null) {
24536
- // performance.now returns a float, representing milliseconds. When the
24537
- // event is logged, it's coerced to an int. Convert to microseconds to
24538
- // maintain extra degrees of precision.
24539
- logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]);
24540
- }
24541
- }
24542
- }
24543
- function markTaskCompleted(task, ms) {
24544
- if (enableProfiling) {
24545
- profilingState[PRIORITY] = NoPriority;
24546
- profilingState[CURRENT_TASK_ID] = 0;
24547
- profilingState[QUEUE_SIZE]--;
24548
-
24549
- if (eventLog !== null) {
24550
- logEvent([TaskCompleteEvent, ms * 1000, task.id]);
24551
- }
24552
- }
24553
- }
24554
- function markTaskCanceled(task, ms) {
24555
- if (enableProfiling) {
24556
- profilingState[QUEUE_SIZE]--;
24557
-
24558
- if (eventLog !== null) {
24559
- logEvent([TaskCancelEvent, ms * 1000, task.id]);
24560
- }
24561
- }
24562
- }
24563
- function markTaskErrored(task, ms) {
24564
- if (enableProfiling) {
24565
- profilingState[PRIORITY] = NoPriority;
24566
- profilingState[CURRENT_TASK_ID] = 0;
24567
- profilingState[QUEUE_SIZE]--;
24568
-
24569
- if (eventLog !== null) {
24570
- logEvent([TaskErrorEvent, ms * 1000, task.id]);
24571
- }
24572
- }
24573
- }
24574
- function markTaskRun(task, ms) {
24575
- if (enableProfiling) {
24576
- runIdCounter++;
24577
- profilingState[PRIORITY] = task.priorityLevel;
24578
- profilingState[CURRENT_TASK_ID] = task.id;
24579
- profilingState[CURRENT_RUN_ID] = runIdCounter;
24580
-
24581
- if (eventLog !== null) {
24582
- logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]);
24583
- }
24584
- }
24585
- }
24586
- function markTaskYield(task, ms) {
24587
- if (enableProfiling) {
24588
- profilingState[PRIORITY] = NoPriority;
24589
- profilingState[CURRENT_TASK_ID] = 0;
24590
- profilingState[CURRENT_RUN_ID] = 0;
24591
-
24592
- if (eventLog !== null) {
24593
- logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]);
24594
- }
24595
- }
24596
- }
24597
- function markSchedulerSuspended(ms) {
24598
- if (enableProfiling) {
24599
- mainThreadIdCounter++;
24600
-
24601
- if (eventLog !== null) {
24602
- logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]);
24603
- }
24604
- }
24605
- }
24606
- function markSchedulerUnsuspended(ms) {
24607
- if (enableProfiling) {
24608
- if (eventLog !== null) {
24609
- logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]);
24610
- }
24611
- }
24612
- }
24613
-
24614
- /* eslint-disable no-var */
24615
- // Math.pow(2, 30) - 1
24616
- // 0b111111111111111111111111111111
24617
-
24618
- var maxSigned31BitInt = 1073741823; // Times out immediately
24619
-
24620
- var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out
24621
-
24622
- var USER_BLOCKING_PRIORITY = 250;
24623
- var NORMAL_PRIORITY_TIMEOUT = 5000;
24624
- var LOW_PRIORITY_TIMEOUT = 10000; // Never times out
24625
-
24626
- var IDLE_PRIORITY = maxSigned31BitInt; // Tasks are stored on a min heap
24627
-
24628
- var taskQueue = [];
24629
- var timerQueue = []; // Incrementing id counter. Used to maintain insertion order.
24630
-
24631
- var taskIdCounter = 1; // Pausing the scheduler is useful for debugging.
24632
-
24633
- var isSchedulerPaused = false;
24634
- var currentTask = null;
24635
- var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrancy.
24636
-
24637
- var isPerformingWork = false;
24638
- var isHostCallbackScheduled = false;
24639
- var isHostTimeoutScheduled = false;
24640
-
24641
- function advanceTimers(currentTime) {
24642
- // Check for tasks that are no longer delayed and add them to the queue.
24643
- var timer = peek(timerQueue);
24644
-
24645
- while (timer !== null) {
24646
- if (timer.callback === null) {
24647
- // Timer was cancelled.
24648
- pop(timerQueue);
24649
- } else if (timer.startTime <= currentTime) {
24650
- // Timer fired. Transfer to the task queue.
24651
- pop(timerQueue);
24652
- timer.sortIndex = timer.expirationTime;
24653
- push(taskQueue, timer);
24654
-
24655
- if (enableProfiling) {
24656
- markTaskStart(timer, currentTime);
24657
- timer.isQueued = true;
24658
- }
24659
- } else {
24660
- // Remaining timers are pending.
24661
- return;
24662
- }
24663
-
24664
- timer = peek(timerQueue);
24665
- }
24666
- }
24667
-
24668
- function handleTimeout(currentTime) {
24669
- isHostTimeoutScheduled = false;
24670
- advanceTimers(currentTime);
24671
-
24672
- if (!isHostCallbackScheduled) {
24673
- if (peek(taskQueue) !== null) {
24674
- isHostCallbackScheduled = true;
24675
- requestHostCallback(flushWork);
24676
- } else {
24677
- var firstTimer = peek(timerQueue);
24678
-
24679
- if (firstTimer !== null) {
24680
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
24681
- }
24682
- }
24683
- }
24684
- }
24685
-
24686
- function flushWork(hasTimeRemaining, initialTime) {
24687
- if (enableProfiling) {
24688
- markSchedulerUnsuspended(initialTime);
24689
- } // We'll need a host callback the next time work is scheduled.
24690
-
24691
-
24692
- isHostCallbackScheduled = false;
24693
-
24694
- if (isHostTimeoutScheduled) {
24695
- // We scheduled a timeout but it's no longer needed. Cancel it.
24696
- isHostTimeoutScheduled = false;
24697
- cancelHostTimeout();
24698
- }
24699
-
24700
- isPerformingWork = true;
24701
- var previousPriorityLevel = currentPriorityLevel;
24702
-
24703
- try {
24704
- if (enableProfiling) {
24705
- try {
24706
- return workLoop(hasTimeRemaining, initialTime);
24707
- } catch (error) {
24708
- if (currentTask !== null) {
24709
- var currentTime = exports.unstable_now();
24710
- markTaskErrored(currentTask, currentTime);
24711
- currentTask.isQueued = false;
24712
- }
24713
-
24714
- throw error;
24715
- }
24716
- } else {
24717
- // No catch in prod codepath.
24718
- return workLoop(hasTimeRemaining, initialTime);
24719
- }
24720
- } finally {
24721
- currentTask = null;
24722
- currentPriorityLevel = previousPriorityLevel;
24723
- isPerformingWork = false;
24724
-
24725
- if (enableProfiling) {
24726
- var _currentTime = exports.unstable_now();
24727
-
24728
- markSchedulerSuspended(_currentTime);
24729
- }
24730
- }
24731
- }
24732
-
24733
- function workLoop(hasTimeRemaining, initialTime) {
24734
- var currentTime = initialTime;
24735
- advanceTimers(currentTime);
24736
- currentTask = peek(taskQueue);
24737
-
24738
- while (currentTask !== null && !(enableSchedulerDebugging && isSchedulerPaused)) {
24739
- if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) {
24740
- // This currentTask hasn't expired, and we've reached the deadline.
24741
- break;
24742
- }
24743
-
24744
- var callback = currentTask.callback;
24745
-
24746
- if (callback !== null) {
24747
- currentTask.callback = null;
24748
- currentPriorityLevel = currentTask.priorityLevel;
24749
- var didUserCallbackTimeout = currentTask.expirationTime <= currentTime;
24750
- markTaskRun(currentTask, currentTime);
24751
- var continuationCallback = callback(didUserCallbackTimeout);
24752
- currentTime = exports.unstable_now();
24753
-
24754
- if (typeof continuationCallback === 'function') {
24755
- currentTask.callback = continuationCallback;
24756
- markTaskYield(currentTask, currentTime);
24757
- } else {
24758
- if (enableProfiling) {
24759
- markTaskCompleted(currentTask, currentTime);
24760
- currentTask.isQueued = false;
24761
- }
24762
-
24763
- if (currentTask === peek(taskQueue)) {
24764
- pop(taskQueue);
24765
- }
24766
- }
24767
-
24768
- advanceTimers(currentTime);
24769
- } else {
24770
- pop(taskQueue);
24771
- }
24772
-
24773
- currentTask = peek(taskQueue);
24774
- } // Return whether there's additional work
24775
-
24776
-
24777
- if (currentTask !== null) {
24778
- return true;
24779
- } else {
24780
- var firstTimer = peek(timerQueue);
24781
-
24782
- if (firstTimer !== null) {
24783
- requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime);
24784
- }
24785
-
24786
- return false;
24787
- }
24788
- }
24789
-
24790
- function unstable_runWithPriority(priorityLevel, eventHandler) {
24791
- switch (priorityLevel) {
24792
- case ImmediatePriority:
24793
- case UserBlockingPriority:
24794
- case NormalPriority:
24795
- case LowPriority:
24796
- case IdlePriority:
24797
- break;
24798
-
24799
- default:
24800
- priorityLevel = NormalPriority;
24801
- }
24802
-
24803
- var previousPriorityLevel = currentPriorityLevel;
24804
- currentPriorityLevel = priorityLevel;
24805
-
24806
- try {
24807
- return eventHandler();
24808
- } finally {
24809
- currentPriorityLevel = previousPriorityLevel;
24810
- }
24811
- }
24812
-
24813
- function unstable_next(eventHandler) {
24814
- var priorityLevel;
24815
-
24816
- switch (currentPriorityLevel) {
24817
- case ImmediatePriority:
24818
- case UserBlockingPriority:
24819
- case NormalPriority:
24820
- // Shift down to normal priority
24821
- priorityLevel = NormalPriority;
24822
- break;
24823
-
24824
- default:
24825
- // Anything lower than normal priority should remain at the current level.
24826
- priorityLevel = currentPriorityLevel;
24827
- break;
24828
- }
24829
-
24830
- var previousPriorityLevel = currentPriorityLevel;
24831
- currentPriorityLevel = priorityLevel;
24832
-
24833
- try {
24834
- return eventHandler();
24835
- } finally {
24836
- currentPriorityLevel = previousPriorityLevel;
24837
- }
24838
- }
24839
-
24840
- function unstable_wrapCallback(callback) {
24841
- var parentPriorityLevel = currentPriorityLevel;
24842
- return function () {
24843
- // This is a fork of runWithPriority, inlined for performance.
24844
- var previousPriorityLevel = currentPriorityLevel;
24845
- currentPriorityLevel = parentPriorityLevel;
24846
-
24847
- try {
24848
- return callback.apply(this, arguments);
24849
- } finally {
24850
- currentPriorityLevel = previousPriorityLevel;
24851
- }
24852
- };
24853
- }
24854
-
24855
- function timeoutForPriorityLevel(priorityLevel) {
24856
- switch (priorityLevel) {
24857
- case ImmediatePriority:
24858
- return IMMEDIATE_PRIORITY_TIMEOUT;
24859
-
24860
- case UserBlockingPriority:
24861
- return USER_BLOCKING_PRIORITY;
24862
-
24863
- case IdlePriority:
24864
- return IDLE_PRIORITY;
24865
-
24866
- case LowPriority:
24867
- return LOW_PRIORITY_TIMEOUT;
24868
-
24869
- case NormalPriority:
24870
- default:
24871
- return NORMAL_PRIORITY_TIMEOUT;
24872
- }
24873
- }
24874
-
24875
- function unstable_scheduleCallback(priorityLevel, callback, options) {
24876
- var currentTime = exports.unstable_now();
24877
- var startTime;
24878
- var timeout;
24879
-
24880
- if (typeof options === 'object' && options !== null) {
24881
- var delay = options.delay;
24882
-
24883
- if (typeof delay === 'number' && delay > 0) {
24884
- startTime = currentTime + delay;
24885
- } else {
24886
- startTime = currentTime;
24887
- }
24888
-
24889
- timeout = typeof options.timeout === 'number' ? options.timeout : timeoutForPriorityLevel(priorityLevel);
24890
- } else {
24891
- timeout = timeoutForPriorityLevel(priorityLevel);
24892
- startTime = currentTime;
24893
- }
24894
-
24895
- var expirationTime = startTime + timeout;
24896
- var newTask = {
24897
- id: taskIdCounter++,
24898
- callback: callback,
24899
- priorityLevel: priorityLevel,
24900
- startTime: startTime,
24901
- expirationTime: expirationTime,
24902
- sortIndex: -1
24903
- };
24904
-
24905
- if (enableProfiling) {
24906
- newTask.isQueued = false;
24907
- }
24908
-
24909
- if (startTime > currentTime) {
24910
- // This is a delayed task.
24911
- newTask.sortIndex = startTime;
24912
- push(timerQueue, newTask);
24913
-
24914
- if (peek(taskQueue) === null && newTask === peek(timerQueue)) {
24915
- // All tasks are delayed, and this is the task with the earliest delay.
24916
- if (isHostTimeoutScheduled) {
24917
- // Cancel an existing timeout.
24918
- cancelHostTimeout();
24919
- } else {
24920
- isHostTimeoutScheduled = true;
24921
- } // Schedule a timeout.
24922
-
24923
-
24924
- requestHostTimeout(handleTimeout, startTime - currentTime);
24925
- }
24926
- } else {
24927
- newTask.sortIndex = expirationTime;
24928
- push(taskQueue, newTask);
24929
-
24930
- if (enableProfiling) {
24931
- markTaskStart(newTask, currentTime);
24932
- newTask.isQueued = true;
24933
- } // Schedule a host callback, if needed. If we're already performing work,
24934
- // wait until the next time we yield.
24935
-
24936
-
24937
- if (!isHostCallbackScheduled && !isPerformingWork) {
24938
- isHostCallbackScheduled = true;
24939
- requestHostCallback(flushWork);
24940
- }
24941
- }
24942
-
24943
- return newTask;
24944
- }
24945
-
24946
- function unstable_pauseExecution() {
24947
- isSchedulerPaused = true;
24948
- }
24949
-
24950
- function unstable_continueExecution() {
24951
- isSchedulerPaused = false;
24952
-
24953
- if (!isHostCallbackScheduled && !isPerformingWork) {
24954
- isHostCallbackScheduled = true;
24955
- requestHostCallback(flushWork);
24956
- }
24957
- }
24958
-
24959
- function unstable_getFirstCallbackNode() {
24960
- return peek(taskQueue);
24961
- }
24962
-
24963
- function unstable_cancelCallback(task) {
24964
- if (enableProfiling) {
24965
- if (task.isQueued) {
24966
- var currentTime = exports.unstable_now();
24967
- markTaskCanceled(task, currentTime);
24968
- task.isQueued = false;
24969
- }
24970
- } // Null out the callback to indicate the task has been canceled. (Can't
24971
- // remove from the queue because you can't remove arbitrary nodes from an
24972
- // array based heap, only the first one.)
24973
-
24974
-
24975
- task.callback = null;
24976
- }
24977
-
24978
- function unstable_getCurrentPriorityLevel() {
24979
- return currentPriorityLevel;
24980
- }
24981
-
24982
- function unstable_shouldYield() {
24983
- var currentTime = exports.unstable_now();
24984
- advanceTimers(currentTime);
24985
- var firstTask = peek(taskQueue);
24986
- return firstTask !== currentTask && currentTask !== null && firstTask !== null && firstTask.callback !== null && firstTask.startTime <= currentTime && firstTask.expirationTime < currentTask.expirationTime || shouldYieldToHost();
24987
- }
24988
-
24989
- var unstable_requestPaint = requestPaint;
24990
- var unstable_Profiling = enableProfiling ? {
24991
- startLoggingProfilingEvents: startLoggingProfilingEvents,
24992
- stopLoggingProfilingEvents: stopLoggingProfilingEvents,
24993
- sharedProfilingBuffer: sharedProfilingBuffer
24994
- } : null;
24995
-
24996
- exports.unstable_ImmediatePriority = ImmediatePriority;
24997
- exports.unstable_UserBlockingPriority = UserBlockingPriority;
24998
- exports.unstable_NormalPriority = NormalPriority;
24999
- exports.unstable_IdlePriority = IdlePriority;
25000
- exports.unstable_LowPriority = LowPriority;
25001
- exports.unstable_runWithPriority = unstable_runWithPriority;
25002
- exports.unstable_next = unstable_next;
25003
- exports.unstable_scheduleCallback = unstable_scheduleCallback;
25004
- exports.unstable_cancelCallback = unstable_cancelCallback;
25005
- exports.unstable_wrapCallback = unstable_wrapCallback;
25006
- exports.unstable_getCurrentPriorityLevel = unstable_getCurrentPriorityLevel;
25007
- exports.unstable_shouldYield = unstable_shouldYield;
25008
- exports.unstable_requestPaint = unstable_requestPaint;
25009
- exports.unstable_continueExecution = unstable_continueExecution;
25010
- exports.unstable_pauseExecution = unstable_pauseExecution;
25011
- exports.unstable_getFirstCallbackNode = unstable_getFirstCallbackNode;
25012
- exports.unstable_Profiling = unstable_Profiling;
25013
- })();
25014
- }
25015
-
25016
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
25017
-
25018
- /***/ }),
25019
- /* 302 */
25020
- /***/ (function(module, exports, __webpack_require__) {
25021
-
25022
- "use strict";
25023
- /* WEBPACK VAR INJECTION */(function(process) {/** @license React v16.12.0
25024
- * react-dom.development.js
25025
- *
25026
- * Copyright (c) Facebook, Inc. and its affiliates.
25027
- *
25028
- * This source code is licensed under the MIT license found in the
25029
- * LICENSE file in the root directory of this source tree.
25030
- */
25031
-
25032
-
25033
-
25034
-
25035
-
25036
- if (process.env.NODE_ENV !== "production") {
25037
- (function() {
25038
- 'use strict';
25039
-
25040
- var React = __webpack_require__(0);
25041
- var _assign = __webpack_require__(43);
25042
- var Scheduler = __webpack_require__(133);
25043
- var checkPropTypes = __webpack_require__(88);
25044
- var tracing = __webpack_require__(303);
25045
-
25046
- // Do not require this module directly! Use normal `invariant` calls with
25047
- // template literal strings. The messages will be replaced with error codes
25048
- // during build.
25049
-
25050
- /**
25051
- * Use invariant() to assert state which your program assumes to be true.
25052
- *
25053
- * Provide sprintf-style format (only %s is supported) and arguments
25054
- * to provide information about what broke and what you were
25055
- * expecting.
25056
- *
25057
- * The invariant message will be stripped in production, but the invariant
25058
- * will remain to ensure logic does not differ in production.
25059
- */
25060
-
25061
- if (!React) {
25062
- {
25063
- throw Error("ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.");
25064
- }
25065
- }
25066
-
25067
- /**
25068
- * Injectable ordering of event plugins.
25069
- */
25070
- var eventPluginOrder = null;
25071
- /**
25072
- * Injectable mapping from names to event plugin modules.
25073
- */
25074
-
25075
- var namesToPlugins = {};
25076
- /**
25077
- * Recomputes the plugin list using the injected plugins and plugin ordering.
25078
- *
25079
- * @private
25080
- */
25081
-
25082
- function recomputePluginOrdering() {
25083
- if (!eventPluginOrder) {
25084
- // Wait until an `eventPluginOrder` is injected.
25085
- return;
25086
- }
25087
-
25088
- for (var pluginName in namesToPlugins) {
25089
- var pluginModule = namesToPlugins[pluginName];
25090
- var pluginIndex = eventPluginOrder.indexOf(pluginName);
25091
-
25092
- if (!(pluginIndex > -1)) {
25093
- {
25094
- throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`.");
25095
- }
25096
- }
25097
-
25098
- if (plugins[pluginIndex]) {
25099
- continue;
25100
- }
25101
-
25102
- if (!pluginModule.extractEvents) {
25103
- {
25104
- throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not.");
25105
- }
25106
- }
25107
-
25108
- plugins[pluginIndex] = pluginModule;
25109
- var publishedEvents = pluginModule.eventTypes;
25110
-
25111
- for (var eventName in publishedEvents) {
25112
- if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {
25113
- {
25114
- throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`.");
25115
- }
25116
- }
25117
- }
25118
- }
25119
- }
25120
- /**
25121
- * Publishes an event so that it can be dispatched by the supplied plugin.
25122
- *
25123
- * @param {object} dispatchConfig Dispatch configuration for the event.
25124
- * @param {object} PluginModule Plugin publishing the event.
25125
- * @return {boolean} True if the event was successfully published.
25126
- * @private
25127
- */
25128
-
25129
-
25130
- function publishEventForPlugin(dispatchConfig, pluginModule, eventName) {
25131
- if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {
25132
- {
25133
- throw Error("EventPluginHub: More than one plugin attempted to publish the same event name, `" + eventName + "`.");
25134
- }
25135
- }
25136
-
25137
- eventNameDispatchConfigs[eventName] = dispatchConfig;
25138
- var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
25139
-
25140
- if (phasedRegistrationNames) {
25141
- for (var phaseName in phasedRegistrationNames) {
25142
- if (phasedRegistrationNames.hasOwnProperty(phaseName)) {
25143
- var phasedRegistrationName = phasedRegistrationNames[phaseName];
25144
- publishRegistrationName(phasedRegistrationName, pluginModule, eventName);
25145
- }
25146
- }
25147
-
25148
- return true;
25149
- } else if (dispatchConfig.registrationName) {
25150
- publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);
25151
- return true;
25152
- }
25153
-
25154
- return false;
25155
- }
25156
- /**
25157
- * Publishes a registration name that is used to identify dispatched events.
25158
- *
25159
- * @param {string} registrationName Registration name to add.
25160
- * @param {object} PluginModule Plugin publishing the event.
25161
- * @private
25162
- */
25163
-
25164
-
25165
- function publishRegistrationName(registrationName, pluginModule, eventName) {
25166
- if (!!registrationNameModules[registrationName]) {
25167
- {
25168
- throw Error("EventPluginHub: More than one plugin attempted to publish the same registration name, `" + registrationName + "`.");
25169
- }
25170
- }
25171
-
25172
- registrationNameModules[registrationName] = pluginModule;
25173
- registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;
25174
-
25175
- {
25176
- var lowerCasedName = registrationName.toLowerCase();
25177
- possibleRegistrationNames[lowerCasedName] = registrationName;
25178
-
25179
- if (registrationName === 'onDoubleClick') {
25180
- possibleRegistrationNames.ondblclick = registrationName;
25181
- }
25182
- }
25183
- }
25184
- /**
25185
- * Registers plugins so that they can extract and dispatch events.
25186
- *
25187
- * @see {EventPluginHub}
25188
- */
25189
-
25190
- /**
25191
- * Ordered list of injected plugins.
25192
- */
25193
-
25194
-
25195
- var plugins = [];
25196
- /**
25197
- * Mapping from event name to dispatch config
25198
- */
25199
-
25200
- var eventNameDispatchConfigs = {};
25201
- /**
25202
- * Mapping from registration name to plugin module
25203
- */
25204
-
25205
- var registrationNameModules = {};
25206
- /**
25207
- * Mapping from registration name to event name
25208
- */
25209
-
25210
- var registrationNameDependencies = {};
25211
- /**
25212
- * Mapping from lowercase registration names to the properly cased version,
25213
- * used to warn in the case of missing event handlers. Available
25214
- * only in true.
25215
- * @type {Object}
25216
- */
25217
-
25218
- var possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true
25219
-
25220
- /**
25221
- * Injects an ordering of plugins (by plugin name). This allows the ordering
25222
- * to be decoupled from injection of the actual plugins so that ordering is
25223
- * always deterministic regardless of packaging, on-the-fly injection, etc.
25224
- *
25225
- * @param {array} InjectedEventPluginOrder
25226
- * @internal
25227
- * @see {EventPluginHub.injection.injectEventPluginOrder}
25228
- */
25229
-
25230
- function injectEventPluginOrder(injectedEventPluginOrder) {
25231
- if (!!eventPluginOrder) {
25232
- {
25233
- throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.");
25234
- }
25235
- } // Clone the ordering so it cannot be dynamically mutated.
25236
-
25237
-
25238
- eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
25239
- recomputePluginOrdering();
25240
- }
25241
- /**
25242
- * Injects plugins to be used by `EventPluginHub`. The plugin names must be
25243
- * in the ordering injected by `injectEventPluginOrder`.
25244
- *
25245
- * Plugins can be injected as part of page initialization or on-the-fly.
25246
- *
25247
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
25248
- * @internal
25249
- * @see {EventPluginHub.injection.injectEventPluginsByName}
25250
- */
25251
-
25252
- function injectEventPluginsByName(injectedNamesToPlugins) {
25253
- var isOrderingDirty = false;
25254
-
25255
- for (var pluginName in injectedNamesToPlugins) {
25256
- if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {
25257
- continue;
25258
- }
25259
-
25260
- var pluginModule = injectedNamesToPlugins[pluginName];
25261
-
25262
- if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {
25263
- if (!!namesToPlugins[pluginName]) {
25264
- {
25265
- throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName + "`.");
25266
- }
25267
- }
25268
-
25269
- namesToPlugins[pluginName] = pluginModule;
25270
- isOrderingDirty = true;
25271
- }
25272
- }
25273
-
25274
- if (isOrderingDirty) {
25275
- recomputePluginOrdering();
25276
- }
25277
- }
25278
-
25279
- var invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {
25280
- var funcArgs = Array.prototype.slice.call(arguments, 3);
25281
-
25282
- try {
25283
- func.apply(context, funcArgs);
25284
- } catch (error) {
25285
- this.onError(error);
25286
- }
25287
- };
25288
-
25289
- {
25290
- // In DEV mode, we swap out invokeGuardedCallback for a special version
25291
- // that plays more nicely with the browser's DevTools. The idea is to preserve
25292
- // "Pause on exceptions" behavior. Because React wraps all user-provided
25293
- // functions in invokeGuardedCallback, and the production version of
25294
- // invokeGuardedCallback uses a try-catch, all user exceptions are treated
25295
- // like caught exceptions, and the DevTools won't pause unless the developer
25296
- // takes the extra step of enabling pause on caught exceptions. This is
25297
- // unintuitive, though, because even though React has caught the error, from
25298
- // the developer's perspective, the error is uncaught.
25299
- //
25300
- // To preserve the expected "Pause on exceptions" behavior, we don't use a
25301
- // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake
25302
- // DOM node, and call the user-provided callback from inside an event handler
25303
- // for that fake event. If the callback throws, the error is "captured" using
25304
- // a global event handler. But because the error happens in a different
25305
- // event loop context, it does not interrupt the normal program flow.
25306
- // Effectively, this gives us try-catch behavior without actually using
25307
- // try-catch. Neat!
25308
- // Check that the browser supports the APIs we need to implement our special
25309
- // DEV version of invokeGuardedCallback
25310
- if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {
25311
- var fakeNode = document.createElement('react');
25312
-
25313
- var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {
25314
- // If document doesn't exist we know for sure we will crash in this method
25315
- // when we call document.createEvent(). However this can cause confusing
25316
- // errors: https://github.com/facebookincubator/create-react-app/issues/3482
25317
- // So we preemptively throw with a better message instead.
25318
- if (!(typeof document !== 'undefined')) {
25319
- {
25320
- throw Error("The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.");
25321
- }
25322
- }
25323
-
25324
- var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We
25325
- // set this to true at the beginning, then set it to false right after
25326
- // calling the function. If the function errors, `didError` will never be
25327
- // set to false. This strategy works even if the browser is flaky and
25328
- // fails to call our global error handler, because it doesn't rely on
25329
- // the error event at all.
25330
-
25331
- var didError = true; // Keeps track of the value of window.event so that we can reset it
25332
- // during the callback to let user code access window.event in the
25333
- // browsers that support it.
25334
-
25335
- var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event
25336
- // dispatching: https://github.com/facebook/react/issues/13688
25337
-
25338
- var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously
25339
- // dispatch our fake event using `dispatchEvent`. Inside the handler, we
25340
- // call the user-provided callback.
25341
-
25342
- var funcArgs = Array.prototype.slice.call(arguments, 3);
25343
-
25344
- function callCallback() {
25345
- // We immediately remove the callback from event listeners so that
25346
- // nested `invokeGuardedCallback` calls do not clash. Otherwise, a
25347
- // nested call would trigger the fake event handlers of any call higher
25348
- // in the stack.
25349
- fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the
25350
- // window.event assignment in both IE <= 10 as they throw an error
25351
- // "Member not found" in strict mode, and in Firefox which does not
25352
- // support window.event.
25353
-
25354
- if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {
25355
- window.event = windowEvent;
25356
- }
25357
-
25358
- func.apply(context, funcArgs);
25359
- didError = false;
25360
- } // Create a global error event handler. We use this to capture the value
25361
- // that was thrown. It's possible that this error handler will fire more
25362
- // than once; for example, if non-React code also calls `dispatchEvent`
25363
- // and a handler for that event throws. We should be resilient to most of
25364
- // those cases. Even if our error event handler fires more than once, the
25365
- // last error event is always used. If the callback actually does error,
25366
- // we know that the last error event is the correct one, because it's not
25367
- // possible for anything else to have happened in between our callback
25368
- // erroring and the code that follows the `dispatchEvent` call below. If
25369
- // the callback doesn't error, but the error event was fired, we know to
25370
- // ignore it because `didError` will be false, as described above.
25371
-
25372
-
25373
- var error; // Use this to track whether the error event is ever called.
25374
-
25375
- var didSetError = false;
25376
- var isCrossOriginError = false;
25377
-
25378
- function handleWindowError(event) {
25379
- error = event.error;
25380
- didSetError = true;
25381
-
25382
- if (error === null && event.colno === 0 && event.lineno === 0) {
25383
- isCrossOriginError = true;
25384
- }
25385
-
25386
- if (event.defaultPrevented) {
25387
- // Some other error handler has prevented default.
25388
- // Browsers silence the error report if this happens.
25389
- // We'll remember this to later decide whether to log it or not.
25390
- if (error != null && typeof error === 'object') {
25391
- try {
25392
- error._suppressLogging = true;
25393
- } catch (inner) {// Ignore.
25394
- }
25395
- }
25396
- }
25397
- } // Create a fake event type.
25398
-
25399
-
25400
- var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers
25401
-
25402
- window.addEventListener('error', handleWindowError);
25403
- fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function
25404
- // errors, it will trigger our global error handler.
25405
-
25406
- evt.initEvent(evtType, false, false);
25407
- fakeNode.dispatchEvent(evt);
25408
-
25409
- if (windowEventDescriptor) {
25410
- Object.defineProperty(window, 'event', windowEventDescriptor);
25411
- }
25412
-
25413
- if (didError) {
25414
- if (!didSetError) {
25415
- // The callback errored, but the error event never fired.
25416
- error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');
25417
- } else if (isCrossOriginError) {
25418
- error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');
25419
- }
25420
-
25421
- this.onError(error);
25422
- } // Remove our event listeners
25423
-
25424
-
25425
- window.removeEventListener('error', handleWindowError);
25426
- };
25427
-
25428
- invokeGuardedCallbackImpl = invokeGuardedCallbackDev;
25429
- }
25430
- }
25431
-
25432
- var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;
25433
-
25434
- var hasError = false;
25435
- var caughtError = null; // Used by event system to capture/rethrow the first error.
25436
-
25437
- var hasRethrowError = false;
25438
- var rethrowError = null;
25439
- var reporter = {
25440
- onError: function (error) {
25441
- hasError = true;
25442
- caughtError = error;
25443
- }
25444
- };
25445
- /**
25446
- * Call a function while guarding against errors that happens within it.
25447
- * Returns an error if it throws, otherwise null.
25448
- *
25449
- * In production, this is implemented using a try-catch. The reason we don't
25450
- * use a try-catch directly is so that we can swap out a different
25451
- * implementation in DEV mode.
25452
- *
25453
- * @param {String} name of the guard to use for logging or debugging
25454
- * @param {Function} func The function to invoke
25455
- * @param {*} context The context to use when calling the function
25456
- * @param {...*} args Arguments for function
25457
- */
25458
-
25459
- function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
25460
- hasError = false;
25461
- caughtError = null;
25462
- invokeGuardedCallbackImpl$1.apply(reporter, arguments);
25463
- }
25464
- /**
25465
- * Same as invokeGuardedCallback, but instead of returning an error, it stores
25466
- * it in a global so it can be rethrown by `rethrowCaughtError` later.
25467
- * TODO: See if caughtError and rethrowError can be unified.
25468
- *
25469
- * @param {String} name of the guard to use for logging or debugging
25470
- * @param {Function} func The function to invoke
25471
- * @param {*} context The context to use when calling the function
25472
- * @param {...*} args Arguments for function
25473
- */
25474
-
25475
- function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {
25476
- invokeGuardedCallback.apply(this, arguments);
25477
-
25478
- if (hasError) {
25479
- var error = clearCaughtError();
25480
-
25481
- if (!hasRethrowError) {
25482
- hasRethrowError = true;
25483
- rethrowError = error;
25484
- }
25485
- }
25486
- }
25487
- /**
25488
- * During execution of guarded functions we will capture the first error which
25489
- * we will rethrow to be handled by the top level error handler.
25490
- */
25491
-
25492
- function rethrowCaughtError() {
25493
- if (hasRethrowError) {
25494
- var error = rethrowError;
25495
- hasRethrowError = false;
25496
- rethrowError = null;
25497
- throw error;
25498
- }
25499
- }
25500
- function hasCaughtError() {
25501
- return hasError;
25502
- }
25503
- function clearCaughtError() {
25504
- if (hasError) {
25505
- var error = caughtError;
25506
- hasError = false;
25507
- caughtError = null;
25508
- return error;
25509
- } else {
25510
- {
25511
- {
25512
- throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.");
25513
- }
25514
- }
25515
- }
25516
- }
25517
-
25518
- /**
25519
- * Similar to invariant but only logs a warning if the condition is not met.
25520
- * This can be used to log issues in development environments in critical
25521
- * paths. Removing the logging code for production environments will keep the
25522
- * same logic and follow the same code paths.
25523
- */
25524
- var warningWithoutStack = function () {};
25525
-
25526
- {
25527
- warningWithoutStack = function (condition, format) {
25528
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
25529
- args[_key - 2] = arguments[_key];
25530
- }
25531
-
25532
- if (format === undefined) {
25533
- throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
25534
- }
25535
-
25536
- if (args.length > 8) {
25537
- // Check before the condition to catch violations early.
25538
- throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
25539
- }
25540
-
25541
- if (condition) {
25542
- return;
25543
- }
25544
-
25545
- if (typeof console !== 'undefined') {
25546
- var argsWithFormat = args.map(function (item) {
25547
- return '' + item;
25548
- });
25549
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
25550
- // breaks IE9: https://github.com/facebook/react/issues/13610
25551
-
25552
- Function.prototype.apply.call(console.error, console, argsWithFormat);
25553
- }
25554
-
25555
- try {
25556
- // --- Welcome to debugging React ---
25557
- // This error was thrown as a convenience so that you can use this stack
25558
- // to find the callsite that caused this warning to fire.
25559
- var argIndex = 0;
25560
- var message = 'Warning: ' + format.replace(/%s/g, function () {
25561
- return args[argIndex++];
25562
- });
25563
- throw new Error(message);
25564
- } catch (x) {}
25565
- };
25566
- }
25567
-
25568
- var warningWithoutStack$1 = warningWithoutStack;
25569
-
25570
- var getFiberCurrentPropsFromNode = null;
25571
- var getInstanceFromNode = null;
25572
- var getNodeFromInstance = null;
25573
- function setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {
25574
- getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;
25575
- getInstanceFromNode = getInstanceFromNodeImpl;
25576
- getNodeFromInstance = getNodeFromInstanceImpl;
25577
-
25578
- {
25579
- !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;
25580
- }
25581
- }
25582
- var validateEventDispatches;
25583
-
25584
- {
25585
- validateEventDispatches = function (event) {
25586
- var dispatchListeners = event._dispatchListeners;
25587
- var dispatchInstances = event._dispatchInstances;
25588
- var listenersIsArr = Array.isArray(dispatchListeners);
25589
- var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;
25590
- var instancesIsArr = Array.isArray(dispatchInstances);
25591
- var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;
25592
- !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;
25593
- };
25594
- }
25595
- /**
25596
- * Dispatch the event to the listener.
25597
- * @param {SyntheticEvent} event SyntheticEvent to handle
25598
- * @param {function} listener Application-level callback
25599
- * @param {*} inst Internal component instance
25600
- */
25601
-
25602
-
25603
- function executeDispatch(event, listener, inst) {
25604
- var type = event.type || 'unknown-event';
25605
- event.currentTarget = getNodeFromInstance(inst);
25606
- invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);
25607
- event.currentTarget = null;
25608
- }
25609
- /**
25610
- * Standard/simple iteration through an event's collected dispatches.
25611
- */
25612
-
25613
- function executeDispatchesInOrder(event) {
25614
- var dispatchListeners = event._dispatchListeners;
25615
- var dispatchInstances = event._dispatchInstances;
25616
-
25617
- {
25618
- validateEventDispatches(event);
25619
- }
25620
-
25621
- if (Array.isArray(dispatchListeners)) {
25622
- for (var i = 0; i < dispatchListeners.length; i++) {
25623
- if (event.isPropagationStopped()) {
25624
- break;
25625
- } // Listeners and Instances are two parallel arrays that are always in sync.
25626
-
25627
-
25628
- executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);
25629
- }
25630
- } else if (dispatchListeners) {
25631
- executeDispatch(event, dispatchListeners, dispatchInstances);
25632
- }
25633
-
25634
- event._dispatchListeners = null;
25635
- event._dispatchInstances = null;
25636
- }
25637
- /**
25638
- * @see executeDispatchesInOrderStopAtTrueImpl
25639
- */
25640
-
25641
-
25642
-
25643
- /**
25644
- * Execution of a "direct" dispatch - there must be at most one dispatch
25645
- * accumulated on the event or it is considered an error. It doesn't really make
25646
- * sense for an event with multiple dispatches (bubbled) to keep track of the
25647
- * return values at each dispatch execution, but it does tend to make sense when
25648
- * dealing with "direct" dispatches.
25649
- *
25650
- * @return {*} The return value of executing the single dispatch.
25651
- */
25652
-
25653
-
25654
- /**
25655
- * @param {SyntheticEvent} event
25656
- * @return {boolean} True iff number of dispatches accumulated is greater than 0.
25657
- */
25658
-
25659
- /**
25660
- * Accumulates items that must not be null or undefined into the first one. This
25661
- * is used to conserve memory by avoiding array allocations, and thus sacrifices
25662
- * API cleanness. Since `current` can be null before being passed in and not
25663
- * null after this function, make sure to assign it back to `current`:
25664
- *
25665
- * `a = accumulateInto(a, b);`
25666
- *
25667
- * This API should be sparingly used. Try `accumulate` for something cleaner.
25668
- *
25669
- * @return {*|array<*>} An accumulation of items.
25670
- */
25671
-
25672
- function accumulateInto(current, next) {
25673
- if (!(next != null)) {
25674
- {
25675
- throw Error("accumulateInto(...): Accumulated items must not be null or undefined.");
25676
- }
25677
- }
25678
-
25679
- if (current == null) {
25680
- return next;
25681
- } // Both are not empty. Warning: Never call x.concat(y) when you are not
25682
- // certain that x is an Array (x could be a string with concat method).
25683
-
25684
-
25685
- if (Array.isArray(current)) {
25686
- if (Array.isArray(next)) {
25687
- current.push.apply(current, next);
25688
- return current;
25689
- }
25690
-
25691
- current.push(next);
25692
- return current;
25693
- }
25694
-
25695
- if (Array.isArray(next)) {
25696
- // A bit too dangerous to mutate `next`.
25697
- return [current].concat(next);
25698
- }
25699
-
25700
- return [current, next];
25701
- }
25702
-
25703
- /**
25704
- * @param {array} arr an "accumulation" of items which is either an Array or
25705
- * a single item. Useful when paired with the `accumulate` module. This is a
25706
- * simple utility that allows us to reason about a collection of items, but
25707
- * handling the case when there is exactly one item (and we do not need to
25708
- * allocate an array).
25709
- * @param {function} cb Callback invoked with each element or a collection.
25710
- * @param {?} [scope] Scope used as `this` in a callback.
25711
- */
25712
- function forEachAccumulated(arr, cb, scope) {
25713
- if (Array.isArray(arr)) {
25714
- arr.forEach(cb, scope);
25715
- } else if (arr) {
25716
- cb.call(scope, arr);
25717
- }
25718
- }
25719
-
25720
- /**
25721
- * Internal queue of events that have accumulated their dispatches and are
25722
- * waiting to have their dispatches executed.
25723
- */
25724
-
25725
- var eventQueue = null;
25726
- /**
25727
- * Dispatches an event and releases it back into the pool, unless persistent.
25728
- *
25729
- * @param {?object} event Synthetic event to be dispatched.
25730
- * @private
25731
- */
25732
-
25733
- var executeDispatchesAndRelease = function (event) {
25734
- if (event) {
25735
- executeDispatchesInOrder(event);
25736
-
25737
- if (!event.isPersistent()) {
25738
- event.constructor.release(event);
25739
- }
25740
- }
25741
- };
25742
-
25743
- var executeDispatchesAndReleaseTopLevel = function (e) {
25744
- return executeDispatchesAndRelease(e);
25745
- };
25746
-
25747
- function runEventsInBatch(events) {
25748
- if (events !== null) {
25749
- eventQueue = accumulateInto(eventQueue, events);
25750
- } // Set `eventQueue` to null before processing it so that we can tell if more
25751
- // events get enqueued while processing.
25752
-
25753
-
25754
- var processingEventQueue = eventQueue;
25755
- eventQueue = null;
25756
-
25757
- if (!processingEventQueue) {
25758
- return;
25759
- }
25760
-
25761
- forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);
25762
-
25763
- if (!!eventQueue) {
25764
- {
25765
- throw Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.");
25766
- }
25767
- } // This would be a good time to rethrow if any of the event handlers threw.
25768
-
25769
-
25770
- rethrowCaughtError();
25771
- }
25772
-
25773
- function isInteractive(tag) {
25774
- return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';
25775
- }
25776
-
25777
- function shouldPreventMouseEvent(name, type, props) {
25778
- switch (name) {
25779
- case 'onClick':
25780
- case 'onClickCapture':
25781
- case 'onDoubleClick':
25782
- case 'onDoubleClickCapture':
25783
- case 'onMouseDown':
25784
- case 'onMouseDownCapture':
25785
- case 'onMouseMove':
25786
- case 'onMouseMoveCapture':
25787
- case 'onMouseUp':
25788
- case 'onMouseUpCapture':
25789
- return !!(props.disabled && isInteractive(type));
25790
-
25791
- default:
25792
- return false;
25793
- }
25794
- }
25795
- /**
25796
- * This is a unified interface for event plugins to be installed and configured.
25797
- *
25798
- * Event plugins can implement the following properties:
25799
- *
25800
- * `extractEvents` {function(string, DOMEventTarget, string, object): *}
25801
- * Required. When a top-level event is fired, this method is expected to
25802
- * extract synthetic events that will in turn be queued and dispatched.
25803
- *
25804
- * `eventTypes` {object}
25805
- * Optional, plugins that fire events must publish a mapping of registration
25806
- * names that are used to register listeners. Values of this mapping must
25807
- * be objects that contain `registrationName` or `phasedRegistrationNames`.
25808
- *
25809
- * `executeDispatch` {function(object, function, string)}
25810
- * Optional, allows plugins to override how an event gets dispatched. By
25811
- * default, the listener is simply invoked.
25812
- *
25813
- * Each plugin that is injected into `EventsPluginHub` is immediately operable.
25814
- *
25815
- * @public
25816
- */
25817
-
25818
- /**
25819
- * Methods for injecting dependencies.
25820
- */
25821
-
25822
-
25823
- var injection = {
25824
- /**
25825
- * @param {array} InjectedEventPluginOrder
25826
- * @public
25827
- */
25828
- injectEventPluginOrder: injectEventPluginOrder,
25829
-
25830
- /**
25831
- * @param {object} injectedNamesToPlugins Map from names to plugin modules.
25832
- */
25833
- injectEventPluginsByName: injectEventPluginsByName
25834
- };
25835
- /**
25836
- * @param {object} inst The instance, which is the source of events.
25837
- * @param {string} registrationName Name of listener (e.g. `onClick`).
25838
- * @return {?function} The stored callback.
25839
- */
25840
-
25841
- function getListener(inst, registrationName) {
25842
- var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not
25843
- // live here; needs to be moved to a better place soon
25844
-
25845
- var stateNode = inst.stateNode;
25846
-
25847
- if (!stateNode) {
25848
- // Work in progress (ex: onload events in incremental mode).
25849
- return null;
25850
- }
25851
-
25852
- var props = getFiberCurrentPropsFromNode(stateNode);
25853
-
25854
- if (!props) {
25855
- // Work in progress.
25856
- return null;
25857
- }
25858
-
25859
- listener = props[registrationName];
25860
-
25861
- if (shouldPreventMouseEvent(registrationName, inst.type, props)) {
25862
- return null;
25863
- }
25864
-
25865
- if (!(!listener || typeof listener === 'function')) {
25866
- {
25867
- throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
25868
- }
25869
- }
25870
-
25871
- return listener;
25872
- }
25873
- /**
25874
- * Allows registered plugins an opportunity to extract events from top-level
25875
- * native browser events.
25876
- *
25877
- * @return {*} An accumulation of synthetic events.
25878
- * @internal
25879
- */
25880
-
25881
- function extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
25882
- var events = null;
25883
-
25884
- for (var i = 0; i < plugins.length; i++) {
25885
- // Not every plugin in the ordering may be loaded at runtime.
25886
- var possiblePlugin = plugins[i];
25887
-
25888
- if (possiblePlugin) {
25889
- var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
25890
-
25891
- if (extractedEvents) {
25892
- events = accumulateInto(events, extractedEvents);
25893
- }
25894
- }
25895
- }
25896
-
25897
- return events;
25898
- }
25899
-
25900
- function runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
25901
- var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
25902
- runEventsInBatch(events);
25903
- }
25904
-
25905
- var FunctionComponent = 0;
25906
- var ClassComponent = 1;
25907
- var IndeterminateComponent = 2; // Before we know whether it is function or class
25908
-
25909
- var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
25910
-
25911
- var HostPortal = 4; // A subtree. Could be an entry point to a different renderer.
25912
-
25913
- var HostComponent = 5;
25914
- var HostText = 6;
25915
- var Fragment = 7;
25916
- var Mode = 8;
25917
- var ContextConsumer = 9;
25918
- var ContextProvider = 10;
25919
- var ForwardRef = 11;
25920
- var Profiler = 12;
25921
- var SuspenseComponent = 13;
25922
- var MemoComponent = 14;
25923
- var SimpleMemoComponent = 15;
25924
- var LazyComponent = 16;
25925
- var IncompleteClassComponent = 17;
25926
- var DehydratedFragment = 18;
25927
- var SuspenseListComponent = 19;
25928
- var FundamentalComponent = 20;
25929
- var ScopeComponent = 21;
25930
-
25931
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.
25932
- // Current owner and dispatcher used to share the same ref,
25933
- // but PR #14548 split them out to better support the react-debug-tools package.
25934
-
25935
- if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
25936
- ReactSharedInternals.ReactCurrentDispatcher = {
25937
- current: null
25938
- };
25939
- }
25940
-
25941
- if (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {
25942
- ReactSharedInternals.ReactCurrentBatchConfig = {
25943
- suspense: null
25944
- };
25945
- }
25946
-
25947
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
25948
- var describeComponentFrame = function (name, source, ownerName) {
25949
- var sourceInfo = '';
25950
-
25951
- if (source) {
25952
- var path = source.fileName;
25953
- var fileName = path.replace(BEFORE_SLASH_RE, '');
25954
-
25955
- {
25956
- // In DEV, include code for a common special case:
25957
- // prefer "folder/index.js" instead of just "index.js".
25958
- if (/^index\./.test(fileName)) {
25959
- var match = path.match(BEFORE_SLASH_RE);
25960
-
25961
- if (match) {
25962
- var pathBeforeSlash = match[1];
25963
-
25964
- if (pathBeforeSlash) {
25965
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
25966
- fileName = folderName + '/' + fileName;
25967
- }
25968
- }
25969
- }
25970
- }
25971
-
25972
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
25973
- } else if (ownerName) {
25974
- sourceInfo = ' (created by ' + ownerName + ')';
25975
- }
25976
-
25977
- return '\n in ' + (name || 'Unknown') + sourceInfo;
25978
- };
25979
-
25980
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
25981
- // nor polyfill, then a plain number is used for performance.
25982
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
25983
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
25984
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
25985
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
25986
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
25987
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
25988
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
25989
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
25990
- // (unstable) APIs that have been removed. Can we remove the symbols?
25991
-
25992
-
25993
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
25994
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
25995
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
25996
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
25997
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
25998
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
25999
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
26000
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
26001
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
26002
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
26003
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
26004
- function getIteratorFn(maybeIterable) {
26005
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
26006
- return null;
26007
- }
26008
-
26009
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
26010
-
26011
- if (typeof maybeIterator === 'function') {
26012
- return maybeIterator;
26013
- }
26014
-
26015
- return null;
26016
- }
26017
-
26018
- /**
26019
- * Similar to invariant but only logs a warning if the condition is not met.
26020
- * This can be used to log issues in development environments in critical
26021
- * paths. Removing the logging code for production environments will keep the
26022
- * same logic and follow the same code paths.
26023
- */
26024
-
26025
- var warning = warningWithoutStack$1;
26026
-
26027
- {
26028
- warning = function (condition, format) {
26029
- if (condition) {
26030
- return;
26031
- }
26032
-
26033
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
26034
- var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args
26035
-
26036
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
26037
- args[_key - 2] = arguments[_key];
26038
- }
26039
-
26040
- warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));
26041
- };
26042
- }
26043
-
26044
- var warning$1 = warning;
26045
-
26046
- var Uninitialized = -1;
26047
- var Pending = 0;
26048
- var Resolved = 1;
26049
- var Rejected = 2;
26050
- function refineResolvedLazyComponent(lazyComponent) {
26051
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
26052
- }
26053
- function initializeLazyComponentType(lazyComponent) {
26054
- if (lazyComponent._status === Uninitialized) {
26055
- lazyComponent._status = Pending;
26056
- var ctor = lazyComponent._ctor;
26057
- var thenable = ctor();
26058
- lazyComponent._result = thenable;
26059
- thenable.then(function (moduleObject) {
26060
- if (lazyComponent._status === Pending) {
26061
- var defaultExport = moduleObject.default;
26062
-
26063
- {
26064
- if (defaultExport === undefined) {
26065
- warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + "const MyComponent = lazy(() => import('./MyComponent'))", moduleObject);
26066
- }
26067
- }
26068
-
26069
- lazyComponent._status = Resolved;
26070
- lazyComponent._result = defaultExport;
26071
- }
26072
- }, function (error) {
26073
- if (lazyComponent._status === Pending) {
26074
- lazyComponent._status = Rejected;
26075
- lazyComponent._result = error;
26076
- }
26077
- });
26078
- }
26079
- }
26080
-
26081
- function getWrappedName(outerType, innerType, wrapperName) {
26082
- var functionName = innerType.displayName || innerType.name || '';
26083
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
26084
- }
26085
-
26086
- function getComponentName(type) {
26087
- if (type == null) {
26088
- // Host root, text node or just invalid type.
26089
- return null;
26090
- }
26091
-
26092
- {
26093
- if (typeof type.tag === 'number') {
26094
- warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
26095
- }
26096
- }
26097
-
26098
- if (typeof type === 'function') {
26099
- return type.displayName || type.name || null;
26100
- }
26101
-
26102
- if (typeof type === 'string') {
26103
- return type;
26104
- }
26105
-
26106
- switch (type) {
26107
- case REACT_FRAGMENT_TYPE:
26108
- return 'Fragment';
26109
-
26110
- case REACT_PORTAL_TYPE:
26111
- return 'Portal';
26112
-
26113
- case REACT_PROFILER_TYPE:
26114
- return "Profiler";
26115
-
26116
- case REACT_STRICT_MODE_TYPE:
26117
- return 'StrictMode';
26118
-
26119
- case REACT_SUSPENSE_TYPE:
26120
- return 'Suspense';
26121
-
26122
- case REACT_SUSPENSE_LIST_TYPE:
26123
- return 'SuspenseList';
26124
- }
26125
-
26126
- if (typeof type === 'object') {
26127
- switch (type.$$typeof) {
26128
- case REACT_CONTEXT_TYPE:
26129
- return 'Context.Consumer';
26130
-
26131
- case REACT_PROVIDER_TYPE:
26132
- return 'Context.Provider';
26133
-
26134
- case REACT_FORWARD_REF_TYPE:
26135
- return getWrappedName(type, type.render, 'ForwardRef');
26136
-
26137
- case REACT_MEMO_TYPE:
26138
- return getComponentName(type.type);
26139
-
26140
- case REACT_LAZY_TYPE:
26141
- {
26142
- var thenable = type;
26143
- var resolvedThenable = refineResolvedLazyComponent(thenable);
26144
-
26145
- if (resolvedThenable) {
26146
- return getComponentName(resolvedThenable);
26147
- }
26148
-
26149
- break;
26150
- }
26151
- }
26152
- }
26153
-
26154
- return null;
26155
- }
26156
-
26157
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
26158
-
26159
- function describeFiber(fiber) {
26160
- switch (fiber.tag) {
26161
- case HostRoot:
26162
- case HostPortal:
26163
- case HostText:
26164
- case Fragment:
26165
- case ContextProvider:
26166
- case ContextConsumer:
26167
- return '';
26168
-
26169
- default:
26170
- var owner = fiber._debugOwner;
26171
- var source = fiber._debugSource;
26172
- var name = getComponentName(fiber.type);
26173
- var ownerName = null;
26174
-
26175
- if (owner) {
26176
- ownerName = getComponentName(owner.type);
26177
- }
26178
-
26179
- return describeComponentFrame(name, source, ownerName);
26180
- }
26181
- }
26182
-
26183
- function getStackByFiberInDevAndProd(workInProgress) {
26184
- var info = '';
26185
- var node = workInProgress;
26186
-
26187
- do {
26188
- info += describeFiber(node);
26189
- node = node.return;
26190
- } while (node);
26191
-
26192
- return info;
26193
- }
26194
- var current = null;
26195
- var phase = null;
26196
- function getCurrentFiberOwnerNameInDevOrNull() {
26197
- {
26198
- if (current === null) {
26199
- return null;
26200
- }
26201
-
26202
- var owner = current._debugOwner;
26203
-
26204
- if (owner !== null && typeof owner !== 'undefined') {
26205
- return getComponentName(owner.type);
26206
- }
26207
- }
26208
-
26209
- return null;
26210
- }
26211
- function getCurrentFiberStackInDev() {
26212
- {
26213
- if (current === null) {
26214
- return '';
26215
- } // Safe because if current fiber exists, we are reconciling,
26216
- // and it is guaranteed to be the work-in-progress version.
26217
-
26218
-
26219
- return getStackByFiberInDevAndProd(current);
26220
- }
26221
-
26222
- return '';
26223
- }
26224
- function resetCurrentFiber() {
26225
- {
26226
- ReactDebugCurrentFrame.getCurrentStack = null;
26227
- current = null;
26228
- phase = null;
26229
- }
26230
- }
26231
- function setCurrentFiber(fiber) {
26232
- {
26233
- ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;
26234
- current = fiber;
26235
- phase = null;
26236
- }
26237
- }
26238
- function setCurrentPhase(lifeCyclePhase) {
26239
- {
26240
- phase = lifeCyclePhase;
26241
- }
26242
- }
26243
-
26244
- var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');
26245
-
26246
- function endsWith(subject, search) {
26247
- var length = subject.length;
26248
- return subject.substring(length - search.length, length) === search;
26249
- }
26250
-
26251
- var PLUGIN_EVENT_SYSTEM = 1;
26252
- var RESPONDER_EVENT_SYSTEM = 1 << 1;
26253
- var IS_PASSIVE = 1 << 2;
26254
- var IS_ACTIVE = 1 << 3;
26255
- var PASSIVE_NOT_SUPPORTED = 1 << 4;
26256
- var IS_REPLAYED = 1 << 5;
26257
-
26258
- var restoreImpl = null;
26259
- var restoreTarget = null;
26260
- var restoreQueue = null;
26261
-
26262
- function restoreStateOfTarget(target) {
26263
- // We perform this translation at the end of the event loop so that we
26264
- // always receive the correct fiber here
26265
- var internalInstance = getInstanceFromNode(target);
26266
-
26267
- if (!internalInstance) {
26268
- // Unmounted
26269
- return;
26270
- }
26271
-
26272
- if (!(typeof restoreImpl === 'function')) {
26273
- {
26274
- throw Error("setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.");
26275
- }
26276
- }
26277
-
26278
- var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);
26279
- restoreImpl(internalInstance.stateNode, internalInstance.type, props);
26280
- }
26281
-
26282
- function setRestoreImplementation(impl) {
26283
- restoreImpl = impl;
26284
- }
26285
- function enqueueStateRestore(target) {
26286
- if (restoreTarget) {
26287
- if (restoreQueue) {
26288
- restoreQueue.push(target);
26289
- } else {
26290
- restoreQueue = [target];
26291
- }
26292
- } else {
26293
- restoreTarget = target;
26294
- }
26295
- }
26296
- function needsStateRestore() {
26297
- return restoreTarget !== null || restoreQueue !== null;
26298
- }
26299
- function restoreStateIfNeeded() {
26300
- if (!restoreTarget) {
26301
- return;
26302
- }
26303
-
26304
- var target = restoreTarget;
26305
- var queuedTargets = restoreQueue;
26306
- restoreTarget = null;
26307
- restoreQueue = null;
26308
- restoreStateOfTarget(target);
26309
-
26310
- if (queuedTargets) {
26311
- for (var i = 0; i < queuedTargets.length; i++) {
26312
- restoreStateOfTarget(queuedTargets[i]);
26313
- }
26314
- }
26315
- }
26316
-
26317
- var enableUserTimingAPI = true; // Helps identify side effects in render-phase lifecycle hooks and setState
26318
- // reducers by double invoking them in Strict Mode.
26319
-
26320
- var debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the "Pause on caught exceptions" behavior of the debugger, we
26321
- // replay the begin phase of a failed component inside invokeGuardedCallback.
26322
-
26323
- var replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:
26324
-
26325
- var warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.
26326
-
26327
- var enableProfilerTimer = true; // Trace which interactions trigger each commit.
26328
-
26329
- var enableSchedulerTracing = true; // SSR experiments
26330
-
26331
- var enableSuspenseServerRenderer = false;
26332
- var enableSelectiveHydration = false; // Only used in www builds.
26333
-
26334
- // Only used in www builds.
26335
-
26336
- // Disable javascript: URL strings in href for XSS protection.
26337
-
26338
- var disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing
26339
- // with their related DOM properties
26340
-
26341
- var disableInputAttributeSyncing = false; // These APIs will no longer be "unstable" in the upcoming 16.7 release,
26342
- // Control this behavior with a flag to support 16.6 minor releases in the meanwhile.
26343
-
26344
- var exposeConcurrentModeAPIs = false;
26345
- var warnAboutShorthandPropertyCollision = false; // Experimental React Flare event system and event components support.
26346
-
26347
- var enableFlareAPI = false; // Experimental Host Component support.
26348
-
26349
- var enableFundamentalAPI = false; // Experimental Scope support.
26350
-
26351
- var enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107
26352
-
26353
- // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)
26354
- // Till then, we warn about the missing mock, but still fallback to a legacy mode compatible version
26355
-
26356
- var warnAboutUnmockedScheduler = false; // For tests, we flush suspense fallbacks in an act scope;
26357
- // *except* in some of our own tests, where we test incremental loading states.
26358
-
26359
- var flushSuspenseFallbacksInTests = true; // Add a callback property to suspense to notify which promises are currently
26360
- // in the update queue. This allows reporting and tracing of what is causing
26361
- // the user to see a loading state.
26362
- // Also allows hydration callbacks to fire when a dehydrated boundary gets
26363
- // hydrated or deleted.
26364
-
26365
- var enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move
26366
- // from React.createElement to React.jsx
26367
- // https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md
26368
-
26369
- var warnAboutDefaultPropsOnFunctionComponents = false;
26370
- var warnAboutStringRefs = false;
26371
- var disableLegacyContext = false;
26372
- var disableSchedulerTimeoutBasedOnReactExpirationTime = false;
26373
- var enableTrustedTypesIntegration = false; // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance
26374
-
26375
- // the renderer. Such as when we're dispatching events or if third party
26376
- // libraries need to call batchedUpdates. Eventually, this API will go away when
26377
- // everything is batched by default. We'll then have a similar API to opt-out of
26378
- // scheduled work and instead do synchronous work.
26379
- // Defaults
26380
-
26381
- var batchedUpdatesImpl = function (fn, bookkeeping) {
26382
- return fn(bookkeeping);
26383
- };
26384
-
26385
- var discreteUpdatesImpl = function (fn, a, b, c) {
26386
- return fn(a, b, c);
26387
- };
26388
-
26389
- var flushDiscreteUpdatesImpl = function () {};
26390
-
26391
- var batchedEventUpdatesImpl = batchedUpdatesImpl;
26392
- var isInsideEventHandler = false;
26393
- var isBatchingEventUpdates = false;
26394
-
26395
- function finishEventHandler() {
26396
- // Here we wait until all updates have propagated, which is important
26397
- // when using controlled components within layers:
26398
- // https://github.com/facebook/react/issues/1698
26399
- // Then we restore state of any controlled component.
26400
- var controlledComponentsHavePendingUpdates = needsStateRestore();
26401
-
26402
- if (controlledComponentsHavePendingUpdates) {
26403
- // If a controlled event was fired, we may need to restore the state of
26404
- // the DOM node back to the controlled value. This is necessary when React
26405
- // bails out of the update without touching the DOM.
26406
- flushDiscreteUpdatesImpl();
26407
- restoreStateIfNeeded();
26408
- }
26409
- }
26410
-
26411
- function batchedUpdates(fn, bookkeeping) {
26412
- if (isInsideEventHandler) {
26413
- // If we are currently inside another batch, we need to wait until it
26414
- // fully completes before restoring state.
26415
- return fn(bookkeeping);
26416
- }
26417
-
26418
- isInsideEventHandler = true;
26419
-
26420
- try {
26421
- return batchedUpdatesImpl(fn, bookkeeping);
26422
- } finally {
26423
- isInsideEventHandler = false;
26424
- finishEventHandler();
26425
- }
26426
- }
26427
- function batchedEventUpdates(fn, a, b) {
26428
- if (isBatchingEventUpdates) {
26429
- // If we are currently inside another batch, we need to wait until it
26430
- // fully completes before restoring state.
26431
- return fn(a, b);
26432
- }
26433
-
26434
- isBatchingEventUpdates = true;
26435
-
26436
- try {
26437
- return batchedEventUpdatesImpl(fn, a, b);
26438
- } finally {
26439
- isBatchingEventUpdates = false;
26440
- finishEventHandler();
26441
- }
26442
- } // This is for the React Flare event system
26443
-
26444
- function executeUserEventHandler(fn, value) {
26445
- var previouslyInEventHandler = isInsideEventHandler;
26446
-
26447
- try {
26448
- isInsideEventHandler = true;
26449
- var type = typeof value === 'object' && value !== null ? value.type : '';
26450
- invokeGuardedCallbackAndCatchFirstError(type, fn, undefined, value);
26451
- } finally {
26452
- isInsideEventHandler = previouslyInEventHandler;
26453
- }
26454
- }
26455
- function discreteUpdates(fn, a, b, c) {
26456
- var prevIsInsideEventHandler = isInsideEventHandler;
26457
- isInsideEventHandler = true;
26458
-
26459
- try {
26460
- return discreteUpdatesImpl(fn, a, b, c);
26461
- } finally {
26462
- isInsideEventHandler = prevIsInsideEventHandler;
26463
-
26464
- if (!isInsideEventHandler) {
26465
- finishEventHandler();
26466
- }
26467
- }
26468
- }
26469
- var lastFlushedEventTimeStamp = 0;
26470
- function flushDiscreteUpdatesIfNeeded(timeStamp) {
26471
- // event.timeStamp isn't overly reliable due to inconsistencies in
26472
- // how different browsers have historically provided the time stamp.
26473
- // Some browsers provide high-resolution time stamps for all events,
26474
- // some provide low-resolution time stamps for all events. FF < 52
26475
- // even mixes both time stamps together. Some browsers even report
26476
- // negative time stamps or time stamps that are 0 (iOS9) in some cases.
26477
- // Given we are only comparing two time stamps with equality (!==),
26478
- // we are safe from the resolution differences. If the time stamp is 0
26479
- // we bail-out of preventing the flush, which can affect semantics,
26480
- // such as if an earlier flush removes or adds event listeners that
26481
- // are fired in the subsequent flush. However, this is the same
26482
- // behaviour as we had before this change, so the risks are low.
26483
- if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) {
26484
- lastFlushedEventTimeStamp = timeStamp;
26485
- flushDiscreteUpdatesImpl();
26486
- }
26487
- }
26488
- function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {
26489
- batchedUpdatesImpl = _batchedUpdatesImpl;
26490
- discreteUpdatesImpl = _discreteUpdatesImpl;
26491
- flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;
26492
- batchedEventUpdatesImpl = _batchedEventUpdatesImpl;
26493
- }
26494
-
26495
- var DiscreteEvent = 0;
26496
- var UserBlockingEvent = 1;
26497
- var ContinuousEvent = 2;
26498
-
26499
- // CommonJS interop named imports.
26500
-
26501
- var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
26502
- var runWithPriority = Scheduler.unstable_runWithPriority;
26503
- var listenToResponderEventTypesImpl;
26504
- function setListenToResponderEventTypes(_listenToResponderEventTypesImpl) {
26505
- listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl;
26506
- }
26507
- var rootEventTypesToEventResponderInstances = new Map();
26508
- var DoNotPropagateToNextResponder = 0;
26509
- var PropagateToNextResponder = 1;
26510
- var currentTimeStamp = 0;
26511
- var currentInstance = null;
26512
- var currentDocument = null;
26513
- var currentPropagationBehavior = DoNotPropagateToNextResponder;
26514
- var eventResponderContext = {
26515
- dispatchEvent: function (eventValue, eventListener, eventPriority) {
26516
- validateResponderContext();
26517
- validateEventValue(eventValue);
26518
-
26519
- switch (eventPriority) {
26520
- case DiscreteEvent:
26521
- {
26522
- flushDiscreteUpdatesIfNeeded(currentTimeStamp);
26523
- discreteUpdates(function () {
26524
- return executeUserEventHandler(eventListener, eventValue);
26525
- });
26526
- break;
26527
- }
26528
-
26529
- case UserBlockingEvent:
26530
- {
26531
- runWithPriority(UserBlockingPriority, function () {
26532
- return executeUserEventHandler(eventListener, eventValue);
26533
- });
26534
- break;
26535
- }
26536
-
26537
- case ContinuousEvent:
26538
- {
26539
- executeUserEventHandler(eventListener, eventValue);
26540
- break;
26541
- }
26542
- }
26543
- },
26544
- isTargetWithinResponder: function (target) {
26545
- validateResponderContext();
26546
-
26547
- if (target != null) {
26548
- var fiber = getClosestInstanceFromNode(target);
26549
- var responderFiber = currentInstance.fiber;
26550
-
26551
- while (fiber !== null) {
26552
- if (fiber === responderFiber || fiber.alternate === responderFiber) {
26553
- return true;
26554
- }
26555
-
26556
- fiber = fiber.return;
26557
- }
26558
- }
26559
-
26560
- return false;
26561
- },
26562
- isTargetWithinResponderScope: function (target) {
26563
- validateResponderContext();
26564
- var componentInstance = currentInstance;
26565
- var responder = componentInstance.responder;
26566
-
26567
- if (target != null) {
26568
- var fiber = getClosestInstanceFromNode(target);
26569
- var responderFiber = currentInstance.fiber;
26570
-
26571
- while (fiber !== null) {
26572
- if (fiber === responderFiber || fiber.alternate === responderFiber) {
26573
- return true;
26574
- }
26575
-
26576
- if (doesFiberHaveResponder(fiber, responder)) {
26577
- return false;
26578
- }
26579
-
26580
- fiber = fiber.return;
26581
- }
26582
- }
26583
-
26584
- return false;
26585
- },
26586
- isTargetWithinNode: function (childTarget, parentTarget) {
26587
- validateResponderContext();
26588
- var childFiber = getClosestInstanceFromNode(childTarget);
26589
- var parentFiber = getClosestInstanceFromNode(parentTarget);
26590
-
26591
- if (childFiber != null && parentFiber != null) {
26592
- var parentAlternateFiber = parentFiber.alternate;
26593
- var node = childFiber;
26594
-
26595
- while (node !== null) {
26596
- if (node === parentFiber || node === parentAlternateFiber) {
26597
- return true;
26598
- }
26599
-
26600
- node = node.return;
26601
- }
26602
-
26603
- return false;
26604
- } // Fallback to DOM APIs
26605
-
26606
-
26607
- return parentTarget.contains(childTarget);
26608
- },
26609
- addRootEventTypes: function (rootEventTypes) {
26610
- validateResponderContext();
26611
- listenToResponderEventTypesImpl(rootEventTypes, currentDocument);
26612
-
26613
- for (var i = 0; i < rootEventTypes.length; i++) {
26614
- var rootEventType = rootEventTypes[i];
26615
- var eventResponderInstance = currentInstance;
26616
- registerRootEventType(rootEventType, eventResponderInstance);
26617
- }
26618
- },
26619
- removeRootEventTypes: function (rootEventTypes) {
26620
- validateResponderContext();
26621
-
26622
- for (var i = 0; i < rootEventTypes.length; i++) {
26623
- var rootEventType = rootEventTypes[i];
26624
- var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType);
26625
- var rootEventTypesSet = currentInstance.rootEventTypes;
26626
-
26627
- if (rootEventTypesSet !== null) {
26628
- rootEventTypesSet.delete(rootEventType);
26629
- }
26630
-
26631
- if (rootEventResponders !== undefined) {
26632
- rootEventResponders.delete(currentInstance);
26633
- }
26634
- }
26635
- },
26636
- getActiveDocument: getActiveDocument,
26637
- objectAssign: _assign,
26638
- getTimeStamp: function () {
26639
- validateResponderContext();
26640
- return currentTimeStamp;
26641
- },
26642
- isTargetWithinHostComponent: function (target, elementType) {
26643
- validateResponderContext();
26644
- var fiber = getClosestInstanceFromNode(target);
26645
-
26646
- while (fiber !== null) {
26647
- if (fiber.tag === HostComponent && fiber.type === elementType) {
26648
- return true;
26649
- }
26650
-
26651
- fiber = fiber.return;
26652
- }
26653
-
26654
- return false;
26655
- },
26656
- continuePropagation: function () {
26657
- currentPropagationBehavior = PropagateToNextResponder;
26658
- },
26659
- enqueueStateRestore: enqueueStateRestore,
26660
- getResponderNode: function () {
26661
- validateResponderContext();
26662
- var responderFiber = currentInstance.fiber;
26663
-
26664
- if (responderFiber.tag === ScopeComponent) {
26665
- return null;
26666
- }
26667
-
26668
- return responderFiber.stateNode;
26669
- }
26670
- };
26671
-
26672
- function validateEventValue(eventValue) {
26673
- if (typeof eventValue === 'object' && eventValue !== null) {
26674
- var target = eventValue.target,
26675
- type = eventValue.type,
26676
- timeStamp = eventValue.timeStamp;
26677
-
26678
- if (target == null || type == null || timeStamp == null) {
26679
- throw new Error('context.dispatchEvent: "target", "timeStamp", and "type" fields on event object are required.');
26680
- }
26681
-
26682
- var showWarning = function (name) {
26683
- {
26684
- warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== "press") { event.%s }`', name, name);
26685
- }
26686
- };
26687
-
26688
- eventValue.isDefaultPrevented = function () {
26689
- {
26690
- showWarning('isDefaultPrevented()');
26691
- }
26692
- };
26693
-
26694
- eventValue.isPropagationStopped = function () {
26695
- {
26696
- showWarning('isPropagationStopped()');
26697
- }
26698
- }; // $FlowFixMe: we don't need value, Flow thinks we do
26699
-
26700
-
26701
- Object.defineProperty(eventValue, 'nativeEvent', {
26702
- get: function () {
26703
- {
26704
- showWarning('nativeEvent');
26705
- }
26706
- }
26707
- });
26708
- }
26709
- }
26710
-
26711
- function doesFiberHaveResponder(fiber, responder) {
26712
- var tag = fiber.tag;
26713
-
26714
- if (tag === HostComponent || tag === ScopeComponent) {
26715
- var dependencies = fiber.dependencies;
26716
-
26717
- if (dependencies !== null) {
26718
- var respondersMap = dependencies.responders;
26719
-
26720
- if (respondersMap !== null && respondersMap.has(responder)) {
26721
- return true;
26722
- }
26723
- }
26724
- }
26725
-
26726
- return false;
26727
- }
26728
-
26729
- function getActiveDocument() {
26730
- return currentDocument;
26731
- }
26732
-
26733
- function createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) {
26734
- var _ref = nativeEvent,
26735
- buttons = _ref.buttons,
26736
- pointerType = _ref.pointerType;
26737
- var eventPointerType = '';
26738
-
26739
- if (pointerType !== undefined) {
26740
- eventPointerType = pointerType;
26741
- } else if (nativeEvent.key !== undefined) {
26742
- eventPointerType = 'keyboard';
26743
- } else if (buttons !== undefined) {
26744
- eventPointerType = 'mouse';
26745
- } else if (nativeEvent.changedTouches !== undefined) {
26746
- eventPointerType = 'touch';
26747
- }
26748
-
26749
- return {
26750
- nativeEvent: nativeEvent,
26751
- passive: passive,
26752
- passiveSupported: passiveSupported,
26753
- pointerType: eventPointerType,
26754
- target: nativeEventTarget,
26755
- type: topLevelType
26756
- };
26757
- }
26758
-
26759
- function responderEventTypesContainType(eventTypes, type) {
26760
- for (var i = 0, len = eventTypes.length; i < len; i++) {
26761
- if (eventTypes[i] === type) {
26762
- return true;
26763
- }
26764
- }
26765
-
26766
- return false;
26767
- }
26768
-
26769
- function validateResponderTargetEventTypes(eventType, responder) {
26770
- var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder
26771
-
26772
- if (targetEventTypes !== null) {
26773
- return responderEventTypesContainType(targetEventTypes, eventType);
26774
- }
26775
-
26776
- return false;
26777
- }
26778
-
26779
- function traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
26780
- var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0;
26781
- var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0;
26782
- var isPassive = isPassiveEvent || !isPassiveSupported;
26783
- var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order:
26784
- // - Bubble target responder phase
26785
- // - Root responder phase
26786
-
26787
- var visitedResponders = new Set();
26788
- var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported);
26789
- var node = targetFiber;
26790
- var insidePortal = false;
26791
-
26792
- while (node !== null) {
26793
- var _node = node,
26794
- dependencies = _node.dependencies,
26795
- tag = _node.tag;
26796
-
26797
- if (tag === HostPortal) {
26798
- insidePortal = true;
26799
- } else if ((tag === HostComponent || tag === ScopeComponent) && dependencies !== null) {
26800
- var respondersMap = dependencies.responders;
26801
-
26802
- if (respondersMap !== null) {
26803
- var responderInstances = Array.from(respondersMap.values());
26804
-
26805
- for (var i = 0, length = responderInstances.length; i < length; i++) {
26806
- var responderInstance = responderInstances[i];
26807
- var props = responderInstance.props,
26808
- responder = responderInstance.responder,
26809
- state = responderInstance.state;
26810
-
26811
- if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder) && (!insidePortal || responder.targetPortalPropagation)) {
26812
- visitedResponders.add(responder);
26813
- var onEvent = responder.onEvent;
26814
-
26815
- if (onEvent !== null) {
26816
- currentInstance = responderInstance;
26817
- onEvent(responderEvent, eventResponderContext, props, state);
26818
-
26819
- if (currentPropagationBehavior === PropagateToNextResponder) {
26820
- visitedResponders.delete(responder);
26821
- currentPropagationBehavior = DoNotPropagateToNextResponder;
26822
- }
26823
- }
26824
- }
26825
- }
26826
- }
26827
- }
26828
-
26829
- node = node.return;
26830
- } // Root phase
26831
-
26832
-
26833
- var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType);
26834
-
26835
- if (rootEventResponderInstances !== undefined) {
26836
- var _responderInstances = Array.from(rootEventResponderInstances);
26837
-
26838
- for (var _i = 0; _i < _responderInstances.length; _i++) {
26839
- var _responderInstance = _responderInstances[_i];
26840
- var props = _responderInstance.props,
26841
- responder = _responderInstance.responder,
26842
- state = _responderInstance.state;
26843
- var onRootEvent = responder.onRootEvent;
26844
-
26845
- if (onRootEvent !== null) {
26846
- currentInstance = _responderInstance;
26847
- onRootEvent(responderEvent, eventResponderContext, props, state);
26848
- }
26849
- }
26850
- }
26851
- }
26852
-
26853
- function mountEventResponder(responder, responderInstance, props, state) {
26854
- var onMount = responder.onMount;
26855
-
26856
- if (onMount !== null) {
26857
- var previousInstance = currentInstance;
26858
- currentInstance = responderInstance;
26859
-
26860
- try {
26861
- batchedEventUpdates(function () {
26862
- onMount(eventResponderContext, props, state);
26863
- });
26864
- } finally {
26865
- currentInstance = previousInstance;
26866
- }
26867
- }
26868
- }
26869
- function unmountEventResponder(responderInstance) {
26870
- var responder = responderInstance.responder;
26871
- var onUnmount = responder.onUnmount;
26872
-
26873
- if (onUnmount !== null) {
26874
- var props = responderInstance.props,
26875
- state = responderInstance.state;
26876
- var previousInstance = currentInstance;
26877
- currentInstance = responderInstance;
26878
-
26879
- try {
26880
- batchedEventUpdates(function () {
26881
- onUnmount(eventResponderContext, props, state);
26882
- });
26883
- } finally {
26884
- currentInstance = previousInstance;
26885
- }
26886
- }
26887
-
26888
- var rootEventTypesSet = responderInstance.rootEventTypes;
26889
-
26890
- if (rootEventTypesSet !== null) {
26891
- var rootEventTypes = Array.from(rootEventTypesSet);
26892
-
26893
- for (var i = 0; i < rootEventTypes.length; i++) {
26894
- var topLevelEventType = rootEventTypes[i];
26895
- var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType);
26896
-
26897
- if (rootEventResponderInstances !== undefined) {
26898
- rootEventResponderInstances.delete(responderInstance);
26899
- }
26900
- }
26901
- }
26902
- }
26903
-
26904
- function validateResponderContext() {
26905
- if (!(currentInstance !== null)) {
26906
- {
26907
- throw Error("An event responder context was used outside of an event cycle.");
26908
- }
26909
- }
26910
- }
26911
-
26912
- function dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {
26913
- if (enableFlareAPI) {
26914
- var previousInstance = currentInstance;
26915
- var previousTimeStamp = currentTimeStamp;
26916
- var previousDocument = currentDocument;
26917
- var previousPropagationBehavior = currentPropagationBehavior;
26918
- currentPropagationBehavior = DoNotPropagateToNextResponder; // nodeType 9 is DOCUMENT_NODE
26919
-
26920
- currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here
26921
-
26922
- currentTimeStamp = nativeEvent.timeStamp;
26923
-
26924
- try {
26925
- batchedEventUpdates(function () {
26926
- traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags);
26927
- });
26928
- } finally {
26929
- currentInstance = previousInstance;
26930
- currentTimeStamp = previousTimeStamp;
26931
- currentDocument = previousDocument;
26932
- currentPropagationBehavior = previousPropagationBehavior;
26933
- }
26934
- }
26935
- }
26936
- function addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) {
26937
- for (var i = 0; i < rootEventTypes.length; i++) {
26938
- var rootEventType = rootEventTypes[i];
26939
- registerRootEventType(rootEventType, responderInstance);
26940
- }
26941
- }
26942
-
26943
- function registerRootEventType(rootEventType, eventResponderInstance) {
26944
- var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType);
26945
-
26946
- if (rootEventResponderInstances === undefined) {
26947
- rootEventResponderInstances = new Set();
26948
- rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances);
26949
- }
26950
-
26951
- var rootEventTypesSet = eventResponderInstance.rootEventTypes;
26952
-
26953
- if (rootEventTypesSet === null) {
26954
- rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set();
26955
- }
26956
-
26957
- if (!!rootEventTypesSet.has(rootEventType)) {
26958
- {
26959
- throw Error("addRootEventTypes() found a duplicate root event type of \"" + rootEventType + "\". This might be because the event type exists in the event responder \"rootEventTypes\" array or because of a previous addRootEventTypes() using this root event type.");
26960
- }
26961
- }
26962
-
26963
- rootEventTypesSet.add(rootEventType);
26964
- rootEventResponderInstances.add(eventResponderInstance);
26965
- }
26966
-
26967
- // A reserved attribute.
26968
- // It is handled by React separately and shouldn't be written to the DOM.
26969
- var RESERVED = 0; // A simple string attribute.
26970
- // Attributes that aren't in the whitelist are presumed to have this type.
26971
-
26972
- var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called
26973
- // "enumerated" attributes with "true" and "false" as possible values.
26974
- // When true, it should be set to a "true" string.
26975
- // When false, it should be set to a "false" string.
26976
-
26977
- var BOOLEANISH_STRING = 2; // A real boolean attribute.
26978
- // When true, it should be present (set either to an empty string or its name).
26979
- // When false, it should be omitted.
26980
-
26981
- var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.
26982
- // When true, it should be present (set either to an empty string or its name).
26983
- // When false, it should be omitted.
26984
- // For any other value, should be present with that value.
26985
-
26986
- var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.
26987
- // When falsy, it should be removed.
26988
-
26989
- var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.
26990
- // When falsy, it should be removed.
26991
-
26992
- var POSITIVE_NUMERIC = 6;
26993
-
26994
- /* eslint-disable max-len */
26995
- var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
26996
- /* eslint-enable max-len */
26997
-
26998
- var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
26999
-
27000
- var ROOT_ATTRIBUTE_NAME = 'data-reactroot';
27001
- var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');
27002
- var hasOwnProperty = Object.prototype.hasOwnProperty;
27003
- var illegalAttributeNameCache = {};
27004
- var validatedAttributeNameCache = {};
27005
- function isAttributeNameSafe(attributeName) {
27006
- if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {
27007
- return true;
27008
- }
27009
-
27010
- if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {
27011
- return false;
27012
- }
27013
-
27014
- if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {
27015
- validatedAttributeNameCache[attributeName] = true;
27016
- return true;
27017
- }
27018
-
27019
- illegalAttributeNameCache[attributeName] = true;
27020
-
27021
- {
27022
- warning$1(false, 'Invalid attribute name: `%s`', attributeName);
27023
- }
27024
-
27025
- return false;
27026
- }
27027
- function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {
27028
- if (propertyInfo !== null) {
27029
- return propertyInfo.type === RESERVED;
27030
- }
27031
-
27032
- if (isCustomComponentTag) {
27033
- return false;
27034
- }
27035
-
27036
- if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
27037
- return true;
27038
- }
27039
-
27040
- return false;
27041
- }
27042
- function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
27043
- if (propertyInfo !== null && propertyInfo.type === RESERVED) {
27044
- return false;
27045
- }
27046
-
27047
- switch (typeof value) {
27048
- case 'function': // $FlowIssue symbol is perfectly valid here
27049
-
27050
- case 'symbol':
27051
- // eslint-disable-line
27052
- return true;
27053
-
27054
- case 'boolean':
27055
- {
27056
- if (isCustomComponentTag) {
27057
- return false;
27058
- }
27059
-
27060
- if (propertyInfo !== null) {
27061
- return !propertyInfo.acceptsBooleans;
27062
- } else {
27063
- var prefix = name.toLowerCase().slice(0, 5);
27064
- return prefix !== 'data-' && prefix !== 'aria-';
27065
- }
27066
- }
27067
-
27068
- default:
27069
- return false;
27070
- }
27071
- }
27072
- function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
27073
- if (value === null || typeof value === 'undefined') {
27074
- return true;
27075
- }
27076
-
27077
- if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {
27078
- return true;
27079
- }
27080
-
27081
- if (isCustomComponentTag) {
27082
- return false;
27083
- }
27084
-
27085
- if (propertyInfo !== null) {
27086
- switch (propertyInfo.type) {
27087
- case BOOLEAN:
27088
- return !value;
27089
-
27090
- case OVERLOADED_BOOLEAN:
27091
- return value === false;
27092
-
27093
- case NUMERIC:
27094
- return isNaN(value);
27095
-
27096
- case POSITIVE_NUMERIC:
27097
- return isNaN(value) || value < 1;
27098
- }
27099
- }
27100
-
27101
- return false;
27102
- }
27103
- function getPropertyInfo(name) {
27104
- return properties.hasOwnProperty(name) ? properties[name] : null;
27105
- }
27106
-
27107
- function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {
27108
- this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;
27109
- this.attributeName = attributeName;
27110
- this.attributeNamespace = attributeNamespace;
27111
- this.mustUseProperty = mustUseProperty;
27112
- this.propertyName = name;
27113
- this.type = type;
27114
- this.sanitizeURL = sanitizeURL;
27115
- } // When adding attributes to this list, be sure to also add them to
27116
- // the `possibleStandardNames` module to ensure casing and incorrect
27117
- // name warnings.
27118
-
27119
-
27120
- var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.
27121
-
27122
- ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular
27123
- // elements (not just inputs). Now that ReactDOMInput assigns to the
27124
- // defaultValue property -- do we need this?
27125
- 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {
27126
- properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty
27127
- name, // attributeName
27128
- null, // attributeNamespace
27129
- false);
27130
- }); // A few React string attributes have a different name.
27131
- // This is a mapping from React prop names to the attribute names.
27132
-
27133
- [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {
27134
- var name = _ref[0],
27135
- attributeName = _ref[1];
27136
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
27137
- attributeName, // attributeName
27138
- null, // attributeNamespace
27139
- false);
27140
- }); // These are "enumerated" HTML attributes that accept "true" and "false".
27141
- // In React, we let users pass `true` and `false` even though technically
27142
- // these aren't boolean attributes (they are coerced to strings).
27143
-
27144
- ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {
27145
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
27146
- name.toLowerCase(), // attributeName
27147
- null, // attributeNamespace
27148
- false);
27149
- }); // These are "enumerated" SVG attributes that accept "true" and "false".
27150
- // In React, we let users pass `true` and `false` even though technically
27151
- // these aren't boolean attributes (they are coerced to strings).
27152
- // Since these are SVG attributes, their attribute names are case-sensitive.
27153
-
27154
- ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {
27155
- properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty
27156
- name, // attributeName
27157
- null, // attributeNamespace
27158
- false);
27159
- }); // These are HTML boolean attributes.
27160
-
27161
- ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM
27162
- // on the client side because the browsers are inconsistent. Instead we call focus().
27163
- 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata
27164
- 'itemScope'].forEach(function (name) {
27165
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty
27166
- name.toLowerCase(), // attributeName
27167
- null, // attributeNamespace
27168
- false);
27169
- }); // These are the few React props that we set as DOM properties
27170
- // rather than attributes. These are all booleans.
27171
-
27172
- ['checked', // Note: `option.selected` is not updated if `select.multiple` is
27173
- // disabled with `removeAttribute`. We have special logic for handling this.
27174
- 'multiple', 'muted', 'selected'].forEach(function (name) {
27175
- properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty
27176
- name, // attributeName
27177
- null, // attributeNamespace
27178
- false);
27179
- }); // These are HTML attributes that are "overloaded booleans": they behave like
27180
- // booleans, but can also accept a string value.
27181
-
27182
- ['capture', 'download'].forEach(function (name) {
27183
- properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty
27184
- name, // attributeName
27185
- null, // attributeNamespace
27186
- false);
27187
- }); // These are HTML attributes that must be positive numbers.
27188
-
27189
- ['cols', 'rows', 'size', 'span'].forEach(function (name) {
27190
- properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty
27191
- name, // attributeName
27192
- null, // attributeNamespace
27193
- false);
27194
- }); // These are HTML attributes that must be numbers.
27195
-
27196
- ['rowSpan', 'start'].forEach(function (name) {
27197
- properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty
27198
- name.toLowerCase(), // attributeName
27199
- null, // attributeNamespace
27200
- false);
27201
- });
27202
- var CAMELIZE = /[\-\:]([a-z])/g;
27203
-
27204
- var capitalize = function (token) {
27205
- return token[1].toUpperCase();
27206
- }; // This is a list of all SVG attributes that need special casing, namespacing,
27207
- // or boolean value assignment. Regular attributes that just accept strings
27208
- // and have the same names are omitted, just like in the HTML whitelist.
27209
- // Some of these attributes can be hard to find. This list was created by
27210
- // scrapping the MDN documentation.
27211
-
27212
-
27213
- ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {
27214
- var name = attributeName.replace(CAMELIZE, capitalize);
27215
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
27216
- attributeName, null, // attributeNamespace
27217
- false);
27218
- }); // String SVG attributes with the xlink namespace.
27219
-
27220
- ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {
27221
- var name = attributeName.replace(CAMELIZE, capitalize);
27222
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
27223
- attributeName, 'http://www.w3.org/1999/xlink', false);
27224
- }); // String SVG attributes with the xml namespace.
27225
-
27226
- ['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {
27227
- var name = attributeName.replace(CAMELIZE, capitalize);
27228
- properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty
27229
- attributeName, 'http://www.w3.org/XML/1998/namespace', false);
27230
- }); // These attribute exists both in HTML and SVG.
27231
- // The attribute name is case-sensitive in SVG so we can't just use
27232
- // the React name like we do for attributes that exist only in HTML.
27233
-
27234
- ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {
27235
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
27236
- attributeName.toLowerCase(), // attributeName
27237
- null, // attributeNamespace
27238
- false);
27239
- }); // These attributes accept URLs. These must not allow javascript: URLS.
27240
- // These will also need to accept Trusted Types object in the future.
27241
-
27242
- var xlinkHref = 'xlinkHref';
27243
- properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty
27244
- 'xlink:href', 'http://www.w3.org/1999/xlink', true);
27245
- ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {
27246
- properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty
27247
- attributeName.toLowerCase(), // attributeName
27248
- null, // attributeNamespace
27249
- true);
27250
- });
27251
-
27252
- var ReactDebugCurrentFrame$1 = null;
27253
-
27254
- {
27255
- ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
27256
- } // A javascript: URL can contain leading C0 control or \u0020 SPACE,
27257
- // and any newline or tab are filtered out as if they're not part of the URL.
27258
- // https://url.spec.whatwg.org/#url-parsing
27259
- // Tab or newline are defined as \r\n\t:
27260
- // https://infra.spec.whatwg.org/#ascii-tab-or-newline
27261
- // A C0 control is a code point in the range \u0000 NULL to \u001F
27262
- // INFORMATION SEPARATOR ONE, inclusive:
27263
- // https://infra.spec.whatwg.org/#c0-control-or-space
27264
-
27265
- /* eslint-disable max-len */
27266
-
27267
-
27268
- var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
27269
- var didWarn = false;
27270
-
27271
- function sanitizeURL(url) {
27272
- if (disableJavaScriptURLs) {
27273
- if (!!isJavaScriptProtocol.test(url)) {
27274
- {
27275
- throw Error("React has blocked a javascript: URL as a security precaution." + (ReactDebugCurrentFrame$1.getStackAddendum()));
27276
- }
27277
- }
27278
- } else if (true && !didWarn && isJavaScriptProtocol.test(url)) {
27279
- didWarn = true;
27280
- warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));
27281
- }
27282
- }
27283
-
27284
- // Flow does not allow string concatenation of most non-string types. To work
27285
- // around this limitation, we use an opaque type that can only be obtained by
27286
- // passing the value through getToStringValue first.
27287
- function toString(value) {
27288
- return '' + value;
27289
- }
27290
- function getToStringValue(value) {
27291
- switch (typeof value) {
27292
- case 'boolean':
27293
- case 'number':
27294
- case 'object':
27295
- case 'string':
27296
- case 'undefined':
27297
- return value;
27298
-
27299
- default:
27300
- // function, symbol are assigned as empty strings
27301
- return '';
27302
- }
27303
- }
27304
- /** Trusted value is a wrapper for "safe" values which can be assigned to DOM execution sinks. */
27305
-
27306
- /**
27307
- * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML
27308
- * and we do validations that the value is safe. Once we do validation we want to use the validated
27309
- * value instead of the object (because object.toString may return something else on next call).
27310
- *
27311
- * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects.
27312
- */
27313
- var toStringOrTrustedType = toString;
27314
-
27315
- if (enableTrustedTypesIntegration && typeof trustedTypes !== 'undefined') {
27316
- toStringOrTrustedType = function (value) {
27317
- if (typeof value === 'object' && (trustedTypes.isHTML(value) || trustedTypes.isScript(value) || trustedTypes.isScriptURL(value) ||
27318
- /* TrustedURLs are deprecated and will be removed soon: https://github.com/WICG/trusted-types/pull/204 */
27319
- trustedTypes.isURL && trustedTypes.isURL(value))) {
27320
- // Pass Trusted Types through.
27321
- return value;
27322
- }
27323
-
27324
- return toString(value);
27325
- };
27326
- }
27327
-
27328
- /**
27329
- * Set attribute for a node. The attribute value can be either string or
27330
- * Trusted value (if application uses Trusted Types).
27331
- */
27332
- function setAttribute(node, attributeName, attributeValue) {
27333
- node.setAttribute(attributeName, attributeValue);
27334
- }
27335
- /**
27336
- * Set attribute with namespace for a node. The attribute value can be either string or
27337
- * Trusted value (if application uses Trusted Types).
27338
- */
27339
-
27340
- function setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {
27341
- node.setAttributeNS(attributeNamespace, attributeName, attributeValue);
27342
- }
27343
-
27344
- /**
27345
- * Get the value for a property on a node. Only used in DEV for SSR validation.
27346
- * The "expected" argument is used as a hint of what the expected value is.
27347
- * Some properties have multiple equivalent values.
27348
- */
27349
- function getValueForProperty(node, name, expected, propertyInfo) {
27350
- {
27351
- if (propertyInfo.mustUseProperty) {
27352
- var propertyName = propertyInfo.propertyName;
27353
- return node[propertyName];
27354
- } else {
27355
- if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) {
27356
- // If we haven't fully disabled javascript: URLs, and if
27357
- // the hydration is successful of a javascript: URL, we
27358
- // still want to warn on the client.
27359
- sanitizeURL('' + expected);
27360
- }
27361
-
27362
- var attributeName = propertyInfo.attributeName;
27363
- var stringValue = null;
27364
-
27365
- if (propertyInfo.type === OVERLOADED_BOOLEAN) {
27366
- if (node.hasAttribute(attributeName)) {
27367
- var value = node.getAttribute(attributeName);
27368
-
27369
- if (value === '') {
27370
- return true;
27371
- }
27372
-
27373
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
27374
- return value;
27375
- }
27376
-
27377
- if (value === '' + expected) {
27378
- return expected;
27379
- }
27380
-
27381
- return value;
27382
- }
27383
- } else if (node.hasAttribute(attributeName)) {
27384
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
27385
- // We had an attribute but shouldn't have had one, so read it
27386
- // for the error message.
27387
- return node.getAttribute(attributeName);
27388
- }
27389
-
27390
- if (propertyInfo.type === BOOLEAN) {
27391
- // If this was a boolean, it doesn't matter what the value is
27392
- // the fact that we have it is the same as the expected.
27393
- return expected;
27394
- } // Even if this property uses a namespace we use getAttribute
27395
- // because we assume its namespaced name is the same as our config.
27396
- // To use getAttributeNS we need the local name which we don't have
27397
- // in our config atm.
27398
-
27399
-
27400
- stringValue = node.getAttribute(attributeName);
27401
- }
27402
-
27403
- if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {
27404
- return stringValue === null ? expected : stringValue;
27405
- } else if (stringValue === '' + expected) {
27406
- return expected;
27407
- } else {
27408
- return stringValue;
27409
- }
27410
- }
27411
- }
27412
- }
27413
- /**
27414
- * Get the value for a attribute on a node. Only used in DEV for SSR validation.
27415
- * The third argument is used as a hint of what the expected value is. Some
27416
- * attributes have multiple equivalent values.
27417
- */
27418
-
27419
- function getValueForAttribute(node, name, expected) {
27420
- {
27421
- if (!isAttributeNameSafe(name)) {
27422
- return;
27423
- }
27424
-
27425
- if (!node.hasAttribute(name)) {
27426
- return expected === undefined ? undefined : null;
27427
- }
27428
-
27429
- var value = node.getAttribute(name);
27430
-
27431
- if (value === '' + expected) {
27432
- return expected;
27433
- }
27434
-
27435
- return value;
27436
- }
27437
- }
27438
- /**
27439
- * Sets the value for a property on a node.
27440
- *
27441
- * @param {DOMElement} node
27442
- * @param {string} name
27443
- * @param {*} value
27444
- */
27445
-
27446
- function setValueForProperty(node, name, value, isCustomComponentTag) {
27447
- var propertyInfo = getPropertyInfo(name);
27448
-
27449
- if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {
27450
- return;
27451
- }
27452
-
27453
- if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {
27454
- value = null;
27455
- } // If the prop isn't in the special list, treat it as a simple attribute.
27456
-
27457
-
27458
- if (isCustomComponentTag || propertyInfo === null) {
27459
- if (isAttributeNameSafe(name)) {
27460
- var _attributeName = name;
27461
-
27462
- if (value === null) {
27463
- node.removeAttribute(_attributeName);
27464
- } else {
27465
- setAttribute(node, _attributeName, toStringOrTrustedType(value));
27466
- }
27467
- }
27468
-
27469
- return;
27470
- }
27471
-
27472
- var mustUseProperty = propertyInfo.mustUseProperty;
27473
-
27474
- if (mustUseProperty) {
27475
- var propertyName = propertyInfo.propertyName;
27476
-
27477
- if (value === null) {
27478
- var type = propertyInfo.type;
27479
- node[propertyName] = type === BOOLEAN ? false : '';
27480
- } else {
27481
- // Contrary to `setAttribute`, object properties are properly
27482
- // `toString`ed by IE8/9.
27483
- node[propertyName] = value;
27484
- }
27485
-
27486
- return;
27487
- } // The rest are treated as attributes with special cases.
27488
-
27489
-
27490
- var attributeName = propertyInfo.attributeName,
27491
- attributeNamespace = propertyInfo.attributeNamespace;
27492
-
27493
- if (value === null) {
27494
- node.removeAttribute(attributeName);
27495
- } else {
27496
- var _type = propertyInfo.type;
27497
- var attributeValue;
27498
-
27499
- if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {
27500
- // If attribute type is boolean, we know for sure it won't be an execution sink
27501
- // and we won't require Trusted Type here.
27502
- attributeValue = '';
27503
- } else {
27504
- // `setAttribute` with objects becomes only `[object]` in IE8/9,
27505
- // ('' + value) makes it output the correct toString()-value.
27506
- attributeValue = toStringOrTrustedType(value);
27507
-
27508
- if (propertyInfo.sanitizeURL) {
27509
- sanitizeURL(attributeValue.toString());
27510
- }
27511
- }
27512
-
27513
- if (attributeNamespace) {
27514
- setAttributeNS(node, attributeNamespace, attributeName, attributeValue);
27515
- } else {
27516
- setAttribute(node, attributeName, attributeValue);
27517
- }
27518
- }
27519
- }
27520
-
27521
- var ReactDebugCurrentFrame$2 = null;
27522
- var ReactControlledValuePropTypes = {
27523
- checkPropTypes: null
27524
- };
27525
-
27526
- {
27527
- ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;
27528
- var hasReadOnlyValue = {
27529
- button: true,
27530
- checkbox: true,
27531
- image: true,
27532
- hidden: true,
27533
- radio: true,
27534
- reset: true,
27535
- submit: true
27536
- };
27537
- var propTypes = {
27538
- value: function (props, propName, componentName) {
27539
- if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
27540
- return null;
27541
- }
27542
-
27543
- return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
27544
- },
27545
- checked: function (props, propName, componentName) {
27546
- if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {
27547
- return null;
27548
- }
27549
-
27550
- return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');
27551
- }
27552
- };
27553
- /**
27554
- * Provide a linked `value` attribute for controlled forms. You should not use
27555
- * this outside of the ReactDOM controlled form components.
27556
- */
27557
-
27558
- ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {
27559
- checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);
27560
- };
27561
- }
27562
-
27563
- function isCheckable(elem) {
27564
- var type = elem.type;
27565
- var nodeName = elem.nodeName;
27566
- return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');
27567
- }
27568
-
27569
- function getTracker(node) {
27570
- return node._valueTracker;
27571
- }
27572
-
27573
- function detachTracker(node) {
27574
- node._valueTracker = null;
27575
- }
27576
-
27577
- function getValueFromNode(node) {
27578
- var value = '';
27579
-
27580
- if (!node) {
27581
- return value;
27582
- }
27583
-
27584
- if (isCheckable(node)) {
27585
- value = node.checked ? 'true' : 'false';
27586
- } else {
27587
- value = node.value;
27588
- }
27589
-
27590
- return value;
27591
- }
27592
-
27593
- function trackValueOnNode(node) {
27594
- var valueField = isCheckable(node) ? 'checked' : 'value';
27595
- var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);
27596
- var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail
27597
- // and don't track value will cause over reporting of changes,
27598
- // but it's better then a hard failure
27599
- // (needed for certain tests that spyOn input values and Safari)
27600
-
27601
- if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {
27602
- return;
27603
- }
27604
-
27605
- var get = descriptor.get,
27606
- set = descriptor.set;
27607
- Object.defineProperty(node, valueField, {
27608
- configurable: true,
27609
- get: function () {
27610
- return get.call(this);
27611
- },
27612
- set: function (value) {
27613
- currentValue = '' + value;
27614
- set.call(this, value);
27615
- }
27616
- }); // We could've passed this the first time
27617
- // but it triggers a bug in IE11 and Edge 14/15.
27618
- // Calling defineProperty() again should be equivalent.
27619
- // https://github.com/facebook/react/issues/11768
27620
-
27621
- Object.defineProperty(node, valueField, {
27622
- enumerable: descriptor.enumerable
27623
- });
27624
- var tracker = {
27625
- getValue: function () {
27626
- return currentValue;
27627
- },
27628
- setValue: function (value) {
27629
- currentValue = '' + value;
27630
- },
27631
- stopTracking: function () {
27632
- detachTracker(node);
27633
- delete node[valueField];
27634
- }
27635
- };
27636
- return tracker;
27637
- }
27638
-
27639
- function track(node) {
27640
- if (getTracker(node)) {
27641
- return;
27642
- } // TODO: Once it's just Fiber we can move this to node._wrapperState
27643
-
27644
-
27645
- node._valueTracker = trackValueOnNode(node);
27646
- }
27647
- function updateValueIfChanged(node) {
27648
- if (!node) {
27649
- return false;
27650
- }
27651
-
27652
- var tracker = getTracker(node); // if there is no tracker at this point it's unlikely
27653
- // that trying again will succeed
27654
-
27655
- if (!tracker) {
27656
- return true;
27657
- }
27658
-
27659
- var lastValue = tracker.getValue();
27660
- var nextValue = getValueFromNode(node);
27661
-
27662
- if (nextValue !== lastValue) {
27663
- tracker.setValue(nextValue);
27664
- return true;
27665
- }
27666
-
27667
- return false;
27668
- }
27669
-
27670
- // TODO: direct imports like some-package/src/* are bad. Fix me.
27671
- var didWarnValueDefaultValue = false;
27672
- var didWarnCheckedDefaultChecked = false;
27673
- var didWarnControlledToUncontrolled = false;
27674
- var didWarnUncontrolledToControlled = false;
27675
-
27676
- function isControlled(props) {
27677
- var usesChecked = props.type === 'checkbox' || props.type === 'radio';
27678
- return usesChecked ? props.checked != null : props.value != null;
27679
- }
27680
- /**
27681
- * Implements an <input> host component that allows setting these optional
27682
- * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.
27683
- *
27684
- * If `checked` or `value` are not supplied (or null/undefined), user actions
27685
- * that affect the checked state or value will trigger updates to the element.
27686
- *
27687
- * If they are supplied (and not null/undefined), the rendered element will not
27688
- * trigger updates to the element. Instead, the props must change in order for
27689
- * the rendered element to be updated.
27690
- *
27691
- * The rendered element will be initialized as unchecked (or `defaultChecked`)
27692
- * with an empty value (or `defaultValue`).
27693
- *
27694
- * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html
27695
- */
27696
-
27697
-
27698
- function getHostProps(element, props) {
27699
- var node = element;
27700
- var checked = props.checked;
27701
-
27702
- var hostProps = _assign({}, props, {
27703
- defaultChecked: undefined,
27704
- defaultValue: undefined,
27705
- value: undefined,
27706
- checked: checked != null ? checked : node._wrapperState.initialChecked
27707
- });
27708
-
27709
- return hostProps;
27710
- }
27711
- function initWrapperState(element, props) {
27712
- {
27713
- ReactControlledValuePropTypes.checkPropTypes('input', props);
27714
-
27715
- if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {
27716
- warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
27717
- didWarnCheckedDefaultChecked = true;
27718
- }
27719
-
27720
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {
27721
- warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);
27722
- didWarnValueDefaultValue = true;
27723
- }
27724
- }
27725
-
27726
- var node = element;
27727
- var defaultValue = props.defaultValue == null ? '' : props.defaultValue;
27728
- node._wrapperState = {
27729
- initialChecked: props.checked != null ? props.checked : props.defaultChecked,
27730
- initialValue: getToStringValue(props.value != null ? props.value : defaultValue),
27731
- controlled: isControlled(props)
27732
- };
27733
- }
27734
- function updateChecked(element, props) {
27735
- var node = element;
27736
- var checked = props.checked;
27737
-
27738
- if (checked != null) {
27739
- setValueForProperty(node, 'checked', checked, false);
27740
- }
27741
- }
27742
- function updateWrapper(element, props) {
27743
- var node = element;
27744
-
27745
- {
27746
- var controlled = isControlled(props);
27747
-
27748
- if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {
27749
- warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
27750
- didWarnUncontrolledToControlled = true;
27751
- }
27752
-
27753
- if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {
27754
- warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);
27755
- didWarnControlledToUncontrolled = true;
27756
- }
27757
- }
27758
-
27759
- updateChecked(element, props);
27760
- var value = getToStringValue(props.value);
27761
- var type = props.type;
27762
-
27763
- if (value != null) {
27764
- if (type === 'number') {
27765
- if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.
27766
- // eslint-disable-next-line
27767
- node.value != value) {
27768
- node.value = toString(value);
27769
- }
27770
- } else if (node.value !== toString(value)) {
27771
- node.value = toString(value);
27772
- }
27773
- } else if (type === 'submit' || type === 'reset') {
27774
- // Submit/reset inputs need the attribute removed completely to avoid
27775
- // blank-text buttons.
27776
- node.removeAttribute('value');
27777
- return;
27778
- }
27779
-
27780
- if (disableInputAttributeSyncing) {
27781
- // When not syncing the value attribute, React only assigns a new value
27782
- // whenever the defaultValue React prop has changed. When not present,
27783
- // React does nothing
27784
- if (props.hasOwnProperty('defaultValue')) {
27785
- setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
27786
- }
27787
- } else {
27788
- // When syncing the value attribute, the value comes from a cascade of
27789
- // properties:
27790
- // 1. The value React property
27791
- // 2. The defaultValue React property
27792
- // 3. Otherwise there should be no change
27793
- if (props.hasOwnProperty('value')) {
27794
- setDefaultValue(node, props.type, value);
27795
- } else if (props.hasOwnProperty('defaultValue')) {
27796
- setDefaultValue(node, props.type, getToStringValue(props.defaultValue));
27797
- }
27798
- }
27799
-
27800
- if (disableInputAttributeSyncing) {
27801
- // When not syncing the checked attribute, the attribute is directly
27802
- // controllable from the defaultValue React property. It needs to be
27803
- // updated as new props come in.
27804
- if (props.defaultChecked == null) {
27805
- node.removeAttribute('checked');
27806
- } else {
27807
- node.defaultChecked = !!props.defaultChecked;
27808
- }
27809
- } else {
27810
- // When syncing the checked attribute, it only changes when it needs
27811
- // to be removed, such as transitioning from a checkbox into a text input
27812
- if (props.checked == null && props.defaultChecked != null) {
27813
- node.defaultChecked = !!props.defaultChecked;
27814
- }
27815
- }
27816
- }
27817
- function postMountWrapper(element, props, isHydrating) {
27818
- var node = element; // Do not assign value if it is already set. This prevents user text input
27819
- // from being lost during SSR hydration.
27820
-
27821
- if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {
27822
- var type = props.type;
27823
- var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the
27824
- // default value provided by the browser. See: #12872
27825
-
27826
- if (isButton && (props.value === undefined || props.value === null)) {
27827
- return;
27828
- }
27829
-
27830
- var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input
27831
- // from being lost during SSR hydration.
27832
-
27833
- if (!isHydrating) {
27834
- if (disableInputAttributeSyncing) {
27835
- var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points
27836
- // directly to the React prop. Only assign it if it exists.
27837
-
27838
- if (value != null) {
27839
- // Always assign on buttons so that it is possible to assign an
27840
- // empty string to clear button text.
27841
- //
27842
- // Otherwise, do not re-assign the value property if is empty. This
27843
- // potentially avoids a DOM write and prevents Firefox (~60.0.1) from
27844
- // prematurely marking required inputs as invalid. Equality is compared
27845
- // to the current value in case the browser provided value is not an
27846
- // empty string.
27847
- if (isButton || value !== node.value) {
27848
- node.value = toString(value);
27849
- }
27850
- }
27851
- } else {
27852
- // When syncing the value attribute, the value property should use
27853
- // the wrapperState._initialValue property. This uses:
27854
- //
27855
- // 1. The value React property when present
27856
- // 2. The defaultValue React property when present
27857
- // 3. An empty string
27858
- if (initialValue !== node.value) {
27859
- node.value = initialValue;
27860
- }
27861
- }
27862
- }
27863
-
27864
- if (disableInputAttributeSyncing) {
27865
- // When not syncing the value attribute, assign the value attribute
27866
- // directly from the defaultValue React property (when present)
27867
- var defaultValue = getToStringValue(props.defaultValue);
27868
-
27869
- if (defaultValue != null) {
27870
- node.defaultValue = toString(defaultValue);
27871
- }
27872
- } else {
27873
- // Otherwise, the value attribute is synchronized to the property,
27874
- // so we assign defaultValue to the same thing as the value property
27875
- // assignment step above.
27876
- node.defaultValue = initialValue;
27877
- }
27878
- } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug
27879
- // this is needed to work around a chrome bug where setting defaultChecked
27880
- // will sometimes influence the value of checked (even after detachment).
27881
- // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416
27882
- // We need to temporarily unset name to avoid disrupting radio button groups.
27883
-
27884
-
27885
- var name = node.name;
27886
-
27887
- if (name !== '') {
27888
- node.name = '';
27889
- }
27890
-
27891
- if (disableInputAttributeSyncing) {
27892
- // When not syncing the checked attribute, the checked property
27893
- // never gets assigned. It must be manually set. We don't want
27894
- // to do this when hydrating so that existing user input isn't
27895
- // modified
27896
- if (!isHydrating) {
27897
- updateChecked(element, props);
27898
- } // Only assign the checked attribute if it is defined. This saves
27899
- // a DOM write when controlling the checked attribute isn't needed
27900
- // (text inputs, submit/reset)
27901
-
27902
-
27903
- if (props.hasOwnProperty('defaultChecked')) {
27904
- node.defaultChecked = !node.defaultChecked;
27905
- node.defaultChecked = !!props.defaultChecked;
27906
- }
27907
- } else {
27908
- // When syncing the checked attribute, both the checked property and
27909
- // attribute are assigned at the same time using defaultChecked. This uses:
27910
- //
27911
- // 1. The checked React property when present
27912
- // 2. The defaultChecked React property when present
27913
- // 3. Otherwise, false
27914
- node.defaultChecked = !node.defaultChecked;
27915
- node.defaultChecked = !!node._wrapperState.initialChecked;
27916
- }
27917
-
27918
- if (name !== '') {
27919
- node.name = name;
27920
- }
27921
- }
27922
- function restoreControlledState$1(element, props) {
27923
- var node = element;
27924
- updateWrapper(node, props);
27925
- updateNamedCousins(node, props);
27926
- }
27927
-
27928
- function updateNamedCousins(rootNode, props) {
27929
- var name = props.name;
27930
-
27931
- if (props.type === 'radio' && name != null) {
27932
- var queryRoot = rootNode;
27933
-
27934
- while (queryRoot.parentNode) {
27935
- queryRoot = queryRoot.parentNode;
27936
- } // If `rootNode.form` was non-null, then we could try `form.elements`,
27937
- // but that sometimes behaves strangely in IE8. We could also try using
27938
- // `form.getElementsByName`, but that will only return direct children
27939
- // and won't include inputs that use the HTML5 `form=` attribute. Since
27940
- // the input might not even be in a form. It might not even be in the
27941
- // document. Let's just use the local `querySelectorAll` to ensure we don't
27942
- // miss anything.
27943
-
27944
-
27945
- var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]');
27946
-
27947
- for (var i = 0; i < group.length; i++) {
27948
- var otherNode = group[i];
27949
-
27950
- if (otherNode === rootNode || otherNode.form !== rootNode.form) {
27951
- continue;
27952
- } // This will throw if radio buttons rendered by different copies of React
27953
- // and the same name are rendered into the same form (same as #1939).
27954
- // That's probably okay; we don't support it just as we don't support
27955
- // mixing React radio buttons with non-React ones.
27956
-
27957
-
27958
- var otherProps = getFiberCurrentPropsFromNode$1(otherNode);
27959
-
27960
- if (!otherProps) {
27961
- {
27962
- throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");
27963
- }
27964
- } // We need update the tracked value on the named cousin since the value
27965
- // was changed but the input saw no event or value set
27966
-
27967
-
27968
- updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that
27969
- // was previously checked to update will cause it to be come re-checked
27970
- // as appropriate.
27971
-
27972
- updateWrapper(otherNode, otherProps);
27973
- }
27974
- }
27975
- } // In Chrome, assigning defaultValue to certain input types triggers input validation.
27976
- // For number inputs, the display value loses trailing decimal points. For email inputs,
27977
- // Chrome raises "The specified value <x> is not a valid email address".
27978
- //
27979
- // Here we check to see if the defaultValue has actually changed, avoiding these problems
27980
- // when the user is inputting text
27981
- //
27982
- // https://github.com/facebook/react/issues/7253
27983
-
27984
-
27985
- function setDefaultValue(node, type, value) {
27986
- if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js
27987
- type !== 'number' || node.ownerDocument.activeElement !== node) {
27988
- if (value == null) {
27989
- node.defaultValue = toString(node._wrapperState.initialValue);
27990
- } else if (node.defaultValue !== toString(value)) {
27991
- node.defaultValue = toString(value);
27992
- }
27993
- }
27994
- }
27995
-
27996
- var didWarnSelectedSetOnOption = false;
27997
- var didWarnInvalidChild = false;
27998
-
27999
- function flattenChildren(children) {
28000
- var content = ''; // Flatten children. We'll warn if they are invalid
28001
- // during validateProps() which runs for hydration too.
28002
- // Note that this would throw on non-element objects.
28003
- // Elements are stringified (which is normally irrelevant
28004
- // but matters for <fbt>).
28005
-
28006
- React.Children.forEach(children, function (child) {
28007
- if (child == null) {
28008
- return;
28009
- }
28010
-
28011
- content += child; // Note: we don't warn about invalid children here.
28012
- // Instead, this is done separately below so that
28013
- // it happens during the hydration codepath too.
28014
- });
28015
- return content;
28016
- }
28017
- /**
28018
- * Implements an <option> host component that warns when `selected` is set.
28019
- */
28020
-
28021
-
28022
- function validateProps(element, props) {
28023
- {
28024
- // This mirrors the codepath above, but runs for hydration too.
28025
- // Warn about invalid children here so that client and hydration are consistent.
28026
- // TODO: this seems like it could cause a DEV-only throw for hydration
28027
- // if children contains a non-element object. We should try to avoid that.
28028
- if (typeof props.children === 'object' && props.children !== null) {
28029
- React.Children.forEach(props.children, function (child) {
28030
- if (child == null) {
28031
- return;
28032
- }
28033
-
28034
- if (typeof child === 'string' || typeof child === 'number') {
28035
- return;
28036
- }
28037
-
28038
- if (typeof child.type !== 'string') {
28039
- return;
28040
- }
28041
-
28042
- if (!didWarnInvalidChild) {
28043
- didWarnInvalidChild = true;
28044
- warning$1(false, 'Only strings and numbers are supported as <option> children.');
28045
- }
28046
- });
28047
- } // TODO: Remove support for `selected` in <option>.
28048
-
28049
-
28050
- if (props.selected != null && !didWarnSelectedSetOnOption) {
28051
- warning$1(false, 'Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.');
28052
- didWarnSelectedSetOnOption = true;
28053
- }
28054
- }
28055
- }
28056
- function postMountWrapper$1(element, props) {
28057
- // value="" should make a value attribute (#6219)
28058
- if (props.value != null) {
28059
- element.setAttribute('value', toString(getToStringValue(props.value)));
28060
- }
28061
- }
28062
- function getHostProps$1(element, props) {
28063
- var hostProps = _assign({
28064
- children: undefined
28065
- }, props);
28066
-
28067
- var content = flattenChildren(props.children);
28068
-
28069
- if (content) {
28070
- hostProps.children = content;
28071
- }
28072
-
28073
- return hostProps;
28074
- }
28075
-
28076
- // TODO: direct imports like some-package/src/* are bad. Fix me.
28077
- var didWarnValueDefaultValue$1;
28078
-
28079
- {
28080
- didWarnValueDefaultValue$1 = false;
28081
- }
28082
-
28083
- function getDeclarationErrorAddendum() {
28084
- var ownerName = getCurrentFiberOwnerNameInDevOrNull();
28085
-
28086
- if (ownerName) {
28087
- return '\n\nCheck the render method of `' + ownerName + '`.';
28088
- }
28089
-
28090
- return '';
28091
- }
28092
-
28093
- var valuePropNames = ['value', 'defaultValue'];
28094
- /**
28095
- * Validation function for `value` and `defaultValue`.
28096
- */
28097
-
28098
- function checkSelectPropTypes(props) {
28099
- ReactControlledValuePropTypes.checkPropTypes('select', props);
28100
-
28101
- for (var i = 0; i < valuePropNames.length; i++) {
28102
- var propName = valuePropNames[i];
28103
-
28104
- if (props[propName] == null) {
28105
- continue;
28106
- }
28107
-
28108
- var isArray = Array.isArray(props[propName]);
28109
-
28110
- if (props.multiple && !isArray) {
28111
- warning$1(false, 'The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());
28112
- } else if (!props.multiple && isArray) {
28113
- warning$1(false, 'The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());
28114
- }
28115
- }
28116
- }
28117
-
28118
- function updateOptions(node, multiple, propValue, setDefaultSelected) {
28119
- var options = node.options;
28120
-
28121
- if (multiple) {
28122
- var selectedValues = propValue;
28123
- var selectedValue = {};
28124
-
28125
- for (var i = 0; i < selectedValues.length; i++) {
28126
- // Prefix to avoid chaos with special keys.
28127
- selectedValue['$' + selectedValues[i]] = true;
28128
- }
28129
-
28130
- for (var _i = 0; _i < options.length; _i++) {
28131
- var selected = selectedValue.hasOwnProperty('$' + options[_i].value);
28132
-
28133
- if (options[_i].selected !== selected) {
28134
- options[_i].selected = selected;
28135
- }
28136
-
28137
- if (selected && setDefaultSelected) {
28138
- options[_i].defaultSelected = true;
28139
- }
28140
- }
28141
- } else {
28142
- // Do not set `select.value` as exact behavior isn't consistent across all
28143
- // browsers for all cases.
28144
- var _selectedValue = toString(getToStringValue(propValue));
28145
-
28146
- var defaultSelected = null;
28147
-
28148
- for (var _i2 = 0; _i2 < options.length; _i2++) {
28149
- if (options[_i2].value === _selectedValue) {
28150
- options[_i2].selected = true;
28151
-
28152
- if (setDefaultSelected) {
28153
- options[_i2].defaultSelected = true;
28154
- }
28155
-
28156
- return;
28157
- }
28158
-
28159
- if (defaultSelected === null && !options[_i2].disabled) {
28160
- defaultSelected = options[_i2];
28161
- }
28162
- }
28163
-
28164
- if (defaultSelected !== null) {
28165
- defaultSelected.selected = true;
28166
- }
28167
- }
28168
- }
28169
- /**
28170
- * Implements a <select> host component that allows optionally setting the
28171
- * props `value` and `defaultValue`. If `multiple` is false, the prop must be a
28172
- * stringable. If `multiple` is true, the prop must be an array of stringables.
28173
- *
28174
- * If `value` is not supplied (or null/undefined), user actions that change the
28175
- * selected option will trigger updates to the rendered options.
28176
- *
28177
- * If it is supplied (and not null/undefined), the rendered options will not
28178
- * update in response to user actions. Instead, the `value` prop must change in
28179
- * order for the rendered options to update.
28180
- *
28181
- * If `defaultValue` is provided, any options with the supplied values will be
28182
- * selected.
28183
- */
28184
-
28185
-
28186
- function getHostProps$2(element, props) {
28187
- return _assign({}, props, {
28188
- value: undefined
28189
- });
28190
- }
28191
- function initWrapperState$1(element, props) {
28192
- var node = element;
28193
-
28194
- {
28195
- checkSelectPropTypes(props);
28196
- }
28197
-
28198
- node._wrapperState = {
28199
- wasMultiple: !!props.multiple
28200
- };
28201
-
28202
- {
28203
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {
28204
- warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');
28205
- didWarnValueDefaultValue$1 = true;
28206
- }
28207
- }
28208
- }
28209
- function postMountWrapper$2(element, props) {
28210
- var node = element;
28211
- node.multiple = !!props.multiple;
28212
- var value = props.value;
28213
-
28214
- if (value != null) {
28215
- updateOptions(node, !!props.multiple, value, false);
28216
- } else if (props.defaultValue != null) {
28217
- updateOptions(node, !!props.multiple, props.defaultValue, true);
28218
- }
28219
- }
28220
- function postUpdateWrapper(element, props) {
28221
- var node = element;
28222
- var wasMultiple = node._wrapperState.wasMultiple;
28223
- node._wrapperState.wasMultiple = !!props.multiple;
28224
- var value = props.value;
28225
-
28226
- if (value != null) {
28227
- updateOptions(node, !!props.multiple, value, false);
28228
- } else if (wasMultiple !== !!props.multiple) {
28229
- // For simplicity, reapply `defaultValue` if `multiple` is toggled.
28230
- if (props.defaultValue != null) {
28231
- updateOptions(node, !!props.multiple, props.defaultValue, true);
28232
- } else {
28233
- // Revert the select back to its default unselected state.
28234
- updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);
28235
- }
28236
- }
28237
- }
28238
- function restoreControlledState$2(element, props) {
28239
- var node = element;
28240
- var value = props.value;
28241
-
28242
- if (value != null) {
28243
- updateOptions(node, !!props.multiple, value, false);
28244
- }
28245
- }
28246
-
28247
- var didWarnValDefaultVal = false;
28248
-
28249
- /**
28250
- * Implements a <textarea> host component that allows setting `value`, and
28251
- * `defaultValue`. This differs from the traditional DOM API because value is
28252
- * usually set as PCDATA children.
28253
- *
28254
- * If `value` is not supplied (or null/undefined), user actions that affect the
28255
- * value will trigger updates to the element.
28256
- *
28257
- * If `value` is supplied (and not null/undefined), the rendered element will
28258
- * not trigger updates to the element. Instead, the `value` prop must change in
28259
- * order for the rendered element to be updated.
28260
- *
28261
- * The rendered element will be initialized with an empty value, the prop
28262
- * `defaultValue` if specified, or the children content (deprecated).
28263
- */
28264
- function getHostProps$3(element, props) {
28265
- var node = element;
28266
-
28267
- if (!(props.dangerouslySetInnerHTML == null)) {
28268
- {
28269
- throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
28270
- }
28271
- } // Always set children to the same thing. In IE9, the selection range will
28272
- // get reset if `textContent` is mutated. We could add a check in setTextContent
28273
- // to only set the value if/when the value differs from the node value (which would
28274
- // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this
28275
- // solution. The value can be a boolean or object so that's why it's forced
28276
- // to be a string.
28277
-
28278
-
28279
- var hostProps = _assign({}, props, {
28280
- value: undefined,
28281
- defaultValue: undefined,
28282
- children: toString(node._wrapperState.initialValue)
28283
- });
28284
-
28285
- return hostProps;
28286
- }
28287
- function initWrapperState$2(element, props) {
28288
- var node = element;
28289
-
28290
- {
28291
- ReactControlledValuePropTypes.checkPropTypes('textarea', props);
28292
-
28293
- if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {
28294
- warning$1(false, '%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
28295
- didWarnValDefaultVal = true;
28296
- }
28297
- }
28298
-
28299
- var initialValue = props.value; // Only bother fetching default value if we're going to use it
28300
-
28301
- if (initialValue == null) {
28302
- var defaultValue = props.defaultValue; // TODO (yungsters): Remove support for children content in <textarea>.
28303
-
28304
- var children = props.children;
28305
-
28306
- if (children != null) {
28307
- {
28308
- warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.');
28309
- }
28310
-
28311
- if (!(defaultValue == null)) {
28312
- {
28313
- throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");
28314
- }
28315
- }
28316
-
28317
- if (Array.isArray(children)) {
28318
- if (!(children.length <= 1)) {
28319
- {
28320
- throw Error("<textarea> can only have at most one child.");
28321
- }
28322
- }
28323
-
28324
- children = children[0];
28325
- }
28326
-
28327
- defaultValue = children;
28328
- }
28329
-
28330
- if (defaultValue == null) {
28331
- defaultValue = '';
28332
- }
28333
-
28334
- initialValue = defaultValue;
28335
- }
28336
-
28337
- node._wrapperState = {
28338
- initialValue: getToStringValue(initialValue)
28339
- };
28340
- }
28341
- function updateWrapper$1(element, props) {
28342
- var node = element;
28343
- var value = getToStringValue(props.value);
28344
- var defaultValue = getToStringValue(props.defaultValue);
28345
-
28346
- if (value != null) {
28347
- // Cast `value` to a string to ensure the value is set correctly. While
28348
- // browsers typically do this as necessary, jsdom doesn't.
28349
- var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed
28350
-
28351
- if (newValue !== node.value) {
28352
- node.value = newValue;
28353
- }
28354
-
28355
- if (props.defaultValue == null && node.defaultValue !== newValue) {
28356
- node.defaultValue = newValue;
28357
- }
28358
- }
28359
-
28360
- if (defaultValue != null) {
28361
- node.defaultValue = toString(defaultValue);
28362
- }
28363
- }
28364
- function postMountWrapper$3(element, props) {
28365
- var node = element; // This is in postMount because we need access to the DOM node, which is not
28366
- // available until after the component has mounted.
28367
-
28368
- var textContent = node.textContent; // Only set node.value if textContent is equal to the expected
28369
- // initial value. In IE10/IE11 there is a bug where the placeholder attribute
28370
- // will populate textContent as well.
28371
- // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/
28372
-
28373
- if (textContent === node._wrapperState.initialValue) {
28374
- if (textContent !== '' && textContent !== null) {
28375
- node.value = textContent;
28376
- }
28377
- }
28378
- }
28379
- function restoreControlledState$3(element, props) {
28380
- // DOM component is still mounted; update
28381
- updateWrapper$1(element, props);
28382
- }
28383
-
28384
- var HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';
28385
- var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
28386
- var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
28387
- var Namespaces = {
28388
- html: HTML_NAMESPACE$1,
28389
- mathml: MATH_NAMESPACE,
28390
- svg: SVG_NAMESPACE
28391
- }; // Assumes there is no parent namespace.
28392
-
28393
- function getIntrinsicNamespace(type) {
28394
- switch (type) {
28395
- case 'svg':
28396
- return SVG_NAMESPACE;
28397
-
28398
- case 'math':
28399
- return MATH_NAMESPACE;
28400
-
28401
- default:
28402
- return HTML_NAMESPACE$1;
28403
- }
28404
- }
28405
- function getChildNamespace(parentNamespace, type) {
28406
- if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {
28407
- // No (or default) parent namespace: potential entry point.
28408
- return getIntrinsicNamespace(type);
28409
- }
28410
-
28411
- if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {
28412
- // We're leaving SVG.
28413
- return HTML_NAMESPACE$1;
28414
- } // By default, pass namespace below.
28415
-
28416
-
28417
- return parentNamespace;
28418
- }
28419
-
28420
- /* globals MSApp */
28421
-
28422
- /**
28423
- * Create a function which has 'unsafe' privileges (required by windows8 apps)
28424
- */
28425
- var createMicrosoftUnsafeLocalFunction = function (func) {
28426
- if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
28427
- return function (arg0, arg1, arg2, arg3) {
28428
- MSApp.execUnsafeLocalFunction(function () {
28429
- return func(arg0, arg1, arg2, arg3);
28430
- });
28431
- };
28432
- } else {
28433
- return func;
28434
- }
28435
- };
28436
-
28437
- var reusableSVGContainer;
28438
- /**
28439
- * Set the innerHTML property of a node
28440
- *
28441
- * @param {DOMElement} node
28442
- * @param {string} html
28443
- * @internal
28444
- */
28445
-
28446
- var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {
28447
- if (node.namespaceURI === Namespaces.svg) {
28448
- {
28449
- if (enableTrustedTypesIntegration) {
28450
- // TODO: reconsider the text of this warning and when it should show
28451
- // before enabling the feature flag.
28452
- !(typeof trustedTypes === 'undefined') ? warning$1(false, "Using 'dangerouslySetInnerHTML' in an svg element with " + 'Trusted Types enabled in an Internet Explorer will cause ' + 'the trusted value to be converted to string. Assigning string ' + "to 'innerHTML' will throw an error if Trusted Types are enforced. " + "You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' " + 'on the enclosing div instead.') : void 0;
28453
- }
28454
- }
28455
-
28456
- if (!('innerHTML' in node)) {
28457
- // IE does not have innerHTML for SVG nodes, so instead we inject the
28458
- // new markup in a temp node and then move the child nodes across into
28459
- // the target node
28460
- reusableSVGContainer = reusableSVGContainer || document.createElement('div');
28461
- reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>';
28462
- var svgNode = reusableSVGContainer.firstChild;
28463
-
28464
- while (node.firstChild) {
28465
- node.removeChild(node.firstChild);
28466
- }
28467
-
28468
- while (svgNode.firstChild) {
28469
- node.appendChild(svgNode.firstChild);
28470
- }
28471
-
28472
- return;
28473
- }
28474
- }
28475
-
28476
- node.innerHTML = html;
28477
- });
28478
-
28479
- /**
28480
- * HTML nodeType values that represent the type of the node
28481
- */
28482
- var ELEMENT_NODE = 1;
28483
- var TEXT_NODE = 3;
28484
- var COMMENT_NODE = 8;
28485
- var DOCUMENT_NODE = 9;
28486
- var DOCUMENT_FRAGMENT_NODE = 11;
28487
-
28488
- /**
28489
- * Set the textContent property of a node. For text updates, it's faster
28490
- * to set the `nodeValue` of the Text node directly instead of using
28491
- * `.textContent` which will remove the existing node and create a new one.
28492
- *
28493
- * @param {DOMElement} node
28494
- * @param {string} text
28495
- * @internal
28496
- */
28497
-
28498
- var setTextContent = function (node, text) {
28499
- if (text) {
28500
- var firstChild = node.firstChild;
28501
-
28502
- if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {
28503
- firstChild.nodeValue = text;
28504
- return;
28505
- }
28506
- }
28507
-
28508
- node.textContent = text;
28509
- };
28510
-
28511
- // Do not use the below two methods directly!
28512
- // Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
28513
- // (It is the only module that is allowed to access these methods.)
28514
- function unsafeCastStringToDOMTopLevelType(topLevelType) {
28515
- return topLevelType;
28516
- }
28517
- function unsafeCastDOMTopLevelTypeToString(topLevelType) {
28518
- return topLevelType;
28519
- }
28520
-
28521
- /**
28522
- * Generate a mapping of standard vendor prefixes using the defined style property and event name.
28523
- *
28524
- * @param {string} styleProp
28525
- * @param {string} eventName
28526
- * @returns {object}
28527
- */
28528
-
28529
- function makePrefixMap(styleProp, eventName) {
28530
- var prefixes = {};
28531
- prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
28532
- prefixes['Webkit' + styleProp] = 'webkit' + eventName;
28533
- prefixes['Moz' + styleProp] = 'moz' + eventName;
28534
- return prefixes;
28535
- }
28536
- /**
28537
- * A list of event names to a configurable list of vendor prefixes.
28538
- */
28539
-
28540
-
28541
- var vendorPrefixes = {
28542
- animationend: makePrefixMap('Animation', 'AnimationEnd'),
28543
- animationiteration: makePrefixMap('Animation', 'AnimationIteration'),
28544
- animationstart: makePrefixMap('Animation', 'AnimationStart'),
28545
- transitionend: makePrefixMap('Transition', 'TransitionEnd')
28546
- };
28547
- /**
28548
- * Event names that have already been detected and prefixed (if applicable).
28549
- */
28550
-
28551
- var prefixedEventNames = {};
28552
- /**
28553
- * Element to check for prefixes on.
28554
- */
28555
-
28556
- var style = {};
28557
- /**
28558
- * Bootstrap if a DOM exists.
28559
- */
28560
-
28561
- if (canUseDOM) {
28562
- style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,
28563
- // the un-prefixed "animation" and "transition" properties are defined on the
28564
- // style object but the events that fire will still be prefixed, so we need
28565
- // to check if the un-prefixed events are usable, and if not remove them from the map.
28566
-
28567
- if (!('AnimationEvent' in window)) {
28568
- delete vendorPrefixes.animationend.animation;
28569
- delete vendorPrefixes.animationiteration.animation;
28570
- delete vendorPrefixes.animationstart.animation;
28571
- } // Same as above
28572
-
28573
-
28574
- if (!('TransitionEvent' in window)) {
28575
- delete vendorPrefixes.transitionend.transition;
28576
- }
28577
- }
28578
- /**
28579
- * Attempts to determine the correct vendor prefixed event name.
28580
- *
28581
- * @param {string} eventName
28582
- * @returns {string}
28583
- */
28584
-
28585
-
28586
- function getVendorPrefixedEventName(eventName) {
28587
- if (prefixedEventNames[eventName]) {
28588
- return prefixedEventNames[eventName];
28589
- } else if (!vendorPrefixes[eventName]) {
28590
- return eventName;
28591
- }
28592
-
28593
- var prefixMap = vendorPrefixes[eventName];
28594
-
28595
- for (var styleProp in prefixMap) {
28596
- if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {
28597
- return prefixedEventNames[eventName] = prefixMap[styleProp];
28598
- }
28599
- }
28600
-
28601
- return eventName;
28602
- }
28603
-
28604
- /**
28605
- * To identify top level events in ReactDOM, we use constants defined by this
28606
- * module. This is the only module that uses the unsafe* methods to express
28607
- * that the constants actually correspond to the browser event names. This lets
28608
- * us save some bundle size by avoiding a top level type -> event name map.
28609
- * The rest of ReactDOM code should import top level types from this file.
28610
- */
28611
-
28612
- var TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');
28613
- var TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));
28614
- var TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));
28615
- var TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));
28616
- var TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');
28617
- var TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');
28618
- var TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');
28619
- var TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');
28620
- var TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');
28621
- var TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');
28622
- var TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');
28623
- var TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');
28624
- var TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');
28625
- var TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');
28626
- var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
28627
- var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
28628
- var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
28629
- var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
28630
- var TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');
28631
- var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
28632
- var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
28633
- var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
28634
- var TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');
28635
- var TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');
28636
- var TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');
28637
- var TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');
28638
- var TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');
28639
- var TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');
28640
- var TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');
28641
- var TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');
28642
- var TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');
28643
- var TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');
28644
- var TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');
28645
- var TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');
28646
- var TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');
28647
- var TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');
28648
- var TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');
28649
- var TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');
28650
- var TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');
28651
- var TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');
28652
- var TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');
28653
- var TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');
28654
- var TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');
28655
- var TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');
28656
- var TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');
28657
- var TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');
28658
- var TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');
28659
- var TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');
28660
- var TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');
28661
- var TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');
28662
- var TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');
28663
- var TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');
28664
- var TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');
28665
- var TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');
28666
- var TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');
28667
-
28668
-
28669
- var TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');
28670
- var TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');
28671
- var TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');
28672
- var TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');
28673
- var TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');
28674
- var TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');
28675
- var TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');
28676
- var TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');
28677
- var TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');
28678
- var TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');
28679
- var TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');
28680
- var TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');
28681
- var TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');
28682
- var TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');
28683
- var TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');
28684
- var TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');
28685
- var TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');
28686
- var TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');
28687
- var TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');
28688
- var TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');
28689
- var TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');
28690
- var TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));
28691
- var TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');
28692
- var TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');
28693
- var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.
28694
- // Note that events in this list will *not* be listened to at the top level
28695
- // unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
28696
-
28697
- var mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];
28698
- function getRawEventName(topLevelType) {
28699
- return unsafeCastDOMTopLevelTypeToString(topLevelType);
28700
- }
28701
-
28702
- /**
28703
- * `ReactInstanceMap` maintains a mapping from a public facing stateful
28704
- * instance (key) and the internal representation (value). This allows public
28705
- * methods to accept the user facing instance as an argument and map them back
28706
- * to internal methods.
28707
- *
28708
- * Note that this module is currently shared and assumed to be stateless.
28709
- * If this becomes an actual Map, that will break.
28710
- */
28711
-
28712
- /**
28713
- * This API should be called `delete` but we'd have to make sure to always
28714
- * transform these to strings for IE support. When this transform is fully
28715
- * supported we can rename it.
28716
- */
28717
-
28718
- function get(key) {
28719
- return key._reactInternalFiber;
28720
- }
28721
- function has(key) {
28722
- return key._reactInternalFiber !== undefined;
28723
- }
28724
- function set(key, value) {
28725
- key._reactInternalFiber = value;
28726
- }
28727
-
28728
- // Don't change these two values. They're used by React Dev Tools.
28729
- var NoEffect =
28730
- /* */
28731
- 0;
28732
- var PerformedWork =
28733
- /* */
28734
- 1; // You can change the rest (and add more).
28735
-
28736
- var Placement =
28737
- /* */
28738
- 2;
28739
- var Update =
28740
- /* */
28741
- 4;
28742
- var PlacementAndUpdate =
28743
- /* */
28744
- 6;
28745
- var Deletion =
28746
- /* */
28747
- 8;
28748
- var ContentReset =
28749
- /* */
28750
- 16;
28751
- var Callback =
28752
- /* */
28753
- 32;
28754
- var DidCapture =
28755
- /* */
28756
- 64;
28757
- var Ref =
28758
- /* */
28759
- 128;
28760
- var Snapshot =
28761
- /* */
28762
- 256;
28763
- var Passive =
28764
- /* */
28765
- 512;
28766
- var Hydrating =
28767
- /* */
28768
- 1024;
28769
- var HydratingAndUpdate =
28770
- /* */
28771
- 1028; // Passive & Update & Callback & Ref & Snapshot
28772
-
28773
- var LifecycleEffectMask =
28774
- /* */
28775
- 932; // Union of all host effects
28776
-
28777
- var HostEffectMask =
28778
- /* */
28779
- 2047;
28780
- var Incomplete =
28781
- /* */
28782
- 2048;
28783
- var ShouldCapture =
28784
- /* */
28785
- 4096;
28786
-
28787
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
28788
- function getNearestMountedFiber(fiber) {
28789
- var node = fiber;
28790
- var nearestMounted = fiber;
28791
-
28792
- if (!fiber.alternate) {
28793
- // If there is no alternate, this might be a new tree that isn't inserted
28794
- // yet. If it is, then it will have a pending insertion effect on it.
28795
- var nextNode = node;
28796
-
28797
- do {
28798
- node = nextNode;
28799
-
28800
- if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {
28801
- // This is an insertion or in-progress hydration. The nearest possible
28802
- // mounted fiber is the parent but we need to continue to figure out
28803
- // if that one is still mounted.
28804
- nearestMounted = node.return;
28805
- }
28806
-
28807
- nextNode = node.return;
28808
- } while (nextNode);
28809
- } else {
28810
- while (node.return) {
28811
- node = node.return;
28812
- }
28813
- }
28814
-
28815
- if (node.tag === HostRoot) {
28816
- // TODO: Check if this was a nested HostRoot when used with
28817
- // renderContainerIntoSubtree.
28818
- return nearestMounted;
28819
- } // If we didn't hit the root, that means that we're in an disconnected tree
28820
- // that has been unmounted.
28821
-
28822
-
28823
- return null;
28824
- }
28825
- function getSuspenseInstanceFromFiber(fiber) {
28826
- if (fiber.tag === SuspenseComponent) {
28827
- var suspenseState = fiber.memoizedState;
28828
-
28829
- if (suspenseState === null) {
28830
- var current = fiber.alternate;
28831
-
28832
- if (current !== null) {
28833
- suspenseState = current.memoizedState;
28834
- }
28835
- }
28836
-
28837
- if (suspenseState !== null) {
28838
- return suspenseState.dehydrated;
28839
- }
28840
- }
28841
-
28842
- return null;
28843
- }
28844
- function getContainerFromFiber(fiber) {
28845
- return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;
28846
- }
28847
- function isFiberMounted(fiber) {
28848
- return getNearestMountedFiber(fiber) === fiber;
28849
- }
28850
- function isMounted(component) {
28851
- {
28852
- var owner = ReactCurrentOwner.current;
28853
-
28854
- if (owner !== null && owner.tag === ClassComponent) {
28855
- var ownerFiber = owner;
28856
- var instance = ownerFiber.stateNode;
28857
- !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;
28858
- instance._warnedAboutRefsInRender = true;
28859
- }
28860
- }
28861
-
28862
- var fiber = get(component);
28863
-
28864
- if (!fiber) {
28865
- return false;
28866
- }
28867
-
28868
- return getNearestMountedFiber(fiber) === fiber;
28869
- }
28870
-
28871
- function assertIsMounted(fiber) {
28872
- if (!(getNearestMountedFiber(fiber) === fiber)) {
28873
- {
28874
- throw Error("Unable to find node on an unmounted component.");
28875
- }
28876
- }
28877
- }
28878
-
28879
- function findCurrentFiberUsingSlowPath(fiber) {
28880
- var alternate = fiber.alternate;
28881
-
28882
- if (!alternate) {
28883
- // If there is no alternate, then we only need to check if it is mounted.
28884
- var nearestMounted = getNearestMountedFiber(fiber);
28885
-
28886
- if (!(nearestMounted !== null)) {
28887
- {
28888
- throw Error("Unable to find node on an unmounted component.");
28889
- }
28890
- }
28891
-
28892
- if (nearestMounted !== fiber) {
28893
- return null;
28894
- }
28895
-
28896
- return fiber;
28897
- } // If we have two possible branches, we'll walk backwards up to the root
28898
- // to see what path the root points to. On the way we may hit one of the
28899
- // special cases and we'll deal with them.
28900
-
28901
-
28902
- var a = fiber;
28903
- var b = alternate;
28904
-
28905
- while (true) {
28906
- var parentA = a.return;
28907
-
28908
- if (parentA === null) {
28909
- // We're at the root.
28910
- break;
28911
- }
28912
-
28913
- var parentB = parentA.alternate;
28914
-
28915
- if (parentB === null) {
28916
- // There is no alternate. This is an unusual case. Currently, it only
28917
- // happens when a Suspense component is hidden. An extra fragment fiber
28918
- // is inserted in between the Suspense fiber and its children. Skip
28919
- // over this extra fragment fiber and proceed to the next parent.
28920
- var nextParent = parentA.return;
28921
-
28922
- if (nextParent !== null) {
28923
- a = b = nextParent;
28924
- continue;
28925
- } // If there's no parent, we're at the root.
28926
-
28927
-
28928
- break;
28929
- } // If both copies of the parent fiber point to the same child, we can
28930
- // assume that the child is current. This happens when we bailout on low
28931
- // priority: the bailed out fiber's child reuses the current child.
28932
-
28933
-
28934
- if (parentA.child === parentB.child) {
28935
- var child = parentA.child;
28936
-
28937
- while (child) {
28938
- if (child === a) {
28939
- // We've determined that A is the current branch.
28940
- assertIsMounted(parentA);
28941
- return fiber;
28942
- }
28943
-
28944
- if (child === b) {
28945
- // We've determined that B is the current branch.
28946
- assertIsMounted(parentA);
28947
- return alternate;
28948
- }
28949
-
28950
- child = child.sibling;
28951
- } // We should never have an alternate for any mounting node. So the only
28952
- // way this could possibly happen is if this was unmounted, if at all.
28953
-
28954
-
28955
- {
28956
- {
28957
- throw Error("Unable to find node on an unmounted component.");
28958
- }
28959
- }
28960
- }
28961
-
28962
- if (a.return !== b.return) {
28963
- // The return pointer of A and the return pointer of B point to different
28964
- // fibers. We assume that return pointers never criss-cross, so A must
28965
- // belong to the child set of A.return, and B must belong to the child
28966
- // set of B.return.
28967
- a = parentA;
28968
- b = parentB;
28969
- } else {
28970
- // The return pointers point to the same fiber. We'll have to use the
28971
- // default, slow path: scan the child sets of each parent alternate to see
28972
- // which child belongs to which set.
28973
- //
28974
- // Search parent A's child set
28975
- var didFindChild = false;
28976
- var _child = parentA.child;
28977
-
28978
- while (_child) {
28979
- if (_child === a) {
28980
- didFindChild = true;
28981
- a = parentA;
28982
- b = parentB;
28983
- break;
28984
- }
28985
-
28986
- if (_child === b) {
28987
- didFindChild = true;
28988
- b = parentA;
28989
- a = parentB;
28990
- break;
28991
- }
28992
-
28993
- _child = _child.sibling;
28994
- }
28995
-
28996
- if (!didFindChild) {
28997
- // Search parent B's child set
28998
- _child = parentB.child;
28999
-
29000
- while (_child) {
29001
- if (_child === a) {
29002
- didFindChild = true;
29003
- a = parentB;
29004
- b = parentA;
29005
- break;
29006
- }
29007
-
29008
- if (_child === b) {
29009
- didFindChild = true;
29010
- b = parentB;
29011
- a = parentA;
29012
- break;
29013
- }
29014
-
29015
- _child = _child.sibling;
29016
- }
29017
-
29018
- if (!didFindChild) {
29019
- {
29020
- throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.");
29021
- }
29022
- }
29023
- }
29024
- }
29025
-
29026
- if (!(a.alternate === b)) {
29027
- {
29028
- throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.");
29029
- }
29030
- }
29031
- } // If the root is not a host container, we're in a disconnected tree. I.e.
29032
- // unmounted.
29033
-
29034
-
29035
- if (!(a.tag === HostRoot)) {
29036
- {
29037
- throw Error("Unable to find node on an unmounted component.");
29038
- }
29039
- }
29040
-
29041
- if (a.stateNode.current === a) {
29042
- // We've determined that A is the current branch.
29043
- return fiber;
29044
- } // Otherwise B has to be current branch.
29045
-
29046
-
29047
- return alternate;
29048
- }
29049
- function findCurrentHostFiber(parent) {
29050
- var currentParent = findCurrentFiberUsingSlowPath(parent);
29051
-
29052
- if (!currentParent) {
29053
- return null;
29054
- } // Next we'll drill down this component to find the first HostComponent/Text.
29055
-
29056
-
29057
- var node = currentParent;
29058
-
29059
- while (true) {
29060
- if (node.tag === HostComponent || node.tag === HostText) {
29061
- return node;
29062
- } else if (node.child) {
29063
- node.child.return = node;
29064
- node = node.child;
29065
- continue;
29066
- }
29067
-
29068
- if (node === currentParent) {
29069
- return null;
29070
- }
29071
-
29072
- while (!node.sibling) {
29073
- if (!node.return || node.return === currentParent) {
29074
- return null;
29075
- }
29076
-
29077
- node = node.return;
29078
- }
29079
-
29080
- node.sibling.return = node.return;
29081
- node = node.sibling;
29082
- } // Flow needs the return null here, but ESLint complains about it.
29083
- // eslint-disable-next-line no-unreachable
29084
-
29085
-
29086
- return null;
29087
- }
29088
- function findCurrentHostFiberWithNoPortals(parent) {
29089
- var currentParent = findCurrentFiberUsingSlowPath(parent);
29090
-
29091
- if (!currentParent) {
29092
- return null;
29093
- } // Next we'll drill down this component to find the first HostComponent/Text.
29094
-
29095
-
29096
- var node = currentParent;
29097
-
29098
- while (true) {
29099
- if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI && node.tag === FundamentalComponent) {
29100
- return node;
29101
- } else if (node.child && node.tag !== HostPortal) {
29102
- node.child.return = node;
29103
- node = node.child;
29104
- continue;
29105
- }
29106
-
29107
- if (node === currentParent) {
29108
- return null;
29109
- }
29110
-
29111
- while (!node.sibling) {
29112
- if (!node.return || node.return === currentParent) {
29113
- return null;
29114
- }
29115
-
29116
- node = node.return;
29117
- }
29118
-
29119
- node.sibling.return = node.return;
29120
- node = node.sibling;
29121
- } // Flow needs the return null here, but ESLint complains about it.
29122
- // eslint-disable-next-line no-unreachable
29123
-
29124
-
29125
- return null;
29126
- }
29127
-
29128
- var attemptSynchronousHydration;
29129
- function setAttemptSynchronousHydration(fn) {
29130
- attemptSynchronousHydration = fn;
29131
- }
29132
- var attemptUserBlockingHydration;
29133
- function setAttemptUserBlockingHydration(fn) {
29134
- attemptUserBlockingHydration = fn;
29135
- }
29136
- var attemptContinuousHydration;
29137
- function setAttemptContinuousHydration(fn) {
29138
- attemptContinuousHydration = fn;
29139
- }
29140
- var attemptHydrationAtCurrentPriority;
29141
- function setAttemptHydrationAtCurrentPriority(fn) {
29142
- attemptHydrationAtCurrentPriority = fn;
29143
- } // TODO: Upgrade this definition once we're on a newer version of Flow that
29144
- // has this definition built-in.
29145
-
29146
- var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.
29147
-
29148
- var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.
29149
-
29150
- // if the last target was dehydrated.
29151
-
29152
- var queuedFocus = null;
29153
- var queuedDrag = null;
29154
- var queuedMouse = null; // For pointer events there can be one latest event per pointerId.
29155
-
29156
- var queuedPointers = new Map();
29157
- var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.
29158
-
29159
- var queuedExplicitHydrationTargets = [];
29160
- function hasQueuedDiscreteEvents() {
29161
- return queuedDiscreteEvents.length > 0;
29162
- }
29163
-
29164
- var discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];
29165
- var continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];
29166
- function isReplayableDiscreteEvent(eventType) {
29167
- return discreteReplayableEvents.indexOf(eventType) > -1;
29168
- }
29169
-
29170
- function trapReplayableEvent(topLevelType, document, listeningSet) {
29171
- listenToTopLevel(topLevelType, document, listeningSet);
29172
-
29173
- if (enableFlareAPI) {
29174
- // Trap events for the responder system.
29175
- var passiveEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_passive';
29176
-
29177
- if (!listeningSet.has(passiveEventKey)) {
29178
- trapEventForResponderEventSystem(document, topLevelType, true);
29179
- listeningSet.add(passiveEventKey);
29180
- } // TODO: This listens to all events as active which might have
29181
- // undesirable effects. It's also unnecessary to have both
29182
- // passive and active listeners. Instead, we could start with
29183
- // a passive and upgrade it to an active one if needed.
29184
- // For replaying purposes the active is never needed since we
29185
- // currently don't preventDefault.
29186
-
29187
-
29188
- var activeEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_active';
29189
-
29190
- if (!listeningSet.has(activeEventKey)) {
29191
- trapEventForResponderEventSystem(document, topLevelType, false);
29192
- listeningSet.add(activeEventKey);
29193
- }
29194
- }
29195
- }
29196
-
29197
- function eagerlyTrapReplayableEvents(document) {
29198
- var listeningSet = getListeningSetForElement(document); // Discrete
29199
-
29200
- discreteReplayableEvents.forEach(function (topLevelType) {
29201
- trapReplayableEvent(topLevelType, document, listeningSet);
29202
- }); // Continuous
29203
-
29204
- continuousReplayableEvents.forEach(function (topLevelType) {
29205
- trapReplayableEvent(topLevelType, document, listeningSet);
29206
- });
29207
- }
29208
-
29209
- function createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
29210
- return {
29211
- blockedOn: blockedOn,
29212
- topLevelType: topLevelType,
29213
- eventSystemFlags: eventSystemFlags | IS_REPLAYED,
29214
- nativeEvent: nativeEvent
29215
- };
29216
- }
29217
-
29218
- function queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
29219
- var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
29220
- queuedDiscreteEvents.push(queuedEvent);
29221
-
29222
- if (enableSelectiveHydration) {
29223
- if (queuedDiscreteEvents.length === 1) {
29224
- // If this was the first discrete event, we might be able to
29225
- // synchronously unblock it so that preventDefault still works.
29226
- while (queuedEvent.blockedOn !== null) {
29227
- var _fiber = getInstanceFromNode$1(queuedEvent.blockedOn);
29228
-
29229
- if (_fiber === null) {
29230
- break;
29231
- }
29232
-
29233
- attemptSynchronousHydration(_fiber);
29234
-
29235
- if (queuedEvent.blockedOn === null) {
29236
- // We got unblocked by hydration. Let's try again.
29237
- replayUnblockedEvents(); // If we're reblocked, on an inner boundary, we might need
29238
- // to attempt hydrating that one.
29239
-
29240
- continue;
29241
- } else {
29242
- // We're still blocked from hydation, we have to give up
29243
- // and replay later.
29244
- break;
29245
- }
29246
- }
29247
- }
29248
- }
29249
- } // Resets the replaying for this type of continuous event to no event.
29250
-
29251
- function clearIfContinuousEvent(topLevelType, nativeEvent) {
29252
- switch (topLevelType) {
29253
- case TOP_FOCUS:
29254
- case TOP_BLUR:
29255
- queuedFocus = null;
29256
- break;
29257
-
29258
- case TOP_DRAG_ENTER:
29259
- case TOP_DRAG_LEAVE:
29260
- queuedDrag = null;
29261
- break;
29262
-
29263
- case TOP_MOUSE_OVER:
29264
- case TOP_MOUSE_OUT:
29265
- queuedMouse = null;
29266
- break;
29267
-
29268
- case TOP_POINTER_OVER:
29269
- case TOP_POINTER_OUT:
29270
- {
29271
- var pointerId = nativeEvent.pointerId;
29272
- queuedPointers.delete(pointerId);
29273
- break;
29274
- }
29275
-
29276
- case TOP_GOT_POINTER_CAPTURE:
29277
- case TOP_LOST_POINTER_CAPTURE:
29278
- {
29279
- var _pointerId = nativeEvent.pointerId;
29280
- queuedPointerCaptures.delete(_pointerId);
29281
- break;
29282
- }
29283
- }
29284
- }
29285
-
29286
- function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
29287
- if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {
29288
- var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
29289
-
29290
- if (blockedOn !== null) {
29291
- var _fiber2 = getInstanceFromNode$1(blockedOn);
29292
-
29293
- if (_fiber2 !== null) {
29294
- // Attempt to increase the priority of this target.
29295
- attemptContinuousHydration(_fiber2);
29296
- }
29297
- }
29298
-
29299
- return queuedEvent;
29300
- } // If we have already queued this exact event, then it's because
29301
- // the different event systems have different DOM event listeners.
29302
- // We can accumulate the flags and store a single event to be
29303
- // replayed.
29304
-
29305
-
29306
- existingQueuedEvent.eventSystemFlags |= eventSystemFlags;
29307
- return existingQueuedEvent;
29308
- }
29309
-
29310
- function queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {
29311
- // These set relatedTarget to null because the replayed event will be treated as if we
29312
- // moved from outside the window (no target) onto the target once it hydrates.
29313
- // Instead of mutating we could clone the event.
29314
- switch (topLevelType) {
29315
- case TOP_FOCUS:
29316
- {
29317
- var focusEvent = nativeEvent;
29318
- queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, focusEvent);
29319
- return true;
29320
- }
29321
-
29322
- case TOP_DRAG_ENTER:
29323
- {
29324
- var dragEvent = nativeEvent;
29325
- queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, dragEvent);
29326
- return true;
29327
- }
29328
-
29329
- case TOP_MOUSE_OVER:
29330
- {
29331
- var mouseEvent = nativeEvent;
29332
- queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, mouseEvent);
29333
- return true;
29334
- }
29335
-
29336
- case TOP_POINTER_OVER:
29337
- {
29338
- var pointerEvent = nativeEvent;
29339
- var pointerId = pointerEvent.pointerId;
29340
- queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, pointerEvent));
29341
- return true;
29342
- }
29343
-
29344
- case TOP_GOT_POINTER_CAPTURE:
29345
- {
29346
- var _pointerEvent = nativeEvent;
29347
- var _pointerId2 = _pointerEvent.pointerId;
29348
- queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, _pointerEvent));
29349
- return true;
29350
- }
29351
- }
29352
-
29353
- return false;
29354
- } // Check if this target is unblocked. Returns true if it's unblocked.
29355
-
29356
- function attemptExplicitHydrationTarget(queuedTarget) {
29357
- // TODO: This function shares a lot of logic with attemptToDispatchEvent.
29358
- // Try to unify them. It's a bit tricky since it would require two return
29359
- // values.
29360
- var targetInst = getClosestInstanceFromNode(queuedTarget.target);
29361
-
29362
- if (targetInst !== null) {
29363
- var nearestMounted = getNearestMountedFiber(targetInst);
29364
-
29365
- if (nearestMounted !== null) {
29366
- var tag = nearestMounted.tag;
29367
-
29368
- if (tag === SuspenseComponent) {
29369
- var instance = getSuspenseInstanceFromFiber(nearestMounted);
29370
-
29371
- if (instance !== null) {
29372
- // We're blocked on hydrating this boundary.
29373
- // Increase its priority.
29374
- queuedTarget.blockedOn = instance;
29375
- Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {
29376
- attemptHydrationAtCurrentPriority(nearestMounted);
29377
- });
29378
- return;
29379
- }
29380
- } else if (tag === HostRoot) {
29381
- var root = nearestMounted.stateNode;
29382
-
29383
- if (root.hydrate) {
29384
- queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of
29385
- // a root other than sync.
29386
-
29387
- return;
29388
- }
29389
- }
29390
- }
29391
- }
29392
-
29393
- queuedTarget.blockedOn = null;
29394
- }
29395
-
29396
- function queueExplicitHydrationTarget(target) {
29397
- if (enableSelectiveHydration) {
29398
- var priority = Scheduler.unstable_getCurrentPriorityLevel();
29399
- var queuedTarget = {
29400
- blockedOn: null,
29401
- target: target,
29402
- priority: priority
29403
- };
29404
- var i = 0;
29405
-
29406
- for (; i < queuedExplicitHydrationTargets.length; i++) {
29407
- if (priority <= queuedExplicitHydrationTargets[i].priority) {
29408
- break;
29409
- }
29410
- }
29411
-
29412
- queuedExplicitHydrationTargets.splice(i, 0, queuedTarget);
29413
-
29414
- if (i === 0) {
29415
- attemptExplicitHydrationTarget(queuedTarget);
29416
- }
29417
- }
29418
- }
29419
-
29420
- function attemptReplayContinuousQueuedEvent(queuedEvent) {
29421
- if (queuedEvent.blockedOn !== null) {
29422
- return false;
29423
- }
29424
-
29425
- var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.nativeEvent);
29426
-
29427
- if (nextBlockedOn !== null) {
29428
- // We're still blocked. Try again later.
29429
- var _fiber3 = getInstanceFromNode$1(nextBlockedOn);
29430
-
29431
- if (_fiber3 !== null) {
29432
- attemptContinuousHydration(_fiber3);
29433
- }
29434
-
29435
- queuedEvent.blockedOn = nextBlockedOn;
29436
- return false;
29437
- }
29438
-
29439
- return true;
29440
- }
29441
-
29442
- function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {
29443
- if (attemptReplayContinuousQueuedEvent(queuedEvent)) {
29444
- map.delete(key);
29445
- }
29446
- }
29447
-
29448
- function replayUnblockedEvents() {
29449
- hasScheduledReplayAttempt = false; // First replay discrete events.
29450
-
29451
- while (queuedDiscreteEvents.length > 0) {
29452
- var nextDiscreteEvent = queuedDiscreteEvents[0];
29453
-
29454
- if (nextDiscreteEvent.blockedOn !== null) {
29455
- // We're still blocked.
29456
- // Increase the priority of this boundary to unblock
29457
- // the next discrete event.
29458
- var _fiber4 = getInstanceFromNode$1(nextDiscreteEvent.blockedOn);
29459
-
29460
- if (_fiber4 !== null) {
29461
- attemptUserBlockingHydration(_fiber4);
29462
- }
29463
-
29464
- break;
29465
- }
29466
-
29467
- var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.nativeEvent);
29468
-
29469
- if (nextBlockedOn !== null) {
29470
- // We're still blocked. Try again later.
29471
- nextDiscreteEvent.blockedOn = nextBlockedOn;
29472
- } else {
29473
- // We've successfully replayed the first event. Let's try the next one.
29474
- queuedDiscreteEvents.shift();
29475
- }
29476
- } // Next replay any continuous events.
29477
-
29478
-
29479
- if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {
29480
- queuedFocus = null;
29481
- }
29482
-
29483
- if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {
29484
- queuedDrag = null;
29485
- }
29486
-
29487
- if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {
29488
- queuedMouse = null;
29489
- }
29490
-
29491
- queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);
29492
- queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);
29493
- }
29494
-
29495
- function scheduleCallbackIfUnblocked(queuedEvent, unblocked) {
29496
- if (queuedEvent.blockedOn === unblocked) {
29497
- queuedEvent.blockedOn = null;
29498
-
29499
- if (!hasScheduledReplayAttempt) {
29500
- hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are
29501
- // now unblocked. This first might not actually be unblocked yet.
29502
- // We could check it early to avoid scheduling an unnecessary callback.
29503
-
29504
- Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);
29505
- }
29506
- }
29507
- }
29508
-
29509
- function retryIfBlockedOn(unblocked) {
29510
- // Mark anything that was blocked on this as no longer blocked
29511
- // and eligible for a replay.
29512
- if (queuedDiscreteEvents.length > 0) {
29513
- scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's
29514
- // worth it because we expect very few discrete events to queue up and once
29515
- // we are actually fully unblocked it will be fast to replay them.
29516
-
29517
- for (var i = 1; i < queuedDiscreteEvents.length; i++) {
29518
- var queuedEvent = queuedDiscreteEvents[i];
29519
-
29520
- if (queuedEvent.blockedOn === unblocked) {
29521
- queuedEvent.blockedOn = null;
29522
- }
29523
- }
29524
- }
29525
-
29526
- if (queuedFocus !== null) {
29527
- scheduleCallbackIfUnblocked(queuedFocus, unblocked);
29528
- }
29529
-
29530
- if (queuedDrag !== null) {
29531
- scheduleCallbackIfUnblocked(queuedDrag, unblocked);
29532
- }
29533
-
29534
- if (queuedMouse !== null) {
29535
- scheduleCallbackIfUnblocked(queuedMouse, unblocked);
29536
- }
29537
-
29538
- var unblock = function (queuedEvent) {
29539
- return scheduleCallbackIfUnblocked(queuedEvent, unblocked);
29540
- };
29541
-
29542
- queuedPointers.forEach(unblock);
29543
- queuedPointerCaptures.forEach(unblock);
29544
-
29545
- for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) {
29546
- var queuedTarget = queuedExplicitHydrationTargets[_i];
29547
-
29548
- if (queuedTarget.blockedOn === unblocked) {
29549
- queuedTarget.blockedOn = null;
29550
- }
29551
- }
29552
-
29553
- while (queuedExplicitHydrationTargets.length > 0) {
29554
- var nextExplicitTarget = queuedExplicitHydrationTargets[0];
29555
-
29556
- if (nextExplicitTarget.blockedOn !== null) {
29557
- // We're still blocked.
29558
- break;
29559
- } else {
29560
- attemptExplicitHydrationTarget(nextExplicitTarget);
29561
-
29562
- if (nextExplicitTarget.blockedOn === null) {
29563
- // We're unblocked.
29564
- queuedExplicitHydrationTargets.shift();
29565
- }
29566
- }
29567
- }
29568
- }
29569
-
29570
- function addEventBubbleListener(element, eventType, listener) {
29571
- element.addEventListener(eventType, listener, false);
29572
- }
29573
- function addEventCaptureListener(element, eventType, listener) {
29574
- element.addEventListener(eventType, listener, true);
29575
- }
29576
- function addEventCaptureListenerWithPassiveFlag(element, eventType, listener, passive) {
29577
- element.addEventListener(eventType, listener, {
29578
- capture: true,
29579
- passive: passive
29580
- });
29581
- }
29582
-
29583
- /**
29584
- * Gets the target node from a native browser event by accounting for
29585
- * inconsistencies in browser DOM APIs.
29586
- *
29587
- * @param {object} nativeEvent Native browser event.
29588
- * @return {DOMEventTarget} Target node.
29589
- */
29590
-
29591
- function getEventTarget(nativeEvent) {
29592
- // Fallback to nativeEvent.srcElement for IE9
29593
- // https://github.com/facebook/react/issues/12506
29594
- var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963
29595
-
29596
- if (target.correspondingUseElement) {
29597
- target = target.correspondingUseElement;
29598
- } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
29599
- // @see http://www.quirksmode.org/js/events_properties.html
29600
-
29601
-
29602
- return target.nodeType === TEXT_NODE ? target.parentNode : target;
29603
- }
29604
-
29605
- function getParent(inst) {
29606
- do {
29607
- inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
29608
- // That is depending on if we want nested subtrees (layers) to bubble
29609
- // events to their parent. We could also go through parentNode on the
29610
- // host node but that wouldn't work for React Native and doesn't let us
29611
- // do the portal feature.
29612
- } while (inst && inst.tag !== HostComponent);
29613
-
29614
- if (inst) {
29615
- return inst;
29616
- }
29617
-
29618
- return null;
29619
- }
29620
- /**
29621
- * Return the lowest common ancestor of A and B, or null if they are in
29622
- * different trees.
29623
- */
29624
-
29625
-
29626
- function getLowestCommonAncestor(instA, instB) {
29627
- var depthA = 0;
29628
-
29629
- for (var tempA = instA; tempA; tempA = getParent(tempA)) {
29630
- depthA++;
29631
- }
29632
-
29633
- var depthB = 0;
29634
-
29635
- for (var tempB = instB; tempB; tempB = getParent(tempB)) {
29636
- depthB++;
29637
- } // If A is deeper, crawl up.
29638
-
29639
-
29640
- while (depthA - depthB > 0) {
29641
- instA = getParent(instA);
29642
- depthA--;
29643
- } // If B is deeper, crawl up.
29644
-
29645
-
29646
- while (depthB - depthA > 0) {
29647
- instB = getParent(instB);
29648
- depthB--;
29649
- } // Walk in lockstep until we find a match.
29650
-
29651
-
29652
- var depth = depthA;
29653
-
29654
- while (depth--) {
29655
- if (instA === instB || instA === instB.alternate) {
29656
- return instA;
29657
- }
29658
-
29659
- instA = getParent(instA);
29660
- instB = getParent(instB);
29661
- }
29662
-
29663
- return null;
29664
- }
29665
- /**
29666
- * Return if A is an ancestor of B.
29667
- */
29668
-
29669
-
29670
- /**
29671
- * Return the parent instance of the passed-in instance.
29672
- */
29673
-
29674
-
29675
- /**
29676
- * Simulates the traversal of a two-phase, capture/bubble event dispatch.
29677
- */
29678
-
29679
- function traverseTwoPhase(inst, fn, arg) {
29680
- var path = [];
29681
-
29682
- while (inst) {
29683
- path.push(inst);
29684
- inst = getParent(inst);
29685
- }
29686
-
29687
- var i;
29688
-
29689
- for (i = path.length; i-- > 0;) {
29690
- fn(path[i], 'captured', arg);
29691
- }
29692
-
29693
- for (i = 0; i < path.length; i++) {
29694
- fn(path[i], 'bubbled', arg);
29695
- }
29696
- }
29697
- /**
29698
- * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that
29699
- * should would receive a `mouseEnter` or `mouseLeave` event.
29700
- *
29701
- * Does not invoke the callback on the nearest common ancestor because nothing
29702
- * "entered" or "left" that element.
29703
- */
29704
-
29705
- function traverseEnterLeave(from, to, fn, argFrom, argTo) {
29706
- var common = from && to ? getLowestCommonAncestor(from, to) : null;
29707
- var pathFrom = [];
29708
-
29709
- while (true) {
29710
- if (!from) {
29711
- break;
29712
- }
29713
-
29714
- if (from === common) {
29715
- break;
29716
- }
29717
-
29718
- var alternate = from.alternate;
29719
-
29720
- if (alternate !== null && alternate === common) {
29721
- break;
29722
- }
29723
-
29724
- pathFrom.push(from);
29725
- from = getParent(from);
29726
- }
29727
-
29728
- var pathTo = [];
29729
-
29730
- while (true) {
29731
- if (!to) {
29732
- break;
29733
- }
29734
-
29735
- if (to === common) {
29736
- break;
29737
- }
29738
-
29739
- var _alternate = to.alternate;
29740
-
29741
- if (_alternate !== null && _alternate === common) {
29742
- break;
29743
- }
29744
-
29745
- pathTo.push(to);
29746
- to = getParent(to);
29747
- }
29748
-
29749
- for (var i = 0; i < pathFrom.length; i++) {
29750
- fn(pathFrom[i], 'bubbled', argFrom);
29751
- }
29752
-
29753
- for (var _i = pathTo.length; _i-- > 0;) {
29754
- fn(pathTo[_i], 'captured', argTo);
29755
- }
29756
- }
29757
-
29758
- /**
29759
- * Some event types have a notion of different registration names for different
29760
- * "phases" of propagation. This finds listeners by a given phase.
29761
- */
29762
- function listenerAtPhase(inst, event, propagationPhase) {
29763
- var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];
29764
- return getListener(inst, registrationName);
29765
- }
29766
- /**
29767
- * A small set of propagation patterns, each of which will accept a small amount
29768
- * of information, and generate a set of "dispatch ready event objects" - which
29769
- * are sets of events that have already been annotated with a set of dispatched
29770
- * listener functions/ids. The API is designed this way to discourage these
29771
- * propagation strategies from actually executing the dispatches, since we
29772
- * always want to collect the entire set of dispatches before executing even a
29773
- * single one.
29774
- */
29775
-
29776
- /**
29777
- * Tags a `SyntheticEvent` with dispatched listeners. Creating this function
29778
- * here, allows us to not have to bind or create functions for each event.
29779
- * Mutating the event's members allows us to not have to create a wrapping
29780
- * "dispatch" object that pairs the event with the listener.
29781
- */
29782
-
29783
-
29784
- function accumulateDirectionalDispatches(inst, phase, event) {
29785
- {
29786
- !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;
29787
- }
29788
-
29789
- var listener = listenerAtPhase(inst, event, phase);
29790
-
29791
- if (listener) {
29792
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
29793
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
29794
- }
29795
- }
29796
- /**
29797
- * Collect dispatches (must be entirely collected before dispatching - see unit
29798
- * tests). Lazily allocate the array to conserve memory. We must loop through
29799
- * each event and perform the traversal for each one. We cannot perform a
29800
- * single traversal for the entire collection of events because each event may
29801
- * have a different target.
29802
- */
29803
-
29804
-
29805
- function accumulateTwoPhaseDispatchesSingle(event) {
29806
- if (event && event.dispatchConfig.phasedRegistrationNames) {
29807
- traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
29808
- }
29809
- }
29810
- /**
29811
- * Accumulates without regard to direction, does not look for phased
29812
- * registration names. Same as `accumulateDirectDispatchesSingle` but without
29813
- * requiring that the `dispatchMarker` be the same as the dispatched ID.
29814
- */
29815
-
29816
-
29817
- function accumulateDispatches(inst, ignoredDirection, event) {
29818
- if (inst && event && event.dispatchConfig.registrationName) {
29819
- var registrationName = event.dispatchConfig.registrationName;
29820
- var listener = getListener(inst, registrationName);
29821
-
29822
- if (listener) {
29823
- event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);
29824
- event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);
29825
- }
29826
- }
29827
- }
29828
- /**
29829
- * Accumulates dispatches on an `SyntheticEvent`, but only for the
29830
- * `dispatchMarker`.
29831
- * @param {SyntheticEvent} event
29832
- */
29833
-
29834
-
29835
- function accumulateDirectDispatchesSingle(event) {
29836
- if (event && event.dispatchConfig.registrationName) {
29837
- accumulateDispatches(event._targetInst, null, event);
29838
- }
29839
- }
29840
-
29841
- function accumulateTwoPhaseDispatches(events) {
29842
- forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);
29843
- }
29844
-
29845
- function accumulateEnterLeaveDispatches(leave, enter, from, to) {
29846
- traverseEnterLeave(from, to, accumulateDispatches, leave, enter);
29847
- }
29848
- function accumulateDirectDispatches(events) {
29849
- forEachAccumulated(events, accumulateDirectDispatchesSingle);
29850
- }
29851
-
29852
- /* eslint valid-typeof: 0 */
29853
- var EVENT_POOL_SIZE = 10;
29854
- /**
29855
- * @interface Event
29856
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
29857
- */
29858
-
29859
- var EventInterface = {
29860
- type: null,
29861
- target: null,
29862
- // currentTarget is set when dispatching; no use in copying it here
29863
- currentTarget: function () {
29864
- return null;
29865
- },
29866
- eventPhase: null,
29867
- bubbles: null,
29868
- cancelable: null,
29869
- timeStamp: function (event) {
29870
- return event.timeStamp || Date.now();
29871
- },
29872
- defaultPrevented: null,
29873
- isTrusted: null
29874
- };
29875
-
29876
- function functionThatReturnsTrue() {
29877
- return true;
29878
- }
29879
-
29880
- function functionThatReturnsFalse() {
29881
- return false;
29882
- }
29883
- /**
29884
- * Synthetic events are dispatched by event plugins, typically in response to a
29885
- * top-level event delegation handler.
29886
- *
29887
- * These systems should generally use pooling to reduce the frequency of garbage
29888
- * collection. The system should check `isPersistent` to determine whether the
29889
- * event should be released into the pool after being dispatched. Users that
29890
- * need a persisted event should invoke `persist`.
29891
- *
29892
- * Synthetic events (and subclasses) implement the DOM Level 3 Events API by
29893
- * normalizing browser quirks. Subclasses do not necessarily have to implement a
29894
- * DOM interface; custom application-specific events can also subclass this.
29895
- *
29896
- * @param {object} dispatchConfig Configuration used to dispatch this event.
29897
- * @param {*} targetInst Marker identifying the event target.
29898
- * @param {object} nativeEvent Native browser event.
29899
- * @param {DOMEventTarget} nativeEventTarget Target node.
29900
- */
29901
-
29902
-
29903
- function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {
29904
- {
29905
- // these have a getter/setter for warnings
29906
- delete this.nativeEvent;
29907
- delete this.preventDefault;
29908
- delete this.stopPropagation;
29909
- delete this.isDefaultPrevented;
29910
- delete this.isPropagationStopped;
29911
- }
29912
-
29913
- this.dispatchConfig = dispatchConfig;
29914
- this._targetInst = targetInst;
29915
- this.nativeEvent = nativeEvent;
29916
- var Interface = this.constructor.Interface;
29917
-
29918
- for (var propName in Interface) {
29919
- if (!Interface.hasOwnProperty(propName)) {
29920
- continue;
29921
- }
29922
-
29923
- {
29924
- delete this[propName]; // this has a getter/setter for warnings
29925
- }
29926
-
29927
- var normalize = Interface[propName];
29928
-
29929
- if (normalize) {
29930
- this[propName] = normalize(nativeEvent);
29931
- } else {
29932
- if (propName === 'target') {
29933
- this.target = nativeEventTarget;
29934
- } else {
29935
- this[propName] = nativeEvent[propName];
29936
- }
29937
- }
29938
- }
29939
-
29940
- var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
29941
-
29942
- if (defaultPrevented) {
29943
- this.isDefaultPrevented = functionThatReturnsTrue;
29944
- } else {
29945
- this.isDefaultPrevented = functionThatReturnsFalse;
29946
- }
29947
-
29948
- this.isPropagationStopped = functionThatReturnsFalse;
29949
- return this;
29950
- }
29951
-
29952
- _assign(SyntheticEvent.prototype, {
29953
- preventDefault: function () {
29954
- this.defaultPrevented = true;
29955
- var event = this.nativeEvent;
29956
-
29957
- if (!event) {
29958
- return;
29959
- }
29960
-
29961
- if (event.preventDefault) {
29962
- event.preventDefault();
29963
- } else if (typeof event.returnValue !== 'unknown') {
29964
- event.returnValue = false;
29965
- }
29966
-
29967
- this.isDefaultPrevented = functionThatReturnsTrue;
29968
- },
29969
- stopPropagation: function () {
29970
- var event = this.nativeEvent;
29971
-
29972
- if (!event) {
29973
- return;
29974
- }
29975
-
29976
- if (event.stopPropagation) {
29977
- event.stopPropagation();
29978
- } else if (typeof event.cancelBubble !== 'unknown') {
29979
- // The ChangeEventPlugin registers a "propertychange" event for
29980
- // IE. This event does not support bubbling or cancelling, and
29981
- // any references to cancelBubble throw "Member not found". A
29982
- // typeof check of "unknown" circumvents this issue (and is also
29983
- // IE specific).
29984
- event.cancelBubble = true;
29985
- }
29986
-
29987
- this.isPropagationStopped = functionThatReturnsTrue;
29988
- },
29989
-
29990
- /**
29991
- * We release all dispatched `SyntheticEvent`s after each event loop, adding
29992
- * them back into the pool. This allows a way to hold onto a reference that
29993
- * won't be added back into the pool.
29994
- */
29995
- persist: function () {
29996
- this.isPersistent = functionThatReturnsTrue;
29997
- },
29998
-
29999
- /**
30000
- * Checks if this event should be released back into the pool.
30001
- *
30002
- * @return {boolean} True if this should not be released, false otherwise.
30003
- */
30004
- isPersistent: functionThatReturnsFalse,
30005
-
30006
- /**
30007
- * `PooledClass` looks for `destructor` on each instance it releases.
30008
- */
30009
- destructor: function () {
30010
- var Interface = this.constructor.Interface;
30011
-
30012
- for (var propName in Interface) {
30013
- {
30014
- Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
30015
- }
30016
- }
30017
-
30018
- this.dispatchConfig = null;
30019
- this._targetInst = null;
30020
- this.nativeEvent = null;
30021
- this.isDefaultPrevented = functionThatReturnsFalse;
30022
- this.isPropagationStopped = functionThatReturnsFalse;
30023
- this._dispatchListeners = null;
30024
- this._dispatchInstances = null;
30025
-
30026
- {
30027
- Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
30028
- Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
30029
- Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
30030
- Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
30031
- Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
30032
- }
30033
- }
30034
- });
30035
-
30036
- SyntheticEvent.Interface = EventInterface;
30037
- /**
30038
- * Helper to reduce boilerplate when creating subclasses.
30039
- */
30040
-
30041
- SyntheticEvent.extend = function (Interface) {
30042
- var Super = this;
30043
-
30044
- var E = function () {};
30045
-
30046
- E.prototype = Super.prototype;
30047
- var prototype = new E();
30048
-
30049
- function Class() {
30050
- return Super.apply(this, arguments);
30051
- }
30052
-
30053
- _assign(prototype, Class.prototype);
30054
-
30055
- Class.prototype = prototype;
30056
- Class.prototype.constructor = Class;
30057
- Class.Interface = _assign({}, Super.Interface, Interface);
30058
- Class.extend = Super.extend;
30059
- addEventPoolingTo(Class);
30060
- return Class;
30061
- };
30062
-
30063
- addEventPoolingTo(SyntheticEvent);
30064
- /**
30065
- * Helper to nullify syntheticEvent instance properties when destructing
30066
- *
30067
- * @param {String} propName
30068
- * @param {?object} getVal
30069
- * @return {object} defineProperty object
30070
- */
30071
-
30072
- function getPooledWarningPropertyDefinition(propName, getVal) {
30073
- var isFunction = typeof getVal === 'function';
30074
- return {
30075
- configurable: true,
30076
- set: set,
30077
- get: get
30078
- };
30079
-
30080
- function set(val) {
30081
- var action = isFunction ? 'setting the method' : 'setting the property';
30082
- warn(action, 'This is effectively a no-op');
30083
- return val;
30084
- }
30085
-
30086
- function get() {
30087
- var action = isFunction ? 'accessing the method' : 'accessing the property';
30088
- var result = isFunction ? 'This is a no-op function' : 'This is set to null';
30089
- warn(action, result);
30090
- return getVal;
30091
- }
30092
-
30093
- function warn(action, result) {
30094
- var warningCondition = false;
30095
- !warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
30096
- }
30097
- }
30098
-
30099
- function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
30100
- var EventConstructor = this;
30101
-
30102
- if (EventConstructor.eventPool.length) {
30103
- var instance = EventConstructor.eventPool.pop();
30104
- EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
30105
- return instance;
30106
- }
30107
-
30108
- return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);
30109
- }
30110
-
30111
- function releasePooledEvent(event) {
30112
- var EventConstructor = this;
30113
-
30114
- if (!(event instanceof EventConstructor)) {
30115
- {
30116
- throw Error("Trying to release an event instance into a pool of a different type.");
30117
- }
30118
- }
30119
-
30120
- event.destructor();
30121
-
30122
- if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
30123
- EventConstructor.eventPool.push(event);
30124
- }
30125
- }
30126
-
30127
- function addEventPoolingTo(EventConstructor) {
30128
- EventConstructor.eventPool = [];
30129
- EventConstructor.getPooled = getPooledEvent;
30130
- EventConstructor.release = releasePooledEvent;
30131
- }
30132
-
30133
- /**
30134
- * @interface Event
30135
- * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface
30136
- * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent
30137
- */
30138
-
30139
- var SyntheticAnimationEvent = SyntheticEvent.extend({
30140
- animationName: null,
30141
- elapsedTime: null,
30142
- pseudoElement: null
30143
- });
30144
-
30145
- /**
30146
- * @interface Event
30147
- * @see http://www.w3.org/TR/clipboard-apis/
30148
- */
30149
-
30150
- var SyntheticClipboardEvent = SyntheticEvent.extend({
30151
- clipboardData: function (event) {
30152
- return 'clipboardData' in event ? event.clipboardData : window.clipboardData;
30153
- }
30154
- });
30155
-
30156
- var SyntheticUIEvent = SyntheticEvent.extend({
30157
- view: null,
30158
- detail: null
30159
- });
30160
-
30161
- /**
30162
- * @interface FocusEvent
30163
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
30164
- */
30165
-
30166
- var SyntheticFocusEvent = SyntheticUIEvent.extend({
30167
- relatedTarget: null
30168
- });
30169
-
30170
- /**
30171
- * `charCode` represents the actual "character code" and is safe to use with
30172
- * `String.fromCharCode`. As such, only keys that correspond to printable
30173
- * characters produce a valid `charCode`, the only exception to this is Enter.
30174
- * The Tab-key is considered non-printable and does not have a `charCode`,
30175
- * presumably because it does not produce a tab-character in browsers.
30176
- *
30177
- * @param {object} nativeEvent Native browser event.
30178
- * @return {number} Normalized `charCode` property.
30179
- */
30180
- function getEventCharCode(nativeEvent) {
30181
- var charCode;
30182
- var keyCode = nativeEvent.keyCode;
30183
-
30184
- if ('charCode' in nativeEvent) {
30185
- charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.
30186
-
30187
- if (charCode === 0 && keyCode === 13) {
30188
- charCode = 13;
30189
- }
30190
- } else {
30191
- // IE8 does not implement `charCode`, but `keyCode` has the correct value.
30192
- charCode = keyCode;
30193
- } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)
30194
- // report Enter as charCode 10 when ctrl is pressed.
30195
-
30196
-
30197
- if (charCode === 10) {
30198
- charCode = 13;
30199
- } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.
30200
- // Must not discard the (non-)printable Enter-key.
30201
-
30202
-
30203
- if (charCode >= 32 || charCode === 13) {
30204
- return charCode;
30205
- }
30206
-
30207
- return 0;
30208
- }
30209
-
30210
- /**
30211
- * Normalization of deprecated HTML5 `key` values
30212
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
30213
- */
30214
-
30215
- var normalizeKey = {
30216
- Esc: 'Escape',
30217
- Spacebar: ' ',
30218
- Left: 'ArrowLeft',
30219
- Up: 'ArrowUp',
30220
- Right: 'ArrowRight',
30221
- Down: 'ArrowDown',
30222
- Del: 'Delete',
30223
- Win: 'OS',
30224
- Menu: 'ContextMenu',
30225
- Apps: 'ContextMenu',
30226
- Scroll: 'ScrollLock',
30227
- MozPrintableKey: 'Unidentified'
30228
- };
30229
- /**
30230
- * Translation from legacy `keyCode` to HTML5 `key`
30231
- * Only special keys supported, all others depend on keyboard layout or browser
30232
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names
30233
- */
30234
-
30235
- var translateToKey = {
30236
- '8': 'Backspace',
30237
- '9': 'Tab',
30238
- '12': 'Clear',
30239
- '13': 'Enter',
30240
- '16': 'Shift',
30241
- '17': 'Control',
30242
- '18': 'Alt',
30243
- '19': 'Pause',
30244
- '20': 'CapsLock',
30245
- '27': 'Escape',
30246
- '32': ' ',
30247
- '33': 'PageUp',
30248
- '34': 'PageDown',
30249
- '35': 'End',
30250
- '36': 'Home',
30251
- '37': 'ArrowLeft',
30252
- '38': 'ArrowUp',
30253
- '39': 'ArrowRight',
30254
- '40': 'ArrowDown',
30255
- '45': 'Insert',
30256
- '46': 'Delete',
30257
- '112': 'F1',
30258
- '113': 'F2',
30259
- '114': 'F3',
30260
- '115': 'F4',
30261
- '116': 'F5',
30262
- '117': 'F6',
30263
- '118': 'F7',
30264
- '119': 'F8',
30265
- '120': 'F9',
30266
- '121': 'F10',
30267
- '122': 'F11',
30268
- '123': 'F12',
30269
- '144': 'NumLock',
30270
- '145': 'ScrollLock',
30271
- '224': 'Meta'
30272
- };
30273
- /**
30274
- * @param {object} nativeEvent Native browser event.
30275
- * @return {string} Normalized `key` property.
30276
- */
30277
-
30278
- function getEventKey(nativeEvent) {
30279
- if (nativeEvent.key) {
30280
- // Normalize inconsistent values reported by browsers due to
30281
- // implementations of a working draft specification.
30282
- // FireFox implements `key` but returns `MozPrintableKey` for all
30283
- // printable characters (normalized to `Unidentified`), ignore it.
30284
- var key = normalizeKey[nativeEvent.key] || nativeEvent.key;
30285
-
30286
- if (key !== 'Unidentified') {
30287
- return key;
30288
- }
30289
- } // Browser does not implement `key`, polyfill as much of it as we can.
30290
-
30291
-
30292
- if (nativeEvent.type === 'keypress') {
30293
- var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can
30294
- // thus be captured by `keypress`, no other non-printable key should.
30295
-
30296
- return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);
30297
- }
30298
-
30299
- if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {
30300
- // While user keyboard layout determines the actual meaning of each
30301
- // `keyCode` value, almost all function keys have a universal value.
30302
- return translateToKey[nativeEvent.keyCode] || 'Unidentified';
30303
- }
30304
-
30305
- return '';
30306
- }
30307
-
30308
- /**
30309
- * Translation from modifier key to the associated property in the event.
30310
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers
30311
- */
30312
- var modifierKeyToProp = {
30313
- Alt: 'altKey',
30314
- Control: 'ctrlKey',
30315
- Meta: 'metaKey',
30316
- Shift: 'shiftKey'
30317
- }; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support
30318
- // getModifierState. If getModifierState is not supported, we map it to a set of
30319
- // modifier keys exposed by the event. In this case, Lock-keys are not supported.
30320
-
30321
- function modifierStateGetter(keyArg) {
30322
- var syntheticEvent = this;
30323
- var nativeEvent = syntheticEvent.nativeEvent;
30324
-
30325
- if (nativeEvent.getModifierState) {
30326
- return nativeEvent.getModifierState(keyArg);
30327
- }
30328
-
30329
- var keyProp = modifierKeyToProp[keyArg];
30330
- return keyProp ? !!nativeEvent[keyProp] : false;
30331
- }
30332
-
30333
- function getEventModifierState(nativeEvent) {
30334
- return modifierStateGetter;
30335
- }
30336
-
30337
- /**
30338
- * @interface KeyboardEvent
30339
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
30340
- */
30341
-
30342
- var SyntheticKeyboardEvent = SyntheticUIEvent.extend({
30343
- key: getEventKey,
30344
- location: null,
30345
- ctrlKey: null,
30346
- shiftKey: null,
30347
- altKey: null,
30348
- metaKey: null,
30349
- repeat: null,
30350
- locale: null,
30351
- getModifierState: getEventModifierState,
30352
- // Legacy Interface
30353
- charCode: function (event) {
30354
- // `charCode` is the result of a KeyPress event and represents the value of
30355
- // the actual printable character.
30356
- // KeyPress is deprecated, but its replacement is not yet final and not
30357
- // implemented in any major browser. Only KeyPress has charCode.
30358
- if (event.type === 'keypress') {
30359
- return getEventCharCode(event);
30360
- }
30361
-
30362
- return 0;
30363
- },
30364
- keyCode: function (event) {
30365
- // `keyCode` is the result of a KeyDown/Up event and represents the value of
30366
- // physical keyboard key.
30367
- // The actual meaning of the value depends on the users' keyboard layout
30368
- // which cannot be detected. Assuming that it is a US keyboard layout
30369
- // provides a surprisingly accurate mapping for US and European users.
30370
- // Due to this, it is left to the user to implement at this time.
30371
- if (event.type === 'keydown' || event.type === 'keyup') {
30372
- return event.keyCode;
30373
- }
30374
-
30375
- return 0;
30376
- },
30377
- which: function (event) {
30378
- // `which` is an alias for either `keyCode` or `charCode` depending on the
30379
- // type of the event.
30380
- if (event.type === 'keypress') {
30381
- return getEventCharCode(event);
30382
- }
30383
-
30384
- if (event.type === 'keydown' || event.type === 'keyup') {
30385
- return event.keyCode;
30386
- }
30387
-
30388
- return 0;
30389
- }
30390
- });
30391
-
30392
- var previousScreenX = 0;
30393
- var previousScreenY = 0; // Use flags to signal movementX/Y has already been set
30394
-
30395
- var isMovementXSet = false;
30396
- var isMovementYSet = false;
30397
- /**
30398
- * @interface MouseEvent
30399
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
30400
- */
30401
-
30402
- var SyntheticMouseEvent = SyntheticUIEvent.extend({
30403
- screenX: null,
30404
- screenY: null,
30405
- clientX: null,
30406
- clientY: null,
30407
- pageX: null,
30408
- pageY: null,
30409
- ctrlKey: null,
30410
- shiftKey: null,
30411
- altKey: null,
30412
- metaKey: null,
30413
- getModifierState: getEventModifierState,
30414
- button: null,
30415
- buttons: null,
30416
- relatedTarget: function (event) {
30417
- return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);
30418
- },
30419
- movementX: function (event) {
30420
- if ('movementX' in event) {
30421
- return event.movementX;
30422
- }
30423
-
30424
- var screenX = previousScreenX;
30425
- previousScreenX = event.screenX;
30426
-
30427
- if (!isMovementXSet) {
30428
- isMovementXSet = true;
30429
- return 0;
30430
- }
30431
-
30432
- return event.type === 'mousemove' ? event.screenX - screenX : 0;
30433
- },
30434
- movementY: function (event) {
30435
- if ('movementY' in event) {
30436
- return event.movementY;
30437
- }
30438
-
30439
- var screenY = previousScreenY;
30440
- previousScreenY = event.screenY;
30441
-
30442
- if (!isMovementYSet) {
30443
- isMovementYSet = true;
30444
- return 0;
30445
- }
30446
-
30447
- return event.type === 'mousemove' ? event.screenY - screenY : 0;
30448
- }
30449
- });
30450
-
30451
- /**
30452
- * @interface PointerEvent
30453
- * @see http://www.w3.org/TR/pointerevents/
30454
- */
30455
-
30456
- var SyntheticPointerEvent = SyntheticMouseEvent.extend({
30457
- pointerId: null,
30458
- width: null,
30459
- height: null,
30460
- pressure: null,
30461
- tangentialPressure: null,
30462
- tiltX: null,
30463
- tiltY: null,
30464
- twist: null,
30465
- pointerType: null,
30466
- isPrimary: null
30467
- });
30468
-
30469
- /**
30470
- * @interface DragEvent
30471
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
30472
- */
30473
-
30474
- var SyntheticDragEvent = SyntheticMouseEvent.extend({
30475
- dataTransfer: null
30476
- });
30477
-
30478
- /**
30479
- * @interface TouchEvent
30480
- * @see http://www.w3.org/TR/touch-events/
30481
- */
30482
-
30483
- var SyntheticTouchEvent = SyntheticUIEvent.extend({
30484
- touches: null,
30485
- targetTouches: null,
30486
- changedTouches: null,
30487
- altKey: null,
30488
- metaKey: null,
30489
- ctrlKey: null,
30490
- shiftKey: null,
30491
- getModifierState: getEventModifierState
30492
- });
30493
-
30494
- /**
30495
- * @interface Event
30496
- * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-
30497
- * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent
30498
- */
30499
-
30500
- var SyntheticTransitionEvent = SyntheticEvent.extend({
30501
- propertyName: null,
30502
- elapsedTime: null,
30503
- pseudoElement: null
30504
- });
30505
-
30506
- /**
30507
- * @interface WheelEvent
30508
- * @see http://www.w3.org/TR/DOM-Level-3-Events/
30509
- */
30510
-
30511
- var SyntheticWheelEvent = SyntheticMouseEvent.extend({
30512
- deltaX: function (event) {
30513
- return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).
30514
- 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;
30515
- },
30516
- deltaY: function (event) {
30517
- return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).
30518
- 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).
30519
- 'wheelDelta' in event ? -event.wheelDelta : 0;
30520
- },
30521
- deltaZ: null,
30522
- // Browsers without "deltaMode" is reporting in raw wheel delta where one
30523
- // notch on the scroll is always +/- 120, roughly equivalent to pixels.
30524
- // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or
30525
- // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
30526
- deltaMode: null
30527
- });
30528
-
30529
- /**
30530
- * Turns
30531
- * ['abort', ...]
30532
- * into
30533
- * eventTypes = {
30534
- * 'abort': {
30535
- * phasedRegistrationNames: {
30536
- * bubbled: 'onAbort',
30537
- * captured: 'onAbortCapture',
30538
- * },
30539
- * dependencies: [TOP_ABORT],
30540
- * },
30541
- * ...
30542
- * };
30543
- * topLevelEventsToDispatchConfig = new Map([
30544
- * [TOP_ABORT, { sameConfig }],
30545
- * ]);
30546
- */
30547
-
30548
- var eventTuples = [// Discrete events
30549
- [TOP_BLUR, 'blur', DiscreteEvent], [TOP_CANCEL, 'cancel', DiscreteEvent], [TOP_CLICK, 'click', DiscreteEvent], [TOP_CLOSE, 'close', DiscreteEvent], [TOP_CONTEXT_MENU, 'contextMenu', DiscreteEvent], [TOP_COPY, 'copy', DiscreteEvent], [TOP_CUT, 'cut', DiscreteEvent], [TOP_AUX_CLICK, 'auxClick', DiscreteEvent], [TOP_DOUBLE_CLICK, 'doubleClick', DiscreteEvent], [TOP_DRAG_END, 'dragEnd', DiscreteEvent], [TOP_DRAG_START, 'dragStart', DiscreteEvent], [TOP_DROP, 'drop', DiscreteEvent], [TOP_FOCUS, 'focus', DiscreteEvent], [TOP_INPUT, 'input', DiscreteEvent], [TOP_INVALID, 'invalid', DiscreteEvent], [TOP_KEY_DOWN, 'keyDown', DiscreteEvent], [TOP_KEY_PRESS, 'keyPress', DiscreteEvent], [TOP_KEY_UP, 'keyUp', DiscreteEvent], [TOP_MOUSE_DOWN, 'mouseDown', DiscreteEvent], [TOP_MOUSE_UP, 'mouseUp', DiscreteEvent], [TOP_PASTE, 'paste', DiscreteEvent], [TOP_PAUSE, 'pause', DiscreteEvent], [TOP_PLAY, 'play', DiscreteEvent], [TOP_POINTER_CANCEL, 'pointerCancel', DiscreteEvent], [TOP_POINTER_DOWN, 'pointerDown', DiscreteEvent], [TOP_POINTER_UP, 'pointerUp', DiscreteEvent], [TOP_RATE_CHANGE, 'rateChange', DiscreteEvent], [TOP_RESET, 'reset', DiscreteEvent], [TOP_SEEKED, 'seeked', DiscreteEvent], [TOP_SUBMIT, 'submit', DiscreteEvent], [TOP_TOUCH_CANCEL, 'touchCancel', DiscreteEvent], [TOP_TOUCH_END, 'touchEnd', DiscreteEvent], [TOP_TOUCH_START, 'touchStart', DiscreteEvent], [TOP_VOLUME_CHANGE, 'volumeChange', DiscreteEvent], // User-blocking events
30550
- [TOP_DRAG, 'drag', UserBlockingEvent], [TOP_DRAG_ENTER, 'dragEnter', UserBlockingEvent], [TOP_DRAG_EXIT, 'dragExit', UserBlockingEvent], [TOP_DRAG_LEAVE, 'dragLeave', UserBlockingEvent], [TOP_DRAG_OVER, 'dragOver', UserBlockingEvent], [TOP_MOUSE_MOVE, 'mouseMove', UserBlockingEvent], [TOP_MOUSE_OUT, 'mouseOut', UserBlockingEvent], [TOP_MOUSE_OVER, 'mouseOver', UserBlockingEvent], [TOP_POINTER_MOVE, 'pointerMove', UserBlockingEvent], [TOP_POINTER_OUT, 'pointerOut', UserBlockingEvent], [TOP_POINTER_OVER, 'pointerOver', UserBlockingEvent], [TOP_SCROLL, 'scroll', UserBlockingEvent], [TOP_TOGGLE, 'toggle', UserBlockingEvent], [TOP_TOUCH_MOVE, 'touchMove', UserBlockingEvent], [TOP_WHEEL, 'wheel', UserBlockingEvent], // Continuous events
30551
- [TOP_ABORT, 'abort', ContinuousEvent], [TOP_ANIMATION_END, 'animationEnd', ContinuousEvent], [TOP_ANIMATION_ITERATION, 'animationIteration', ContinuousEvent], [TOP_ANIMATION_START, 'animationStart', ContinuousEvent], [TOP_CAN_PLAY, 'canPlay', ContinuousEvent], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough', ContinuousEvent], [TOP_DURATION_CHANGE, 'durationChange', ContinuousEvent], [TOP_EMPTIED, 'emptied', ContinuousEvent], [TOP_ENCRYPTED, 'encrypted', ContinuousEvent], [TOP_ENDED, 'ended', ContinuousEvent], [TOP_ERROR, 'error', ContinuousEvent], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', ContinuousEvent], [TOP_LOAD, 'load', ContinuousEvent], [TOP_LOADED_DATA, 'loadedData', ContinuousEvent], [TOP_LOADED_METADATA, 'loadedMetadata', ContinuousEvent], [TOP_LOAD_START, 'loadStart', ContinuousEvent], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', ContinuousEvent], [TOP_PLAYING, 'playing', ContinuousEvent], [TOP_PROGRESS, 'progress', ContinuousEvent], [TOP_SEEKING, 'seeking', ContinuousEvent], [TOP_STALLED, 'stalled', ContinuousEvent], [TOP_SUSPEND, 'suspend', ContinuousEvent], [TOP_TIME_UPDATE, 'timeUpdate', ContinuousEvent], [TOP_TRANSITION_END, 'transitionEnd', ContinuousEvent], [TOP_WAITING, 'waiting', ContinuousEvent]];
30552
- var eventTypes = {};
30553
- var topLevelEventsToDispatchConfig = {};
30554
-
30555
- for (var i = 0; i < eventTuples.length; i++) {
30556
- var eventTuple = eventTuples[i];
30557
- var topEvent = eventTuple[0];
30558
- var event = eventTuple[1];
30559
- var eventPriority = eventTuple[2];
30560
- var capitalizedEvent = event[0].toUpperCase() + event.slice(1);
30561
- var onEvent = 'on' + capitalizedEvent;
30562
- var config = {
30563
- phasedRegistrationNames: {
30564
- bubbled: onEvent,
30565
- captured: onEvent + 'Capture'
30566
- },
30567
- dependencies: [topEvent],
30568
- eventPriority: eventPriority
30569
- };
30570
- eventTypes[event] = config;
30571
- topLevelEventsToDispatchConfig[topEvent] = config;
30572
- } // Only used in DEV for exhaustiveness validation.
30573
-
30574
-
30575
- var knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];
30576
- var SimpleEventPlugin = {
30577
- eventTypes: eventTypes,
30578
- getEventPriority: function (topLevelType) {
30579
- var config = topLevelEventsToDispatchConfig[topLevelType];
30580
- return config !== undefined ? config.eventPriority : ContinuousEvent;
30581
- },
30582
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
30583
- var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
30584
-
30585
- if (!dispatchConfig) {
30586
- return null;
30587
- }
30588
-
30589
- var EventConstructor;
30590
-
30591
- switch (topLevelType) {
30592
- case TOP_KEY_PRESS:
30593
- // Firefox creates a keypress event for function keys too. This removes
30594
- // the unwanted keypress events. Enter is however both printable and
30595
- // non-printable. One would expect Tab to be as well (but it isn't).
30596
- if (getEventCharCode(nativeEvent) === 0) {
30597
- return null;
30598
- }
30599
-
30600
- /* falls through */
30601
-
30602
- case TOP_KEY_DOWN:
30603
- case TOP_KEY_UP:
30604
- EventConstructor = SyntheticKeyboardEvent;
30605
- break;
30606
-
30607
- case TOP_BLUR:
30608
- case TOP_FOCUS:
30609
- EventConstructor = SyntheticFocusEvent;
30610
- break;
30611
-
30612
- case TOP_CLICK:
30613
- // Firefox creates a click event on right mouse clicks. This removes the
30614
- // unwanted click events.
30615
- if (nativeEvent.button === 2) {
30616
- return null;
30617
- }
30618
-
30619
- /* falls through */
30620
-
30621
- case TOP_AUX_CLICK:
30622
- case TOP_DOUBLE_CLICK:
30623
- case TOP_MOUSE_DOWN:
30624
- case TOP_MOUSE_MOVE:
30625
- case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events
30626
-
30627
- /* falls through */
30628
-
30629
- case TOP_MOUSE_OUT:
30630
- case TOP_MOUSE_OVER:
30631
- case TOP_CONTEXT_MENU:
30632
- EventConstructor = SyntheticMouseEvent;
30633
- break;
30634
-
30635
- case TOP_DRAG:
30636
- case TOP_DRAG_END:
30637
- case TOP_DRAG_ENTER:
30638
- case TOP_DRAG_EXIT:
30639
- case TOP_DRAG_LEAVE:
30640
- case TOP_DRAG_OVER:
30641
- case TOP_DRAG_START:
30642
- case TOP_DROP:
30643
- EventConstructor = SyntheticDragEvent;
30644
- break;
30645
-
30646
- case TOP_TOUCH_CANCEL:
30647
- case TOP_TOUCH_END:
30648
- case TOP_TOUCH_MOVE:
30649
- case TOP_TOUCH_START:
30650
- EventConstructor = SyntheticTouchEvent;
30651
- break;
30652
-
30653
- case TOP_ANIMATION_END:
30654
- case TOP_ANIMATION_ITERATION:
30655
- case TOP_ANIMATION_START:
30656
- EventConstructor = SyntheticAnimationEvent;
30657
- break;
30658
-
30659
- case TOP_TRANSITION_END:
30660
- EventConstructor = SyntheticTransitionEvent;
30661
- break;
30662
-
30663
- case TOP_SCROLL:
30664
- EventConstructor = SyntheticUIEvent;
30665
- break;
30666
-
30667
- case TOP_WHEEL:
30668
- EventConstructor = SyntheticWheelEvent;
30669
- break;
30670
-
30671
- case TOP_COPY:
30672
- case TOP_CUT:
30673
- case TOP_PASTE:
30674
- EventConstructor = SyntheticClipboardEvent;
30675
- break;
30676
-
30677
- case TOP_GOT_POINTER_CAPTURE:
30678
- case TOP_LOST_POINTER_CAPTURE:
30679
- case TOP_POINTER_CANCEL:
30680
- case TOP_POINTER_DOWN:
30681
- case TOP_POINTER_MOVE:
30682
- case TOP_POINTER_OUT:
30683
- case TOP_POINTER_OVER:
30684
- case TOP_POINTER_UP:
30685
- EventConstructor = SyntheticPointerEvent;
30686
- break;
30687
-
30688
- default:
30689
- {
30690
- if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
30691
- warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);
30692
- }
30693
- } // HTML Events
30694
- // @see http://www.w3.org/TR/html5/index.html#events-0
30695
-
30696
-
30697
- EventConstructor = SyntheticEvent;
30698
- break;
30699
- }
30700
-
30701
- var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);
30702
- accumulateTwoPhaseDispatches(event);
30703
- return event;
30704
- }
30705
- };
30706
-
30707
- var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners
30708
- // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
30709
-
30710
- if (enableFlareAPI && canUseDOM) {
30711
- try {
30712
- var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value
30713
-
30714
- Object.defineProperty(options, 'passive', {
30715
- get: function () {
30716
- passiveBrowserEventsSupported = true;
30717
- }
30718
- });
30719
- window.addEventListener('test', options, options);
30720
- window.removeEventListener('test', options, options);
30721
- } catch (e) {
30722
- passiveBrowserEventsSupported = false;
30723
- }
30724
- }
30725
-
30726
- // Intentionally not named imports because Rollup would use dynamic dispatch for
30727
- // CommonJS interop named imports.
30728
- var UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority;
30729
- var runWithPriority$1 = Scheduler.unstable_runWithPriority;
30730
- var getEventPriority = SimpleEventPlugin.getEventPriority;
30731
- var CALLBACK_BOOKKEEPING_POOL_SIZE = 10;
30732
- var callbackBookkeepingPool = [];
30733
-
30734
- /**
30735
- * Find the deepest React component completely containing the root of the
30736
- * passed-in instance (for use when entire React trees are nested within each
30737
- * other). If React trees are not nested, returns null.
30738
- */
30739
- function findRootContainerNode(inst) {
30740
- if (inst.tag === HostRoot) {
30741
- return inst.stateNode.containerInfo;
30742
- } // TODO: It may be a good idea to cache this to prevent unnecessary DOM
30743
- // traversal, but caching is difficult to do correctly without using a
30744
- // mutation observer to listen for all DOM changes.
30745
-
30746
-
30747
- while (inst.return) {
30748
- inst = inst.return;
30749
- }
30750
-
30751
- if (inst.tag !== HostRoot) {
30752
- // This can happen if we're in a detached tree.
30753
- return null;
30754
- }
30755
-
30756
- return inst.stateNode.containerInfo;
30757
- } // Used to store ancestor hierarchy in top level callback
30758
-
30759
-
30760
- function getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {
30761
- if (callbackBookkeepingPool.length) {
30762
- var instance = callbackBookkeepingPool.pop();
30763
- instance.topLevelType = topLevelType;
30764
- instance.eventSystemFlags = eventSystemFlags;
30765
- instance.nativeEvent = nativeEvent;
30766
- instance.targetInst = targetInst;
30767
- return instance;
30768
- }
30769
-
30770
- return {
30771
- topLevelType: topLevelType,
30772
- eventSystemFlags: eventSystemFlags,
30773
- nativeEvent: nativeEvent,
30774
- targetInst: targetInst,
30775
- ancestors: []
30776
- };
30777
- }
30778
-
30779
- function releaseTopLevelCallbackBookKeeping(instance) {
30780
- instance.topLevelType = null;
30781
- instance.nativeEvent = null;
30782
- instance.targetInst = null;
30783
- instance.ancestors.length = 0;
30784
-
30785
- if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {
30786
- callbackBookkeepingPool.push(instance);
30787
- }
30788
- }
30789
-
30790
- function handleTopLevel(bookKeeping) {
30791
- var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.
30792
- // It's important that we build the array of ancestors before calling any
30793
- // event handlers, because event handlers can modify the DOM, leading to
30794
- // inconsistencies with ReactMount's node cache. See #1105.
30795
-
30796
- var ancestor = targetInst;
30797
-
30798
- do {
30799
- if (!ancestor) {
30800
- var ancestors = bookKeeping.ancestors;
30801
- ancestors.push(ancestor);
30802
- break;
30803
- }
30804
-
30805
- var root = findRootContainerNode(ancestor);
30806
-
30807
- if (!root) {
30808
- break;
30809
- }
30810
-
30811
- var tag = ancestor.tag;
30812
-
30813
- if (tag === HostComponent || tag === HostText) {
30814
- bookKeeping.ancestors.push(ancestor);
30815
- }
30816
-
30817
- ancestor = getClosestInstanceFromNode(root);
30818
- } while (ancestor);
30819
-
30820
- for (var i = 0; i < bookKeeping.ancestors.length; i++) {
30821
- targetInst = bookKeeping.ancestors[i];
30822
- var eventTarget = getEventTarget(bookKeeping.nativeEvent);
30823
- var topLevelType = bookKeeping.topLevelType;
30824
- var nativeEvent = bookKeeping.nativeEvent;
30825
- runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, bookKeeping.eventSystemFlags);
30826
- }
30827
- } // TODO: can we stop exporting these?
30828
-
30829
-
30830
- var _enabled = true;
30831
- function setEnabled(enabled) {
30832
- _enabled = !!enabled;
30833
- }
30834
- function isEnabled() {
30835
- return _enabled;
30836
- }
30837
- function trapBubbledEvent(topLevelType, element) {
30838
- trapEventForPluginEventSystem(element, topLevelType, false);
30839
- }
30840
- function trapCapturedEvent(topLevelType, element) {
30841
- trapEventForPluginEventSystem(element, topLevelType, true);
30842
- }
30843
- function trapEventForResponderEventSystem(element, topLevelType, passive) {
30844
- if (enableFlareAPI) {
30845
- var rawEventName = getRawEventName(topLevelType);
30846
- var eventFlags = RESPONDER_EVENT_SYSTEM; // If passive option is not supported, then the event will be
30847
- // active and not passive, but we flag it as using not being
30848
- // supported too. This way the responder event plugins know,
30849
- // and can provide polyfills if needed.
30850
-
30851
- if (passive) {
30852
- if (passiveBrowserEventsSupported) {
30853
- eventFlags |= IS_PASSIVE;
30854
- } else {
30855
- eventFlags |= IS_ACTIVE;
30856
- eventFlags |= PASSIVE_NOT_SUPPORTED;
30857
- passive = false;
30858
- }
30859
- } else {
30860
- eventFlags |= IS_ACTIVE;
30861
- } // Check if interactive and wrap in discreteUpdates
30862
-
30863
-
30864
- var listener = dispatchEvent.bind(null, topLevelType, eventFlags);
30865
-
30866
- if (passiveBrowserEventsSupported) {
30867
- addEventCaptureListenerWithPassiveFlag(element, rawEventName, listener, passive);
30868
- } else {
30869
- addEventCaptureListener(element, rawEventName, listener);
30870
- }
30871
- }
30872
- }
30873
-
30874
- function trapEventForPluginEventSystem(element, topLevelType, capture) {
30875
- var listener;
30876
-
30877
- switch (getEventPriority(topLevelType)) {
30878
- case DiscreteEvent:
30879
- listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
30880
- break;
30881
-
30882
- case UserBlockingEvent:
30883
- listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
30884
- break;
30885
-
30886
- case ContinuousEvent:
30887
- default:
30888
- listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);
30889
- break;
30890
- }
30891
-
30892
- var rawEventName = getRawEventName(topLevelType);
30893
-
30894
- if (capture) {
30895
- addEventCaptureListener(element, rawEventName, listener);
30896
- } else {
30897
- addEventBubbleListener(element, rawEventName, listener);
30898
- }
30899
- }
30900
-
30901
- function dispatchDiscreteEvent(topLevelType, eventSystemFlags, nativeEvent) {
30902
- flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);
30903
- discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, nativeEvent);
30904
- }
30905
-
30906
- function dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, nativeEvent) {
30907
- runWithPriority$1(UserBlockingPriority$1, dispatchEvent.bind(null, topLevelType, eventSystemFlags, nativeEvent));
30908
- }
30909
-
30910
- function dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {
30911
- var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);
30912
-
30913
- try {
30914
- // Event queue being processed in the same cycle allows
30915
- // `preventDefault`.
30916
- batchedEventUpdates(handleTopLevel, bookKeeping);
30917
- } finally {
30918
- releaseTopLevelCallbackBookKeeping(bookKeeping);
30919
- }
30920
- }
30921
-
30922
- function dispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {
30923
- if (!_enabled) {
30924
- return;
30925
- }
30926
-
30927
- if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {
30928
- // If we already have a queue of discrete events, and this is another discrete
30929
- // event, then we can't dispatch it regardless of its target, since they
30930
- // need to dispatch in order.
30931
- queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.
30932
- topLevelType, eventSystemFlags, nativeEvent);
30933
- return;
30934
- }
30935
-
30936
- var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent);
30937
-
30938
- if (blockedOn === null) {
30939
- // We successfully dispatched this event.
30940
- clearIfContinuousEvent(topLevelType, nativeEvent);
30941
- return;
30942
- }
30943
-
30944
- if (isReplayableDiscreteEvent(topLevelType)) {
30945
- // This this to be replayed later once the target is available.
30946
- queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);
30947
- return;
30948
- }
30949
-
30950
- if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent)) {
30951
- return;
30952
- } // We need to clear only if we didn't queue because
30953
- // queueing is accummulative.
30954
-
30955
-
30956
- clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,
30957
- // in case the event system needs to trace it.
30958
-
30959
- if (enableFlareAPI) {
30960
- if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {
30961
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
30962
- }
30963
-
30964
- if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {
30965
- // React Flare event system
30966
- dispatchEventForResponderEventSystem(topLevelType, null, nativeEvent, getEventTarget(nativeEvent), eventSystemFlags);
30967
- }
30968
- } else {
30969
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);
30970
- }
30971
- } // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.
30972
-
30973
- function attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {
30974
- // TODO: Warn if _enabled is false.
30975
- var nativeEventTarget = getEventTarget(nativeEvent);
30976
- var targetInst = getClosestInstanceFromNode(nativeEventTarget);
30977
-
30978
- if (targetInst !== null) {
30979
- var nearestMounted = getNearestMountedFiber(targetInst);
30980
-
30981
- if (nearestMounted === null) {
30982
- // This tree has been unmounted already. Dispatch without a target.
30983
- targetInst = null;
30984
- } else {
30985
- var tag = nearestMounted.tag;
30986
-
30987
- if (tag === SuspenseComponent) {
30988
- var instance = getSuspenseInstanceFromFiber(nearestMounted);
30989
-
30990
- if (instance !== null) {
30991
- // Queue the event to be replayed later. Abort dispatching since we
30992
- // don't want this event dispatched twice through the event system.
30993
- // TODO: If this is the first discrete event in the queue. Schedule an increased
30994
- // priority for this boundary.
30995
- return instance;
30996
- } // This shouldn't happen, something went wrong but to avoid blocking
30997
- // the whole system, dispatch the event without a target.
30998
- // TODO: Warn.
30999
-
31000
-
31001
- targetInst = null;
31002
- } else if (tag === HostRoot) {
31003
- var root = nearestMounted.stateNode;
31004
-
31005
- if (root.hydrate) {
31006
- // If this happens during a replay something went wrong and it might block
31007
- // the whole system.
31008
- return getContainerFromFiber(nearestMounted);
31009
- }
31010
-
31011
- targetInst = null;
31012
- } else if (nearestMounted !== targetInst) {
31013
- // If we get an event (ex: img onload) before committing that
31014
- // component's mount, ignore it for now (that is, treat it as if it was an
31015
- // event on a non-React tree). We might also consider queueing events and
31016
- // dispatching them after the mount.
31017
- targetInst = null;
31018
- }
31019
- }
31020
- }
31021
-
31022
- if (enableFlareAPI) {
31023
- if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {
31024
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
31025
- }
31026
-
31027
- if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {
31028
- // React Flare event system
31029
- dispatchEventForResponderEventSystem(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);
31030
- }
31031
- } else {
31032
- dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);
31033
- } // We're not blocked on anything.
31034
-
31035
-
31036
- return null;
31037
- }
31038
-
31039
- /**
31040
- * Checks if an event is supported in the current execution environment.
31041
- *
31042
- * NOTE: This will not work correctly for non-generic events such as `change`,
31043
- * `reset`, `load`, `error`, and `select`.
31044
- *
31045
- * Borrows from Modernizr.
31046
- *
31047
- * @param {string} eventNameSuffix Event name, e.g. "click".
31048
- * @return {boolean} True if the event is supported.
31049
- * @internal
31050
- * @license Modernizr 3.0.0pre (Custom Build) | MIT
31051
- */
31052
-
31053
- function isEventSupported(eventNameSuffix) {
31054
- if (!canUseDOM) {
31055
- return false;
31056
- }
31057
-
31058
- var eventName = 'on' + eventNameSuffix;
31059
- var isSupported = eventName in document;
31060
-
31061
- if (!isSupported) {
31062
- var element = document.createElement('div');
31063
- element.setAttribute(eventName, 'return;');
31064
- isSupported = typeof element[eventName] === 'function';
31065
- }
31066
-
31067
- return isSupported;
31068
- }
31069
-
31070
- /**
31071
- * Summary of `ReactBrowserEventEmitter` event handling:
31072
- *
31073
- * - Top-level delegation is used to trap most native browser events. This
31074
- * may only occur in the main thread and is the responsibility of
31075
- * ReactDOMEventListener, which is injected and can therefore support
31076
- * pluggable event sources. This is the only work that occurs in the main
31077
- * thread.
31078
- *
31079
- * - We normalize and de-duplicate events to account for browser quirks. This
31080
- * may be done in the worker thread.
31081
- *
31082
- * - Forward these native events (with the associated top-level type used to
31083
- * trap it) to `EventPluginHub`, which in turn will ask plugins if they want
31084
- * to extract any synthetic events.
31085
- *
31086
- * - The `EventPluginHub` will then process each event by annotating them with
31087
- * "dispatches", a sequence of listeners and IDs that care about that event.
31088
- *
31089
- * - The `EventPluginHub` then dispatches the events.
31090
- *
31091
- * Overview of React and the event system:
31092
- *
31093
- * +------------+ .
31094
- * | DOM | .
31095
- * +------------+ .
31096
- * | .
31097
- * v .
31098
- * +------------+ .
31099
- * | ReactEvent | .
31100
- * | Listener | .
31101
- * +------------+ . +-----------+
31102
- * | . +--------+|SimpleEvent|
31103
- * | . | |Plugin |
31104
- * +-----|------+ . v +-----------+
31105
- * | | | . +--------------+ +------------+
31106
- * | +-----------.--->|EventPluginHub| | Event |
31107
- * | | . | | +-----------+ | Propagators|
31108
- * | ReactEvent | . | | |TapEvent | |------------|
31109
- * | Emitter | . | |<---+|Plugin | |other plugin|
31110
- * | | . | | +-----------+ | utilities |
31111
- * | +-----------.--->| | +------------+
31112
- * | | | . +--------------+
31113
- * +-----|------+ . ^ +-----------+
31114
- * | . | |Enter/Leave|
31115
- * + . +-------+|Plugin |
31116
- * +-------------+ . +-----------+
31117
- * | application | .
31118
- * |-------------| .
31119
- * | | .
31120
- * | | .
31121
- * +-------------+ .
31122
- * .
31123
- * React Core . General Purpose Event Plugin System
31124
- */
31125
-
31126
- var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
31127
- var elementListeningSets = new PossiblyWeakMap();
31128
- function getListeningSetForElement(element) {
31129
- var listeningSet = elementListeningSets.get(element);
31130
-
31131
- if (listeningSet === undefined) {
31132
- listeningSet = new Set();
31133
- elementListeningSets.set(element, listeningSet);
31134
- }
31135
-
31136
- return listeningSet;
31137
- }
31138
- /**
31139
- * We listen for bubbled touch events on the document object.
31140
- *
31141
- * Firefox v8.01 (and possibly others) exhibited strange behavior when
31142
- * mounting `onmousemove` events at some node that was not the document
31143
- * element. The symptoms were that if your mouse is not moving over something
31144
- * contained within that mount point (for example on the background) the
31145
- * top-level listeners for `onmousemove` won't be called. However, if you
31146
- * register the `mousemove` on the document object, then it will of course
31147
- * catch all `mousemove`s. This along with iOS quirks, justifies restricting
31148
- * top-level listeners to the document object only, at least for these
31149
- * movement types of events and possibly all events.
31150
- *
31151
- * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
31152
- *
31153
- * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but
31154
- * they bubble to document.
31155
- *
31156
- * @param {string} registrationName Name of listener (e.g. `onClick`).
31157
- * @param {object} mountAt Container where to mount the listener
31158
- */
31159
-
31160
- function listenTo(registrationName, mountAt) {
31161
- var listeningSet = getListeningSetForElement(mountAt);
31162
- var dependencies = registrationNameDependencies[registrationName];
31163
-
31164
- for (var i = 0; i < dependencies.length; i++) {
31165
- var dependency = dependencies[i];
31166
- listenToTopLevel(dependency, mountAt, listeningSet);
31167
- }
31168
- }
31169
- function listenToTopLevel(topLevelType, mountAt, listeningSet) {
31170
- if (!listeningSet.has(topLevelType)) {
31171
- switch (topLevelType) {
31172
- case TOP_SCROLL:
31173
- trapCapturedEvent(TOP_SCROLL, mountAt);
31174
- break;
31175
-
31176
- case TOP_FOCUS:
31177
- case TOP_BLUR:
31178
- trapCapturedEvent(TOP_FOCUS, mountAt);
31179
- trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,
31180
- // but this ensures we mark both as attached rather than just one.
31181
-
31182
- listeningSet.add(TOP_BLUR);
31183
- listeningSet.add(TOP_FOCUS);
31184
- break;
31185
-
31186
- case TOP_CANCEL:
31187
- case TOP_CLOSE:
31188
- if (isEventSupported(getRawEventName(topLevelType))) {
31189
- trapCapturedEvent(topLevelType, mountAt);
31190
- }
31191
-
31192
- break;
31193
-
31194
- case TOP_INVALID:
31195
- case TOP_SUBMIT:
31196
- case TOP_RESET:
31197
- // We listen to them on the target DOM elements.
31198
- // Some of them bubble so we don't want them to fire twice.
31199
- break;
31200
-
31201
- default:
31202
- // By default, listen on the top level to all non-media events.
31203
- // Media events don't bubble so adding the listener wouldn't do anything.
31204
- var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;
31205
-
31206
- if (!isMediaEvent) {
31207
- trapBubbledEvent(topLevelType, mountAt);
31208
- }
31209
-
31210
- break;
31211
- }
31212
-
31213
- listeningSet.add(topLevelType);
31214
- }
31215
- }
31216
- function isListeningToAllDependencies(registrationName, mountAt) {
31217
- var listeningSet = getListeningSetForElement(mountAt);
31218
- var dependencies = registrationNameDependencies[registrationName];
31219
-
31220
- for (var i = 0; i < dependencies.length; i++) {
31221
- var dependency = dependencies[i];
31222
-
31223
- if (!listeningSet.has(dependency)) {
31224
- return false;
31225
- }
31226
- }
31227
-
31228
- return true;
31229
- }
31230
-
31231
- // List derived from Gecko source code:
31232
- // https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js
31233
- var shorthandToLonghand = {
31234
- animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],
31235
- background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],
31236
- backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],
31237
- border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],
31238
- borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],
31239
- borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],
31240
- borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],
31241
- borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],
31242
- borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],
31243
- borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],
31244
- borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],
31245
- borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],
31246
- borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],
31247
- borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],
31248
- borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],
31249
- borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],
31250
- borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],
31251
- columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],
31252
- columns: ['columnCount', 'columnWidth'],
31253
- flex: ['flexBasis', 'flexGrow', 'flexShrink'],
31254
- flexFlow: ['flexDirection', 'flexWrap'],
31255
- font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],
31256
- fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],
31257
- gap: ['columnGap', 'rowGap'],
31258
- grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
31259
- gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],
31260
- gridColumn: ['gridColumnEnd', 'gridColumnStart'],
31261
- gridColumnGap: ['columnGap'],
31262
- gridGap: ['columnGap', 'rowGap'],
31263
- gridRow: ['gridRowEnd', 'gridRowStart'],
31264
- gridRowGap: ['rowGap'],
31265
- gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],
31266
- listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],
31267
- margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],
31268
- marker: ['markerEnd', 'markerMid', 'markerStart'],
31269
- mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],
31270
- maskPosition: ['maskPositionX', 'maskPositionY'],
31271
- outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],
31272
- overflow: ['overflowX', 'overflowY'],
31273
- padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],
31274
- placeContent: ['alignContent', 'justifyContent'],
31275
- placeItems: ['alignItems', 'justifyItems'],
31276
- placeSelf: ['alignSelf', 'justifySelf'],
31277
- textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],
31278
- textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],
31279
- transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],
31280
- wordWrap: ['overflowWrap']
31281
- };
31282
-
31283
- /**
31284
- * CSS properties which accept numbers but are not in units of "px".
31285
- */
31286
- var isUnitlessNumber = {
31287
- animationIterationCount: true,
31288
- borderImageOutset: true,
31289
- borderImageSlice: true,
31290
- borderImageWidth: true,
31291
- boxFlex: true,
31292
- boxFlexGroup: true,
31293
- boxOrdinalGroup: true,
31294
- columnCount: true,
31295
- columns: true,
31296
- flex: true,
31297
- flexGrow: true,
31298
- flexPositive: true,
31299
- flexShrink: true,
31300
- flexNegative: true,
31301
- flexOrder: true,
31302
- gridArea: true,
31303
- gridRow: true,
31304
- gridRowEnd: true,
31305
- gridRowSpan: true,
31306
- gridRowStart: true,
31307
- gridColumn: true,
31308
- gridColumnEnd: true,
31309
- gridColumnSpan: true,
31310
- gridColumnStart: true,
31311
- fontWeight: true,
31312
- lineClamp: true,
31313
- lineHeight: true,
31314
- opacity: true,
31315
- order: true,
31316
- orphans: true,
31317
- tabSize: true,
31318
- widows: true,
31319
- zIndex: true,
31320
- zoom: true,
31321
- // SVG-related properties
31322
- fillOpacity: true,
31323
- floodOpacity: true,
31324
- stopOpacity: true,
31325
- strokeDasharray: true,
31326
- strokeDashoffset: true,
31327
- strokeMiterlimit: true,
31328
- strokeOpacity: true,
31329
- strokeWidth: true
31330
- };
31331
- /**
31332
- * @param {string} prefix vendor-specific prefix, eg: Webkit
31333
- * @param {string} key style name, eg: transitionDuration
31334
- * @return {string} style name prefixed with `prefix`, properly camelCased, eg:
31335
- * WebkitTransitionDuration
31336
- */
31337
-
31338
- function prefixKey(prefix, key) {
31339
- return prefix + key.charAt(0).toUpperCase() + key.substring(1);
31340
- }
31341
- /**
31342
- * Support style names that may come passed in prefixed by adding permutations
31343
- * of vendor prefixes.
31344
- */
31345
-
31346
-
31347
- var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
31348
- // infinite loop, because it iterates over the newly added props too.
31349
-
31350
- Object.keys(isUnitlessNumber).forEach(function (prop) {
31351
- prefixes.forEach(function (prefix) {
31352
- isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
31353
- });
31354
- });
31355
-
31356
- /**
31357
- * Convert a value into the proper css writable value. The style name `name`
31358
- * should be logical (no hyphens), as specified
31359
- * in `CSSProperty.isUnitlessNumber`.
31360
- *
31361
- * @param {string} name CSS property name such as `topMargin`.
31362
- * @param {*} value CSS property value such as `10px`.
31363
- * @return {string} Normalized style value with dimensions applied.
31364
- */
31365
-
31366
- function dangerousStyleValue(name, value, isCustomProperty) {
31367
- // Note that we've removed escapeTextForBrowser() calls here since the
31368
- // whole string will be escaped when the attribute is injected into
31369
- // the markup. If you provide unsafe user data here they can inject
31370
- // arbitrary CSS which may be problematic (I couldn't repro this):
31371
- // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
31372
- // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/
31373
- // This is not an XSS hole but instead a potential CSS injection issue
31374
- // which has lead to a greater discussion about how we're going to
31375
- // trust URLs moving forward. See #2115901
31376
- var isEmpty = value == null || typeof value === 'boolean' || value === '';
31377
-
31378
- if (isEmpty) {
31379
- return '';
31380
- }
31381
-
31382
- if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {
31383
- return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers
31384
- }
31385
-
31386
- return ('' + value).trim();
31387
- }
31388
-
31389
- var uppercasePattern = /([A-Z])/g;
31390
- var msPattern = /^ms-/;
31391
- /**
31392
- * Hyphenates a camelcased CSS property name, for example:
31393
- *
31394
- * > hyphenateStyleName('backgroundColor')
31395
- * < "background-color"
31396
- * > hyphenateStyleName('MozTransition')
31397
- * < "-moz-transition"
31398
- * > hyphenateStyleName('msTransition')
31399
- * < "-ms-transition"
31400
- *
31401
- * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix
31402
- * is converted to `-ms-`.
31403
- */
31404
-
31405
- function hyphenateStyleName(name) {
31406
- return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');
31407
- }
31408
-
31409
- var warnValidStyle = function () {};
31410
-
31411
- {
31412
- // 'msTransform' is correct, but the other prefixes should be capitalized
31413
- var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;
31414
- var msPattern$1 = /^-ms-/;
31415
- var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon
31416
-
31417
- var badStyleValueWithSemicolonPattern = /;\s*$/;
31418
- var warnedStyleNames = {};
31419
- var warnedStyleValues = {};
31420
- var warnedForNaNValue = false;
31421
- var warnedForInfinityValue = false;
31422
-
31423
- var camelize = function (string) {
31424
- return string.replace(hyphenPattern, function (_, character) {
31425
- return character.toUpperCase();
31426
- });
31427
- };
31428
-
31429
- var warnHyphenatedStyleName = function (name) {
31430
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
31431
- return;
31432
- }
31433
-
31434
- warnedStyleNames[name] = true;
31435
- warning$1(false, 'Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests
31436
- // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix
31437
- // is converted to lowercase `ms`.
31438
- camelize(name.replace(msPattern$1, 'ms-')));
31439
- };
31440
-
31441
- var warnBadVendoredStyleName = function (name) {
31442
- if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
31443
- return;
31444
- }
31445
-
31446
- warnedStyleNames[name] = true;
31447
- warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));
31448
- };
31449
-
31450
- var warnStyleValueWithSemicolon = function (name, value) {
31451
- if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
31452
- return;
31453
- }
31454
-
31455
- warnedStyleValues[value] = true;
31456
- warning$1(false, "Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));
31457
- };
31458
-
31459
- var warnStyleValueIsNaN = function (name, value) {
31460
- if (warnedForNaNValue) {
31461
- return;
31462
- }
31463
-
31464
- warnedForNaNValue = true;
31465
- warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);
31466
- };
31467
-
31468
- var warnStyleValueIsInfinity = function (name, value) {
31469
- if (warnedForInfinityValue) {
31470
- return;
31471
- }
31472
-
31473
- warnedForInfinityValue = true;
31474
- warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);
31475
- };
31476
-
31477
- warnValidStyle = function (name, value) {
31478
- if (name.indexOf('-') > -1) {
31479
- warnHyphenatedStyleName(name);
31480
- } else if (badVendoredStyleNamePattern.test(name)) {
31481
- warnBadVendoredStyleName(name);
31482
- } else if (badStyleValueWithSemicolonPattern.test(value)) {
31483
- warnStyleValueWithSemicolon(name, value);
31484
- }
31485
-
31486
- if (typeof value === 'number') {
31487
- if (isNaN(value)) {
31488
- warnStyleValueIsNaN(name, value);
31489
- } else if (!isFinite(value)) {
31490
- warnStyleValueIsInfinity(name, value);
31491
- }
31492
- }
31493
- };
31494
- }
31495
-
31496
- var warnValidStyle$1 = warnValidStyle;
31497
-
31498
- /**
31499
- * Operations for dealing with CSS properties.
31500
- */
31501
-
31502
- /**
31503
- * This creates a string that is expected to be equivalent to the style
31504
- * attribute generated by server-side rendering. It by-passes warnings and
31505
- * security checks so it's not safe to use this value for anything other than
31506
- * comparison. It is only used in DEV for SSR validation.
31507
- */
31508
-
31509
- function createDangerousStringForStyles(styles) {
31510
- {
31511
- var serialized = '';
31512
- var delimiter = '';
31513
-
31514
- for (var styleName in styles) {
31515
- if (!styles.hasOwnProperty(styleName)) {
31516
- continue;
31517
- }
31518
-
31519
- var styleValue = styles[styleName];
31520
-
31521
- if (styleValue != null) {
31522
- var isCustomProperty = styleName.indexOf('--') === 0;
31523
- serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';
31524
- serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);
31525
- delimiter = ';';
31526
- }
31527
- }
31528
-
31529
- return serialized || null;
31530
- }
31531
- }
31532
- /**
31533
- * Sets the value for multiple styles on a node. If a value is specified as
31534
- * '' (empty string), the corresponding style property will be unset.
31535
- *
31536
- * @param {DOMElement} node
31537
- * @param {object} styles
31538
- */
31539
-
31540
- function setValueForStyles(node, styles) {
31541
- var style = node.style;
31542
-
31543
- for (var styleName in styles) {
31544
- if (!styles.hasOwnProperty(styleName)) {
31545
- continue;
31546
- }
31547
-
31548
- var isCustomProperty = styleName.indexOf('--') === 0;
31549
-
31550
- {
31551
- if (!isCustomProperty) {
31552
- warnValidStyle$1(styleName, styles[styleName]);
31553
- }
31554
- }
31555
-
31556
- var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);
31557
-
31558
- if (styleName === 'float') {
31559
- styleName = 'cssFloat';
31560
- }
31561
-
31562
- if (isCustomProperty) {
31563
- style.setProperty(styleName, styleValue);
31564
- } else {
31565
- style[styleName] = styleValue;
31566
- }
31567
- }
31568
- }
31569
-
31570
- function isValueEmpty(value) {
31571
- return value == null || typeof value === 'boolean' || value === '';
31572
- }
31573
- /**
31574
- * Given {color: 'red', overflow: 'hidden'} returns {
31575
- * color: 'color',
31576
- * overflowX: 'overflow',
31577
- * overflowY: 'overflow',
31578
- * }. This can be read as "the overflowY property was set by the overflow
31579
- * shorthand". That is, the values are the property that each was derived from.
31580
- */
31581
-
31582
-
31583
- function expandShorthandMap(styles) {
31584
- var expanded = {};
31585
-
31586
- for (var key in styles) {
31587
- var longhands = shorthandToLonghand[key] || [key];
31588
-
31589
- for (var i = 0; i < longhands.length; i++) {
31590
- expanded[longhands[i]] = key;
31591
- }
31592
- }
31593
-
31594
- return expanded;
31595
- }
31596
- /**
31597
- * When mixing shorthand and longhand property names, we warn during updates if
31598
- * we expect an incorrect result to occur. In particular, we warn for:
31599
- *
31600
- * Updating a shorthand property (longhand gets overwritten):
31601
- * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}
31602
- * becomes .style.font = 'baz'
31603
- * Removing a shorthand property (longhand gets lost too):
31604
- * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}
31605
- * becomes .style.font = ''
31606
- * Removing a longhand property (should revert to shorthand; doesn't):
31607
- * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}
31608
- * becomes .style.fontVariant = ''
31609
- */
31610
-
31611
-
31612
- function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {
31613
- if (!warnAboutShorthandPropertyCollision) {
31614
- return;
31615
- }
31616
-
31617
- if (!nextStyles) {
31618
- return;
31619
- }
31620
-
31621
- var expandedUpdates = expandShorthandMap(styleUpdates);
31622
- var expandedStyles = expandShorthandMap(nextStyles);
31623
- var warnedAbout = {};
31624
-
31625
- for (var key in expandedUpdates) {
31626
- var originalKey = expandedUpdates[key];
31627
- var correctOriginalKey = expandedStyles[key];
31628
-
31629
- if (correctOriginalKey && originalKey !== correctOriginalKey) {
31630
- var warningKey = originalKey + ',' + correctOriginalKey;
31631
-
31632
- if (warnedAbout[warningKey]) {
31633
- continue;
31634
- }
31635
-
31636
- warnedAbout[warningKey] = true;
31637
- warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);
31638
- }
31639
- }
31640
- }
31641
-
31642
- // For HTML, certain tags should omit their close tag. We keep a whitelist for
31643
- // those special-case tags.
31644
- var omittedCloseTags = {
31645
- area: true,
31646
- base: true,
31647
- br: true,
31648
- col: true,
31649
- embed: true,
31650
- hr: true,
31651
- img: true,
31652
- input: true,
31653
- keygen: true,
31654
- link: true,
31655
- meta: true,
31656
- param: true,
31657
- source: true,
31658
- track: true,
31659
- wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.
31660
-
31661
- };
31662
-
31663
- // `omittedCloseTags` except that `menuitem` should still have its closing tag.
31664
-
31665
- var voidElementTags = _assign({
31666
- menuitem: true
31667
- }, omittedCloseTags);
31668
-
31669
- // or add stack by default to invariants where possible.
31670
-
31671
- var HTML$1 = '__html';
31672
- var ReactDebugCurrentFrame$3 = null;
31673
-
31674
- {
31675
- ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;
31676
- }
31677
-
31678
- function assertValidProps(tag, props) {
31679
- if (!props) {
31680
- return;
31681
- } // Note the use of `==` which checks for null or undefined.
31682
-
31683
-
31684
- if (voidElementTags[tag]) {
31685
- if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {
31686
- {
31687
- throw Error(tag + " is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`." + (ReactDebugCurrentFrame$3.getStackAddendum()));
31688
- }
31689
- }
31690
- }
31691
-
31692
- if (props.dangerouslySetInnerHTML != null) {
31693
- if (!(props.children == null)) {
31694
- {
31695
- throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");
31696
- }
31697
- }
31698
-
31699
- if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML)) {
31700
- {
31701
- throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.");
31702
- }
31703
- }
31704
- }
31705
-
31706
- {
31707
- !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;
31708
- }
31709
-
31710
- if (!(props.style == null || typeof props.style === 'object')) {
31711
- {
31712
- throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." + (ReactDebugCurrentFrame$3.getStackAddendum()));
31713
- }
31714
- }
31715
- }
31716
-
31717
- function isCustomComponent(tagName, props) {
31718
- if (tagName.indexOf('-') === -1) {
31719
- return typeof props.is === 'string';
31720
- }
31721
-
31722
- switch (tagName) {
31723
- // These are reserved SVG and MathML elements.
31724
- // We don't mind this whitelist too much because we expect it to never grow.
31725
- // The alternative is to track the namespace in a few places which is convoluted.
31726
- // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts
31727
- case 'annotation-xml':
31728
- case 'color-profile':
31729
- case 'font-face':
31730
- case 'font-face-src':
31731
- case 'font-face-uri':
31732
- case 'font-face-format':
31733
- case 'font-face-name':
31734
- case 'missing-glyph':
31735
- return false;
31736
-
31737
- default:
31738
- return true;
31739
- }
31740
- }
31741
-
31742
- // When adding attributes to the HTML or SVG whitelist, be sure to
31743
- // also add them to this module to ensure casing and incorrect name
31744
- // warnings.
31745
- var possibleStandardNames = {
31746
- // HTML
31747
- accept: 'accept',
31748
- acceptcharset: 'acceptCharset',
31749
- 'accept-charset': 'acceptCharset',
31750
- accesskey: 'accessKey',
31751
- action: 'action',
31752
- allowfullscreen: 'allowFullScreen',
31753
- alt: 'alt',
31754
- as: 'as',
31755
- async: 'async',
31756
- autocapitalize: 'autoCapitalize',
31757
- autocomplete: 'autoComplete',
31758
- autocorrect: 'autoCorrect',
31759
- autofocus: 'autoFocus',
31760
- autoplay: 'autoPlay',
31761
- autosave: 'autoSave',
31762
- capture: 'capture',
31763
- cellpadding: 'cellPadding',
31764
- cellspacing: 'cellSpacing',
31765
- challenge: 'challenge',
31766
- charset: 'charSet',
31767
- checked: 'checked',
31768
- children: 'children',
31769
- cite: 'cite',
31770
- class: 'className',
31771
- classid: 'classID',
31772
- classname: 'className',
31773
- cols: 'cols',
31774
- colspan: 'colSpan',
31775
- content: 'content',
31776
- contenteditable: 'contentEditable',
31777
- contextmenu: 'contextMenu',
31778
- controls: 'controls',
31779
- controlslist: 'controlsList',
31780
- coords: 'coords',
31781
- crossorigin: 'crossOrigin',
31782
- dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',
31783
- data: 'data',
31784
- datetime: 'dateTime',
31785
- default: 'default',
31786
- defaultchecked: 'defaultChecked',
31787
- defaultvalue: 'defaultValue',
31788
- defer: 'defer',
31789
- dir: 'dir',
31790
- disabled: 'disabled',
31791
- disablepictureinpicture: 'disablePictureInPicture',
31792
- download: 'download',
31793
- draggable: 'draggable',
31794
- enctype: 'encType',
31795
- for: 'htmlFor',
31796
- form: 'form',
31797
- formmethod: 'formMethod',
31798
- formaction: 'formAction',
31799
- formenctype: 'formEncType',
31800
- formnovalidate: 'formNoValidate',
31801
- formtarget: 'formTarget',
31802
- frameborder: 'frameBorder',
31803
- headers: 'headers',
31804
- height: 'height',
31805
- hidden: 'hidden',
31806
- high: 'high',
31807
- href: 'href',
31808
- hreflang: 'hrefLang',
31809
- htmlfor: 'htmlFor',
31810
- httpequiv: 'httpEquiv',
31811
- 'http-equiv': 'httpEquiv',
31812
- icon: 'icon',
31813
- id: 'id',
31814
- innerhtml: 'innerHTML',
31815
- inputmode: 'inputMode',
31816
- integrity: 'integrity',
31817
- is: 'is',
31818
- itemid: 'itemID',
31819
- itemprop: 'itemProp',
31820
- itemref: 'itemRef',
31821
- itemscope: 'itemScope',
31822
- itemtype: 'itemType',
31823
- keyparams: 'keyParams',
31824
- keytype: 'keyType',
31825
- kind: 'kind',
31826
- label: 'label',
31827
- lang: 'lang',
31828
- list: 'list',
31829
- loop: 'loop',
31830
- low: 'low',
31831
- manifest: 'manifest',
31832
- marginwidth: 'marginWidth',
31833
- marginheight: 'marginHeight',
31834
- max: 'max',
31835
- maxlength: 'maxLength',
31836
- media: 'media',
31837
- mediagroup: 'mediaGroup',
31838
- method: 'method',
31839
- min: 'min',
31840
- minlength: 'minLength',
31841
- multiple: 'multiple',
31842
- muted: 'muted',
31843
- name: 'name',
31844
- nomodule: 'noModule',
31845
- nonce: 'nonce',
31846
- novalidate: 'noValidate',
31847
- open: 'open',
31848
- optimum: 'optimum',
31849
- pattern: 'pattern',
31850
- placeholder: 'placeholder',
31851
- playsinline: 'playsInline',
31852
- poster: 'poster',
31853
- preload: 'preload',
31854
- profile: 'profile',
31855
- radiogroup: 'radioGroup',
31856
- readonly: 'readOnly',
31857
- referrerpolicy: 'referrerPolicy',
31858
- rel: 'rel',
31859
- required: 'required',
31860
- reversed: 'reversed',
31861
- role: 'role',
31862
- rows: 'rows',
31863
- rowspan: 'rowSpan',
31864
- sandbox: 'sandbox',
31865
- scope: 'scope',
31866
- scoped: 'scoped',
31867
- scrolling: 'scrolling',
31868
- seamless: 'seamless',
31869
- selected: 'selected',
31870
- shape: 'shape',
31871
- size: 'size',
31872
- sizes: 'sizes',
31873
- span: 'span',
31874
- spellcheck: 'spellCheck',
31875
- src: 'src',
31876
- srcdoc: 'srcDoc',
31877
- srclang: 'srcLang',
31878
- srcset: 'srcSet',
31879
- start: 'start',
31880
- step: 'step',
31881
- style: 'style',
31882
- summary: 'summary',
31883
- tabindex: 'tabIndex',
31884
- target: 'target',
31885
- title: 'title',
31886
- type: 'type',
31887
- usemap: 'useMap',
31888
- value: 'value',
31889
- width: 'width',
31890
- wmode: 'wmode',
31891
- wrap: 'wrap',
31892
- // SVG
31893
- about: 'about',
31894
- accentheight: 'accentHeight',
31895
- 'accent-height': 'accentHeight',
31896
- accumulate: 'accumulate',
31897
- additive: 'additive',
31898
- alignmentbaseline: 'alignmentBaseline',
31899
- 'alignment-baseline': 'alignmentBaseline',
31900
- allowreorder: 'allowReorder',
31901
- alphabetic: 'alphabetic',
31902
- amplitude: 'amplitude',
31903
- arabicform: 'arabicForm',
31904
- 'arabic-form': 'arabicForm',
31905
- ascent: 'ascent',
31906
- attributename: 'attributeName',
31907
- attributetype: 'attributeType',
31908
- autoreverse: 'autoReverse',
31909
- azimuth: 'azimuth',
31910
- basefrequency: 'baseFrequency',
31911
- baselineshift: 'baselineShift',
31912
- 'baseline-shift': 'baselineShift',
31913
- baseprofile: 'baseProfile',
31914
- bbox: 'bbox',
31915
- begin: 'begin',
31916
- bias: 'bias',
31917
- by: 'by',
31918
- calcmode: 'calcMode',
31919
- capheight: 'capHeight',
31920
- 'cap-height': 'capHeight',
31921
- clip: 'clip',
31922
- clippath: 'clipPath',
31923
- 'clip-path': 'clipPath',
31924
- clippathunits: 'clipPathUnits',
31925
- cliprule: 'clipRule',
31926
- 'clip-rule': 'clipRule',
31927
- color: 'color',
31928
- colorinterpolation: 'colorInterpolation',
31929
- 'color-interpolation': 'colorInterpolation',
31930
- colorinterpolationfilters: 'colorInterpolationFilters',
31931
- 'color-interpolation-filters': 'colorInterpolationFilters',
31932
- colorprofile: 'colorProfile',
31933
- 'color-profile': 'colorProfile',
31934
- colorrendering: 'colorRendering',
31935
- 'color-rendering': 'colorRendering',
31936
- contentscripttype: 'contentScriptType',
31937
- contentstyletype: 'contentStyleType',
31938
- cursor: 'cursor',
31939
- cx: 'cx',
31940
- cy: 'cy',
31941
- d: 'd',
31942
- datatype: 'datatype',
31943
- decelerate: 'decelerate',
31944
- descent: 'descent',
31945
- diffuseconstant: 'diffuseConstant',
31946
- direction: 'direction',
31947
- display: 'display',
31948
- divisor: 'divisor',
31949
- dominantbaseline: 'dominantBaseline',
31950
- 'dominant-baseline': 'dominantBaseline',
31951
- dur: 'dur',
31952
- dx: 'dx',
31953
- dy: 'dy',
31954
- edgemode: 'edgeMode',
31955
- elevation: 'elevation',
31956
- enablebackground: 'enableBackground',
31957
- 'enable-background': 'enableBackground',
31958
- end: 'end',
31959
- exponent: 'exponent',
31960
- externalresourcesrequired: 'externalResourcesRequired',
31961
- fill: 'fill',
31962
- fillopacity: 'fillOpacity',
31963
- 'fill-opacity': 'fillOpacity',
31964
- fillrule: 'fillRule',
31965
- 'fill-rule': 'fillRule',
31966
- filter: 'filter',
31967
- filterres: 'filterRes',
31968
- filterunits: 'filterUnits',
31969
- floodopacity: 'floodOpacity',
31970
- 'flood-opacity': 'floodOpacity',
31971
- floodcolor: 'floodColor',
31972
- 'flood-color': 'floodColor',
31973
- focusable: 'focusable',
31974
- fontfamily: 'fontFamily',
31975
- 'font-family': 'fontFamily',
31976
- fontsize: 'fontSize',
31977
- 'font-size': 'fontSize',
31978
- fontsizeadjust: 'fontSizeAdjust',
31979
- 'font-size-adjust': 'fontSizeAdjust',
31980
- fontstretch: 'fontStretch',
31981
- 'font-stretch': 'fontStretch',
31982
- fontstyle: 'fontStyle',
31983
- 'font-style': 'fontStyle',
31984
- fontvariant: 'fontVariant',
31985
- 'font-variant': 'fontVariant',
31986
- fontweight: 'fontWeight',
31987
- 'font-weight': 'fontWeight',
31988
- format: 'format',
31989
- from: 'from',
31990
- fx: 'fx',
31991
- fy: 'fy',
31992
- g1: 'g1',
31993
- g2: 'g2',
31994
- glyphname: 'glyphName',
31995
- 'glyph-name': 'glyphName',
31996
- glyphorientationhorizontal: 'glyphOrientationHorizontal',
31997
- 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',
31998
- glyphorientationvertical: 'glyphOrientationVertical',
31999
- 'glyph-orientation-vertical': 'glyphOrientationVertical',
32000
- glyphref: 'glyphRef',
32001
- gradienttransform: 'gradientTransform',
32002
- gradientunits: 'gradientUnits',
32003
- hanging: 'hanging',
32004
- horizadvx: 'horizAdvX',
32005
- 'horiz-adv-x': 'horizAdvX',
32006
- horizoriginx: 'horizOriginX',
32007
- 'horiz-origin-x': 'horizOriginX',
32008
- ideographic: 'ideographic',
32009
- imagerendering: 'imageRendering',
32010
- 'image-rendering': 'imageRendering',
32011
- in2: 'in2',
32012
- in: 'in',
32013
- inlist: 'inlist',
32014
- intercept: 'intercept',
32015
- k1: 'k1',
32016
- k2: 'k2',
32017
- k3: 'k3',
32018
- k4: 'k4',
32019
- k: 'k',
32020
- kernelmatrix: 'kernelMatrix',
32021
- kernelunitlength: 'kernelUnitLength',
32022
- kerning: 'kerning',
32023
- keypoints: 'keyPoints',
32024
- keysplines: 'keySplines',
32025
- keytimes: 'keyTimes',
32026
- lengthadjust: 'lengthAdjust',
32027
- letterspacing: 'letterSpacing',
32028
- 'letter-spacing': 'letterSpacing',
32029
- lightingcolor: 'lightingColor',
32030
- 'lighting-color': 'lightingColor',
32031
- limitingconeangle: 'limitingConeAngle',
32032
- local: 'local',
32033
- markerend: 'markerEnd',
32034
- 'marker-end': 'markerEnd',
32035
- markerheight: 'markerHeight',
32036
- markermid: 'markerMid',
32037
- 'marker-mid': 'markerMid',
32038
- markerstart: 'markerStart',
32039
- 'marker-start': 'markerStart',
32040
- markerunits: 'markerUnits',
32041
- markerwidth: 'markerWidth',
32042
- mask: 'mask',
32043
- maskcontentunits: 'maskContentUnits',
32044
- maskunits: 'maskUnits',
32045
- mathematical: 'mathematical',
32046
- mode: 'mode',
32047
- numoctaves: 'numOctaves',
32048
- offset: 'offset',
32049
- opacity: 'opacity',
32050
- operator: 'operator',
32051
- order: 'order',
32052
- orient: 'orient',
32053
- orientation: 'orientation',
32054
- origin: 'origin',
32055
- overflow: 'overflow',
32056
- overlineposition: 'overlinePosition',
32057
- 'overline-position': 'overlinePosition',
32058
- overlinethickness: 'overlineThickness',
32059
- 'overline-thickness': 'overlineThickness',
32060
- paintorder: 'paintOrder',
32061
- 'paint-order': 'paintOrder',
32062
- panose1: 'panose1',
32063
- 'panose-1': 'panose1',
32064
- pathlength: 'pathLength',
32065
- patterncontentunits: 'patternContentUnits',
32066
- patterntransform: 'patternTransform',
32067
- patternunits: 'patternUnits',
32068
- pointerevents: 'pointerEvents',
32069
- 'pointer-events': 'pointerEvents',
32070
- points: 'points',
32071
- pointsatx: 'pointsAtX',
32072
- pointsaty: 'pointsAtY',
32073
- pointsatz: 'pointsAtZ',
32074
- prefix: 'prefix',
32075
- preservealpha: 'preserveAlpha',
32076
- preserveaspectratio: 'preserveAspectRatio',
32077
- primitiveunits: 'primitiveUnits',
32078
- property: 'property',
32079
- r: 'r',
32080
- radius: 'radius',
32081
- refx: 'refX',
32082
- refy: 'refY',
32083
- renderingintent: 'renderingIntent',
32084
- 'rendering-intent': 'renderingIntent',
32085
- repeatcount: 'repeatCount',
32086
- repeatdur: 'repeatDur',
32087
- requiredextensions: 'requiredExtensions',
32088
- requiredfeatures: 'requiredFeatures',
32089
- resource: 'resource',
32090
- restart: 'restart',
32091
- result: 'result',
32092
- results: 'results',
32093
- rotate: 'rotate',
32094
- rx: 'rx',
32095
- ry: 'ry',
32096
- scale: 'scale',
32097
- security: 'security',
32098
- seed: 'seed',
32099
- shaperendering: 'shapeRendering',
32100
- 'shape-rendering': 'shapeRendering',
32101
- slope: 'slope',
32102
- spacing: 'spacing',
32103
- specularconstant: 'specularConstant',
32104
- specularexponent: 'specularExponent',
32105
- speed: 'speed',
32106
- spreadmethod: 'spreadMethod',
32107
- startoffset: 'startOffset',
32108
- stddeviation: 'stdDeviation',
32109
- stemh: 'stemh',
32110
- stemv: 'stemv',
32111
- stitchtiles: 'stitchTiles',
32112
- stopcolor: 'stopColor',
32113
- 'stop-color': 'stopColor',
32114
- stopopacity: 'stopOpacity',
32115
- 'stop-opacity': 'stopOpacity',
32116
- strikethroughposition: 'strikethroughPosition',
32117
- 'strikethrough-position': 'strikethroughPosition',
32118
- strikethroughthickness: 'strikethroughThickness',
32119
- 'strikethrough-thickness': 'strikethroughThickness',
32120
- string: 'string',
32121
- stroke: 'stroke',
32122
- strokedasharray: 'strokeDasharray',
32123
- 'stroke-dasharray': 'strokeDasharray',
32124
- strokedashoffset: 'strokeDashoffset',
32125
- 'stroke-dashoffset': 'strokeDashoffset',
32126
- strokelinecap: 'strokeLinecap',
32127
- 'stroke-linecap': 'strokeLinecap',
32128
- strokelinejoin: 'strokeLinejoin',
32129
- 'stroke-linejoin': 'strokeLinejoin',
32130
- strokemiterlimit: 'strokeMiterlimit',
32131
- 'stroke-miterlimit': 'strokeMiterlimit',
32132
- strokewidth: 'strokeWidth',
32133
- 'stroke-width': 'strokeWidth',
32134
- strokeopacity: 'strokeOpacity',
32135
- 'stroke-opacity': 'strokeOpacity',
32136
- suppresscontenteditablewarning: 'suppressContentEditableWarning',
32137
- suppresshydrationwarning: 'suppressHydrationWarning',
32138
- surfacescale: 'surfaceScale',
32139
- systemlanguage: 'systemLanguage',
32140
- tablevalues: 'tableValues',
32141
- targetx: 'targetX',
32142
- targety: 'targetY',
32143
- textanchor: 'textAnchor',
32144
- 'text-anchor': 'textAnchor',
32145
- textdecoration: 'textDecoration',
32146
- 'text-decoration': 'textDecoration',
32147
- textlength: 'textLength',
32148
- textrendering: 'textRendering',
32149
- 'text-rendering': 'textRendering',
32150
- to: 'to',
32151
- transform: 'transform',
32152
- typeof: 'typeof',
32153
- u1: 'u1',
32154
- u2: 'u2',
32155
- underlineposition: 'underlinePosition',
32156
- 'underline-position': 'underlinePosition',
32157
- underlinethickness: 'underlineThickness',
32158
- 'underline-thickness': 'underlineThickness',
32159
- unicode: 'unicode',
32160
- unicodebidi: 'unicodeBidi',
32161
- 'unicode-bidi': 'unicodeBidi',
32162
- unicoderange: 'unicodeRange',
32163
- 'unicode-range': 'unicodeRange',
32164
- unitsperem: 'unitsPerEm',
32165
- 'units-per-em': 'unitsPerEm',
32166
- unselectable: 'unselectable',
32167
- valphabetic: 'vAlphabetic',
32168
- 'v-alphabetic': 'vAlphabetic',
32169
- values: 'values',
32170
- vectoreffect: 'vectorEffect',
32171
- 'vector-effect': 'vectorEffect',
32172
- version: 'version',
32173
- vertadvy: 'vertAdvY',
32174
- 'vert-adv-y': 'vertAdvY',
32175
- vertoriginx: 'vertOriginX',
32176
- 'vert-origin-x': 'vertOriginX',
32177
- vertoriginy: 'vertOriginY',
32178
- 'vert-origin-y': 'vertOriginY',
32179
- vhanging: 'vHanging',
32180
- 'v-hanging': 'vHanging',
32181
- videographic: 'vIdeographic',
32182
- 'v-ideographic': 'vIdeographic',
32183
- viewbox: 'viewBox',
32184
- viewtarget: 'viewTarget',
32185
- visibility: 'visibility',
32186
- vmathematical: 'vMathematical',
32187
- 'v-mathematical': 'vMathematical',
32188
- vocab: 'vocab',
32189
- widths: 'widths',
32190
- wordspacing: 'wordSpacing',
32191
- 'word-spacing': 'wordSpacing',
32192
- writingmode: 'writingMode',
32193
- 'writing-mode': 'writingMode',
32194
- x1: 'x1',
32195
- x2: 'x2',
32196
- x: 'x',
32197
- xchannelselector: 'xChannelSelector',
32198
- xheight: 'xHeight',
32199
- 'x-height': 'xHeight',
32200
- xlinkactuate: 'xlinkActuate',
32201
- 'xlink:actuate': 'xlinkActuate',
32202
- xlinkarcrole: 'xlinkArcrole',
32203
- 'xlink:arcrole': 'xlinkArcrole',
32204
- xlinkhref: 'xlinkHref',
32205
- 'xlink:href': 'xlinkHref',
32206
- xlinkrole: 'xlinkRole',
32207
- 'xlink:role': 'xlinkRole',
32208
- xlinkshow: 'xlinkShow',
32209
- 'xlink:show': 'xlinkShow',
32210
- xlinktitle: 'xlinkTitle',
32211
- 'xlink:title': 'xlinkTitle',
32212
- xlinktype: 'xlinkType',
32213
- 'xlink:type': 'xlinkType',
32214
- xmlbase: 'xmlBase',
32215
- 'xml:base': 'xmlBase',
32216
- xmllang: 'xmlLang',
32217
- 'xml:lang': 'xmlLang',
32218
- xmlns: 'xmlns',
32219
- 'xml:space': 'xmlSpace',
32220
- xmlnsxlink: 'xmlnsXlink',
32221
- 'xmlns:xlink': 'xmlnsXlink',
32222
- xmlspace: 'xmlSpace',
32223
- y1: 'y1',
32224
- y2: 'y2',
32225
- y: 'y',
32226
- ychannelselector: 'yChannelSelector',
32227
- z: 'z',
32228
- zoomandpan: 'zoomAndPan'
32229
- };
32230
-
32231
- var ariaProperties = {
32232
- 'aria-current': 0,
32233
- // state
32234
- 'aria-details': 0,
32235
- 'aria-disabled': 0,
32236
- // state
32237
- 'aria-hidden': 0,
32238
- // state
32239
- 'aria-invalid': 0,
32240
- // state
32241
- 'aria-keyshortcuts': 0,
32242
- 'aria-label': 0,
32243
- 'aria-roledescription': 0,
32244
- // Widget Attributes
32245
- 'aria-autocomplete': 0,
32246
- 'aria-checked': 0,
32247
- 'aria-expanded': 0,
32248
- 'aria-haspopup': 0,
32249
- 'aria-level': 0,
32250
- 'aria-modal': 0,
32251
- 'aria-multiline': 0,
32252
- 'aria-multiselectable': 0,
32253
- 'aria-orientation': 0,
32254
- 'aria-placeholder': 0,
32255
- 'aria-pressed': 0,
32256
- 'aria-readonly': 0,
32257
- 'aria-required': 0,
32258
- 'aria-selected': 0,
32259
- 'aria-sort': 0,
32260
- 'aria-valuemax': 0,
32261
- 'aria-valuemin': 0,
32262
- 'aria-valuenow': 0,
32263
- 'aria-valuetext': 0,
32264
- // Live Region Attributes
32265
- 'aria-atomic': 0,
32266
- 'aria-busy': 0,
32267
- 'aria-live': 0,
32268
- 'aria-relevant': 0,
32269
- // Drag-and-Drop Attributes
32270
- 'aria-dropeffect': 0,
32271
- 'aria-grabbed': 0,
32272
- // Relationship Attributes
32273
- 'aria-activedescendant': 0,
32274
- 'aria-colcount': 0,
32275
- 'aria-colindex': 0,
32276
- 'aria-colspan': 0,
32277
- 'aria-controls': 0,
32278
- 'aria-describedby': 0,
32279
- 'aria-errormessage': 0,
32280
- 'aria-flowto': 0,
32281
- 'aria-labelledby': 0,
32282
- 'aria-owns': 0,
32283
- 'aria-posinset': 0,
32284
- 'aria-rowcount': 0,
32285
- 'aria-rowindex': 0,
32286
- 'aria-rowspan': 0,
32287
- 'aria-setsize': 0
32288
- };
32289
-
32290
- var warnedProperties = {};
32291
- var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
32292
- var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
32293
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
32294
-
32295
- function validateProperty(tagName, name) {
32296
- if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {
32297
- return true;
32298
- }
32299
-
32300
- if (rARIACamel.test(name)) {
32301
- var ariaName = 'aria-' + name.slice(4).toLowerCase();
32302
- var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM
32303
- // DOM properties, then it is an invalid aria-* attribute.
32304
-
32305
- if (correctName == null) {
32306
- warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);
32307
- warnedProperties[name] = true;
32308
- return true;
32309
- } // aria-* attributes should be lowercase; suggest the lowercase version.
32310
-
32311
-
32312
- if (name !== correctName) {
32313
- warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);
32314
- warnedProperties[name] = true;
32315
- return true;
32316
- }
32317
- }
32318
-
32319
- if (rARIA.test(name)) {
32320
- var lowerCasedName = name.toLowerCase();
32321
- var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM
32322
- // DOM properties, then it is an invalid aria-* attribute.
32323
-
32324
- if (standardName == null) {
32325
- warnedProperties[name] = true;
32326
- return false;
32327
- } // aria-* attributes should be lowercase; suggest the lowercase version.
32328
-
32329
-
32330
- if (name !== standardName) {
32331
- warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);
32332
- warnedProperties[name] = true;
32333
- return true;
32334
- }
32335
- }
32336
-
32337
- return true;
32338
- }
32339
-
32340
- function warnInvalidARIAProps(type, props) {
32341
- var invalidProps = [];
32342
-
32343
- for (var key in props) {
32344
- var isValid = validateProperty(type, key);
32345
-
32346
- if (!isValid) {
32347
- invalidProps.push(key);
32348
- }
32349
- }
32350
-
32351
- var unknownPropString = invalidProps.map(function (prop) {
32352
- return '`' + prop + '`';
32353
- }).join(', ');
32354
-
32355
- if (invalidProps.length === 1) {
32356
- warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
32357
- } else if (invalidProps.length > 1) {
32358
- warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);
32359
- }
32360
- }
32361
-
32362
- function validateProperties(type, props) {
32363
- if (isCustomComponent(type, props)) {
32364
- return;
32365
- }
32366
-
32367
- warnInvalidARIAProps(type, props);
32368
- }
32369
-
32370
- var didWarnValueNull = false;
32371
- function validateProperties$1(type, props) {
32372
- if (type !== 'input' && type !== 'textarea' && type !== 'select') {
32373
- return;
32374
- }
32375
-
32376
- if (props != null && props.value === null && !didWarnValueNull) {
32377
- didWarnValueNull = true;
32378
-
32379
- if (type === 'select' && props.multiple) {
32380
- warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);
32381
- } else {
32382
- warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);
32383
- }
32384
- }
32385
- }
32386
-
32387
- var validateProperty$1 = function () {};
32388
-
32389
- {
32390
- var warnedProperties$1 = {};
32391
- var _hasOwnProperty = Object.prototype.hasOwnProperty;
32392
- var EVENT_NAME_REGEX = /^on./;
32393
- var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;
32394
- var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
32395
- var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
32396
-
32397
- validateProperty$1 = function (tagName, name, value, canUseEventSystem) {
32398
- if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {
32399
- return true;
32400
- }
32401
-
32402
- var lowerCasedName = name.toLowerCase();
32403
-
32404
- if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {
32405
- warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');
32406
- warnedProperties$1[name] = true;
32407
- return true;
32408
- } // We can't rely on the event system being injected on the server.
32409
-
32410
-
32411
- if (canUseEventSystem) {
32412
- if (registrationNameModules.hasOwnProperty(name)) {
32413
- return true;
32414
- }
32415
-
32416
- var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;
32417
-
32418
- if (registrationName != null) {
32419
- warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);
32420
- warnedProperties$1[name] = true;
32421
- return true;
32422
- }
32423
-
32424
- if (EVENT_NAME_REGEX.test(name)) {
32425
- warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);
32426
- warnedProperties$1[name] = true;
32427
- return true;
32428
- }
32429
- } else if (EVENT_NAME_REGEX.test(name)) {
32430
- // If no event plugins have been injected, we are in a server environment.
32431
- // So we can't tell if the event name is correct for sure, but we can filter
32432
- // out known bad ones like `onclick`. We can't suggest a specific replacement though.
32433
- if (INVALID_EVENT_NAME_REGEX.test(name)) {
32434
- warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);
32435
- }
32436
-
32437
- warnedProperties$1[name] = true;
32438
- return true;
32439
- } // Let the ARIA attribute hook validate ARIA attributes
32440
-
32441
-
32442
- if (rARIA$1.test(name) || rARIACamel$1.test(name)) {
32443
- return true;
32444
- }
32445
-
32446
- if (lowerCasedName === 'innerhtml') {
32447
- warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');
32448
- warnedProperties$1[name] = true;
32449
- return true;
32450
- }
32451
-
32452
- if (lowerCasedName === 'aria') {
32453
- warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');
32454
- warnedProperties$1[name] = true;
32455
- return true;
32456
- }
32457
-
32458
- if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {
32459
- warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);
32460
- warnedProperties$1[name] = true;
32461
- return true;
32462
- }
32463
-
32464
- if (typeof value === 'number' && isNaN(value)) {
32465
- warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);
32466
- warnedProperties$1[name] = true;
32467
- return true;
32468
- }
32469
-
32470
- var propertyInfo = getPropertyInfo(name);
32471
- var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.
32472
-
32473
- if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {
32474
- var standardName = possibleStandardNames[lowerCasedName];
32475
-
32476
- if (standardName !== name) {
32477
- warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);
32478
- warnedProperties$1[name] = true;
32479
- return true;
32480
- }
32481
- } else if (!isReserved && name !== lowerCasedName) {
32482
- // Unknown attributes should have lowercase casing since that's how they
32483
- // will be cased anyway with server rendering.
32484
- warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);
32485
- warnedProperties$1[name] = true;
32486
- return true;
32487
- }
32488
-
32489
- if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
32490
- if (value) {
32491
- warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name);
32492
- } else {
32493
- warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);
32494
- }
32495
-
32496
- warnedProperties$1[name] = true;
32497
- return true;
32498
- } // Now that we've validated casing, do not validate
32499
- // data types for reserved props
32500
-
32501
-
32502
- if (isReserved) {
32503
- return true;
32504
- } // Warn when a known attribute is a bad type
32505
-
32506
-
32507
- if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {
32508
- warnedProperties$1[name] = true;
32509
- return false;
32510
- } // Warn when passing the strings 'false' or 'true' into a boolean prop
32511
-
32512
-
32513
- if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {
32514
- warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value);
32515
- warnedProperties$1[name] = true;
32516
- return true;
32517
- }
32518
-
32519
- return true;
32520
- };
32521
- }
32522
-
32523
- var warnUnknownProperties = function (type, props, canUseEventSystem) {
32524
- var unknownProps = [];
32525
-
32526
- for (var key in props) {
32527
- var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
32528
-
32529
- if (!isValid) {
32530
- unknownProps.push(key);
32531
- }
32532
- }
32533
-
32534
- var unknownPropString = unknownProps.map(function (prop) {
32535
- return '`' + prop + '`';
32536
- }).join(', ');
32537
-
32538
- if (unknownProps.length === 1) {
32539
- warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
32540
- } else if (unknownProps.length > 1) {
32541
- warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);
32542
- }
32543
- };
32544
-
32545
- function validateProperties$2(type, props, canUseEventSystem) {
32546
- if (isCustomComponent(type, props)) {
32547
- return;
32548
- }
32549
-
32550
- warnUnknownProperties(type, props, canUseEventSystem);
32551
- }
32552
-
32553
- // TODO: direct imports like some-package/src/* are bad. Fix me.
32554
- var didWarnInvalidHydration = false;
32555
- var didWarnShadyDOM = false;
32556
- var didWarnScriptTags = false;
32557
- var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';
32558
- var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';
32559
- var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';
32560
- var AUTOFOCUS = 'autoFocus';
32561
- var CHILDREN = 'children';
32562
- var STYLE$1 = 'style';
32563
- var HTML = '__html';
32564
- var LISTENERS = 'listeners';
32565
- var HTML_NAMESPACE = Namespaces.html;
32566
- var warnedUnknownTags;
32567
- var suppressHydrationWarning;
32568
- var validatePropertiesInDevelopment;
32569
- var warnForTextDifference;
32570
- var warnForPropDifference;
32571
- var warnForExtraAttributes;
32572
- var warnForInvalidEventListener;
32573
- var canDiffStyleForHydrationWarning;
32574
- var normalizeMarkupForTextOrAttribute;
32575
- var normalizeHTML;
32576
-
32577
- {
32578
- warnedUnknownTags = {
32579
- // Chrome is the only major browser not shipping <time>. But as of July
32580
- // 2017 it intends to ship it due to widespread usage. We intentionally
32581
- // *don't* warn for <time> even if it's unrecognized by Chrome because
32582
- // it soon will be, and many apps have been using it anyway.
32583
- time: true,
32584
- // There are working polyfills for <dialog>. Let people use it.
32585
- dialog: true,
32586
- // Electron ships a custom <webview> tag to display external web content in
32587
- // an isolated frame and process.
32588
- // This tag is not present in non Electron environments such as JSDom which
32589
- // is often used for testing purposes.
32590
- // @see https://electronjs.org/docs/api/webview-tag
32591
- webview: true
32592
- };
32593
-
32594
- validatePropertiesInDevelopment = function (type, props) {
32595
- validateProperties(type, props);
32596
- validateProperties$1(type, props);
32597
- validateProperties$2(type, props,
32598
- /* canUseEventSystem */
32599
- true);
32600
- }; // IE 11 parses & normalizes the style attribute as opposed to other
32601
- // browsers. It adds spaces and sorts the properties in some
32602
- // non-alphabetical order. Handling that would require sorting CSS
32603
- // properties in the client & server versions or applying
32604
- // `expectedStyle` to a temporary DOM node to read its `style` attribute
32605
- // normalized. Since it only affects IE, we're skipping style warnings
32606
- // in that browser completely in favor of doing all that work.
32607
- // See https://github.com/facebook/react/issues/11807
32608
-
32609
-
32610
- canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.
32611
- // It also can turn \u0000 into \uFFFD inside attributes.
32612
- // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream
32613
- // If we have a mismatch, it might be caused by that.
32614
- // We will still patch up in this case but not fire the warning.
32615
-
32616
- var NORMALIZE_NEWLINES_REGEX = /\r\n?/g;
32617
- var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g;
32618
-
32619
- normalizeMarkupForTextOrAttribute = function (markup) {
32620
- var markupString = typeof markup === 'string' ? markup : '' + markup;
32621
- return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');
32622
- };
32623
-
32624
- warnForTextDifference = function (serverText, clientText) {
32625
- if (didWarnInvalidHydration) {
32626
- return;
32627
- }
32628
-
32629
- var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);
32630
- var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);
32631
-
32632
- if (normalizedServerText === normalizedClientText) {
32633
- return;
32634
- }
32635
-
32636
- didWarnInvalidHydration = true;
32637
- warningWithoutStack$1(false, 'Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText);
32638
- };
32639
-
32640
- warnForPropDifference = function (propName, serverValue, clientValue) {
32641
- if (didWarnInvalidHydration) {
32642
- return;
32643
- }
32644
-
32645
- var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);
32646
- var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);
32647
-
32648
- if (normalizedServerValue === normalizedClientValue) {
32649
- return;
32650
- }
32651
-
32652
- didWarnInvalidHydration = true;
32653
- warningWithoutStack$1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));
32654
- };
32655
-
32656
- warnForExtraAttributes = function (attributeNames) {
32657
- if (didWarnInvalidHydration) {
32658
- return;
32659
- }
32660
-
32661
- didWarnInvalidHydration = true;
32662
- var names = [];
32663
- attributeNames.forEach(function (name) {
32664
- names.push(name);
32665
- });
32666
- warningWithoutStack$1(false, 'Extra attributes from the server: %s', names);
32667
- };
32668
-
32669
- warnForInvalidEventListener = function (registrationName, listener) {
32670
- if (listener === false) {
32671
- warning$1(false, 'Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);
32672
- } else {
32673
- warning$1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);
32674
- }
32675
- }; // Parse the HTML and read it back to normalize the HTML string so that it
32676
- // can be used for comparison.
32677
-
32678
-
32679
- normalizeHTML = function (parent, html) {
32680
- // We could have created a separate document here to avoid
32681
- // re-initializing custom elements if they exist. But this breaks
32682
- // how <noscript> is being handled. So we use the same document.
32683
- // See the discussion in https://github.com/facebook/react/pull/11157.
32684
- var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);
32685
- testElement.innerHTML = html;
32686
- return testElement.innerHTML;
32687
- };
32688
- }
32689
-
32690
- function ensureListeningTo(rootContainerElement, registrationName) {
32691
- var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;
32692
- var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;
32693
- listenTo(registrationName, doc);
32694
- }
32695
-
32696
- function getOwnerDocumentFromRootContainer(rootContainerElement) {
32697
- return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;
32698
- }
32699
-
32700
- function noop() {}
32701
-
32702
- function trapClickOnNonInteractiveElement(node) {
32703
- // Mobile Safari does not fire properly bubble click events on
32704
- // non-interactive elements, which means delegated click listeners do not
32705
- // fire. The workaround for this bug involves attaching an empty click
32706
- // listener on the target node.
32707
- // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
32708
- // Just set it using the onclick property so that we don't have to manage any
32709
- // bookkeeping for it. Not sure if we need to clear it when the listener is
32710
- // removed.
32711
- // TODO: Only do this for the relevant Safaris maybe?
32712
- node.onclick = noop;
32713
- }
32714
-
32715
- function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {
32716
- for (var propKey in nextProps) {
32717
- if (!nextProps.hasOwnProperty(propKey)) {
32718
- continue;
32719
- }
32720
-
32721
- var nextProp = nextProps[propKey];
32722
-
32723
- if (propKey === STYLE$1) {
32724
- {
32725
- if (nextProp) {
32726
- // Freeze the next style object so that we can assume it won't be
32727
- // mutated. We have already warned for this in the past.
32728
- Object.freeze(nextProp);
32729
- }
32730
- } // Relies on `updateStylesByID` not mutating `styleUpdates`.
32731
-
32732
-
32733
- setValueForStyles(domElement, nextProp);
32734
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
32735
- var nextHtml = nextProp ? nextProp[HTML] : undefined;
32736
-
32737
- if (nextHtml != null) {
32738
- setInnerHTML(domElement, nextHtml);
32739
- }
32740
- } else if (propKey === CHILDREN) {
32741
- if (typeof nextProp === 'string') {
32742
- // Avoid setting initial textContent when the text is empty. In IE11 setting
32743
- // textContent on a <textarea> will cause the placeholder to not
32744
- // show within the <textarea> until it has been focused and blurred again.
32745
- // https://github.com/facebook/react/issues/6731#issuecomment-254874553
32746
- var canSetTextContent = tag !== 'textarea' || nextProp !== '';
32747
-
32748
- if (canSetTextContent) {
32749
- setTextContent(domElement, nextProp);
32750
- }
32751
- } else if (typeof nextProp === 'number') {
32752
- setTextContent(domElement, '' + nextProp);
32753
- }
32754
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
32755
- } else if (propKey === AUTOFOCUS) {// We polyfill it separately on the client during commit.
32756
- // We could have excluded it in the property list instead of
32757
- // adding a special case here, but then it wouldn't be emitted
32758
- // on server rendering (but we *do* want to emit it in SSR).
32759
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
32760
- if (nextProp != null) {
32761
- if (true && typeof nextProp !== 'function') {
32762
- warnForInvalidEventListener(propKey, nextProp);
32763
- }
32764
-
32765
- ensureListeningTo(rootContainerElement, propKey);
32766
- }
32767
- } else if (nextProp != null) {
32768
- setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);
32769
- }
32770
- }
32771
- }
32772
-
32773
- function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {
32774
- // TODO: Handle wasCustomComponentTag
32775
- for (var i = 0; i < updatePayload.length; i += 2) {
32776
- var propKey = updatePayload[i];
32777
- var propValue = updatePayload[i + 1];
32778
-
32779
- if (propKey === STYLE$1) {
32780
- setValueForStyles(domElement, propValue);
32781
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
32782
- setInnerHTML(domElement, propValue);
32783
- } else if (propKey === CHILDREN) {
32784
- setTextContent(domElement, propValue);
32785
- } else {
32786
- setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);
32787
- }
32788
- }
32789
- }
32790
-
32791
- function createElement(type, props, rootContainerElement, parentNamespace) {
32792
- var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML
32793
- // tags get no namespace.
32794
-
32795
- var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);
32796
- var domElement;
32797
- var namespaceURI = parentNamespace;
32798
-
32799
- if (namespaceURI === HTML_NAMESPACE) {
32800
- namespaceURI = getIntrinsicNamespace(type);
32801
- }
32802
-
32803
- if (namespaceURI === HTML_NAMESPACE) {
32804
- {
32805
- isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to
32806
- // allow <SVG> or <mATH>.
32807
-
32808
- !(isCustomComponentTag || type === type.toLowerCase()) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;
32809
- }
32810
-
32811
- if (type === 'script') {
32812
- // Create the script via .innerHTML so its "parser-inserted" flag is
32813
- // set to true and it does not execute
32814
- var div = ownerDocument.createElement('div');
32815
-
32816
- {
32817
- if (enableTrustedTypesIntegration && !didWarnScriptTags) {
32818
- warning$1(false, 'Encountered a script tag while rendering React component. ' + 'Scripts inside React components are never executed when rendering ' + 'on the client. Consider using template tag instead ' + '(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template).');
32819
- didWarnScriptTags = true;
32820
- }
32821
- }
32822
-
32823
- div.innerHTML = '<script><' + '/script>'; // eslint-disable-line
32824
- // This is guaranteed to yield a script element.
32825
-
32826
- var firstChild = div.firstChild;
32827
- domElement = div.removeChild(firstChild);
32828
- } else if (typeof props.is === 'string') {
32829
- // $FlowIssue `createElement` should be updated for Web Components
32830
- domElement = ownerDocument.createElement(type, {
32831
- is: props.is
32832
- });
32833
- } else {
32834
- // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.
32835
- // See discussion in https://github.com/facebook/react/pull/6896
32836
- // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240
32837
- domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`
32838
- // attributes on `select`s needs to be added before `option`s are inserted.
32839
- // This prevents:
32840
- // - a bug where the `select` does not scroll to the correct option because singular
32841
- // `select` elements automatically pick the first item #13222
32842
- // - a bug where the `select` set the first item as selected despite the `size` attribute #14239
32843
- // See https://github.com/facebook/react/issues/13222
32844
- // and https://github.com/facebook/react/issues/14239
32845
-
32846
- if (type === 'select') {
32847
- var node = domElement;
32848
-
32849
- if (props.multiple) {
32850
- node.multiple = true;
32851
- } else if (props.size) {
32852
- // Setting a size greater than 1 causes a select to behave like `multiple=true`, where
32853
- // it is possible that no option is selected.
32854
- //
32855
- // This is only necessary when a select in "single selection mode".
32856
- node.size = props.size;
32857
- }
32858
- }
32859
- }
32860
- } else {
32861
- domElement = ownerDocument.createElementNS(namespaceURI, type);
32862
- }
32863
-
32864
- {
32865
- if (namespaceURI === HTML_NAMESPACE) {
32866
- if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {
32867
- warnedUnknownTags[type] = true;
32868
- warning$1(false, 'The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);
32869
- }
32870
- }
32871
- }
32872
-
32873
- return domElement;
32874
- }
32875
- function createTextNode(text, rootContainerElement) {
32876
- return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);
32877
- }
32878
- function setInitialProperties(domElement, tag, rawProps, rootContainerElement) {
32879
- var isCustomComponentTag = isCustomComponent(tag, rawProps);
32880
-
32881
- {
32882
- validatePropertiesInDevelopment(tag, rawProps);
32883
-
32884
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
32885
- warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
32886
- didWarnShadyDOM = true;
32887
- }
32888
- } // TODO: Make sure that we check isMounted before firing any of these events.
32889
-
32890
-
32891
- var props;
32892
-
32893
- switch (tag) {
32894
- case 'iframe':
32895
- case 'object':
32896
- case 'embed':
32897
- trapBubbledEvent(TOP_LOAD, domElement);
32898
- props = rawProps;
32899
- break;
32900
-
32901
- case 'video':
32902
- case 'audio':
32903
- // Create listener for each media event
32904
- for (var i = 0; i < mediaEventTypes.length; i++) {
32905
- trapBubbledEvent(mediaEventTypes[i], domElement);
32906
- }
32907
-
32908
- props = rawProps;
32909
- break;
32910
-
32911
- case 'source':
32912
- trapBubbledEvent(TOP_ERROR, domElement);
32913
- props = rawProps;
32914
- break;
32915
-
32916
- case 'img':
32917
- case 'image':
32918
- case 'link':
32919
- trapBubbledEvent(TOP_ERROR, domElement);
32920
- trapBubbledEvent(TOP_LOAD, domElement);
32921
- props = rawProps;
32922
- break;
32923
-
32924
- case 'form':
32925
- trapBubbledEvent(TOP_RESET, domElement);
32926
- trapBubbledEvent(TOP_SUBMIT, domElement);
32927
- props = rawProps;
32928
- break;
32929
-
32930
- case 'details':
32931
- trapBubbledEvent(TOP_TOGGLE, domElement);
32932
- props = rawProps;
32933
- break;
32934
-
32935
- case 'input':
32936
- initWrapperState(domElement, rawProps);
32937
- props = getHostProps(domElement, rawProps);
32938
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
32939
- // to onChange. Even if there is no listener.
32940
-
32941
- ensureListeningTo(rootContainerElement, 'onChange');
32942
- break;
32943
-
32944
- case 'option':
32945
- validateProps(domElement, rawProps);
32946
- props = getHostProps$1(domElement, rawProps);
32947
- break;
32948
-
32949
- case 'select':
32950
- initWrapperState$1(domElement, rawProps);
32951
- props = getHostProps$2(domElement, rawProps);
32952
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
32953
- // to onChange. Even if there is no listener.
32954
-
32955
- ensureListeningTo(rootContainerElement, 'onChange');
32956
- break;
32957
-
32958
- case 'textarea':
32959
- initWrapperState$2(domElement, rawProps);
32960
- props = getHostProps$3(domElement, rawProps);
32961
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
32962
- // to onChange. Even if there is no listener.
32963
-
32964
- ensureListeningTo(rootContainerElement, 'onChange');
32965
- break;
32966
-
32967
- default:
32968
- props = rawProps;
32969
- }
32970
-
32971
- assertValidProps(tag, props);
32972
- setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);
32973
-
32974
- switch (tag) {
32975
- case 'input':
32976
- // TODO: Make sure we check if this is still unmounted or do any clean
32977
- // up necessary since we never stop tracking anymore.
32978
- track(domElement);
32979
- postMountWrapper(domElement, rawProps, false);
32980
- break;
32981
-
32982
- case 'textarea':
32983
- // TODO: Make sure we check if this is still unmounted or do any clean
32984
- // up necessary since we never stop tracking anymore.
32985
- track(domElement);
32986
- postMountWrapper$3(domElement, rawProps);
32987
- break;
32988
-
32989
- case 'option':
32990
- postMountWrapper$1(domElement, rawProps);
32991
- break;
32992
-
32993
- case 'select':
32994
- postMountWrapper$2(domElement, rawProps);
32995
- break;
32996
-
32997
- default:
32998
- if (typeof props.onClick === 'function') {
32999
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
33000
- trapClickOnNonInteractiveElement(domElement);
33001
- }
33002
-
33003
- break;
33004
- }
33005
- } // Calculate the diff between the two objects.
33006
-
33007
- function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {
33008
- {
33009
- validatePropertiesInDevelopment(tag, nextRawProps);
33010
- }
33011
-
33012
- var updatePayload = null;
33013
- var lastProps;
33014
- var nextProps;
33015
-
33016
- switch (tag) {
33017
- case 'input':
33018
- lastProps = getHostProps(domElement, lastRawProps);
33019
- nextProps = getHostProps(domElement, nextRawProps);
33020
- updatePayload = [];
33021
- break;
33022
-
33023
- case 'option':
33024
- lastProps = getHostProps$1(domElement, lastRawProps);
33025
- nextProps = getHostProps$1(domElement, nextRawProps);
33026
- updatePayload = [];
33027
- break;
33028
-
33029
- case 'select':
33030
- lastProps = getHostProps$2(domElement, lastRawProps);
33031
- nextProps = getHostProps$2(domElement, nextRawProps);
33032
- updatePayload = [];
33033
- break;
33034
-
33035
- case 'textarea':
33036
- lastProps = getHostProps$3(domElement, lastRawProps);
33037
- nextProps = getHostProps$3(domElement, nextRawProps);
33038
- updatePayload = [];
33039
- break;
33040
-
33041
- default:
33042
- lastProps = lastRawProps;
33043
- nextProps = nextRawProps;
33044
-
33045
- if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {
33046
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
33047
- trapClickOnNonInteractiveElement(domElement);
33048
- }
33049
-
33050
- break;
33051
- }
33052
-
33053
- assertValidProps(tag, nextProps);
33054
- var propKey;
33055
- var styleName;
33056
- var styleUpdates = null;
33057
-
33058
- for (propKey in lastProps) {
33059
- if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {
33060
- continue;
33061
- }
33062
-
33063
- if (propKey === STYLE$1) {
33064
- var lastStyle = lastProps[propKey];
33065
-
33066
- for (styleName in lastStyle) {
33067
- if (lastStyle.hasOwnProperty(styleName)) {
33068
- if (!styleUpdates) {
33069
- styleUpdates = {};
33070
- }
33071
-
33072
- styleUpdates[styleName] = '';
33073
- }
33074
- }
33075
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) {// Noop. This is handled by the clear text mechanism.
33076
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
33077
- } else if (propKey === AUTOFOCUS) {// Noop. It doesn't work on updates anyway.
33078
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
33079
- // This is a special case. If any listener updates we need to ensure
33080
- // that the "current" fiber pointer gets updated so we need a commit
33081
- // to update this element.
33082
- if (!updatePayload) {
33083
- updatePayload = [];
33084
- }
33085
- } else {
33086
- // For all other deleted properties we add it to the queue. We use
33087
- // the whitelist in the commit phase instead.
33088
- (updatePayload = updatePayload || []).push(propKey, null);
33089
- }
33090
- }
33091
-
33092
- for (propKey in nextProps) {
33093
- var nextProp = nextProps[propKey];
33094
- var lastProp = lastProps != null ? lastProps[propKey] : undefined;
33095
-
33096
- if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {
33097
- continue;
33098
- }
33099
-
33100
- if (propKey === STYLE$1) {
33101
- {
33102
- if (nextProp) {
33103
- // Freeze the next style object so that we can assume it won't be
33104
- // mutated. We have already warned for this in the past.
33105
- Object.freeze(nextProp);
33106
- }
33107
- }
33108
-
33109
- if (lastProp) {
33110
- // Unset styles on `lastProp` but not on `nextProp`.
33111
- for (styleName in lastProp) {
33112
- if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {
33113
- if (!styleUpdates) {
33114
- styleUpdates = {};
33115
- }
33116
-
33117
- styleUpdates[styleName] = '';
33118
- }
33119
- } // Update styles that changed since `lastProp`.
33120
-
33121
-
33122
- for (styleName in nextProp) {
33123
- if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {
33124
- if (!styleUpdates) {
33125
- styleUpdates = {};
33126
- }
33127
-
33128
- styleUpdates[styleName] = nextProp[styleName];
33129
- }
33130
- }
33131
- } else {
33132
- // Relies on `updateStylesByID` not mutating `styleUpdates`.
33133
- if (!styleUpdates) {
33134
- if (!updatePayload) {
33135
- updatePayload = [];
33136
- }
33137
-
33138
- updatePayload.push(propKey, styleUpdates);
33139
- }
33140
-
33141
- styleUpdates = nextProp;
33142
- }
33143
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
33144
- var nextHtml = nextProp ? nextProp[HTML] : undefined;
33145
- var lastHtml = lastProp ? lastProp[HTML] : undefined;
33146
-
33147
- if (nextHtml != null) {
33148
- if (lastHtml !== nextHtml) {
33149
- (updatePayload = updatePayload || []).push(propKey, toStringOrTrustedType(nextHtml));
33150
- }
33151
- } else {// TODO: It might be too late to clear this if we have children
33152
- // inserted already.
33153
- }
33154
- } else if (propKey === CHILDREN) {
33155
- if (lastProp !== nextProp && (typeof nextProp === 'string' || typeof nextProp === 'number')) {
33156
- (updatePayload = updatePayload || []).push(propKey, '' + nextProp);
33157
- }
33158
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop
33159
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
33160
- if (nextProp != null) {
33161
- // We eagerly listen to this even though we haven't committed yet.
33162
- if (true && typeof nextProp !== 'function') {
33163
- warnForInvalidEventListener(propKey, nextProp);
33164
- }
33165
-
33166
- ensureListeningTo(rootContainerElement, propKey);
33167
- }
33168
-
33169
- if (!updatePayload && lastProp !== nextProp) {
33170
- // This is a special case. If any listener updates we need to ensure
33171
- // that the "current" props pointer gets updated so we need a commit
33172
- // to update this element.
33173
- updatePayload = [];
33174
- }
33175
- } else {
33176
- // For any other property we always add it to the queue and then we
33177
- // filter it out using the whitelist during the commit.
33178
- (updatePayload = updatePayload || []).push(propKey, nextProp);
33179
- }
33180
- }
33181
-
33182
- if (styleUpdates) {
33183
- {
33184
- validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE$1]);
33185
- }
33186
-
33187
- (updatePayload = updatePayload || []).push(STYLE$1, styleUpdates);
33188
- }
33189
-
33190
- return updatePayload;
33191
- } // Apply the diff.
33192
-
33193
- function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {
33194
- // Update checked *before* name.
33195
- // In the middle of an update, it is possible to have multiple checked.
33196
- // When a checked radio tries to change name, browser makes another radio's checked false.
33197
- if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {
33198
- updateChecked(domElement, nextRawProps);
33199
- }
33200
-
33201
- var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);
33202
- var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff.
33203
-
33204
- updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props
33205
- // changed.
33206
-
33207
- switch (tag) {
33208
- case 'input':
33209
- // Update the wrapper around inputs *after* updating props. This has to
33210
- // happen after `updateDOMProperties`. Otherwise HTML5 input validations
33211
- // raise warnings and prevent the new value from being assigned.
33212
- updateWrapper(domElement, nextRawProps);
33213
- break;
33214
-
33215
- case 'textarea':
33216
- updateWrapper$1(domElement, nextRawProps);
33217
- break;
33218
-
33219
- case 'select':
33220
- // <select> value update needs to occur after <option> children
33221
- // reconciliation
33222
- postUpdateWrapper(domElement, nextRawProps);
33223
- break;
33224
- }
33225
- }
33226
-
33227
- function getPossibleStandardName(propName) {
33228
- {
33229
- var lowerCasedName = propName.toLowerCase();
33230
-
33231
- if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {
33232
- return null;
33233
- }
33234
-
33235
- return possibleStandardNames[lowerCasedName] || null;
33236
- }
33237
-
33238
- return null;
33239
- }
33240
-
33241
- function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {
33242
- var isCustomComponentTag;
33243
- var extraAttributeNames;
33244
-
33245
- {
33246
- suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING$1] === true;
33247
- isCustomComponentTag = isCustomComponent(tag, rawProps);
33248
- validatePropertiesInDevelopment(tag, rawProps);
33249
-
33250
- if (isCustomComponentTag && !didWarnShadyDOM && domElement.shadyRoot) {
33251
- warning$1(false, '%s is using shady DOM. Using shady DOM with React can ' + 'cause things to break subtly.', getCurrentFiberOwnerNameInDevOrNull() || 'A component');
33252
- didWarnShadyDOM = true;
33253
- }
33254
- } // TODO: Make sure that we check isMounted before firing any of these events.
33255
-
33256
-
33257
- switch (tag) {
33258
- case 'iframe':
33259
- case 'object':
33260
- case 'embed':
33261
- trapBubbledEvent(TOP_LOAD, domElement);
33262
- break;
33263
-
33264
- case 'video':
33265
- case 'audio':
33266
- // Create listener for each media event
33267
- for (var i = 0; i < mediaEventTypes.length; i++) {
33268
- trapBubbledEvent(mediaEventTypes[i], domElement);
33269
- }
33270
-
33271
- break;
33272
-
33273
- case 'source':
33274
- trapBubbledEvent(TOP_ERROR, domElement);
33275
- break;
33276
-
33277
- case 'img':
33278
- case 'image':
33279
- case 'link':
33280
- trapBubbledEvent(TOP_ERROR, domElement);
33281
- trapBubbledEvent(TOP_LOAD, domElement);
33282
- break;
33283
-
33284
- case 'form':
33285
- trapBubbledEvent(TOP_RESET, domElement);
33286
- trapBubbledEvent(TOP_SUBMIT, domElement);
33287
- break;
33288
-
33289
- case 'details':
33290
- trapBubbledEvent(TOP_TOGGLE, domElement);
33291
- break;
33292
-
33293
- case 'input':
33294
- initWrapperState(domElement, rawProps);
33295
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
33296
- // to onChange. Even if there is no listener.
33297
-
33298
- ensureListeningTo(rootContainerElement, 'onChange');
33299
- break;
33300
-
33301
- case 'option':
33302
- validateProps(domElement, rawProps);
33303
- break;
33304
-
33305
- case 'select':
33306
- initWrapperState$1(domElement, rawProps);
33307
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
33308
- // to onChange. Even if there is no listener.
33309
-
33310
- ensureListeningTo(rootContainerElement, 'onChange');
33311
- break;
33312
-
33313
- case 'textarea':
33314
- initWrapperState$2(domElement, rawProps);
33315
- trapBubbledEvent(TOP_INVALID, domElement); // For controlled components we always need to ensure we're listening
33316
- // to onChange. Even if there is no listener.
33317
-
33318
- ensureListeningTo(rootContainerElement, 'onChange');
33319
- break;
33320
- }
33321
-
33322
- assertValidProps(tag, rawProps);
33323
-
33324
- {
33325
- extraAttributeNames = new Set();
33326
- var attributes = domElement.attributes;
33327
-
33328
- for (var _i = 0; _i < attributes.length; _i++) {
33329
- var name = attributes[_i].name.toLowerCase();
33330
-
33331
- switch (name) {
33332
- // Built-in SSR attribute is whitelisted
33333
- case 'data-reactroot':
33334
- break;
33335
- // Controlled attributes are not validated
33336
- // TODO: Only ignore them on controlled tags.
33337
-
33338
- case 'value':
33339
- break;
33340
-
33341
- case 'checked':
33342
- break;
33343
-
33344
- case 'selected':
33345
- break;
33346
-
33347
- default:
33348
- // Intentionally use the original name.
33349
- // See discussion in https://github.com/facebook/react/pull/10676.
33350
- extraAttributeNames.add(attributes[_i].name);
33351
- }
33352
- }
33353
- }
33354
-
33355
- var updatePayload = null;
33356
-
33357
- for (var propKey in rawProps) {
33358
- if (!rawProps.hasOwnProperty(propKey)) {
33359
- continue;
33360
- }
33361
-
33362
- var nextProp = rawProps[propKey];
33363
-
33364
- if (propKey === CHILDREN) {
33365
- // For text content children we compare against textContent. This
33366
- // might match additional HTML that is hidden when we read it using
33367
- // textContent. E.g. "foo" will match "f<span>oo</span>" but that still
33368
- // satisfies our requirement. Our requirement is not to produce perfect
33369
- // HTML and attributes. Ideally we should preserve structure but it's
33370
- // ok not to if the visible content is still enough to indicate what
33371
- // even listeners these nodes might be wired up to.
33372
- // TODO: Warn if there is more than a single textNode as a child.
33373
- // TODO: Should we use domElement.firstChild.nodeValue to compare?
33374
- if (typeof nextProp === 'string') {
33375
- if (domElement.textContent !== nextProp) {
33376
- if (true && !suppressHydrationWarning) {
33377
- warnForTextDifference(domElement.textContent, nextProp);
33378
- }
33379
-
33380
- updatePayload = [CHILDREN, nextProp];
33381
- }
33382
- } else if (typeof nextProp === 'number') {
33383
- if (domElement.textContent !== '' + nextProp) {
33384
- if (true && !suppressHydrationWarning) {
33385
- warnForTextDifference(domElement.textContent, nextProp);
33386
- }
33387
-
33388
- updatePayload = [CHILDREN, '' + nextProp];
33389
- }
33390
- }
33391
- } else if (registrationNameModules.hasOwnProperty(propKey)) {
33392
- if (nextProp != null) {
33393
- if (true && typeof nextProp !== 'function') {
33394
- warnForInvalidEventListener(propKey, nextProp);
33395
- }
33396
-
33397
- ensureListeningTo(rootContainerElement, propKey);
33398
- }
33399
- } else if (true && // Convince Flow we've calculated it (it's DEV-only in this method.)
33400
- typeof isCustomComponentTag === 'boolean') {
33401
- // Validate that the properties correspond to their expected values.
33402
- var serverValue = void 0;
33403
- var propertyInfo = getPropertyInfo(propKey);
33404
-
33405
- if (suppressHydrationWarning) {// Don't bother comparing. We're ignoring all these warnings.
33406
- } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1 || // Controlled attributes are not validated
33407
- // TODO: Only ignore them on controlled tags.
33408
- propKey === 'value' || propKey === 'checked' || propKey === 'selected') {// Noop
33409
- } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {
33410
- var serverHTML = domElement.innerHTML;
33411
- var nextHtml = nextProp ? nextProp[HTML] : undefined;
33412
- var expectedHTML = normalizeHTML(domElement, nextHtml != null ? nextHtml : '');
33413
-
33414
- if (expectedHTML !== serverHTML) {
33415
- warnForPropDifference(propKey, serverHTML, expectedHTML);
33416
- }
33417
- } else if (propKey === STYLE$1) {
33418
- // $FlowFixMe - Should be inferred as not undefined.
33419
- extraAttributeNames.delete(propKey);
33420
-
33421
- if (canDiffStyleForHydrationWarning) {
33422
- var expectedStyle = createDangerousStringForStyles(nextProp);
33423
- serverValue = domElement.getAttribute('style');
33424
-
33425
- if (expectedStyle !== serverValue) {
33426
- warnForPropDifference(propKey, serverValue, expectedStyle);
33427
- }
33428
- }
33429
- } else if (isCustomComponentTag) {
33430
- // $FlowFixMe - Should be inferred as not undefined.
33431
- extraAttributeNames.delete(propKey.toLowerCase());
33432
- serverValue = getValueForAttribute(domElement, propKey, nextProp);
33433
-
33434
- if (nextProp !== serverValue) {
33435
- warnForPropDifference(propKey, serverValue, nextProp);
33436
- }
33437
- } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {
33438
- var isMismatchDueToBadCasing = false;
33439
-
33440
- if (propertyInfo !== null) {
33441
- // $FlowFixMe - Should be inferred as not undefined.
33442
- extraAttributeNames.delete(propertyInfo.attributeName);
33443
- serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);
33444
- } else {
33445
- var ownNamespace = parentNamespace;
33446
-
33447
- if (ownNamespace === HTML_NAMESPACE) {
33448
- ownNamespace = getIntrinsicNamespace(tag);
33449
- }
33450
-
33451
- if (ownNamespace === HTML_NAMESPACE) {
33452
- // $FlowFixMe - Should be inferred as not undefined.
33453
- extraAttributeNames.delete(propKey.toLowerCase());
33454
- } else {
33455
- var standardName = getPossibleStandardName(propKey);
33456
-
33457
- if (standardName !== null && standardName !== propKey) {
33458
- // If an SVG prop is supplied with bad casing, it will
33459
- // be successfully parsed from HTML, but will produce a mismatch
33460
- // (and would be incorrectly rendered on the client).
33461
- // However, we already warn about bad casing elsewhere.
33462
- // So we'll skip the misleading extra mismatch warning in this case.
33463
- isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined.
33464
-
33465
- extraAttributeNames.delete(standardName);
33466
- } // $FlowFixMe - Should be inferred as not undefined.
33467
-
33468
-
33469
- extraAttributeNames.delete(propKey);
33470
- }
33471
-
33472
- serverValue = getValueForAttribute(domElement, propKey, nextProp);
33473
- }
33474
-
33475
- if (nextProp !== serverValue && !isMismatchDueToBadCasing) {
33476
- warnForPropDifference(propKey, serverValue, nextProp);
33477
- }
33478
- }
33479
- }
33480
- }
33481
-
33482
- {
33483
- // $FlowFixMe - Should be inferred as not undefined.
33484
- if (extraAttributeNames.size > 0 && !suppressHydrationWarning) {
33485
- // $FlowFixMe - Should be inferred as not undefined.
33486
- warnForExtraAttributes(extraAttributeNames);
33487
- }
33488
- }
33489
-
33490
- switch (tag) {
33491
- case 'input':
33492
- // TODO: Make sure we check if this is still unmounted or do any clean
33493
- // up necessary since we never stop tracking anymore.
33494
- track(domElement);
33495
- postMountWrapper(domElement, rawProps, true);
33496
- break;
33497
-
33498
- case 'textarea':
33499
- // TODO: Make sure we check if this is still unmounted or do any clean
33500
- // up necessary since we never stop tracking anymore.
33501
- track(domElement);
33502
- postMountWrapper$3(domElement, rawProps);
33503
- break;
33504
-
33505
- case 'select':
33506
- case 'option':
33507
- // For input and textarea we current always set the value property at
33508
- // post mount to force it to diverge from attributes. However, for
33509
- // option and select we don't quite do the same thing and select
33510
- // is not resilient to the DOM state changing so we don't do that here.
33511
- // TODO: Consider not doing this for input and textarea.
33512
- break;
33513
-
33514
- default:
33515
- if (typeof rawProps.onClick === 'function') {
33516
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
33517
- trapClickOnNonInteractiveElement(domElement);
33518
- }
33519
-
33520
- break;
33521
- }
33522
-
33523
- return updatePayload;
33524
- }
33525
- function diffHydratedText(textNode, text) {
33526
- var isDifferent = textNode.nodeValue !== text;
33527
- return isDifferent;
33528
- }
33529
- function warnForUnmatchedText(textNode, text) {
33530
- {
33531
- warnForTextDifference(textNode.nodeValue, text);
33532
- }
33533
- }
33534
- function warnForDeletedHydratableElement(parentNode, child) {
33535
- {
33536
- if (didWarnInvalidHydration) {
33537
- return;
33538
- }
33539
-
33540
- didWarnInvalidHydration = true;
33541
- warningWithoutStack$1(false, 'Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());
33542
- }
33543
- }
33544
- function warnForDeletedHydratableText(parentNode, child) {
33545
- {
33546
- if (didWarnInvalidHydration) {
33547
- return;
33548
- }
33549
-
33550
- didWarnInvalidHydration = true;
33551
- warningWithoutStack$1(false, 'Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase());
33552
- }
33553
- }
33554
- function warnForInsertedHydratedElement(parentNode, tag, props) {
33555
- {
33556
- if (didWarnInvalidHydration) {
33557
- return;
33558
- }
33559
-
33560
- didWarnInvalidHydration = true;
33561
- warningWithoutStack$1(false, 'Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase());
33562
- }
33563
- }
33564
- function warnForInsertedHydratedText(parentNode, text) {
33565
- {
33566
- if (text === '') {
33567
- // We expect to insert empty text nodes since they're not represented in
33568
- // the HTML.
33569
- // TODO: Remove this special case if we can just avoid inserting empty
33570
- // text nodes.
33571
- return;
33572
- }
33573
-
33574
- if (didWarnInvalidHydration) {
33575
- return;
33576
- }
33577
-
33578
- didWarnInvalidHydration = true;
33579
- warningWithoutStack$1(false, 'Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase());
33580
- }
33581
- }
33582
- function restoreControlledState$$1(domElement, tag, props) {
33583
- switch (tag) {
33584
- case 'input':
33585
- restoreControlledState$1(domElement, props);
33586
- return;
33587
-
33588
- case 'textarea':
33589
- restoreControlledState$3(domElement, props);
33590
- return;
33591
-
33592
- case 'select':
33593
- restoreControlledState$2(domElement, props);
33594
- return;
33595
- }
33596
- }
33597
- function listenToEventResponderEventTypes(eventTypes, element) {
33598
- if (enableFlareAPI) {
33599
- // Get the listening Set for this element. We use this to track
33600
- // what events we're listening to.
33601
- var listeningSet = getListeningSetForElement(element); // Go through each target event type of the event responder
33602
-
33603
- for (var i = 0, length = eventTypes.length; i < length; ++i) {
33604
- var eventType = eventTypes[i];
33605
- var isPassive = !endsWith(eventType, '_active');
33606
- var eventKey = isPassive ? eventType + '_passive' : eventType;
33607
- var targetEventType = isPassive ? eventType : eventType.substring(0, eventType.length - 7);
33608
-
33609
- if (!listeningSet.has(eventKey)) {
33610
- trapEventForResponderEventSystem(element, targetEventType, isPassive);
33611
- listeningSet.add(eventKey);
33612
- }
33613
- }
33614
- }
33615
- } // We can remove this once the event API is stable and out of a flag
33616
-
33617
- if (enableFlareAPI) {
33618
- setListenToResponderEventTypes(listenToEventResponderEventTypes);
33619
- }
33620
-
33621
- function getActiveElement(doc) {
33622
- doc = doc || (typeof document !== 'undefined' ? document : undefined);
33623
-
33624
- if (typeof doc === 'undefined') {
33625
- return null;
33626
- }
33627
-
33628
- try {
33629
- return doc.activeElement || doc.body;
33630
- } catch (e) {
33631
- return doc.body;
33632
- }
33633
- }
33634
-
33635
- /**
33636
- * Given any node return the first leaf node without children.
33637
- *
33638
- * @param {DOMElement|DOMTextNode} node
33639
- * @return {DOMElement|DOMTextNode}
33640
- */
33641
-
33642
- function getLeafNode(node) {
33643
- while (node && node.firstChild) {
33644
- node = node.firstChild;
33645
- }
33646
-
33647
- return node;
33648
- }
33649
- /**
33650
- * Get the next sibling within a container. This will walk up the
33651
- * DOM if a node's siblings have been exhausted.
33652
- *
33653
- * @param {DOMElement|DOMTextNode} node
33654
- * @return {?DOMElement|DOMTextNode}
33655
- */
33656
-
33657
-
33658
- function getSiblingNode(node) {
33659
- while (node) {
33660
- if (node.nextSibling) {
33661
- return node.nextSibling;
33662
- }
33663
-
33664
- node = node.parentNode;
33665
- }
33666
- }
33667
- /**
33668
- * Get object describing the nodes which contain characters at offset.
33669
- *
33670
- * @param {DOMElement|DOMTextNode} root
33671
- * @param {number} offset
33672
- * @return {?object}
33673
- */
33674
-
33675
-
33676
- function getNodeForCharacterOffset(root, offset) {
33677
- var node = getLeafNode(root);
33678
- var nodeStart = 0;
33679
- var nodeEnd = 0;
33680
-
33681
- while (node) {
33682
- if (node.nodeType === TEXT_NODE) {
33683
- nodeEnd = nodeStart + node.textContent.length;
33684
-
33685
- if (nodeStart <= offset && nodeEnd >= offset) {
33686
- return {
33687
- node: node,
33688
- offset: offset - nodeStart
33689
- };
33690
- }
33691
-
33692
- nodeStart = nodeEnd;
33693
- }
33694
-
33695
- node = getLeafNode(getSiblingNode(node));
33696
- }
33697
- }
33698
-
33699
- /**
33700
- * @param {DOMElement} outerNode
33701
- * @return {?object}
33702
- */
33703
-
33704
- function getOffsets(outerNode) {
33705
- var ownerDocument = outerNode.ownerDocument;
33706
- var win = ownerDocument && ownerDocument.defaultView || window;
33707
- var selection = win.getSelection && win.getSelection();
33708
-
33709
- if (!selection || selection.rangeCount === 0) {
33710
- return null;
33711
- }
33712
-
33713
- var anchorNode = selection.anchorNode,
33714
- anchorOffset = selection.anchorOffset,
33715
- focusNode = selection.focusNode,
33716
- focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the
33717
- // up/down buttons on an <input type="number">. Anonymous divs do not seem to
33718
- // expose properties, triggering a "Permission denied error" if any of its
33719
- // properties are accessed. The only seemingly possible way to avoid erroring
33720
- // is to access a property that typically works for non-anonymous divs and
33721
- // catch any error that may otherwise arise. See
33722
- // https://bugzilla.mozilla.org/show_bug.cgi?id=208427
33723
-
33724
- try {
33725
- /* eslint-disable no-unused-expressions */
33726
- anchorNode.nodeType;
33727
- focusNode.nodeType;
33728
- /* eslint-enable no-unused-expressions */
33729
- } catch (e) {
33730
- return null;
33731
- }
33732
-
33733
- return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);
33734
- }
33735
- /**
33736
- * Returns {start, end} where `start` is the character/codepoint index of
33737
- * (anchorNode, anchorOffset) within the textContent of `outerNode`, and
33738
- * `end` is the index of (focusNode, focusOffset).
33739
- *
33740
- * Returns null if you pass in garbage input but we should probably just crash.
33741
- *
33742
- * Exported only for testing.
33743
- */
33744
-
33745
- function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {
33746
- var length = 0;
33747
- var start = -1;
33748
- var end = -1;
33749
- var indexWithinAnchor = 0;
33750
- var indexWithinFocus = 0;
33751
- var node = outerNode;
33752
- var parentNode = null;
33753
-
33754
- outer: while (true) {
33755
- var next = null;
33756
-
33757
- while (true) {
33758
- if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {
33759
- start = length + anchorOffset;
33760
- }
33761
-
33762
- if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {
33763
- end = length + focusOffset;
33764
- }
33765
-
33766
- if (node.nodeType === TEXT_NODE) {
33767
- length += node.nodeValue.length;
33768
- }
33769
-
33770
- if ((next = node.firstChild) === null) {
33771
- break;
33772
- } // Moving from `node` to its first child `next`.
33773
-
33774
-
33775
- parentNode = node;
33776
- node = next;
33777
- }
33778
-
33779
- while (true) {
33780
- if (node === outerNode) {
33781
- // If `outerNode` has children, this is always the second time visiting
33782
- // it. If it has no children, this is still the first loop, and the only
33783
- // valid selection is anchorNode and focusNode both equal to this node
33784
- // and both offsets 0, in which case we will have handled above.
33785
- break outer;
33786
- }
33787
-
33788
- if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {
33789
- start = length;
33790
- }
33791
-
33792
- if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {
33793
- end = length;
33794
- }
33795
-
33796
- if ((next = node.nextSibling) !== null) {
33797
- break;
33798
- }
33799
-
33800
- node = parentNode;
33801
- parentNode = node.parentNode;
33802
- } // Moving from `node` to its next sibling `next`.
33803
-
33804
-
33805
- node = next;
33806
- }
33807
-
33808
- if (start === -1 || end === -1) {
33809
- // This should never happen. (Would happen if the anchor/focus nodes aren't
33810
- // actually inside the passed-in node.)
33811
- return null;
33812
- }
33813
-
33814
- return {
33815
- start: start,
33816
- end: end
33817
- };
33818
- }
33819
- /**
33820
- * In modern non-IE browsers, we can support both forward and backward
33821
- * selections.
33822
- *
33823
- * Note: IE10+ supports the Selection object, but it does not support
33824
- * the `extend` method, which means that even in modern IE, it's not possible
33825
- * to programmatically create a backward selection. Thus, for all IE
33826
- * versions, we use the old IE API to create our selections.
33827
- *
33828
- * @param {DOMElement|DOMTextNode} node
33829
- * @param {object} offsets
33830
- */
33831
-
33832
- function setOffsets(node, offsets) {
33833
- var doc = node.ownerDocument || document;
33834
- var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios.
33835
- // (For instance: TinyMCE editor used in a list component that supports pasting to add more,
33836
- // fails when pasting 100+ items)
33837
-
33838
- if (!win.getSelection) {
33839
- return;
33840
- }
33841
-
33842
- var selection = win.getSelection();
33843
- var length = node.textContent.length;
33844
- var start = Math.min(offsets.start, length);
33845
- var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method.
33846
- // Flip backward selections, so we can set with a single range.
33847
-
33848
- if (!selection.extend && start > end) {
33849
- var temp = end;
33850
- end = start;
33851
- start = temp;
33852
- }
33853
-
33854
- var startMarker = getNodeForCharacterOffset(node, start);
33855
- var endMarker = getNodeForCharacterOffset(node, end);
33856
-
33857
- if (startMarker && endMarker) {
33858
- if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {
33859
- return;
33860
- }
33861
-
33862
- var range = doc.createRange();
33863
- range.setStart(startMarker.node, startMarker.offset);
33864
- selection.removeAllRanges();
33865
-
33866
- if (start > end) {
33867
- selection.addRange(range);
33868
- selection.extend(endMarker.node, endMarker.offset);
33869
- } else {
33870
- range.setEnd(endMarker.node, endMarker.offset);
33871
- selection.addRange(range);
33872
- }
33873
- }
33874
- }
33875
-
33876
- function isTextNode(node) {
33877
- return node && node.nodeType === TEXT_NODE;
33878
- }
33879
-
33880
- function containsNode(outerNode, innerNode) {
33881
- if (!outerNode || !innerNode) {
33882
- return false;
33883
- } else if (outerNode === innerNode) {
33884
- return true;
33885
- } else if (isTextNode(outerNode)) {
33886
- return false;
33887
- } else if (isTextNode(innerNode)) {
33888
- return containsNode(outerNode, innerNode.parentNode);
33889
- } else if ('contains' in outerNode) {
33890
- return outerNode.contains(innerNode);
33891
- } else if (outerNode.compareDocumentPosition) {
33892
- return !!(outerNode.compareDocumentPosition(innerNode) & 16);
33893
- } else {
33894
- return false;
33895
- }
33896
- }
33897
-
33898
- function isInDocument(node) {
33899
- return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);
33900
- }
33901
-
33902
- function isSameOriginFrame(iframe) {
33903
- try {
33904
- // Accessing the contentDocument of a HTMLIframeElement can cause the browser
33905
- // to throw, e.g. if it has a cross-origin src attribute.
33906
- // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g:
33907
- // iframe.contentDocument.defaultView;
33908
- // A safety way is to access one of the cross origin properties: Window or Location
33909
- // Which might result in "SecurityError" DOM Exception and it is compatible to Safari.
33910
- // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl
33911
- return typeof iframe.contentWindow.location.href === 'string';
33912
- } catch (err) {
33913
- return false;
33914
- }
33915
- }
33916
-
33917
- function getActiveElementDeep() {
33918
- var win = window;
33919
- var element = getActiveElement();
33920
-
33921
- while (element instanceof win.HTMLIFrameElement) {
33922
- if (isSameOriginFrame(element)) {
33923
- win = element.contentWindow;
33924
- } else {
33925
- return element;
33926
- }
33927
-
33928
- element = getActiveElement(win.document);
33929
- }
33930
-
33931
- return element;
33932
- }
33933
- /**
33934
- * @ReactInputSelection: React input selection module. Based on Selection.js,
33935
- * but modified to be suitable for react and has a couple of bug fixes (doesn't
33936
- * assume buttons have range selections allowed).
33937
- * Input selection module for React.
33938
- */
33939
-
33940
- /**
33941
- * @hasSelectionCapabilities: we get the element types that support selection
33942
- * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart`
33943
- * and `selectionEnd` rows.
33944
- */
33945
-
33946
-
33947
- function hasSelectionCapabilities(elem) {
33948
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
33949
- return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');
33950
- }
33951
- function getSelectionInformation() {
33952
- var focusedElem = getActiveElementDeep();
33953
- return {
33954
- focusedElem: focusedElem,
33955
- selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null
33956
- };
33957
- }
33958
- /**
33959
- * @restoreSelection: If any selection information was potentially lost,
33960
- * restore it. This is useful when performing operations that could remove dom
33961
- * nodes and place them back in, resulting in focus being lost.
33962
- */
33963
-
33964
- function restoreSelection(priorSelectionInformation) {
33965
- var curFocusedElem = getActiveElementDeep();
33966
- var priorFocusedElem = priorSelectionInformation.focusedElem;
33967
- var priorSelectionRange = priorSelectionInformation.selectionRange;
33968
-
33969
- if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {
33970
- if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {
33971
- setSelection(priorFocusedElem, priorSelectionRange);
33972
- } // Focusing a node can change the scroll position, which is undesirable
33973
-
33974
-
33975
- var ancestors = [];
33976
- var ancestor = priorFocusedElem;
33977
-
33978
- while (ancestor = ancestor.parentNode) {
33979
- if (ancestor.nodeType === ELEMENT_NODE) {
33980
- ancestors.push({
33981
- element: ancestor,
33982
- left: ancestor.scrollLeft,
33983
- top: ancestor.scrollTop
33984
- });
33985
- }
33986
- }
33987
-
33988
- if (typeof priorFocusedElem.focus === 'function') {
33989
- priorFocusedElem.focus();
33990
- }
33991
-
33992
- for (var i = 0; i < ancestors.length; i++) {
33993
- var info = ancestors[i];
33994
- info.element.scrollLeft = info.left;
33995
- info.element.scrollTop = info.top;
33996
- }
33997
- }
33998
- }
33999
- /**
34000
- * @getSelection: Gets the selection bounds of a focused textarea, input or
34001
- * contentEditable node.
34002
- * -@input: Look up selection bounds of this input
34003
- * -@return {start: selectionStart, end: selectionEnd}
34004
- */
34005
-
34006
- function getSelection(input) {
34007
- var selection;
34008
-
34009
- if ('selectionStart' in input) {
34010
- // Modern browser with input or textarea.
34011
- selection = {
34012
- start: input.selectionStart,
34013
- end: input.selectionEnd
34014
- };
34015
- } else {
34016
- // Content editable or old IE textarea.
34017
- selection = getOffsets(input);
34018
- }
34019
-
34020
- return selection || {
34021
- start: 0,
34022
- end: 0
34023
- };
34024
- }
34025
- /**
34026
- * @setSelection: Sets the selection bounds of a textarea or input and focuses
34027
- * the input.
34028
- * -@input Set selection bounds of this input or textarea
34029
- * -@offsets Object of same form that is returned from get*
34030
- */
34031
-
34032
- function setSelection(input, offsets) {
34033
- var start = offsets.start,
34034
- end = offsets.end;
34035
-
34036
- if (end === undefined) {
34037
- end = start;
34038
- }
34039
-
34040
- if ('selectionStart' in input) {
34041
- input.selectionStart = start;
34042
- input.selectionEnd = Math.min(end, input.value.length);
34043
- } else {
34044
- setOffsets(input, offsets);
34045
- }
34046
- }
34047
-
34048
- var validateDOMNesting = function () {};
34049
-
34050
- var updatedAncestorInfo = function () {};
34051
-
34052
- {
34053
- // This validation code was written based on the HTML5 parsing spec:
34054
- // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
34055
- //
34056
- // Note: this does not catch all invalid nesting, nor does it try to (as it's
34057
- // not clear what practical benefit doing so provides); instead, we warn only
34058
- // for cases where the parser will give a parse tree differing from what React
34059
- // intended. For example, <b><div></div></b> is invalid but we don't warn
34060
- // because it still parses correctly; we do warn for other cases like nested
34061
- // <p> tags where the beginning of the second element implicitly closes the
34062
- // first, causing a confusing mess.
34063
- // https://html.spec.whatwg.org/multipage/syntax.html#special
34064
- var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope
34065
-
34066
- var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point
34067
- // TODO: Distinguish by namespace here -- for <title>, including it here
34068
- // errs on the side of fewer warnings
34069
- 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope
34070
-
34071
- var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags
34072
-
34073
- var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];
34074
- var emptyAncestorInfo = {
34075
- current: null,
34076
- formTag: null,
34077
- aTagInScope: null,
34078
- buttonTagInScope: null,
34079
- nobrTagInScope: null,
34080
- pTagInButtonScope: null,
34081
- listItemTagAutoclosing: null,
34082
- dlItemTagAutoclosing: null
34083
- };
34084
-
34085
- updatedAncestorInfo = function (oldInfo, tag) {
34086
- var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);
34087
-
34088
- var info = {
34089
- tag: tag
34090
- };
34091
-
34092
- if (inScopeTags.indexOf(tag) !== -1) {
34093
- ancestorInfo.aTagInScope = null;
34094
- ancestorInfo.buttonTagInScope = null;
34095
- ancestorInfo.nobrTagInScope = null;
34096
- }
34097
-
34098
- if (buttonScopeTags.indexOf(tag) !== -1) {
34099
- ancestorInfo.pTagInButtonScope = null;
34100
- } // See rules for 'li', 'dd', 'dt' start tags in
34101
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
34102
-
34103
-
34104
- if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {
34105
- ancestorInfo.listItemTagAutoclosing = null;
34106
- ancestorInfo.dlItemTagAutoclosing = null;
34107
- }
34108
-
34109
- ancestorInfo.current = info;
34110
-
34111
- if (tag === 'form') {
34112
- ancestorInfo.formTag = info;
34113
- }
34114
-
34115
- if (tag === 'a') {
34116
- ancestorInfo.aTagInScope = info;
34117
- }
34118
-
34119
- if (tag === 'button') {
34120
- ancestorInfo.buttonTagInScope = info;
34121
- }
34122
-
34123
- if (tag === 'nobr') {
34124
- ancestorInfo.nobrTagInScope = info;
34125
- }
34126
-
34127
- if (tag === 'p') {
34128
- ancestorInfo.pTagInButtonScope = info;
34129
- }
34130
-
34131
- if (tag === 'li') {
34132
- ancestorInfo.listItemTagAutoclosing = info;
34133
- }
34134
-
34135
- if (tag === 'dd' || tag === 'dt') {
34136
- ancestorInfo.dlItemTagAutoclosing = info;
34137
- }
34138
-
34139
- return ancestorInfo;
34140
- };
34141
- /**
34142
- * Returns whether
34143
- */
34144
-
34145
-
34146
- var isTagValidWithParent = function (tag, parentTag) {
34147
- // First, let's check if we're in an unusual parsing mode...
34148
- switch (parentTag) {
34149
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect
34150
- case 'select':
34151
- return tag === 'option' || tag === 'optgroup' || tag === '#text';
34152
-
34153
- case 'optgroup':
34154
- return tag === 'option' || tag === '#text';
34155
- // Strictly speaking, seeing an <option> doesn't mean we're in a <select>
34156
- // but
34157
-
34158
- case 'option':
34159
- return tag === '#text';
34160
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd
34161
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption
34162
- // No special behavior since these rules fall back to "in body" mode for
34163
- // all except special table nodes which cause bad parsing behavior anyway.
34164
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr
34165
-
34166
- case 'tr':
34167
- return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';
34168
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody
34169
-
34170
- case 'tbody':
34171
- case 'thead':
34172
- case 'tfoot':
34173
- return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';
34174
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup
34175
-
34176
- case 'colgroup':
34177
- return tag === 'col' || tag === 'template';
34178
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable
34179
-
34180
- case 'table':
34181
- return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';
34182
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead
34183
-
34184
- case 'head':
34185
- return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';
34186
- // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element
34187
-
34188
- case 'html':
34189
- return tag === 'head' || tag === 'body' || tag === 'frameset';
34190
-
34191
- case 'frameset':
34192
- return tag === 'frame';
34193
-
34194
- case '#document':
34195
- return tag === 'html';
34196
- } // Probably in the "in body" parsing mode, so we outlaw only tag combos
34197
- // where the parsing rules cause implicit opens or closes to be added.
34198
- // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
34199
-
34200
-
34201
- switch (tag) {
34202
- case 'h1':
34203
- case 'h2':
34204
- case 'h3':
34205
- case 'h4':
34206
- case 'h5':
34207
- case 'h6':
34208
- return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';
34209
-
34210
- case 'rp':
34211
- case 'rt':
34212
- return impliedEndTags.indexOf(parentTag) === -1;
34213
-
34214
- case 'body':
34215
- case 'caption':
34216
- case 'col':
34217
- case 'colgroup':
34218
- case 'frameset':
34219
- case 'frame':
34220
- case 'head':
34221
- case 'html':
34222
- case 'tbody':
34223
- case 'td':
34224
- case 'tfoot':
34225
- case 'th':
34226
- case 'thead':
34227
- case 'tr':
34228
- // These tags are only valid with a few parents that have special child
34229
- // parsing rules -- if we're down here, then none of those matched and
34230
- // so we allow it only if we don't know what the parent is, as all other
34231
- // cases are invalid.
34232
- return parentTag == null;
34233
- }
34234
-
34235
- return true;
34236
- };
34237
- /**
34238
- * Returns whether
34239
- */
34240
-
34241
-
34242
- var findInvalidAncestorForTag = function (tag, ancestorInfo) {
34243
- switch (tag) {
34244
- case 'address':
34245
- case 'article':
34246
- case 'aside':
34247
- case 'blockquote':
34248
- case 'center':
34249
- case 'details':
34250
- case 'dialog':
34251
- case 'dir':
34252
- case 'div':
34253
- case 'dl':
34254
- case 'fieldset':
34255
- case 'figcaption':
34256
- case 'figure':
34257
- case 'footer':
34258
- case 'header':
34259
- case 'hgroup':
34260
- case 'main':
34261
- case 'menu':
34262
- case 'nav':
34263
- case 'ol':
34264
- case 'p':
34265
- case 'section':
34266
- case 'summary':
34267
- case 'ul':
34268
- case 'pre':
34269
- case 'listing':
34270
- case 'table':
34271
- case 'hr':
34272
- case 'xmp':
34273
- case 'h1':
34274
- case 'h2':
34275
- case 'h3':
34276
- case 'h4':
34277
- case 'h5':
34278
- case 'h6':
34279
- return ancestorInfo.pTagInButtonScope;
34280
-
34281
- case 'form':
34282
- return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;
34283
-
34284
- case 'li':
34285
- return ancestorInfo.listItemTagAutoclosing;
34286
-
34287
- case 'dd':
34288
- case 'dt':
34289
- return ancestorInfo.dlItemTagAutoclosing;
34290
-
34291
- case 'button':
34292
- return ancestorInfo.buttonTagInScope;
34293
-
34294
- case 'a':
34295
- // Spec says something about storing a list of markers, but it sounds
34296
- // equivalent to this check.
34297
- return ancestorInfo.aTagInScope;
34298
-
34299
- case 'nobr':
34300
- return ancestorInfo.nobrTagInScope;
34301
- }
34302
-
34303
- return null;
34304
- };
34305
-
34306
- var didWarn$1 = {};
34307
-
34308
- validateDOMNesting = function (childTag, childText, ancestorInfo) {
34309
- ancestorInfo = ancestorInfo || emptyAncestorInfo;
34310
- var parentInfo = ancestorInfo.current;
34311
- var parentTag = parentInfo && parentInfo.tag;
34312
-
34313
- if (childText != null) {
34314
- !(childTag == null) ? warningWithoutStack$1(false, 'validateDOMNesting: when childText is passed, childTag should be null') : void 0;
34315
- childTag = '#text';
34316
- }
34317
-
34318
- var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;
34319
- var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);
34320
- var invalidParentOrAncestor = invalidParent || invalidAncestor;
34321
-
34322
- if (!invalidParentOrAncestor) {
34323
- return;
34324
- }
34325
-
34326
- var ancestorTag = invalidParentOrAncestor.tag;
34327
- var addendum = getCurrentFiberStackInDev();
34328
- var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag + '|' + addendum;
34329
-
34330
- if (didWarn$1[warnKey]) {
34331
- return;
34332
- }
34333
-
34334
- didWarn$1[warnKey] = true;
34335
- var tagDisplayName = childTag;
34336
- var whitespaceInfo = '';
34337
-
34338
- if (childTag === '#text') {
34339
- if (/\S/.test(childText)) {
34340
- tagDisplayName = 'Text nodes';
34341
- } else {
34342
- tagDisplayName = 'Whitespace text nodes';
34343
- whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.';
34344
- }
34345
- } else {
34346
- tagDisplayName = '<' + childTag + '>';
34347
- }
34348
-
34349
- if (invalidParent) {
34350
- var info = '';
34351
-
34352
- if (ancestorTag === 'table' && childTag === 'tr') {
34353
- info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.';
34354
- }
34355
-
34356
- warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info, addendum);
34357
- } else {
34358
- warningWithoutStack$1(false, 'validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.%s', tagDisplayName, ancestorTag, addendum);
34359
- }
34360
- };
34361
- }
34362
-
34363
- // can re-export everything from this module.
34364
-
34365
- function shim() {
34366
- {
34367
- {
34368
- throw Error("The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.");
34369
- }
34370
- }
34371
- } // Persistence (when unsupported)
34372
-
34373
-
34374
- var supportsPersistence = false;
34375
- var cloneInstance = shim;
34376
- var cloneFundamentalInstance = shim;
34377
- var createContainerChildSet = shim;
34378
- var appendChildToContainerChildSet = shim;
34379
- var finalizeContainerChildren = shim;
34380
- var replaceContainerChildren = shim;
34381
- var cloneHiddenInstance = shim;
34382
- var cloneHiddenTextInstance = shim;
34383
-
34384
- var SUPPRESS_HYDRATION_WARNING;
34385
-
34386
- {
34387
- SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';
34388
- }
34389
-
34390
- var SUSPENSE_START_DATA = '$';
34391
- var SUSPENSE_END_DATA = '/$';
34392
- var SUSPENSE_PENDING_START_DATA = '$?';
34393
- var SUSPENSE_FALLBACK_START_DATA = '$!';
34394
- var STYLE = 'style';
34395
- var eventsEnabled = null;
34396
- var selectionInformation = null;
34397
-
34398
- function shouldAutoFocusHostComponent(type, props) {
34399
- switch (type) {
34400
- case 'button':
34401
- case 'input':
34402
- case 'select':
34403
- case 'textarea':
34404
- return !!props.autoFocus;
34405
- }
34406
-
34407
- return false;
34408
- }
34409
-
34410
- function getRootHostContext(rootContainerInstance) {
34411
- var type;
34412
- var namespace;
34413
- var nodeType = rootContainerInstance.nodeType;
34414
-
34415
- switch (nodeType) {
34416
- case DOCUMENT_NODE:
34417
- case DOCUMENT_FRAGMENT_NODE:
34418
- {
34419
- type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';
34420
- var root = rootContainerInstance.documentElement;
34421
- namespace = root ? root.namespaceURI : getChildNamespace(null, '');
34422
- break;
34423
- }
34424
-
34425
- default:
34426
- {
34427
- var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;
34428
- var ownNamespace = container.namespaceURI || null;
34429
- type = container.tagName;
34430
- namespace = getChildNamespace(ownNamespace, type);
34431
- break;
34432
- }
34433
- }
34434
-
34435
- {
34436
- var validatedTag = type.toLowerCase();
34437
- var ancestorInfo = updatedAncestorInfo(null, validatedTag);
34438
- return {
34439
- namespace: namespace,
34440
- ancestorInfo: ancestorInfo
34441
- };
34442
- }
34443
-
34444
- return namespace;
34445
- }
34446
- function getChildHostContext(parentHostContext, type, rootContainerInstance) {
34447
- {
34448
- var parentHostContextDev = parentHostContext;
34449
- var namespace = getChildNamespace(parentHostContextDev.namespace, type);
34450
- var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);
34451
- return {
34452
- namespace: namespace,
34453
- ancestorInfo: ancestorInfo
34454
- };
34455
- }
34456
-
34457
- var parentNamespace = parentHostContext;
34458
- return getChildNamespace(parentNamespace, type);
34459
- }
34460
- function getPublicInstance(instance) {
34461
- return instance;
34462
- }
34463
- function prepareForCommit(containerInfo) {
34464
- eventsEnabled = isEnabled();
34465
- selectionInformation = getSelectionInformation();
34466
- setEnabled(false);
34467
- }
34468
- function resetAfterCommit(containerInfo) {
34469
- restoreSelection(selectionInformation);
34470
- selectionInformation = null;
34471
- setEnabled(eventsEnabled);
34472
- eventsEnabled = null;
34473
- }
34474
- function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
34475
- var parentNamespace;
34476
-
34477
- {
34478
- // TODO: take namespace into account when validating.
34479
- var hostContextDev = hostContext;
34480
- validateDOMNesting(type, null, hostContextDev.ancestorInfo);
34481
-
34482
- if (typeof props.children === 'string' || typeof props.children === 'number') {
34483
- var string = '' + props.children;
34484
- var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
34485
- validateDOMNesting(null, string, ownAncestorInfo);
34486
- }
34487
-
34488
- parentNamespace = hostContextDev.namespace;
34489
- }
34490
-
34491
- var domElement = createElement(type, props, rootContainerInstance, parentNamespace);
34492
- precacheFiberNode(internalInstanceHandle, domElement);
34493
- updateFiberProps(domElement, props);
34494
- return domElement;
34495
- }
34496
- function appendInitialChild(parentInstance, child) {
34497
- parentInstance.appendChild(child);
34498
- }
34499
- function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {
34500
- setInitialProperties(domElement, type, props, rootContainerInstance);
34501
- return shouldAutoFocusHostComponent(type, props);
34502
- }
34503
- function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {
34504
- {
34505
- var hostContextDev = hostContext;
34506
-
34507
- if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {
34508
- var string = '' + newProps.children;
34509
- var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);
34510
- validateDOMNesting(null, string, ownAncestorInfo);
34511
- }
34512
- }
34513
-
34514
- return diffProperties(domElement, type, oldProps, newProps, rootContainerInstance);
34515
- }
34516
- function shouldSetTextContent(type, props) {
34517
- return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;
34518
- }
34519
- function shouldDeprioritizeSubtree(type, props) {
34520
- return !!props.hidden;
34521
- }
34522
- function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {
34523
- {
34524
- var hostContextDev = hostContext;
34525
- validateDOMNesting(null, text, hostContextDev.ancestorInfo);
34526
- }
34527
-
34528
- var textNode = createTextNode(text, rootContainerInstance);
34529
- precacheFiberNode(internalInstanceHandle, textNode);
34530
- return textNode;
34531
- }
34532
- var isPrimaryRenderer = true;
34533
- var warnsIfNotActing = true; // This initialization code may run even on server environments
34534
- // if a component just imports ReactDOM (e.g. for findDOMNode).
34535
- // Some environments might not have setTimeout or clearTimeout.
34536
-
34537
- var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;
34538
- var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;
34539
- var noTimeout = -1; // -------------------
34540
- // Mutation
34541
- // -------------------
34542
-
34543
- var supportsMutation = true;
34544
- function commitMount(domElement, type, newProps, internalInstanceHandle) {
34545
- // Despite the naming that might imply otherwise, this method only
34546
- // fires if there is an `Update` effect scheduled during mounting.
34547
- // This happens if `finalizeInitialChildren` returns `true` (which it
34548
- // does to implement the `autoFocus` attribute on the client). But
34549
- // there are also other cases when this might happen (such as patching
34550
- // up text content during hydration mismatch). So we'll check this again.
34551
- if (shouldAutoFocusHostComponent(type, newProps)) {
34552
- domElement.focus();
34553
- }
34554
- }
34555
- function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {
34556
- // Update the props handle so that we know which props are the ones with
34557
- // with current event handlers.
34558
- updateFiberProps(domElement, newProps); // Apply the diff to the DOM node.
34559
-
34560
- updateProperties(domElement, updatePayload, type, oldProps, newProps);
34561
- }
34562
- function resetTextContent(domElement) {
34563
- setTextContent(domElement, '');
34564
- }
34565
- function commitTextUpdate(textInstance, oldText, newText) {
34566
- textInstance.nodeValue = newText;
34567
- }
34568
- function appendChild(parentInstance, child) {
34569
- parentInstance.appendChild(child);
34570
- }
34571
- function appendChildToContainer(container, child) {
34572
- var parentNode;
34573
-
34574
- if (container.nodeType === COMMENT_NODE) {
34575
- parentNode = container.parentNode;
34576
- parentNode.insertBefore(child, container);
34577
- } else {
34578
- parentNode = container;
34579
- parentNode.appendChild(child);
34580
- } // This container might be used for a portal.
34581
- // If something inside a portal is clicked, that click should bubble
34582
- // through the React tree. However, on Mobile Safari the click would
34583
- // never bubble through the *DOM* tree unless an ancestor with onclick
34584
- // event exists. So we wouldn't see it and dispatch it.
34585
- // This is why we ensure that non React root containers have inline onclick
34586
- // defined.
34587
- // https://github.com/facebook/react/issues/11918
34588
-
34589
-
34590
- var reactRootContainer = container._reactRootContainer;
34591
-
34592
- if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {
34593
- // TODO: This cast may not be sound for SVG, MathML or custom elements.
34594
- trapClickOnNonInteractiveElement(parentNode);
34595
- }
34596
- }
34597
- function insertBefore(parentInstance, child, beforeChild) {
34598
- parentInstance.insertBefore(child, beforeChild);
34599
- }
34600
- function insertInContainerBefore(container, child, beforeChild) {
34601
- if (container.nodeType === COMMENT_NODE) {
34602
- container.parentNode.insertBefore(child, beforeChild);
34603
- } else {
34604
- container.insertBefore(child, beforeChild);
34605
- }
34606
- } // This is a specific event for the React Flare
34607
- // event system, so event responders can act
34608
- // accordingly to a DOM node being unmounted that
34609
- // previously had active document focus.
34610
-
34611
- function dispatchDetachedVisibleNodeEvent(child) {
34612
- if (enableFlareAPI && selectionInformation && child === selectionInformation.focusedElem) {
34613
- var targetFiber = getClosestInstanceFromNode(child); // Simlulate a blur event to the React Flare responder system.
34614
-
34615
- dispatchEventForResponderEventSystem('detachedvisiblenode', targetFiber, {
34616
- target: child,
34617
- timeStamp: Date.now()
34618
- }, child, RESPONDER_EVENT_SYSTEM | IS_PASSIVE);
34619
- }
34620
- }
34621
-
34622
- function removeChild(parentInstance, child) {
34623
- dispatchDetachedVisibleNodeEvent(child);
34624
- parentInstance.removeChild(child);
34625
- }
34626
- function removeChildFromContainer(container, child) {
34627
- if (container.nodeType === COMMENT_NODE) {
34628
- container.parentNode.removeChild(child);
34629
- } else {
34630
- dispatchDetachedVisibleNodeEvent(child);
34631
- container.removeChild(child);
34632
- }
34633
- }
34634
- function clearSuspenseBoundary(parentInstance, suspenseInstance) {
34635
- var node = suspenseInstance; // Delete all nodes within this suspense boundary.
34636
- // There might be nested nodes so we need to keep track of how
34637
- // deep we are and only break out when we're back on top.
34638
-
34639
- var depth = 0;
34640
-
34641
- do {
34642
- var nextNode = node.nextSibling;
34643
- parentInstance.removeChild(node);
34644
-
34645
- if (nextNode && nextNode.nodeType === COMMENT_NODE) {
34646
- var data = nextNode.data;
34647
-
34648
- if (data === SUSPENSE_END_DATA) {
34649
- if (depth === 0) {
34650
- parentInstance.removeChild(nextNode); // Retry if any event replaying was blocked on this.
34651
-
34652
- retryIfBlockedOn(suspenseInstance);
34653
- return;
34654
- } else {
34655
- depth--;
34656
- }
34657
- } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) {
34658
- depth++;
34659
- }
34660
- }
34661
-
34662
- node = nextNode;
34663
- } while (node); // TODO: Warn, we didn't find the end comment boundary.
34664
- // Retry if any event replaying was blocked on this.
34665
-
34666
-
34667
- retryIfBlockedOn(suspenseInstance);
34668
- }
34669
- function clearSuspenseBoundaryFromContainer(container, suspenseInstance) {
34670
- if (container.nodeType === COMMENT_NODE) {
34671
- clearSuspenseBoundary(container.parentNode, suspenseInstance);
34672
- } else if (container.nodeType === ELEMENT_NODE) {
34673
- clearSuspenseBoundary(container, suspenseInstance);
34674
- } else {} // Document nodes should never contain suspense boundaries.
34675
- // Retry if any event replaying was blocked on this.
34676
-
34677
-
34678
- retryIfBlockedOn(container);
34679
- }
34680
- function hideInstance(instance) {
34681
- // TODO: Does this work for all element types? What about MathML? Should we
34682
- // pass host context to this method?
34683
- instance = instance;
34684
- var style = instance.style;
34685
-
34686
- if (typeof style.setProperty === 'function') {
34687
- style.setProperty('display', 'none', 'important');
34688
- } else {
34689
- style.display = 'none';
34690
- }
34691
- }
34692
- function hideTextInstance(textInstance) {
34693
- textInstance.nodeValue = '';
34694
- }
34695
- function unhideInstance(instance, props) {
34696
- instance = instance;
34697
- var styleProp = props[STYLE];
34698
- var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;
34699
- instance.style.display = dangerousStyleValue('display', display);
34700
- }
34701
- function unhideTextInstance(textInstance, text) {
34702
- textInstance.nodeValue = text;
34703
- } // -------------------
34704
- // Hydration
34705
- // -------------------
34706
-
34707
- var supportsHydration = true;
34708
- function canHydrateInstance(instance, type, props) {
34709
- if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {
34710
- return null;
34711
- } // This has now been refined to an element node.
34712
-
34713
-
34714
- return instance;
34715
- }
34716
- function canHydrateTextInstance(instance, text) {
34717
- if (text === '' || instance.nodeType !== TEXT_NODE) {
34718
- // Empty strings are not parsed by HTML so there won't be a correct match here.
34719
- return null;
34720
- } // This has now been refined to a text node.
34721
-
34722
-
34723
- return instance;
34724
- }
34725
- function canHydrateSuspenseInstance(instance) {
34726
- if (instance.nodeType !== COMMENT_NODE) {
34727
- // Empty strings are not parsed by HTML so there won't be a correct match here.
34728
- return null;
34729
- } // This has now been refined to a suspense node.
34730
-
34731
-
34732
- return instance;
34733
- }
34734
- function isSuspenseInstancePending(instance) {
34735
- return instance.data === SUSPENSE_PENDING_START_DATA;
34736
- }
34737
- function isSuspenseInstanceFallback(instance) {
34738
- return instance.data === SUSPENSE_FALLBACK_START_DATA;
34739
- }
34740
- function registerSuspenseInstanceRetry(instance, callback) {
34741
- instance._reactRetry = callback;
34742
- }
34743
-
34744
- function getNextHydratable(node) {
34745
- // Skip non-hydratable nodes.
34746
- for (; node != null; node = node.nextSibling) {
34747
- var nodeType = node.nodeType;
34748
-
34749
- if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {
34750
- break;
34751
- }
34752
-
34753
- if (enableSuspenseServerRenderer) {
34754
- if (nodeType === COMMENT_NODE) {
34755
- var nodeData = node.data;
34756
-
34757
- if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) {
34758
- break;
34759
- }
34760
- }
34761
- }
34762
- }
34763
-
34764
- return node;
34765
- }
34766
-
34767
- function getNextHydratableSibling(instance) {
34768
- return getNextHydratable(instance.nextSibling);
34769
- }
34770
- function getFirstHydratableChild(parentInstance) {
34771
- return getNextHydratable(parentInstance.firstChild);
34772
- }
34773
- function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {
34774
- precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events
34775
- // get attached.
34776
-
34777
- updateFiberProps(instance, props);
34778
- var parentNamespace;
34779
-
34780
- {
34781
- var hostContextDev = hostContext;
34782
- parentNamespace = hostContextDev.namespace;
34783
- }
34784
-
34785
- return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance);
34786
- }
34787
- function hydrateTextInstance(textInstance, text, internalInstanceHandle) {
34788
- precacheFiberNode(internalInstanceHandle, textInstance);
34789
- return diffHydratedText(textInstance, text);
34790
- }
34791
- function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) {
34792
- precacheFiberNode(internalInstanceHandle, suspenseInstance);
34793
- }
34794
- function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {
34795
- var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary.
34796
- // There might be nested nodes so we need to keep track of how
34797
- // deep we are and only break out when we're back on top.
34798
-
34799
- var depth = 0;
34800
-
34801
- while (node) {
34802
- if (node.nodeType === COMMENT_NODE) {
34803
- var data = node.data;
34804
-
34805
- if (data === SUSPENSE_END_DATA) {
34806
- if (depth === 0) {
34807
- return getNextHydratableSibling(node);
34808
- } else {
34809
- depth--;
34810
- }
34811
- } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
34812
- depth++;
34813
- }
34814
- }
34815
-
34816
- node = node.nextSibling;
34817
- } // TODO: Warn, we didn't find the end comment boundary.
34818
-
34819
-
34820
- return null;
34821
- } // Returns the SuspenseInstance if this node is a direct child of a
34822
- // SuspenseInstance. I.e. if its previous sibling is a Comment with
34823
- // SUSPENSE_x_START_DATA. Otherwise, null.
34824
-
34825
- function getParentSuspenseInstance(targetInstance) {
34826
- var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary.
34827
- // There might be nested nodes so we need to keep track of how
34828
- // deep we are and only break out when we're back on top.
34829
-
34830
- var depth = 0;
34831
-
34832
- while (node) {
34833
- if (node.nodeType === COMMENT_NODE) {
34834
- var data = node.data;
34835
-
34836
- if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {
34837
- if (depth === 0) {
34838
- return node;
34839
- } else {
34840
- depth--;
34841
- }
34842
- } else if (data === SUSPENSE_END_DATA) {
34843
- depth++;
34844
- }
34845
- }
34846
-
34847
- node = node.previousSibling;
34848
- }
34849
-
34850
- return null;
34851
- }
34852
- function commitHydratedContainer(container) {
34853
- // Retry if any event replaying was blocked on this.
34854
- retryIfBlockedOn(container);
34855
- }
34856
- function commitHydratedSuspenseInstance(suspenseInstance) {
34857
- // Retry if any event replaying was blocked on this.
34858
- retryIfBlockedOn(suspenseInstance);
34859
- }
34860
- function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {
34861
- {
34862
- warnForUnmatchedText(textInstance, text);
34863
- }
34864
- }
34865
- function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {
34866
- if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
34867
- warnForUnmatchedText(textInstance, text);
34868
- }
34869
- }
34870
- function didNotHydrateContainerInstance(parentContainer, instance) {
34871
- {
34872
- if (instance.nodeType === ELEMENT_NODE) {
34873
- warnForDeletedHydratableElement(parentContainer, instance);
34874
- } else if (instance.nodeType === COMMENT_NODE) {// TODO: warnForDeletedHydratableSuspenseBoundary
34875
- } else {
34876
- warnForDeletedHydratableText(parentContainer, instance);
34877
- }
34878
- }
34879
- }
34880
- function didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {
34881
- if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
34882
- if (instance.nodeType === ELEMENT_NODE) {
34883
- warnForDeletedHydratableElement(parentInstance, instance);
34884
- } else if (instance.nodeType === COMMENT_NODE) {// TODO: warnForDeletedHydratableSuspenseBoundary
34885
- } else {
34886
- warnForDeletedHydratableText(parentInstance, instance);
34887
- }
34888
- }
34889
- }
34890
- function didNotFindHydratableContainerInstance(parentContainer, type, props) {
34891
- {
34892
- warnForInsertedHydratedElement(parentContainer, type, props);
34893
- }
34894
- }
34895
- function didNotFindHydratableContainerTextInstance(parentContainer, text) {
34896
- {
34897
- warnForInsertedHydratedText(parentContainer, text);
34898
- }
34899
- }
34900
-
34901
- function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {
34902
- if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
34903
- warnForInsertedHydratedElement(parentInstance, type, props);
34904
- }
34905
- }
34906
- function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {
34907
- if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {
34908
- warnForInsertedHydratedText(parentInstance, text);
34909
- }
34910
- }
34911
- function didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {
34912
- if (true && parentProps[SUPPRESS_HYDRATION_WARNING] !== true) {// TODO: warnForInsertedHydratedSuspense(parentInstance);
34913
- }
34914
- }
34915
- function mountResponderInstance(responder, responderInstance, responderProps, responderState, instance) {
34916
- // Listen to events
34917
- var doc = instance.ownerDocument;
34918
- var _ref = responder,
34919
- rootEventTypes = _ref.rootEventTypes,
34920
- targetEventTypes = _ref.targetEventTypes;
34921
-
34922
- if (targetEventTypes !== null) {
34923
- listenToEventResponderEventTypes(targetEventTypes, doc);
34924
- }
34925
-
34926
- if (rootEventTypes !== null) {
34927
- addRootEventTypesForResponderInstance(responderInstance, rootEventTypes);
34928
- listenToEventResponderEventTypes(rootEventTypes, doc);
34929
- }
34930
-
34931
- mountEventResponder(responder, responderInstance, responderProps, responderState);
34932
- return responderInstance;
34933
- }
34934
- function unmountResponderInstance(responderInstance) {
34935
- if (enableFlareAPI) {
34936
- // TODO stop listening to targetEventTypes
34937
- unmountEventResponder(responderInstance);
34938
- }
34939
- }
34940
- function getFundamentalComponentInstance(fundamentalInstance) {
34941
- if (enableFundamentalAPI) {
34942
- var currentFiber = fundamentalInstance.currentFiber,
34943
- impl = fundamentalInstance.impl,
34944
- props = fundamentalInstance.props,
34945
- state = fundamentalInstance.state;
34946
- var instance = impl.getInstance(null, props, state);
34947
- precacheFiberNode(currentFiber, instance);
34948
- return instance;
34949
- } // Because of the flag above, this gets around the Flow error;
34950
-
34951
-
34952
- return null;
34953
- }
34954
- function mountFundamentalComponent(fundamentalInstance) {
34955
- if (enableFundamentalAPI) {
34956
- var impl = fundamentalInstance.impl,
34957
- instance = fundamentalInstance.instance,
34958
- props = fundamentalInstance.props,
34959
- state = fundamentalInstance.state;
34960
- var onMount = impl.onMount;
34961
-
34962
- if (onMount !== undefined) {
34963
- onMount(null, instance, props, state);
34964
- }
34965
- }
34966
- }
34967
- function shouldUpdateFundamentalComponent(fundamentalInstance) {
34968
- if (enableFundamentalAPI) {
34969
- var impl = fundamentalInstance.impl,
34970
- prevProps = fundamentalInstance.prevProps,
34971
- props = fundamentalInstance.props,
34972
- state = fundamentalInstance.state;
34973
- var shouldUpdate = impl.shouldUpdate;
34974
-
34975
- if (shouldUpdate !== undefined) {
34976
- return shouldUpdate(null, prevProps, props, state);
34977
- }
34978
- }
34979
-
34980
- return true;
34981
- }
34982
- function updateFundamentalComponent(fundamentalInstance) {
34983
- if (enableFundamentalAPI) {
34984
- var impl = fundamentalInstance.impl,
34985
- instance = fundamentalInstance.instance,
34986
- prevProps = fundamentalInstance.prevProps,
34987
- props = fundamentalInstance.props,
34988
- state = fundamentalInstance.state;
34989
- var onUpdate = impl.onUpdate;
34990
-
34991
- if (onUpdate !== undefined) {
34992
- onUpdate(null, instance, prevProps, props, state);
34993
- }
34994
- }
34995
- }
34996
- function unmountFundamentalComponent(fundamentalInstance) {
34997
- if (enableFundamentalAPI) {
34998
- var impl = fundamentalInstance.impl,
34999
- instance = fundamentalInstance.instance,
35000
- props = fundamentalInstance.props,
35001
- state = fundamentalInstance.state;
35002
- var onUnmount = impl.onUnmount;
35003
-
35004
- if (onUnmount !== undefined) {
35005
- onUnmount(null, instance, props, state);
35006
- }
35007
- }
35008
- }
35009
- function getInstanceFromNode$2(node) {
35010
- return getClosestInstanceFromNode(node) || null;
35011
- }
35012
-
35013
- var randomKey = Math.random().toString(36).slice(2);
35014
- var internalInstanceKey = '__reactInternalInstance$' + randomKey;
35015
- var internalEventHandlersKey = '__reactEventHandlers$' + randomKey;
35016
- var internalContainerInstanceKey = '__reactContainere$' + randomKey;
35017
- function precacheFiberNode(hostInst, node) {
35018
- node[internalInstanceKey] = hostInst;
35019
- }
35020
- function markContainerAsRoot(hostRoot, node) {
35021
- node[internalContainerInstanceKey] = hostRoot;
35022
- }
35023
- function unmarkContainerAsRoot(node) {
35024
- node[internalContainerInstanceKey] = null;
35025
- }
35026
- function isContainerMarkedAsRoot(node) {
35027
- return !!node[internalContainerInstanceKey];
35028
- } // Given a DOM node, return the closest HostComponent or HostText fiber ancestor.
35029
- // If the target node is part of a hydrated or not yet rendered subtree, then
35030
- // this may also return a SuspenseComponent or HostRoot to indicate that.
35031
- // Conceptually the HostRoot fiber is a child of the Container node. So if you
35032
- // pass the Container node as the targetNode, you will not actually get the
35033
- // HostRoot back. To get to the HostRoot, you need to pass a child of it.
35034
- // The same thing applies to Suspense boundaries.
35035
-
35036
- function getClosestInstanceFromNode(targetNode) {
35037
- var targetInst = targetNode[internalInstanceKey];
35038
-
35039
- if (targetInst) {
35040
- // Don't return HostRoot or SuspenseComponent here.
35041
- return targetInst;
35042
- } // If the direct event target isn't a React owned DOM node, we need to look
35043
- // to see if one of its parents is a React owned DOM node.
35044
-
35045
-
35046
- var parentNode = targetNode.parentNode;
35047
-
35048
- while (parentNode) {
35049
- // We'll check if this is a container root that could include
35050
- // React nodes in the future. We need to check this first because
35051
- // if we're a child of a dehydrated container, we need to first
35052
- // find that inner container before moving on to finding the parent
35053
- // instance. Note that we don't check this field on the targetNode
35054
- // itself because the fibers are conceptually between the container
35055
- // node and the first child. It isn't surrounding the container node.
35056
- // If it's not a container, we check if it's an instance.
35057
- targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];
35058
-
35059
- if (targetInst) {
35060
- // Since this wasn't the direct target of the event, we might have
35061
- // stepped past dehydrated DOM nodes to get here. However they could
35062
- // also have been non-React nodes. We need to answer which one.
35063
- // If we the instance doesn't have any children, then there can't be
35064
- // a nested suspense boundary within it. So we can use this as a fast
35065
- // bailout. Most of the time, when people add non-React children to
35066
- // the tree, it is using a ref to a child-less DOM node.
35067
- // Normally we'd only need to check one of the fibers because if it
35068
- // has ever gone from having children to deleting them or vice versa
35069
- // it would have deleted the dehydrated boundary nested inside already.
35070
- // However, since the HostRoot starts out with an alternate it might
35071
- // have one on the alternate so we need to check in case this was a
35072
- // root.
35073
- var alternate = targetInst.alternate;
35074
-
35075
- if (targetInst.child !== null || alternate !== null && alternate.child !== null) {
35076
- // Next we need to figure out if the node that skipped past is
35077
- // nested within a dehydrated boundary and if so, which one.
35078
- var suspenseInstance = getParentSuspenseInstance(targetNode);
35079
-
35080
- while (suspenseInstance !== null) {
35081
- // We found a suspense instance. That means that we haven't
35082
- // hydrated it yet. Even though we leave the comments in the
35083
- // DOM after hydrating, and there are boundaries in the DOM
35084
- // that could already be hydrated, we wouldn't have found them
35085
- // through this pass since if the target is hydrated it would
35086
- // have had an internalInstanceKey on it.
35087
- // Let's get the fiber associated with the SuspenseComponent
35088
- // as the deepest instance.
35089
- var targetSuspenseInst = suspenseInstance[internalInstanceKey];
35090
-
35091
- if (targetSuspenseInst) {
35092
- return targetSuspenseInst;
35093
- } // If we don't find a Fiber on the comment, it might be because
35094
- // we haven't gotten to hydrate it yet. There might still be a
35095
- // parent boundary that hasn't above this one so we need to find
35096
- // the outer most that is known.
35097
-
35098
-
35099
- suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent
35100
- // host component also hasn't hydrated yet. We can return it
35101
- // below since it will bail out on the isMounted check later.
35102
- }
35103
- }
35104
-
35105
- return targetInst;
35106
- }
35107
-
35108
- targetNode = parentNode;
35109
- parentNode = targetNode.parentNode;
35110
- }
35111
-
35112
- return null;
35113
- }
35114
- /**
35115
- * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent
35116
- * instance, or null if the node was not rendered by this React.
35117
- */
35118
-
35119
- function getInstanceFromNode$1(node) {
35120
- var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];
35121
-
35122
- if (inst) {
35123
- if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {
35124
- return inst;
35125
- } else {
35126
- return null;
35127
- }
35128
- }
35129
-
35130
- return null;
35131
- }
35132
- /**
35133
- * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding
35134
- * DOM node.
35135
- */
35136
-
35137
- function getNodeFromInstance$1(inst) {
35138
- if (inst.tag === HostComponent || inst.tag === HostText) {
35139
- // In Fiber this, is just the state node right now. We assume it will be
35140
- // a host component or host text.
35141
- return inst.stateNode;
35142
- } // Without this first invariant, passing a non-DOM-component triggers the next
35143
- // invariant for a missing parent, which is super confusing.
35144
-
35145
-
35146
- {
35147
- {
35148
- throw Error("getNodeFromInstance: Invalid argument.");
35149
- }
35150
- }
35151
- }
35152
- function getFiberCurrentPropsFromNode$1(node) {
35153
- return node[internalEventHandlersKey] || null;
35154
- }
35155
- function updateFiberProps(node, props) {
35156
- node[internalEventHandlersKey] = props;
35157
- }
35158
-
35159
- /**
35160
- * These variables store information about text content of a target node,
35161
- * allowing comparison of content before and after a given event.
35162
- *
35163
- * Identify the node where selection currently begins, then observe
35164
- * both its text content and its current position in the DOM. Since the
35165
- * browser may natively replace the target node during composition, we can
35166
- * use its position to find its replacement.
35167
- *
35168
- *
35169
- */
35170
- var root = null;
35171
- var startText = null;
35172
- var fallbackText = null;
35173
- function initialize(nativeEventTarget) {
35174
- root = nativeEventTarget;
35175
- startText = getText();
35176
- return true;
35177
- }
35178
- function reset() {
35179
- root = null;
35180
- startText = null;
35181
- fallbackText = null;
35182
- }
35183
- function getData() {
35184
- if (fallbackText) {
35185
- return fallbackText;
35186
- }
35187
-
35188
- var start;
35189
- var startValue = startText;
35190
- var startLength = startValue.length;
35191
- var end;
35192
- var endValue = getText();
35193
- var endLength = endValue.length;
35194
-
35195
- for (start = 0; start < startLength; start++) {
35196
- if (startValue[start] !== endValue[start]) {
35197
- break;
35198
- }
35199
- }
35200
-
35201
- var minEnd = startLength - start;
35202
-
35203
- for (end = 1; end <= minEnd; end++) {
35204
- if (startValue[startLength - end] !== endValue[endLength - end]) {
35205
- break;
35206
- }
35207
- }
35208
-
35209
- var sliceTail = end > 1 ? 1 - end : undefined;
35210
- fallbackText = endValue.slice(start, sliceTail);
35211
- return fallbackText;
35212
- }
35213
- function getText() {
35214
- if ('value' in root) {
35215
- return root.value;
35216
- }
35217
-
35218
- return root.textContent;
35219
- }
35220
-
35221
- /**
35222
- * @interface Event
35223
- * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents
35224
- */
35225
-
35226
- var SyntheticCompositionEvent = SyntheticEvent.extend({
35227
- data: null
35228
- });
35229
-
35230
- /**
35231
- * @interface Event
35232
- * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105
35233
- * /#events-inputevents
35234
- */
35235
-
35236
- var SyntheticInputEvent = SyntheticEvent.extend({
35237
- data: null
35238
- });
35239
-
35240
- var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space
35241
-
35242
- var START_KEYCODE = 229;
35243
- var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;
35244
- var documentMode = null;
35245
-
35246
- if (canUseDOM && 'documentMode' in document) {
35247
- documentMode = document.documentMode;
35248
- } // Webkit offers a very useful `textInput` event that can be used to
35249
- // directly represent `beforeInput`. The IE `textinput` event is not as
35250
- // useful, so we don't use it.
35251
-
35252
-
35253
- var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied
35254
- // by the native compositionend event may be incorrect. Japanese ideographic
35255
- // spaces, for instance (\u3000) are not recorded correctly.
35256
-
35257
- var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11);
35258
- var SPACEBAR_CODE = 32;
35259
- var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); // Events and their corresponding property names.
35260
-
35261
- var eventTypes$1 = {
35262
- beforeInput: {
35263
- phasedRegistrationNames: {
35264
- bubbled: 'onBeforeInput',
35265
- captured: 'onBeforeInputCapture'
35266
- },
35267
- dependencies: [TOP_COMPOSITION_END, TOP_KEY_PRESS, TOP_TEXT_INPUT, TOP_PASTE]
35268
- },
35269
- compositionEnd: {
35270
- phasedRegistrationNames: {
35271
- bubbled: 'onCompositionEnd',
35272
- captured: 'onCompositionEndCapture'
35273
- },
35274
- dependencies: [TOP_BLUR, TOP_COMPOSITION_END, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
35275
- },
35276
- compositionStart: {
35277
- phasedRegistrationNames: {
35278
- bubbled: 'onCompositionStart',
35279
- captured: 'onCompositionStartCapture'
35280
- },
35281
- dependencies: [TOP_BLUR, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
35282
- },
35283
- compositionUpdate: {
35284
- phasedRegistrationNames: {
35285
- bubbled: 'onCompositionUpdate',
35286
- captured: 'onCompositionUpdateCapture'
35287
- },
35288
- dependencies: [TOP_BLUR, TOP_COMPOSITION_UPDATE, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_MOUSE_DOWN]
35289
- }
35290
- }; // Track whether we've ever handled a keypress on the space key.
35291
-
35292
- var hasSpaceKeypress = false;
35293
- /**
35294
- * Return whether a native keypress event is assumed to be a command.
35295
- * This is required because Firefox fires `keypress` events for key commands
35296
- * (cut, copy, select-all, etc.) even though no character is inserted.
35297
- */
35298
-
35299
- function isKeypressCommand(nativeEvent) {
35300
- return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command.
35301
- !(nativeEvent.ctrlKey && nativeEvent.altKey);
35302
- }
35303
- /**
35304
- * Translate native top level events into event types.
35305
- *
35306
- * @param {string} topLevelType
35307
- * @return {object}
35308
- */
35309
-
35310
-
35311
- function getCompositionEventType(topLevelType) {
35312
- switch (topLevelType) {
35313
- case TOP_COMPOSITION_START:
35314
- return eventTypes$1.compositionStart;
35315
-
35316
- case TOP_COMPOSITION_END:
35317
- return eventTypes$1.compositionEnd;
35318
-
35319
- case TOP_COMPOSITION_UPDATE:
35320
- return eventTypes$1.compositionUpdate;
35321
- }
35322
- }
35323
- /**
35324
- * Does our fallback best-guess model think this event signifies that
35325
- * composition has begun?
35326
- *
35327
- * @param {string} topLevelType
35328
- * @param {object} nativeEvent
35329
- * @return {boolean}
35330
- */
35331
-
35332
-
35333
- function isFallbackCompositionStart(topLevelType, nativeEvent) {
35334
- return topLevelType === TOP_KEY_DOWN && nativeEvent.keyCode === START_KEYCODE;
35335
- }
35336
- /**
35337
- * Does our fallback mode think that this event is the end of composition?
35338
- *
35339
- * @param {string} topLevelType
35340
- * @param {object} nativeEvent
35341
- * @return {boolean}
35342
- */
35343
-
35344
-
35345
- function isFallbackCompositionEnd(topLevelType, nativeEvent) {
35346
- switch (topLevelType) {
35347
- case TOP_KEY_UP:
35348
- // Command keys insert or clear IME input.
35349
- return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
35350
-
35351
- case TOP_KEY_DOWN:
35352
- // Expect IME keyCode on each keydown. If we get any other
35353
- // code we must have exited earlier.
35354
- return nativeEvent.keyCode !== START_KEYCODE;
35355
-
35356
- case TOP_KEY_PRESS:
35357
- case TOP_MOUSE_DOWN:
35358
- case TOP_BLUR:
35359
- // Events are not possible without cancelling IME.
35360
- return true;
35361
-
35362
- default:
35363
- return false;
35364
- }
35365
- }
35366
- /**
35367
- * Google Input Tools provides composition data via a CustomEvent,
35368
- * with the `data` property populated in the `detail` object. If this
35369
- * is available on the event object, use it. If not, this is a plain
35370
- * composition event and we have nothing special to extract.
35371
- *
35372
- * @param {object} nativeEvent
35373
- * @return {?string}
35374
- */
35375
-
35376
-
35377
- function getDataFromCustomEvent(nativeEvent) {
35378
- var detail = nativeEvent.detail;
35379
-
35380
- if (typeof detail === 'object' && 'data' in detail) {
35381
- return detail.data;
35382
- }
35383
-
35384
- return null;
35385
- }
35386
- /**
35387
- * Check if a composition event was triggered by Korean IME.
35388
- * Our fallback mode does not work well with IE's Korean IME,
35389
- * so just use native composition events when Korean IME is used.
35390
- * Although CompositionEvent.locale property is deprecated,
35391
- * it is available in IE, where our fallback mode is enabled.
35392
- *
35393
- * @param {object} nativeEvent
35394
- * @return {boolean}
35395
- */
35396
-
35397
-
35398
- function isUsingKoreanIME(nativeEvent) {
35399
- return nativeEvent.locale === 'ko';
35400
- } // Track the current IME composition status, if any.
35401
-
35402
-
35403
- var isComposing = false;
35404
- /**
35405
- * @return {?object} A SyntheticCompositionEvent.
35406
- */
35407
-
35408
- function extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
35409
- var eventType;
35410
- var fallbackData;
35411
-
35412
- if (canUseCompositionEvent) {
35413
- eventType = getCompositionEventType(topLevelType);
35414
- } else if (!isComposing) {
35415
- if (isFallbackCompositionStart(topLevelType, nativeEvent)) {
35416
- eventType = eventTypes$1.compositionStart;
35417
- }
35418
- } else if (isFallbackCompositionEnd(topLevelType, nativeEvent)) {
35419
- eventType = eventTypes$1.compositionEnd;
35420
- }
35421
-
35422
- if (!eventType) {
35423
- return null;
35424
- }
35425
-
35426
- if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {
35427
- // The current composition is stored statically and must not be
35428
- // overwritten while composition continues.
35429
- if (!isComposing && eventType === eventTypes$1.compositionStart) {
35430
- isComposing = initialize(nativeEventTarget);
35431
- } else if (eventType === eventTypes$1.compositionEnd) {
35432
- if (isComposing) {
35433
- fallbackData = getData();
35434
- }
35435
- }
35436
- }
35437
-
35438
- var event = SyntheticCompositionEvent.getPooled(eventType, targetInst, nativeEvent, nativeEventTarget);
35439
-
35440
- if (fallbackData) {
35441
- // Inject data generated from fallback path into the synthetic event.
35442
- // This matches the property of native CompositionEventInterface.
35443
- event.data = fallbackData;
35444
- } else {
35445
- var customData = getDataFromCustomEvent(nativeEvent);
35446
-
35447
- if (customData !== null) {
35448
- event.data = customData;
35449
- }
35450
- }
35451
-
35452
- accumulateTwoPhaseDispatches(event);
35453
- return event;
35454
- }
35455
- /**
35456
- * @param {TopLevelType} topLevelType Number from `TopLevelType`.
35457
- * @param {object} nativeEvent Native browser event.
35458
- * @return {?string} The string corresponding to this `beforeInput` event.
35459
- */
35460
-
35461
-
35462
- function getNativeBeforeInputChars(topLevelType, nativeEvent) {
35463
- switch (topLevelType) {
35464
- case TOP_COMPOSITION_END:
35465
- return getDataFromCustomEvent(nativeEvent);
35466
-
35467
- case TOP_KEY_PRESS:
35468
- /**
35469
- * If native `textInput` events are available, our goal is to make
35470
- * use of them. However, there is a special case: the spacebar key.
35471
- * In Webkit, preventing default on a spacebar `textInput` event
35472
- * cancels character insertion, but it *also* causes the browser
35473
- * to fall back to its default spacebar behavior of scrolling the
35474
- * page.
35475
- *
35476
- * Tracking at:
35477
- * https://code.google.com/p/chromium/issues/detail?id=355103
35478
- *
35479
- * To avoid this issue, use the keypress event as if no `textInput`
35480
- * event is available.
35481
- */
35482
- var which = nativeEvent.which;
35483
-
35484
- if (which !== SPACEBAR_CODE) {
35485
- return null;
35486
- }
35487
-
35488
- hasSpaceKeypress = true;
35489
- return SPACEBAR_CHAR;
35490
-
35491
- case TOP_TEXT_INPUT:
35492
- // Record the characters to be added to the DOM.
35493
- var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled
35494
- // it at the keypress level and bail immediately. Android Chrome
35495
- // doesn't give us keycodes, so we need to ignore it.
35496
-
35497
- if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {
35498
- return null;
35499
- }
35500
-
35501
- return chars;
35502
-
35503
- default:
35504
- // For other native event types, do nothing.
35505
- return null;
35506
- }
35507
- }
35508
- /**
35509
- * For browsers that do not provide the `textInput` event, extract the
35510
- * appropriate string to use for SyntheticInputEvent.
35511
- *
35512
- * @param {number} topLevelType Number from `TopLevelEventTypes`.
35513
- * @param {object} nativeEvent Native browser event.
35514
- * @return {?string} The fallback string for this `beforeInput` event.
35515
- */
35516
-
35517
-
35518
- function getFallbackBeforeInputChars(topLevelType, nativeEvent) {
35519
- // If we are currently composing (IME) and using a fallback to do so,
35520
- // try to extract the composed characters from the fallback object.
35521
- // If composition event is available, we extract a string only at
35522
- // compositionevent, otherwise extract it at fallback events.
35523
- if (isComposing) {
35524
- if (topLevelType === TOP_COMPOSITION_END || !canUseCompositionEvent && isFallbackCompositionEnd(topLevelType, nativeEvent)) {
35525
- var chars = getData();
35526
- reset();
35527
- isComposing = false;
35528
- return chars;
35529
- }
35530
-
35531
- return null;
35532
- }
35533
-
35534
- switch (topLevelType) {
35535
- case TOP_PASTE:
35536
- // If a paste event occurs after a keypress, throw out the input
35537
- // chars. Paste events should not lead to BeforeInput events.
35538
- return null;
35539
-
35540
- case TOP_KEY_PRESS:
35541
- /**
35542
- * As of v27, Firefox may fire keypress events even when no character
35543
- * will be inserted. A few possibilities:
35544
- *
35545
- * - `which` is `0`. Arrow keys, Esc key, etc.
35546
- *
35547
- * - `which` is the pressed key code, but no char is available.
35548
- * Ex: 'AltGr + d` in Polish. There is no modified character for
35549
- * this key combination and no character is inserted into the
35550
- * document, but FF fires the keypress for char code `100` anyway.
35551
- * No `input` event will occur.
35552
- *
35553
- * - `which` is the pressed key code, but a command combination is
35554
- * being used. Ex: `Cmd+C`. No character is inserted, and no
35555
- * `input` event will occur.
35556
- */
35557
- if (!isKeypressCommand(nativeEvent)) {
35558
- // IE fires the `keypress` event when a user types an emoji via
35559
- // Touch keyboard of Windows. In such a case, the `char` property
35560
- // holds an emoji character like `\uD83D\uDE0A`. Because its length
35561
- // is 2, the property `which` does not represent an emoji correctly.
35562
- // In such a case, we directly return the `char` property instead of
35563
- // using `which`.
35564
- if (nativeEvent.char && nativeEvent.char.length > 1) {
35565
- return nativeEvent.char;
35566
- } else if (nativeEvent.which) {
35567
- return String.fromCharCode(nativeEvent.which);
35568
- }
35569
- }
35570
-
35571
- return null;
35572
-
35573
- case TOP_COMPOSITION_END:
35574
- return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;
35575
-
35576
- default:
35577
- return null;
35578
- }
35579
- }
35580
- /**
35581
- * Extract a SyntheticInputEvent for `beforeInput`, based on either native
35582
- * `textInput` or fallback behavior.
35583
- *
35584
- * @return {?object} A SyntheticInputEvent.
35585
- */
35586
-
35587
-
35588
- function extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget) {
35589
- var chars;
35590
-
35591
- if (canUseTextInputEvent) {
35592
- chars = getNativeBeforeInputChars(topLevelType, nativeEvent);
35593
- } else {
35594
- chars = getFallbackBeforeInputChars(topLevelType, nativeEvent);
35595
- } // If no characters are being inserted, no BeforeInput event should
35596
- // be fired.
35597
-
35598
-
35599
- if (!chars) {
35600
- return null;
35601
- }
35602
-
35603
- var event = SyntheticInputEvent.getPooled(eventTypes$1.beforeInput, targetInst, nativeEvent, nativeEventTarget);
35604
- event.data = chars;
35605
- accumulateTwoPhaseDispatches(event);
35606
- return event;
35607
- }
35608
- /**
35609
- * Create an `onBeforeInput` event to match
35610
- * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents.
35611
- *
35612
- * This event plugin is based on the native `textInput` event
35613
- * available in Chrome, Safari, Opera, and IE. This event fires after
35614
- * `onKeyPress` and `onCompositionEnd`, but before `onInput`.
35615
- *
35616
- * `beforeInput` is spec'd but not implemented in any browsers, and
35617
- * the `input` event does not provide any useful information about what has
35618
- * actually been added, contrary to the spec. Thus, `textInput` is the best
35619
- * available event to identify the characters that have actually been inserted
35620
- * into the target node.
35621
- *
35622
- * This plugin is also responsible for emitting `composition` events, thus
35623
- * allowing us to share composition fallback code for both `beforeInput` and
35624
- * `composition` event types.
35625
- */
35626
-
35627
-
35628
- var BeforeInputEventPlugin = {
35629
- eventTypes: eventTypes$1,
35630
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
35631
- var composition = extractCompositionEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
35632
- var beforeInput = extractBeforeInputEvent(topLevelType, targetInst, nativeEvent, nativeEventTarget);
35633
-
35634
- if (composition === null) {
35635
- return beforeInput;
35636
- }
35637
-
35638
- if (beforeInput === null) {
35639
- return composition;
35640
- }
35641
-
35642
- return [composition, beforeInput];
35643
- }
35644
- };
35645
-
35646
- /**
35647
- * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
35648
- */
35649
- var supportedInputTypes = {
35650
- color: true,
35651
- date: true,
35652
- datetime: true,
35653
- 'datetime-local': true,
35654
- email: true,
35655
- month: true,
35656
- number: true,
35657
- password: true,
35658
- range: true,
35659
- search: true,
35660
- tel: true,
35661
- text: true,
35662
- time: true,
35663
- url: true,
35664
- week: true
35665
- };
35666
-
35667
- function isTextInputElement(elem) {
35668
- var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();
35669
-
35670
- if (nodeName === 'input') {
35671
- return !!supportedInputTypes[elem.type];
35672
- }
35673
-
35674
- if (nodeName === 'textarea') {
35675
- return true;
35676
- }
35677
-
35678
- return false;
35679
- }
35680
-
35681
- var eventTypes$2 = {
35682
- change: {
35683
- phasedRegistrationNames: {
35684
- bubbled: 'onChange',
35685
- captured: 'onChangeCapture'
35686
- },
35687
- dependencies: [TOP_BLUR, TOP_CHANGE, TOP_CLICK, TOP_FOCUS, TOP_INPUT, TOP_KEY_DOWN, TOP_KEY_UP, TOP_SELECTION_CHANGE]
35688
- }
35689
- };
35690
-
35691
- function createAndAccumulateChangeEvent(inst, nativeEvent, target) {
35692
- var event = SyntheticEvent.getPooled(eventTypes$2.change, inst, nativeEvent, target);
35693
- event.type = 'change'; // Flag this event loop as needing state restore.
35694
-
35695
- enqueueStateRestore(target);
35696
- accumulateTwoPhaseDispatches(event);
35697
- return event;
35698
- }
35699
- /**
35700
- * For IE shims
35701
- */
35702
-
35703
-
35704
- var activeElement = null;
35705
- var activeElementInst = null;
35706
- /**
35707
- * SECTION: handle `change` event
35708
- */
35709
-
35710
- function shouldUseChangeEvent(elem) {
35711
- var nodeName = elem.nodeName && elem.nodeName.toLowerCase();
35712
- return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';
35713
- }
35714
-
35715
- function manualDispatchChangeEvent(nativeEvent) {
35716
- var event = createAndAccumulateChangeEvent(activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the
35717
- // other events and have it go through ReactBrowserEventEmitter. Since it
35718
- // doesn't, we manually listen for the events and so we have to enqueue and
35719
- // process the abstract event manually.
35720
- //
35721
- // Batching is necessary here in order to ensure that all event handlers run
35722
- // before the next rerender (including event handlers attached to ancestor
35723
- // elements instead of directly on the input). Without this, controlled
35724
- // components don't work properly in conjunction with event bubbling because
35725
- // the component is rerendered and the value reverted before all the event
35726
- // handlers can run. See https://github.com/facebook/react/issues/708.
35727
-
35728
- batchedUpdates(runEventInBatch, event);
35729
- }
35730
-
35731
- function runEventInBatch(event) {
35732
- runEventsInBatch(event);
35733
- }
35734
-
35735
- function getInstIfValueChanged(targetInst) {
35736
- var targetNode = getNodeFromInstance$1(targetInst);
35737
-
35738
- if (updateValueIfChanged(targetNode)) {
35739
- return targetInst;
35740
- }
35741
- }
35742
-
35743
- function getTargetInstForChangeEvent(topLevelType, targetInst) {
35744
- if (topLevelType === TOP_CHANGE) {
35745
- return targetInst;
35746
- }
35747
- }
35748
- /**
35749
- * SECTION: handle `input` event
35750
- */
35751
-
35752
-
35753
- var isInputEventSupported = false;
35754
-
35755
- if (canUseDOM) {
35756
- // IE9 claims to support the input event but fails to trigger it when
35757
- // deleting text, so we ignore its input events.
35758
- isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9);
35759
- }
35760
- /**
35761
- * (For IE <=9) Starts tracking propertychange events on the passed-in element
35762
- * and override the value property so that we can distinguish user events from
35763
- * value changes in JS.
35764
- */
35765
-
35766
-
35767
- function startWatchingForValueChange(target, targetInst) {
35768
- activeElement = target;
35769
- activeElementInst = targetInst;
35770
- activeElement.attachEvent('onpropertychange', handlePropertyChange);
35771
- }
35772
- /**
35773
- * (For IE <=9) Removes the event listeners from the currently-tracked element,
35774
- * if any exists.
35775
- */
35776
-
35777
-
35778
- function stopWatchingForValueChange() {
35779
- if (!activeElement) {
35780
- return;
35781
- }
35782
-
35783
- activeElement.detachEvent('onpropertychange', handlePropertyChange);
35784
- activeElement = null;
35785
- activeElementInst = null;
35786
- }
35787
- /**
35788
- * (For IE <=9) Handles a propertychange event, sending a `change` event if
35789
- * the value of the active element has changed.
35790
- */
35791
-
35792
-
35793
- function handlePropertyChange(nativeEvent) {
35794
- if (nativeEvent.propertyName !== 'value') {
35795
- return;
35796
- }
35797
-
35798
- if (getInstIfValueChanged(activeElementInst)) {
35799
- manualDispatchChangeEvent(nativeEvent);
35800
- }
35801
- }
35802
-
35803
- function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
35804
- if (topLevelType === TOP_FOCUS) {
35805
- // In IE9, propertychange fires for most input events but is buggy and
35806
- // doesn't fire when text is deleted, but conveniently, selectionchange
35807
- // appears to fire in all of the remaining cases so we catch those and
35808
- // forward the event if the value has changed
35809
- // In either case, we don't want to call the event handler if the value
35810
- // is changed from JS so we redefine a setter for `.value` that updates
35811
- // our activeElementValue variable, allowing us to ignore those changes
35812
- //
35813
- // stopWatching() should be a noop here but we call it just in case we
35814
- // missed a blur event somehow.
35815
- stopWatchingForValueChange();
35816
- startWatchingForValueChange(target, targetInst);
35817
- } else if (topLevelType === TOP_BLUR) {
35818
- stopWatchingForValueChange();
35819
- }
35820
- } // For IE8 and IE9.
35821
-
35822
-
35823
- function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
35824
- if (topLevelType === TOP_SELECTION_CHANGE || topLevelType === TOP_KEY_UP || topLevelType === TOP_KEY_DOWN) {
35825
- // On the selectionchange event, the target is just document which isn't
35826
- // helpful for us so just check activeElement instead.
35827
- //
35828
- // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
35829
- // propertychange on the first input event after setting `value` from a
35830
- // script and fires only keydown, keypress, keyup. Catching keyup usually
35831
- // gets it and catching keydown lets us fire an event for the first
35832
- // keystroke if user does a key repeat (it'll be a little delayed: right
35833
- // before the second keystroke). Other input methods (e.g., paste) seem to
35834
- // fire selectionchange normally.
35835
- return getInstIfValueChanged(activeElementInst);
35836
- }
35837
- }
35838
- /**
35839
- * SECTION: handle `click` event
35840
- */
35841
-
35842
-
35843
- function shouldUseClickEvent(elem) {
35844
- // Use the `click` event to detect changes to checkbox and radio inputs.
35845
- // This approach works across all browsers, whereas `change` does not fire
35846
- // until `blur` in IE8.
35847
- var nodeName = elem.nodeName;
35848
- return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');
35849
- }
35850
-
35851
- function getTargetInstForClickEvent(topLevelType, targetInst) {
35852
- if (topLevelType === TOP_CLICK) {
35853
- return getInstIfValueChanged(targetInst);
35854
- }
35855
- }
35856
-
35857
- function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
35858
- if (topLevelType === TOP_INPUT || topLevelType === TOP_CHANGE) {
35859
- return getInstIfValueChanged(targetInst);
35860
- }
35861
- }
35862
-
35863
- function handleControlledInputBlur(node) {
35864
- var state = node._wrapperState;
35865
-
35866
- if (!state || !state.controlled || node.type !== 'number') {
35867
- return;
35868
- }
35869
-
35870
- if (!disableInputAttributeSyncing) {
35871
- // If controlled, assign the value attribute to the current value on blur
35872
- setDefaultValue(node, 'number', node.value);
35873
- }
35874
- }
35875
- /**
35876
- * This plugin creates an `onChange` event that normalizes change events
35877
- * across form elements. This event fires at a time when it's possible to
35878
- * change the element's value without seeing a flicker.
35879
- *
35880
- * Supported elements are:
35881
- * - input (see `isTextInputElement`)
35882
- * - textarea
35883
- * - select
35884
- */
35885
-
35886
-
35887
- var ChangeEventPlugin = {
35888
- eventTypes: eventTypes$2,
35889
- _isInputEventSupported: isInputEventSupported,
35890
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
35891
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
35892
- var getTargetInstFunc, handleEventFunc;
35893
-
35894
- if (shouldUseChangeEvent(targetNode)) {
35895
- getTargetInstFunc = getTargetInstForChangeEvent;
35896
- } else if (isTextInputElement(targetNode)) {
35897
- if (isInputEventSupported) {
35898
- getTargetInstFunc = getTargetInstForInputOrChangeEvent;
35899
- } else {
35900
- getTargetInstFunc = getTargetInstForInputEventPolyfill;
35901
- handleEventFunc = handleEventsForInputEventPolyfill;
35902
- }
35903
- } else if (shouldUseClickEvent(targetNode)) {
35904
- getTargetInstFunc = getTargetInstForClickEvent;
35905
- }
35906
-
35907
- if (getTargetInstFunc) {
35908
- var inst = getTargetInstFunc(topLevelType, targetInst);
35909
-
35910
- if (inst) {
35911
- var event = createAndAccumulateChangeEvent(inst, nativeEvent, nativeEventTarget);
35912
- return event;
35913
- }
35914
- }
35915
-
35916
- if (handleEventFunc) {
35917
- handleEventFunc(topLevelType, targetNode, targetInst);
35918
- } // When blurring, set the value attribute for number inputs
35919
-
35920
-
35921
- if (topLevelType === TOP_BLUR) {
35922
- handleControlledInputBlur(targetNode);
35923
- }
35924
- }
35925
- };
35926
-
35927
- /**
35928
- * Module that is injectable into `EventPluginHub`, that specifies a
35929
- * deterministic ordering of `EventPlugin`s. A convenient way to reason about
35930
- * plugins, without having to package every one of them. This is better than
35931
- * having plugins be ordered in the same order that they are injected because
35932
- * that ordering would be influenced by the packaging order.
35933
- * `ResponderEventPlugin` must occur before `SimpleEventPlugin` so that
35934
- * preventing default on events is convenient in `SimpleEventPlugin` handlers.
35935
- */
35936
- var DOMEventPluginOrder = ['ResponderEventPlugin', 'SimpleEventPlugin', 'EnterLeaveEventPlugin', 'ChangeEventPlugin', 'SelectEventPlugin', 'BeforeInputEventPlugin'];
35937
-
35938
- var eventTypes$3 = {
35939
- mouseEnter: {
35940
- registrationName: 'onMouseEnter',
35941
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
35942
- },
35943
- mouseLeave: {
35944
- registrationName: 'onMouseLeave',
35945
- dependencies: [TOP_MOUSE_OUT, TOP_MOUSE_OVER]
35946
- },
35947
- pointerEnter: {
35948
- registrationName: 'onPointerEnter',
35949
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
35950
- },
35951
- pointerLeave: {
35952
- registrationName: 'onPointerLeave',
35953
- dependencies: [TOP_POINTER_OUT, TOP_POINTER_OVER]
35954
- }
35955
- }; // We track the lastNativeEvent to ensure that when we encounter
35956
- // cases where we process the same nativeEvent multiple times,
35957
- // which can happen when have multiple ancestors, that we don't
35958
- // duplicate enter
35959
-
35960
- var lastNativeEvent;
35961
- var EnterLeaveEventPlugin = {
35962
- eventTypes: eventTypes$3,
35963
-
35964
- /**
35965
- * For almost every interaction we care about, there will be both a top-level
35966
- * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that
35967
- * we do not extract duplicate events. However, moving the mouse into the
35968
- * browser from outside will not fire a `mouseout` event. In this case, we use
35969
- * the `mouseover` top-level event.
35970
- */
35971
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
35972
- var isOverEvent = topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;
35973
- var isOutEvent = topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_POINTER_OUT;
35974
-
35975
- if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0 && (nativeEvent.relatedTarget || nativeEvent.fromElement)) {
35976
- // If this is an over event with a target, then we've already dispatched
35977
- // the event in the out event of the other target. If this is replayed,
35978
- // then it's because we couldn't dispatch against this target previously
35979
- // so we have to do it now instead.
35980
- return null;
35981
- }
35982
-
35983
- if (!isOutEvent && !isOverEvent) {
35984
- // Must not be a mouse or pointer in or out - ignoring.
35985
- return null;
35986
- }
35987
-
35988
- var win;
35989
-
35990
- if (nativeEventTarget.window === nativeEventTarget) {
35991
- // `nativeEventTarget` is probably a window object.
35992
- win = nativeEventTarget;
35993
- } else {
35994
- // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
35995
- var doc = nativeEventTarget.ownerDocument;
35996
-
35997
- if (doc) {
35998
- win = doc.defaultView || doc.parentWindow;
35999
- } else {
36000
- win = window;
36001
- }
36002
- }
36003
-
36004
- var from;
36005
- var to;
36006
-
36007
- if (isOutEvent) {
36008
- from = targetInst;
36009
- var related = nativeEvent.relatedTarget || nativeEvent.toElement;
36010
- to = related ? getClosestInstanceFromNode(related) : null;
36011
-
36012
- if (to !== null) {
36013
- var nearestMounted = getNearestMountedFiber(to);
36014
-
36015
- if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {
36016
- to = null;
36017
- }
36018
- }
36019
- } else {
36020
- // Moving to a node from outside the window.
36021
- from = null;
36022
- to = targetInst;
36023
- }
36024
-
36025
- if (from === to) {
36026
- // Nothing pertains to our managed components.
36027
- return null;
36028
- }
36029
-
36030
- var eventInterface, leaveEventType, enterEventType, eventTypePrefix;
36031
-
36032
- if (topLevelType === TOP_MOUSE_OUT || topLevelType === TOP_MOUSE_OVER) {
36033
- eventInterface = SyntheticMouseEvent;
36034
- leaveEventType = eventTypes$3.mouseLeave;
36035
- enterEventType = eventTypes$3.mouseEnter;
36036
- eventTypePrefix = 'mouse';
36037
- } else if (topLevelType === TOP_POINTER_OUT || topLevelType === TOP_POINTER_OVER) {
36038
- eventInterface = SyntheticPointerEvent;
36039
- leaveEventType = eventTypes$3.pointerLeave;
36040
- enterEventType = eventTypes$3.pointerEnter;
36041
- eventTypePrefix = 'pointer';
36042
- }
36043
-
36044
- var fromNode = from == null ? win : getNodeFromInstance$1(from);
36045
- var toNode = to == null ? win : getNodeFromInstance$1(to);
36046
- var leave = eventInterface.getPooled(leaveEventType, from, nativeEvent, nativeEventTarget);
36047
- leave.type = eventTypePrefix + 'leave';
36048
- leave.target = fromNode;
36049
- leave.relatedTarget = toNode;
36050
- var enter = eventInterface.getPooled(enterEventType, to, nativeEvent, nativeEventTarget);
36051
- enter.type = eventTypePrefix + 'enter';
36052
- enter.target = toNode;
36053
- enter.relatedTarget = fromNode;
36054
- accumulateEnterLeaveDispatches(leave, enter, from, to);
36055
-
36056
- if (nativeEvent === lastNativeEvent) {
36057
- lastNativeEvent = null;
36058
- return [leave];
36059
- }
36060
-
36061
- lastNativeEvent = nativeEvent;
36062
- return [leave, enter];
36063
- }
36064
- };
36065
-
36066
- /**
36067
- * inlined Object.is polyfill to avoid requiring consumers ship their own
36068
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
36069
- */
36070
- function is(x, y) {
36071
- return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare
36072
- ;
36073
- }
36074
-
36075
- var is$1 = typeof Object.is === 'function' ? Object.is : is;
36076
-
36077
- var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
36078
- /**
36079
- * Performs equality by iterating through keys on an object and returning false
36080
- * when any key has values which are not strictly equal between the arguments.
36081
- * Returns true when the values of all keys are strictly equal.
36082
- */
36083
-
36084
- function shallowEqual(objA, objB) {
36085
- if (is$1(objA, objB)) {
36086
- return true;
36087
- }
36088
-
36089
- if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
36090
- return false;
36091
- }
36092
-
36093
- var keysA = Object.keys(objA);
36094
- var keysB = Object.keys(objB);
36095
-
36096
- if (keysA.length !== keysB.length) {
36097
- return false;
36098
- } // Test for A's keys different from B.
36099
-
36100
-
36101
- for (var i = 0; i < keysA.length; i++) {
36102
- if (!hasOwnProperty$2.call(objB, keysA[i]) || !is$1(objA[keysA[i]], objB[keysA[i]])) {
36103
- return false;
36104
- }
36105
- }
36106
-
36107
- return true;
36108
- }
36109
-
36110
- var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11;
36111
- var eventTypes$4 = {
36112
- select: {
36113
- phasedRegistrationNames: {
36114
- bubbled: 'onSelect',
36115
- captured: 'onSelectCapture'
36116
- },
36117
- dependencies: [TOP_BLUR, TOP_CONTEXT_MENU, TOP_DRAG_END, TOP_FOCUS, TOP_KEY_DOWN, TOP_KEY_UP, TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_SELECTION_CHANGE]
36118
- }
36119
- };
36120
- var activeElement$1 = null;
36121
- var activeElementInst$1 = null;
36122
- var lastSelection = null;
36123
- var mouseDown = false;
36124
- /**
36125
- * Get an object which is a unique representation of the current selection.
36126
- *
36127
- * The return value will not be consistent across nodes or browsers, but
36128
- * two identical selections on the same node will return identical objects.
36129
- *
36130
- * @param {DOMElement} node
36131
- * @return {object}
36132
- */
36133
-
36134
- function getSelection$1(node) {
36135
- if ('selectionStart' in node && hasSelectionCapabilities(node)) {
36136
- return {
36137
- start: node.selectionStart,
36138
- end: node.selectionEnd
36139
- };
36140
- } else {
36141
- var win = node.ownerDocument && node.ownerDocument.defaultView || window;
36142
- var selection = win.getSelection();
36143
- return {
36144
- anchorNode: selection.anchorNode,
36145
- anchorOffset: selection.anchorOffset,
36146
- focusNode: selection.focusNode,
36147
- focusOffset: selection.focusOffset
36148
- };
36149
- }
36150
- }
36151
- /**
36152
- * Get document associated with the event target.
36153
- *
36154
- * @param {object} nativeEventTarget
36155
- * @return {Document}
36156
- */
36157
-
36158
-
36159
- function getEventTargetDocument(eventTarget) {
36160
- return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;
36161
- }
36162
- /**
36163
- * Poll selection to see whether it's changed.
36164
- *
36165
- * @param {object} nativeEvent
36166
- * @param {object} nativeEventTarget
36167
- * @return {?SyntheticEvent}
36168
- */
36169
-
36170
-
36171
- function constructSelectEvent(nativeEvent, nativeEventTarget) {
36172
- // Ensure we have the right element, and that the user is not dragging a
36173
- // selection (this matches native `select` event behavior). In HTML5, select
36174
- // fires only on input and textarea thus if there's no focused element we
36175
- // won't dispatch.
36176
- var doc = getEventTargetDocument(nativeEventTarget);
36177
-
36178
- if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {
36179
- return null;
36180
- } // Only fire when selection has actually changed.
36181
-
36182
-
36183
- var currentSelection = getSelection$1(activeElement$1);
36184
-
36185
- if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {
36186
- lastSelection = currentSelection;
36187
- var syntheticEvent = SyntheticEvent.getPooled(eventTypes$4.select, activeElementInst$1, nativeEvent, nativeEventTarget);
36188
- syntheticEvent.type = 'select';
36189
- syntheticEvent.target = activeElement$1;
36190
- accumulateTwoPhaseDispatches(syntheticEvent);
36191
- return syntheticEvent;
36192
- }
36193
-
36194
- return null;
36195
- }
36196
- /**
36197
- * This plugin creates an `onSelect` event that normalizes select events
36198
- * across form elements.
36199
- *
36200
- * Supported elements are:
36201
- * - input (see `isTextInputElement`)
36202
- * - textarea
36203
- * - contentEditable
36204
- *
36205
- * This differs from native browser implementations in the following ways:
36206
- * - Fires on contentEditable fields as well as inputs.
36207
- * - Fires for collapsed selection.
36208
- * - Fires after user input.
36209
- */
36210
-
36211
-
36212
- var SelectEventPlugin = {
36213
- eventTypes: eventTypes$4,
36214
- extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
36215
- var doc = getEventTargetDocument(nativeEventTarget); // Track whether all listeners exists for this plugin. If none exist, we do
36216
- // not extract events. See #3639.
36217
-
36218
- if (!doc || !isListeningToAllDependencies('onSelect', doc)) {
36219
- return null;
36220
- }
36221
-
36222
- var targetNode = targetInst ? getNodeFromInstance$1(targetInst) : window;
36223
-
36224
- switch (topLevelType) {
36225
- // Track the input node that has focus.
36226
- case TOP_FOCUS:
36227
- if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {
36228
- activeElement$1 = targetNode;
36229
- activeElementInst$1 = targetInst;
36230
- lastSelection = null;
36231
- }
36232
-
36233
- break;
36234
-
36235
- case TOP_BLUR:
36236
- activeElement$1 = null;
36237
- activeElementInst$1 = null;
36238
- lastSelection = null;
36239
- break;
36240
- // Don't fire the event while the user is dragging. This matches the
36241
- // semantics of the native select event.
36242
-
36243
- case TOP_MOUSE_DOWN:
36244
- mouseDown = true;
36245
- break;
36246
-
36247
- case TOP_CONTEXT_MENU:
36248
- case TOP_MOUSE_UP:
36249
- case TOP_DRAG_END:
36250
- mouseDown = false;
36251
- return constructSelectEvent(nativeEvent, nativeEventTarget);
36252
- // Chrome and IE fire non-standard event when selection is changed (and
36253
- // sometimes when it hasn't). IE's event fires out of order with respect
36254
- // to key and input events on deletion, so we discard it.
36255
- //
36256
- // Firefox doesn't support selectionchange, so check selection status
36257
- // after each key entry. The selection changes after keydown and before
36258
- // keyup, but we check on keydown as well in the case of holding down a
36259
- // key, when multiple keydown events are fired but only one keyup is.
36260
- // This is also our approach for IE handling, for the reason above.
36261
-
36262
- case TOP_SELECTION_CHANGE:
36263
- if (skipSelectionChangeEvent) {
36264
- break;
36265
- }
36266
-
36267
- // falls through
36268
-
36269
- case TOP_KEY_DOWN:
36270
- case TOP_KEY_UP:
36271
- return constructSelectEvent(nativeEvent, nativeEventTarget);
36272
- }
36273
-
36274
- return null;
36275
- }
36276
- };
36277
-
36278
- /**
36279
- * Inject modules for resolving DOM hierarchy and plugin ordering.
36280
- */
36281
-
36282
- injection.injectEventPluginOrder(DOMEventPluginOrder);
36283
- setComponentTree(getFiberCurrentPropsFromNode$1, getInstanceFromNode$1, getNodeFromInstance$1);
36284
- /**
36285
- * Some important event plugins included by default (without having to require
36286
- * them).
36287
- */
36288
-
36289
- injection.injectEventPluginsByName({
36290
- SimpleEventPlugin: SimpleEventPlugin,
36291
- EnterLeaveEventPlugin: EnterLeaveEventPlugin,
36292
- ChangeEventPlugin: ChangeEventPlugin,
36293
- SelectEventPlugin: SelectEventPlugin,
36294
- BeforeInputEventPlugin: BeforeInputEventPlugin
36295
- });
36296
-
36297
- // Prefix measurements so that it's possible to filter them.
36298
- // Longer prefixes are hard to read in DevTools.
36299
- var reactEmoji = "\u269B";
36300
- var warningEmoji = "\u26D4";
36301
- var supportsUserTiming = typeof performance !== 'undefined' && typeof performance.mark === 'function' && typeof performance.clearMarks === 'function' && typeof performance.measure === 'function' && typeof performance.clearMeasures === 'function'; // Keep track of current fiber so that we know the path to unwind on pause.
36302
- // TODO: this looks the same as nextUnitOfWork in scheduler. Can we unify them?
36303
-
36304
- var currentFiber = null; // If we're in the middle of user code, which fiber and method is it?
36305
- // Reusing `currentFiber` would be confusing for this because user code fiber
36306
- // can change during commit phase too, but we don't need to unwind it (since
36307
- // lifecycles in the commit phase don't resemble a tree).
36308
-
36309
- var currentPhase = null;
36310
- var currentPhaseFiber = null; // Did lifecycle hook schedule an update? This is often a performance problem,
36311
- // so we will keep track of it, and include it in the report.
36312
- // Track commits caused by cascading updates.
36313
-
36314
- var isCommitting = false;
36315
- var hasScheduledUpdateInCurrentCommit = false;
36316
- var hasScheduledUpdateInCurrentPhase = false;
36317
- var commitCountInCurrentWorkLoop = 0;
36318
- var effectCountInCurrentCommit = 0;
36319
- // to avoid stretch the commit phase with measurement overhead.
36320
-
36321
- var labelsInCurrentCommit = new Set();
36322
-
36323
- var formatMarkName = function (markName) {
36324
- return reactEmoji + " " + markName;
36325
- };
36326
-
36327
- var formatLabel = function (label, warning) {
36328
- var prefix = warning ? warningEmoji + " " : reactEmoji + " ";
36329
- var suffix = warning ? " Warning: " + warning : '';
36330
- return "" + prefix + label + suffix;
36331
- };
36332
-
36333
- var beginMark = function (markName) {
36334
- performance.mark(formatMarkName(markName));
36335
- };
36336
-
36337
- var clearMark = function (markName) {
36338
- performance.clearMarks(formatMarkName(markName));
36339
- };
36340
-
36341
- var endMark = function (label, markName, warning) {
36342
- var formattedMarkName = formatMarkName(markName);
36343
- var formattedLabel = formatLabel(label, warning);
36344
-
36345
- try {
36346
- performance.measure(formattedLabel, formattedMarkName);
36347
- } catch (err) {} // If previous mark was missing for some reason, this will throw.
36348
- // This could only happen if React crashed in an unexpected place earlier.
36349
- // Don't pile on with more errors.
36350
- // Clear marks immediately to avoid growing buffer.
36351
-
36352
-
36353
- performance.clearMarks(formattedMarkName);
36354
- performance.clearMeasures(formattedLabel);
36355
- };
36356
-
36357
- var getFiberMarkName = function (label, debugID) {
36358
- return label + " (#" + debugID + ")";
36359
- };
36360
-
36361
- var getFiberLabel = function (componentName, isMounted, phase) {
36362
- if (phase === null) {
36363
- // These are composite component total time measurements.
36364
- return componentName + " [" + (isMounted ? 'update' : 'mount') + "]";
36365
- } else {
36366
- // Composite component methods.
36367
- return componentName + "." + phase;
36368
- }
36369
- };
36370
-
36371
- var beginFiberMark = function (fiber, phase) {
36372
- var componentName = getComponentName(fiber.type) || 'Unknown';
36373
- var debugID = fiber._debugID;
36374
- var isMounted = fiber.alternate !== null;
36375
- var label = getFiberLabel(componentName, isMounted, phase);
36376
-
36377
- if (isCommitting && labelsInCurrentCommit.has(label)) {
36378
- // During the commit phase, we don't show duplicate labels because
36379
- // there is a fixed overhead for every measurement, and we don't
36380
- // want to stretch the commit phase beyond necessary.
36381
- return false;
36382
- }
36383
-
36384
- labelsInCurrentCommit.add(label);
36385
- var markName = getFiberMarkName(label, debugID);
36386
- beginMark(markName);
36387
- return true;
36388
- };
36389
-
36390
- var clearFiberMark = function (fiber, phase) {
36391
- var componentName = getComponentName(fiber.type) || 'Unknown';
36392
- var debugID = fiber._debugID;
36393
- var isMounted = fiber.alternate !== null;
36394
- var label = getFiberLabel(componentName, isMounted, phase);
36395
- var markName = getFiberMarkName(label, debugID);
36396
- clearMark(markName);
36397
- };
36398
-
36399
- var endFiberMark = function (fiber, phase, warning) {
36400
- var componentName = getComponentName(fiber.type) || 'Unknown';
36401
- var debugID = fiber._debugID;
36402
- var isMounted = fiber.alternate !== null;
36403
- var label = getFiberLabel(componentName, isMounted, phase);
36404
- var markName = getFiberMarkName(label, debugID);
36405
- endMark(label, markName, warning);
36406
- };
36407
-
36408
- var shouldIgnoreFiber = function (fiber) {
36409
- // Host components should be skipped in the timeline.
36410
- // We could check typeof fiber.type, but does this work with RN?
36411
- switch (fiber.tag) {
36412
- case HostRoot:
36413
- case HostComponent:
36414
- case HostText:
36415
- case HostPortal:
36416
- case Fragment:
36417
- case ContextProvider:
36418
- case ContextConsumer:
36419
- case Mode:
36420
- return true;
36421
-
36422
- default:
36423
- return false;
36424
- }
36425
- };
36426
-
36427
- var clearPendingPhaseMeasurement = function () {
36428
- if (currentPhase !== null && currentPhaseFiber !== null) {
36429
- clearFiberMark(currentPhaseFiber, currentPhase);
36430
- }
36431
-
36432
- currentPhaseFiber = null;
36433
- currentPhase = null;
36434
- hasScheduledUpdateInCurrentPhase = false;
36435
- };
36436
-
36437
- var pauseTimers = function () {
36438
- // Stops all currently active measurements so that they can be resumed
36439
- // if we continue in a later deferred loop from the same unit of work.
36440
- var fiber = currentFiber;
36441
-
36442
- while (fiber) {
36443
- if (fiber._debugIsCurrentlyTiming) {
36444
- endFiberMark(fiber, null, null);
36445
- }
36446
-
36447
- fiber = fiber.return;
36448
- }
36449
- };
36450
-
36451
- var resumeTimersRecursively = function (fiber) {
36452
- if (fiber.return !== null) {
36453
- resumeTimersRecursively(fiber.return);
36454
- }
36455
-
36456
- if (fiber._debugIsCurrentlyTiming) {
36457
- beginFiberMark(fiber, null);
36458
- }
36459
- };
36460
-
36461
- var resumeTimers = function () {
36462
- // Resumes all measurements that were active during the last deferred loop.
36463
- if (currentFiber !== null) {
36464
- resumeTimersRecursively(currentFiber);
36465
- }
36466
- };
36467
-
36468
- function recordEffect() {
36469
- if (enableUserTimingAPI) {
36470
- effectCountInCurrentCommit++;
36471
- }
36472
- }
36473
- function recordScheduleUpdate() {
36474
- if (enableUserTimingAPI) {
36475
- if (isCommitting) {
36476
- hasScheduledUpdateInCurrentCommit = true;
36477
- }
36478
-
36479
- if (currentPhase !== null && currentPhase !== 'componentWillMount' && currentPhase !== 'componentWillReceiveProps') {
36480
- hasScheduledUpdateInCurrentPhase = true;
36481
- }
36482
- }
36483
- }
36484
-
36485
-
36486
- function startWorkTimer(fiber) {
36487
- if (enableUserTimingAPI) {
36488
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
36489
- return;
36490
- } // If we pause, this is the fiber to unwind from.
36491
-
36492
-
36493
- currentFiber = fiber;
36494
-
36495
- if (!beginFiberMark(fiber, null)) {
36496
- return;
36497
- }
36498
-
36499
- fiber._debugIsCurrentlyTiming = true;
36500
- }
36501
- }
36502
- function cancelWorkTimer(fiber) {
36503
- if (enableUserTimingAPI) {
36504
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
36505
- return;
36506
- } // Remember we shouldn't complete measurement for this fiber.
36507
- // Otherwise flamechart will be deep even for small updates.
36508
-
36509
-
36510
- fiber._debugIsCurrentlyTiming = false;
36511
- clearFiberMark(fiber, null);
36512
- }
36513
- }
36514
- function stopWorkTimer(fiber) {
36515
- if (enableUserTimingAPI) {
36516
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
36517
- return;
36518
- } // If we pause, its parent is the fiber to unwind from.
36519
-
36520
-
36521
- currentFiber = fiber.return;
36522
-
36523
- if (!fiber._debugIsCurrentlyTiming) {
36524
- return;
36525
- }
36526
-
36527
- fiber._debugIsCurrentlyTiming = false;
36528
- endFiberMark(fiber, null, null);
36529
- }
36530
- }
36531
- function stopFailedWorkTimer(fiber) {
36532
- if (enableUserTimingAPI) {
36533
- if (!supportsUserTiming || shouldIgnoreFiber(fiber)) {
36534
- return;
36535
- } // If we pause, its parent is the fiber to unwind from.
36536
-
36537
-
36538
- currentFiber = fiber.return;
36539
-
36540
- if (!fiber._debugIsCurrentlyTiming) {
36541
- return;
36542
- }
36543
-
36544
- fiber._debugIsCurrentlyTiming = false;
36545
- var warning = fiber.tag === SuspenseComponent ? 'Rendering was suspended' : 'An error was thrown inside this error boundary';
36546
- endFiberMark(fiber, null, warning);
36547
- }
36548
- }
36549
- function startPhaseTimer(fiber, phase) {
36550
- if (enableUserTimingAPI) {
36551
- if (!supportsUserTiming) {
36552
- return;
36553
- }
36554
-
36555
- clearPendingPhaseMeasurement();
36556
-
36557
- if (!beginFiberMark(fiber, phase)) {
36558
- return;
36559
- }
36560
-
36561
- currentPhaseFiber = fiber;
36562
- currentPhase = phase;
36563
- }
36564
- }
36565
- function stopPhaseTimer() {
36566
- if (enableUserTimingAPI) {
36567
- if (!supportsUserTiming) {
36568
- return;
36569
- }
36570
-
36571
- if (currentPhase !== null && currentPhaseFiber !== null) {
36572
- var warning = hasScheduledUpdateInCurrentPhase ? 'Scheduled a cascading update' : null;
36573
- endFiberMark(currentPhaseFiber, currentPhase, warning);
36574
- }
36575
-
36576
- currentPhase = null;
36577
- currentPhaseFiber = null;
36578
- }
36579
- }
36580
- function startWorkLoopTimer(nextUnitOfWork) {
36581
- if (enableUserTimingAPI) {
36582
- currentFiber = nextUnitOfWork;
36583
-
36584
- if (!supportsUserTiming) {
36585
- return;
36586
- }
36587
-
36588
- commitCountInCurrentWorkLoop = 0; // This is top level call.
36589
- // Any other measurements are performed within.
36590
-
36591
- beginMark('(React Tree Reconciliation)'); // Resume any measurements that were in progress during the last loop.
36592
-
36593
- resumeTimers();
36594
- }
36595
- }
36596
- function stopWorkLoopTimer(interruptedBy, didCompleteRoot) {
36597
- if (enableUserTimingAPI) {
36598
- if (!supportsUserTiming) {
36599
- return;
36600
- }
36601
-
36602
- var warning = null;
36603
-
36604
- if (interruptedBy !== null) {
36605
- if (interruptedBy.tag === HostRoot) {
36606
- warning = 'A top-level update interrupted the previous render';
36607
- } else {
36608
- var componentName = getComponentName(interruptedBy.type) || 'Unknown';
36609
- warning = "An update to " + componentName + " interrupted the previous render";
36610
- }
36611
- } else if (commitCountInCurrentWorkLoop > 1) {
36612
- warning = 'There were cascading updates';
36613
- }
36614
-
36615
- commitCountInCurrentWorkLoop = 0;
36616
- var label = didCompleteRoot ? '(React Tree Reconciliation: Completed Root)' : '(React Tree Reconciliation: Yielded)'; // Pause any measurements until the next loop.
36617
-
36618
- pauseTimers();
36619
- endMark(label, '(React Tree Reconciliation)', warning);
36620
- }
36621
- }
36622
- function startCommitTimer() {
36623
- if (enableUserTimingAPI) {
36624
- if (!supportsUserTiming) {
36625
- return;
36626
- }
36627
-
36628
- isCommitting = true;
36629
- hasScheduledUpdateInCurrentCommit = false;
36630
- labelsInCurrentCommit.clear();
36631
- beginMark('(Committing Changes)');
36632
- }
36633
- }
36634
- function stopCommitTimer() {
36635
- if (enableUserTimingAPI) {
36636
- if (!supportsUserTiming) {
36637
- return;
36638
- }
36639
-
36640
- var warning = null;
36641
-
36642
- if (hasScheduledUpdateInCurrentCommit) {
36643
- warning = 'Lifecycle hook scheduled a cascading update';
36644
- } else if (commitCountInCurrentWorkLoop > 0) {
36645
- warning = 'Caused by a cascading update in earlier commit';
36646
- }
36647
-
36648
- hasScheduledUpdateInCurrentCommit = false;
36649
- commitCountInCurrentWorkLoop++;
36650
- isCommitting = false;
36651
- labelsInCurrentCommit.clear();
36652
- endMark('(Committing Changes)', '(Committing Changes)', warning);
36653
- }
36654
- }
36655
- function startCommitSnapshotEffectsTimer() {
36656
- if (enableUserTimingAPI) {
36657
- if (!supportsUserTiming) {
36658
- return;
36659
- }
36660
-
36661
- effectCountInCurrentCommit = 0;
36662
- beginMark('(Committing Snapshot Effects)');
36663
- }
36664
- }
36665
- function stopCommitSnapshotEffectsTimer() {
36666
- if (enableUserTimingAPI) {
36667
- if (!supportsUserTiming) {
36668
- return;
36669
- }
36670
-
36671
- var count = effectCountInCurrentCommit;
36672
- effectCountInCurrentCommit = 0;
36673
- endMark("(Committing Snapshot Effects: " + count + " Total)", '(Committing Snapshot Effects)', null);
36674
- }
36675
- }
36676
- function startCommitHostEffectsTimer() {
36677
- if (enableUserTimingAPI) {
36678
- if (!supportsUserTiming) {
36679
- return;
36680
- }
36681
-
36682
- effectCountInCurrentCommit = 0;
36683
- beginMark('(Committing Host Effects)');
36684
- }
36685
- }
36686
- function stopCommitHostEffectsTimer() {
36687
- if (enableUserTimingAPI) {
36688
- if (!supportsUserTiming) {
36689
- return;
36690
- }
36691
-
36692
- var count = effectCountInCurrentCommit;
36693
- effectCountInCurrentCommit = 0;
36694
- endMark("(Committing Host Effects: " + count + " Total)", '(Committing Host Effects)', null);
36695
- }
36696
- }
36697
- function startCommitLifeCyclesTimer() {
36698
- if (enableUserTimingAPI) {
36699
- if (!supportsUserTiming) {
36700
- return;
36701
- }
36702
-
36703
- effectCountInCurrentCommit = 0;
36704
- beginMark('(Calling Lifecycle Methods)');
36705
- }
36706
- }
36707
- function stopCommitLifeCyclesTimer() {
36708
- if (enableUserTimingAPI) {
36709
- if (!supportsUserTiming) {
36710
- return;
36711
- }
36712
-
36713
- var count = effectCountInCurrentCommit;
36714
- effectCountInCurrentCommit = 0;
36715
- endMark("(Calling Lifecycle Methods: " + count + " Total)", '(Calling Lifecycle Methods)', null);
36716
- }
36717
- }
36718
-
36719
- var valueStack = [];
36720
- var fiberStack;
36721
-
36722
- {
36723
- fiberStack = [];
36724
- }
36725
-
36726
- var index = -1;
36727
-
36728
- function createCursor(defaultValue) {
36729
- return {
36730
- current: defaultValue
36731
- };
36732
- }
36733
-
36734
- function pop(cursor, fiber) {
36735
- if (index < 0) {
36736
- {
36737
- warningWithoutStack$1(false, 'Unexpected pop.');
36738
- }
36739
-
36740
- return;
36741
- }
36742
-
36743
- {
36744
- if (fiber !== fiberStack[index]) {
36745
- warningWithoutStack$1(false, 'Unexpected Fiber popped.');
36746
- }
36747
- }
36748
-
36749
- cursor.current = valueStack[index];
36750
- valueStack[index] = null;
36751
-
36752
- {
36753
- fiberStack[index] = null;
36754
- }
36755
-
36756
- index--;
36757
- }
36758
-
36759
- function push(cursor, value, fiber) {
36760
- index++;
36761
- valueStack[index] = cursor.current;
36762
-
36763
- {
36764
- fiberStack[index] = fiber;
36765
- }
36766
-
36767
- cursor.current = value;
36768
- }
36769
-
36770
- var warnedAboutMissingGetChildContext;
36771
-
36772
- {
36773
- warnedAboutMissingGetChildContext = {};
36774
- }
36775
-
36776
- var emptyContextObject = {};
36777
-
36778
- {
36779
- Object.freeze(emptyContextObject);
36780
- } // A cursor to the current merged context object on the stack.
36781
-
36782
-
36783
- var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed.
36784
-
36785
- var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack.
36786
- // We use this to get access to the parent context after we have already
36787
- // pushed the next context provider, and now need to merge their contexts.
36788
-
36789
- var previousContext = emptyContextObject;
36790
-
36791
- function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {
36792
- if (disableLegacyContext) {
36793
- return emptyContextObject;
36794
- } else {
36795
- if (didPushOwnContextIfProvider && isContextProvider(Component)) {
36796
- // If the fiber is a context provider itself, when we read its context
36797
- // we may have already pushed its own child context on the stack. A context
36798
- // provider should not "see" its own child context. Therefore we read the
36799
- // previous (parent) context instead for a context provider.
36800
- return previousContext;
36801
- }
36802
-
36803
- return contextStackCursor.current;
36804
- }
36805
- }
36806
-
36807
- function cacheContext(workInProgress, unmaskedContext, maskedContext) {
36808
- if (disableLegacyContext) {
36809
- return;
36810
- } else {
36811
- var instance = workInProgress.stateNode;
36812
- instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;
36813
- instance.__reactInternalMemoizedMaskedChildContext = maskedContext;
36814
- }
36815
- }
36816
-
36817
- function getMaskedContext(workInProgress, unmaskedContext) {
36818
- if (disableLegacyContext) {
36819
- return emptyContextObject;
36820
- } else {
36821
- var type = workInProgress.type;
36822
- var contextTypes = type.contextTypes;
36823
-
36824
- if (!contextTypes) {
36825
- return emptyContextObject;
36826
- } // Avoid recreating masked context unless unmasked context has changed.
36827
- // Failing to do this will result in unnecessary calls to componentWillReceiveProps.
36828
- // This may trigger infinite loops if componentWillReceiveProps calls setState.
36829
-
36830
-
36831
- var instance = workInProgress.stateNode;
36832
-
36833
- if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {
36834
- return instance.__reactInternalMemoizedMaskedChildContext;
36835
- }
36836
-
36837
- var context = {};
36838
-
36839
- for (var key in contextTypes) {
36840
- context[key] = unmaskedContext[key];
36841
- }
36842
-
36843
- {
36844
- var name = getComponentName(type) || 'Unknown';
36845
- checkPropTypes(contextTypes, context, 'context', name, getCurrentFiberStackInDev);
36846
- } // Cache unmasked context so we can avoid recreating masked context unless necessary.
36847
- // Context is created before the class component is instantiated so check for instance.
36848
-
36849
-
36850
- if (instance) {
36851
- cacheContext(workInProgress, unmaskedContext, context);
36852
- }
36853
-
36854
- return context;
36855
- }
36856
- }
36857
-
36858
- function hasContextChanged() {
36859
- if (disableLegacyContext) {
36860
- return false;
36861
- } else {
36862
- return didPerformWorkStackCursor.current;
36863
- }
36864
- }
36865
-
36866
- function isContextProvider(type) {
36867
- if (disableLegacyContext) {
36868
- return false;
36869
- } else {
36870
- var childContextTypes = type.childContextTypes;
36871
- return childContextTypes !== null && childContextTypes !== undefined;
36872
- }
36873
- }
36874
-
36875
- function popContext(fiber) {
36876
- if (disableLegacyContext) {
36877
- return;
36878
- } else {
36879
- pop(didPerformWorkStackCursor, fiber);
36880
- pop(contextStackCursor, fiber);
36881
- }
36882
- }
36883
-
36884
- function popTopLevelContextObject(fiber) {
36885
- if (disableLegacyContext) {
36886
- return;
36887
- } else {
36888
- pop(didPerformWorkStackCursor, fiber);
36889
- pop(contextStackCursor, fiber);
36890
- }
36891
- }
36892
-
36893
- function pushTopLevelContextObject(fiber, context, didChange) {
36894
- if (disableLegacyContext) {
36895
- return;
36896
- } else {
36897
- if (!(contextStackCursor.current === emptyContextObject)) {
36898
- {
36899
- throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.");
36900
- }
36901
- }
36902
-
36903
- push(contextStackCursor, context, fiber);
36904
- push(didPerformWorkStackCursor, didChange, fiber);
36905
- }
36906
- }
36907
-
36908
- function processChildContext(fiber, type, parentContext) {
36909
- if (disableLegacyContext) {
36910
- return parentContext;
36911
- } else {
36912
- var instance = fiber.stateNode;
36913
- var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future.
36914
- // It has only been added in Fiber to match the (unintentional) behavior in Stack.
36915
-
36916
- if (typeof instance.getChildContext !== 'function') {
36917
- {
36918
- var componentName = getComponentName(type) || 'Unknown';
36919
-
36920
- if (!warnedAboutMissingGetChildContext[componentName]) {
36921
- warnedAboutMissingGetChildContext[componentName] = true;
36922
- warningWithoutStack$1(false, '%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName);
36923
- }
36924
- }
36925
-
36926
- return parentContext;
36927
- }
36928
-
36929
- var childContext;
36930
-
36931
- {
36932
- setCurrentPhase('getChildContext');
36933
- }
36934
-
36935
- startPhaseTimer(fiber, 'getChildContext');
36936
- childContext = instance.getChildContext();
36937
- stopPhaseTimer();
36938
-
36939
- {
36940
- setCurrentPhase(null);
36941
- }
36942
-
36943
- for (var contextKey in childContext) {
36944
- if (!(contextKey in childContextTypes)) {
36945
- {
36946
- throw Error((getComponentName(type) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes.");
36947
- }
36948
- }
36949
- }
36950
-
36951
- {
36952
- var name = getComponentName(type) || 'Unknown';
36953
- checkPropTypes(childContextTypes, childContext, 'child context', name, // In practice, there is one case in which we won't get a stack. It's when
36954
- // somebody calls unstable_renderSubtreeIntoContainer() and we process
36955
- // context from the parent component instance. The stack will be missing
36956
- // because it's outside of the reconciliation, and so the pointer has not
36957
- // been set. This is rare and doesn't matter. We'll also remove that API.
36958
- getCurrentFiberStackInDev);
36959
- }
36960
-
36961
- return _assign({}, parentContext, {}, childContext);
36962
- }
36963
- }
36964
-
36965
- function pushContextProvider(workInProgress) {
36966
- if (disableLegacyContext) {
36967
- return false;
36968
- } else {
36969
- var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity.
36970
- // If the instance does not exist yet, we will push null at first,
36971
- // and replace it on the stack later when invalidating the context.
36972
-
36973
- var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later.
36974
- // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.
36975
-
36976
- previousContext = contextStackCursor.current;
36977
- push(contextStackCursor, memoizedMergedChildContext, workInProgress);
36978
- push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);
36979
- return true;
36980
- }
36981
- }
36982
-
36983
- function invalidateContextProvider(workInProgress, type, didChange) {
36984
- if (disableLegacyContext) {
36985
- return;
36986
- } else {
36987
- var instance = workInProgress.stateNode;
36988
-
36989
- if (!instance) {
36990
- {
36991
- throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.");
36992
- }
36993
- }
36994
-
36995
- if (didChange) {
36996
- // Merge parent and own context.
36997
- // Skip this if we're not updating due to sCU.
36998
- // This avoids unnecessarily recomputing memoized values.
36999
- var mergedContext = processChildContext(workInProgress, type, previousContext);
37000
- instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one.
37001
- // It is important to unwind the context in the reverse order.
37002
-
37003
- pop(didPerformWorkStackCursor, workInProgress);
37004
- pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed.
37005
-
37006
- push(contextStackCursor, mergedContext, workInProgress);
37007
- push(didPerformWorkStackCursor, didChange, workInProgress);
37008
- } else {
37009
- pop(didPerformWorkStackCursor, workInProgress);
37010
- push(didPerformWorkStackCursor, didChange, workInProgress);
37011
- }
37012
- }
37013
- }
37014
-
37015
- function findCurrentUnmaskedContext(fiber) {
37016
- if (disableLegacyContext) {
37017
- return emptyContextObject;
37018
- } else {
37019
- // Currently this is only used with renderSubtreeIntoContainer; not sure if it
37020
- // makes sense elsewhere
37021
- if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {
37022
- {
37023
- throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.");
37024
- }
37025
- }
37026
-
37027
- var node = fiber;
37028
-
37029
- do {
37030
- switch (node.tag) {
37031
- case HostRoot:
37032
- return node.stateNode.context;
37033
-
37034
- case ClassComponent:
37035
- {
37036
- var Component = node.type;
37037
-
37038
- if (isContextProvider(Component)) {
37039
- return node.stateNode.__reactInternalMemoizedMergedChildContext;
37040
- }
37041
-
37042
- break;
37043
- }
37044
- }
37045
-
37046
- node = node.return;
37047
- } while (node !== null);
37048
-
37049
- {
37050
- {
37051
- throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.");
37052
- }
37053
- }
37054
- }
37055
- }
37056
-
37057
- var LegacyRoot = 0;
37058
- var BlockingRoot = 1;
37059
- var ConcurrentRoot = 2;
37060
-
37061
- // Intentionally not named imports because Rollup would use dynamic dispatch for
37062
- // CommonJS interop named imports.
37063
- var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority;
37064
- var Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback;
37065
- var Scheduler_cancelCallback = Scheduler.unstable_cancelCallback;
37066
- var Scheduler_shouldYield = Scheduler.unstable_shouldYield;
37067
- var Scheduler_requestPaint = Scheduler.unstable_requestPaint;
37068
- var Scheduler_now = Scheduler.unstable_now;
37069
- var Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel;
37070
- var Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority;
37071
- var Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
37072
- var Scheduler_NormalPriority = Scheduler.unstable_NormalPriority;
37073
- var Scheduler_LowPriority = Scheduler.unstable_LowPriority;
37074
- var Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;
37075
-
37076
- if (enableSchedulerTracing) {
37077
- // Provide explicit error message when production+profiling bundle of e.g.
37078
- // react-dom is used with production (non-profiling) bundle of
37079
- // scheduler/tracing
37080
- if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {
37081
- {
37082
- throw Error("It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `scheduler/tracing` module with `scheduler/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling");
37083
- }
37084
- }
37085
- }
37086
-
37087
- var fakeCallbackNode = {}; // Except for NoPriority, these correspond to Scheduler priorities. We use
37088
- // ascending numbers so we can compare them like numbers. They start at 90 to
37089
- // avoid clashing with Scheduler's priorities.
37090
-
37091
- var ImmediatePriority = 99;
37092
- var UserBlockingPriority$2 = 98;
37093
- var NormalPriority = 97;
37094
- var LowPriority = 96;
37095
- var IdlePriority = 95; // NoPriority is the absence of priority. Also React-only.
37096
-
37097
- var NoPriority = 90;
37098
- var shouldYield = Scheduler_shouldYield;
37099
- var requestPaint = // Fall back gracefully if we're running an older version of Scheduler.
37100
- Scheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};
37101
- var syncQueue = null;
37102
- var immediateQueueCallbackNode = null;
37103
- var isFlushingSyncQueue = false;
37104
- var initialTimeMs = Scheduler_now(); // If the initial timestamp is reasonably small, use Scheduler's `now` directly.
37105
- // This will be the case for modern browsers that support `performance.now`. In
37106
- // older browsers, Scheduler falls back to `Date.now`, which returns a Unix
37107
- // timestamp. In that case, subtract the module initialization time to simulate
37108
- // the behavior of performance.now and keep our times small enough to fit
37109
- // within 32 bits.
37110
- // TODO: Consider lifting this into Scheduler.
37111
-
37112
- var now = initialTimeMs < 10000 ? Scheduler_now : function () {
37113
- return Scheduler_now() - initialTimeMs;
37114
- };
37115
- function getCurrentPriorityLevel() {
37116
- switch (Scheduler_getCurrentPriorityLevel()) {
37117
- case Scheduler_ImmediatePriority:
37118
- return ImmediatePriority;
37119
-
37120
- case Scheduler_UserBlockingPriority:
37121
- return UserBlockingPriority$2;
37122
-
37123
- case Scheduler_NormalPriority:
37124
- return NormalPriority;
37125
-
37126
- case Scheduler_LowPriority:
37127
- return LowPriority;
37128
-
37129
- case Scheduler_IdlePriority:
37130
- return IdlePriority;
37131
-
37132
- default:
37133
- {
37134
- {
37135
- throw Error("Unknown priority level.");
37136
- }
37137
- }
37138
-
37139
- }
37140
- }
37141
-
37142
- function reactPriorityToSchedulerPriority(reactPriorityLevel) {
37143
- switch (reactPriorityLevel) {
37144
- case ImmediatePriority:
37145
- return Scheduler_ImmediatePriority;
37146
-
37147
- case UserBlockingPriority$2:
37148
- return Scheduler_UserBlockingPriority;
37149
-
37150
- case NormalPriority:
37151
- return Scheduler_NormalPriority;
37152
-
37153
- case LowPriority:
37154
- return Scheduler_LowPriority;
37155
-
37156
- case IdlePriority:
37157
- return Scheduler_IdlePriority;
37158
-
37159
- default:
37160
- {
37161
- {
37162
- throw Error("Unknown priority level.");
37163
- }
37164
- }
37165
-
37166
- }
37167
- }
37168
-
37169
- function runWithPriority$2(reactPriorityLevel, fn) {
37170
- var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
37171
- return Scheduler_runWithPriority(priorityLevel, fn);
37172
- }
37173
- function scheduleCallback(reactPriorityLevel, callback, options) {
37174
- var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
37175
- return Scheduler_scheduleCallback(priorityLevel, callback, options);
37176
- }
37177
- function scheduleSyncCallback(callback) {
37178
- // Push this callback into an internal queue. We'll flush these either in
37179
- // the next tick, or earlier if something calls `flushSyncCallbackQueue`.
37180
- if (syncQueue === null) {
37181
- syncQueue = [callback]; // Flush the queue in the next tick, at the earliest.
37182
-
37183
- immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);
37184
- } else {
37185
- // Push onto existing queue. Don't need to schedule a callback because
37186
- // we already scheduled one when we created the queue.
37187
- syncQueue.push(callback);
37188
- }
37189
-
37190
- return fakeCallbackNode;
37191
- }
37192
- function cancelCallback(callbackNode) {
37193
- if (callbackNode !== fakeCallbackNode) {
37194
- Scheduler_cancelCallback(callbackNode);
37195
- }
37196
- }
37197
- function flushSyncCallbackQueue() {
37198
- if (immediateQueueCallbackNode !== null) {
37199
- var node = immediateQueueCallbackNode;
37200
- immediateQueueCallbackNode = null;
37201
- Scheduler_cancelCallback(node);
37202
- }
37203
-
37204
- flushSyncCallbackQueueImpl();
37205
- }
37206
-
37207
- function flushSyncCallbackQueueImpl() {
37208
- if (!isFlushingSyncQueue && syncQueue !== null) {
37209
- // Prevent re-entrancy.
37210
- isFlushingSyncQueue = true;
37211
- var i = 0;
37212
-
37213
- try {
37214
- var _isSync = true;
37215
- var queue = syncQueue;
37216
- runWithPriority$2(ImmediatePriority, function () {
37217
- for (; i < queue.length; i++) {
37218
- var callback = queue[i];
37219
-
37220
- do {
37221
- callback = callback(_isSync);
37222
- } while (callback !== null);
37223
- }
37224
- });
37225
- syncQueue = null;
37226
- } catch (error) {
37227
- // If something throws, leave the remaining callbacks on the queue.
37228
- if (syncQueue !== null) {
37229
- syncQueue = syncQueue.slice(i + 1);
37230
- } // Resume flushing in the next tick
37231
-
37232
-
37233
- Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);
37234
- throw error;
37235
- } finally {
37236
- isFlushingSyncQueue = false;
37237
- }
37238
- }
37239
- }
37240
-
37241
- var NoMode = 0;
37242
- var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root
37243
- // tag instead
37244
-
37245
- var BlockingMode = 2;
37246
- var ConcurrentMode = 4;
37247
- var ProfileMode = 8;
37248
-
37249
- // Max 31 bit integer. The max integer size in V8 for 32-bit systems.
37250
- // Math.pow(2, 30) - 1
37251
- // 0b111111111111111111111111111111
37252
- var MAX_SIGNED_31_BIT_INT = 1073741823;
37253
-
37254
- var NoWork = 0; // TODO: Think of a better name for Never. The key difference with Idle is that
37255
- // Never work can be committed in an inconsistent state without tearing the UI.
37256
- // The main example is offscreen content, like a hidden subtree. So one possible
37257
- // name is Offscreen. However, it also includes dehydrated Suspense boundaries,
37258
- // which are inconsistent in the sense that they haven't finished yet, but
37259
- // aren't visibly inconsistent because the server rendered HTML matches what the
37260
- // hydrated tree would look like.
37261
-
37262
- var Never = 1; // Idle is slightly higher priority than Never. It must completely finish in
37263
- // order to be consistent.
37264
-
37265
- var Idle = 2; // Continuous Hydration is a moving priority. It is slightly higher than Idle
37266
- // and is used to increase priority of hover targets. It is increasing with
37267
- // each usage so that last always wins.
37268
-
37269
- var ContinuousHydration = 3;
37270
- var Sync = MAX_SIGNED_31_BIT_INT;
37271
- var Batched = Sync - 1;
37272
- var UNIT_SIZE = 10;
37273
- var MAGIC_NUMBER_OFFSET = Batched - 1; // 1 unit of expiration time represents 10ms.
37274
-
37275
- function msToExpirationTime(ms) {
37276
- // Always add an offset so that we don't clash with the magic number for NoWork.
37277
- return MAGIC_NUMBER_OFFSET - (ms / UNIT_SIZE | 0);
37278
- }
37279
- function expirationTimeToMs(expirationTime) {
37280
- return (MAGIC_NUMBER_OFFSET - expirationTime) * UNIT_SIZE;
37281
- }
37282
-
37283
- function ceiling(num, precision) {
37284
- return ((num / precision | 0) + 1) * precision;
37285
- }
37286
-
37287
- function computeExpirationBucket(currentTime, expirationInMs, bucketSizeMs) {
37288
- return MAGIC_NUMBER_OFFSET - ceiling(MAGIC_NUMBER_OFFSET - currentTime + expirationInMs / UNIT_SIZE, bucketSizeMs / UNIT_SIZE);
37289
- } // TODO: This corresponds to Scheduler's NormalPriority, not LowPriority. Update
37290
- // the names to reflect.
37291
-
37292
-
37293
- var LOW_PRIORITY_EXPIRATION = 5000;
37294
- var LOW_PRIORITY_BATCH_SIZE = 250;
37295
- function computeAsyncExpiration(currentTime) {
37296
- return computeExpirationBucket(currentTime, LOW_PRIORITY_EXPIRATION, LOW_PRIORITY_BATCH_SIZE);
37297
- }
37298
- function computeSuspenseExpiration(currentTime, timeoutMs) {
37299
- // TODO: Should we warn if timeoutMs is lower than the normal pri expiration time?
37300
- return computeExpirationBucket(currentTime, timeoutMs, LOW_PRIORITY_BATCH_SIZE);
37301
- } // We intentionally set a higher expiration time for interactive updates in
37302
- // dev than in production.
37303
- //
37304
- // If the main thread is being blocked so long that you hit the expiration,
37305
- // it's a problem that could be solved with better scheduling.
37306
- //
37307
- // People will be more likely to notice this and fix it with the long
37308
- // expiration time in development.
37309
- //
37310
- // In production we opt for better UX at the risk of masking scheduling
37311
- // problems, by expiring fast.
37312
-
37313
- var HIGH_PRIORITY_EXPIRATION = 500;
37314
- var HIGH_PRIORITY_BATCH_SIZE = 100;
37315
- function computeInteractiveExpiration(currentTime) {
37316
- return computeExpirationBucket(currentTime, HIGH_PRIORITY_EXPIRATION, HIGH_PRIORITY_BATCH_SIZE);
37317
- }
37318
- function computeContinuousHydrationExpiration(currentTime) {
37319
- // Each time we ask for a new one of these we increase the priority.
37320
- // This ensures that the last one always wins since we can't deprioritize
37321
- // once we've scheduled work already.
37322
- return ContinuousHydration++;
37323
- }
37324
- function inferPriorityFromExpirationTime(currentTime, expirationTime) {
37325
- if (expirationTime === Sync) {
37326
- return ImmediatePriority;
37327
- }
37328
-
37329
- if (expirationTime === Never || expirationTime === Idle) {
37330
- return IdlePriority;
37331
- }
37332
-
37333
- var msUntil = expirationTimeToMs(expirationTime) - expirationTimeToMs(currentTime);
37334
-
37335
- if (msUntil <= 0) {
37336
- return ImmediatePriority;
37337
- }
37338
-
37339
- if (msUntil <= HIGH_PRIORITY_EXPIRATION + HIGH_PRIORITY_BATCH_SIZE) {
37340
- return UserBlockingPriority$2;
37341
- }
37342
-
37343
- if (msUntil <= LOW_PRIORITY_EXPIRATION + LOW_PRIORITY_BATCH_SIZE) {
37344
- return NormalPriority;
37345
- } // TODO: Handle LowPriority
37346
- // Assume anything lower has idle priority
37347
-
37348
-
37349
- return IdlePriority;
37350
- }
37351
-
37352
- /**
37353
- * Forked from fbjs/warning:
37354
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
37355
- *
37356
- * Only change is we use console.warn instead of console.error,
37357
- * and do nothing when 'console' is not supported.
37358
- * This really simplifies the code.
37359
- * ---
37360
- * Similar to invariant but only logs a warning if the condition is not met.
37361
- * This can be used to log issues in development environments in critical
37362
- * paths. Removing the logging code for production environments will keep the
37363
- * same logic and follow the same code paths.
37364
- */
37365
- var lowPriorityWarningWithoutStack = function () {};
37366
-
37367
- {
37368
- var printWarning = function (format) {
37369
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
37370
- args[_key - 1] = arguments[_key];
37371
- }
37372
-
37373
- var argIndex = 0;
37374
- var message = 'Warning: ' + format.replace(/%s/g, function () {
37375
- return args[argIndex++];
37376
- });
37377
-
37378
- if (typeof console !== 'undefined') {
37379
- console.warn(message);
37380
- }
37381
-
37382
- try {
37383
- // --- Welcome to debugging React ---
37384
- // This error was thrown as a convenience so that you can use this stack
37385
- // to find the callsite that caused this warning to fire.
37386
- throw new Error(message);
37387
- } catch (x) {}
37388
- };
37389
-
37390
- lowPriorityWarningWithoutStack = function (condition, format) {
37391
- if (format === undefined) {
37392
- throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
37393
- }
37394
-
37395
- if (!condition) {
37396
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
37397
- args[_key2 - 2] = arguments[_key2];
37398
- }
37399
-
37400
- printWarning.apply(void 0, [format].concat(args));
37401
- }
37402
- };
37403
- }
37404
-
37405
- var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
37406
-
37407
- var ReactStrictModeWarnings = {
37408
- recordUnsafeLifecycleWarnings: function (fiber, instance) {},
37409
- flushPendingUnsafeLifecycleWarnings: function () {},
37410
- recordLegacyContextWarning: function (fiber, instance) {},
37411
- flushLegacyContextWarning: function () {},
37412
- discardPendingWarnings: function () {}
37413
- };
37414
-
37415
- {
37416
- var findStrictRoot = function (fiber) {
37417
- var maybeStrictRoot = null;
37418
- var node = fiber;
37419
-
37420
- while (node !== null) {
37421
- if (node.mode & StrictMode) {
37422
- maybeStrictRoot = node;
37423
- }
37424
-
37425
- node = node.return;
37426
- }
37427
-
37428
- return maybeStrictRoot;
37429
- };
37430
-
37431
- var setToSortedString = function (set) {
37432
- var array = [];
37433
- set.forEach(function (value) {
37434
- array.push(value);
37435
- });
37436
- return array.sort().join(', ');
37437
- };
37438
-
37439
- var pendingComponentWillMountWarnings = [];
37440
- var pendingUNSAFE_ComponentWillMountWarnings = [];
37441
- var pendingComponentWillReceivePropsWarnings = [];
37442
- var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
37443
- var pendingComponentWillUpdateWarnings = [];
37444
- var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about.
37445
-
37446
- var didWarnAboutUnsafeLifecycles = new Set();
37447
-
37448
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {
37449
- // Dedup strategy: Warn once per component.
37450
- if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
37451
- return;
37452
- }
37453
-
37454
- if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components.
37455
- instance.componentWillMount.__suppressDeprecationWarning !== true) {
37456
- pendingComponentWillMountWarnings.push(fiber);
37457
- }
37458
-
37459
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {
37460
- pendingUNSAFE_ComponentWillMountWarnings.push(fiber);
37461
- }
37462
-
37463
- if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
37464
- pendingComponentWillReceivePropsWarnings.push(fiber);
37465
- }
37466
-
37467
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
37468
- pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);
37469
- }
37470
-
37471
- if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
37472
- pendingComponentWillUpdateWarnings.push(fiber);
37473
- }
37474
-
37475
- if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {
37476
- pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);
37477
- }
37478
- };
37479
-
37480
- ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {
37481
- // We do an initial pass to gather component names
37482
- var componentWillMountUniqueNames = new Set();
37483
-
37484
- if (pendingComponentWillMountWarnings.length > 0) {
37485
- pendingComponentWillMountWarnings.forEach(function (fiber) {
37486
- componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
37487
- didWarnAboutUnsafeLifecycles.add(fiber.type);
37488
- });
37489
- pendingComponentWillMountWarnings = [];
37490
- }
37491
-
37492
- var UNSAFE_componentWillMountUniqueNames = new Set();
37493
-
37494
- if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) {
37495
- pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {
37496
- UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');
37497
- didWarnAboutUnsafeLifecycles.add(fiber.type);
37498
- });
37499
- pendingUNSAFE_ComponentWillMountWarnings = [];
37500
- }
37501
-
37502
- var componentWillReceivePropsUniqueNames = new Set();
37503
-
37504
- if (pendingComponentWillReceivePropsWarnings.length > 0) {
37505
- pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {
37506
- componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
37507
- didWarnAboutUnsafeLifecycles.add(fiber.type);
37508
- });
37509
- pendingComponentWillReceivePropsWarnings = [];
37510
- }
37511
-
37512
- var UNSAFE_componentWillReceivePropsUniqueNames = new Set();
37513
-
37514
- if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) {
37515
- pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {
37516
- UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');
37517
- didWarnAboutUnsafeLifecycles.add(fiber.type);
37518
- });
37519
- pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
37520
- }
37521
-
37522
- var componentWillUpdateUniqueNames = new Set();
37523
-
37524
- if (pendingComponentWillUpdateWarnings.length > 0) {
37525
- pendingComponentWillUpdateWarnings.forEach(function (fiber) {
37526
- componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
37527
- didWarnAboutUnsafeLifecycles.add(fiber.type);
37528
- });
37529
- pendingComponentWillUpdateWarnings = [];
37530
- }
37531
-
37532
- var UNSAFE_componentWillUpdateUniqueNames = new Set();
37533
-
37534
- if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) {
37535
- pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {
37536
- UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');
37537
- didWarnAboutUnsafeLifecycles.add(fiber.type);
37538
- });
37539
- pendingUNSAFE_ComponentWillUpdateWarnings = [];
37540
- } // Finally, we flush all the warnings
37541
- // UNSAFE_ ones before the deprecated ones, since they'll be 'louder'
37542
-
37543
-
37544
- if (UNSAFE_componentWillMountUniqueNames.size > 0) {
37545
- var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);
37546
- warningWithoutStack$1(false, 'Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames);
37547
- }
37548
-
37549
- if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) {
37550
- var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);
37551
-
37552
- warningWithoutStack$1(false, 'Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '\nPlease update the following components: %s', _sortedNames);
37553
- }
37554
-
37555
- if (UNSAFE_componentWillUpdateUniqueNames.size > 0) {
37556
- var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);
37557
-
37558
- warningWithoutStack$1(false, 'Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2);
37559
- }
37560
-
37561
- if (componentWillMountUniqueNames.size > 0) {
37562
- var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);
37563
-
37564
- lowPriorityWarningWithoutStack$1(false, 'componentWillMount has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3);
37565
- }
37566
-
37567
- if (componentWillReceivePropsUniqueNames.size > 0) {
37568
- var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);
37569
-
37570
- lowPriorityWarningWithoutStack$1(false, 'componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4);
37571
- }
37572
-
37573
- if (componentWillUpdateUniqueNames.size > 0) {
37574
- var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);
37575
-
37576
- lowPriorityWarningWithoutStack$1(false, 'componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://fb.me/react-unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5);
37577
- }
37578
- };
37579
-
37580
- var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about.
37581
-
37582
- var didWarnAboutLegacyContext = new Set();
37583
-
37584
- ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {
37585
- var strictRoot = findStrictRoot(fiber);
37586
-
37587
- if (strictRoot === null) {
37588
- warningWithoutStack$1(false, 'Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');
37589
- return;
37590
- } // Dedup strategy: Warn once per component.
37591
-
37592
-
37593
- if (didWarnAboutLegacyContext.has(fiber.type)) {
37594
- return;
37595
- }
37596
-
37597
- var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);
37598
-
37599
- if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {
37600
- if (warningsForRoot === undefined) {
37601
- warningsForRoot = [];
37602
- pendingLegacyContextWarning.set(strictRoot, warningsForRoot);
37603
- }
37604
-
37605
- warningsForRoot.push(fiber);
37606
- }
37607
- };
37608
-
37609
- ReactStrictModeWarnings.flushLegacyContextWarning = function () {
37610
- pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {
37611
- var uniqueNames = new Set();
37612
- fiberArray.forEach(function (fiber) {
37613
- uniqueNames.add(getComponentName(fiber.type) || 'Component');
37614
- didWarnAboutLegacyContext.add(fiber.type);
37615
- });
37616
- var sortedNames = setToSortedString(uniqueNames);
37617
- var strictRootComponentStack = getStackByFiberInDevAndProd(strictRoot);
37618
- warningWithoutStack$1(false, 'Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://fb.me/react-legacy-context' + '%s', sortedNames, strictRootComponentStack);
37619
- });
37620
- };
37621
-
37622
- ReactStrictModeWarnings.discardPendingWarnings = function () {
37623
- pendingComponentWillMountWarnings = [];
37624
- pendingUNSAFE_ComponentWillMountWarnings = [];
37625
- pendingComponentWillReceivePropsWarnings = [];
37626
- pendingUNSAFE_ComponentWillReceivePropsWarnings = [];
37627
- pendingComponentWillUpdateWarnings = [];
37628
- pendingUNSAFE_ComponentWillUpdateWarnings = [];
37629
- pendingLegacyContextWarning = new Map();
37630
- };
37631
- }
37632
-
37633
- var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below.
37634
-
37635
- var failedBoundaries = null;
37636
- var setRefreshHandler = function (handler) {
37637
- {
37638
- resolveFamily = handler;
37639
- }
37640
- };
37641
- function resolveFunctionForHotReloading(type) {
37642
- {
37643
- if (resolveFamily === null) {
37644
- // Hot reloading is disabled.
37645
- return type;
37646
- }
37647
-
37648
- var family = resolveFamily(type);
37649
-
37650
- if (family === undefined) {
37651
- return type;
37652
- } // Use the latest known implementation.
37653
-
37654
-
37655
- return family.current;
37656
- }
37657
- }
37658
- function resolveClassForHotReloading(type) {
37659
- // No implementation differences.
37660
- return resolveFunctionForHotReloading(type);
37661
- }
37662
- function resolveForwardRefForHotReloading(type) {
37663
- {
37664
- if (resolveFamily === null) {
37665
- // Hot reloading is disabled.
37666
- return type;
37667
- }
37668
-
37669
- var family = resolveFamily(type);
37670
-
37671
- if (family === undefined) {
37672
- // Check if we're dealing with a real forwardRef. Don't want to crash early.
37673
- if (type !== null && type !== undefined && typeof type.render === 'function') {
37674
- // ForwardRef is special because its resolved .type is an object,
37675
- // but it's possible that we only have its inner render function in the map.
37676
- // If that inner render function is different, we'll build a new forwardRef type.
37677
- var currentRender = resolveFunctionForHotReloading(type.render);
37678
-
37679
- if (type.render !== currentRender) {
37680
- var syntheticType = {
37681
- $$typeof: REACT_FORWARD_REF_TYPE,
37682
- render: currentRender
37683
- };
37684
-
37685
- if (type.displayName !== undefined) {
37686
- syntheticType.displayName = type.displayName;
37687
- }
37688
-
37689
- return syntheticType;
37690
- }
37691
- }
37692
-
37693
- return type;
37694
- } // Use the latest known implementation.
37695
-
37696
-
37697
- return family.current;
37698
- }
37699
- }
37700
- function isCompatibleFamilyForHotReloading(fiber, element) {
37701
- {
37702
- if (resolveFamily === null) {
37703
- // Hot reloading is disabled.
37704
- return false;
37705
- }
37706
-
37707
- var prevType = fiber.elementType;
37708
- var nextType = element.type; // If we got here, we know types aren't === equal.
37709
-
37710
- var needsCompareFamilies = false;
37711
- var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null;
37712
-
37713
- switch (fiber.tag) {
37714
- case ClassComponent:
37715
- {
37716
- if (typeof nextType === 'function') {
37717
- needsCompareFamilies = true;
37718
- }
37719
-
37720
- break;
37721
- }
37722
-
37723
- case FunctionComponent:
37724
- {
37725
- if (typeof nextType === 'function') {
37726
- needsCompareFamilies = true;
37727
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
37728
- // We don't know the inner type yet.
37729
- // We're going to assume that the lazy inner type is stable,
37730
- // and so it is sufficient to avoid reconciling it away.
37731
- // We're not going to unwrap or actually use the new lazy type.
37732
- needsCompareFamilies = true;
37733
- }
37734
-
37735
- break;
37736
- }
37737
-
37738
- case ForwardRef:
37739
- {
37740
- if ($$typeofNextType === REACT_FORWARD_REF_TYPE) {
37741
- needsCompareFamilies = true;
37742
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
37743
- needsCompareFamilies = true;
37744
- }
37745
-
37746
- break;
37747
- }
37748
-
37749
- case MemoComponent:
37750
- case SimpleMemoComponent:
37751
- {
37752
- if ($$typeofNextType === REACT_MEMO_TYPE) {
37753
- // TODO: if it was but can no longer be simple,
37754
- // we shouldn't set this.
37755
- needsCompareFamilies = true;
37756
- } else if ($$typeofNextType === REACT_LAZY_TYPE) {
37757
- needsCompareFamilies = true;
37758
- }
37759
-
37760
- break;
37761
- }
37762
-
37763
- default:
37764
- return false;
37765
- } // Check if both types have a family and it's the same one.
37766
-
37767
-
37768
- if (needsCompareFamilies) {
37769
- // Note: memo() and forwardRef() we'll compare outer rather than inner type.
37770
- // This means both of them need to be registered to preserve state.
37771
- // If we unwrapped and compared the inner types for wrappers instead,
37772
- // then we would risk falsely saying two separate memo(Foo)
37773
- // calls are equivalent because they wrap the same Foo function.
37774
- var prevFamily = resolveFamily(prevType);
37775
-
37776
- if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {
37777
- return true;
37778
- }
37779
- }
37780
-
37781
- return false;
37782
- }
37783
- }
37784
- function markFailedErrorBoundaryForHotReloading(fiber) {
37785
- {
37786
- if (resolveFamily === null) {
37787
- // Hot reloading is disabled.
37788
- return;
37789
- }
37790
-
37791
- if (typeof WeakSet !== 'function') {
37792
- return;
37793
- }
37794
-
37795
- if (failedBoundaries === null) {
37796
- failedBoundaries = new WeakSet();
37797
- }
37798
-
37799
- failedBoundaries.add(fiber);
37800
- }
37801
- }
37802
- var scheduleRefresh = function (root, update) {
37803
- {
37804
- if (resolveFamily === null) {
37805
- // Hot reloading is disabled.
37806
- return;
37807
- }
37808
-
37809
- var staleFamilies = update.staleFamilies,
37810
- updatedFamilies = update.updatedFamilies;
37811
- flushPassiveEffects();
37812
- flushSync(function () {
37813
- scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
37814
- });
37815
- }
37816
- };
37817
- var scheduleRoot = function (root, element) {
37818
- {
37819
- if (root.context !== emptyContextObject) {
37820
- // Super edge case: root has a legacy _renderSubtree context
37821
- // but we don't know the parentComponent so we can't pass it.
37822
- // Just ignore. We'll delete this with _renderSubtree code path later.
37823
- return;
37824
- }
37825
-
37826
- flushPassiveEffects();
37827
- syncUpdates(function () {
37828
- updateContainer(element, root, null, null);
37829
- });
37830
- }
37831
- };
37832
-
37833
- function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
37834
- {
37835
- var alternate = fiber.alternate,
37836
- child = fiber.child,
37837
- sibling = fiber.sibling,
37838
- tag = fiber.tag,
37839
- type = fiber.type;
37840
- var candidateType = null;
37841
-
37842
- switch (tag) {
37843
- case FunctionComponent:
37844
- case SimpleMemoComponent:
37845
- case ClassComponent:
37846
- candidateType = type;
37847
- break;
37848
-
37849
- case ForwardRef:
37850
- candidateType = type.render;
37851
- break;
37852
-
37853
- default:
37854
- break;
37855
- }
37856
-
37857
- if (resolveFamily === null) {
37858
- throw new Error('Expected resolveFamily to be set during hot reload.');
37859
- }
37860
-
37861
- var needsRender = false;
37862
- var needsRemount = false;
37863
-
37864
- if (candidateType !== null) {
37865
- var family = resolveFamily(candidateType);
37866
-
37867
- if (family !== undefined) {
37868
- if (staleFamilies.has(family)) {
37869
- needsRemount = true;
37870
- } else if (updatedFamilies.has(family)) {
37871
- if (tag === ClassComponent) {
37872
- needsRemount = true;
37873
- } else {
37874
- needsRender = true;
37875
- }
37876
- }
37877
- }
37878
- }
37879
-
37880
- if (failedBoundaries !== null) {
37881
- if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {
37882
- needsRemount = true;
37883
- }
37884
- }
37885
-
37886
- if (needsRemount) {
37887
- fiber._debugNeedsRemount = true;
37888
- }
37889
-
37890
- if (needsRemount || needsRender) {
37891
- scheduleWork(fiber, Sync);
37892
- }
37893
-
37894
- if (child !== null && !needsRemount) {
37895
- scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
37896
- }
37897
-
37898
- if (sibling !== null) {
37899
- scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
37900
- }
37901
- }
37902
- }
37903
-
37904
- var findHostInstancesForRefresh = function (root, families) {
37905
- {
37906
- var hostInstances = new Set();
37907
- var types = new Set(families.map(function (family) {
37908
- return family.current;
37909
- }));
37910
- findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);
37911
- return hostInstances;
37912
- }
37913
- };
37914
-
37915
- function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
37916
- {
37917
- var child = fiber.child,
37918
- sibling = fiber.sibling,
37919
- tag = fiber.tag,
37920
- type = fiber.type;
37921
- var candidateType = null;
37922
-
37923
- switch (tag) {
37924
- case FunctionComponent:
37925
- case SimpleMemoComponent:
37926
- case ClassComponent:
37927
- candidateType = type;
37928
- break;
37929
-
37930
- case ForwardRef:
37931
- candidateType = type.render;
37932
- break;
37933
-
37934
- default:
37935
- break;
37936
- }
37937
-
37938
- var didMatch = false;
37939
-
37940
- if (candidateType !== null) {
37941
- if (types.has(candidateType)) {
37942
- didMatch = true;
37943
- }
37944
- }
37945
-
37946
- if (didMatch) {
37947
- // We have a match. This only drills down to the closest host components.
37948
- // There's no need to search deeper because for the purpose of giving
37949
- // visual feedback, "flashing" outermost parent rectangles is sufficient.
37950
- findHostInstancesForFiberShallowly(fiber, hostInstances);
37951
- } else {
37952
- // If there's no match, maybe there will be one further down in the child tree.
37953
- if (child !== null) {
37954
- findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
37955
- }
37956
- }
37957
-
37958
- if (sibling !== null) {
37959
- findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);
37960
- }
37961
- }
37962
- }
37963
-
37964
- function findHostInstancesForFiberShallowly(fiber, hostInstances) {
37965
- {
37966
- var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);
37967
-
37968
- if (foundHostInstances) {
37969
- return;
37970
- } // If we didn't find any host children, fallback to closest host parent.
37971
-
37972
-
37973
- var node = fiber;
37974
-
37975
- while (true) {
37976
- switch (node.tag) {
37977
- case HostComponent:
37978
- hostInstances.add(node.stateNode);
37979
- return;
37980
-
37981
- case HostPortal:
37982
- hostInstances.add(node.stateNode.containerInfo);
37983
- return;
37984
-
37985
- case HostRoot:
37986
- hostInstances.add(node.stateNode.containerInfo);
37987
- return;
37988
- }
37989
-
37990
- if (node.return === null) {
37991
- throw new Error('Expected to reach root first.');
37992
- }
37993
-
37994
- node = node.return;
37995
- }
37996
- }
37997
- }
37998
-
37999
- function findChildHostInstancesForFiberShallowly(fiber, hostInstances) {
38000
- {
38001
- var node = fiber;
38002
- var foundHostInstances = false;
38003
-
38004
- while (true) {
38005
- if (node.tag === HostComponent) {
38006
- // We got a match.
38007
- foundHostInstances = true;
38008
- hostInstances.add(node.stateNode); // There may still be more, so keep searching.
38009
- } else if (node.child !== null) {
38010
- node.child.return = node;
38011
- node = node.child;
38012
- continue;
38013
- }
38014
-
38015
- if (node === fiber) {
38016
- return foundHostInstances;
38017
- }
38018
-
38019
- while (node.sibling === null) {
38020
- if (node.return === null || node.return === fiber) {
38021
- return foundHostInstances;
38022
- }
38023
-
38024
- node = node.return;
38025
- }
38026
-
38027
- node.sibling.return = node.return;
38028
- node = node.sibling;
38029
- }
38030
- }
38031
-
38032
- return false;
38033
- }
38034
-
38035
- function resolveDefaultProps(Component, baseProps) {
38036
- if (Component && Component.defaultProps) {
38037
- // Resolve default props. Taken from ReactElement
38038
- var props = _assign({}, baseProps);
38039
-
38040
- var defaultProps = Component.defaultProps;
38041
-
38042
- for (var propName in defaultProps) {
38043
- if (props[propName] === undefined) {
38044
- props[propName] = defaultProps[propName];
38045
- }
38046
- }
38047
-
38048
- return props;
38049
- }
38050
-
38051
- return baseProps;
38052
- }
38053
- function readLazyComponentType(lazyComponent) {
38054
- initializeLazyComponentType(lazyComponent);
38055
-
38056
- if (lazyComponent._status !== Resolved) {
38057
- throw lazyComponent._result;
38058
- }
38059
-
38060
- return lazyComponent._result;
38061
- }
38062
-
38063
- var valueCursor = createCursor(null);
38064
- var rendererSigil;
38065
-
38066
- {
38067
- // Use this to detect multiple renderers using the same context
38068
- rendererSigil = {};
38069
- }
38070
-
38071
- var currentlyRenderingFiber = null;
38072
- var lastContextDependency = null;
38073
- var lastContextWithAllBitsObserved = null;
38074
- var isDisallowedContextReadInDEV = false;
38075
- function resetContextDependencies() {
38076
- // This is called right before React yields execution, to ensure `readContext`
38077
- // cannot be called outside the render phase.
38078
- currentlyRenderingFiber = null;
38079
- lastContextDependency = null;
38080
- lastContextWithAllBitsObserved = null;
38081
-
38082
- {
38083
- isDisallowedContextReadInDEV = false;
38084
- }
38085
- }
38086
- function enterDisallowedContextReadInDEV() {
38087
- {
38088
- isDisallowedContextReadInDEV = true;
38089
- }
38090
- }
38091
- function exitDisallowedContextReadInDEV() {
38092
- {
38093
- isDisallowedContextReadInDEV = false;
38094
- }
38095
- }
38096
- function pushProvider(providerFiber, nextValue) {
38097
- var context = providerFiber.type._context;
38098
-
38099
- if (isPrimaryRenderer) {
38100
- push(valueCursor, context._currentValue, providerFiber);
38101
- context._currentValue = nextValue;
38102
-
38103
- {
38104
- !(context._currentRenderer === undefined || context._currentRenderer === null || context._currentRenderer === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
38105
- context._currentRenderer = rendererSigil;
38106
- }
38107
- } else {
38108
- push(valueCursor, context._currentValue2, providerFiber);
38109
- context._currentValue2 = nextValue;
38110
-
38111
- {
38112
- !(context._currentRenderer2 === undefined || context._currentRenderer2 === null || context._currentRenderer2 === rendererSigil) ? warningWithoutStack$1(false, 'Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.') : void 0;
38113
- context._currentRenderer2 = rendererSigil;
38114
- }
38115
- }
38116
- }
38117
- function popProvider(providerFiber) {
38118
- var currentValue = valueCursor.current;
38119
- pop(valueCursor, providerFiber);
38120
- var context = providerFiber.type._context;
38121
-
38122
- if (isPrimaryRenderer) {
38123
- context._currentValue = currentValue;
38124
- } else {
38125
- context._currentValue2 = currentValue;
38126
- }
38127
- }
38128
- function calculateChangedBits(context, newValue, oldValue) {
38129
- if (is$1(oldValue, newValue)) {
38130
- // No change
38131
- return 0;
38132
- } else {
38133
- var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
38134
-
38135
- {
38136
- !((changedBits & MAX_SIGNED_31_BIT_INT) === changedBits) ? warning$1(false, 'calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits) : void 0;
38137
- }
38138
-
38139
- return changedBits | 0;
38140
- }
38141
- }
38142
- function scheduleWorkOnParentPath(parent, renderExpirationTime) {
38143
- // Update the child expiration time of all the ancestors, including
38144
- // the alternates.
38145
- var node = parent;
38146
-
38147
- while (node !== null) {
38148
- var alternate = node.alternate;
38149
-
38150
- if (node.childExpirationTime < renderExpirationTime) {
38151
- node.childExpirationTime = renderExpirationTime;
38152
-
38153
- if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
38154
- alternate.childExpirationTime = renderExpirationTime;
38155
- }
38156
- } else if (alternate !== null && alternate.childExpirationTime < renderExpirationTime) {
38157
- alternate.childExpirationTime = renderExpirationTime;
38158
- } else {
38159
- // Neither alternate was updated, which means the rest of the
38160
- // ancestor path already has sufficient priority.
38161
- break;
38162
- }
38163
-
38164
- node = node.return;
38165
- }
38166
- }
38167
- function propagateContextChange(workInProgress, context, changedBits, renderExpirationTime) {
38168
- var fiber = workInProgress.child;
38169
-
38170
- if (fiber !== null) {
38171
- // Set the return pointer of the child to the work-in-progress fiber.
38172
- fiber.return = workInProgress;
38173
- }
38174
-
38175
- while (fiber !== null) {
38176
- var nextFiber = void 0; // Visit this fiber.
38177
-
38178
- var list = fiber.dependencies;
38179
-
38180
- if (list !== null) {
38181
- nextFiber = fiber.child;
38182
- var dependency = list.firstContext;
38183
-
38184
- while (dependency !== null) {
38185
- // Check if the context matches.
38186
- if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {
38187
- // Match! Schedule an update on this fiber.
38188
- if (fiber.tag === ClassComponent) {
38189
- // Schedule a force update on the work-in-progress.
38190
- var update = createUpdate(renderExpirationTime, null);
38191
- update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the
38192
- // update to the current fiber, too, which means it will persist even if
38193
- // this render is thrown away. Since it's a race condition, not sure it's
38194
- // worth fixing.
38195
-
38196
- enqueueUpdate(fiber, update);
38197
- }
38198
-
38199
- if (fiber.expirationTime < renderExpirationTime) {
38200
- fiber.expirationTime = renderExpirationTime;
38201
- }
38202
-
38203
- var alternate = fiber.alternate;
38204
-
38205
- if (alternate !== null && alternate.expirationTime < renderExpirationTime) {
38206
- alternate.expirationTime = renderExpirationTime;
38207
- }
38208
-
38209
- scheduleWorkOnParentPath(fiber.return, renderExpirationTime); // Mark the expiration time on the list, too.
38210
-
38211
- if (list.expirationTime < renderExpirationTime) {
38212
- list.expirationTime = renderExpirationTime;
38213
- } // Since we already found a match, we can stop traversing the
38214
- // dependency list.
38215
-
38216
-
38217
- break;
38218
- }
38219
-
38220
- dependency = dependency.next;
38221
- }
38222
- } else if (fiber.tag === ContextProvider) {
38223
- // Don't scan deeper if this is a matching provider
38224
- nextFiber = fiber.type === workInProgress.type ? null : fiber.child;
38225
- } else if (enableSuspenseServerRenderer && fiber.tag === DehydratedFragment) {
38226
- // If a dehydrated suspense bounudary is in this subtree, we don't know
38227
- // if it will have any context consumers in it. The best we can do is
38228
- // mark it as having updates.
38229
- var parentSuspense = fiber.return;
38230
-
38231
- if (!(parentSuspense !== null)) {
38232
- {
38233
- throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");
38234
- }
38235
- }
38236
-
38237
- if (parentSuspense.expirationTime < renderExpirationTime) {
38238
- parentSuspense.expirationTime = renderExpirationTime;
38239
- }
38240
-
38241
- var _alternate = parentSuspense.alternate;
38242
-
38243
- if (_alternate !== null && _alternate.expirationTime < renderExpirationTime) {
38244
- _alternate.expirationTime = renderExpirationTime;
38245
- } // This is intentionally passing this fiber as the parent
38246
- // because we want to schedule this fiber as having work
38247
- // on its children. We'll use the childExpirationTime on
38248
- // this fiber to indicate that a context has changed.
38249
-
38250
-
38251
- scheduleWorkOnParentPath(parentSuspense, renderExpirationTime);
38252
- nextFiber = fiber.sibling;
38253
- } else {
38254
- // Traverse down.
38255
- nextFiber = fiber.child;
38256
- }
38257
-
38258
- if (nextFiber !== null) {
38259
- // Set the return pointer of the child to the work-in-progress fiber.
38260
- nextFiber.return = fiber;
38261
- } else {
38262
- // No child. Traverse to next sibling.
38263
- nextFiber = fiber;
38264
-
38265
- while (nextFiber !== null) {
38266
- if (nextFiber === workInProgress) {
38267
- // We're back to the root of this subtree. Exit.
38268
- nextFiber = null;
38269
- break;
38270
- }
38271
-
38272
- var sibling = nextFiber.sibling;
38273
-
38274
- if (sibling !== null) {
38275
- // Set the return pointer of the sibling to the work-in-progress fiber.
38276
- sibling.return = nextFiber.return;
38277
- nextFiber = sibling;
38278
- break;
38279
- } // No more siblings. Traverse up.
38280
-
38281
-
38282
- nextFiber = nextFiber.return;
38283
- }
38284
- }
38285
-
38286
- fiber = nextFiber;
38287
- }
38288
- }
38289
- function prepareToReadContext(workInProgress, renderExpirationTime) {
38290
- currentlyRenderingFiber = workInProgress;
38291
- lastContextDependency = null;
38292
- lastContextWithAllBitsObserved = null;
38293
- var dependencies = workInProgress.dependencies;
38294
-
38295
- if (dependencies !== null) {
38296
- var firstContext = dependencies.firstContext;
38297
-
38298
- if (firstContext !== null) {
38299
- if (dependencies.expirationTime >= renderExpirationTime) {
38300
- // Context list has a pending update. Mark that this fiber performed work.
38301
- markWorkInProgressReceivedUpdate();
38302
- } // Reset the work-in-progress list
38303
-
38304
-
38305
- dependencies.firstContext = null;
38306
- }
38307
- }
38308
- }
38309
- function readContext(context, observedBits) {
38310
- {
38311
- // This warning would fire if you read context inside a Hook like useMemo.
38312
- // Unlike the class check below, it's not enforced in production for perf.
38313
- !!isDisallowedContextReadInDEV ? warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().') : void 0;
38314
- }
38315
-
38316
- if (lastContextWithAllBitsObserved === context) {// Nothing to do. We already observe everything in this context.
38317
- } else if (observedBits === false || observedBits === 0) {// Do not observe any updates.
38318
- } else {
38319
- var resolvedObservedBits; // Avoid deopting on observable arguments or heterogeneous types.
38320
-
38321
- if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {
38322
- // Observe all updates.
38323
- lastContextWithAllBitsObserved = context;
38324
- resolvedObservedBits = MAX_SIGNED_31_BIT_INT;
38325
- } else {
38326
- resolvedObservedBits = observedBits;
38327
- }
38328
-
38329
- var contextItem = {
38330
- context: context,
38331
- observedBits: resolvedObservedBits,
38332
- next: null
38333
- };
38334
-
38335
- if (lastContextDependency === null) {
38336
- if (!(currentlyRenderingFiber !== null)) {
38337
- {
38338
- throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");
38339
- }
38340
- } // This is the first dependency for this component. Create a new list.
38341
-
38342
-
38343
- lastContextDependency = contextItem;
38344
- currentlyRenderingFiber.dependencies = {
38345
- expirationTime: NoWork,
38346
- firstContext: contextItem,
38347
- responders: null
38348
- };
38349
- } else {
38350
- // Append a new context item.
38351
- lastContextDependency = lastContextDependency.next = contextItem;
38352
- }
38353
- }
38354
-
38355
- return isPrimaryRenderer ? context._currentValue : context._currentValue2;
38356
- }
38357
-
38358
- // UpdateQueue is a linked list of prioritized updates.
38359
- //
38360
- // Like fibers, update queues come in pairs: a current queue, which represents
38361
- // the visible state of the screen, and a work-in-progress queue, which can be
38362
- // mutated and processed asynchronously before it is committed — a form of
38363
- // double buffering. If a work-in-progress render is discarded before finishing,
38364
- // we create a new work-in-progress by cloning the current queue.
38365
- //
38366
- // Both queues share a persistent, singly-linked list structure. To schedule an
38367
- // update, we append it to the end of both queues. Each queue maintains a
38368
- // pointer to first update in the persistent list that hasn't been processed.
38369
- // The work-in-progress pointer always has a position equal to or greater than
38370
- // the current queue, since we always work on that one. The current queue's
38371
- // pointer is only updated during the commit phase, when we swap in the
38372
- // work-in-progress.
38373
- //
38374
- // For example:
38375
- //
38376
- // Current pointer: A - B - C - D - E - F
38377
- // Work-in-progress pointer: D - E - F
38378
- // ^
38379
- // The work-in-progress queue has
38380
- // processed more updates than current.
38381
- //
38382
- // The reason we append to both queues is because otherwise we might drop
38383
- // updates without ever processing them. For example, if we only add updates to
38384
- // the work-in-progress queue, some updates could be lost whenever a work-in
38385
- // -progress render restarts by cloning from current. Similarly, if we only add
38386
- // updates to the current queue, the updates will be lost whenever an already
38387
- // in-progress queue commits and swaps with the current queue. However, by
38388
- // adding to both queues, we guarantee that the update will be part of the next
38389
- // work-in-progress. (And because the work-in-progress queue becomes the
38390
- // current queue once it commits, there's no danger of applying the same
38391
- // update twice.)
38392
- //
38393
- // Prioritization
38394
- // --------------
38395
- //
38396
- // Updates are not sorted by priority, but by insertion; new updates are always
38397
- // appended to the end of the list.
38398
- //
38399
- // The priority is still important, though. When processing the update queue
38400
- // during the render phase, only the updates with sufficient priority are
38401
- // included in the result. If we skip an update because it has insufficient
38402
- // priority, it remains in the queue to be processed later, during a lower
38403
- // priority render. Crucially, all updates subsequent to a skipped update also
38404
- // remain in the queue *regardless of their priority*. That means high priority
38405
- // updates are sometimes processed twice, at two separate priorities. We also
38406
- // keep track of a base state, that represents the state before the first
38407
- // update in the queue is applied.
38408
- //
38409
- // For example:
38410
- //
38411
- // Given a base state of '', and the following queue of updates
38412
- //
38413
- // A1 - B2 - C1 - D2
38414
- //
38415
- // where the number indicates the priority, and the update is applied to the
38416
- // previous state by appending a letter, React will process these updates as
38417
- // two separate renders, one per distinct priority level:
38418
- //
38419
- // First render, at priority 1:
38420
- // Base state: ''
38421
- // Updates: [A1, C1]
38422
- // Result state: 'AC'
38423
- //
38424
- // Second render, at priority 2:
38425
- // Base state: 'A' <- The base state does not include C1,
38426
- // because B2 was skipped.
38427
- // Updates: [B2, C1, D2] <- C1 was rebased on top of B2
38428
- // Result state: 'ABCD'
38429
- //
38430
- // Because we process updates in insertion order, and rebase high priority
38431
- // updates when preceding updates are skipped, the final result is deterministic
38432
- // regardless of priority. Intermediate state may vary according to system
38433
- // resources, but the final state is always the same.
38434
- var UpdateState = 0;
38435
- var ReplaceState = 1;
38436
- var ForceUpdate = 2;
38437
- var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`.
38438
- // It should only be read right after calling `processUpdateQueue`, via
38439
- // `checkHasForceUpdateAfterProcessing`.
38440
-
38441
- var hasForceUpdate = false;
38442
- var didWarnUpdateInsideUpdate;
38443
- var currentlyProcessingQueue;
38444
-
38445
-
38446
- {
38447
- didWarnUpdateInsideUpdate = false;
38448
- currentlyProcessingQueue = null;
38449
-
38450
-
38451
- }
38452
-
38453
- function createUpdateQueue(baseState) {
38454
- var queue = {
38455
- baseState: baseState,
38456
- firstUpdate: null,
38457
- lastUpdate: null,
38458
- firstCapturedUpdate: null,
38459
- lastCapturedUpdate: null,
38460
- firstEffect: null,
38461
- lastEffect: null,
38462
- firstCapturedEffect: null,
38463
- lastCapturedEffect: null
38464
- };
38465
- return queue;
38466
- }
38467
-
38468
- function cloneUpdateQueue(currentQueue) {
38469
- var queue = {
38470
- baseState: currentQueue.baseState,
38471
- firstUpdate: currentQueue.firstUpdate,
38472
- lastUpdate: currentQueue.lastUpdate,
38473
- // TODO: With resuming, if we bail out and resuse the child tree, we should
38474
- // keep these effects.
38475
- firstCapturedUpdate: null,
38476
- lastCapturedUpdate: null,
38477
- firstEffect: null,
38478
- lastEffect: null,
38479
- firstCapturedEffect: null,
38480
- lastCapturedEffect: null
38481
- };
38482
- return queue;
38483
- }
38484
-
38485
- function createUpdate(expirationTime, suspenseConfig) {
38486
- var update = {
38487
- expirationTime: expirationTime,
38488
- suspenseConfig: suspenseConfig,
38489
- tag: UpdateState,
38490
- payload: null,
38491
- callback: null,
38492
- next: null,
38493
- nextEffect: null
38494
- };
38495
-
38496
- {
38497
- update.priority = getCurrentPriorityLevel();
38498
- }
38499
-
38500
- return update;
38501
- }
38502
-
38503
- function appendUpdateToQueue(queue, update) {
38504
- // Append the update to the end of the list.
38505
- if (queue.lastUpdate === null) {
38506
- // Queue is empty
38507
- queue.firstUpdate = queue.lastUpdate = update;
38508
- } else {
38509
- queue.lastUpdate.next = update;
38510
- queue.lastUpdate = update;
38511
- }
38512
- }
38513
-
38514
- function enqueueUpdate(fiber, update) {
38515
- // Update queues are created lazily.
38516
- var alternate = fiber.alternate;
38517
- var queue1;
38518
- var queue2;
38519
-
38520
- if (alternate === null) {
38521
- // There's only one fiber.
38522
- queue1 = fiber.updateQueue;
38523
- queue2 = null;
38524
-
38525
- if (queue1 === null) {
38526
- queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
38527
- }
38528
- } else {
38529
- // There are two owners.
38530
- queue1 = fiber.updateQueue;
38531
- queue2 = alternate.updateQueue;
38532
-
38533
- if (queue1 === null) {
38534
- if (queue2 === null) {
38535
- // Neither fiber has an update queue. Create new ones.
38536
- queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState);
38537
- queue2 = alternate.updateQueue = createUpdateQueue(alternate.memoizedState);
38538
- } else {
38539
- // Only one fiber has an update queue. Clone to create a new one.
38540
- queue1 = fiber.updateQueue = cloneUpdateQueue(queue2);
38541
- }
38542
- } else {
38543
- if (queue2 === null) {
38544
- // Only one fiber has an update queue. Clone to create a new one.
38545
- queue2 = alternate.updateQueue = cloneUpdateQueue(queue1);
38546
- } else {// Both owners have an update queue.
38547
- }
38548
- }
38549
- }
38550
-
38551
- if (queue2 === null || queue1 === queue2) {
38552
- // There's only a single queue.
38553
- appendUpdateToQueue(queue1, update);
38554
- } else {
38555
- // There are two queues. We need to append the update to both queues,
38556
- // while accounting for the persistent structure of the list — we don't
38557
- // want the same update to be added multiple times.
38558
- if (queue1.lastUpdate === null || queue2.lastUpdate === null) {
38559
- // One of the queues is not empty. We must add the update to both queues.
38560
- appendUpdateToQueue(queue1, update);
38561
- appendUpdateToQueue(queue2, update);
38562
- } else {
38563
- // Both queues are non-empty. The last update is the same in both lists,
38564
- // because of structural sharing. So, only append to one of the lists.
38565
- appendUpdateToQueue(queue1, update); // But we still need to update the `lastUpdate` pointer of queue2.
38566
-
38567
- queue2.lastUpdate = update;
38568
- }
38569
- }
38570
-
38571
- {
38572
- if (fiber.tag === ClassComponent && (currentlyProcessingQueue === queue1 || queue2 !== null && currentlyProcessingQueue === queue2) && !didWarnUpdateInsideUpdate) {
38573
- warningWithoutStack$1(false, 'An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.');
38574
- didWarnUpdateInsideUpdate = true;
38575
- }
38576
- }
38577
- }
38578
- function enqueueCapturedUpdate(workInProgress, update) {
38579
- // Captured updates go into a separate list, and only on the work-in-
38580
- // progress queue.
38581
- var workInProgressQueue = workInProgress.updateQueue;
38582
-
38583
- if (workInProgressQueue === null) {
38584
- workInProgressQueue = workInProgress.updateQueue = createUpdateQueue(workInProgress.memoizedState);
38585
- } else {
38586
- // TODO: I put this here rather than createWorkInProgress so that we don't
38587
- // clone the queue unnecessarily. There's probably a better way to
38588
- // structure this.
38589
- workInProgressQueue = ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue);
38590
- } // Append the update to the end of the list.
38591
-
38592
-
38593
- if (workInProgressQueue.lastCapturedUpdate === null) {
38594
- // This is the first render phase update
38595
- workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update;
38596
- } else {
38597
- workInProgressQueue.lastCapturedUpdate.next = update;
38598
- workInProgressQueue.lastCapturedUpdate = update;
38599
- }
38600
- }
38601
-
38602
- function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
38603
- var current = workInProgress.alternate;
38604
-
38605
- if (current !== null) {
38606
- // If the work-in-progress queue is equal to the current queue,
38607
- // we need to clone it first.
38608
- if (queue === current.updateQueue) {
38609
- queue = workInProgress.updateQueue = cloneUpdateQueue(queue);
38610
- }
38611
- }
38612
-
38613
- return queue;
38614
- }
38615
-
38616
- function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {
38617
- switch (update.tag) {
38618
- case ReplaceState:
38619
- {
38620
- var payload = update.payload;
38621
-
38622
- if (typeof payload === 'function') {
38623
- // Updater function
38624
- {
38625
- enterDisallowedContextReadInDEV();
38626
-
38627
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
38628
- payload.call(instance, prevState, nextProps);
38629
- }
38630
- }
38631
-
38632
- var nextState = payload.call(instance, prevState, nextProps);
38633
-
38634
- {
38635
- exitDisallowedContextReadInDEV();
38636
- }
38637
-
38638
- return nextState;
38639
- } // State object
38640
-
38641
-
38642
- return payload;
38643
- }
38644
-
38645
- case CaptureUpdate:
38646
- {
38647
- workInProgress.effectTag = workInProgress.effectTag & ~ShouldCapture | DidCapture;
38648
- }
38649
- // Intentional fallthrough
38650
-
38651
- case UpdateState:
38652
- {
38653
- var _payload = update.payload;
38654
- var partialState;
38655
-
38656
- if (typeof _payload === 'function') {
38657
- // Updater function
38658
- {
38659
- enterDisallowedContextReadInDEV();
38660
-
38661
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
38662
- _payload.call(instance, prevState, nextProps);
38663
- }
38664
- }
38665
-
38666
- partialState = _payload.call(instance, prevState, nextProps);
38667
-
38668
- {
38669
- exitDisallowedContextReadInDEV();
38670
- }
38671
- } else {
38672
- // Partial state object
38673
- partialState = _payload;
38674
- }
38675
-
38676
- if (partialState === null || partialState === undefined) {
38677
- // Null and undefined are treated as no-ops.
38678
- return prevState;
38679
- } // Merge the partial state and the previous state.
38680
-
38681
-
38682
- return _assign({}, prevState, partialState);
38683
- }
38684
-
38685
- case ForceUpdate:
38686
- {
38687
- hasForceUpdate = true;
38688
- return prevState;
38689
- }
38690
- }
38691
-
38692
- return prevState;
38693
- }
38694
-
38695
- function processUpdateQueue(workInProgress, queue, props, instance, renderExpirationTime) {
38696
- hasForceUpdate = false;
38697
- queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue);
38698
-
38699
- {
38700
- currentlyProcessingQueue = queue;
38701
- } // These values may change as we process the queue.
38702
-
38703
-
38704
- var newBaseState = queue.baseState;
38705
- var newFirstUpdate = null;
38706
- var newExpirationTime = NoWork; // Iterate through the list of updates to compute the result.
38707
-
38708
- var update = queue.firstUpdate;
38709
- var resultState = newBaseState;
38710
-
38711
- while (update !== null) {
38712
- var updateExpirationTime = update.expirationTime;
38713
-
38714
- if (updateExpirationTime < renderExpirationTime) {
38715
- // This update does not have sufficient priority. Skip it.
38716
- if (newFirstUpdate === null) {
38717
- // This is the first skipped update. It will be the first update in
38718
- // the new list.
38719
- newFirstUpdate = update; // Since this is the first update that was skipped, the current result
38720
- // is the new base state.
38721
-
38722
- newBaseState = resultState;
38723
- } // Since this update will remain in the list, update the remaining
38724
- // expiration time.
38725
-
38726
-
38727
- if (newExpirationTime < updateExpirationTime) {
38728
- newExpirationTime = updateExpirationTime;
38729
- }
38730
- } else {
38731
- // This update does have sufficient priority.
38732
- // Mark the event time of this update as relevant to this render pass.
38733
- // TODO: This should ideally use the true event time of this update rather than
38734
- // its priority which is a derived and not reverseable value.
38735
- // TODO: We should skip this update if it was already committed but currently
38736
- // we have no way of detecting the difference between a committed and suspended
38737
- // update here.
38738
- markRenderEventTimeAndConfig(updateExpirationTime, update.suspenseConfig); // Process it and compute a new result.
38739
-
38740
- resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
38741
- var callback = update.callback;
38742
-
38743
- if (callback !== null) {
38744
- workInProgress.effectTag |= Callback; // Set this to null, in case it was mutated during an aborted render.
38745
-
38746
- update.nextEffect = null;
38747
-
38748
- if (queue.lastEffect === null) {
38749
- queue.firstEffect = queue.lastEffect = update;
38750
- } else {
38751
- queue.lastEffect.nextEffect = update;
38752
- queue.lastEffect = update;
38753
- }
38754
- }
38755
- } // Continue to the next update.
38756
-
38757
-
38758
- update = update.next;
38759
- } // Separately, iterate though the list of captured updates.
38760
-
38761
-
38762
- var newFirstCapturedUpdate = null;
38763
- update = queue.firstCapturedUpdate;
38764
-
38765
- while (update !== null) {
38766
- var _updateExpirationTime = update.expirationTime;
38767
-
38768
- if (_updateExpirationTime < renderExpirationTime) {
38769
- // This update does not have sufficient priority. Skip it.
38770
- if (newFirstCapturedUpdate === null) {
38771
- // This is the first skipped captured update. It will be the first
38772
- // update in the new list.
38773
- newFirstCapturedUpdate = update; // If this is the first update that was skipped, the current result is
38774
- // the new base state.
38775
-
38776
- if (newFirstUpdate === null) {
38777
- newBaseState = resultState;
38778
- }
38779
- } // Since this update will remain in the list, update the remaining
38780
- // expiration time.
38781
-
38782
-
38783
- if (newExpirationTime < _updateExpirationTime) {
38784
- newExpirationTime = _updateExpirationTime;
38785
- }
38786
- } else {
38787
- // This update does have sufficient priority. Process it and compute
38788
- // a new result.
38789
- resultState = getStateFromUpdate(workInProgress, queue, update, resultState, props, instance);
38790
- var _callback = update.callback;
38791
-
38792
- if (_callback !== null) {
38793
- workInProgress.effectTag |= Callback; // Set this to null, in case it was mutated during an aborted render.
38794
-
38795
- update.nextEffect = null;
38796
-
38797
- if (queue.lastCapturedEffect === null) {
38798
- queue.firstCapturedEffect = queue.lastCapturedEffect = update;
38799
- } else {
38800
- queue.lastCapturedEffect.nextEffect = update;
38801
- queue.lastCapturedEffect = update;
38802
- }
38803
- }
38804
- }
38805
-
38806
- update = update.next;
38807
- }
38808
-
38809
- if (newFirstUpdate === null) {
38810
- queue.lastUpdate = null;
38811
- }
38812
-
38813
- if (newFirstCapturedUpdate === null) {
38814
- queue.lastCapturedUpdate = null;
38815
- } else {
38816
- workInProgress.effectTag |= Callback;
38817
- }
38818
-
38819
- if (newFirstUpdate === null && newFirstCapturedUpdate === null) {
38820
- // We processed every update, without skipping. That means the new base
38821
- // state is the same as the result state.
38822
- newBaseState = resultState;
38823
- }
38824
-
38825
- queue.baseState = newBaseState;
38826
- queue.firstUpdate = newFirstUpdate;
38827
- queue.firstCapturedUpdate = newFirstCapturedUpdate; // Set the remaining expiration time to be whatever is remaining in the queue.
38828
- // This should be fine because the only two other things that contribute to
38829
- // expiration time are props and context. We're already in the middle of the
38830
- // begin phase by the time we start processing the queue, so we've already
38831
- // dealt with the props. Context in components that specify
38832
- // shouldComponentUpdate is tricky; but we'll have to account for
38833
- // that regardless.
38834
-
38835
- markUnprocessedUpdateTime(newExpirationTime);
38836
- workInProgress.expirationTime = newExpirationTime;
38837
- workInProgress.memoizedState = resultState;
38838
-
38839
- {
38840
- currentlyProcessingQueue = null;
38841
- }
38842
- }
38843
-
38844
- function callCallback(callback, context) {
38845
- if (!(typeof callback === 'function')) {
38846
- {
38847
- throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback);
38848
- }
38849
- }
38850
-
38851
- callback.call(context);
38852
- }
38853
-
38854
- function resetHasForceUpdateBeforeProcessing() {
38855
- hasForceUpdate = false;
38856
- }
38857
- function checkHasForceUpdateAfterProcessing() {
38858
- return hasForceUpdate;
38859
- }
38860
- function commitUpdateQueue(finishedWork, finishedQueue, instance, renderExpirationTime) {
38861
- // If the finished render included captured updates, and there are still
38862
- // lower priority updates left over, we need to keep the captured updates
38863
- // in the queue so that they are rebased and not dropped once we process the
38864
- // queue again at the lower priority.
38865
- if (finishedQueue.firstCapturedUpdate !== null) {
38866
- // Join the captured update list to the end of the normal list.
38867
- if (finishedQueue.lastUpdate !== null) {
38868
- finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate;
38869
- finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate;
38870
- } // Clear the list of captured updates.
38871
-
38872
-
38873
- finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null;
38874
- } // Commit the effects
38875
-
38876
-
38877
- commitUpdateEffects(finishedQueue.firstEffect, instance);
38878
- finishedQueue.firstEffect = finishedQueue.lastEffect = null;
38879
- commitUpdateEffects(finishedQueue.firstCapturedEffect, instance);
38880
- finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null;
38881
- }
38882
-
38883
- function commitUpdateEffects(effect, instance) {
38884
- while (effect !== null) {
38885
- var callback = effect.callback;
38886
-
38887
- if (callback !== null) {
38888
- effect.callback = null;
38889
- callCallback(callback, instance);
38890
- }
38891
-
38892
- effect = effect.nextEffect;
38893
- }
38894
- }
38895
-
38896
- var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;
38897
- function requestCurrentSuspenseConfig() {
38898
- return ReactCurrentBatchConfig.suspense;
38899
- }
38900
-
38901
- var fakeInternalInstance = {};
38902
- var isArray$1 = Array.isArray; // React.Component uses a shared frozen object by default.
38903
- // We'll use it to determine whether we need to initialize legacy refs.
38904
-
38905
- var emptyRefsObject = new React.Component().refs;
38906
- var didWarnAboutStateAssignmentForComponent;
38907
- var didWarnAboutUninitializedState;
38908
- var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;
38909
- var didWarnAboutLegacyLifecyclesAndDerivedState;
38910
- var didWarnAboutUndefinedDerivedState;
38911
- var warnOnUndefinedDerivedState;
38912
- var warnOnInvalidCallback$1;
38913
- var didWarnAboutDirectlyAssigningPropsToState;
38914
- var didWarnAboutContextTypeAndContextTypes;
38915
- var didWarnAboutInvalidateContextType;
38916
-
38917
- {
38918
- didWarnAboutStateAssignmentForComponent = new Set();
38919
- didWarnAboutUninitializedState = new Set();
38920
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();
38921
- didWarnAboutLegacyLifecyclesAndDerivedState = new Set();
38922
- didWarnAboutDirectlyAssigningPropsToState = new Set();
38923
- didWarnAboutUndefinedDerivedState = new Set();
38924
- didWarnAboutContextTypeAndContextTypes = new Set();
38925
- didWarnAboutInvalidateContextType = new Set();
38926
- var didWarnOnInvalidCallback = new Set();
38927
-
38928
- warnOnInvalidCallback$1 = function (callback, callerName) {
38929
- if (callback === null || typeof callback === 'function') {
38930
- return;
38931
- }
38932
-
38933
- var key = callerName + "_" + callback;
38934
-
38935
- if (!didWarnOnInvalidCallback.has(key)) {
38936
- didWarnOnInvalidCallback.add(key);
38937
- warningWithoutStack$1(false, '%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);
38938
- }
38939
- };
38940
-
38941
- warnOnUndefinedDerivedState = function (type, partialState) {
38942
- if (partialState === undefined) {
38943
- var componentName = getComponentName(type) || 'Component';
38944
-
38945
- if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
38946
- didWarnAboutUndefinedDerivedState.add(componentName);
38947
- warningWithoutStack$1(false, '%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);
38948
- }
38949
- }
38950
- }; // This is so gross but it's at least non-critical and can be removed if
38951
- // it causes problems. This is meant to give a nicer error message for
38952
- // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,
38953
- // ...)) which otherwise throws a "_processChildContext is not a function"
38954
- // exception.
38955
-
38956
-
38957
- Object.defineProperty(fakeInternalInstance, '_processChildContext', {
38958
- enumerable: false,
38959
- value: function () {
38960
- {
38961
- {
38962
- throw Error("_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).");
38963
- }
38964
- }
38965
- }
38966
- });
38967
- Object.freeze(fakeInternalInstance);
38968
- }
38969
-
38970
- function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {
38971
- var prevState = workInProgress.memoizedState;
38972
-
38973
- {
38974
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
38975
- // Invoke the function an extra time to help detect side-effects.
38976
- getDerivedStateFromProps(nextProps, prevState);
38977
- }
38978
- }
38979
-
38980
- var partialState = getDerivedStateFromProps(nextProps, prevState);
38981
-
38982
- {
38983
- warnOnUndefinedDerivedState(ctor, partialState);
38984
- } // Merge the partial state and the previous state.
38985
-
38986
-
38987
- var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);
38988
- workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the
38989
- // base state.
38990
-
38991
- var updateQueue = workInProgress.updateQueue;
38992
-
38993
- if (updateQueue !== null && workInProgress.expirationTime === NoWork) {
38994
- updateQueue.baseState = memoizedState;
38995
- }
38996
- }
38997
- var classComponentUpdater = {
38998
- isMounted: isMounted,
38999
- enqueueSetState: function (inst, payload, callback) {
39000
- var fiber = get(inst);
39001
- var currentTime = requestCurrentTimeForUpdate();
39002
- var suspenseConfig = requestCurrentSuspenseConfig();
39003
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
39004
- var update = createUpdate(expirationTime, suspenseConfig);
39005
- update.payload = payload;
39006
-
39007
- if (callback !== undefined && callback !== null) {
39008
- {
39009
- warnOnInvalidCallback$1(callback, 'setState');
39010
- }
39011
-
39012
- update.callback = callback;
39013
- }
39014
-
39015
- enqueueUpdate(fiber, update);
39016
- scheduleWork(fiber, expirationTime);
39017
- },
39018
- enqueueReplaceState: function (inst, payload, callback) {
39019
- var fiber = get(inst);
39020
- var currentTime = requestCurrentTimeForUpdate();
39021
- var suspenseConfig = requestCurrentSuspenseConfig();
39022
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
39023
- var update = createUpdate(expirationTime, suspenseConfig);
39024
- update.tag = ReplaceState;
39025
- update.payload = payload;
39026
-
39027
- if (callback !== undefined && callback !== null) {
39028
- {
39029
- warnOnInvalidCallback$1(callback, 'replaceState');
39030
- }
39031
-
39032
- update.callback = callback;
39033
- }
39034
-
39035
- enqueueUpdate(fiber, update);
39036
- scheduleWork(fiber, expirationTime);
39037
- },
39038
- enqueueForceUpdate: function (inst, callback) {
39039
- var fiber = get(inst);
39040
- var currentTime = requestCurrentTimeForUpdate();
39041
- var suspenseConfig = requestCurrentSuspenseConfig();
39042
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
39043
- var update = createUpdate(expirationTime, suspenseConfig);
39044
- update.tag = ForceUpdate;
39045
-
39046
- if (callback !== undefined && callback !== null) {
39047
- {
39048
- warnOnInvalidCallback$1(callback, 'forceUpdate');
39049
- }
39050
-
39051
- update.callback = callback;
39052
- }
39053
-
39054
- enqueueUpdate(fiber, update);
39055
- scheduleWork(fiber, expirationTime);
39056
- }
39057
- };
39058
-
39059
- function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {
39060
- var instance = workInProgress.stateNode;
39061
-
39062
- if (typeof instance.shouldComponentUpdate === 'function') {
39063
- startPhaseTimer(workInProgress, 'shouldComponentUpdate');
39064
- var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);
39065
- stopPhaseTimer();
39066
-
39067
- {
39068
- !(shouldUpdate !== undefined) ? warningWithoutStack$1(false, '%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component') : void 0;
39069
- }
39070
-
39071
- return shouldUpdate;
39072
- }
39073
-
39074
- if (ctor.prototype && ctor.prototype.isPureReactComponent) {
39075
- return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);
39076
- }
39077
-
39078
- return true;
39079
- }
39080
-
39081
- function checkClassInstance(workInProgress, ctor, newProps) {
39082
- var instance = workInProgress.stateNode;
39083
-
39084
- {
39085
- var name = getComponentName(ctor) || 'Component';
39086
- var renderPresent = instance.render;
39087
-
39088
- if (!renderPresent) {
39089
- if (ctor.prototype && typeof ctor.prototype.render === 'function') {
39090
- warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);
39091
- } else {
39092
- warningWithoutStack$1(false, '%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);
39093
- }
39094
- }
39095
-
39096
- var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state;
39097
- !noGetInitialStateOnES6 ? warningWithoutStack$1(false, 'getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name) : void 0;
39098
- var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved;
39099
- !noGetDefaultPropsOnES6 ? warningWithoutStack$1(false, 'getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name) : void 0;
39100
- var noInstancePropTypes = !instance.propTypes;
39101
- !noInstancePropTypes ? warningWithoutStack$1(false, 'propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name) : void 0;
39102
- var noInstanceContextType = !instance.contextType;
39103
- !noInstanceContextType ? warningWithoutStack$1(false, 'contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name) : void 0;
39104
-
39105
- if (disableLegacyContext) {
39106
- if (ctor.childContextTypes) {
39107
- warningWithoutStack$1(false, '%s uses the legacy childContextTypes API which is no longer supported. ' + 'Use React.createContext() instead.', name);
39108
- }
39109
-
39110
- if (ctor.contextTypes) {
39111
- warningWithoutStack$1(false, '%s uses the legacy contextTypes API which is no longer supported. ' + 'Use React.createContext() with static contextType instead.', name);
39112
- }
39113
- } else {
39114
- var noInstanceContextTypes = !instance.contextTypes;
39115
- !noInstanceContextTypes ? warningWithoutStack$1(false, 'contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name) : void 0;
39116
-
39117
- if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {
39118
- didWarnAboutContextTypeAndContextTypes.add(ctor);
39119
- warningWithoutStack$1(false, '%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);
39120
- }
39121
- }
39122
-
39123
- var noComponentShouldUpdate = typeof instance.componentShouldUpdate !== 'function';
39124
- !noComponentShouldUpdate ? warningWithoutStack$1(false, '%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name) : void 0;
39125
-
39126
- if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {
39127
- warningWithoutStack$1(false, '%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');
39128
- }
39129
-
39130
- var noComponentDidUnmount = typeof instance.componentDidUnmount !== 'function';
39131
- !noComponentDidUnmount ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name) : void 0;
39132
- var noComponentDidReceiveProps = typeof instance.componentDidReceiveProps !== 'function';
39133
- !noComponentDidReceiveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name) : void 0;
39134
- var noComponentWillRecieveProps = typeof instance.componentWillRecieveProps !== 'function';
39135
- !noComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name) : void 0;
39136
- var noUnsafeComponentWillRecieveProps = typeof instance.UNSAFE_componentWillRecieveProps !== 'function';
39137
- !noUnsafeComponentWillRecieveProps ? warningWithoutStack$1(false, '%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name) : void 0;
39138
- var hasMutatedProps = instance.props !== newProps;
39139
- !(instance.props === undefined || !hasMutatedProps) ? warningWithoutStack$1(false, '%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name) : void 0;
39140
- var noInstanceDefaultProps = !instance.defaultProps;
39141
- !noInstanceDefaultProps ? warningWithoutStack$1(false, 'Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name) : void 0;
39142
-
39143
- if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {
39144
- didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);
39145
- warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));
39146
- }
39147
-
39148
- var noInstanceGetDerivedStateFromProps = typeof instance.getDerivedStateFromProps !== 'function';
39149
- !noInstanceGetDerivedStateFromProps ? warningWithoutStack$1(false, '%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
39150
- var noInstanceGetDerivedStateFromCatch = typeof instance.getDerivedStateFromError !== 'function';
39151
- !noInstanceGetDerivedStateFromCatch ? warningWithoutStack$1(false, '%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name) : void 0;
39152
- var noStaticGetSnapshotBeforeUpdate = typeof ctor.getSnapshotBeforeUpdate !== 'function';
39153
- !noStaticGetSnapshotBeforeUpdate ? warningWithoutStack$1(false, '%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name) : void 0;
39154
- var _state = instance.state;
39155
-
39156
- if (_state && (typeof _state !== 'object' || isArray$1(_state))) {
39157
- warningWithoutStack$1(false, '%s.state: must be set to an object or null', name);
39158
- }
39159
-
39160
- if (typeof instance.getChildContext === 'function') {
39161
- !(typeof ctor.childContextTypes === 'object') ? warningWithoutStack$1(false, '%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name) : void 0;
39162
- }
39163
- }
39164
- }
39165
-
39166
- function adoptClassInstance(workInProgress, instance) {
39167
- instance.updater = classComponentUpdater;
39168
- workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates
39169
-
39170
- set(instance, workInProgress);
39171
-
39172
- {
39173
- instance._reactInternalInstance = fakeInternalInstance;
39174
- }
39175
- }
39176
-
39177
- function constructClassInstance(workInProgress, ctor, props, renderExpirationTime) {
39178
- var isLegacyContextConsumer = false;
39179
- var unmaskedContext = emptyContextObject;
39180
- var context = emptyContextObject;
39181
- var contextType = ctor.contextType;
39182
-
39183
- {
39184
- if ('contextType' in ctor) {
39185
- var isValid = // Allow null for conditional declaration
39186
- contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer>
39187
-
39188
- if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {
39189
- didWarnAboutInvalidateContextType.add(ctor);
39190
- var addendum = '';
39191
-
39192
- if (contextType === undefined) {
39193
- addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';
39194
- } else if (typeof contextType !== 'object') {
39195
- addendum = ' However, it is set to a ' + typeof contextType + '.';
39196
- } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {
39197
- addendum = ' Did you accidentally pass the Context.Provider instead?';
39198
- } else if (contextType._context !== undefined) {
39199
- // <Context.Consumer>
39200
- addendum = ' Did you accidentally pass the Context.Consumer instead?';
39201
- } else {
39202
- addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';
39203
- }
39204
-
39205
- warningWithoutStack$1(false, '%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);
39206
- }
39207
- }
39208
- }
39209
-
39210
- if (typeof contextType === 'object' && contextType !== null) {
39211
- context = readContext(contextType);
39212
- } else if (!disableLegacyContext) {
39213
- unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
39214
- var contextTypes = ctor.contextTypes;
39215
- isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;
39216
- context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;
39217
- } // Instantiate twice to help detect side-effects.
39218
-
39219
-
39220
- {
39221
- if (debugRenderPhaseSideEffectsForStrictMode && workInProgress.mode & StrictMode) {
39222
- new ctor(props, context); // eslint-disable-line no-new
39223
- }
39224
- }
39225
-
39226
- var instance = new ctor(props, context);
39227
- var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;
39228
- adoptClassInstance(workInProgress, instance);
39229
-
39230
- {
39231
- if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {
39232
- var componentName = getComponentName(ctor) || 'Component';
39233
-
39234
- if (!didWarnAboutUninitializedState.has(componentName)) {
39235
- didWarnAboutUninitializedState.add(componentName);
39236
- warningWithoutStack$1(false, '`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);
39237
- }
39238
- } // If new component APIs are defined, "unsafe" lifecycles won't be called.
39239
- // Warn about these lifecycles if they are present.
39240
- // Don't warn about react-lifecycles-compat polyfilled methods though.
39241
-
39242
-
39243
- if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {
39244
- var foundWillMountName = null;
39245
- var foundWillReceivePropsName = null;
39246
- var foundWillUpdateName = null;
39247
-
39248
- if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {
39249
- foundWillMountName = 'componentWillMount';
39250
- } else if (typeof instance.UNSAFE_componentWillMount === 'function') {
39251
- foundWillMountName = 'UNSAFE_componentWillMount';
39252
- }
39253
-
39254
- if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {
39255
- foundWillReceivePropsName = 'componentWillReceiveProps';
39256
- } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
39257
- foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
39258
- }
39259
-
39260
- if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {
39261
- foundWillUpdateName = 'componentWillUpdate';
39262
- } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
39263
- foundWillUpdateName = 'UNSAFE_componentWillUpdate';
39264
- }
39265
-
39266
- if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {
39267
- var _componentName = getComponentName(ctor) || 'Component';
39268
-
39269
- var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';
39270
-
39271
- if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {
39272
- didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);
39273
- warningWithoutStack$1(false, 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://fb.me/react-unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : '');
39274
- }
39275
- }
39276
- }
39277
- } // Cache unmasked context so we can avoid recreating masked context unless necessary.
39278
- // ReactFiberContext usually updates this cache but can't for newly-created instances.
39279
-
39280
-
39281
- if (isLegacyContextConsumer) {
39282
- cacheContext(workInProgress, unmaskedContext, context);
39283
- }
39284
-
39285
- return instance;
39286
- }
39287
-
39288
- function callComponentWillMount(workInProgress, instance) {
39289
- startPhaseTimer(workInProgress, 'componentWillMount');
39290
- var oldState = instance.state;
39291
-
39292
- if (typeof instance.componentWillMount === 'function') {
39293
- instance.componentWillMount();
39294
- }
39295
-
39296
- if (typeof instance.UNSAFE_componentWillMount === 'function') {
39297
- instance.UNSAFE_componentWillMount();
39298
- }
39299
-
39300
- stopPhaseTimer();
39301
-
39302
- if (oldState !== instance.state) {
39303
- {
39304
- warningWithoutStack$1(false, '%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');
39305
- }
39306
-
39307
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
39308
- }
39309
- }
39310
-
39311
- function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {
39312
- var oldState = instance.state;
39313
- startPhaseTimer(workInProgress, 'componentWillReceiveProps');
39314
-
39315
- if (typeof instance.componentWillReceiveProps === 'function') {
39316
- instance.componentWillReceiveProps(newProps, nextContext);
39317
- }
39318
-
39319
- if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {
39320
- instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
39321
- }
39322
-
39323
- stopPhaseTimer();
39324
-
39325
- if (instance.state !== oldState) {
39326
- {
39327
- var componentName = getComponentName(workInProgress.type) || 'Component';
39328
-
39329
- if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {
39330
- didWarnAboutStateAssignmentForComponent.add(componentName);
39331
- warningWithoutStack$1(false, '%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName);
39332
- }
39333
- }
39334
-
39335
- classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
39336
- }
39337
- } // Invokes the mount life-cycles on a previously never rendered instance.
39338
-
39339
-
39340
- function mountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
39341
- {
39342
- checkClassInstance(workInProgress, ctor, newProps);
39343
- }
39344
-
39345
- var instance = workInProgress.stateNode;
39346
- instance.props = newProps;
39347
- instance.state = workInProgress.memoizedState;
39348
- instance.refs = emptyRefsObject;
39349
- var contextType = ctor.contextType;
39350
-
39351
- if (typeof contextType === 'object' && contextType !== null) {
39352
- instance.context = readContext(contextType);
39353
- } else if (disableLegacyContext) {
39354
- instance.context = emptyContextObject;
39355
- } else {
39356
- var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
39357
- instance.context = getMaskedContext(workInProgress, unmaskedContext);
39358
- }
39359
-
39360
- {
39361
- if (instance.state === newProps) {
39362
- var componentName = getComponentName(ctor) || 'Component';
39363
-
39364
- if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {
39365
- didWarnAboutDirectlyAssigningPropsToState.add(componentName);
39366
- warningWithoutStack$1(false, '%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName);
39367
- }
39368
- }
39369
-
39370
- if (workInProgress.mode & StrictMode) {
39371
- ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);
39372
- }
39373
-
39374
- if (warnAboutDeprecatedLifecycles) {
39375
- ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);
39376
- }
39377
- }
39378
-
39379
- var updateQueue = workInProgress.updateQueue;
39380
-
39381
- if (updateQueue !== null) {
39382
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
39383
- instance.state = workInProgress.memoizedState;
39384
- }
39385
-
39386
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
39387
-
39388
- if (typeof getDerivedStateFromProps === 'function') {
39389
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
39390
- instance.state = workInProgress.memoizedState;
39391
- } // In order to support react-lifecycles-compat polyfilled components,
39392
- // Unsafe lifecycles should not be invoked for components using the new APIs.
39393
-
39394
-
39395
- if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
39396
- callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's
39397
- // process them now.
39398
-
39399
- updateQueue = workInProgress.updateQueue;
39400
-
39401
- if (updateQueue !== null) {
39402
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
39403
- instance.state = workInProgress.memoizedState;
39404
- }
39405
- }
39406
-
39407
- if (typeof instance.componentDidMount === 'function') {
39408
- workInProgress.effectTag |= Update;
39409
- }
39410
- }
39411
-
39412
- function resumeMountClassInstance(workInProgress, ctor, newProps, renderExpirationTime) {
39413
- var instance = workInProgress.stateNode;
39414
- var oldProps = workInProgress.memoizedProps;
39415
- instance.props = oldProps;
39416
- var oldContext = instance.context;
39417
- var contextType = ctor.contextType;
39418
- var nextContext = emptyContextObject;
39419
-
39420
- if (typeof contextType === 'object' && contextType !== null) {
39421
- nextContext = readContext(contextType);
39422
- } else if (!disableLegacyContext) {
39423
- var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
39424
- nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);
39425
- }
39426
-
39427
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
39428
- var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
39429
- // ever the previously attempted to render - not the "current". However,
39430
- // during componentDidUpdate we pass the "current" props.
39431
- // In order to support react-lifecycles-compat polyfilled components,
39432
- // Unsafe lifecycles should not be invoked for components using the new APIs.
39433
-
39434
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
39435
- if (oldProps !== newProps || oldContext !== nextContext) {
39436
- callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
39437
- }
39438
- }
39439
-
39440
- resetHasForceUpdateBeforeProcessing();
39441
- var oldState = workInProgress.memoizedState;
39442
- var newState = instance.state = oldState;
39443
- var updateQueue = workInProgress.updateQueue;
39444
-
39445
- if (updateQueue !== null) {
39446
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
39447
- newState = workInProgress.memoizedState;
39448
- }
39449
-
39450
- if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
39451
- // If an update was already in progress, we should schedule an Update
39452
- // effect even though we're bailing out, so that cWU/cDU are called.
39453
- if (typeof instance.componentDidMount === 'function') {
39454
- workInProgress.effectTag |= Update;
39455
- }
39456
-
39457
- return false;
39458
- }
39459
-
39460
- if (typeof getDerivedStateFromProps === 'function') {
39461
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
39462
- newState = workInProgress.memoizedState;
39463
- }
39464
-
39465
- var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
39466
-
39467
- if (shouldUpdate) {
39468
- // In order to support react-lifecycles-compat polyfilled components,
39469
- // Unsafe lifecycles should not be invoked for components using the new APIs.
39470
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {
39471
- startPhaseTimer(workInProgress, 'componentWillMount');
39472
-
39473
- if (typeof instance.componentWillMount === 'function') {
39474
- instance.componentWillMount();
39475
- }
39476
-
39477
- if (typeof instance.UNSAFE_componentWillMount === 'function') {
39478
- instance.UNSAFE_componentWillMount();
39479
- }
39480
-
39481
- stopPhaseTimer();
39482
- }
39483
-
39484
- if (typeof instance.componentDidMount === 'function') {
39485
- workInProgress.effectTag |= Update;
39486
- }
39487
- } else {
39488
- // If an update was already in progress, we should schedule an Update
39489
- // effect even though we're bailing out, so that cWU/cDU are called.
39490
- if (typeof instance.componentDidMount === 'function') {
39491
- workInProgress.effectTag |= Update;
39492
- } // If shouldComponentUpdate returned false, we should still update the
39493
- // memoized state to indicate that this work can be reused.
39494
-
39495
-
39496
- workInProgress.memoizedProps = newProps;
39497
- workInProgress.memoizedState = newState;
39498
- } // Update the existing instance's state, props, and context pointers even
39499
- // if shouldComponentUpdate returns false.
39500
-
39501
-
39502
- instance.props = newProps;
39503
- instance.state = newState;
39504
- instance.context = nextContext;
39505
- return shouldUpdate;
39506
- } // Invokes the update life-cycles and returns false if it shouldn't rerender.
39507
-
39508
-
39509
- function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {
39510
- var instance = workInProgress.stateNode;
39511
- var oldProps = workInProgress.memoizedProps;
39512
- instance.props = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps);
39513
- var oldContext = instance.context;
39514
- var contextType = ctor.contextType;
39515
- var nextContext = emptyContextObject;
39516
-
39517
- if (typeof contextType === 'object' && contextType !== null) {
39518
- nextContext = readContext(contextType);
39519
- } else if (!disableLegacyContext) {
39520
- var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);
39521
- nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);
39522
- }
39523
-
39524
- var getDerivedStateFromProps = ctor.getDerivedStateFromProps;
39525
- var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what
39526
- // ever the previously attempted to render - not the "current". However,
39527
- // during componentDidUpdate we pass the "current" props.
39528
- // In order to support react-lifecycles-compat polyfilled components,
39529
- // Unsafe lifecycles should not be invoked for components using the new APIs.
39530
-
39531
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {
39532
- if (oldProps !== newProps || oldContext !== nextContext) {
39533
- callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);
39534
- }
39535
- }
39536
-
39537
- resetHasForceUpdateBeforeProcessing();
39538
- var oldState = workInProgress.memoizedState;
39539
- var newState = instance.state = oldState;
39540
- var updateQueue = workInProgress.updateQueue;
39541
-
39542
- if (updateQueue !== null) {
39543
- processUpdateQueue(workInProgress, updateQueue, newProps, instance, renderExpirationTime);
39544
- newState = workInProgress.memoizedState;
39545
- }
39546
-
39547
- if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {
39548
- // If an update was already in progress, we should schedule an Update
39549
- // effect even though we're bailing out, so that cWU/cDU are called.
39550
- if (typeof instance.componentDidUpdate === 'function') {
39551
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
39552
- workInProgress.effectTag |= Update;
39553
- }
39554
- }
39555
-
39556
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
39557
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
39558
- workInProgress.effectTag |= Snapshot;
39559
- }
39560
- }
39561
-
39562
- return false;
39563
- }
39564
-
39565
- if (typeof getDerivedStateFromProps === 'function') {
39566
- applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);
39567
- newState = workInProgress.memoizedState;
39568
- }
39569
-
39570
- var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);
39571
-
39572
- if (shouldUpdate) {
39573
- // In order to support react-lifecycles-compat polyfilled components,
39574
- // Unsafe lifecycles should not be invoked for components using the new APIs.
39575
- if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {
39576
- startPhaseTimer(workInProgress, 'componentWillUpdate');
39577
-
39578
- if (typeof instance.componentWillUpdate === 'function') {
39579
- instance.componentWillUpdate(newProps, newState, nextContext);
39580
- }
39581
-
39582
- if (typeof instance.UNSAFE_componentWillUpdate === 'function') {
39583
- instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);
39584
- }
39585
-
39586
- stopPhaseTimer();
39587
- }
39588
-
39589
- if (typeof instance.componentDidUpdate === 'function') {
39590
- workInProgress.effectTag |= Update;
39591
- }
39592
-
39593
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
39594
- workInProgress.effectTag |= Snapshot;
39595
- }
39596
- } else {
39597
- // If an update was already in progress, we should schedule an Update
39598
- // effect even though we're bailing out, so that cWU/cDU are called.
39599
- if (typeof instance.componentDidUpdate === 'function') {
39600
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
39601
- workInProgress.effectTag |= Update;
39602
- }
39603
- }
39604
-
39605
- if (typeof instance.getSnapshotBeforeUpdate === 'function') {
39606
- if (oldProps !== current.memoizedProps || oldState !== current.memoizedState) {
39607
- workInProgress.effectTag |= Snapshot;
39608
- }
39609
- } // If shouldComponentUpdate returned false, we should still update the
39610
- // memoized props/state to indicate that this work can be reused.
39611
-
39612
-
39613
- workInProgress.memoizedProps = newProps;
39614
- workInProgress.memoizedState = newState;
39615
- } // Update the existing instance's state, props, and context pointers even
39616
- // if shouldComponentUpdate returns false.
39617
-
39618
-
39619
- instance.props = newProps;
39620
- instance.state = newState;
39621
- instance.context = nextContext;
39622
- return shouldUpdate;
39623
- }
39624
-
39625
- var didWarnAboutMaps;
39626
- var didWarnAboutGenerators;
39627
- var didWarnAboutStringRefs;
39628
- var ownerHasKeyUseWarning;
39629
- var ownerHasFunctionTypeWarning;
39630
-
39631
- var warnForMissingKey = function (child) {};
39632
-
39633
- {
39634
- didWarnAboutMaps = false;
39635
- didWarnAboutGenerators = false;
39636
- didWarnAboutStringRefs = {};
39637
- /**
39638
- * Warn if there's no key explicitly set on dynamic arrays of children or
39639
- * object keys are not valid. This allows us to keep track of children between
39640
- * updates.
39641
- */
39642
-
39643
- ownerHasKeyUseWarning = {};
39644
- ownerHasFunctionTypeWarning = {};
39645
-
39646
- warnForMissingKey = function (child) {
39647
- if (child === null || typeof child !== 'object') {
39648
- return;
39649
- }
39650
-
39651
- if (!child._store || child._store.validated || child.key != null) {
39652
- return;
39653
- }
39654
-
39655
- if (!(typeof child._store === 'object')) {
39656
- {
39657
- throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
39658
- }
39659
- }
39660
-
39661
- child._store.validated = true;
39662
- var currentComponentErrorInfo = 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.' + getCurrentFiberStackInDev();
39663
-
39664
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
39665
- return;
39666
- }
39667
-
39668
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
39669
- warning$1(false, 'Each child in a list should have a unique ' + '"key" prop. See https://fb.me/react-warning-keys for ' + 'more information.');
39670
- };
39671
- }
39672
-
39673
- var isArray = Array.isArray;
39674
-
39675
- function coerceRef(returnFiber, current$$1, element) {
39676
- var mixedRef = element.ref;
39677
-
39678
- if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {
39679
- {
39680
- // TODO: Clean this up once we turn on the string ref warning for
39681
- // everyone, because the strict mode case will no longer be relevant
39682
- if (returnFiber.mode & StrictMode || warnAboutStringRefs) {
39683
- var componentName = getComponentName(returnFiber.type) || 'Component';
39684
-
39685
- if (!didWarnAboutStringRefs[componentName]) {
39686
- if (warnAboutStringRefs) {
39687
- warningWithoutStack$1(false, 'Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', componentName, mixedRef, getStackByFiberInDevAndProd(returnFiber));
39688
- } else {
39689
- warningWithoutStack$1(false, 'A string ref, "%s", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref%s', mixedRef, getStackByFiberInDevAndProd(returnFiber));
39690
- }
39691
-
39692
- didWarnAboutStringRefs[componentName] = true;
39693
- }
39694
- }
39695
- }
39696
-
39697
- if (element._owner) {
39698
- var owner = element._owner;
39699
- var inst;
39700
-
39701
- if (owner) {
39702
- var ownerFiber = owner;
39703
-
39704
- if (!(ownerFiber.tag === ClassComponent)) {
39705
- {
39706
- throw Error("Function components cannot have refs. Did you mean to use React.forwardRef()?");
39707
- }
39708
- }
39709
-
39710
- inst = ownerFiber.stateNode;
39711
- }
39712
-
39713
- if (!inst) {
39714
- {
39715
- throw Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a bug in React. Please file an issue.");
39716
- }
39717
- }
39718
-
39719
- var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref
39720
-
39721
- if (current$$1 !== null && current$$1.ref !== null && typeof current$$1.ref === 'function' && current$$1.ref._stringRef === stringRef) {
39722
- return current$$1.ref;
39723
- }
39724
-
39725
- var ref = function (value) {
39726
- var refs = inst.refs;
39727
-
39728
- if (refs === emptyRefsObject) {
39729
- // This is a lazy pooled frozen object, so we need to initialize.
39730
- refs = inst.refs = {};
39731
- }
39732
-
39733
- if (value === null) {
39734
- delete refs[stringRef];
39735
- } else {
39736
- refs[stringRef] = value;
39737
- }
39738
- };
39739
-
39740
- ref._stringRef = stringRef;
39741
- return ref;
39742
- } else {
39743
- if (!(typeof mixedRef === 'string')) {
39744
- {
39745
- throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null.");
39746
- }
39747
- }
39748
-
39749
- if (!element._owner) {
39750
- {
39751
- throw Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.");
39752
- }
39753
- }
39754
- }
39755
- }
39756
-
39757
- return mixedRef;
39758
- }
39759
-
39760
- function throwOnInvalidObjectType(returnFiber, newChild) {
39761
- if (returnFiber.type !== 'textarea') {
39762
- var addendum = '';
39763
-
39764
- {
39765
- addendum = ' If you meant to render a collection of children, use an array ' + 'instead.' + getCurrentFiberStackInDev();
39766
- }
39767
-
39768
- {
39769
- {
39770
- throw Error("Objects are not valid as a React child (found: " + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + ")." + addendum);
39771
- }
39772
- }
39773
- }
39774
- }
39775
-
39776
- function warnOnFunctionType() {
39777
- var currentComponentErrorInfo = 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.' + getCurrentFiberStackInDev();
39778
-
39779
- if (ownerHasFunctionTypeWarning[currentComponentErrorInfo]) {
39780
- return;
39781
- }
39782
-
39783
- ownerHasFunctionTypeWarning[currentComponentErrorInfo] = true;
39784
- warning$1(false, 'Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.');
39785
- } // This wrapper function exists because I expect to clone the code in each path
39786
- // to be able to optimize each path individually by branching early. This needs
39787
- // a compiler or we can do it manually. Helpers that don't need this branching
39788
- // live outside of this function.
39789
-
39790
-
39791
- function ChildReconciler(shouldTrackSideEffects) {
39792
- function deleteChild(returnFiber, childToDelete) {
39793
- if (!shouldTrackSideEffects) {
39794
- // Noop.
39795
- return;
39796
- } // Deletions are added in reversed order so we add it to the front.
39797
- // At this point, the return fiber's effect list is empty except for
39798
- // deletions, so we can just append the deletion to the list. The remaining
39799
- // effects aren't added until the complete phase. Once we implement
39800
- // resuming, this may not be true.
39801
-
39802
-
39803
- var last = returnFiber.lastEffect;
39804
-
39805
- if (last !== null) {
39806
- last.nextEffect = childToDelete;
39807
- returnFiber.lastEffect = childToDelete;
39808
- } else {
39809
- returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;
39810
- }
39811
-
39812
- childToDelete.nextEffect = null;
39813
- childToDelete.effectTag = Deletion;
39814
- }
39815
-
39816
- function deleteRemainingChildren(returnFiber, currentFirstChild) {
39817
- if (!shouldTrackSideEffects) {
39818
- // Noop.
39819
- return null;
39820
- } // TODO: For the shouldClone case, this could be micro-optimized a bit by
39821
- // assuming that after the first child we've already added everything.
39822
-
39823
-
39824
- var childToDelete = currentFirstChild;
39825
-
39826
- while (childToDelete !== null) {
39827
- deleteChild(returnFiber, childToDelete);
39828
- childToDelete = childToDelete.sibling;
39829
- }
39830
-
39831
- return null;
39832
- }
39833
-
39834
- function mapRemainingChildren(returnFiber, currentFirstChild) {
39835
- // Add the remaining children to a temporary map so that we can find them by
39836
- // keys quickly. Implicit (null) keys get added to this set with their index
39837
- // instead.
39838
- var existingChildren = new Map();
39839
- var existingChild = currentFirstChild;
39840
-
39841
- while (existingChild !== null) {
39842
- if (existingChild.key !== null) {
39843
- existingChildren.set(existingChild.key, existingChild);
39844
- } else {
39845
- existingChildren.set(existingChild.index, existingChild);
39846
- }
39847
-
39848
- existingChild = existingChild.sibling;
39849
- }
39850
-
39851
- return existingChildren;
39852
- }
39853
-
39854
- function useFiber(fiber, pendingProps, expirationTime) {
39855
- // We currently set sibling to null and index to 0 here because it is easy
39856
- // to forget to do before returning it. E.g. for the single child case.
39857
- var clone = createWorkInProgress(fiber, pendingProps, expirationTime);
39858
- clone.index = 0;
39859
- clone.sibling = null;
39860
- return clone;
39861
- }
39862
-
39863
- function placeChild(newFiber, lastPlacedIndex, newIndex) {
39864
- newFiber.index = newIndex;
39865
-
39866
- if (!shouldTrackSideEffects) {
39867
- // Noop.
39868
- return lastPlacedIndex;
39869
- }
39870
-
39871
- var current$$1 = newFiber.alternate;
39872
-
39873
- if (current$$1 !== null) {
39874
- var oldIndex = current$$1.index;
39875
-
39876
- if (oldIndex < lastPlacedIndex) {
39877
- // This is a move.
39878
- newFiber.effectTag = Placement;
39879
- return lastPlacedIndex;
39880
- } else {
39881
- // This item can stay in place.
39882
- return oldIndex;
39883
- }
39884
- } else {
39885
- // This is an insertion.
39886
- newFiber.effectTag = Placement;
39887
- return lastPlacedIndex;
39888
- }
39889
- }
39890
-
39891
- function placeSingleChild(newFiber) {
39892
- // This is simpler for the single child case. We only need to do a
39893
- // placement for inserting new children.
39894
- if (shouldTrackSideEffects && newFiber.alternate === null) {
39895
- newFiber.effectTag = Placement;
39896
- }
39897
-
39898
- return newFiber;
39899
- }
39900
-
39901
- function updateTextNode(returnFiber, current$$1, textContent, expirationTime) {
39902
- if (current$$1 === null || current$$1.tag !== HostText) {
39903
- // Insert
39904
- var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
39905
- created.return = returnFiber;
39906
- return created;
39907
- } else {
39908
- // Update
39909
- var existing = useFiber(current$$1, textContent, expirationTime);
39910
- existing.return = returnFiber;
39911
- return existing;
39912
- }
39913
- }
39914
-
39915
- function updateElement(returnFiber, current$$1, element, expirationTime) {
39916
- if (current$$1 !== null && (current$$1.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
39917
- isCompatibleFamilyForHotReloading(current$$1, element)))) {
39918
- // Move based on index
39919
- var existing = useFiber(current$$1, element.props, expirationTime);
39920
- existing.ref = coerceRef(returnFiber, current$$1, element);
39921
- existing.return = returnFiber;
39922
-
39923
- {
39924
- existing._debugSource = element._source;
39925
- existing._debugOwner = element._owner;
39926
- }
39927
-
39928
- return existing;
39929
- } else {
39930
- // Insert
39931
- var created = createFiberFromElement(element, returnFiber.mode, expirationTime);
39932
- created.ref = coerceRef(returnFiber, current$$1, element);
39933
- created.return = returnFiber;
39934
- return created;
39935
- }
39936
- }
39937
-
39938
- function updatePortal(returnFiber, current$$1, portal, expirationTime) {
39939
- if (current$$1 === null || current$$1.tag !== HostPortal || current$$1.stateNode.containerInfo !== portal.containerInfo || current$$1.stateNode.implementation !== portal.implementation) {
39940
- // Insert
39941
- var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
39942
- created.return = returnFiber;
39943
- return created;
39944
- } else {
39945
- // Update
39946
- var existing = useFiber(current$$1, portal.children || [], expirationTime);
39947
- existing.return = returnFiber;
39948
- return existing;
39949
- }
39950
- }
39951
-
39952
- function updateFragment(returnFiber, current$$1, fragment, expirationTime, key) {
39953
- if (current$$1 === null || current$$1.tag !== Fragment) {
39954
- // Insert
39955
- var created = createFiberFromFragment(fragment, returnFiber.mode, expirationTime, key);
39956
- created.return = returnFiber;
39957
- return created;
39958
- } else {
39959
- // Update
39960
- var existing = useFiber(current$$1, fragment, expirationTime);
39961
- existing.return = returnFiber;
39962
- return existing;
39963
- }
39964
- }
39965
-
39966
- function createChild(returnFiber, newChild, expirationTime) {
39967
- if (typeof newChild === 'string' || typeof newChild === 'number') {
39968
- // Text nodes don't have keys. If the previous node is implicitly keyed
39969
- // we can continue to replace it without aborting even if it is not a text
39970
- // node.
39971
- var created = createFiberFromText('' + newChild, returnFiber.mode, expirationTime);
39972
- created.return = returnFiber;
39973
- return created;
39974
- }
39975
-
39976
- if (typeof newChild === 'object' && newChild !== null) {
39977
- switch (newChild.$$typeof) {
39978
- case REACT_ELEMENT_TYPE:
39979
- {
39980
- var _created = createFiberFromElement(newChild, returnFiber.mode, expirationTime);
39981
-
39982
- _created.ref = coerceRef(returnFiber, null, newChild);
39983
- _created.return = returnFiber;
39984
- return _created;
39985
- }
39986
-
39987
- case REACT_PORTAL_TYPE:
39988
- {
39989
- var _created2 = createFiberFromPortal(newChild, returnFiber.mode, expirationTime);
39990
-
39991
- _created2.return = returnFiber;
39992
- return _created2;
39993
- }
39994
- }
39995
-
39996
- if (isArray(newChild) || getIteratorFn(newChild)) {
39997
- var _created3 = createFiberFromFragment(newChild, returnFiber.mode, expirationTime, null);
39998
-
39999
- _created3.return = returnFiber;
40000
- return _created3;
40001
- }
40002
-
40003
- throwOnInvalidObjectType(returnFiber, newChild);
40004
- }
40005
-
40006
- {
40007
- if (typeof newChild === 'function') {
40008
- warnOnFunctionType();
40009
- }
40010
- }
40011
-
40012
- return null;
40013
- }
40014
-
40015
- function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
40016
- // Update the fiber if the keys match, otherwise return null.
40017
- var key = oldFiber !== null ? oldFiber.key : null;
40018
-
40019
- if (typeof newChild === 'string' || typeof newChild === 'number') {
40020
- // Text nodes don't have keys. If the previous node is implicitly keyed
40021
- // we can continue to replace it without aborting even if it is not a text
40022
- // node.
40023
- if (key !== null) {
40024
- return null;
40025
- }
40026
-
40027
- return updateTextNode(returnFiber, oldFiber, '' + newChild, expirationTime);
40028
- }
40029
-
40030
- if (typeof newChild === 'object' && newChild !== null) {
40031
- switch (newChild.$$typeof) {
40032
- case REACT_ELEMENT_TYPE:
40033
- {
40034
- if (newChild.key === key) {
40035
- if (newChild.type === REACT_FRAGMENT_TYPE) {
40036
- return updateFragment(returnFiber, oldFiber, newChild.props.children, expirationTime, key);
40037
- }
40038
-
40039
- return updateElement(returnFiber, oldFiber, newChild, expirationTime);
40040
- } else {
40041
- return null;
40042
- }
40043
- }
40044
-
40045
- case REACT_PORTAL_TYPE:
40046
- {
40047
- if (newChild.key === key) {
40048
- return updatePortal(returnFiber, oldFiber, newChild, expirationTime);
40049
- } else {
40050
- return null;
40051
- }
40052
- }
40053
- }
40054
-
40055
- if (isArray(newChild) || getIteratorFn(newChild)) {
40056
- if (key !== null) {
40057
- return null;
40058
- }
40059
-
40060
- return updateFragment(returnFiber, oldFiber, newChild, expirationTime, null);
40061
- }
40062
-
40063
- throwOnInvalidObjectType(returnFiber, newChild);
40064
- }
40065
-
40066
- {
40067
- if (typeof newChild === 'function') {
40068
- warnOnFunctionType();
40069
- }
40070
- }
40071
-
40072
- return null;
40073
- }
40074
-
40075
- function updateFromMap(existingChildren, returnFiber, newIdx, newChild, expirationTime) {
40076
- if (typeof newChild === 'string' || typeof newChild === 'number') {
40077
- // Text nodes don't have keys, so we neither have to check the old nor
40078
- // new node for the key. If both are text nodes, they match.
40079
- var matchedFiber = existingChildren.get(newIdx) || null;
40080
- return updateTextNode(returnFiber, matchedFiber, '' + newChild, expirationTime);
40081
- }
40082
-
40083
- if (typeof newChild === 'object' && newChild !== null) {
40084
- switch (newChild.$$typeof) {
40085
- case REACT_ELEMENT_TYPE:
40086
- {
40087
- var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
40088
-
40089
- if (newChild.type === REACT_FRAGMENT_TYPE) {
40090
- return updateFragment(returnFiber, _matchedFiber, newChild.props.children, expirationTime, newChild.key);
40091
- }
40092
-
40093
- return updateElement(returnFiber, _matchedFiber, newChild, expirationTime);
40094
- }
40095
-
40096
- case REACT_PORTAL_TYPE:
40097
- {
40098
- var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;
40099
-
40100
- return updatePortal(returnFiber, _matchedFiber2, newChild, expirationTime);
40101
- }
40102
- }
40103
-
40104
- if (isArray(newChild) || getIteratorFn(newChild)) {
40105
- var _matchedFiber3 = existingChildren.get(newIdx) || null;
40106
-
40107
- return updateFragment(returnFiber, _matchedFiber3, newChild, expirationTime, null);
40108
- }
40109
-
40110
- throwOnInvalidObjectType(returnFiber, newChild);
40111
- }
40112
-
40113
- {
40114
- if (typeof newChild === 'function') {
40115
- warnOnFunctionType();
40116
- }
40117
- }
40118
-
40119
- return null;
40120
- }
40121
- /**
40122
- * Warns if there is a duplicate or missing key
40123
- */
40124
-
40125
-
40126
- function warnOnInvalidKey(child, knownKeys) {
40127
- {
40128
- if (typeof child !== 'object' || child === null) {
40129
- return knownKeys;
40130
- }
40131
-
40132
- switch (child.$$typeof) {
40133
- case REACT_ELEMENT_TYPE:
40134
- case REACT_PORTAL_TYPE:
40135
- warnForMissingKey(child);
40136
- var key = child.key;
40137
-
40138
- if (typeof key !== 'string') {
40139
- break;
40140
- }
40141
-
40142
- if (knownKeys === null) {
40143
- knownKeys = new Set();
40144
- knownKeys.add(key);
40145
- break;
40146
- }
40147
-
40148
- if (!knownKeys.has(key)) {
40149
- knownKeys.add(key);
40150
- break;
40151
- }
40152
-
40153
- warning$1(false, 'Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key);
40154
- break;
40155
-
40156
- default:
40157
- break;
40158
- }
40159
- }
40160
-
40161
- return knownKeys;
40162
- }
40163
-
40164
- function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, expirationTime) {
40165
- // This algorithm can't optimize by searching from both ends since we
40166
- // don't have backpointers on fibers. I'm trying to see how far we can get
40167
- // with that model. If it ends up not being worth the tradeoffs, we can
40168
- // add it later.
40169
- // Even with a two ended optimization, we'd want to optimize for the case
40170
- // where there are few changes and brute force the comparison instead of
40171
- // going for the Map. It'd like to explore hitting that path first in
40172
- // forward-only mode and only go for the Map once we notice that we need
40173
- // lots of look ahead. This doesn't handle reversal as well as two ended
40174
- // search but that's unusual. Besides, for the two ended optimization to
40175
- // work on Iterables, we'd need to copy the whole set.
40176
- // In this first iteration, we'll just live with hitting the bad case
40177
- // (adding everything to a Map) in for every insert/move.
40178
- // If you change this code, also update reconcileChildrenIterator() which
40179
- // uses the same algorithm.
40180
- {
40181
- // First, validate keys.
40182
- var knownKeys = null;
40183
-
40184
- for (var i = 0; i < newChildren.length; i++) {
40185
- var child = newChildren[i];
40186
- knownKeys = warnOnInvalidKey(child, knownKeys);
40187
- }
40188
- }
40189
-
40190
- var resultingFirstChild = null;
40191
- var previousNewFiber = null;
40192
- var oldFiber = currentFirstChild;
40193
- var lastPlacedIndex = 0;
40194
- var newIdx = 0;
40195
- var nextOldFiber = null;
40196
-
40197
- for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) {
40198
- if (oldFiber.index > newIdx) {
40199
- nextOldFiber = oldFiber;
40200
- oldFiber = null;
40201
- } else {
40202
- nextOldFiber = oldFiber.sibling;
40203
- }
40204
-
40205
- var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], expirationTime);
40206
-
40207
- if (newFiber === null) {
40208
- // TODO: This breaks on empty slots like null children. That's
40209
- // unfortunate because it triggers the slow path all the time. We need
40210
- // a better way to communicate whether this was a miss or null,
40211
- // boolean, undefined, etc.
40212
- if (oldFiber === null) {
40213
- oldFiber = nextOldFiber;
40214
- }
40215
-
40216
- break;
40217
- }
40218
-
40219
- if (shouldTrackSideEffects) {
40220
- if (oldFiber && newFiber.alternate === null) {
40221
- // We matched the slot, but we didn't reuse the existing fiber, so we
40222
- // need to delete the existing child.
40223
- deleteChild(returnFiber, oldFiber);
40224
- }
40225
- }
40226
-
40227
- lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
40228
-
40229
- if (previousNewFiber === null) {
40230
- // TODO: Move out of the loop. This only happens for the first run.
40231
- resultingFirstChild = newFiber;
40232
- } else {
40233
- // TODO: Defer siblings if we're not at the right index for this slot.
40234
- // I.e. if we had null values before, then we want to defer this
40235
- // for each null value. However, we also don't want to call updateSlot
40236
- // with the previous one.
40237
- previousNewFiber.sibling = newFiber;
40238
- }
40239
-
40240
- previousNewFiber = newFiber;
40241
- oldFiber = nextOldFiber;
40242
- }
40243
-
40244
- if (newIdx === newChildren.length) {
40245
- // We've reached the end of the new children. We can delete the rest.
40246
- deleteRemainingChildren(returnFiber, oldFiber);
40247
- return resultingFirstChild;
40248
- }
40249
-
40250
- if (oldFiber === null) {
40251
- // If we don't have any more existing children we can choose a fast path
40252
- // since the rest will all be insertions.
40253
- for (; newIdx < newChildren.length; newIdx++) {
40254
- var _newFiber = createChild(returnFiber, newChildren[newIdx], expirationTime);
40255
-
40256
- if (_newFiber === null) {
40257
- continue;
40258
- }
40259
-
40260
- lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);
40261
-
40262
- if (previousNewFiber === null) {
40263
- // TODO: Move out of the loop. This only happens for the first run.
40264
- resultingFirstChild = _newFiber;
40265
- } else {
40266
- previousNewFiber.sibling = _newFiber;
40267
- }
40268
-
40269
- previousNewFiber = _newFiber;
40270
- }
40271
-
40272
- return resultingFirstChild;
40273
- } // Add all children to a key map for quick lookups.
40274
-
40275
-
40276
- var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
40277
-
40278
- for (; newIdx < newChildren.length; newIdx++) {
40279
- var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], expirationTime);
40280
-
40281
- if (_newFiber2 !== null) {
40282
- if (shouldTrackSideEffects) {
40283
- if (_newFiber2.alternate !== null) {
40284
- // The new fiber is a work in progress, but if there exists a
40285
- // current, that means that we reused the fiber. We need to delete
40286
- // it from the child list so that we don't add it to the deletion
40287
- // list.
40288
- existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);
40289
- }
40290
- }
40291
-
40292
- lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);
40293
-
40294
- if (previousNewFiber === null) {
40295
- resultingFirstChild = _newFiber2;
40296
- } else {
40297
- previousNewFiber.sibling = _newFiber2;
40298
- }
40299
-
40300
- previousNewFiber = _newFiber2;
40301
- }
40302
- }
40303
-
40304
- if (shouldTrackSideEffects) {
40305
- // Any existing children that weren't consumed above were deleted. We need
40306
- // to add them to the deletion list.
40307
- existingChildren.forEach(function (child) {
40308
- return deleteChild(returnFiber, child);
40309
- });
40310
- }
40311
-
40312
- return resultingFirstChild;
40313
- }
40314
-
40315
- function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, expirationTime) {
40316
- // This is the same implementation as reconcileChildrenArray(),
40317
- // but using the iterator instead.
40318
- var iteratorFn = getIteratorFn(newChildrenIterable);
40319
-
40320
- if (!(typeof iteratorFn === 'function')) {
40321
- {
40322
- throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");
40323
- }
40324
- }
40325
-
40326
- {
40327
- // We don't support rendering Generators because it's a mutation.
40328
- // See https://github.com/facebook/react/issues/12995
40329
- if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag
40330
- newChildrenIterable[Symbol.toStringTag] === 'Generator') {
40331
- !didWarnAboutGenerators ? warning$1(false, 'Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.') : void 0;
40332
- didWarnAboutGenerators = true;
40333
- } // Warn about using Maps as children
40334
-
40335
-
40336
- if (newChildrenIterable.entries === iteratorFn) {
40337
- !didWarnAboutMaps ? warning$1(false, 'Using Maps as children is unsupported and will likely yield ' + 'unexpected results. Convert it to a sequence/iterable of keyed ' + 'ReactElements instead.') : void 0;
40338
- didWarnAboutMaps = true;
40339
- } // First, validate keys.
40340
- // We'll get a different iterator later for the main pass.
40341
-
40342
-
40343
- var _newChildren = iteratorFn.call(newChildrenIterable);
40344
-
40345
- if (_newChildren) {
40346
- var knownKeys = null;
40347
-
40348
- var _step = _newChildren.next();
40349
-
40350
- for (; !_step.done; _step = _newChildren.next()) {
40351
- var child = _step.value;
40352
- knownKeys = warnOnInvalidKey(child, knownKeys);
40353
- }
40354
- }
40355
- }
40356
-
40357
- var newChildren = iteratorFn.call(newChildrenIterable);
40358
-
40359
- if (!(newChildren != null)) {
40360
- {
40361
- throw Error("An iterable object provided no iterator.");
40362
- }
40363
- }
40364
-
40365
- var resultingFirstChild = null;
40366
- var previousNewFiber = null;
40367
- var oldFiber = currentFirstChild;
40368
- var lastPlacedIndex = 0;
40369
- var newIdx = 0;
40370
- var nextOldFiber = null;
40371
- var step = newChildren.next();
40372
-
40373
- for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {
40374
- if (oldFiber.index > newIdx) {
40375
- nextOldFiber = oldFiber;
40376
- oldFiber = null;
40377
- } else {
40378
- nextOldFiber = oldFiber.sibling;
40379
- }
40380
-
40381
- var newFiber = updateSlot(returnFiber, oldFiber, step.value, expirationTime);
40382
-
40383
- if (newFiber === null) {
40384
- // TODO: This breaks on empty slots like null children. That's
40385
- // unfortunate because it triggers the slow path all the time. We need
40386
- // a better way to communicate whether this was a miss or null,
40387
- // boolean, undefined, etc.
40388
- if (oldFiber === null) {
40389
- oldFiber = nextOldFiber;
40390
- }
40391
-
40392
- break;
40393
- }
40394
-
40395
- if (shouldTrackSideEffects) {
40396
- if (oldFiber && newFiber.alternate === null) {
40397
- // We matched the slot, but we didn't reuse the existing fiber, so we
40398
- // need to delete the existing child.
40399
- deleteChild(returnFiber, oldFiber);
40400
- }
40401
- }
40402
-
40403
- lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);
40404
-
40405
- if (previousNewFiber === null) {
40406
- // TODO: Move out of the loop. This only happens for the first run.
40407
- resultingFirstChild = newFiber;
40408
- } else {
40409
- // TODO: Defer siblings if we're not at the right index for this slot.
40410
- // I.e. if we had null values before, then we want to defer this
40411
- // for each null value. However, we also don't want to call updateSlot
40412
- // with the previous one.
40413
- previousNewFiber.sibling = newFiber;
40414
- }
40415
-
40416
- previousNewFiber = newFiber;
40417
- oldFiber = nextOldFiber;
40418
- }
40419
-
40420
- if (step.done) {
40421
- // We've reached the end of the new children. We can delete the rest.
40422
- deleteRemainingChildren(returnFiber, oldFiber);
40423
- return resultingFirstChild;
40424
- }
40425
-
40426
- if (oldFiber === null) {
40427
- // If we don't have any more existing children we can choose a fast path
40428
- // since the rest will all be insertions.
40429
- for (; !step.done; newIdx++, step = newChildren.next()) {
40430
- var _newFiber3 = createChild(returnFiber, step.value, expirationTime);
40431
-
40432
- if (_newFiber3 === null) {
40433
- continue;
40434
- }
40435
-
40436
- lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);
40437
-
40438
- if (previousNewFiber === null) {
40439
- // TODO: Move out of the loop. This only happens for the first run.
40440
- resultingFirstChild = _newFiber3;
40441
- } else {
40442
- previousNewFiber.sibling = _newFiber3;
40443
- }
40444
-
40445
- previousNewFiber = _newFiber3;
40446
- }
40447
-
40448
- return resultingFirstChild;
40449
- } // Add all children to a key map for quick lookups.
40450
-
40451
-
40452
- var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves.
40453
-
40454
- for (; !step.done; newIdx++, step = newChildren.next()) {
40455
- var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, expirationTime);
40456
-
40457
- if (_newFiber4 !== null) {
40458
- if (shouldTrackSideEffects) {
40459
- if (_newFiber4.alternate !== null) {
40460
- // The new fiber is a work in progress, but if there exists a
40461
- // current, that means that we reused the fiber. We need to delete
40462
- // it from the child list so that we don't add it to the deletion
40463
- // list.
40464
- existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);
40465
- }
40466
- }
40467
-
40468
- lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);
40469
-
40470
- if (previousNewFiber === null) {
40471
- resultingFirstChild = _newFiber4;
40472
- } else {
40473
- previousNewFiber.sibling = _newFiber4;
40474
- }
40475
-
40476
- previousNewFiber = _newFiber4;
40477
- }
40478
- }
40479
-
40480
- if (shouldTrackSideEffects) {
40481
- // Any existing children that weren't consumed above were deleted. We need
40482
- // to add them to the deletion list.
40483
- existingChildren.forEach(function (child) {
40484
- return deleteChild(returnFiber, child);
40485
- });
40486
- }
40487
-
40488
- return resultingFirstChild;
40489
- }
40490
-
40491
- function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, expirationTime) {
40492
- // There's no need to check for keys on text nodes since we don't have a
40493
- // way to define them.
40494
- if (currentFirstChild !== null && currentFirstChild.tag === HostText) {
40495
- // We already have an existing node so let's just update it and delete
40496
- // the rest.
40497
- deleteRemainingChildren(returnFiber, currentFirstChild.sibling);
40498
- var existing = useFiber(currentFirstChild, textContent, expirationTime);
40499
- existing.return = returnFiber;
40500
- return existing;
40501
- } // The existing first child is not a text node so we need to create one
40502
- // and delete the existing ones.
40503
-
40504
-
40505
- deleteRemainingChildren(returnFiber, currentFirstChild);
40506
- var created = createFiberFromText(textContent, returnFiber.mode, expirationTime);
40507
- created.return = returnFiber;
40508
- return created;
40509
- }
40510
-
40511
- function reconcileSingleElement(returnFiber, currentFirstChild, element, expirationTime) {
40512
- var key = element.key;
40513
- var child = currentFirstChild;
40514
-
40515
- while (child !== null) {
40516
- // TODO: If key === null and child.key === null, then this only applies to
40517
- // the first item in the list.
40518
- if (child.key === key) {
40519
- if (child.tag === Fragment ? element.type === REACT_FRAGMENT_TYPE : child.elementType === element.type || ( // Keep this check inline so it only runs on the false path:
40520
- isCompatibleFamilyForHotReloading(child, element))) {
40521
- deleteRemainingChildren(returnFiber, child.sibling);
40522
- var existing = useFiber(child, element.type === REACT_FRAGMENT_TYPE ? element.props.children : element.props, expirationTime);
40523
- existing.ref = coerceRef(returnFiber, child, element);
40524
- existing.return = returnFiber;
40525
-
40526
- {
40527
- existing._debugSource = element._source;
40528
- existing._debugOwner = element._owner;
40529
- }
40530
-
40531
- return existing;
40532
- } else {
40533
- deleteRemainingChildren(returnFiber, child);
40534
- break;
40535
- }
40536
- } else {
40537
- deleteChild(returnFiber, child);
40538
- }
40539
-
40540
- child = child.sibling;
40541
- }
40542
-
40543
- if (element.type === REACT_FRAGMENT_TYPE) {
40544
- var created = createFiberFromFragment(element.props.children, returnFiber.mode, expirationTime, element.key);
40545
- created.return = returnFiber;
40546
- return created;
40547
- } else {
40548
- var _created4 = createFiberFromElement(element, returnFiber.mode, expirationTime);
40549
-
40550
- _created4.ref = coerceRef(returnFiber, currentFirstChild, element);
40551
- _created4.return = returnFiber;
40552
- return _created4;
40553
- }
40554
- }
40555
-
40556
- function reconcileSinglePortal(returnFiber, currentFirstChild, portal, expirationTime) {
40557
- var key = portal.key;
40558
- var child = currentFirstChild;
40559
-
40560
- while (child !== null) {
40561
- // TODO: If key === null and child.key === null, then this only applies to
40562
- // the first item in the list.
40563
- if (child.key === key) {
40564
- if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
40565
- deleteRemainingChildren(returnFiber, child.sibling);
40566
- var existing = useFiber(child, portal.children || [], expirationTime);
40567
- existing.return = returnFiber;
40568
- return existing;
40569
- } else {
40570
- deleteRemainingChildren(returnFiber, child);
40571
- break;
40572
- }
40573
- } else {
40574
- deleteChild(returnFiber, child);
40575
- }
40576
-
40577
- child = child.sibling;
40578
- }
40579
-
40580
- var created = createFiberFromPortal(portal, returnFiber.mode, expirationTime);
40581
- created.return = returnFiber;
40582
- return created;
40583
- } // This API will tag the children with the side-effect of the reconciliation
40584
- // itself. They will be added to the side-effect list as we pass through the
40585
- // children and the parent.
40586
-
40587
-
40588
- function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {
40589
- // This function is not recursive.
40590
- // If the top level item is an array, we treat it as a set of children,
40591
- // not as a fragment. Nested arrays on the other hand will be treated as
40592
- // fragment nodes. Recursion happens at the normal flow.
40593
- // Handle top level unkeyed fragments as if they were arrays.
40594
- // This leads to an ambiguity between <>{[...]}</> and <>...</>.
40595
- // We treat the ambiguous cases above the same.
40596
- var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;
40597
-
40598
- if (isUnkeyedTopLevelFragment) {
40599
- newChild = newChild.props.children;
40600
- } // Handle object types
40601
-
40602
-
40603
- var isObject = typeof newChild === 'object' && newChild !== null;
40604
-
40605
- if (isObject) {
40606
- switch (newChild.$$typeof) {
40607
- case REACT_ELEMENT_TYPE:
40608
- return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));
40609
-
40610
- case REACT_PORTAL_TYPE:
40611
- return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));
40612
- }
40613
- }
40614
-
40615
- if (typeof newChild === 'string' || typeof newChild === 'number') {
40616
- return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));
40617
- }
40618
-
40619
- if (isArray(newChild)) {
40620
- return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);
40621
- }
40622
-
40623
- if (getIteratorFn(newChild)) {
40624
- return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);
40625
- }
40626
-
40627
- if (isObject) {
40628
- throwOnInvalidObjectType(returnFiber, newChild);
40629
- }
40630
-
40631
- {
40632
- if (typeof newChild === 'function') {
40633
- warnOnFunctionType();
40634
- }
40635
- }
40636
-
40637
- if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {
40638
- // If the new child is undefined, and the return fiber is a composite
40639
- // component, throw an error. If Fiber return types are disabled,
40640
- // we already threw above.
40641
- switch (returnFiber.tag) {
40642
- case ClassComponent:
40643
- {
40644
- {
40645
- var instance = returnFiber.stateNode;
40646
-
40647
- if (instance.render._isMockFunction) {
40648
- // We allow auto-mocks to proceed as if they're returning null.
40649
- break;
40650
- }
40651
- }
40652
- }
40653
- // Intentionally fall through to the next case, which handles both
40654
- // functions and classes
40655
- // eslint-disable-next-lined no-fallthrough
40656
-
40657
- case FunctionComponent:
40658
- {
40659
- var Component = returnFiber.type;
40660
-
40661
- {
40662
- {
40663
- throw Error((Component.displayName || Component.name || 'Component') + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.");
40664
- }
40665
- }
40666
- }
40667
- }
40668
- } // Remaining cases are all treated as empty.
40669
-
40670
-
40671
- return deleteRemainingChildren(returnFiber, currentFirstChild);
40672
- }
40673
-
40674
- return reconcileChildFibers;
40675
- }
40676
-
40677
- var reconcileChildFibers = ChildReconciler(true);
40678
- var mountChildFibers = ChildReconciler(false);
40679
- function cloneChildFibers(current$$1, workInProgress) {
40680
- if (!(current$$1 === null || workInProgress.child === current$$1.child)) {
40681
- {
40682
- throw Error("Resuming work not yet implemented.");
40683
- }
40684
- }
40685
-
40686
- if (workInProgress.child === null) {
40687
- return;
40688
- }
40689
-
40690
- var currentChild = workInProgress.child;
40691
- var newChild = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
40692
- workInProgress.child = newChild;
40693
- newChild.return = workInProgress;
40694
-
40695
- while (currentChild.sibling !== null) {
40696
- currentChild = currentChild.sibling;
40697
- newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps, currentChild.expirationTime);
40698
- newChild.return = workInProgress;
40699
- }
40700
-
40701
- newChild.sibling = null;
40702
- } // Reset a workInProgress child set to prepare it for a second pass.
40703
-
40704
- function resetChildFibers(workInProgress, renderExpirationTime) {
40705
- var child = workInProgress.child;
40706
-
40707
- while (child !== null) {
40708
- resetWorkInProgress(child, renderExpirationTime);
40709
- child = child.sibling;
40710
- }
40711
- }
40712
-
40713
- var NO_CONTEXT = {};
40714
- var contextStackCursor$1 = createCursor(NO_CONTEXT);
40715
- var contextFiberStackCursor = createCursor(NO_CONTEXT);
40716
- var rootInstanceStackCursor = createCursor(NO_CONTEXT);
40717
-
40718
- function requiredContext(c) {
40719
- if (!(c !== NO_CONTEXT)) {
40720
- {
40721
- throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.");
40722
- }
40723
- }
40724
-
40725
- return c;
40726
- }
40727
-
40728
- function getRootHostContainer() {
40729
- var rootInstance = requiredContext(rootInstanceStackCursor.current);
40730
- return rootInstance;
40731
- }
40732
-
40733
- function pushHostContainer(fiber, nextRootInstance) {
40734
- // Push current root instance onto the stack;
40735
- // This allows us to reset root when portals are popped.
40736
- push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it.
40737
- // This enables us to pop only Fibers that provide unique contexts.
40738
-
40739
- push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack.
40740
- // However, we can't just call getRootHostContext() and push it because
40741
- // we'd have a different number of entries on the stack depending on
40742
- // whether getRootHostContext() throws somewhere in renderer code or not.
40743
- // So we push an empty value first. This lets us safely unwind on errors.
40744
-
40745
- push(contextStackCursor$1, NO_CONTEXT, fiber);
40746
- var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it.
40747
-
40748
- pop(contextStackCursor$1, fiber);
40749
- push(contextStackCursor$1, nextRootContext, fiber);
40750
- }
40751
-
40752
- function popHostContainer(fiber) {
40753
- pop(contextStackCursor$1, fiber);
40754
- pop(contextFiberStackCursor, fiber);
40755
- pop(rootInstanceStackCursor, fiber);
40756
- }
40757
-
40758
- function getHostContext() {
40759
- var context = requiredContext(contextStackCursor$1.current);
40760
- return context;
40761
- }
40762
-
40763
- function pushHostContext(fiber) {
40764
- var rootInstance = requiredContext(rootInstanceStackCursor.current);
40765
- var context = requiredContext(contextStackCursor$1.current);
40766
- var nextContext = getChildHostContext(context, fiber.type, rootInstance); // Don't push this Fiber's context unless it's unique.
40767
-
40768
- if (context === nextContext) {
40769
- return;
40770
- } // Track the context and the Fiber that provided it.
40771
- // This enables us to pop only Fibers that provide unique contexts.
40772
-
40773
-
40774
- push(contextFiberStackCursor, fiber, fiber);
40775
- push(contextStackCursor$1, nextContext, fiber);
40776
- }
40777
-
40778
- function popHostContext(fiber) {
40779
- // Do not pop unless this Fiber provided the current context.
40780
- // pushHostContext() only pushes Fibers that provide unique contexts.
40781
- if (contextFiberStackCursor.current !== fiber) {
40782
- return;
40783
- }
40784
-
40785
- pop(contextStackCursor$1, fiber);
40786
- pop(contextFiberStackCursor, fiber);
40787
- }
40788
-
40789
- var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is
40790
- // inherited deeply down the subtree. The upper bits only affect
40791
- // this immediate suspense boundary and gets reset each new
40792
- // boundary or suspense list.
40793
-
40794
- var SubtreeSuspenseContextMask = 1; // Subtree Flags:
40795
- // InvisibleParentSuspenseContext indicates that one of our parent Suspense
40796
- // boundaries is not currently showing visible main content.
40797
- // Either because it is already showing a fallback or is not mounted at all.
40798
- // We can use this to determine if it is desirable to trigger a fallback at
40799
- // the parent. If not, then we might need to trigger undesirable boundaries
40800
- // and/or suspend the commit to avoid hiding the parent content.
40801
-
40802
- var InvisibleParentSuspenseContext = 1; // Shallow Flags:
40803
- // ForceSuspenseFallback can be used by SuspenseList to force newly added
40804
- // items into their fallback state during one of the render passes.
40805
-
40806
- var ForceSuspenseFallback = 2;
40807
- var suspenseStackCursor = createCursor(DefaultSuspenseContext);
40808
- function hasSuspenseContext(parentContext, flag) {
40809
- return (parentContext & flag) !== 0;
40810
- }
40811
- function setDefaultShallowSuspenseContext(parentContext) {
40812
- return parentContext & SubtreeSuspenseContextMask;
40813
- }
40814
- function setShallowSuspenseContext(parentContext, shallowContext) {
40815
- return parentContext & SubtreeSuspenseContextMask | shallowContext;
40816
- }
40817
- function addSubtreeSuspenseContext(parentContext, subtreeContext) {
40818
- return parentContext | subtreeContext;
40819
- }
40820
- function pushSuspenseContext(fiber, newContext) {
40821
- push(suspenseStackCursor, newContext, fiber);
40822
- }
40823
- function popSuspenseContext(fiber) {
40824
- pop(suspenseStackCursor, fiber);
40825
- }
40826
-
40827
- function shouldCaptureSuspense(workInProgress, hasInvisibleParent) {
40828
- // If it was the primary children that just suspended, capture and render the
40829
- // fallback. Otherwise, don't capture and bubble to the next boundary.
40830
- var nextState = workInProgress.memoizedState;
40831
-
40832
- if (nextState !== null) {
40833
- if (nextState.dehydrated !== null) {
40834
- // A dehydrated boundary always captures.
40835
- return true;
40836
- }
40837
-
40838
- return false;
40839
- }
40840
-
40841
- var props = workInProgress.memoizedProps; // In order to capture, the Suspense component must have a fallback prop.
40842
-
40843
- if (props.fallback === undefined) {
40844
- return false;
40845
- } // Regular boundaries always capture.
40846
-
40847
-
40848
- if (props.unstable_avoidThisFallback !== true) {
40849
- return true;
40850
- } // If it's a boundary we should avoid, then we prefer to bubble up to the
40851
- // parent boundary if it is currently invisible.
40852
-
40853
-
40854
- if (hasInvisibleParent) {
40855
- return false;
40856
- } // If the parent is not able to handle it, we must handle it.
40857
-
40858
-
40859
- return true;
40860
- }
40861
- function findFirstSuspended(row) {
40862
- var node = row;
40863
-
40864
- while (node !== null) {
40865
- if (node.tag === SuspenseComponent) {
40866
- var state = node.memoizedState;
40867
-
40868
- if (state !== null) {
40869
- var dehydrated = state.dehydrated;
40870
-
40871
- if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {
40872
- return node;
40873
- }
40874
- }
40875
- } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't
40876
- // keep track of whether it suspended or not.
40877
- node.memoizedProps.revealOrder !== undefined) {
40878
- var didSuspend = (node.effectTag & DidCapture) !== NoEffect;
40879
-
40880
- if (didSuspend) {
40881
- return node;
40882
- }
40883
- } else if (node.child !== null) {
40884
- node.child.return = node;
40885
- node = node.child;
40886
- continue;
40887
- }
40888
-
40889
- if (node === row) {
40890
- return null;
40891
- }
40892
-
40893
- while (node.sibling === null) {
40894
- if (node.return === null || node.return === row) {
40895
- return null;
40896
- }
40897
-
40898
- node = node.return;
40899
- }
40900
-
40901
- node.sibling.return = node.return;
40902
- node = node.sibling;
40903
- }
40904
-
40905
- return null;
40906
- }
40907
-
40908
- var emptyObject = {};
40909
- var isArray$2 = Array.isArray;
40910
- function createResponderInstance(responder, responderProps, responderState, fiber) {
40911
- return {
40912
- fiber: fiber,
40913
- props: responderProps,
40914
- responder: responder,
40915
- rootEventTypes: null,
40916
- state: responderState
40917
- };
40918
- }
40919
-
40920
- function mountEventResponder$1(responder, responderProps, fiber, respondersMap, rootContainerInstance) {
40921
- var responderState = emptyObject;
40922
- var getInitialState = responder.getInitialState;
40923
-
40924
- if (getInitialState !== null) {
40925
- responderState = getInitialState(responderProps);
40926
- }
40927
-
40928
- var responderInstance = createResponderInstance(responder, responderProps, responderState, fiber);
40929
-
40930
- if (!rootContainerInstance) {
40931
- var node = fiber;
40932
-
40933
- while (node !== null) {
40934
- var tag = node.tag;
40935
-
40936
- if (tag === HostComponent) {
40937
- rootContainerInstance = node.stateNode;
40938
- break;
40939
- } else if (tag === HostRoot) {
40940
- rootContainerInstance = node.stateNode.containerInfo;
40941
- break;
40942
- }
40943
-
40944
- node = node.return;
40945
- }
40946
- }
40947
-
40948
- mountResponderInstance(responder, responderInstance, responderProps, responderState, rootContainerInstance);
40949
- respondersMap.set(responder, responderInstance);
40950
- }
40951
-
40952
- function updateEventListener(listener, fiber, visistedResponders, respondersMap, rootContainerInstance) {
40953
- var responder;
40954
- var props;
40955
-
40956
- if (listener) {
40957
- responder = listener.responder;
40958
- props = listener.props;
40959
- }
40960
-
40961
- if (!(responder && responder.$$typeof === REACT_RESPONDER_TYPE)) {
40962
- {
40963
- throw Error("An invalid value was used as an event listener. Expect one or many event listeners created via React.unstable_useResponder().");
40964
- }
40965
- }
40966
-
40967
- var listenerProps = props;
40968
-
40969
- if (visistedResponders.has(responder)) {
40970
- // show warning
40971
- {
40972
- warning$1(false, 'Duplicate event responder "%s" found in event listeners. ' + 'Event listeners passed to elements cannot use the same event responder more than once.', responder.displayName);
40973
- }
40974
-
40975
- return;
40976
- }
40977
-
40978
- visistedResponders.add(responder);
40979
- var responderInstance = respondersMap.get(responder);
40980
-
40981
- if (responderInstance === undefined) {
40982
- // Mount (happens in either complete or commit phase)
40983
- mountEventResponder$1(responder, listenerProps, fiber, respondersMap, rootContainerInstance);
40984
- } else {
40985
- // Update (happens during commit phase only)
40986
- responderInstance.props = listenerProps;
40987
- responderInstance.fiber = fiber;
40988
- }
40989
- }
40990
-
40991
- function updateEventListeners(listeners, fiber, rootContainerInstance) {
40992
- var visistedResponders = new Set();
40993
- var dependencies = fiber.dependencies;
40994
-
40995
- if (listeners != null) {
40996
- if (dependencies === null) {
40997
- dependencies = fiber.dependencies = {
40998
- expirationTime: NoWork,
40999
- firstContext: null,
41000
- responders: new Map()
41001
- };
41002
- }
41003
-
41004
- var respondersMap = dependencies.responders;
41005
-
41006
- if (respondersMap === null) {
41007
- respondersMap = new Map();
41008
- }
41009
-
41010
- if (isArray$2(listeners)) {
41011
- for (var i = 0, length = listeners.length; i < length; i++) {
41012
- var listener = listeners[i];
41013
- updateEventListener(listener, fiber, visistedResponders, respondersMap, rootContainerInstance);
41014
- }
41015
- } else {
41016
- updateEventListener(listeners, fiber, visistedResponders, respondersMap, rootContainerInstance);
41017
- }
41018
- }
41019
-
41020
- if (dependencies !== null) {
41021
- var _respondersMap = dependencies.responders;
41022
-
41023
- if (_respondersMap !== null) {
41024
- // Unmount
41025
- var mountedResponders = Array.from(_respondersMap.keys());
41026
-
41027
- for (var _i = 0, _length = mountedResponders.length; _i < _length; _i++) {
41028
- var mountedResponder = mountedResponders[_i];
41029
-
41030
- if (!visistedResponders.has(mountedResponder)) {
41031
- var responderInstance = _respondersMap.get(mountedResponder);
41032
-
41033
- unmountResponderInstance(responderInstance);
41034
-
41035
- _respondersMap.delete(mountedResponder);
41036
- }
41037
- }
41038
- }
41039
- }
41040
- }
41041
- function createResponderListener(responder, props) {
41042
- var eventResponderListener = {
41043
- responder: responder,
41044
- props: props
41045
- };
41046
-
41047
- {
41048
- Object.freeze(eventResponderListener);
41049
- }
41050
-
41051
- return eventResponderListener;
41052
- }
41053
-
41054
- var NoEffect$1 =
41055
- /* */
41056
- 0;
41057
- var UnmountSnapshot =
41058
- /* */
41059
- 2;
41060
- var UnmountMutation =
41061
- /* */
41062
- 4;
41063
- var MountMutation =
41064
- /* */
41065
- 8;
41066
- var UnmountLayout =
41067
- /* */
41068
- 16;
41069
- var MountLayout =
41070
- /* */
41071
- 32;
41072
- var MountPassive =
41073
- /* */
41074
- 64;
41075
- var UnmountPassive =
41076
- /* */
41077
- 128;
41078
-
41079
- var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
41080
- var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;
41081
- var didWarnAboutMismatchedHooksForComponent;
41082
-
41083
- {
41084
- didWarnAboutMismatchedHooksForComponent = new Set();
41085
- }
41086
-
41087
- // These are set right before calling the component.
41088
- var renderExpirationTime$1 = NoWork; // The work-in-progress fiber. I've named it differently to distinguish it from
41089
- // the work-in-progress hook.
41090
-
41091
- var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The
41092
- // current hook list is the list that belongs to the current fiber. The
41093
- // work-in-progress hook list is a new list that will be added to the
41094
- // work-in-progress fiber.
41095
-
41096
- var currentHook = null;
41097
- var nextCurrentHook = null;
41098
- var firstWorkInProgressHook = null;
41099
- var workInProgressHook = null;
41100
- var nextWorkInProgressHook = null;
41101
- var remainingExpirationTime = NoWork;
41102
- var componentUpdateQueue = null;
41103
- var sideEffectTag = 0; // Updates scheduled during render will trigger an immediate re-render at the
41104
- // end of the current pass. We can't store these updates on the normal queue,
41105
- // because if the work is aborted, they should be discarded. Because this is
41106
- // a relatively rare case, we also don't want to add an additional field to
41107
- // either the hook or queue object types. So we store them in a lazily create
41108
- // map of queue -> render-phase updates, which are discarded once the component
41109
- // completes without re-rendering.
41110
- // Whether an update was scheduled during the currently executing render pass.
41111
-
41112
- var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates
41113
-
41114
- var renderPhaseUpdates = null; // Counter to prevent infinite loops.
41115
-
41116
- var numberOfReRenders = 0;
41117
- var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook
41118
-
41119
- var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders.
41120
- // The list stores the order of hooks used during the initial render (mount).
41121
- // Subsequent renders (updates) reference this list.
41122
-
41123
- var hookTypesDev = null;
41124
- var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore
41125
- // the dependencies for Hooks that need them (e.g. useEffect or useMemo).
41126
- // When true, such Hooks will always be "remounted". Only used during hot reload.
41127
-
41128
- var ignorePreviousDependencies = false;
41129
-
41130
- function mountHookTypesDev() {
41131
- {
41132
- var hookName = currentHookNameInDev;
41133
-
41134
- if (hookTypesDev === null) {
41135
- hookTypesDev = [hookName];
41136
- } else {
41137
- hookTypesDev.push(hookName);
41138
- }
41139
- }
41140
- }
41141
-
41142
- function updateHookTypesDev() {
41143
- {
41144
- var hookName = currentHookNameInDev;
41145
-
41146
- if (hookTypesDev !== null) {
41147
- hookTypesUpdateIndexDev++;
41148
-
41149
- if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {
41150
- warnOnHookMismatchInDev(hookName);
41151
- }
41152
- }
41153
- }
41154
- }
41155
-
41156
- function checkDepsAreArrayDev(deps) {
41157
- {
41158
- if (deps !== undefined && deps !== null && !Array.isArray(deps)) {
41159
- // Verify deps, but only on mount to avoid extra checks.
41160
- // It's unlikely their type would change as usually you define them inline.
41161
- warning$1(false, '%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);
41162
- }
41163
- }
41164
- }
41165
-
41166
- function warnOnHookMismatchInDev(currentHookName) {
41167
- {
41168
- var componentName = getComponentName(currentlyRenderingFiber$1.type);
41169
-
41170
- if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {
41171
- didWarnAboutMismatchedHooksForComponent.add(componentName);
41172
-
41173
- if (hookTypesDev !== null) {
41174
- var table = '';
41175
- var secondColumnStart = 30;
41176
-
41177
- for (var i = 0; i <= hookTypesUpdateIndexDev; i++) {
41178
- var oldHookName = hookTypesDev[i];
41179
- var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;
41180
- var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up
41181
- // lol @ IE not supporting String#repeat
41182
-
41183
- while (row.length < secondColumnStart) {
41184
- row += ' ';
41185
- }
41186
-
41187
- row += newHookName + '\n';
41188
- table += row;
41189
- }
41190
-
41191
- warning$1(false, 'React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://fb.me/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table);
41192
- }
41193
- }
41194
- }
41195
- }
41196
-
41197
- function throwInvalidHookError() {
41198
- {
41199
- {
41200
- throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");
41201
- }
41202
- }
41203
- }
41204
-
41205
- function areHookInputsEqual(nextDeps, prevDeps) {
41206
- {
41207
- if (ignorePreviousDependencies) {
41208
- // Only true when this component is being hot reloaded.
41209
- return false;
41210
- }
41211
- }
41212
-
41213
- if (prevDeps === null) {
41214
- {
41215
- warning$1(false, '%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);
41216
- }
41217
-
41218
- return false;
41219
- }
41220
-
41221
- {
41222
- // Don't bother comparing lengths in prod because these arrays should be
41223
- // passed inline.
41224
- if (nextDeps.length !== prevDeps.length) {
41225
- warning$1(false, 'The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]");
41226
- }
41227
- }
41228
-
41229
- for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {
41230
- if (is$1(nextDeps[i], prevDeps[i])) {
41231
- continue;
41232
- }
41233
-
41234
- return false;
41235
- }
41236
-
41237
- return true;
41238
- }
41239
-
41240
- function renderWithHooks(current, workInProgress, Component, props, refOrContext, nextRenderExpirationTime) {
41241
- renderExpirationTime$1 = nextRenderExpirationTime;
41242
- currentlyRenderingFiber$1 = workInProgress;
41243
- nextCurrentHook = current !== null ? current.memoizedState : null;
41244
-
41245
- {
41246
- hookTypesDev = current !== null ? current._debugHookTypes : null;
41247
- hookTypesUpdateIndexDev = -1; // Used for hot reloading:
41248
-
41249
- ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;
41250
- } // The following should have already been reset
41251
- // currentHook = null;
41252
- // workInProgressHook = null;
41253
- // remainingExpirationTime = NoWork;
41254
- // componentUpdateQueue = null;
41255
- // didScheduleRenderPhaseUpdate = false;
41256
- // renderPhaseUpdates = null;
41257
- // numberOfReRenders = 0;
41258
- // sideEffectTag = 0;
41259
- // TODO Warn if no hooks are used at all during mount, then some are used during update.
41260
- // Currently we will identify the update render as a mount because nextCurrentHook === null.
41261
- // This is tricky because it's valid for certain types of components (e.g. React.lazy)
41262
- // Using nextCurrentHook to differentiate between mount/update only works if at least one stateful hook is used.
41263
- // Non-stateful hooks (e.g. context) don't get added to memoizedState,
41264
- // so nextCurrentHook would be null during updates and mounts.
41265
-
41266
-
41267
- {
41268
- if (nextCurrentHook !== null) {
41269
- ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
41270
- } else if (hookTypesDev !== null) {
41271
- // This dispatcher handles an edge case where a component is updating,
41272
- // but no stateful hooks have been used.
41273
- // We want to match the production code behavior (which will use HooksDispatcherOnMount),
41274
- // but with the extra DEV validation to ensure hooks ordering hasn't changed.
41275
- // This dispatcher does that.
41276
- ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;
41277
- } else {
41278
- ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;
41279
- }
41280
- }
41281
-
41282
- var children = Component(props, refOrContext);
41283
-
41284
- if (didScheduleRenderPhaseUpdate) {
41285
- do {
41286
- didScheduleRenderPhaseUpdate = false;
41287
- numberOfReRenders += 1;
41288
-
41289
- {
41290
- // Even when hot reloading, allow dependencies to stabilize
41291
- // after first render to prevent infinite render phase updates.
41292
- ignorePreviousDependencies = false;
41293
- } // Start over from the beginning of the list
41294
-
41295
-
41296
- nextCurrentHook = current !== null ? current.memoizedState : null;
41297
- nextWorkInProgressHook = firstWorkInProgressHook;
41298
- currentHook = null;
41299
- workInProgressHook = null;
41300
- componentUpdateQueue = null;
41301
-
41302
- {
41303
- // Also validate hook order for cascading updates.
41304
- hookTypesUpdateIndexDev = -1;
41305
- }
41306
-
41307
- ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;
41308
- children = Component(props, refOrContext);
41309
- } while (didScheduleRenderPhaseUpdate);
41310
-
41311
- renderPhaseUpdates = null;
41312
- numberOfReRenders = 0;
41313
- } // We can assume the previous dispatcher is always this one, since we set it
41314
- // at the beginning of the render phase and there's no re-entrancy.
41315
-
41316
-
41317
- ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
41318
- var renderedWork = currentlyRenderingFiber$1;
41319
- renderedWork.memoizedState = firstWorkInProgressHook;
41320
- renderedWork.expirationTime = remainingExpirationTime;
41321
- renderedWork.updateQueue = componentUpdateQueue;
41322
- renderedWork.effectTag |= sideEffectTag;
41323
-
41324
- {
41325
- renderedWork._debugHookTypes = hookTypesDev;
41326
- } // This check uses currentHook so that it works the same in DEV and prod bundles.
41327
- // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.
41328
-
41329
-
41330
- var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;
41331
- renderExpirationTime$1 = NoWork;
41332
- currentlyRenderingFiber$1 = null;
41333
- currentHook = null;
41334
- nextCurrentHook = null;
41335
- firstWorkInProgressHook = null;
41336
- workInProgressHook = null;
41337
- nextWorkInProgressHook = null;
41338
-
41339
- {
41340
- currentHookNameInDev = null;
41341
- hookTypesDev = null;
41342
- hookTypesUpdateIndexDev = -1;
41343
- }
41344
-
41345
- remainingExpirationTime = NoWork;
41346
- componentUpdateQueue = null;
41347
- sideEffectTag = 0; // These were reset above
41348
- // didScheduleRenderPhaseUpdate = false;
41349
- // renderPhaseUpdates = null;
41350
- // numberOfReRenders = 0;
41351
-
41352
- if (!!didRenderTooFewHooks) {
41353
- {
41354
- throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");
41355
- }
41356
- }
41357
-
41358
- return children;
41359
- }
41360
- function bailoutHooks(current, workInProgress, expirationTime) {
41361
- workInProgress.updateQueue = current.updateQueue;
41362
- workInProgress.effectTag &= ~(Passive | Update);
41363
-
41364
- if (current.expirationTime <= expirationTime) {
41365
- current.expirationTime = NoWork;
41366
- }
41367
- }
41368
- function resetHooks() {
41369
- // We can assume the previous dispatcher is always this one, since we set it
41370
- // at the beginning of the render phase and there's no re-entrancy.
41371
- ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; // This is used to reset the state of this module when a component throws.
41372
- // It's also called inside mountIndeterminateComponent if we determine the
41373
- // component is a module-style component.
41374
-
41375
- renderExpirationTime$1 = NoWork;
41376
- currentlyRenderingFiber$1 = null;
41377
- currentHook = null;
41378
- nextCurrentHook = null;
41379
- firstWorkInProgressHook = null;
41380
- workInProgressHook = null;
41381
- nextWorkInProgressHook = null;
41382
-
41383
- {
41384
- hookTypesDev = null;
41385
- hookTypesUpdateIndexDev = -1;
41386
- currentHookNameInDev = null;
41387
- }
41388
-
41389
- remainingExpirationTime = NoWork;
41390
- componentUpdateQueue = null;
41391
- sideEffectTag = 0;
41392
- didScheduleRenderPhaseUpdate = false;
41393
- renderPhaseUpdates = null;
41394
- numberOfReRenders = 0;
41395
- }
41396
-
41397
- function mountWorkInProgressHook() {
41398
- var hook = {
41399
- memoizedState: null,
41400
- baseState: null,
41401
- queue: null,
41402
- baseUpdate: null,
41403
- next: null
41404
- };
41405
-
41406
- if (workInProgressHook === null) {
41407
- // This is the first hook in the list
41408
- firstWorkInProgressHook = workInProgressHook = hook;
41409
- } else {
41410
- // Append to the end of the list
41411
- workInProgressHook = workInProgressHook.next = hook;
41412
- }
41413
-
41414
- return workInProgressHook;
41415
- }
41416
-
41417
- function updateWorkInProgressHook() {
41418
- // This function is used both for updates and for re-renders triggered by a
41419
- // render phase update. It assumes there is either a current hook we can
41420
- // clone, or a work-in-progress hook from a previous render pass that we can
41421
- // use as a base. When we reach the end of the base list, we must switch to
41422
- // the dispatcher used for mounts.
41423
- if (nextWorkInProgressHook !== null) {
41424
- // There's already a work-in-progress. Reuse it.
41425
- workInProgressHook = nextWorkInProgressHook;
41426
- nextWorkInProgressHook = workInProgressHook.next;
41427
- currentHook = nextCurrentHook;
41428
- nextCurrentHook = currentHook !== null ? currentHook.next : null;
41429
- } else {
41430
- // Clone from the current hook.
41431
- if (!(nextCurrentHook !== null)) {
41432
- {
41433
- throw Error("Rendered more hooks than during the previous render.");
41434
- }
41435
- }
41436
-
41437
- currentHook = nextCurrentHook;
41438
- var newHook = {
41439
- memoizedState: currentHook.memoizedState,
41440
- baseState: currentHook.baseState,
41441
- queue: currentHook.queue,
41442
- baseUpdate: currentHook.baseUpdate,
41443
- next: null
41444
- };
41445
-
41446
- if (workInProgressHook === null) {
41447
- // This is the first hook in the list.
41448
- workInProgressHook = firstWorkInProgressHook = newHook;
41449
- } else {
41450
- // Append to the end of the list.
41451
- workInProgressHook = workInProgressHook.next = newHook;
41452
- }
41453
-
41454
- nextCurrentHook = currentHook.next;
41455
- }
41456
-
41457
- return workInProgressHook;
41458
- }
41459
-
41460
- function createFunctionComponentUpdateQueue() {
41461
- return {
41462
- lastEffect: null
41463
- };
41464
- }
41465
-
41466
- function basicStateReducer(state, action) {
41467
- return typeof action === 'function' ? action(state) : action;
41468
- }
41469
-
41470
- function mountReducer(reducer, initialArg, init) {
41471
- var hook = mountWorkInProgressHook();
41472
- var initialState;
41473
-
41474
- if (init !== undefined) {
41475
- initialState = init(initialArg);
41476
- } else {
41477
- initialState = initialArg;
41478
- }
41479
-
41480
- hook.memoizedState = hook.baseState = initialState;
41481
- var queue = hook.queue = {
41482
- last: null,
41483
- dispatch: null,
41484
- lastRenderedReducer: reducer,
41485
- lastRenderedState: initialState
41486
- };
41487
- var dispatch = queue.dispatch = dispatchAction.bind(null, // Flow doesn't know this is non-null, but we do.
41488
- currentlyRenderingFiber$1, queue);
41489
- return [hook.memoizedState, dispatch];
41490
- }
41491
-
41492
- function updateReducer(reducer, initialArg, init) {
41493
- var hook = updateWorkInProgressHook();
41494
- var queue = hook.queue;
41495
-
41496
- if (!(queue !== null)) {
41497
- {
41498
- throw Error("Should have a queue. This is likely a bug in React. Please file an issue.");
41499
- }
41500
- }
41501
-
41502
- queue.lastRenderedReducer = reducer;
41503
-
41504
- if (numberOfReRenders > 0) {
41505
- // This is a re-render. Apply the new render phase updates to the previous
41506
- // work-in-progress hook.
41507
- var _dispatch = queue.dispatch;
41508
-
41509
- if (renderPhaseUpdates !== null) {
41510
- // Render phase updates are stored in a map of queue -> linked list
41511
- var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
41512
-
41513
- if (firstRenderPhaseUpdate !== undefined) {
41514
- renderPhaseUpdates.delete(queue);
41515
- var newState = hook.memoizedState;
41516
- var update = firstRenderPhaseUpdate;
41517
-
41518
- do {
41519
- // Process this render phase update. We don't have to check the
41520
- // priority because it will always be the same as the current
41521
- // render's.
41522
- var action = update.action;
41523
- newState = reducer(newState, action);
41524
- update = update.next;
41525
- } while (update !== null); // Mark that the fiber performed work, but only if the new state is
41526
- // different from the current state.
41527
-
41528
-
41529
- if (!is$1(newState, hook.memoizedState)) {
41530
- markWorkInProgressReceivedUpdate();
41531
- }
41532
-
41533
- hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to
41534
- // the base state unless the queue is empty.
41535
- // TODO: Not sure if this is the desired semantics, but it's what we
41536
- // do for gDSFP. I can't remember why.
41537
-
41538
- if (hook.baseUpdate === queue.last) {
41539
- hook.baseState = newState;
41540
- }
41541
-
41542
- queue.lastRenderedState = newState;
41543
- return [newState, _dispatch];
41544
- }
41545
- }
41546
-
41547
- return [hook.memoizedState, _dispatch];
41548
- } // The last update in the entire queue
41549
-
41550
-
41551
- var last = queue.last; // The last update that is part of the base state.
41552
-
41553
- var baseUpdate = hook.baseUpdate;
41554
- var baseState = hook.baseState; // Find the first unprocessed update.
41555
-
41556
- var first;
41557
-
41558
- if (baseUpdate !== null) {
41559
- if (last !== null) {
41560
- // For the first update, the queue is a circular linked list where
41561
- // `queue.last.next = queue.first`. Once the first update commits, and
41562
- // the `baseUpdate` is no longer empty, we can unravel the list.
41563
- last.next = null;
41564
- }
41565
-
41566
- first = baseUpdate.next;
41567
- } else {
41568
- first = last !== null ? last.next : null;
41569
- }
41570
-
41571
- if (first !== null) {
41572
- var _newState = baseState;
41573
- var newBaseState = null;
41574
- var newBaseUpdate = null;
41575
- var prevUpdate = baseUpdate;
41576
- var _update = first;
41577
- var didSkip = false;
41578
-
41579
- do {
41580
- var updateExpirationTime = _update.expirationTime;
41581
-
41582
- if (updateExpirationTime < renderExpirationTime$1) {
41583
- // Priority is insufficient. Skip this update. If this is the first
41584
- // skipped update, the previous update/state is the new base
41585
- // update/state.
41586
- if (!didSkip) {
41587
- didSkip = true;
41588
- newBaseUpdate = prevUpdate;
41589
- newBaseState = _newState;
41590
- } // Update the remaining priority in the queue.
41591
-
41592
-
41593
- if (updateExpirationTime > remainingExpirationTime) {
41594
- remainingExpirationTime = updateExpirationTime;
41595
- markUnprocessedUpdateTime(remainingExpirationTime);
41596
- }
41597
- } else {
41598
- // This update does have sufficient priority.
41599
- // Mark the event time of this update as relevant to this render pass.
41600
- // TODO: This should ideally use the true event time of this update rather than
41601
- // its priority which is a derived and not reverseable value.
41602
- // TODO: We should skip this update if it was already committed but currently
41603
- // we have no way of detecting the difference between a committed and suspended
41604
- // update here.
41605
- markRenderEventTimeAndConfig(updateExpirationTime, _update.suspenseConfig); // Process this update.
41606
-
41607
- if (_update.eagerReducer === reducer) {
41608
- // If this update was processed eagerly, and its reducer matches the
41609
- // current reducer, we can use the eagerly computed state.
41610
- _newState = _update.eagerState;
41611
- } else {
41612
- var _action = _update.action;
41613
- _newState = reducer(_newState, _action);
41614
- }
41615
- }
41616
-
41617
- prevUpdate = _update;
41618
- _update = _update.next;
41619
- } while (_update !== null && _update !== first);
41620
-
41621
- if (!didSkip) {
41622
- newBaseUpdate = prevUpdate;
41623
- newBaseState = _newState;
41624
- } // Mark that the fiber performed work, but only if the new state is
41625
- // different from the current state.
41626
-
41627
-
41628
- if (!is$1(_newState, hook.memoizedState)) {
41629
- markWorkInProgressReceivedUpdate();
41630
- }
41631
-
41632
- hook.memoizedState = _newState;
41633
- hook.baseUpdate = newBaseUpdate;
41634
- hook.baseState = newBaseState;
41635
- queue.lastRenderedState = _newState;
41636
- }
41637
-
41638
- var dispatch = queue.dispatch;
41639
- return [hook.memoizedState, dispatch];
41640
- }
41641
-
41642
- function mountState(initialState) {
41643
- var hook = mountWorkInProgressHook();
41644
-
41645
- if (typeof initialState === 'function') {
41646
- initialState = initialState();
41647
- }
41648
-
41649
- hook.memoizedState = hook.baseState = initialState;
41650
- var queue = hook.queue = {
41651
- last: null,
41652
- dispatch: null,
41653
- lastRenderedReducer: basicStateReducer,
41654
- lastRenderedState: initialState
41655
- };
41656
- var dispatch = queue.dispatch = dispatchAction.bind(null, // Flow doesn't know this is non-null, but we do.
41657
- currentlyRenderingFiber$1, queue);
41658
- return [hook.memoizedState, dispatch];
41659
- }
41660
-
41661
- function updateState(initialState) {
41662
- return updateReducer(basicStateReducer, initialState);
41663
- }
41664
-
41665
- function pushEffect(tag, create, destroy, deps) {
41666
- var effect = {
41667
- tag: tag,
41668
- create: create,
41669
- destroy: destroy,
41670
- deps: deps,
41671
- // Circular
41672
- next: null
41673
- };
41674
-
41675
- if (componentUpdateQueue === null) {
41676
- componentUpdateQueue = createFunctionComponentUpdateQueue();
41677
- componentUpdateQueue.lastEffect = effect.next = effect;
41678
- } else {
41679
- var lastEffect = componentUpdateQueue.lastEffect;
41680
-
41681
- if (lastEffect === null) {
41682
- componentUpdateQueue.lastEffect = effect.next = effect;
41683
- } else {
41684
- var firstEffect = lastEffect.next;
41685
- lastEffect.next = effect;
41686
- effect.next = firstEffect;
41687
- componentUpdateQueue.lastEffect = effect;
41688
- }
41689
- }
41690
-
41691
- return effect;
41692
- }
41693
-
41694
- function mountRef(initialValue) {
41695
- var hook = mountWorkInProgressHook();
41696
- var ref = {
41697
- current: initialValue
41698
- };
41699
-
41700
- {
41701
- Object.seal(ref);
41702
- }
41703
-
41704
- hook.memoizedState = ref;
41705
- return ref;
41706
- }
41707
-
41708
- function updateRef(initialValue) {
41709
- var hook = updateWorkInProgressHook();
41710
- return hook.memoizedState;
41711
- }
41712
-
41713
- function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
41714
- var hook = mountWorkInProgressHook();
41715
- var nextDeps = deps === undefined ? null : deps;
41716
- sideEffectTag |= fiberEffectTag;
41717
- hook.memoizedState = pushEffect(hookEffectTag, create, undefined, nextDeps);
41718
- }
41719
-
41720
- function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
41721
- var hook = updateWorkInProgressHook();
41722
- var nextDeps = deps === undefined ? null : deps;
41723
- var destroy = undefined;
41724
-
41725
- if (currentHook !== null) {
41726
- var prevEffect = currentHook.memoizedState;
41727
- destroy = prevEffect.destroy;
41728
-
41729
- if (nextDeps !== null) {
41730
- var prevDeps = prevEffect.deps;
41731
-
41732
- if (areHookInputsEqual(nextDeps, prevDeps)) {
41733
- pushEffect(NoEffect$1, create, destroy, nextDeps);
41734
- return;
41735
- }
41736
- }
41737
- }
41738
-
41739
- sideEffectTag |= fiberEffectTag;
41740
- hook.memoizedState = pushEffect(hookEffectTag, create, destroy, nextDeps);
41741
- }
41742
-
41743
- function mountEffect(create, deps) {
41744
- {
41745
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
41746
- if ('undefined' !== typeof jest) {
41747
- warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
41748
- }
41749
- }
41750
-
41751
- return mountEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
41752
- }
41753
-
41754
- function updateEffect(create, deps) {
41755
- {
41756
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
41757
- if ('undefined' !== typeof jest) {
41758
- warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);
41759
- }
41760
- }
41761
-
41762
- return updateEffectImpl(Update | Passive, UnmountPassive | MountPassive, create, deps);
41763
- }
41764
-
41765
- function mountLayoutEffect(create, deps) {
41766
- return mountEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
41767
- }
41768
-
41769
- function updateLayoutEffect(create, deps) {
41770
- return updateEffectImpl(Update, UnmountMutation | MountLayout, create, deps);
41771
- }
41772
-
41773
- function imperativeHandleEffect(create, ref) {
41774
- if (typeof ref === 'function') {
41775
- var refCallback = ref;
41776
-
41777
- var _inst = create();
41778
-
41779
- refCallback(_inst);
41780
- return function () {
41781
- refCallback(null);
41782
- };
41783
- } else if (ref !== null && ref !== undefined) {
41784
- var refObject = ref;
41785
-
41786
- {
41787
- !refObject.hasOwnProperty('current') ? warning$1(false, 'Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}') : void 0;
41788
- }
41789
-
41790
- var _inst2 = create();
41791
-
41792
- refObject.current = _inst2;
41793
- return function () {
41794
- refObject.current = null;
41795
- };
41796
- }
41797
- }
41798
-
41799
- function mountImperativeHandle(ref, create, deps) {
41800
- {
41801
- !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
41802
- } // TODO: If deps are provided, should we skip comparing the ref itself?
41803
-
41804
-
41805
- var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
41806
- return mountEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
41807
- }
41808
-
41809
- function updateImperativeHandle(ref, create, deps) {
41810
- {
41811
- !(typeof create === 'function') ? warning$1(false, 'Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null') : void 0;
41812
- } // TODO: If deps are provided, should we skip comparing the ref itself?
41813
-
41814
-
41815
- var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
41816
- return updateEffectImpl(Update, UnmountMutation | MountLayout, imperativeHandleEffect.bind(null, create, ref), effectDeps);
41817
- }
41818
-
41819
- function mountDebugValue(value, formatterFn) {// This hook is normally a no-op.
41820
- // The react-debug-hooks package injects its own implementation
41821
- // so that e.g. DevTools can display custom hook values.
41822
- }
41823
-
41824
- var updateDebugValue = mountDebugValue;
41825
-
41826
- function mountCallback(callback, deps) {
41827
- var hook = mountWorkInProgressHook();
41828
- var nextDeps = deps === undefined ? null : deps;
41829
- hook.memoizedState = [callback, nextDeps];
41830
- return callback;
41831
- }
41832
-
41833
- function updateCallback(callback, deps) {
41834
- var hook = updateWorkInProgressHook();
41835
- var nextDeps = deps === undefined ? null : deps;
41836
- var prevState = hook.memoizedState;
41837
-
41838
- if (prevState !== null) {
41839
- if (nextDeps !== null) {
41840
- var prevDeps = prevState[1];
41841
-
41842
- if (areHookInputsEqual(nextDeps, prevDeps)) {
41843
- return prevState[0];
41844
- }
41845
- }
41846
- }
41847
-
41848
- hook.memoizedState = [callback, nextDeps];
41849
- return callback;
41850
- }
41851
-
41852
- function mountMemo(nextCreate, deps) {
41853
- var hook = mountWorkInProgressHook();
41854
- var nextDeps = deps === undefined ? null : deps;
41855
- var nextValue = nextCreate();
41856
- hook.memoizedState = [nextValue, nextDeps];
41857
- return nextValue;
41858
- }
41859
-
41860
- function updateMemo(nextCreate, deps) {
41861
- var hook = updateWorkInProgressHook();
41862
- var nextDeps = deps === undefined ? null : deps;
41863
- var prevState = hook.memoizedState;
41864
-
41865
- if (prevState !== null) {
41866
- // Assume these are defined. If they're not, areHookInputsEqual will warn.
41867
- if (nextDeps !== null) {
41868
- var prevDeps = prevState[1];
41869
-
41870
- if (areHookInputsEqual(nextDeps, prevDeps)) {
41871
- return prevState[0];
41872
- }
41873
- }
41874
- }
41875
-
41876
- var nextValue = nextCreate();
41877
- hook.memoizedState = [nextValue, nextDeps];
41878
- return nextValue;
41879
- }
41880
-
41881
- function mountDeferredValue(value, config) {
41882
- var _mountState = mountState(value),
41883
- prevValue = _mountState[0],
41884
- setValue = _mountState[1];
41885
-
41886
- mountEffect(function () {
41887
- Scheduler.unstable_next(function () {
41888
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
41889
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
41890
-
41891
- try {
41892
- setValue(value);
41893
- } finally {
41894
- ReactCurrentBatchConfig$1.suspense = previousConfig;
41895
- }
41896
- });
41897
- }, [value, config]);
41898
- return prevValue;
41899
- }
41900
-
41901
- function updateDeferredValue(value, config) {
41902
- var _updateState = updateState(value),
41903
- prevValue = _updateState[0],
41904
- setValue = _updateState[1];
41905
-
41906
- updateEffect(function () {
41907
- Scheduler.unstable_next(function () {
41908
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
41909
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
41910
-
41911
- try {
41912
- setValue(value);
41913
- } finally {
41914
- ReactCurrentBatchConfig$1.suspense = previousConfig;
41915
- }
41916
- });
41917
- }, [value, config]);
41918
- return prevValue;
41919
- }
41920
-
41921
- function mountTransition(config) {
41922
- var _mountState2 = mountState(false),
41923
- isPending = _mountState2[0],
41924
- setPending = _mountState2[1];
41925
-
41926
- var startTransition = mountCallback(function (callback) {
41927
- setPending(true);
41928
- Scheduler.unstable_next(function () {
41929
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
41930
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
41931
-
41932
- try {
41933
- setPending(false);
41934
- callback();
41935
- } finally {
41936
- ReactCurrentBatchConfig$1.suspense = previousConfig;
41937
- }
41938
- });
41939
- }, [config, isPending]);
41940
- return [startTransition, isPending];
41941
- }
41942
-
41943
- function updateTransition(config) {
41944
- var _updateState2 = updateState(false),
41945
- isPending = _updateState2[0],
41946
- setPending = _updateState2[1];
41947
-
41948
- var startTransition = updateCallback(function (callback) {
41949
- setPending(true);
41950
- Scheduler.unstable_next(function () {
41951
- var previousConfig = ReactCurrentBatchConfig$1.suspense;
41952
- ReactCurrentBatchConfig$1.suspense = config === undefined ? null : config;
41953
-
41954
- try {
41955
- setPending(false);
41956
- callback();
41957
- } finally {
41958
- ReactCurrentBatchConfig$1.suspense = previousConfig;
41959
- }
41960
- });
41961
- }, [config, isPending]);
41962
- return [startTransition, isPending];
41963
- }
41964
-
41965
- function dispatchAction(fiber, queue, action) {
41966
- if (!(numberOfReRenders < RE_RENDER_LIMIT)) {
41967
- {
41968
- throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");
41969
- }
41970
- }
41971
-
41972
- {
41973
- !(typeof arguments[3] !== 'function') ? warning$1(false, "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().') : void 0;
41974
- }
41975
-
41976
- var alternate = fiber.alternate;
41977
-
41978
- if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {
41979
- // This is a render phase update. Stash it in a lazily-created map of
41980
- // queue -> linked list of updates. After this render pass, we'll restart
41981
- // and apply the stashed updates on top of the work-in-progress hook.
41982
- didScheduleRenderPhaseUpdate = true;
41983
- var update = {
41984
- expirationTime: renderExpirationTime$1,
41985
- suspenseConfig: null,
41986
- action: action,
41987
- eagerReducer: null,
41988
- eagerState: null,
41989
- next: null
41990
- };
41991
-
41992
- {
41993
- update.priority = getCurrentPriorityLevel();
41994
- }
41995
-
41996
- if (renderPhaseUpdates === null) {
41997
- renderPhaseUpdates = new Map();
41998
- }
41999
-
42000
- var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
42001
-
42002
- if (firstRenderPhaseUpdate === undefined) {
42003
- renderPhaseUpdates.set(queue, update);
42004
- } else {
42005
- // Append the update to the end of the list.
42006
- var lastRenderPhaseUpdate = firstRenderPhaseUpdate;
42007
-
42008
- while (lastRenderPhaseUpdate.next !== null) {
42009
- lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;
42010
- }
42011
-
42012
- lastRenderPhaseUpdate.next = update;
42013
- }
42014
- } else {
42015
- var currentTime = requestCurrentTimeForUpdate();
42016
- var suspenseConfig = requestCurrentSuspenseConfig();
42017
- var expirationTime = computeExpirationForFiber(currentTime, fiber, suspenseConfig);
42018
- var _update2 = {
42019
- expirationTime: expirationTime,
42020
- suspenseConfig: suspenseConfig,
42021
- action: action,
42022
- eagerReducer: null,
42023
- eagerState: null,
42024
- next: null
42025
- };
42026
-
42027
- {
42028
- _update2.priority = getCurrentPriorityLevel();
42029
- } // Append the update to the end of the list.
42030
-
42031
-
42032
- var last = queue.last;
42033
-
42034
- if (last === null) {
42035
- // This is the first update. Create a circular list.
42036
- _update2.next = _update2;
42037
- } else {
42038
- var first = last.next;
42039
-
42040
- if (first !== null) {
42041
- // Still circular.
42042
- _update2.next = first;
42043
- }
42044
-
42045
- last.next = _update2;
42046
- }
42047
-
42048
- queue.last = _update2;
42049
-
42050
- if (fiber.expirationTime === NoWork && (alternate === null || alternate.expirationTime === NoWork)) {
42051
- // The queue is currently empty, which means we can eagerly compute the
42052
- // next state before entering the render phase. If the new state is the
42053
- // same as the current state, we may be able to bail out entirely.
42054
- var lastRenderedReducer = queue.lastRenderedReducer;
42055
-
42056
- if (lastRenderedReducer !== null) {
42057
- var prevDispatcher;
42058
-
42059
- {
42060
- prevDispatcher = ReactCurrentDispatcher$1.current;
42061
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
42062
- }
42063
-
42064
- try {
42065
- var currentState = queue.lastRenderedState;
42066
- var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute
42067
- // it, on the update object. If the reducer hasn't changed by the
42068
- // time we enter the render phase, then the eager state can be used
42069
- // without calling the reducer again.
42070
-
42071
- _update2.eagerReducer = lastRenderedReducer;
42072
- _update2.eagerState = eagerState;
42073
-
42074
- if (is$1(eagerState, currentState)) {
42075
- // Fast path. We can bail out without scheduling React to re-render.
42076
- // It's still possible that we'll need to rebase this update later,
42077
- // if the component re-renders for a different reason and by that
42078
- // time the reducer has changed.
42079
- return;
42080
- }
42081
- } catch (error) {// Suppress the error. It will throw again in the render phase.
42082
- } finally {
42083
- {
42084
- ReactCurrentDispatcher$1.current = prevDispatcher;
42085
- }
42086
- }
42087
- }
42088
- }
42089
-
42090
- {
42091
- // $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests
42092
- if ('undefined' !== typeof jest) {
42093
- warnIfNotScopedWithMatchingAct(fiber);
42094
- warnIfNotCurrentlyActingUpdatesInDev(fiber);
42095
- }
42096
- }
42097
-
42098
- scheduleWork(fiber, expirationTime);
42099
- }
42100
- }
42101
-
42102
- var ContextOnlyDispatcher = {
42103
- readContext: readContext,
42104
- useCallback: throwInvalidHookError,
42105
- useContext: throwInvalidHookError,
42106
- useEffect: throwInvalidHookError,
42107
- useImperativeHandle: throwInvalidHookError,
42108
- useLayoutEffect: throwInvalidHookError,
42109
- useMemo: throwInvalidHookError,
42110
- useReducer: throwInvalidHookError,
42111
- useRef: throwInvalidHookError,
42112
- useState: throwInvalidHookError,
42113
- useDebugValue: throwInvalidHookError,
42114
- useResponder: throwInvalidHookError,
42115
- useDeferredValue: throwInvalidHookError,
42116
- useTransition: throwInvalidHookError
42117
- };
42118
- var HooksDispatcherOnMountInDEV = null;
42119
- var HooksDispatcherOnMountWithHookTypesInDEV = null;
42120
- var HooksDispatcherOnUpdateInDEV = null;
42121
- var InvalidNestedHooksDispatcherOnMountInDEV = null;
42122
- var InvalidNestedHooksDispatcherOnUpdateInDEV = null;
42123
-
42124
- {
42125
- var warnInvalidContextAccess = function () {
42126
- warning$1(false, 'Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');
42127
- };
42128
-
42129
- var warnInvalidHookAccess = function () {
42130
- warning$1(false, 'Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://fb.me/rules-of-hooks');
42131
- };
42132
-
42133
- HooksDispatcherOnMountInDEV = {
42134
- readContext: function (context, observedBits) {
42135
- return readContext(context, observedBits);
42136
- },
42137
- useCallback: function (callback, deps) {
42138
- currentHookNameInDev = 'useCallback';
42139
- mountHookTypesDev();
42140
- checkDepsAreArrayDev(deps);
42141
- return mountCallback(callback, deps);
42142
- },
42143
- useContext: function (context, observedBits) {
42144
- currentHookNameInDev = 'useContext';
42145
- mountHookTypesDev();
42146
- return readContext(context, observedBits);
42147
- },
42148
- useEffect: function (create, deps) {
42149
- currentHookNameInDev = 'useEffect';
42150
- mountHookTypesDev();
42151
- checkDepsAreArrayDev(deps);
42152
- return mountEffect(create, deps);
42153
- },
42154
- useImperativeHandle: function (ref, create, deps) {
42155
- currentHookNameInDev = 'useImperativeHandle';
42156
- mountHookTypesDev();
42157
- checkDepsAreArrayDev(deps);
42158
- return mountImperativeHandle(ref, create, deps);
42159
- },
42160
- useLayoutEffect: function (create, deps) {
42161
- currentHookNameInDev = 'useLayoutEffect';
42162
- mountHookTypesDev();
42163
- checkDepsAreArrayDev(deps);
42164
- return mountLayoutEffect(create, deps);
42165
- },
42166
- useMemo: function (create, deps) {
42167
- currentHookNameInDev = 'useMemo';
42168
- mountHookTypesDev();
42169
- checkDepsAreArrayDev(deps);
42170
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42171
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42172
-
42173
- try {
42174
- return mountMemo(create, deps);
42175
- } finally {
42176
- ReactCurrentDispatcher$1.current = prevDispatcher;
42177
- }
42178
- },
42179
- useReducer: function (reducer, initialArg, init) {
42180
- currentHookNameInDev = 'useReducer';
42181
- mountHookTypesDev();
42182
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42183
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42184
-
42185
- try {
42186
- return mountReducer(reducer, initialArg, init);
42187
- } finally {
42188
- ReactCurrentDispatcher$1.current = prevDispatcher;
42189
- }
42190
- },
42191
- useRef: function (initialValue) {
42192
- currentHookNameInDev = 'useRef';
42193
- mountHookTypesDev();
42194
- return mountRef(initialValue);
42195
- },
42196
- useState: function (initialState) {
42197
- currentHookNameInDev = 'useState';
42198
- mountHookTypesDev();
42199
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42200
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42201
-
42202
- try {
42203
- return mountState(initialState);
42204
- } finally {
42205
- ReactCurrentDispatcher$1.current = prevDispatcher;
42206
- }
42207
- },
42208
- useDebugValue: function (value, formatterFn) {
42209
- currentHookNameInDev = 'useDebugValue';
42210
- mountHookTypesDev();
42211
- return mountDebugValue(value, formatterFn);
42212
- },
42213
- useResponder: function (responder, props) {
42214
- currentHookNameInDev = 'useResponder';
42215
- mountHookTypesDev();
42216
- return createResponderListener(responder, props);
42217
- },
42218
- useDeferredValue: function (value, config) {
42219
- currentHookNameInDev = 'useDeferredValue';
42220
- mountHookTypesDev();
42221
- return mountDeferredValue(value, config);
42222
- },
42223
- useTransition: function (config) {
42224
- currentHookNameInDev = 'useTransition';
42225
- mountHookTypesDev();
42226
- return mountTransition(config);
42227
- }
42228
- };
42229
- HooksDispatcherOnMountWithHookTypesInDEV = {
42230
- readContext: function (context, observedBits) {
42231
- return readContext(context, observedBits);
42232
- },
42233
- useCallback: function (callback, deps) {
42234
- currentHookNameInDev = 'useCallback';
42235
- updateHookTypesDev();
42236
- return mountCallback(callback, deps);
42237
- },
42238
- useContext: function (context, observedBits) {
42239
- currentHookNameInDev = 'useContext';
42240
- updateHookTypesDev();
42241
- return readContext(context, observedBits);
42242
- },
42243
- useEffect: function (create, deps) {
42244
- currentHookNameInDev = 'useEffect';
42245
- updateHookTypesDev();
42246
- return mountEffect(create, deps);
42247
- },
42248
- useImperativeHandle: function (ref, create, deps) {
42249
- currentHookNameInDev = 'useImperativeHandle';
42250
- updateHookTypesDev();
42251
- return mountImperativeHandle(ref, create, deps);
42252
- },
42253
- useLayoutEffect: function (create, deps) {
42254
- currentHookNameInDev = 'useLayoutEffect';
42255
- updateHookTypesDev();
42256
- return mountLayoutEffect(create, deps);
42257
- },
42258
- useMemo: function (create, deps) {
42259
- currentHookNameInDev = 'useMemo';
42260
- updateHookTypesDev();
42261
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42262
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42263
-
42264
- try {
42265
- return mountMemo(create, deps);
42266
- } finally {
42267
- ReactCurrentDispatcher$1.current = prevDispatcher;
42268
- }
42269
- },
42270
- useReducer: function (reducer, initialArg, init) {
42271
- currentHookNameInDev = 'useReducer';
42272
- updateHookTypesDev();
42273
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42274
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42275
-
42276
- try {
42277
- return mountReducer(reducer, initialArg, init);
42278
- } finally {
42279
- ReactCurrentDispatcher$1.current = prevDispatcher;
42280
- }
42281
- },
42282
- useRef: function (initialValue) {
42283
- currentHookNameInDev = 'useRef';
42284
- updateHookTypesDev();
42285
- return mountRef(initialValue);
42286
- },
42287
- useState: function (initialState) {
42288
- currentHookNameInDev = 'useState';
42289
- updateHookTypesDev();
42290
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42291
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42292
-
42293
- try {
42294
- return mountState(initialState);
42295
- } finally {
42296
- ReactCurrentDispatcher$1.current = prevDispatcher;
42297
- }
42298
- },
42299
- useDebugValue: function (value, formatterFn) {
42300
- currentHookNameInDev = 'useDebugValue';
42301
- updateHookTypesDev();
42302
- return mountDebugValue(value, formatterFn);
42303
- },
42304
- useResponder: function (responder, props) {
42305
- currentHookNameInDev = 'useResponder';
42306
- updateHookTypesDev();
42307
- return createResponderListener(responder, props);
42308
- },
42309
- useDeferredValue: function (value, config) {
42310
- currentHookNameInDev = 'useDeferredValue';
42311
- updateHookTypesDev();
42312
- return mountDeferredValue(value, config);
42313
- },
42314
- useTransition: function (config) {
42315
- currentHookNameInDev = 'useTransition';
42316
- updateHookTypesDev();
42317
- return mountTransition(config);
42318
- }
42319
- };
42320
- HooksDispatcherOnUpdateInDEV = {
42321
- readContext: function (context, observedBits) {
42322
- return readContext(context, observedBits);
42323
- },
42324
- useCallback: function (callback, deps) {
42325
- currentHookNameInDev = 'useCallback';
42326
- updateHookTypesDev();
42327
- return updateCallback(callback, deps);
42328
- },
42329
- useContext: function (context, observedBits) {
42330
- currentHookNameInDev = 'useContext';
42331
- updateHookTypesDev();
42332
- return readContext(context, observedBits);
42333
- },
42334
- useEffect: function (create, deps) {
42335
- currentHookNameInDev = 'useEffect';
42336
- updateHookTypesDev();
42337
- return updateEffect(create, deps);
42338
- },
42339
- useImperativeHandle: function (ref, create, deps) {
42340
- currentHookNameInDev = 'useImperativeHandle';
42341
- updateHookTypesDev();
42342
- return updateImperativeHandle(ref, create, deps);
42343
- },
42344
- useLayoutEffect: function (create, deps) {
42345
- currentHookNameInDev = 'useLayoutEffect';
42346
- updateHookTypesDev();
42347
- return updateLayoutEffect(create, deps);
42348
- },
42349
- useMemo: function (create, deps) {
42350
- currentHookNameInDev = 'useMemo';
42351
- updateHookTypesDev();
42352
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42353
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
42354
-
42355
- try {
42356
- return updateMemo(create, deps);
42357
- } finally {
42358
- ReactCurrentDispatcher$1.current = prevDispatcher;
42359
- }
42360
- },
42361
- useReducer: function (reducer, initialArg, init) {
42362
- currentHookNameInDev = 'useReducer';
42363
- updateHookTypesDev();
42364
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42365
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
42366
-
42367
- try {
42368
- return updateReducer(reducer, initialArg, init);
42369
- } finally {
42370
- ReactCurrentDispatcher$1.current = prevDispatcher;
42371
- }
42372
- },
42373
- useRef: function (initialValue) {
42374
- currentHookNameInDev = 'useRef';
42375
- updateHookTypesDev();
42376
- return updateRef(initialValue);
42377
- },
42378
- useState: function (initialState) {
42379
- currentHookNameInDev = 'useState';
42380
- updateHookTypesDev();
42381
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42382
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
42383
-
42384
- try {
42385
- return updateState(initialState);
42386
- } finally {
42387
- ReactCurrentDispatcher$1.current = prevDispatcher;
42388
- }
42389
- },
42390
- useDebugValue: function (value, formatterFn) {
42391
- currentHookNameInDev = 'useDebugValue';
42392
- updateHookTypesDev();
42393
- return updateDebugValue(value, formatterFn);
42394
- },
42395
- useResponder: function (responder, props) {
42396
- currentHookNameInDev = 'useResponder';
42397
- updateHookTypesDev();
42398
- return createResponderListener(responder, props);
42399
- },
42400
- useDeferredValue: function (value, config) {
42401
- currentHookNameInDev = 'useDeferredValue';
42402
- updateHookTypesDev();
42403
- return updateDeferredValue(value, config);
42404
- },
42405
- useTransition: function (config) {
42406
- currentHookNameInDev = 'useTransition';
42407
- updateHookTypesDev();
42408
- return updateTransition(config);
42409
- }
42410
- };
42411
- InvalidNestedHooksDispatcherOnMountInDEV = {
42412
- readContext: function (context, observedBits) {
42413
- warnInvalidContextAccess();
42414
- return readContext(context, observedBits);
42415
- },
42416
- useCallback: function (callback, deps) {
42417
- currentHookNameInDev = 'useCallback';
42418
- warnInvalidHookAccess();
42419
- mountHookTypesDev();
42420
- return mountCallback(callback, deps);
42421
- },
42422
- useContext: function (context, observedBits) {
42423
- currentHookNameInDev = 'useContext';
42424
- warnInvalidHookAccess();
42425
- mountHookTypesDev();
42426
- return readContext(context, observedBits);
42427
- },
42428
- useEffect: function (create, deps) {
42429
- currentHookNameInDev = 'useEffect';
42430
- warnInvalidHookAccess();
42431
- mountHookTypesDev();
42432
- return mountEffect(create, deps);
42433
- },
42434
- useImperativeHandle: function (ref, create, deps) {
42435
- currentHookNameInDev = 'useImperativeHandle';
42436
- warnInvalidHookAccess();
42437
- mountHookTypesDev();
42438
- return mountImperativeHandle(ref, create, deps);
42439
- },
42440
- useLayoutEffect: function (create, deps) {
42441
- currentHookNameInDev = 'useLayoutEffect';
42442
- warnInvalidHookAccess();
42443
- mountHookTypesDev();
42444
- return mountLayoutEffect(create, deps);
42445
- },
42446
- useMemo: function (create, deps) {
42447
- currentHookNameInDev = 'useMemo';
42448
- warnInvalidHookAccess();
42449
- mountHookTypesDev();
42450
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42451
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42452
-
42453
- try {
42454
- return mountMemo(create, deps);
42455
- } finally {
42456
- ReactCurrentDispatcher$1.current = prevDispatcher;
42457
- }
42458
- },
42459
- useReducer: function (reducer, initialArg, init) {
42460
- currentHookNameInDev = 'useReducer';
42461
- warnInvalidHookAccess();
42462
- mountHookTypesDev();
42463
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42464
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42465
-
42466
- try {
42467
- return mountReducer(reducer, initialArg, init);
42468
- } finally {
42469
- ReactCurrentDispatcher$1.current = prevDispatcher;
42470
- }
42471
- },
42472
- useRef: function (initialValue) {
42473
- currentHookNameInDev = 'useRef';
42474
- warnInvalidHookAccess();
42475
- mountHookTypesDev();
42476
- return mountRef(initialValue);
42477
- },
42478
- useState: function (initialState) {
42479
- currentHookNameInDev = 'useState';
42480
- warnInvalidHookAccess();
42481
- mountHookTypesDev();
42482
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42483
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
42484
-
42485
- try {
42486
- return mountState(initialState);
42487
- } finally {
42488
- ReactCurrentDispatcher$1.current = prevDispatcher;
42489
- }
42490
- },
42491
- useDebugValue: function (value, formatterFn) {
42492
- currentHookNameInDev = 'useDebugValue';
42493
- warnInvalidHookAccess();
42494
- mountHookTypesDev();
42495
- return mountDebugValue(value, formatterFn);
42496
- },
42497
- useResponder: function (responder, props) {
42498
- currentHookNameInDev = 'useResponder';
42499
- warnInvalidHookAccess();
42500
- mountHookTypesDev();
42501
- return createResponderListener(responder, props);
42502
- },
42503
- useDeferredValue: function (value, config) {
42504
- currentHookNameInDev = 'useDeferredValue';
42505
- warnInvalidHookAccess();
42506
- mountHookTypesDev();
42507
- return mountDeferredValue(value, config);
42508
- },
42509
- useTransition: function (config) {
42510
- currentHookNameInDev = 'useTransition';
42511
- warnInvalidHookAccess();
42512
- mountHookTypesDev();
42513
- return mountTransition(config);
42514
- }
42515
- };
42516
- InvalidNestedHooksDispatcherOnUpdateInDEV = {
42517
- readContext: function (context, observedBits) {
42518
- warnInvalidContextAccess();
42519
- return readContext(context, observedBits);
42520
- },
42521
- useCallback: function (callback, deps) {
42522
- currentHookNameInDev = 'useCallback';
42523
- warnInvalidHookAccess();
42524
- updateHookTypesDev();
42525
- return updateCallback(callback, deps);
42526
- },
42527
- useContext: function (context, observedBits) {
42528
- currentHookNameInDev = 'useContext';
42529
- warnInvalidHookAccess();
42530
- updateHookTypesDev();
42531
- return readContext(context, observedBits);
42532
- },
42533
- useEffect: function (create, deps) {
42534
- currentHookNameInDev = 'useEffect';
42535
- warnInvalidHookAccess();
42536
- updateHookTypesDev();
42537
- return updateEffect(create, deps);
42538
- },
42539
- useImperativeHandle: function (ref, create, deps) {
42540
- currentHookNameInDev = 'useImperativeHandle';
42541
- warnInvalidHookAccess();
42542
- updateHookTypesDev();
42543
- return updateImperativeHandle(ref, create, deps);
42544
- },
42545
- useLayoutEffect: function (create, deps) {
42546
- currentHookNameInDev = 'useLayoutEffect';
42547
- warnInvalidHookAccess();
42548
- updateHookTypesDev();
42549
- return updateLayoutEffect(create, deps);
42550
- },
42551
- useMemo: function (create, deps) {
42552
- currentHookNameInDev = 'useMemo';
42553
- warnInvalidHookAccess();
42554
- updateHookTypesDev();
42555
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42556
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
42557
-
42558
- try {
42559
- return updateMemo(create, deps);
42560
- } finally {
42561
- ReactCurrentDispatcher$1.current = prevDispatcher;
42562
- }
42563
- },
42564
- useReducer: function (reducer, initialArg, init) {
42565
- currentHookNameInDev = 'useReducer';
42566
- warnInvalidHookAccess();
42567
- updateHookTypesDev();
42568
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42569
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
42570
-
42571
- try {
42572
- return updateReducer(reducer, initialArg, init);
42573
- } finally {
42574
- ReactCurrentDispatcher$1.current = prevDispatcher;
42575
- }
42576
- },
42577
- useRef: function (initialValue) {
42578
- currentHookNameInDev = 'useRef';
42579
- warnInvalidHookAccess();
42580
- updateHookTypesDev();
42581
- return updateRef(initialValue);
42582
- },
42583
- useState: function (initialState) {
42584
- currentHookNameInDev = 'useState';
42585
- warnInvalidHookAccess();
42586
- updateHookTypesDev();
42587
- var prevDispatcher = ReactCurrentDispatcher$1.current;
42588
- ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
42589
-
42590
- try {
42591
- return updateState(initialState);
42592
- } finally {
42593
- ReactCurrentDispatcher$1.current = prevDispatcher;
42594
- }
42595
- },
42596
- useDebugValue: function (value, formatterFn) {
42597
- currentHookNameInDev = 'useDebugValue';
42598
- warnInvalidHookAccess();
42599
-
68
  /***/ (function(module, exports, __webpack_require__) {
69
 
70
  "use strict";
71
+ /* WEBPACK VAR INJECTION */(function(process) {
72
+
73
+ if (process.env.NODE_ENV === 'production') {
74
+ module.exports = __webpack_require__(297);
75
+ } else {
76
+ module.exports = __webpack_require__(298);
77
+ }
78
 
79
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
80
 
82
  /* 1 */
83
  /***/ (function(module, exports) {
84
 
85
+ // shim for using process in browser
86
+ var process = module.exports = {};
87
+
88
+ // cached from whatever global is present so that test runners that stub it
89
+ // don't break things. But we need to wrap it in a try catch in case it is
90
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
91
+ // function because try/catches deoptimize in certain engines.
92
+
93
+ var cachedSetTimeout;
94
+ var cachedClearTimeout;
95
+
96
+ function defaultSetTimout() {
97
+ throw new Error('setTimeout has not been defined');
98
+ }
99
+ function defaultClearTimeout () {
100
+ throw new Error('clearTimeout has not been defined');
101
+ }
102
+ (function () {
103
+ try {
104
+ if (typeof setTimeout === 'function') {
105
+ cachedSetTimeout = setTimeout;
106
+ } else {
107
+ cachedSetTimeout = defaultSetTimout;
108
+ }
109
+ } catch (e) {
110
+ cachedSetTimeout = defaultSetTimout;
111
+ }
112
+ try {
113
+ if (typeof clearTimeout === 'function') {
114
+ cachedClearTimeout = clearTimeout;
115
+ } else {
116
+ cachedClearTimeout = defaultClearTimeout;
117
+ }
118
+ } catch (e) {
119
+ cachedClearTimeout = defaultClearTimeout;
120
+ }
121
+ } ())
122
+ function runTimeout(fun) {
123
+ if (cachedSetTimeout === setTimeout) {
124
+ //normal enviroments in sane situations
125
+ return setTimeout(fun, 0);
126
+ }
127
+ // if setTimeout wasn't available but was latter defined
128
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
129
+ cachedSetTimeout = setTimeout;
130
+ return setTimeout(fun, 0);
131
+ }
132
+ try {
133
+ // when when somebody has screwed with setTimeout but no I.E. maddness
134
+ return cachedSetTimeout(fun, 0);
135
+ } catch(e){
136
+ try {
137
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
138
+ return cachedSetTimeout.call(null, fun, 0);
139
+ } catch(e){
140
+ // 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
141
+ return cachedSetTimeout.call(this, fun, 0);
142
+ }
143
+ }
144
+
145
+
146
+ }
147
+ function runClearTimeout(marker) {
148
+ if (cachedClearTimeout === clearTimeout) {
149
+ //normal enviroments in sane situations
150
+ return clearTimeout(marker);
151
+ }
152
+ // if clearTimeout wasn't available but was latter defined
153
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
154
+ cachedClearTimeout = clearTimeout;
155
+ return clearTimeout(marker);
156
+ }
157
+ try {
158
+ // when when somebody has screwed with setTimeout but no I.E. maddness
159
+ return cachedClearTimeout(marker);
160
+ } catch (e){
161
+ try {
162
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
163
+ return cachedClearTimeout.call(null, marker);
164
+ } catch (e){
165
+ // 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.
166
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
167
+ return cachedClearTimeout.call(this, marker);
168
+ }
169
+ }
170
+
171
+
172
+
173
+ }
174
+ var queue = [];
175
+ var draining = false;
176
+ var currentQueue;
177
+ var queueIndex = -1;
178
+
179
+ function cleanUpNextTick() {
180
+ if (!draining || !currentQueue) {
181
+ return;
182
+ }
183
+ draining = false;
184
+ if (currentQueue.length) {
185
+ queue = currentQueue.concat(queue);
186
+ } else {
187
+ queueIndex = -1;
188
+ }
189
+ if (queue.length) {
190
+ drainQueue();
191
+ }
192
+ }
193
+
194
+ function drainQueue() {
195
+ if (draining) {
196
+ return;
197
+ }
198
+ var timeout = runTimeout(cleanUpNextTick);
199
+ draining = true;
200
+
201
+ var len = queue.length;
202
+ while(len) {
203
+ currentQueue = queue;
204
+ queue = [];
205
+ while (++queueIndex < len) {
206
+ if (currentQueue) {
207
+ currentQueue[queueIndex].run();
208
+ }
209
+ }
210
+ queueIndex = -1;
211
+ len = queue.length;
212
+ }
213
+ currentQueue = null;
214
+ draining = false;
215
+ runClearTimeout(timeout);
216
+ }
217
+
218
+ process.nextTick = function (fun) {
219
+ var args = new Array(arguments.length - 1);
220
+ if (arguments.length > 1) {
221
+ for (var i = 1; i < arguments.length; i++) {
222
+ args[i - 1] = arguments[i];
223
+ }
224
+ }
225
+ queue.push(new Item(fun, args));
226
+ if (queue.length === 1 && !draining) {
227
+ runTimeout(drainQueue);
228
+ }
229
+ };
230
+
231
+ // v8 likes predictible objects
232
+ function Item(fun, array) {
233
+ this.fun = fun;
234
+ this.array = array;
235
+ }
236
+ Item.prototype.run = function () {
237
+ this.fun.apply(null, this.array);
238
+ };
239
+ process.title = 'browser';
240
+ process.browser = true;
241
+ process.env = {};
242
+ process.argv = [];
243
+ process.version = ''; // empty string to avoid regexp issues
244
+ process.versions = {};
245
+
246
+ function noop() {}
247
+
248
+ process.on = noop;
249
+ process.addListener = noop;
250
+ process.once = noop;
251
+ process.off = noop;
252
+ process.removeListener = noop;
253
+ process.removeAllListeners = noop;
254
+ process.emit = noop;
255
+ process.prependListener = noop;
256
+ process.prependOnceListener = noop;
257
+
258
+ process.listeners = function (name) { return [] }
259
+
260
+ process.binding = function (name) {
261
+ throw new Error('process.binding is not supported');
262
+ };
263
+
264
+ process.cwd = function () { return '/' };
265
+ process.chdir = function (dir) {
266
+ throw new Error('process.chdir is not supported');
267
+ };
268
+ process.umask = function() { return 0; };
269
 
270
 
271
  /***/ }),
272
  /* 2 */
273
  /***/ (function(module, exports, __webpack_require__) {
274
 
275
+ /* WEBPACK VAR INJECTION */(function(process) {/**
276
+ * Copyright (c) 2013-present, Facebook, Inc.
277
+ *
278
+ * This source code is licensed under the MIT license found in the
279
+ * LICENSE file in the root directory of this source tree.
280
+ */
281
+
282
+ if (process.env.NODE_ENV !== 'production') {
283
+ var ReactIs = __webpack_require__(14);
284
+
285
+ // By explicitly using `prop-types` you are opting into new development behavior.
286
+ // http://fb.me/prop-types-in-prod
287
+ var throwOnDirectAccess = true;
288
+ module.exports = __webpack_require__(309)(ReactIs.isElement, throwOnDirectAccess);
289
+ } else {
290
+ // By explicitly using `prop-types` you are opting into new production behavior.
291
+ // http://fb.me/prop-types-in-prod
292
+ module.exports = __webpack_require__(310)();
293
+ }
294
 
295
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
296
 
300
 
301
  "use strict";
302
  /* harmony export (immutable) */ __webpack_exports__["a"] = _extends;
303
+ function _extends() {
304
+ _extends = Object.assign || function (target) {
305
+ for (var i = 1; i < arguments.length; i++) {
306
+ var source = arguments[i];
307
+
308
+ for (var key in source) {
309
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
310
+ target[key] = source[key];
311
+ }
312
+ }
313
+ }
314
+
315
+ return target;
316
+ };
317
+
318
+ return _extends.apply(this, arguments);
319
  }
320
 
321
  /***/ }),
325
  "use strict";
326
  /* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutProperties;
327
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__objectWithoutPropertiesLoose__ = __webpack_require__(25);
328
+
329
+ function _objectWithoutProperties(source, excluded) {
330
+ if (source == null) return {};
331
+ var target = Object(__WEBPACK_IMPORTED_MODULE_0__objectWithoutPropertiesLoose__["a" /* default */])(source, excluded);
332
+ var key, i;
333
+
334
+ if (Object.getOwnPropertySymbols) {
335
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
336
+
337
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
338
+ key = sourceSymbolKeys[i];
339
+ if (excluded.indexOf(key) >= 0) continue;
340
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
341
+ target[key] = source[key];
342
+ }
343
+ }
344
+
345
+ return target;
346
  }
347
 
348
  /***/ }),
524
  /***/ (function(module, exports, __webpack_require__) {
525
 
526
  "use strict";
527
+ /* WEBPACK VAR INJECTION */(function(process) {
528
+
529
+ function checkDCE() {
530
+ /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
531
+ if (
532
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
533
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
534
+ ) {
535
+ return;
536
+ }
537
+ if (process.env.NODE_ENV !== 'production') {
538
+ // This branch is unreachable because this function is only called
539
+ // in production, but the condition is true only in development.
540
+ // Therefore if the branch is still here, dead code elimination wasn't
541
+ // properly applied.
542
+ // Don't change the message. React DevTools relies on it. Also make sure
543
+ // this message doesn't occur elsewhere in this function, or it will cause
544
+ // a false positive.
545
+ throw new Error('^_^');
546
+ }
547
+ try {
548
+ // Verify that the code above has been dead code eliminated (DCE'd).
549
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
550
+ } catch (err) {
551
+ // DevTools shouldn't crash React, no matter what.
552
+ // We should still report in case we break this code.
553
+ console.error(err);
554
+ }
555
+ }
556
+
557
+ if (process.env.NODE_ENV === 'production') {
558
+ // DCE check should happen before ReactDOM bundle executes so that
559
+ // DevTools can report bad minification during injection.
560
+ checkDCE();
561
+ module.exports = __webpack_require__(299);
562
+ } else {
563
+ module.exports = __webpack_require__(302);
564
+ }
565
 
566
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
567
 
600
 
601
  "use strict";
602
  /* harmony export (immutable) */ __webpack_exports__["a"] = _defineProperty;
603
+ function _defineProperty(obj, key, value) {
604
+ if (key in obj) {
605
+ Object.defineProperty(obj, key, {
606
+ value: value,
607
+ enumerable: true,
608
+ configurable: true,
609
+ writable: true
610
+ });
611
+ } else {
612
+ obj[key] = value;
613
+ }
614
+
615
+ return obj;
616
  }
617
 
618
  /***/ }),
645
  /***/ (function(module, exports, __webpack_require__) {
646
 
647
  "use strict";
648
+ /* WEBPACK VAR INJECTION */(function(process) {
649
+
650
+ if (process.env.NODE_ENV === 'production') {
651
+ module.exports = __webpack_require__(307);
652
+ } else {
653
+ module.exports = __webpack_require__(308);
654
+ }
655
 
656
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
657
 
1020
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__ = __webpack_require__(360);
1021
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArray__ = __webpack_require__(143);
1022
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nonIterableSpread__ = __webpack_require__(361);
1023
+
1024
+
1025
+
1026
+ function _toConsumableArray(arr) {
1027
+ return Object(__WEBPACK_IMPORTED_MODULE_0__arrayWithoutHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__iterableToArray__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_2__nonIterableSpread__["a" /* default */])();
1028
  }
1029
 
1030
  /***/ }),
1175
  /***/ (function(module, exports, __webpack_require__) {
1176
 
1177
  "use strict";
1178
+
1179
+ var strictUriEncode = __webpack_require__(332);
1180
+ var objectAssign = __webpack_require__(43);
1181
+
1182
+ function encoderForArrayFormat(opts) {
1183
+ switch (opts.arrayFormat) {
1184
+ case 'index':
1185
+ return function (key, value, index) {
1186
+ return value === null ? [
1187
+ encode(key, opts),
1188
+ '[',
1189
+ index,
1190
+ ']'
1191
+ ].join('') : [
1192
+ encode(key, opts),
1193
+ '[',
1194
+ encode(index, opts),
1195
+ ']=',
1196
+ encode(value, opts)
1197
+ ].join('');
1198
+ };
1199
+
1200
+ case 'bracket':
1201
+ return function (key, value) {
1202
+ return value === null ? encode(key, opts) : [
1203
+ encode(key, opts),
1204
+ '[]=',
1205
+ encode(value, opts)
1206
+ ].join('');
1207
+ };
1208
+
1209
+ default:
1210
+ return function (key, value) {
1211
+ return value === null ? encode(key, opts) : [
1212
+ encode(key, opts),
1213
+ '=',
1214
+ encode(value, opts)
1215
+ ].join('');
1216
+ };
1217
+ }
1218
+ }
1219
+
1220
+ function parserForArrayFormat(opts) {
1221
+ var result;
1222
+
1223
+ switch (opts.arrayFormat) {
1224
+ case 'index':
1225
+ return function (key, value, accumulator) {
1226
+ result = /\[(\d*)\]$/.exec(key);
1227
+
1228
+ key = key.replace(/\[\d*\]$/, '');
1229
+
1230
+ if (!result) {
1231
+ accumulator[key] = value;
1232
+ return;
1233
+ }
1234
+
1235
+ if (accumulator[key] === undefined) {
1236
+ accumulator[key] = {};
1237
+ }
1238
+
1239
+ accumulator[key][result[1]] = value;
1240
+ };
1241
+
1242
+ case 'bracket':
1243
+ return function (key, value, accumulator) {
1244
+ result = /(\[\])$/.exec(key);
1245
+ key = key.replace(/\[\]$/, '');
1246
+
1247
+ if (!result) {
1248
+ accumulator[key] = value;
1249
+ return;
1250
+ } else if (accumulator[key] === undefined) {
1251
+ accumulator[key] = [value];
1252
+ return;
1253
+ }
1254
+
1255
+ accumulator[key] = [].concat(accumulator[key], value);
1256
+ };
1257
+
1258
+ default:
1259
+ return function (key, value, accumulator) {
1260
+ if (accumulator[key] === undefined) {
1261
+ accumulator[key] = value;
1262
+ return;
1263
+ }
1264
+
1265
+ accumulator[key] = [].concat(accumulator[key], value);
1266
+ };
1267
+ }
1268
+ }
1269
+
1270
+ function encode(value, opts) {
1271
+ if (opts.encode) {
1272
+ return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
1273
+ }
1274
+
1275
+ return value;
1276
+ }
1277
+
1278
+ function keysSorter(input) {
1279
+ if (Array.isArray(input)) {
1280
+ return input.sort();
1281
+ } else if (typeof input === 'object') {
1282
+ return keysSorter(Object.keys(input)).sort(function (a, b) {
1283
+ return Number(a) - Number(b);
1284
+ }).map(function (key) {
1285
+ return input[key];
1286
+ });
1287
+ }
1288
+
1289
+ return input;
1290
+ }
1291
+
1292
+ exports.extract = function (str) {
1293
+ return str.split('?')[1] || '';
1294
+ };
1295
+
1296
+ exports.parse = function (str, opts) {
1297
+ opts = objectAssign({arrayFormat: 'none'}, opts);
1298
+
1299
+ var formatter = parserForArrayFormat(opts);
1300
+
1301
+ // Create an object with no prototype
1302
+ // https://github.com/sindresorhus/query-string/issues/47
1303
+ var ret = Object.create(null);
1304
+
1305
+ if (typeof str !== 'string') {
1306
+ return ret;
1307
+ }
1308
+
1309
+ str = str.trim().replace(/^(\?|#|&)/, '');
1310
+
1311
+ if (!str) {
1312
+ return ret;
1313
+ }
1314
+
1315
+ str.split('&').forEach(function (param) {
1316
+ var parts = param.replace(/\+/g, ' ').split('=');
1317
+ // Firefox (pre 40) decodes `%3D` to `=`
1318
+ // https://github.com/sindresorhus/query-string/pull/37
1319
+ var key = parts.shift();
1320
+ var val = parts.length > 0 ? parts.join('=') : undefined;
1321
+
1322
+ // missing `=` should be `null`:
1323
+ // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
1324
+ val = val === undefined ? null : decodeURIComponent(val);
1325
+
1326
+ formatter(decodeURIComponent(key), val, ret);
1327
+ });
1328
+
1329
+ return Object.keys(ret).sort().reduce(function (result, key) {
1330
+ var val = ret[key];
1331
+ if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {
1332
+ // Sort object keys, not values
1333
+ result[key] = keysSorter(val);
1334
+ } else {
1335
+ result[key] = val;
1336
+ }
1337
+
1338
+ return result;
1339
+ }, Object.create(null));
1340
+ };
1341
+
1342
+ exports.stringify = function (obj, opts) {
1343
+ var defaults = {
1344
+ encode: true,
1345
+ strict: true,
1346
+ arrayFormat: 'none'
1347
+ };
1348
+
1349
+ opts = objectAssign(defaults, opts);
1350
+
1351
+ var formatter = encoderForArrayFormat(opts);
1352
+
1353
+ return obj ? Object.keys(obj).sort().map(function (key) {
1354
+ var val = obj[key];
1355
+
1356
+ if (val === undefined) {
1357
+ return '';
1358
+ }
1359
+
1360
+ if (val === null) {
1361
+ return encode(key, opts);
1362
+ }
1363
+
1364
+ if (Array.isArray(val)) {
1365
+ var result = [];
1366
+
1367
+ val.slice().forEach(function (val2) {
1368
+ if (val2 === undefined) {
1369
+ return;
1370
+ }
1371
+
1372
+ result.push(formatter(key, val2, result.length));
1373
+ });
1374
+
1375
+ return result.join('&');
1376
+ }
1377
+
1378
+ return encode(key, opts) + '=' + encode(val, opts);
1379
+ }).filter(function (x) {
1380
+ return x.length > 0;
1381
+ }).join('&') : '';
1382
+ };
1383
 
1384
 
1385
  /***/ }),
1398
 
1399
  "use strict";
1400
  /* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutPropertiesLoose;
1401
+ function _objectWithoutPropertiesLoose(source, excluded) {
1402
+ if (source == null) return {};
1403
+ var target = {};
1404
+ var sourceKeys = Object.keys(source);
1405
+ var key, i;
1406
+
1407
+ for (i = 0; i < sourceKeys.length; i++) {
1408
+ key = sourceKeys[i];
1409
+ if (excluded.indexOf(key) >= 0) continue;
1410
+ target[key] = source[key];
1411
+ }
1412
+
1413
+ return target;
1414
  }
1415
 
1416
  /***/ }),
1419
 
1420
  "use strict";
1421
  /* harmony export (immutable) */ __webpack_exports__["a"] = _inheritsLoose;
1422
+ function _inheritsLoose(subClass, superClass) {
1423
+ subClass.prototype = Object.create(superClass.prototype);
1424
+ subClass.prototype.constructor = subClass;
1425
+ subClass.__proto__ = superClass;
1426
  }
1427
 
1428
  /***/ }),
1505
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__arrayWithHoles__ = __webpack_require__(171);
1506
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__iterableToArrayLimit__ = __webpack_require__(383);
1507
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__nonIterableRest__ = __webpack_require__(172);
1508
+
1509
+
1510
+
1511
+ function _slicedToArray(arr, i) {
1512
+ return Object(__WEBPACK_IMPORTED_MODULE_0__arrayWithHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__iterableToArrayLimit__["a" /* default */])(arr, i) || Object(__WEBPACK_IMPORTED_MODULE_2__nonIterableRest__["a" /* default */])();
1513
  }
1514
 
1515
  /***/ }),
1748
  /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "matchPath", function() { return __WEBPACK_IMPORTED_MODULE_12__matchPath__["a"]; });
1749
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__withRouter__ = __webpack_require__(329);
1750
  /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withRouter", function() { return __WEBPACK_IMPORTED_MODULE_13__withRouter__["a"]; });
1751
+
1752
+
1753
+
1754
+
1755
+
1756
+
1757
+
1758
+
1759
+
1760
+
1761
+
1762
+
1763
+
1764
+
1765
+
1766
+
1767
+
1768
+
1769
+
1770
+
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+
1777
+
1778
 
1779
 
1780
  /***/ }),
1782
  /***/ (function(module, exports, __webpack_require__) {
1783
 
1784
  "use strict";
1785
+ /* WEBPACK VAR INJECTION */(function(process) {/**
1786
+ * Copyright (c) 2014-present, Facebook, Inc.
1787
+ *
1788
+ * This source code is licensed under the MIT license found in the
1789
+ * LICENSE file in the root directory of this source tree.
1790
+ */
1791
+
1792
+
1793
+
1794
+ /**
1795
+ * Similar to invariant but only logs a warning if the condition is not met.
1796
+ * This can be used to log issues in development environments in critical
1797
+ * paths. Removing the logging code for production environments will keep the
1798
+ * same logic and follow the same code paths.
1799
+ */
1800
+
1801
+ var __DEV__ = process.env.NODE_ENV !== 'production';
1802
+
1803
+ var warning = function() {};
1804
+
1805
+ if (__DEV__) {
1806
+ var printWarning = function printWarning(format, args) {
1807
+ var len = arguments.length;
1808
+ args = new Array(len > 1 ? len - 1 : 0);
1809
+ for (var key = 1; key < len; key++) {
1810
+ args[key - 1] = arguments[key];
1811
+ }
1812
+ var argIndex = 0;
1813
+ var message = 'Warning: ' +
1814
+ format.replace(/%s/g, function() {
1815
+ return args[argIndex++];
1816
+ });
1817
+ if (typeof console !== 'undefined') {
1818
+ console.error(message);
1819
+ }
1820
+ try {
1821
+ // --- Welcome to debugging React ---
1822
+ // This error was thrown as a convenience so that you can use this stack
1823
+ // to find the callsite that caused this warning to fire.
1824
+ throw new Error(message);
1825
+ } catch (x) {}
1826
+ }
1827
+
1828
+ warning = function(condition, format, args) {
1829
+ var len = arguments.length;
1830
+ args = new Array(len > 2 ? len - 2 : 0);
1831
+ for (var key = 2; key < len; key++) {
1832
+ args[key - 2] = arguments[key];
1833
+ }
1834
+ if (format === undefined) {
1835
+ throw new Error(
1836
+ '`warning(condition, format, ...args)` requires a warning ' +
1837
+ 'message argument'
1838
+ );
1839
+ }
1840
+ if (!condition) {
1841
+ printWarning.apply(null, [format].concat(args));
1842
+ }
1843
+ };
1844
+ }
1845
+
1846
+ module.exports = warning;
1847
 
1848
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
1849
 
1852
  /***/ (function(module, exports, __webpack_require__) {
1853
 
1854
  "use strict";
1855
+ /* WEBPACK VAR INJECTION */(function(process) {/**
1856
+ * Copyright (c) 2013-present, Facebook, Inc.
1857
+ *
1858
+ * This source code is licensed under the MIT license found in the
1859
+ * LICENSE file in the root directory of this source tree.
1860
+ */
1861
+
1862
+
1863
+
1864
+ /**
1865
+ * Use invariant() to assert state which your program assumes to be true.
1866
+ *
1867
+ * Provide sprintf-style format (only %s is supported) and arguments
1868
+ * to provide information about what broke and what you were
1869
+ * expecting.
1870
+ *
1871
+ * The invariant message will be stripped in production, but the invariant
1872
+ * will remain to ensure logic does not differ in production.
1873
+ */
1874
+
1875
+ var invariant = function(condition, format, a, b, c, d, e, f) {
1876
+ if (process.env.NODE_ENV !== 'production') {
1877
+ if (format === undefined) {
1878
+ throw new Error('invariant requires an error message argument');
1879
+ }
1880
+ }
1881
+
1882
+ if (!condition) {
1883
+ var error;
1884
+ if (format === undefined) {
1885
+ error = new Error(
1886
+ 'Minified exception occurred; use the non-minified dev environment ' +
1887
+ 'for the full error message and additional helpful warnings.'
1888
+ );
1889
+ } else {
1890
+ var args = [a, b, c, d, e, f];
1891
+ var argIndex = 0;
1892
+ error = new Error(
1893
+ format.replace(/%s/g, function() { return args[argIndex++]; })
1894
+ );
1895
+ error.name = 'Invariant Violation';
1896
+ }
1897
+
1898
+ error.framesToPop = 1; // we don't care about invariant's own frame
1899
+ throw error;
1900
+ }
1901
+ };
1902
+
1903
+ module.exports = invariant;
1904
 
1905
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
1906
 
1910
 
1911
  "use strict";
1912
  /* harmony export (immutable) */ __webpack_exports__["a"] = _typeof;
1913
+ function _typeof(obj) {
1914
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1915
+ _typeof = function _typeof(obj) {
1916
+ return typeof obj;
1917
+ };
1918
+ } else {
1919
+ _typeof = function _typeof(obj) {
1920
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
1921
+ };
1922
+ }
1923
+
1924
+ return _typeof(obj);
1925
  }
1926
 
1927
  /***/ }),
4301
  /***/ (function(module, exports, __webpack_require__) {
4302
 
4303
  "use strict";
4304
+ /*
4305
+ object-assign
4306
+ (c) Sindre Sorhus
4307
+ @license MIT
4308
+ */
4309
+
4310
+
4311
+ /* eslint-disable no-unused-vars */
4312
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
4313
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
4314
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
4315
+
4316
+ function toObject(val) {
4317
+ if (val === null || val === undefined) {
4318
+ throw new TypeError('Object.assign cannot be called with null or undefined');
4319
+ }
4320
+
4321
+ return Object(val);
4322
+ }
4323
+
4324
+ function shouldUseNative() {
4325
+ try {
4326
+ if (!Object.assign) {
4327
+ return false;
4328
+ }
4329
+
4330
+ // Detect buggy property enumeration order in older V8 versions.
4331
+
4332
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
4333
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
4334
+ test1[5] = 'de';
4335
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
4336
+ return false;
4337
+ }
4338
+
4339
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4340
+ var test2 = {};
4341
+ for (var i = 0; i < 10; i++) {
4342
+ test2['_' + String.fromCharCode(i)] = i;
4343
+ }
4344
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
4345
+ return test2[n];
4346
+ });
4347
+ if (order2.join('') !== '0123456789') {
4348
+ return false;
4349
+ }
4350
+
4351
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
4352
+ var test3 = {};
4353
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
4354
+ test3[letter] = letter;
4355
+ });
4356
+ if (Object.keys(Object.assign({}, test3)).join('') !==
4357
+ 'abcdefghijklmnopqrst') {
4358
+ return false;
4359
+ }
4360
+
4361
+ return true;
4362
+ } catch (err) {
4363
+ // We don't expect any of the above to throw, but better to be safe.
4364
+ return false;
4365
+ }
4366
+ }
4367
+
4368
+ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
4369
+ var from;
4370
+ var to = toObject(target);
4371
+ var symbols;
4372
+
4373
+ for (var s = 1; s < arguments.length; s++) {
4374
+ from = Object(arguments[s]);
4375
+
4376
+ for (var key in from) {
4377
+ if (hasOwnProperty.call(from, key)) {
4378
+ to[key] = from[key];
4379
+ }
4380
+ }
4381
+
4382
+ if (getOwnPropertySymbols) {
4383
+ symbols = getOwnPropertySymbols(from);
4384
+ for (var i = 0; i < symbols.length; i++) {
4385
+ if (propIsEnumerable.call(from, symbols[i])) {
4386
+ to[symbols[i]] = from[symbols[i]];
4387
+ }
4388
+ }
4389
+ }
4390
+ }
4391
+
4392
+ return to;
4393
+ };
4394
 
4395
 
4396
  /***/ }),
4410
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_value_equal__ = __webpack_require__(312);
4411
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_tiny_warning__ = __webpack_require__(64);
4412
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tiny_invariant__ = __webpack_require__(313);
4413
+
4414
+
4415
+
4416
+
4417
+
4418
+
4419
+ function addLeadingSlash(path) {
4420
+ return path.charAt(0) === '/' ? path : '/' + path;
4421
+ }
4422
+ function stripLeadingSlash(path) {
4423
+ return path.charAt(0) === '/' ? path.substr(1) : path;
4424
+ }
4425
+ function hasBasename(path, prefix) {
4426
+ return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
4427
+ }
4428
+ function stripBasename(path, prefix) {
4429
+ return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
4430
+ }
4431
+ function stripTrailingSlash(path) {
4432
+ return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
4433
+ }
4434
+ function parsePath(path) {
4435
+ var pathname = path || '/';
4436
+ var search = '';
4437
+ var hash = '';
4438
+ var hashIndex = pathname.indexOf('#');
4439
+
4440
+ if (hashIndex !== -1) {
4441
+ hash = pathname.substr(hashIndex);
4442
+ pathname = pathname.substr(0, hashIndex);
4443
+ }
4444
+
4445
+ var searchIndex = pathname.indexOf('?');
4446
+
4447
+ if (searchIndex !== -1) {
4448
+ search = pathname.substr(searchIndex);
4449
+ pathname = pathname.substr(0, searchIndex);
4450
+ }
4451
+
4452
+ return {
4453
+ pathname: pathname,
4454
+ search: search === '?' ? '' : search,
4455
+ hash: hash === '#' ? '' : hash
4456
+ };
4457
+ }
4458
+ function createPath(location) {
4459
+ var pathname = location.pathname,
4460
+ search = location.search,
4461
+ hash = location.hash;
4462
+ var path = pathname || '/';
4463
+ if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
4464
+ if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
4465
+ return path;
4466
+ }
4467
+
4468
+ function createLocation(path, state, key, currentLocation) {
4469
+ var location;
4470
+
4471
+ if (typeof path === 'string') {
4472
+ // Two-arg form: push(path, state)
4473
+ location = parsePath(path);
4474
+ location.state = state;
4475
+ } else {
4476
+ // One-arg form: push(location)
4477
+ location = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, path);
4478
+ if (location.pathname === undefined) location.pathname = '';
4479
+
4480
+ if (location.search) {
4481
+ if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
4482
+ } else {
4483
+ location.search = '';
4484
+ }
4485
+
4486
+ if (location.hash) {
4487
+ if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
4488
+ } else {
4489
+ location.hash = '';
4490
+ }
4491
+
4492
+ if (state !== undefined && location.state === undefined) location.state = state;
4493
+ }
4494
+
4495
+ try {
4496
+ location.pathname = decodeURI(location.pathname);
4497
+ } catch (e) {
4498
+ if (e instanceof URIError) {
4499
+ throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
4500
+ } else {
4501
+ throw e;
4502
+ }
4503
+ }
4504
+
4505
+ if (key) location.key = key;
4506
+
4507
+ if (currentLocation) {
4508
+ // Resolve incomplete/relative pathname relative to current location.
4509
+ if (!location.pathname) {
4510
+ location.pathname = currentLocation.pathname;
4511
+ } else if (location.pathname.charAt(0) !== '/') {
4512
+ location.pathname = Object(__WEBPACK_IMPORTED_MODULE_1_resolve_pathname__["a" /* default */])(location.pathname, currentLocation.pathname);
4513
+ }
4514
+ } else {
4515
+ // When there is no prior location and pathname is empty, set it to /
4516
+ if (!location.pathname) {
4517
+ location.pathname = '/';
4518
+ }
4519
+ }
4520
+
4521
+ return location;
4522
+ }
4523
+ function locationsAreEqual(a, b) {
4524
+ return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && Object(__WEBPACK_IMPORTED_MODULE_2_value_equal__["a" /* default */])(a.state, b.state);
4525
+ }
4526
+
4527
+ function createTransitionManager() {
4528
+ var prompt = null;
4529
+
4530
+ function setPrompt(nextPrompt) {
4531
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(prompt == null, 'A history supports only one prompt at a time') : void 0;
4532
+ prompt = nextPrompt;
4533
+ return function () {
4534
+ if (prompt === nextPrompt) prompt = null;
4535
+ };
4536
+ }
4537
+
4538
+ function confirmTransitionTo(location, action, getUserConfirmation, callback) {
4539
+ // TODO: If another transition starts while we're still confirming
4540
+ // the previous one, we may end up in a weird state. Figure out the
4541
+ // best way to handle this.
4542
+ if (prompt != null) {
4543
+ var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
4544
+
4545
+ if (typeof result === 'string') {
4546
+ if (typeof getUserConfirmation === 'function') {
4547
+ getUserConfirmation(result, callback);
4548
+ } else {
4549
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;
4550
+ callback(true);
4551
+ }
4552
+ } else {
4553
+ // Return false from a transition hook to cancel the transition.
4554
+ callback(result !== false);
4555
+ }
4556
+ } else {
4557
+ callback(true);
4558
+ }
4559
+ }
4560
+
4561
+ var listeners = [];
4562
+
4563
+ function appendListener(fn) {
4564
+ var isActive = true;
4565
+
4566
+ function listener() {
4567
+ if (isActive) fn.apply(void 0, arguments);
4568
+ }
4569
+
4570
+ listeners.push(listener);
4571
+ return function () {
4572
+ isActive = false;
4573
+ listeners = listeners.filter(function (item) {
4574
+ return item !== listener;
4575
+ });
4576
+ };
4577
+ }
4578
+
4579
+ function notifyListeners() {
4580
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4581
+ args[_key] = arguments[_key];
4582
+ }
4583
+
4584
+ listeners.forEach(function (listener) {
4585
+ return listener.apply(void 0, args);
4586
+ });
4587
+ }
4588
+
4589
+ return {
4590
+ setPrompt: setPrompt,
4591
+ confirmTransitionTo: confirmTransitionTo,
4592
+ appendListener: appendListener,
4593
+ notifyListeners: notifyListeners
4594
+ };
4595
+ }
4596
+
4597
+ var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
4598
+ function getConfirmation(message, callback) {
4599
+ callback(window.confirm(message)); // eslint-disable-line no-alert
4600
+ }
4601
+ /**
4602
+ * Returns true if the HTML5 history API is supported. Taken from Modernizr.
4603
+ *
4604
+ * https://github.com/Modernizr/Modernizr/blob/master/LICENSE
4605
+ * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
4606
+ * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
4607
+ */
4608
+
4609
+ function supportsHistory() {
4610
+ var ua = window.navigator.userAgent;
4611
+ if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
4612
+ return window.history && 'pushState' in window.history;
4613
+ }
4614
+ /**
4615
+ * Returns true if browser fires popstate on hash change.
4616
+ * IE10 and IE11 do not.
4617
+ */
4618
+
4619
+ function supportsPopStateOnHashChange() {
4620
+ return window.navigator.userAgent.indexOf('Trident') === -1;
4621
+ }
4622
+ /**
4623
+ * Returns false if using go(n) with hash history causes a full page reload.
4624
+ */
4625
+
4626
+ function supportsGoWithoutReloadUsingHash() {
4627
+ return window.navigator.userAgent.indexOf('Firefox') === -1;
4628
+ }
4629
+ /**
4630
+ * Returns true if a given popstate event is an extraneous WebKit event.
4631
+ * Accounts for the fact that Chrome on iOS fires real popstate events
4632
+ * containing undefined state when pressing the back button.
4633
+ */
4634
+
4635
+ function isExtraneousPopstateEvent(event) {
4636
+ return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
4637
+ }
4638
+
4639
+ var PopStateEvent = 'popstate';
4640
+ var HashChangeEvent = 'hashchange';
4641
+
4642
+ function getHistoryState() {
4643
+ try {
4644
+ return window.history.state || {};
4645
+ } catch (e) {
4646
+ // IE 11 sometimes throws when accessing window.history.state
4647
+ // See https://github.com/ReactTraining/history/pull/289
4648
+ return {};
4649
+ }
4650
+ }
4651
+ /**
4652
+ * Creates a history object that uses the HTML5 history API including
4653
+ * pushState, replaceState, and the popstate event.
4654
+ */
4655
+
4656
+
4657
+ function createBrowserHistory(props) {
4658
+ if (props === void 0) {
4659
+ props = {};
4660
+ }
4661
+
4662
+ !canUseDOM ? process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false, 'Browser history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
4663
+ var globalHistory = window.history;
4664
+ var canUseHistory = supportsHistory();
4665
+ var needsHashChangeListener = !supportsPopStateOnHashChange();
4666
+ var _props = props,
4667
+ _props$forceRefresh = _props.forceRefresh,
4668
+ forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
4669
+ _props$getUserConfirm = _props.getUserConfirmation,
4670
+ getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
4671
+ _props$keyLength = _props.keyLength,
4672
+ keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
4673
+ var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
4674
+
4675
+ function getDOMLocation(historyState) {
4676
+ var _ref = historyState || {},
4677
+ key = _ref.key,
4678
+ state = _ref.state;
4679
+
4680
+ var _window$location = window.location,
4681
+ pathname = _window$location.pathname,
4682
+ search = _window$location.search,
4683
+ hash = _window$location.hash;
4684
+ var path = pathname + search + hash;
4685
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
4686
+ if (basename) path = stripBasename(path, basename);
4687
+ return createLocation(path, state, key);
4688
+ }
4689
+
4690
+ function createKey() {
4691
+ return Math.random().toString(36).substr(2, keyLength);
4692
+ }
4693
+
4694
+ var transitionManager = createTransitionManager();
4695
+
4696
+ function setState(nextState) {
4697
+ Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);
4698
+
4699
+ history.length = globalHistory.length;
4700
+ transitionManager.notifyListeners(history.location, history.action);
4701
+ }
4702
+
4703
+ function handlePopState(event) {
4704
+ // Ignore extraneous popstate events in WebKit.
4705
+ if (isExtraneousPopstateEvent(event)) return;
4706
+ handlePop(getDOMLocation(event.state));
4707
+ }
4708
+
4709
+ function handleHashChange() {
4710
+ handlePop(getDOMLocation(getHistoryState()));
4711
+ }
4712
+
4713
+ var forceNextPop = false;
4714
+
4715
+ function handlePop(location) {
4716
+ if (forceNextPop) {
4717
+ forceNextPop = false;
4718
+ setState();
4719
+ } else {
4720
+ var action = 'POP';
4721
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
4722
+ if (ok) {
4723
+ setState({
4724
+ action: action,
4725
+ location: location
4726
+ });
4727
+ } else {
4728
+ revertPop(location);
4729
+ }
4730
+ });
4731
+ }
4732
+ }
4733
+
4734
+ function revertPop(fromLocation) {
4735
+ var toLocation = history.location; // TODO: We could probably make this more reliable by
4736
+ // keeping a list of keys we've seen in sessionStorage.
4737
+ // Instead, we just default to 0 for keys we don't know.
4738
+
4739
+ var toIndex = allKeys.indexOf(toLocation.key);
4740
+ if (toIndex === -1) toIndex = 0;
4741
+ var fromIndex = allKeys.indexOf(fromLocation.key);
4742
+ if (fromIndex === -1) fromIndex = 0;
4743
+ var delta = toIndex - fromIndex;
4744
+
4745
+ if (delta) {
4746
+ forceNextPop = true;
4747
+ go(delta);
4748
+ }
4749
+ }
4750
+
4751
+ var initialLocation = getDOMLocation(getHistoryState());
4752
+ var allKeys = [initialLocation.key]; // Public interface
4753
+
4754
+ function createHref(location) {
4755
+ return basename + createPath(location);
4756
+ }
4757
+
4758
+ function push(path, state) {
4759
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
4760
+ var action = 'PUSH';
4761
+ var location = createLocation(path, state, createKey(), history.location);
4762
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
4763
+ if (!ok) return;
4764
+ var href = createHref(location);
4765
+ var key = location.key,
4766
+ state = location.state;
4767
+
4768
+ if (canUseHistory) {
4769
+ globalHistory.pushState({
4770
+ key: key,
4771
+ state: state
4772
+ }, null, href);
4773
+
4774
+ if (forceRefresh) {
4775
+ window.location.href = href;
4776
+ } else {
4777
+ var prevIndex = allKeys.indexOf(history.location.key);
4778
+ var nextKeys = allKeys.slice(0, prevIndex + 1);
4779
+ nextKeys.push(location.key);
4780
+ allKeys = nextKeys;
4781
+ setState({
4782
+ action: action,
4783
+ location: location
4784
+ });
4785
+ }
4786
+ } else {
4787
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;
4788
+ window.location.href = href;
4789
+ }
4790
+ });
4791
+ }
4792
+
4793
+ function replace(path, state) {
4794
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
4795
+ var action = 'REPLACE';
4796
+ var location = createLocation(path, state, createKey(), history.location);
4797
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
4798
+ if (!ok) return;
4799
+ var href = createHref(location);
4800
+ var key = location.key,
4801
+ state = location.state;
4802
+
4803
+ if (canUseHistory) {
4804
+ globalHistory.replaceState({
4805
+ key: key,
4806
+ state: state
4807
+ }, null, href);
4808
+
4809
+ if (forceRefresh) {
4810
+ window.location.replace(href);
4811
+ } else {
4812
+ var prevIndex = allKeys.indexOf(history.location.key);
4813
+ if (prevIndex !== -1) allKeys[prevIndex] = location.key;
4814
+ setState({
4815
+ action: action,
4816
+ location: location
4817
+ });
4818
+ }
4819
+ } else {
4820
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;
4821
+ window.location.replace(href);
4822
+ }
4823
+ });
4824
+ }
4825
+
4826
+ function go(n) {
4827
+ globalHistory.go(n);
4828
+ }
4829
+
4830
+ function goBack() {
4831
+ go(-1);
4832
+ }
4833
+
4834
+ function goForward() {
4835
+ go(1);
4836
+ }
4837
+
4838
+ var listenerCount = 0;
4839
+
4840
+ function checkDOMListeners(delta) {
4841
+ listenerCount += delta;
4842
+
4843
+ if (listenerCount === 1 && delta === 1) {
4844
+ window.addEventListener(PopStateEvent, handlePopState);
4845
+ if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
4846
+ } else if (listenerCount === 0) {
4847
+ window.removeEventListener(PopStateEvent, handlePopState);
4848
+ if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
4849
+ }
4850
+ }
4851
+
4852
+ var isBlocked = false;
4853
+
4854
+ function block(prompt) {
4855
+ if (prompt === void 0) {
4856
+ prompt = false;
4857
+ }
4858
+
4859
+ var unblock = transitionManager.setPrompt(prompt);
4860
+
4861
+ if (!isBlocked) {
4862
+ checkDOMListeners(1);
4863
+ isBlocked = true;
4864
+ }
4865
+
4866
+ return function () {
4867
+ if (isBlocked) {
4868
+ isBlocked = false;
4869
+ checkDOMListeners(-1);
4870
+ }
4871
+
4872
+ return unblock();
4873
+ };
4874
+ }
4875
+
4876
+ function listen(listener) {
4877
+ var unlisten = transitionManager.appendListener(listener);
4878
+ checkDOMListeners(1);
4879
+ return function () {
4880
+ checkDOMListeners(-1);
4881
+ unlisten();
4882
+ };
4883
+ }
4884
+
4885
+ var history = {
4886
+ length: globalHistory.length,
4887
+ action: 'POP',
4888
+ location: initialLocation,
4889
+ createHref: createHref,
4890
+ push: push,
4891
+ replace: replace,
4892
+ go: go,
4893
+ goBack: goBack,
4894
+ goForward: goForward,
4895
+ block: block,
4896
+ listen: listen
4897
+ };
4898
+ return history;
4899
+ }
4900
+
4901
+ var HashChangeEvent$1 = 'hashchange';
4902
+ var HashPathCoders = {
4903
+ hashbang: {
4904
+ encodePath: function encodePath(path) {
4905
+ return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
4906
+ },
4907
+ decodePath: function decodePath(path) {
4908
+ return path.charAt(0) === '!' ? path.substr(1) : path;
4909
+ }
4910
+ },
4911
+ noslash: {
4912
+ encodePath: stripLeadingSlash,
4913
+ decodePath: addLeadingSlash
4914
+ },
4915
+ slash: {
4916
+ encodePath: addLeadingSlash,
4917
+ decodePath: addLeadingSlash
4918
+ }
4919
+ };
4920
+
4921
+ function stripHash(url) {
4922
+ var hashIndex = url.indexOf('#');
4923
+ return hashIndex === -1 ? url : url.slice(0, hashIndex);
4924
+ }
4925
+
4926
+ function getHashPath() {
4927
+ // We can't use window.location.hash here because it's not
4928
+ // consistent across browsers - Firefox will pre-decode it!
4929
+ var href = window.location.href;
4930
+ var hashIndex = href.indexOf('#');
4931
+ return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
4932
+ }
4933
+
4934
+ function pushHashPath(path) {
4935
+ window.location.hash = path;
4936
+ }
4937
+
4938
+ function replaceHashPath(path) {
4939
+ window.location.replace(stripHash(window.location.href) + '#' + path);
4940
+ }
4941
+
4942
+ function createHashHistory(props) {
4943
+ if (props === void 0) {
4944
+ props = {};
4945
+ }
4946
+
4947
+ !canUseDOM ? process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false, 'Hash history needs a DOM') : Object(__WEBPACK_IMPORTED_MODULE_4_tiny_invariant__["a" /* default */])(false) : void 0;
4948
+ var globalHistory = window.history;
4949
+ var canGoWithoutReload = supportsGoWithoutReloadUsingHash();
4950
+ var _props = props,
4951
+ _props$getUserConfirm = _props.getUserConfirmation,
4952
+ getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
4953
+ _props$hashType = _props.hashType,
4954
+ hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
4955
+ var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
4956
+ var _HashPathCoders$hashT = HashPathCoders[hashType],
4957
+ encodePath = _HashPathCoders$hashT.encodePath,
4958
+ decodePath = _HashPathCoders$hashT.decodePath;
4959
+
4960
+ function getDOMLocation() {
4961
+ var path = decodePath(getHashPath());
4962
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".') : void 0;
4963
+ if (basename) path = stripBasename(path, basename);
4964
+ return createLocation(path);
4965
+ }
4966
+
4967
+ var transitionManager = createTransitionManager();
4968
+
4969
+ function setState(nextState) {
4970
+ Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);
4971
+
4972
+ history.length = globalHistory.length;
4973
+ transitionManager.notifyListeners(history.location, history.action);
4974
+ }
4975
+
4976
+ var forceNextPop = false;
4977
+ var ignorePath = null;
4978
+
4979
+ function locationsAreEqual$$1(a, b) {
4980
+ return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
4981
+ }
4982
+
4983
+ function handleHashChange() {
4984
+ var path = getHashPath();
4985
+ var encodedPath = encodePath(path);
4986
+
4987
+ if (path !== encodedPath) {
4988
+ // Ensure we always have a properly-encoded hash.
4989
+ replaceHashPath(encodedPath);
4990
+ } else {
4991
+ var location = getDOMLocation();
4992
+ var prevLocation = history.location;
4993
+ if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
4994
+
4995
+ if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
4996
+
4997
+ ignorePath = null;
4998
+ handlePop(location);
4999
+ }
5000
+ }
5001
+
5002
+ function handlePop(location) {
5003
+ if (forceNextPop) {
5004
+ forceNextPop = false;
5005
+ setState();
5006
+ } else {
5007
+ var action = 'POP';
5008
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5009
+ if (ok) {
5010
+ setState({
5011
+ action: action,
5012
+ location: location
5013
+ });
5014
+ } else {
5015
+ revertPop(location);
5016
+ }
5017
+ });
5018
+ }
5019
+ }
5020
+
5021
+ function revertPop(fromLocation) {
5022
+ var toLocation = history.location; // TODO: We could probably make this more reliable by
5023
+ // keeping a list of paths we've seen in sessionStorage.
5024
+ // Instead, we just default to 0 for paths we don't know.
5025
+
5026
+ var toIndex = allPaths.lastIndexOf(createPath(toLocation));
5027
+ if (toIndex === -1) toIndex = 0;
5028
+ var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
5029
+ if (fromIndex === -1) fromIndex = 0;
5030
+ var delta = toIndex - fromIndex;
5031
+
5032
+ if (delta) {
5033
+ forceNextPop = true;
5034
+ go(delta);
5035
+ }
5036
+ } // Ensure the hash is encoded properly before doing anything else.
5037
+
5038
+
5039
+ var path = getHashPath();
5040
+ var encodedPath = encodePath(path);
5041
+ if (path !== encodedPath) replaceHashPath(encodedPath);
5042
+ var initialLocation = getDOMLocation();
5043
+ var allPaths = [createPath(initialLocation)]; // Public interface
5044
+
5045
+ function createHref(location) {
5046
+ var baseTag = document.querySelector('base');
5047
+ var href = '';
5048
+
5049
+ if (baseTag && baseTag.getAttribute('href')) {
5050
+ href = stripHash(window.location.href);
5051
+ }
5052
+
5053
+ return href + '#' + encodePath(basename + createPath(location));
5054
+ }
5055
+
5056
+ function push(path, state) {
5057
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;
5058
+ var action = 'PUSH';
5059
+ var location = createLocation(path, undefined, undefined, history.location);
5060
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5061
+ if (!ok) return;
5062
+ var path = createPath(location);
5063
+ var encodedPath = encodePath(basename + path);
5064
+ var hashChanged = getHashPath() !== encodedPath;
5065
+
5066
+ if (hashChanged) {
5067
+ // We cannot tell if a hashchange was caused by a PUSH, so we'd
5068
+ // rather setState here and ignore the hashchange. The caveat here
5069
+ // is that other hash histories in the page will consider it a POP.
5070
+ ignorePath = path;
5071
+ pushHashPath(encodedPath);
5072
+ var prevIndex = allPaths.lastIndexOf(createPath(history.location));
5073
+ var nextPaths = allPaths.slice(0, prevIndex + 1);
5074
+ nextPaths.push(path);
5075
+ allPaths = nextPaths;
5076
+ setState({
5077
+ action: action,
5078
+ location: location
5079
+ });
5080
+ } else {
5081
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;
5082
+ setState();
5083
+ }
5084
+ });
5085
+ }
5086
+
5087
+ function replace(path, state) {
5088
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;
5089
+ var action = 'REPLACE';
5090
+ var location = createLocation(path, undefined, undefined, history.location);
5091
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5092
+ if (!ok) return;
5093
+ var path = createPath(location);
5094
+ var encodedPath = encodePath(basename + path);
5095
+ var hashChanged = getHashPath() !== encodedPath;
5096
+
5097
+ if (hashChanged) {
5098
+ // We cannot tell if a hashchange was caused by a REPLACE, so we'd
5099
+ // rather setState here and ignore the hashchange. The caveat here
5100
+ // is that other hash histories in the page will consider it a POP.
5101
+ ignorePath = path;
5102
+ replaceHashPath(encodedPath);
5103
+ }
5104
+
5105
+ var prevIndex = allPaths.indexOf(createPath(history.location));
5106
+ if (prevIndex !== -1) allPaths[prevIndex] = path;
5107
+ setState({
5108
+ action: action,
5109
+ location: location
5110
+ });
5111
+ });
5112
+ }
5113
+
5114
+ function go(n) {
5115
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;
5116
+ globalHistory.go(n);
5117
+ }
5118
+
5119
+ function goBack() {
5120
+ go(-1);
5121
+ }
5122
+
5123
+ function goForward() {
5124
+ go(1);
5125
+ }
5126
+
5127
+ var listenerCount = 0;
5128
+
5129
+ function checkDOMListeners(delta) {
5130
+ listenerCount += delta;
5131
+
5132
+ if (listenerCount === 1 && delta === 1) {
5133
+ window.addEventListener(HashChangeEvent$1, handleHashChange);
5134
+ } else if (listenerCount === 0) {
5135
+ window.removeEventListener(HashChangeEvent$1, handleHashChange);
5136
+ }
5137
+ }
5138
+
5139
+ var isBlocked = false;
5140
+
5141
+ function block(prompt) {
5142
+ if (prompt === void 0) {
5143
+ prompt = false;
5144
+ }
5145
+
5146
+ var unblock = transitionManager.setPrompt(prompt);
5147
+
5148
+ if (!isBlocked) {
5149
+ checkDOMListeners(1);
5150
+ isBlocked = true;
5151
+ }
5152
+
5153
+ return function () {
5154
+ if (isBlocked) {
5155
+ isBlocked = false;
5156
+ checkDOMListeners(-1);
5157
+ }
5158
+
5159
+ return unblock();
5160
+ };
5161
+ }
5162
+
5163
+ function listen(listener) {
5164
+ var unlisten = transitionManager.appendListener(listener);
5165
+ checkDOMListeners(1);
5166
+ return function () {
5167
+ checkDOMListeners(-1);
5168
+ unlisten();
5169
+ };
5170
+ }
5171
+
5172
+ var history = {
5173
+ length: globalHistory.length,
5174
+ action: 'POP',
5175
+ location: initialLocation,
5176
+ createHref: createHref,
5177
+ push: push,
5178
+ replace: replace,
5179
+ go: go,
5180
+ goBack: goBack,
5181
+ goForward: goForward,
5182
+ block: block,
5183
+ listen: listen
5184
+ };
5185
+ return history;
5186
+ }
5187
+
5188
+ function clamp(n, lowerBound, upperBound) {
5189
+ return Math.min(Math.max(n, lowerBound), upperBound);
5190
+ }
5191
+ /**
5192
+ * Creates a history object that stores locations in memory.
5193
+ */
5194
+
5195
+
5196
+ function createMemoryHistory(props) {
5197
+ if (props === void 0) {
5198
+ props = {};
5199
+ }
5200
+
5201
+ var _props = props,
5202
+ getUserConfirmation = _props.getUserConfirmation,
5203
+ _props$initialEntries = _props.initialEntries,
5204
+ initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
5205
+ _props$initialIndex = _props.initialIndex,
5206
+ initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
5207
+ _props$keyLength = _props.keyLength,
5208
+ keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
5209
+ var transitionManager = createTransitionManager();
5210
+
5211
+ function setState(nextState) {
5212
+ Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])(history, nextState);
5213
+
5214
+ history.length = history.entries.length;
5215
+ transitionManager.notifyListeners(history.location, history.action);
5216
+ }
5217
+
5218
+ function createKey() {
5219
+ return Math.random().toString(36).substr(2, keyLength);
5220
+ }
5221
+
5222
+ var index = clamp(initialIndex, 0, initialEntries.length - 1);
5223
+ var entries = initialEntries.map(function (entry) {
5224
+ return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
5225
+ }); // Public interface
5226
+
5227
+ var createHref = createPath;
5228
+
5229
+ function push(path, state) {
5230
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
5231
+ var action = 'PUSH';
5232
+ var location = createLocation(path, state, createKey(), history.location);
5233
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5234
+ if (!ok) return;
5235
+ var prevIndex = history.index;
5236
+ var nextIndex = prevIndex + 1;
5237
+ var nextEntries = history.entries.slice(0);
5238
+
5239
+ if (nextEntries.length > nextIndex) {
5240
+ nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
5241
+ } else {
5242
+ nextEntries.push(location);
5243
+ }
5244
+
5245
+ setState({
5246
+ action: action,
5247
+ location: location,
5248
+ index: nextIndex,
5249
+ entries: nextEntries
5250
+ });
5251
+ });
5252
+ }
5253
+
5254
+ function replace(path, state) {
5255
+ process.env.NODE_ENV !== "production" ? Object(__WEBPACK_IMPORTED_MODULE_3_tiny_warning__["a" /* default */])(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;
5256
+ var action = 'REPLACE';
5257
+ var location = createLocation(path, state, createKey(), history.location);
5258
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5259
+ if (!ok) return;
5260
+ history.entries[history.index] = location;
5261
+ setState({
5262
+ action: action,
5263
+ location: location
5264
+ });
5265
+ });
5266
+ }
5267
+
5268
+ function go(n) {
5269
+ var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
5270
+ var action = 'POP';
5271
+ var location = history.entries[nextIndex];
5272
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
5273
+ if (ok) {
5274
+ setState({
5275
+ action: action,
5276
+ location: location,
5277
+ index: nextIndex
5278
+ });
5279
+ } else {
5280
+ // Mimic the behavior of DOM histories by
5281
+ // causing a render after a cancelled POP.
5282
+ setState();
5283
+ }
5284
+ });
5285
+ }
5286
+
5287
+ function goBack() {
5288
+ go(-1);
5289
+ }
5290
+
5291
+ function goForward() {
5292
+ go(1);
5293
+ }
5294
+
5295
+ function canGo(n) {
5296
+ var nextIndex = history.index + n;
5297
+ return nextIndex >= 0 && nextIndex < history.entries.length;
5298
+ }
5299
+
5300
+ function block(prompt) {
5301
+ if (prompt === void 0) {
5302
+ prompt = false;
5303
+ }
5304
+
5305
+ return transitionManager.setPrompt(prompt);
5306
+ }
5307
+
5308
+ function listen(listener) {
5309
+ return transitionManager.appendListener(listener);
5310
+ }
5311
+
5312
+ var history = {
5313
+ length: entries.length,
5314
+ action: 'POP',
5315
+ location: entries[index],
5316
+ index: index,
5317
+ entries: entries,
5318
+ createHref: createHref,
5319
+ push: push,
5320
+ replace: replace,
5321
+ go: go,
5322
+ goBack: goBack,
5323
+ goForward: goForward,
5324
+ canGo: canGo,
5325
+ block: block,
5326
+ listen: listen
5327
+ };
5328
+ return history;
5329
+ }
5330
+
5331
+
5332
 
5333
  /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
5334
 
5812
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5813
 
5814
  "use strict";
5815
+ /* WEBPACK VAR INJECTION */(function(process) {var isProduction = process.env.NODE_ENV === 'production';
5816
+ function warning(condition, message) {
5817
+ if (!isProduction) {
5818
+ if (condition) {
5819
+ return;
5820
+ }
5821
+
5822
+ var text = "Warning: " + message;
5823
+
5824
+ if (typeof console !== 'undefined') {
5825
+ console.warn(text);
5826
+ }
5827
+
5828
+ try {
5829
+ throw Error(text);
5830
+ } catch (x) {}
5831
+ }
5832
+ }
5833
+
5834
+ /* harmony default export */ __webpack_exports__["a"] = (warning);
5835
 
5836
  /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
5837
 
5850
 
5851
  "use strict";
5852
  /* harmony export (immutable) */ __webpack_exports__["a"] = _createClass;
5853
+ function _defineProperties(target, props) {
5854
+ for (var i = 0; i < props.length; i++) {
5855
+ var descriptor = props[i];
5856
+ descriptor.enumerable = descriptor.enumerable || false;
5857
+ descriptor.configurable = true;
5858
+ if ("value" in descriptor) descriptor.writable = true;
5859
+ Object.defineProperty(target, descriptor.key, descriptor);
5860
+ }
5861
+ }
5862
+
5863
+ function _createClass(Constructor, protoProps, staticProps) {
5864
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
5865
+ if (staticProps) _defineProperties(Constructor, staticProps);
5866
+ return Constructor;
5867
  }
5868
 
5869
  /***/ }),
5872
 
5873
  "use strict";
5874
  /* harmony export (immutable) */ __webpack_exports__["a"] = _assertThisInitialized;
5875
+ function _assertThisInitialized(self) {
5876
+ if (self === void 0) {
5877
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5878
+ }
5879
+
5880
+ return self;
5881
  }
5882
 
5883
  /***/ }),
5905
  /***/ (function(module, exports, __webpack_require__) {
5906
 
5907
  "use strict";
5908
+
5909
+
5910
+ var reactIs = __webpack_require__(14);
5911
+
5912
+ /**
5913
+ * Copyright 2015, Yahoo! Inc.
5914
+ * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
5915
+ */
5916
+ var REACT_STATICS = {
5917
+ childContextTypes: true,
5918
+ contextType: true,
5919
+ contextTypes: true,
5920
+ defaultProps: true,
5921
+ displayName: true,
5922
+ getDefaultProps: true,
5923
+ getDerivedStateFromError: true,
5924
+ getDerivedStateFromProps: true,
5925
+ mixins: true,
5926
+ propTypes: true,
5927
+ type: true
5928
+ };
5929
+ var KNOWN_STATICS = {
5930
+ name: true,
5931
+ length: true,
5932
+ prototype: true,
5933
+ caller: true,
5934
+ callee: true,
5935
+ arguments: true,
5936
+ arity: true
5937
+ };
5938
+ var FORWARD_REF_STATICS = {
5939
+ '$$typeof': true,
5940
+ render: true,
5941
+ defaultProps: true,
5942
+ displayName: true,
5943
+ propTypes: true
5944
+ };
5945
+ var MEMO_STATICS = {
5946
+ '$$typeof': true,
5947
+ compare: true,
5948
+ defaultProps: true,
5949
+ displayName: true,
5950
+ propTypes: true,
5951
+ type: true
5952
+ };
5953
+ var TYPE_STATICS = {};
5954
+ TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
5955
+ TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
5956
+
5957
+ function getStatics(component) {
5958
+ // React v16.11 and below
5959
+ if (reactIs.isMemo(component)) {
5960
+ return MEMO_STATICS;
5961
+ } // React v16.12 and above
5962
+
5963
+
5964
+ return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
5965
+ }
5966
+
5967
+ var defineProperty = Object.defineProperty;
5968
+ var getOwnPropertyNames = Object.getOwnPropertyNames;
5969
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
5970
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
5971
+ var getPrototypeOf = Object.getPrototypeOf;
5972
+ var objectPrototype = Object.prototype;
5973
+ function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
5974
+ if (typeof sourceComponent !== 'string') {
5975
+ // don't hoist over string (html) components
5976
+ if (objectPrototype) {
5977
+ var inheritedComponent = getPrototypeOf(sourceComponent);
5978
+
5979
+ if (inheritedComponent && inheritedComponent !== objectPrototype) {
5980
+ hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
5981
+ }
5982
+ }
5983
+
5984
+ var keys = getOwnPropertyNames(sourceComponent);
5985
+
5986
+ if (getOwnPropertySymbols) {
5987
+ keys = keys.concat(getOwnPropertySymbols(sourceComponent));
5988
+ }
5989
+
5990
+ var targetStatics = getStatics(targetComponent);
5991
+ var sourceStatics = getStatics(sourceComponent);
5992
+
5993
+ for (var i = 0; i < keys.length; ++i) {
5994
+ var key = keys[i];
5995
+
5996
+ if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
5997
+ var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
5998
+
5999
+ try {
6000
+ // Avoid failures from read-only properties
6001
+ defineProperty(targetComponent, key, descriptor);
6002
+ } catch (e) {}
6003
+ }
6004
+ }
6005
+ }
6006
+
6007
+ return targetComponent;
6008
+ }
6009
+
6010
+ module.exports = hoistNonReactStatics;
6011
 
6012
 
6013
  /***/ }),
6295
  /***/ (function(module, exports, __webpack_require__) {
6296
 
6297
  "use strict";
6298
+ /* WEBPACK VAR INJECTION */(function(process) {/**
6299
+ * Copyright (c) 2013-present, Facebook, Inc.
6300
+ *
6301
+ * This source code is licensed under the MIT license found in the
6302
+ * LICENSE file in the root directory of this source tree.
6303
+ */
6304
+
6305
+
6306
+
6307
+ var printWarning = function() {};
6308
+
6309
+ if (process.env.NODE_ENV !== 'production') {
6310
+ var ReactPropTypesSecret = __webpack_require__(89);
6311
+ var loggedTypeFailures = {};
6312
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
6313
+
6314
+ printWarning = function(text) {
6315
+ var message = 'Warning: ' + text;
6316
+ if (typeof console !== 'undefined') {
6317
+ console.error(message);
6318
+ }
6319
+ try {
6320
+ // --- Welcome to debugging React ---
6321
+ // This error was thrown as a convenience so that you can use this stack
6322
+ // to find the callsite that caused this warning to fire.
6323
+ throw new Error(message);
6324
+ } catch (x) {}
6325
+ };
6326
+ }
6327
+
6328
+ /**
6329
+ * Assert that the values match with the type specs.
6330
+ * Error messages are memorized and will only be shown once.
6331
+ *
6332
+ * @param {object} typeSpecs Map of name to a ReactPropType
6333
+ * @param {object} values Runtime values that need to be type-checked
6334
+ * @param {string} location e.g. "prop", "context", "child context"
6335
+ * @param {string} componentName Name of the component for error messages.
6336
+ * @param {?Function} getStack Returns the component stack.
6337
+ * @private
6338
+ */
6339
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
6340
+ if (process.env.NODE_ENV !== 'production') {
6341
+ for (var typeSpecName in typeSpecs) {
6342
+ if (has(typeSpecs, typeSpecName)) {
6343
+ var error;
6344
+ // Prop type validation may throw. In case they do, we don't want to
6345
+ // fail the render phase where it didn't fail before. So we log it.
6346
+ // After these have been cleaned up, we'll let them throw.
6347
+ try {
6348
+ // This is intentionally an invariant that gets caught. It's the same
6349
+ // behavior as without this statement except with a better message.
6350
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
6351
+ var err = Error(
6352
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
6353
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
6354
+ );
6355
+ err.name = 'Invariant Violation';
6356
+ throw err;
6357
+ }
6358
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
6359
+ } catch (ex) {
6360
+ error = ex;
6361
+ }
6362
+ if (error && !(error instanceof Error)) {
6363
+ printWarning(
6364
+ (componentName || 'React class') + ': type specification of ' +
6365
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
6366
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
6367
+ 'You may have forgotten to pass an argument to the type checker ' +
6368
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
6369
+ 'shape all require an argument).'
6370
+ );
6371
+ }
6372
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
6373
+ // Only monitor this failure once because there tends to be a lot of the
6374
+ // same error.
6375
+ loggedTypeFailures[error.message] = true;
6376
+
6377
+ var stack = getStack ? getStack() : '';
6378
+
6379
+ printWarning(
6380
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
6381
+ );
6382
+ }
6383
+ }
6384
+ }
6385
+ }
6386
+ }
6387
+
6388
+ /**
6389
+ * Resets warning cache when testing.
6390
+ *
6391
+ * @private
6392
+ */
6393
+ checkPropTypes.resetWarningCache = function() {
6394
+ if (process.env.NODE_ENV !== 'production') {
6395
+ loggedTypeFailures = {};
6396
+ }
6397
+ }
6398
+
6399
+ module.exports = checkPropTypes;
6400
 
6401
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
6402
 
6405
  /***/ (function(module, exports, __webpack_require__) {
6406
 
6407
  "use strict";
6408
+ /**
6409
+ * Copyright (c) 2013-present, Facebook, Inc.
6410
+ *
6411
+ * This source code is licensed under the MIT license found in the
6412
+ * LICENSE file in the root directory of this source tree.
6413
+ */
6414
+
6415
+
6416
+
6417
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
6418
+
6419
+ module.exports = ReactPropTypesSecret;
6420
 
6421
 
6422
  /***/ }),
6425
 
6426
  "use strict";
6427
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Router__ = __webpack_require__(91);
6428
+ // Written in this round about way for babel-transform-imports
6429
+
6430
+
6431
  /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Router__["a" /* default */]);
6432
 
6433
  /***/ }),
6443
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
6444
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
6445
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
6446
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
6447
+
6448
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6449
+
6450
+ 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; }
6451
+
6452
+ 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; }
6453
+
6454
+
6455
+
6456
+
6457
+
6458
+
6459
+ /**
6460
+ * The public API for putting history on context.
6461
+ */
6462
+
6463
+ var Router = function (_React$Component) {
6464
+ _inherits(Router, _React$Component);
6465
+
6466
+ function Router() {
6467
+ var _temp, _this, _ret;
6468
+
6469
+ _classCallCheck(this, Router);
6470
+
6471
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
6472
+ args[_key] = arguments[_key];
6473
+ }
6474
+
6475
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
6476
+ match: _this.computeMatch(_this.props.history.location.pathname)
6477
+ }, _temp), _possibleConstructorReturn(_this, _ret);
6478
+ }
6479
+
6480
+ Router.prototype.getChildContext = function getChildContext() {
6481
+ return {
6482
+ router: _extends({}, this.context.router, {
6483
+ history: this.props.history,
6484
+ route: {
6485
+ location: this.props.history.location,
6486
+ match: this.state.match
6487
+ }
6488
+ })
6489
+ };
6490
+ };
6491
+
6492
+ Router.prototype.computeMatch = function computeMatch(pathname) {
6493
+ return {
6494
+ path: "/",
6495
+ url: "/",
6496
+ params: {},
6497
+ isExact: pathname === "/"
6498
+ };
6499
+ };
6500
+
6501
+ Router.prototype.componentWillMount = function componentWillMount() {
6502
+ var _this2 = this;
6503
+
6504
+ var _props = this.props,
6505
+ children = _props.children,
6506
+ history = _props.history;
6507
+
6508
+
6509
+ __WEBPACK_IMPORTED_MODULE_1_invariant___default()(children == null || __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 1, "A <Router> may have only one child element");
6510
+
6511
+ // Do this here so we can setState when a <Redirect> changes the
6512
+ // location in componentWillMount. This happens e.g. when doing
6513
+ // server rendering using a <StaticRouter>.
6514
+ this.unlisten = history.listen(function () {
6515
+ _this2.setState({
6516
+ match: _this2.computeMatch(history.location.pathname)
6517
+ });
6518
+ });
6519
+ };
6520
+
6521
+ Router.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
6522
+ __WEBPACK_IMPORTED_MODULE_0_warning___default()(this.props.history === nextProps.history, "You cannot change <Router history>");
6523
+ };
6524
+
6525
+ Router.prototype.componentWillUnmount = function componentWillUnmount() {
6526
+ this.unlisten();
6527
+ };
6528
+
6529
+ Router.prototype.render = function render() {
6530
+ var children = this.props.children;
6531
+
6532
+ return children ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children) : null;
6533
+ };
6534
+
6535
+ return Router;
6536
+ }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
6537
+
6538
+ Router.propTypes = {
6539
+ history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
6540
+ children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node
6541
+ };
6542
+ Router.contextTypes = {
6543
+ router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
6544
+ };
6545
+ Router.childContextTypes = {
6546
+ router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
6547
+ };
6548
+
6549
+
6550
+ /* harmony default export */ __webpack_exports__["a"] = (Router);
6551
 
6552
+ /***/ }),
6553
+ /* 92 */
6554
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
6555
 
6556
+ "use strict";
6557
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(137);
6558
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
6559
+
6560
+
6561
+ var patternCache = {};
6562
+ var cacheLimit = 10000;
6563
+ var cacheCount = 0;
6564
+
6565
+ var compilePath = function compilePath(pattern, options) {
6566
+ var cacheKey = "" + options.end + options.strict + options.sensitive;
6567
+ var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
6568
+
6569
+ if (cache[pattern]) return cache[pattern];
6570
+
6571
+ var keys = [];
6572
+ var re = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default()(pattern, keys, options);
6573
+ var compiledPattern = { re: re, keys: keys };
6574
+
6575
+ if (cacheCount < cacheLimit) {
6576
+ cache[pattern] = compiledPattern;
6577
+ cacheCount++;
6578
+ }
6579
+
6580
+ return compiledPattern;
6581
+ };
6582
+
6583
+ /**
6584
+ * Public API for matching a URL pathname to a path pattern.
6585
+ */
6586
+ var matchPath = function matchPath(pathname) {
6587
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6588
+ var parent = arguments[2];
6589
+
6590
+ if (typeof options === "string") options = { path: options };
6591
+
6592
+ var _options = options,
6593
+ path = _options.path,
6594
+ _options$exact = _options.exact,
6595
+ exact = _options$exact === undefined ? false : _options$exact,
6596
+ _options$strict = _options.strict,
6597
+ strict = _options$strict === undefined ? false : _options$strict,
6598
+ _options$sensitive = _options.sensitive,
6599
+ sensitive = _options$sensitive === undefined ? false : _options$sensitive;
6600
+
6601
+
6602
+ if (path == null) return parent;
6603
+
6604
+ var _compilePath = compilePath(path, { end: exact, strict: strict, sensitive: sensitive }),
6605
+ re = _compilePath.re,
6606
+ keys = _compilePath.keys;
6607
+
6608
+ var match = re.exec(pathname);
6609
+
6610
+ if (!match) return null;
6611
+
6612
+ var url = match[0],
6613
+ values = match.slice(1);
6614
+
6615
+ var isExact = pathname === url;
6616
+
6617
+ if (exact && !isExact) return null;
6618
+
6619
+ return {
6620
+ path: path, // the path pattern used to match
6621
+ url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL
6622
+ isExact: isExact, // whether or not we matched exactly
6623
+ params: keys.reduce(function (memo, key, index) {
6624
+ memo[key.name] = values[index];
6625
+ return memo;
6626
+ }, {})
6627
+ };
6628
+ };
6629
+
6630
+ /* harmony default export */ __webpack_exports__["a"] = (matchPath);
6631
 
6632
+ /***/ }),
6633
+ /* 93 */
6634
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
6635
 
6636
+ "use strict";
6637
+ /* WEBPACK VAR INJECTION */(function(process) {/* harmony export (immutable) */ __webpack_exports__["a"] = chainPropTypes;
6638
+ function chainPropTypes(propType1, propType2) {
6639
+ if (process.env.NODE_ENV === 'production') {
6640
+ return function () {
6641
+ return null;
6642
+ };
6643
+ }
6644
 
6645
+ return function validate() {
6646
+ return propType1.apply(void 0, arguments) || propType2.apply(void 0, arguments);
6647
+ };
6648
+ }
6649
+ /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(1)))
6650
 
6651
+ /***/ }),
6652
+ /* 94 */
6653
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
6654
 
6655
+ "use strict";
6656
+ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__getThemeProps__ = __webpack_require__(350);
6657
+ /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__getThemeProps__["a"]; });
6658
 
 
 
6659
 
6660
+ /***/ }),
6661
+ /* 95 */
6662
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6663
 
6664
  "use strict";
6665
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__jssPreset__ = __webpack_require__(351);
6681
 
6682
  "use strict";
6683
  /* harmony export (immutable) */ __webpack_exports__["a"] = _classCallCheck;
6684
+ function _classCallCheck(instance, Constructor) {
6685
+ if (!(instance instanceof Constructor)) {
6686
+ throw new TypeError("Cannot call a class as a function");
6687
+ }
6688
  }
6689
 
6690
  /***/ }),
8999
  /***/ (function(module, exports, __webpack_require__) {
9000
 
9001
  "use strict";
9002
+ /* WEBPACK VAR INJECTION */(function(process) {
9003
+
9004
+ if (process.env.NODE_ENV === 'production') {
9005
+ module.exports = __webpack_require__(300);
9006
+ } else {
9007
+ module.exports = __webpack_require__(301);
9008
+ }
9009
 
9010
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
9011
 
9021
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant__ = __webpack_require__(35);
9022
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_invariant___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_invariant__);
9023
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_history__ = __webpack_require__(44);
9024
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9025
+
9026
+ function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
9027
+
9028
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9029
+
9030
+ 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; }
9031
+
9032
+ 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; }
9033
+
9034
+
9035
+
9036
+
9037
+
9038
+
9039
+ var isModifiedEvent = function isModifiedEvent(event) {
9040
+ return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
9041
+ };
9042
+
9043
+ /**
9044
+ * The public API for rendering a history-aware <a>.
9045
+ */
9046
+
9047
+ var Link = function (_React$Component) {
9048
+ _inherits(Link, _React$Component);
9049
+
9050
+ function Link() {
9051
+ var _temp, _this, _ret;
9052
+
9053
+ _classCallCheck(this, Link);
9054
+
9055
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
9056
+ args[_key] = arguments[_key];
9057
+ }
9058
+
9059
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleClick = function (event) {
9060
+ if (_this.props.onClick) _this.props.onClick(event);
9061
+
9062
+ if (!event.defaultPrevented && // onClick prevented default
9063
+ event.button === 0 && // ignore everything but left clicks
9064
+ !_this.props.target && // let browser handle "target=_blank" etc.
9065
+ !isModifiedEvent(event) // ignore clicks with modifier keys
9066
+ ) {
9067
+ event.preventDefault();
9068
+
9069
+ var history = _this.context.router.history;
9070
+ var _this$props = _this.props,
9071
+ replace = _this$props.replace,
9072
+ to = _this$props.to;
9073
+
9074
+
9075
+ if (replace) {
9076
+ history.replace(to);
9077
+ } else {
9078
+ history.push(to);
9079
+ }
9080
+ }
9081
+ }, _temp), _possibleConstructorReturn(_this, _ret);
9082
+ }
9083
+
9084
+ Link.prototype.render = function render() {
9085
+ var _props = this.props,
9086
+ replace = _props.replace,
9087
+ to = _props.to,
9088
+ innerRef = _props.innerRef,
9089
+ props = _objectWithoutProperties(_props, ["replace", "to", "innerRef"]); // eslint-disable-line no-unused-vars
9090
+
9091
+ __WEBPACK_IMPORTED_MODULE_2_invariant___default()(this.context.router, "You should not use <Link> outside a <Router>");
9092
+
9093
+ __WEBPACK_IMPORTED_MODULE_2_invariant___default()(to !== undefined, 'You must specify the "to" property');
9094
+
9095
+ var history = this.context.router.history;
9096
+
9097
+ var location = typeof to === "string" ? Object(__WEBPACK_IMPORTED_MODULE_3_history__["c" /* createLocation */])(to, null, null, history.location) : to;
9098
+
9099
+ var href = history.createHref(location);
9100
+ return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("a", _extends({}, props, { onClick: this.handleClick, href: href, ref: innerRef }));
9101
+ };
9102
+
9103
+ return Link;
9104
+ }(__WEBPACK_IMPORTED_MODULE_0_react___default.a.Component);
9105
+
9106
+ Link.propTypes = {
9107
+ onClick: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func,
9108
+ target: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string,
9109
+ replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.bool,
9110
+ to: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.object]).isRequired,
9111
+ innerRef: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.string, __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func])
9112
+ };
9113
+ Link.defaultProps = {
9114
+ replace: false
9115
+ };
9116
+ Link.contextTypes = {
9117
+ router: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
9118
+ history: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.shape({
9119
+ push: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
9120
+ replace: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired,
9121
+ createHref: __WEBPACK_IMPORTED_MODULE_1_prop_types___default.a.func.isRequired
9122
+ }).isRequired
9123
+ }).isRequired
9124
+ };
9125
+
9126
+
9127
  /* harmony default export */ __webpack_exports__["a"] = (Link);
9128
 
9129
  /***/ }),
9132
 
9133
  "use strict";
9134
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__ = __webpack_require__(136);
9135
+ // Written in this round about way for babel-transform-imports
9136
+
9137
+
9138
  /* harmony default export */ __webpack_exports__["a"] = (__WEBPACK_IMPORTED_MODULE_0_react_router_es_Route__["a" /* default */]);
9139
 
9140
  /***/ }),
9151
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types__ = __webpack_require__(2);
9152
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_prop_types___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_prop_types__);
9153
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__matchPath__ = __webpack_require__(92);
9154
+ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
9155
+
9156
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9157
+
9158
+ 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; }
9159
+
9160
+ 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; }
9161
+
9162
+
9163
+
9164
+
9165
+
9166
+
9167
+
9168
+ var isEmptyChildren = function isEmptyChildren(children) {
9169
+ return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.count(children) === 0;
9170
+ };
9171
+
9172
+ /**
9173
+ * The public API for matching a single path and rendering.
9174
+ */
9175
+
9176
+ var Route = function (_React$Component) {
9177
+ _inherits(Route, _React$Component);
9178
+
9179
+ function Route() {
9180
+ var _temp, _this, _ret;
9181
+
9182
+ _classCallCheck(this, Route);
9183
+
9184
+ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
9185
+ args[_key] = arguments[_key];
9186
+ }
9187
+
9188
+ return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.state = {
9189
+ match: _this.computeMatch(_this.props, _this.context.router)
9190
+ }, _temp), _possibleConstructorReturn(_this, _ret);
9191
+ }
9192
+
9193
+ Route.prototype.getChildContext = function getChildContext() {
9194
+ return {
9195
+ router: _extends({}, this.context.router, {
9196
+ route: {
9197
+ location: this.props.location || this.context.router.route.location,
9198
+ match: this.state.match
9199
+ }
9200
+ })
9201
+ };
9202
+ };
9203
+
9204
+ Route.prototype.computeMatch = function computeMatch(_ref, router) {
9205
+ var computedMatch = _ref.computedMatch,
9206
+ location = _ref.location,
9207
+ path = _ref.path,
9208
+ strict = _ref.strict,
9209
+ exact = _ref.exact,
9210
+ sensitive = _ref.sensitive;
9211
+
9212
+ if (computedMatch) return computedMatch; // <Switch> already computed the match for us
9213
+
9214
+ __WEBPACK_IMPORTED_MODULE_1_invariant___default()(router, "You should not use <Route> or withRouter() outside a <Router>");
9215
+
9216
+ var route = router.route;
9217
+
9218
+ var pathname = (location || route.location).pathname;
9219
+
9220
+ return Object(__WEBPACK_IMPORTED_MODULE_4__matchPath__["a" /* default */])(pathname, { path: path, strict: strict, exact: exact, sensitive: sensitive }, route.match);
9221
+ };
9222
+
9223
+ Route.prototype.componentWillMount = function componentWillMount() {
9224
+ __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.render), "You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored");
9225
+
9226
+ __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored");
9227
+
9228
+ __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)), "You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored");
9229
+ };
9230
+
9231
+ Route.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps, nextContext) {
9232
+ __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(nextProps.location && !this.props.location), '<Route> elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.');
9233
+
9234
+ __WEBPACK_IMPORTED_MODULE_0_warning___default()(!(!nextProps.location && this.props.location), '<Route> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.');
9235
+
9236
+ this.setState({
9237
+ match: this.computeMatch(nextProps, nextContext.router)
9238
+ });
9239
+ };
9240
+
9241
+ Route.prototype.render = function render() {
9242
+ var match = this.state.match;
9243
+ var _props = this.props,
9244
+ children = _props.children,
9245
+ component = _props.component,
9246
+ render = _props.render;
9247
+ var _context$router = this.context.router,
9248
+ history = _context$router.history,
9249
+ route = _context$router.route,
9250
+ staticContext = _context$router.staticContext;
9251
+
9252
+ var location = this.props.location || route.location;
9253
+ var props = { match: match, location: location, history: history, staticContext: staticContext };
9254
+
9255
+ if (component) return match ? __WEBPACK_IMPORTED_MODULE_2_react___default.a.createElement(component, props) : null;
9256
+
9257
+ if (render) return match ? render(props) : null;
9258
+
9259
+ if (typeof children === "function") return children(props);
9260
+
9261
+ if (children && !isEmptyChildren(children)) return __WEBPACK_IMPORTED_MODULE_2_react___default.a.Children.only(children);
9262
+
9263
+ return null;
9264
+ };
9265
+
9266
+ return Route;
9267
+ }(__WEBPACK_IMPORTED_MODULE_2_react___default.a.Component);
9268
+
9269
+ Route.propTypes = {
9270
+ computedMatch: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object, // private, from <Switch>
9271
+ path: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.string,
9272
+ exact: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
9273
+ strict: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
9274
+ sensitive: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.bool,
9275
+ component: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
9276
+ render: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func,
9277
+ children: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.oneOfType([__WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.func, __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.node]),
9278
+ location: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
9279
+ };
9280
+ Route.contextTypes = {
9281
+ router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.shape({
9282
+ history: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
9283
+ route: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired,
9284
+ staticContext: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object
9285
+ })
9286
+ };
9287
+ Route.childContextTypes = {
9288
+ router: __WEBPACK_IMPORTED_MODULE_3_prop_types___default.a.object.isRequired
9289
+ };
9290
+
9291
+
9292
  /* harmony default export */ __webpack_exports__["a"] = (Route);
9293
 
9294
  /***/ }),
9295
  /* 137 */
9296
  /***/ (function(module, exports, __webpack_require__) {
9297
 
9298
+ var isarray = __webpack_require__(318)
9299
+
9300
+ /**
9301
+ * Expose `pathToRegexp`.
9302
+ */
9303
+ module.exports = pathToRegexp
9304
+ module.exports.parse = parse
9305
+ module.exports.compile = compile
9306
+ module.exports.tokensToFunction = tokensToFunction
9307
+ module.exports.tokensToRegExp = tokensToRegExp
9308
+
9309
+ /**
9310
+ * The main path matching regexp utility.
9311
+ *
9312
+ * @type {RegExp}
9313
+ */
9314
+ var PATH_REGEXP = new RegExp([
9315
+ // Match escaped characters that would otherwise appear in future matches.
9316
+ // This allows the user to escape special characters that won't transform.
9317
+ '(\\\\.)',
9318
+ // Match Express-style parameters and un-named parameters with a prefix
9319
+ // and optional suffixes. Matches appear as:
9320
+ //
9321
+ // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
9322
+ // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
9323
+ // "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
9324
+ '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
9325
+ ].join('|'), 'g')
9326
+
9327
+ /**
9328
+ * Parse a string for the raw tokens.
9329
+ *
9330
+ * @param {string} str
9331
+ * @param {Object=} options
9332
+ * @return {!Array}
9333
+ */
9334
+ function parse (str, options) {
9335
+ var tokens = []
9336
+ var key = 0
9337
+ var index = 0
9338
+ var path = ''
9339
+ var defaultDelimiter = options && options.delimiter || '/'
9340
+ var res
9341
+
9342
+ while ((res = PATH_REGEXP.exec(str)) != null) {
9343
+ var m = res[0]
9344
+ var escaped = res[1]
9345
+ var offset = res.index
9346
+ path += str.slice(index, offset)
9347
+ index = offset + m.length
9348
+
9349
+ // Ignore already escaped sequences.
9350
+ if (escaped) {
9351
+ path += escaped[1]
9352
+ continue
9353
+ }
9354
+
9355
+ var next = str[index]
9356
+ var prefix = res[2]
9357
+ var name = res[3]
9358
+ var capture = res[4]
9359
+ var group = res[5]
9360
+ var modifier = res[6]
9361
+ var asterisk = res[7]
9362
+
9363
+ // Push the current path onto the tokens.
9364
+ if (path) {
9365
+ tokens.push(path)
9366
+ path = ''
9367
+ }
9368
+
9369
+ var partial = prefix != null && next != null && next !== prefix
9370
+ var repeat = modifier === '+' || modifier === '*'
9371
+ var optional = modifier === '?' || modifier === '*'
9372
+ var delimiter = res[2] || defaultDelimiter
9373
+ var pattern = capture || group
9374
+
9375
+ tokens.push({
9376
+ name: name || key++,
9377
+ prefix: prefix || '',
9378
+ delimiter: delimiter,
9379
+ optional: optional,
9380
+ repeat: repeat,
9381
+ partial: partial,
9382
+ asterisk: !!asterisk,
9383
+ pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
9384
+ })
9385
+ }
9386
+
9387
+ // Match any characters still remaining.
9388
+ if (index < str.length) {
9389
+ path += str.substr(index)
9390
+ }
9391
+
9392
+ // If the path exists, push it onto the end.
9393
+ if (path) {
9394
+ tokens.push(path)
9395
+ }
9396
+
9397
+ return tokens
9398
+ }
9399
+
9400
+ /**
9401
+ * Compile a string to a template function for the path.
9402
+ *
9403
+ * @param {string} str
9404
+ * @param {Object=} options
9405
+ * @return {!function(Object=, Object=)}
9406
+ */
9407
+ function compile (str, options) {
9408
+ return tokensToFunction(parse(str, options), options)
9409
+ }
9410
+
9411
+ /**
9412
+ * Prettier encoding of URI path segments.
9413
+ *
9414
+ * @param {string}
9415
+ * @return {string}
9416
+ */
9417
+ function encodeURIComponentPretty (str) {
9418
+ return encodeURI(str).replace(/[\/?#]/g, function (c) {
9419
+ return '%' + c.charCodeAt(0).toString(16).toUpperCase()
9420
+ })
9421
+ }
9422
+
9423
+ /**
9424
+ * Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
9425
+ *
9426
+ * @param {string}
9427
+ * @return {string}
9428
+ */
9429
+ function encodeAsterisk (str) {
9430
+ return encodeURI(str).replace(/[?#]/g, function (c) {
9431
+ return '%' + c.charCodeAt(0).toString(16).toUpperCase()
9432
+ })
9433
+ }
9434
+
9435
+ /**
9436
+ * Expose a method for transforming tokens into the path function.
9437
+ */
9438
+ function tokensToFunction (tokens, options) {
9439
+ // Compile all the tokens into regexps.
9440
+ var matches = new Array(tokens.length)
9441
+
9442
+ // Compile all the patterns before compilation.
9443
+ for (var i = 0; i < tokens.length; i++) {
9444
+ if (typeof tokens[i] === 'object') {
9445
+ matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options))
9446
+ }
9447
+ }
9448
+
9449
+ return function (obj, opts) {
9450
+ var path = ''
9451
+ var data = obj || {}
9452
+ var options = opts || {}
9453
+ var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent
9454
+
9455
+ for (var i = 0; i < tokens.length; i++) {
9456
+ var token = tokens[i]
9457
+
9458
+ if (typeof token === 'string') {
9459
+ path += token
9460
+
9461
+ continue
9462
+ }
9463
+
9464
+ var value = data[token.name]
9465
+ var segment
9466
+
9467
+ if (value == null) {
9468
+ if (token.optional) {
9469
+ // Prepend partial segment prefixes.
9470
+ if (token.partial) {
9471
+ path += token.prefix
9472
+ }
9473
+
9474
+ continue
9475
+ } else {
9476
+ throw new TypeError('Expected "' + token.name + '" to be defined')
9477
+ }
9478
+ }
9479
+
9480
+ if (isarray(value)) {
9481
+ if (!token.repeat) {
9482
+ throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
9483
+ }
9484
+
9485
+ if (value.length === 0) {
9486
+ if (token.optional) {
9487
+ continue
9488
+ } else {
9489
+ throw new TypeError('Expected "' + token.name + '" to not be empty')
9490
+ }
9491
+ }
9492
+
9493
+ for (var j = 0; j < value.length; j++) {
9494
+ segment = encode(value[j])
9495
+
9496
+ if (!matches[i].test(segment)) {
9497
+ throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
9498
+ }
9499
+
9500
+ path += (j === 0 ? token.prefix : token.delimiter) + segment
9501
+ }
9502
+
9503
+ continue
9504
+ }
9505
+
9506
+ segment = token.asterisk ? encodeAsterisk(value) : encode(value)
9507
+
9508
+ if (!matches[i].test(segment)) {
9509
+ throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
9510
+ }
9511
+
9512
+ path += token.prefix + segment
9513
+ }
9514
+
9515
+ return path
9516
+ }
9517
+ }
9518
+
9519
+ /**
9520
+ * Escape a regular expression string.
9521
+ *
9522
+ * @param {string} str
9523
+ * @return {string}
9524
+ */
9525
+ function escapeString (str) {
9526
+ return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
9527
+ }
9528
+
9529
+ /**
9530
+ * Escape the capturing group by escaping special characters and meaning.
9531
+ *
9532
+ * @param {string} group
9533
+ * @return {string}
9534
+ */
9535
+ function escapeGroup (group) {
9536
+ return group.replace(/([=!:$\/()])/g, '\\$1')
9537
+ }
9538
+
9539
+ /**
9540
+ * Attach the keys as a property of the regexp.
9541
+ *
9542
+ * @param {!RegExp} re
9543
+ * @param {Array} keys
9544
+ * @return {!RegExp}
9545
+ */
9546
+ function attachKeys (re, keys) {
9547
+ re.keys = keys
9548
+ return re
9549
+ }
9550
+
9551
+ /**
9552
+ * Get the flags for a regexp from the options.
9553
+ *
9554
+ * @param {Object} options
9555
+ * @return {string}
9556
+ */
9557
+ function flags (options) {
9558
+ return options && options.sensitive ? '' : 'i'
9559
+ }
9560
+
9561
+ /**
9562
+ * Pull out keys from a regexp.
9563
+ *
9564
+ * @param {!RegExp} path
9565
+ * @param {!Array} keys
9566
+ * @return {!RegExp}
9567
+ */
9568
+ function regexpToRegexp (path, keys) {
9569
+ // Use a negative lookahead to match only capturing groups.
9570
+ var groups = path.source.match(/\((?!\?)/g)
9571
+
9572
+ if (groups) {
9573
+ for (var i = 0; i < groups.length; i++) {
9574
+ keys.push({
9575
+ name: i,
9576
+ prefix: null,
9577
+ delimiter: null,
9578
+ optional: false,
9579
+ repeat: false,
9580
+ partial: false,
9581
+ asterisk: false,
9582
+ pattern: null
9583
+ })
9584
+ }
9585
+ }
9586
+
9587
+ return attachKeys(path, keys)
9588
+ }
9589
+
9590
+ /**
9591
+ * Transform an array into a regexp.
9592
+ *
9593
+ * @param {!Array} path
9594
+ * @param {Array} keys
9595
+ * @param {!Object} options
9596
+ * @return {!RegExp}
9597
+ */
9598
+ function arrayToRegexp (path, keys, options) {
9599
+ var parts = []
9600
+
9601
+ for (var i = 0; i < path.length; i++) {
9602
+ parts.push(pathToRegexp(path[i], keys, options).source)
9603
+ }
9604
+
9605
+ var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options))
9606
+
9607
+ return attachKeys(regexp, keys)
9608
+ }
9609
+
9610
+ /**
9611
+ * Create a path regexp from string input.
9612
+ *
9613
+ * @param {string} path
9614
+ * @param {!Array} keys
9615
+ * @param {!Object} options
9616
+ * @return {!RegExp}
9617
+ */
9618
+ function stringToRegexp (path, keys, options) {
9619
+ return tokensToRegExp(parse(path, options), keys, options)
9620
+ }
9621
+
9622
+ /**
9623
+ * Expose a function for taking tokens and returning a RegExp.
9624
+ *
9625
+ * @param {!Array} tokens
9626
+ * @param {(Array|Object)=} keys
9627
+ * @param {Object=} options
9628
+ * @return {!RegExp}
9629
+ */
9630
+ function tokensToRegExp (tokens, keys, options) {
9631
+ if (!isarray(keys)) {
9632
+ options = /** @type {!Object} */ (keys || options)
9633
+ keys = []
9634
+ }
9635
+
9636
+ options = options || {}
9637
+
9638
+ var strict = options.strict
9639
+ var end = options.end !== false
9640
+ var route = ''
9641
+
9642
+ // Iterate over the tokens and create our regexp string.
9643
+ for (var i = 0; i < tokens.length; i++) {
9644
+ var token = tokens[i]
9645
+
9646
+ if (typeof token === 'string') {
9647
+ route += escapeString(token)
9648
+ } else {
9649
+ var prefix = escapeString(token.prefix)
9650
+ var capture = '(?:' + token.pattern + ')'
9651
+
9652
+ keys.push(token)
9653
+
9654
+ if (token.repeat) {
9655
+ capture += '(?:' + prefix + capture + ')*'
9656
+ }
9657
+
9658
+ if (token.optional) {
9659
+ if (!token.partial) {
9660
+ capture = '(?:' + prefix + '(' + capture + '))?'
9661
+ } else {
9662
+ capture = prefix + '(' + capture + ')?'
9663
+ }
9664
+ } else {
9665
+ capture = prefix + '(' + capture + ')'
9666
+ }
9667
+
9668
+ route += capture
9669
+ }
9670
+ }
9671
+
9672
+ var delimiter = escapeString(options.delimiter || '/')
9673
+ var endsWithDelimiter = route.slice(-delimiter.length) === delimiter
9674
+
9675
+ // In non-strict mode we allow a slash at the end of match. If the path to
9676
+ // match already ends with a slash, we remove it for consistency. The slash
9677
+ // is valid at the end of a path match, not in the middle. This is important
9678
+ // in non-ending mode, where "/test/" shouldn't match "/test//route".
9679
+ if (!strict) {
9680
+ route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?'
9681
+ }
9682
+
9683
+ if (end) {
9684
+ route += '$'
9685
+ } else {
9686
+ // In non-ending mode, we need the capturing groups to match as much as
9687
+ // possible by using a positive lookahead to the end or next path segment.
9688
+ route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)'
9689
+ }
9690
+
9691
+ return attachKeys(new RegExp('^' + route, flags(options)), keys)
9692
+ }
9693
+
9694
+ /**
9695
+ * Normalize the given path string, returning a regular expression.
9696
+ *
9697
+ * An empty array can be passed in for the keys, which will hold the
9698
+ * placeholder key descriptions. For example, using `/user/:id`, `keys` will
9699
+ * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
9700
+ *
9701
+ * @param {(string|RegExp|Array)} path
9702
+ * @param {(Array|Object)=} keys
9703
+ * @param {Object=} options
9704
+ * @return {!RegExp}
9705
+ */
9706
+ function pathToRegexp (path, keys, options) {
9707
+ if (!isarray(keys)) {
9708
+ options = /** @type {!Object} */ (keys || options)
9709
+ keys = []
9710
+ }
9711
+
9712
+ options = options || {}
9713
+
9714
+ if (path instanceof RegExp) {
9715
+ return regexpToRegexp(path, /** @type {!Array} */ (keys))
9716
+ }
9717
+
9718
+ if (isarray(path)) {
9719
+ return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
9720
+ }
9721
+
9722
+ return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
9723
+ }
9724
 
9725
 
9726
  /***/ }),
9730
  "use strict";
9731
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp__ = __webpack_require__(137);
9732
  /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_path_to_regexp__);
9733
+
9734
+
9735
+ var patternCache = {};
9736
+ var cacheLimit = 10000;
9737
+ var cacheCount = 0;
9738
+
9739
+ var compileGenerator = function compileGenerator(pattern) {
9740
+ var cacheKey = pattern;
9741
+ var cache = patternCache[cacheKey] || (patternCache[cacheKey] = {});
9742
+
9743
+ if (cache[pattern]) return cache[pattern];
9744
+
9745
+ var compiledGenerator = __WEBPACK_IMPORTED_MODULE_0_path_to_regexp___default.a.compile(pattern);
9746
+
9747
+ if (cacheCount < cacheLimit) {
9748
+ cache[pattern] = compiledGenerator;
9749
+ cacheCount++;
9750
+ }
9751
+
9752
+ return compiledGenerator;
9753
+ };
9754
+
9755
+ /**
9756
+ * Public API for generating a URL pathname from a pattern and parameters.
9757
+ */
9758
+ var generatePath = function generatePath() {
9759
+ var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "/";
9760
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9761
+
9762
+ if (pattern === "/") {
9763
+ return pattern;
9764
+ }
9765
+ var generator = compileGenerator(pattern);
9766
+ return generator(params, { pretty: true });
9767
+ };
9768
+
9769
  /* harmony default export */ __webpack_exports__["a"] = (generatePath);
9770
 
9771
  /***/ }),
10506
  return res.json();
10507
  }).then(function (result) {
10508
  var titleName = result.name;
10509
+ var quads_ad_old_id = 'ad' + result.id;
10510
 
10511
  if (page.ad_type == 'random_ads') {
10512
  titleName = result.name + " (Random)";
10513
  }
10514
 
10515
  _this2.setState(Object.assign(_this2.state.quads_post_meta, {
10516
+ label: titleName,
10517
+ quads_ad_old_id: quads_ad_old_id
10518
  }));
10519
  }, function (error) {});
10520
  }
10638
 
10639
  "use strict";
10640
  /* harmony export (immutable) */ __webpack_exports__["a"] = _iterableToArray;
10641
+ function _iterableToArray(iter) {
10642
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
10643
  }
10644
 
10645
  /***/ }),
11758
 
11759
  "use strict";
11760
  /* harmony export (immutable) */ __webpack_exports__["a"] = _arrayWithHoles;
11761
+ function _arrayWithHoles(arr) {
11762
+ if (Array.isArray(arr)) return arr;
11763
  }
11764
 
11765
  /***/ }),
11768
 
11769
  "use strict";
11770
  /* harmony export (immutable) */ __webpack_exports__["a"] = _nonIterableRest;
11771
+ function _nonIterableRest() {
11772
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
11773
  }
11774
 
11775
  /***/ }),
21415
  }]);
21416
 
21417
  return QuadsAdRootComponent;