UNPKG

272 kBJavaScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @noflow
8 * @preventMunge
9 * @generated
10 */
11
12"use strict";
13require("react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore");
14var ReactNativePrivateInterface = require("react-native/Libraries/ReactPrivate/ReactNativePrivateInterface"),
15 React = require("react"),
16 Scheduler = require("scheduler");
17function ReactError(error) {
18 error.name = "Invariant Violation";
19 return error;
20}
21var eventPluginOrder = null,
22 namesToPlugins = {};
23function recomputePluginOrdering() {
24 if (eventPluginOrder)
25 for (var pluginName in namesToPlugins) {
26 var pluginModule = namesToPlugins[pluginName],
27 pluginIndex = eventPluginOrder.indexOf(pluginName);
28 if (!(-1 < pluginIndex))
29 throw ReactError(
30 Error(
31 "EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" +
32 pluginName +
33 "`."
34 )
35 );
36 if (!plugins[pluginIndex]) {
37 if (!pluginModule.extractEvents)
38 throw ReactError(
39 Error(
40 "EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" +
41 pluginName +
42 "` does not."
43 )
44 );
45 plugins[pluginIndex] = pluginModule;
46 pluginIndex = pluginModule.eventTypes;
47 for (var eventName in pluginIndex) {
48 var JSCompiler_inline_result = void 0;
49 var dispatchConfig = pluginIndex[eventName],
50 pluginModule$jscomp$0 = pluginModule,
51 eventName$jscomp$0 = eventName;
52 if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0))
53 throw ReactError(
54 Error(
55 "EventPluginHub: More than one plugin attempted to publish the same event name, `" +
56 eventName$jscomp$0 +
57 "`."
58 )
59 );
60 eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig;
61 var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;
62 if (phasedRegistrationNames) {
63 for (JSCompiler_inline_result in phasedRegistrationNames)
64 phasedRegistrationNames.hasOwnProperty(
65 JSCompiler_inline_result
66 ) &&
67 publishRegistrationName(
68 phasedRegistrationNames[JSCompiler_inline_result],
69 pluginModule$jscomp$0,
70 eventName$jscomp$0
71 );
72 JSCompiler_inline_result = !0;
73 } else
74 dispatchConfig.registrationName
75 ? (publishRegistrationName(
76 dispatchConfig.registrationName,
77 pluginModule$jscomp$0,
78 eventName$jscomp$0
79 ),
80 (JSCompiler_inline_result = !0))
81 : (JSCompiler_inline_result = !1);
82 if (!JSCompiler_inline_result)
83 throw ReactError(
84 Error(
85 "EventPluginRegistry: Failed to publish event `" +
86 eventName +
87 "` for plugin `" +
88 pluginName +
89 "`."
90 )
91 );
92 }
93 }
94 }
95}
96function publishRegistrationName(registrationName, pluginModule) {
97 if (registrationNameModules[registrationName])
98 throw ReactError(
99 Error(
100 "EventPluginHub: More than one plugin attempted to publish the same registration name, `" +
101 registrationName +
102 "`."
103 )
104 );
105 registrationNameModules[registrationName] = pluginModule;
106}
107var plugins = [],
108 eventNameDispatchConfigs = {},
109 registrationNameModules = {};
110function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) {
111 var funcArgs = Array.prototype.slice.call(arguments, 3);
112 try {
113 func.apply(context, funcArgs);
114 } catch (error) {
115 this.onError(error);
116 }
117}
118var hasError = !1,
119 caughtError = null,
120 hasRethrowError = !1,
121 rethrowError = null,
122 reporter = {
123 onError: function(error) {
124 hasError = !0;
125 caughtError = error;
126 }
127 };
128function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {
129 hasError = !1;
130 caughtError = null;
131 invokeGuardedCallbackImpl.apply(reporter, arguments);
132}
133function invokeGuardedCallbackAndCatchFirstError(
134 name,
135 func,
136 context,
137 a,
138 b,
139 c,
140 d,
141 e,
142 f
143) {
144 invokeGuardedCallback.apply(this, arguments);
145 if (hasError) {
146 if (hasError) {
147 var error = caughtError;
148 hasError = !1;
149 caughtError = null;
150 } else
151 throw ReactError(
152 Error(
153 "clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."
154 )
155 );
156 hasRethrowError || ((hasRethrowError = !0), (rethrowError = error));
157 }
158}
159var getFiberCurrentPropsFromNode = null,
160 getInstanceFromNode = null,
161 getNodeFromInstance = null;
162function executeDispatch(event, listener, inst) {
163 var type = event.type || "unknown-event";
164 event.currentTarget = getNodeFromInstance(inst);
165 invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event);
166 event.currentTarget = null;
167}
168function executeDirectDispatch(event) {
169 var dispatchListener = event._dispatchListeners,
170 dispatchInstance = event._dispatchInstances;
171 if (Array.isArray(dispatchListener))
172 throw ReactError(Error("executeDirectDispatch(...): Invalid `event`."));
173 event.currentTarget = dispatchListener
174 ? getNodeFromInstance(dispatchInstance)
175 : null;
176 dispatchListener = dispatchListener ? dispatchListener(event) : null;
177 event.currentTarget = null;
178 event._dispatchListeners = null;
179 event._dispatchInstances = null;
180 return dispatchListener;
181}
182function accumulateInto(current, next) {
183 if (null == next)
184 throw ReactError(
185 Error(
186 "accumulateInto(...): Accumulated items must not be null or undefined."
187 )
188 );
189 if (null == current) return next;
190 if (Array.isArray(current)) {
191 if (Array.isArray(next)) return current.push.apply(current, next), current;
192 current.push(next);
193 return current;
194 }
195 return Array.isArray(next) ? [current].concat(next) : [current, next];
196}
197function forEachAccumulated(arr, cb, scope) {
198 Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr);
199}
200var eventQueue = null;
201function executeDispatchesAndReleaseTopLevel(e) {
202 if (e) {
203 var dispatchListeners = e._dispatchListeners,
204 dispatchInstances = e._dispatchInstances;
205 if (Array.isArray(dispatchListeners))
206 for (
207 var i = 0;
208 i < dispatchListeners.length && !e.isPropagationStopped();
209 i++
210 )
211 executeDispatch(e, dispatchListeners[i], dispatchInstances[i]);
212 else
213 dispatchListeners &&
214 executeDispatch(e, dispatchListeners, dispatchInstances);
215 e._dispatchListeners = null;
216 e._dispatchInstances = null;
217 e.isPersistent() || e.constructor.release(e);
218 }
219}
220var injection = {
221 injectEventPluginOrder: function(injectedEventPluginOrder) {
222 if (eventPluginOrder)
223 throw ReactError(
224 Error(
225 "EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."
226 )
227 );
228 eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);
229 recomputePluginOrdering();
230 },
231 injectEventPluginsByName: function(injectedNamesToPlugins) {
232 var isOrderingDirty = !1,
233 pluginName;
234 for (pluginName in injectedNamesToPlugins)
235 if (injectedNamesToPlugins.hasOwnProperty(pluginName)) {
236 var pluginModule = injectedNamesToPlugins[pluginName];
237 if (
238 !namesToPlugins.hasOwnProperty(pluginName) ||
239 namesToPlugins[pluginName] !== pluginModule
240 ) {
241 if (namesToPlugins[pluginName])
242 throw ReactError(
243 Error(
244 "EventPluginRegistry: Cannot inject two different event plugins using the same name, `" +
245 pluginName +
246 "`."
247 )
248 );
249 namesToPlugins[pluginName] = pluginModule;
250 isOrderingDirty = !0;
251 }
252 }
253 isOrderingDirty && recomputePluginOrdering();
254 }
255};
256function getListener(inst, registrationName) {
257 var listener = inst.stateNode;
258 if (!listener) return null;
259 var props = getFiberCurrentPropsFromNode(listener);
260 if (!props) return null;
261 listener = props[registrationName];
262 a: switch (registrationName) {
263 case "onClick":
264 case "onClickCapture":
265 case "onDoubleClick":
266 case "onDoubleClickCapture":
267 case "onMouseDown":
268 case "onMouseDownCapture":
269 case "onMouseMove":
270 case "onMouseMoveCapture":
271 case "onMouseUp":
272 case "onMouseUpCapture":
273 (props = !props.disabled) ||
274 ((inst = inst.type),
275 (props = !(
276 "button" === inst ||
277 "input" === inst ||
278 "select" === inst ||
279 "textarea" === inst
280 )));
281 inst = !props;
282 break a;
283 default:
284 inst = !1;
285 }
286 if (inst) return null;
287 if (listener && "function" !== typeof listener)
288 throw ReactError(
289 Error(
290 "Expected `" +
291 registrationName +
292 "` listener to be a function, instead got a value of `" +
293 typeof listener +
294 "` type."
295 )
296 );
297 return listener;
298}
299function getParent(inst) {
300 do inst = inst.return;
301 while (inst && 5 !== inst.tag);
302 return inst ? inst : null;
303}
304function traverseTwoPhase(inst, fn, arg) {
305 for (var path = []; inst; ) path.push(inst), (inst = getParent(inst));
306 for (inst = path.length; 0 < inst--; ) fn(path[inst], "captured", arg);
307 for (inst = 0; inst < path.length; inst++) fn(path[inst], "bubbled", arg);
308}
309function accumulateDirectionalDispatches(inst, phase, event) {
310 if (
311 (phase = getListener(
312 inst,
313 event.dispatchConfig.phasedRegistrationNames[phase]
314 ))
315 )
316 (event._dispatchListeners = accumulateInto(
317 event._dispatchListeners,
318 phase
319 )),
320 (event._dispatchInstances = accumulateInto(
321 event._dispatchInstances,
322 inst
323 ));
324}
325function accumulateTwoPhaseDispatchesSingle(event) {
326 event &&
327 event.dispatchConfig.phasedRegistrationNames &&
328 traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);
329}
330function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
331 if (event && event.dispatchConfig.phasedRegistrationNames) {
332 var targetInst = event._targetInst;
333 targetInst = targetInst ? getParent(targetInst) : null;
334 traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event);
335 }
336}
337function accumulateDirectDispatchesSingle(event) {
338 if (event && event.dispatchConfig.registrationName) {
339 var inst = event._targetInst;
340 if (inst && event && event.dispatchConfig.registrationName) {
341 var listener = getListener(inst, event.dispatchConfig.registrationName);
342 listener &&
343 ((event._dispatchListeners = accumulateInto(
344 event._dispatchListeners,
345 listener
346 )),
347 (event._dispatchInstances = accumulateInto(
348 event._dispatchInstances,
349 inst
350 )));
351 }
352 }
353}
354function functionThatReturnsTrue() {
355 return !0;
356}
357function functionThatReturnsFalse() {
358 return !1;
359}
360function SyntheticEvent(
361 dispatchConfig,
362 targetInst,
363 nativeEvent,
364 nativeEventTarget
365) {
366 this.dispatchConfig = dispatchConfig;
367 this._targetInst = targetInst;
368 this.nativeEvent = nativeEvent;
369 dispatchConfig = this.constructor.Interface;
370 for (var propName in dispatchConfig)
371 dispatchConfig.hasOwnProperty(propName) &&
372 ((targetInst = dispatchConfig[propName])
373 ? (this[propName] = targetInst(nativeEvent))
374 : "target" === propName
375 ? (this.target = nativeEventTarget)
376 : (this[propName] = nativeEvent[propName]));
377 this.isDefaultPrevented = (null != nativeEvent.defaultPrevented
378 ? nativeEvent.defaultPrevented
379 : !1 === nativeEvent.returnValue)
380 ? functionThatReturnsTrue
381 : functionThatReturnsFalse;
382 this.isPropagationStopped = functionThatReturnsFalse;
383 return this;
384}
385Object.assign(SyntheticEvent.prototype, {
386 preventDefault: function() {
387 this.defaultPrevented = !0;
388 var event = this.nativeEvent;
389 event &&
390 (event.preventDefault
391 ? event.preventDefault()
392 : "unknown" !== typeof event.returnValue && (event.returnValue = !1),
393 (this.isDefaultPrevented = functionThatReturnsTrue));
394 },
395 stopPropagation: function() {
396 var event = this.nativeEvent;
397 event &&
398 (event.stopPropagation
399 ? event.stopPropagation()
400 : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = !0),
401 (this.isPropagationStopped = functionThatReturnsTrue));
402 },
403 persist: function() {
404 this.isPersistent = functionThatReturnsTrue;
405 },
406 isPersistent: functionThatReturnsFalse,
407 destructor: function() {
408 var Interface = this.constructor.Interface,
409 propName;
410 for (propName in Interface) this[propName] = null;
411 this.nativeEvent = this._targetInst = this.dispatchConfig = null;
412 this.isPropagationStopped = this.isDefaultPrevented = functionThatReturnsFalse;
413 this._dispatchInstances = this._dispatchListeners = null;
414 }
415});
416SyntheticEvent.Interface = {
417 type: null,
418 target: null,
419 currentTarget: function() {
420 return null;
421 },
422 eventPhase: null,
423 bubbles: null,
424 cancelable: null,
425 timeStamp: function(event) {
426 return event.timeStamp || Date.now();
427 },
428 defaultPrevented: null,
429 isTrusted: null
430};
431SyntheticEvent.extend = function(Interface) {
432 function E() {}
433 function Class() {
434 return Super.apply(this, arguments);
435 }
436 var Super = this;
437 E.prototype = Super.prototype;
438 var prototype = new E();
439 Object.assign(prototype, Class.prototype);
440 Class.prototype = prototype;
441 Class.prototype.constructor = Class;
442 Class.Interface = Object.assign({}, Super.Interface, Interface);
443 Class.extend = Super.extend;
444 addEventPoolingTo(Class);
445 return Class;
446};
447addEventPoolingTo(SyntheticEvent);
448function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
449 if (this.eventPool.length) {
450 var instance = this.eventPool.pop();
451 this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);
452 return instance;
453 }
454 return new this(dispatchConfig, targetInst, nativeEvent, nativeInst);
455}
456function releasePooledEvent(event) {
457 if (!(event instanceof this))
458 throw ReactError(
459 Error(
460 "Trying to release an event instance into a pool of a different type."
461 )
462 );
463 event.destructor();
464 10 > this.eventPool.length && this.eventPool.push(event);
465}
466function addEventPoolingTo(EventConstructor) {
467 EventConstructor.eventPool = [];
468 EventConstructor.getPooled = getPooledEvent;
469 EventConstructor.release = releasePooledEvent;
470}
471var ResponderSyntheticEvent = SyntheticEvent.extend({
472 touchHistory: function() {
473 return null;
474 }
475});
476function isStartish(topLevelType) {
477 return "topTouchStart" === topLevelType;
478}
479function isMoveish(topLevelType) {
480 return "topTouchMove" === topLevelType;
481}
482var startDependencies = ["topTouchStart"],
483 moveDependencies = ["topTouchMove"],
484 endDependencies = ["topTouchCancel", "topTouchEnd"],
485 touchBank = [],
486 touchHistory = {
487 touchBank: touchBank,
488 numberActiveTouches: 0,
489 indexOfSingleActiveTouch: -1,
490 mostRecentTimeStamp: 0
491 };
492function timestampForTouch(touch) {
493 return touch.timeStamp || touch.timestamp;
494}
495function getTouchIdentifier(_ref) {
496 _ref = _ref.identifier;
497 if (null == _ref)
498 throw ReactError(Error("Touch object is missing identifier."));
499 return _ref;
500}
501function recordTouchStart(touch) {
502 var identifier = getTouchIdentifier(touch),
503 touchRecord = touchBank[identifier];
504 touchRecord
505 ? ((touchRecord.touchActive = !0),
506 (touchRecord.startPageX = touch.pageX),
507 (touchRecord.startPageY = touch.pageY),
508 (touchRecord.startTimeStamp = timestampForTouch(touch)),
509 (touchRecord.currentPageX = touch.pageX),
510 (touchRecord.currentPageY = touch.pageY),
511 (touchRecord.currentTimeStamp = timestampForTouch(touch)),
512 (touchRecord.previousPageX = touch.pageX),
513 (touchRecord.previousPageY = touch.pageY),
514 (touchRecord.previousTimeStamp = timestampForTouch(touch)))
515 : ((touchRecord = {
516 touchActive: !0,
517 startPageX: touch.pageX,
518 startPageY: touch.pageY,
519 startTimeStamp: timestampForTouch(touch),
520 currentPageX: touch.pageX,
521 currentPageY: touch.pageY,
522 currentTimeStamp: timestampForTouch(touch),
523 previousPageX: touch.pageX,
524 previousPageY: touch.pageY,
525 previousTimeStamp: timestampForTouch(touch)
526 }),
527 (touchBank[identifier] = touchRecord));
528 touchHistory.mostRecentTimeStamp = timestampForTouch(touch);
529}
530function recordTouchMove(touch) {
531 var touchRecord = touchBank[getTouchIdentifier(touch)];
532 touchRecord
533 ? ((touchRecord.touchActive = !0),
534 (touchRecord.previousPageX = touchRecord.currentPageX),
535 (touchRecord.previousPageY = touchRecord.currentPageY),
536 (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
537 (touchRecord.currentPageX = touch.pageX),
538 (touchRecord.currentPageY = touch.pageY),
539 (touchRecord.currentTimeStamp = timestampForTouch(touch)),
540 (touchHistory.mostRecentTimeStamp = timestampForTouch(touch)))
541 : console.warn(
542 "Cannot record touch move without a touch start.\nTouch Move: %s\n",
543 "Touch Bank: %s",
544 printTouch(touch),
545 printTouchBank()
546 );
547}
548function recordTouchEnd(touch) {
549 var touchRecord = touchBank[getTouchIdentifier(touch)];
550 touchRecord
551 ? ((touchRecord.touchActive = !1),
552 (touchRecord.previousPageX = touchRecord.currentPageX),
553 (touchRecord.previousPageY = touchRecord.currentPageY),
554 (touchRecord.previousTimeStamp = touchRecord.currentTimeStamp),
555 (touchRecord.currentPageX = touch.pageX),
556 (touchRecord.currentPageY = touch.pageY),
557 (touchRecord.currentTimeStamp = timestampForTouch(touch)),
558 (touchHistory.mostRecentTimeStamp = timestampForTouch(touch)))
559 : console.warn(
560 "Cannot record touch end without a touch start.\nTouch End: %s\n",
561 "Touch Bank: %s",
562 printTouch(touch),
563 printTouchBank()
564 );
565}
566function printTouch(touch) {
567 return JSON.stringify({
568 identifier: touch.identifier,
569 pageX: touch.pageX,
570 pageY: touch.pageY,
571 timestamp: timestampForTouch(touch)
572 });
573}
574function printTouchBank() {
575 var printed = JSON.stringify(touchBank.slice(0, 20));
576 20 < touchBank.length &&
577 (printed += " (original size: " + touchBank.length + ")");
578 return printed;
579}
580var ResponderTouchHistoryStore = {
581 recordTouchTrack: function(topLevelType, nativeEvent) {
582 if (isMoveish(topLevelType))
583 nativeEvent.changedTouches.forEach(recordTouchMove);
584 else if (isStartish(topLevelType))
585 nativeEvent.changedTouches.forEach(recordTouchStart),
586 (touchHistory.numberActiveTouches = nativeEvent.touches.length),
587 1 === touchHistory.numberActiveTouches &&
588 (touchHistory.indexOfSingleActiveTouch =
589 nativeEvent.touches[0].identifier);
590 else if (
591 "topTouchEnd" === topLevelType ||
592 "topTouchCancel" === topLevelType
593 )
594 if (
595 (nativeEvent.changedTouches.forEach(recordTouchEnd),
596 (touchHistory.numberActiveTouches = nativeEvent.touches.length),
597 1 === touchHistory.numberActiveTouches)
598 )
599 for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++)
600 if (
601 ((nativeEvent = touchBank[topLevelType]),
602 null != nativeEvent && nativeEvent.touchActive)
603 ) {
604 touchHistory.indexOfSingleActiveTouch = topLevelType;
605 break;
606 }
607 },
608 touchHistory: touchHistory
609};
610function accumulate(current, next) {
611 if (null == next)
612 throw ReactError(
613 Error("accumulate(...): Accumulated items must not be null or undefined.")
614 );
615 return null == current
616 ? next
617 : Array.isArray(current)
618 ? current.concat(next)
619 : Array.isArray(next)
620 ? [current].concat(next)
621 : [current, next];
622}
623var responderInst = null,
624 trackedTouchCount = 0;
625function changeResponder(nextResponderInst, blockHostResponder) {
626 var oldResponderInst = responderInst;
627 responderInst = nextResponderInst;
628 if (null !== ResponderEventPlugin.GlobalResponderHandler)
629 ResponderEventPlugin.GlobalResponderHandler.onChange(
630 oldResponderInst,
631 nextResponderInst,
632 blockHostResponder
633 );
634}
635var eventTypes = {
636 startShouldSetResponder: {
637 phasedRegistrationNames: {
638 bubbled: "onStartShouldSetResponder",
639 captured: "onStartShouldSetResponderCapture"
640 },
641 dependencies: startDependencies
642 },
643 scrollShouldSetResponder: {
644 phasedRegistrationNames: {
645 bubbled: "onScrollShouldSetResponder",
646 captured: "onScrollShouldSetResponderCapture"
647 },
648 dependencies: ["topScroll"]
649 },
650 selectionChangeShouldSetResponder: {
651 phasedRegistrationNames: {
652 bubbled: "onSelectionChangeShouldSetResponder",
653 captured: "onSelectionChangeShouldSetResponderCapture"
654 },
655 dependencies: ["topSelectionChange"]
656 },
657 moveShouldSetResponder: {
658 phasedRegistrationNames: {
659 bubbled: "onMoveShouldSetResponder",
660 captured: "onMoveShouldSetResponderCapture"
661 },
662 dependencies: moveDependencies
663 },
664 responderStart: {
665 registrationName: "onResponderStart",
666 dependencies: startDependencies
667 },
668 responderMove: {
669 registrationName: "onResponderMove",
670 dependencies: moveDependencies
671 },
672 responderEnd: {
673 registrationName: "onResponderEnd",
674 dependencies: endDependencies
675 },
676 responderRelease: {
677 registrationName: "onResponderRelease",
678 dependencies: endDependencies
679 },
680 responderTerminationRequest: {
681 registrationName: "onResponderTerminationRequest",
682 dependencies: []
683 },
684 responderGrant: { registrationName: "onResponderGrant", dependencies: [] },
685 responderReject: {
686 registrationName: "onResponderReject",
687 dependencies: []
688 },
689 responderTerminate: {
690 registrationName: "onResponderTerminate",
691 dependencies: []
692 }
693 },
694 ResponderEventPlugin = {
695 _getResponder: function() {
696 return responderInst;
697 },
698 eventTypes: eventTypes,
699 extractEvents: function(
700 topLevelType,
701 targetInst,
702 nativeEvent,
703 nativeEventTarget
704 ) {
705 if (isStartish(topLevelType)) trackedTouchCount += 1;
706 else if (
707 "topTouchEnd" === topLevelType ||
708 "topTouchCancel" === topLevelType
709 )
710 if (0 <= trackedTouchCount) --trackedTouchCount;
711 else
712 return (
713 console.error(
714 "Ended a touch event which was not counted in `trackedTouchCount`."
715 ),
716 null
717 );
718 ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent);
719 if (
720 targetInst &&
721 (("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll) ||
722 (0 < trackedTouchCount && "topSelectionChange" === topLevelType) ||
723 isStartish(topLevelType) ||
724 isMoveish(topLevelType))
725 ) {
726 var JSCompiler_temp = isStartish(topLevelType)
727 ? eventTypes.startShouldSetResponder
728 : isMoveish(topLevelType)
729 ? eventTypes.moveShouldSetResponder
730 : "topSelectionChange" === topLevelType
731 ? eventTypes.selectionChangeShouldSetResponder
732 : eventTypes.scrollShouldSetResponder;
733 if (responderInst)
734 b: {
735 var JSCompiler_temp$jscomp$0 = responderInst;
736 for (
737 var depthA = 0, tempA = JSCompiler_temp$jscomp$0;
738 tempA;
739 tempA = getParent(tempA)
740 )
741 depthA++;
742 tempA = 0;
743 for (var tempB = targetInst; tempB; tempB = getParent(tempB))
744 tempA++;
745 for (; 0 < depthA - tempA; )
746 (JSCompiler_temp$jscomp$0 = getParent(JSCompiler_temp$jscomp$0)),
747 depthA--;
748 for (; 0 < tempA - depthA; )
749 (targetInst = getParent(targetInst)), tempA--;
750 for (; depthA--; ) {
751 if (
752 JSCompiler_temp$jscomp$0 === targetInst ||
753 JSCompiler_temp$jscomp$0 === targetInst.alternate
754 )
755 break b;
756 JSCompiler_temp$jscomp$0 = getParent(JSCompiler_temp$jscomp$0);
757 targetInst = getParent(targetInst);
758 }
759 JSCompiler_temp$jscomp$0 = null;
760 }
761 else JSCompiler_temp$jscomp$0 = targetInst;
762 targetInst = JSCompiler_temp$jscomp$0 === responderInst;
763 JSCompiler_temp$jscomp$0 = ResponderSyntheticEvent.getPooled(
764 JSCompiler_temp,
765 JSCompiler_temp$jscomp$0,
766 nativeEvent,
767 nativeEventTarget
768 );
769 JSCompiler_temp$jscomp$0.touchHistory =
770 ResponderTouchHistoryStore.touchHistory;
771 targetInst
772 ? forEachAccumulated(
773 JSCompiler_temp$jscomp$0,
774 accumulateTwoPhaseDispatchesSingleSkipTarget
775 )
776 : forEachAccumulated(
777 JSCompiler_temp$jscomp$0,
778 accumulateTwoPhaseDispatchesSingle
779 );
780 b: {
781 JSCompiler_temp = JSCompiler_temp$jscomp$0._dispatchListeners;
782 targetInst = JSCompiler_temp$jscomp$0._dispatchInstances;
783 if (Array.isArray(JSCompiler_temp))
784 for (
785 depthA = 0;
786 depthA < JSCompiler_temp.length &&
787 !JSCompiler_temp$jscomp$0.isPropagationStopped();
788 depthA++
789 ) {
790 if (
791 JSCompiler_temp[depthA](
792 JSCompiler_temp$jscomp$0,
793 targetInst[depthA]
794 )
795 ) {
796 JSCompiler_temp = targetInst[depthA];
797 break b;
798 }
799 }
800 else if (
801 JSCompiler_temp &&
802 JSCompiler_temp(JSCompiler_temp$jscomp$0, targetInst)
803 ) {
804 JSCompiler_temp = targetInst;
805 break b;
806 }
807 JSCompiler_temp = null;
808 }
809 JSCompiler_temp$jscomp$0._dispatchInstances = null;
810 JSCompiler_temp$jscomp$0._dispatchListeners = null;
811 JSCompiler_temp$jscomp$0.isPersistent() ||
812 JSCompiler_temp$jscomp$0.constructor.release(
813 JSCompiler_temp$jscomp$0
814 );
815 JSCompiler_temp && JSCompiler_temp !== responderInst
816 ? ((JSCompiler_temp$jscomp$0 = void 0),
817 (targetInst = ResponderSyntheticEvent.getPooled(
818 eventTypes.responderGrant,
819 JSCompiler_temp,
820 nativeEvent,
821 nativeEventTarget
822 )),
823 (targetInst.touchHistory = ResponderTouchHistoryStore.touchHistory),
824 forEachAccumulated(targetInst, accumulateDirectDispatchesSingle),
825 (depthA = !0 === executeDirectDispatch(targetInst)),
826 responderInst
827 ? ((tempA = ResponderSyntheticEvent.getPooled(
828 eventTypes.responderTerminationRequest,
829 responderInst,
830 nativeEvent,
831 nativeEventTarget
832 )),
833 (tempA.touchHistory = ResponderTouchHistoryStore.touchHistory),
834 forEachAccumulated(tempA, accumulateDirectDispatchesSingle),
835 (tempB =
836 !tempA._dispatchListeners || executeDirectDispatch(tempA)),
837 tempA.isPersistent() || tempA.constructor.release(tempA),
838 tempB
839 ? ((tempA = ResponderSyntheticEvent.getPooled(
840 eventTypes.responderTerminate,
841 responderInst,
842 nativeEvent,
843 nativeEventTarget
844 )),
845 (tempA.touchHistory =
846 ResponderTouchHistoryStore.touchHistory),
847 forEachAccumulated(tempA, accumulateDirectDispatchesSingle),
848 (JSCompiler_temp$jscomp$0 = accumulate(
849 JSCompiler_temp$jscomp$0,
850 [targetInst, tempA]
851 )),
852 changeResponder(JSCompiler_temp, depthA))
853 : ((JSCompiler_temp = ResponderSyntheticEvent.getPooled(
854 eventTypes.responderReject,
855 JSCompiler_temp,
856 nativeEvent,
857 nativeEventTarget
858 )),
859 (JSCompiler_temp.touchHistory =
860 ResponderTouchHistoryStore.touchHistory),
861 forEachAccumulated(
862 JSCompiler_temp,
863 accumulateDirectDispatchesSingle
864 ),
865 (JSCompiler_temp$jscomp$0 = accumulate(
866 JSCompiler_temp$jscomp$0,
867 JSCompiler_temp
868 ))))
869 : ((JSCompiler_temp$jscomp$0 = accumulate(
870 JSCompiler_temp$jscomp$0,
871 targetInst
872 )),
873 changeResponder(JSCompiler_temp, depthA)),
874 (JSCompiler_temp = JSCompiler_temp$jscomp$0))
875 : (JSCompiler_temp = null);
876 } else JSCompiler_temp = null;
877 JSCompiler_temp$jscomp$0 = responderInst && isStartish(topLevelType);
878 targetInst = responderInst && isMoveish(topLevelType);
879 depthA =
880 responderInst &&
881 ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType);
882 if (
883 (JSCompiler_temp$jscomp$0 = JSCompiler_temp$jscomp$0
884 ? eventTypes.responderStart
885 : targetInst
886 ? eventTypes.responderMove
887 : depthA
888 ? eventTypes.responderEnd
889 : null)
890 )
891 (JSCompiler_temp$jscomp$0 = ResponderSyntheticEvent.getPooled(
892 JSCompiler_temp$jscomp$0,
893 responderInst,
894 nativeEvent,
895 nativeEventTarget
896 )),
897 (JSCompiler_temp$jscomp$0.touchHistory =
898 ResponderTouchHistoryStore.touchHistory),
899 forEachAccumulated(
900 JSCompiler_temp$jscomp$0,
901 accumulateDirectDispatchesSingle
902 ),
903 (JSCompiler_temp = accumulate(
904 JSCompiler_temp,
905 JSCompiler_temp$jscomp$0
906 ));
907 JSCompiler_temp$jscomp$0 =
908 responderInst && "topTouchCancel" === topLevelType;
909 if (
910 (topLevelType =
911 responderInst &&
912 !JSCompiler_temp$jscomp$0 &&
913 ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType))
914 )
915 a: {
916 if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length)
917 for (targetInst = 0; targetInst < topLevelType.length; targetInst++)
918 if (
919 ((depthA = topLevelType[targetInst].target),
920 null !== depthA && void 0 !== depthA && 0 !== depthA)
921 ) {
922 tempA = getInstanceFromNode(depthA);
923 b: {
924 for (depthA = responderInst; tempA; ) {
925 if (depthA === tempA || depthA === tempA.alternate) {
926 depthA = !0;
927 break b;
928 }
929 tempA = getParent(tempA);
930 }
931 depthA = !1;
932 }
933 if (depthA) {
934 topLevelType = !1;
935 break a;
936 }
937 }
938 topLevelType = !0;
939 }
940 if (
941 (topLevelType = JSCompiler_temp$jscomp$0
942 ? eventTypes.responderTerminate
943 : topLevelType
944 ? eventTypes.responderRelease
945 : null)
946 )
947 (nativeEvent = ResponderSyntheticEvent.getPooled(
948 topLevelType,
949 responderInst,
950 nativeEvent,
951 nativeEventTarget
952 )),
953 (nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory),
954 forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle),
955 (JSCompiler_temp = accumulate(JSCompiler_temp, nativeEvent)),
956 changeResponder(null);
957 return JSCompiler_temp;
958 },
959 GlobalResponderHandler: null,
960 injection: {
961 injectGlobalResponderHandler: function(GlobalResponderHandler) {
962 ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler;
963 }
964 }
965 },
966 customBubblingEventTypes =
967 ReactNativePrivateInterface.ReactNativeViewConfigRegistry
968 .customBubblingEventTypes,
969 customDirectEventTypes =
970 ReactNativePrivateInterface.ReactNativeViewConfigRegistry
971 .customDirectEventTypes;
972injection.injectEventPluginOrder([
973 "ResponderEventPlugin",
974 "ReactNativeBridgeEventPlugin"
975]);
976injection.injectEventPluginsByName({
977 ResponderEventPlugin: ResponderEventPlugin,
978 ReactNativeBridgeEventPlugin: {
979 eventTypes: {},
980 extractEvents: function(
981 topLevelType,
982 targetInst,
983 nativeEvent,
984 nativeEventTarget
985 ) {
986 if (null == targetInst) return null;
987 var bubbleDispatchConfig = customBubblingEventTypes[topLevelType],
988 directDispatchConfig = customDirectEventTypes[topLevelType];
989 if (!bubbleDispatchConfig && !directDispatchConfig)
990 throw ReactError(
991 Error(
992 'Unsupported top level event type "' + topLevelType + '" dispatched'
993 )
994 );
995 topLevelType = SyntheticEvent.getPooled(
996 bubbleDispatchConfig || directDispatchConfig,
997 targetInst,
998 nativeEvent,
999 nativeEventTarget
1000 );
1001 if (bubbleDispatchConfig)
1002 forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle);
1003 else if (directDispatchConfig)
1004 forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle);
1005 else return null;
1006 return topLevelType;
1007 }
1008 }
1009});
1010function getInstanceFromInstance(instanceHandle) {
1011 return instanceHandle;
1012}
1013getFiberCurrentPropsFromNode = function(inst) {
1014 return inst.canonical.currentProps;
1015};
1016getInstanceFromNode = getInstanceFromInstance;
1017getNodeFromInstance = function(inst) {
1018 inst = inst.stateNode.canonical._nativeTag;
1019 if (!inst) throw ReactError(Error("All native instances should have a tag."));
1020 return inst;
1021};
1022ResponderEventPlugin.injection.injectGlobalResponderHandler({
1023 onChange: function(from, to, blockNativeResponder) {
1024 null !== to
1025 ? ReactNativePrivateInterface.UIManager.setJSResponder(
1026 to.stateNode.canonical._nativeTag,
1027 blockNativeResponder
1028 )
1029 : ReactNativePrivateInterface.UIManager.clearJSResponder();
1030 }
1031});
1032var ReactSharedInternals =
1033 React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1034ReactSharedInternals.hasOwnProperty("ReactCurrentDispatcher") ||
1035 (ReactSharedInternals.ReactCurrentDispatcher = { current: null });
1036ReactSharedInternals.hasOwnProperty("ReactCurrentBatchConfig") ||
1037 (ReactSharedInternals.ReactCurrentBatchConfig = { suspense: null });
1038var hasSymbol = "function" === typeof Symbol && Symbol.for,
1039 REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103,
1040 REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106,
1041 REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107,
1042 REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108,
1043 REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114,
1044 REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109,
1045 REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110,
1046 REACT_CONCURRENT_MODE_TYPE = hasSymbol
1047 ? Symbol.for("react.concurrent_mode")
1048 : 60111,
1049 REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112,
1050 REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113,
1051 REACT_SUSPENSE_LIST_TYPE = hasSymbol
1052 ? Symbol.for("react.suspense_list")
1053 : 60120,
1054 REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115,
1055 REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
1056hasSymbol && Symbol.for("react.fundamental");
1057hasSymbol && Symbol.for("react.responder");
1058var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator;
1059function getIteratorFn(maybeIterable) {
1060 if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
1061 maybeIterable =
1062 (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
1063 maybeIterable["@@iterator"];
1064 return "function" === typeof maybeIterable ? maybeIterable : null;
1065}
1066function getComponentName(type) {
1067 if (null == type) return null;
1068 if ("function" === typeof type) return type.displayName || type.name || null;
1069 if ("string" === typeof type) return type;
1070 switch (type) {
1071 case REACT_FRAGMENT_TYPE:
1072 return "Fragment";
1073 case REACT_PORTAL_TYPE:
1074 return "Portal";
1075 case REACT_PROFILER_TYPE:
1076 return "Profiler";
1077 case REACT_STRICT_MODE_TYPE:
1078 return "StrictMode";
1079 case REACT_SUSPENSE_TYPE:
1080 return "Suspense";
1081 case REACT_SUSPENSE_LIST_TYPE:
1082 return "SuspenseList";
1083 }
1084 if ("object" === typeof type)
1085 switch (type.$$typeof) {
1086 case REACT_CONTEXT_TYPE:
1087 return "Context.Consumer";
1088 case REACT_PROVIDER_TYPE:
1089 return "Context.Provider";
1090 case REACT_FORWARD_REF_TYPE:
1091 var innerType = type.render;
1092 innerType = innerType.displayName || innerType.name || "";
1093 return (
1094 type.displayName ||
1095 ("" !== innerType ? "ForwardRef(" + innerType + ")" : "ForwardRef")
1096 );
1097 case REACT_MEMO_TYPE:
1098 return getComponentName(type.type);
1099 case REACT_LAZY_TYPE:
1100 if ((type = 1 === type._status ? type._result : null))
1101 return getComponentName(type);
1102 }
1103 return null;
1104}
1105require("../shims/ReactFeatureFlags");
1106function isFiberMountedImpl(fiber) {
1107 var node = fiber;
1108 if (fiber.alternate) for (; node.return; ) node = node.return;
1109 else {
1110 if (0 !== (node.effectTag & 2)) return 1;
1111 for (; node.return; )
1112 if (((node = node.return), 0 !== (node.effectTag & 2))) return 1;
1113 }
1114 return 3 === node.tag ? 2 : 3;
1115}
1116function assertIsMounted(fiber) {
1117 if (2 !== isFiberMountedImpl(fiber))
1118 throw ReactError(Error("Unable to find node on an unmounted component."));
1119}
1120function findCurrentFiberUsingSlowPath(fiber) {
1121 var alternate = fiber.alternate;
1122 if (!alternate) {
1123 alternate = isFiberMountedImpl(fiber);
1124 if (3 === alternate)
1125 throw ReactError(Error("Unable to find node on an unmounted component."));
1126 return 1 === alternate ? null : fiber;
1127 }
1128 for (var a = fiber, b = alternate; ; ) {
1129 var parentA = a.return;
1130 if (null === parentA) break;
1131 var parentB = parentA.alternate;
1132 if (null === parentB) {
1133 b = parentA.return;
1134 if (null !== b) {
1135 a = b;
1136 continue;
1137 }
1138 break;
1139 }
1140 if (parentA.child === parentB.child) {
1141 for (parentB = parentA.child; parentB; ) {
1142 if (parentB === a) return assertIsMounted(parentA), fiber;
1143 if (parentB === b) return assertIsMounted(parentA), alternate;
1144 parentB = parentB.sibling;
1145 }
1146 throw ReactError(Error("Unable to find node on an unmounted component."));
1147 }
1148 if (a.return !== b.return) (a = parentA), (b = parentB);
1149 else {
1150 for (var didFindChild = !1, _child = parentA.child; _child; ) {
1151 if (_child === a) {
1152 didFindChild = !0;
1153 a = parentA;
1154 b = parentB;
1155 break;
1156 }
1157 if (_child === b) {
1158 didFindChild = !0;
1159 b = parentA;
1160 a = parentB;
1161 break;
1162 }
1163 _child = _child.sibling;
1164 }
1165 if (!didFindChild) {
1166 for (_child = parentB.child; _child; ) {
1167 if (_child === a) {
1168 didFindChild = !0;
1169 a = parentB;
1170 b = parentA;
1171 break;
1172 }
1173 if (_child === b) {
1174 didFindChild = !0;
1175 b = parentB;
1176 a = parentA;
1177 break;
1178 }
1179 _child = _child.sibling;
1180 }
1181 if (!didFindChild)
1182 throw ReactError(
1183 Error(
1184 "Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."
1185 )
1186 );
1187 }
1188 }
1189 if (a.alternate !== b)
1190 throw ReactError(
1191 Error(
1192 "Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."
1193 )
1194 );
1195 }
1196 if (3 !== a.tag)
1197 throw ReactError(Error("Unable to find node on an unmounted component."));
1198 return a.stateNode.current === a ? fiber : alternate;
1199}
1200function findCurrentHostFiber(parent) {
1201 parent = findCurrentFiberUsingSlowPath(parent);
1202 if (!parent) return null;
1203 for (var node = parent; ; ) {
1204 if (5 === node.tag || 6 === node.tag) return node;
1205 if (node.child) (node.child.return = node), (node = node.child);
1206 else {
1207 if (node === parent) break;
1208 for (; !node.sibling; ) {
1209 if (!node.return || node.return === parent) return null;
1210 node = node.return;
1211 }
1212 node.sibling.return = node.return;
1213 node = node.sibling;
1214 }
1215 }
1216 return null;
1217}
1218function mountSafeCallback_NOT_REALLY_SAFE(context, callback) {
1219 return function() {
1220 if (
1221 callback &&
1222 ("boolean" !== typeof context.__isMounted || context.__isMounted)
1223 )
1224 return callback.apply(context, arguments);
1225 };
1226}
1227var emptyObject = {},
1228 removedKeys = null,
1229 removedKeyCount = 0;
1230function restoreDeletedValuesInNestedArray(
1231 updatePayload,
1232 node,
1233 validAttributes
1234) {
1235 if (Array.isArray(node))
1236 for (var i = node.length; i-- && 0 < removedKeyCount; )
1237 restoreDeletedValuesInNestedArray(
1238 updatePayload,
1239 node[i],
1240 validAttributes
1241 );
1242 else if (node && 0 < removedKeyCount)
1243 for (i in removedKeys)
1244 if (removedKeys[i]) {
1245 var nextProp = node[i];
1246 if (void 0 !== nextProp) {
1247 var attributeConfig = validAttributes[i];
1248 if (attributeConfig) {
1249 "function" === typeof nextProp && (nextProp = !0);
1250 "undefined" === typeof nextProp && (nextProp = null);
1251 if ("object" !== typeof attributeConfig)
1252 updatePayload[i] = nextProp;
1253 else if (
1254 "function" === typeof attributeConfig.diff ||
1255 "function" === typeof attributeConfig.process
1256 )
1257 (nextProp =
1258 "function" === typeof attributeConfig.process
1259 ? attributeConfig.process(nextProp)
1260 : nextProp),
1261 (updatePayload[i] = nextProp);
1262 removedKeys[i] = !1;
1263 removedKeyCount--;
1264 }
1265 }
1266 }
1267}
1268function diffNestedProperty(
1269 updatePayload,
1270 prevProp,
1271 nextProp,
1272 validAttributes
1273) {
1274 if (!updatePayload && prevProp === nextProp) return updatePayload;
1275 if (!prevProp || !nextProp)
1276 return nextProp
1277 ? addNestedProperty(updatePayload, nextProp, validAttributes)
1278 : prevProp
1279 ? clearNestedProperty(updatePayload, prevProp, validAttributes)
1280 : updatePayload;
1281 if (!Array.isArray(prevProp) && !Array.isArray(nextProp))
1282 return diffProperties(updatePayload, prevProp, nextProp, validAttributes);
1283 if (Array.isArray(prevProp) && Array.isArray(nextProp)) {
1284 var minLength =
1285 prevProp.length < nextProp.length ? prevProp.length : nextProp.length,
1286 i;
1287 for (i = 0; i < minLength; i++)
1288 updatePayload = diffNestedProperty(
1289 updatePayload,
1290 prevProp[i],
1291 nextProp[i],
1292 validAttributes
1293 );
1294 for (; i < prevProp.length; i++)
1295 updatePayload = clearNestedProperty(
1296 updatePayload,
1297 prevProp[i],
1298 validAttributes
1299 );
1300 for (; i < nextProp.length; i++)
1301 updatePayload = addNestedProperty(
1302 updatePayload,
1303 nextProp[i],
1304 validAttributes
1305 );
1306 return updatePayload;
1307 }
1308 return Array.isArray(prevProp)
1309 ? diffProperties(
1310 updatePayload,
1311 ReactNativePrivateInterface.flattenStyle(prevProp),
1312 nextProp,
1313 validAttributes
1314 )
1315 : diffProperties(
1316 updatePayload,
1317 prevProp,
1318 ReactNativePrivateInterface.flattenStyle(nextProp),
1319 validAttributes
1320 );
1321}
1322function addNestedProperty(updatePayload, nextProp, validAttributes) {
1323 if (!nextProp) return updatePayload;
1324 if (!Array.isArray(nextProp))
1325 return diffProperties(
1326 updatePayload,
1327 emptyObject,
1328 nextProp,
1329 validAttributes
1330 );
1331 for (var i = 0; i < nextProp.length; i++)
1332 updatePayload = addNestedProperty(
1333 updatePayload,
1334 nextProp[i],
1335 validAttributes
1336 );
1337 return updatePayload;
1338}
1339function clearNestedProperty(updatePayload, prevProp, validAttributes) {
1340 if (!prevProp) return updatePayload;
1341 if (!Array.isArray(prevProp))
1342 return diffProperties(
1343 updatePayload,
1344 prevProp,
1345 emptyObject,
1346 validAttributes
1347 );
1348 for (var i = 0; i < prevProp.length; i++)
1349 updatePayload = clearNestedProperty(
1350 updatePayload,
1351 prevProp[i],
1352 validAttributes
1353 );
1354 return updatePayload;
1355}
1356function diffProperties(updatePayload, prevProps, nextProps, validAttributes) {
1357 var attributeConfig, propKey;
1358 for (propKey in nextProps)
1359 if ((attributeConfig = validAttributes[propKey])) {
1360 var prevProp = prevProps[propKey];
1361 var nextProp = nextProps[propKey];
1362 "function" === typeof nextProp &&
1363 ((nextProp = !0), "function" === typeof prevProp && (prevProp = !0));
1364 "undefined" === typeof nextProp &&
1365 ((nextProp = null),
1366 "undefined" === typeof prevProp && (prevProp = null));
1367 removedKeys && (removedKeys[propKey] = !1);
1368 if (updatePayload && void 0 !== updatePayload[propKey])
1369 if ("object" !== typeof attributeConfig)
1370 updatePayload[propKey] = nextProp;
1371 else {
1372 if (
1373 "function" === typeof attributeConfig.diff ||
1374 "function" === typeof attributeConfig.process
1375 )
1376 (attributeConfig =
1377 "function" === typeof attributeConfig.process
1378 ? attributeConfig.process(nextProp)
1379 : nextProp),
1380 (updatePayload[propKey] = attributeConfig);
1381 }
1382 else if (prevProp !== nextProp)
1383 if ("object" !== typeof attributeConfig)
1384 ("object" !== typeof nextProp ||
1385 null === nextProp ||
1386 ReactNativePrivateInterface.deepDiffer(prevProp, nextProp)) &&
1387 ((updatePayload || (updatePayload = {}))[propKey] = nextProp);
1388 else if (
1389 "function" === typeof attributeConfig.diff ||
1390 "function" === typeof attributeConfig.process
1391 ) {
1392 if (
1393 void 0 === prevProp ||
1394 ("function" === typeof attributeConfig.diff
1395 ? attributeConfig.diff(prevProp, nextProp)
1396 : "object" !== typeof nextProp ||
1397 null === nextProp ||
1398 ReactNativePrivateInterface.deepDiffer(prevProp, nextProp))
1399 )
1400 (attributeConfig =
1401 "function" === typeof attributeConfig.process
1402 ? attributeConfig.process(nextProp)
1403 : nextProp),
1404 ((updatePayload || (updatePayload = {}))[
1405 propKey
1406 ] = attributeConfig);
1407 } else
1408 (removedKeys = null),
1409 (removedKeyCount = 0),
1410 (updatePayload = diffNestedProperty(
1411 updatePayload,
1412 prevProp,
1413 nextProp,
1414 attributeConfig
1415 )),
1416 0 < removedKeyCount &&
1417 updatePayload &&
1418 (restoreDeletedValuesInNestedArray(
1419 updatePayload,
1420 nextProp,
1421 attributeConfig
1422 ),
1423 (removedKeys = null));
1424 }
1425 for (var _propKey in prevProps)
1426 void 0 === nextProps[_propKey] &&
1427 (!(attributeConfig = validAttributes[_propKey]) ||
1428 (updatePayload && void 0 !== updatePayload[_propKey]) ||
1429 ((prevProp = prevProps[_propKey]),
1430 void 0 !== prevProp &&
1431 ("object" !== typeof attributeConfig ||
1432 "function" === typeof attributeConfig.diff ||
1433 "function" === typeof attributeConfig.process
1434 ? (((updatePayload || (updatePayload = {}))[_propKey] = null),
1435 removedKeys || (removedKeys = {}),
1436 removedKeys[_propKey] ||
1437 ((removedKeys[_propKey] = !0), removedKeyCount++))
1438 : (updatePayload = clearNestedProperty(
1439 updatePayload,
1440 prevProp,
1441 attributeConfig
1442 )))));
1443 return updatePayload;
1444}
1445var restoreTarget = null,
1446 restoreQueue = null;
1447function restoreStateOfTarget(target) {
1448 if (getInstanceFromNode(target))
1449 throw ReactError(
1450 Error(
1451 "setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue."
1452 )
1453 );
1454}
1455function batchedUpdatesImpl(fn, bookkeeping) {
1456 return fn(bookkeeping);
1457}
1458function flushDiscreteUpdatesImpl() {}
1459var isInsideEventHandler = !1;
1460function batchedUpdates(fn, bookkeeping) {
1461 if (isInsideEventHandler) return fn(bookkeeping);
1462 isInsideEventHandler = !0;
1463 try {
1464 return batchedUpdatesImpl(fn, bookkeeping);
1465 } finally {
1466 if (
1467 ((isInsideEventHandler = !1),
1468 null !== restoreTarget || null !== restoreQueue)
1469 )
1470 if (
1471 (flushDiscreteUpdatesImpl(),
1472 restoreTarget &&
1473 ((bookkeeping = restoreTarget),
1474 (fn = restoreQueue),
1475 (restoreQueue = restoreTarget = null),
1476 restoreStateOfTarget(bookkeeping),
1477 fn))
1478 )
1479 for (bookkeeping = 0; bookkeeping < fn.length; bookkeeping++)
1480 restoreStateOfTarget(fn[bookkeeping]);
1481 }
1482}
1483function _inherits(subClass, superClass) {
1484 if ("function" !== typeof superClass && null !== superClass)
1485 throw new TypeError(
1486 "Super expression must either be null or a function, not " +
1487 typeof superClass
1488 );
1489 subClass.prototype = Object.create(superClass && superClass.prototype, {
1490 constructor: {
1491 value: subClass,
1492 enumerable: !1,
1493 writable: !0,
1494 configurable: !0
1495 }
1496 });
1497 superClass &&
1498 (Object.setPrototypeOf
1499 ? Object.setPrototypeOf(subClass, superClass)
1500 : (subClass.__proto__ = superClass));
1501}
1502(function(_React$Component) {
1503 function ReactNativeComponent() {
1504 if (!(this instanceof ReactNativeComponent))
1505 throw new TypeError("Cannot call a class as a function");
1506 var call = _React$Component.apply(this, arguments);
1507 if (!this)
1508 throw new ReferenceError(
1509 "this hasn't been initialised - super() hasn't been called"
1510 );
1511 return !call || ("object" !== typeof call && "function" !== typeof call)
1512 ? this
1513 : call;
1514 }
1515 _inherits(ReactNativeComponent, _React$Component);
1516 ReactNativeComponent.prototype.blur = function() {};
1517 ReactNativeComponent.prototype.focus = function() {};
1518 ReactNativeComponent.prototype.measure = function() {};
1519 ReactNativeComponent.prototype.measureInWindow = function() {};
1520 ReactNativeComponent.prototype.measureLayout = function() {};
1521 ReactNativeComponent.prototype.setNativeProps = function() {};
1522 return ReactNativeComponent;
1523})(React.Component);
1524new Map();
1525new Map();
1526new Set();
1527new Map();
1528function dispatchEvent(target, topLevelType, nativeEvent) {
1529 batchedUpdates(function() {
1530 var events = nativeEvent.target;
1531 for (var events$jscomp$0 = null, i = 0; i < plugins.length; i++) {
1532 var possiblePlugin = plugins[i];
1533 possiblePlugin &&
1534 (possiblePlugin = possiblePlugin.extractEvents(
1535 topLevelType,
1536 target,
1537 nativeEvent,
1538 events
1539 )) &&
1540 (events$jscomp$0 = accumulateInto(events$jscomp$0, possiblePlugin));
1541 }
1542 events = events$jscomp$0;
1543 null !== events && (eventQueue = accumulateInto(eventQueue, events));
1544 events = eventQueue;
1545 eventQueue = null;
1546 if (events) {
1547 forEachAccumulated(events, executeDispatchesAndReleaseTopLevel);
1548 if (eventQueue)
1549 throw ReactError(
1550 Error(
1551 "processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."
1552 )
1553 );
1554 if (hasRethrowError)
1555 throw ((events = rethrowError),
1556 (hasRethrowError = !1),
1557 (rethrowError = null),
1558 events);
1559 }
1560 });
1561}
1562function shim$1() {
1563 throw ReactError(
1564 Error(
1565 "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue."
1566 )
1567 );
1568}
1569var _nativeFabricUIManage$1 = nativeFabricUIManager,
1570 createNode = _nativeFabricUIManage$1.createNode,
1571 cloneNode = _nativeFabricUIManage$1.cloneNode,
1572 cloneNodeWithNewChildren = _nativeFabricUIManage$1.cloneNodeWithNewChildren,
1573 cloneNodeWithNewChildrenAndProps =
1574 _nativeFabricUIManage$1.cloneNodeWithNewChildrenAndProps,
1575 cloneNodeWithNewProps = _nativeFabricUIManage$1.cloneNodeWithNewProps,
1576 createChildNodeSet = _nativeFabricUIManage$1.createChildSet,
1577 appendChildNode = _nativeFabricUIManage$1.appendChild,
1578 appendChildNodeToSet = _nativeFabricUIManage$1.appendChildToSet,
1579 completeRoot = _nativeFabricUIManage$1.completeRoot,
1580 registerEventHandler = _nativeFabricUIManage$1.registerEventHandler,
1581 fabricMeasure = _nativeFabricUIManage$1.measure,
1582 fabricMeasureInWindow = _nativeFabricUIManage$1.measureInWindow,
1583 fabricMeasureLayout = _nativeFabricUIManage$1.measureLayout,
1584 getViewConfigForType =
1585 ReactNativePrivateInterface.ReactNativeViewConfigRegistry.get,
1586 nextReactTag = 2;
1587registerEventHandler && registerEventHandler(dispatchEvent);
1588var ReactFabricHostComponent = (function() {
1589 function ReactFabricHostComponent(
1590 tag,
1591 viewConfig,
1592 props,
1593 internalInstanceHandle
1594 ) {
1595 if (!(this instanceof ReactFabricHostComponent))
1596 throw new TypeError("Cannot call a class as a function");
1597 this._nativeTag = tag;
1598 this.viewConfig = viewConfig;
1599 this.currentProps = props;
1600 this._internalInstanceHandle = internalInstanceHandle;
1601 }
1602 ReactFabricHostComponent.prototype.blur = function() {
1603 ReactNativePrivateInterface.TextInputState.blurTextInput(this._nativeTag);
1604 };
1605 ReactFabricHostComponent.prototype.focus = function() {
1606 ReactNativePrivateInterface.TextInputState.focusTextInput(this._nativeTag);
1607 };
1608 ReactFabricHostComponent.prototype.measure = function(callback) {
1609 fabricMeasure(
1610 this._internalInstanceHandle.stateNode.node,
1611 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
1612 );
1613 };
1614 ReactFabricHostComponent.prototype.measureInWindow = function(callback) {
1615 fabricMeasureInWindow(
1616 this._internalInstanceHandle.stateNode.node,
1617 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
1618 );
1619 };
1620 ReactFabricHostComponent.prototype.measureLayout = function(
1621 relativeToNativeNode,
1622 onSuccess,
1623 onFail
1624 ) {
1625 "number" !== typeof relativeToNativeNode &&
1626 relativeToNativeNode instanceof ReactFabricHostComponent &&
1627 fabricMeasureLayout(
1628 this._internalInstanceHandle.stateNode.node,
1629 relativeToNativeNode._internalInstanceHandle.stateNode.node,
1630 mountSafeCallback_NOT_REALLY_SAFE(this, onFail),
1631 mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)
1632 );
1633 };
1634 ReactFabricHostComponent.prototype.setNativeProps = function() {};
1635 return ReactFabricHostComponent;
1636})();
1637function createTextInstance(
1638 text,
1639 rootContainerInstance,
1640 hostContext,
1641 internalInstanceHandle
1642) {
1643 if (!hostContext.isInAParentText)
1644 throw ReactError(
1645 Error("Text strings must be rendered within a <Text> component.")
1646 );
1647 hostContext = nextReactTag;
1648 nextReactTag += 2;
1649 return {
1650 node: createNode(
1651 hostContext,
1652 "RCTRawText",
1653 rootContainerInstance,
1654 { text: text },
1655 internalInstanceHandle
1656 )
1657 };
1658}
1659var scheduleTimeout = setTimeout,
1660 cancelTimeout = clearTimeout;
1661function cloneHiddenInstance(instance) {
1662 var node = instance.node;
1663 var updatePayload = diffProperties(
1664 null,
1665 emptyObject,
1666 { style: { display: "none" } },
1667 instance.canonical.viewConfig.validAttributes
1668 );
1669 return {
1670 node: cloneNodeWithNewProps(node, updatePayload),
1671 canonical: instance.canonical
1672 };
1673}
1674var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
1675function getStackByFiberInDevAndProd(workInProgress) {
1676 var info = "";
1677 do {
1678 a: switch (workInProgress.tag) {
1679 case 3:
1680 case 4:
1681 case 6:
1682 case 7:
1683 case 10:
1684 case 9:
1685 var JSCompiler_inline_result = "";
1686 break a;
1687 default:
1688 var owner = workInProgress._debugOwner,
1689 source = workInProgress._debugSource,
1690 name = getComponentName(workInProgress.type);
1691 JSCompiler_inline_result = null;
1692 owner && (JSCompiler_inline_result = getComponentName(owner.type));
1693 owner = name;
1694 name = "";
1695 source
1696 ? (name =
1697 " (at " +
1698 source.fileName.replace(BEFORE_SLASH_RE, "") +
1699 ":" +
1700 source.lineNumber +
1701 ")")
1702 : JSCompiler_inline_result &&
1703 (name = " (created by " + JSCompiler_inline_result + ")");
1704 JSCompiler_inline_result = "\n in " + (owner || "Unknown") + name;
1705 }
1706 info += JSCompiler_inline_result;
1707 workInProgress = workInProgress.return;
1708 } while (workInProgress);
1709 return info;
1710}
1711new Set();
1712var valueStack = [],
1713 index = -1;
1714function pop(cursor) {
1715 0 > index ||
1716 ((cursor.current = valueStack[index]), (valueStack[index] = null), index--);
1717}
1718function push(cursor, value) {
1719 index++;
1720 valueStack[index] = cursor.current;
1721 cursor.current = value;
1722}
1723var emptyContextObject = {},
1724 contextStackCursor = { current: emptyContextObject },
1725 didPerformWorkStackCursor = { current: !1 },
1726 previousContext = emptyContextObject;
1727function getMaskedContext(workInProgress, unmaskedContext) {
1728 var contextTypes = workInProgress.type.contextTypes;
1729 if (!contextTypes) return emptyContextObject;
1730 var instance = workInProgress.stateNode;
1731 if (
1732 instance &&
1733 instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext
1734 )
1735 return instance.__reactInternalMemoizedMaskedChildContext;
1736 var context = {},
1737 key;
1738 for (key in contextTypes) context[key] = unmaskedContext[key];
1739 instance &&
1740 ((workInProgress = workInProgress.stateNode),
1741 (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
1742 (workInProgress.__reactInternalMemoizedMaskedChildContext = context));
1743 return context;
1744}
1745function isContextProvider(type) {
1746 type = type.childContextTypes;
1747 return null !== type && void 0 !== type;
1748}
1749function popContext(fiber) {
1750 pop(didPerformWorkStackCursor, fiber);
1751 pop(contextStackCursor, fiber);
1752}
1753function popTopLevelContextObject(fiber) {
1754 pop(didPerformWorkStackCursor, fiber);
1755 pop(contextStackCursor, fiber);
1756}
1757function pushTopLevelContextObject(fiber, context, didChange) {
1758 if (contextStackCursor.current !== emptyContextObject)
1759 throw ReactError(
1760 Error(
1761 "Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."
1762 )
1763 );
1764 push(contextStackCursor, context, fiber);
1765 push(didPerformWorkStackCursor, didChange, fiber);
1766}
1767function processChildContext(fiber, type, parentContext) {
1768 var instance = fiber.stateNode;
1769 fiber = type.childContextTypes;
1770 if ("function" !== typeof instance.getChildContext) return parentContext;
1771 instance = instance.getChildContext();
1772 for (var contextKey in instance)
1773 if (!(contextKey in fiber))
1774 throw ReactError(
1775 Error(
1776 (getComponentName(type) || "Unknown") +
1777 '.getChildContext(): key "' +
1778 contextKey +
1779 '" is not defined in childContextTypes.'
1780 )
1781 );
1782 return Object.assign({}, parentContext, instance);
1783}
1784function pushContextProvider(workInProgress) {
1785 var instance = workInProgress.stateNode;
1786 instance =
1787 (instance && instance.__reactInternalMemoizedMergedChildContext) ||
1788 emptyContextObject;
1789 previousContext = contextStackCursor.current;
1790 push(contextStackCursor, instance, workInProgress);
1791 push(
1792 didPerformWorkStackCursor,
1793 didPerformWorkStackCursor.current,
1794 workInProgress
1795 );
1796 return !0;
1797}
1798function invalidateContextProvider(workInProgress, type, didChange) {
1799 var instance = workInProgress.stateNode;
1800 if (!instance)
1801 throw ReactError(
1802 Error(
1803 "Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."
1804 )
1805 );
1806 didChange
1807 ? ((type = processChildContext(workInProgress, type, previousContext)),
1808 (instance.__reactInternalMemoizedMergedChildContext = type),
1809 pop(didPerformWorkStackCursor, workInProgress),
1810 pop(contextStackCursor, workInProgress),
1811 push(contextStackCursor, type, workInProgress))
1812 : pop(didPerformWorkStackCursor, workInProgress);
1813 push(didPerformWorkStackCursor, didChange, workInProgress);
1814}
1815var Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,
1816 Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,
1817 Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,
1818 Scheduler_shouldYield = Scheduler.unstable_shouldYield,
1819 Scheduler_requestPaint = Scheduler.unstable_requestPaint,
1820 Scheduler_now = Scheduler.unstable_now,
1821 Scheduler_getCurrentPriorityLevel =
1822 Scheduler.unstable_getCurrentPriorityLevel,
1823 Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,
1824 Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,
1825 Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,
1826 Scheduler_LowPriority = Scheduler.unstable_LowPriority,
1827 Scheduler_IdlePriority = Scheduler.unstable_IdlePriority,
1828 fakeCallbackNode = {},
1829 requestPaint =
1830 void 0 !== Scheduler_requestPaint ? Scheduler_requestPaint : function() {},
1831 syncQueue = null,
1832 immediateQueueCallbackNode = null,
1833 isFlushingSyncQueue = !1,
1834 initialTimeMs = Scheduler_now(),
1835 now =
1836 1e4 > initialTimeMs
1837 ? Scheduler_now
1838 : function() {
1839 return Scheduler_now() - initialTimeMs;
1840 };
1841function getCurrentPriorityLevel() {
1842 switch (Scheduler_getCurrentPriorityLevel()) {
1843 case Scheduler_ImmediatePriority:
1844 return 99;
1845 case Scheduler_UserBlockingPriority:
1846 return 98;
1847 case Scheduler_NormalPriority:
1848 return 97;
1849 case Scheduler_LowPriority:
1850 return 96;
1851 case Scheduler_IdlePriority:
1852 return 95;
1853 default:
1854 throw ReactError(Error("Unknown priority level."));
1855 }
1856}
1857function reactPriorityToSchedulerPriority(reactPriorityLevel) {
1858 switch (reactPriorityLevel) {
1859 case 99:
1860 return Scheduler_ImmediatePriority;
1861 case 98:
1862 return Scheduler_UserBlockingPriority;
1863 case 97:
1864 return Scheduler_NormalPriority;
1865 case 96:
1866 return Scheduler_LowPriority;
1867 case 95:
1868 return Scheduler_IdlePriority;
1869 default:
1870 throw ReactError(Error("Unknown priority level."));
1871 }
1872}
1873function runWithPriority$1(reactPriorityLevel, fn) {
1874 reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
1875 return Scheduler_runWithPriority(reactPriorityLevel, fn);
1876}
1877function scheduleCallback(reactPriorityLevel, callback, options) {
1878 reactPriorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);
1879 return Scheduler_scheduleCallback(reactPriorityLevel, callback, options);
1880}
1881function scheduleSyncCallback(callback) {
1882 null === syncQueue
1883 ? ((syncQueue = [callback]),
1884 (immediateQueueCallbackNode = Scheduler_scheduleCallback(
1885 Scheduler_ImmediatePriority,
1886 flushSyncCallbackQueueImpl
1887 )))
1888 : syncQueue.push(callback);
1889 return fakeCallbackNode;
1890}
1891function flushSyncCallbackQueue() {
1892 null !== immediateQueueCallbackNode &&
1893 Scheduler_cancelCallback(immediateQueueCallbackNode);
1894 flushSyncCallbackQueueImpl();
1895}
1896function flushSyncCallbackQueueImpl() {
1897 if (!isFlushingSyncQueue && null !== syncQueue) {
1898 isFlushingSyncQueue = !0;
1899 var i = 0;
1900 try {
1901 var queue = syncQueue;
1902 runWithPriority$1(99, function() {
1903 for (; i < queue.length; i++) {
1904 var callback = queue[i];
1905 do callback = callback(!0);
1906 while (null !== callback);
1907 }
1908 });
1909 syncQueue = null;
1910 } catch (error) {
1911 throw (null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)),
1912 Scheduler_scheduleCallback(
1913 Scheduler_ImmediatePriority,
1914 flushSyncCallbackQueue
1915 ),
1916 error);
1917 } finally {
1918 isFlushingSyncQueue = !1;
1919 }
1920 }
1921}
1922function inferPriorityFromExpirationTime(currentTime, expirationTime) {
1923 if (1073741823 === expirationTime) return 99;
1924 if (1 === expirationTime) return 95;
1925 currentTime =
1926 10 * (1073741821 - expirationTime) - 10 * (1073741821 - currentTime);
1927 return 0 >= currentTime
1928 ? 99
1929 : 250 >= currentTime
1930 ? 98
1931 : 5250 >= currentTime
1932 ? 97
1933 : 95;
1934}
1935function is(x, y) {
1936 return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
1937}
1938var hasOwnProperty = Object.prototype.hasOwnProperty;
1939function shallowEqual(objA, objB) {
1940 if (is(objA, objB)) return !0;
1941 if (
1942 "object" !== typeof objA ||
1943 null === objA ||
1944 "object" !== typeof objB ||
1945 null === objB
1946 )
1947 return !1;
1948 var keysA = Object.keys(objA),
1949 keysB = Object.keys(objB);
1950 if (keysA.length !== keysB.length) return !1;
1951 for (keysB = 0; keysB < keysA.length; keysB++)
1952 if (
1953 !hasOwnProperty.call(objB, keysA[keysB]) ||
1954 !is(objA[keysA[keysB]], objB[keysA[keysB]])
1955 )
1956 return !1;
1957 return !0;
1958}
1959function resolveDefaultProps(Component, baseProps) {
1960 if (Component && Component.defaultProps) {
1961 baseProps = Object.assign({}, baseProps);
1962 Component = Component.defaultProps;
1963 for (var propName in Component)
1964 void 0 === baseProps[propName] &&
1965 (baseProps[propName] = Component[propName]);
1966 }
1967 return baseProps;
1968}
1969function readLazyComponentType(lazyComponent) {
1970 var result = lazyComponent._result;
1971 switch (lazyComponent._status) {
1972 case 1:
1973 return result;
1974 case 2:
1975 throw result;
1976 case 0:
1977 throw result;
1978 default:
1979 lazyComponent._status = 0;
1980 result = lazyComponent._ctor;
1981 result = result();
1982 result.then(
1983 function(moduleObject) {
1984 0 === lazyComponent._status &&
1985 ((moduleObject = moduleObject.default),
1986 (lazyComponent._status = 1),
1987 (lazyComponent._result = moduleObject));
1988 },
1989 function(error) {
1990 0 === lazyComponent._status &&
1991 ((lazyComponent._status = 2), (lazyComponent._result = error));
1992 }
1993 );
1994 switch (lazyComponent._status) {
1995 case 1:
1996 return lazyComponent._result;
1997 case 2:
1998 throw lazyComponent._result;
1999 }
2000 lazyComponent._result = result;
2001 throw result;
2002 }
2003}
2004var valueCursor = { current: null },
2005 currentlyRenderingFiber = null,
2006 lastContextDependency = null,
2007 lastContextWithAllBitsObserved = null;
2008function resetContextDependencies() {
2009 lastContextWithAllBitsObserved = lastContextDependency = currentlyRenderingFiber = null;
2010}
2011function pushProvider(providerFiber, nextValue) {
2012 var context = providerFiber.type._context;
2013 push(valueCursor, context._currentValue2, providerFiber);
2014 context._currentValue2 = nextValue;
2015}
2016function popProvider(providerFiber) {
2017 var currentValue = valueCursor.current;
2018 pop(valueCursor, providerFiber);
2019 providerFiber.type._context._currentValue2 = currentValue;
2020}
2021function scheduleWorkOnParentPath(parent, renderExpirationTime) {
2022 for (; null !== parent; ) {
2023 var alternate = parent.alternate;
2024 if (parent.childExpirationTime < renderExpirationTime)
2025 (parent.childExpirationTime = renderExpirationTime),
2026 null !== alternate &&
2027 alternate.childExpirationTime < renderExpirationTime &&
2028 (alternate.childExpirationTime = renderExpirationTime);
2029 else if (
2030 null !== alternate &&
2031 alternate.childExpirationTime < renderExpirationTime
2032 )
2033 alternate.childExpirationTime = renderExpirationTime;
2034 else break;
2035 parent = parent.return;
2036 }
2037}
2038function prepareToReadContext(workInProgress, renderExpirationTime) {
2039 currentlyRenderingFiber = workInProgress;
2040 lastContextWithAllBitsObserved = lastContextDependency = null;
2041 workInProgress = workInProgress.dependencies;
2042 null !== workInProgress &&
2043 null !== workInProgress.firstContext &&
2044 (workInProgress.expirationTime >= renderExpirationTime &&
2045 (didReceiveUpdate = !0),
2046 (workInProgress.firstContext = null));
2047}
2048function readContext(context, observedBits) {
2049 if (
2050 lastContextWithAllBitsObserved !== context &&
2051 !1 !== observedBits &&
2052 0 !== observedBits
2053 ) {
2054 if ("number" !== typeof observedBits || 1073741823 === observedBits)
2055 (lastContextWithAllBitsObserved = context), (observedBits = 1073741823);
2056 observedBits = { context: context, observedBits: observedBits, next: null };
2057 if (null === lastContextDependency) {
2058 if (null === currentlyRenderingFiber)
2059 throw ReactError(
2060 Error(
2061 "Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."
2062 )
2063 );
2064 lastContextDependency = observedBits;
2065 currentlyRenderingFiber.dependencies = {
2066 expirationTime: 0,
2067 firstContext: observedBits,
2068 responders: null
2069 };
2070 } else lastContextDependency = lastContextDependency.next = observedBits;
2071 }
2072 return context._currentValue2;
2073}
2074var hasForceUpdate = !1;
2075function createUpdateQueue(baseState) {
2076 return {
2077 baseState: baseState,
2078 firstUpdate: null,
2079 lastUpdate: null,
2080 firstCapturedUpdate: null,
2081 lastCapturedUpdate: null,
2082 firstEffect: null,
2083 lastEffect: null,
2084 firstCapturedEffect: null,
2085 lastCapturedEffect: null
2086 };
2087}
2088function cloneUpdateQueue(currentQueue) {
2089 return {
2090 baseState: currentQueue.baseState,
2091 firstUpdate: currentQueue.firstUpdate,
2092 lastUpdate: currentQueue.lastUpdate,
2093 firstCapturedUpdate: null,
2094 lastCapturedUpdate: null,
2095 firstEffect: null,
2096 lastEffect: null,
2097 firstCapturedEffect: null,
2098 lastCapturedEffect: null
2099 };
2100}
2101function createUpdate(expirationTime, suspenseConfig) {
2102 return {
2103 expirationTime: expirationTime,
2104 suspenseConfig: suspenseConfig,
2105 tag: 0,
2106 payload: null,
2107 callback: null,
2108 next: null,
2109 nextEffect: null
2110 };
2111}
2112function appendUpdateToQueue(queue, update) {
2113 null === queue.lastUpdate
2114 ? (queue.firstUpdate = queue.lastUpdate = update)
2115 : ((queue.lastUpdate.next = update), (queue.lastUpdate = update));
2116}
2117function enqueueUpdate(fiber, update) {
2118 var alternate = fiber.alternate;
2119 if (null === alternate) {
2120 var queue1 = fiber.updateQueue;
2121 var queue2 = null;
2122 null === queue1 &&
2123 (queue1 = fiber.updateQueue = createUpdateQueue(fiber.memoizedState));
2124 } else
2125 (queue1 = fiber.updateQueue),
2126 (queue2 = alternate.updateQueue),
2127 null === queue1
2128 ? null === queue2
2129 ? ((queue1 = fiber.updateQueue = createUpdateQueue(
2130 fiber.memoizedState
2131 )),
2132 (queue2 = alternate.updateQueue = createUpdateQueue(
2133 alternate.memoizedState
2134 )))
2135 : (queue1 = fiber.updateQueue = cloneUpdateQueue(queue2))
2136 : null === queue2 &&
2137 (queue2 = alternate.updateQueue = cloneUpdateQueue(queue1));
2138 null === queue2 || queue1 === queue2
2139 ? appendUpdateToQueue(queue1, update)
2140 : null === queue1.lastUpdate || null === queue2.lastUpdate
2141 ? (appendUpdateToQueue(queue1, update),
2142 appendUpdateToQueue(queue2, update))
2143 : (appendUpdateToQueue(queue1, update), (queue2.lastUpdate = update));
2144}
2145function enqueueCapturedUpdate(workInProgress, update) {
2146 var workInProgressQueue = workInProgress.updateQueue;
2147 workInProgressQueue =
2148 null === workInProgressQueue
2149 ? (workInProgress.updateQueue = createUpdateQueue(
2150 workInProgress.memoizedState
2151 ))
2152 : ensureWorkInProgressQueueIsAClone(workInProgress, workInProgressQueue);
2153 null === workInProgressQueue.lastCapturedUpdate
2154 ? (workInProgressQueue.firstCapturedUpdate = workInProgressQueue.lastCapturedUpdate = update)
2155 : ((workInProgressQueue.lastCapturedUpdate.next = update),
2156 (workInProgressQueue.lastCapturedUpdate = update));
2157}
2158function ensureWorkInProgressQueueIsAClone(workInProgress, queue) {
2159 var current = workInProgress.alternate;
2160 null !== current &&
2161 queue === current.updateQueue &&
2162 (queue = workInProgress.updateQueue = cloneUpdateQueue(queue));
2163 return queue;
2164}
2165function getStateFromUpdate(
2166 workInProgress,
2167 queue,
2168 update,
2169 prevState,
2170 nextProps,
2171 instance
2172) {
2173 switch (update.tag) {
2174 case 1:
2175 return (
2176 (workInProgress = update.payload),
2177 "function" === typeof workInProgress
2178 ? workInProgress.call(instance, prevState, nextProps)
2179 : workInProgress
2180 );
2181 case 3:
2182 workInProgress.effectTag = (workInProgress.effectTag & -2049) | 64;
2183 case 0:
2184 workInProgress = update.payload;
2185 nextProps =
2186 "function" === typeof workInProgress
2187 ? workInProgress.call(instance, prevState, nextProps)
2188 : workInProgress;
2189 if (null === nextProps || void 0 === nextProps) break;
2190 return Object.assign({}, prevState, nextProps);
2191 case 2:
2192 hasForceUpdate = !0;
2193 }
2194 return prevState;
2195}
2196function processUpdateQueue(
2197 workInProgress,
2198 queue,
2199 props,
2200 instance,
2201 renderExpirationTime
2202) {
2203 hasForceUpdate = !1;
2204 queue = ensureWorkInProgressQueueIsAClone(workInProgress, queue);
2205 for (
2206 var newBaseState = queue.baseState,
2207 newFirstUpdate = null,
2208 newExpirationTime = 0,
2209 update = queue.firstUpdate,
2210 resultState = newBaseState;
2211 null !== update;
2212
2213 ) {
2214 var updateExpirationTime = update.expirationTime;
2215 updateExpirationTime < renderExpirationTime
2216 ? (null === newFirstUpdate &&
2217 ((newFirstUpdate = update), (newBaseState = resultState)),
2218 newExpirationTime < updateExpirationTime &&
2219 (newExpirationTime = updateExpirationTime))
2220 : (markRenderEventTimeAndConfig(
2221 updateExpirationTime,
2222 update.suspenseConfig
2223 ),
2224 (resultState = getStateFromUpdate(
2225 workInProgress,
2226 queue,
2227 update,
2228 resultState,
2229 props,
2230 instance
2231 )),
2232 null !== update.callback &&
2233 ((workInProgress.effectTag |= 32),
2234 (update.nextEffect = null),
2235 null === queue.lastEffect
2236 ? (queue.firstEffect = queue.lastEffect = update)
2237 : ((queue.lastEffect.nextEffect = update),
2238 (queue.lastEffect = update))));
2239 update = update.next;
2240 }
2241 updateExpirationTime = null;
2242 for (update = queue.firstCapturedUpdate; null !== update; ) {
2243 var _updateExpirationTime = update.expirationTime;
2244 _updateExpirationTime < renderExpirationTime
2245 ? (null === updateExpirationTime &&
2246 ((updateExpirationTime = update),
2247 null === newFirstUpdate && (newBaseState = resultState)),
2248 newExpirationTime < _updateExpirationTime &&
2249 (newExpirationTime = _updateExpirationTime))
2250 : ((resultState = getStateFromUpdate(
2251 workInProgress,
2252 queue,
2253 update,
2254 resultState,
2255 props,
2256 instance
2257 )),
2258 null !== update.callback &&
2259 ((workInProgress.effectTag |= 32),
2260 (update.nextEffect = null),
2261 null === queue.lastCapturedEffect
2262 ? (queue.firstCapturedEffect = queue.lastCapturedEffect = update)
2263 : ((queue.lastCapturedEffect.nextEffect = update),
2264 (queue.lastCapturedEffect = update))));
2265 update = update.next;
2266 }
2267 null === newFirstUpdate && (queue.lastUpdate = null);
2268 null === updateExpirationTime
2269 ? (queue.lastCapturedUpdate = null)
2270 : (workInProgress.effectTag |= 32);
2271 null === newFirstUpdate &&
2272 null === updateExpirationTime &&
2273 (newBaseState = resultState);
2274 queue.baseState = newBaseState;
2275 queue.firstUpdate = newFirstUpdate;
2276 queue.firstCapturedUpdate = updateExpirationTime;
2277 workInProgress.expirationTime = newExpirationTime;
2278 workInProgress.memoizedState = resultState;
2279}
2280function commitUpdateQueue(finishedWork, finishedQueue, instance) {
2281 null !== finishedQueue.firstCapturedUpdate &&
2282 (null !== finishedQueue.lastUpdate &&
2283 ((finishedQueue.lastUpdate.next = finishedQueue.firstCapturedUpdate),
2284 (finishedQueue.lastUpdate = finishedQueue.lastCapturedUpdate)),
2285 (finishedQueue.firstCapturedUpdate = finishedQueue.lastCapturedUpdate = null));
2286 commitUpdateEffects(finishedQueue.firstEffect, instance);
2287 finishedQueue.firstEffect = finishedQueue.lastEffect = null;
2288 commitUpdateEffects(finishedQueue.firstCapturedEffect, instance);
2289 finishedQueue.firstCapturedEffect = finishedQueue.lastCapturedEffect = null;
2290}
2291function commitUpdateEffects(effect, instance) {
2292 for (; null !== effect; ) {
2293 var _callback3 = effect.callback;
2294 if (null !== _callback3) {
2295 effect.callback = null;
2296 var context = instance;
2297 if ("function" !== typeof _callback3)
2298 throw ReactError(
2299 Error(
2300 "Invalid argument passed as callback. Expected a function. Instead received: " +
2301 _callback3
2302 )
2303 );
2304 _callback3.call(context);
2305 }
2306 effect = effect.nextEffect;
2307 }
2308}
2309var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig,
2310 emptyRefsObject = new React.Component().refs;
2311function applyDerivedStateFromProps(
2312 workInProgress,
2313 ctor,
2314 getDerivedStateFromProps,
2315 nextProps
2316) {
2317 ctor = workInProgress.memoizedState;
2318 getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor);
2319 getDerivedStateFromProps =
2320 null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps
2321 ? ctor
2322 : Object.assign({}, ctor, getDerivedStateFromProps);
2323 workInProgress.memoizedState = getDerivedStateFromProps;
2324 nextProps = workInProgress.updateQueue;
2325 null !== nextProps &&
2326 0 === workInProgress.expirationTime &&
2327 (nextProps.baseState = getDerivedStateFromProps);
2328}
2329var classComponentUpdater = {
2330 isMounted: function(component) {
2331 return (component = component._reactInternalFiber)
2332 ? 2 === isFiberMountedImpl(component)
2333 : !1;
2334 },
2335 enqueueSetState: function(inst, payload, callback) {
2336 inst = inst._reactInternalFiber;
2337 var currentTime = requestCurrentTime(),
2338 suspenseConfig = ReactCurrentBatchConfig.suspense;
2339 currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
2340 suspenseConfig = createUpdate(currentTime, suspenseConfig);
2341 suspenseConfig.payload = payload;
2342 void 0 !== callback &&
2343 null !== callback &&
2344 (suspenseConfig.callback = callback);
2345 enqueueUpdate(inst, suspenseConfig);
2346 scheduleUpdateOnFiber(inst, currentTime);
2347 },
2348 enqueueReplaceState: function(inst, payload, callback) {
2349 inst = inst._reactInternalFiber;
2350 var currentTime = requestCurrentTime(),
2351 suspenseConfig = ReactCurrentBatchConfig.suspense;
2352 currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
2353 suspenseConfig = createUpdate(currentTime, suspenseConfig);
2354 suspenseConfig.tag = 1;
2355 suspenseConfig.payload = payload;
2356 void 0 !== callback &&
2357 null !== callback &&
2358 (suspenseConfig.callback = callback);
2359 enqueueUpdate(inst, suspenseConfig);
2360 scheduleUpdateOnFiber(inst, currentTime);
2361 },
2362 enqueueForceUpdate: function(inst, callback) {
2363 inst = inst._reactInternalFiber;
2364 var currentTime = requestCurrentTime(),
2365 suspenseConfig = ReactCurrentBatchConfig.suspense;
2366 currentTime = computeExpirationForFiber(currentTime, inst, suspenseConfig);
2367 suspenseConfig = createUpdate(currentTime, suspenseConfig);
2368 suspenseConfig.tag = 2;
2369 void 0 !== callback &&
2370 null !== callback &&
2371 (suspenseConfig.callback = callback);
2372 enqueueUpdate(inst, suspenseConfig);
2373 scheduleUpdateOnFiber(inst, currentTime);
2374 }
2375};
2376function checkShouldComponentUpdate(
2377 workInProgress,
2378 ctor,
2379 oldProps,
2380 newProps,
2381 oldState,
2382 newState,
2383 nextContext
2384) {
2385 workInProgress = workInProgress.stateNode;
2386 return "function" === typeof workInProgress.shouldComponentUpdate
2387 ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext)
2388 : ctor.prototype && ctor.prototype.isPureReactComponent
2389 ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)
2390 : !0;
2391}
2392function constructClassInstance(workInProgress, ctor, props) {
2393 var isLegacyContextConsumer = !1,
2394 unmaskedContext = emptyContextObject;
2395 var context = ctor.contextType;
2396 "object" === typeof context && null !== context
2397 ? (context = readContext(context))
2398 : ((unmaskedContext = isContextProvider(ctor)
2399 ? previousContext
2400 : contextStackCursor.current),
2401 (isLegacyContextConsumer = ctor.contextTypes),
2402 (context = (isLegacyContextConsumer =
2403 null !== isLegacyContextConsumer && void 0 !== isLegacyContextConsumer)
2404 ? getMaskedContext(workInProgress, unmaskedContext)
2405 : emptyContextObject));
2406 ctor = new ctor(props, context);
2407 workInProgress.memoizedState =
2408 null !== ctor.state && void 0 !== ctor.state ? ctor.state : null;
2409 ctor.updater = classComponentUpdater;
2410 workInProgress.stateNode = ctor;
2411 ctor._reactInternalFiber = workInProgress;
2412 isLegacyContextConsumer &&
2413 ((workInProgress = workInProgress.stateNode),
2414 (workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext),
2415 (workInProgress.__reactInternalMemoizedMaskedChildContext = context));
2416 return ctor;
2417}
2418function callComponentWillReceiveProps(
2419 workInProgress,
2420 instance,
2421 newProps,
2422 nextContext
2423) {
2424 workInProgress = instance.state;
2425 "function" === typeof instance.componentWillReceiveProps &&
2426 instance.componentWillReceiveProps(newProps, nextContext);
2427 "function" === typeof instance.UNSAFE_componentWillReceiveProps &&
2428 instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
2429 instance.state !== workInProgress &&
2430 classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
2431}
2432function mountClassInstance(
2433 workInProgress,
2434 ctor,
2435 newProps,
2436 renderExpirationTime
2437) {
2438 var instance = workInProgress.stateNode;
2439 instance.props = newProps;
2440 instance.state = workInProgress.memoizedState;
2441 instance.refs = emptyRefsObject;
2442 var contextType = ctor.contextType;
2443 "object" === typeof contextType && null !== contextType
2444 ? (instance.context = readContext(contextType))
2445 : ((contextType = isContextProvider(ctor)
2446 ? previousContext
2447 : contextStackCursor.current),
2448 (instance.context = getMaskedContext(workInProgress, contextType)));
2449 contextType = workInProgress.updateQueue;
2450 null !== contextType &&
2451 (processUpdateQueue(
2452 workInProgress,
2453 contextType,
2454 newProps,
2455 instance,
2456 renderExpirationTime
2457 ),
2458 (instance.state = workInProgress.memoizedState));
2459 contextType = ctor.getDerivedStateFromProps;
2460 "function" === typeof contextType &&
2461 (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps),
2462 (instance.state = workInProgress.memoizedState));
2463 "function" === typeof ctor.getDerivedStateFromProps ||
2464 "function" === typeof instance.getSnapshotBeforeUpdate ||
2465 ("function" !== typeof instance.UNSAFE_componentWillMount &&
2466 "function" !== typeof instance.componentWillMount) ||
2467 ((ctor = instance.state),
2468 "function" === typeof instance.componentWillMount &&
2469 instance.componentWillMount(),
2470 "function" === typeof instance.UNSAFE_componentWillMount &&
2471 instance.UNSAFE_componentWillMount(),
2472 ctor !== instance.state &&
2473 classComponentUpdater.enqueueReplaceState(instance, instance.state, null),
2474 (contextType = workInProgress.updateQueue),
2475 null !== contextType &&
2476 (processUpdateQueue(
2477 workInProgress,
2478 contextType,
2479 newProps,
2480 instance,
2481 renderExpirationTime
2482 ),
2483 (instance.state = workInProgress.memoizedState)));
2484 "function" === typeof instance.componentDidMount &&
2485 (workInProgress.effectTag |= 4);
2486}
2487var isArray = Array.isArray;
2488function coerceRef(returnFiber, current$$1, element) {
2489 returnFiber = element.ref;
2490 if (
2491 null !== returnFiber &&
2492 "function" !== typeof returnFiber &&
2493 "object" !== typeof returnFiber
2494 ) {
2495 if (element._owner) {
2496 element = element._owner;
2497 var inst = void 0;
2498 if (element) {
2499 if (1 !== element.tag)
2500 throw ReactError(
2501 Error(
2502 "Function components cannot have refs. Did you mean to use React.forwardRef()?"
2503 )
2504 );
2505 inst = element.stateNode;
2506 }
2507 if (!inst)
2508 throw ReactError(
2509 Error(
2510 "Missing owner for string ref " +
2511 returnFiber +
2512 ". This error is likely caused by a bug in React. Please file an issue."
2513 )
2514 );
2515 var stringRef = "" + returnFiber;
2516 if (
2517 null !== current$$1 &&
2518 null !== current$$1.ref &&
2519 "function" === typeof current$$1.ref &&
2520 current$$1.ref._stringRef === stringRef
2521 )
2522 return current$$1.ref;
2523 current$$1 = function(value) {
2524 var refs = inst.refs;
2525 refs === emptyRefsObject && (refs = inst.refs = {});
2526 null === value ? delete refs[stringRef] : (refs[stringRef] = value);
2527 };
2528 current$$1._stringRef = stringRef;
2529 return current$$1;
2530 }
2531 if ("string" !== typeof returnFiber)
2532 throw ReactError(
2533 Error(
2534 "Expected ref to be a function, a string, an object returned by React.createRef(), or null."
2535 )
2536 );
2537 if (!element._owner)
2538 throw ReactError(
2539 Error(
2540 "Element ref was specified as a string (" +
2541 returnFiber +
2542 ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information."
2543 )
2544 );
2545 }
2546 return returnFiber;
2547}
2548function throwOnInvalidObjectType(returnFiber, newChild) {
2549 if ("textarea" !== returnFiber.type)
2550 throw ReactError(
2551 Error(
2552 "Objects are not valid as a React child (found: " +
2553 ("[object Object]" === Object.prototype.toString.call(newChild)
2554 ? "object with keys {" + Object.keys(newChild).join(", ") + "}"
2555 : newChild) +
2556 ")."
2557 )
2558 );
2559}
2560function ChildReconciler(shouldTrackSideEffects) {
2561 function deleteChild(returnFiber, childToDelete) {
2562 if (shouldTrackSideEffects) {
2563 var last = returnFiber.lastEffect;
2564 null !== last
2565 ? ((last.nextEffect = childToDelete),
2566 (returnFiber.lastEffect = childToDelete))
2567 : (returnFiber.firstEffect = returnFiber.lastEffect = childToDelete);
2568 childToDelete.nextEffect = null;
2569 childToDelete.effectTag = 8;
2570 }
2571 }
2572 function deleteRemainingChildren(returnFiber, currentFirstChild) {
2573 if (!shouldTrackSideEffects) return null;
2574 for (; null !== currentFirstChild; )
2575 deleteChild(returnFiber, currentFirstChild),
2576 (currentFirstChild = currentFirstChild.sibling);
2577 return null;
2578 }
2579 function mapRemainingChildren(returnFiber, currentFirstChild) {
2580 for (returnFiber = new Map(); null !== currentFirstChild; )
2581 null !== currentFirstChild.key
2582 ? returnFiber.set(currentFirstChild.key, currentFirstChild)
2583 : returnFiber.set(currentFirstChild.index, currentFirstChild),
2584 (currentFirstChild = currentFirstChild.sibling);
2585 return returnFiber;
2586 }
2587 function useFiber(fiber, pendingProps, expirationTime) {
2588 fiber = createWorkInProgress(fiber, pendingProps, expirationTime);
2589 fiber.index = 0;
2590 fiber.sibling = null;
2591 return fiber;
2592 }
2593 function placeChild(newFiber, lastPlacedIndex, newIndex) {
2594 newFiber.index = newIndex;
2595 if (!shouldTrackSideEffects) return lastPlacedIndex;
2596 newIndex = newFiber.alternate;
2597 if (null !== newIndex)
2598 return (
2599 (newIndex = newIndex.index),
2600 newIndex < lastPlacedIndex
2601 ? ((newFiber.effectTag = 2), lastPlacedIndex)
2602 : newIndex
2603 );
2604 newFiber.effectTag = 2;
2605 return lastPlacedIndex;
2606 }
2607 function placeSingleChild(newFiber) {
2608 shouldTrackSideEffects &&
2609 null === newFiber.alternate &&
2610 (newFiber.effectTag = 2);
2611 return newFiber;
2612 }
2613 function updateTextNode(
2614 returnFiber,
2615 current$$1,
2616 textContent,
2617 expirationTime
2618 ) {
2619 if (null === current$$1 || 6 !== current$$1.tag)
2620 return (
2621 (current$$1 = createFiberFromText(
2622 textContent,
2623 returnFiber.mode,
2624 expirationTime
2625 )),
2626 (current$$1.return = returnFiber),
2627 current$$1
2628 );
2629 current$$1 = useFiber(current$$1, textContent, expirationTime);
2630 current$$1.return = returnFiber;
2631 return current$$1;
2632 }
2633 function updateElement(returnFiber, current$$1, element, expirationTime) {
2634 if (null !== current$$1 && current$$1.elementType === element.type)
2635 return (
2636 (expirationTime = useFiber(current$$1, element.props, expirationTime)),
2637 (expirationTime.ref = coerceRef(returnFiber, current$$1, element)),
2638 (expirationTime.return = returnFiber),
2639 expirationTime
2640 );
2641 expirationTime = createFiberFromTypeAndProps(
2642 element.type,
2643 element.key,
2644 element.props,
2645 null,
2646 returnFiber.mode,
2647 expirationTime
2648 );
2649 expirationTime.ref = coerceRef(returnFiber, current$$1, element);
2650 expirationTime.return = returnFiber;
2651 return expirationTime;
2652 }
2653 function updatePortal(returnFiber, current$$1, portal, expirationTime) {
2654 if (
2655 null === current$$1 ||
2656 4 !== current$$1.tag ||
2657 current$$1.stateNode.containerInfo !== portal.containerInfo ||
2658 current$$1.stateNode.implementation !== portal.implementation
2659 )
2660 return (
2661 (current$$1 = createFiberFromPortal(
2662 portal,
2663 returnFiber.mode,
2664 expirationTime
2665 )),
2666 (current$$1.return = returnFiber),
2667 current$$1
2668 );
2669 current$$1 = useFiber(current$$1, portal.children || [], expirationTime);
2670 current$$1.return = returnFiber;
2671 return current$$1;
2672 }
2673 function updateFragment(
2674 returnFiber,
2675 current$$1,
2676 fragment,
2677 expirationTime,
2678 key
2679 ) {
2680 if (null === current$$1 || 7 !== current$$1.tag)
2681 return (
2682 (current$$1 = createFiberFromFragment(
2683 fragment,
2684 returnFiber.mode,
2685 expirationTime,
2686 key
2687 )),
2688 (current$$1.return = returnFiber),
2689 current$$1
2690 );
2691 current$$1 = useFiber(current$$1, fragment, expirationTime);
2692 current$$1.return = returnFiber;
2693 return current$$1;
2694 }
2695 function createChild(returnFiber, newChild, expirationTime) {
2696 if ("string" === typeof newChild || "number" === typeof newChild)
2697 return (
2698 (newChild = createFiberFromText(
2699 "" + newChild,
2700 returnFiber.mode,
2701 expirationTime
2702 )),
2703 (newChild.return = returnFiber),
2704 newChild
2705 );
2706 if ("object" === typeof newChild && null !== newChild) {
2707 switch (newChild.$$typeof) {
2708 case REACT_ELEMENT_TYPE:
2709 return (
2710 (expirationTime = createFiberFromTypeAndProps(
2711 newChild.type,
2712 newChild.key,
2713 newChild.props,
2714 null,
2715 returnFiber.mode,
2716 expirationTime
2717 )),
2718 (expirationTime.ref = coerceRef(returnFiber, null, newChild)),
2719 (expirationTime.return = returnFiber),
2720 expirationTime
2721 );
2722 case REACT_PORTAL_TYPE:
2723 return (
2724 (newChild = createFiberFromPortal(
2725 newChild,
2726 returnFiber.mode,
2727 expirationTime
2728 )),
2729 (newChild.return = returnFiber),
2730 newChild
2731 );
2732 }
2733 if (isArray(newChild) || getIteratorFn(newChild))
2734 return (
2735 (newChild = createFiberFromFragment(
2736 newChild,
2737 returnFiber.mode,
2738 expirationTime,
2739 null
2740 )),
2741 (newChild.return = returnFiber),
2742 newChild
2743 );
2744 throwOnInvalidObjectType(returnFiber, newChild);
2745 }
2746 return null;
2747 }
2748 function updateSlot(returnFiber, oldFiber, newChild, expirationTime) {
2749 var key = null !== oldFiber ? oldFiber.key : null;
2750 if ("string" === typeof newChild || "number" === typeof newChild)
2751 return null !== key
2752 ? null
2753 : updateTextNode(returnFiber, oldFiber, "" + newChild, expirationTime);
2754 if ("object" === typeof newChild && null !== newChild) {
2755 switch (newChild.$$typeof) {
2756 case REACT_ELEMENT_TYPE:
2757 return newChild.key === key
2758 ? newChild.type === REACT_FRAGMENT_TYPE
2759 ? updateFragment(
2760 returnFiber,
2761 oldFiber,
2762 newChild.props.children,
2763 expirationTime,
2764 key
2765 )
2766 : updateElement(returnFiber, oldFiber, newChild, expirationTime)
2767 : null;
2768 case REACT_PORTAL_TYPE:
2769 return newChild.key === key
2770 ? updatePortal(returnFiber, oldFiber, newChild, expirationTime)
2771 : null;
2772 }
2773 if (isArray(newChild) || getIteratorFn(newChild))
2774 return null !== key
2775 ? null
2776 : updateFragment(
2777 returnFiber,
2778 oldFiber,
2779 newChild,
2780 expirationTime,
2781 null
2782 );
2783 throwOnInvalidObjectType(returnFiber, newChild);
2784 }
2785 return null;
2786 }
2787 function updateFromMap(
2788 existingChildren,
2789 returnFiber,
2790 newIdx,
2791 newChild,
2792 expirationTime
2793 ) {
2794 if ("string" === typeof newChild || "number" === typeof newChild)
2795 return (
2796 (existingChildren = existingChildren.get(newIdx) || null),
2797 updateTextNode(
2798 returnFiber,
2799 existingChildren,
2800 "" + newChild,
2801 expirationTime
2802 )
2803 );
2804 if ("object" === typeof newChild && null !== newChild) {
2805 switch (newChild.$$typeof) {
2806 case REACT_ELEMENT_TYPE:
2807 return (
2808 (existingChildren =
2809 existingChildren.get(
2810 null === newChild.key ? newIdx : newChild.key
2811 ) || null),
2812 newChild.type === REACT_FRAGMENT_TYPE
2813 ? updateFragment(
2814 returnFiber,
2815 existingChildren,
2816 newChild.props.children,
2817 expirationTime,
2818 newChild.key
2819 )
2820 : updateElement(
2821 returnFiber,
2822 existingChildren,
2823 newChild,
2824 expirationTime
2825 )
2826 );
2827 case REACT_PORTAL_TYPE:
2828 return (
2829 (existingChildren =
2830 existingChildren.get(
2831 null === newChild.key ? newIdx : newChild.key
2832 ) || null),
2833 updatePortal(
2834 returnFiber,
2835 existingChildren,
2836 newChild,
2837 expirationTime
2838 )
2839 );
2840 }
2841 if (isArray(newChild) || getIteratorFn(newChild))
2842 return (
2843 (existingChildren = existingChildren.get(newIdx) || null),
2844 updateFragment(
2845 returnFiber,
2846 existingChildren,
2847 newChild,
2848 expirationTime,
2849 null
2850 )
2851 );
2852 throwOnInvalidObjectType(returnFiber, newChild);
2853 }
2854 return null;
2855 }
2856 function reconcileChildrenArray(
2857 returnFiber,
2858 currentFirstChild,
2859 newChildren,
2860 expirationTime
2861 ) {
2862 for (
2863 var resultingFirstChild = null,
2864 previousNewFiber = null,
2865 oldFiber = currentFirstChild,
2866 newIdx = (currentFirstChild = 0),
2867 nextOldFiber = null;
2868 null !== oldFiber && newIdx < newChildren.length;
2869 newIdx++
2870 ) {
2871 oldFiber.index > newIdx
2872 ? ((nextOldFiber = oldFiber), (oldFiber = null))
2873 : (nextOldFiber = oldFiber.sibling);
2874 var newFiber = updateSlot(
2875 returnFiber,
2876 oldFiber,
2877 newChildren[newIdx],
2878 expirationTime
2879 );
2880 if (null === newFiber) {
2881 null === oldFiber && (oldFiber = nextOldFiber);
2882 break;
2883 }
2884 shouldTrackSideEffects &&
2885 oldFiber &&
2886 null === newFiber.alternate &&
2887 deleteChild(returnFiber, oldFiber);
2888 currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
2889 null === previousNewFiber
2890 ? (resultingFirstChild = newFiber)
2891 : (previousNewFiber.sibling = newFiber);
2892 previousNewFiber = newFiber;
2893 oldFiber = nextOldFiber;
2894 }
2895 if (newIdx === newChildren.length)
2896 return (
2897 deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild
2898 );
2899 if (null === oldFiber) {
2900 for (; newIdx < newChildren.length; newIdx++)
2901 (oldFiber = createChild(
2902 returnFiber,
2903 newChildren[newIdx],
2904 expirationTime
2905 )),
2906 null !== oldFiber &&
2907 ((currentFirstChild = placeChild(
2908 oldFiber,
2909 currentFirstChild,
2910 newIdx
2911 )),
2912 null === previousNewFiber
2913 ? (resultingFirstChild = oldFiber)
2914 : (previousNewFiber.sibling = oldFiber),
2915 (previousNewFiber = oldFiber));
2916 return resultingFirstChild;
2917 }
2918 for (
2919 oldFiber = mapRemainingChildren(returnFiber, oldFiber);
2920 newIdx < newChildren.length;
2921 newIdx++
2922 )
2923 (nextOldFiber = updateFromMap(
2924 oldFiber,
2925 returnFiber,
2926 newIdx,
2927 newChildren[newIdx],
2928 expirationTime
2929 )),
2930 null !== nextOldFiber &&
2931 (shouldTrackSideEffects &&
2932 null !== nextOldFiber.alternate &&
2933 oldFiber.delete(
2934 null === nextOldFiber.key ? newIdx : nextOldFiber.key
2935 ),
2936 (currentFirstChild = placeChild(
2937 nextOldFiber,
2938 currentFirstChild,
2939 newIdx
2940 )),
2941 null === previousNewFiber
2942 ? (resultingFirstChild = nextOldFiber)
2943 : (previousNewFiber.sibling = nextOldFiber),
2944 (previousNewFiber = nextOldFiber));
2945 shouldTrackSideEffects &&
2946 oldFiber.forEach(function(child) {
2947 return deleteChild(returnFiber, child);
2948 });
2949 return resultingFirstChild;
2950 }
2951 function reconcileChildrenIterator(
2952 returnFiber,
2953 currentFirstChild,
2954 newChildrenIterable,
2955 expirationTime
2956 ) {
2957 var iteratorFn = getIteratorFn(newChildrenIterable);
2958 if ("function" !== typeof iteratorFn)
2959 throw ReactError(
2960 Error(
2961 "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."
2962 )
2963 );
2964 newChildrenIterable = iteratorFn.call(newChildrenIterable);
2965 if (null == newChildrenIterable)
2966 throw ReactError(Error("An iterable object provided no iterator."));
2967 for (
2968 var previousNewFiber = (iteratorFn = null),
2969 oldFiber = currentFirstChild,
2970 newIdx = (currentFirstChild = 0),
2971 nextOldFiber = null,
2972 step = newChildrenIterable.next();
2973 null !== oldFiber && !step.done;
2974 newIdx++, step = newChildrenIterable.next()
2975 ) {
2976 oldFiber.index > newIdx
2977 ? ((nextOldFiber = oldFiber), (oldFiber = null))
2978 : (nextOldFiber = oldFiber.sibling);
2979 var newFiber = updateSlot(
2980 returnFiber,
2981 oldFiber,
2982 step.value,
2983 expirationTime
2984 );
2985 if (null === newFiber) {
2986 null === oldFiber && (oldFiber = nextOldFiber);
2987 break;
2988 }
2989 shouldTrackSideEffects &&
2990 oldFiber &&
2991 null === newFiber.alternate &&
2992 deleteChild(returnFiber, oldFiber);
2993 currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx);
2994 null === previousNewFiber
2995 ? (iteratorFn = newFiber)
2996 : (previousNewFiber.sibling = newFiber);
2997 previousNewFiber = newFiber;
2998 oldFiber = nextOldFiber;
2999 }
3000 if (step.done)
3001 return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn;
3002 if (null === oldFiber) {
3003 for (; !step.done; newIdx++, step = newChildrenIterable.next())
3004 (step = createChild(returnFiber, step.value, expirationTime)),
3005 null !== step &&
3006 ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
3007 null === previousNewFiber
3008 ? (iteratorFn = step)
3009 : (previousNewFiber.sibling = step),
3010 (previousNewFiber = step));
3011 return iteratorFn;
3012 }
3013 for (
3014 oldFiber = mapRemainingChildren(returnFiber, oldFiber);
3015 !step.done;
3016 newIdx++, step = newChildrenIterable.next()
3017 )
3018 (step = updateFromMap(
3019 oldFiber,
3020 returnFiber,
3021 newIdx,
3022 step.value,
3023 expirationTime
3024 )),
3025 null !== step &&
3026 (shouldTrackSideEffects &&
3027 null !== step.alternate &&
3028 oldFiber.delete(null === step.key ? newIdx : step.key),
3029 (currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
3030 null === previousNewFiber
3031 ? (iteratorFn = step)
3032 : (previousNewFiber.sibling = step),
3033 (previousNewFiber = step));
3034 shouldTrackSideEffects &&
3035 oldFiber.forEach(function(child) {
3036 return deleteChild(returnFiber, child);
3037 });
3038 return iteratorFn;
3039 }
3040 return function(returnFiber, currentFirstChild, newChild, expirationTime) {
3041 var isUnkeyedTopLevelFragment =
3042 "object" === typeof newChild &&
3043 null !== newChild &&
3044 newChild.type === REACT_FRAGMENT_TYPE &&
3045 null === newChild.key;
3046 isUnkeyedTopLevelFragment && (newChild = newChild.props.children);
3047 var isObject = "object" === typeof newChild && null !== newChild;
3048 if (isObject)
3049 switch (newChild.$$typeof) {
3050 case REACT_ELEMENT_TYPE:
3051 a: {
3052 isObject = newChild.key;
3053 for (
3054 isUnkeyedTopLevelFragment = currentFirstChild;
3055 null !== isUnkeyedTopLevelFragment;
3056
3057 ) {
3058 if (isUnkeyedTopLevelFragment.key === isObject) {
3059 if (
3060 7 === isUnkeyedTopLevelFragment.tag
3061 ? newChild.type === REACT_FRAGMENT_TYPE
3062 : isUnkeyedTopLevelFragment.elementType === newChild.type
3063 ) {
3064 deleteRemainingChildren(
3065 returnFiber,
3066 isUnkeyedTopLevelFragment.sibling
3067 );
3068 currentFirstChild = useFiber(
3069 isUnkeyedTopLevelFragment,
3070 newChild.type === REACT_FRAGMENT_TYPE
3071 ? newChild.props.children
3072 : newChild.props,
3073 expirationTime
3074 );
3075 currentFirstChild.ref = coerceRef(
3076 returnFiber,
3077 isUnkeyedTopLevelFragment,
3078 newChild
3079 );
3080 currentFirstChild.return = returnFiber;
3081 returnFiber = currentFirstChild;
3082 break a;
3083 }
3084 deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment);
3085 break;
3086 } else deleteChild(returnFiber, isUnkeyedTopLevelFragment);
3087 isUnkeyedTopLevelFragment = isUnkeyedTopLevelFragment.sibling;
3088 }
3089 newChild.type === REACT_FRAGMENT_TYPE
3090 ? ((currentFirstChild = createFiberFromFragment(
3091 newChild.props.children,
3092 returnFiber.mode,
3093 expirationTime,
3094 newChild.key
3095 )),
3096 (currentFirstChild.return = returnFiber),
3097 (returnFiber = currentFirstChild))
3098 : ((expirationTime = createFiberFromTypeAndProps(
3099 newChild.type,
3100 newChild.key,
3101 newChild.props,
3102 null,
3103 returnFiber.mode,
3104 expirationTime
3105 )),
3106 (expirationTime.ref = coerceRef(
3107 returnFiber,
3108 currentFirstChild,
3109 newChild
3110 )),
3111 (expirationTime.return = returnFiber),
3112 (returnFiber = expirationTime));
3113 }
3114 return placeSingleChild(returnFiber);
3115 case REACT_PORTAL_TYPE:
3116 a: {
3117 for (
3118 isUnkeyedTopLevelFragment = newChild.key;
3119 null !== currentFirstChild;
3120
3121 ) {
3122 if (currentFirstChild.key === isUnkeyedTopLevelFragment) {
3123 if (
3124 4 === currentFirstChild.tag &&
3125 currentFirstChild.stateNode.containerInfo ===
3126 newChild.containerInfo &&
3127 currentFirstChild.stateNode.implementation ===
3128 newChild.implementation
3129 ) {
3130 deleteRemainingChildren(
3131 returnFiber,
3132 currentFirstChild.sibling
3133 );
3134 currentFirstChild = useFiber(
3135 currentFirstChild,
3136 newChild.children || [],
3137 expirationTime
3138 );
3139 currentFirstChild.return = returnFiber;
3140 returnFiber = currentFirstChild;
3141 break a;
3142 }
3143 deleteRemainingChildren(returnFiber, currentFirstChild);
3144 break;
3145 } else deleteChild(returnFiber, currentFirstChild);
3146 currentFirstChild = currentFirstChild.sibling;
3147 }
3148 currentFirstChild = createFiberFromPortal(
3149 newChild,
3150 returnFiber.mode,
3151 expirationTime
3152 );
3153 currentFirstChild.return = returnFiber;
3154 returnFiber = currentFirstChild;
3155 }
3156 return placeSingleChild(returnFiber);
3157 }
3158 if ("string" === typeof newChild || "number" === typeof newChild)
3159 return (
3160 (newChild = "" + newChild),
3161 null !== currentFirstChild && 6 === currentFirstChild.tag
3162 ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling),
3163 (currentFirstChild = useFiber(
3164 currentFirstChild,
3165 newChild,
3166 expirationTime
3167 )),
3168 (currentFirstChild.return = returnFiber),
3169 (returnFiber = currentFirstChild))
3170 : (deleteRemainingChildren(returnFiber, currentFirstChild),
3171 (currentFirstChild = createFiberFromText(
3172 newChild,
3173 returnFiber.mode,
3174 expirationTime
3175 )),
3176 (currentFirstChild.return = returnFiber),
3177 (returnFiber = currentFirstChild)),
3178 placeSingleChild(returnFiber)
3179 );
3180 if (isArray(newChild))
3181 return reconcileChildrenArray(
3182 returnFiber,
3183 currentFirstChild,
3184 newChild,
3185 expirationTime
3186 );
3187 if (getIteratorFn(newChild))
3188 return reconcileChildrenIterator(
3189 returnFiber,
3190 currentFirstChild,
3191 newChild,
3192 expirationTime
3193 );
3194 isObject && throwOnInvalidObjectType(returnFiber, newChild);
3195 if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment)
3196 switch (returnFiber.tag) {
3197 case 1:
3198 case 0:
3199 throw ((returnFiber = returnFiber.type),
3200 ReactError(
3201 Error(
3202 (returnFiber.displayName || returnFiber.name || "Component") +
3203 "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."
3204 )
3205 ));
3206 }
3207 return deleteRemainingChildren(returnFiber, currentFirstChild);
3208 };
3209}
3210var reconcileChildFibers = ChildReconciler(!0),
3211 mountChildFibers = ChildReconciler(!1),
3212 NO_CONTEXT = {},
3213 contextStackCursor$1 = { current: NO_CONTEXT },
3214 contextFiberStackCursor = { current: NO_CONTEXT },
3215 rootInstanceStackCursor = { current: NO_CONTEXT };
3216function requiredContext(c) {
3217 if (c === NO_CONTEXT)
3218 throw ReactError(
3219 Error(
3220 "Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."
3221 )
3222 );
3223 return c;
3224}
3225function pushHostContainer(fiber, nextRootInstance) {
3226 push(rootInstanceStackCursor, nextRootInstance, fiber);
3227 push(contextFiberStackCursor, fiber, fiber);
3228 push(contextStackCursor$1, NO_CONTEXT, fiber);
3229 pop(contextStackCursor$1, fiber);
3230 push(contextStackCursor$1, { isInAParentText: !1 }, fiber);
3231}
3232function popHostContainer(fiber) {
3233 pop(contextStackCursor$1, fiber);
3234 pop(contextFiberStackCursor, fiber);
3235 pop(rootInstanceStackCursor, fiber);
3236}
3237function pushHostContext(fiber) {
3238 requiredContext(rootInstanceStackCursor.current);
3239 var context = requiredContext(contextStackCursor$1.current);
3240 var nextContext = fiber.type;
3241 nextContext =
3242 "AndroidTextInput" === nextContext ||
3243 "RCTMultilineTextInputView" === nextContext ||
3244 "RCTSinglelineTextInputView" === nextContext ||
3245 "RCTText" === nextContext ||
3246 "RCTVirtualText" === nextContext;
3247 nextContext =
3248 context.isInAParentText !== nextContext
3249 ? { isInAParentText: nextContext }
3250 : context;
3251 context !== nextContext &&
3252 (push(contextFiberStackCursor, fiber, fiber),
3253 push(contextStackCursor$1, nextContext, fiber));
3254}
3255function popHostContext(fiber) {
3256 contextFiberStackCursor.current === fiber &&
3257 (pop(contextStackCursor$1, fiber), pop(contextFiberStackCursor, fiber));
3258}
3259var SubtreeSuspenseContextMask = 1,
3260 InvisibleParentSuspenseContext = 1,
3261 ForceSuspenseFallback = 2,
3262 suspenseStackCursor = { current: 0 };
3263function findFirstSuspended(row) {
3264 for (var node = row; null !== node; ) {
3265 if (13 === node.tag) {
3266 if (null !== node.memoizedState) return node;
3267 } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) {
3268 if (0 !== (node.effectTag & 64)) return node;
3269 } else if (null !== node.child) {
3270 node.child.return = node;
3271 node = node.child;
3272 continue;
3273 }
3274 if (node === row) break;
3275 for (; null === node.sibling; ) {
3276 if (null === node.return || node.return === row) return null;
3277 node = node.return;
3278 }
3279 node.sibling.return = node.return;
3280 node = node.sibling;
3281 }
3282 return null;
3283}
3284function createResponderListener(responder, props) {
3285 return { responder: responder, props: props };
3286}
3287var NoEffect$1 = 0,
3288 UnmountSnapshot = 2,
3289 UnmountMutation = 4,
3290 MountMutation = 8,
3291 UnmountLayout = 16,
3292 MountLayout = 32,
3293 MountPassive = 64,
3294 UnmountPassive = 128,
3295 ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,
3296 renderExpirationTime$1 = 0,
3297 currentlyRenderingFiber$1 = null,
3298 currentHook = null,
3299 nextCurrentHook = null,
3300 firstWorkInProgressHook = null,
3301 workInProgressHook = null,
3302 nextWorkInProgressHook = null,
3303 remainingExpirationTime = 0,
3304 componentUpdateQueue = null,
3305 sideEffectTag = 0,
3306 didScheduleRenderPhaseUpdate = !1,
3307 renderPhaseUpdates = null,
3308 numberOfReRenders = 0;
3309function throwInvalidHookError() {
3310 throw ReactError(
3311 Error(
3312 "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem."
3313 )
3314 );
3315}
3316function areHookInputsEqual(nextDeps, prevDeps) {
3317 if (null === prevDeps) return !1;
3318 for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++)
3319 if (!is(nextDeps[i], prevDeps[i])) return !1;
3320 return !0;
3321}
3322function renderWithHooks(
3323 current,
3324 workInProgress,
3325 Component,
3326 props,
3327 refOrContext,
3328 nextRenderExpirationTime
3329) {
3330 renderExpirationTime$1 = nextRenderExpirationTime;
3331 currentlyRenderingFiber$1 = workInProgress;
3332 nextCurrentHook = null !== current ? current.memoizedState : null;
3333 ReactCurrentDispatcher$1.current =
3334 null === nextCurrentHook ? HooksDispatcherOnMount : HooksDispatcherOnUpdate;
3335 workInProgress = Component(props, refOrContext);
3336 if (didScheduleRenderPhaseUpdate) {
3337 do
3338 (didScheduleRenderPhaseUpdate = !1),
3339 (numberOfReRenders += 1),
3340 (nextCurrentHook = null !== current ? current.memoizedState : null),
3341 (nextWorkInProgressHook = firstWorkInProgressHook),
3342 (componentUpdateQueue = workInProgressHook = currentHook = null),
3343 (ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdate),
3344 (workInProgress = Component(props, refOrContext));
3345 while (didScheduleRenderPhaseUpdate);
3346 renderPhaseUpdates = null;
3347 numberOfReRenders = 0;
3348 }
3349 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
3350 current = currentlyRenderingFiber$1;
3351 current.memoizedState = firstWorkInProgressHook;
3352 current.expirationTime = remainingExpirationTime;
3353 current.updateQueue = componentUpdateQueue;
3354 current.effectTag |= sideEffectTag;
3355 current = null !== currentHook && null !== currentHook.next;
3356 renderExpirationTime$1 = 0;
3357 nextWorkInProgressHook = workInProgressHook = firstWorkInProgressHook = nextCurrentHook = currentHook = currentlyRenderingFiber$1 = null;
3358 remainingExpirationTime = 0;
3359 componentUpdateQueue = null;
3360 sideEffectTag = 0;
3361 if (current)
3362 throw ReactError(
3363 Error(
3364 "Rendered fewer hooks than expected. This may be caused by an accidental early return statement."
3365 )
3366 );
3367 return workInProgress;
3368}
3369function resetHooks() {
3370 ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;
3371 renderExpirationTime$1 = 0;
3372 nextWorkInProgressHook = workInProgressHook = firstWorkInProgressHook = nextCurrentHook = currentHook = currentlyRenderingFiber$1 = null;
3373 remainingExpirationTime = 0;
3374 componentUpdateQueue = null;
3375 sideEffectTag = 0;
3376 didScheduleRenderPhaseUpdate = !1;
3377 renderPhaseUpdates = null;
3378 numberOfReRenders = 0;
3379}
3380function mountWorkInProgressHook() {
3381 var hook = {
3382 memoizedState: null,
3383 baseState: null,
3384 queue: null,
3385 baseUpdate: null,
3386 next: null
3387 };
3388 null === workInProgressHook
3389 ? (firstWorkInProgressHook = workInProgressHook = hook)
3390 : (workInProgressHook = workInProgressHook.next = hook);
3391 return workInProgressHook;
3392}
3393function updateWorkInProgressHook() {
3394 if (null !== nextWorkInProgressHook)
3395 (workInProgressHook = nextWorkInProgressHook),
3396 (nextWorkInProgressHook = workInProgressHook.next),
3397 (currentHook = nextCurrentHook),
3398 (nextCurrentHook = null !== currentHook ? currentHook.next : null);
3399 else {
3400 if (null === nextCurrentHook)
3401 throw ReactError(
3402 Error("Rendered more hooks than during the previous render.")
3403 );
3404 currentHook = nextCurrentHook;
3405 var newHook = {
3406 memoizedState: currentHook.memoizedState,
3407 baseState: currentHook.baseState,
3408 queue: currentHook.queue,
3409 baseUpdate: currentHook.baseUpdate,
3410 next: null
3411 };
3412 workInProgressHook =
3413 null === workInProgressHook
3414 ? (firstWorkInProgressHook = newHook)
3415 : (workInProgressHook.next = newHook);
3416 nextCurrentHook = currentHook.next;
3417 }
3418 return workInProgressHook;
3419}
3420function basicStateReducer(state, action) {
3421 return "function" === typeof action ? action(state) : action;
3422}
3423function updateReducer(reducer) {
3424 var hook = updateWorkInProgressHook(),
3425 queue = hook.queue;
3426 if (null === queue)
3427 throw ReactError(
3428 Error(
3429 "Should have a queue. This is likely a bug in React. Please file an issue."
3430 )
3431 );
3432 queue.lastRenderedReducer = reducer;
3433 if (0 < numberOfReRenders) {
3434 var _dispatch = queue.dispatch;
3435 if (null !== renderPhaseUpdates) {
3436 var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);
3437 if (void 0 !== firstRenderPhaseUpdate) {
3438 renderPhaseUpdates.delete(queue);
3439 var newState = hook.memoizedState;
3440 do
3441 (newState = reducer(newState, firstRenderPhaseUpdate.action)),
3442 (firstRenderPhaseUpdate = firstRenderPhaseUpdate.next);
3443 while (null !== firstRenderPhaseUpdate);
3444 is(newState, hook.memoizedState) || (didReceiveUpdate = !0);
3445 hook.memoizedState = newState;
3446 hook.baseUpdate === queue.last && (hook.baseState = newState);
3447 queue.lastRenderedState = newState;
3448 return [newState, _dispatch];
3449 }
3450 }
3451 return [hook.memoizedState, _dispatch];
3452 }
3453 _dispatch = queue.last;
3454 var baseUpdate = hook.baseUpdate;
3455 newState = hook.baseState;
3456 null !== baseUpdate
3457 ? (null !== _dispatch && (_dispatch.next = null),
3458 (_dispatch = baseUpdate.next))
3459 : (_dispatch = null !== _dispatch ? _dispatch.next : null);
3460 if (null !== _dispatch) {
3461 var newBaseUpdate = (firstRenderPhaseUpdate = null),
3462 _update = _dispatch,
3463 didSkip = !1;
3464 do {
3465 var updateExpirationTime = _update.expirationTime;
3466 updateExpirationTime < renderExpirationTime$1
3467 ? (didSkip ||
3468 ((didSkip = !0),
3469 (newBaseUpdate = baseUpdate),
3470 (firstRenderPhaseUpdate = newState)),
3471 updateExpirationTime > remainingExpirationTime &&
3472 (remainingExpirationTime = updateExpirationTime))
3473 : (markRenderEventTimeAndConfig(
3474 updateExpirationTime,
3475 _update.suspenseConfig
3476 ),
3477 (newState =
3478 _update.eagerReducer === reducer
3479 ? _update.eagerState
3480 : reducer(newState, _update.action)));
3481 baseUpdate = _update;
3482 _update = _update.next;
3483 } while (null !== _update && _update !== _dispatch);
3484 didSkip ||
3485 ((newBaseUpdate = baseUpdate), (firstRenderPhaseUpdate = newState));
3486 is(newState, hook.memoizedState) || (didReceiveUpdate = !0);
3487 hook.memoizedState = newState;
3488 hook.baseUpdate = newBaseUpdate;
3489 hook.baseState = firstRenderPhaseUpdate;
3490 queue.lastRenderedState = newState;
3491 }
3492 return [hook.memoizedState, queue.dispatch];
3493}
3494function pushEffect(tag, create, destroy, deps) {
3495 tag = { tag: tag, create: create, destroy: destroy, deps: deps, next: null };
3496 null === componentUpdateQueue
3497 ? ((componentUpdateQueue = { lastEffect: null }),
3498 (componentUpdateQueue.lastEffect = tag.next = tag))
3499 : ((create = componentUpdateQueue.lastEffect),
3500 null === create
3501 ? (componentUpdateQueue.lastEffect = tag.next = tag)
3502 : ((destroy = create.next),
3503 (create.next = tag),
3504 (tag.next = destroy),
3505 (componentUpdateQueue.lastEffect = tag)));
3506 return tag;
3507}
3508function mountEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
3509 var hook = mountWorkInProgressHook();
3510 sideEffectTag |= fiberEffectTag;
3511 hook.memoizedState = pushEffect(
3512 hookEffectTag,
3513 create,
3514 void 0,
3515 void 0 === deps ? null : deps
3516 );
3517}
3518function updateEffectImpl(fiberEffectTag, hookEffectTag, create, deps) {
3519 var hook = updateWorkInProgressHook();
3520 deps = void 0 === deps ? null : deps;
3521 var destroy = void 0;
3522 if (null !== currentHook) {
3523 var prevEffect = currentHook.memoizedState;
3524 destroy = prevEffect.destroy;
3525 if (null !== deps && areHookInputsEqual(deps, prevEffect.deps)) {
3526 pushEffect(NoEffect$1, create, destroy, deps);
3527 return;
3528 }
3529 }
3530 sideEffectTag |= fiberEffectTag;
3531 hook.memoizedState = pushEffect(hookEffectTag, create, destroy, deps);
3532}
3533function imperativeHandleEffect(create, ref) {
3534 if ("function" === typeof ref)
3535 return (
3536 (create = create()),
3537 ref(create),
3538 function() {
3539 ref(null);
3540 }
3541 );
3542 if (null !== ref && void 0 !== ref)
3543 return (
3544 (create = create()),
3545 (ref.current = create),
3546 function() {
3547 ref.current = null;
3548 }
3549 );
3550}
3551function mountDebugValue() {}
3552function dispatchAction(fiber, queue, action) {
3553 if (!(25 > numberOfReRenders))
3554 throw ReactError(
3555 Error(
3556 "Too many re-renders. React limits the number of renders to prevent an infinite loop."
3557 )
3558 );
3559 var alternate = fiber.alternate;
3560 if (
3561 fiber === currentlyRenderingFiber$1 ||
3562 (null !== alternate && alternate === currentlyRenderingFiber$1)
3563 )
3564 if (
3565 ((didScheduleRenderPhaseUpdate = !0),
3566 (fiber = {
3567 expirationTime: renderExpirationTime$1,
3568 suspenseConfig: null,
3569 action: action,
3570 eagerReducer: null,
3571 eagerState: null,
3572 next: null
3573 }),
3574 null === renderPhaseUpdates && (renderPhaseUpdates = new Map()),
3575 (action = renderPhaseUpdates.get(queue)),
3576 void 0 === action)
3577 )
3578 renderPhaseUpdates.set(queue, fiber);
3579 else {
3580 for (queue = action; null !== queue.next; ) queue = queue.next;
3581 queue.next = fiber;
3582 }
3583 else {
3584 var currentTime = requestCurrentTime(),
3585 _suspenseConfig = ReactCurrentBatchConfig.suspense;
3586 currentTime = computeExpirationForFiber(
3587 currentTime,
3588 fiber,
3589 _suspenseConfig
3590 );
3591 _suspenseConfig = {
3592 expirationTime: currentTime,
3593 suspenseConfig: _suspenseConfig,
3594 action: action,
3595 eagerReducer: null,
3596 eagerState: null,
3597 next: null
3598 };
3599 var _last = queue.last;
3600 if (null === _last) _suspenseConfig.next = _suspenseConfig;
3601 else {
3602 var first = _last.next;
3603 null !== first && (_suspenseConfig.next = first);
3604 _last.next = _suspenseConfig;
3605 }
3606 queue.last = _suspenseConfig;
3607 if (
3608 0 === fiber.expirationTime &&
3609 (null === alternate || 0 === alternate.expirationTime) &&
3610 ((alternate = queue.lastRenderedReducer), null !== alternate)
3611 )
3612 try {
3613 var currentState = queue.lastRenderedState,
3614 _eagerState = alternate(currentState, action);
3615 _suspenseConfig.eagerReducer = alternate;
3616 _suspenseConfig.eagerState = _eagerState;
3617 if (is(_eagerState, currentState)) return;
3618 } catch (error) {
3619 } finally {
3620 }
3621 scheduleUpdateOnFiber(fiber, currentTime);
3622 }
3623}
3624var ContextOnlyDispatcher = {
3625 readContext: readContext,
3626 useCallback: throwInvalidHookError,
3627 useContext: throwInvalidHookError,
3628 useEffect: throwInvalidHookError,
3629 useImperativeHandle: throwInvalidHookError,
3630 useLayoutEffect: throwInvalidHookError,
3631 useMemo: throwInvalidHookError,
3632 useReducer: throwInvalidHookError,
3633 useRef: throwInvalidHookError,
3634 useState: throwInvalidHookError,
3635 useDebugValue: throwInvalidHookError,
3636 useResponder: throwInvalidHookError
3637 },
3638 HooksDispatcherOnMount = {
3639 readContext: readContext,
3640 useCallback: function(callback, deps) {
3641 mountWorkInProgressHook().memoizedState = [
3642 callback,
3643 void 0 === deps ? null : deps
3644 ];
3645 return callback;
3646 },
3647 useContext: readContext,
3648 useEffect: function(create, deps) {
3649 return mountEffectImpl(516, UnmountPassive | MountPassive, create, deps);
3650 },
3651 useImperativeHandle: function(ref, create, deps) {
3652 deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
3653 return mountEffectImpl(
3654 4,
3655 UnmountMutation | MountLayout,
3656 imperativeHandleEffect.bind(null, create, ref),
3657 deps
3658 );
3659 },
3660 useLayoutEffect: function(create, deps) {
3661 return mountEffectImpl(4, UnmountMutation | MountLayout, create, deps);
3662 },
3663 useMemo: function(nextCreate, deps) {
3664 var hook = mountWorkInProgressHook();
3665 deps = void 0 === deps ? null : deps;
3666 nextCreate = nextCreate();
3667 hook.memoizedState = [nextCreate, deps];
3668 return nextCreate;
3669 },
3670 useReducer: function(reducer, initialArg, init) {
3671 var hook = mountWorkInProgressHook();
3672 initialArg = void 0 !== init ? init(initialArg) : initialArg;
3673 hook.memoizedState = hook.baseState = initialArg;
3674 reducer = hook.queue = {
3675 last: null,
3676 dispatch: null,
3677 lastRenderedReducer: reducer,
3678 lastRenderedState: initialArg
3679 };
3680 reducer = reducer.dispatch = dispatchAction.bind(
3681 null,
3682 currentlyRenderingFiber$1,
3683 reducer
3684 );
3685 return [hook.memoizedState, reducer];
3686 },
3687 useRef: function(initialValue) {
3688 var hook = mountWorkInProgressHook();
3689 initialValue = { current: initialValue };
3690 return (hook.memoizedState = initialValue);
3691 },
3692 useState: function(initialState) {
3693 var hook = mountWorkInProgressHook();
3694 "function" === typeof initialState && (initialState = initialState());
3695 hook.memoizedState = hook.baseState = initialState;
3696 initialState = hook.queue = {
3697 last: null,
3698 dispatch: null,
3699 lastRenderedReducer: basicStateReducer,
3700 lastRenderedState: initialState
3701 };
3702 initialState = initialState.dispatch = dispatchAction.bind(
3703 null,
3704 currentlyRenderingFiber$1,
3705 initialState
3706 );
3707 return [hook.memoizedState, initialState];
3708 },
3709 useDebugValue: mountDebugValue,
3710 useResponder: createResponderListener
3711 },
3712 HooksDispatcherOnUpdate = {
3713 readContext: readContext,
3714 useCallback: function(callback, deps) {
3715 var hook = updateWorkInProgressHook();
3716 deps = void 0 === deps ? null : deps;
3717 var prevState = hook.memoizedState;
3718 if (
3719 null !== prevState &&
3720 null !== deps &&
3721 areHookInputsEqual(deps, prevState[1])
3722 )
3723 return prevState[0];
3724 hook.memoizedState = [callback, deps];
3725 return callback;
3726 },
3727 useContext: readContext,
3728 useEffect: function(create, deps) {
3729 return updateEffectImpl(516, UnmountPassive | MountPassive, create, deps);
3730 },
3731 useImperativeHandle: function(ref, create, deps) {
3732 deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
3733 return updateEffectImpl(
3734 4,
3735 UnmountMutation | MountLayout,
3736 imperativeHandleEffect.bind(null, create, ref),
3737 deps
3738 );
3739 },
3740 useLayoutEffect: function(create, deps) {
3741 return updateEffectImpl(4, UnmountMutation | MountLayout, create, deps);
3742 },
3743 useMemo: function(nextCreate, deps) {
3744 var hook = updateWorkInProgressHook();
3745 deps = void 0 === deps ? null : deps;
3746 var prevState = hook.memoizedState;
3747 if (
3748 null !== prevState &&
3749 null !== deps &&
3750 areHookInputsEqual(deps, prevState[1])
3751 )
3752 return prevState[0];
3753 nextCreate = nextCreate();
3754 hook.memoizedState = [nextCreate, deps];
3755 return nextCreate;
3756 },
3757 useReducer: updateReducer,
3758 useRef: function() {
3759 return updateWorkInProgressHook().memoizedState;
3760 },
3761 useState: function(initialState) {
3762 return updateReducer(basicStateReducer, initialState);
3763 },
3764 useDebugValue: mountDebugValue,
3765 useResponder: createResponderListener
3766 },
3767 hydrationParentFiber = null,
3768 nextHydratableInstance = null,
3769 isHydrating = !1;
3770function tryHydrate(fiber, nextInstance) {
3771 switch (fiber.tag) {
3772 case 5:
3773 return (
3774 (nextInstance = shim$1(nextInstance, fiber.type, fiber.pendingProps)),
3775 null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1
3776 );
3777 case 6:
3778 return (
3779 (nextInstance = shim$1(nextInstance, fiber.pendingProps)),
3780 null !== nextInstance ? ((fiber.stateNode = nextInstance), !0) : !1
3781 );
3782 case 13:
3783 return !1;
3784 default:
3785 return !1;
3786 }
3787}
3788function tryToClaimNextHydratableInstance(fiber$jscomp$0) {
3789 if (isHydrating) {
3790 var nextInstance = nextHydratableInstance;
3791 if (nextInstance) {
3792 var firstAttemptedInstance = nextInstance;
3793 if (!tryHydrate(fiber$jscomp$0, nextInstance)) {
3794 nextInstance = shim$1(firstAttemptedInstance);
3795 if (!nextInstance || !tryHydrate(fiber$jscomp$0, nextInstance)) {
3796 fiber$jscomp$0.effectTag |= 2;
3797 isHydrating = !1;
3798 hydrationParentFiber = fiber$jscomp$0;
3799 return;
3800 }
3801 var returnFiber = hydrationParentFiber,
3802 fiber = createFiber(5, null, null, 0);
3803 fiber.elementType = "DELETED";
3804 fiber.type = "DELETED";
3805 fiber.stateNode = firstAttemptedInstance;
3806 fiber.return = returnFiber;
3807 fiber.effectTag = 8;
3808 null !== returnFiber.lastEffect
3809 ? ((returnFiber.lastEffect.nextEffect = fiber),
3810 (returnFiber.lastEffect = fiber))
3811 : (returnFiber.firstEffect = returnFiber.lastEffect = fiber);
3812 }
3813 hydrationParentFiber = fiber$jscomp$0;
3814 nextHydratableInstance = shim$1(nextInstance);
3815 } else
3816 (fiber$jscomp$0.effectTag |= 2),
3817 (isHydrating = !1),
3818 (hydrationParentFiber = fiber$jscomp$0);
3819 }
3820}
3821var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner,
3822 didReceiveUpdate = !1;
3823function reconcileChildren(
3824 current$$1,
3825 workInProgress,
3826 nextChildren,
3827 renderExpirationTime
3828) {
3829 workInProgress.child =
3830 null === current$$1
3831 ? mountChildFibers(
3832 workInProgress,
3833 null,
3834 nextChildren,
3835 renderExpirationTime
3836 )
3837 : reconcileChildFibers(
3838 workInProgress,
3839 current$$1.child,
3840 nextChildren,
3841 renderExpirationTime
3842 );
3843}
3844function updateForwardRef(
3845 current$$1,
3846 workInProgress,
3847 Component,
3848 nextProps,
3849 renderExpirationTime
3850) {
3851 Component = Component.render;
3852 var ref = workInProgress.ref;
3853 prepareToReadContext(workInProgress, renderExpirationTime);
3854 nextProps = renderWithHooks(
3855 current$$1,
3856 workInProgress,
3857 Component,
3858 nextProps,
3859 ref,
3860 renderExpirationTime
3861 );
3862 if (null !== current$$1 && !didReceiveUpdate)
3863 return (
3864 (workInProgress.updateQueue = current$$1.updateQueue),
3865 (workInProgress.effectTag &= -517),
3866 current$$1.expirationTime <= renderExpirationTime &&
3867 (current$$1.expirationTime = 0),
3868 bailoutOnAlreadyFinishedWork(
3869 current$$1,
3870 workInProgress,
3871 renderExpirationTime
3872 )
3873 );
3874 workInProgress.effectTag |= 1;
3875 reconcileChildren(
3876 current$$1,
3877 workInProgress,
3878 nextProps,
3879 renderExpirationTime
3880 );
3881 return workInProgress.child;
3882}
3883function updateMemoComponent(
3884 current$$1,
3885 workInProgress,
3886 Component,
3887 nextProps,
3888 updateExpirationTime,
3889 renderExpirationTime
3890) {
3891 if (null === current$$1) {
3892 var type = Component.type;
3893 if (
3894 "function" === typeof type &&
3895 !shouldConstruct(type) &&
3896 void 0 === type.defaultProps &&
3897 null === Component.compare &&
3898 void 0 === Component.defaultProps
3899 )
3900 return (
3901 (workInProgress.tag = 15),
3902 (workInProgress.type = type),
3903 updateSimpleMemoComponent(
3904 current$$1,
3905 workInProgress,
3906 type,
3907 nextProps,
3908 updateExpirationTime,
3909 renderExpirationTime
3910 )
3911 );
3912 current$$1 = createFiberFromTypeAndProps(
3913 Component.type,
3914 null,
3915 nextProps,
3916 null,
3917 workInProgress.mode,
3918 renderExpirationTime
3919 );
3920 current$$1.ref = workInProgress.ref;
3921 current$$1.return = workInProgress;
3922 return (workInProgress.child = current$$1);
3923 }
3924 type = current$$1.child;
3925 if (
3926 updateExpirationTime < renderExpirationTime &&
3927 ((updateExpirationTime = type.memoizedProps),
3928 (Component = Component.compare),
3929 (Component = null !== Component ? Component : shallowEqual),
3930 Component(updateExpirationTime, nextProps) &&
3931 current$$1.ref === workInProgress.ref)
3932 )
3933 return bailoutOnAlreadyFinishedWork(
3934 current$$1,
3935 workInProgress,
3936 renderExpirationTime
3937 );
3938 workInProgress.effectTag |= 1;
3939 current$$1 = createWorkInProgress(type, nextProps, renderExpirationTime);
3940 current$$1.ref = workInProgress.ref;
3941 current$$1.return = workInProgress;
3942 return (workInProgress.child = current$$1);
3943}
3944function updateSimpleMemoComponent(
3945 current$$1,
3946 workInProgress,
3947 Component,
3948 nextProps,
3949 updateExpirationTime,
3950 renderExpirationTime
3951) {
3952 return null !== current$$1 &&
3953 shallowEqual(current$$1.memoizedProps, nextProps) &&
3954 current$$1.ref === workInProgress.ref &&
3955 ((didReceiveUpdate = !1), updateExpirationTime < renderExpirationTime)
3956 ? bailoutOnAlreadyFinishedWork(
3957 current$$1,
3958 workInProgress,
3959 renderExpirationTime
3960 )
3961 : updateFunctionComponent(
3962 current$$1,
3963 workInProgress,
3964 Component,
3965 nextProps,
3966 renderExpirationTime
3967 );
3968}
3969function markRef(current$$1, workInProgress) {
3970 var ref = workInProgress.ref;
3971 if (
3972 (null === current$$1 && null !== ref) ||
3973 (null !== current$$1 && current$$1.ref !== ref)
3974 )
3975 workInProgress.effectTag |= 128;
3976}
3977function updateFunctionComponent(
3978 current$$1,
3979 workInProgress,
3980 Component,
3981 nextProps,
3982 renderExpirationTime
3983) {
3984 var context = isContextProvider(Component)
3985 ? previousContext
3986 : contextStackCursor.current;
3987 context = getMaskedContext(workInProgress, context);
3988 prepareToReadContext(workInProgress, renderExpirationTime);
3989 Component = renderWithHooks(
3990 current$$1,
3991 workInProgress,
3992 Component,
3993 nextProps,
3994 context,
3995 renderExpirationTime
3996 );
3997 if (null !== current$$1 && !didReceiveUpdate)
3998 return (
3999 (workInProgress.updateQueue = current$$1.updateQueue),
4000 (workInProgress.effectTag &= -517),
4001 current$$1.expirationTime <= renderExpirationTime &&
4002 (current$$1.expirationTime = 0),
4003 bailoutOnAlreadyFinishedWork(
4004 current$$1,
4005 workInProgress,
4006 renderExpirationTime
4007 )
4008 );
4009 workInProgress.effectTag |= 1;
4010 reconcileChildren(
4011 current$$1,
4012 workInProgress,
4013 Component,
4014 renderExpirationTime
4015 );
4016 return workInProgress.child;
4017}
4018function updateClassComponent(
4019 current$$1,
4020 workInProgress,
4021 Component,
4022 nextProps,
4023 renderExpirationTime
4024) {
4025 if (isContextProvider(Component)) {
4026 var hasContext = !0;
4027 pushContextProvider(workInProgress);
4028 } else hasContext = !1;
4029 prepareToReadContext(workInProgress, renderExpirationTime);
4030 if (null === workInProgress.stateNode)
4031 null !== current$$1 &&
4032 ((current$$1.alternate = null),
4033 (workInProgress.alternate = null),
4034 (workInProgress.effectTag |= 2)),
4035 constructClassInstance(
4036 workInProgress,
4037 Component,
4038 nextProps,
4039 renderExpirationTime
4040 ),
4041 mountClassInstance(
4042 workInProgress,
4043 Component,
4044 nextProps,
4045 renderExpirationTime
4046 ),
4047 (nextProps = !0);
4048 else if (null === current$$1) {
4049 var instance = workInProgress.stateNode,
4050 oldProps = workInProgress.memoizedProps;
4051 instance.props = oldProps;
4052 var oldContext = instance.context,
4053 contextType = Component.contextType;
4054 "object" === typeof contextType && null !== contextType
4055 ? (contextType = readContext(contextType))
4056 : ((contextType = isContextProvider(Component)
4057 ? previousContext
4058 : contextStackCursor.current),
4059 (contextType = getMaskedContext(workInProgress, contextType)));
4060 var getDerivedStateFromProps = Component.getDerivedStateFromProps,
4061 hasNewLifecycles =
4062 "function" === typeof getDerivedStateFromProps ||
4063 "function" === typeof instance.getSnapshotBeforeUpdate;
4064 hasNewLifecycles ||
4065 ("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
4066 "function" !== typeof instance.componentWillReceiveProps) ||
4067 ((oldProps !== nextProps || oldContext !== contextType) &&
4068 callComponentWillReceiveProps(
4069 workInProgress,
4070 instance,
4071 nextProps,
4072 contextType
4073 ));
4074 hasForceUpdate = !1;
4075 var oldState = workInProgress.memoizedState;
4076 oldContext = instance.state = oldState;
4077 var updateQueue = workInProgress.updateQueue;
4078 null !== updateQueue &&
4079 (processUpdateQueue(
4080 workInProgress,
4081 updateQueue,
4082 nextProps,
4083 instance,
4084 renderExpirationTime
4085 ),
4086 (oldContext = workInProgress.memoizedState));
4087 oldProps !== nextProps ||
4088 oldState !== oldContext ||
4089 didPerformWorkStackCursor.current ||
4090 hasForceUpdate
4091 ? ("function" === typeof getDerivedStateFromProps &&
4092 (applyDerivedStateFromProps(
4093 workInProgress,
4094 Component,
4095 getDerivedStateFromProps,
4096 nextProps
4097 ),
4098 (oldContext = workInProgress.memoizedState)),
4099 (oldProps =
4100 hasForceUpdate ||
4101 checkShouldComponentUpdate(
4102 workInProgress,
4103 Component,
4104 oldProps,
4105 nextProps,
4106 oldState,
4107 oldContext,
4108 contextType
4109 ))
4110 ? (hasNewLifecycles ||
4111 ("function" !== typeof instance.UNSAFE_componentWillMount &&
4112 "function" !== typeof instance.componentWillMount) ||
4113 ("function" === typeof instance.componentWillMount &&
4114 instance.componentWillMount(),
4115 "function" === typeof instance.UNSAFE_componentWillMount &&
4116 instance.UNSAFE_componentWillMount()),
4117 "function" === typeof instance.componentDidMount &&
4118 (workInProgress.effectTag |= 4))
4119 : ("function" === typeof instance.componentDidMount &&
4120 (workInProgress.effectTag |= 4),
4121 (workInProgress.memoizedProps = nextProps),
4122 (workInProgress.memoizedState = oldContext)),
4123 (instance.props = nextProps),
4124 (instance.state = oldContext),
4125 (instance.context = contextType),
4126 (nextProps = oldProps))
4127 : ("function" === typeof instance.componentDidMount &&
4128 (workInProgress.effectTag |= 4),
4129 (nextProps = !1));
4130 } else
4131 (instance = workInProgress.stateNode),
4132 (oldProps = workInProgress.memoizedProps),
4133 (instance.props =
4134 workInProgress.type === workInProgress.elementType
4135 ? oldProps
4136 : resolveDefaultProps(workInProgress.type, oldProps)),
4137 (oldContext = instance.context),
4138 (contextType = Component.contextType),
4139 "object" === typeof contextType && null !== contextType
4140 ? (contextType = readContext(contextType))
4141 : ((contextType = isContextProvider(Component)
4142 ? previousContext
4143 : contextStackCursor.current),
4144 (contextType = getMaskedContext(workInProgress, contextType))),
4145 (getDerivedStateFromProps = Component.getDerivedStateFromProps),
4146 (hasNewLifecycles =
4147 "function" === typeof getDerivedStateFromProps ||
4148 "function" === typeof instance.getSnapshotBeforeUpdate) ||
4149 ("function" !== typeof instance.UNSAFE_componentWillReceiveProps &&
4150 "function" !== typeof instance.componentWillReceiveProps) ||
4151 ((oldProps !== nextProps || oldContext !== contextType) &&
4152 callComponentWillReceiveProps(
4153 workInProgress,
4154 instance,
4155 nextProps,
4156 contextType
4157 )),
4158 (hasForceUpdate = !1),
4159 (oldContext = workInProgress.memoizedState),
4160 (oldState = instance.state = oldContext),
4161 (updateQueue = workInProgress.updateQueue),
4162 null !== updateQueue &&
4163 (processUpdateQueue(
4164 workInProgress,
4165 updateQueue,
4166 nextProps,
4167 instance,
4168 renderExpirationTime
4169 ),
4170 (oldState = workInProgress.memoizedState)),
4171 oldProps !== nextProps ||
4172 oldContext !== oldState ||
4173 didPerformWorkStackCursor.current ||
4174 hasForceUpdate
4175 ? ("function" === typeof getDerivedStateFromProps &&
4176 (applyDerivedStateFromProps(
4177 workInProgress,
4178 Component,
4179 getDerivedStateFromProps,
4180 nextProps
4181 ),
4182 (oldState = workInProgress.memoizedState)),
4183 (getDerivedStateFromProps =
4184 hasForceUpdate ||
4185 checkShouldComponentUpdate(
4186 workInProgress,
4187 Component,
4188 oldProps,
4189 nextProps,
4190 oldContext,
4191 oldState,
4192 contextType
4193 ))
4194 ? (hasNewLifecycles ||
4195 ("function" !== typeof instance.UNSAFE_componentWillUpdate &&
4196 "function" !== typeof instance.componentWillUpdate) ||
4197 ("function" === typeof instance.componentWillUpdate &&
4198 instance.componentWillUpdate(
4199 nextProps,
4200 oldState,
4201 contextType
4202 ),
4203 "function" === typeof instance.UNSAFE_componentWillUpdate &&
4204 instance.UNSAFE_componentWillUpdate(
4205 nextProps,
4206 oldState,
4207 contextType
4208 )),
4209 "function" === typeof instance.componentDidUpdate &&
4210 (workInProgress.effectTag |= 4),
4211 "function" === typeof instance.getSnapshotBeforeUpdate &&
4212 (workInProgress.effectTag |= 256))
4213 : ("function" !== typeof instance.componentDidUpdate ||
4214 (oldProps === current$$1.memoizedProps &&
4215 oldContext === current$$1.memoizedState) ||
4216 (workInProgress.effectTag |= 4),
4217 "function" !== typeof instance.getSnapshotBeforeUpdate ||
4218 (oldProps === current$$1.memoizedProps &&
4219 oldContext === current$$1.memoizedState) ||
4220 (workInProgress.effectTag |= 256),
4221 (workInProgress.memoizedProps = nextProps),
4222 (workInProgress.memoizedState = oldState)),
4223 (instance.props = nextProps),
4224 (instance.state = oldState),
4225 (instance.context = contextType),
4226 (nextProps = getDerivedStateFromProps))
4227 : ("function" !== typeof instance.componentDidUpdate ||
4228 (oldProps === current$$1.memoizedProps &&
4229 oldContext === current$$1.memoizedState) ||
4230 (workInProgress.effectTag |= 4),
4231 "function" !== typeof instance.getSnapshotBeforeUpdate ||
4232 (oldProps === current$$1.memoizedProps &&
4233 oldContext === current$$1.memoizedState) ||
4234 (workInProgress.effectTag |= 256),
4235 (nextProps = !1));
4236 return finishClassComponent(
4237 current$$1,
4238 workInProgress,
4239 Component,
4240 nextProps,
4241 hasContext,
4242 renderExpirationTime
4243 );
4244}
4245function finishClassComponent(
4246 current$$1,
4247 workInProgress,
4248 Component,
4249 shouldUpdate,
4250 hasContext,
4251 renderExpirationTime
4252) {
4253 markRef(current$$1, workInProgress);
4254 var didCaptureError = 0 !== (workInProgress.effectTag & 64);
4255 if (!shouldUpdate && !didCaptureError)
4256 return (
4257 hasContext && invalidateContextProvider(workInProgress, Component, !1),
4258 bailoutOnAlreadyFinishedWork(
4259 current$$1,
4260 workInProgress,
4261 renderExpirationTime
4262 )
4263 );
4264 shouldUpdate = workInProgress.stateNode;
4265 ReactCurrentOwner$3.current = workInProgress;
4266 var nextChildren =
4267 didCaptureError && "function" !== typeof Component.getDerivedStateFromError
4268 ? null
4269 : shouldUpdate.render();
4270 workInProgress.effectTag |= 1;
4271 null !== current$$1 && didCaptureError
4272 ? ((workInProgress.child = reconcileChildFibers(
4273 workInProgress,
4274 current$$1.child,
4275 null,
4276 renderExpirationTime
4277 )),
4278 (workInProgress.child = reconcileChildFibers(
4279 workInProgress,
4280 null,
4281 nextChildren,
4282 renderExpirationTime
4283 )))
4284 : reconcileChildren(
4285 current$$1,
4286 workInProgress,
4287 nextChildren,
4288 renderExpirationTime
4289 );
4290 workInProgress.memoizedState = shouldUpdate.state;
4291 hasContext && invalidateContextProvider(workInProgress, Component, !0);
4292 return workInProgress.child;
4293}
4294function pushHostRootContext(workInProgress) {
4295 var root = workInProgress.stateNode;
4296 root.pendingContext
4297 ? pushTopLevelContextObject(
4298 workInProgress,
4299 root.pendingContext,
4300 root.pendingContext !== root.context
4301 )
4302 : root.context &&
4303 pushTopLevelContextObject(workInProgress, root.context, !1);
4304 pushHostContainer(workInProgress, root.containerInfo);
4305}
4306var SUSPENDED_MARKER = {};
4307function updateSuspenseComponent(
4308 current$$1,
4309 workInProgress,
4310 renderExpirationTime
4311) {
4312 var mode = workInProgress.mode,
4313 nextProps = workInProgress.pendingProps,
4314 suspenseContext = suspenseStackCursor.current,
4315 nextState = null,
4316 nextDidTimeout = !1,
4317 JSCompiler_temp;
4318 (JSCompiler_temp = 0 !== (workInProgress.effectTag & 64)) ||
4319 (JSCompiler_temp =
4320 0 !== (suspenseContext & ForceSuspenseFallback) &&
4321 (null === current$$1 || null !== current$$1.memoizedState));
4322 JSCompiler_temp
4323 ? ((nextState = SUSPENDED_MARKER),
4324 (nextDidTimeout = !0),
4325 (workInProgress.effectTag &= -65))
4326 : (null !== current$$1 && null === current$$1.memoizedState) ||
4327 void 0 === nextProps.fallback ||
4328 !0 === nextProps.unstable_avoidThisFallback ||
4329 (suspenseContext |= InvisibleParentSuspenseContext);
4330 suspenseContext &= SubtreeSuspenseContextMask;
4331 push(suspenseStackCursor, suspenseContext, workInProgress);
4332 if (null === current$$1)
4333 if (nextDidTimeout) {
4334 nextProps = nextProps.fallback;
4335 current$$1 = createFiberFromFragment(null, mode, 0, null);
4336 current$$1.return = workInProgress;
4337 if (0 === (workInProgress.mode & 2))
4338 for (
4339 nextDidTimeout =
4340 null !== workInProgress.memoizedState
4341 ? workInProgress.child.child
4342 : workInProgress.child,
4343 current$$1.child = nextDidTimeout;
4344 null !== nextDidTimeout;
4345
4346 )
4347 (nextDidTimeout.return = current$$1),
4348 (nextDidTimeout = nextDidTimeout.sibling);
4349 renderExpirationTime = createFiberFromFragment(
4350 nextProps,
4351 mode,
4352 renderExpirationTime,
4353 null
4354 );
4355 renderExpirationTime.return = workInProgress;
4356 current$$1.sibling = renderExpirationTime;
4357 mode = current$$1;
4358 } else
4359 mode = renderExpirationTime = mountChildFibers(
4360 workInProgress,
4361 null,
4362 nextProps.children,
4363 renderExpirationTime
4364 );
4365 else {
4366 if (null !== current$$1.memoizedState)
4367 if (
4368 ((suspenseContext = current$$1.child),
4369 (mode = suspenseContext.sibling),
4370 nextDidTimeout)
4371 ) {
4372 nextProps = nextProps.fallback;
4373 renderExpirationTime = createWorkInProgress(
4374 suspenseContext,
4375 suspenseContext.pendingProps,
4376 0
4377 );
4378 renderExpirationTime.return = workInProgress;
4379 if (
4380 0 === (workInProgress.mode & 2) &&
4381 ((nextDidTimeout =
4382 null !== workInProgress.memoizedState
4383 ? workInProgress.child.child
4384 : workInProgress.child),
4385 nextDidTimeout !== suspenseContext.child)
4386 )
4387 for (
4388 renderExpirationTime.child = nextDidTimeout;
4389 null !== nextDidTimeout;
4390
4391 )
4392 (nextDidTimeout.return = renderExpirationTime),
4393 (nextDidTimeout = nextDidTimeout.sibling);
4394 nextProps = createWorkInProgress(mode, nextProps, mode.expirationTime);
4395 nextProps.return = workInProgress;
4396 renderExpirationTime.sibling = nextProps;
4397 mode = renderExpirationTime;
4398 renderExpirationTime.childExpirationTime = 0;
4399 renderExpirationTime = nextProps;
4400 } else
4401 mode = renderExpirationTime = reconcileChildFibers(
4402 workInProgress,
4403 suspenseContext.child,
4404 nextProps.children,
4405 renderExpirationTime
4406 );
4407 else if (((suspenseContext = current$$1.child), nextDidTimeout)) {
4408 nextDidTimeout = nextProps.fallback;
4409 nextProps = createFiberFromFragment(null, mode, 0, null);
4410 nextProps.return = workInProgress;
4411 nextProps.child = suspenseContext;
4412 null !== suspenseContext && (suspenseContext.return = nextProps);
4413 if (0 === (workInProgress.mode & 2))
4414 for (
4415 suspenseContext =
4416 null !== workInProgress.memoizedState
4417 ? workInProgress.child.child
4418 : workInProgress.child,
4419 nextProps.child = suspenseContext;
4420 null !== suspenseContext;
4421
4422 )
4423 (suspenseContext.return = nextProps),
4424 (suspenseContext = suspenseContext.sibling);
4425 renderExpirationTime = createFiberFromFragment(
4426 nextDidTimeout,
4427 mode,
4428 renderExpirationTime,
4429 null
4430 );
4431 renderExpirationTime.return = workInProgress;
4432 nextProps.sibling = renderExpirationTime;
4433 renderExpirationTime.effectTag |= 2;
4434 mode = nextProps;
4435 nextProps.childExpirationTime = 0;
4436 } else
4437 renderExpirationTime = mode = reconcileChildFibers(
4438 workInProgress,
4439 suspenseContext,
4440 nextProps.children,
4441 renderExpirationTime
4442 );
4443 workInProgress.stateNode = current$$1.stateNode;
4444 }
4445 workInProgress.memoizedState = nextState;
4446 workInProgress.child = mode;
4447 return renderExpirationTime;
4448}
4449function initSuspenseListRenderState(
4450 workInProgress,
4451 isBackwards,
4452 tail,
4453 lastContentRow,
4454 tailMode
4455) {
4456 var renderState = workInProgress.memoizedState;
4457 null === renderState
4458 ? (workInProgress.memoizedState = {
4459 isBackwards: isBackwards,
4460 rendering: null,
4461 last: lastContentRow,
4462 tail: tail,
4463 tailExpiration: 0,
4464 tailMode: tailMode
4465 })
4466 : ((renderState.isBackwards = isBackwards),
4467 (renderState.rendering = null),
4468 (renderState.last = lastContentRow),
4469 (renderState.tail = tail),
4470 (renderState.tailExpiration = 0),
4471 (renderState.tailMode = tailMode));
4472}
4473function updateSuspenseListComponent(
4474 current$$1,
4475 workInProgress,
4476 renderExpirationTime
4477) {
4478 var nextProps = workInProgress.pendingProps,
4479 revealOrder = nextProps.revealOrder,
4480 tailMode = nextProps.tail;
4481 reconcileChildren(
4482 current$$1,
4483 workInProgress,
4484 nextProps.children,
4485 renderExpirationTime
4486 );
4487 nextProps = suspenseStackCursor.current;
4488 if (0 !== (nextProps & ForceSuspenseFallback))
4489 (nextProps =
4490 (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback),
4491 (workInProgress.effectTag |= 64);
4492 else {
4493 if (null !== current$$1 && 0 !== (current$$1.effectTag & 64))
4494 a: for (current$$1 = workInProgress.child; null !== current$$1; ) {
4495 if (13 === current$$1.tag) {
4496 if (null !== current$$1.memoizedState) {
4497 current$$1.expirationTime < renderExpirationTime &&
4498 (current$$1.expirationTime = renderExpirationTime);
4499 var alternate = current$$1.alternate;
4500 null !== alternate &&
4501 alternate.expirationTime < renderExpirationTime &&
4502 (alternate.expirationTime = renderExpirationTime);
4503 scheduleWorkOnParentPath(current$$1.return, renderExpirationTime);
4504 }
4505 } else if (null !== current$$1.child) {
4506 current$$1.child.return = current$$1;
4507 current$$1 = current$$1.child;
4508 continue;
4509 }
4510 if (current$$1 === workInProgress) break a;
4511 for (; null === current$$1.sibling; ) {
4512 if (
4513 null === current$$1.return ||
4514 current$$1.return === workInProgress
4515 )
4516 break a;
4517 current$$1 = current$$1.return;
4518 }
4519 current$$1.sibling.return = current$$1.return;
4520 current$$1 = current$$1.sibling;
4521 }
4522 nextProps &= SubtreeSuspenseContextMask;
4523 }
4524 push(suspenseStackCursor, nextProps, workInProgress);
4525 if (0 === (workInProgress.mode & 2)) workInProgress.memoizedState = null;
4526 else
4527 switch (revealOrder) {
4528 case "forwards":
4529 renderExpirationTime = workInProgress.child;
4530 for (revealOrder = null; null !== renderExpirationTime; )
4531 (nextProps = renderExpirationTime.alternate),
4532 null !== nextProps &&
4533 null === findFirstSuspended(nextProps) &&
4534 (revealOrder = renderExpirationTime),
4535 (renderExpirationTime = renderExpirationTime.sibling);
4536 renderExpirationTime = revealOrder;
4537 null === renderExpirationTime
4538 ? ((revealOrder = workInProgress.child),
4539 (workInProgress.child = null))
4540 : ((revealOrder = renderExpirationTime.sibling),
4541 (renderExpirationTime.sibling = null));
4542 initSuspenseListRenderState(
4543 workInProgress,
4544 !1,
4545 revealOrder,
4546 renderExpirationTime,
4547 tailMode
4548 );
4549 break;
4550 case "backwards":
4551 renderExpirationTime = null;
4552 revealOrder = workInProgress.child;
4553 for (workInProgress.child = null; null !== revealOrder; ) {
4554 nextProps = revealOrder.alternate;
4555 if (null !== nextProps && null === findFirstSuspended(nextProps)) {
4556 workInProgress.child = revealOrder;
4557 break;
4558 }
4559 nextProps = revealOrder.sibling;
4560 revealOrder.sibling = renderExpirationTime;
4561 renderExpirationTime = revealOrder;
4562 revealOrder = nextProps;
4563 }
4564 initSuspenseListRenderState(
4565 workInProgress,
4566 !0,
4567 renderExpirationTime,
4568 null,
4569 tailMode
4570 );
4571 break;
4572 case "together":
4573 initSuspenseListRenderState(workInProgress, !1, null, null, void 0);
4574 break;
4575 default:
4576 workInProgress.memoizedState = null;
4577 }
4578 return workInProgress.child;
4579}
4580function bailoutOnAlreadyFinishedWork(
4581 current$$1,
4582 workInProgress,
4583 renderExpirationTime
4584) {
4585 null !== current$$1 &&
4586 (workInProgress.dependencies = current$$1.dependencies);
4587 if (workInProgress.childExpirationTime < renderExpirationTime) return null;
4588 if (null !== current$$1 && workInProgress.child !== current$$1.child)
4589 throw ReactError(Error("Resuming work not yet implemented."));
4590 if (null !== workInProgress.child) {
4591 current$$1 = workInProgress.child;
4592 renderExpirationTime = createWorkInProgress(
4593 current$$1,
4594 current$$1.pendingProps,
4595 current$$1.expirationTime
4596 );
4597 workInProgress.child = renderExpirationTime;
4598 for (
4599 renderExpirationTime.return = workInProgress;
4600 null !== current$$1.sibling;
4601
4602 )
4603 (current$$1 = current$$1.sibling),
4604 (renderExpirationTime = renderExpirationTime.sibling = createWorkInProgress(
4605 current$$1,
4606 current$$1.pendingProps,
4607 current$$1.expirationTime
4608 )),
4609 (renderExpirationTime.return = workInProgress);
4610 renderExpirationTime.sibling = null;
4611 }
4612 return workInProgress.child;
4613}
4614var appendAllChildren = void 0,
4615 updateHostContainer = void 0,
4616 updateHostComponent$1 = void 0,
4617 updateHostText$1 = void 0;
4618appendAllChildren = function(
4619 parent,
4620 workInProgress,
4621 needsVisibilityToggle,
4622 isHidden
4623) {
4624 for (var node = workInProgress.child; null !== node; ) {
4625 if (5 === node.tag) {
4626 var instance = node.stateNode;
4627 needsVisibilityToggle &&
4628 isHidden &&
4629 (instance = cloneHiddenInstance(
4630 instance,
4631 node.type,
4632 node.memoizedProps,
4633 node
4634 ));
4635 appendChildNode(parent.node, instance.node);
4636 } else if (6 === node.tag) {
4637 instance = node.stateNode;
4638 if (needsVisibilityToggle && isHidden)
4639 throw Error("Not yet implemented.");
4640 appendChildNode(parent.node, instance.node);
4641 } else if (4 !== node.tag) {
4642 if (
4643 13 === node.tag &&
4644 0 !== (node.effectTag & 4) &&
4645 (instance = null !== node.memoizedState)
4646 ) {
4647 var primaryChildParent = node.child;
4648 if (
4649 null !== primaryChildParent &&
4650 (null !== primaryChildParent.child &&
4651 ((primaryChildParent.child.return = primaryChildParent),
4652 appendAllChildren(parent, primaryChildParent, !0, instance)),
4653 (instance = primaryChildParent.sibling),
4654 null !== instance)
4655 ) {
4656 instance.return = node;
4657 node = instance;
4658 continue;
4659 }
4660 }
4661 if (null !== node.child) {
4662 node.child.return = node;
4663 node = node.child;
4664 continue;
4665 }
4666 }
4667 if (node === workInProgress) break;
4668 for (; null === node.sibling; ) {
4669 if (null === node.return || node.return === workInProgress) return;
4670 node = node.return;
4671 }
4672 node.sibling.return = node.return;
4673 node = node.sibling;
4674 }
4675};
4676function appendAllChildrenToContainer(
4677 containerChildSet,
4678 workInProgress,
4679 needsVisibilityToggle,
4680 isHidden
4681) {
4682 for (var node = workInProgress.child; null !== node; ) {
4683 if (5 === node.tag) {
4684 var instance = node.stateNode;
4685 needsVisibilityToggle &&
4686 isHidden &&
4687 (instance = cloneHiddenInstance(
4688 instance,
4689 node.type,
4690 node.memoizedProps,
4691 node
4692 ));
4693 appendChildNodeToSet(containerChildSet, instance.node);
4694 } else if (6 === node.tag) {
4695 instance = node.stateNode;
4696 if (needsVisibilityToggle && isHidden)
4697 throw Error("Not yet implemented.");
4698 appendChildNodeToSet(containerChildSet, instance.node);
4699 } else if (4 !== node.tag) {
4700 if (
4701 13 === node.tag &&
4702 0 !== (node.effectTag & 4) &&
4703 (instance = null !== node.memoizedState)
4704 ) {
4705 var primaryChildParent = node.child;
4706 if (
4707 null !== primaryChildParent &&
4708 (null !== primaryChildParent.child &&
4709 ((primaryChildParent.child.return = primaryChildParent),
4710 appendAllChildrenToContainer(
4711 containerChildSet,
4712 primaryChildParent,
4713 !0,
4714 instance
4715 )),
4716 (instance = primaryChildParent.sibling),
4717 null !== instance)
4718 ) {
4719 instance.return = node;
4720 node = instance;
4721 continue;
4722 }
4723 }
4724 if (null !== node.child) {
4725 node.child.return = node;
4726 node = node.child;
4727 continue;
4728 }
4729 }
4730 if (node === workInProgress) break;
4731 for (; null === node.sibling; ) {
4732 if (null === node.return || node.return === workInProgress) return;
4733 node = node.return;
4734 }
4735 node.sibling.return = node.return;
4736 node = node.sibling;
4737 }
4738}
4739updateHostContainer = function(workInProgress) {
4740 var portalOrRoot = workInProgress.stateNode;
4741 if (null !== workInProgress.firstEffect) {
4742 var container = portalOrRoot.containerInfo,
4743 newChildSet = createChildNodeSet(container);
4744 appendAllChildrenToContainer(newChildSet, workInProgress, !1, !1);
4745 portalOrRoot.pendingChildren = newChildSet;
4746 workInProgress.effectTag |= 4;
4747 completeRoot(container, newChildSet);
4748 }
4749};
4750updateHostComponent$1 = function(current, workInProgress, type, newProps) {
4751 type = current.stateNode;
4752 var oldProps = current.memoizedProps;
4753 if ((current = null === workInProgress.firstEffect) && oldProps === newProps)
4754 workInProgress.stateNode = type;
4755 else {
4756 var recyclableInstance = workInProgress.stateNode;
4757 requiredContext(contextStackCursor$1.current);
4758 var updatePayload = null;
4759 oldProps !== newProps &&
4760 ((oldProps = diffProperties(
4761 null,
4762 oldProps,
4763 newProps,
4764 recyclableInstance.canonical.viewConfig.validAttributes
4765 )),
4766 (recyclableInstance.canonical.currentProps = newProps),
4767 (updatePayload = oldProps));
4768 current && null === updatePayload
4769 ? (workInProgress.stateNode = type)
4770 : ((newProps = updatePayload),
4771 (recyclableInstance = type.node),
4772 (type = {
4773 node: current
4774 ? null !== newProps
4775 ? cloneNodeWithNewProps(recyclableInstance, newProps)
4776 : cloneNode(recyclableInstance)
4777 : null !== newProps
4778 ? cloneNodeWithNewChildrenAndProps(recyclableInstance, newProps)
4779 : cloneNodeWithNewChildren(recyclableInstance),
4780 canonical: type.canonical
4781 }),
4782 (workInProgress.stateNode = type),
4783 current
4784 ? (workInProgress.effectTag |= 4)
4785 : appendAllChildren(type, workInProgress, !1, !1));
4786 }
4787};
4788updateHostText$1 = function(current, workInProgress, oldText, newText) {
4789 oldText !== newText &&
4790 ((current = requiredContext(rootInstanceStackCursor.current)),
4791 (oldText = requiredContext(contextStackCursor$1.current)),
4792 (workInProgress.stateNode = createTextInstance(
4793 newText,
4794 current,
4795 oldText,
4796 workInProgress
4797 )),
4798 (workInProgress.effectTag |= 4));
4799};
4800function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {
4801 switch (renderState.tailMode) {
4802 case "hidden":
4803 hasRenderedATailFallback = renderState.tail;
4804 for (var lastTailNode = null; null !== hasRenderedATailFallback; )
4805 null !== hasRenderedATailFallback.alternate &&
4806 (lastTailNode = hasRenderedATailFallback),
4807 (hasRenderedATailFallback = hasRenderedATailFallback.sibling);
4808 null === lastTailNode
4809 ? (renderState.tail = null)
4810 : (lastTailNode.sibling = null);
4811 break;
4812 case "collapsed":
4813 lastTailNode = renderState.tail;
4814 for (var _lastTailNode = null; null !== lastTailNode; )
4815 null !== lastTailNode.alternate && (_lastTailNode = lastTailNode),
4816 (lastTailNode = lastTailNode.sibling);
4817 null === _lastTailNode
4818 ? hasRenderedATailFallback || null === renderState.tail
4819 ? (renderState.tail = null)
4820 : (renderState.tail.sibling = null)
4821 : (_lastTailNode.sibling = null);
4822 }
4823}
4824function unwindWork(workInProgress) {
4825 switch (workInProgress.tag) {
4826 case 1:
4827 isContextProvider(workInProgress.type) && popContext(workInProgress);
4828 var effectTag = workInProgress.effectTag;
4829 return effectTag & 2048
4830 ? ((workInProgress.effectTag = (effectTag & -2049) | 64),
4831 workInProgress)
4832 : null;
4833 case 3:
4834 popHostContainer(workInProgress);
4835 popTopLevelContextObject(workInProgress);
4836 effectTag = workInProgress.effectTag;
4837 if (0 !== (effectTag & 64))
4838 throw ReactError(
4839 Error(
4840 "The root failed to unmount after an error. This is likely a bug in React. Please file an issue."
4841 )
4842 );
4843 workInProgress.effectTag = (effectTag & -2049) | 64;
4844 return workInProgress;
4845 case 5:
4846 return popHostContext(workInProgress), null;
4847 case 13:
4848 return (
4849 pop(suspenseStackCursor, workInProgress),
4850 (effectTag = workInProgress.effectTag),
4851 effectTag & 2048
4852 ? ((workInProgress.effectTag = (effectTag & -2049) | 64),
4853 workInProgress)
4854 : null
4855 );
4856 case 18:
4857 return null;
4858 case 19:
4859 return pop(suspenseStackCursor, workInProgress), null;
4860 case 4:
4861 return popHostContainer(workInProgress), null;
4862 case 10:
4863 return popProvider(workInProgress), null;
4864 default:
4865 return null;
4866 }
4867}
4868function createCapturedValue(value, source) {
4869 return {
4870 value: value,
4871 source: source,
4872 stack: getStackByFiberInDevAndProd(source)
4873 };
4874}
4875if (
4876 "function" !==
4877 typeof ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog
4878)
4879 throw ReactError(
4880 Error("Expected ReactFiberErrorDialog.showErrorDialog to be a function.")
4881 );
4882function logCapturedError(capturedError) {
4883 !1 !==
4884 ReactNativePrivateInterface.ReactFiberErrorDialog.showErrorDialog(
4885 capturedError
4886 ) && console.error(capturedError.error);
4887}
4888var PossiblyWeakSet$1 = "function" === typeof WeakSet ? WeakSet : Set;
4889function logError(boundary, errorInfo) {
4890 var source = errorInfo.source,
4891 stack = errorInfo.stack;
4892 null === stack &&
4893 null !== source &&
4894 (stack = getStackByFiberInDevAndProd(source));
4895 errorInfo = {
4896 componentName: null !== source ? getComponentName(source.type) : null,
4897 componentStack: null !== stack ? stack : "",
4898 error: errorInfo.value,
4899 errorBoundary: null,
4900 errorBoundaryName: null,
4901 errorBoundaryFound: !1,
4902 willRetry: !1
4903 };
4904 null !== boundary &&
4905 1 === boundary.tag &&
4906 ((errorInfo.errorBoundary = boundary.stateNode),
4907 (errorInfo.errorBoundaryName = getComponentName(boundary.type)),
4908 (errorInfo.errorBoundaryFound = !0),
4909 (errorInfo.willRetry = !0));
4910 try {
4911 logCapturedError(errorInfo);
4912 } catch (e) {
4913 setTimeout(function() {
4914 throw e;
4915 });
4916 }
4917}
4918function safelyCallComponentWillUnmount(current$$1, instance) {
4919 try {
4920 (instance.props = current$$1.memoizedProps),
4921 (instance.state = current$$1.memoizedState),
4922 instance.componentWillUnmount();
4923 } catch (unmountError) {
4924 captureCommitPhaseError(current$$1, unmountError);
4925 }
4926}
4927function safelyDetachRef(current$$1) {
4928 var ref = current$$1.ref;
4929 if (null !== ref)
4930 if ("function" === typeof ref)
4931 try {
4932 ref(null);
4933 } catch (refError) {
4934 captureCommitPhaseError(current$$1, refError);
4935 }
4936 else ref.current = null;
4937}
4938function commitHookEffectList(unmountTag, mountTag, finishedWork) {
4939 finishedWork = finishedWork.updateQueue;
4940 finishedWork = null !== finishedWork ? finishedWork.lastEffect : null;
4941 if (null !== finishedWork) {
4942 var effect = (finishedWork = finishedWork.next);
4943 do {
4944 if ((effect.tag & unmountTag) !== NoEffect$1) {
4945 var destroy = effect.destroy;
4946 effect.destroy = void 0;
4947 void 0 !== destroy && destroy();
4948 }
4949 (effect.tag & mountTag) !== NoEffect$1 &&
4950 ((destroy = effect.create), (effect.destroy = destroy()));
4951 effect = effect.next;
4952 } while (effect !== finishedWork);
4953 }
4954}
4955function commitUnmount(current$$1$jscomp$0, renderPriorityLevel) {
4956 "function" === typeof onCommitFiberUnmount &&
4957 onCommitFiberUnmount(current$$1$jscomp$0);
4958 switch (current$$1$jscomp$0.tag) {
4959 case 0:
4960 case 11:
4961 case 14:
4962 case 15:
4963 var updateQueue = current$$1$jscomp$0.updateQueue;
4964 if (
4965 null !== updateQueue &&
4966 ((updateQueue = updateQueue.lastEffect), null !== updateQueue)
4967 ) {
4968 var firstEffect = updateQueue.next;
4969 runWithPriority$1(
4970 97 < renderPriorityLevel ? 97 : renderPriorityLevel,
4971 function() {
4972 var effect = firstEffect;
4973 do {
4974 var destroy = effect.destroy;
4975 if (void 0 !== destroy) {
4976 var current$$1 = current$$1$jscomp$0;
4977 try {
4978 destroy();
4979 } catch (error) {
4980 captureCommitPhaseError(current$$1, error);
4981 }
4982 }
4983 effect = effect.next;
4984 } while (effect !== firstEffect);
4985 }
4986 );
4987 }
4988 break;
4989 case 1:
4990 safelyDetachRef(current$$1$jscomp$0);
4991 renderPriorityLevel = current$$1$jscomp$0.stateNode;
4992 "function" === typeof renderPriorityLevel.componentWillUnmount &&
4993 safelyCallComponentWillUnmount(
4994 current$$1$jscomp$0,
4995 renderPriorityLevel
4996 );
4997 break;
4998 case 5:
4999 safelyDetachRef(current$$1$jscomp$0);
5000 break;
5001 case 4:
5002 createChildNodeSet(current$$1$jscomp$0.stateNode.containerInfo);
5003 }
5004}
5005function detachFiber(current$$1) {
5006 var alternate = current$$1.alternate;
5007 current$$1.return = null;
5008 current$$1.child = null;
5009 current$$1.memoizedState = null;
5010 current$$1.updateQueue = null;
5011 current$$1.dependencies = null;
5012 current$$1.alternate = null;
5013 current$$1.firstEffect = null;
5014 current$$1.lastEffect = null;
5015 current$$1.pendingProps = null;
5016 current$$1.memoizedProps = null;
5017 null !== alternate && detachFiber(alternate);
5018}
5019function commitWork(current$$1, finishedWork) {
5020 switch (finishedWork.tag) {
5021 case 0:
5022 case 11:
5023 case 14:
5024 case 15:
5025 commitHookEffectList(UnmountMutation, MountMutation, finishedWork);
5026 return;
5027 case 12:
5028 return;
5029 case 13:
5030 null !== finishedWork.memoizedState &&
5031 (globalMostRecentFallbackTime = now());
5032 attachSuspenseRetryListeners(finishedWork);
5033 return;
5034 case 19:
5035 attachSuspenseRetryListeners(finishedWork);
5036 return;
5037 }
5038 switch (finishedWork.tag) {
5039 case 1:
5040 case 5:
5041 case 6:
5042 case 20:
5043 break;
5044 case 3:
5045 case 4:
5046 break;
5047 default:
5048 throw ReactError(
5049 Error(
5050 "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
5051 )
5052 );
5053 }
5054}
5055function attachSuspenseRetryListeners(finishedWork) {
5056 var thenables = finishedWork.updateQueue;
5057 if (null !== thenables) {
5058 finishedWork.updateQueue = null;
5059 var retryCache = finishedWork.stateNode;
5060 null === retryCache &&
5061 (retryCache = finishedWork.stateNode = new PossiblyWeakSet$1());
5062 thenables.forEach(function(thenable) {
5063 var retry = resolveRetryThenable.bind(null, finishedWork, thenable);
5064 retryCache.has(thenable) ||
5065 (retryCache.add(thenable), thenable.then(retry, retry));
5066 });
5067 }
5068}
5069var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map;
5070function createRootErrorUpdate(fiber, errorInfo, expirationTime) {
5071 expirationTime = createUpdate(expirationTime, null);
5072 expirationTime.tag = 3;
5073 expirationTime.payload = { element: null };
5074 var error = errorInfo.value;
5075 expirationTime.callback = function() {
5076 hasUncaughtError || ((hasUncaughtError = !0), (firstUncaughtError = error));
5077 logError(fiber, errorInfo);
5078 };
5079 return expirationTime;
5080}
5081function createClassErrorUpdate(fiber, errorInfo, expirationTime) {
5082 expirationTime = createUpdate(expirationTime, null);
5083 expirationTime.tag = 3;
5084 var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
5085 if ("function" === typeof getDerivedStateFromError) {
5086 var error = errorInfo.value;
5087 expirationTime.payload = function() {
5088 logError(fiber, errorInfo);
5089 return getDerivedStateFromError(error);
5090 };
5091 }
5092 var inst = fiber.stateNode;
5093 null !== inst &&
5094 "function" === typeof inst.componentDidCatch &&
5095 (expirationTime.callback = function() {
5096 "function" !== typeof getDerivedStateFromError &&
5097 (null === legacyErrorBoundariesThatAlreadyFailed
5098 ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this]))
5099 : legacyErrorBoundariesThatAlreadyFailed.add(this),
5100 logError(fiber, errorInfo));
5101 var stack = errorInfo.stack;
5102 this.componentDidCatch(errorInfo.value, {
5103 componentStack: null !== stack ? stack : ""
5104 });
5105 });
5106 return expirationTime;
5107}
5108var ceil = Math.ceil,
5109 ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher,
5110 ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,
5111 NoContext = 0,
5112 LegacyUnbatchedContext = 8,
5113 RenderContext = 16,
5114 CommitContext = 32,
5115 RootIncomplete = 0,
5116 RootErrored = 1,
5117 RootSuspended = 2,
5118 RootSuspendedWithDelay = 3,
5119 RootCompleted = 4,
5120 executionContext = NoContext,
5121 workInProgressRoot = null,
5122 workInProgress = null,
5123 renderExpirationTime = 0,
5124 workInProgressRootExitStatus = RootIncomplete,
5125 workInProgressRootLatestProcessedExpirationTime = 1073741823,
5126 workInProgressRootLatestSuspenseTimeout = 1073741823,
5127 workInProgressRootCanSuspendUsingConfig = null,
5128 workInProgressRootHasPendingPing = !1,
5129 globalMostRecentFallbackTime = 0,
5130 FALLBACK_THROTTLE_MS = 500,
5131 nextEffect = null,
5132 hasUncaughtError = !1,
5133 firstUncaughtError = null,
5134 legacyErrorBoundariesThatAlreadyFailed = null,
5135 rootDoesHavePassiveEffects = !1,
5136 rootWithPendingPassiveEffects = null,
5137 pendingPassiveEffectsRenderPriority = 90,
5138 pendingPassiveEffectsExpirationTime = 0,
5139 rootsWithPendingDiscreteUpdates = null,
5140 nestedUpdateCount = 0,
5141 rootWithNestedUpdates = null,
5142 currentEventTime = 0;
5143function requestCurrentTime() {
5144 return (executionContext & (RenderContext | CommitContext)) !== NoContext
5145 ? 1073741821 - ((now() / 10) | 0)
5146 : 0 !== currentEventTime
5147 ? currentEventTime
5148 : (currentEventTime = 1073741821 - ((now() / 10) | 0));
5149}
5150function computeExpirationForFiber(currentTime, fiber, suspenseConfig) {
5151 fiber = fiber.mode;
5152 if (0 === (fiber & 2)) return 1073741823;
5153 var priorityLevel = getCurrentPriorityLevel();
5154 if (0 === (fiber & 4)) return 99 === priorityLevel ? 1073741823 : 1073741822;
5155 if ((executionContext & RenderContext) !== NoContext)
5156 return renderExpirationTime;
5157 if (null !== suspenseConfig)
5158 currentTime =
5159 1073741821 -
5160 25 *
5161 ((((1073741821 -
5162 currentTime +
5163 (suspenseConfig.timeoutMs | 0 || 5e3) / 10) /
5164 25) |
5165 0) +
5166 1);
5167 else
5168 switch (priorityLevel) {
5169 case 99:
5170 currentTime = 1073741823;
5171 break;
5172 case 98:
5173 currentTime =
5174 1073741821 - 10 * ((((1073741821 - currentTime + 15) / 10) | 0) + 1);
5175 break;
5176 case 97:
5177 case 96:
5178 currentTime =
5179 1073741821 - 25 * ((((1073741821 - currentTime + 500) / 25) | 0) + 1);
5180 break;
5181 case 95:
5182 currentTime = 1;
5183 break;
5184 default:
5185 throw ReactError(Error("Expected a valid priority level"));
5186 }
5187 null !== workInProgressRoot &&
5188 currentTime === renderExpirationTime &&
5189 --currentTime;
5190 return currentTime;
5191}
5192function scheduleUpdateOnFiber(fiber, expirationTime) {
5193 if (50 < nestedUpdateCount)
5194 throw ((nestedUpdateCount = 0),
5195 (rootWithNestedUpdates = null),
5196 ReactError(
5197 Error(
5198 "Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."
5199 )
5200 ));
5201 fiber = markUpdateTimeFromFiberToRoot(fiber, expirationTime);
5202 if (null !== fiber) {
5203 fiber.pingTime = 0;
5204 var priorityLevel = getCurrentPriorityLevel();
5205 if (1073741823 === expirationTime)
5206 if (
5207 (executionContext & LegacyUnbatchedContext) !== NoContext &&
5208 (executionContext & (RenderContext | CommitContext)) === NoContext
5209 )
5210 for (
5211 var callback = renderRoot(fiber, 1073741823, !0);
5212 null !== callback;
5213
5214 )
5215 callback = callback(!0);
5216 else
5217 scheduleCallbackForRoot(fiber, 99, 1073741823),
5218 executionContext === NoContext && flushSyncCallbackQueue();
5219 else scheduleCallbackForRoot(fiber, priorityLevel, expirationTime);
5220 (executionContext & 4) === NoContext ||
5221 (98 !== priorityLevel && 99 !== priorityLevel) ||
5222 (null === rootsWithPendingDiscreteUpdates
5223 ? (rootsWithPendingDiscreteUpdates = new Map([[fiber, expirationTime]]))
5224 : ((priorityLevel = rootsWithPendingDiscreteUpdates.get(fiber)),
5225 (void 0 === priorityLevel || priorityLevel > expirationTime) &&
5226 rootsWithPendingDiscreteUpdates.set(fiber, expirationTime)));
5227 }
5228}
5229function markUpdateTimeFromFiberToRoot(fiber, expirationTime) {
5230 fiber.expirationTime < expirationTime &&
5231 (fiber.expirationTime = expirationTime);
5232 var alternate = fiber.alternate;
5233 null !== alternate &&
5234 alternate.expirationTime < expirationTime &&
5235 (alternate.expirationTime = expirationTime);
5236 var node = fiber.return,
5237 root = null;
5238 if (null === node && 3 === fiber.tag) root = fiber.stateNode;
5239 else
5240 for (; null !== node; ) {
5241 alternate = node.alternate;
5242 node.childExpirationTime < expirationTime &&
5243 (node.childExpirationTime = expirationTime);
5244 null !== alternate &&
5245 alternate.childExpirationTime < expirationTime &&
5246 (alternate.childExpirationTime = expirationTime);
5247 if (null === node.return && 3 === node.tag) {
5248 root = node.stateNode;
5249 break;
5250 }
5251 node = node.return;
5252 }
5253 null !== root &&
5254 (expirationTime > root.firstPendingTime &&
5255 (root.firstPendingTime = expirationTime),
5256 (fiber = root.lastPendingTime),
5257 0 === fiber || expirationTime < fiber) &&
5258 (root.lastPendingTime = expirationTime);
5259 return root;
5260}
5261function scheduleCallbackForRoot(root, priorityLevel, expirationTime) {
5262 if (root.callbackExpirationTime < expirationTime) {
5263 var existingCallbackNode = root.callbackNode;
5264 null !== existingCallbackNode &&
5265 existingCallbackNode !== fakeCallbackNode &&
5266 Scheduler_cancelCallback(existingCallbackNode);
5267 root.callbackExpirationTime = expirationTime;
5268 1073741823 === expirationTime
5269 ? (root.callbackNode = scheduleSyncCallback(
5270 runRootCallback.bind(
5271 null,
5272 root,
5273 renderRoot.bind(null, root, expirationTime)
5274 )
5275 ))
5276 : ((existingCallbackNode = null),
5277 1 !== expirationTime &&
5278 (existingCallbackNode = {
5279 timeout: 10 * (1073741821 - expirationTime) - now()
5280 }),
5281 (root.callbackNode = scheduleCallback(
5282 priorityLevel,
5283 runRootCallback.bind(
5284 null,
5285 root,
5286 renderRoot.bind(null, root, expirationTime)
5287 ),
5288 existingCallbackNode
5289 )));
5290 }
5291}
5292function runRootCallback(root, callback, isSync) {
5293 var prevCallbackNode = root.callbackNode,
5294 continuation = null;
5295 try {
5296 return (
5297 (continuation = callback(isSync)),
5298 null !== continuation
5299 ? runRootCallback.bind(null, root, continuation)
5300 : null
5301 );
5302 } finally {
5303 null === continuation &&
5304 prevCallbackNode === root.callbackNode &&
5305 ((root.callbackNode = null), (root.callbackExpirationTime = 0));
5306 }
5307}
5308function resolveLocksOnRoot(root, expirationTime) {
5309 var firstBatch = root.firstBatch;
5310 return null !== firstBatch &&
5311 firstBatch._defer &&
5312 firstBatch._expirationTime >= expirationTime
5313 ? (scheduleCallback(97, function() {
5314 firstBatch._onComplete();
5315 return null;
5316 }),
5317 !0)
5318 : !1;
5319}
5320function flushPendingDiscreteUpdates() {
5321 if (null !== rootsWithPendingDiscreteUpdates) {
5322 var roots = rootsWithPendingDiscreteUpdates;
5323 rootsWithPendingDiscreteUpdates = null;
5324 roots.forEach(function(expirationTime, root) {
5325 scheduleSyncCallback(renderRoot.bind(null, root, expirationTime));
5326 });
5327 flushSyncCallbackQueue();
5328 }
5329}
5330function prepareFreshStack(root, expirationTime) {
5331 root.finishedWork = null;
5332 root.finishedExpirationTime = 0;
5333 var timeoutHandle = root.timeoutHandle;
5334 -1 !== timeoutHandle &&
5335 ((root.timeoutHandle = -1), cancelTimeout(timeoutHandle));
5336 if (null !== workInProgress)
5337 for (timeoutHandle = workInProgress.return; null !== timeoutHandle; ) {
5338 var interruptedWork = timeoutHandle;
5339 switch (interruptedWork.tag) {
5340 case 1:
5341 var childContextTypes = interruptedWork.type.childContextTypes;
5342 null !== childContextTypes &&
5343 void 0 !== childContextTypes &&
5344 popContext(interruptedWork);
5345 break;
5346 case 3:
5347 popHostContainer(interruptedWork);
5348 popTopLevelContextObject(interruptedWork);
5349 break;
5350 case 5:
5351 popHostContext(interruptedWork);
5352 break;
5353 case 4:
5354 popHostContainer(interruptedWork);
5355 break;
5356 case 13:
5357 pop(suspenseStackCursor, interruptedWork);
5358 break;
5359 case 19:
5360 pop(suspenseStackCursor, interruptedWork);
5361 break;
5362 case 10:
5363 popProvider(interruptedWork);
5364 }
5365 timeoutHandle = timeoutHandle.return;
5366 }
5367 workInProgressRoot = root;
5368 workInProgress = createWorkInProgress(root.current, null, expirationTime);
5369 renderExpirationTime = expirationTime;
5370 workInProgressRootExitStatus = RootIncomplete;
5371 workInProgressRootLatestSuspenseTimeout = workInProgressRootLatestProcessedExpirationTime = 1073741823;
5372 workInProgressRootCanSuspendUsingConfig = null;
5373 workInProgressRootHasPendingPing = !1;
5374}
5375function renderRoot(root$jscomp$0, expirationTime, isSync) {
5376 if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
5377 throw ReactError(Error("Should not already be working."));
5378 if (root$jscomp$0.firstPendingTime < expirationTime) return null;
5379 if (isSync && root$jscomp$0.finishedExpirationTime === expirationTime)
5380 return commitRoot.bind(null, root$jscomp$0);
5381 flushPassiveEffects();
5382 if (
5383 root$jscomp$0 !== workInProgressRoot ||
5384 expirationTime !== renderExpirationTime
5385 )
5386 prepareFreshStack(root$jscomp$0, expirationTime);
5387 else if (workInProgressRootExitStatus === RootSuspendedWithDelay)
5388 if (workInProgressRootHasPendingPing)
5389 prepareFreshStack(root$jscomp$0, expirationTime);
5390 else {
5391 var lastPendingTime = root$jscomp$0.lastPendingTime;
5392 if (lastPendingTime < expirationTime)
5393 return renderRoot.bind(null, root$jscomp$0, lastPendingTime);
5394 }
5395 if (null !== workInProgress) {
5396 lastPendingTime = executionContext;
5397 executionContext |= RenderContext;
5398 var prevDispatcher = ReactCurrentDispatcher.current;
5399 null === prevDispatcher && (prevDispatcher = ContextOnlyDispatcher);
5400 ReactCurrentDispatcher.current = ContextOnlyDispatcher;
5401 if (isSync) {
5402 if (1073741823 !== expirationTime) {
5403 var currentTime = requestCurrentTime();
5404 if (currentTime < expirationTime)
5405 return (
5406 (executionContext = lastPendingTime),
5407 resetContextDependencies(),
5408 (ReactCurrentDispatcher.current = prevDispatcher),
5409 renderRoot.bind(null, root$jscomp$0, currentTime)
5410 );
5411 }
5412 } else currentEventTime = 0;
5413 do
5414 try {
5415 if (isSync)
5416 for (; null !== workInProgress; )
5417 workInProgress = performUnitOfWork(workInProgress);
5418 else
5419 for (; null !== workInProgress && !Scheduler_shouldYield(); )
5420 workInProgress = performUnitOfWork(workInProgress);
5421 break;
5422 } catch (thrownValue) {
5423 resetContextDependencies();
5424 resetHooks();
5425 currentTime = workInProgress;
5426 if (null === currentTime || null === currentTime.return)
5427 throw (prepareFreshStack(root$jscomp$0, expirationTime),
5428 (executionContext = lastPendingTime),
5429 thrownValue);
5430 a: {
5431 var root = root$jscomp$0,
5432 returnFiber = currentTime.return,
5433 sourceFiber = currentTime,
5434 value = thrownValue,
5435 renderExpirationTime$jscomp$0 = renderExpirationTime;
5436 sourceFiber.effectTag |= 1024;
5437 sourceFiber.firstEffect = sourceFiber.lastEffect = null;
5438 if (
5439 null !== value &&
5440 "object" === typeof value &&
5441 "function" === typeof value.then
5442 ) {
5443 var thenable = value,
5444 hasInvisibleParentBoundary =
5445 0 !==
5446 (suspenseStackCursor.current & InvisibleParentSuspenseContext);
5447 value = returnFiber;
5448 do {
5449 var JSCompiler_temp;
5450 if ((JSCompiler_temp = 13 === value.tag))
5451 null !== value.memoizedState
5452 ? (JSCompiler_temp = !1)
5453 : ((JSCompiler_temp = value.memoizedProps),
5454 (JSCompiler_temp =
5455 void 0 === JSCompiler_temp.fallback
5456 ? !1
5457 : !0 !== JSCompiler_temp.unstable_avoidThisFallback
5458 ? !0
5459 : hasInvisibleParentBoundary
5460 ? !1
5461 : !0));
5462 if (JSCompiler_temp) {
5463 returnFiber = value.updateQueue;
5464 null === returnFiber
5465 ? ((returnFiber = new Set()),
5466 returnFiber.add(thenable),
5467 (value.updateQueue = returnFiber))
5468 : returnFiber.add(thenable);
5469 if (0 === (value.mode & 2)) {
5470 value.effectTag |= 64;
5471 sourceFiber.effectTag &= -1957;
5472 1 === sourceFiber.tag &&
5473 (null === sourceFiber.alternate
5474 ? (sourceFiber.tag = 17)
5475 : ((renderExpirationTime$jscomp$0 = createUpdate(
5476 1073741823,
5477 null
5478 )),
5479 (renderExpirationTime$jscomp$0.tag = 2),
5480 enqueueUpdate(
5481 sourceFiber,
5482 renderExpirationTime$jscomp$0
5483 )));
5484 sourceFiber.expirationTime = 1073741823;
5485 break a;
5486 }
5487 sourceFiber = root;
5488 root = renderExpirationTime$jscomp$0;
5489 hasInvisibleParentBoundary = sourceFiber.pingCache;
5490 null === hasInvisibleParentBoundary
5491 ? ((hasInvisibleParentBoundary = sourceFiber.pingCache = new PossiblyWeakMap()),
5492 (returnFiber = new Set()),
5493 hasInvisibleParentBoundary.set(thenable, returnFiber))
5494 : ((returnFiber = hasInvisibleParentBoundary.get(thenable)),
5495 void 0 === returnFiber &&
5496 ((returnFiber = new Set()),
5497 hasInvisibleParentBoundary.set(thenable, returnFiber)));
5498 returnFiber.has(root) ||
5499 (returnFiber.add(root),
5500 (sourceFiber = pingSuspendedRoot.bind(
5501 null,
5502 sourceFiber,
5503 thenable,
5504 root
5505 )),
5506 thenable.then(sourceFiber, sourceFiber));
5507 value.effectTag |= 2048;
5508 value.expirationTime = renderExpirationTime$jscomp$0;
5509 break a;
5510 }
5511 value = value.return;
5512 } while (null !== value);
5513 value = Error(
5514 (getComponentName(sourceFiber.type) || "A React component") +
5515 " suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display." +
5516 getStackByFiberInDevAndProd(sourceFiber)
5517 );
5518 }
5519 workInProgressRootExitStatus !== RootCompleted &&
5520 (workInProgressRootExitStatus = RootErrored);
5521 value = createCapturedValue(value, sourceFiber);
5522 sourceFiber = returnFiber;
5523 do {
5524 switch (sourceFiber.tag) {
5525 case 3:
5526 sourceFiber.effectTag |= 2048;
5527 sourceFiber.expirationTime = renderExpirationTime$jscomp$0;
5528 renderExpirationTime$jscomp$0 = createRootErrorUpdate(
5529 sourceFiber,
5530 value,
5531 renderExpirationTime$jscomp$0
5532 );
5533 enqueueCapturedUpdate(
5534 sourceFiber,
5535 renderExpirationTime$jscomp$0
5536 );
5537 break a;
5538 case 1:
5539 if (
5540 ((thenable = value),
5541 (root = sourceFiber.type),
5542 (returnFiber = sourceFiber.stateNode),
5543 0 === (sourceFiber.effectTag & 64) &&
5544 ("function" === typeof root.getDerivedStateFromError ||
5545 (null !== returnFiber &&
5546 "function" === typeof returnFiber.componentDidCatch &&
5547 (null === legacyErrorBoundariesThatAlreadyFailed ||
5548 !legacyErrorBoundariesThatAlreadyFailed.has(
5549 returnFiber
5550 )))))
5551 ) {
5552 sourceFiber.effectTag |= 2048;
5553 sourceFiber.expirationTime = renderExpirationTime$jscomp$0;
5554 renderExpirationTime$jscomp$0 = createClassErrorUpdate(
5555 sourceFiber,
5556 thenable,
5557 renderExpirationTime$jscomp$0
5558 );
5559 enqueueCapturedUpdate(
5560 sourceFiber,
5561 renderExpirationTime$jscomp$0
5562 );
5563 break a;
5564 }
5565 }
5566 sourceFiber = sourceFiber.return;
5567 } while (null !== sourceFiber);
5568 }
5569 workInProgress = completeUnitOfWork(currentTime);
5570 }
5571 while (1);
5572 executionContext = lastPendingTime;
5573 resetContextDependencies();
5574 ReactCurrentDispatcher.current = prevDispatcher;
5575 if (null !== workInProgress)
5576 return renderRoot.bind(null, root$jscomp$0, expirationTime);
5577 }
5578 root$jscomp$0.finishedWork = root$jscomp$0.current.alternate;
5579 root$jscomp$0.finishedExpirationTime = expirationTime;
5580 if (resolveLocksOnRoot(root$jscomp$0, expirationTime)) return null;
5581 workInProgressRoot = null;
5582 switch (workInProgressRootExitStatus) {
5583 case RootIncomplete:
5584 throw ReactError(Error("Should have a work-in-progress."));
5585 case RootErrored:
5586 return (
5587 (lastPendingTime = root$jscomp$0.lastPendingTime),
5588 lastPendingTime < expirationTime
5589 ? renderRoot.bind(null, root$jscomp$0, lastPendingTime)
5590 : isSync
5591 ? commitRoot.bind(null, root$jscomp$0)
5592 : (prepareFreshStack(root$jscomp$0, expirationTime),
5593 scheduleSyncCallback(
5594 renderRoot.bind(null, root$jscomp$0, expirationTime)
5595 ),
5596 null)
5597 );
5598 case RootSuspended:
5599 if (
5600 1073741823 === workInProgressRootLatestProcessedExpirationTime &&
5601 !isSync &&
5602 ((isSync = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now()),
5603 10 < isSync)
5604 ) {
5605 if (workInProgressRootHasPendingPing)
5606 return (
5607 prepareFreshStack(root$jscomp$0, expirationTime),
5608 renderRoot.bind(null, root$jscomp$0, expirationTime)
5609 );
5610 lastPendingTime = root$jscomp$0.lastPendingTime;
5611 if (lastPendingTime < expirationTime)
5612 return renderRoot.bind(null, root$jscomp$0, lastPendingTime);
5613 root$jscomp$0.timeoutHandle = scheduleTimeout(
5614 commitRoot.bind(null, root$jscomp$0),
5615 isSync
5616 );
5617 return null;
5618 }
5619 return commitRoot.bind(null, root$jscomp$0);
5620 case RootSuspendedWithDelay:
5621 if (!isSync) {
5622 if (workInProgressRootHasPendingPing)
5623 return (
5624 prepareFreshStack(root$jscomp$0, expirationTime),
5625 renderRoot.bind(null, root$jscomp$0, expirationTime)
5626 );
5627 isSync = root$jscomp$0.lastPendingTime;
5628 if (isSync < expirationTime)
5629 return renderRoot.bind(null, root$jscomp$0, isSync);
5630 1073741823 !== workInProgressRootLatestSuspenseTimeout
5631 ? (isSync =
5632 10 * (1073741821 - workInProgressRootLatestSuspenseTimeout) -
5633 now())
5634 : 1073741823 === workInProgressRootLatestProcessedExpirationTime
5635 ? (isSync = 0)
5636 : ((isSync =
5637 10 *
5638 (1073741821 -
5639 workInProgressRootLatestProcessedExpirationTime) -
5640 5e3),
5641 (lastPendingTime = now()),
5642 (expirationTime =
5643 10 * (1073741821 - expirationTime) - lastPendingTime),
5644 (isSync = lastPendingTime - isSync),
5645 0 > isSync && (isSync = 0),
5646 (isSync =
5647 (120 > isSync
5648 ? 120
5649 : 480 > isSync
5650 ? 480
5651 : 1080 > isSync
5652 ? 1080
5653 : 1920 > isSync
5654 ? 1920
5655 : 3e3 > isSync
5656 ? 3e3
5657 : 4320 > isSync
5658 ? 4320
5659 : 1960 * ceil(isSync / 1960)) - isSync),
5660 expirationTime < isSync && (isSync = expirationTime));
5661 if (10 < isSync)
5662 return (
5663 (root$jscomp$0.timeoutHandle = scheduleTimeout(
5664 commitRoot.bind(null, root$jscomp$0),
5665 isSync
5666 )),
5667 null
5668 );
5669 }
5670 return commitRoot.bind(null, root$jscomp$0);
5671 case RootCompleted:
5672 return !isSync &&
5673 1073741823 !== workInProgressRootLatestProcessedExpirationTime &&
5674 null !== workInProgressRootCanSuspendUsingConfig &&
5675 ((lastPendingTime = workInProgressRootLatestProcessedExpirationTime),
5676 (prevDispatcher = workInProgressRootCanSuspendUsingConfig),
5677 (expirationTime = prevDispatcher.busyMinDurationMs | 0),
5678 0 >= expirationTime
5679 ? (expirationTime = 0)
5680 : ((isSync = prevDispatcher.busyDelayMs | 0),
5681 (lastPendingTime =
5682 now() -
5683 (10 * (1073741821 - lastPendingTime) -
5684 (prevDispatcher.timeoutMs | 0 || 5e3))),
5685 (expirationTime =
5686 lastPendingTime <= isSync
5687 ? 0
5688 : isSync + expirationTime - lastPendingTime)),
5689 10 < expirationTime)
5690 ? ((root$jscomp$0.timeoutHandle = scheduleTimeout(
5691 commitRoot.bind(null, root$jscomp$0),
5692 expirationTime
5693 )),
5694 null)
5695 : commitRoot.bind(null, root$jscomp$0);
5696 default:
5697 throw ReactError(Error("Unknown root exit status."));
5698 }
5699}
5700function markRenderEventTimeAndConfig(expirationTime, suspenseConfig) {
5701 expirationTime < workInProgressRootLatestProcessedExpirationTime &&
5702 1 < expirationTime &&
5703 (workInProgressRootLatestProcessedExpirationTime = expirationTime);
5704 null !== suspenseConfig &&
5705 expirationTime < workInProgressRootLatestSuspenseTimeout &&
5706 1 < expirationTime &&
5707 ((workInProgressRootLatestSuspenseTimeout = expirationTime),
5708 (workInProgressRootCanSuspendUsingConfig = suspenseConfig));
5709}
5710function performUnitOfWork(unitOfWork) {
5711 var next = beginWork$$1(
5712 unitOfWork.alternate,
5713 unitOfWork,
5714 renderExpirationTime
5715 );
5716 unitOfWork.memoizedProps = unitOfWork.pendingProps;
5717 null === next && (next = completeUnitOfWork(unitOfWork));
5718 ReactCurrentOwner$2.current = null;
5719 return next;
5720}
5721function completeUnitOfWork(unitOfWork) {
5722 workInProgress = unitOfWork;
5723 do {
5724 var current$$1 = workInProgress.alternate;
5725 unitOfWork = workInProgress.return;
5726 if (0 === (workInProgress.effectTag & 1024)) {
5727 a: {
5728 var current = current$$1;
5729 current$$1 = workInProgress;
5730 var renderExpirationTime$jscomp$0 = renderExpirationTime,
5731 newProps = current$$1.pendingProps;
5732 switch (current$$1.tag) {
5733 case 2:
5734 break;
5735 case 16:
5736 break;
5737 case 15:
5738 case 0:
5739 break;
5740 case 1:
5741 isContextProvider(current$$1.type) && popContext(current$$1);
5742 break;
5743 case 3:
5744 popHostContainer(current$$1);
5745 popTopLevelContextObject(current$$1);
5746 renderExpirationTime$jscomp$0 = current$$1.stateNode;
5747 renderExpirationTime$jscomp$0.pendingContext &&
5748 ((renderExpirationTime$jscomp$0.context =
5749 renderExpirationTime$jscomp$0.pendingContext),
5750 (renderExpirationTime$jscomp$0.pendingContext = null));
5751 if (null === current || null === current.child)
5752 current$$1.effectTag &= -3;
5753 updateHostContainer(current$$1);
5754 break;
5755 case 5:
5756 popHostContext(current$$1);
5757 renderExpirationTime$jscomp$0 = requiredContext(
5758 rootInstanceStackCursor.current
5759 );
5760 var type = current$$1.type;
5761 if (null !== current && null != current$$1.stateNode)
5762 updateHostComponent$1(
5763 current,
5764 current$$1,
5765 type,
5766 newProps,
5767 renderExpirationTime$jscomp$0
5768 ),
5769 current.ref !== current$$1.ref && (current$$1.effectTag |= 128);
5770 else if (newProps) {
5771 requiredContext(contextStackCursor$1.current);
5772 current = newProps;
5773 var rootContainerInstance = renderExpirationTime$jscomp$0;
5774 renderExpirationTime$jscomp$0 = current$$1;
5775 newProps = nextReactTag;
5776 nextReactTag += 2;
5777 type = getViewConfigForType(type);
5778 var updatePayload = diffProperties(
5779 null,
5780 emptyObject,
5781 current,
5782 type.validAttributes
5783 );
5784 rootContainerInstance = createNode(
5785 newProps,
5786 type.uiViewClassName,
5787 rootContainerInstance,
5788 updatePayload,
5789 renderExpirationTime$jscomp$0
5790 );
5791 current = new ReactFabricHostComponent(
5792 newProps,
5793 type,
5794 current,
5795 renderExpirationTime$jscomp$0
5796 );
5797 current = { node: rootContainerInstance, canonical: current };
5798 appendAllChildren(current, current$$1, !1, !1);
5799 current$$1.stateNode = current;
5800 null !== current$$1.ref && (current$$1.effectTag |= 128);
5801 } else if (null === current$$1.stateNode)
5802 throw ReactError(
5803 Error(
5804 "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
5805 )
5806 );
5807 break;
5808 case 6:
5809 if (current && null != current$$1.stateNode)
5810 updateHostText$1(
5811 current,
5812 current$$1,
5813 current.memoizedProps,
5814 newProps
5815 );
5816 else {
5817 if ("string" !== typeof newProps && null === current$$1.stateNode)
5818 throw ReactError(
5819 Error(
5820 "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
5821 )
5822 );
5823 current = requiredContext(rootInstanceStackCursor.current);
5824 renderExpirationTime$jscomp$0 = requiredContext(
5825 contextStackCursor$1.current
5826 );
5827 current$$1.stateNode = createTextInstance(
5828 newProps,
5829 current,
5830 renderExpirationTime$jscomp$0,
5831 current$$1
5832 );
5833 }
5834 break;
5835 case 11:
5836 break;
5837 case 13:
5838 pop(suspenseStackCursor, current$$1);
5839 newProps = current$$1.memoizedState;
5840 if (0 !== (current$$1.effectTag & 64)) {
5841 current$$1.expirationTime = renderExpirationTime$jscomp$0;
5842 break a;
5843 }
5844 renderExpirationTime$jscomp$0 = null !== newProps;
5845 newProps = !1;
5846 null !== current &&
5847 ((type = current.memoizedState),
5848 (newProps = null !== type),
5849 renderExpirationTime$jscomp$0 ||
5850 null === type ||
5851 ((type = current.child.sibling),
5852 null !== type &&
5853 ((rootContainerInstance = current$$1.firstEffect),
5854 null !== rootContainerInstance
5855 ? ((current$$1.firstEffect = type),
5856 (type.nextEffect = rootContainerInstance))
5857 : ((current$$1.firstEffect = current$$1.lastEffect = type),
5858 (type.nextEffect = null)),
5859 (type.effectTag = 8))));
5860 if (
5861 renderExpirationTime$jscomp$0 &&
5862 !newProps &&
5863 0 !== (current$$1.mode & 2)
5864 )
5865 if (
5866 (null === current &&
5867 !0 !== current$$1.memoizedProps.unstable_avoidThisFallback) ||
5868 0 !==
5869 (suspenseStackCursor.current & InvisibleParentSuspenseContext)
5870 )
5871 workInProgressRootExitStatus === RootIncomplete &&
5872 (workInProgressRootExitStatus = RootSuspended);
5873 else if (
5874 workInProgressRootExitStatus === RootIncomplete ||
5875 workInProgressRootExitStatus === RootSuspended
5876 )
5877 workInProgressRootExitStatus = RootSuspendedWithDelay;
5878 renderExpirationTime$jscomp$0 && (current$$1.effectTag |= 4);
5879 break;
5880 case 7:
5881 break;
5882 case 8:
5883 break;
5884 case 12:
5885 break;
5886 case 4:
5887 popHostContainer(current$$1);
5888 updateHostContainer(current$$1);
5889 break;
5890 case 10:
5891 popProvider(current$$1);
5892 break;
5893 case 9:
5894 break;
5895 case 14:
5896 break;
5897 case 17:
5898 isContextProvider(current$$1.type) && popContext(current$$1);
5899 break;
5900 case 18:
5901 break;
5902 case 19:
5903 pop(suspenseStackCursor, current$$1);
5904 newProps = current$$1.memoizedState;
5905 if (null === newProps) break;
5906 type = 0 !== (current$$1.effectTag & 64);
5907 rootContainerInstance = newProps.rendering;
5908 if (null === rootContainerInstance)
5909 if (type) cutOffTailIfNeeded(newProps, !1);
5910 else {
5911 if (
5912 workInProgressRootExitStatus !== RootIncomplete ||
5913 (null !== current && 0 !== (current.effectTag & 64))
5914 )
5915 for (current = current$$1.child; null !== current; ) {
5916 rootContainerInstance = findFirstSuspended(current);
5917 if (null !== rootContainerInstance) {
5918 current$$1.effectTag |= 64;
5919 cutOffTailIfNeeded(newProps, !1);
5920 current = rootContainerInstance.updateQueue;
5921 null !== current &&
5922 ((current$$1.updateQueue = current),
5923 (current$$1.effectTag |= 4));
5924 current$$1.firstEffect = current$$1.lastEffect = null;
5925 current = renderExpirationTime$jscomp$0;
5926 for (
5927 renderExpirationTime$jscomp$0 = current$$1.child;
5928 null !== renderExpirationTime$jscomp$0;
5929
5930 )
5931 (newProps = renderExpirationTime$jscomp$0),
5932 (type = current),
5933 (newProps.effectTag &= 2),
5934 (newProps.nextEffect = null),
5935 (newProps.firstEffect = null),
5936 (newProps.lastEffect = null),
5937 (rootContainerInstance = newProps.alternate),
5938 null === rootContainerInstance
5939 ? ((newProps.childExpirationTime = 0),
5940 (newProps.expirationTime = type),
5941 (newProps.child = null),
5942 (newProps.memoizedProps = null),
5943 (newProps.memoizedState = null),
5944 (newProps.updateQueue = null),
5945 (newProps.dependencies = null))
5946 : ((newProps.childExpirationTime =
5947 rootContainerInstance.childExpirationTime),
5948 (newProps.expirationTime =
5949 rootContainerInstance.expirationTime),
5950 (newProps.child = rootContainerInstance.child),
5951 (newProps.memoizedProps =
5952 rootContainerInstance.memoizedProps),
5953 (newProps.memoizedState =
5954 rootContainerInstance.memoizedState),
5955 (newProps.updateQueue =
5956 rootContainerInstance.updateQueue),
5957 (type = rootContainerInstance.dependencies),
5958 (newProps.dependencies =
5959 null === type
5960 ? null
5961 : {
5962 expirationTime: type.expirationTime,
5963 firstContext: type.firstContext,
5964 responders: type.responders
5965 })),
5966 (renderExpirationTime$jscomp$0 =
5967 renderExpirationTime$jscomp$0.sibling);
5968 push(
5969 suspenseStackCursor,
5970 (suspenseStackCursor.current &
5971 SubtreeSuspenseContextMask) |
5972 ForceSuspenseFallback,
5973 current$$1
5974 );
5975 current$$1 = current$$1.child;
5976 break a;
5977 }
5978 current = current.sibling;
5979 }
5980 }
5981 else {
5982 if (!type)
5983 if (
5984 ((current = findFirstSuspended(rootContainerInstance)),
5985 null !== current)
5986 ) {
5987 if (
5988 ((current$$1.effectTag |= 64),
5989 (type = !0),
5990 cutOffTailIfNeeded(newProps, !0),
5991 null === newProps.tail && "hidden" === newProps.tailMode)
5992 ) {
5993 current = current.updateQueue;
5994 null !== current &&
5995 ((current$$1.updateQueue = current),
5996 (current$$1.effectTag |= 4));
5997 current$$1 = current$$1.lastEffect = newProps.lastEffect;
5998 null !== current$$1 && (current$$1.nextEffect = null);
5999 break;
6000 }
6001 } else
6002 now() > newProps.tailExpiration &&
6003 1 < renderExpirationTime$jscomp$0 &&
6004 ((current$$1.effectTag |= 64),
6005 (type = !0),
6006 cutOffTailIfNeeded(newProps, !1),
6007 (current$$1.expirationTime = current$$1.childExpirationTime =
6008 renderExpirationTime$jscomp$0 - 1));
6009 newProps.isBackwards
6010 ? ((rootContainerInstance.sibling = current$$1.child),
6011 (current$$1.child = rootContainerInstance))
6012 : ((current = newProps.last),
6013 null !== current
6014 ? (current.sibling = rootContainerInstance)
6015 : (current$$1.child = rootContainerInstance),
6016 (newProps.last = rootContainerInstance));
6017 }
6018 if (null !== newProps.tail) {
6019 0 === newProps.tailExpiration &&
6020 (newProps.tailExpiration = now() + 500);
6021 current = newProps.tail;
6022 newProps.rendering = current;
6023 newProps.tail = current.sibling;
6024 newProps.lastEffect = current$$1.lastEffect;
6025 current.sibling = null;
6026 renderExpirationTime$jscomp$0 = suspenseStackCursor.current;
6027 renderExpirationTime$jscomp$0 = type
6028 ? (renderExpirationTime$jscomp$0 & SubtreeSuspenseContextMask) |
6029 ForceSuspenseFallback
6030 : renderExpirationTime$jscomp$0 & SubtreeSuspenseContextMask;
6031 push(
6032 suspenseStackCursor,
6033 renderExpirationTime$jscomp$0,
6034 current$$1
6035 );
6036 current$$1 = current;
6037 break a;
6038 }
6039 break;
6040 case 20:
6041 break;
6042 default:
6043 throw ReactError(
6044 Error(
6045 "Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
6046 )
6047 );
6048 }
6049 current$$1 = null;
6050 }
6051 current = workInProgress;
6052 if (1 === renderExpirationTime || 1 !== current.childExpirationTime) {
6053 renderExpirationTime$jscomp$0 = 0;
6054 for (newProps = current.child; null !== newProps; )
6055 (type = newProps.expirationTime),
6056 (rootContainerInstance = newProps.childExpirationTime),
6057 type > renderExpirationTime$jscomp$0 &&
6058 (renderExpirationTime$jscomp$0 = type),
6059 rootContainerInstance > renderExpirationTime$jscomp$0 &&
6060 (renderExpirationTime$jscomp$0 = rootContainerInstance),
6061 (newProps = newProps.sibling);
6062 current.childExpirationTime = renderExpirationTime$jscomp$0;
6063 }
6064 if (null !== current$$1) return current$$1;
6065 null !== unitOfWork &&
6066 0 === (unitOfWork.effectTag & 1024) &&
6067 (null === unitOfWork.firstEffect &&
6068 (unitOfWork.firstEffect = workInProgress.firstEffect),
6069 null !== workInProgress.lastEffect &&
6070 (null !== unitOfWork.lastEffect &&
6071 (unitOfWork.lastEffect.nextEffect = workInProgress.firstEffect),
6072 (unitOfWork.lastEffect = workInProgress.lastEffect)),
6073 1 < workInProgress.effectTag &&
6074 (null !== unitOfWork.lastEffect
6075 ? (unitOfWork.lastEffect.nextEffect = workInProgress)
6076 : (unitOfWork.firstEffect = workInProgress),
6077 (unitOfWork.lastEffect = workInProgress)));
6078 } else {
6079 current$$1 = unwindWork(workInProgress, renderExpirationTime);
6080 if (null !== current$$1)
6081 return (current$$1.effectTag &= 1023), current$$1;
6082 null !== unitOfWork &&
6083 ((unitOfWork.firstEffect = unitOfWork.lastEffect = null),
6084 (unitOfWork.effectTag |= 1024));
6085 }
6086 current$$1 = workInProgress.sibling;
6087 if (null !== current$$1) return current$$1;
6088 workInProgress = unitOfWork;
6089 } while (null !== workInProgress);
6090 workInProgressRootExitStatus === RootIncomplete &&
6091 (workInProgressRootExitStatus = RootCompleted);
6092 return null;
6093}
6094function commitRoot(root) {
6095 var renderPriorityLevel = getCurrentPriorityLevel();
6096 runWithPriority$1(99, commitRootImpl.bind(null, root, renderPriorityLevel));
6097 null !== rootWithPendingPassiveEffects &&
6098 scheduleCallback(97, function() {
6099 flushPassiveEffects();
6100 return null;
6101 });
6102 return null;
6103}
6104function commitRootImpl(root, renderPriorityLevel) {
6105 flushPassiveEffects();
6106 if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
6107 throw ReactError(Error("Should not already be working."));
6108 var finishedWork = root.finishedWork,
6109 expirationTime = root.finishedExpirationTime;
6110 if (null === finishedWork) return null;
6111 root.finishedWork = null;
6112 root.finishedExpirationTime = 0;
6113 if (finishedWork === root.current)
6114 throw ReactError(
6115 Error(
6116 "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."
6117 )
6118 );
6119 root.callbackNode = null;
6120 root.callbackExpirationTime = 0;
6121 var updateExpirationTimeBeforeCommit = finishedWork.expirationTime,
6122 childExpirationTimeBeforeCommit = finishedWork.childExpirationTime;
6123 updateExpirationTimeBeforeCommit =
6124 childExpirationTimeBeforeCommit > updateExpirationTimeBeforeCommit
6125 ? childExpirationTimeBeforeCommit
6126 : updateExpirationTimeBeforeCommit;
6127 root.firstPendingTime = updateExpirationTimeBeforeCommit;
6128 updateExpirationTimeBeforeCommit < root.lastPendingTime &&
6129 (root.lastPendingTime = updateExpirationTimeBeforeCommit);
6130 root === workInProgressRoot &&
6131 ((workInProgress = workInProgressRoot = null), (renderExpirationTime = 0));
6132 1 < finishedWork.effectTag
6133 ? null !== finishedWork.lastEffect
6134 ? ((finishedWork.lastEffect.nextEffect = finishedWork),
6135 (updateExpirationTimeBeforeCommit = finishedWork.firstEffect))
6136 : (updateExpirationTimeBeforeCommit = finishedWork)
6137 : (updateExpirationTimeBeforeCommit = finishedWork.firstEffect);
6138 if (null !== updateExpirationTimeBeforeCommit) {
6139 childExpirationTimeBeforeCommit = executionContext;
6140 executionContext |= CommitContext;
6141 ReactCurrentOwner$2.current = null;
6142 nextEffect = updateExpirationTimeBeforeCommit;
6143 do
6144 try {
6145 for (; null !== nextEffect; ) {
6146 if (0 !== (nextEffect.effectTag & 256)) {
6147 var current$$1 = nextEffect.alternate,
6148 finishedWork$jscomp$0 = nextEffect;
6149 switch (finishedWork$jscomp$0.tag) {
6150 case 0:
6151 case 11:
6152 case 15:
6153 commitHookEffectList(
6154 UnmountSnapshot,
6155 NoEffect$1,
6156 finishedWork$jscomp$0
6157 );
6158 break;
6159 case 1:
6160 if (
6161 finishedWork$jscomp$0.effectTag & 256 &&
6162 null !== current$$1
6163 ) {
6164 var prevProps = current$$1.memoizedProps,
6165 prevState = current$$1.memoizedState,
6166 instance = finishedWork$jscomp$0.stateNode,
6167 snapshot = instance.getSnapshotBeforeUpdate(
6168 finishedWork$jscomp$0.elementType ===
6169 finishedWork$jscomp$0.type
6170 ? prevProps
6171 : resolveDefaultProps(
6172 finishedWork$jscomp$0.type,
6173 prevProps
6174 ),
6175 prevState
6176 );
6177 instance.__reactInternalSnapshotBeforeUpdate = snapshot;
6178 }
6179 break;
6180 case 3:
6181 case 5:
6182 case 6:
6183 case 4:
6184 case 17:
6185 break;
6186 default:
6187 throw ReactError(
6188 Error(
6189 "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
6190 )
6191 );
6192 }
6193 }
6194 nextEffect = nextEffect.nextEffect;
6195 }
6196 } catch (error) {
6197 if (null === nextEffect)
6198 throw ReactError(Error("Should be working on an effect."));
6199 captureCommitPhaseError(nextEffect, error);
6200 nextEffect = nextEffect.nextEffect;
6201 }
6202 while (null !== nextEffect);
6203 nextEffect = updateExpirationTimeBeforeCommit;
6204 do
6205 try {
6206 for (current$$1 = renderPriorityLevel; null !== nextEffect; ) {
6207 var effectTag = nextEffect.effectTag;
6208 if (effectTag & 128) {
6209 var current$$1$jscomp$0 = nextEffect.alternate;
6210 if (null !== current$$1$jscomp$0) {
6211 var currentRef = current$$1$jscomp$0.ref;
6212 null !== currentRef &&
6213 ("function" === typeof currentRef
6214 ? currentRef(null)
6215 : (currentRef.current = null));
6216 }
6217 }
6218 switch (effectTag & 14) {
6219 case 2:
6220 nextEffect.effectTag &= -3;
6221 break;
6222 case 6:
6223 nextEffect.effectTag &= -3;
6224 commitWork(nextEffect.alternate, nextEffect);
6225 break;
6226 case 4:
6227 commitWork(nextEffect.alternate, nextEffect);
6228 break;
6229 case 8:
6230 prevProps = nextEffect;
6231 a: for (
6232 prevState = prevProps,
6233 instance = current$$1,
6234 snapshot = prevState;
6235 ;
6236
6237 )
6238 if (
6239 (commitUnmount(snapshot, instance), null !== snapshot.child)
6240 )
6241 (snapshot.child.return = snapshot),
6242 (snapshot = snapshot.child);
6243 else {
6244 if (snapshot === prevState) break;
6245 for (; null === snapshot.sibling; ) {
6246 if (
6247 null === snapshot.return ||
6248 snapshot.return === prevState
6249 )
6250 break a;
6251 snapshot = snapshot.return;
6252 }
6253 snapshot.sibling.return = snapshot.return;
6254 snapshot = snapshot.sibling;
6255 }
6256 detachFiber(prevProps);
6257 }
6258 nextEffect = nextEffect.nextEffect;
6259 }
6260 } catch (error) {
6261 if (null === nextEffect)
6262 throw ReactError(Error("Should be working on an effect."));
6263 captureCommitPhaseError(nextEffect, error);
6264 nextEffect = nextEffect.nextEffect;
6265 }
6266 while (null !== nextEffect);
6267 root.current = finishedWork;
6268 nextEffect = updateExpirationTimeBeforeCommit;
6269 do
6270 try {
6271 for (effectTag = expirationTime; null !== nextEffect; ) {
6272 var effectTag$jscomp$0 = nextEffect.effectTag;
6273 if (effectTag$jscomp$0 & 36) {
6274 var current$$1$jscomp$1 = nextEffect.alternate;
6275 current$$1$jscomp$0 = nextEffect;
6276 currentRef = effectTag;
6277 switch (current$$1$jscomp$0.tag) {
6278 case 0:
6279 case 11:
6280 case 15:
6281 commitHookEffectList(
6282 UnmountLayout,
6283 MountLayout,
6284 current$$1$jscomp$0
6285 );
6286 break;
6287 case 1:
6288 var instance$jscomp$0 = current$$1$jscomp$0.stateNode;
6289 if (current$$1$jscomp$0.effectTag & 4)
6290 if (null === current$$1$jscomp$1)
6291 instance$jscomp$0.componentDidMount();
6292 else {
6293 var prevProps$jscomp$0 =
6294 current$$1$jscomp$0.elementType ===
6295 current$$1$jscomp$0.type
6296 ? current$$1$jscomp$1.memoizedProps
6297 : resolveDefaultProps(
6298 current$$1$jscomp$0.type,
6299 current$$1$jscomp$1.memoizedProps
6300 );
6301 instance$jscomp$0.componentDidUpdate(
6302 prevProps$jscomp$0,
6303 current$$1$jscomp$1.memoizedState,
6304 instance$jscomp$0.__reactInternalSnapshotBeforeUpdate
6305 );
6306 }
6307 var updateQueue = current$$1$jscomp$0.updateQueue;
6308 null !== updateQueue &&
6309 commitUpdateQueue(
6310 current$$1$jscomp$0,
6311 updateQueue,
6312 instance$jscomp$0,
6313 currentRef
6314 );
6315 break;
6316 case 3:
6317 var _updateQueue = current$$1$jscomp$0.updateQueue;
6318 if (null !== _updateQueue) {
6319 current$$1 = null;
6320 if (null !== current$$1$jscomp$0.child)
6321 switch (current$$1$jscomp$0.child.tag) {
6322 case 5:
6323 current$$1 =
6324 current$$1$jscomp$0.child.stateNode.canonical;
6325 break;
6326 case 1:
6327 current$$1 = current$$1$jscomp$0.child.stateNode;
6328 }
6329 commitUpdateQueue(
6330 current$$1$jscomp$0,
6331 _updateQueue,
6332 current$$1,
6333 currentRef
6334 );
6335 }
6336 break;
6337 case 5:
6338 if (
6339 null === current$$1$jscomp$1 &&
6340 current$$1$jscomp$0.effectTag & 4
6341 )
6342 throw ReactError(
6343 Error(
6344 "The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue."
6345 )
6346 );
6347 break;
6348 case 6:
6349 break;
6350 case 4:
6351 break;
6352 case 12:
6353 break;
6354 case 13:
6355 case 19:
6356 case 17:
6357 case 20:
6358 break;
6359 default:
6360 throw ReactError(
6361 Error(
6362 "This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."
6363 )
6364 );
6365 }
6366 }
6367 if (effectTag$jscomp$0 & 128) {
6368 var ref = nextEffect.ref;
6369 if (null !== ref) {
6370 var instance$jscomp$1 = nextEffect.stateNode;
6371 switch (nextEffect.tag) {
6372 case 5:
6373 var instanceToUse = instance$jscomp$1.canonical;
6374 break;
6375 default:
6376 instanceToUse = instance$jscomp$1;
6377 }
6378 "function" === typeof ref
6379 ? ref(instanceToUse)
6380 : (ref.current = instanceToUse);
6381 }
6382 }
6383 effectTag$jscomp$0 & 512 && (rootDoesHavePassiveEffects = !0);
6384 nextEffect = nextEffect.nextEffect;
6385 }
6386 } catch (error) {
6387 if (null === nextEffect)
6388 throw ReactError(Error("Should be working on an effect."));
6389 captureCommitPhaseError(nextEffect, error);
6390 nextEffect = nextEffect.nextEffect;
6391 }
6392 while (null !== nextEffect);
6393 nextEffect = null;
6394 requestPaint();
6395 executionContext = childExpirationTimeBeforeCommit;
6396 } else root.current = finishedWork;
6397 if (rootDoesHavePassiveEffects)
6398 (rootDoesHavePassiveEffects = !1),
6399 (rootWithPendingPassiveEffects = root),
6400 (pendingPassiveEffectsExpirationTime = expirationTime),
6401 (pendingPassiveEffectsRenderPriority = renderPriorityLevel);
6402 else
6403 for (nextEffect = updateExpirationTimeBeforeCommit; null !== nextEffect; )
6404 (renderPriorityLevel = nextEffect.nextEffect),
6405 (nextEffect.nextEffect = null),
6406 (nextEffect = renderPriorityLevel);
6407 renderPriorityLevel = root.firstPendingTime;
6408 0 !== renderPriorityLevel
6409 ? ((effectTag$jscomp$0 = requestCurrentTime()),
6410 (effectTag$jscomp$0 = inferPriorityFromExpirationTime(
6411 effectTag$jscomp$0,
6412 renderPriorityLevel
6413 )),
6414 scheduleCallbackForRoot(root, effectTag$jscomp$0, renderPriorityLevel))
6415 : (legacyErrorBoundariesThatAlreadyFailed = null);
6416 "function" === typeof onCommitFiberRoot &&
6417 onCommitFiberRoot(finishedWork.stateNode, expirationTime);
6418 1073741823 === renderPriorityLevel
6419 ? root === rootWithNestedUpdates
6420 ? nestedUpdateCount++
6421 : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))
6422 : (nestedUpdateCount = 0);
6423 if (hasUncaughtError)
6424 throw ((hasUncaughtError = !1),
6425 (root = firstUncaughtError),
6426 (firstUncaughtError = null),
6427 root);
6428 if ((executionContext & LegacyUnbatchedContext) !== NoContext) return null;
6429 flushSyncCallbackQueue();
6430 return null;
6431}
6432function flushPassiveEffects() {
6433 if (null === rootWithPendingPassiveEffects) return !1;
6434 var root = rootWithPendingPassiveEffects,
6435 expirationTime = pendingPassiveEffectsExpirationTime,
6436 renderPriorityLevel = pendingPassiveEffectsRenderPriority;
6437 rootWithPendingPassiveEffects = null;
6438 pendingPassiveEffectsExpirationTime = 0;
6439 pendingPassiveEffectsRenderPriority = 90;
6440 return runWithPriority$1(
6441 97 < renderPriorityLevel ? 97 : renderPriorityLevel,
6442 flushPassiveEffectsImpl.bind(null, root, expirationTime)
6443 );
6444}
6445function flushPassiveEffectsImpl(root) {
6446 if ((executionContext & (RenderContext | CommitContext)) !== NoContext)
6447 throw ReactError(
6448 Error("Cannot flush passive effects while already rendering.")
6449 );
6450 var prevExecutionContext = executionContext;
6451 executionContext |= CommitContext;
6452 for (root = root.current.firstEffect; null !== root; ) {
6453 try {
6454 var finishedWork = root;
6455 if (0 !== (finishedWork.effectTag & 512))
6456 switch (finishedWork.tag) {
6457 case 0:
6458 case 11:
6459 case 15:
6460 commitHookEffectList(UnmountPassive, NoEffect$1, finishedWork),
6461 commitHookEffectList(NoEffect$1, MountPassive, finishedWork);
6462 }
6463 } catch (error) {
6464 if (null === root)
6465 throw ReactError(Error("Should be working on an effect."));
6466 captureCommitPhaseError(root, error);
6467 }
6468 finishedWork = root.nextEffect;
6469 root.nextEffect = null;
6470 root = finishedWork;
6471 }
6472 executionContext = prevExecutionContext;
6473 flushSyncCallbackQueue();
6474 return !0;
6475}
6476function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {
6477 sourceFiber = createCapturedValue(error, sourceFiber);
6478 sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1073741823);
6479 enqueueUpdate(rootFiber, sourceFiber);
6480 rootFiber = markUpdateTimeFromFiberToRoot(rootFiber, 1073741823);
6481 null !== rootFiber && scheduleCallbackForRoot(rootFiber, 99, 1073741823);
6482}
6483function captureCommitPhaseError(sourceFiber, error) {
6484 if (3 === sourceFiber.tag)
6485 captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);
6486 else
6487 for (var fiber = sourceFiber.return; null !== fiber; ) {
6488 if (3 === fiber.tag) {
6489 captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);
6490 break;
6491 } else if (1 === fiber.tag) {
6492 var instance = fiber.stateNode;
6493 if (
6494 "function" === typeof fiber.type.getDerivedStateFromError ||
6495 ("function" === typeof instance.componentDidCatch &&
6496 (null === legacyErrorBoundariesThatAlreadyFailed ||
6497 !legacyErrorBoundariesThatAlreadyFailed.has(instance)))
6498 ) {
6499 sourceFiber = createCapturedValue(error, sourceFiber);
6500 sourceFiber = createClassErrorUpdate(fiber, sourceFiber, 1073741823);
6501 enqueueUpdate(fiber, sourceFiber);
6502 fiber = markUpdateTimeFromFiberToRoot(fiber, 1073741823);
6503 null !== fiber && scheduleCallbackForRoot(fiber, 99, 1073741823);
6504 break;
6505 }
6506 }
6507 fiber = fiber.return;
6508 }
6509}
6510function pingSuspendedRoot(root, thenable, suspendedTime) {
6511 var pingCache = root.pingCache;
6512 null !== pingCache && pingCache.delete(thenable);
6513 workInProgressRoot === root && renderExpirationTime === suspendedTime
6514 ? workInProgressRootExitStatus === RootSuspendedWithDelay ||
6515 (workInProgressRootExitStatus === RootSuspended &&
6516 1073741823 === workInProgressRootLatestProcessedExpirationTime &&
6517 now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS)
6518 ? prepareFreshStack(root, renderExpirationTime)
6519 : (workInProgressRootHasPendingPing = !0)
6520 : root.lastPendingTime < suspendedTime ||
6521 ((thenable = root.pingTime),
6522 (0 !== thenable && thenable < suspendedTime) ||
6523 ((root.pingTime = suspendedTime),
6524 root.finishedExpirationTime === suspendedTime &&
6525 ((root.finishedExpirationTime = 0), (root.finishedWork = null)),
6526 (thenable = requestCurrentTime()),
6527 (thenable = inferPriorityFromExpirationTime(thenable, suspendedTime)),
6528 scheduleCallbackForRoot(root, thenable, suspendedTime)));
6529}
6530function resolveRetryThenable(boundaryFiber, thenable) {
6531 var retryCache = boundaryFiber.stateNode;
6532 null !== retryCache && retryCache.delete(thenable);
6533 retryCache = requestCurrentTime();
6534 thenable = computeExpirationForFiber(retryCache, boundaryFiber, null);
6535 retryCache = inferPriorityFromExpirationTime(retryCache, thenable);
6536 boundaryFiber = markUpdateTimeFromFiberToRoot(boundaryFiber, thenable);
6537 null !== boundaryFiber &&
6538 scheduleCallbackForRoot(boundaryFiber, retryCache, thenable);
6539}
6540var beginWork$$1 = void 0;
6541beginWork$$1 = function(current$$1, workInProgress, renderExpirationTime) {
6542 var updateExpirationTime = workInProgress.expirationTime;
6543 if (null !== current$$1)
6544 if (
6545 current$$1.memoizedProps !== workInProgress.pendingProps ||
6546 didPerformWorkStackCursor.current
6547 )
6548 didReceiveUpdate = !0;
6549 else {
6550 if (updateExpirationTime < renderExpirationTime) {
6551 didReceiveUpdate = !1;
6552 switch (workInProgress.tag) {
6553 case 3:
6554 pushHostRootContext(workInProgress);
6555 break;
6556 case 5:
6557 pushHostContext(workInProgress);
6558 break;
6559 case 1:
6560 isContextProvider(workInProgress.type) &&
6561 pushContextProvider(workInProgress);
6562 break;
6563 case 4:
6564 pushHostContainer(
6565 workInProgress,
6566 workInProgress.stateNode.containerInfo
6567 );
6568 break;
6569 case 10:
6570 pushProvider(workInProgress, workInProgress.memoizedProps.value);
6571 break;
6572 case 13:
6573 if (null !== workInProgress.memoizedState) {
6574 updateExpirationTime = workInProgress.child.childExpirationTime;
6575 if (
6576 0 !== updateExpirationTime &&
6577 updateExpirationTime >= renderExpirationTime
6578 )
6579 return updateSuspenseComponent(
6580 current$$1,
6581 workInProgress,
6582 renderExpirationTime
6583 );
6584 push(
6585 suspenseStackCursor,
6586 suspenseStackCursor.current & SubtreeSuspenseContextMask,
6587 workInProgress
6588 );
6589 workInProgress = bailoutOnAlreadyFinishedWork(
6590 current$$1,
6591 workInProgress,
6592 renderExpirationTime
6593 );
6594 return null !== workInProgress ? workInProgress.sibling : null;
6595 }
6596 push(
6597 suspenseStackCursor,
6598 suspenseStackCursor.current & SubtreeSuspenseContextMask,
6599 workInProgress
6600 );
6601 break;
6602 case 19:
6603 updateExpirationTime =
6604 workInProgress.childExpirationTime >= renderExpirationTime;
6605 if (0 !== (current$$1.effectTag & 64)) {
6606 if (updateExpirationTime)
6607 return updateSuspenseListComponent(
6608 current$$1,
6609 workInProgress,
6610 renderExpirationTime
6611 );
6612 workInProgress.effectTag |= 64;
6613 }
6614 var renderState = workInProgress.memoizedState;
6615 null !== renderState &&
6616 ((renderState.rendering = null), (renderState.tail = null));
6617 push(
6618 suspenseStackCursor,
6619 suspenseStackCursor.current,
6620 workInProgress
6621 );
6622 if (!updateExpirationTime) return null;
6623 }
6624 return bailoutOnAlreadyFinishedWork(
6625 current$$1,
6626 workInProgress,
6627 renderExpirationTime
6628 );
6629 }
6630 }
6631 else didReceiveUpdate = !1;
6632 workInProgress.expirationTime = 0;
6633 switch (workInProgress.tag) {
6634 case 2:
6635 updateExpirationTime = workInProgress.type;
6636 null !== current$$1 &&
6637 ((current$$1.alternate = null),
6638 (workInProgress.alternate = null),
6639 (workInProgress.effectTag |= 2));
6640 current$$1 = workInProgress.pendingProps;
6641 renderState = getMaskedContext(
6642 workInProgress,
6643 contextStackCursor.current
6644 );
6645 prepareToReadContext(workInProgress, renderExpirationTime);
6646 renderState = renderWithHooks(
6647 null,
6648 workInProgress,
6649 updateExpirationTime,
6650 current$$1,
6651 renderState,
6652 renderExpirationTime
6653 );
6654 workInProgress.effectTag |= 1;
6655 if (
6656 "object" === typeof renderState &&
6657 null !== renderState &&
6658 "function" === typeof renderState.render &&
6659 void 0 === renderState.$$typeof
6660 ) {
6661 workInProgress.tag = 1;
6662 resetHooks();
6663 if (isContextProvider(updateExpirationTime)) {
6664 var hasContext = !0;
6665 pushContextProvider(workInProgress);
6666 } else hasContext = !1;
6667 workInProgress.memoizedState =
6668 null !== renderState.state && void 0 !== renderState.state
6669 ? renderState.state
6670 : null;
6671 var getDerivedStateFromProps =
6672 updateExpirationTime.getDerivedStateFromProps;
6673 "function" === typeof getDerivedStateFromProps &&
6674 applyDerivedStateFromProps(
6675 workInProgress,
6676 updateExpirationTime,
6677 getDerivedStateFromProps,
6678 current$$1
6679 );
6680 renderState.updater = classComponentUpdater;
6681 workInProgress.stateNode = renderState;
6682 renderState._reactInternalFiber = workInProgress;
6683 mountClassInstance(
6684 workInProgress,
6685 updateExpirationTime,
6686 current$$1,
6687 renderExpirationTime
6688 );
6689 workInProgress = finishClassComponent(
6690 null,
6691 workInProgress,
6692 updateExpirationTime,
6693 !0,
6694 hasContext,
6695 renderExpirationTime
6696 );
6697 } else
6698 (workInProgress.tag = 0),
6699 reconcileChildren(
6700 null,
6701 workInProgress,
6702 renderState,
6703 renderExpirationTime
6704 ),
6705 (workInProgress = workInProgress.child);
6706 return workInProgress;
6707 case 16:
6708 renderState = workInProgress.elementType;
6709 null !== current$$1 &&
6710 ((current$$1.alternate = null),
6711 (workInProgress.alternate = null),
6712 (workInProgress.effectTag |= 2));
6713 current$$1 = workInProgress.pendingProps;
6714 renderState = readLazyComponentType(renderState);
6715 workInProgress.type = renderState;
6716 hasContext = workInProgress.tag = resolveLazyComponentTag(renderState);
6717 current$$1 = resolveDefaultProps(renderState, current$$1);
6718 switch (hasContext) {
6719 case 0:
6720 workInProgress = updateFunctionComponent(
6721 null,
6722 workInProgress,
6723 renderState,
6724 current$$1,
6725 renderExpirationTime
6726 );
6727 break;
6728 case 1:
6729 workInProgress = updateClassComponent(
6730 null,
6731 workInProgress,
6732 renderState,
6733 current$$1,
6734 renderExpirationTime
6735 );
6736 break;
6737 case 11:
6738 workInProgress = updateForwardRef(
6739 null,
6740 workInProgress,
6741 renderState,
6742 current$$1,
6743 renderExpirationTime
6744 );
6745 break;
6746 case 14:
6747 workInProgress = updateMemoComponent(
6748 null,
6749 workInProgress,
6750 renderState,
6751 resolveDefaultProps(renderState.type, current$$1),
6752 updateExpirationTime,
6753 renderExpirationTime
6754 );
6755 break;
6756 default:
6757 throw ReactError(
6758 Error(
6759 "Element type is invalid. Received a promise that resolves to: " +
6760 renderState +
6761 ". Lazy element type must resolve to a class or function."
6762 )
6763 );
6764 }
6765 return workInProgress;
6766 case 0:
6767 return (
6768 (updateExpirationTime = workInProgress.type),
6769 (renderState = workInProgress.pendingProps),
6770 (renderState =
6771 workInProgress.elementType === updateExpirationTime
6772 ? renderState
6773 : resolveDefaultProps(updateExpirationTime, renderState)),
6774 updateFunctionComponent(
6775 current$$1,
6776 workInProgress,
6777 updateExpirationTime,
6778 renderState,
6779 renderExpirationTime
6780 )
6781 );
6782 case 1:
6783 return (
6784 (updateExpirationTime = workInProgress.type),
6785 (renderState = workInProgress.pendingProps),
6786 (renderState =
6787 workInProgress.elementType === updateExpirationTime
6788 ? renderState
6789 : resolveDefaultProps(updateExpirationTime, renderState)),
6790 updateClassComponent(
6791 current$$1,
6792 workInProgress,
6793 updateExpirationTime,
6794 renderState,
6795 renderExpirationTime
6796 )
6797 );
6798 case 3:
6799 pushHostRootContext(workInProgress);
6800 updateExpirationTime = workInProgress.updateQueue;
6801 if (null === updateExpirationTime)
6802 throw ReactError(
6803 Error(
6804 "If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue."
6805 )
6806 );
6807 renderState = workInProgress.memoizedState;
6808 renderState = null !== renderState ? renderState.element : null;
6809 processUpdateQueue(
6810 workInProgress,
6811 updateExpirationTime,
6812 workInProgress.pendingProps,
6813 null,
6814 renderExpirationTime
6815 );
6816 updateExpirationTime = workInProgress.memoizedState.element;
6817 updateExpirationTime === renderState
6818 ? (workInProgress = bailoutOnAlreadyFinishedWork(
6819 current$$1,
6820 workInProgress,
6821 renderExpirationTime
6822 ))
6823 : (reconcileChildren(
6824 current$$1,
6825 workInProgress,
6826 updateExpirationTime,
6827 renderExpirationTime
6828 ),
6829 (workInProgress = workInProgress.child));
6830 return workInProgress;
6831 case 5:
6832 return (
6833 pushHostContext(workInProgress),
6834 null === current$$1 && tryToClaimNextHydratableInstance(workInProgress),
6835 (updateExpirationTime = workInProgress.pendingProps.children),
6836 markRef(current$$1, workInProgress),
6837 reconcileChildren(
6838 current$$1,
6839 workInProgress,
6840 updateExpirationTime,
6841 renderExpirationTime
6842 ),
6843 workInProgress.child
6844 );
6845 case 6:
6846 return (
6847 null === current$$1 && tryToClaimNextHydratableInstance(workInProgress),
6848 null
6849 );
6850 case 13:
6851 return updateSuspenseComponent(
6852 current$$1,
6853 workInProgress,
6854 renderExpirationTime
6855 );
6856 case 4:
6857 return (
6858 pushHostContainer(
6859 workInProgress,
6860 workInProgress.stateNode.containerInfo
6861 ),
6862 (updateExpirationTime = workInProgress.pendingProps),
6863 null === current$$1
6864 ? (workInProgress.child = reconcileChildFibers(
6865 workInProgress,
6866 null,
6867 updateExpirationTime,
6868 renderExpirationTime
6869 ))
6870 : reconcileChildren(
6871 current$$1,
6872 workInProgress,
6873 updateExpirationTime,
6874 renderExpirationTime
6875 ),
6876 workInProgress.child
6877 );
6878 case 11:
6879 return (
6880 (updateExpirationTime = workInProgress.type),
6881 (renderState = workInProgress.pendingProps),
6882 (renderState =
6883 workInProgress.elementType === updateExpirationTime
6884 ? renderState
6885 : resolveDefaultProps(updateExpirationTime, renderState)),
6886 updateForwardRef(
6887 current$$1,
6888 workInProgress,
6889 updateExpirationTime,
6890 renderState,
6891 renderExpirationTime
6892 )
6893 );
6894 case 7:
6895 return (
6896 reconcileChildren(
6897 current$$1,
6898 workInProgress,
6899 workInProgress.pendingProps,
6900 renderExpirationTime
6901 ),
6902 workInProgress.child
6903 );
6904 case 8:
6905 return (
6906 reconcileChildren(
6907 current$$1,
6908 workInProgress,
6909 workInProgress.pendingProps.children,
6910 renderExpirationTime
6911 ),
6912 workInProgress.child
6913 );
6914 case 12:
6915 return (
6916 reconcileChildren(
6917 current$$1,
6918 workInProgress,
6919 workInProgress.pendingProps.children,
6920 renderExpirationTime
6921 ),
6922 workInProgress.child
6923 );
6924 case 10:
6925 a: {
6926 updateExpirationTime = workInProgress.type._context;
6927 renderState = workInProgress.pendingProps;
6928 getDerivedStateFromProps = workInProgress.memoizedProps;
6929 hasContext = renderState.value;
6930 pushProvider(workInProgress, hasContext);
6931 if (null !== getDerivedStateFromProps) {
6932 var oldValue = getDerivedStateFromProps.value;
6933 hasContext = is(oldValue, hasContext)
6934 ? 0
6935 : ("function" === typeof updateExpirationTime._calculateChangedBits
6936 ? updateExpirationTime._calculateChangedBits(
6937 oldValue,
6938 hasContext
6939 )
6940 : 1073741823) | 0;
6941 if (0 === hasContext) {
6942 if (
6943 getDerivedStateFromProps.children === renderState.children &&
6944 !didPerformWorkStackCursor.current
6945 ) {
6946 workInProgress = bailoutOnAlreadyFinishedWork(
6947 current$$1,
6948 workInProgress,
6949 renderExpirationTime
6950 );
6951 break a;
6952 }
6953 } else
6954 for (
6955 oldValue = workInProgress.child,
6956 null !== oldValue && (oldValue.return = workInProgress);
6957 null !== oldValue;
6958
6959 ) {
6960 var list = oldValue.dependencies;
6961 if (null !== list) {
6962 getDerivedStateFromProps = oldValue.child;
6963 for (
6964 var dependency = list.firstContext;
6965 null !== dependency;
6966
6967 ) {
6968 if (
6969 dependency.context === updateExpirationTime &&
6970 0 !== (dependency.observedBits & hasContext)
6971 ) {
6972 1 === oldValue.tag &&
6973 ((dependency = createUpdate(renderExpirationTime, null)),
6974 (dependency.tag = 2),
6975 enqueueUpdate(oldValue, dependency));
6976 oldValue.expirationTime < renderExpirationTime &&
6977 (oldValue.expirationTime = renderExpirationTime);
6978 dependency = oldValue.alternate;
6979 null !== dependency &&
6980 dependency.expirationTime < renderExpirationTime &&
6981 (dependency.expirationTime = renderExpirationTime);
6982 scheduleWorkOnParentPath(
6983 oldValue.return,
6984 renderExpirationTime
6985 );
6986 list.expirationTime < renderExpirationTime &&
6987 (list.expirationTime = renderExpirationTime);
6988 break;
6989 }
6990 dependency = dependency.next;
6991 }
6992 } else
6993 getDerivedStateFromProps =
6994 10 === oldValue.tag
6995 ? oldValue.type === workInProgress.type
6996 ? null
6997 : oldValue.child
6998 : oldValue.child;
6999 if (null !== getDerivedStateFromProps)
7000 getDerivedStateFromProps.return = oldValue;
7001 else
7002 for (
7003 getDerivedStateFromProps = oldValue;
7004 null !== getDerivedStateFromProps;
7005
7006 ) {
7007 if (getDerivedStateFromProps === workInProgress) {
7008 getDerivedStateFromProps = null;
7009 break;
7010 }
7011 oldValue = getDerivedStateFromProps.sibling;
7012 if (null !== oldValue) {
7013 oldValue.return = getDerivedStateFromProps.return;
7014 getDerivedStateFromProps = oldValue;
7015 break;
7016 }
7017 getDerivedStateFromProps = getDerivedStateFromProps.return;
7018 }
7019 oldValue = getDerivedStateFromProps;
7020 }
7021 }
7022 reconcileChildren(
7023 current$$1,
7024 workInProgress,
7025 renderState.children,
7026 renderExpirationTime
7027 );
7028 workInProgress = workInProgress.child;
7029 }
7030 return workInProgress;
7031 case 9:
7032 return (
7033 (renderState = workInProgress.type),
7034 (hasContext = workInProgress.pendingProps),
7035 (updateExpirationTime = hasContext.children),
7036 prepareToReadContext(workInProgress, renderExpirationTime),
7037 (renderState = readContext(
7038 renderState,
7039 hasContext.unstable_observedBits
7040 )),
7041 (updateExpirationTime = updateExpirationTime(renderState)),
7042 (workInProgress.effectTag |= 1),
7043 reconcileChildren(
7044 current$$1,
7045 workInProgress,
7046 updateExpirationTime,
7047 renderExpirationTime
7048 ),
7049 workInProgress.child
7050 );
7051 case 14:
7052 return (
7053 (renderState = workInProgress.type),
7054 (hasContext = resolveDefaultProps(
7055 renderState,
7056 workInProgress.pendingProps
7057 )),
7058 (hasContext = resolveDefaultProps(renderState.type, hasContext)),
7059 updateMemoComponent(
7060 current$$1,
7061 workInProgress,
7062 renderState,
7063 hasContext,
7064 updateExpirationTime,
7065 renderExpirationTime
7066 )
7067 );
7068 case 15:
7069 return updateSimpleMemoComponent(
7070 current$$1,
7071 workInProgress,
7072 workInProgress.type,
7073 workInProgress.pendingProps,
7074 updateExpirationTime,
7075 renderExpirationTime
7076 );
7077 case 17:
7078 return (
7079 (updateExpirationTime = workInProgress.type),
7080 (renderState = workInProgress.pendingProps),
7081 (renderState =
7082 workInProgress.elementType === updateExpirationTime
7083 ? renderState
7084 : resolveDefaultProps(updateExpirationTime, renderState)),
7085 null !== current$$1 &&
7086 ((current$$1.alternate = null),
7087 (workInProgress.alternate = null),
7088 (workInProgress.effectTag |= 2)),
7089 (workInProgress.tag = 1),
7090 isContextProvider(updateExpirationTime)
7091 ? ((current$$1 = !0), pushContextProvider(workInProgress))
7092 : (current$$1 = !1),
7093 prepareToReadContext(workInProgress, renderExpirationTime),
7094 constructClassInstance(
7095 workInProgress,
7096 updateExpirationTime,
7097 renderState,
7098 renderExpirationTime
7099 ),
7100 mountClassInstance(
7101 workInProgress,
7102 updateExpirationTime,
7103 renderState,
7104 renderExpirationTime
7105 ),
7106 finishClassComponent(
7107 null,
7108 workInProgress,
7109 updateExpirationTime,
7110 !0,
7111 current$$1,
7112 renderExpirationTime
7113 )
7114 );
7115 case 19:
7116 return updateSuspenseListComponent(
7117 current$$1,
7118 workInProgress,
7119 renderExpirationTime
7120 );
7121 }
7122 throw ReactError(
7123 Error(
7124 "Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue."
7125 )
7126 );
7127};
7128var onCommitFiberRoot = null,
7129 onCommitFiberUnmount = null;
7130function injectInternals(internals) {
7131 if ("undefined" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) return !1;
7132 var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;
7133 if (hook.isDisabled || !hook.supportsFiber) return !0;
7134 try {
7135 var rendererID = hook.inject(internals);
7136 onCommitFiberRoot = function(root) {
7137 try {
7138 hook.onCommitFiberRoot(
7139 rendererID,
7140 root,
7141 void 0,
7142 64 === (root.current.effectTag & 64)
7143 );
7144 } catch (err) {}
7145 };
7146 onCommitFiberUnmount = function(fiber) {
7147 try {
7148 hook.onCommitFiberUnmount(rendererID, fiber);
7149 } catch (err) {}
7150 };
7151 } catch (err) {}
7152 return !0;
7153}
7154function FiberNode(tag, pendingProps, key, mode) {
7155 this.tag = tag;
7156 this.key = key;
7157 this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null;
7158 this.index = 0;
7159 this.ref = null;
7160 this.pendingProps = pendingProps;
7161 this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null;
7162 this.mode = mode;
7163 this.effectTag = 0;
7164 this.lastEffect = this.firstEffect = this.nextEffect = null;
7165 this.childExpirationTime = this.expirationTime = 0;
7166 this.alternate = null;
7167}
7168function createFiber(tag, pendingProps, key, mode) {
7169 return new FiberNode(tag, pendingProps, key, mode);
7170}
7171function shouldConstruct(Component) {
7172 Component = Component.prototype;
7173 return !(!Component || !Component.isReactComponent);
7174}
7175function resolveLazyComponentTag(Component) {
7176 if ("function" === typeof Component)
7177 return shouldConstruct(Component) ? 1 : 0;
7178 if (void 0 !== Component && null !== Component) {
7179 Component = Component.$$typeof;
7180 if (Component === REACT_FORWARD_REF_TYPE) return 11;
7181 if (Component === REACT_MEMO_TYPE) return 14;
7182 }
7183 return 2;
7184}
7185function createWorkInProgress(current, pendingProps) {
7186 var workInProgress = current.alternate;
7187 null === workInProgress
7188 ? ((workInProgress = createFiber(
7189 current.tag,
7190 pendingProps,
7191 current.key,
7192 current.mode
7193 )),
7194 (workInProgress.elementType = current.elementType),
7195 (workInProgress.type = current.type),
7196 (workInProgress.stateNode = current.stateNode),
7197 (workInProgress.alternate = current),
7198 (current.alternate = workInProgress))
7199 : ((workInProgress.pendingProps = pendingProps),
7200 (workInProgress.effectTag = 0),
7201 (workInProgress.nextEffect = null),
7202 (workInProgress.firstEffect = null),
7203 (workInProgress.lastEffect = null));
7204 workInProgress.childExpirationTime = current.childExpirationTime;
7205 workInProgress.expirationTime = current.expirationTime;
7206 workInProgress.child = current.child;
7207 workInProgress.memoizedProps = current.memoizedProps;
7208 workInProgress.memoizedState = current.memoizedState;
7209 workInProgress.updateQueue = current.updateQueue;
7210 pendingProps = current.dependencies;
7211 workInProgress.dependencies =
7212 null === pendingProps
7213 ? null
7214 : {
7215 expirationTime: pendingProps.expirationTime,
7216 firstContext: pendingProps.firstContext,
7217 responders: pendingProps.responders
7218 };
7219 workInProgress.sibling = current.sibling;
7220 workInProgress.index = current.index;
7221 workInProgress.ref = current.ref;
7222 return workInProgress;
7223}
7224function createFiberFromTypeAndProps(
7225 type,
7226 key,
7227 pendingProps,
7228 owner,
7229 mode,
7230 expirationTime
7231) {
7232 var fiberTag = 2;
7233 owner = type;
7234 if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);
7235 else if ("string" === typeof type) fiberTag = 5;
7236 else
7237 a: switch (type) {
7238 case REACT_FRAGMENT_TYPE:
7239 return createFiberFromFragment(
7240 pendingProps.children,
7241 mode,
7242 expirationTime,
7243 key
7244 );
7245 case REACT_CONCURRENT_MODE_TYPE:
7246 fiberTag = 8;
7247 mode |= 7;
7248 break;
7249 case REACT_STRICT_MODE_TYPE:
7250 fiberTag = 8;
7251 mode |= 1;
7252 break;
7253 case REACT_PROFILER_TYPE:
7254 return (
7255 (type = createFiber(12, pendingProps, key, mode | 8)),
7256 (type.elementType = REACT_PROFILER_TYPE),
7257 (type.type = REACT_PROFILER_TYPE),
7258 (type.expirationTime = expirationTime),
7259 type
7260 );
7261 case REACT_SUSPENSE_TYPE:
7262 return (
7263 (type = createFiber(13, pendingProps, key, mode)),
7264 (type.type = REACT_SUSPENSE_TYPE),
7265 (type.elementType = REACT_SUSPENSE_TYPE),
7266 (type.expirationTime = expirationTime),
7267 type
7268 );
7269 case REACT_SUSPENSE_LIST_TYPE:
7270 return (
7271 (type = createFiber(19, pendingProps, key, mode)),
7272 (type.elementType = REACT_SUSPENSE_LIST_TYPE),
7273 (type.expirationTime = expirationTime),
7274 type
7275 );
7276 default:
7277 if ("object" === typeof type && null !== type)
7278 switch (type.$$typeof) {
7279 case REACT_PROVIDER_TYPE:
7280 fiberTag = 10;
7281 break a;
7282 case REACT_CONTEXT_TYPE:
7283 fiberTag = 9;
7284 break a;
7285 case REACT_FORWARD_REF_TYPE:
7286 fiberTag = 11;
7287 break a;
7288 case REACT_MEMO_TYPE:
7289 fiberTag = 14;
7290 break a;
7291 case REACT_LAZY_TYPE:
7292 fiberTag = 16;
7293 owner = null;
7294 break a;
7295 }
7296 throw ReactError(
7297 Error(
7298 "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
7299 (null == type ? type : typeof type) +
7300 "."
7301 )
7302 );
7303 }
7304 key = createFiber(fiberTag, pendingProps, key, mode);
7305 key.elementType = type;
7306 key.type = owner;
7307 key.expirationTime = expirationTime;
7308 return key;
7309}
7310function createFiberFromFragment(elements, mode, expirationTime, key) {
7311 elements = createFiber(7, elements, key, mode);
7312 elements.expirationTime = expirationTime;
7313 return elements;
7314}
7315function createFiberFromText(content, mode, expirationTime) {
7316 content = createFiber(6, content, null, mode);
7317 content.expirationTime = expirationTime;
7318 return content;
7319}
7320function createFiberFromPortal(portal, mode, expirationTime) {
7321 mode = createFiber(
7322 4,
7323 null !== portal.children ? portal.children : [],
7324 portal.key,
7325 mode
7326 );
7327 mode.expirationTime = expirationTime;
7328 mode.stateNode = {
7329 containerInfo: portal.containerInfo,
7330 pendingChildren: null,
7331 implementation: portal.implementation
7332 };
7333 return mode;
7334}
7335function FiberRootNode(containerInfo, tag, hydrate) {
7336 this.tag = tag;
7337 this.current = null;
7338 this.containerInfo = containerInfo;
7339 this.pingCache = this.pendingChildren = null;
7340 this.finishedExpirationTime = 0;
7341 this.finishedWork = null;
7342 this.timeoutHandle = -1;
7343 this.pendingContext = this.context = null;
7344 this.hydrate = hydrate;
7345 this.callbackNode = this.firstBatch = null;
7346 this.pingTime = this.lastPendingTime = this.firstPendingTime = this.callbackExpirationTime = 0;
7347}
7348function findHostInstance(component) {
7349 var fiber = component._reactInternalFiber;
7350 if (void 0 === fiber) {
7351 if ("function" === typeof component.render)
7352 throw ReactError(Error("Unable to find node on an unmounted component."));
7353 throw ReactError(
7354 Error(
7355 "Argument appears to not be a ReactComponent. Keys: " +
7356 Object.keys(component)
7357 )
7358 );
7359 }
7360 component = findCurrentHostFiber(fiber);
7361 return null === component ? null : component.stateNode;
7362}
7363function updateContainer(element, container, parentComponent, callback) {
7364 var current$$1 = container.current,
7365 currentTime = requestCurrentTime(),
7366 suspenseConfig = ReactCurrentBatchConfig.suspense;
7367 current$$1 = computeExpirationForFiber(
7368 currentTime,
7369 current$$1,
7370 suspenseConfig
7371 );
7372 currentTime = container.current;
7373 a: if (parentComponent) {
7374 parentComponent = parentComponent._reactInternalFiber;
7375 b: {
7376 if (
7377 2 !== isFiberMountedImpl(parentComponent) ||
7378 1 !== parentComponent.tag
7379 )
7380 throw ReactError(
7381 Error(
7382 "Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."
7383 )
7384 );
7385 var parentContext = parentComponent;
7386 do {
7387 switch (parentContext.tag) {
7388 case 3:
7389 parentContext = parentContext.stateNode.context;
7390 break b;
7391 case 1:
7392 if (isContextProvider(parentContext.type)) {
7393 parentContext =
7394 parentContext.stateNode
7395 .__reactInternalMemoizedMergedChildContext;
7396 break b;
7397 }
7398 }
7399 parentContext = parentContext.return;
7400 } while (null !== parentContext);
7401 throw ReactError(
7402 Error(
7403 "Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."
7404 )
7405 );
7406 }
7407 if (1 === parentComponent.tag) {
7408 var Component = parentComponent.type;
7409 if (isContextProvider(Component)) {
7410 parentComponent = processChildContext(
7411 parentComponent,
7412 Component,
7413 parentContext
7414 );
7415 break a;
7416 }
7417 }
7418 parentComponent = parentContext;
7419 } else parentComponent = emptyContextObject;
7420 null === container.context
7421 ? (container.context = parentComponent)
7422 : (container.pendingContext = parentComponent);
7423 container = callback;
7424 suspenseConfig = createUpdate(current$$1, suspenseConfig);
7425 suspenseConfig.payload = { element: element };
7426 container = void 0 === container ? null : container;
7427 null !== container && (suspenseConfig.callback = container);
7428 enqueueUpdate(currentTime, suspenseConfig);
7429 scheduleUpdateOnFiber(currentTime, current$$1);
7430 return current$$1;
7431}
7432function createPortal(children, containerInfo, implementation) {
7433 var key =
7434 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
7435 return {
7436 $$typeof: REACT_PORTAL_TYPE,
7437 key: null == key ? null : "" + key,
7438 children: children,
7439 containerInfo: containerInfo,
7440 implementation: implementation
7441 };
7442}
7443function _inherits$1(subClass, superClass) {
7444 if ("function" !== typeof superClass && null !== superClass)
7445 throw new TypeError(
7446 "Super expression must either be null or a function, not " +
7447 typeof superClass
7448 );
7449 subClass.prototype = Object.create(superClass && superClass.prototype, {
7450 constructor: {
7451 value: subClass,
7452 enumerable: !1,
7453 writable: !0,
7454 configurable: !0
7455 }
7456 });
7457 superClass &&
7458 (Object.setPrototypeOf
7459 ? Object.setPrototypeOf(subClass, superClass)
7460 : (subClass.__proto__ = superClass));
7461}
7462var getInspectorDataForViewTag = void 0;
7463getInspectorDataForViewTag = function() {
7464 throw ReactError(
7465 Error("getInspectorDataForViewTag() is not available in production")
7466 );
7467};
7468var fabricDispatchCommand = nativeFabricUIManager.dispatchCommand;
7469function findNodeHandle(componentOrHandle) {
7470 if (null == componentOrHandle) return null;
7471 if ("number" === typeof componentOrHandle) return componentOrHandle;
7472 if (componentOrHandle._nativeTag) return componentOrHandle._nativeTag;
7473 if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag)
7474 return componentOrHandle.canonical._nativeTag;
7475 componentOrHandle = findHostInstance(componentOrHandle);
7476 return null == componentOrHandle
7477 ? componentOrHandle
7478 : componentOrHandle.canonical
7479 ? componentOrHandle.canonical._nativeTag
7480 : componentOrHandle._nativeTag;
7481}
7482batchedUpdatesImpl = function(fn, a) {
7483 var prevExecutionContext = executionContext;
7484 executionContext |= 1;
7485 try {
7486 return fn(a);
7487 } finally {
7488 (executionContext = prevExecutionContext),
7489 executionContext === NoContext && flushSyncCallbackQueue();
7490 }
7491};
7492flushDiscreteUpdatesImpl = function() {
7493 (executionContext & (1 | RenderContext | CommitContext)) === NoContext &&
7494 (flushPendingDiscreteUpdates(), flushPassiveEffects());
7495};
7496var roots = new Map(),
7497 ReactFabric = {
7498 NativeComponent: (function(findNodeHandle, findHostInstance) {
7499 return (function(_React$Component) {
7500 function ReactNativeComponent() {
7501 if (!(this instanceof ReactNativeComponent))
7502 throw new TypeError("Cannot call a class as a function");
7503 var call = _React$Component.apply(this, arguments);
7504 if (!this)
7505 throw new ReferenceError(
7506 "this hasn't been initialised - super() hasn't been called"
7507 );
7508 return !call ||
7509 ("object" !== typeof call && "function" !== typeof call)
7510 ? this
7511 : call;
7512 }
7513 _inherits$1(ReactNativeComponent, _React$Component);
7514 ReactNativeComponent.prototype.blur = function() {
7515 ReactNativePrivateInterface.TextInputState.blurTextInput(
7516 findNodeHandle(this)
7517 );
7518 };
7519 ReactNativeComponent.prototype.focus = function() {
7520 ReactNativePrivateInterface.TextInputState.focusTextInput(
7521 findNodeHandle(this)
7522 );
7523 };
7524 ReactNativeComponent.prototype.measure = function(callback) {
7525 var maybeInstance = void 0;
7526 try {
7527 maybeInstance = findHostInstance(this);
7528 } catch (error) {}
7529 null != maybeInstance &&
7530 (maybeInstance.canonical
7531 ? nativeFabricUIManager.measure(
7532 maybeInstance.node,
7533 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7534 )
7535 : ReactNativePrivateInterface.UIManager.measure(
7536 findNodeHandle(this),
7537 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7538 ));
7539 };
7540 ReactNativeComponent.prototype.measureInWindow = function(callback) {
7541 var maybeInstance = void 0;
7542 try {
7543 maybeInstance = findHostInstance(this);
7544 } catch (error) {}
7545 null != maybeInstance &&
7546 (maybeInstance.canonical
7547 ? nativeFabricUIManager.measureInWindow(
7548 maybeInstance.node,
7549 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7550 )
7551 : ReactNativePrivateInterface.UIManager.measureInWindow(
7552 findNodeHandle(this),
7553 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7554 ));
7555 };
7556 ReactNativeComponent.prototype.measureLayout = function(
7557 relativeToNativeNode,
7558 onSuccess,
7559 onFail
7560 ) {
7561 var maybeInstance = void 0;
7562 try {
7563 maybeInstance = findHostInstance(this);
7564 } catch (error) {}
7565 null == maybeInstance ||
7566 maybeInstance.canonical ||
7567 ((maybeInstance = void 0),
7568 "number" === typeof relativeToNativeNode
7569 ? (maybeInstance = relativeToNativeNode)
7570 : relativeToNativeNode._nativeTag &&
7571 (maybeInstance = relativeToNativeNode._nativeTag),
7572 null != maybeInstance &&
7573 ReactNativePrivateInterface.UIManager.measureLayout(
7574 findNodeHandle(this),
7575 maybeInstance,
7576 mountSafeCallback_NOT_REALLY_SAFE(this, onFail),
7577 mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)
7578 ));
7579 };
7580 ReactNativeComponent.prototype.setNativeProps = function(nativeProps) {
7581 var maybeInstance = void 0;
7582 try {
7583 maybeInstance = findHostInstance(this);
7584 } catch (error) {}
7585 if (null != maybeInstance && !maybeInstance.canonical) {
7586 var nativeTag =
7587 maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
7588 maybeInstance =
7589 maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
7590 nativeProps = diffProperties(
7591 null,
7592 emptyObject,
7593 nativeProps,
7594 maybeInstance.validAttributes
7595 );
7596 null != nativeProps &&
7597 ReactNativePrivateInterface.UIManager.updateView(
7598 nativeTag,
7599 maybeInstance.uiViewClassName,
7600 nativeProps
7601 );
7602 }
7603 };
7604 return ReactNativeComponent;
7605 })(React.Component);
7606 })(findNodeHandle, findHostInstance),
7607 findNodeHandle: findNodeHandle,
7608 setNativeProps: function() {},
7609 dispatchCommand: function(handle, command, args) {
7610 null != handle._nativeTag &&
7611 null != handle._internalInstanceHandle &&
7612 fabricDispatchCommand(
7613 handle._internalInstanceHandle.stateNode.node,
7614 command,
7615 args
7616 );
7617 },
7618 render: function(element, containerTag, callback) {
7619 var root = roots.get(containerTag);
7620 if (!root) {
7621 root = new FiberRootNode(containerTag, 0, !1);
7622 var uninitializedFiber = createFiber(3, null, null, 0);
7623 root.current = uninitializedFiber;
7624 uninitializedFiber.stateNode = root;
7625 roots.set(containerTag, root);
7626 }
7627 updateContainer(element, root, null, callback);
7628 a: if (((element = root.current), element.child))
7629 switch (element.child.tag) {
7630 case 5:
7631 element = element.child.stateNode.canonical;
7632 break a;
7633 default:
7634 element = element.child.stateNode;
7635 }
7636 else element = null;
7637 return element;
7638 },
7639 unmountComponentAtNode: function(containerTag) {
7640 var root = roots.get(containerTag);
7641 root &&
7642 updateContainer(null, root, null, function() {
7643 roots.delete(containerTag);
7644 });
7645 },
7646 createPortal: function(children, containerTag) {
7647 return createPortal(
7648 children,
7649 containerTag,
7650 null,
7651 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null
7652 );
7653 },
7654 __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: {
7655 NativeMethodsMixin: (function(findNodeHandle, findHostInstance) {
7656 return {
7657 measure: function(callback) {
7658 var maybeInstance = void 0;
7659 try {
7660 maybeInstance = findHostInstance(this);
7661 } catch (error) {}
7662 null != maybeInstance &&
7663 (maybeInstance.canonical
7664 ? nativeFabricUIManager.measure(
7665 maybeInstance.node,
7666 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7667 )
7668 : ReactNativePrivateInterface.UIManager.measure(
7669 findNodeHandle(this),
7670 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7671 ));
7672 },
7673 measureInWindow: function(callback) {
7674 var maybeInstance = void 0;
7675 try {
7676 maybeInstance = findHostInstance(this);
7677 } catch (error) {}
7678 null != maybeInstance &&
7679 (maybeInstance.canonical
7680 ? nativeFabricUIManager.measureInWindow(
7681 maybeInstance.node,
7682 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7683 )
7684 : ReactNativePrivateInterface.UIManager.measureInWindow(
7685 findNodeHandle(this),
7686 mountSafeCallback_NOT_REALLY_SAFE(this, callback)
7687 ));
7688 },
7689 measureLayout: function(relativeToNativeNode, onSuccess, onFail) {
7690 var maybeInstance = void 0;
7691 try {
7692 maybeInstance = findHostInstance(this);
7693 } catch (error) {}
7694 null == maybeInstance ||
7695 maybeInstance.canonical ||
7696 ((maybeInstance = void 0),
7697 "number" === typeof relativeToNativeNode
7698 ? (maybeInstance = relativeToNativeNode)
7699 : relativeToNativeNode._nativeTag &&
7700 (maybeInstance = relativeToNativeNode._nativeTag),
7701 null != maybeInstance &&
7702 ReactNativePrivateInterface.UIManager.measureLayout(
7703 findNodeHandle(this),
7704 maybeInstance,
7705 mountSafeCallback_NOT_REALLY_SAFE(this, onFail),
7706 mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)
7707 ));
7708 },
7709 setNativeProps: function(nativeProps) {
7710 var maybeInstance = void 0;
7711 try {
7712 maybeInstance = findHostInstance(this);
7713 } catch (error) {}
7714 if (null != maybeInstance && !maybeInstance.canonical) {
7715 var nativeTag =
7716 maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
7717 maybeInstance =
7718 maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
7719 nativeProps = diffProperties(
7720 null,
7721 emptyObject,
7722 nativeProps,
7723 maybeInstance.validAttributes
7724 );
7725 null != nativeProps &&
7726 ReactNativePrivateInterface.UIManager.updateView(
7727 nativeTag,
7728 maybeInstance.uiViewClassName,
7729 nativeProps
7730 );
7731 }
7732 },
7733 focus: function() {
7734 ReactNativePrivateInterface.TextInputState.focusTextInput(
7735 findNodeHandle(this)
7736 );
7737 },
7738 blur: function() {
7739 ReactNativePrivateInterface.TextInputState.blurTextInput(
7740 findNodeHandle(this)
7741 );
7742 }
7743 };
7744 })(findNodeHandle, findHostInstance)
7745 }
7746 };
7747(function(devToolsConfig) {
7748 var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;
7749 return injectInternals(
7750 Object.assign({}, devToolsConfig, {
7751 overrideHookState: null,
7752 overrideProps: null,
7753 setSuspenseHandler: null,
7754 scheduleUpdate: null,
7755 currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher,
7756 findHostInstanceByFiber: function(fiber) {
7757 fiber = findCurrentHostFiber(fiber);
7758 return null === fiber ? null : fiber.stateNode;
7759 },
7760 findFiberByHostInstance: function(instance) {
7761 return findFiberByHostInstance
7762 ? findFiberByHostInstance(instance)
7763 : null;
7764 },
7765 findHostInstancesForRefresh: null,
7766 scheduleRefresh: null,
7767 scheduleRoot: null,
7768 setRefreshHandler: null,
7769 getCurrentFiber: null
7770 })
7771 );
7772})({
7773 findFiberByHostInstance: getInstanceFromInstance,
7774 getInspectorDataForViewTag: getInspectorDataForViewTag,
7775 bundleType: 0,
7776 version: "16.8.6",
7777 rendererPackageName: "react-native-renderer"
7778});
7779var ReactFabric$2 = { default: ReactFabric },
7780 ReactFabric$3 = (ReactFabric$2 && ReactFabric) || ReactFabric$2;
7781module.exports = ReactFabric$3.default || ReactFabric$3;