react 0.0.0-experimental-8b155d261 → 0.0.0-experimental-33c3af284

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build-info.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "branch": "master",
3
- "buildNumber": "100411",
4
- "checksum": "8066f26",
5
- "commit": "8b155d261",
3
+ "buildNumber": "147946",
4
+ "checksum": "1d8b187",
5
+ "commit": "33c3af284",
6
6
  "environment": "ci",
7
- "reactVersion": "16.13.0-experimental-8b155d261"
7
+ "reactVersion": "16.13.1-experimental-33c3af284"
8
8
  }
@@ -0,0 +1,1130 @@
1
+ /** @license React v0.0.0-experimental-33c3af284
2
+ * react-jsx-dev-runtime.development.js
3
+ *
4
+ * Copyright (c) Facebook, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+
10
+ 'use strict';
11
+
12
+
13
+
14
+ if (process.env.NODE_ENV !== "production") {
15
+ (function() {
16
+ 'use strict';
17
+
18
+ var React = require('react');
19
+
20
+ // ATTENTION
21
+ // When adding new symbols to this file,
22
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
23
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
24
+ // nor polyfill, then a plain number is used for performance.
25
+ var REACT_ELEMENT_TYPE = 0xeac7;
26
+ var REACT_PORTAL_TYPE = 0xeaca;
27
+ exports.Fragment = 0xeacb;
28
+ var REACT_STRICT_MODE_TYPE = 0xeacc;
29
+ var REACT_PROFILER_TYPE = 0xead2;
30
+ var REACT_PROVIDER_TYPE = 0xeacd;
31
+ var REACT_CONTEXT_TYPE = 0xeace;
32
+ var REACT_FORWARD_REF_TYPE = 0xead0;
33
+ var REACT_SUSPENSE_TYPE = 0xead1;
34
+ var REACT_SUSPENSE_LIST_TYPE = 0xead8;
35
+ var REACT_MEMO_TYPE = 0xead3;
36
+ var REACT_LAZY_TYPE = 0xead4;
37
+ var REACT_BLOCK_TYPE = 0xead9;
38
+ var REACT_SERVER_BLOCK_TYPE = 0xeada;
39
+ var REACT_FUNDAMENTAL_TYPE = 0xead5;
40
+ var REACT_RESPONDER_TYPE = 0xead6;
41
+ var REACT_SCOPE_TYPE = 0xead7;
42
+ var REACT_OPAQUE_ID_TYPE = 0xeae0;
43
+ var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
44
+ var REACT_OFFSCREEN_TYPE = 0xeae2;
45
+ var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
46
+
47
+ if (typeof Symbol === 'function' && Symbol.for) {
48
+ var symbolFor = Symbol.for;
49
+ REACT_ELEMENT_TYPE = symbolFor('react.element');
50
+ REACT_PORTAL_TYPE = symbolFor('react.portal');
51
+ exports.Fragment = symbolFor('react.fragment');
52
+ REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
53
+ REACT_PROFILER_TYPE = symbolFor('react.profiler');
54
+ REACT_PROVIDER_TYPE = symbolFor('react.provider');
55
+ REACT_CONTEXT_TYPE = symbolFor('react.context');
56
+ REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
57
+ REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
58
+ REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
59
+ REACT_MEMO_TYPE = symbolFor('react.memo');
60
+ REACT_LAZY_TYPE = symbolFor('react.lazy');
61
+ REACT_BLOCK_TYPE = symbolFor('react.block');
62
+ REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
63
+ REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
64
+ REACT_RESPONDER_TYPE = symbolFor('react.responder');
65
+ REACT_SCOPE_TYPE = symbolFor('react.scope');
66
+ REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
67
+ REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
68
+ REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');
69
+ REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
70
+ }
71
+
72
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
73
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
74
+ function getIteratorFn(maybeIterable) {
75
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
76
+ return null;
77
+ }
78
+
79
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
80
+
81
+ if (typeof maybeIterator === 'function') {
82
+ return maybeIterator;
83
+ }
84
+
85
+ return null;
86
+ }
87
+
88
+ var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
89
+
90
+ function error(format) {
91
+ {
92
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
93
+ args[_key2 - 1] = arguments[_key2];
94
+ }
95
+
96
+ printWarning('error', format, args);
97
+ }
98
+ }
99
+
100
+ function printWarning(level, format, args) {
101
+ // When changing this logic, you might want to also
102
+ // update consoleWithStackDev.www.js as well.
103
+ {
104
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
105
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
106
+
107
+ if (stack !== '') {
108
+ format += '%s';
109
+ args = args.concat([stack]);
110
+ }
111
+
112
+ var argsWithFormat = args.map(function (item) {
113
+ return '' + item;
114
+ }); // Careful: RN currently depends on this prefix
115
+
116
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
117
+ // breaks IE9: https://github.com/facebook/react/issues/13610
118
+ // eslint-disable-next-line react-internal/no-production-logging
119
+
120
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
121
+
122
+ try {
123
+ // --- Welcome to debugging React ---
124
+ // This error was thrown as a convenience so that you can use this stack
125
+ // to find the callsite that caused this warning to fire.
126
+ var argIndex = 0;
127
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
128
+ return args[argIndex++];
129
+ });
130
+ throw new Error(message);
131
+ } catch (x) {}
132
+ }
133
+ }
134
+
135
+ function isValidElementType(type) {
136
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
137
+ type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE);
138
+ }
139
+
140
+ function getWrappedName(outerType, innerType, wrapperName) {
141
+ var functionName = innerType.displayName || innerType.name || '';
142
+ return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
143
+ }
144
+
145
+ function getContextName(type) {
146
+ return type.displayName || 'Context';
147
+ }
148
+
149
+ function getComponentName(type) {
150
+ if (type == null) {
151
+ // Host root, text node or just invalid type.
152
+ return null;
153
+ }
154
+
155
+ {
156
+ if (typeof type.tag === 'number') {
157
+ error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
158
+ }
159
+ }
160
+
161
+ if (typeof type === 'function') {
162
+ return type.displayName || type.name || null;
163
+ }
164
+
165
+ if (typeof type === 'string') {
166
+ return type;
167
+ }
168
+
169
+ switch (type) {
170
+ case exports.Fragment:
171
+ return 'Fragment';
172
+
173
+ case REACT_PORTAL_TYPE:
174
+ return 'Portal';
175
+
176
+ case REACT_PROFILER_TYPE:
177
+ return "Profiler";
178
+
179
+ case REACT_STRICT_MODE_TYPE:
180
+ return 'StrictMode';
181
+
182
+ case REACT_SUSPENSE_TYPE:
183
+ return 'Suspense';
184
+
185
+ case REACT_SUSPENSE_LIST_TYPE:
186
+ return 'SuspenseList';
187
+ }
188
+
189
+ if (typeof type === 'object') {
190
+ switch (type.$$typeof) {
191
+ case REACT_CONTEXT_TYPE:
192
+ var context = type;
193
+ return getContextName(context) + '.Consumer';
194
+
195
+ case REACT_PROVIDER_TYPE:
196
+ var provider = type;
197
+ return getContextName(provider._context) + '.Provider';
198
+
199
+ case REACT_FORWARD_REF_TYPE:
200
+ return getWrappedName(type, type.render, 'ForwardRef');
201
+
202
+ case REACT_MEMO_TYPE:
203
+ return getComponentName(type.type);
204
+
205
+ case REACT_BLOCK_TYPE:
206
+ return getComponentName(type._render);
207
+
208
+ case REACT_LAZY_TYPE:
209
+ {
210
+ var lazyComponent = type;
211
+ var payload = lazyComponent._payload;
212
+ var init = lazyComponent._init;
213
+
214
+ try {
215
+ return getComponentName(init(payload));
216
+ } catch (x) {
217
+ return null;
218
+ }
219
+ }
220
+ }
221
+ }
222
+
223
+ return null;
224
+ }
225
+
226
+ var loggedTypeFailures = {};
227
+ function checkPropTypes(typeSpecs, values, location, componentName) {
228
+ {
229
+ // $FlowFixMe This is okay but Flow doesn't know it.
230
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
231
+
232
+ for (var typeSpecName in typeSpecs) {
233
+ if (has(typeSpecs, typeSpecName)) {
234
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
235
+ // fail the render phase where it didn't fail before. So we log it.
236
+ // After these have been cleaned up, we'll let them throw.
237
+
238
+ try {
239
+ // This is intentionally an invariant that gets caught. It's the same
240
+ // behavior as without this statement except with a better message.
241
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
242
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
243
+ err.name = 'Invariant Violation';
244
+ throw err;
245
+ }
246
+
247
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
248
+ } catch (ex) {
249
+ error$1 = ex;
250
+ }
251
+
252
+ if (error$1 && !(error$1 instanceof Error)) {
253
+ error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
254
+ }
255
+
256
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
257
+ // Only monitor this failure once because there tends to be a lot of the
258
+ // same error.
259
+ loggedTypeFailures[error$1.message] = true;
260
+
261
+ error('Failed %s type: %s', location, error$1.message);
262
+ }
263
+ }
264
+ }
265
+ }
266
+ }
267
+
268
+ var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
269
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
270
+ var RESERVED_PROPS = {
271
+ key: true,
272
+ ref: true,
273
+ __self: true,
274
+ __source: true
275
+ };
276
+ var specialPropKeyWarningShown;
277
+ var specialPropRefWarningShown;
278
+ var didWarnAboutStringRefs;
279
+
280
+ {
281
+ didWarnAboutStringRefs = {};
282
+ }
283
+
284
+ function hasValidRef(config) {
285
+ {
286
+ if (hasOwnProperty.call(config, 'ref')) {
287
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
288
+
289
+ if (getter && getter.isReactWarning) {
290
+ return false;
291
+ }
292
+ }
293
+ }
294
+
295
+ return config.ref !== undefined;
296
+ }
297
+
298
+ function hasValidKey(config) {
299
+ {
300
+ if (hasOwnProperty.call(config, 'key')) {
301
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
302
+
303
+ if (getter && getter.isReactWarning) {
304
+ return false;
305
+ }
306
+ }
307
+ }
308
+
309
+ return config.key !== undefined;
310
+ }
311
+
312
+ function warnIfStringRefCannotBeAutoConverted(config, self) {
313
+ {
314
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
315
+ var componentName = getComponentName(ReactCurrentOwner.current.type);
316
+
317
+ if (!didWarnAboutStringRefs[componentName]) {
318
+ error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://fb.me/react-strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
319
+
320
+ didWarnAboutStringRefs[componentName] = true;
321
+ }
322
+ }
323
+ }
324
+ }
325
+
326
+ function defineKeyPropWarningGetter(props, displayName) {
327
+ {
328
+ var warnAboutAccessingKey = function () {
329
+ if (!specialPropKeyWarningShown) {
330
+ specialPropKeyWarningShown = true;
331
+
332
+ error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
333
+ }
334
+ };
335
+
336
+ warnAboutAccessingKey.isReactWarning = true;
337
+ Object.defineProperty(props, 'key', {
338
+ get: warnAboutAccessingKey,
339
+ configurable: true
340
+ });
341
+ }
342
+ }
343
+
344
+ function defineRefPropWarningGetter(props, displayName) {
345
+ {
346
+ var warnAboutAccessingRef = function () {
347
+ if (!specialPropRefWarningShown) {
348
+ specialPropRefWarningShown = true;
349
+
350
+ error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', displayName);
351
+ }
352
+ };
353
+
354
+ warnAboutAccessingRef.isReactWarning = true;
355
+ Object.defineProperty(props, 'ref', {
356
+ get: warnAboutAccessingRef,
357
+ configurable: true
358
+ });
359
+ }
360
+ }
361
+ /**
362
+ * Factory method to create a new React element. This no longer adheres to
363
+ * the class pattern, so do not use new to call it. Also, instanceof check
364
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
365
+ * if something is a React Element.
366
+ *
367
+ * @param {*} type
368
+ * @param {*} props
369
+ * @param {*} key
370
+ * @param {string|object} ref
371
+ * @param {*} owner
372
+ * @param {*} self A *temporary* helper to detect places where `this` is
373
+ * different from the `owner` when React.createElement is called, so that we
374
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
375
+ * functions, and as long as `this` and owner are the same, there will be no
376
+ * change in behavior.
377
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
378
+ * indicating filename, line number, and/or other information.
379
+ * @internal
380
+ */
381
+
382
+
383
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
384
+ var element = {
385
+ // This tag allows us to uniquely identify this as a React Element
386
+ $$typeof: REACT_ELEMENT_TYPE,
387
+ // Built-in properties that belong on the element
388
+ type: type,
389
+ key: key,
390
+ ref: ref,
391
+ props: props,
392
+ // Record the component responsible for creating this element.
393
+ _owner: owner
394
+ };
395
+
396
+ {
397
+ // The validation flag is currently mutative. We put it on
398
+ // an external backing store so that we can freeze the whole object.
399
+ // This can be replaced with a WeakMap once they are implemented in
400
+ // commonly used development environments.
401
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
402
+ // the validation flag non-enumerable (where possible, which should
403
+ // include every environment we run tests in), so the test framework
404
+ // ignores it.
405
+
406
+ Object.defineProperty(element._store, 'validated', {
407
+ configurable: false,
408
+ enumerable: false,
409
+ writable: true,
410
+ value: false
411
+ }); // self and source are DEV only properties.
412
+
413
+ Object.defineProperty(element, '_self', {
414
+ configurable: false,
415
+ enumerable: false,
416
+ writable: false,
417
+ value: self
418
+ }); // Two elements created in two different places should be considered
419
+ // equal for testing purposes and therefore we hide it from enumeration.
420
+
421
+ Object.defineProperty(element, '_source', {
422
+ configurable: false,
423
+ enumerable: false,
424
+ writable: false,
425
+ value: source
426
+ });
427
+
428
+ if (Object.freeze) {
429
+ Object.freeze(element.props);
430
+ Object.freeze(element);
431
+ }
432
+ }
433
+
434
+ return element;
435
+ };
436
+ /**
437
+ * https://github.com/reactjs/rfcs/pull/107
438
+ * @param {*} type
439
+ * @param {object} props
440
+ * @param {string} key
441
+ */
442
+
443
+ function jsxDEV(type, config, maybeKey, source, self) {
444
+ {
445
+ var propName; // Reserved names are extracted
446
+
447
+ var props = {};
448
+ var key = null;
449
+ var ref = null; // Currently, key can be spread in as a prop. This causes a potential
450
+ // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
451
+ // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
452
+ // but as an intermediary step, we will use jsxDEV for everything except
453
+ // <div {...props} key="Hi" />, because we aren't currently able to tell if
454
+ // key is explicitly declared to be undefined or not.
455
+
456
+ if (maybeKey !== undefined) {
457
+ key = '' + maybeKey;
458
+ }
459
+
460
+ if (hasValidKey(config)) {
461
+ key = '' + config.key;
462
+ }
463
+
464
+ if (hasValidRef(config)) {
465
+ ref = config.ref;
466
+ warnIfStringRefCannotBeAutoConverted(config, self);
467
+ } // Remaining properties are added to a new props object
468
+
469
+
470
+ for (propName in config) {
471
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
472
+ props[propName] = config[propName];
473
+ }
474
+ } // Resolve default props
475
+
476
+
477
+ if (type && type.defaultProps) {
478
+ var defaultProps = type.defaultProps;
479
+
480
+ for (propName in defaultProps) {
481
+ if (props[propName] === undefined) {
482
+ props[propName] = defaultProps[propName];
483
+ }
484
+ }
485
+ }
486
+
487
+ if (key || ref) {
488
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
489
+
490
+ if (key) {
491
+ defineKeyPropWarningGetter(props, displayName);
492
+ }
493
+
494
+ if (ref) {
495
+ defineRefPropWarningGetter(props, displayName);
496
+ }
497
+ }
498
+
499
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
500
+ }
501
+ }
502
+
503
+ // Helpers to patch console.logs to avoid logging during side-effect free
504
+ // replaying on render function. This currently only patches the object
505
+ // lazily which won't cover if the log function was extracted eagerly.
506
+ // We could also eagerly patch the method.
507
+ var disabledDepth = 0;
508
+ var prevLog;
509
+ var prevInfo;
510
+ var prevWarn;
511
+ var prevError;
512
+
513
+ function disabledLog() {}
514
+
515
+ function disableLogs() {
516
+ {
517
+ if (disabledDepth === 0) {
518
+ /* eslint-disable react-internal/no-production-logging */
519
+ prevLog = console.log;
520
+ prevInfo = console.info;
521
+ prevWarn = console.warn;
522
+ prevError = console.error; // $FlowFixMe Flow thinks console is immutable.
523
+
524
+ console.log = console.info = console.warn = console.error = disabledLog;
525
+ /* eslint-enable react-internal/no-production-logging */
526
+ }
527
+
528
+ disabledDepth++;
529
+ }
530
+ }
531
+ function reenableLogs() {
532
+ {
533
+ disabledDepth--;
534
+
535
+ if (disabledDepth === 0) {
536
+ /* eslint-disable react-internal/no-production-logging */
537
+ // $FlowFixMe Flow thinks console is immutable.
538
+ console.log = prevLog; // $FlowFixMe Flow thinks console is immutable.
539
+
540
+ console.info = prevInfo; // $FlowFixMe Flow thinks console is immutable.
541
+
542
+ console.warn = prevWarn; // $FlowFixMe Flow thinks console is immutable.
543
+
544
+ console.error = prevError;
545
+ /* eslint-enable react-internal/no-production-logging */
546
+ }
547
+
548
+ if (disabledDepth < 0) {
549
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
550
+ }
551
+ }
552
+ }
553
+
554
+ var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
555
+ var prefix;
556
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
557
+ {
558
+ if (prefix === undefined) {
559
+ // Extract the VM specific prefix used by each line.
560
+ try {
561
+ throw Error();
562
+ } catch (x) {
563
+ var match = x.stack.trim().match(/\n( *(at )?)/);
564
+ prefix = match && match[1] || '';
565
+ }
566
+ } // We use the prefix to ensure our stacks line up with native stack frames.
567
+
568
+
569
+ return '\n' + prefix + name;
570
+ }
571
+ }
572
+ var reentry = false;
573
+ var componentFrameCache;
574
+
575
+ {
576
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
577
+ componentFrameCache = new PossiblyWeakMap();
578
+ }
579
+
580
+ function describeNativeComponentFrame(fn, construct) {
581
+ // If something asked for a stack inside a fake render, it should get ignored.
582
+ if (!fn || reentry) {
583
+ return '';
584
+ }
585
+
586
+ {
587
+ var frame = componentFrameCache.get(fn);
588
+
589
+ if (frame !== undefined) {
590
+ return frame;
591
+ }
592
+ }
593
+
594
+ var control;
595
+ reentry = true;
596
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
597
+
598
+ Error.prepareStackTrace = undefined;
599
+ var previousDispatcher;
600
+
601
+ {
602
+ previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function
603
+ // for warnings.
604
+
605
+ ReactCurrentDispatcher.current = null;
606
+ disableLogs();
607
+ }
608
+
609
+ try {
610
+ // This should throw.
611
+ if (construct) {
612
+ // Something should be setting the props in the constructor.
613
+ var Fake = function () {
614
+ throw Error();
615
+ }; // $FlowFixMe
616
+
617
+
618
+ Object.defineProperty(Fake.prototype, 'props', {
619
+ set: function () {
620
+ // We use a throwing setter instead of frozen or non-writable props
621
+ // because that won't throw in a non-strict mode function.
622
+ throw Error();
623
+ }
624
+ });
625
+
626
+ if (typeof Reflect === 'object' && Reflect.construct) {
627
+ // We construct a different control for this case to include any extra
628
+ // frames added by the construct call.
629
+ try {
630
+ Reflect.construct(Fake, []);
631
+ } catch (x) {
632
+ control = x;
633
+ }
634
+
635
+ Reflect.construct(fn, [], Fake);
636
+ } else {
637
+ try {
638
+ Fake.call();
639
+ } catch (x) {
640
+ control = x;
641
+ }
642
+
643
+ fn.call(Fake.prototype);
644
+ }
645
+ } else {
646
+ try {
647
+ throw Error();
648
+ } catch (x) {
649
+ control = x;
650
+ }
651
+
652
+ fn();
653
+ }
654
+ } catch (sample) {
655
+ // This is inlined manually because closure doesn't do it for us.
656
+ if (sample && control && typeof sample.stack === 'string') {
657
+ // This extracts the first frame from the sample that isn't also in the control.
658
+ // Skipping one frame that we assume is the frame that calls the two.
659
+ var sampleLines = sample.stack.split('\n');
660
+ var controlLines = control.stack.split('\n');
661
+ var s = sampleLines.length - 1;
662
+ var c = controlLines.length - 1;
663
+
664
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
665
+ // We expect at least one stack frame to be shared.
666
+ // Typically this will be the root most one. However, stack frames may be
667
+ // cut off due to maximum stack limits. In this case, one maybe cut off
668
+ // earlier than the other. We assume that the sample is longer or the same
669
+ // and there for cut off earlier. So we should find the root most frame in
670
+ // the sample somewhere in the control.
671
+ c--;
672
+ }
673
+
674
+ for (; s >= 1 && c >= 0; s--, c--) {
675
+ // Next we find the first one that isn't the same which should be the
676
+ // frame that called our sample function and the control.
677
+ if (sampleLines[s] !== controlLines[c]) {
678
+ // In V8, the first line is describing the message but other VMs don't.
679
+ // If we're about to return the first line, and the control is also on the same
680
+ // line, that's a pretty good indicator that our sample threw at same line as
681
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
682
+ // This can happen if you passed a class to function component, or non-function.
683
+ if (s !== 1 || c !== 1) {
684
+ do {
685
+ s--;
686
+ c--; // We may still have similar intermediate frames from the construct call.
687
+ // The next one that isn't the same should be our match though.
688
+
689
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
690
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
691
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
692
+
693
+ {
694
+ if (typeof fn === 'function') {
695
+ componentFrameCache.set(fn, _frame);
696
+ }
697
+ } // Return the line we found.
698
+
699
+
700
+ return _frame;
701
+ }
702
+ } while (s >= 1 && c >= 0);
703
+ }
704
+
705
+ break;
706
+ }
707
+ }
708
+ }
709
+ } finally {
710
+ reentry = false;
711
+
712
+ {
713
+ ReactCurrentDispatcher.current = previousDispatcher;
714
+ reenableLogs();
715
+ }
716
+
717
+ Error.prepareStackTrace = previousPrepareStackTrace;
718
+ } // Fallback to just using the name if we couldn't make it throw.
719
+
720
+
721
+ var name = fn ? fn.displayName || fn.name : '';
722
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
723
+
724
+ {
725
+ if (typeof fn === 'function') {
726
+ componentFrameCache.set(fn, syntheticFrame);
727
+ }
728
+ }
729
+
730
+ return syntheticFrame;
731
+ }
732
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
733
+ {
734
+ return describeNativeComponentFrame(fn, false);
735
+ }
736
+ }
737
+
738
+ function shouldConstruct(Component) {
739
+ var prototype = Component.prototype;
740
+ return !!(prototype && prototype.isReactComponent);
741
+ }
742
+
743
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
744
+
745
+ if (type == null) {
746
+ return '';
747
+ }
748
+
749
+ if (typeof type === 'function') {
750
+ {
751
+ return describeNativeComponentFrame(type, shouldConstruct(type));
752
+ }
753
+ }
754
+
755
+ if (typeof type === 'string') {
756
+ return describeBuiltInComponentFrame(type);
757
+ }
758
+
759
+ switch (type) {
760
+ case REACT_SUSPENSE_TYPE:
761
+ return describeBuiltInComponentFrame('Suspense');
762
+
763
+ case REACT_SUSPENSE_LIST_TYPE:
764
+ return describeBuiltInComponentFrame('SuspenseList');
765
+ }
766
+
767
+ if (typeof type === 'object') {
768
+ switch (type.$$typeof) {
769
+ case REACT_FORWARD_REF_TYPE:
770
+ return describeFunctionComponentFrame(type.render);
771
+
772
+ case REACT_MEMO_TYPE:
773
+ // Memo may contain any component type so we recursively resolve it.
774
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
775
+
776
+ case REACT_BLOCK_TYPE:
777
+ return describeFunctionComponentFrame(type._render);
778
+
779
+ case REACT_LAZY_TYPE:
780
+ {
781
+ var lazyComponent = type;
782
+ var payload = lazyComponent._payload;
783
+ var init = lazyComponent._init;
784
+
785
+ try {
786
+ // Lazy may contain any component type so we recursively resolve it.
787
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
788
+ } catch (x) {}
789
+ }
790
+ }
791
+ }
792
+
793
+ return '';
794
+ }
795
+
796
+ var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
797
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
798
+
799
+ function setCurrentlyValidatingElement(element) {
800
+ {
801
+ if (element) {
802
+ var owner = element._owner;
803
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
804
+ ReactDebugCurrentFrame.setExtraStackFrame(stack);
805
+ } else {
806
+ ReactDebugCurrentFrame.setExtraStackFrame(null);
807
+ }
808
+ }
809
+ }
810
+
811
+ var propTypesMisspellWarningShown;
812
+
813
+ {
814
+ propTypesMisspellWarningShown = false;
815
+ }
816
+ /**
817
+ * Verifies the object is a ReactElement.
818
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
819
+ * @param {?object} object
820
+ * @return {boolean} True if `object` is a ReactElement.
821
+ * @final
822
+ */
823
+
824
+ function isValidElement(object) {
825
+ {
826
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
827
+ }
828
+ }
829
+
830
+ function getDeclarationErrorAddendum() {
831
+ {
832
+ if (ReactCurrentOwner$1.current) {
833
+ var name = getComponentName(ReactCurrentOwner$1.current.type);
834
+
835
+ if (name) {
836
+ return '\n\nCheck the render method of `' + name + '`.';
837
+ }
838
+ }
839
+
840
+ return '';
841
+ }
842
+ }
843
+
844
+ function getSourceInfoErrorAddendum(source) {
845
+ {
846
+ if (source !== undefined) {
847
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
848
+ var lineNumber = source.lineNumber;
849
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
850
+ }
851
+
852
+ return '';
853
+ }
854
+ }
855
+ /**
856
+ * Warn if there's no key explicitly set on dynamic arrays of children or
857
+ * object keys are not valid. This allows us to keep track of children between
858
+ * updates.
859
+ */
860
+
861
+
862
+ var ownerHasKeyUseWarning = {};
863
+
864
+ function getCurrentComponentErrorInfo(parentType) {
865
+ {
866
+ var info = getDeclarationErrorAddendum();
867
+
868
+ if (!info) {
869
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
870
+
871
+ if (parentName) {
872
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
873
+ }
874
+ }
875
+
876
+ return info;
877
+ }
878
+ }
879
+ /**
880
+ * Warn if the element doesn't have an explicit key assigned to it.
881
+ * This element is in an array. The array could grow and shrink or be
882
+ * reordered. All children that haven't already been validated are required to
883
+ * have a "key" property assigned to it. Error statuses are cached so a warning
884
+ * will only be shown once.
885
+ *
886
+ * @internal
887
+ * @param {ReactElement} element Element that requires a key.
888
+ * @param {*} parentType element's parent's type.
889
+ */
890
+
891
+
892
+ function validateExplicitKey(element, parentType) {
893
+ {
894
+ if (!element._store || element._store.validated || element.key != null) {
895
+ return;
896
+ }
897
+
898
+ element._store.validated = true;
899
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
900
+
901
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
902
+ return;
903
+ }
904
+
905
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
906
+ // property, it may be the creator of the child that's responsible for
907
+ // assigning it a key.
908
+
909
+ var childOwner = '';
910
+
911
+ if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
912
+ // Give the component that originally created this child.
913
+ childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
914
+ }
915
+
916
+ setCurrentlyValidatingElement(element);
917
+
918
+ error('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);
919
+
920
+ setCurrentlyValidatingElement(null);
921
+ }
922
+ }
923
+ /**
924
+ * Ensure that every element either is passed in a static location, in an
925
+ * array with an explicit keys property defined, or in an object literal
926
+ * with valid key property.
927
+ *
928
+ * @internal
929
+ * @param {ReactNode} node Statically passed child of any type.
930
+ * @param {*} parentType node's parent's type.
931
+ */
932
+
933
+
934
+ function validateChildKeys(node, parentType) {
935
+ {
936
+ if (typeof node !== 'object') {
937
+ return;
938
+ }
939
+
940
+ if (Array.isArray(node)) {
941
+ for (var i = 0; i < node.length; i++) {
942
+ var child = node[i];
943
+
944
+ if (isValidElement(child)) {
945
+ validateExplicitKey(child, parentType);
946
+ }
947
+ }
948
+ } else if (isValidElement(node)) {
949
+ // This element was passed in a valid location.
950
+ if (node._store) {
951
+ node._store.validated = true;
952
+ }
953
+ } else if (node) {
954
+ var iteratorFn = getIteratorFn(node);
955
+
956
+ if (typeof iteratorFn === 'function') {
957
+ // Entry iterators used to provide implicit keys,
958
+ // but now we print a separate warning for them later.
959
+ if (iteratorFn !== node.entries) {
960
+ var iterator = iteratorFn.call(node);
961
+ var step;
962
+
963
+ while (!(step = iterator.next()).done) {
964
+ if (isValidElement(step.value)) {
965
+ validateExplicitKey(step.value, parentType);
966
+ }
967
+ }
968
+ }
969
+ }
970
+ }
971
+ }
972
+ }
973
+ /**
974
+ * Given an element, validate that its props follow the propTypes definition,
975
+ * provided by the type.
976
+ *
977
+ * @param {ReactElement} element
978
+ */
979
+
980
+
981
+ function validatePropTypes(element) {
982
+ {
983
+ var type = element.type;
984
+
985
+ if (type === null || type === undefined || typeof type === 'string') {
986
+ return;
987
+ }
988
+
989
+ var name = getComponentName(type);
990
+ var propTypes;
991
+
992
+ if (typeof type === 'function') {
993
+ propTypes = type.propTypes;
994
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
995
+ // Inner props are checked in the reconciler.
996
+ type.$$typeof === REACT_MEMO_TYPE)) {
997
+ propTypes = type.propTypes;
998
+ } else {
999
+ return;
1000
+ }
1001
+
1002
+ if (propTypes) {
1003
+ setCurrentlyValidatingElement(element);
1004
+ checkPropTypes(propTypes, element.props, 'prop', name);
1005
+ setCurrentlyValidatingElement(null);
1006
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
1007
+ propTypesMisspellWarningShown = true;
1008
+
1009
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', name || 'Unknown');
1010
+ }
1011
+
1012
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
1013
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
1014
+ }
1015
+ }
1016
+ }
1017
+ /**
1018
+ * Given a fragment, validate that it can only be provided with fragment props
1019
+ * @param {ReactElement} fragment
1020
+ */
1021
+
1022
+
1023
+ function validateFragmentProps(fragment) {
1024
+ {
1025
+ setCurrentlyValidatingElement(fragment);
1026
+ var keys = Object.keys(fragment.props);
1027
+
1028
+ for (var i = 0; i < keys.length; i++) {
1029
+ var key = keys[i];
1030
+
1031
+ if (key !== 'children' && key !== 'key') {
1032
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
1033
+
1034
+ break;
1035
+ }
1036
+ }
1037
+
1038
+ if (fragment.ref !== null) {
1039
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
1040
+ }
1041
+
1042
+ setCurrentlyValidatingElement(null);
1043
+ }
1044
+ }
1045
+
1046
+ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
1047
+ {
1048
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
1049
+ // succeed and there will likely be errors in render.
1050
+
1051
+ if (!validType) {
1052
+ var info = '';
1053
+
1054
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
1055
+ 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.";
1056
+ }
1057
+
1058
+ var sourceInfo = getSourceInfoErrorAddendum(source);
1059
+
1060
+ if (sourceInfo) {
1061
+ info += sourceInfo;
1062
+ } else {
1063
+ info += getDeclarationErrorAddendum();
1064
+ }
1065
+
1066
+ var typeString;
1067
+
1068
+ if (type === null) {
1069
+ typeString = 'null';
1070
+ } else if (Array.isArray(type)) {
1071
+ typeString = 'array';
1072
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
1073
+ typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
1074
+ info = ' Did you accidentally export a JSX literal instead of a component?';
1075
+ } else {
1076
+ typeString = typeof type;
1077
+ }
1078
+
1079
+ error('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);
1080
+ }
1081
+
1082
+ var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1083
+ // TODO: Drop this when these are no longer allowed as the type argument.
1084
+
1085
+ if (element == null) {
1086
+ return element;
1087
+ } // Skip key warning if the type isn't valid since our key validation logic
1088
+ // doesn't expect a non-string/function type and can throw confusing errors.
1089
+ // We don't want exception behavior to differ between dev and prod.
1090
+ // (Rendering will throw with a helpful message and as soon as the type is
1091
+ // fixed, the key warnings will appear.)
1092
+
1093
+
1094
+ if (validType) {
1095
+ var children = props.children;
1096
+
1097
+ if (children !== undefined) {
1098
+ if (isStaticChildren) {
1099
+ if (Array.isArray(children)) {
1100
+ for (var i = 0; i < children.length; i++) {
1101
+ validateChildKeys(children[i], type);
1102
+ }
1103
+
1104
+ if (Object.freeze) {
1105
+ Object.freeze(children);
1106
+ }
1107
+ } else {
1108
+ error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
1109
+ }
1110
+ } else {
1111
+ validateChildKeys(children, type);
1112
+ }
1113
+ }
1114
+ }
1115
+
1116
+ if (type === exports.Fragment) {
1117
+ validateFragmentProps(element);
1118
+ } else {
1119
+ validatePropTypes(element);
1120
+ }
1121
+
1122
+ return element;
1123
+ }
1124
+ } // These two functions exist to still get child warnings in dev
1125
+
1126
+ var jsxDEV$1 = jsxWithValidation ;
1127
+
1128
+ exports.jsxDEV = jsxDEV$1;
1129
+ })();
1130
+ }