@usecsv/react 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js ADDED
@@ -0,0 +1,3106 @@
1
+ /*!
2
+ * @usecsv/react v0.0.1
3
+ * (c) layercode
4
+ * Released under the MIT License.
5
+ */
6
+
7
+ 'use strict';
8
+
9
+ /*!
10
+ * @usecsv/js v0.0.11
11
+ * (c) layercode
12
+ * Released under the MIT License.
13
+ */
14
+
15
+ var containers = []; // will store container HTMLElement references
16
+ var styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}
17
+
18
+ var usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';
19
+
20
+ function insertCss(css, options) {
21
+ options = options || {};
22
+
23
+ if (css === undefined) {
24
+ throw new Error(usage);
25
+ }
26
+
27
+ var position = options.prepend === true ? 'prepend' : 'append';
28
+ var container = options.container !== undefined ? options.container : document.querySelector('head');
29
+ var containerId = containers.indexOf(container);
30
+
31
+ // first time we see this container, create the necessary entries
32
+ if (containerId === -1) {
33
+ containerId = containers.push(container) - 1;
34
+ styleElements[containerId] = {};
35
+ }
36
+
37
+ // try to get the correponding container + position styleElement, create it otherwise
38
+ var styleElement;
39
+
40
+ if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {
41
+ styleElement = styleElements[containerId][position];
42
+ } else {
43
+ styleElement = styleElements[containerId][position] = createStyleElement();
44
+
45
+ if (position === 'prepend') {
46
+ container.insertBefore(styleElement, container.childNodes[0]);
47
+ } else {
48
+ container.appendChild(styleElement);
49
+ }
50
+ }
51
+
52
+ // strip potential UTF-8 BOM if css was read from a file
53
+ if (css.charCodeAt(0) === 0xFEFF) { css = css.substr(1, css.length); }
54
+
55
+ // actually add the stylesheet
56
+ if (styleElement.styleSheet) {
57
+ styleElement.styleSheet.cssText += css;
58
+ } else {
59
+ styleElement.textContent += css;
60
+ }
61
+
62
+ return styleElement;
63
+ }
64
+ function createStyleElement() {
65
+ var styleElement = document.createElement('style');
66
+ styleElement.setAttribute('type', 'text/css');
67
+ return styleElement;
68
+ }
69
+
70
+ var insertCss_1 = insertCss;
71
+ var insertCss_2 = insertCss;
72
+ insertCss_1.insertCss = insertCss_2;
73
+
74
+ var MessageType;
75
+ (function (MessageType) {
76
+ MessageType["Call"] = "call";
77
+ MessageType["Reply"] = "reply";
78
+ MessageType["Syn"] = "syn";
79
+ MessageType["SynAck"] = "synAck";
80
+ MessageType["Ack"] = "ack";
81
+ })(MessageType || (MessageType = {}));
82
+ var Resolution;
83
+ (function (Resolution) {
84
+ Resolution["Fulfilled"] = "fulfilled";
85
+ Resolution["Rejected"] = "rejected";
86
+ })(Resolution || (Resolution = {}));
87
+ var ErrorCode;
88
+ (function (ErrorCode) {
89
+ ErrorCode["ConnectionDestroyed"] = "ConnectionDestroyed";
90
+ ErrorCode["ConnectionTimeout"] = "ConnectionTimeout";
91
+ ErrorCode["NoIframeSrc"] = "NoIframeSrc";
92
+ })(ErrorCode || (ErrorCode = {}));
93
+ var NativeErrorName;
94
+ (function (NativeErrorName) {
95
+ NativeErrorName["DataCloneError"] = "DataCloneError";
96
+ })(NativeErrorName || (NativeErrorName = {}));
97
+ var NativeEventType;
98
+ (function (NativeEventType) {
99
+ NativeEventType["Message"] = "message";
100
+ })(NativeEventType || (NativeEventType = {}));
101
+
102
+ var createDestructor = (localName, log) => {
103
+ const callbacks = [];
104
+ let destroyed = false;
105
+ return {
106
+ destroy(error) {
107
+ if (!destroyed) {
108
+ destroyed = true;
109
+ log(`${localName}: Destroying connection`);
110
+ callbacks.forEach((callback) => {
111
+ callback(error);
112
+ });
113
+ }
114
+ },
115
+ onDestroy(callback) {
116
+ destroyed ? callback() : callbacks.push(callback);
117
+ },
118
+ };
119
+ };
120
+
121
+ var createLogger = (debug) => {
122
+ /**
123
+ * Logs a message if debug is enabled.
124
+ */
125
+ return (...args) => {
126
+ if (debug) {
127
+ console.log('[Penpal]', ...args); // eslint-disable-line no-console
128
+ }
129
+ };
130
+ };
131
+
132
+ const DEFAULT_PORT_BY_PROTOCOL = {
133
+ 'http:': '80',
134
+ 'https:': '443',
135
+ };
136
+ const URL_REGEX = /^(https?:)?\/\/([^/:]+)?(:(\d+))?/;
137
+ const opaqueOriginSchemes = ['file:', 'data:'];
138
+ /**
139
+ * Converts a src value into an origin.
140
+ */
141
+ var getOriginFromSrc = (src) => {
142
+ if (src && opaqueOriginSchemes.find((scheme) => src.startsWith(scheme))) {
143
+ // The origin of the child document is an opaque origin and its
144
+ // serialization is "null"
145
+ // https://html.spec.whatwg.org/multipage/origin.html#origin
146
+ return 'null';
147
+ }
148
+ // Note that if src is undefined, then srcdoc is being used instead of src
149
+ // and we can follow this same logic below to get the origin of the parent,
150
+ // which is the origin that we will need to use.
151
+ const location = document.location;
152
+ const regexResult = URL_REGEX.exec(src);
153
+ let protocol;
154
+ let hostname;
155
+ let port;
156
+ if (regexResult) {
157
+ // It's an absolute URL. Use the parsed info.
158
+ // regexResult[1] will be undefined if the URL starts with //
159
+ protocol = regexResult[1] ? regexResult[1] : location.protocol;
160
+ hostname = regexResult[2];
161
+ port = regexResult[4];
162
+ }
163
+ else {
164
+ // It's a relative path. Use the current location's info.
165
+ protocol = location.protocol;
166
+ hostname = location.hostname;
167
+ port = location.port;
168
+ }
169
+ // If the port is the default for the protocol, we don't want to add it to the origin string
170
+ // or it won't match the message's event.origin.
171
+ const portSuffix = port && port !== DEFAULT_PORT_BY_PROTOCOL[protocol] ? `:${port}` : '';
172
+ return `${protocol}//${hostname}${portSuffix}`;
173
+ };
174
+
175
+ /**
176
+ * Converts an error object into a plain object.
177
+ */
178
+ const serializeError = ({ name, message, stack, }) => ({
179
+ name,
180
+ message,
181
+ stack,
182
+ });
183
+ /**
184
+ * Converts a plain object into an error object.
185
+ */
186
+ const deserializeError = (obj) => {
187
+ const deserializedError = new Error();
188
+ // @ts-ignore
189
+ Object.keys(obj).forEach((key) => (deserializedError[key] = obj[key]));
190
+ return deserializedError;
191
+ };
192
+
193
+ /**
194
+ * Listens for "call" messages coming from the remote, executes the corresponding method, and
195
+ * responds with the return value.
196
+ */
197
+ var connectCallReceiver = (info, methods, log) => {
198
+ const { localName, local, remote, originForSending, originForReceiving, } = info;
199
+ let destroyed = false;
200
+ const handleMessageEvent = (event) => {
201
+ if (event.source !== remote || event.data.penpal !== MessageType.Call) {
202
+ return;
203
+ }
204
+ if (event.origin !== originForReceiving) {
205
+ log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);
206
+ return;
207
+ }
208
+ const callMessage = event.data;
209
+ const { methodName, args, id } = callMessage;
210
+ log(`${localName}: Received ${methodName}() call`);
211
+ const createPromiseHandler = (resolution) => {
212
+ return (returnValue) => {
213
+ log(`${localName}: Sending ${methodName}() reply`);
214
+ if (destroyed) {
215
+ // It's possible to throw an error here, but it would need to be thrown asynchronously
216
+ // and would only be catchable using window.onerror. This is because the consumer
217
+ // is merely returning a value from their method and not calling any function
218
+ // that they could wrap in a try-catch. Even if the consumer were to catch the error,
219
+ // the value of doing so is questionable. Instead, we'll just log a message.
220
+ log(`${localName}: Unable to send ${methodName}() reply due to destroyed connection`);
221
+ return;
222
+ }
223
+ const message = {
224
+ penpal: MessageType.Reply,
225
+ id,
226
+ resolution,
227
+ returnValue,
228
+ };
229
+ if (resolution === Resolution.Rejected &&
230
+ returnValue instanceof Error) {
231
+ message.returnValue = serializeError(returnValue);
232
+ message.returnValueIsError = true;
233
+ }
234
+ try {
235
+ remote.postMessage(message, originForSending);
236
+ }
237
+ catch (err) {
238
+ // If a consumer attempts to send an object that's not cloneable (e.g., window),
239
+ // we want to ensure the receiver's promise gets rejected.
240
+ if (err.name === NativeErrorName.DataCloneError) {
241
+ const errorReplyMessage = {
242
+ penpal: MessageType.Reply,
243
+ id,
244
+ resolution: Resolution.Rejected,
245
+ returnValue: serializeError(err),
246
+ returnValueIsError: true,
247
+ };
248
+ remote.postMessage(errorReplyMessage, originForSending);
249
+ }
250
+ throw err;
251
+ }
252
+ };
253
+ };
254
+ new Promise((resolve) => resolve(methods[methodName].apply(methods, args))).then(createPromiseHandler(Resolution.Fulfilled), createPromiseHandler(Resolution.Rejected));
255
+ };
256
+ local.addEventListener(NativeEventType.Message, handleMessageEvent);
257
+ return () => {
258
+ destroyed = true;
259
+ local.removeEventListener(NativeEventType.Message, handleMessageEvent);
260
+ };
261
+ };
262
+
263
+ let id = 0;
264
+ /**
265
+ * @return {number} A unique ID (not universally unique)
266
+ */
267
+ var generateId = () => ++id;
268
+
269
+ /**
270
+ * Augments an object with methods that match those defined by the remote. When these methods are
271
+ * called, a "call" message will be sent to the remote, the remote's corresponding method will be
272
+ * executed, and the method's return value will be returned via a message.
273
+ * @param {Object} callSender Sender object that should be augmented with methods.
274
+ * @param {Object} info Information about the local and remote windows.
275
+ * @param {Array} methodNames Names of methods available to be called on the remote.
276
+ * @param {Promise} destructionPromise A promise resolved when destroy() is called on the penpal
277
+ * connection.
278
+ * @returns {Object} The call sender object with methods that may be called.
279
+ */
280
+ var connectCallSender = (callSender, info, methodNames, destroyConnection, log) => {
281
+ const { localName, local, remote, originForSending, originForReceiving, } = info;
282
+ let destroyed = false;
283
+ log(`${localName}: Connecting call sender`);
284
+ const createMethodProxy = (methodName) => {
285
+ return (...args) => {
286
+ log(`${localName}: Sending ${methodName}() call`);
287
+ // This handles the case where the iframe has been removed from the DOM
288
+ // (and therefore its window closed), the consumer has not yet
289
+ // called destroy(), and the user calls a method exposed by
290
+ // the remote. We detect the iframe has been removed and force
291
+ // a destroy() immediately so that the consumer sees the error saying
292
+ // the connection has been destroyed. We wrap this check in a try catch
293
+ // because Edge throws an "Object expected" error when accessing
294
+ // contentWindow.closed on a contentWindow from an iframe that's been
295
+ // removed from the DOM.
296
+ let iframeRemoved;
297
+ try {
298
+ if (remote.closed) {
299
+ iframeRemoved = true;
300
+ }
301
+ }
302
+ catch (e) {
303
+ iframeRemoved = true;
304
+ }
305
+ if (iframeRemoved) {
306
+ destroyConnection();
307
+ }
308
+ if (destroyed) {
309
+ const error = new Error(`Unable to send ${methodName}() call due ` + `to destroyed connection`);
310
+ error.code = ErrorCode.ConnectionDestroyed;
311
+ throw error;
312
+ }
313
+ return new Promise((resolve, reject) => {
314
+ const id = generateId();
315
+ const handleMessageEvent = (event) => {
316
+ if (event.source !== remote ||
317
+ event.data.penpal !== MessageType.Reply ||
318
+ event.data.id !== id) {
319
+ return;
320
+ }
321
+ if (event.origin !== originForReceiving) {
322
+ log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);
323
+ return;
324
+ }
325
+ const replyMessage = event.data;
326
+ log(`${localName}: Received ${methodName}() reply`);
327
+ local.removeEventListener(NativeEventType.Message, handleMessageEvent);
328
+ let returnValue = replyMessage.returnValue;
329
+ if (replyMessage.returnValueIsError) {
330
+ returnValue = deserializeError(returnValue);
331
+ }
332
+ (replyMessage.resolution === Resolution.Fulfilled ? resolve : reject)(returnValue);
333
+ };
334
+ local.addEventListener(NativeEventType.Message, handleMessageEvent);
335
+ const callMessage = {
336
+ penpal: MessageType.Call,
337
+ id,
338
+ methodName,
339
+ args,
340
+ };
341
+ remote.postMessage(callMessage, originForSending);
342
+ });
343
+ };
344
+ };
345
+ methodNames.reduce((api, methodName) => {
346
+ api[methodName] = createMethodProxy(methodName);
347
+ return api;
348
+ }, callSender);
349
+ return () => {
350
+ destroyed = true;
351
+ };
352
+ };
353
+
354
+ /**
355
+ * Handles an ACK handshake message.
356
+ */
357
+ var handleAckMessageFactory = (methods, childOrigin, originForSending, destructor, log) => {
358
+ const { destroy, onDestroy } = destructor;
359
+ let destroyCallReceiver;
360
+ let receiverMethodNames;
361
+ // We resolve the promise with the call sender. If the child reconnects
362
+ // (for example, after refreshing or navigating to another page that
363
+ // uses Penpal, we'll update the call sender with methods that match the
364
+ // latest provided by the child.
365
+ const callSender = {};
366
+ return (event) => {
367
+ if (event.origin !== childOrigin) {
368
+ log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);
369
+ return;
370
+ }
371
+ log('Parent: Handshake - Received ACK');
372
+ const info = {
373
+ localName: 'Parent',
374
+ local: window,
375
+ remote: event.source,
376
+ originForSending: originForSending,
377
+ originForReceiving: childOrigin,
378
+ };
379
+ // If the child reconnected, we need to destroy the prior call receiver
380
+ // before setting up a new one.
381
+ if (destroyCallReceiver) {
382
+ destroyCallReceiver();
383
+ }
384
+ destroyCallReceiver = connectCallReceiver(info, methods, log);
385
+ onDestroy(destroyCallReceiver);
386
+ // If the child reconnected, we need to remove the methods from the
387
+ // previous call receiver off the sender.
388
+ if (receiverMethodNames) {
389
+ receiverMethodNames.forEach((receiverMethodName) => {
390
+ delete callSender[receiverMethodName];
391
+ });
392
+ }
393
+ receiverMethodNames = event.data.methodNames;
394
+ const destroyCallSender = connectCallSender(callSender, info, receiverMethodNames, destroy, log);
395
+ onDestroy(destroyCallSender);
396
+ return callSender;
397
+ };
398
+ };
399
+
400
+ /**
401
+ * Handles a SYN handshake message.
402
+ */
403
+ var handleSynMessageFactory = (log, methods, childOrigin, originForSending) => {
404
+ return (event) => {
405
+ if (event.origin !== childOrigin) {
406
+ log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);
407
+ return;
408
+ }
409
+ log('Parent: Handshake - Received SYN, responding with SYN-ACK');
410
+ const synAckMessage = {
411
+ penpal: MessageType.SynAck,
412
+ methodNames: Object.keys(methods),
413
+ };
414
+ event.source.postMessage(synAckMessage, originForSending);
415
+ };
416
+ };
417
+
418
+ const CHECK_IFRAME_IN_DOC_INTERVAL = 60000;
419
+ /**
420
+ * Monitors for iframe removal and destroys connection if iframe
421
+ * is found to have been removed from DOM. This is to prevent memory
422
+ * leaks when the iframe is removed from the document and the consumer
423
+ * hasn't called destroy(). Without this, event listeners attached to
424
+ * the window would stick around and since the event handlers have a
425
+ * reference to the iframe in their closures, the iframe would stick
426
+ * around too.
427
+ */
428
+ var monitorIframeRemoval = (iframe, destructor) => {
429
+ const { destroy, onDestroy } = destructor;
430
+ const checkIframeInDocIntervalId = setInterval(() => {
431
+ if (!iframe.isConnected) {
432
+ clearInterval(checkIframeInDocIntervalId);
433
+ destroy();
434
+ }
435
+ }, CHECK_IFRAME_IN_DOC_INTERVAL);
436
+ onDestroy(() => {
437
+ clearInterval(checkIframeInDocIntervalId);
438
+ });
439
+ };
440
+
441
+ /**
442
+ * Starts a timeout and calls the callback with an error
443
+ * if the timeout completes before the stop function is called.
444
+ */
445
+ var startConnectionTimeout = (timeout, callback) => {
446
+ let timeoutId;
447
+ if (timeout !== undefined) {
448
+ timeoutId = window.setTimeout(() => {
449
+ const error = new Error(`Connection timed out after ${timeout}ms`);
450
+ error.code = ErrorCode.ConnectionTimeout;
451
+ callback(error);
452
+ }, timeout);
453
+ }
454
+ return () => {
455
+ clearTimeout(timeoutId);
456
+ };
457
+ };
458
+
459
+ var validateIframeHasSrcOrSrcDoc = (iframe) => {
460
+ if (!iframe.src && !iframe.srcdoc) {
461
+ const error = new Error('Iframe must have src or srcdoc property defined.');
462
+ error.code = ErrorCode.NoIframeSrc;
463
+ throw error;
464
+ }
465
+ };
466
+
467
+ /**
468
+ * Attempts to establish communication with an iframe.
469
+ */
470
+ var connectToChild = (options) => {
471
+ let { iframe, methods = {}, childOrigin, timeout, debug = false } = options;
472
+ const log = createLogger(debug);
473
+ const destructor = createDestructor('Parent', log);
474
+ const { onDestroy, destroy } = destructor;
475
+ if (!childOrigin) {
476
+ validateIframeHasSrcOrSrcDoc(iframe);
477
+ childOrigin = getOriginFromSrc(iframe.src);
478
+ }
479
+ // If event.origin is "null", the remote protocol is file: or data: and we
480
+ // must post messages with "*" as targetOrigin when sending messages.
481
+ // https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#Using_window.postMessage_in_extensions
482
+ const originForSending = childOrigin === 'null' ? '*' : childOrigin;
483
+ const handleSynMessage = handleSynMessageFactory(log, methods, childOrigin, originForSending);
484
+ const handleAckMessage = handleAckMessageFactory(methods, childOrigin, originForSending, destructor, log);
485
+ const promise = new Promise((resolve, reject) => {
486
+ const stopConnectionTimeout = startConnectionTimeout(timeout, destroy);
487
+ const handleMessage = (event) => {
488
+ if (event.source !== iframe.contentWindow || !event.data) {
489
+ return;
490
+ }
491
+ if (event.data.penpal === MessageType.Syn) {
492
+ handleSynMessage(event);
493
+ return;
494
+ }
495
+ if (event.data.penpal === MessageType.Ack) {
496
+ const callSender = handleAckMessage(event);
497
+ if (callSender) {
498
+ stopConnectionTimeout();
499
+ resolve(callSender);
500
+ }
501
+ return;
502
+ }
503
+ };
504
+ window.addEventListener(NativeEventType.Message, handleMessage);
505
+ log('Parent: Awaiting handshake');
506
+ monitorIframeRemoval(iframe, destructor);
507
+ onDestroy((error) => {
508
+ window.removeEventListener(NativeEventType.Message, handleMessage);
509
+ if (error) {
510
+ reject(error);
511
+ }
512
+ });
513
+ });
514
+ return {
515
+ promise,
516
+ destroy() {
517
+ // Don't allow consumer to pass an error into destroy.
518
+ destroy();
519
+ },
520
+ };
521
+ };
522
+
523
+ /* eslint no-void: "off" */
524
+
525
+ // Loaded ready states
526
+ var loadedStates = ['interactive', 'complete'];
527
+
528
+ // Return Promise
529
+ var whenDomReady = function whenDomReady(cb, doc) {
530
+ return new Promise(function (resolve) {
531
+ // Allow doc to be passed in as the lone first param
532
+ if (cb && typeof cb !== 'function') {
533
+ doc = cb;
534
+ cb = null;
535
+ }
536
+
537
+ // Use global document if we don't have one
538
+ doc = doc || window.document;
539
+
540
+ // Handle DOM load
541
+ var done = function done() {
542
+ return resolve(void (cb && setTimeout(cb)));
543
+ };
544
+
545
+ // Resolve now if DOM has already loaded
546
+ // Otherwise wait for DOMContentLoaded
547
+ if (loadedStates.indexOf(doc.readyState) !== -1) {
548
+ done();
549
+ } else {
550
+ doc.addEventListener('DOMContentLoaded', done);
551
+ }
552
+ });
553
+ };
554
+
555
+ // Promise chain helper
556
+ whenDomReady.resume = function (doc) {
557
+ return function (val) {
558
+ return whenDomReady(doc).then(function () {
559
+ return val;
560
+ });
561
+ };
562
+ };
563
+
564
+ // eslint-disable-next-line dot-notation
565
+ var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
566
+ var insertIframe = function (id) {
567
+ var _a;
568
+ insertCss_2("\n .usecsv_container {\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 100000;\n }\n .usecsv_container iframe {\n width: 100%;\n height: 100%;\n position: absolute;\n border-width: 0;\n }\n .usecsv_container {\n overflow: hidden;\n overscroll-behavior-x: none;\n }\n");
569
+ document.body.insertAdjacentHTML("beforeend", "<div id=" + id + " class=\"usecsv_container loading\">\n</div>");
570
+ var iframe = document.createElement("iframe");
571
+ iframe.setAttribute("src", MOUNT_URL);
572
+ (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.appendChild(iframe);
573
+ return iframe;
574
+ };
575
+ var useCsvPlugin = function (_a) {
576
+ var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata;
577
+ var id = "usecsv-" + Math.round(Math.random() * 100000000);
578
+ return whenDomReady().then(function () {
579
+ var iframe = insertIframe(id);
580
+ var iframeConnection = connectToChild({
581
+ iframe: iframe,
582
+ });
583
+ iframeConnection.promise.then(function (child) {
584
+ var _a;
585
+ (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.classList.remove("loading");
586
+ // eslint-disable-next-line dot-notation
587
+ child["setParams"] && child["setParams"]({ importerKey: importerKey, user: user, metadata: metadata });
588
+ });
589
+ return iframeConnection;
590
+ });
591
+ };
592
+
593
+ function createCommonjsModule(fn, module) {
594
+ return module = { exports: {} }, fn(module, module.exports), module.exports;
595
+ }
596
+
597
+ /*
598
+ object-assign
599
+ (c) Sindre Sorhus
600
+ @license MIT
601
+ */
602
+ /* eslint-disable no-unused-vars */
603
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
604
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
605
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
606
+
607
+ function toObject(val) {
608
+ if (val === null || val === undefined) {
609
+ throw new TypeError('Object.assign cannot be called with null or undefined');
610
+ }
611
+
612
+ return Object(val);
613
+ }
614
+
615
+ function shouldUseNative() {
616
+ try {
617
+ if (!Object.assign) {
618
+ return false;
619
+ }
620
+
621
+ // Detect buggy property enumeration order in older V8 versions.
622
+
623
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
624
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
625
+ test1[5] = 'de';
626
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
627
+ return false;
628
+ }
629
+
630
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
631
+ var test2 = {};
632
+ for (var i = 0; i < 10; i++) {
633
+ test2['_' + String.fromCharCode(i)] = i;
634
+ }
635
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
636
+ return test2[n];
637
+ });
638
+ if (order2.join('') !== '0123456789') {
639
+ return false;
640
+ }
641
+
642
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
643
+ var test3 = {};
644
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
645
+ test3[letter] = letter;
646
+ });
647
+ if (Object.keys(Object.assign({}, test3)).join('') !==
648
+ 'abcdefghijklmnopqrst') {
649
+ return false;
650
+ }
651
+
652
+ return true;
653
+ } catch (err) {
654
+ // We don't expect any of the above to throw, but better to be safe.
655
+ return false;
656
+ }
657
+ }
658
+
659
+ var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
660
+ var from;
661
+ var to = toObject(target);
662
+ var symbols;
663
+
664
+ for (var s = 1; s < arguments.length; s++) {
665
+ from = Object(arguments[s]);
666
+
667
+ for (var key in from) {
668
+ if (hasOwnProperty.call(from, key)) {
669
+ to[key] = from[key];
670
+ }
671
+ }
672
+
673
+ if (getOwnPropertySymbols) {
674
+ symbols = getOwnPropertySymbols(from);
675
+ for (var i = 0; i < symbols.length; i++) {
676
+ if (propIsEnumerable.call(from, symbols[i])) {
677
+ to[symbols[i]] = from[symbols[i]];
678
+ }
679
+ }
680
+ }
681
+ }
682
+
683
+ return to;
684
+ };
685
+
686
+ var react_production_min = createCommonjsModule(function (module, exports) {
687
+ var n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;
688
+ if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;
689
+ function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(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."}
690
+ var A={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState");};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
691
+ function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}var F=E.prototype=new D;F.constructor=E;objectAssign(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
692
+ function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f;}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return {$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
693
+ function K(a,b){return {$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return "object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
694
+ function O(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case n:case p:h=!0;}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
695
+ 0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d);}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
696
+ function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;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);});}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:objectAssign};
697
+ exports.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments);},c);},count:function(a){var b=0;P(a,function(){b++;});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};exports.Component=C;exports.PureComponent=E;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
698
+ exports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=objectAssign({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g;}return {$$typeof:n,type:a.type,
699
+ key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=J;exports.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};exports.createRef=function(){return {current:null}};exports.forwardRef=function(a){return {$$typeof:t,render:a}};exports.isValidElement=L;
700
+ exports.lazy=function(a){return {$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};exports.memo=function(a,b){return {$$typeof:u,type:a,compare:void 0===b?null:b}};exports.useCallback=function(a,b){return S().useCallback(a,b)};exports.useContext=function(a,b){return S().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return S().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
701
+ exports.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S().useMemo(a,b)};exports.useReducer=function(a,b,c){return S().useReducer(a,b,c)};exports.useRef=function(a){return S().useRef(a)};exports.useState=function(a){return S().useState(a)};exports.version="17.0.2";
702
+ });
703
+ react_production_min.Fragment;
704
+ react_production_min.StrictMode;
705
+ react_production_min.Profiler;
706
+ react_production_min.Suspense;
707
+ react_production_min.Children;
708
+ react_production_min.Component;
709
+ react_production_min.PureComponent;
710
+ react_production_min.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
711
+ react_production_min.cloneElement;
712
+ react_production_min.createContext;
713
+ react_production_min.createElement;
714
+ react_production_min.createFactory;
715
+ react_production_min.createRef;
716
+ react_production_min.forwardRef;
717
+ react_production_min.isValidElement;
718
+ react_production_min.lazy;
719
+ react_production_min.memo;
720
+ react_production_min.useCallback;
721
+ react_production_min.useContext;
722
+ react_production_min.useDebugValue;
723
+ react_production_min.useEffect;
724
+ react_production_min.useImperativeHandle;
725
+ react_production_min.useLayoutEffect;
726
+ react_production_min.useMemo;
727
+ react_production_min.useReducer;
728
+ react_production_min.useRef;
729
+ react_production_min.useState;
730
+ react_production_min.version;
731
+
732
+ var react_development = createCommonjsModule(function (module, exports) {
733
+
734
+ if (process.env.NODE_ENV !== "production") {
735
+ (function() {
736
+
737
+ var _assign = objectAssign;
738
+
739
+ // TODO: this is special because it gets imported during build.
740
+ var ReactVersion = '17.0.2';
741
+
742
+ // ATTENTION
743
+ // When adding new symbols to this file,
744
+ // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
745
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
746
+ // nor polyfill, then a plain number is used for performance.
747
+ var REACT_ELEMENT_TYPE = 0xeac7;
748
+ var REACT_PORTAL_TYPE = 0xeaca;
749
+ exports.Fragment = 0xeacb;
750
+ exports.StrictMode = 0xeacc;
751
+ exports.Profiler = 0xead2;
752
+ var REACT_PROVIDER_TYPE = 0xeacd;
753
+ var REACT_CONTEXT_TYPE = 0xeace;
754
+ var REACT_FORWARD_REF_TYPE = 0xead0;
755
+ exports.Suspense = 0xead1;
756
+ var REACT_SUSPENSE_LIST_TYPE = 0xead8;
757
+ var REACT_MEMO_TYPE = 0xead3;
758
+ var REACT_LAZY_TYPE = 0xead4;
759
+ var REACT_BLOCK_TYPE = 0xead9;
760
+ var REACT_SERVER_BLOCK_TYPE = 0xeada;
761
+ var REACT_FUNDAMENTAL_TYPE = 0xead5;
762
+ var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
763
+ var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
764
+
765
+ if (typeof Symbol === 'function' && Symbol.for) {
766
+ var symbolFor = Symbol.for;
767
+ REACT_ELEMENT_TYPE = symbolFor('react.element');
768
+ REACT_PORTAL_TYPE = symbolFor('react.portal');
769
+ exports.Fragment = symbolFor('react.fragment');
770
+ exports.StrictMode = symbolFor('react.strict_mode');
771
+ exports.Profiler = symbolFor('react.profiler');
772
+ REACT_PROVIDER_TYPE = symbolFor('react.provider');
773
+ REACT_CONTEXT_TYPE = symbolFor('react.context');
774
+ REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
775
+ exports.Suspense = symbolFor('react.suspense');
776
+ REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
777
+ REACT_MEMO_TYPE = symbolFor('react.memo');
778
+ REACT_LAZY_TYPE = symbolFor('react.lazy');
779
+ REACT_BLOCK_TYPE = symbolFor('react.block');
780
+ REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
781
+ REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
782
+ symbolFor('react.scope');
783
+ symbolFor('react.opaque.id');
784
+ REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
785
+ symbolFor('react.offscreen');
786
+ REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
787
+ }
788
+
789
+ var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
790
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
791
+ function getIteratorFn(maybeIterable) {
792
+ if (maybeIterable === null || typeof maybeIterable !== 'object') {
793
+ return null;
794
+ }
795
+
796
+ var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
797
+
798
+ if (typeof maybeIterator === 'function') {
799
+ return maybeIterator;
800
+ }
801
+
802
+ return null;
803
+ }
804
+
805
+ /**
806
+ * Keeps track of the current dispatcher.
807
+ */
808
+ var ReactCurrentDispatcher = {
809
+ /**
810
+ * @internal
811
+ * @type {ReactComponent}
812
+ */
813
+ current: null
814
+ };
815
+
816
+ /**
817
+ * Keeps track of the current batch's configuration such as how long an update
818
+ * should suspend for if it needs to.
819
+ */
820
+ var ReactCurrentBatchConfig = {
821
+ transition: 0
822
+ };
823
+
824
+ /**
825
+ * Keeps track of the current owner.
826
+ *
827
+ * The current owner is the component who should own any components that are
828
+ * currently being constructed.
829
+ */
830
+ var ReactCurrentOwner = {
831
+ /**
832
+ * @internal
833
+ * @type {ReactComponent}
834
+ */
835
+ current: null
836
+ };
837
+
838
+ var ReactDebugCurrentFrame = {};
839
+ var currentExtraStackFrame = null;
840
+ function setExtraStackFrame(stack) {
841
+ {
842
+ currentExtraStackFrame = stack;
843
+ }
844
+ }
845
+
846
+ {
847
+ ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {
848
+ {
849
+ currentExtraStackFrame = stack;
850
+ }
851
+ }; // Stack implementation injected by the current renderer.
852
+
853
+
854
+ ReactDebugCurrentFrame.getCurrentStack = null;
855
+
856
+ ReactDebugCurrentFrame.getStackAddendum = function () {
857
+ var stack = ''; // Add an extra top frame while an element is being validated
858
+
859
+ if (currentExtraStackFrame) {
860
+ stack += currentExtraStackFrame;
861
+ } // Delegate to the injected renderer-specific implementation
862
+
863
+
864
+ var impl = ReactDebugCurrentFrame.getCurrentStack;
865
+
866
+ if (impl) {
867
+ stack += impl() || '';
868
+ }
869
+
870
+ return stack;
871
+ };
872
+ }
873
+
874
+ /**
875
+ * Used by act() to track whether you're inside an act() scope.
876
+ */
877
+ var IsSomeRendererActing = {
878
+ current: false
879
+ };
880
+
881
+ var ReactSharedInternals = {
882
+ ReactCurrentDispatcher: ReactCurrentDispatcher,
883
+ ReactCurrentBatchConfig: ReactCurrentBatchConfig,
884
+ ReactCurrentOwner: ReactCurrentOwner,
885
+ IsSomeRendererActing: IsSomeRendererActing,
886
+ // Used by renderers to avoid bundling object-assign twice in UMD bundles:
887
+ assign: _assign
888
+ };
889
+
890
+ {
891
+ ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
892
+ }
893
+
894
+ // by calls to these methods by a Babel plugin.
895
+ //
896
+ // In PROD (or in packages without access to React internals),
897
+ // they are left as they are instead.
898
+
899
+ function warn(format) {
900
+ {
901
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
902
+ args[_key - 1] = arguments[_key];
903
+ }
904
+
905
+ printWarning('warn', format, args);
906
+ }
907
+ }
908
+ function error(format) {
909
+ {
910
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
911
+ args[_key2 - 1] = arguments[_key2];
912
+ }
913
+
914
+ printWarning('error', format, args);
915
+ }
916
+ }
917
+
918
+ function printWarning(level, format, args) {
919
+ // When changing this logic, you might want to also
920
+ // update consoleWithStackDev.www.js as well.
921
+ {
922
+ var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
923
+ var stack = ReactDebugCurrentFrame.getStackAddendum();
924
+
925
+ if (stack !== '') {
926
+ format += '%s';
927
+ args = args.concat([stack]);
928
+ }
929
+
930
+ var argsWithFormat = args.map(function (item) {
931
+ return '' + item;
932
+ }); // Careful: RN currently depends on this prefix
933
+
934
+ argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
935
+ // breaks IE9: https://github.com/facebook/react/issues/13610
936
+ // eslint-disable-next-line react-internal/no-production-logging
937
+
938
+ Function.prototype.apply.call(console[level], console, argsWithFormat);
939
+ }
940
+ }
941
+
942
+ var didWarnStateUpdateForUnmountedComponent = {};
943
+
944
+ function warnNoop(publicInstance, callerName) {
945
+ {
946
+ var _constructor = publicInstance.constructor;
947
+ var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
948
+ var warningKey = componentName + "." + callerName;
949
+
950
+ if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
951
+ return;
952
+ }
953
+
954
+ error("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);
955
+
956
+ didWarnStateUpdateForUnmountedComponent[warningKey] = true;
957
+ }
958
+ }
959
+ /**
960
+ * This is the abstract API for an update queue.
961
+ */
962
+
963
+
964
+ var ReactNoopUpdateQueue = {
965
+ /**
966
+ * Checks whether or not this composite component is mounted.
967
+ * @param {ReactClass} publicInstance The instance we want to test.
968
+ * @return {boolean} True if mounted, false otherwise.
969
+ * @protected
970
+ * @final
971
+ */
972
+ isMounted: function (publicInstance) {
973
+ return false;
974
+ },
975
+
976
+ /**
977
+ * Forces an update. This should only be invoked when it is known with
978
+ * certainty that we are **not** in a DOM transaction.
979
+ *
980
+ * You may want to call this when you know that some deeper aspect of the
981
+ * component's state has changed but `setState` was not called.
982
+ *
983
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
984
+ * `componentWillUpdate` and `componentDidUpdate`.
985
+ *
986
+ * @param {ReactClass} publicInstance The instance that should rerender.
987
+ * @param {?function} callback Called after component is updated.
988
+ * @param {?string} callerName name of the calling function in the public API.
989
+ * @internal
990
+ */
991
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
992
+ warnNoop(publicInstance, 'forceUpdate');
993
+ },
994
+
995
+ /**
996
+ * Replaces all of the state. Always use this or `setState` to mutate state.
997
+ * You should treat `this.state` as immutable.
998
+ *
999
+ * There is no guarantee that `this.state` will be immediately updated, so
1000
+ * accessing `this.state` after calling this method may return the old value.
1001
+ *
1002
+ * @param {ReactClass} publicInstance The instance that should rerender.
1003
+ * @param {object} completeState Next state.
1004
+ * @param {?function} callback Called after component is updated.
1005
+ * @param {?string} callerName name of the calling function in the public API.
1006
+ * @internal
1007
+ */
1008
+ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {
1009
+ warnNoop(publicInstance, 'replaceState');
1010
+ },
1011
+
1012
+ /**
1013
+ * Sets a subset of the state. This only exists because _pendingState is
1014
+ * internal. This provides a merging strategy that is not available to deep
1015
+ * properties which is confusing. TODO: Expose pendingState or don't use it
1016
+ * during the merge.
1017
+ *
1018
+ * @param {ReactClass} publicInstance The instance that should rerender.
1019
+ * @param {object} partialState Next partial state to be merged with state.
1020
+ * @param {?function} callback Called after component is updated.
1021
+ * @param {?string} Name of the calling function in the public API.
1022
+ * @internal
1023
+ */
1024
+ enqueueSetState: function (publicInstance, partialState, callback, callerName) {
1025
+ warnNoop(publicInstance, 'setState');
1026
+ }
1027
+ };
1028
+
1029
+ var emptyObject = {};
1030
+
1031
+ {
1032
+ Object.freeze(emptyObject);
1033
+ }
1034
+ /**
1035
+ * Base class helpers for the updating state of a component.
1036
+ */
1037
+
1038
+
1039
+ function Component(props, context, updater) {
1040
+ this.props = props;
1041
+ this.context = context; // If a component has string refs, we will assign a different object later.
1042
+
1043
+ this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
1044
+ // renderer.
1045
+
1046
+ this.updater = updater || ReactNoopUpdateQueue;
1047
+ }
1048
+
1049
+ Component.prototype.isReactComponent = {};
1050
+ /**
1051
+ * Sets a subset of the state. Always use this to mutate
1052
+ * state. You should treat `this.state` as immutable.
1053
+ *
1054
+ * There is no guarantee that `this.state` will be immediately updated, so
1055
+ * accessing `this.state` after calling this method may return the old value.
1056
+ *
1057
+ * There is no guarantee that calls to `setState` will run synchronously,
1058
+ * as they may eventually be batched together. You can provide an optional
1059
+ * callback that will be executed when the call to setState is actually
1060
+ * completed.
1061
+ *
1062
+ * When a function is provided to setState, it will be called at some point in
1063
+ * the future (not synchronously). It will be called with the up to date
1064
+ * component arguments (state, props, context). These values can be different
1065
+ * from this.* because your function may be called after receiveProps but before
1066
+ * shouldComponentUpdate, and this new state, props, and context will not yet be
1067
+ * assigned to this.
1068
+ *
1069
+ * @param {object|function} partialState Next partial state or function to
1070
+ * produce next partial state to be merged with current state.
1071
+ * @param {?function} callback Called after state is updated.
1072
+ * @final
1073
+ * @protected
1074
+ */
1075
+
1076
+ Component.prototype.setState = function (partialState, callback) {
1077
+ if (!(typeof partialState === 'object' || typeof partialState === 'function' || partialState == null)) {
1078
+ {
1079
+ throw Error( "setState(...): takes an object of state variables to update or a function which returns an object of state variables." );
1080
+ }
1081
+ }
1082
+
1083
+ this.updater.enqueueSetState(this, partialState, callback, 'setState');
1084
+ };
1085
+ /**
1086
+ * Forces an update. This should only be invoked when it is known with
1087
+ * certainty that we are **not** in a DOM transaction.
1088
+ *
1089
+ * You may want to call this when you know that some deeper aspect of the
1090
+ * component's state has changed but `setState` was not called.
1091
+ *
1092
+ * This will not invoke `shouldComponentUpdate`, but it will invoke
1093
+ * `componentWillUpdate` and `componentDidUpdate`.
1094
+ *
1095
+ * @param {?function} callback Called after update is complete.
1096
+ * @final
1097
+ * @protected
1098
+ */
1099
+
1100
+
1101
+ Component.prototype.forceUpdate = function (callback) {
1102
+ this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
1103
+ };
1104
+ /**
1105
+ * Deprecated APIs. These APIs used to exist on classic React classes but since
1106
+ * we would like to deprecate them, we're not going to move them over to this
1107
+ * modern base class. Instead, we define a getter that warns if it's accessed.
1108
+ */
1109
+
1110
+
1111
+ {
1112
+ var deprecatedAPIs = {
1113
+ isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],
1114
+ replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']
1115
+ };
1116
+
1117
+ var defineDeprecationWarning = function (methodName, info) {
1118
+ Object.defineProperty(Component.prototype, methodName, {
1119
+ get: function () {
1120
+ warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
1121
+
1122
+ return undefined;
1123
+ }
1124
+ });
1125
+ };
1126
+
1127
+ for (var fnName in deprecatedAPIs) {
1128
+ if (deprecatedAPIs.hasOwnProperty(fnName)) {
1129
+ defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
1130
+ }
1131
+ }
1132
+ }
1133
+
1134
+ function ComponentDummy() {}
1135
+
1136
+ ComponentDummy.prototype = Component.prototype;
1137
+ /**
1138
+ * Convenience component with default shallow equality check for sCU.
1139
+ */
1140
+
1141
+ function PureComponent(props, context, updater) {
1142
+ this.props = props;
1143
+ this.context = context; // If a component has string refs, we will assign a different object later.
1144
+
1145
+ this.refs = emptyObject;
1146
+ this.updater = updater || ReactNoopUpdateQueue;
1147
+ }
1148
+
1149
+ var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
1150
+ pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
1151
+
1152
+ _assign(pureComponentPrototype, Component.prototype);
1153
+
1154
+ pureComponentPrototype.isPureReactComponent = true;
1155
+
1156
+ // an immutable object with a single mutable value
1157
+ function createRef() {
1158
+ var refObject = {
1159
+ current: null
1160
+ };
1161
+
1162
+ {
1163
+ Object.seal(refObject);
1164
+ }
1165
+
1166
+ return refObject;
1167
+ }
1168
+
1169
+ function getWrappedName(outerType, innerType, wrapperName) {
1170
+ var functionName = innerType.displayName || innerType.name || '';
1171
+ return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
1172
+ }
1173
+
1174
+ function getContextName(type) {
1175
+ return type.displayName || 'Context';
1176
+ }
1177
+
1178
+ function getComponentName(type) {
1179
+ if (type == null) {
1180
+ // Host root, text node or just invalid type.
1181
+ return null;
1182
+ }
1183
+
1184
+ {
1185
+ if (typeof type.tag === 'number') {
1186
+ error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
1187
+ }
1188
+ }
1189
+
1190
+ if (typeof type === 'function') {
1191
+ return type.displayName || type.name || null;
1192
+ }
1193
+
1194
+ if (typeof type === 'string') {
1195
+ return type;
1196
+ }
1197
+
1198
+ switch (type) {
1199
+ case exports.Fragment:
1200
+ return 'Fragment';
1201
+
1202
+ case REACT_PORTAL_TYPE:
1203
+ return 'Portal';
1204
+
1205
+ case exports.Profiler:
1206
+ return 'Profiler';
1207
+
1208
+ case exports.StrictMode:
1209
+ return 'StrictMode';
1210
+
1211
+ case exports.Suspense:
1212
+ return 'Suspense';
1213
+
1214
+ case REACT_SUSPENSE_LIST_TYPE:
1215
+ return 'SuspenseList';
1216
+ }
1217
+
1218
+ if (typeof type === 'object') {
1219
+ switch (type.$$typeof) {
1220
+ case REACT_CONTEXT_TYPE:
1221
+ var context = type;
1222
+ return getContextName(context) + '.Consumer';
1223
+
1224
+ case REACT_PROVIDER_TYPE:
1225
+ var provider = type;
1226
+ return getContextName(provider._context) + '.Provider';
1227
+
1228
+ case REACT_FORWARD_REF_TYPE:
1229
+ return getWrappedName(type, type.render, 'ForwardRef');
1230
+
1231
+ case REACT_MEMO_TYPE:
1232
+ return getComponentName(type.type);
1233
+
1234
+ case REACT_BLOCK_TYPE:
1235
+ return getComponentName(type._render);
1236
+
1237
+ case REACT_LAZY_TYPE:
1238
+ {
1239
+ var lazyComponent = type;
1240
+ var payload = lazyComponent._payload;
1241
+ var init = lazyComponent._init;
1242
+
1243
+ try {
1244
+ return getComponentName(init(payload));
1245
+ } catch (x) {
1246
+ return null;
1247
+ }
1248
+ }
1249
+ }
1250
+ }
1251
+
1252
+ return null;
1253
+ }
1254
+
1255
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1256
+ var RESERVED_PROPS = {
1257
+ key: true,
1258
+ ref: true,
1259
+ __self: true,
1260
+ __source: true
1261
+ };
1262
+ var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
1263
+
1264
+ {
1265
+ didWarnAboutStringRefs = {};
1266
+ }
1267
+
1268
+ function hasValidRef(config) {
1269
+ {
1270
+ if (hasOwnProperty.call(config, 'ref')) {
1271
+ var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1272
+
1273
+ if (getter && getter.isReactWarning) {
1274
+ return false;
1275
+ }
1276
+ }
1277
+ }
1278
+
1279
+ return config.ref !== undefined;
1280
+ }
1281
+
1282
+ function hasValidKey(config) {
1283
+ {
1284
+ if (hasOwnProperty.call(config, 'key')) {
1285
+ var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1286
+
1287
+ if (getter && getter.isReactWarning) {
1288
+ return false;
1289
+ }
1290
+ }
1291
+ }
1292
+
1293
+ return config.key !== undefined;
1294
+ }
1295
+
1296
+ function defineKeyPropWarningGetter(props, displayName) {
1297
+ var warnAboutAccessingKey = function () {
1298
+ {
1299
+ if (!specialPropKeyWarningShown) {
1300
+ specialPropKeyWarningShown = true;
1301
+
1302
+ 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://reactjs.org/link/special-props)', displayName);
1303
+ }
1304
+ }
1305
+ };
1306
+
1307
+ warnAboutAccessingKey.isReactWarning = true;
1308
+ Object.defineProperty(props, 'key', {
1309
+ get: warnAboutAccessingKey,
1310
+ configurable: true
1311
+ });
1312
+ }
1313
+
1314
+ function defineRefPropWarningGetter(props, displayName) {
1315
+ var warnAboutAccessingRef = function () {
1316
+ {
1317
+ if (!specialPropRefWarningShown) {
1318
+ specialPropRefWarningShown = true;
1319
+
1320
+ 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://reactjs.org/link/special-props)', displayName);
1321
+ }
1322
+ }
1323
+ };
1324
+
1325
+ warnAboutAccessingRef.isReactWarning = true;
1326
+ Object.defineProperty(props, 'ref', {
1327
+ get: warnAboutAccessingRef,
1328
+ configurable: true
1329
+ });
1330
+ }
1331
+
1332
+ function warnIfStringRefCannotBeAutoConverted(config) {
1333
+ {
1334
+ if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
1335
+ var componentName = getComponentName(ReactCurrentOwner.current.type);
1336
+
1337
+ if (!didWarnAboutStringRefs[componentName]) {
1338
+ 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://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
1339
+
1340
+ didWarnAboutStringRefs[componentName] = true;
1341
+ }
1342
+ }
1343
+ }
1344
+ }
1345
+ /**
1346
+ * Factory method to create a new React element. This no longer adheres to
1347
+ * the class pattern, so do not use new to call it. Also, instanceof check
1348
+ * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
1349
+ * if something is a React Element.
1350
+ *
1351
+ * @param {*} type
1352
+ * @param {*} props
1353
+ * @param {*} key
1354
+ * @param {string|object} ref
1355
+ * @param {*} owner
1356
+ * @param {*} self A *temporary* helper to detect places where `this` is
1357
+ * different from the `owner` when React.createElement is called, so that we
1358
+ * can warn. We want to get rid of owner and replace string `ref`s with arrow
1359
+ * functions, and as long as `this` and owner are the same, there will be no
1360
+ * change in behavior.
1361
+ * @param {*} source An annotation object (added by a transpiler or otherwise)
1362
+ * indicating filename, line number, and/or other information.
1363
+ * @internal
1364
+ */
1365
+
1366
+
1367
+ var ReactElement = function (type, key, ref, self, source, owner, props) {
1368
+ var element = {
1369
+ // This tag allows us to uniquely identify this as a React Element
1370
+ $$typeof: REACT_ELEMENT_TYPE,
1371
+ // Built-in properties that belong on the element
1372
+ type: type,
1373
+ key: key,
1374
+ ref: ref,
1375
+ props: props,
1376
+ // Record the component responsible for creating this element.
1377
+ _owner: owner
1378
+ };
1379
+
1380
+ {
1381
+ // The validation flag is currently mutative. We put it on
1382
+ // an external backing store so that we can freeze the whole object.
1383
+ // This can be replaced with a WeakMap once they are implemented in
1384
+ // commonly used development environments.
1385
+ element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1386
+ // the validation flag non-enumerable (where possible, which should
1387
+ // include every environment we run tests in), so the test framework
1388
+ // ignores it.
1389
+
1390
+ Object.defineProperty(element._store, 'validated', {
1391
+ configurable: false,
1392
+ enumerable: false,
1393
+ writable: true,
1394
+ value: false
1395
+ }); // self and source are DEV only properties.
1396
+
1397
+ Object.defineProperty(element, '_self', {
1398
+ configurable: false,
1399
+ enumerable: false,
1400
+ writable: false,
1401
+ value: self
1402
+ }); // Two elements created in two different places should be considered
1403
+ // equal for testing purposes and therefore we hide it from enumeration.
1404
+
1405
+ Object.defineProperty(element, '_source', {
1406
+ configurable: false,
1407
+ enumerable: false,
1408
+ writable: false,
1409
+ value: source
1410
+ });
1411
+
1412
+ if (Object.freeze) {
1413
+ Object.freeze(element.props);
1414
+ Object.freeze(element);
1415
+ }
1416
+ }
1417
+
1418
+ return element;
1419
+ };
1420
+ /**
1421
+ * Create and return a new ReactElement of the given type.
1422
+ * See https://reactjs.org/docs/react-api.html#createelement
1423
+ */
1424
+
1425
+ function createElement(type, config, children) {
1426
+ var propName; // Reserved names are extracted
1427
+
1428
+ var props = {};
1429
+ var key = null;
1430
+ var ref = null;
1431
+ var self = null;
1432
+ var source = null;
1433
+
1434
+ if (config != null) {
1435
+ if (hasValidRef(config)) {
1436
+ ref = config.ref;
1437
+
1438
+ {
1439
+ warnIfStringRefCannotBeAutoConverted(config);
1440
+ }
1441
+ }
1442
+
1443
+ if (hasValidKey(config)) {
1444
+ key = '' + config.key;
1445
+ }
1446
+
1447
+ self = config.__self === undefined ? null : config.__self;
1448
+ source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
1449
+
1450
+ for (propName in config) {
1451
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1452
+ props[propName] = config[propName];
1453
+ }
1454
+ }
1455
+ } // Children can be more than one argument, and those are transferred onto
1456
+ // the newly allocated props object.
1457
+
1458
+
1459
+ var childrenLength = arguments.length - 2;
1460
+
1461
+ if (childrenLength === 1) {
1462
+ props.children = children;
1463
+ } else if (childrenLength > 1) {
1464
+ var childArray = Array(childrenLength);
1465
+
1466
+ for (var i = 0; i < childrenLength; i++) {
1467
+ childArray[i] = arguments[i + 2];
1468
+ }
1469
+
1470
+ {
1471
+ if (Object.freeze) {
1472
+ Object.freeze(childArray);
1473
+ }
1474
+ }
1475
+
1476
+ props.children = childArray;
1477
+ } // Resolve default props
1478
+
1479
+
1480
+ if (type && type.defaultProps) {
1481
+ var defaultProps = type.defaultProps;
1482
+
1483
+ for (propName in defaultProps) {
1484
+ if (props[propName] === undefined) {
1485
+ props[propName] = defaultProps[propName];
1486
+ }
1487
+ }
1488
+ }
1489
+
1490
+ {
1491
+ if (key || ref) {
1492
+ var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
1493
+
1494
+ if (key) {
1495
+ defineKeyPropWarningGetter(props, displayName);
1496
+ }
1497
+
1498
+ if (ref) {
1499
+ defineRefPropWarningGetter(props, displayName);
1500
+ }
1501
+ }
1502
+ }
1503
+
1504
+ return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
1505
+ }
1506
+ function cloneAndReplaceKey(oldElement, newKey) {
1507
+ var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
1508
+ return newElement;
1509
+ }
1510
+ /**
1511
+ * Clone and return a new ReactElement using element as the starting point.
1512
+ * See https://reactjs.org/docs/react-api.html#cloneelement
1513
+ */
1514
+
1515
+ function cloneElement(element, config, children) {
1516
+ if (!!(element === null || element === undefined)) {
1517
+ {
1518
+ throw Error( "React.cloneElement(...): The argument must be a React element, but you passed " + element + "." );
1519
+ }
1520
+ }
1521
+
1522
+ var propName; // Original props are copied
1523
+
1524
+ var props = _assign({}, element.props); // Reserved names are extracted
1525
+
1526
+
1527
+ var key = element.key;
1528
+ var ref = element.ref; // Self is preserved since the owner is preserved.
1529
+
1530
+ var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a
1531
+ // transpiler, and the original source is probably a better indicator of the
1532
+ // true owner.
1533
+
1534
+ var source = element._source; // Owner will be preserved, unless ref is overridden
1535
+
1536
+ var owner = element._owner;
1537
+
1538
+ if (config != null) {
1539
+ if (hasValidRef(config)) {
1540
+ // Silently steal the ref from the parent.
1541
+ ref = config.ref;
1542
+ owner = ReactCurrentOwner.current;
1543
+ }
1544
+
1545
+ if (hasValidKey(config)) {
1546
+ key = '' + config.key;
1547
+ } // Remaining properties override existing props
1548
+
1549
+
1550
+ var defaultProps;
1551
+
1552
+ if (element.type && element.type.defaultProps) {
1553
+ defaultProps = element.type.defaultProps;
1554
+ }
1555
+
1556
+ for (propName in config) {
1557
+ if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
1558
+ if (config[propName] === undefined && defaultProps !== undefined) {
1559
+ // Resolve default props
1560
+ props[propName] = defaultProps[propName];
1561
+ } else {
1562
+ props[propName] = config[propName];
1563
+ }
1564
+ }
1565
+ }
1566
+ } // Children can be more than one argument, and those are transferred onto
1567
+ // the newly allocated props object.
1568
+
1569
+
1570
+ var childrenLength = arguments.length - 2;
1571
+
1572
+ if (childrenLength === 1) {
1573
+ props.children = children;
1574
+ } else if (childrenLength > 1) {
1575
+ var childArray = Array(childrenLength);
1576
+
1577
+ for (var i = 0; i < childrenLength; i++) {
1578
+ childArray[i] = arguments[i + 2];
1579
+ }
1580
+
1581
+ props.children = childArray;
1582
+ }
1583
+
1584
+ return ReactElement(element.type, key, ref, self, source, owner, props);
1585
+ }
1586
+ /**
1587
+ * Verifies the object is a ReactElement.
1588
+ * See https://reactjs.org/docs/react-api.html#isvalidelement
1589
+ * @param {?object} object
1590
+ * @return {boolean} True if `object` is a ReactElement.
1591
+ * @final
1592
+ */
1593
+
1594
+ function isValidElement(object) {
1595
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1596
+ }
1597
+
1598
+ var SEPARATOR = '.';
1599
+ var SUBSEPARATOR = ':';
1600
+ /**
1601
+ * Escape and wrap key so it is safe to use as a reactid
1602
+ *
1603
+ * @param {string} key to be escaped.
1604
+ * @return {string} the escaped key.
1605
+ */
1606
+
1607
+ function escape(key) {
1608
+ var escapeRegex = /[=:]/g;
1609
+ var escaperLookup = {
1610
+ '=': '=0',
1611
+ ':': '=2'
1612
+ };
1613
+ var escapedString = key.replace(escapeRegex, function (match) {
1614
+ return escaperLookup[match];
1615
+ });
1616
+ return '$' + escapedString;
1617
+ }
1618
+ /**
1619
+ * TODO: Test that a single child and an array with one item have the same key
1620
+ * pattern.
1621
+ */
1622
+
1623
+
1624
+ var didWarnAboutMaps = false;
1625
+ var userProvidedKeyEscapeRegex = /\/+/g;
1626
+
1627
+ function escapeUserProvidedKey(text) {
1628
+ return text.replace(userProvidedKeyEscapeRegex, '$&/');
1629
+ }
1630
+ /**
1631
+ * Generate a key string that identifies a element within a set.
1632
+ *
1633
+ * @param {*} element A element that could contain a manual key.
1634
+ * @param {number} index Index that is used if a manual key is not provided.
1635
+ * @return {string}
1636
+ */
1637
+
1638
+
1639
+ function getElementKey(element, index) {
1640
+ // Do some typechecking here since we call this blindly. We want to ensure
1641
+ // that we don't block potential future ES APIs.
1642
+ if (typeof element === 'object' && element !== null && element.key != null) {
1643
+ // Explicit key
1644
+ return escape('' + element.key);
1645
+ } // Implicit key determined by the index in the set
1646
+
1647
+
1648
+ return index.toString(36);
1649
+ }
1650
+
1651
+ function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
1652
+ var type = typeof children;
1653
+
1654
+ if (type === 'undefined' || type === 'boolean') {
1655
+ // All of the above are perceived as null.
1656
+ children = null;
1657
+ }
1658
+
1659
+ var invokeCallback = false;
1660
+
1661
+ if (children === null) {
1662
+ invokeCallback = true;
1663
+ } else {
1664
+ switch (type) {
1665
+ case 'string':
1666
+ case 'number':
1667
+ invokeCallback = true;
1668
+ break;
1669
+
1670
+ case 'object':
1671
+ switch (children.$$typeof) {
1672
+ case REACT_ELEMENT_TYPE:
1673
+ case REACT_PORTAL_TYPE:
1674
+ invokeCallback = true;
1675
+ }
1676
+
1677
+ }
1678
+ }
1679
+
1680
+ if (invokeCallback) {
1681
+ var _child = children;
1682
+ var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
1683
+ // so that it's consistent if the number of children grows:
1684
+
1685
+ var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
1686
+
1687
+ if (Array.isArray(mappedChild)) {
1688
+ var escapedChildKey = '';
1689
+
1690
+ if (childKey != null) {
1691
+ escapedChildKey = escapeUserProvidedKey(childKey) + '/';
1692
+ }
1693
+
1694
+ mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {
1695
+ return c;
1696
+ });
1697
+ } else if (mappedChild != null) {
1698
+ if (isValidElement(mappedChild)) {
1699
+ mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as
1700
+ // traverseAllChildren used to do for objects as children
1701
+ escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
1702
+ mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
1703
+ escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
1704
+ }
1705
+
1706
+ array.push(mappedChild);
1707
+ }
1708
+
1709
+ return 1;
1710
+ }
1711
+
1712
+ var child;
1713
+ var nextName;
1714
+ var subtreeCount = 0; // Count of children found in the current subtree.
1715
+
1716
+ var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
1717
+
1718
+ if (Array.isArray(children)) {
1719
+ for (var i = 0; i < children.length; i++) {
1720
+ child = children[i];
1721
+ nextName = nextNamePrefix + getElementKey(child, i);
1722
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1723
+ }
1724
+ } else {
1725
+ var iteratorFn = getIteratorFn(children);
1726
+
1727
+ if (typeof iteratorFn === 'function') {
1728
+ var iterableChildren = children;
1729
+
1730
+ {
1731
+ // Warn about using Maps as children
1732
+ if (iteratorFn === iterableChildren.entries) {
1733
+ if (!didWarnAboutMaps) {
1734
+ warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
1735
+ }
1736
+
1737
+ didWarnAboutMaps = true;
1738
+ }
1739
+ }
1740
+
1741
+ var iterator = iteratorFn.call(iterableChildren);
1742
+ var step;
1743
+ var ii = 0;
1744
+
1745
+ while (!(step = iterator.next()).done) {
1746
+ child = step.value;
1747
+ nextName = nextNamePrefix + getElementKey(child, ii++);
1748
+ subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
1749
+ }
1750
+ } else if (type === 'object') {
1751
+ var childrenString = '' + children;
1752
+
1753
+ {
1754
+ {
1755
+ throw Error( "Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). If you meant to render a collection of children, use an array instead." );
1756
+ }
1757
+ }
1758
+ }
1759
+ }
1760
+
1761
+ return subtreeCount;
1762
+ }
1763
+
1764
+ /**
1765
+ * Maps children that are typically specified as `props.children`.
1766
+ *
1767
+ * See https://reactjs.org/docs/react-api.html#reactchildrenmap
1768
+ *
1769
+ * The provided mapFunction(child, index) will be called for each
1770
+ * leaf child.
1771
+ *
1772
+ * @param {?*} children Children tree container.
1773
+ * @param {function(*, int)} func The map function.
1774
+ * @param {*} context Context for mapFunction.
1775
+ * @return {object} Object containing the ordered map of results.
1776
+ */
1777
+ function mapChildren(children, func, context) {
1778
+ if (children == null) {
1779
+ return children;
1780
+ }
1781
+
1782
+ var result = [];
1783
+ var count = 0;
1784
+ mapIntoArray(children, result, '', '', function (child) {
1785
+ return func.call(context, child, count++);
1786
+ });
1787
+ return result;
1788
+ }
1789
+ /**
1790
+ * Count the number of children that are typically specified as
1791
+ * `props.children`.
1792
+ *
1793
+ * See https://reactjs.org/docs/react-api.html#reactchildrencount
1794
+ *
1795
+ * @param {?*} children Children tree container.
1796
+ * @return {number} The number of children.
1797
+ */
1798
+
1799
+
1800
+ function countChildren(children) {
1801
+ var n = 0;
1802
+ mapChildren(children, function () {
1803
+ n++; // Don't return anything
1804
+ });
1805
+ return n;
1806
+ }
1807
+
1808
+ /**
1809
+ * Iterates through children that are typically specified as `props.children`.
1810
+ *
1811
+ * See https://reactjs.org/docs/react-api.html#reactchildrenforeach
1812
+ *
1813
+ * The provided forEachFunc(child, index) will be called for each
1814
+ * leaf child.
1815
+ *
1816
+ * @param {?*} children Children tree container.
1817
+ * @param {function(*, int)} forEachFunc
1818
+ * @param {*} forEachContext Context for forEachContext.
1819
+ */
1820
+ function forEachChildren(children, forEachFunc, forEachContext) {
1821
+ mapChildren(children, function () {
1822
+ forEachFunc.apply(this, arguments); // Don't return anything.
1823
+ }, forEachContext);
1824
+ }
1825
+ /**
1826
+ * Flatten a children object (typically specified as `props.children`) and
1827
+ * return an array with appropriately re-keyed children.
1828
+ *
1829
+ * See https://reactjs.org/docs/react-api.html#reactchildrentoarray
1830
+ */
1831
+
1832
+
1833
+ function toArray(children) {
1834
+ return mapChildren(children, function (child) {
1835
+ return child;
1836
+ }) || [];
1837
+ }
1838
+ /**
1839
+ * Returns the first child in a collection of children and verifies that there
1840
+ * is only one child in the collection.
1841
+ *
1842
+ * See https://reactjs.org/docs/react-api.html#reactchildrenonly
1843
+ *
1844
+ * The current implementation of this function assumes that a single child gets
1845
+ * passed without a wrapper, but the purpose of this helper function is to
1846
+ * abstract away the particular structure of children.
1847
+ *
1848
+ * @param {?object} children Child collection structure.
1849
+ * @return {ReactElement} The first and only `ReactElement` contained in the
1850
+ * structure.
1851
+ */
1852
+
1853
+
1854
+ function onlyChild(children) {
1855
+ if (!isValidElement(children)) {
1856
+ {
1857
+ throw Error( "React.Children.only expected to receive a single React element child." );
1858
+ }
1859
+ }
1860
+
1861
+ return children;
1862
+ }
1863
+
1864
+ function createContext(defaultValue, calculateChangedBits) {
1865
+ if (calculateChangedBits === undefined) {
1866
+ calculateChangedBits = null;
1867
+ } else {
1868
+ {
1869
+ if (calculateChangedBits !== null && typeof calculateChangedBits !== 'function') {
1870
+ error('createContext: Expected the optional second argument to be a ' + 'function. Instead received: %s', calculateChangedBits);
1871
+ }
1872
+ }
1873
+ }
1874
+
1875
+ var context = {
1876
+ $$typeof: REACT_CONTEXT_TYPE,
1877
+ _calculateChangedBits: calculateChangedBits,
1878
+ // As a workaround to support multiple concurrent renderers, we categorize
1879
+ // some renderers as primary and others as secondary. We only expect
1880
+ // there to be two concurrent renderers at most: React Native (primary) and
1881
+ // Fabric (secondary); React DOM (primary) and React ART (secondary).
1882
+ // Secondary renderers store their context values on separate fields.
1883
+ _currentValue: defaultValue,
1884
+ _currentValue2: defaultValue,
1885
+ // Used to track how many concurrent renderers this context currently
1886
+ // supports within in a single renderer. Such as parallel server rendering.
1887
+ _threadCount: 0,
1888
+ // These are circular
1889
+ Provider: null,
1890
+ Consumer: null
1891
+ };
1892
+ context.Provider = {
1893
+ $$typeof: REACT_PROVIDER_TYPE,
1894
+ _context: context
1895
+ };
1896
+ var hasWarnedAboutUsingNestedContextConsumers = false;
1897
+ var hasWarnedAboutUsingConsumerProvider = false;
1898
+ var hasWarnedAboutDisplayNameOnConsumer = false;
1899
+
1900
+ {
1901
+ // A separate object, but proxies back to the original context object for
1902
+ // backwards compatibility. It has a different $$typeof, so we can properly
1903
+ // warn for the incorrect usage of Context as a Consumer.
1904
+ var Consumer = {
1905
+ $$typeof: REACT_CONTEXT_TYPE,
1906
+ _context: context,
1907
+ _calculateChangedBits: context._calculateChangedBits
1908
+ }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
1909
+
1910
+ Object.defineProperties(Consumer, {
1911
+ Provider: {
1912
+ get: function () {
1913
+ if (!hasWarnedAboutUsingConsumerProvider) {
1914
+ hasWarnedAboutUsingConsumerProvider = true;
1915
+
1916
+ error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
1917
+ }
1918
+
1919
+ return context.Provider;
1920
+ },
1921
+ set: function (_Provider) {
1922
+ context.Provider = _Provider;
1923
+ }
1924
+ },
1925
+ _currentValue: {
1926
+ get: function () {
1927
+ return context._currentValue;
1928
+ },
1929
+ set: function (_currentValue) {
1930
+ context._currentValue = _currentValue;
1931
+ }
1932
+ },
1933
+ _currentValue2: {
1934
+ get: function () {
1935
+ return context._currentValue2;
1936
+ },
1937
+ set: function (_currentValue2) {
1938
+ context._currentValue2 = _currentValue2;
1939
+ }
1940
+ },
1941
+ _threadCount: {
1942
+ get: function () {
1943
+ return context._threadCount;
1944
+ },
1945
+ set: function (_threadCount) {
1946
+ context._threadCount = _threadCount;
1947
+ }
1948
+ },
1949
+ Consumer: {
1950
+ get: function () {
1951
+ if (!hasWarnedAboutUsingNestedContextConsumers) {
1952
+ hasWarnedAboutUsingNestedContextConsumers = true;
1953
+
1954
+ error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
1955
+ }
1956
+
1957
+ return context.Consumer;
1958
+ }
1959
+ },
1960
+ displayName: {
1961
+ get: function () {
1962
+ return context.displayName;
1963
+ },
1964
+ set: function (displayName) {
1965
+ if (!hasWarnedAboutDisplayNameOnConsumer) {
1966
+ warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
1967
+
1968
+ hasWarnedAboutDisplayNameOnConsumer = true;
1969
+ }
1970
+ }
1971
+ }
1972
+ }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty
1973
+
1974
+ context.Consumer = Consumer;
1975
+ }
1976
+
1977
+ {
1978
+ context._currentRenderer = null;
1979
+ context._currentRenderer2 = null;
1980
+ }
1981
+
1982
+ return context;
1983
+ }
1984
+
1985
+ var Uninitialized = -1;
1986
+ var Pending = 0;
1987
+ var Resolved = 1;
1988
+ var Rejected = 2;
1989
+
1990
+ function lazyInitializer(payload) {
1991
+ if (payload._status === Uninitialized) {
1992
+ var ctor = payload._result;
1993
+ var thenable = ctor(); // Transition to the next state.
1994
+
1995
+ var pending = payload;
1996
+ pending._status = Pending;
1997
+ pending._result = thenable;
1998
+ thenable.then(function (moduleObject) {
1999
+ if (payload._status === Pending) {
2000
+ var defaultExport = moduleObject.default;
2001
+
2002
+ {
2003
+ if (defaultExport === undefined) {
2004
+ error('lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
2005
+ 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
2006
+ }
2007
+ } // Transition to the next state.
2008
+
2009
+
2010
+ var resolved = payload;
2011
+ resolved._status = Resolved;
2012
+ resolved._result = defaultExport;
2013
+ }
2014
+ }, function (error) {
2015
+ if (payload._status === Pending) {
2016
+ // Transition to the next state.
2017
+ var rejected = payload;
2018
+ rejected._status = Rejected;
2019
+ rejected._result = error;
2020
+ }
2021
+ });
2022
+ }
2023
+
2024
+ if (payload._status === Resolved) {
2025
+ return payload._result;
2026
+ } else {
2027
+ throw payload._result;
2028
+ }
2029
+ }
2030
+
2031
+ function lazy(ctor) {
2032
+ var payload = {
2033
+ // We use these fields to store the result.
2034
+ _status: -1,
2035
+ _result: ctor
2036
+ };
2037
+ var lazyType = {
2038
+ $$typeof: REACT_LAZY_TYPE,
2039
+ _payload: payload,
2040
+ _init: lazyInitializer
2041
+ };
2042
+
2043
+ {
2044
+ // In production, this would just set it on the object.
2045
+ var defaultProps;
2046
+ var propTypes; // $FlowFixMe
2047
+
2048
+ Object.defineProperties(lazyType, {
2049
+ defaultProps: {
2050
+ configurable: true,
2051
+ get: function () {
2052
+ return defaultProps;
2053
+ },
2054
+ set: function (newDefaultProps) {
2055
+ error('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.');
2056
+
2057
+ defaultProps = newDefaultProps; // Match production behavior more closely:
2058
+ // $FlowFixMe
2059
+
2060
+ Object.defineProperty(lazyType, 'defaultProps', {
2061
+ enumerable: true
2062
+ });
2063
+ }
2064
+ },
2065
+ propTypes: {
2066
+ configurable: true,
2067
+ get: function () {
2068
+ return propTypes;
2069
+ },
2070
+ set: function (newPropTypes) {
2071
+ error('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.');
2072
+
2073
+ propTypes = newPropTypes; // Match production behavior more closely:
2074
+ // $FlowFixMe
2075
+
2076
+ Object.defineProperty(lazyType, 'propTypes', {
2077
+ enumerable: true
2078
+ });
2079
+ }
2080
+ }
2081
+ });
2082
+ }
2083
+
2084
+ return lazyType;
2085
+ }
2086
+
2087
+ function forwardRef(render) {
2088
+ {
2089
+ if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
2090
+ error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
2091
+ } else if (typeof render !== 'function') {
2092
+ error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
2093
+ } else {
2094
+ if (render.length !== 0 && render.length !== 2) {
2095
+ error('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.');
2096
+ }
2097
+ }
2098
+
2099
+ if (render != null) {
2100
+ if (render.defaultProps != null || render.propTypes != null) {
2101
+ error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
2102
+ }
2103
+ }
2104
+ }
2105
+
2106
+ var elementType = {
2107
+ $$typeof: REACT_FORWARD_REF_TYPE,
2108
+ render: render
2109
+ };
2110
+
2111
+ {
2112
+ var ownName;
2113
+ Object.defineProperty(elementType, 'displayName', {
2114
+ enumerable: false,
2115
+ configurable: true,
2116
+ get: function () {
2117
+ return ownName;
2118
+ },
2119
+ set: function (name) {
2120
+ ownName = name;
2121
+
2122
+ if (render.displayName == null) {
2123
+ render.displayName = name;
2124
+ }
2125
+ }
2126
+ });
2127
+ }
2128
+
2129
+ return elementType;
2130
+ }
2131
+
2132
+ // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
2133
+
2134
+ var enableScopeAPI = false; // Experimental Create Event Handle API.
2135
+
2136
+ function isValidElementType(type) {
2137
+ if (typeof type === 'string' || typeof type === 'function') {
2138
+ return true;
2139
+ } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
2140
+
2141
+
2142
+ if (type === exports.Fragment || type === exports.Profiler || type === REACT_DEBUG_TRACING_MODE_TYPE || type === exports.StrictMode || type === exports.Suspense || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
2143
+ return true;
2144
+ }
2145
+
2146
+ if (typeof type === 'object' && type !== null) {
2147
+ if (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_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
2148
+ return true;
2149
+ }
2150
+ }
2151
+
2152
+ return false;
2153
+ }
2154
+
2155
+ function memo(type, compare) {
2156
+ {
2157
+ if (!isValidElementType(type)) {
2158
+ error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
2159
+ }
2160
+ }
2161
+
2162
+ var elementType = {
2163
+ $$typeof: REACT_MEMO_TYPE,
2164
+ type: type,
2165
+ compare: compare === undefined ? null : compare
2166
+ };
2167
+
2168
+ {
2169
+ var ownName;
2170
+ Object.defineProperty(elementType, 'displayName', {
2171
+ enumerable: false,
2172
+ configurable: true,
2173
+ get: function () {
2174
+ return ownName;
2175
+ },
2176
+ set: function (name) {
2177
+ ownName = name;
2178
+
2179
+ if (type.displayName == null) {
2180
+ type.displayName = name;
2181
+ }
2182
+ }
2183
+ });
2184
+ }
2185
+
2186
+ return elementType;
2187
+ }
2188
+
2189
+ function resolveDispatcher() {
2190
+ var dispatcher = ReactCurrentDispatcher.current;
2191
+
2192
+ if (!(dispatcher !== null)) {
2193
+ {
2194
+ 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem." );
2195
+ }
2196
+ }
2197
+
2198
+ return dispatcher;
2199
+ }
2200
+
2201
+ function useContext(Context, unstable_observedBits) {
2202
+ var dispatcher = resolveDispatcher();
2203
+
2204
+ {
2205
+ if (unstable_observedBits !== undefined) {
2206
+ error('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://reactjs.org/link/rules-of-hooks' : '');
2207
+ } // TODO: add a more generic warning for invalid values.
2208
+
2209
+
2210
+ if (Context._context !== undefined) {
2211
+ var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
2212
+ // and nobody should be using this in existing code.
2213
+
2214
+ if (realContext.Consumer === Context) {
2215
+ error('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?');
2216
+ } else if (realContext.Provider === Context) {
2217
+ error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
2218
+ }
2219
+ }
2220
+ }
2221
+
2222
+ return dispatcher.useContext(Context, unstable_observedBits);
2223
+ }
2224
+ function useState(initialState) {
2225
+ var dispatcher = resolveDispatcher();
2226
+ return dispatcher.useState(initialState);
2227
+ }
2228
+ function useReducer(reducer, initialArg, init) {
2229
+ var dispatcher = resolveDispatcher();
2230
+ return dispatcher.useReducer(reducer, initialArg, init);
2231
+ }
2232
+ function useRef(initialValue) {
2233
+ var dispatcher = resolveDispatcher();
2234
+ return dispatcher.useRef(initialValue);
2235
+ }
2236
+ function useEffect(create, deps) {
2237
+ var dispatcher = resolveDispatcher();
2238
+ return dispatcher.useEffect(create, deps);
2239
+ }
2240
+ function useLayoutEffect(create, deps) {
2241
+ var dispatcher = resolveDispatcher();
2242
+ return dispatcher.useLayoutEffect(create, deps);
2243
+ }
2244
+ function useCallback(callback, deps) {
2245
+ var dispatcher = resolveDispatcher();
2246
+ return dispatcher.useCallback(callback, deps);
2247
+ }
2248
+ function useMemo(create, deps) {
2249
+ var dispatcher = resolveDispatcher();
2250
+ return dispatcher.useMemo(create, deps);
2251
+ }
2252
+ function useImperativeHandle(ref, create, deps) {
2253
+ var dispatcher = resolveDispatcher();
2254
+ return dispatcher.useImperativeHandle(ref, create, deps);
2255
+ }
2256
+ function useDebugValue(value, formatterFn) {
2257
+ {
2258
+ var dispatcher = resolveDispatcher();
2259
+ return dispatcher.useDebugValue(value, formatterFn);
2260
+ }
2261
+ }
2262
+
2263
+ // Helpers to patch console.logs to avoid logging during side-effect free
2264
+ // replaying on render function. This currently only patches the object
2265
+ // lazily which won't cover if the log function was extracted eagerly.
2266
+ // We could also eagerly patch the method.
2267
+ var disabledDepth = 0;
2268
+ var prevLog;
2269
+ var prevInfo;
2270
+ var prevWarn;
2271
+ var prevError;
2272
+ var prevGroup;
2273
+ var prevGroupCollapsed;
2274
+ var prevGroupEnd;
2275
+
2276
+ function disabledLog() {}
2277
+
2278
+ disabledLog.__reactDisabledLog = true;
2279
+ function disableLogs() {
2280
+ {
2281
+ if (disabledDepth === 0) {
2282
+ /* eslint-disable react-internal/no-production-logging */
2283
+ prevLog = console.log;
2284
+ prevInfo = console.info;
2285
+ prevWarn = console.warn;
2286
+ prevError = console.error;
2287
+ prevGroup = console.group;
2288
+ prevGroupCollapsed = console.groupCollapsed;
2289
+ prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
2290
+
2291
+ var props = {
2292
+ configurable: true,
2293
+ enumerable: true,
2294
+ value: disabledLog,
2295
+ writable: true
2296
+ }; // $FlowFixMe Flow thinks console is immutable.
2297
+
2298
+ Object.defineProperties(console, {
2299
+ info: props,
2300
+ log: props,
2301
+ warn: props,
2302
+ error: props,
2303
+ group: props,
2304
+ groupCollapsed: props,
2305
+ groupEnd: props
2306
+ });
2307
+ /* eslint-enable react-internal/no-production-logging */
2308
+ }
2309
+
2310
+ disabledDepth++;
2311
+ }
2312
+ }
2313
+ function reenableLogs() {
2314
+ {
2315
+ disabledDepth--;
2316
+
2317
+ if (disabledDepth === 0) {
2318
+ /* eslint-disable react-internal/no-production-logging */
2319
+ var props = {
2320
+ configurable: true,
2321
+ enumerable: true,
2322
+ writable: true
2323
+ }; // $FlowFixMe Flow thinks console is immutable.
2324
+
2325
+ Object.defineProperties(console, {
2326
+ log: _assign({}, props, {
2327
+ value: prevLog
2328
+ }),
2329
+ info: _assign({}, props, {
2330
+ value: prevInfo
2331
+ }),
2332
+ warn: _assign({}, props, {
2333
+ value: prevWarn
2334
+ }),
2335
+ error: _assign({}, props, {
2336
+ value: prevError
2337
+ }),
2338
+ group: _assign({}, props, {
2339
+ value: prevGroup
2340
+ }),
2341
+ groupCollapsed: _assign({}, props, {
2342
+ value: prevGroupCollapsed
2343
+ }),
2344
+ groupEnd: _assign({}, props, {
2345
+ value: prevGroupEnd
2346
+ })
2347
+ });
2348
+ /* eslint-enable react-internal/no-production-logging */
2349
+ }
2350
+
2351
+ if (disabledDepth < 0) {
2352
+ error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
2353
+ }
2354
+ }
2355
+ }
2356
+
2357
+ var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
2358
+ var prefix;
2359
+ function describeBuiltInComponentFrame(name, source, ownerFn) {
2360
+ {
2361
+ if (prefix === undefined) {
2362
+ // Extract the VM specific prefix used by each line.
2363
+ try {
2364
+ throw Error();
2365
+ } catch (x) {
2366
+ var match = x.stack.trim().match(/\n( *(at )?)/);
2367
+ prefix = match && match[1] || '';
2368
+ }
2369
+ } // We use the prefix to ensure our stacks line up with native stack frames.
2370
+
2371
+
2372
+ return '\n' + prefix + name;
2373
+ }
2374
+ }
2375
+ var reentry = false;
2376
+ var componentFrameCache;
2377
+
2378
+ {
2379
+ var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
2380
+ componentFrameCache = new PossiblyWeakMap();
2381
+ }
2382
+
2383
+ function describeNativeComponentFrame(fn, construct) {
2384
+ // If something asked for a stack inside a fake render, it should get ignored.
2385
+ if (!fn || reentry) {
2386
+ return '';
2387
+ }
2388
+
2389
+ {
2390
+ var frame = componentFrameCache.get(fn);
2391
+
2392
+ if (frame !== undefined) {
2393
+ return frame;
2394
+ }
2395
+ }
2396
+
2397
+ var control;
2398
+ reentry = true;
2399
+ var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
2400
+
2401
+ Error.prepareStackTrace = undefined;
2402
+ var previousDispatcher;
2403
+
2404
+ {
2405
+ previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function
2406
+ // for warnings.
2407
+
2408
+ ReactCurrentDispatcher$1.current = null;
2409
+ disableLogs();
2410
+ }
2411
+
2412
+ try {
2413
+ // This should throw.
2414
+ if (construct) {
2415
+ // Something should be setting the props in the constructor.
2416
+ var Fake = function () {
2417
+ throw Error();
2418
+ }; // $FlowFixMe
2419
+
2420
+
2421
+ Object.defineProperty(Fake.prototype, 'props', {
2422
+ set: function () {
2423
+ // We use a throwing setter instead of frozen or non-writable props
2424
+ // because that won't throw in a non-strict mode function.
2425
+ throw Error();
2426
+ }
2427
+ });
2428
+
2429
+ if (typeof Reflect === 'object' && Reflect.construct) {
2430
+ // We construct a different control for this case to include any extra
2431
+ // frames added by the construct call.
2432
+ try {
2433
+ Reflect.construct(Fake, []);
2434
+ } catch (x) {
2435
+ control = x;
2436
+ }
2437
+
2438
+ Reflect.construct(fn, [], Fake);
2439
+ } else {
2440
+ try {
2441
+ Fake.call();
2442
+ } catch (x) {
2443
+ control = x;
2444
+ }
2445
+
2446
+ fn.call(Fake.prototype);
2447
+ }
2448
+ } else {
2449
+ try {
2450
+ throw Error();
2451
+ } catch (x) {
2452
+ control = x;
2453
+ }
2454
+
2455
+ fn();
2456
+ }
2457
+ } catch (sample) {
2458
+ // This is inlined manually because closure doesn't do it for us.
2459
+ if (sample && control && typeof sample.stack === 'string') {
2460
+ // This extracts the first frame from the sample that isn't also in the control.
2461
+ // Skipping one frame that we assume is the frame that calls the two.
2462
+ var sampleLines = sample.stack.split('\n');
2463
+ var controlLines = control.stack.split('\n');
2464
+ var s = sampleLines.length - 1;
2465
+ var c = controlLines.length - 1;
2466
+
2467
+ while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
2468
+ // We expect at least one stack frame to be shared.
2469
+ // Typically this will be the root most one. However, stack frames may be
2470
+ // cut off due to maximum stack limits. In this case, one maybe cut off
2471
+ // earlier than the other. We assume that the sample is longer or the same
2472
+ // and there for cut off earlier. So we should find the root most frame in
2473
+ // the sample somewhere in the control.
2474
+ c--;
2475
+ }
2476
+
2477
+ for (; s >= 1 && c >= 0; s--, c--) {
2478
+ // Next we find the first one that isn't the same which should be the
2479
+ // frame that called our sample function and the control.
2480
+ if (sampleLines[s] !== controlLines[c]) {
2481
+ // In V8, the first line is describing the message but other VMs don't.
2482
+ // If we're about to return the first line, and the control is also on the same
2483
+ // line, that's a pretty good indicator that our sample threw at same line as
2484
+ // the control. I.e. before we entered the sample frame. So we ignore this result.
2485
+ // This can happen if you passed a class to function component, or non-function.
2486
+ if (s !== 1 || c !== 1) {
2487
+ do {
2488
+ s--;
2489
+ c--; // We may still have similar intermediate frames from the construct call.
2490
+ // The next one that isn't the same should be our match though.
2491
+
2492
+ if (c < 0 || sampleLines[s] !== controlLines[c]) {
2493
+ // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
2494
+ var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
2495
+
2496
+ {
2497
+ if (typeof fn === 'function') {
2498
+ componentFrameCache.set(fn, _frame);
2499
+ }
2500
+ } // Return the line we found.
2501
+
2502
+
2503
+ return _frame;
2504
+ }
2505
+ } while (s >= 1 && c >= 0);
2506
+ }
2507
+
2508
+ break;
2509
+ }
2510
+ }
2511
+ }
2512
+ } finally {
2513
+ reentry = false;
2514
+
2515
+ {
2516
+ ReactCurrentDispatcher$1.current = previousDispatcher;
2517
+ reenableLogs();
2518
+ }
2519
+
2520
+ Error.prepareStackTrace = previousPrepareStackTrace;
2521
+ } // Fallback to just using the name if we couldn't make it throw.
2522
+
2523
+
2524
+ var name = fn ? fn.displayName || fn.name : '';
2525
+ var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
2526
+
2527
+ {
2528
+ if (typeof fn === 'function') {
2529
+ componentFrameCache.set(fn, syntheticFrame);
2530
+ }
2531
+ }
2532
+
2533
+ return syntheticFrame;
2534
+ }
2535
+ function describeFunctionComponentFrame(fn, source, ownerFn) {
2536
+ {
2537
+ return describeNativeComponentFrame(fn, false);
2538
+ }
2539
+ }
2540
+
2541
+ function shouldConstruct(Component) {
2542
+ var prototype = Component.prototype;
2543
+ return !!(prototype && prototype.isReactComponent);
2544
+ }
2545
+
2546
+ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
2547
+
2548
+ if (type == null) {
2549
+ return '';
2550
+ }
2551
+
2552
+ if (typeof type === 'function') {
2553
+ {
2554
+ return describeNativeComponentFrame(type, shouldConstruct(type));
2555
+ }
2556
+ }
2557
+
2558
+ if (typeof type === 'string') {
2559
+ return describeBuiltInComponentFrame(type);
2560
+ }
2561
+
2562
+ switch (type) {
2563
+ case exports.Suspense:
2564
+ return describeBuiltInComponentFrame('Suspense');
2565
+
2566
+ case REACT_SUSPENSE_LIST_TYPE:
2567
+ return describeBuiltInComponentFrame('SuspenseList');
2568
+ }
2569
+
2570
+ if (typeof type === 'object') {
2571
+ switch (type.$$typeof) {
2572
+ case REACT_FORWARD_REF_TYPE:
2573
+ return describeFunctionComponentFrame(type.render);
2574
+
2575
+ case REACT_MEMO_TYPE:
2576
+ // Memo may contain any component type so we recursively resolve it.
2577
+ return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
2578
+
2579
+ case REACT_BLOCK_TYPE:
2580
+ return describeFunctionComponentFrame(type._render);
2581
+
2582
+ case REACT_LAZY_TYPE:
2583
+ {
2584
+ var lazyComponent = type;
2585
+ var payload = lazyComponent._payload;
2586
+ var init = lazyComponent._init;
2587
+
2588
+ try {
2589
+ // Lazy may contain any component type so we recursively resolve it.
2590
+ return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
2591
+ } catch (x) {}
2592
+ }
2593
+ }
2594
+ }
2595
+
2596
+ return '';
2597
+ }
2598
+
2599
+ var loggedTypeFailures = {};
2600
+ var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
2601
+
2602
+ function setCurrentlyValidatingElement(element) {
2603
+ {
2604
+ if (element) {
2605
+ var owner = element._owner;
2606
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2607
+ ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
2608
+ } else {
2609
+ ReactDebugCurrentFrame$1.setExtraStackFrame(null);
2610
+ }
2611
+ }
2612
+ }
2613
+
2614
+ function checkPropTypes(typeSpecs, values, location, componentName, element) {
2615
+ {
2616
+ // $FlowFixMe This is okay but Flow doesn't know it.
2617
+ var has = Function.call.bind(Object.prototype.hasOwnProperty);
2618
+
2619
+ for (var typeSpecName in typeSpecs) {
2620
+ if (has(typeSpecs, typeSpecName)) {
2621
+ var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
2622
+ // fail the render phase where it didn't fail before. So we log it.
2623
+ // After these have been cleaned up, we'll let them throw.
2624
+
2625
+ try {
2626
+ // This is intentionally an invariant that gets caught. It's the same
2627
+ // behavior as without this statement except with a better message.
2628
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
2629
+ 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`.');
2630
+ err.name = 'Invariant Violation';
2631
+ throw err;
2632
+ }
2633
+
2634
+ error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
2635
+ } catch (ex) {
2636
+ error$1 = ex;
2637
+ }
2638
+
2639
+ if (error$1 && !(error$1 instanceof Error)) {
2640
+ setCurrentlyValidatingElement(element);
2641
+
2642
+ 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);
2643
+
2644
+ setCurrentlyValidatingElement(null);
2645
+ }
2646
+
2647
+ if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
2648
+ // Only monitor this failure once because there tends to be a lot of the
2649
+ // same error.
2650
+ loggedTypeFailures[error$1.message] = true;
2651
+ setCurrentlyValidatingElement(element);
2652
+
2653
+ error('Failed %s type: %s', location, error$1.message);
2654
+
2655
+ setCurrentlyValidatingElement(null);
2656
+ }
2657
+ }
2658
+ }
2659
+ }
2660
+ }
2661
+
2662
+ function setCurrentlyValidatingElement$1(element) {
2663
+ {
2664
+ if (element) {
2665
+ var owner = element._owner;
2666
+ var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
2667
+ setExtraStackFrame(stack);
2668
+ } else {
2669
+ setExtraStackFrame(null);
2670
+ }
2671
+ }
2672
+ }
2673
+
2674
+ var propTypesMisspellWarningShown;
2675
+
2676
+ {
2677
+ propTypesMisspellWarningShown = false;
2678
+ }
2679
+
2680
+ function getDeclarationErrorAddendum() {
2681
+ if (ReactCurrentOwner.current) {
2682
+ var name = getComponentName(ReactCurrentOwner.current.type);
2683
+
2684
+ if (name) {
2685
+ return '\n\nCheck the render method of `' + name + '`.';
2686
+ }
2687
+ }
2688
+
2689
+ return '';
2690
+ }
2691
+
2692
+ function getSourceInfoErrorAddendum(source) {
2693
+ if (source !== undefined) {
2694
+ var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2695
+ var lineNumber = source.lineNumber;
2696
+ return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2697
+ }
2698
+
2699
+ return '';
2700
+ }
2701
+
2702
+ function getSourceInfoErrorAddendumForProps(elementProps) {
2703
+ if (elementProps !== null && elementProps !== undefined) {
2704
+ return getSourceInfoErrorAddendum(elementProps.__source);
2705
+ }
2706
+
2707
+ return '';
2708
+ }
2709
+ /**
2710
+ * Warn if there's no key explicitly set on dynamic arrays of children or
2711
+ * object keys are not valid. This allows us to keep track of children between
2712
+ * updates.
2713
+ */
2714
+
2715
+
2716
+ var ownerHasKeyUseWarning = {};
2717
+
2718
+ function getCurrentComponentErrorInfo(parentType) {
2719
+ var info = getDeclarationErrorAddendum();
2720
+
2721
+ if (!info) {
2722
+ var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2723
+
2724
+ if (parentName) {
2725
+ info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2726
+ }
2727
+ }
2728
+
2729
+ return info;
2730
+ }
2731
+ /**
2732
+ * Warn if the element doesn't have an explicit key assigned to it.
2733
+ * This element is in an array. The array could grow and shrink or be
2734
+ * reordered. All children that haven't already been validated are required to
2735
+ * have a "key" property assigned to it. Error statuses are cached so a warning
2736
+ * will only be shown once.
2737
+ *
2738
+ * @internal
2739
+ * @param {ReactElement} element Element that requires a key.
2740
+ * @param {*} parentType element's parent's type.
2741
+ */
2742
+
2743
+
2744
+ function validateExplicitKey(element, parentType) {
2745
+ if (!element._store || element._store.validated || element.key != null) {
2746
+ return;
2747
+ }
2748
+
2749
+ element._store.validated = true;
2750
+ var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2751
+
2752
+ if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2753
+ return;
2754
+ }
2755
+
2756
+ ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2757
+ // property, it may be the creator of the child that's responsible for
2758
+ // assigning it a key.
2759
+
2760
+ var childOwner = '';
2761
+
2762
+ if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
2763
+ // Give the component that originally created this child.
2764
+ childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
2765
+ }
2766
+
2767
+ {
2768
+ setCurrentlyValidatingElement$1(element);
2769
+
2770
+ error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
2771
+
2772
+ setCurrentlyValidatingElement$1(null);
2773
+ }
2774
+ }
2775
+ /**
2776
+ * Ensure that every element either is passed in a static location, in an
2777
+ * array with an explicit keys property defined, or in an object literal
2778
+ * with valid key property.
2779
+ *
2780
+ * @internal
2781
+ * @param {ReactNode} node Statically passed child of any type.
2782
+ * @param {*} parentType node's parent's type.
2783
+ */
2784
+
2785
+
2786
+ function validateChildKeys(node, parentType) {
2787
+ if (typeof node !== 'object') {
2788
+ return;
2789
+ }
2790
+
2791
+ if (Array.isArray(node)) {
2792
+ for (var i = 0; i < node.length; i++) {
2793
+ var child = node[i];
2794
+
2795
+ if (isValidElement(child)) {
2796
+ validateExplicitKey(child, parentType);
2797
+ }
2798
+ }
2799
+ } else if (isValidElement(node)) {
2800
+ // This element was passed in a valid location.
2801
+ if (node._store) {
2802
+ node._store.validated = true;
2803
+ }
2804
+ } else if (node) {
2805
+ var iteratorFn = getIteratorFn(node);
2806
+
2807
+ if (typeof iteratorFn === 'function') {
2808
+ // Entry iterators used to provide implicit keys,
2809
+ // but now we print a separate warning for them later.
2810
+ if (iteratorFn !== node.entries) {
2811
+ var iterator = iteratorFn.call(node);
2812
+ var step;
2813
+
2814
+ while (!(step = iterator.next()).done) {
2815
+ if (isValidElement(step.value)) {
2816
+ validateExplicitKey(step.value, parentType);
2817
+ }
2818
+ }
2819
+ }
2820
+ }
2821
+ }
2822
+ }
2823
+ /**
2824
+ * Given an element, validate that its props follow the propTypes definition,
2825
+ * provided by the type.
2826
+ *
2827
+ * @param {ReactElement} element
2828
+ */
2829
+
2830
+
2831
+ function validatePropTypes(element) {
2832
+ {
2833
+ var type = element.type;
2834
+
2835
+ if (type === null || type === undefined || typeof type === 'string') {
2836
+ return;
2837
+ }
2838
+
2839
+ var propTypes;
2840
+
2841
+ if (typeof type === 'function') {
2842
+ propTypes = type.propTypes;
2843
+ } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
2844
+ // Inner props are checked in the reconciler.
2845
+ type.$$typeof === REACT_MEMO_TYPE)) {
2846
+ propTypes = type.propTypes;
2847
+ } else {
2848
+ return;
2849
+ }
2850
+
2851
+ if (propTypes) {
2852
+ // Intentionally inside to avoid triggering lazy initializers:
2853
+ var name = getComponentName(type);
2854
+ checkPropTypes(propTypes, element.props, 'prop', name, element);
2855
+ } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2856
+ propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
2857
+
2858
+ var _name = getComponentName(type);
2859
+
2860
+ error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
2861
+ }
2862
+
2863
+ if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2864
+ error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2865
+ }
2866
+ }
2867
+ }
2868
+ /**
2869
+ * Given a fragment, validate that it can only be provided with fragment props
2870
+ * @param {ReactElement} fragment
2871
+ */
2872
+
2873
+
2874
+ function validateFragmentProps(fragment) {
2875
+ {
2876
+ var keys = Object.keys(fragment.props);
2877
+
2878
+ for (var i = 0; i < keys.length; i++) {
2879
+ var key = keys[i];
2880
+
2881
+ if (key !== 'children' && key !== 'key') {
2882
+ setCurrentlyValidatingElement$1(fragment);
2883
+
2884
+ error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2885
+
2886
+ setCurrentlyValidatingElement$1(null);
2887
+ break;
2888
+ }
2889
+ }
2890
+
2891
+ if (fragment.ref !== null) {
2892
+ setCurrentlyValidatingElement$1(fragment);
2893
+
2894
+ error('Invalid attribute `ref` supplied to `React.Fragment`.');
2895
+
2896
+ setCurrentlyValidatingElement$1(null);
2897
+ }
2898
+ }
2899
+ }
2900
+ function createElementWithValidation(type, props, children) {
2901
+ var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2902
+ // succeed and there will likely be errors in render.
2903
+
2904
+ if (!validType) {
2905
+ var info = '';
2906
+
2907
+ if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2908
+ 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.";
2909
+ }
2910
+
2911
+ var sourceInfo = getSourceInfoErrorAddendumForProps(props);
2912
+
2913
+ if (sourceInfo) {
2914
+ info += sourceInfo;
2915
+ } else {
2916
+ info += getDeclarationErrorAddendum();
2917
+ }
2918
+
2919
+ var typeString;
2920
+
2921
+ if (type === null) {
2922
+ typeString = 'null';
2923
+ } else if (Array.isArray(type)) {
2924
+ typeString = 'array';
2925
+ } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2926
+ typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
2927
+ info = ' Did you accidentally export a JSX literal instead of a component?';
2928
+ } else {
2929
+ typeString = typeof type;
2930
+ }
2931
+
2932
+ {
2933
+ error('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);
2934
+ }
2935
+ }
2936
+
2937
+ var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
2938
+ // TODO: Drop this when these are no longer allowed as the type argument.
2939
+
2940
+ if (element == null) {
2941
+ return element;
2942
+ } // Skip key warning if the type isn't valid since our key validation logic
2943
+ // doesn't expect a non-string/function type and can throw confusing errors.
2944
+ // We don't want exception behavior to differ between dev and prod.
2945
+ // (Rendering will throw with a helpful message and as soon as the type is
2946
+ // fixed, the key warnings will appear.)
2947
+
2948
+
2949
+ if (validType) {
2950
+ for (var i = 2; i < arguments.length; i++) {
2951
+ validateChildKeys(arguments[i], type);
2952
+ }
2953
+ }
2954
+
2955
+ if (type === exports.Fragment) {
2956
+ validateFragmentProps(element);
2957
+ } else {
2958
+ validatePropTypes(element);
2959
+ }
2960
+
2961
+ return element;
2962
+ }
2963
+ var didWarnAboutDeprecatedCreateFactory = false;
2964
+ function createFactoryWithValidation(type) {
2965
+ var validatedFactory = createElementWithValidation.bind(null, type);
2966
+ validatedFactory.type = type;
2967
+
2968
+ {
2969
+ if (!didWarnAboutDeprecatedCreateFactory) {
2970
+ didWarnAboutDeprecatedCreateFactory = true;
2971
+
2972
+ warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
2973
+ } // Legacy hook: remove it
2974
+
2975
+
2976
+ Object.defineProperty(validatedFactory, 'type', {
2977
+ enumerable: false,
2978
+ get: function () {
2979
+ warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
2980
+
2981
+ Object.defineProperty(this, 'type', {
2982
+ value: type
2983
+ });
2984
+ return type;
2985
+ }
2986
+ });
2987
+ }
2988
+
2989
+ return validatedFactory;
2990
+ }
2991
+ function cloneElementWithValidation(element, props, children) {
2992
+ var newElement = cloneElement.apply(this, arguments);
2993
+
2994
+ for (var i = 2; i < arguments.length; i++) {
2995
+ validateChildKeys(arguments[i], newElement.type);
2996
+ }
2997
+
2998
+ validatePropTypes(newElement);
2999
+ return newElement;
3000
+ }
3001
+
3002
+ {
3003
+
3004
+ try {
3005
+ var frozenObject = Object.freeze({});
3006
+ /* eslint-disable no-new */
3007
+
3008
+ new Map([[frozenObject, null]]);
3009
+ new Set([frozenObject]);
3010
+ /* eslint-enable no-new */
3011
+ } catch (e) {
3012
+ }
3013
+ }
3014
+
3015
+ var createElement$1 = createElementWithValidation ;
3016
+ var cloneElement$1 = cloneElementWithValidation ;
3017
+ var createFactory = createFactoryWithValidation ;
3018
+ var Children = {
3019
+ map: mapChildren,
3020
+ forEach: forEachChildren,
3021
+ count: countChildren,
3022
+ toArray: toArray,
3023
+ only: onlyChild
3024
+ };
3025
+
3026
+ exports.Children = Children;
3027
+ exports.Component = Component;
3028
+ exports.PureComponent = PureComponent;
3029
+ exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
3030
+ exports.cloneElement = cloneElement$1;
3031
+ exports.createContext = createContext;
3032
+ exports.createElement = createElement$1;
3033
+ exports.createFactory = createFactory;
3034
+ exports.createRef = createRef;
3035
+ exports.forwardRef = forwardRef;
3036
+ exports.isValidElement = isValidElement;
3037
+ exports.lazy = lazy;
3038
+ exports.memo = memo;
3039
+ exports.useCallback = useCallback;
3040
+ exports.useContext = useContext;
3041
+ exports.useDebugValue = useDebugValue;
3042
+ exports.useEffect = useEffect;
3043
+ exports.useImperativeHandle = useImperativeHandle;
3044
+ exports.useLayoutEffect = useLayoutEffect;
3045
+ exports.useMemo = useMemo;
3046
+ exports.useReducer = useReducer;
3047
+ exports.useRef = useRef;
3048
+ exports.useState = useState;
3049
+ exports.version = ReactVersion;
3050
+ })();
3051
+ }
3052
+ });
3053
+ react_development.Fragment;
3054
+ react_development.StrictMode;
3055
+ react_development.Profiler;
3056
+ react_development.Suspense;
3057
+ react_development.Children;
3058
+ react_development.Component;
3059
+ react_development.PureComponent;
3060
+ react_development.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
3061
+ react_development.cloneElement;
3062
+ react_development.createContext;
3063
+ react_development.createElement;
3064
+ react_development.createFactory;
3065
+ react_development.createRef;
3066
+ react_development.forwardRef;
3067
+ react_development.isValidElement;
3068
+ react_development.lazy;
3069
+ react_development.memo;
3070
+ react_development.useCallback;
3071
+ react_development.useContext;
3072
+ react_development.useDebugValue;
3073
+ react_development.useEffect;
3074
+ react_development.useImperativeHandle;
3075
+ react_development.useLayoutEffect;
3076
+ react_development.useMemo;
3077
+ react_development.useReducer;
3078
+ react_development.useRef;
3079
+ react_development.useState;
3080
+ react_development.version;
3081
+
3082
+ var react = createCommonjsModule(function (module) {
3083
+
3084
+ if (process.env.NODE_ENV === 'production') {
3085
+ module.exports = react_production_min;
3086
+ } else {
3087
+ module.exports = react_development;
3088
+ }
3089
+ });
3090
+
3091
+ var UseCsvButton = function (_a) {
3092
+ var children = _a.children, importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, render = _a.render;
3093
+ return (react.createElement(react.Fragment, null, render ? (react.createElement(react.Fragment, null, render(function () { return useCsvPlugin({ importerKey: importerKey, user: user, metadata: metadata }); }))) : (react.createElement("button", { type: "button", id: "usecsv-button", style: {
3094
+ backgroundColor: "#FFF",
3095
+ color: "#000",
3096
+ border: "2px solid #000",
3097
+ borderRadius: "6px",
3098
+ padding: "10px 15px",
3099
+ textAlign: "center",
3100
+ fontSize: "16px",
3101
+ cursor: "pointer",
3102
+ }, onClick: function () { return useCsvPlugin({ importerKey: importerKey, user: user, metadata: metadata }); } }, children))));
3103
+ };
3104
+
3105
+ module.exports = UseCsvButton;
3106
+ //# sourceMappingURL=index.js.map