diff --git a/Libraries/Renderer/REVISION b/Libraries/Renderer/REVISION index a95c669b8ca..848c15af7a5 100644 --- a/Libraries/Renderer/REVISION +++ b/Libraries/Renderer/REVISION @@ -1 +1 @@ -4aea7c3fade5f5dfc64f74efdd1e5888670d92f6 +cb32253d2f0376de899edb1bc6ebbd1602eec074 \ No newline at end of file diff --git a/Libraries/Renderer/ReactNativeFiber-dev.js b/Libraries/Renderer/ReactNativeFiber-dev.js index ace0a78e35f..b8b084f7241 100644 --- a/Libraries/Renderer/ReactNativeFiber-dev.js +++ b/Libraries/Renderer/ReactNativeFiber-dev.js @@ -11,4713 +11,4467 @@ */ "use strict"; -var invariant = require("fbjs/lib/invariant"), warning = require("fbjs/lib/warning"), ExceptionsManager = require("ExceptionsManager"); - -require("InitializeCore"); - -var RCTEventEmitter = require("RCTEventEmitter"), emptyFunction = require("fbjs/lib/emptyFunction"), UIManager = require("UIManager"), checkPropTypes = require("prop-types/checkPropTypes"), emptyObject = require("fbjs/lib/emptyObject"), react = require("react"), shallowEqual = require("fbjs/lib/shallowEqual"), deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"), deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInDev"); - -require("ReactNativeFeatureFlags"); - -var ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), defaultShowDialog = function(capturedError) { - return !0; -}, showDialog = defaultShowDialog; - -function logCapturedError(capturedError) { - if (!1 !== showDialog(capturedError)) { - var componentName = capturedError.componentName, componentStack = capturedError.componentStack, error = capturedError.error, errorBoundaryName = capturedError.errorBoundaryName, errorBoundaryFound = capturedError.errorBoundaryFound, willRetry = capturedError.willRetry, message = error.message, name = error.name, stack = error.stack, errorSummary = message ? name + ": " + message : name, componentNameMessage = componentName ? "React caught an error thrown by " + componentName + "." : "React caught an error thrown by one of your components.", formattedCallStack = stack.slice(0, errorSummary.length) === errorSummary ? stack.slice(errorSummary.length) : stack; - formattedCallStack = formattedCallStack.trim().split("\n").map(function(line) { - return "\n " + line.trim(); - }).join(); - var errorBoundaryMessage = void 0; - errorBoundaryMessage = errorBoundaryFound && errorBoundaryName ? willRetry ? "React will try to recreate this component tree from scratch " + "using the error boundary you provided, " + errorBoundaryName + "." : "This error was initially handled by the error boundary " + errorBoundaryName + ". " + "Recreating the tree from scratch failed so React will unmount the tree." : "Consider adding an error boundary to your tree to customize error handling behavior.", - console.error(componentNameMessage + " You should fix this error in your code. " + errorBoundaryMessage + "\n\n" + errorSummary + "\n\n" + "The error is located at: " + componentStack + "\n\n" + "The error was thrown at: " + formattedCallStack); - } -} - -var injection = { - injectDialog: function(fn) { - invariant(showDialog === defaultShowDialog, "The custom dialog was already injected."), - invariant("function" == typeof fn, "Injected showDialog() must be a function."), - showDialog = fn; - } -}, logCapturedError_1 = logCapturedError, ReactFiberErrorLogger = { - injection: injection, - logCapturedError: logCapturedError_1 -}, caughtError = null, invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { - var funcArgs = Array.prototype.slice.call(arguments, 3); - try { - func.apply(context, funcArgs); - } catch (error) { - return error; - } - return null; -}; - -if ("undefined" != typeof window && "function" == typeof window.dispatchEvent && "undefined" != typeof document && "function" == typeof document.createEvent) { - var fakeNode = document.createElement("react"), depth = 0; - invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { - depth++; - var thisDepth = depth, funcArgs = Array.prototype.slice.call(arguments, 3), boundFunc = function() { - func.apply(context, funcArgs); - }, fakeEventError = null, onFakeEventError = function(event) { - depth === thisDepth && (fakeEventError = event.error); - }, evtType = "react-" + (name || "invokeguardedcallback") + "-" + depth; - window.addEventListener("error", onFakeEventError), fakeNode.addEventListener(evtType, boundFunc, !1); - var evt = document.createEvent("Event"); - return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), - window.removeEventListener("error", onFakeEventError), depth--, fakeEventError; - }; -} - -var rethrowCaughtError = function() { - if (caughtError) { - var error = caughtError; - throw caughtError = null, error; - } -}, ReactErrorUtils = { - injection: { - injectErrorUtils: function(injectedErrorUtils) { - invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), - invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; - } - }, - invokeGuardedCallback: function(name, func, context, a, b, c, d, e, f) { - return invokeGuardedCallback.apply(this, arguments); - }, - invokeGuardedCallbackAndCatchFirstError: function(name, func, context, a, b, c, d, e, f) { - var error = ReactErrorUtils.invokeGuardedCallback.apply(this, arguments); - null !== error && null === caughtError && (caughtError = error); - }, - rethrowCaughtError: function() { - return rethrowCaughtError.apply(this, arguments); - } -}, ReactErrorUtils_1 = ReactErrorUtils, ComponentTree, injection$1 = { - injectComponentTree: function(Injected) { - ComponentTree = Injected, warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, "EventPluginUtils.injection.injectComponentTree(...): Injected " + "module is missing getNodeFromInstance or getInstanceFromNode."); - } -}; - -function isEndish(topLevelType) { - return "topMouseUp" === topLevelType || "topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType; -} - -function isMoveish(topLevelType) { - return "topMouseMove" === topLevelType || "topTouchMove" === topLevelType; -} - -function isStartish(topLevelType) { - return "topMouseDown" === topLevelType || "topTouchStart" === topLevelType; -} - -var validateEventDispatches; - -validateEventDispatches = function(event) { - var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances, listenersIsArr = Array.isArray(dispatchListeners), listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0, instancesIsArr = Array.isArray(dispatchInstances), instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; - warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, "EventPluginUtils: Invalid `event`."); -}; - -function executeDispatch(event, simulated, listener, inst) { - var type = event.type || "unknown-event"; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), - event.currentTarget = null; -} - -function executeDispatchesInOrder(event, simulated) { - var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; - if (validateEventDispatches(event), Array.isArray(dispatchListeners)) for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); else dispatchListeners && executeDispatch(event, simulated, dispatchListeners, dispatchInstances); - event._dispatchListeners = null, event._dispatchInstances = null; -} - -function executeDispatchesInOrderStopAtTrueImpl(event) { - var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; - if (validateEventDispatches(event), Array.isArray(dispatchListeners)) { - for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) if (dispatchListeners[i](event, dispatchInstances[i])) return dispatchInstances[i]; - } else if (dispatchListeners && dispatchListeners(event, dispatchInstances)) return dispatchInstances; - return null; -} - -function executeDispatchesInOrderStopAtTrue(event) { - var ret = executeDispatchesInOrderStopAtTrueImpl(event); - return event._dispatchInstances = null, event._dispatchListeners = null, ret; -} - -function executeDirectDispatch(event) { - validateEventDispatches(event); - var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), - event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; - var res = dispatchListener ? dispatchListener(event) : null; - return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, - res; -} - -function hasDispatches(event) { - return !!event._dispatchListeners; -} - -var EventPluginUtils = { - isEndish: isEndish, - isMoveish: isMoveish, - isStartish: isStartish, - executeDirectDispatch: executeDirectDispatch, - executeDispatchesInOrder: executeDispatchesInOrder, - executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, - hasDispatches: hasDispatches, - getFiberCurrentPropsFromNode: function(node) { - return ComponentTree.getFiberCurrentPropsFromNode(node); - }, - getInstanceFromNode: function(node) { - return ComponentTree.getInstanceFromNode(node); - }, - getNodeFromInstance: function(node) { - return ComponentTree.getNodeFromInstance(node); - }, - injection: injection$1 -}, EventPluginUtils_1 = EventPluginUtils, fiberHostComponent = null, ReactControlledComponentInjection = { - injectFiberControlledHostComponent: function(hostComponentImpl) { - fiberHostComponent = hostComponentImpl; - } -}, restoreTarget = null, restoreQueue = null; - -function restoreStateOfTarget(target) { - var internalInstance = EventPluginUtils_1.getInstanceFromNode(target); - if (internalInstance) { - if ("number" == typeof internalInstance.tag) { - invariant(fiberHostComponent && "function" == typeof fiberHostComponent.restoreControlledState, "Fiber needs to be injected to handle a fiber target for controlled " + "events."); - var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); - return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); - } - invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), - internalInstance.restoreControlledState(); - } -} - -var ReactControlledComponent = { - injection: ReactControlledComponentInjection, - enqueueStateRestore: function(target) { - restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [ target ] : restoreTarget = target; - }, - restoreStateIfNeeded: function() { - if (restoreTarget) { - var target = restoreTarget, queuedTargets = restoreQueue; - if (restoreTarget = null, restoreQueue = null, restoreStateOfTarget(target), queuedTargets) for (var i = 0; i < queuedTargets.length; i++) restoreStateOfTarget(queuedTargets[i]); - } - } -}, ReactControlledComponent_1 = ReactControlledComponent, stackBatchedUpdates = function(fn, a, b, c, d, e) { - return fn(a, b, c, d, e); -}, fiberBatchedUpdates = function(fn, bookkeeping) { - return fn(bookkeeping); -}; - -function performFiberBatchedUpdates(fn, bookkeeping) { - return fiberBatchedUpdates(fn, bookkeeping); -} - -function batchedUpdates(fn, bookkeeping) { - return stackBatchedUpdates(performFiberBatchedUpdates, fn, bookkeeping); -} - -var isNestingBatched = !1; - -function batchedUpdatesWithControlledComponents(fn, bookkeeping) { - if (isNestingBatched) return batchedUpdates(fn, bookkeeping); - isNestingBatched = !0; - try { - return batchedUpdates(fn, bookkeeping); - } finally { - isNestingBatched = !1, ReactControlledComponent_1.restoreStateIfNeeded(); - } -} - -var ReactGenericBatchingInjection = { - injectStackBatchedUpdates: function(_batchedUpdates) { - stackBatchedUpdates = _batchedUpdates; - }, - injectFiberBatchedUpdates: function(_batchedUpdates) { - fiberBatchedUpdates = _batchedUpdates; - } -}, ReactGenericBatching = { - batchedUpdates: batchedUpdatesWithControlledComponents, - injection: ReactGenericBatchingInjection -}, ReactGenericBatching_1 = ReactGenericBatching; - -function ReactNativeFiberErrorDialog(capturedError) { - var componentStack = capturedError.componentStack, error = capturedError.error, errorMessage = void 0, errorStack = void 0, errorType = void 0; - if (error && "object" == typeof error) { - var message = error.message, name = error.name; - errorMessage = (message ? name + ": " + message : name) + "\n\nThis error is located at:" + componentStack, - errorStack = error.stack, errorType = error.constructor; - } else errorMessage = "Unspecified error at:" + componentStack, errorStack = "", - errorType = Error; - var newError = new errorType(errorMessage); - return newError.stack = errorStack, ExceptionsManager.handleException(newError, !1), - !1; -} - -var showDialog$1 = ReactNativeFiberErrorDialog, ReactNativeFiberErrorDialog_1 = { - showDialog: showDialog$1 -}, eventPluginOrder = null, namesToPlugins = {}; - -function recomputePluginOrdering() { - if (eventPluginOrder) for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); - if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), - !EventPluginRegistry.plugins[pluginIndex]) { - invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), - EventPluginRegistry.plugins[pluginIndex] = pluginModule; - var publishedEvents = pluginModule.eventTypes; - for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); - } - } -} - -function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), - EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - if (phasedRegistrationNames) { - for (var phaseName in phasedRegistrationNames) if (phasedRegistrationNames.hasOwnProperty(phaseName)) { - var phasedRegistrationName = phasedRegistrationNames[phaseName]; - publishRegistrationName(phasedRegistrationName, pluginModule, eventName); - } +if (__DEV__) { + var invariant = require("fbjs/lib/invariant"), warning = require("fbjs/lib/warning"), ExceptionsManager = require("ExceptionsManager"); + require("InitializeCore"); + var RCTEventEmitter = require("RCTEventEmitter"), emptyFunction = require("fbjs/lib/emptyFunction"), UIManager = require("UIManager"), checkPropTypes = require("prop-types/checkPropTypes"), emptyObject = require("fbjs/lib/emptyObject"), react = require("react"), shallowEqual = require("fbjs/lib/shallowEqual"), deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"), deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInDev"), ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), defaultShowDialog = function(capturedError) { return !0; - } - return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), - !0); -} - -function publishRegistrationName(registrationName, pluginModule, eventName) { - invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), - EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; - var lowerCasedName = registrationName.toLowerCase(); - EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, - "onDoubleClick" === registrationName && (EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName); -} - -var EventPluginRegistry = { - plugins: [], - eventNameDispatchConfigs: {}, - registrationNameModules: {}, - registrationNameDependencies: {}, - possibleRegistrationNames: {}, - injectEventPluginOrder: function(injectedEventPluginOrder) { - invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), - eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); - }, - injectEventPluginsByName: function(injectedNamesToPlugins) { - var isOrderingDirty = !1; - for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { - var pluginModule = injectedNamesToPlugins[pluginName]; - namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), - namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); + }, showDialog = defaultShowDialog; + function logCapturedError(capturedError) { + if (!1 !== showDialog(capturedError)) { + var componentName = capturedError.componentName, componentStack = capturedError.componentStack, error = capturedError.error, errorBoundaryName = capturedError.errorBoundaryName, errorBoundaryFound = capturedError.errorBoundaryFound, willRetry = capturedError.willRetry, message = error.message, name = error.name, stack = error.stack, errorSummary = message ? name + ": " + message : name, componentNameMessage = componentName ? "React caught an error thrown by " + componentName + "." : "React caught an error thrown by one of your components.", formattedCallStack = stack.slice(0, errorSummary.length) === errorSummary ? stack.slice(errorSummary.length) : stack; + formattedCallStack = formattedCallStack.trim().split("\n").map(function(line) { + return "\n " + line.trim(); + }).join(); + var errorBoundaryMessage = void 0; + errorBoundaryMessage = errorBoundaryFound && errorBoundaryName ? willRetry ? "React will try to recreate this component tree from scratch " + "using the error boundary you provided, " + errorBoundaryName + "." : "This error was initially handled by the error boundary " + errorBoundaryName + ". " + "Recreating the tree from scratch failed so React will unmount the tree." : "Consider adding an error boundary to your tree to customize error handling behavior.", + console.error(componentNameMessage + " You should fix this error in your code. " + errorBoundaryMessage + "\n\n" + errorSummary + "\n\n" + "The error is located at: " + componentStack + "\n\n" + "The error was thrown at: " + formattedCallStack); } - isOrderingDirty && recomputePluginOrdering(); } -}, EventPluginRegistry_1 = EventPluginRegistry; - -function accumulateInto(current, next) { - return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), - null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), - current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; -} - -var accumulateInto_1 = accumulateInto; - -function forEachAccumulated(arr, cb, scope) { - Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); -} - -var forEachAccumulated_1 = forEachAccumulated, eventQueue = null, executeDispatchesAndRelease = function(event, simulated) { - event && (EventPluginUtils_1.executeDispatchesInOrder(event, simulated), event.isPersistent() || event.constructor.release(event)); -}, executeDispatchesAndReleaseSimulated = function(e) { - return executeDispatchesAndRelease(e, !0); -}, executeDispatchesAndReleaseTopLevel = function(e) { - return executeDispatchesAndRelease(e, !1); -}; - -function isInteractive(tag) { - return "button" === tag || "input" === tag || "select" === tag || "textarea" === tag; -} - -function shouldPreventMouseEvent(name, type, props) { - switch (name) { - case "onClick": - case "onClickCapture": - case "onDoubleClick": - case "onDoubleClickCapture": - case "onMouseDown": - case "onMouseDownCapture": - case "onMouseMove": - case "onMouseMoveCapture": - case "onMouseUp": - case "onMouseUpCapture": - return !(!props.disabled || !isInteractive(type)); - - default: - return !1; - } -} - -var EventPluginHub = { - injection: { - injectEventPluginOrder: EventPluginRegistry_1.injectEventPluginOrder, - injectEventPluginsByName: EventPluginRegistry_1.injectEventPluginsByName - }, - getListener: function(inst, registrationName) { - var listener; - if ("number" == typeof inst.tag) { - var stateNode = inst.stateNode; - if (!stateNode) return null; - var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(stateNode); - if (!props) return null; - if (listener = props[registrationName], shouldPreventMouseEvent(registrationName, inst.type, props)) return null; - } else { - var currentElement = inst._currentElement; - if ("string" == typeof currentElement || "number" == typeof currentElement) return null; - if (!inst._rootNodeID) return null; - var _props = currentElement.props; - if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; + var injection = { + injectDialog: function(fn) { + invariant(showDialog === defaultShowDialog, "The custom dialog was already injected."), + invariant("function" == typeof fn, "Injected showDialog() must be a function."), + showDialog = fn; } - return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), - listener; - }, - extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - for (var events, plugins = EventPluginRegistry_1.plugins, i = 0; i < plugins.length; i++) { - var possiblePlugin = plugins[i]; - if (possiblePlugin) { - var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); - extractedEvents && (events = accumulateInto_1(events, extractedEvents)); + }, logCapturedError_1 = logCapturedError, ReactFiberErrorLogger = { + injection: injection, + logCapturedError: logCapturedError_1 + }, caughtError = null, invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + try { + func.apply(context, funcArgs); + } catch (error) { + return error; + } + return null; + }; + if ("undefined" != typeof window && "function" == typeof window.dispatchEvent && "undefined" != typeof document && "function" == typeof document.createEvent) { + var fakeNode = document.createElement("react"), depth = 0; + invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { + depth++; + var thisDepth = depth, funcArgs = Array.prototype.slice.call(arguments, 3), boundFunc = function() { + func.apply(context, funcArgs); + }, fakeEventError = null, onFakeEventError = function(event) { + depth === thisDepth && (fakeEventError = event.error); + }, evtType = "react-" + (name || "invokeguardedcallback") + "-" + depth; + window.addEventListener("error", onFakeEventError), fakeNode.addEventListener(evtType, boundFunc, !1); + var evt = document.createEvent("Event"); + return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), + window.removeEventListener("error", onFakeEventError), depth--, fakeEventError; + }; + } + var rethrowCaughtError = function() { + if (caughtError) { + var error = caughtError; + throw caughtError = null, error; + } + }, ReactErrorUtils = { + injection: { + injectErrorUtils: function(injectedErrorUtils) { + invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), + invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; + } + }, + invokeGuardedCallback: function(name, func, context, a, b, c, d, e, f) { + return invokeGuardedCallback.apply(this, arguments); + }, + invokeGuardedCallbackAndCatchFirstError: function(name, func, context, a, b, c, d, e, f) { + var error = ReactErrorUtils.invokeGuardedCallback.apply(this, arguments); + null !== error && null === caughtError && (caughtError = error); + }, + rethrowCaughtError: function() { + return rethrowCaughtError.apply(this, arguments); + } + }, ReactErrorUtils_1 = ReactErrorUtils, ComponentTree, injection$1 = { + injectComponentTree: function(Injected) { + ComponentTree = Injected, warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, "EventPluginUtils.injection.injectComponentTree(...): Injected " + "module is missing getNodeFromInstance or getInstanceFromNode."); + } + }; + function isEndish(topLevelType) { + return "topMouseUp" === topLevelType || "topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType; + } + function isMoveish(topLevelType) { + return "topMouseMove" === topLevelType || "topTouchMove" === topLevelType; + } + function isStartish(topLevelType) { + return "topMouseDown" === topLevelType || "topTouchStart" === topLevelType; + } + var validateEventDispatches; + validateEventDispatches = function(event) { + var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances, listenersIsArr = Array.isArray(dispatchListeners), listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0, instancesIsArr = Array.isArray(dispatchInstances), instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, "EventPluginUtils: Invalid `event`."); + }; + function executeDispatch(event, simulated, listener, inst) { + var type = event.type || "unknown-event"; + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), + event.currentTarget = null; + } + function executeDispatchesInOrder(event, simulated) { + var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; + if (validateEventDispatches(event), Array.isArray(dispatchListeners)) for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); else dispatchListeners && executeDispatch(event, simulated, dispatchListeners, dispatchInstances); + event._dispatchListeners = null, event._dispatchInstances = null; + } + function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; + if (validateEventDispatches(event), Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) if (dispatchListeners[i](event, dispatchInstances[i])) return dispatchInstances[i]; + } else if (dispatchListeners && dispatchListeners(event, dispatchInstances)) return dispatchInstances; + return null; + } + function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + return event._dispatchInstances = null, event._dispatchListeners = null, ret; + } + function executeDirectDispatch(event) { + validateEventDispatches(event); + var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; + invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), + event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; + var res = dispatchListener ? dispatchListener(event) : null; + return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, + res; + } + function hasDispatches(event) { + return !!event._dispatchListeners; + } + var EventPluginUtils = { + isEndish: isEndish, + isMoveish: isMoveish, + isStartish: isStartish, + executeDirectDispatch: executeDirectDispatch, + executeDispatchesInOrder: executeDispatchesInOrder, + executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, + hasDispatches: hasDispatches, + getFiberCurrentPropsFromNode: function(node) { + return ComponentTree.getFiberCurrentPropsFromNode(node); + }, + getInstanceFromNode: function(node) { + return ComponentTree.getInstanceFromNode(node); + }, + getNodeFromInstance: function(node) { + return ComponentTree.getNodeFromInstance(node); + }, + injection: injection$1 + }, EventPluginUtils_1 = EventPluginUtils, fiberHostComponent = null, ReactControlledComponentInjection = { + injectFiberControlledHostComponent: function(hostComponentImpl) { + fiberHostComponent = hostComponentImpl; + } + }, restoreTarget = null, restoreQueue = null; + function restoreStateOfTarget(target) { + var internalInstance = EventPluginUtils_1.getInstanceFromNode(target); + if (internalInstance) { + if ("number" == typeof internalInstance.tag) { + invariant(fiberHostComponent && "function" == typeof fiberHostComponent.restoreControlledState, "Fiber needs to be injected to handle a fiber target for controlled " + "events."); + var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); + return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); + } + invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), + internalInstance.restoreControlledState(); + } + } + var ReactControlledComponent = { + injection: ReactControlledComponentInjection, + enqueueStateRestore: function(target) { + restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [ target ] : restoreTarget = target; + }, + restoreStateIfNeeded: function() { + if (restoreTarget) { + var target = restoreTarget, queuedTargets = restoreQueue; + if (restoreTarget = null, restoreQueue = null, restoreStateOfTarget(target), queuedTargets) for (var i = 0; i < queuedTargets.length; i++) restoreStateOfTarget(queuedTargets[i]); } } - return events; - }, - enqueueEvents: function(events) { - events && (eventQueue = accumulateInto_1(eventQueue, events)); - }, - processEventQueue: function(simulated) { - var processingEventQueue = eventQueue; - eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), - invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), - ReactErrorUtils_1.rethrowCaughtError(); + }, ReactControlledComponent_1 = ReactControlledComponent, stackBatchedUpdates = function(fn, a, b, c, d, e) { + return fn(a, b, c, d, e); + }, fiberBatchedUpdates = function(fn, bookkeeping) { + return fn(bookkeeping); + }; + function performFiberBatchedUpdates(fn, bookkeeping) { + return fiberBatchedUpdates(fn, bookkeeping); } -}, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { - IndeterminateComponent: 0, - FunctionalComponent: 1, - ClassComponent: 2, - HostRoot: 3, - HostPortal: 4, - HostComponent: 5, - HostText: 6, - CoroutineComponent: 7, - CoroutineHandlerPhase: 8, - YieldComponent: 9, - Fragment: 10 -}, HostComponent = ReactTypeOfWork.HostComponent; - -function getParent(inst) { - if (void 0 !== inst._hostParent) return inst._hostParent; - if ("number" == typeof inst.tag) { - do { - inst = inst.return; - } while (inst && inst.tag !== HostComponent); - if (inst) return inst; + function batchedUpdates(fn, bookkeeping) { + return stackBatchedUpdates(performFiberBatchedUpdates, fn, bookkeeping); } - return null; -} - -function getLowestCommonAncestor(instA, instB) { - for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA)) depthA++; - for (var depthB = 0, tempB = instB; tempB; tempB = getParent(tempB)) depthB++; - for (;depthA - depthB > 0; ) instA = getParent(instA), depthA--; - for (;depthB - depthA > 0; ) instB = getParent(instB), depthB--; - for (var depth = depthA; depth--; ) { - if (instA === instB || instA === instB.alternate) return instA; - instA = getParent(instA), instB = getParent(instB); + var isNestingBatched = !1; + function batchedUpdatesWithControlledComponents(fn, bookkeeping) { + if (isNestingBatched) return batchedUpdates(fn, bookkeeping); + isNestingBatched = !0; + try { + return batchedUpdates(fn, bookkeeping); + } finally { + isNestingBatched = !1, ReactControlledComponent_1.restoreStateIfNeeded(); + } } - return null; -} - -function isAncestor(instA, instB) { - for (;instB; ) { - if (instA === instB || instA === instB.alternate) return !0; - instB = getParent(instB); + var ReactGenericBatchingInjection = { + injectStackBatchedUpdates: function(_batchedUpdates) { + stackBatchedUpdates = _batchedUpdates; + }, + injectFiberBatchedUpdates: function(_batchedUpdates) { + fiberBatchedUpdates = _batchedUpdates; + } + }, ReactGenericBatching = { + batchedUpdates: batchedUpdatesWithControlledComponents, + injection: ReactGenericBatchingInjection + }, ReactGenericBatching_1 = ReactGenericBatching; + function ReactNativeFiberErrorDialog(capturedError) { + var componentStack = capturedError.componentStack, error = capturedError.error, errorToHandle = void 0; + if (error instanceof Error) { + var message = error.message, name = error.name, summary = message ? name + ": " + message : name; + errorToHandle = error; + try { + errorToHandle.message = summary + "\n\nThis error is located at:" + componentStack; + } catch (e) {} + } else errorToHandle = "string" == typeof error ? new Error(error + "\n\nThis error is located at:" + componentStack) : new Error("Unspecified error at:" + componentStack); + return ExceptionsManager.handleException(errorToHandle, !1), !1; } - return !1; -} - -function getParentInstance(inst) { - return getParent(inst); -} - -function traverseTwoPhase(inst, fn, arg) { - for (var path = []; inst; ) path.push(inst), inst = getParent(inst); - var i; - for (i = path.length; i-- > 0; ) fn(path[i], "captured", arg); - for (i = 0; i < path.length; i++) fn(path[i], "bubbled", arg); -} - -function traverseEnterLeave(from, to, fn, argFrom, argTo) { - for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), - from = getParent(from); - for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); - var i; - for (i = 0; i < pathFrom.length; i++) fn(pathFrom[i], "bubbled", argFrom); - for (i = pathTo.length; i-- > 0; ) fn(pathTo[i], "captured", argTo); -} - -var ReactTreeTraversal = { - isAncestor: isAncestor, - getLowestCommonAncestor: getLowestCommonAncestor, - getParentInstance: getParentInstance, - traverseTwoPhase: traverseTwoPhase, - traverseEnterLeave: traverseEnterLeave -}, getListener = EventPluginHub_1.getListener; - -function listenerAtPhase(inst, event, propagationPhase) { - var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; - return getListener(inst, registrationName); -} - -function accumulateDirectionalDispatches(inst, phase, event) { - warning(inst, "Dispatching inst must not be null"); - var listener = listenerAtPhase(inst, event, phase); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), - event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); -} - -function accumulateTwoPhaseDispatchesSingle(event) { - event && event.dispatchConfig.phasedRegistrationNames && ReactTreeTraversal.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); -} - -function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - var targetInst = event._targetInst, parentInst = targetInst ? ReactTreeTraversal.getParentInstance(targetInst) : null; - ReactTreeTraversal.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); + var showDialog$1 = ReactNativeFiberErrorDialog, ReactNativeFiberErrorDialog_1 = { + showDialog: showDialog$1 + }, eventPluginOrder = null, namesToPlugins = {}; + function recomputePluginOrdering() { + if (eventPluginOrder) for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); + if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), + !EventPluginRegistry.plugins[pluginIndex]) { + invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), + EventPluginRegistry.plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); + } + } } -} + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), + EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + return !0; + } + return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), + !0); + } + function publishRegistrationName(registrationName, pluginModule, eventName) { + invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), + EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + var lowerCasedName = registrationName.toLowerCase(); + EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, + "onDoubleClick" === registrationName && (EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName); + } + var EventPluginRegistry = { + plugins: [], + eventNameDispatchConfigs: {}, + registrationNameModules: {}, + registrationNameDependencies: {}, + possibleRegistrationNames: {}, + injectEventPluginOrder: function(injectedEventPluginOrder) { + invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); + }, + injectEventPluginsByName: function(injectedNamesToPlugins) { + var isOrderingDirty = !1; + for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { + var pluginModule = injectedNamesToPlugins[pluginName]; + namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), + namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); + } + isOrderingDirty && recomputePluginOrdering(); + } + }, EventPluginRegistry_1 = EventPluginRegistry; + function accumulateInto(current, next) { + return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), + null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), + current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; + } + var accumulateInto_1 = accumulateInto; + function forEachAccumulated(arr, cb, scope) { + Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); + } + var forEachAccumulated_1 = forEachAccumulated, eventQueue = null, executeDispatchesAndRelease = function(event, simulated) { + event && (EventPluginUtils_1.executeDispatchesInOrder(event, simulated), event.isPersistent() || event.constructor.release(event)); + }, executeDispatchesAndReleaseSimulated = function(e) { + return executeDispatchesAndRelease(e, !0); + }, executeDispatchesAndReleaseTopLevel = function(e) { + return executeDispatchesAndRelease(e, !1); + }; + function isInteractive(tag) { + return "button" === tag || "input" === tag || "select" === tag || "textarea" === tag; + } + function shouldPreventMouseEvent(name, type, props) { + switch (name) { + case "onClick": + case "onClickCapture": + case "onDoubleClick": + case "onDoubleClickCapture": + case "onMouseDown": + case "onMouseDownCapture": + case "onMouseMove": + case "onMouseMoveCapture": + case "onMouseUp": + case "onMouseUpCapture": + return !(!props.disabled || !isInteractive(type)); -function accumulateDispatches(inst, ignoredDirection, event) { - if (inst && event && event.dispatchConfig.registrationName) { - var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); + default: + return !1; + } + } + var EventPluginHub = { + injection: { + injectEventPluginOrder: EventPluginRegistry_1.injectEventPluginOrder, + injectEventPluginsByName: EventPluginRegistry_1.injectEventPluginsByName + }, + getListener: function(inst, registrationName) { + var listener; + if ("number" == typeof inst.tag) { + var stateNode = inst.stateNode; + if (!stateNode) return null; + var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(stateNode); + if (!props) return null; + if (listener = props[registrationName], shouldPreventMouseEvent(registrationName, inst.type, props)) return null; + } else { + var currentElement = inst._currentElement; + if ("string" == typeof currentElement || "number" == typeof currentElement) return null; + if (!inst._rootNodeID) return null; + var _props = currentElement.props; + if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; + } + return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), + listener; + }, + extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + for (var events, plugins = EventPluginRegistry_1.plugins, i = 0; i < plugins.length; i++) { + var possiblePlugin = plugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + extractedEvents && (events = accumulateInto_1(events, extractedEvents)); + } + } + return events; + }, + enqueueEvents: function(events) { + events && (eventQueue = accumulateInto_1(eventQueue, events)); + }, + processEventQueue: function(simulated) { + var processingEventQueue = eventQueue; + eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), + invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), + ReactErrorUtils_1.rethrowCaughtError(); + } + }, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { + IndeterminateComponent: 0, + FunctionalComponent: 1, + ClassComponent: 2, + HostRoot: 3, + HostPortal: 4, + HostComponent: 5, + HostText: 6, + CoroutineComponent: 7, + CoroutineHandlerPhase: 8, + YieldComponent: 9, + Fragment: 10 + }, HostComponent = ReactTypeOfWork.HostComponent; + function getParent(inst) { + if (void 0 !== inst._hostParent) return inst._hostParent; + if ("number" == typeof inst.tag) { + do { + inst = inst.return; + } while (inst && inst.tag !== HostComponent); + if (inst) return inst; + } + return null; + } + function getLowestCommonAncestor(instA, instB) { + for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA)) depthA++; + for (var depthB = 0, tempB = instB; tempB; tempB = getParent(tempB)) depthB++; + for (;depthA - depthB > 0; ) instA = getParent(instA), depthA--; + for (;depthB - depthA > 0; ) instB = getParent(instB), depthB--; + for (var depth = depthA; depth--; ) { + if (instA === instB || instA === instB.alternate) return instA; + instA = getParent(instA), instB = getParent(instB); + } + return null; + } + function isAncestor(instA, instB) { + for (;instB; ) { + if (instA === instB || instA === instB.alternate) return !0; + instB = getParent(instB); + } + return !1; + } + function getParentInstance(inst) { + return getParent(inst); + } + function traverseTwoPhase(inst, fn, arg) { + for (var path = []; inst; ) path.push(inst), inst = getParent(inst); + var i; + for (i = path.length; i-- > 0; ) fn(path[i], "captured", arg); + for (i = 0; i < path.length; i++) fn(path[i], "bubbled", arg); + } + function traverseEnterLeave(from, to, fn, argFrom, argTo) { + for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), + from = getParent(from); + for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); + var i; + for (i = 0; i < pathFrom.length; i++) fn(pathFrom[i], "bubbled", argFrom); + for (i = pathTo.length; i-- > 0; ) fn(pathTo[i], "captured", argTo); + } + var ReactTreeTraversal = { + isAncestor: isAncestor, + getLowestCommonAncestor: getLowestCommonAncestor, + getParentInstance: getParentInstance, + traverseTwoPhase: traverseTwoPhase, + traverseEnterLeave: traverseEnterLeave + }, getListener = EventPluginHub_1.getListener; + function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); + } + function accumulateDirectionalDispatches(inst, phase, event) { + warning(inst, "Dispatching inst must not be null"); + var listener = listenerAtPhase(inst, event, phase); listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } -} - -function accumulateDirectDispatchesSingle(event) { - event && event.dispatchConfig.registrationName && accumulateDispatches(event._targetInst, null, event); -} - -function accumulateTwoPhaseDispatches(events) { - forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingle); -} - -function accumulateTwoPhaseDispatchesSkipTarget(events) { - forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingleSkipTarget); -} - -function accumulateEnterLeaveDispatches(leave, enter, from, to) { - ReactTreeTraversal.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); -} - -function accumulateDirectDispatches(events) { - forEachAccumulated_1(events, accumulateDirectDispatchesSingle); -} - -var EventPropagators = { - accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, - accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, - accumulateDirectDispatches: accumulateDirectDispatches, - accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches -}, EventPropagators_1 = EventPropagators, oneArgumentPooler = function(copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, copyFieldsFrom), instance; + function accumulateTwoPhaseDispatchesSingle(event) { + event && event.dispatchConfig.phasedRegistrationNames && ReactTreeTraversal.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); } - return new Klass(copyFieldsFrom); -}, twoArgumentPooler = function(a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, a1, a2), instance; + function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst, parentInst = targetInst ? ReactTreeTraversal.getParentInstance(targetInst) : null; + ReactTreeTraversal.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); + } } - return new Klass(a1, a2); -}, threeArgumentPooler = function(a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, a1, a2, a3), instance; + function accumulateDispatches(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); + } } - return new Klass(a1, a2, a3); -}, fourArgumentPooler = function(a1, a2, a3, a4) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, a1, a2, a3, a4), instance; + function accumulateDirectDispatchesSingle(event) { + event && event.dispatchConfig.registrationName && accumulateDispatches(event._targetInst, null, event); } - return new Klass(a1, a2, a3, a4); -}, standardReleaser = function(instance) { - var Klass = this; - invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), - instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); -}, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { - var NewKlass = CopyConstructor; - return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, - NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, - NewKlass; -}, PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fourArgumentPooler: fourArgumentPooler -}, PooledClass_1 = PooledClass, didWarnForAddedNewProperty = !1, isProxySupported = "function" == typeof Proxy, shouldBeReleasedProperties = [ "dispatchConfig", "_targetInst", "nativeEvent", "isDefaultPrevented", "isPropagationStopped", "_dispatchListeners", "_dispatchInstances" ], EventInterface = { - type: null, - target: null, - currentTarget: emptyFunction.thatReturnsNull, - eventPhase: null, - bubbles: null, - cancelable: null, - timeStamp: function(event) { - return event.timeStamp || Date.now(); - }, - defaultPrevented: null, - isTrusted: null -}; - -function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { - delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, - this.dispatchConfig = dispatchConfig, this._targetInst = targetInst, this.nativeEvent = nativeEvent; - var Interface = this.constructor.Interface; - for (var propName in Interface) if (Interface.hasOwnProperty(propName)) { - delete this[propName]; - var normalize = Interface[propName]; - normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; + function accumulateTwoPhaseDispatches(events) { + forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingle); } - var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; - return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, - this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; -} - -Object.assign(SyntheticEvent.prototype, { - preventDefault: function() { - this.defaultPrevented = !0; - var event = this.nativeEvent; - event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), - this.isDefaultPrevented = emptyFunction.thatReturnsTrue); - }, - stopPropagation: function() { - var event = this.nativeEvent; - event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), - this.isPropagationStopped = emptyFunction.thatReturnsTrue); - }, - persist: function() { - this.isPersistent = emptyFunction.thatReturnsTrue; - }, - isPersistent: emptyFunction.thatReturnsFalse, - destructor: function() { - var Interface = this.constructor.Interface; - for (var propName in Interface) Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); - for (var i = 0; i < shouldBeReleasedProperties.length; i++) this[shouldBeReleasedProperties[i]] = null; - Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), - Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), - Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", emptyFunction)); + function accumulateTwoPhaseDispatchesSkipTarget(events) { + forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingleSkipTarget); } -}), SyntheticEvent.Interface = EventInterface, isProxySupported && (SyntheticEvent = new Proxy(SyntheticEvent, { - construct: function(target, args) { - return this.apply(target, Object.create(target.prototype), args); - }, - apply: function(constructor, that, args) { - return new Proxy(constructor.apply(that, args), { - set: function(target, prop, value) { - return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), - didWarnForAddedNewProperty = !0), target[prop] = value, !0; - } - }); + function accumulateEnterLeaveDispatches(leave, enter, from, to) { + ReactTreeTraversal.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); } -})), SyntheticEvent.augmentClass = function(Class, Interface) { - var Super = this, E = function() {}; - E.prototype = Super.prototype; - var prototype = new E(); - Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, - Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, - PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); -}, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); - -var SyntheticEvent_1 = SyntheticEvent; - -function getPooledWarningPropertyDefinition(propName, getVal) { - var isFunction = "function" == typeof getVal; - return { - configurable: !0, - set: set, - get: get + function accumulateDirectDispatches(events) { + forEachAccumulated_1(events, accumulateDirectDispatchesSingle); + } + var EventPropagators = { + accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, + accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, + accumulateDirectDispatches: accumulateDirectDispatches, + accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches + }, EventPropagators_1 = EventPropagators, oneArgumentPooler = function(copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, copyFieldsFrom), instance; + } + return new Klass(copyFieldsFrom); + }, twoArgumentPooler = function(a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, a1, a2), instance; + } + return new Klass(a1, a2); + }, threeArgumentPooler = function(a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, a1, a2, a3), instance; + } + return new Klass(a1, a2, a3); + }, fourArgumentPooler = function(a1, a2, a3, a4) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, a1, a2, a3, a4), instance; + } + return new Klass(a1, a2, a3, a4); + }, standardReleaser = function(instance) { + var Klass = this; + invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), + instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); + }, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, + NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, + NewKlass; + }, PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fourArgumentPooler: fourArgumentPooler + }, PooledClass_1 = PooledClass, didWarnForAddedNewProperty = !1, isProxySupported = "function" == typeof Proxy, shouldBeReleasedProperties = [ "dispatchConfig", "_targetInst", "nativeEvent", "isDefaultPrevented", "isPropagationStopped", "_dispatchListeners", "_dispatchInstances" ], EventInterface = { + type: null, + target: null, + currentTarget: emptyFunction.thatReturnsNull, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function(event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null }; - function set(val) { - return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), - val; - } - function get() { - return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), - getVal; - } - function warn(action, result) { - warning(!1, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + "If you must keep the original synthetic event around, use event.persist(). " + "See https://fb.me/react-event-pooling for more information.", action, propName, result); - } -} - -var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); - } - return target; -}, customBubblingEventTypes = UIManager.customBubblingEventTypes, customDirectEventTypes = UIManager.customDirectEventTypes, allTypesByEventName = {}; - -for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; - -for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), -allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; - -var ReactNativeBridgeEventPlugin = { - eventTypes: _extends({}, customBubblingEventTypes, customDirectEventTypes), - extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], directDispatchConfig = customDirectEventTypes[topLevelType], event = SyntheticEvent_1.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); - if (bubbleDispatchConfig) EventPropagators_1.accumulateTwoPhaseDispatches(event); else { - if (!directDispatchConfig) return null; - EventPropagators_1.accumulateDirectDispatches(event); + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, + this.dispatchConfig = dispatchConfig, this._targetInst = targetInst, this.nativeEvent = nativeEvent; + var Interface = this.constructor.Interface; + for (var propName in Interface) if (Interface.hasOwnProperty(propName)) { + delete this[propName]; + var normalize = Interface[propName]; + normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; } - return event; + var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; + return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, + this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; } -}, ReactNativeBridgeEventPlugin_1 = ReactNativeBridgeEventPlugin, instanceCache = {}, instanceProps = {}; - -function getRenderedHostOrTextFromComponent(component) { - for (var rendered; rendered = component._renderedComponent; ) component = rendered; - return component; -} - -function precacheNode(inst, tag) { - var nativeInst = getRenderedHostOrTextFromComponent(inst); - instanceCache[tag] = nativeInst; -} - -function precacheFiberNode(hostInst, tag) { - instanceCache[tag] = hostInst; -} - -function uncacheNode(inst) { - var tag = inst._rootNodeID; - tag && delete instanceCache[tag]; -} - -function uncacheFiberNode(tag) { - delete instanceCache[tag], delete instanceProps[tag]; -} - -function getInstanceFromTag(tag) { - return instanceCache[tag] || null; -} - -function getTagFromInstance(inst) { - var tag = "number" != typeof inst.tag ? inst._rootNodeID : inst.stateNode._nativeTag; - return invariant(tag, "All native instances should have a tag."), tag; -} - -function getFiberCurrentPropsFromNode(stateNode) { - return instanceProps[stateNode._nativeTag] || null; -} - -function updateFiberProps(tag, props) { - instanceProps[tag] = props; -} - -var ReactNativeComponentTree = { - getClosestInstanceFromNode: getInstanceFromTag, - getInstanceFromNode: getInstanceFromTag, - getNodeFromInstance: getTagFromInstance, - precacheFiberNode: precacheFiberNode, - precacheNode: precacheNode, - uncacheFiberNode: uncacheFiberNode, - uncacheNode: uncacheNode, - getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode, - updateFiberProps: updateFiberProps -}, ReactNativeComponentTree_1 = ReactNativeComponentTree; - -function runEventQueueInBatch(events) { - EventPluginHub_1.enqueueEvents(events), EventPluginHub_1.processEventQueue(!1); -} - -var ReactEventEmitterMixin = { - handleTopLevel: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - runEventQueueInBatch(EventPluginHub_1.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget)); + Object.assign(SyntheticEvent.prototype, { + preventDefault: function() { + this.defaultPrevented = !0; + var event = this.nativeEvent; + event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), + this.isDefaultPrevented = emptyFunction.thatReturnsTrue); + }, + stopPropagation: function() { + var event = this.nativeEvent; + event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), + this.isPropagationStopped = emptyFunction.thatReturnsTrue); + }, + persist: function() { + this.isPersistent = emptyFunction.thatReturnsTrue; + }, + isPersistent: emptyFunction.thatReturnsFalse, + destructor: function() { + var Interface = this.constructor.Interface; + for (var propName in Interface) Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); + for (var i = 0; i < shouldBeReleasedProperties.length; i++) this[shouldBeReleasedProperties[i]] = null; + Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), + Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), + Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", emptyFunction)); + } + }), SyntheticEvent.Interface = EventInterface, isProxySupported && (SyntheticEvent = new Proxy(SyntheticEvent, { + construct: function(target, args) { + return this.apply(target, Object.create(target.prototype), args); + }, + apply: function(constructor, that, args) { + return new Proxy(constructor.apply(that, args), { + set: function(target, prop, value) { + return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), + didWarnForAddedNewProperty = !0), target[prop] = value, !0; + } + }); + } + })), SyntheticEvent.augmentClass = function(Class, Interface) { + var Super = this, E = function() {}; + E.prototype = Super.prototype; + var prototype = new E(); + Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, + Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, + PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); + }, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); + var SyntheticEvent_1 = SyntheticEvent; + function getPooledWarningPropertyDefinition(propName, getVal) { + var isFunction = "function" == typeof getVal; + return { + configurable: !0, + set: set, + get: get + }; + function set(val) { + return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), + val; + } + function get() { + return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), + getVal; + } + function warn(action, result) { + warning(!1, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + "If you must keep the original synthetic event around, use event.persist(). " + "See https://fb.me/react-event-pooling for more information.", action, propName, result); + } } -}, ReactEventEmitterMixin_1 = ReactEventEmitterMixin, INITIAL_TAG_COUNT = 1, ReactNativeTagHandles = { - tagsStartAt: INITIAL_TAG_COUNT, - tagCount: INITIAL_TAG_COUNT, - allocateTag: function() { - for (;this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount); ) ReactNativeTagHandles.tagCount++; - var tag = ReactNativeTagHandles.tagCount; - return ReactNativeTagHandles.tagCount++, tag; - }, - assertRootTag: function(tag) { - invariant(this.reactTagIsNativeTopRootID(tag), "Expect a native root tag, instead got %s", tag); - }, - reactTagIsNativeTopRootID: function(reactTag) { - return reactTag % 10 == 1; + var _extends = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + } + return target; + }, customBubblingEventTypes = UIManager.customBubblingEventTypes, customDirectEventTypes = UIManager.customDirectEventTypes, allTypesByEventName = {}; + for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; + for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), + allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; + var ReactNativeBridgeEventPlugin = { + eventTypes: _extends({}, customBubblingEventTypes, customDirectEventTypes), + extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], directDispatchConfig = customDirectEventTypes[topLevelType], event = SyntheticEvent_1.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); + if (bubbleDispatchConfig) EventPropagators_1.accumulateTwoPhaseDispatches(event); else { + if (!directDispatchConfig) return null; + EventPropagators_1.accumulateDirectDispatches(event); + } + return event; + } + }, ReactNativeBridgeEventPlugin_1 = ReactNativeBridgeEventPlugin, instanceCache = {}, instanceProps = {}; + function getRenderedHostOrTextFromComponent(component) { + for (var rendered; rendered = component._renderedComponent; ) component = rendered; + return component; } -}, ReactNativeTagHandles_1 = ReactNativeTagHandles, _extends$1 = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + function precacheNode(inst, tag) { + var nativeInst = getRenderedHostOrTextFromComponent(inst); + instanceCache[tag] = nativeInst; } - return target; -}, EMPTY_NATIVE_EVENT = {}, touchSubsequence = function(touches, indices) { - for (var ret = [], i = 0; i < indices.length; i++) ret.push(touches[indices[i]]); - return ret; -}, removeTouchesAtIndices = function(touches, indices) { - for (var rippedOut = [], temp = touches, i = 0; i < indices.length; i++) { - var index = indices[i]; - rippedOut.push(touches[index]), temp[index] = null; + function precacheFiberNode(hostInst, tag) { + instanceCache[tag] = hostInst; } - for (var fillAt = 0, j = 0; j < temp.length; j++) { - var cur = temp[j]; - null !== cur && (temp[fillAt++] = cur); + function uncacheNode(inst) { + var tag = inst._rootNodeID; + tag && delete instanceCache[tag]; } - return temp.length = fillAt, rippedOut; -}, ReactNativeEventEmitter = _extends$1({}, ReactEventEmitterMixin_1, { - registrationNames: EventPluginRegistry_1.registrationNameModules, - getListener: EventPluginHub_1.getListener, - _receiveRootNodeIDEvent: function(rootNodeID, topLevelType, nativeEventParam) { - var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT, inst = ReactNativeComponentTree_1.getInstanceFromNode(rootNodeID); - ReactGenericBatching_1.batchedUpdates(function() { - ReactNativeEventEmitter.handleTopLevel(topLevelType, inst, nativeEvent, nativeEvent.target); + function uncacheFiberNode(tag) { + delete instanceCache[tag], delete instanceProps[tag]; + } + function getInstanceFromTag(tag) { + return instanceCache[tag] || null; + } + function getTagFromInstance(inst) { + var tag = "number" != typeof inst.tag ? inst._rootNodeID : inst.stateNode._nativeTag; + return invariant(tag, "All native instances should have a tag."), tag; + } + function getFiberCurrentPropsFromNode(stateNode) { + return instanceProps[stateNode._nativeTag] || null; + } + function updateFiberProps(tag, props) { + instanceProps[tag] = props; + } + var ReactNativeComponentTree = { + getClosestInstanceFromNode: getInstanceFromTag, + getInstanceFromNode: getInstanceFromTag, + getNodeFromInstance: getTagFromInstance, + precacheFiberNode: precacheFiberNode, + precacheNode: precacheNode, + uncacheFiberNode: uncacheFiberNode, + uncacheNode: uncacheNode, + getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode, + updateFiberProps: updateFiberProps + }, ReactNativeComponentTree_1 = ReactNativeComponentTree; + function runEventQueueInBatch(events) { + EventPluginHub_1.enqueueEvents(events), EventPluginHub_1.processEventQueue(!1); + } + var ReactEventEmitterMixin = { + handleTopLevel: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + runEventQueueInBatch(EventPluginHub_1.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget)); + } + }, ReactEventEmitterMixin_1 = ReactEventEmitterMixin, INITIAL_TAG_COUNT = 1, ReactNativeTagHandles = { + tagsStartAt: INITIAL_TAG_COUNT, + tagCount: INITIAL_TAG_COUNT, + allocateTag: function() { + for (;this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount); ) ReactNativeTagHandles.tagCount++; + var tag = ReactNativeTagHandles.tagCount; + return ReactNativeTagHandles.tagCount++, tag; + }, + assertRootTag: function(tag) { + invariant(this.reactTagIsNativeTopRootID(tag), "Expect a native root tag, instead got %s", tag); + }, + reactTagIsNativeTopRootID: function(reactTag) { + return reactTag % 10 == 1; + } + }, ReactNativeTagHandles_1 = ReactNativeTagHandles, _extends$1 = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + } + return target; + }, EMPTY_NATIVE_EVENT = {}, touchSubsequence = function(touches, indices) { + for (var ret = [], i = 0; i < indices.length; i++) ret.push(touches[indices[i]]); + return ret; + }, removeTouchesAtIndices = function(touches, indices) { + for (var rippedOut = [], temp = touches, i = 0; i < indices.length; i++) { + var index = indices[i]; + rippedOut.push(touches[index]), temp[index] = null; + } + for (var fillAt = 0, j = 0; j < temp.length; j++) { + var cur = temp[j]; + null !== cur && (temp[fillAt++] = cur); + } + return temp.length = fillAt, rippedOut; + }, ReactNativeEventEmitter = _extends$1({}, ReactEventEmitterMixin_1, { + registrationNames: EventPluginRegistry_1.registrationNameModules, + getListener: EventPluginHub_1.getListener, + _receiveRootNodeIDEvent: function(rootNodeID, topLevelType, nativeEventParam) { + var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT, inst = ReactNativeComponentTree_1.getInstanceFromNode(rootNodeID); + ReactGenericBatching_1.batchedUpdates(function() { + ReactNativeEventEmitter.handleTopLevel(topLevelType, inst, nativeEvent, nativeEvent.target); + }); + }, + receiveEvent: function(tag, topLevelType, nativeEventParam) { + var rootNodeID = tag; + ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); + }, + receiveTouches: function(eventTopLevelType, touches, changedIndices) { + for (var changedTouches = "topTouchEnd" === eventTopLevelType || "topTouchCancel" === eventTopLevelType ? removeTouchesAtIndices(touches, changedIndices) : touchSubsequence(touches, changedIndices), jj = 0; jj < changedTouches.length; jj++) { + var touch = changedTouches[jj]; + touch.changedTouches = changedTouches, touch.touches = touches; + var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; + null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), + ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); + } + } + }), ReactNativeEventEmitter_1 = ReactNativeEventEmitter, ReactNativeEventPluginOrder = [ "ResponderEventPlugin", "ReactNativeBridgeEventPlugin" ], ReactNativeEventPluginOrder_1 = ReactNativeEventPluginOrder, ReactNativeGlobalResponderHandler = { + onChange: function(from, to, blockNativeResponder) { + if (null !== to) { + var tag = "number" != typeof to.tag ? to._rootNodeID : to.stateNode._nativeTag; + UIManager.setJSResponder(tag, blockNativeResponder); + } else UIManager.clearJSResponder(); + } + }, ReactNativeGlobalResponderHandler_1 = ReactNativeGlobalResponderHandler, ResponderEventInterface = { + touchHistory: function(nativeEvent) { + return null; + } + }; + function ResponderSyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + SyntheticEvent_1.augmentClass(ResponderSyntheticEvent, ResponderEventInterface); + var ResponderSyntheticEvent_1 = ResponderSyntheticEvent, isEndish$2 = EventPluginUtils_1.isEndish, isMoveish$2 = EventPluginUtils_1.isMoveish, isStartish$2 = EventPluginUtils_1.isStartish, MAX_TOUCH_BANK = 20, touchBank = [], touchHistory = { + touchBank: touchBank, + numberActiveTouches: 0, + indexOfSingleActiveTouch: -1, + mostRecentTimeStamp: 0 + }; + function timestampForTouch(touch) { + return touch.timeStamp || touch.timestamp; + } + function createTouchRecord(touch) { + return { + touchActive: !0, + startPageX: touch.pageX, + startPageY: touch.pageY, + startTimeStamp: timestampForTouch(touch), + currentPageX: touch.pageX, + currentPageY: touch.pageY, + currentTimeStamp: timestampForTouch(touch), + previousPageX: touch.pageX, + previousPageY: touch.pageY, + previousTimeStamp: timestampForTouch(touch) + }; + } + function resetTouchRecord(touchRecord, touch) { + touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, + touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, + touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), + touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, + touchRecord.previousTimeStamp = timestampForTouch(touch); + } + function getTouchIdentifier(_ref) { + var identifier = _ref.identifier; + return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), + identifier; + } + function recordTouchStart(touch) { + var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; + touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } + function recordTouchMove(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + function recordTouchEnd(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + function printTouch(touch) { + return JSON.stringify({ + identifier: touch.identifier, + pageX: touch.pageX, + pageY: touch.pageY, + timestamp: timestampForTouch(touch) }); - }, - receiveEvent: function(tag, topLevelType, nativeEventParam) { - var rootNodeID = tag; - ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); - }, - receiveTouches: function(eventTopLevelType, touches, changedIndices) { - for (var changedTouches = "topTouchEnd" === eventTopLevelType || "topTouchCancel" === eventTopLevelType ? removeTouchesAtIndices(touches, changedIndices) : touchSubsequence(touches, changedIndices), jj = 0; jj < changedTouches.length; jj++) { - var touch = changedTouches[jj]; - touch.changedTouches = changedTouches, touch.touches = touches; - var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; - null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), - ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); + } + function printTouchBank() { + var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); + return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), + printed; + } + var ResponderTouchHistoryStore = { + recordTouchTrack: function(topLevelType, nativeEvent) { + if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) { + for (var i = 0; i < touchBank.length; i++) { + var touchTrackToCheck = touchBank[i]; + if (null != touchTrackToCheck && touchTrackToCheck.touchActive) { + touchHistory.indexOfSingleActiveTouch = i; + break; + } + } + var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; + warning(null != activeRecord && activeRecord.touchActive, "Cannot find single active touch."); + } + }, + touchHistory: touchHistory + }, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; + function accumulate(current, next) { + return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), + null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; + } + var accumulate_1 = accumulate, isStartish$1 = EventPluginUtils_1.isStartish, isMoveish$1 = EventPluginUtils_1.isMoveish, isEndish$1 = EventPluginUtils_1.isEndish, executeDirectDispatch$1 = EventPluginUtils_1.executeDirectDispatch, hasDispatches$1 = EventPluginUtils_1.hasDispatches, executeDispatchesInOrderStopAtTrue$1 = EventPluginUtils_1.executeDispatchesInOrderStopAtTrue, responderInst = null, trackedTouchCount = 0, previousActiveTouches = 0, changeResponder = function(nextResponderInst, blockHostResponder) { + var oldResponderInst = responderInst; + responderInst = nextResponderInst, null !== ResponderEventPlugin.GlobalResponderHandler && ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); + }, eventTypes = { + startShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onStartShouldSetResponder", + captured: "onStartShouldSetResponderCapture" + } + }, + scrollShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onScrollShouldSetResponder", + captured: "onScrollShouldSetResponderCapture" + } + }, + selectionChangeShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onSelectionChangeShouldSetResponder", + captured: "onSelectionChangeShouldSetResponderCapture" + } + }, + moveShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onMoveShouldSetResponder", + captured: "onMoveShouldSetResponderCapture" + } + }, + responderStart: { + registrationName: "onResponderStart" + }, + responderMove: { + registrationName: "onResponderMove" + }, + responderEnd: { + registrationName: "onResponderEnd" + }, + responderRelease: { + registrationName: "onResponderRelease" + }, + responderTerminationRequest: { + registrationName: "onResponderTerminationRequest" + }, + responderGrant: { + registrationName: "onResponderGrant" + }, + responderReject: { + registrationName: "onResponderReject" + }, + responderTerminate: { + registrationName: "onResponderTerminate" + } + }; + function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); + shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); + var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); + if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), + !wantsResponderInst || wantsResponderInst === responderInst) return null; + var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); + grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); + var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); + if (responderInst) { + var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, + EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); + var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); + if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), + shouldSwitch) { + var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); + terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), + extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); + } else { + var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); + rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), + extracted = accumulate_1(extracted, rejectEvent); + } + } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); + return extracted; + } + function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { + return topLevelInst && ("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && "topSelectionChange" === topLevelType || isStartish$1(topLevelType) || isMoveish$1(topLevelType)); + } + function noResponderTouches(nativeEvent) { + var touches = nativeEvent.touches; + if (!touches || 0 === touches.length) return !0; + for (var i = 0; i < touches.length; i++) { + var activeTouch = touches[i], target = activeTouch.target; + if (null !== target && void 0 !== target && 0 !== target) { + var targetInst = EventPluginUtils_1.getInstanceFromNode(target); + if (ReactTreeTraversal.isAncestor(responderInst, targetInst)) return !1; + } + } + return !0; + } + var ResponderEventPlugin = { + _getResponder: function() { + return responderInst; + }, + eventTypes: eventTypes, + extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { + if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), + null; + trackedTouchCount -= 1; + } + ResponderTouchHistoryStore_1.recordTouchTrack(topLevelType, nativeEvent); + var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; + if (incrementalTouch) { + var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); + gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), + extracted = accumulate_1(extracted, gesture); + } + var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; + if (finalTouch) { + var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); + finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), + extracted = accumulate_1(extracted, finalEvent), changeResponder(null); + } + var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; + return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), + previousActiveTouches = numberActiveTouches, extracted; + }, + GlobalResponderHandler: null, + GlobalInteractionHandler: null, + injection: { + injectGlobalResponderHandler: function(GlobalResponderHandler) { + ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + }, + injectGlobalInteractionHandler: function(GlobalInteractionHandler) { + ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler; + } + } + }, ResponderEventPlugin_1 = ResponderEventPlugin; + function inject() { + RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), + EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), + EventPluginHub_1.injection.injectEventPluginsByName({ + ResponderEventPlugin: ResponderEventPlugin_1, + ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 + }); + } + var ReactNativeInjection = { + inject: inject + }, REACT_PORTAL_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.portal") || 60106, createPortal = function(children, containerInfo, implementation) { + var key = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null; + return { + $$typeof: REACT_PORTAL_TYPE, + key: null == key ? null : "" + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; + }, isPortal = function(object) { + return "object" == typeof object && null !== object && object.$$typeof === REACT_PORTAL_TYPE; + }, REACT_PORTAL_TYPE_1 = REACT_PORTAL_TYPE, ReactPortal = { + createPortal: createPortal, + isPortal: isPortal, + REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1 + }, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = { + disableNewFiberFeatures: !1, + enableAsyncSubtreeAPI: !1 + }, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = { + NoEffect: 0, + PerformedWork: 1, + Placement: 2, + Update: 4, + PlacementAndUpdate: 6, + Deletion: 8, + ContentReset: 16, + Callback: 32, + Err: 64, + Ref: 128 + }, ReactPriorityLevel = { + NoWork: 0, + SynchronousPriority: 1, + TaskPriority: 2, + HighPriority: 3, + LowPriority: 4, + OffscreenPriority: 5 + }, CallbackEffect = ReactTypeOfSideEffect.Callback, NoWork = ReactPriorityLevel.NoWork, SynchronousPriority = ReactPriorityLevel.SynchronousPriority, TaskPriority = ReactPriorityLevel.TaskPriority, warning$3 = warning; + function comparePriority(a, b) { + return a !== TaskPriority && a !== SynchronousPriority || b !== TaskPriority && b !== SynchronousPriority ? a === NoWork && b !== NoWork ? -255 : a !== NoWork && b === NoWork ? 255 : a - b : 0; + } + function ensureUpdateQueue(fiber) { + if (null !== fiber.updateQueue) return fiber.updateQueue; + var queue = void 0; + return queue = { + first: null, + last: null, + hasForceUpdate: !1, + callbackList: null, + isProcessing: !1 + }, fiber.updateQueue = queue, queue; + } + function cloneUpdateQueue(current, workInProgress) { + var currentQueue = current.updateQueue; + if (null === currentQueue) return workInProgress.updateQueue = null, null; + var altQueue = null !== workInProgress.updateQueue ? workInProgress.updateQueue : {}; + return altQueue.first = currentQueue.first, altQueue.last = currentQueue.last, altQueue.hasForceUpdate = !1, + altQueue.callbackList = null, altQueue.isProcessing = !1, workInProgress.updateQueue = altQueue, + altQueue; + } + var cloneUpdateQueue_1 = cloneUpdateQueue; + function cloneUpdate(update) { + return { + priorityLevel: update.priorityLevel, + partialState: update.partialState, + callback: update.callback, + isReplace: update.isReplace, + isForced: update.isForced, + isTopLevelUnmount: update.isTopLevelUnmount, + next: null + }; + } + function insertUpdateIntoQueue(queue, update, insertAfter, insertBefore) { + null !== insertAfter ? insertAfter.next = update : (update.next = queue.first, queue.first = update), + null !== insertBefore ? update.next = insertBefore : queue.last = update; + } + function findInsertionPosition(queue, update) { + var priorityLevel = update.priorityLevel, insertAfter = null, insertBefore = null; + if (null !== queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) insertAfter = queue.last; else for (insertBefore = queue.first; null !== insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0; ) insertAfter = insertBefore, + insertBefore = insertBefore.next; + return insertAfter; + } + function insertUpdate(fiber, update) { + var queue1 = ensureUpdateQueue(fiber), queue2 = null !== fiber.alternate ? ensureUpdateQueue(fiber.alternate) : null; + (queue1.isProcessing || null !== queue2 && queue2.isProcessing) && warning$3(!1, "An update (setState, replaceState, or forceUpdate) was scheduled " + "from inside an update function. Update functions should be pure, " + "with zero side-effects. Consider using componentDidUpdate or a " + "callback."); + var insertAfter1 = findInsertionPosition(queue1, update), insertBefore1 = null !== insertAfter1 ? insertAfter1.next : queue1.first; + if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), + null; + var insertAfter2 = findInsertionPosition(queue2, update), insertBefore2 = null !== insertAfter2 ? insertAfter2.next : queue2.first; + if (insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), insertBefore1 !== insertBefore2) { + var update2 = cloneUpdate(update); + return insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2), update2; + } + return null === insertAfter2 && (queue2.first = update), null === insertBefore2 && (queue2.last = null), + null; + } + function addUpdate(fiber, partialState, callback, priorityLevel) { + insertUpdate(fiber, { + priorityLevel: priorityLevel, + partialState: partialState, + callback: callback, + isReplace: !1, + isForced: !1, + isTopLevelUnmount: !1, + next: null + }); + } + var addUpdate_1 = addUpdate; + function addReplaceUpdate(fiber, state, callback, priorityLevel) { + insertUpdate(fiber, { + priorityLevel: priorityLevel, + partialState: state, + callback: callback, + isReplace: !0, + isForced: !1, + isTopLevelUnmount: !1, + next: null + }); + } + var addReplaceUpdate_1 = addReplaceUpdate; + function addForceUpdate(fiber, callback, priorityLevel) { + insertUpdate(fiber, { + priorityLevel: priorityLevel, + partialState: null, + callback: callback, + isReplace: !1, + isForced: !0, + isTopLevelUnmount: !1, + next: null + }); + } + var addForceUpdate_1 = addForceUpdate; + function getPendingPriority(queue) { + return null !== queue.first ? queue.first.priorityLevel : NoWork; + } + var getPendingPriority_1 = getPendingPriority; + function addTopLevelUpdate$1(fiber, partialState, callback, priorityLevel) { + var isTopLevelUnmount = null === partialState.element, update = { + priorityLevel: priorityLevel, + partialState: partialState, + callback: callback, + isReplace: !1, + isForced: !1, + isTopLevelUnmount: isTopLevelUnmount, + next: null + }, update2 = insertUpdate(fiber, update); + if (isTopLevelUnmount) { + var queue1 = fiber.updateQueue, queue2 = null !== fiber.alternate ? fiber.alternate.updateQueue : null; + null !== queue1 && null !== update.next && (update.next = null, queue1.last = update), + null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null, + queue2.last = update); } } -}), ReactNativeEventEmitter_1 = ReactNativeEventEmitter, ReactNativeEventPluginOrder = [ "ResponderEventPlugin", "ReactNativeBridgeEventPlugin" ], ReactNativeEventPluginOrder_1 = ReactNativeEventPluginOrder, ReactNativeGlobalResponderHandler = { - onChange: function(from, to, blockNativeResponder) { - if (null !== to) { - var tag = "number" != typeof to.tag ? to._rootNodeID : to.stateNode._nativeTag; - UIManager.setJSResponder(tag, blockNativeResponder); - } else UIManager.clearJSResponder(); + var addTopLevelUpdate_1 = addTopLevelUpdate$1; + function getStateFromUpdate(update, instance, prevState, props) { + var partialState = update.partialState; + if ("function" == typeof partialState) { + return partialState.call(instance, prevState, props); + } + return partialState; } -}, ReactNativeGlobalResponderHandler_1 = ReactNativeGlobalResponderHandler, ResponderEventInterface = { - touchHistory: function(nativeEvent) { + function beginUpdateQueue(workInProgress, queue, instance, prevState, props, priorityLevel) { + queue.isProcessing = !0, queue.hasForceUpdate = !1; + for (var state = prevState, dontMutatePrevState = !0, callbackList = queue.callbackList, update = queue.first; null !== update && comparePriority(update.priorityLevel, priorityLevel) <= 0; ) { + queue.first = update.next, null === queue.first && (queue.last = null); + var _partialState = void 0; + update.isReplace ? (state = getStateFromUpdate(update, instance, state, props), + dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState), + dontMutatePrevState = !1), update.isForced && (queue.hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = callbackList || [], + callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect), + update = update.next; + } + return queue.callbackList = callbackList, null !== queue.first || null !== callbackList || queue.hasForceUpdate || (workInProgress.updateQueue = null), + queue.isProcessing = !1, state; + } + var beginUpdateQueue_1 = beginUpdateQueue; + function commitCallbacks(finishedWork, queue, context) { + var callbackList = queue.callbackList; + if (null !== callbackList) for (var i = 0; i < callbackList.length; i++) { + var _callback = callbackList[i]; + invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback), + _callback.call(context); + } + } + var commitCallbacks_1 = commitCallbacks, ReactFiberUpdateQueue = { + cloneUpdateQueue: cloneUpdateQueue_1, + addUpdate: addUpdate_1, + addReplaceUpdate: addReplaceUpdate_1, + addForceUpdate: addForceUpdate_1, + getPendingPriority: getPendingPriority_1, + addTopLevelUpdate: addTopLevelUpdate_1, + beginUpdateQueue: beginUpdateQueue_1, + commitCallbacks: commitCallbacks_1 + }; + function getComponentName$1(instanceOrFiber) { + if ("function" == typeof instanceOrFiber.getName) { + return instanceOrFiber.getName(); + } + if ("number" == typeof instanceOrFiber.tag) { + var fiber = instanceOrFiber, type = fiber.type; + if ("string" == typeof type) return type; + if ("function" == typeof type) return type.displayName || type.name; + } return null; } -}; - -function ResponderSyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent_1.augmentClass(ResponderSyntheticEvent, ResponderEventInterface); - -var ResponderSyntheticEvent_1 = ResponderSyntheticEvent, isEndish$2 = EventPluginUtils_1.isEndish, isMoveish$2 = EventPluginUtils_1.isMoveish, isStartish$2 = EventPluginUtils_1.isStartish, MAX_TOUCH_BANK = 20, touchBank = [], touchHistory = { - touchBank: touchBank, - numberActiveTouches: 0, - indexOfSingleActiveTouch: -1, - mostRecentTimeStamp: 0 -}; - -function timestampForTouch(touch) { - return touch.timeStamp || touch.timestamp; -} - -function createTouchRecord(touch) { - return { - touchActive: !0, - startPageX: touch.pageX, - startPageY: touch.pageY, - startTimeStamp: timestampForTouch(touch), - currentPageX: touch.pageX, - currentPageY: touch.pageY, - currentTimeStamp: timestampForTouch(touch), - previousPageX: touch.pageX, - previousPageY: touch.pageY, - previousTimeStamp: timestampForTouch(touch) - }; -} - -function resetTouchRecord(touchRecord, touch) { - touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, - touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, - touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), - touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, - touchRecord.previousTimeStamp = timestampForTouch(touch); -} - -function getTouchIdentifier(_ref) { - var identifier = _ref.identifier; - return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), - identifier; -} - -function recordTouchStart(touch) { - var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; - touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), - touchHistory.mostRecentTimeStamp = timestampForTouch(touch); -} - -function recordTouchMove(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, - touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); -} - -function recordTouchEnd(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, - touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); -} - -function printTouch(touch) { - return JSON.stringify({ - identifier: touch.identifier, - pageX: touch.pageX, - pageY: touch.pageY, - timestamp: timestampForTouch(touch) - }); -} - -function printTouchBank() { - var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); - return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), - printed; -} - -var ResponderTouchHistoryStore = { - recordTouchTrack: function(topLevelType, nativeEvent) { - if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) { - for (var i = 0; i < touchBank.length; i++) { - var touchTrackToCheck = touchBank[i]; - if (null != touchTrackToCheck && touchTrackToCheck.touchActive) { - touchHistory.indexOfSingleActiveTouch = i; - break; - } - } - var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; - warning(null != activeRecord && activeRecord.touchActive, "Cannot find single active touch."); - } - }, - touchHistory: touchHistory -}, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; - -function accumulate(current, next) { - return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), - null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; -} - -var accumulate_1 = accumulate, isStartish$1 = EventPluginUtils_1.isStartish, isMoveish$1 = EventPluginUtils_1.isMoveish, isEndish$1 = EventPluginUtils_1.isEndish, executeDirectDispatch$1 = EventPluginUtils_1.executeDirectDispatch, hasDispatches$1 = EventPluginUtils_1.hasDispatches, executeDispatchesInOrderStopAtTrue$1 = EventPluginUtils_1.executeDispatchesInOrderStopAtTrue, responderInst = null, trackedTouchCount = 0, previousActiveTouches = 0, changeResponder = function(nextResponderInst, blockHostResponder) { - var oldResponderInst = responderInst; - responderInst = nextResponderInst, null !== ResponderEventPlugin.GlobalResponderHandler && ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); -}, eventTypes = { - startShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onStartShouldSetResponder", - captured: "onStartShouldSetResponderCapture" - } - }, - scrollShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onScrollShouldSetResponder", - captured: "onScrollShouldSetResponderCapture" - } - }, - selectionChangeShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onSelectionChangeShouldSetResponder", - captured: "onSelectionChangeShouldSetResponderCapture" - } - }, - moveShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onMoveShouldSetResponder", - captured: "onMoveShouldSetResponderCapture" - } - }, - responderStart: { - registrationName: "onResponderStart" - }, - responderMove: { - registrationName: "onResponderMove" - }, - responderEnd: { - registrationName: "onResponderEnd" - }, - responderRelease: { - registrationName: "onResponderRelease" - }, - responderTerminationRequest: { - registrationName: "onResponderTerminationRequest" - }, - responderGrant: { - registrationName: "onResponderGrant" - }, - responderReject: { - registrationName: "onResponderReject" - }, - responderTerminate: { - registrationName: "onResponderTerminate" - } -}; - -function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); - shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); - var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); - if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), - !wantsResponderInst || wantsResponderInst === responderInst) return null; - var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); - grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); - var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); - if (responderInst) { - var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); - terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, - EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); - var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); - if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), - shouldSwitch) { - var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); - terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), - extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); - } else { - var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); - rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), - extracted = accumulate_1(extracted, rejectEvent); - } - } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); - return extracted; -} - -function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { - return topLevelInst && ("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && "topSelectionChange" === topLevelType || isStartish$1(topLevelType) || isMoveish$1(topLevelType)); -} - -function noResponderTouches(nativeEvent) { - var touches = nativeEvent.touches; - if (!touches || 0 === touches.length) return !0; - for (var i = 0; i < touches.length; i++) { - var activeTouch = touches[i], target = activeTouch.target; - if (null !== target && void 0 !== target && 0 !== target) { - var targetInst = EventPluginUtils_1.getInstanceFromNode(target); - if (ReactTreeTraversal.isAncestor(responderInst, targetInst)) return !1; - } - } - return !0; -} - -var ResponderEventPlugin = { - _getResponder: function() { - return responderInst; - }, - eventTypes: eventTypes, - extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { - if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), - null; - trackedTouchCount -= 1; - } - ResponderTouchHistoryStore_1.recordTouchTrack(topLevelType, nativeEvent); - var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; - if (incrementalTouch) { - var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); - gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), - extracted = accumulate_1(extracted, gesture); - } - var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; - if (finalTouch) { - var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); - finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), - extracted = accumulate_1(extracted, finalEvent), changeResponder(null); - } - var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; - return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), - previousActiveTouches = numberActiveTouches, extracted; - }, - GlobalResponderHandler: null, - GlobalInteractionHandler: null, - injection: { - injectGlobalResponderHandler: function(GlobalResponderHandler) { - ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + var getComponentName_1 = getComponentName$1, ReactInstanceMap = { + remove: function(key) { + key._reactInternalInstance = void 0; }, - injectGlobalInteractionHandler: function(GlobalInteractionHandler) { - ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler; + get: function(key) { + return key._reactInternalInstance; + }, + has: function(key) { + return void 0 !== key._reactInternalInstance; + }, + set: function(key, value) { + key._reactInternalInstance = value; } - } -}, ResponderEventPlugin_1 = ResponderEventPlugin; - -function inject() { - RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), - EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), - EventPluginHub_1.injection.injectEventPluginsByName({ - ResponderEventPlugin: ResponderEventPlugin_1, - ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 - }); -} - -var ReactNativeInjection = { - inject: inject -}, REACT_PORTAL_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.portal") || 60106, createPortal = function(children, containerInfo, implementation) { - var key = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null; - return { - $$typeof: REACT_PORTAL_TYPE, - key: null == key ? null : "" + key, - children: children, - containerInfo: containerInfo, - implementation: implementation + }, ReactInstanceMap_1 = ReactInstanceMap, ReactInternals = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = { + ReactCurrentOwner: ReactInternals.ReactCurrentOwner }; -}, isPortal = function(object) { - return "object" == typeof object && null !== object && object.$$typeof === REACT_PORTAL_TYPE; -}, REACT_PORTAL_TYPE_1 = REACT_PORTAL_TYPE, ReactPortal = { - createPortal: createPortal, - isPortal: isPortal, - REACT_PORTAL_TYPE: REACT_PORTAL_TYPE_1 -}, commonjsGlobal = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {}, ReactFeatureFlags = { - disableNewFiberFeatures: !1, - enableAsyncSubtreeAPI: !1 -}, ReactFeatureFlags_1 = ReactFeatureFlags, ReactTypeOfSideEffect = { - NoEffect: 0, - PerformedWork: 1, - Placement: 2, - Update: 4, - PlacementAndUpdate: 6, - Deletion: 8, - ContentReset: 16, - Callback: 32, - Err: 64, - Ref: 128 -}, ReactPriorityLevel = { - NoWork: 0, - SynchronousPriority: 1, - TaskPriority: 2, - AnimationPriority: 3, - HighPriority: 4, - LowPriority: 5, - OffscreenPriority: 6 -}, CallbackEffect = ReactTypeOfSideEffect.Callback, NoWork = ReactPriorityLevel.NoWork, SynchronousPriority = ReactPriorityLevel.SynchronousPriority, TaskPriority = ReactPriorityLevel.TaskPriority, warning$3 = warning; - -function comparePriority(a, b) { - return a !== TaskPriority && a !== SynchronousPriority || b !== TaskPriority && b !== SynchronousPriority ? a === NoWork && b !== NoWork ? -255 : a !== NoWork && b === NoWork ? 255 : a - b : 0; -} - -function ensureUpdateQueue(fiber) { - if (null !== fiber.updateQueue) return fiber.updateQueue; - var queue = void 0; - return queue = { - first: null, - last: null, - hasForceUpdate: !1, - callbackList: null, - isProcessing: !1 - }, fiber.updateQueue = queue, queue; -} - -function cloneUpdateQueue(current, workInProgress) { - var currentQueue = current.updateQueue; - if (null === currentQueue) return workInProgress.updateQueue = null, null; - var altQueue = null !== workInProgress.updateQueue ? workInProgress.updateQueue : {}; - return altQueue.first = currentQueue.first, altQueue.last = currentQueue.last, altQueue.hasForceUpdate = !1, - altQueue.callbackList = null, altQueue.isProcessing = !1, workInProgress.updateQueue = altQueue, - altQueue; -} - -var cloneUpdateQueue_1 = cloneUpdateQueue; - -function cloneUpdate(update) { - return { - priorityLevel: update.priorityLevel, - partialState: update.partialState, - callback: update.callback, - isReplace: update.isReplace, - isForced: update.isForced, - isTopLevelUnmount: update.isTopLevelUnmount, - next: null - }; -} - -function insertUpdateIntoQueue(queue, update, insertAfter, insertBefore) { - null !== insertAfter ? insertAfter.next = update : (update.next = queue.first, queue.first = update), - null !== insertBefore ? update.next = insertBefore : queue.last = update; -} - -function findInsertionPosition(queue, update) { - var priorityLevel = update.priorityLevel, insertAfter = null, insertBefore = null; - if (null !== queue.last && comparePriority(queue.last.priorityLevel, priorityLevel) <= 0) insertAfter = queue.last; else for (insertBefore = queue.first; null !== insertBefore && comparePriority(insertBefore.priorityLevel, priorityLevel) <= 0; ) insertAfter = insertBefore, - insertBefore = insertBefore.next; - return insertAfter; -} - -function insertUpdate(fiber, update) { - var queue1 = ensureUpdateQueue(fiber), queue2 = null !== fiber.alternate ? ensureUpdateQueue(fiber.alternate) : null; - (queue1.isProcessing || null !== queue2 && queue2.isProcessing) && warning$3(!1, "An update (setState, replaceState, or forceUpdate) was scheduled " + "from inside an update function. Update functions should be pure, " + "with zero side-effects. Consider using componentDidUpdate or a " + "callback."); - var insertAfter1 = findInsertionPosition(queue1, update), insertBefore1 = null !== insertAfter1 ? insertAfter1.next : queue1.first; - if (null === queue2) return insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), - null; - var insertAfter2 = findInsertionPosition(queue2, update), insertBefore2 = null !== insertAfter2 ? insertAfter2.next : queue2.first; - if (insertUpdateIntoQueue(queue1, update, insertAfter1, insertBefore1), insertBefore1 !== insertBefore2) { - var update2 = cloneUpdate(update); - return insertUpdateIntoQueue(queue2, update2, insertAfter2, insertBefore2), update2; - } - return null === insertAfter2 && (queue2.first = update), null === insertBefore2 && (queue2.last = null), - null; -} - -function addUpdate(fiber, partialState, callback, priorityLevel) { - insertUpdate(fiber, { - priorityLevel: priorityLevel, - partialState: partialState, - callback: callback, - isReplace: !1, - isForced: !1, - isTopLevelUnmount: !1, - next: null + Object.assign(ReactGlobalSharedState, { + ReactComponentTreeHook: ReactInternals.ReactComponentTreeHook, + ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame }); -} - -var addUpdate_1 = addUpdate; - -function addReplaceUpdate(fiber, state, callback, priorityLevel) { - insertUpdate(fiber, { - priorityLevel: priorityLevel, - partialState: state, - callback: callback, - isReplace: !0, - isForced: !1, - isTopLevelUnmount: !1, - next: null - }); -} - -var addReplaceUpdate_1 = addReplaceUpdate; - -function addForceUpdate(fiber, callback, priorityLevel) { - insertUpdate(fiber, { - priorityLevel: priorityLevel, - partialState: null, - callback: callback, - isReplace: !1, - isForced: !0, - isTopLevelUnmount: !1, - next: null - }); -} - -var addForceUpdate_1 = addForceUpdate; - -function getPendingPriority(queue) { - return null !== queue.first ? queue.first.priorityLevel : NoWork; -} - -var getPendingPriority_1 = getPendingPriority; - -function addTopLevelUpdate$1(fiber, partialState, callback, priorityLevel) { - var isTopLevelUnmount = null === partialState.element, update = { - priorityLevel: priorityLevel, - partialState: partialState, - callback: callback, - isReplace: !1, - isForced: !1, - isTopLevelUnmount: isTopLevelUnmount, - next: null - }, update2 = insertUpdate(fiber, update); - if (isTopLevelUnmount) { - var queue1 = fiber.updateQueue, queue2 = null !== fiber.alternate ? fiber.alternate.updateQueue : null; - null !== queue1 && null !== update.next && (update.next = null, queue1.last = update), - null !== queue2 && null !== update2 && null !== update2.next && (update2.next = null, - queue2.last = update); - } -} - -var addTopLevelUpdate_1 = addTopLevelUpdate$1; - -function getStateFromUpdate(update, instance, prevState, props) { - var partialState = update.partialState; - if ("function" == typeof partialState) { - return partialState.call(instance, prevState, props); - } - return partialState; -} - -function beginUpdateQueue(workInProgress, queue, instance, prevState, props, priorityLevel) { - queue.isProcessing = !0, queue.hasForceUpdate = !1; - for (var state = prevState, dontMutatePrevState = !0, callbackList = queue.callbackList, update = queue.first; null !== update && comparePriority(update.priorityLevel, priorityLevel) <= 0; ) { - queue.first = update.next, null === queue.first && (queue.last = null); - var _partialState = void 0; - update.isReplace ? (state = getStateFromUpdate(update, instance, state, props), - dontMutatePrevState = !0) : (_partialState = getStateFromUpdate(update, instance, state, props)) && (state = dontMutatePrevState ? Object.assign({}, state, _partialState) : Object.assign(state, _partialState), - dontMutatePrevState = !1), update.isForced && (queue.hasForceUpdate = !0), null === update.callback || update.isTopLevelUnmount && null !== update.next || (callbackList = callbackList || [], - callbackList.push(update.callback), workInProgress.effectTag |= CallbackEffect), - update = update.next; - } - return queue.callbackList = callbackList, null !== queue.first || null !== callbackList || queue.hasForceUpdate || (workInProgress.updateQueue = null), - queue.isProcessing = !1, state; -} - -var beginUpdateQueue_1 = beginUpdateQueue; - -function commitCallbacks(finishedWork, queue, context) { - var callbackList = queue.callbackList; - if (null !== callbackList) for (var i = 0; i < callbackList.length; i++) { - var _callback = callbackList[i]; - invariant("function" == typeof _callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", _callback), - _callback.call(context); - } -} - -var commitCallbacks_1 = commitCallbacks, ReactFiberUpdateQueue = { - cloneUpdateQueue: cloneUpdateQueue_1, - addUpdate: addUpdate_1, - addReplaceUpdate: addReplaceUpdate_1, - addForceUpdate: addForceUpdate_1, - getPendingPriority: getPendingPriority_1, - addTopLevelUpdate: addTopLevelUpdate_1, - beginUpdateQueue: beginUpdateQueue_1, - commitCallbacks: commitCallbacks_1 -}; - -function getComponentName$1(instanceOrFiber) { - if ("function" == typeof instanceOrFiber.getName) { - return instanceOrFiber.getName(); - } - if ("number" == typeof instanceOrFiber.tag) { - var fiber = instanceOrFiber, type = fiber.type; - if ("string" == typeof type) return type; - if ("function" == typeof type) return type.displayName || type.name; - } - return null; -} - -var getComponentName_1 = getComponentName$1, ReactInstanceMap = { - remove: function(key) { - key._reactInternalInstance = void 0; - }, - get: function(key) { - return key._reactInternalInstance; - }, - has: function(key) { - return void 0 !== key._reactInternalInstance; - }, - set: function(key, value) { - key._reactInternalInstance = value; - } -}, ReactInstanceMap_1 = ReactInstanceMap, ReactInternals = react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = { - ReactCurrentOwner: ReactInternals.ReactCurrentOwner -}; - -Object.assign(ReactGlobalSharedState, { - ReactComponentTreeHook: ReactInternals.ReactComponentTreeHook, - ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame -}); - -var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$4 = warning, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, ClassComponent$1 = ReactTypeOfWork.ClassComponent, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; - -function isFiberMountedImpl(fiber) { - var node = fiber; - if (fiber.alternate) for (;node.return; ) node = node.return; else { - if ((node.effectTag & Placement) !== NoEffect) return MOUNTING; - for (;node.return; ) if (node = node.return, (node.effectTag & Placement) !== NoEffect) return MOUNTING; - } - return node.tag === HostRoot$1 ? MOUNTED : UNMOUNTED; -} - -var isFiberMounted$1 = function(fiber) { - return isFiberMountedImpl(fiber) === MOUNTED; -}, isMounted = function(component) { - var owner = ReactCurrentOwner.current; - if (null !== owner && owner.tag === ClassComponent$1) { - var ownerFiber = owner, instance = ownerFiber.stateNode; - warning$4(instance._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentName_1(ownerFiber) || "A component"), - instance._warnedAboutRefsInRender = !0; - } - var fiber = ReactInstanceMap_1.get(component); - return !!fiber && isFiberMountedImpl(fiber) === MOUNTED; -}; - -function assertIsMounted(fiber) { - invariant(isFiberMountedImpl(fiber) === MOUNTED, "Unable to find node on an unmounted component."); -} - -function findCurrentFiberUsingSlowPath(fiber) { - var alternate = fiber.alternate; - if (!alternate) { - var state = isFiberMountedImpl(fiber); - return invariant(state !== UNMOUNTED, "Unable to find node on an unmounted component."), - state === MOUNTING ? null : fiber; - } - for (var a = fiber, b = alternate; !0; ) { - var parentA = a.return, parentB = parentA ? parentA.alternate : null; - if (!parentA || !parentB) break; - if (parentA.child === parentB.child) { - for (var child = parentA.child; child; ) { - if (child === a) return assertIsMounted(parentA), fiber; - if (child === b) return assertIsMounted(parentA), alternate; - child = child.sibling; - } - invariant(!1, "Unable to find node on an unmounted component."); + var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$4 = warning, HostRoot$1 = ReactTypeOfWork.HostRoot, HostComponent$2 = ReactTypeOfWork.HostComponent, HostText = ReactTypeOfWork.HostText, ClassComponent$1 = ReactTypeOfWork.ClassComponent, NoEffect = ReactTypeOfSideEffect.NoEffect, Placement = ReactTypeOfSideEffect.Placement, MOUNTING = 1, MOUNTED = 2, UNMOUNTED = 3; + function isFiberMountedImpl(fiber) { + var node = fiber; + if (fiber.alternate) for (;node.return; ) node = node.return; else { + if ((node.effectTag & Placement) !== NoEffect) return MOUNTING; + for (;node.return; ) if (node = node.return, (node.effectTag & Placement) !== NoEffect) return MOUNTING; } - if (a.return !== b.return) a = parentA, b = parentB; else { - for (var didFindChild = !1, _child = parentA.child; _child; ) { - if (_child === a) { - didFindChild = !0, a = parentA, b = parentB; - break; + return node.tag === HostRoot$1 ? MOUNTED : UNMOUNTED; + } + var isFiberMounted$1 = function(fiber) { + return isFiberMountedImpl(fiber) === MOUNTED; + }, isMounted = function(component) { + var owner = ReactCurrentOwner.current; + if (null !== owner && owner.tag === ClassComponent$1) { + var ownerFiber = owner, instance = ownerFiber.stateNode; + warning$4(instance._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", getComponentName_1(ownerFiber) || "A component"), + instance._warnedAboutRefsInRender = !0; + } + var fiber = ReactInstanceMap_1.get(component); + return !!fiber && isFiberMountedImpl(fiber) === MOUNTED; + }; + function assertIsMounted(fiber) { + invariant(isFiberMountedImpl(fiber) === MOUNTED, "Unable to find node on an unmounted component."); + } + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + if (!alternate) { + var state = isFiberMountedImpl(fiber); + return invariant(state !== UNMOUNTED, "Unable to find node on an unmounted component."), + state === MOUNTING ? null : fiber; + } + for (var a = fiber, b = alternate; !0; ) { + var parentA = a.return, parentB = parentA ? parentA.alternate : null; + if (!parentA || !parentB) break; + if (parentA.child === parentB.child) { + for (var child = parentA.child; child; ) { + if (child === a) return assertIsMounted(parentA), fiber; + if (child === b) return assertIsMounted(parentA), alternate; + child = child.sibling; } - if (_child === b) { - didFindChild = !0, b = parentA, a = parentB; - break; - } - _child = _child.sibling; + invariant(!1, "Unable to find node on an unmounted component."); } - if (!didFindChild) { - for (_child = parentB.child; _child; ) { + if (a.return !== b.return) a = parentA, b = parentB; else { + for (var didFindChild = !1, _child = parentA.child; _child; ) { if (_child === a) { - didFindChild = !0, a = parentB, b = parentA; + didFindChild = !0, a = parentA, b = parentB; break; } if (_child === b) { - didFindChild = !0, b = parentB, a = parentA; + didFindChild = !0, b = parentA, a = parentB; break; } _child = _child.sibling; } - invariant(didFindChild, "Child was not found in either parent set. This indicates a bug " + "related to the return pointer."); + if (!didFindChild) { + for (_child = parentB.child; _child; ) { + if (_child === a) { + didFindChild = !0, a = parentB, b = parentA; + break; + } + if (_child === b) { + didFindChild = !0, b = parentB, a = parentA; + break; + } + _child = _child.sibling; + } + invariant(didFindChild, "Child was not found in either parent set. This indicates a bug " + "related to the return pointer."); + } + } + invariant(a.alternate === b, "Return fibers should always be each others' alternates."); + } + return invariant(a.tag === HostRoot$1, "Unable to find node on an unmounted component."), + a.stateNode.current === a ? fiber : alternate; + } + var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrentHostFiber$1 = function(parent) { + var currentParent = findCurrentFiberUsingSlowPath(parent); + if (!currentParent) return null; + for (var node = currentParent; !0; ) { + if (node.tag === HostComponent$2 || node.tag === HostText) return node; + if (node.child) node.child.return = node, node = node.child; else { + if (node === currentParent) return null; + for (;!node.sibling; ) { + if (!node.return || node.return === currentParent) return null; + node = node.return; + } + node.sibling.return = node.return, node = node.sibling; } } - invariant(a.alternate === b, "Return fibers should always be each others' alternates."); - } - return invariant(a.tag === HostRoot$1, "Unable to find node on an unmounted component."), - a.stateNode.current === a ? fiber : alternate; -} - -var findCurrentFiberUsingSlowPath_1 = findCurrentFiberUsingSlowPath, findCurrentHostFiber$1 = function(parent) { - var currentParent = findCurrentFiberUsingSlowPath(parent); - if (!currentParent) return null; - for (var node = currentParent; !0; ) { - if (node.tag === HostComponent$2 || node.tag === HostText) return node; - if (node.child) node.child.return = node, node = node.child; else { - if (node === currentParent) return null; - for (;!node.sibling; ) { - if (!node.return || node.return === currentParent) return null; - node = node.return; - } - node.sibling.return = node.return, node = node.sibling; - } - } - return null; -}, ReactFiberTreeReflection = { - isFiberMounted: isFiberMounted$1, - isMounted: isMounted, - findCurrentFiberUsingSlowPath: findCurrentFiberUsingSlowPath_1, - findCurrentHostFiber: findCurrentHostFiber$1 -}, valueStack = [], fiberStack = [], index = -1, createCursor$1 = function(defaultValue) { - return { - current: defaultValue - }; -}, isEmpty = function() { - return -1 === index; -}, pop$1 = function(cursor, fiber) { - if (index < 0) return void warning(!1, "Unexpected pop."); - fiber !== fiberStack[index] && warning(!1, "Unexpected Fiber popped."), cursor.current = valueStack[index], - valueStack[index] = null, fiberStack[index] = null, index--; -}, push$1 = function(cursor, value, fiber) { - index++, valueStack[index] = cursor.current, fiberStack[index] = fiber, cursor.current = value; -}, reset = function() { - for (;index > -1; ) valueStack[index] = null, fiberStack[index] = null, index--; -}, ReactFiberStack = { - createCursor: createCursor$1, - isEmpty: isEmpty, - pop: pop$1, - push: push$1, - reset: reset -}, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostComponent$3 = ReactTypeOfWork.HostComponent; - -function describeComponentFrame(name, source, ownerName) { - return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : ""); -} - -function describeFiber(fiber) { - switch (fiber.tag) { - case IndeterminateComponent: - case FunctionalComponent: - case ClassComponent$2: - case HostComponent$3: - var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null; - return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName); - - default: - return ""; - } -} - -function getStackAddendumByWorkInProgressFiber$1(workInProgress) { - var info = "", node = workInProgress; - do { - info += describeFiber(node), node = node.return; - } while (node); - return info; -} - -var ReactFiberComponentTreeHook = { - getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$1, - describeComponentFrame: describeComponentFrame -}, getComponentName$3 = getComponentName_1, _require$1 = ReactFiberComponentTreeHook, getStackAddendumByWorkInProgressFiber = _require$1.getStackAddendumByWorkInProgressFiber; - -function getCurrentFiberOwnerName() { - var fiber = ReactDebugCurrentFiber$2.current; - return null === fiber ? null : null != fiber._debugOwner ? getComponentName$3(fiber._debugOwner) : null; -} - -function getCurrentFiberStackAddendum() { - var fiber = ReactDebugCurrentFiber$2.current; - return null === fiber ? null : getStackAddendumByWorkInProgressFiber(fiber); -} - -var ReactDebugCurrentFiber$2 = { - current: null, - phase: null, - getCurrentFiberOwnerName: getCurrentFiberOwnerName, - getCurrentFiberStackAddendum: getCurrentFiberStackAddendum -}, ReactDebugCurrentFiber_1 = ReactDebugCurrentFiber$2, ReactDebugFiberPerf = null, _require$2 = ReactTypeOfWork, HostRoot$2 = _require$2.HostRoot, HostComponent$4 = _require$2.HostComponent, HostText$1 = _require$2.HostText, HostPortal = _require$2.HostPortal, YieldComponent = _require$2.YieldComponent, Fragment = _require$2.Fragment, getComponentName$4 = getComponentName_1, reactEmoji = "âš›", warningEmoji = "â›”", supportsUserTiming = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, currentFiber = null, currentPhase = null, currentPhaseFiber = null, isCommitting = !1, hasScheduledUpdateInCurrentCommit = !1, hasScheduledUpdateInCurrentPhase = !1, commitCountInCurrentWorkLoop = 0, effectCountInCurrentCommit = 0, labelsInCurrentCommit = new Set(), formatMarkName = function(markName) { - return reactEmoji + " " + markName; -}, formatLabel = function(label, warning$$1) { - return (warning$$1 ? warningEmoji + " " : reactEmoji + " ") + label + (warning$$1 ? " Warning: " + warning$$1 : ""); -}, beginMark = function(markName) { - performance.mark(formatMarkName(markName)); -}, clearMark = function(markName) { - performance.clearMarks(formatMarkName(markName)); -}, endMark = function(label, markName, warning$$1) { - var formattedMarkName = formatMarkName(markName), formattedLabel = formatLabel(label, warning$$1); - try { - performance.measure(formattedLabel, formattedMarkName); - } catch (err) {} - performance.clearMarks(formattedMarkName), performance.clearMeasures(formattedLabel); -}, getFiberMarkName = function(label, debugID) { - return label + " (#" + debugID + ")"; -}, getFiberLabel = function(componentName, isMounted, phase) { - return null === phase ? componentName + " [" + (isMounted ? "update" : "mount") + "]" : componentName + "." + phase; -}, beginFiberMark = function(fiber, phase) { - var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase); - if (isCommitting && labelsInCurrentCommit.has(label)) return !1; - labelsInCurrentCommit.add(label); - var markName = getFiberMarkName(label, debugID); - return beginMark(markName), !0; -}, clearFiberMark = function(fiber, phase) { - var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase), markName = getFiberMarkName(label, debugID); - clearMark(markName); -}, endFiberMark = function(fiber, phase, warning$$1) { - var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase), markName = getFiberMarkName(label, debugID); - endMark(label, markName, warning$$1); -}, shouldIgnoreFiber = function(fiber) { - switch (fiber.tag) { - case HostRoot$2: - case HostComponent$4: - case HostText$1: - case HostPortal: - case YieldComponent: - case Fragment: - return !0; - - default: - return !1; - } -}, clearPendingPhaseMeasurement = function() { - null !== currentPhase && null !== currentPhaseFiber && clearFiberMark(currentPhaseFiber, currentPhase), - currentPhaseFiber = null, currentPhase = null, hasScheduledUpdateInCurrentPhase = !1; -}, pauseTimers = function() { - for (var fiber = currentFiber; fiber; ) fiber._debugIsCurrentlyTiming && endFiberMark(fiber, null, null), - fiber = fiber.return; -}, resumeTimersRecursively = function(fiber) { - null !== fiber.return && resumeTimersRecursively(fiber.return), fiber._debugIsCurrentlyTiming && beginFiberMark(fiber, null); -}, resumeTimers = function() { - null !== currentFiber && resumeTimersRecursively(currentFiber); -}; - -ReactDebugFiberPerf = { - recordEffect: function() { - effectCountInCurrentCommit++; - }, - recordScheduleUpdate: function() { - isCommitting && (hasScheduledUpdateInCurrentCommit = !0), null !== currentPhase && "componentWillMount" !== currentPhase && "componentWillReceiveProps" !== currentPhase && (hasScheduledUpdateInCurrentPhase = !0); - }, - startWorkTimer: function(fiber) { - supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber, beginFiberMark(fiber, null) && (fiber._debugIsCurrentlyTiming = !0)); - }, - cancelWorkTimer: function(fiber) { - supportsUserTiming && !shouldIgnoreFiber(fiber) && (fiber._debugIsCurrentlyTiming = !1, - clearFiberMark(fiber, null)); - }, - stopWorkTimer: function(fiber) { - supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber.return, - fiber._debugIsCurrentlyTiming && (fiber._debugIsCurrentlyTiming = !1, endFiberMark(fiber, null, null))); - }, - startPhaseTimer: function(fiber, phase) { - supportsUserTiming && (clearPendingPhaseMeasurement(), beginFiberMark(fiber, phase) && (currentPhaseFiber = fiber, - currentPhase = phase)); - }, - stopPhaseTimer: function() { - if (supportsUserTiming) { - if (null !== currentPhase && null !== currentPhaseFiber) { - endFiberMark(currentPhaseFiber, currentPhase, hasScheduledUpdateInCurrentPhase ? "Scheduled a cascading update" : null); - } - currentPhase = null, currentPhaseFiber = null; - } - }, - startWorkLoopTimer: function() { - supportsUserTiming && (commitCountInCurrentWorkLoop = 0, beginMark("(React Tree Reconciliation)"), - resumeTimers()); - }, - stopWorkLoopTimer: function() { - if (supportsUserTiming) { - var warning$$1 = commitCountInCurrentWorkLoop > 1 ? "There were cascading updates" : null; - commitCountInCurrentWorkLoop = 0, pauseTimers(), endMark("(React Tree Reconciliation)", "(React Tree Reconciliation)", warning$$1); - } - }, - startCommitTimer: function() { - supportsUserTiming && (isCommitting = !0, hasScheduledUpdateInCurrentCommit = !1, - labelsInCurrentCommit.clear(), beginMark("(Committing Changes)")); - }, - stopCommitTimer: function() { - if (supportsUserTiming) { - var warning$$1 = null; - hasScheduledUpdateInCurrentCommit ? warning$$1 = "Lifecycle hook scheduled a cascading update" : commitCountInCurrentWorkLoop > 0 && (warning$$1 = "Caused by a cascading update in earlier commit"), - hasScheduledUpdateInCurrentCommit = !1, commitCountInCurrentWorkLoop++, isCommitting = !1, - labelsInCurrentCommit.clear(), endMark("(Committing Changes)", "(Committing Changes)", warning$$1); - } - }, - startCommitHostEffectsTimer: function() { - supportsUserTiming && (effectCountInCurrentCommit = 0, beginMark("(Committing Host Effects)")); - }, - stopCommitHostEffectsTimer: function() { - if (supportsUserTiming) { - var count = effectCountInCurrentCommit; - effectCountInCurrentCommit = 0, endMark("(Committing Host Effects: " + count + " Total)", "(Committing Host Effects)", null); - } - }, - startCommitLifeCyclesTimer: function() { - supportsUserTiming && (effectCountInCurrentCommit = 0, beginMark("(Calling Lifecycle Methods)")); - }, - stopCommitLifeCyclesTimer: function() { - if (supportsUserTiming) { - var count = effectCountInCurrentCommit; - effectCountInCurrentCommit = 0, endMark("(Calling Lifecycle Methods: " + count + " Total)", "(Calling Lifecycle Methods)", null); - } - } -}; - -var ReactDebugFiberPerf_1 = ReactDebugFiberPerf, _extends$2 = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); - } - return target; -}, isFiberMounted = ReactFiberTreeReflection.isFiberMounted, ClassComponent = ReactTypeOfWork.ClassComponent, HostRoot = ReactTypeOfWork.HostRoot, createCursor = ReactFiberStack.createCursor, pop = ReactFiberStack.pop, push = ReactFiberStack.push, ReactDebugCurrentFiber$1 = ReactDebugCurrentFiber_1, _require4$1 = ReactGlobalSharedState_1, ReactDebugCurrentFrame = _require4$1.ReactDebugCurrentFrame, _require5 = ReactDebugFiberPerf_1, startPhaseTimer = _require5.startPhaseTimer, stopPhaseTimer = _require5.stopPhaseTimer, warnedAboutMissingGetChildContext = {}, contextStackCursor = createCursor(emptyObject), didPerformWorkStackCursor = createCursor(!1), previousContext = emptyObject; - -function getUnmaskedContext(workInProgress) { - return isContextProvider$1(workInProgress) ? previousContext : contextStackCursor.current; -} - -var getUnmaskedContext_1 = getUnmaskedContext; - -function cacheContext(workInProgress, unmaskedContext, maskedContext) { - var instance = workInProgress.stateNode; - instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext, instance.__reactInternalMemoizedMaskedChildContext = maskedContext; -} - -var cacheContext_1 = cacheContext, getMaskedContext = function(workInProgress, unmaskedContext) { - var type = workInProgress.type, contextTypes = type.contextTypes; - if (!contextTypes) return emptyObject; - var instance = workInProgress.stateNode; - if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) return instance.__reactInternalMemoizedMaskedChildContext; - var context = {}; - for (var key in contextTypes) context[key] = unmaskedContext[key]; - var name = getComponentName_1(workInProgress) || "Unknown"; - return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(contextTypes, context, "context", name, ReactDebugCurrentFrame.getStackAddendum), - ReactDebugCurrentFrame.current = null, instance && cacheContext(workInProgress, unmaskedContext, context), - context; -}, hasContextChanged = function() { - return didPerformWorkStackCursor.current; -}; - -function isContextConsumer(fiber) { - return fiber.tag === ClassComponent && null != fiber.type.contextTypes; -} - -var isContextConsumer_1 = isContextConsumer; - -function isContextProvider$1(fiber) { - return fiber.tag === ClassComponent && null != fiber.type.childContextTypes; -} - -var isContextProvider_1 = isContextProvider$1; - -function popContextProvider(fiber) { - isContextProvider$1(fiber) && (pop(didPerformWorkStackCursor, fiber), pop(contextStackCursor, fiber)); -} - -var popContextProvider_1 = popContextProvider, pushTopLevelContextObject = function(fiber, context, didChange) { - invariant(null == contextStackCursor.cursor, "Unexpected context found on stack"), - push(contextStackCursor, context, fiber), push(didPerformWorkStackCursor, didChange, fiber); -}; - -function processChildContext$1(fiber, parentContext, isReconciling) { - var instance = fiber.stateNode, childContextTypes = fiber.type.childContextTypes; - if ("function" != typeof instance.getChildContext) { - var componentName = getComponentName_1(fiber) || "Unknown"; - return warnedAboutMissingGetChildContext[componentName] || (warnedAboutMissingGetChildContext[componentName] = !0, - warning(!1, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), - parentContext; - } - var childContext = void 0; - ReactDebugCurrentFiber$1.phase = "getChildContext", startPhaseTimer(fiber, "getChildContext"), - childContext = instance.getChildContext(), stopPhaseTimer(), ReactDebugCurrentFiber$1.phase = null; - for (var contextKey in childContext) invariant(contextKey in childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName_1(fiber) || "Unknown", contextKey); - var name = getComponentName_1(fiber) || "Unknown", workInProgress = isReconciling ? fiber : null; - return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(childContextTypes, childContext, "child context", name, ReactDebugCurrentFrame.getStackAddendum), - ReactDebugCurrentFrame.current = null, _extends$2({}, parentContext, childContext); -} - -var processChildContext_1 = processChildContext$1, pushContextProvider = function(workInProgress) { - if (!isContextProvider$1(workInProgress)) return !1; - var instance = workInProgress.stateNode, memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject; - return previousContext = contextStackCursor.current, push(contextStackCursor, memoizedMergedChildContext, workInProgress), - push(didPerformWorkStackCursor, !1, workInProgress), !0; -}, invalidateContextProvider = function(workInProgress) { - var instance = workInProgress.stateNode; - invariant(instance, "Expected to have an instance by this point."); - var mergedContext = processChildContext$1(workInProgress, previousContext, !0); - instance.__reactInternalMemoizedMergedChildContext = mergedContext, pop(didPerformWorkStackCursor, workInProgress), - pop(contextStackCursor, workInProgress), push(contextStackCursor, mergedContext, workInProgress), - push(didPerformWorkStackCursor, !0, workInProgress); -}, resetContext = function() { - previousContext = emptyObject, contextStackCursor.current = emptyObject, didPerformWorkStackCursor.current = !1; -}, findCurrentUnmaskedContext$1 = function(fiber) { - invariant(isFiberMounted(fiber) && fiber.tag === ClassComponent, "Expected subtree parent to be a mounted class component"); - for (var node = fiber; node.tag !== HostRoot; ) { - if (isContextProvider$1(node)) return node.stateNode.__reactInternalMemoizedMergedChildContext; - var parent = node.return; - invariant(parent, "Found unexpected detached subtree parent"), node = parent; - } - return node.stateNode.context; -}, ReactFiberContext = { - getUnmaskedContext: getUnmaskedContext_1, - cacheContext: cacheContext_1, - getMaskedContext: getMaskedContext, - hasContextChanged: hasContextChanged, - isContextConsumer: isContextConsumer_1, - isContextProvider: isContextProvider_1, - popContextProvider: popContextProvider_1, - pushTopLevelContextObject: pushTopLevelContextObject, - processChildContext: processChildContext_1, - pushContextProvider: pushContextProvider, - invalidateContextProvider: invalidateContextProvider, - resetContext: resetContext, - findCurrentUnmaskedContext: findCurrentUnmaskedContext$1 -}, ReactTypeOfInternalContext = { - NoContext: 0, - AsyncUpdates: 1 -}, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$1 = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, getComponentName$5 = getComponentName_1, hasBadMapPolyfill = !1; - -try { - var nonExtensibleObject = Object.preventExtensions({}); - new Map([ [ nonExtensibleObject, null ] ]), new Set([ nonExtensibleObject ]); -} catch (e) { - hasBadMapPolyfill = !0; -} - -var debugCounter = 1, createFiber = function(tag, key, internalContextTag) { - var fiber = { - tag: tag, - key: key, - type: null, - stateNode: null, - return: null, - child: null, - sibling: null, - index: 0, - ref: null, - pendingProps: null, - memoizedProps: null, - updateQueue: null, - memoizedState: null, - internalContextTag: internalContextTag, - effectTag: NoEffect$1, - nextEffect: null, - firstEffect: null, - lastEffect: null, - pendingWorkPriority: NoWork$1, - progressedPriority: NoWork$1, - progressedChild: null, - progressedFirstDeletion: null, - progressedLastDeletion: null, - alternate: null - }; - return fiber._debugID = debugCounter++, fiber._debugSource = null, fiber._debugOwner = null, - fiber._debugIsCurrentlyTiming = !1, hasBadMapPolyfill || "function" != typeof Object.preventExtensions || Object.preventExtensions(fiber), - fiber; -}; - -function shouldConstruct(Component) { - return !(!Component.prototype || !Component.prototype.isReactComponent); -} - -var cloneFiber = function(fiber, priorityLevel) { - var alt = fiber.alternate; - return null !== alt ? (alt.effectTag = NoEffect$1, alt.nextEffect = null, alt.firstEffect = null, - alt.lastEffect = null) : (alt = createFiber(fiber.tag, fiber.key, fiber.internalContextTag), - alt.type = fiber.type, alt.progressedChild = fiber.progressedChild, alt.progressedPriority = fiber.progressedPriority, - alt.alternate = fiber, fiber.alternate = alt), alt.stateNode = fiber.stateNode, - alt.child = fiber.child, alt.sibling = fiber.sibling, alt.index = fiber.index, alt.ref = fiber.ref, - alt.pendingProps = fiber.pendingProps, cloneUpdateQueue$1(fiber, alt), alt.pendingWorkPriority = priorityLevel, - alt.memoizedProps = fiber.memoizedProps, alt.memoizedState = fiber.memoizedState, - alt._debugID = fiber._debugID, alt._debugSource = fiber._debugSource, alt._debugOwner = fiber._debugOwner, - alt; -}, createHostRootFiber$1 = function() { - return createFiber(HostRoot$3, null, NoContext); -}, createFiberFromElement = function(element, internalContextTag, priorityLevel) { - var owner = null; - owner = element._owner; - var fiber = createFiberFromElementType(element.type, element.key, internalContextTag, owner); - return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel, - fiber._debugSource = element._source, fiber._debugOwner = element._owner, fiber; -}, createFiberFromFragment = function(elements, internalContextTag, priorityLevel) { - var fiber = createFiber(Fragment$1, null, internalContextTag); - return fiber.pendingProps = elements, fiber.pendingWorkPriority = priorityLevel, - fiber; -}, createFiberFromText = function(content, internalContextTag, priorityLevel) { - var fiber = createFiber(HostText$2, null, internalContextTag); - return fiber.pendingProps = content, fiber.pendingWorkPriority = priorityLevel, - fiber; -}; - -function createFiberFromElementType(type, key, internalContextTag, debugOwner) { - var fiber = void 0; - if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$3, key, internalContextTag) : createFiber(IndeterminateComponent$1, key, internalContextTag), - fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$5, key, internalContextTag), - fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else { - var info = ""; - (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."); - var ownerName = debugOwner ? getComponentName$5(debugOwner) : null; - ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`."), invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); - } - return fiber; -} - -var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() { - var fiber = createFiber(HostComponent$5, null, NoContext); - return fiber.type = "DELETED", fiber; -}, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) { - var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag); - return fiber.type = coroutine.handler, fiber.pendingProps = coroutine, fiber.pendingWorkPriority = priorityLevel, - fiber; -}, createFiberFromYield = function(yieldNode, internalContextTag, priorityLevel) { - return createFiber(YieldComponent$1, null, internalContextTag); -}, createFiberFromPortal = function(portal, internalContextTag, priorityLevel) { - var fiber = createFiber(HostPortal$1, portal.key, internalContextTag); - return fiber.pendingProps = portal.children || [], fiber.pendingWorkPriority = priorityLevel, - fiber.stateNode = { - containerInfo: portal.containerInfo, - implementation: portal.implementation - }, fiber; -}, ReactFiber = { - cloneFiber: cloneFiber, - createHostRootFiber: createHostRootFiber$1, - createFiberFromElement: createFiberFromElement, - createFiberFromFragment: createFiberFromFragment, - createFiberFromText: createFiberFromText, - createFiberFromElementType: createFiberFromElementType_1, - createFiberFromHostInstanceForDeletion: createFiberFromHostInstanceForDeletion, - createFiberFromCoroutine: createFiberFromCoroutine, - createFiberFromYield: createFiberFromYield, - createFiberFromPortal: createFiberFromPortal -}, createHostRootFiber = ReactFiber.createHostRootFiber, createFiberRoot$1 = function(containerInfo) { - var uninitializedFiber = createHostRootFiber(), root = { - current: uninitializedFiber, - containerInfo: containerInfo, - isScheduled: !1, - nextScheduledRoot: null, - context: null, - pendingContext: null - }; - return uninitializedFiber.stateNode = root, root; -}, ReactFiberRoot = { - createFiberRoot: createFiberRoot$1 -}, REACT_COROUTINE_TYPE$1, REACT_YIELD_TYPE$1; - -"function" == typeof Symbol && Symbol.for ? (REACT_COROUTINE_TYPE$1 = Symbol.for("react.coroutine"), -REACT_YIELD_TYPE$1 = Symbol.for("react.yield")) : (REACT_COROUTINE_TYPE$1 = 60104, -REACT_YIELD_TYPE$1 = 60105); - -var createCoroutine = function(children, handler, props) { - var key = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, coroutine = { - $$typeof: REACT_COROUTINE_TYPE$1, - key: null == key ? null : "" + key, - children: children, - handler: handler, - props: props - }; - return Object.freeze && (Object.freeze(coroutine.props), Object.freeze(coroutine)), - coroutine; -}, createYield = function(value) { - var yieldNode = { - $$typeof: REACT_YIELD_TYPE$1, - value: value - }; - return Object.freeze && Object.freeze(yieldNode), yieldNode; -}, isCoroutine = function(object) { - return "object" == typeof object && null !== object && object.$$typeof === REACT_COROUTINE_TYPE$1; -}, isYield = function(object) { - return "object" == typeof object && null !== object && object.$$typeof === REACT_YIELD_TYPE$1; -}, REACT_YIELD_TYPE_1 = REACT_YIELD_TYPE$1, REACT_COROUTINE_TYPE_1 = REACT_COROUTINE_TYPE$1, ReactCoroutine = { - createCoroutine: createCoroutine, - createYield: createYield, - isCoroutine: isCoroutine, - isYield: isYield, - REACT_YIELD_TYPE: REACT_YIELD_TYPE_1, - REACT_COROUTINE_TYPE: REACT_COROUTINE_TYPE_1 -}, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, _require3$3 = ReactDebugCurrentFiber_1, getCurrentFiberStackAddendum$1 = _require3$3.getCurrentFiberStackAddendum, warning$7 = warning, didWarnAboutMaps = !1, ownerHasKeyUseWarning = {}, warnForMissingKey = function(child) { - if (null !== child && "object" == typeof child && child._store && !child._store.validated && null == child.key) { - invariant("object" == typeof child._store, "React Component in warnForMissingKey should have a _store"), - child._store.validated = !0; - var currentComponentErrorInfo = "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information." + (getCurrentFiberStackAddendum$1() || ""); - ownerHasKeyUseWarning[currentComponentErrorInfo] || (ownerHasKeyUseWarning[currentComponentErrorInfo] = !0, - warning$7(!1, "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information.%s", getCurrentFiberStackAddendum$1())); - } -}, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion, ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103; - -function getIteratorFn(maybeIterable) { - if (null === maybeIterable || void 0 === maybeIterable) return null; - var iteratorFn = ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; - return "function" == typeof iteratorFn ? iteratorFn : null; -} - -function coerceRef(current, element) { - var mixedRef = element.ref; - if (null !== mixedRef && "function" != typeof mixedRef && element._owner) { - var owner = element._owner, inst = void 0; - if (owner) if ("number" == typeof owner.tag) { - var ownerFiber = owner; - invariant(ownerFiber.tag === ClassComponent$6, "Stateless function components cannot have refs."), - inst = ownerFiber.stateNode; - } else inst = owner.getPublicInstance(); - invariant(inst, "Missing owner for string ref %s. This error is likely caused by a " + "bug in React. Please file an issue.", mixedRef); - var stringRef = "" + mixedRef; - if (null !== current && null !== current.ref && current.ref._stringRef === stringRef) return current.ref; - var ref = function(value) { - var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; - null === value ? delete refs[stringRef] : refs[stringRef] = value; - }; - return ref._stringRef = stringRef, ref; - } - return mixedRef; -} - -function throwOnInvalidObjectType(returnFiber, newChild) { - if ("textarea" !== returnFiber.type) { - var addendum = ""; - addendum = " If you meant to render a collection of children, use an array " + "instead." + (getCurrentFiberStackAddendum$1() || ""), - invariant(!1, "Objects are not valid as a React child (found: %s).%s", "[object Object]" === Object.prototype.toString.call(newChild) ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : newChild, addendum); - } -} - -function ChildReconciler(shouldClone, shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - if (!shouldClone) { - if (null === childToDelete.alternate) return; - childToDelete = childToDelete.alternate; - } - var last = returnFiber.progressedLastDeletion; - null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, - childToDelete.nextEffect = null, childToDelete.effectTag = Deletion$1; - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (var childToDelete = currentFirstChild; null !== childToDelete; ) deleteChild(returnFiber, childToDelete), - childToDelete = childToDelete.sibling; return null; + }, ReactFiberTreeReflection = { + isFiberMounted: isFiberMounted$1, + isMounted: isMounted, + findCurrentFiberUsingSlowPath: findCurrentFiberUsingSlowPath_1, + findCurrentHostFiber: findCurrentHostFiber$1 + }, valueStack = [], fiberStack = [], index = -1, createCursor$1 = function(defaultValue) { + return { + current: defaultValue + }; + }, isEmpty = function() { + return -1 === index; + }, pop$1 = function(cursor, fiber) { + if (index < 0) return void warning(!1, "Unexpected pop."); + fiber !== fiberStack[index] && warning(!1, "Unexpected Fiber popped."), cursor.current = valueStack[index], + valueStack[index] = null, fiberStack[index] = null, index--; + }, push$1 = function(cursor, value, fiber) { + index++, valueStack[index] = cursor.current, fiberStack[index] = fiber, cursor.current = value; + }, reset = function() { + for (;index > -1; ) valueStack[index] = null, fiberStack[index] = null, index--; + }, ReactFiberStack = { + createCursor: createCursor$1, + isEmpty: isEmpty, + pop: pop$1, + push: push$1, + reset: reset + }, IndeterminateComponent = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent = ReactTypeOfWork.FunctionalComponent, ClassComponent$2 = ReactTypeOfWork.ClassComponent, HostComponent$3 = ReactTypeOfWork.HostComponent; + function describeComponentFrame(name, source, ownerName) { + return "\n in " + (name || "Unknown") + (source ? " (at " + source.fileName.replace(/^.*[\\\/]/, "") + ":" + source.lineNumber + ")" : ownerName ? " (created by " + ownerName + ")" : ""); } - function mapRemainingChildren(returnFiber, currentFirstChild) { - for (var existingChildren = new Map(), existingChild = currentFirstChild; null !== existingChild; ) null !== existingChild.key ? existingChildren.set(existingChild.key, existingChild) : existingChildren.set(existingChild.index, existingChild), - existingChild = existingChild.sibling; - return existingChildren; - } - function useFiber(fiber, priority) { - if (shouldClone) { - var clone = cloneFiber$2(fiber, priority); - return clone.index = 0, clone.sibling = null, clone; + function describeFiber(fiber) { + switch (fiber.tag) { + case IndeterminateComponent: + case FunctionalComponent: + case ClassComponent$2: + case HostComponent$3: + var owner = fiber._debugOwner, source = fiber._debugSource, name = getComponentName_1(fiber), ownerName = null; + return owner && (ownerName = getComponentName_1(owner)), describeComponentFrame(name, source, ownerName); + + default: + return ""; } - return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$2, fiber.index = 0, - fiber.sibling = null, fiber; } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - if (newFiber.index = newIndex, !shouldTrackSideEffects) return lastPlacedIndex; - var current = newFiber.alternate; - if (null !== current) { - var oldIndex = current.index; - return oldIndex < lastPlacedIndex ? (newFiber.effectTag = Placement$3, lastPlacedIndex) : oldIndex; + function getStackAddendumByWorkInProgressFiber$1(workInProgress) { + var info = "", node = workInProgress; + do { + info += describeFiber(node), node = node.return; + } while (node); + return info; + } + var ReactFiberComponentTreeHook = { + getStackAddendumByWorkInProgressFiber: getStackAddendumByWorkInProgressFiber$1, + describeComponentFrame: describeComponentFrame + }, getComponentName$3 = getComponentName_1, _require$1 = ReactFiberComponentTreeHook, getStackAddendumByWorkInProgressFiber = _require$1.getStackAddendumByWorkInProgressFiber; + function getCurrentFiberOwnerName() { + var fiber = ReactDebugCurrentFiber$2.current; + return null === fiber ? null : null != fiber._debugOwner ? getComponentName$3(fiber._debugOwner) : null; + } + function getCurrentFiberStackAddendum() { + var fiber = ReactDebugCurrentFiber$2.current; + return null === fiber ? null : getStackAddendumByWorkInProgressFiber(fiber); + } + var ReactDebugCurrentFiber$2 = { + current: null, + phase: null, + getCurrentFiberOwnerName: getCurrentFiberOwnerName, + getCurrentFiberStackAddendum: getCurrentFiberStackAddendum + }, ReactDebugCurrentFiber_1 = ReactDebugCurrentFiber$2, ReactDebugFiberPerf = null, _require$2 = ReactTypeOfWork, HostRoot$2 = _require$2.HostRoot, HostComponent$4 = _require$2.HostComponent, HostText$1 = _require$2.HostText, HostPortal = _require$2.HostPortal, YieldComponent = _require$2.YieldComponent, Fragment = _require$2.Fragment, getComponentName$4 = getComponentName_1, reactEmoji = "âš›", warningEmoji = "â›”", supportsUserTiming = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, currentFiber = null, currentPhase = null, currentPhaseFiber = null, isCommitting = !1, hasScheduledUpdateInCurrentCommit = !1, hasScheduledUpdateInCurrentPhase = !1, commitCountInCurrentWorkLoop = 0, effectCountInCurrentCommit = 0, labelsInCurrentCommit = new Set(), formatMarkName = function(markName) { + return reactEmoji + " " + markName; + }, formatLabel = function(label, warning$$1) { + return (warning$$1 ? warningEmoji + " " : reactEmoji + " ") + label + (warning$$1 ? " Warning: " + warning$$1 : ""); + }, beginMark = function(markName) { + performance.mark(formatMarkName(markName)); + }, clearMark = function(markName) { + performance.clearMarks(formatMarkName(markName)); + }, endMark = function(label, markName, warning$$1) { + var formattedMarkName = formatMarkName(markName), formattedLabel = formatLabel(label, warning$$1); + try { + performance.measure(formattedLabel, formattedMarkName); + } catch (err) {} + performance.clearMarks(formattedMarkName), performance.clearMeasures(formattedLabel); + }, getFiberMarkName = function(label, debugID) { + return label + " (#" + debugID + ")"; + }, getFiberLabel = function(componentName, isMounted, phase) { + return null === phase ? componentName + " [" + (isMounted ? "update" : "mount") + "]" : componentName + "." + phase; + }, beginFiberMark = function(fiber, phase) { + var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase); + if (isCommitting && labelsInCurrentCommit.has(label)) return !1; + labelsInCurrentCommit.add(label); + var markName = getFiberMarkName(label, debugID); + return beginMark(markName), !0; + }, clearFiberMark = function(fiber, phase) { + var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase), markName = getFiberMarkName(label, debugID); + clearMark(markName); + }, endFiberMark = function(fiber, phase, warning$$1) { + var componentName = getComponentName$4(fiber) || "Unknown", debugID = fiber._debugID, isMounted = null !== fiber.alternate, label = getFiberLabel(componentName, isMounted, phase), markName = getFiberMarkName(label, debugID); + endMark(label, markName, warning$$1); + }, shouldIgnoreFiber = function(fiber) { + switch (fiber.tag) { + case HostRoot$2: + case HostComponent$4: + case HostText$1: + case HostPortal: + case YieldComponent: + case Fragment: + return !0; + + default: + return !1; } - return newFiber.effectTag = Placement$3, lastPlacedIndex; + }, clearPendingPhaseMeasurement = function() { + null !== currentPhase && null !== currentPhaseFiber && clearFiberMark(currentPhaseFiber, currentPhase), + currentPhaseFiber = null, currentPhase = null, hasScheduledUpdateInCurrentPhase = !1; + }, pauseTimers = function() { + for (var fiber = currentFiber; fiber; ) fiber._debugIsCurrentlyTiming && endFiberMark(fiber, null, null), + fiber = fiber.return; + }, resumeTimersRecursively = function(fiber) { + null !== fiber.return && resumeTimersRecursively(fiber.return), fiber._debugIsCurrentlyTiming && beginFiberMark(fiber, null); + }, resumeTimers = function() { + null !== currentFiber && resumeTimersRecursively(currentFiber); + }; + ReactDebugFiberPerf = { + recordEffect: function() { + effectCountInCurrentCommit++; + }, + recordScheduleUpdate: function() { + isCommitting && (hasScheduledUpdateInCurrentCommit = !0), null !== currentPhase && "componentWillMount" !== currentPhase && "componentWillReceiveProps" !== currentPhase && (hasScheduledUpdateInCurrentPhase = !0); + }, + startWorkTimer: function(fiber) { + supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber, beginFiberMark(fiber, null) && (fiber._debugIsCurrentlyTiming = !0)); + }, + cancelWorkTimer: function(fiber) { + supportsUserTiming && !shouldIgnoreFiber(fiber) && (fiber._debugIsCurrentlyTiming = !1, + clearFiberMark(fiber, null)); + }, + stopWorkTimer: function(fiber) { + supportsUserTiming && !shouldIgnoreFiber(fiber) && (currentFiber = fiber.return, + fiber._debugIsCurrentlyTiming && (fiber._debugIsCurrentlyTiming = !1, endFiberMark(fiber, null, null))); + }, + startPhaseTimer: function(fiber, phase) { + supportsUserTiming && (clearPendingPhaseMeasurement(), beginFiberMark(fiber, phase) && (currentPhaseFiber = fiber, + currentPhase = phase)); + }, + stopPhaseTimer: function() { + if (supportsUserTiming) { + if (null !== currentPhase && null !== currentPhaseFiber) { + endFiberMark(currentPhaseFiber, currentPhase, hasScheduledUpdateInCurrentPhase ? "Scheduled a cascading update" : null); + } + currentPhase = null, currentPhaseFiber = null; + } + }, + startWorkLoopTimer: function() { + supportsUserTiming && (commitCountInCurrentWorkLoop = 0, beginMark("(React Tree Reconciliation)"), + resumeTimers()); + }, + stopWorkLoopTimer: function() { + if (supportsUserTiming) { + var warning$$1 = commitCountInCurrentWorkLoop > 1 ? "There were cascading updates" : null; + commitCountInCurrentWorkLoop = 0, pauseTimers(), endMark("(React Tree Reconciliation)", "(React Tree Reconciliation)", warning$$1); + } + }, + startCommitTimer: function() { + supportsUserTiming && (isCommitting = !0, hasScheduledUpdateInCurrentCommit = !1, + labelsInCurrentCommit.clear(), beginMark("(Committing Changes)")); + }, + stopCommitTimer: function() { + if (supportsUserTiming) { + var warning$$1 = null; + hasScheduledUpdateInCurrentCommit ? warning$$1 = "Lifecycle hook scheduled a cascading update" : commitCountInCurrentWorkLoop > 0 && (warning$$1 = "Caused by a cascading update in earlier commit"), + hasScheduledUpdateInCurrentCommit = !1, commitCountInCurrentWorkLoop++, isCommitting = !1, + labelsInCurrentCommit.clear(), endMark("(Committing Changes)", "(Committing Changes)", warning$$1); + } + }, + startCommitHostEffectsTimer: function() { + supportsUserTiming && (effectCountInCurrentCommit = 0, beginMark("(Committing Host Effects)")); + }, + stopCommitHostEffectsTimer: function() { + if (supportsUserTiming) { + var count = effectCountInCurrentCommit; + effectCountInCurrentCommit = 0, endMark("(Committing Host Effects: " + count + " Total)", "(Committing Host Effects)", null); + } + }, + startCommitLifeCyclesTimer: function() { + supportsUserTiming && (effectCountInCurrentCommit = 0, beginMark("(Calling Lifecycle Methods)")); + }, + stopCommitLifeCyclesTimer: function() { + if (supportsUserTiming) { + var count = effectCountInCurrentCommit; + effectCountInCurrentCommit = 0, endMark("(Calling Lifecycle Methods: " + count + " Total)", "(Calling Lifecycle Methods)", null); + } + } + }; + var ReactDebugFiberPerf_1 = ReactDebugFiberPerf, _extends$2 = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + } + return target; + }, isFiberMounted = ReactFiberTreeReflection.isFiberMounted, ClassComponent = ReactTypeOfWork.ClassComponent, HostRoot = ReactTypeOfWork.HostRoot, createCursor = ReactFiberStack.createCursor, pop = ReactFiberStack.pop, push = ReactFiberStack.push, ReactDebugCurrentFiber$1 = ReactDebugCurrentFiber_1, _require4$1 = ReactGlobalSharedState_1, ReactDebugCurrentFrame = _require4$1.ReactDebugCurrentFrame, _require5 = ReactDebugFiberPerf_1, startPhaseTimer = _require5.startPhaseTimer, stopPhaseTimer = _require5.stopPhaseTimer, warnedAboutMissingGetChildContext = {}, contextStackCursor = createCursor(emptyObject), didPerformWorkStackCursor = createCursor(!1), previousContext = emptyObject; + function getUnmaskedContext(workInProgress) { + return isContextProvider$1(workInProgress) ? previousContext : contextStackCursor.current; } - function placeSingleChild(newFiber) { - return shouldTrackSideEffects && null === newFiber.alternate && (newFiber.effectTag = Placement$3), - newFiber; + var getUnmaskedContext_1 = getUnmaskedContext; + function cacheContext(workInProgress, unmaskedContext, maskedContext) { + var instance = workInProgress.stateNode; + instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext, instance.__reactInternalMemoizedMaskedChildContext = maskedContext; } - function updateTextNode(returnFiber, current, textContent, priority) { - if (null === current || current.tag !== HostText$4) { + var cacheContext_1 = cacheContext, getMaskedContext = function(workInProgress, unmaskedContext) { + var type = workInProgress.type, contextTypes = type.contextTypes; + if (!contextTypes) return emptyObject; + var instance = workInProgress.stateNode; + if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) return instance.__reactInternalMemoizedMaskedChildContext; + var context = {}; + for (var key in contextTypes) context[key] = unmaskedContext[key]; + var name = getComponentName_1(workInProgress) || "Unknown"; + return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(contextTypes, context, "context", name, ReactDebugCurrentFrame.getStackAddendum), + ReactDebugCurrentFrame.current = null, instance && cacheContext(workInProgress, unmaskedContext, context), + context; + }, hasContextChanged = function() { + return didPerformWorkStackCursor.current; + }; + function isContextConsumer(fiber) { + return fiber.tag === ClassComponent && null != fiber.type.contextTypes; + } + var isContextConsumer_1 = isContextConsumer; + function isContextProvider$1(fiber) { + return fiber.tag === ClassComponent && null != fiber.type.childContextTypes; + } + var isContextProvider_1 = isContextProvider$1; + function popContextProvider(fiber) { + isContextProvider$1(fiber) && (pop(didPerformWorkStackCursor, fiber), pop(contextStackCursor, fiber)); + } + var popContextProvider_1 = popContextProvider, pushTopLevelContextObject = function(fiber, context, didChange) { + invariant(null == contextStackCursor.cursor, "Unexpected context found on stack"), + push(contextStackCursor, context, fiber), push(didPerformWorkStackCursor, didChange, fiber); + }; + function processChildContext$1(fiber, parentContext, isReconciling) { + var instance = fiber.stateNode, childContextTypes = fiber.type.childContextTypes; + if ("function" != typeof instance.getChildContext) { + var componentName = getComponentName_1(fiber) || "Unknown"; + return warnedAboutMissingGetChildContext[componentName] || (warnedAboutMissingGetChildContext[componentName] = !0, + warning(!1, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), + parentContext; + } + var childContext = void 0; + ReactDebugCurrentFiber$1.phase = "getChildContext", startPhaseTimer(fiber, "getChildContext"), + childContext = instance.getChildContext(), stopPhaseTimer(), ReactDebugCurrentFiber$1.phase = null; + for (var contextKey in childContext) invariant(contextKey in childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', getComponentName_1(fiber) || "Unknown", contextKey); + var name = getComponentName_1(fiber) || "Unknown", workInProgress = isReconciling ? fiber : null; + return ReactDebugCurrentFrame.current = workInProgress, checkPropTypes(childContextTypes, childContext, "child context", name, ReactDebugCurrentFrame.getStackAddendum), + ReactDebugCurrentFrame.current = null, _extends$2({}, parentContext, childContext); + } + var processChildContext_1 = processChildContext$1, pushContextProvider = function(workInProgress) { + if (!isContextProvider$1(workInProgress)) return !1; + var instance = workInProgress.stateNode, memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyObject; + return previousContext = contextStackCursor.current, push(contextStackCursor, memoizedMergedChildContext, workInProgress), + push(didPerformWorkStackCursor, !1, workInProgress), !0; + }, invalidateContextProvider = function(workInProgress) { + var instance = workInProgress.stateNode; + invariant(instance, "Expected to have an instance by this point."); + var mergedContext = processChildContext$1(workInProgress, previousContext, !0); + instance.__reactInternalMemoizedMergedChildContext = mergedContext, pop(didPerformWorkStackCursor, workInProgress), + pop(contextStackCursor, workInProgress), push(contextStackCursor, mergedContext, workInProgress), + push(didPerformWorkStackCursor, !0, workInProgress); + }, resetContext = function() { + previousContext = emptyObject, contextStackCursor.current = emptyObject, didPerformWorkStackCursor.current = !1; + }, findCurrentUnmaskedContext$1 = function(fiber) { + invariant(isFiberMounted(fiber) && fiber.tag === ClassComponent, "Expected subtree parent to be a mounted class component"); + for (var node = fiber; node.tag !== HostRoot; ) { + if (isContextProvider$1(node)) return node.stateNode.__reactInternalMemoizedMergedChildContext; + var parent = node.return; + invariant(parent, "Found unexpected detached subtree parent"), node = parent; + } + return node.stateNode.context; + }, ReactFiberContext = { + getUnmaskedContext: getUnmaskedContext_1, + cacheContext: cacheContext_1, + getMaskedContext: getMaskedContext, + hasContextChanged: hasContextChanged, + isContextConsumer: isContextConsumer_1, + isContextProvider: isContextProvider_1, + popContextProvider: popContextProvider_1, + pushTopLevelContextObject: pushTopLevelContextObject, + processChildContext: processChildContext_1, + pushContextProvider: pushContextProvider, + invalidateContextProvider: invalidateContextProvider, + resetContext: resetContext, + findCurrentUnmaskedContext: findCurrentUnmaskedContext$1 + }, ReactTypeOfInternalContext = { + NoContext: 0, + AsyncUpdates: 1 + }, IndeterminateComponent$1 = ReactTypeOfWork.IndeterminateComponent, ClassComponent$3 = ReactTypeOfWork.ClassComponent, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$5 = ReactTypeOfWork.HostComponent, HostText$2 = ReactTypeOfWork.HostText, HostPortal$1 = ReactTypeOfWork.HostPortal, CoroutineComponent = ReactTypeOfWork.CoroutineComponent, YieldComponent$1 = ReactTypeOfWork.YieldComponent, Fragment$1 = ReactTypeOfWork.Fragment, NoWork$1 = ReactPriorityLevel.NoWork, NoContext = ReactTypeOfInternalContext.NoContext, NoEffect$1 = ReactTypeOfSideEffect.NoEffect, cloneUpdateQueue$1 = ReactFiberUpdateQueue.cloneUpdateQueue, getComponentName$5 = getComponentName_1, hasBadMapPolyfill = !1; + try { + var nonExtensibleObject = Object.preventExtensions({}); + new Map([ [ nonExtensibleObject, null ] ]), new Set([ nonExtensibleObject ]); + } catch (e) { + hasBadMapPolyfill = !0; + } + var debugCounter = 1, createFiber = function(tag, key, internalContextTag) { + var fiber = { + tag: tag, + key: key, + type: null, + stateNode: null, + return: null, + child: null, + sibling: null, + index: 0, + ref: null, + pendingProps: null, + memoizedProps: null, + updateQueue: null, + memoizedState: null, + internalContextTag: internalContextTag, + effectTag: NoEffect$1, + nextEffect: null, + firstEffect: null, + lastEffect: null, + pendingWorkPriority: NoWork$1, + progressedPriority: NoWork$1, + progressedChild: null, + progressedFirstDeletion: null, + progressedLastDeletion: null, + alternate: null + }; + return fiber._debugID = debugCounter++, fiber._debugSource = null, fiber._debugOwner = null, + fiber._debugIsCurrentlyTiming = !1, hasBadMapPolyfill || "function" != typeof Object.preventExtensions || Object.preventExtensions(fiber), + fiber; + }; + function shouldConstruct(Component) { + return !(!Component.prototype || !Component.prototype.isReactComponent); + } + var cloneFiber = function(fiber, priorityLevel) { + var alt = fiber.alternate; + return null !== alt ? (alt.effectTag = NoEffect$1, alt.nextEffect = null, alt.firstEffect = null, + alt.lastEffect = null) : (alt = createFiber(fiber.tag, fiber.key, fiber.internalContextTag), + alt.type = fiber.type, alt.progressedChild = fiber.progressedChild, alt.progressedPriority = fiber.progressedPriority, + alt.alternate = fiber, fiber.alternate = alt), alt.stateNode = fiber.stateNode, + alt.child = fiber.child, alt.sibling = fiber.sibling, alt.index = fiber.index, alt.ref = fiber.ref, + alt.pendingProps = fiber.pendingProps, cloneUpdateQueue$1(fiber, alt), alt.pendingWorkPriority = priorityLevel, + alt.memoizedProps = fiber.memoizedProps, alt.memoizedState = fiber.memoizedState, + alt._debugID = fiber._debugID, alt._debugSource = fiber._debugSource, alt._debugOwner = fiber._debugOwner, + alt; + }, createHostRootFiber$1 = function() { + return createFiber(HostRoot$3, null, NoContext); + }, createFiberFromElement = function(element, internalContextTag, priorityLevel) { + var owner = null; + owner = element._owner; + var fiber = createFiberFromElementType(element.type, element.key, internalContextTag, owner); + return fiber.pendingProps = element.props, fiber.pendingWorkPriority = priorityLevel, + fiber._debugSource = element._source, fiber._debugOwner = element._owner, fiber; + }, createFiberFromFragment = function(elements, internalContextTag, priorityLevel) { + var fiber = createFiber(Fragment$1, null, internalContextTag); + return fiber.pendingProps = elements, fiber.pendingWorkPriority = priorityLevel, + fiber; + }, createFiberFromText = function(content, internalContextTag, priorityLevel) { + var fiber = createFiber(HostText$2, null, internalContextTag); + return fiber.pendingProps = content, fiber.pendingWorkPriority = priorityLevel, + fiber; + }; + function createFiberFromElementType(type, key, internalContextTag, debugOwner) { + var fiber = void 0; + if ("function" == typeof type) fiber = shouldConstruct(type) ? createFiber(ClassComponent$3, key, internalContextTag) : createFiber(IndeterminateComponent$1, key, internalContextTag), + fiber.type = type; else if ("string" == typeof type) fiber = createFiber(HostComponent$5, key, internalContextTag), + fiber.type = type; else if ("object" == typeof type && null !== type && "number" == typeof type.tag) fiber = type; else { + var info = ""; + (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."); + var ownerName = debugOwner ? getComponentName$5(debugOwner) : null; + ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`."), invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); + } + return fiber; + } + var createFiberFromElementType_1 = createFiberFromElementType, createFiberFromHostInstanceForDeletion = function() { + var fiber = createFiber(HostComponent$5, null, NoContext); + return fiber.type = "DELETED", fiber; + }, createFiberFromCoroutine = function(coroutine, internalContextTag, priorityLevel) { + var fiber = createFiber(CoroutineComponent, coroutine.key, internalContextTag); + return fiber.type = coroutine.handler, fiber.pendingProps = coroutine, fiber.pendingWorkPriority = priorityLevel, + fiber; + }, createFiberFromYield = function(yieldNode, internalContextTag, priorityLevel) { + return createFiber(YieldComponent$1, null, internalContextTag); + }, createFiberFromPortal = function(portal, internalContextTag, priorityLevel) { + var fiber = createFiber(HostPortal$1, portal.key, internalContextTag); + return fiber.pendingProps = portal.children || [], fiber.pendingWorkPriority = priorityLevel, + fiber.stateNode = { + containerInfo: portal.containerInfo, + implementation: portal.implementation + }, fiber; + }, ReactFiber = { + cloneFiber: cloneFiber, + createHostRootFiber: createHostRootFiber$1, + createFiberFromElement: createFiberFromElement, + createFiberFromFragment: createFiberFromFragment, + createFiberFromText: createFiberFromText, + createFiberFromElementType: createFiberFromElementType_1, + createFiberFromHostInstanceForDeletion: createFiberFromHostInstanceForDeletion, + createFiberFromCoroutine: createFiberFromCoroutine, + createFiberFromYield: createFiberFromYield, + createFiberFromPortal: createFiberFromPortal + }, createHostRootFiber = ReactFiber.createHostRootFiber, createFiberRoot$1 = function(containerInfo) { + var uninitializedFiber = createHostRootFiber(), root = { + current: uninitializedFiber, + containerInfo: containerInfo, + isScheduled: !1, + nextScheduledRoot: null, + context: null, + pendingContext: null + }; + return uninitializedFiber.stateNode = root, root; + }, ReactFiberRoot = { + createFiberRoot: createFiberRoot$1 + }, REACT_COROUTINE_TYPE$1, REACT_YIELD_TYPE$1; + "function" == typeof Symbol && Symbol.for ? (REACT_COROUTINE_TYPE$1 = Symbol.for("react.coroutine"), + REACT_YIELD_TYPE$1 = Symbol.for("react.yield")) : (REACT_COROUTINE_TYPE$1 = 60104, + REACT_YIELD_TYPE$1 = 60105); + var createCoroutine = function(children, handler, props) { + var key = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, coroutine = { + $$typeof: REACT_COROUTINE_TYPE$1, + key: null == key ? null : "" + key, + children: children, + handler: handler, + props: props + }; + return Object.freeze && (Object.freeze(coroutine.props), Object.freeze(coroutine)), + coroutine; + }, createYield = function(value) { + var yieldNode = { + $$typeof: REACT_YIELD_TYPE$1, + value: value + }; + return Object.freeze && Object.freeze(yieldNode), yieldNode; + }, isCoroutine = function(object) { + return "object" == typeof object && null !== object && object.$$typeof === REACT_COROUTINE_TYPE$1; + }, isYield = function(object) { + return "object" == typeof object && null !== object && object.$$typeof === REACT_YIELD_TYPE$1; + }, REACT_YIELD_TYPE_1 = REACT_YIELD_TYPE$1, REACT_COROUTINE_TYPE_1 = REACT_COROUTINE_TYPE$1, ReactCoroutine = { + createCoroutine: createCoroutine, + createYield: createYield, + isCoroutine: isCoroutine, + isYield: isYield, + REACT_YIELD_TYPE: REACT_YIELD_TYPE_1, + REACT_COROUTINE_TYPE: REACT_COROUTINE_TYPE_1 + }, REACT_COROUTINE_TYPE = ReactCoroutine.REACT_COROUTINE_TYPE, REACT_YIELD_TYPE = ReactCoroutine.REACT_YIELD_TYPE, REACT_PORTAL_TYPE$1 = ReactPortal.REACT_PORTAL_TYPE, _require3$3 = ReactDebugCurrentFiber_1, getCurrentFiberStackAddendum$1 = _require3$3.getCurrentFiberStackAddendum, warning$7 = warning, didWarnAboutMaps = !1, ownerHasKeyUseWarning = {}, warnForMissingKey = function(child) { + if (null !== child && "object" == typeof child && child._store && !child._store.validated && null == child.key) { + invariant("object" == typeof child._store, "React Component in warnForMissingKey should have a _store"), + child._store.validated = !0; + var currentComponentErrorInfo = "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information." + (getCurrentFiberStackAddendum$1() || ""); + ownerHasKeyUseWarning[currentComponentErrorInfo] || (ownerHasKeyUseWarning[currentComponentErrorInfo] = !0, + warning$7(!1, "Each child in an array or iterator should have a unique " + '"key" prop. See https://fb.me/react-warning-keys for ' + "more information.%s", getCurrentFiberStackAddendum$1())); + } + }, cloneFiber$2 = ReactFiber.cloneFiber, createFiberFromElement$1 = ReactFiber.createFiberFromElement, createFiberFromFragment$1 = ReactFiber.createFiberFromFragment, createFiberFromText$1 = ReactFiber.createFiberFromText, createFiberFromCoroutine$1 = ReactFiber.createFiberFromCoroutine, createFiberFromYield$1 = ReactFiber.createFiberFromYield, createFiberFromPortal$1 = ReactFiber.createFiberFromPortal, isArray = Array.isArray, FunctionalComponent$2 = ReactTypeOfWork.FunctionalComponent, ClassComponent$6 = ReactTypeOfWork.ClassComponent, HostText$4 = ReactTypeOfWork.HostText, HostPortal$4 = ReactTypeOfWork.HostPortal, CoroutineComponent$2 = ReactTypeOfWork.CoroutineComponent, YieldComponent$3 = ReactTypeOfWork.YieldComponent, Fragment$3 = ReactTypeOfWork.Fragment, NoEffect$2 = ReactTypeOfSideEffect.NoEffect, Placement$3 = ReactTypeOfSideEffect.Placement, Deletion$1 = ReactTypeOfSideEffect.Deletion, ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103; + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || void 0 === maybeIterable) return null; + var iteratorFn = ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; + return "function" == typeof iteratorFn ? iteratorFn : null; + } + function coerceRef(current, element) { + var mixedRef = element.ref; + if (null !== mixedRef && "function" != typeof mixedRef && element._owner) { + var owner = element._owner, inst = void 0; + if (owner) if ("number" == typeof owner.tag) { + var ownerFiber = owner; + invariant(ownerFiber.tag === ClassComponent$6, "Stateless function components cannot have refs."), + inst = ownerFiber.stateNode; + } else inst = owner.getPublicInstance(); + invariant(inst, "Missing owner for string ref %s. This error is likely caused by a " + "bug in React. Please file an issue.", mixedRef); + var stringRef = "" + mixedRef; + if (null !== current && null !== current.ref && current.ref._stringRef === stringRef) return current.ref; + var ref = function(value) { + var refs = inst.refs === emptyObject ? inst.refs = {} : inst.refs; + null === value ? delete refs[stringRef] : refs[stringRef] = value; + }; + return ref._stringRef = stringRef, ref; + } + return mixedRef; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + if ("textarea" !== returnFiber.type) { + var addendum = ""; + addendum = " If you meant to render a collection of children, use an array " + "instead." + (getCurrentFiberStackAddendum$1() || ""), + invariant(!1, "Objects are not valid as a React child (found: %s).%s", "[object Object]" === Object.prototype.toString.call(newChild) ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : newChild, addendum); + } + } + function ChildReconciler(shouldClone, shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + if (!shouldClone) { + if (null === childToDelete.alternate) return; + childToDelete = childToDelete.alternate; + } + var last = returnFiber.progressedLastDeletion; + null !== last ? (last.nextEffect = childToDelete, returnFiber.progressedLastDeletion = childToDelete) : returnFiber.progressedFirstDeletion = returnFiber.progressedLastDeletion = childToDelete, + childToDelete.nextEffect = null, childToDelete.effectTag = Deletion$1; + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (var childToDelete = currentFirstChild; null !== childToDelete; ) deleteChild(returnFiber, childToDelete), + childToDelete = childToDelete.sibling; + return null; + } + function mapRemainingChildren(returnFiber, currentFirstChild) { + for (var existingChildren = new Map(), existingChild = currentFirstChild; null !== existingChild; ) null !== existingChild.key ? existingChildren.set(existingChild.key, existingChild) : existingChildren.set(existingChild.index, existingChild), + existingChild = existingChild.sibling; + return existingChildren; + } + function useFiber(fiber, priority) { + if (shouldClone) { + var clone = cloneFiber$2(fiber, priority); + return clone.index = 0, clone.sibling = null, clone; + } + return fiber.pendingWorkPriority = priority, fiber.effectTag = NoEffect$2, fiber.index = 0, + fiber.sibling = null, fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + if (newFiber.index = newIndex, !shouldTrackSideEffects) return lastPlacedIndex; + var current = newFiber.alternate; + if (null !== current) { + var oldIndex = current.index; + return oldIndex < lastPlacedIndex ? (newFiber.effectTag = Placement$3, lastPlacedIndex) : oldIndex; + } + return newFiber.effectTag = Placement$3, lastPlacedIndex; + } + function placeSingleChild(newFiber) { + return shouldTrackSideEffects && null === newFiber.alternate && (newFiber.effectTag = Placement$3), + newFiber; + } + function updateTextNode(returnFiber, current, textContent, priority) { + if (null === current || current.tag !== HostText$4) { + var created = createFiberFromText$1(textContent, returnFiber.internalContextTag, priority); + return created.return = returnFiber, created; + } + var existing = useFiber(current, priority); + return existing.pendingProps = textContent, existing.return = returnFiber, existing; + } + function updateElement(returnFiber, current, element, priority) { + if (null === current || current.type !== element.type) { + var created = createFiberFromElement$1(element, returnFiber.internalContextTag, priority); + return created.ref = coerceRef(current, element), created.return = returnFiber, + created; + } + var existing = useFiber(current, priority); + return existing.ref = coerceRef(current, element), existing.pendingProps = element.props, + existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, + existing; + } + function updateCoroutine(returnFiber, current, coroutine, priority) { + if (null === current || current.tag !== CoroutineComponent$2) { + var created = createFiberFromCoroutine$1(coroutine, returnFiber.internalContextTag, priority); + return created.return = returnFiber, created; + } + var existing = useFiber(current, priority); + return existing.pendingProps = coroutine, existing.return = returnFiber, existing; + } + function updateYield(returnFiber, current, yieldNode, priority) { + if (null === current || current.tag !== YieldComponent$3) { + var created = createFiberFromYield$1(yieldNode, returnFiber.internalContextTag, priority); + return created.type = yieldNode.value, created.return = returnFiber, created; + } + var existing = useFiber(current, priority); + return existing.type = yieldNode.value, existing.return = returnFiber, existing; + } + function updatePortal(returnFiber, current, portal, priority) { + if (null === current || current.tag !== HostPortal$4 || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { + var created = createFiberFromPortal$1(portal, returnFiber.internalContextTag, priority); + return created.return = returnFiber, created; + } + var existing = useFiber(current, priority); + return existing.pendingProps = portal.children || [], existing.return = returnFiber, + existing; + } + function updateFragment(returnFiber, current, fragment, priority) { + if (null === current || current.tag !== Fragment$3) { + var created = createFiberFromFragment$1(fragment, returnFiber.internalContextTag, priority); + return created.return = returnFiber, created; + } + var existing = useFiber(current, priority); + return existing.pendingProps = fragment, existing.return = returnFiber, existing; + } + function createChild(returnFiber, newChild, priority) { + if ("string" == typeof newChild || "number" == typeof newChild) { + var created = createFiberFromText$1("" + newChild, returnFiber.internalContextTag, priority); + return created.return = returnFiber, created; + } + if ("object" == typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + var _created = createFiberFromElement$1(newChild, returnFiber.internalContextTag, priority); + return _created.ref = coerceRef(null, newChild), _created.return = returnFiber, + _created; + + case REACT_COROUTINE_TYPE: + var _created2 = createFiberFromCoroutine$1(newChild, returnFiber.internalContextTag, priority); + return _created2.return = returnFiber, _created2; + + case REACT_YIELD_TYPE: + var _created3 = createFiberFromYield$1(newChild, returnFiber.internalContextTag, priority); + return _created3.type = newChild.value, _created3.return = returnFiber, _created3; + + case REACT_PORTAL_TYPE$1: + var _created4 = createFiberFromPortal$1(newChild, returnFiber.internalContextTag, priority); + return _created4.return = returnFiber, _created4; + } + if (isArray(newChild) || getIteratorFn(newChild)) { + var _created5 = createFiberFromFragment$1(newChild, returnFiber.internalContextTag, priority); + return _created5.return = returnFiber, _created5; + } + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, priority) { + var key = null !== oldFiber ? oldFiber.key : null; + if ("string" == typeof newChild || "number" == typeof newChild) return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, priority); + if ("object" == typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, priority) : null; + + case REACT_COROUTINE_TYPE: + return newChild.key === key ? updateCoroutine(returnFiber, oldFiber, newChild, priority) : null; + + case REACT_YIELD_TYPE: + return null === key ? updateYield(returnFiber, oldFiber, newChild, priority) : null; + + case REACT_PORTAL_TYPE$1: + return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, priority) : null; + } + if (isArray(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, priority); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, priority) { + if ("string" == typeof newChild || "number" == typeof newChild) { + return updateTextNode(returnFiber, existingChildren.get(newIdx) || null, "" + newChild, priority); + } + if ("object" == typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return updateElement(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, priority); + + case REACT_COROUTINE_TYPE: + return updateCoroutine(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, priority); + + case REACT_YIELD_TYPE: + return updateYield(returnFiber, existingChildren.get(newIdx) || null, newChild, priority); + + case REACT_PORTAL_TYPE$1: + return updatePortal(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, priority); + } + if (isArray(newChild) || getIteratorFn(newChild)) { + return updateFragment(returnFiber, existingChildren.get(newIdx) || null, newChild, priority); + } + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function warnOnInvalidKey(child, knownKeys) { + if ("object" != typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_COROUTINE_TYPE: + case REACT_PORTAL_TYPE$1: + warnForMissingKey(child); + var key = child.key; + if ("string" != typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(), knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + warning$7(!1, "Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, " + "only the first child will be used.%s", key, getCurrentFiberStackAddendum$1()); + } + return knownKeys; + } + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, priority) { + for (var knownKeys = null, i = 0; i < newChildren.length; i++) { + knownKeys = warnOnInvalidKey(newChildren[i], knownKeys); + } + for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) { + oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], priority); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, + previousNewFiber = newFiber, oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), + resultingFirstChild; + if (null === oldFiber) { + for (;newIdx < newChildren.length; newIdx++) { + var _newFiber = createChild(returnFiber, newChildren[newIdx], priority); + _newFiber && (lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx), + null === previousNewFiber ? resultingFirstChild = _newFiber : previousNewFiber.sibling = _newFiber, + previousNewFiber = _newFiber); + } + return resultingFirstChild; + } + for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); newIdx < newChildren.length; newIdx++) { + var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], priority); + _newFiber2 && (shouldTrackSideEffects && null !== _newFiber2.alternate && existingChildren.delete(null === _newFiber2.key ? newIdx : _newFiber2.key), + lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber.sibling = _newFiber2, + previousNewFiber = _newFiber2); + } + return shouldTrackSideEffects && existingChildren.forEach(function(child) { + return deleteChild(returnFiber, child); + }), resultingFirstChild; + } + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, priority) { + var iteratorFn = getIteratorFn(newChildrenIterable); + if (invariant("function" == typeof iteratorFn, "An object is not an iterable. This error is likely caused by a bug in " + "React. Please file an issue."), + "function" == typeof newChildrenIterable.entries) { + newChildrenIterable.entries === iteratorFn && (warning$7(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentFiberStackAddendum$1()), + didWarnAboutMaps = !0); + } + var _newChildren = iteratorFn.call(newChildrenIterable); + if (_newChildren) for (var knownKeys = null, _step = _newChildren.next(); !_step.done; _step = _newChildren.next()) { + var child = _step.value; + knownKeys = warnOnInvalidKey(child, knownKeys); + } + var newChildren = iteratorFn.call(newChildrenIterable); + invariant(null != newChildren, "An iterable object provided no iterator."); + for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, + step = newChildren.next()) { + oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; + var newFiber = updateSlot(returnFiber, oldFiber, step.value, priority); + if (null === newFiber) { + oldFiber || (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), + lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, + previousNewFiber = newFiber, oldFiber = nextOldFiber; + } + if (step.done) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; + if (null === oldFiber) { + for (;!step.done; newIdx++, step = newChildren.next()) { + var _newFiber3 = createChild(returnFiber, step.value, priority); + null !== _newFiber3 && (lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx), + null === previousNewFiber ? resultingFirstChild = _newFiber3 : previousNewFiber.sibling = _newFiber3, + previousNewFiber = _newFiber3); + } + return resultingFirstChild; + } + for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, + step = newChildren.next()) { + var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, priority); + null !== _newFiber4 && (shouldTrackSideEffects && null !== _newFiber4.alternate && existingChildren.delete(null === _newFiber4.key ? newIdx : _newFiber4.key), + lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber.sibling = _newFiber4, + previousNewFiber = _newFiber4); + } + return shouldTrackSideEffects && existingChildren.forEach(function(child) { + return deleteChild(returnFiber, child); + }), resultingFirstChild; + } + function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, priority) { + if (null !== currentFirstChild && currentFirstChild.tag === HostText$4) { + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + var existing = useFiber(currentFirstChild, priority); + return existing.pendingProps = textContent, existing.return = returnFiber, existing; + } + deleteRemainingChildren(returnFiber, currentFirstChild); var created = createFiberFromText$1(textContent, returnFiber.internalContextTag, priority); return created.return = returnFiber, created; } - var existing = useFiber(current, priority); - return existing.pendingProps = textContent, existing.return = returnFiber, existing; - } - function updateElement(returnFiber, current, element, priority) { - if (null === current || current.type !== element.type) { + function reconcileSingleElement(returnFiber, currentFirstChild, element, priority) { + for (var key = element.key, child = currentFirstChild; null !== child; ) { + if (child.key === key) { + if (child.type === element.type) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, priority); + return existing.ref = coerceRef(child, element), existing.pendingProps = element.props, + existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, + existing; + } + deleteRemainingChildren(returnFiber, child); + break; + } + deleteChild(returnFiber, child), child = child.sibling; + } var created = createFiberFromElement$1(element, returnFiber.internalContextTag, priority); - return created.ref = coerceRef(current, element), created.return = returnFiber, + return created.ref = coerceRef(currentFirstChild, element), created.return = returnFiber, created; } - var existing = useFiber(current, priority); - return existing.ref = coerceRef(current, element), existing.pendingProps = element.props, - existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, - existing; - } - function updateCoroutine(returnFiber, current, coroutine, priority) { - if (null === current || current.tag !== CoroutineComponent$2) { + function reconcileSingleCoroutine(returnFiber, currentFirstChild, coroutine, priority) { + for (var key = coroutine.key, child = currentFirstChild; null !== child; ) { + if (child.key === key) { + if (child.tag === CoroutineComponent$2) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, priority); + return existing.pendingProps = coroutine, existing.return = returnFiber, existing; + } + deleteRemainingChildren(returnFiber, child); + break; + } + deleteChild(returnFiber, child), child = child.sibling; + } var created = createFiberFromCoroutine$1(coroutine, returnFiber.internalContextTag, priority); return created.return = returnFiber, created; } - var existing = useFiber(current, priority); - return existing.pendingProps = coroutine, existing.return = returnFiber, existing; - } - function updateYield(returnFiber, current, yieldNode, priority) { - if (null === current || current.tag !== YieldComponent$3) { + function reconcileSingleYield(returnFiber, currentFirstChild, yieldNode, priority) { + var child = currentFirstChild; + if (null !== child) { + if (child.tag === YieldComponent$3) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, priority); + return existing.type = yieldNode.value, existing.return = returnFiber, existing; + } + deleteRemainingChildren(returnFiber, child); + } var created = createFiberFromYield$1(yieldNode, returnFiber.internalContextTag, priority); return created.type = yieldNode.value, created.return = returnFiber, created; } - var existing = useFiber(current, priority); - return existing.type = yieldNode.value, existing.return = returnFiber, existing; - } - function updatePortal(returnFiber, current, portal, priority) { - if (null === current || current.tag !== HostPortal$4 || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { + function reconcileSinglePortal(returnFiber, currentFirstChild, portal, priority) { + for (var key = portal.key, child = currentFirstChild; null !== child; ) { + if (child.key === key) { + if (child.tag === HostPortal$4 && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { + deleteRemainingChildren(returnFiber, child.sibling); + var existing = useFiber(child, priority); + return existing.pendingProps = portal.children || [], existing.return = returnFiber, + existing; + } + deleteRemainingChildren(returnFiber, child); + break; + } + deleteChild(returnFiber, child), child = child.sibling; + } var created = createFiberFromPortal$1(portal, returnFiber.internalContextTag, priority); return created.return = returnFiber, created; } - var existing = useFiber(current, priority); - return existing.pendingProps = portal.children || [], existing.return = returnFiber, - existing; - } - function updateFragment(returnFiber, current, fragment, priority) { - if (null === current || current.tag !== Fragment$3) { - var created = createFiberFromFragment$1(fragment, returnFiber.internalContextTag, priority); - return created.return = returnFiber, created; - } - var existing = useFiber(current, priority); - return existing.pendingProps = fragment, existing.return = returnFiber, existing; - } - function createChild(returnFiber, newChild, priority) { - if ("string" == typeof newChild || "number" == typeof newChild) { - var created = createFiberFromText$1("" + newChild, returnFiber.internalContextTag, priority); - return created.return = returnFiber, created; - } - if ("object" == typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { + function reconcileChildFibers(returnFiber, currentFirstChild, newChild, priority) { + var disableNewFiberFeatures = ReactFeatureFlags_1.disableNewFiberFeatures, isObject = "object" == typeof newChild && null !== newChild; + if (isObject) if (disableNewFiberFeatures) switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: - var _created = createFiberFromElement$1(newChild, returnFiber.internalContextTag, priority); - return _created.ref = coerceRef(null, newChild), _created.return = returnFiber, - _created; - - case REACT_COROUTINE_TYPE: - var _created2 = createFiberFromCoroutine$1(newChild, returnFiber.internalContextTag, priority); - return _created2.return = returnFiber, _created2; - - case REACT_YIELD_TYPE: - var _created3 = createFiberFromYield$1(newChild, returnFiber.internalContextTag, priority); - return _created3.type = newChild.value, _created3.return = returnFiber, _created3; + return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, priority)); case REACT_PORTAL_TYPE$1: - var _created4 = createFiberFromPortal$1(newChild, returnFiber.internalContextTag, priority); - return _created4.return = returnFiber, _created4; - } - if (isArray(newChild) || getIteratorFn(newChild)) { - var _created5 = createFiberFromFragment$1(newChild, returnFiber.internalContextTag, priority); - return _created5.return = returnFiber, _created5; - } - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, priority) { - var key = null !== oldFiber ? oldFiber.key : null; - if ("string" == typeof newChild || "number" == typeof newChild) return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, priority); - if ("object" == typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { + return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, priority)); + } else switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: - return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, priority) : null; + return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, priority)); case REACT_COROUTINE_TYPE: - return newChild.key === key ? updateCoroutine(returnFiber, oldFiber, newChild, priority) : null; + return placeSingleChild(reconcileSingleCoroutine(returnFiber, currentFirstChild, newChild, priority)); case REACT_YIELD_TYPE: - return null === key ? updateYield(returnFiber, oldFiber, newChild, priority) : null; + return placeSingleChild(reconcileSingleYield(returnFiber, currentFirstChild, newChild, priority)); case REACT_PORTAL_TYPE$1: - return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, priority) : null; + return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, priority)); } - if (isArray(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, priority); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function updateFromMap(existingChildren, returnFiber, newIdx, newChild, priority) { - if ("string" == typeof newChild || "number" == typeof newChild) { - return updateTextNode(returnFiber, existingChildren.get(newIdx) || null, "" + newChild, priority); - } - if ("object" == typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return updateElement(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, priority); - - case REACT_COROUTINE_TYPE: - return updateCoroutine(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, priority); - - case REACT_YIELD_TYPE: - return updateYield(returnFiber, existingChildren.get(newIdx) || null, newChild, priority); - - case REACT_PORTAL_TYPE$1: - return updatePortal(returnFiber, existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, newChild, priority); - } - if (isArray(newChild) || getIteratorFn(newChild)) { - return updateFragment(returnFiber, existingChildren.get(newIdx) || null, newChild, priority); - } - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function warnOnInvalidKey(child, knownKeys) { - if ("object" != typeof child || null === child) return knownKeys; - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_COROUTINE_TYPE: - case REACT_PORTAL_TYPE$1: - warnForMissingKey(child); - var key = child.key; - if ("string" != typeof key) break; - if (null === knownKeys) { - knownKeys = new Set(), knownKeys.add(key); + if (disableNewFiberFeatures) switch (returnFiber.tag) { + case ClassComponent$6: + if (returnFiber.stateNode.render._isMockFunction && void 0 === newChild) break; + var Component = returnFiber.type; + invariant(null === newChild || !1 === newChild, "%s.render(): A valid React element (or null) must be returned. " + "You may have returned undefined, an array or some other " + "invalid object.", Component.displayName || Component.name || "Component"); break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - warning$7(!1, "Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, " + "only the first child will be used.%s", key, getCurrentFiberStackAddendum$1()); - } - return knownKeys; - } - function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, priority) { - for (var knownKeys = null, i = 0; i < newChildren.length; i++) { - knownKeys = warnOnInvalidKey(newChildren[i], knownKeys); - } - for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) { - oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; - var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], priority); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, - previousNewFiber = newFiber, oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), - resultingFirstChild; - if (null === oldFiber) { - for (;newIdx < newChildren.length; newIdx++) { - var _newFiber = createChild(returnFiber, newChildren[newIdx], priority); - _newFiber && (lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx), - null === previousNewFiber ? resultingFirstChild = _newFiber : previousNewFiber.sibling = _newFiber, - previousNewFiber = _newFiber); - } - return resultingFirstChild; - } - for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); newIdx < newChildren.length; newIdx++) { - var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], priority); - _newFiber2 && (shouldTrackSideEffects && null !== _newFiber2.alternate && existingChildren.delete(null === _newFiber2.key ? newIdx : _newFiber2.key), - lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber2 : previousNewFiber.sibling = _newFiber2, - previousNewFiber = _newFiber2); - } - return shouldTrackSideEffects && existingChildren.forEach(function(child) { - return deleteChild(returnFiber, child); - }), resultingFirstChild; - } - function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, priority) { - var iteratorFn = getIteratorFn(newChildrenIterable); - if (invariant("function" == typeof iteratorFn, "An object is not an iterable. This error is likely caused by a bug in " + "React. Please file an issue."), - "function" == typeof newChildrenIterable.entries) { - newChildrenIterable.entries === iteratorFn && (warning$7(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentFiberStackAddendum$1()), - didWarnAboutMaps = !0); - } - var _newChildren = iteratorFn.call(newChildrenIterable); - if (_newChildren) for (var knownKeys = null, _step = _newChildren.next(); !_step.done; _step = _newChildren.next()) { - var child = _step.value; - knownKeys = warnOnInvalidKey(child, knownKeys); - } - var newChildren = iteratorFn.call(newChildrenIterable); - invariant(null != newChildren, "An iterable object provided no iterator."); - for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, lastPlacedIndex = 0, newIdx = 0, nextOldFiber = null, step = newChildren.next(); null !== oldFiber && !step.done; newIdx++, - step = newChildren.next()) { - oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; - var newFiber = updateSlot(returnFiber, oldFiber, step.value, priority); - if (null === newFiber) { - oldFiber || (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber), - lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber, - previousNewFiber = newFiber, oldFiber = nextOldFiber; - } - if (step.done) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; - if (null === oldFiber) { - for (;!step.done; newIdx++, step = newChildren.next()) { - var _newFiber3 = createChild(returnFiber, step.value, priority); - null !== _newFiber3 && (lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx), - null === previousNewFiber ? resultingFirstChild = _newFiber3 : previousNewFiber.sibling = _newFiber3, - previousNewFiber = _newFiber3); - } - return resultingFirstChild; - } - for (var existingChildren = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, - step = newChildren.next()) { - var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, priority); - null !== _newFiber4 && (shouldTrackSideEffects && null !== _newFiber4.alternate && existingChildren.delete(null === _newFiber4.key ? newIdx : _newFiber4.key), - lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx), null === previousNewFiber ? resultingFirstChild = _newFiber4 : previousNewFiber.sibling = _newFiber4, - previousNewFiber = _newFiber4); - } - return shouldTrackSideEffects && existingChildren.forEach(function(child) { - return deleteChild(returnFiber, child); - }), resultingFirstChild; - } - function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, priority) { - if (null !== currentFirstChild && currentFirstChild.tag === HostText$4) { - deleteRemainingChildren(returnFiber, currentFirstChild.sibling); - var existing = useFiber(currentFirstChild, priority); - return existing.pendingProps = textContent, existing.return = returnFiber, existing; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - var created = createFiberFromText$1(textContent, returnFiber.internalContextTag, priority); - return created.return = returnFiber, created; - } - function reconcileSingleElement(returnFiber, currentFirstChild, element, priority) { - for (var key = element.key, child = currentFirstChild; null !== child; ) { - if (child.key === key) { - if (child.type === element.type) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, priority); - return existing.ref = coerceRef(child, element), existing.pendingProps = element.props, - existing.return = returnFiber, existing._debugSource = element._source, existing._debugOwner = element._owner, - existing; - } - deleteRemainingChildren(returnFiber, child); - break; - } - deleteChild(returnFiber, child), child = child.sibling; - } - var created = createFiberFromElement$1(element, returnFiber.internalContextTag, priority); - return created.ref = coerceRef(currentFirstChild, element), created.return = returnFiber, - created; - } - function reconcileSingleCoroutine(returnFiber, currentFirstChild, coroutine, priority) { - for (var key = coroutine.key, child = currentFirstChild; null !== child; ) { - if (child.key === key) { - if (child.tag === CoroutineComponent$2) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, priority); - return existing.pendingProps = coroutine, existing.return = returnFiber, existing; - } - deleteRemainingChildren(returnFiber, child); - break; - } - deleteChild(returnFiber, child), child = child.sibling; - } - var created = createFiberFromCoroutine$1(coroutine, returnFiber.internalContextTag, priority); - return created.return = returnFiber, created; - } - function reconcileSingleYield(returnFiber, currentFirstChild, yieldNode, priority) { - var child = currentFirstChild; - if (null !== child) { - if (child.tag === YieldComponent$3) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, priority); - return existing.type = yieldNode.value, existing.return = returnFiber, existing; - } - deleteRemainingChildren(returnFiber, child); - } - var created = createFiberFromYield$1(yieldNode, returnFiber.internalContextTag, priority); - return created.type = yieldNode.value, created.return = returnFiber, created; - } - function reconcileSinglePortal(returnFiber, currentFirstChild, portal, priority) { - for (var key = portal.key, child = currentFirstChild; null !== child; ) { - if (child.key === key) { - if (child.tag === HostPortal$4 && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { - deleteRemainingChildren(returnFiber, child.sibling); - var existing = useFiber(child, priority); - return existing.pendingProps = portal.children || [], existing.return = returnFiber, - existing; - } - deleteRemainingChildren(returnFiber, child); - break; - } - deleteChild(returnFiber, child), child = child.sibling; - } - var created = createFiberFromPortal$1(portal, returnFiber.internalContextTag, priority); - return created.return = returnFiber, created; - } - function reconcileChildFibers(returnFiber, currentFirstChild, newChild, priority) { - var disableNewFiberFeatures = ReactFeatureFlags_1.disableNewFiberFeatures, isObject = "object" == typeof newChild && null !== newChild; - if (isObject) if (disableNewFiberFeatures) switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, priority)); - case REACT_PORTAL_TYPE$1: - return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, priority)); - } else switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, priority)); + case FunctionalComponent$2: + var _Component = returnFiber.type; + invariant(null === newChild || !1 === newChild, "%s(...): A valid React element (or null) must be returned. " + "You may have returned undefined, an array or some other " + "invalid object.", _Component.displayName || _Component.name || "Component"); + } + if ("string" == typeof newChild || "number" == typeof newChild) return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, priority)); + if (isArray(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, priority); + if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, priority); + if (isObject && throwOnInvalidObjectType(returnFiber, newChild), !disableNewFiberFeatures && void 0 === newChild) switch (returnFiber.tag) { + case ClassComponent$6: + if (returnFiber.stateNode.render._isMockFunction) break; - case REACT_COROUTINE_TYPE: - return placeSingleChild(reconcileSingleCoroutine(returnFiber, currentFirstChild, newChild, priority)); - - case REACT_YIELD_TYPE: - return placeSingleChild(reconcileSingleYield(returnFiber, currentFirstChild, newChild, priority)); - - case REACT_PORTAL_TYPE$1: - return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, priority)); + case FunctionalComponent$2: + var _Component2 = returnFiber.type; + invariant(!1, "%s(...): Nothing was returned from render. This usually means a " + "return statement is missing. Or, to render nothing, " + "return null.", _Component2.displayName || _Component2.name || "Component"); + } + return deleteRemainingChildren(returnFiber, currentFirstChild); } - if (disableNewFiberFeatures) switch (returnFiber.tag) { - case ClassComponent$6: - if (returnFiber.stateNode.render._isMockFunction && void 0 === newChild) break; - var Component = returnFiber.type; - invariant(null === newChild || !1 === newChild, "%s.render(): A valid React element (or null) must be returned. " + "You may have returned undefined, an array or some other " + "invalid object.", Component.displayName || Component.name || "Component"); - break; - - case FunctionalComponent$2: - var _Component = returnFiber.type; - invariant(null === newChild || !1 === newChild, "%s(...): A valid React element (or null) must be returned. " + "You may have returned undefined, an array or some other " + "invalid object.", _Component.displayName || _Component.name || "Component"); - } - if ("string" == typeof newChild || "number" == typeof newChild) return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, "" + newChild, priority)); - if (isArray(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, priority); - if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, priority); - if (isObject && throwOnInvalidObjectType(returnFiber, newChild), !disableNewFiberFeatures && void 0 === newChild) switch (returnFiber.tag) { - case ClassComponent$6: - if (returnFiber.stateNode.render._isMockFunction) break; - - case FunctionalComponent$2: - var _Component2 = returnFiber.type; - invariant(!1, "%s(...): Nothing was returned from render. This usually means a " + "return statement is missing. Or, to render nothing, " + "return null.", _Component2.displayName || _Component2.name || "Component"); - } - return deleteRemainingChildren(returnFiber, currentFirstChild); + return reconcileChildFibers; } - return reconcileChildFibers; -} - -var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlace$1 = ChildReconciler(!1, !0), mountChildFibersInPlace$1 = ChildReconciler(!1, !1), cloneChildFibers$1 = function(current, workInProgress) { - if (workInProgress.child) if (null !== current && workInProgress.child === current.child) { - var currentChild = workInProgress.child, newChild = cloneFiber$2(currentChild, currentChild.pendingWorkPriority); - for (workInProgress.child = newChild, newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling, - newChild = newChild.sibling = cloneFiber$2(currentChild, currentChild.pendingWorkPriority), - newChild.return = workInProgress; - newChild.sibling = null; - } else for (var child = workInProgress.child; null !== child; ) child.return = workInProgress, - child = child.sibling; -}, ReactChildFiber = { - reconcileChildFibers: reconcileChildFibers$1, - reconcileChildFibersInPlace: reconcileChildFibersInPlace$1, - mountChildFibersInPlace: mountChildFibersInPlace$1, - cloneChildFibers: cloneChildFibers$1 -}, Update$1 = ReactTypeOfSideEffect.Update, AsyncUpdates$1 = ReactTypeOfInternalContext.AsyncUpdates, cacheContext$1 = ReactFiberContext.cacheContext, getMaskedContext$2 = ReactFiberContext.getMaskedContext, getUnmaskedContext$2 = ReactFiberContext.getUnmaskedContext, isContextConsumer$1 = ReactFiberContext.isContextConsumer, addUpdate$1 = ReactFiberUpdateQueue.addUpdate, addReplaceUpdate$1 = ReactFiberUpdateQueue.addReplaceUpdate, addForceUpdate$1 = ReactFiberUpdateQueue.addForceUpdate, beginUpdateQueue$2 = ReactFiberUpdateQueue.beginUpdateQueue, _require5$1 = ReactFiberContext, hasContextChanged$2 = _require5$1.hasContextChanged, isMounted$1 = ReactFiberTreeReflection.isMounted, isArray$1 = Array.isArray, _require7$1 = ReactDebugFiberPerf_1, startPhaseTimer$1 = _require7$1.startPhaseTimer, stopPhaseTimer$1 = _require7$1.stopPhaseTimer, warning$8 = warning, warnOnInvalidCallback = function(callback, callerName) { - warning$8(null === callback || "function" == typeof callback, "%s(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callerName, callback); -}, ReactFiberClassComponent = function(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState) { - var updater = { - isMounted: isMounted$1, - enqueueSetState: function(instance, partialState, callback) { - var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "setState"), - addUpdate$1(fiber, partialState, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); - }, - enqueueReplaceState: function(instance, state, callback) { - var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "replaceState"), - addReplaceUpdate$1(fiber, state, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); - }, - enqueueForceUpdate: function(instance, callback) { - var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); - callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "forceUpdate"), - addForceUpdate$1(fiber, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); + var reconcileChildFibers$1 = ChildReconciler(!0, !0), reconcileChildFibersInPlace$1 = ChildReconciler(!1, !0), mountChildFibersInPlace$1 = ChildReconciler(!1, !1), cloneChildFibers$1 = function(current, workInProgress) { + if (workInProgress.child) if (null !== current && workInProgress.child === current.child) { + var currentChild = workInProgress.child, newChild = cloneFiber$2(currentChild, currentChild.pendingWorkPriority); + for (workInProgress.child = newChild, newChild.return = workInProgress; null !== currentChild.sibling; ) currentChild = currentChild.sibling, + newChild = newChild.sibling = cloneFiber$2(currentChild, currentChild.pendingWorkPriority), + newChild.return = workInProgress; + newChild.sibling = null; + } else for (var child = workInProgress.child; null !== child; ) child.return = workInProgress, + child = child.sibling; + }, ReactChildFiber = { + reconcileChildFibers: reconcileChildFibers$1, + reconcileChildFibersInPlace: reconcileChildFibersInPlace$1, + mountChildFibersInPlace: mountChildFibersInPlace$1, + cloneChildFibers: cloneChildFibers$1 + }, Update$1 = ReactTypeOfSideEffect.Update, AsyncUpdates$1 = ReactTypeOfInternalContext.AsyncUpdates, cacheContext$1 = ReactFiberContext.cacheContext, getMaskedContext$2 = ReactFiberContext.getMaskedContext, getUnmaskedContext$2 = ReactFiberContext.getUnmaskedContext, isContextConsumer$1 = ReactFiberContext.isContextConsumer, addUpdate$1 = ReactFiberUpdateQueue.addUpdate, addReplaceUpdate$1 = ReactFiberUpdateQueue.addReplaceUpdate, addForceUpdate$1 = ReactFiberUpdateQueue.addForceUpdate, beginUpdateQueue$2 = ReactFiberUpdateQueue.beginUpdateQueue, _require5$1 = ReactFiberContext, hasContextChanged$2 = _require5$1.hasContextChanged, isMounted$1 = ReactFiberTreeReflection.isMounted, isArray$1 = Array.isArray, _require7$1 = ReactDebugFiberPerf_1, startPhaseTimer$1 = _require7$1.startPhaseTimer, stopPhaseTimer$1 = _require7$1.stopPhaseTimer, warning$8 = warning, warnOnInvalidCallback = function(callback, callerName) { + warning$8(null === callback || "function" == typeof callback, "%s(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callerName, callback); + }, ReactFiberClassComponent = function(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState) { + var updater = { + isMounted: isMounted$1, + enqueueSetState: function(instance, partialState, callback) { + var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); + callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "setState"), + addUpdate$1(fiber, partialState, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); + }, + enqueueReplaceState: function(instance, state, callback) { + var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); + callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "replaceState"), + addReplaceUpdate$1(fiber, state, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); + }, + enqueueForceUpdate: function(instance, callback) { + var fiber = ReactInstanceMap_1.get(instance), priorityLevel = getPriorityContext(fiber, !1); + callback = void 0 === callback ? null : callback, warnOnInvalidCallback(callback, "forceUpdate"), + addForceUpdate$1(fiber, callback, priorityLevel), scheduleUpdate(fiber, priorityLevel); + } + }; + function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { + if (null === oldProps || null !== workInProgress.updateQueue && workInProgress.updateQueue.hasForceUpdate) return !0; + var instance = workInProgress.stateNode, type = workInProgress.type; + if ("function" == typeof instance.shouldComponentUpdate) { + startPhaseTimer$1(workInProgress, "shouldComponentUpdate"); + var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); + return stopPhaseTimer$1(), warning$8(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", getComponentName_1(workInProgress) || "Unknown"), + shouldUpdate; + } + return !type.prototype || !type.prototype.isPureReactComponent || (!shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)); } - }; - function checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext) { - if (null === oldProps || null !== workInProgress.updateQueue && workInProgress.updateQueue.hasForceUpdate) return !0; - var instance = workInProgress.stateNode, type = workInProgress.type; - if ("function" == typeof instance.shouldComponentUpdate) { - startPhaseTimer$1(workInProgress, "shouldComponentUpdate"); - var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, newContext); - return stopPhaseTimer$1(), warning$8(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", getComponentName_1(workInProgress) || "Unknown"), + function checkClassInstance(workInProgress) { + var instance = workInProgress.stateNode, type = workInProgress.type, name = getComponentName_1(workInProgress), renderPresent = instance.render; + warning$8(renderPresent, "%s(...): No `render` method found on the returned component " + "instance: you may have forgotten to define `render`.", name); + var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state; + warning$8(noGetInitialStateOnES6, "getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", name); + var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved; + warning$8(noGetDefaultPropsOnES6, "getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", name); + var noInstancePropTypes = !instance.propTypes; + warning$8(noInstancePropTypes, "propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", name); + var noInstanceContextTypes = !instance.contextTypes; + warning$8(noInstanceContextTypes, "contextTypes was defined as an instance property on %s. Use a static " + "property to define contextTypes instead.", name); + var noComponentShouldUpdate = "function" != typeof instance.componentShouldUpdate; + warning$8(noComponentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", name), + type.prototype && type.prototype.isPureReactComponent && void 0 !== instance.shouldComponentUpdate && warning$8(!1, "%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", getComponentName_1(workInProgress) || "A pure component"); + var noComponentDidUnmount = "function" != typeof instance.componentDidUnmount; + warning$8(noComponentDidUnmount, "%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", name); + var noComponentWillRecieveProps = "function" != typeof instance.componentWillRecieveProps; + warning$8(noComponentWillRecieveProps, "%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name); + var hasMutatedProps = instance.props !== workInProgress.pendingProps; + warning$8(void 0 === instance.props || !hasMutatedProps, "%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", name, name); + var noInstanceDefaultProps = !instance.defaultProps; + warning$8(noInstanceDefaultProps, "Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", name, name); + var state = instance.state; + state && ("object" != typeof state || isArray$1(state)) && invariant(!1, "%s.state: must be set to an object or null", getComponentName_1(workInProgress)), + "function" == typeof instance.getChildContext && invariant("object" == typeof workInProgress.type.childContextTypes, "%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", getComponentName_1(workInProgress)); + } + function resetInputPointers(workInProgress, instance) { + instance.props = workInProgress.memoizedProps, instance.state = workInProgress.memoizedState; + } + function adoptClassInstance(workInProgress, instance) { + instance.updater = updater, workInProgress.stateNode = instance, ReactInstanceMap_1.set(instance, workInProgress); + } + function constructClassInstance(workInProgress, props) { + var ctor = workInProgress.type, unmaskedContext = getUnmaskedContext$2(workInProgress), needsContext = isContextConsumer$1(workInProgress), context = needsContext ? getMaskedContext$2(workInProgress, unmaskedContext) : emptyObject, instance = new ctor(props, context); + return adoptClassInstance(workInProgress, instance), needsContext && cacheContext$1(workInProgress, unmaskedContext, context), + instance; + } + function callComponentWillMount(workInProgress, instance) { + startPhaseTimer$1(workInProgress, "componentWillMount"); + var oldState = instance.state; + instance.componentWillMount(), stopPhaseTimer$1(), oldState !== instance.state && (warning$8(!1, "%s.componentWillMount(): Assigning directly to this.state is " + "deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), + updater.enqueueReplaceState(instance, instance.state, null)); + } + function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { + startPhaseTimer$1(workInProgress, "componentWillReceiveProps"); + var oldState = instance.state; + instance.componentWillReceiveProps(newProps, newContext), stopPhaseTimer$1(), instance.state !== oldState && (warning$8(!1, "%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), + updater.enqueueReplaceState(instance, instance.state, null)); + } + function mountClassInstance(workInProgress, priorityLevel) { + checkClassInstance(workInProgress); + var instance = workInProgress.stateNode, state = instance.state || null, props = workInProgress.pendingProps; + invariant(props, "There must be pending props for an initial mount. This error is " + "likely caused by a bug in React. Please file an issue."); + var unmaskedContext = getUnmaskedContext$2(workInProgress); + if (instance.props = props, instance.state = state, instance.refs = emptyObject, + instance.context = getMaskedContext$2(workInProgress, unmaskedContext), ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != workInProgress.type && !0 === workInProgress.type.unstable_asyncUpdates && (workInProgress.internalContextTag |= AsyncUpdates$1), + "function" == typeof instance.componentWillMount) { + callComponentWillMount(workInProgress, instance); + var updateQueue = workInProgress.updateQueue; + null !== updateQueue && (instance.state = beginUpdateQueue$2(workInProgress, updateQueue, instance, state, props, priorityLevel)); + } + "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1); + } + function resumeMountClassInstance(workInProgress, priorityLevel) { + var instance = workInProgress.stateNode; + resetInputPointers(workInProgress, instance); + var newState = workInProgress.memoizedState, newProps = workInProgress.pendingProps; + newProps || (newProps = workInProgress.memoizedProps, invariant(null != newProps, "There should always be pending or memoized props. This error is " + "likely caused by a bug in React. Please file an issue.")); + var newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext), oldContext = instance.context, oldProps = workInProgress.memoizedProps; + "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); + var updateQueue = workInProgress.updateQueue; + if (null !== updateQueue && (newState = beginUpdateQueue$2(workInProgress, updateQueue, instance, newState, newProps, priorityLevel)), + !checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) return instance.props = newProps, + instance.state = newState, instance.context = newContext, !1; + if (instance.props = newProps, instance.state = newState, instance.context = newContext, + "function" == typeof instance.componentWillMount) { + callComponentWillMount(workInProgress, instance); + var newUpdateQueue = workInProgress.updateQueue; + null !== newUpdateQueue && (newState = beginUpdateQueue$2(workInProgress, newUpdateQueue, instance, newState, newProps, priorityLevel)); + } + return "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1), + instance.state = newState, !0; + } + function updateClassInstance(current, workInProgress, priorityLevel) { + var instance = workInProgress.stateNode; + resetInputPointers(workInProgress, instance); + var oldProps = workInProgress.memoizedProps, newProps = workInProgress.pendingProps; + newProps || (newProps = oldProps, invariant(null != newProps, "There should always be pending or memoized props. This error is " + "likely caused by a bug in React. Please file an issue.")); + var oldContext = instance.context, newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext); + "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); + var updateQueue = workInProgress.updateQueue, oldState = workInProgress.memoizedState, newState = void 0; + if (newState = null !== updateQueue ? beginUpdateQueue$2(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel) : oldState, + !(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== updateQueue && updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), + !1; + var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext); + return shouldUpdate ? ("function" == typeof instance.componentWillUpdate && (startPhaseTimer$1(workInProgress, "componentWillUpdate"), + instance.componentWillUpdate(newProps, newState, newContext), stopPhaseTimer$1()), + "function" == typeof instance.componentDidUpdate && (workInProgress.effectTag |= Update$1)) : ("function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), + memoizeProps(workInProgress, newProps), memoizeState(workInProgress, newState)), + instance.props = newProps, instance.state = newState, instance.context = newContext, shouldUpdate; } - return !type.prototype || !type.prototype.isPureReactComponent || (!shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState)); - } - function checkClassInstance(workInProgress) { - var instance = workInProgress.stateNode, type = workInProgress.type, name = getComponentName_1(workInProgress), renderPresent = instance.render; - warning$8(renderPresent, "%s(...): No `render` method found on the returned component " + "instance: you may have forgotten to define `render`.", name); - var noGetInitialStateOnES6 = !instance.getInitialState || instance.getInitialState.isReactClassApproved || instance.state; - warning$8(noGetInitialStateOnES6, "getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", name); - var noGetDefaultPropsOnES6 = !instance.getDefaultProps || instance.getDefaultProps.isReactClassApproved; - warning$8(noGetDefaultPropsOnES6, "getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", name); - var noInstancePropTypes = !instance.propTypes; - warning$8(noInstancePropTypes, "propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", name); - var noInstanceContextTypes = !instance.contextTypes; - warning$8(noInstanceContextTypes, "contextTypes was defined as an instance property on %s. Use a static " + "property to define contextTypes instead.", name); - var noComponentShouldUpdate = "function" != typeof instance.componentShouldUpdate; - warning$8(noComponentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", name), - type.prototype && type.prototype.isPureReactComponent && void 0 !== instance.shouldComponentUpdate && warning$8(!1, "%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", getComponentName_1(workInProgress) || "A pure component"); - var noComponentDidUnmount = "function" != typeof instance.componentDidUnmount; - warning$8(noComponentDidUnmount, "%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", name); - var noComponentWillRecieveProps = "function" != typeof instance.componentWillRecieveProps; - warning$8(noComponentWillRecieveProps, "%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", name); - var hasMutatedProps = instance.props !== workInProgress.pendingProps; - warning$8(void 0 === instance.props || !hasMutatedProps, "%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", name, name); - var noInstanceDefaultProps = !instance.defaultProps; - warning$8(noInstanceDefaultProps, "Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", name, name); - var state = instance.state; - state && ("object" != typeof state || isArray$1(state)) && invariant(!1, "%s.state: must be set to an object or null", getComponentName_1(workInProgress)), - "function" == typeof instance.getChildContext && invariant("object" == typeof workInProgress.type.childContextTypes, "%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", getComponentName_1(workInProgress)); - } - function resetInputPointers(workInProgress, instance) { - instance.props = workInProgress.memoizedProps, instance.state = workInProgress.memoizedState; - } - function adoptClassInstance(workInProgress, instance) { - instance.updater = updater, workInProgress.stateNode = instance, ReactInstanceMap_1.set(instance, workInProgress); - } - function constructClassInstance(workInProgress, props) { - var ctor = workInProgress.type, unmaskedContext = getUnmaskedContext$2(workInProgress), needsContext = isContextConsumer$1(workInProgress), context = needsContext ? getMaskedContext$2(workInProgress, unmaskedContext) : emptyObject, instance = new ctor(props, context); - return adoptClassInstance(workInProgress, instance), needsContext && cacheContext$1(workInProgress, unmaskedContext, context), - instance; - } - function callComponentWillMount(workInProgress, instance) { - startPhaseTimer$1(workInProgress, "componentWillMount"); - var oldState = instance.state; - instance.componentWillMount(), stopPhaseTimer$1(), oldState !== instance.state && (warning$8(!1, "%s.componentWillMount(): Assigning directly to this.state is " + "deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), - updater.enqueueReplaceState(instance, instance.state, null)); - } - function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) { - startPhaseTimer$1(workInProgress, "componentWillReceiveProps"); - var oldState = instance.state; - instance.componentWillReceiveProps(newProps, newContext), stopPhaseTimer$1(), instance.state !== oldState && (warning$8(!1, "%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", getComponentName_1(workInProgress)), - updater.enqueueReplaceState(instance, instance.state, null)); - } - function mountClassInstance(workInProgress, priorityLevel) { - checkClassInstance(workInProgress); - var instance = workInProgress.stateNode, state = instance.state || null, props = workInProgress.pendingProps; - invariant(props, "There must be pending props for an initial mount. This error is " + "likely caused by a bug in React. Please file an issue."); - var unmaskedContext = getUnmaskedContext$2(workInProgress); - if (instance.props = props, instance.state = state, instance.refs = emptyObject, - instance.context = getMaskedContext$2(workInProgress, unmaskedContext), ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != workInProgress.type && !0 === workInProgress.type.unstable_asyncUpdates && (workInProgress.internalContextTag |= AsyncUpdates$1), - "function" == typeof instance.componentWillMount) { - callComponentWillMount(workInProgress, instance); - var updateQueue = workInProgress.updateQueue; - null !== updateQueue && (instance.state = beginUpdateQueue$2(workInProgress, updateQueue, instance, state, props, priorityLevel)); + return { + adoptClassInstance: adoptClassInstance, + constructClassInstance: constructClassInstance, + mountClassInstance: mountClassInstance, + resumeMountClassInstance: resumeMountClassInstance, + updateClassInstance: updateClassInstance + }; + }, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactDebugCurrentFiber$4 = ReactDebugCurrentFiber_1, _require7 = ReactDebugFiberPerf_1, cancelWorkTimer = _require7.cancelWorkTimer, warning$6 = warning, warnedAboutStatelessRefs = {}, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { + var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance; + function markChildAsProgressed(current, workInProgress, priorityLevel) { + workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, + null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); } - "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1); - } - function resumeMountClassInstance(workInProgress, priorityLevel) { - var instance = workInProgress.stateNode; - resetInputPointers(workInProgress, instance); - var newState = workInProgress.memoizedState, newProps = workInProgress.pendingProps; - newProps || (newProps = workInProgress.memoizedProps, invariant(null != newProps, "There should always be pending or memoized props. This error is " + "likely caused by a bug in React. Please file an issue.")); - var newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext), oldContext = instance.context, oldProps = workInProgress.memoizedProps; - "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); - var updateQueue = workInProgress.updateQueue; - if (null !== updateQueue && (newState = beginUpdateQueue$2(workInProgress, updateQueue, instance, newState, newProps, priorityLevel)), - !checkShouldComponentUpdate(workInProgress, workInProgress.memoizedProps, newProps, workInProgress.memoizedState, newState, newContext)) return instance.props = newProps, - instance.state = newState, instance.context = newContext, !1; - if (instance.props = newProps, instance.state = newState, instance.context = newContext, - "function" == typeof instance.componentWillMount) { - callComponentWillMount(workInProgress, instance); - var newUpdateQueue = workInProgress.updateQueue; - null !== newUpdateQueue && (newState = beginUpdateQueue$2(workInProgress, newUpdateQueue, instance, newState, newProps, priorityLevel)); + function clearDeletions(workInProgress) { + workInProgress.progressedFirstDeletion = workInProgress.progressedLastDeletion = null; } - return "function" == typeof instance.componentDidMount && (workInProgress.effectTag |= Update$1), - instance.state = newState, !0; - } - function updateClassInstance(current, workInProgress, priorityLevel) { - var instance = workInProgress.stateNode; - resetInputPointers(workInProgress, instance); - var oldProps = workInProgress.memoizedProps, newProps = workInProgress.pendingProps; - newProps || (newProps = oldProps, invariant(null != newProps, "There should always be pending or memoized props. This error is " + "likely caused by a bug in React. Please file an issue.")); - var oldContext = instance.context, newUnmaskedContext = getUnmaskedContext$2(workInProgress), newContext = getMaskedContext$2(workInProgress, newUnmaskedContext); - "function" != typeof instance.componentWillReceiveProps || oldProps === newProps && oldContext === newContext || callComponentWillReceiveProps(workInProgress, instance, newProps, newContext); - var updateQueue = workInProgress.updateQueue, oldState = workInProgress.memoizedState, newState = void 0; - if (newState = null !== updateQueue ? beginUpdateQueue$2(workInProgress, updateQueue, instance, oldState, newProps, priorityLevel) : oldState, - !(oldProps !== newProps || oldState !== newState || hasContextChanged$2() || null !== updateQueue && updateQueue.hasForceUpdate)) return "function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), - !1; - var shouldUpdate = checkShouldComponentUpdate(workInProgress, oldProps, newProps, oldState, newState, newContext); - return shouldUpdate ? ("function" == typeof instance.componentWillUpdate && (startPhaseTimer$1(workInProgress, "componentWillUpdate"), - instance.componentWillUpdate(newProps, newState, newContext), stopPhaseTimer$1()), - "function" == typeof instance.componentDidUpdate && (workInProgress.effectTag |= Update$1)) : ("function" == typeof instance.componentDidUpdate && (oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.effectTag |= Update$1)), - memoizeProps(workInProgress, newProps), memoizeState(workInProgress, newState)), - instance.props = newProps, instance.state = newState, instance.context = newContext, - shouldUpdate; - } - return { - adoptClassInstance: adoptClassInstance, - constructClassInstance: constructClassInstance, - mountClassInstance: mountClassInstance, - resumeMountClassInstance: resumeMountClassInstance, - updateClassInstance: updateClassInstance - }; -}, mountChildFibersInPlace = ReactChildFiber.mountChildFibersInPlace, reconcileChildFibers = ReactChildFiber.reconcileChildFibers, reconcileChildFibersInPlace = ReactChildFiber.reconcileChildFibersInPlace, cloneChildFibers = ReactChildFiber.cloneChildFibers, beginUpdateQueue$1 = ReactFiberUpdateQueue.beginUpdateQueue, getMaskedContext$1 = ReactFiberContext.getMaskedContext, getUnmaskedContext$1 = ReactFiberContext.getUnmaskedContext, hasContextChanged$1 = ReactFiberContext.hasContextChanged, pushContextProvider$1 = ReactFiberContext.pushContextProvider, pushTopLevelContextObject$1 = ReactFiberContext.pushTopLevelContextObject, invalidateContextProvider$1 = ReactFiberContext.invalidateContextProvider, IndeterminateComponent$2 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$1 = ReactTypeOfWork.FunctionalComponent, ClassComponent$5 = ReactTypeOfWork.ClassComponent, HostRoot$5 = ReactTypeOfWork.HostRoot, HostComponent$7 = ReactTypeOfWork.HostComponent, HostText$3 = ReactTypeOfWork.HostText, HostPortal$3 = ReactTypeOfWork.HostPortal, CoroutineComponent$1 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$2 = ReactTypeOfWork.YieldComponent, Fragment$2 = ReactTypeOfWork.Fragment, NoWork$3 = ReactPriorityLevel.NoWork, OffscreenPriority$1 = ReactPriorityLevel.OffscreenPriority, PerformedWork$1 = ReactTypeOfSideEffect.PerformedWork, Placement$2 = ReactTypeOfSideEffect.Placement, ContentReset$1 = ReactTypeOfSideEffect.ContentReset, Err$1 = ReactTypeOfSideEffect.Err, Ref$1 = ReactTypeOfSideEffect.Ref, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, ReactDebugCurrentFiber$4 = ReactDebugCurrentFiber_1, _require7 = ReactDebugFiberPerf_1, cancelWorkTimer = _require7.cancelWorkTimer, warning$6 = warning, warnedAboutStatelessRefs = {}, ReactFiberBeginWork = function(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext) { - var shouldSetTextContent = config.shouldSetTextContent, useSyncScheduling = config.useSyncScheduling, shouldDeprioritizeSubtree = config.shouldDeprioritizeSubtree, pushHostContext = hostContext.pushHostContext, pushHostContainer = hostContext.pushHostContainer, enterHydrationState = hydrationContext.enterHydrationState, resetHydrationState = hydrationContext.resetHydrationState, tryToClaimNextHydratableInstance = hydrationContext.tryToClaimNextHydratableInstance, _ReactFiberClassCompo = ReactFiberClassComponent(scheduleUpdate, getPriorityContext, memoizeProps, memoizeState), adoptClassInstance = _ReactFiberClassCompo.adoptClassInstance, constructClassInstance = _ReactFiberClassCompo.constructClassInstance, mountClassInstance = _ReactFiberClassCompo.mountClassInstance, resumeMountClassInstance = _ReactFiberClassCompo.resumeMountClassInstance, updateClassInstance = _ReactFiberClassCompo.updateClassInstance; - function markChildAsProgressed(current, workInProgress, priorityLevel) { - workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, - null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); - } - function clearDeletions(workInProgress) { - workInProgress.progressedFirstDeletion = workInProgress.progressedLastDeletion = null; - } - function transferDeletions(workInProgress) { - workInProgress.firstEffect = workInProgress.progressedFirstDeletion, workInProgress.lastEffect = workInProgress.progressedLastDeletion; - } - function reconcileChildren(current, workInProgress, nextChildren) { - reconcileChildrenAtPriority(current, workInProgress, nextChildren, workInProgress.pendingWorkPriority); - } - function reconcileChildrenAtPriority(current, workInProgress, nextChildren, priorityLevel) { - workInProgress.memoizedProps = null, null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), - workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel), - transferDeletions(workInProgress)) : (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), - transferDeletions(workInProgress)), markChildAsProgressed(current, workInProgress, priorityLevel); - } - function updateFragment(current, workInProgress) { - var nextChildren = workInProgress.pendingProps; - if (hasContextChanged$1()) null === nextChildren && (nextChildren = workInProgress.memoizedProps); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); - return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren), - workInProgress.child; - } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - null === ref || current && current.ref === ref || (workInProgress.effectTag |= Ref$1); - } - function updateFunctionalComponent(current, workInProgress) { - var fn = workInProgress.type, nextProps = workInProgress.pendingProps, memoizedProps = workInProgress.memoizedProps; - if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps); else { - if (null === nextProps || memoizedProps === nextProps) return bailoutOnAlreadyFinishedWork(current, workInProgress); - if ("function" == typeof fn.shouldComponentUpdate && !fn.shouldComponentUpdate(memoizedProps, nextProps)) return memoizeProps(workInProgress, nextProps), - bailoutOnAlreadyFinishedWork(current, workInProgress); + function transferDeletions(workInProgress) { + workInProgress.firstEffect = workInProgress.progressedFirstDeletion, workInProgress.lastEffect = workInProgress.progressedLastDeletion; } - var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); - return ReactCurrentOwner$2.current = workInProgress, ReactDebugCurrentFiber$4.phase = "render", - nextChildren = fn(nextProps, context), ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1, - reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), - workInProgress.child; - } - function updateClassComponent(current, workInProgress, priorityLevel) { - var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0; - return null === current ? workInProgress.stateNode ? shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel) : (constructClassInstance(workInProgress, workInProgress.pendingProps), - mountClassInstance(workInProgress, priorityLevel), shouldUpdate = !0) : shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel), - finishClassComponent(current, workInProgress, shouldUpdate, hasContext); - } - function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) { - if (markRef(current, workInProgress), !shouldUpdate) return bailoutOnAlreadyFinishedWork(current, workInProgress); - var instance = workInProgress.stateNode; - ReactCurrentOwner$2.current = workInProgress; - var nextChildren = void 0; - return ReactDebugCurrentFiber$4.phase = "render", nextChildren = instance.render(), - ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1, - reconcileChildren(current, workInProgress, nextChildren), memoizeState(workInProgress, instance.state), - memoizeProps(workInProgress, instance.props), hasContext && invalidateContextProvider$1(workInProgress), - workInProgress.child; - } - function updateHostRoot(current, workInProgress, priorityLevel) { - var root = workInProgress.stateNode; - root.pendingContext ? pushTopLevelContextObject$1(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject$1(workInProgress, root.context, !1), - pushHostContainer(workInProgress, root.containerInfo); - var updateQueue = workInProgress.updateQueue; - if (null !== updateQueue) { - var prevState = workInProgress.memoizedState, state = beginUpdateQueue$1(workInProgress, updateQueue, null, prevState, null, priorityLevel); - if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); - var element = state.element; - return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), - reconcileChildren(current, workInProgress, element)) : (workInProgress.effectTag |= Placement$2, - workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), - markChildAsProgressed(current, workInProgress, priorityLevel)), memoizeState(workInProgress, state), + function reconcileChildren(current, workInProgress, nextChildren) { + reconcileChildrenAtPriority(current, workInProgress, nextChildren, workInProgress.pendingWorkPriority); + } + function reconcileChildrenAtPriority(current, workInProgress, nextChildren, priorityLevel) { + workInProgress.memoizedProps = null, null === current ? workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), + workInProgress.child = reconcileChildFibers(workInProgress, workInProgress.child, nextChildren, priorityLevel), + transferDeletions(workInProgress)) : (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), + transferDeletions(workInProgress)), markChildAsProgressed(current, workInProgress, priorityLevel); + } + function updateFragment(current, workInProgress) { + var nextChildren = workInProgress.pendingProps; + if (hasContextChanged$1()) null === nextChildren && (nextChildren = workInProgress.memoizedProps); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); + return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextChildren), workInProgress.child; } - return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); - } - function updateHostComponent(current, workInProgress) { - pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress); - var nextProps = workInProgress.pendingProps, type = workInProgress.type, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; - if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) { - if (!useSyncScheduling && shouldDeprioritizeSubtree(type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { - for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, - child = child.sibling; + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + null === ref || current && current.ref === ref || (workInProgress.effectTag |= Ref$1); + } + function updateFunctionalComponent(current, workInProgress) { + var fn = workInProgress.type, nextProps = workInProgress.pendingProps, memoizedProps = workInProgress.memoizedProps; + if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps); else { + if (null === nextProps || memoizedProps === nextProps) return bailoutOnAlreadyFinishedWork(current, workInProgress); + if ("function" == typeof fn.shouldComponentUpdate && !fn.shouldComponentUpdate(memoizedProps, nextProps)) return memoizeProps(workInProgress, nextProps), + bailoutOnAlreadyFinishedWork(current, workInProgress); + } + var nextChildren, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); + return ReactCurrentOwner$2.current = workInProgress, ReactDebugCurrentFiber$4.phase = "render", + nextChildren = fn(nextProps, context), ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1, + reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), + workInProgress.child; + } + function updateClassComponent(current, workInProgress, priorityLevel) { + var hasContext = pushContextProvider$1(workInProgress), shouldUpdate = void 0; + return null === current ? workInProgress.stateNode ? shouldUpdate = resumeMountClassInstance(workInProgress, priorityLevel) : (constructClassInstance(workInProgress, workInProgress.pendingProps), + mountClassInstance(workInProgress, priorityLevel), shouldUpdate = !0) : shouldUpdate = updateClassInstance(current, workInProgress, priorityLevel), + finishClassComponent(current, workInProgress, shouldUpdate, hasContext); + } + function finishClassComponent(current, workInProgress, shouldUpdate, hasContext) { + if (markRef(current, workInProgress), !shouldUpdate) return bailoutOnAlreadyFinishedWork(current, workInProgress); + var instance = workInProgress.stateNode; + ReactCurrentOwner$2.current = workInProgress; + var nextChildren = void 0; + return ReactDebugCurrentFiber$4.phase = "render", nextChildren = instance.render(), + ReactDebugCurrentFiber$4.phase = null, workInProgress.effectTag |= PerformedWork$1, + reconcileChildren(current, workInProgress, nextChildren), memoizeState(workInProgress, instance.state), + memoizeProps(workInProgress, instance.props), hasContext && invalidateContextProvider$1(workInProgress), + workInProgress.child; + } + function updateHostRoot(current, workInProgress, priorityLevel) { + var root = workInProgress.stateNode; + root.pendingContext ? pushTopLevelContextObject$1(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject$1(workInProgress, root.context, !1), + pushHostContainer(workInProgress, root.containerInfo); + var updateQueue = workInProgress.updateQueue; + if (null !== updateQueue) { + var prevState = workInProgress.memoizedState, state = beginUpdateQueue$1(workInProgress, updateQueue, null, prevState, null, priorityLevel); + if (prevState === state) return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); + var element = state.element; + return null !== current && null !== current.child || !enterHydrationState(workInProgress) ? (resetHydrationState(), + reconcileChildren(current, workInProgress, element)) : (workInProgress.effectTag |= Placement$2, + workInProgress.child = mountChildFibersInPlace(workInProgress, workInProgress.child, element, priorityLevel), + markChildAsProgressed(current, workInProgress, priorityLevel)), memoizeState(workInProgress, state), + workInProgress.child; + } + return resetHydrationState(), bailoutOnAlreadyFinishedWork(current, workInProgress); + } + function updateHostComponent(current, workInProgress) { + pushHostContext(workInProgress), null === current && tryToClaimNextHydratableInstance(workInProgress); + var nextProps = workInProgress.pendingProps, type = workInProgress.type, prevProps = null !== current ? current.memoizedProps : null, memoizedProps = workInProgress.memoizedProps; + if (hasContextChanged$1()) null === nextProps && (nextProps = memoizedProps, invariant(null !== nextProps, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextProps || memoizedProps === nextProps) { + if (!useSyncScheduling && shouldDeprioritizeSubtree(type, memoizedProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { + for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority = OffscreenPriority$1, + child = child.sibling; + return null; + } + return bailoutOnAlreadyFinishedWork(current, workInProgress); + } + var nextChildren = nextProps.children; + if (shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1), + markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { + if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), + reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), + memoizeProps(workInProgress, nextProps), workInProgress.child = null !== current ? current.child : null, + null === current) for (var _child = workInProgress.progressedChild; null !== _child; ) _child.effectTag = Placement$2, + _child = _child.sibling; return null; } - return bailoutOnAlreadyFinishedWork(current, workInProgress); + return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), + workInProgress.child; } - var nextChildren = nextProps.children; - if (shouldSetTextContent(type, nextProps) ? nextChildren = null : prevProps && shouldSetTextContent(type, prevProps) && (workInProgress.effectTag |= ContentReset$1), - markRef(current, workInProgress), !useSyncScheduling && shouldDeprioritizeSubtree(workInProgress.type, nextProps) && workInProgress.pendingWorkPriority !== OffscreenPriority$1) { - if (workInProgress.progressedPriority === OffscreenPriority$1 && (workInProgress.child = workInProgress.progressedChild), - reconcileChildrenAtPriority(current, workInProgress, nextChildren, OffscreenPriority$1), - memoizeProps(workInProgress, nextProps), workInProgress.child = null !== current ? current.child : null, - null === current) for (var _child = workInProgress.progressedChild; null !== _child; ) _child.effectTag = Placement$2, - _child = _child.sibling; - return null; + function updateHostText(current, workInProgress) { + null === current && tryToClaimNextHydratableInstance(workInProgress); + var nextProps = workInProgress.pendingProps; + return null === nextProps && (nextProps = workInProgress.memoizedProps), memoizeProps(workInProgress, nextProps), + null; } - return reconcileChildren(current, workInProgress, nextChildren), memoizeProps(workInProgress, nextProps), - workInProgress.child; - } - function updateHostText(current, workInProgress) { - null === current && tryToClaimNextHydratableInstance(workInProgress); - var nextProps = workInProgress.pendingProps; - return null === nextProps && (nextProps = workInProgress.memoizedProps), memoizeProps(workInProgress, nextProps), - null; - } - function mountIndeterminateComponent(current, workInProgress, priorityLevel) { - invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue."); - var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); - if (ReactCurrentOwner$2.current = workInProgress, value = fn(props, context), workInProgress.effectTag |= PerformedWork$1, - "object" == typeof value && null !== value && "function" == typeof value.render) { - workInProgress.tag = ClassComponent$5; - var hasContext = pushContextProvider$1(workInProgress); - return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), - finishClassComponent(current, workInProgress, !0, hasContext); + function mountIndeterminateComponent(current, workInProgress, priorityLevel) { + invariant(null === current, "An indeterminate component should never have mounted. This error is " + "likely caused by a bug in React. Please file an issue."); + var value, fn = workInProgress.type, props = workInProgress.pendingProps, unmaskedContext = getUnmaskedContext$1(workInProgress), context = getMaskedContext$1(workInProgress, unmaskedContext); + if (ReactCurrentOwner$2.current = workInProgress, value = fn(props, context), workInProgress.effectTag |= PerformedWork$1, + "object" == typeof value && null !== value && "function" == typeof value.render) { + workInProgress.tag = ClassComponent$5; + var hasContext = pushContextProvider$1(workInProgress); + return adoptClassInstance(workInProgress, value), mountClassInstance(workInProgress, priorityLevel), + finishClassComponent(current, workInProgress, !0, hasContext); + } + workInProgress.tag = FunctionalComponent$1; + var Component = workInProgress.type; + if (Component && warning$6(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), + null !== workInProgress.ref) { + var info = "", ownerName = ReactDebugCurrentFiber$4.getCurrentFiberOwnerName(); + ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`."); + var warningKey = ownerName || workInProgress._debugID || "", debugSource = workInProgress._debugSource; + debugSource && (warningKey = debugSource.fileName + ":" + debugSource.lineNumber), + warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, + warning$6(!1, "Stateless function components cannot be given refs. " + "Attempts to access this ref will fail.%s%s", info, ReactDebugCurrentFiber$4.getCurrentFiberStackAddendum())); + } + return reconcileChildren(current, workInProgress, value), memoizeProps(workInProgress, props), + workInProgress.child; } - workInProgress.tag = FunctionalComponent$1; - var Component = workInProgress.type; - if (Component && warning$6(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), - null !== workInProgress.ref) { - var info = "", ownerName = ReactDebugCurrentFiber$4.getCurrentFiberOwnerName(); - ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`."); - var warningKey = ownerName || workInProgress._debugID || "", debugSource = workInProgress._debugSource; - debugSource && (warningKey = debugSource.fileName + ":" + debugSource.lineNumber), - warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, - warning$6(!1, "Stateless function components cannot be given refs. " + "Attempts to access this ref will fail.%s%s", info, ReactDebugCurrentFiber$4.getCurrentFiberStackAddendum())); + function updateCoroutineComponent(current, workInProgress) { + var nextCoroutine = workInProgress.pendingProps; + hasContextChanged$1() ? null === nextCoroutine && (nextCoroutine = current && current.memoizedProps, + invariant(null !== nextCoroutine, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")) : null !== nextCoroutine && workInProgress.memoizedProps !== nextCoroutine || (nextCoroutine = workInProgress.memoizedProps); + var nextChildren = nextCoroutine.children, priorityLevel = workInProgress.pendingWorkPriority; + return workInProgress.memoizedProps = null, null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), + workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), + transferDeletions(workInProgress)) : (workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), + transferDeletions(workInProgress)), memoizeProps(workInProgress, nextCoroutine), + workInProgress.stateNode; } - return reconcileChildren(current, workInProgress, value), memoizeProps(workInProgress, props), - workInProgress.child; - } - function updateCoroutineComponent(current, workInProgress) { - var nextCoroutine = workInProgress.pendingProps; - hasContextChanged$1() ? null === nextCoroutine && (nextCoroutine = current && current.memoizedProps, - invariant(null !== nextCoroutine, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")) : null !== nextCoroutine && workInProgress.memoizedProps !== nextCoroutine || (nextCoroutine = workInProgress.memoizedProps); - var nextChildren = nextCoroutine.children, priorityLevel = workInProgress.pendingWorkPriority; - return workInProgress.memoizedProps = null, null === current ? workInProgress.stateNode = mountChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel) : current.child === workInProgress.child ? (clearDeletions(workInProgress), - workInProgress.stateNode = reconcileChildFibers(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), - transferDeletions(workInProgress)) : (workInProgress.stateNode = reconcileChildFibersInPlace(workInProgress, workInProgress.stateNode, nextChildren, priorityLevel), - transferDeletions(workInProgress)), memoizeProps(workInProgress, nextCoroutine), - workInProgress.stateNode; - } - function updatePortalComponent(current, workInProgress) { - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - var priorityLevel = workInProgress.pendingWorkPriority, nextChildren = workInProgress.pendingProps; - if (hasContextChanged$1()) null === nextChildren && (nextChildren = current && current.memoizedProps, - invariant(null != nextChildren, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); - return null === current ? (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), - memoizeProps(workInProgress, nextChildren), markChildAsProgressed(current, workInProgress, priorityLevel)) : (reconcileChildren(current, workInProgress, nextChildren), - memoizeProps(workInProgress, nextChildren)), workInProgress.child; - } - function bailoutOnAlreadyFinishedWork(current, workInProgress) { - cancelWorkTimer(workInProgress); - var priorityLevel = workInProgress.pendingWorkPriority; - return current && workInProgress.child === current.child && clearDeletions(workInProgress), - cloneChildFibers(current, workInProgress), markChildAsProgressed(current, workInProgress, priorityLevel), - workInProgress.child; - } - function bailoutOnLowPriority(current, workInProgress) { - switch (cancelWorkTimer(workInProgress), workInProgress.tag) { - case ClassComponent$5: - pushContextProvider$1(workInProgress); - break; - - case HostPortal$3: + function updatePortalComponent(current, workInProgress) { pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + var priorityLevel = workInProgress.pendingWorkPriority, nextChildren = workInProgress.pendingProps; + if (hasContextChanged$1()) null === nextChildren && (nextChildren = current && current.memoizedProps, + invariant(null != nextChildren, "We should always have pending or current props. This error is " + "likely caused by a bug in React. Please file an issue.")); else if (null === nextChildren || workInProgress.memoizedProps === nextChildren) return bailoutOnAlreadyFinishedWork(current, workInProgress); + return null === current ? (workInProgress.child = reconcileChildFibersInPlace(workInProgress, workInProgress.child, nextChildren, priorityLevel), + memoizeProps(workInProgress, nextChildren), markChildAsProgressed(current, workInProgress, priorityLevel)) : (reconcileChildren(current, workInProgress, nextChildren), + memoizeProps(workInProgress, nextChildren)), workInProgress.child; } - return null; - } - function memoizeProps(workInProgress, nextProps) { - workInProgress.memoizedProps = nextProps, workInProgress.pendingProps = null; - } - function memoizeState(workInProgress, nextState) { - workInProgress.memoizedState = nextState; - } - function beginWork(current, workInProgress, priorityLevel) { - if (workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); - switch (ReactDebugCurrentFiber$4.current = workInProgress, workInProgress.firstEffect = null, - workInProgress.lastEffect = null, workInProgress.progressedPriority === priorityLevel && (workInProgress.child = workInProgress.progressedChild), - workInProgress.tag) { - case IndeterminateComponent$2: - return mountIndeterminateComponent(current, workInProgress, priorityLevel); - - case FunctionalComponent$1: - return updateFunctionalComponent(current, workInProgress); - - case ClassComponent$5: - return updateClassComponent(current, workInProgress, priorityLevel); - - case HostRoot$5: - return updateHostRoot(current, workInProgress, priorityLevel); - - case HostComponent$7: - return updateHostComponent(current, workInProgress); - - case HostText$3: - return updateHostText(current, workInProgress); - - case CoroutineHandlerPhase: - workInProgress.tag = CoroutineComponent$1; - - case CoroutineComponent$1: - return updateCoroutineComponent(current, workInProgress); - - case YieldComponent$2: - return null; - - case HostPortal$3: - return updatePortalComponent(current, workInProgress); - - case Fragment$2: - return updateFragment(current, workInProgress); - - default: - invariant(!1, "Unknown unit of work tag. This error is likely caused by a bug in " + "React. Please file an issue."); + function bailoutOnAlreadyFinishedWork(current, workInProgress) { + cancelWorkTimer(workInProgress); + var priorityLevel = workInProgress.pendingWorkPriority; + return current && workInProgress.child === current.child && clearDeletions(workInProgress), + cloneChildFibers(current, workInProgress), markChildAsProgressed(current, workInProgress, priorityLevel), + workInProgress.child; } - } - function beginFailedWork(current, workInProgress, priorityLevel) { - if (invariant(workInProgress.tag === ClassComponent$5 || workInProgress.tag === HostRoot$5, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."), - workInProgress.effectTag |= Err$1, workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); - if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildren(current, workInProgress, null), - workInProgress.tag === ClassComponent$5) { - var instance = workInProgress.stateNode; - workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state, - workInProgress.pendingProps = null; - } - return workInProgress.child; - } - return { - beginWork: beginWork, - beginFailedWork: beginFailedWork - }; -}, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$4 = ReactTypeOfWork.YieldComponent, Fragment$4 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactDebugCurrentFiber$5 = ReactDebugCurrentFiber_1, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { - var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; - function markChildAsProgressed(current, workInProgress, priorityLevel) { - workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, - null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); - } - function markUpdate(workInProgress) { - workInProgress.effectTag |= Update$2; - } - function markRef(workInProgress) { - workInProgress.effectTag |= Ref$2; - } - function appendAllYields(yields, workInProgress) { - var node = workInProgress.stateNode; - for (node && (node.return = workInProgress); null !== node; ) { - if (node.tag === HostComponent$8 || node.tag === HostText$5 || node.tag === HostPortal$5) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$4) yields.push(node.type); else if (null !== node.child) { - node.child.return = node, node = node.child; - continue; - } - for (;null === node.sibling; ) { - if (null === node.return || node.return === workInProgress) return; - node = node.return; - } - node.sibling.return = node.return, node = node.sibling; - } - } - function moveCoroutineToHandlerPhase(current, workInProgress) { - var coroutine = workInProgress.memoizedProps; - invariant(coroutine, "Should be resolved by now. This error is likely caused by a bug in " + "React. Please file an issue."), - workInProgress.tag = CoroutineHandlerPhase$1; - var yields = []; - appendAllYields(yields, workInProgress); - var fn = coroutine.handler, props = coroutine.props, nextChildren = fn(props, yields), currentFirstChild = null !== current ? current.child : null, priority = workInProgress.pendingWorkPriority; - return workInProgress.child = reconcileChildFibers$2(workInProgress, currentFirstChild, nextChildren, priority), - markChildAsProgressed(current, workInProgress, priority), workInProgress.child; - } - function appendAllChildren(parent, workInProgress) { - for (var node = workInProgress.child; null !== node; ) { - if (node.tag === HostComponent$8 || node.tag === HostText$5) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { - node = node.child; - continue; - } - if (node === workInProgress) return; - for (;null === node.sibling; ) { - if (null === node.return || node.return === workInProgress) return; - node = node.return; - } - node = node.sibling; - } - } - function completeWork(current, workInProgress) { - switch (ReactDebugCurrentFiber$5.current = workInProgress, workInProgress.tag) { - case FunctionalComponent$3: - return null; + function bailoutOnLowPriority(current, workInProgress) { + switch (cancelWorkTimer(workInProgress), workInProgress.tag) { + case ClassComponent$5: + pushContextProvider$1(workInProgress); + break; - case ClassComponent$7: - return popContextProvider$2(workInProgress), null; - - case HostRoot$6: - var fiberRoot = workInProgress.stateNode; - return fiberRoot.pendingContext && (fiberRoot.context = fiberRoot.pendingContext, - fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), - workInProgress.effectTag &= ~Placement$4), null; - - case HostComponent$8: - popHostContext(workInProgress); - var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps; - if (null !== current && null != workInProgress.stateNode) { - var oldProps = current.memoizedProps, instance = workInProgress.stateNode, currentHostContext = getHostContext(), updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); - workInProgress.updateQueue = updatePayload, updatePayload && markUpdate(workInProgress), - current.ref !== workInProgress.ref && markRef(workInProgress); - } else { - if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), - null; - var _currentHostContext = getHostContext(); - if (popHydrationState(workInProgress)) prepareToHydrateHostInstance(workInProgress, rootContainerInstance) && markUpdate(workInProgress); else { - var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress); - appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress), - workInProgress.stateNode = _instance; - } - null !== workInProgress.ref && markRef(workInProgress); + case HostPortal$3: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); } return null; + } + function memoizeProps(workInProgress, nextProps) { + workInProgress.memoizedProps = nextProps, workInProgress.pendingProps = null; + } + function memoizeState(workInProgress, nextState) { + workInProgress.memoizedState = nextState; + } + function beginWork(current, workInProgress, priorityLevel) { + if (workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); + switch (ReactDebugCurrentFiber$4.current = workInProgress, workInProgress.firstEffect = null, + workInProgress.lastEffect = null, workInProgress.progressedPriority === priorityLevel && (workInProgress.child = workInProgress.progressedChild), + workInProgress.tag) { + case IndeterminateComponent$2: + return mountIndeterminateComponent(current, workInProgress, priorityLevel); - case HostText$5: - var newText = workInProgress.memoizedProps; - if (current && null != workInProgress.stateNode) { - current.memoizedProps !== newText && markUpdate(workInProgress); - } else { - if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), - null; - var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(); - popHydrationState(workInProgress) ? prepareToHydrateHostTextInstance(workInProgress) && markUpdate(workInProgress) : workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress); + case FunctionalComponent$1: + return updateFunctionalComponent(current, workInProgress); + + case ClassComponent$5: + return updateClassComponent(current, workInProgress, priorityLevel); + + case HostRoot$5: + return updateHostRoot(current, workInProgress, priorityLevel); + + case HostComponent$7: + return updateHostComponent(current, workInProgress); + + case HostText$3: + return updateHostText(current, workInProgress); + + case CoroutineHandlerPhase: + workInProgress.tag = CoroutineComponent$1; + + case CoroutineComponent$1: + return updateCoroutineComponent(current, workInProgress); + + case YieldComponent$2: + return null; + + case HostPortal$3: + return updatePortalComponent(current, workInProgress); + + case Fragment$2: + return updateFragment(current, workInProgress); + + default: + invariant(!1, "Unknown unit of work tag. This error is likely caused by a bug in " + "React. Please file an issue."); } - return null; - - case CoroutineComponent$3: - return moveCoroutineToHandlerPhase(current, workInProgress); - - case CoroutineHandlerPhase$1: - return workInProgress.tag = CoroutineComponent$3, null; - - case YieldComponent$4: - case Fragment$4: - return null; - - case HostPortal$5: - return markUpdate(workInProgress), popHostContainer(workInProgress), null; - - case IndeterminateComponent$3: - invariant(!1, "An indeterminate component should have become determinate before " + "completing. This error is likely caused by a bug in React. Please " + "file an issue."); - - default: - invariant(!1, "Unknown unit of work tag. This error is likely caused by a bug in " + "React. Please file an issue."); } - } - return { - completeWork: completeWork - }; -}, rendererID = null, injectInternals$1 = null, onCommitRoot$1 = null, onCommitUnmount$1 = null; - -if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && __REACT_DEVTOOLS_GLOBAL_HOOK__.supportsFiber) { - var inject$1 = __REACT_DEVTOOLS_GLOBAL_HOOK__.inject, onCommitFiberRoot = __REACT_DEVTOOLS_GLOBAL_HOOK__.onCommitFiberRoot, onCommitFiberUnmount = __REACT_DEVTOOLS_GLOBAL_HOOK__.onCommitFiberUnmount; - injectInternals$1 = function(internals) { - warning(null == rendererID, "Cannot inject into DevTools twice."), rendererID = inject$1(internals); - }, onCommitRoot$1 = function(root) { - if (null != rendererID) try { - onCommitFiberRoot(rendererID, root); - } catch (err) { - warning(!1, "React DevTools encountered an error: %s", err); - } - }, onCommitUnmount$1 = function(fiber) { - if (null != rendererID) try { - onCommitFiberUnmount(rendererID, fiber); - } catch (err) { - warning(!1, "React DevTools encountered an error: %s", err); - } - }; -} - -var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCommitUnmount_1 = onCommitUnmount$1, ReactFiberDevToolsHook = { - injectInternals: injectInternals_1, - onCommitRoot: onCommitRoot_1, - onCommitUnmount: onCommitUnmount_1 -}, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostPortal$6 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, invokeGuardedCallback$2 = ReactErrorUtils_1.invokeGuardedCallback, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, _require5$2 = ReactDebugFiberPerf_1, startPhaseTimer$2 = _require5$2.startPhaseTimer, stopPhaseTimer$2 = _require5$2.stopPhaseTimer, ReactFiberCommitWork = function(config, captureError) { - var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance, callComponentWillUnmountWithTimerInDev = function(current, instance) { - startPhaseTimer$2(current, "componentWillUnmount"), instance.componentWillUnmount(), - stopPhaseTimer$2(); - }; - function safelyCallComponentWillUnmount(current, instance) { - var unmountError = invokeGuardedCallback$2(null, callComponentWillUnmountWithTimerInDev, null, current, instance); - unmountError && captureError(current, unmountError); - } - function safelyDetachRef(current) { - var ref = current.ref; - if (null !== ref) { - var refError = invokeGuardedCallback$2(null, ref, null, null); - null !== refError && captureError(current, refError); - } - } - function getHostParent(fiber) { - for (var parent = fiber.return; null !== parent; ) { - switch (parent.tag) { - case HostComponent$9: - return parent.stateNode; - - case HostRoot$7: - case HostPortal$6: - return parent.stateNode.containerInfo; + function beginFailedWork(current, workInProgress, priorityLevel) { + if (invariant(workInProgress.tag === ClassComponent$5 || workInProgress.tag === HostRoot$5, "Invalid type of work. This error is likely caused by a bug in React. " + "Please file an issue."), + workInProgress.effectTag |= Err$1, workInProgress.pendingWorkPriority === NoWork$3 || workInProgress.pendingWorkPriority > priorityLevel) return bailoutOnLowPriority(current, workInProgress); + if (workInProgress.firstEffect = null, workInProgress.lastEffect = null, reconcileChildren(current, workInProgress, null), + workInProgress.tag === ClassComponent$5) { + var instance = workInProgress.stateNode; + workInProgress.memoizedProps = instance.props, workInProgress.memoizedState = instance.state, + workInProgress.pendingProps = null; } - parent = parent.return; + return workInProgress.child; } - invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); - } - function getHostParentFiber(fiber) { - for (var parent = fiber.return; null !== parent; ) { - if (isHostParent(parent)) return parent; - parent = parent.return; + return { + beginWork: beginWork, + beginFailedWork: beginFailedWork + }; + }, reconcileChildFibers$2 = ReactChildFiber.reconcileChildFibers, popContextProvider$2 = ReactFiberContext.popContextProvider, IndeterminateComponent$3 = ReactTypeOfWork.IndeterminateComponent, FunctionalComponent$3 = ReactTypeOfWork.FunctionalComponent, ClassComponent$7 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$3 = ReactTypeOfWork.CoroutineComponent, CoroutineHandlerPhase$1 = ReactTypeOfWork.CoroutineHandlerPhase, YieldComponent$4 = ReactTypeOfWork.YieldComponent, Fragment$4 = ReactTypeOfWork.Fragment, Placement$4 = ReactTypeOfSideEffect.Placement, Ref$2 = ReactTypeOfSideEffect.Ref, Update$2 = ReactTypeOfSideEffect.Update, ReactDebugCurrentFiber$5 = ReactDebugCurrentFiber_1, ReactFiberCompleteWork = function(config, hostContext, hydrationContext) { + var createInstance = config.createInstance, createTextInstance = config.createTextInstance, appendInitialChild = config.appendInitialChild, finalizeInitialChildren = config.finalizeInitialChildren, prepareUpdate = config.prepareUpdate, getRootHostContainer = hostContext.getRootHostContainer, popHostContext = hostContext.popHostContext, getHostContext = hostContext.getHostContext, popHostContainer = hostContext.popHostContainer, prepareToHydrateHostInstance = hydrationContext.prepareToHydrateHostInstance, prepareToHydrateHostTextInstance = hydrationContext.prepareToHydrateHostTextInstance, popHydrationState = hydrationContext.popHydrationState; + function markChildAsProgressed(current, workInProgress, priorityLevel) { + workInProgress.progressedChild = workInProgress.child, workInProgress.progressedPriority = priorityLevel, + null !== current && (current.progressedChild = workInProgress.progressedChild, current.progressedPriority = workInProgress.progressedPriority); } - invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); - } - function isHostParent(fiber) { - return fiber.tag === HostComponent$9 || fiber.tag === HostRoot$7 || fiber.tag === HostPortal$6; - } - function getHostSibling(fiber) { - var node = fiber; - siblings: for (;!0; ) { - for (;null === node.sibling; ) { - if (null === node.return || isHostParent(node.return)) return null; - node = node.return; - } - for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$9 && node.tag !== HostText$6; ) { - if (node.effectTag & Placement$5) continue siblings; - if (null === node.child || node.tag === HostPortal$6) continue siblings; - node.child.return = node, node = node.child; - } - if (!(node.effectTag & Placement$5)) return node.stateNode; + function markUpdate(workInProgress) { + workInProgress.effectTag |= Update$2; } - } - function commitPlacement(finishedWork) { - var parentFiber = getHostParentFiber(finishedWork), parent = void 0; - switch (parentFiber.tag) { - case HostComponent$9: - parent = parentFiber.stateNode; - break; - - case HostRoot$7: - case HostPortal$6: - parent = parentFiber.stateNode.containerInfo; - break; - - default: - invariant(!1, "Invalid host parent fiber. This error is likely caused by a bug " + "in React. Please file an issue."); + function markRef(workInProgress) { + workInProgress.effectTag |= Ref$2; } - parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2); - for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) { - if (node.tag === HostComponent$9 || node.tag === HostText$6) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$6) ; else if (null !== node.child) { - node.child.return = node, node = node.child; - continue; - } - if (node === finishedWork) return; - for (;null === node.sibling; ) { - if (null === node.return || node.return === finishedWork) return; - node = node.return; - } - node.sibling.return = node.return, node = node.sibling; - } - } - function commitNestedUnmounts(root) { - for (var node = root; !0; ) if (commitUnmount(node), null === node.child || node.tag === HostPortal$6) { - if (node === root) return; - for (;null === node.sibling; ) { - if (null === node.return || node.return === root) return; - node = node.return; - } - node.sibling.return = node.return, node = node.sibling; - } else node.child.return = node, node = node.child; - } - function unmountHostComponents(parent, current) { - for (var node = current; !0; ) { - if (node.tag === HostComponent$9 || node.tag === HostText$6) commitNestedUnmounts(node), - removeChild(parent, node.stateNode); else if (node.tag === HostPortal$6) { - if (parent = node.stateNode.containerInfo, null !== node.child) { + function appendAllYields(yields, workInProgress) { + var node = workInProgress.stateNode; + for (node && (node.return = workInProgress); null !== node; ) { + if (node.tag === HostComponent$8 || node.tag === HostText$5 || node.tag === HostPortal$5) invariant(!1, "A coroutine cannot have host component children."); else if (node.tag === YieldComponent$4) yields.push(node.type); else if (null !== node.child) { node.child.return = node, node = node.child; continue; } - } else if (commitUnmount(node), null !== node.child) { - node.child.return = node, node = node.child; - continue; + for (;null === node.sibling; ) { + if (null === node.return || node.return === workInProgress) return; + node = node.return; + } + node.sibling.return = node.return, node = node.sibling; } - if (node === current) return; - for (;null === node.sibling; ) { - if (null === node.return || node.return === current) return; - node = node.return, node.tag === HostPortal$6 && (parent = getHostParent(node)); - } - node.sibling.return = node.return, node = node.sibling; } - } - function commitDeletion(current) { - unmountHostComponents(getHostParent(current), current), current.return = null, current.child = null, - current.alternate && (current.alternate.child = null, current.alternate.return = null); - } - function commitUnmount(current) { - switch ("function" == typeof onCommitUnmount && onCommitUnmount(current), current.tag) { - case ClassComponent$8: - safelyDetachRef(current); - var instance = current.stateNode; - return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance)); - - case HostComponent$9: - return void safelyDetachRef(current); - - case CoroutineComponent$4: - return void commitNestedUnmounts(current.stateNode); - - case HostPortal$6: - return void unmountHostComponents(getHostParent(current), current); + function moveCoroutineToHandlerPhase(current, workInProgress) { + var coroutine = workInProgress.memoizedProps; + invariant(coroutine, "Should be resolved by now. This error is likely caused by a bug in " + "React. Please file an issue."), + workInProgress.tag = CoroutineHandlerPhase$1; + var yields = []; + appendAllYields(yields, workInProgress); + var fn = coroutine.handler, props = coroutine.props, nextChildren = fn(props, yields), currentFirstChild = null !== current ? current.child : null, priority = workInProgress.pendingWorkPriority; + return workInProgress.child = reconcileChildFibers$2(workInProgress, currentFirstChild, nextChildren, priority), + markChildAsProgressed(current, workInProgress, priority), workInProgress.child; } - } - function commitWork(current, finishedWork) { - switch (finishedWork.tag) { - case ClassComponent$8: - return; - - case HostComponent$9: - var instance = finishedWork.stateNode; - if (null != instance) { - var newProps = finishedWork.memoizedProps, oldProps = null !== current ? current.memoizedProps : newProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; - finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); + function appendAllChildren(parent, workInProgress) { + for (var node = workInProgress.child; null !== node; ) { + if (node.tag === HostComponent$8 || node.tag === HostText$5) appendInitialChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { + node = node.child; + continue; + } + if (node === workInProgress) return; + for (;null === node.sibling; ) { + if (null === node.return || node.return === workInProgress) return; + node = node.return; + } + node = node.sibling; } - return; - - case HostText$6: - invariant(null !== finishedWork.stateNode, "This should have a text node initialized. This error is likely " + "caused by a bug in React. Please file an issue."); - var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = null !== current ? current.memoizedProps : newText; - return void commitTextUpdate(textInstance, oldText, newText); - - case HostRoot$7: - case HostPortal$6: - return; - - default: - invariant(!1, "This unit of work tag should not have side-effects. This error is " + "likely caused by a bug in React. Please file an issue."); } - } - function commitLifeCycles(current, finishedWork) { - switch (finishedWork.tag) { - case ClassComponent$8: - var instance = finishedWork.stateNode; - if (finishedWork.effectTag & Update$3) if (null === current) startPhaseTimer$2(finishedWork, "componentDidMount"), - instance.componentDidMount(), stopPhaseTimer$2(); else { - var prevProps = current.memoizedProps, prevState = current.memoizedState; - startPhaseTimer$2(finishedWork, "componentDidUpdate"), instance.componentDidUpdate(prevProps, prevState), - stopPhaseTimer$2(); + function completeWork(current, workInProgress) { + switch (ReactDebugCurrentFiber$5.current = workInProgress, workInProgress.tag) { + case FunctionalComponent$3: + return null; + + case ClassComponent$7: + return popContextProvider$2(workInProgress), null; + + case HostRoot$6: + var fiberRoot = workInProgress.stateNode; + return fiberRoot.pendingContext && (fiberRoot.context = fiberRoot.pendingContext, + fiberRoot.pendingContext = null), null !== current && null !== current.child || (popHydrationState(workInProgress), + workInProgress.effectTag &= ~Placement$4), null; + + case HostComponent$8: + popHostContext(workInProgress); + var rootContainerInstance = getRootHostContainer(), type = workInProgress.type, newProps = workInProgress.memoizedProps; + if (null !== current && null != workInProgress.stateNode) { + var oldProps = current.memoizedProps, instance = workInProgress.stateNode, currentHostContext = getHostContext(), updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); + workInProgress.updateQueue = updatePayload, updatePayload && markUpdate(workInProgress), + current.ref !== workInProgress.ref && markRef(workInProgress); + } else { + if (!newProps) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), + null; + var _currentHostContext = getHostContext(); + if (popHydrationState(workInProgress)) prepareToHydrateHostInstance(workInProgress, rootContainerInstance) && markUpdate(workInProgress); else { + var _instance = createInstance(type, newProps, rootContainerInstance, _currentHostContext, workInProgress); + appendAllChildren(_instance, workInProgress), finalizeInitialChildren(_instance, type, newProps, rootContainerInstance) && markUpdate(workInProgress), + workInProgress.stateNode = _instance; + } + null !== workInProgress.ref && markRef(workInProgress); + } + return null; + + case HostText$5: + var newText = workInProgress.memoizedProps; + if (current && null != workInProgress.stateNode) { + current.memoizedProps !== newText && markUpdate(workInProgress); + } else { + if ("string" != typeof newText) return invariant(null !== workInProgress.stateNode, "We must have new props for new mounts. This error is likely " + "caused by a bug in React. Please file an issue."), + null; + var _rootContainerInstance = getRootHostContainer(), _currentHostContext2 = getHostContext(); + popHydrationState(workInProgress) ? prepareToHydrateHostTextInstance(workInProgress) && markUpdate(workInProgress) : workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext2, workInProgress); + } + return null; + + case CoroutineComponent$3: + return moveCoroutineToHandlerPhase(current, workInProgress); + + case CoroutineHandlerPhase$1: + return workInProgress.tag = CoroutineComponent$3, null; + + case YieldComponent$4: + case Fragment$4: + return null; + + case HostPortal$5: + return markUpdate(workInProgress), popHostContainer(workInProgress), null; + + case IndeterminateComponent$3: + invariant(!1, "An indeterminate component should have become determinate before " + "completing. This error is likely caused by a bug in React. Please " + "file an issue."); + + default: + invariant(!1, "Unknown unit of work tag. This error is likely caused by a bug in " + "React. Please file an issue."); } - return void (finishedWork.effectTag & Callback$1 && null !== finishedWork.updateQueue && commitCallbacks$1(finishedWork, finishedWork.updateQueue, instance)); - - case HostRoot$7: - var updateQueue = finishedWork.updateQueue; - if (null !== updateQueue) { - var _instance = finishedWork.child && finishedWork.child.stateNode; - commitCallbacks$1(finishedWork, updateQueue, _instance); - } - return; - - case HostComponent$9: - var _instance2 = finishedWork.stateNode; - if (null === current && finishedWork.effectTag & Update$3) { - var type = finishedWork.type, props = finishedWork.memoizedProps; - commitMount(_instance2, type, props, finishedWork); - } - return; - - case HostText$6: - case HostPortal$6: - return; - - default: - invariant(!1, "This unit of work tag should not have side-effects. This error is " + "likely caused by a bug in React. Please file an issue."); } + return { + completeWork: completeWork + }; + }, rendererID = null, injectInternals$1 = null, onCommitRoot$1 = null, onCommitUnmount$1 = null; + if ("undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && __REACT_DEVTOOLS_GLOBAL_HOOK__.supportsFiber) { + var inject$1 = __REACT_DEVTOOLS_GLOBAL_HOOK__.inject, onCommitFiberRoot = __REACT_DEVTOOLS_GLOBAL_HOOK__.onCommitFiberRoot, onCommitFiberUnmount = __REACT_DEVTOOLS_GLOBAL_HOOK__.onCommitFiberUnmount; + injectInternals$1 = function(internals) { + warning(null == rendererID, "Cannot inject into DevTools twice."), rendererID = inject$1(internals); + }, onCommitRoot$1 = function(root) { + if (null != rendererID) try { + onCommitFiberRoot(rendererID, root); + } catch (err) { + warning(!1, "React DevTools encountered an error: %s", err); + } + }, onCommitUnmount$1 = function(fiber) { + if (null != rendererID) try { + onCommitFiberUnmount(rendererID, fiber); + } catch (err) { + warning(!1, "React DevTools encountered an error: %s", err); + } + }; } - function commitAttachRef(finishedWork) { - var ref = finishedWork.ref; - if (null !== ref) { - var instance = finishedWork.stateNode; - switch (finishedWork.tag) { + var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCommitUnmount_1 = onCommitUnmount$1, ReactFiberDevToolsHook = { + injectInternals: injectInternals_1, + onCommitRoot: onCommitRoot_1, + onCommitUnmount: onCommitUnmount_1 + }, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$7 = ReactTypeOfWork.HostRoot, HostComponent$9 = ReactTypeOfWork.HostComponent, HostText$6 = ReactTypeOfWork.HostText, HostPortal$6 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, invokeGuardedCallback$2 = ReactErrorUtils_1.invokeGuardedCallback, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, _require5$2 = ReactDebugFiberPerf_1, startPhaseTimer$2 = _require5$2.startPhaseTimer, stopPhaseTimer$2 = _require5$2.stopPhaseTimer, ReactFiberCommitWork = function(config, captureError) { + var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, appendChildToContainer = config.appendChildToContainer, insertBefore = config.insertBefore, insertInContainerBefore = config.insertInContainerBefore, removeChild = config.removeChild, removeChildFromContainer = config.removeChildFromContainer, getPublicInstance = config.getPublicInstance, callComponentWillUnmountWithTimerInDev = function(current, instance) { + startPhaseTimer$2(current, "componentWillUnmount"), instance.componentWillUnmount(), + stopPhaseTimer$2(); + }; + function safelyCallComponentWillUnmount(current, instance) { + var unmountError = invokeGuardedCallback$2(null, callComponentWillUnmountWithTimerInDev, null, current, instance); + unmountError && captureError(current, unmountError); + } + function safelyDetachRef(current) { + var ref = current.ref; + if (null !== ref) { + var refError = invokeGuardedCallback$2(null, ref, null, null); + null !== refError && captureError(current, refError); + } + } + function getHostParentFiber(fiber) { + for (var parent = fiber.return; null !== parent; ) { + if (isHostParent(parent)) return parent; + parent = parent.return; + } + invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); + } + function isHostParent(fiber) { + return fiber.tag === HostComponent$9 || fiber.tag === HostRoot$7 || fiber.tag === HostPortal$6; + } + function getHostSibling(fiber) { + var node = fiber; + siblings: for (;!0; ) { + for (;null === node.sibling; ) { + if (null === node.return || isHostParent(node.return)) return null; + node = node.return; + } + for (node.sibling.return = node.return, node = node.sibling; node.tag !== HostComponent$9 && node.tag !== HostText$6; ) { + if (node.effectTag & Placement$5) continue siblings; + if (null === node.child || node.tag === HostPortal$6) continue siblings; + node.child.return = node, node = node.child; + } + if (!(node.effectTag & Placement$5)) return node.stateNode; + } + } + function commitPlacement(finishedWork) { + var parentFiber = getHostParentFiber(finishedWork), parent = void 0, isContainer = void 0; + switch (parentFiber.tag) { case HostComponent$9: - ref(getPublicInstance(instance)); + parent = parentFiber.stateNode, isContainer = !1; + break; + + case HostRoot$7: + case HostPortal$6: + parent = parentFiber.stateNode.containerInfo, isContainer = !0; break; default: - ref(instance); + invariant(!1, "Invalid host parent fiber. This error is likely caused by a bug " + "in React. Please file an issue."); + } + parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2); + for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) { + if (node.tag === HostComponent$9 || node.tag === HostText$6) before ? isContainer ? insertInContainerBefore(parent, node.stateNode, before) : insertBefore(parent, node.stateNode, before) : isContainer ? appendChildToContainer(parent, node.stateNode) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$6) ; else if (null !== node.child) { + node.child.return = node, node = node.child; + continue; + } + if (node === finishedWork) return; + for (;null === node.sibling; ) { + if (null === node.return || node.return === finishedWork) return; + node = node.return; + } + node.sibling.return = node.return, node = node.sibling; } } - } - function commitDetachRef(current) { - var currentRef = current.ref; - null !== currentRef && currentRef(null); - } - return { - commitPlacement: commitPlacement, - commitDeletion: commitDeletion, - commitWork: commitWork, - commitLifeCycles: commitLifeCycles, - commitAttachRef: commitAttachRef, - commitDetachRef: commitDetachRef - }; -}, createCursor$2 = ReactFiberStack.createCursor, pop$2 = ReactFiberStack.pop, push$2 = ReactFiberStack.push, NO_CONTEXT = {}, ReactFiberHostContext = function(config) { - var getChildHostContext = config.getChildHostContext, getRootHostContext = config.getRootHostContext, contextStackCursor = createCursor$2(NO_CONTEXT), contextFiberStackCursor = createCursor$2(NO_CONTEXT), rootInstanceStackCursor = createCursor$2(NO_CONTEXT); - function requiredContext(c) { - return invariant(c !== NO_CONTEXT, "Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."), - c; - } - function getRootHostContainer() { - return requiredContext(rootInstanceStackCursor.current); - } - function pushHostContainer(fiber, nextRootInstance) { - push$2(rootInstanceStackCursor, nextRootInstance, fiber); - var nextRootContext = getRootHostContext(nextRootInstance); - push$2(contextFiberStackCursor, fiber, fiber), push$2(contextStackCursor, nextRootContext, fiber); - } - function popHostContainer(fiber) { - pop$2(contextStackCursor, fiber), pop$2(contextFiberStackCursor, fiber), pop$2(rootInstanceStackCursor, fiber); - } - function getHostContext() { - return requiredContext(contextStackCursor.current); - } - function pushHostContext(fiber) { - var rootInstance = requiredContext(rootInstanceStackCursor.current), context = requiredContext(contextStackCursor.current), nextContext = getChildHostContext(context, fiber.type, rootInstance); - context !== nextContext && (push$2(contextFiberStackCursor, fiber, fiber), push$2(contextStackCursor, nextContext, fiber)); - } - function popHostContext(fiber) { - contextFiberStackCursor.current === fiber && (pop$2(contextStackCursor, fiber), - pop$2(contextFiberStackCursor, fiber)); - } - function resetHostContainer() { - contextStackCursor.current = NO_CONTEXT, rootInstanceStackCursor.current = NO_CONTEXT; - } - return { - getHostContext: getHostContext, - getRootHostContainer: getRootHostContainer, - popHostContainer: popHostContainer, - popHostContext: popHostContext, - pushHostContainer: pushHostContainer, - pushHostContext: pushHostContext, - resetHostContainer: resetHostContainer - }; -}, HostComponent$10 = ReactTypeOfWork.HostComponent, HostText$7 = ReactTypeOfWork.HostText, HostRoot$8 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { - var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance; - if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return { - enterHydrationState: function() { - return !1; - }, - resetHydrationState: function() {}, - tryToClaimNextHydratableInstance: function() {}, - prepareToHydrateHostInstance: function() { - invariant(!1, "React bug."); - }, - prepareToHydrateHostTextInstance: function() { - invariant(!1, "React bug."); - }, - popHydrationState: function(fiber) { - return !1; + function commitNestedUnmounts(root) { + for (var node = root; !0; ) if (commitUnmount(node), null === node.child || node.tag === HostPortal$6) { + if (node === root) return; + for (;null === node.sibling; ) { + if (null === node.return || node.return === root) return; + node = node.return; + } + node.sibling.return = node.return, node = node.sibling; + } else node.child.return = node, node = node.child; } - }; - var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1; - function enterHydrationState(fiber) { - var parentInstance = fiber.stateNode.containerInfo; - return nextHydratableInstance = getFirstHydratableChild(parentInstance), hydrationParentFiber = fiber, - isHydrating = !0, !0; - } - function deleteHydratableInstance(returnFiber, instance) { - var childToDelete = createFiberFromHostInstanceForDeletion$1(); - childToDelete.stateNode = instance, childToDelete.return = returnFiber, childToDelete.effectTag = Deletion$2, - null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete, - returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; - } - function canHydrate(fiber, nextInstance) { - switch (fiber.tag) { - case HostComponent$10: - var type = fiber.type, props = fiber.memoizedProps; - return canHydrateInstance(nextInstance, type, props); + function unmountHostComponents(current) { + for (var node = current, currentParentIsValid = !1, currentParent = void 0, currentParentIsContainer = void 0; !0; ) { + if (!currentParentIsValid) { + var parent = node.return; + findParent: for (;!0; ) { + switch (invariant(null !== parent, "Expected to find a host parent. This error is likely caused by " + "a bug in React. Please file an issue."), + parent.tag) { + case HostComponent$9: + currentParent = parent.stateNode, currentParentIsContainer = !1; + break findParent; - case HostText$7: - return canHydrateTextInstance(nextInstance); - - default: - return !1; - } - } - function tryToClaimNextHydratableInstance(fiber) { - if (isHydrating) { - var nextInstance = nextHydratableInstance; - if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); - if (!canHydrate(fiber, nextInstance)) { - if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return fiber.effectTag |= Placement$6, - isHydrating = !1, void (hydrationParentFiber = fiber); - deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); + case HostRoot$7: + case HostPortal$6: + currentParent = parent.stateNode.containerInfo, currentParentIsContainer = !0; + break findParent; + } + parent = parent.return; + } + currentParentIsValid = !0; + } + if (node.tag === HostComponent$9 || node.tag === HostText$6) commitNestedUnmounts(node), + currentParentIsContainer ? removeChildFromContainer(currentParent, node.stateNode) : removeChild(currentParent, node.stateNode); else if (node.tag === HostPortal$6) { + if (currentParent = node.stateNode.containerInfo, null !== node.child) { + node.child.return = node, node = node.child; + continue; + } + } else if (commitUnmount(node), null !== node.child) { + node.child.return = node, node = node.child; + continue; + } + if (node === current) return; + for (;null === node.sibling; ) { + if (null === node.return || node.return === current) return; + node = node.return, node.tag === HostPortal$6 && (currentParentIsValid = !1); + } + node.sibling.return = node.return, node = node.sibling; } - fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance); } - } - function prepareToHydrateHostInstance(fiber, rootContainerInstance) { - var instance = fiber.stateNode, updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber); - return fiber.updateQueue = updatePayload, null !== updatePayload; - } - function prepareToHydrateHostTextInstance(fiber) { - var textInstance = fiber.stateNode; - return hydrateTextInstance(textInstance, fiber.memoizedProps, fiber); - } - function popToNextHostParent(fiber) { - for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$10 && parent.tag !== HostRoot$8; ) parent = parent.return; - hydrationParentFiber = parent; - } - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1; - var type = fiber.type; - if (fiber.tag !== HostComponent$10 || "head" !== type && "body" !== type && !shouldSetTextContent(type, fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), - nextInstance = getNextHydratableSibling(nextInstance); - return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, - !0; - } - function resetHydrationState() { - hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1; - } - return { - enterHydrationState: enterHydrationState, - resetHydrationState: resetHydrationState, - tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance, - prepareToHydrateHostInstance: prepareToHydrateHostInstance, - prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance, - popHydrationState: popHydrationState - }; -}, ReactFiberInstrumentation$2 = { - debugTool: null -}, ReactFiberInstrumentation_1 = ReactFiberInstrumentation$2, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber$2 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, invokeGuardedCallback$1 = ReactErrorUtils_1.invokeGuardedCallback, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostPortal$2 = ReactTypeOfWork.HostPortal, ClassComponent$4 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, warning$5 = warning, ReactFiberInstrumentation$1 = ReactFiberInstrumentation_1, ReactDebugCurrentFiber$3 = ReactDebugCurrentFiber_1, _require15 = ReactDebugFiberPerf_1, recordEffect = _require15.recordEffect, recordScheduleUpdate = _require15.recordScheduleUpdate, startWorkTimer = _require15.startWorkTimer, stopWorkTimer = _require15.stopWorkTimer, startWorkLoopTimer = _require15.startWorkLoopTimer, stopWorkLoopTimer = _require15.stopWorkLoopTimer, startCommitTimer = _require15.startCommitTimer, stopCommitTimer = _require15.stopCommitTimer, startCommitHostEffectsTimer = _require15.startCommitHostEffectsTimer, stopCommitHostEffectsTimer = _require15.stopCommitHostEffectsTimer, startCommitLifeCyclesTimer = _require15.startCommitLifeCyclesTimer, stopCommitLifeCyclesTimer = _require15.stopCommitLifeCyclesTimer, warnAboutUpdateOnUnmounted = function(instance) { - var ctor = instance.constructor; - warning$5(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"); -}, warnAboutInvalidUpdates = function(instance) { - switch (ReactDebugCurrentFiber$3.phase) { - case "getChildContext": - warning$5(!1, "setState(...): Cannot call setState() inside getChildContext()"); - break; + function commitDeletion(current) { + unmountHostComponents(current), current.return = null, current.child = null, current.alternate && (current.alternate.child = null, + current.alternate.return = null); + } + function commitUnmount(current) { + switch ("function" == typeof onCommitUnmount && onCommitUnmount(current), current.tag) { + case ClassComponent$8: + safelyDetachRef(current); + var instance = current.stateNode; + return void ("function" == typeof instance.componentWillUnmount && safelyCallComponentWillUnmount(current, instance)); - case "render": - warning$5(!1, "Cannot update during an existing state transition (such as within " + "`render` or another component's constructor). Render methods should " + "be a pure function of props and state; constructor side-effects are " + "an anti-pattern, but can be moved to `componentWillMount`."); - } -}, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) { - var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, hostScheduleAnimationCallback = config.scheduleAnimationCallback, hostScheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isAnimationCallbackScheduled = !1, isDeferredCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1; - function scheduleAnimationCallback(callback) { - isAnimationCallbackScheduled || (isAnimationCallbackScheduled = !0, hostScheduleAnimationCallback(callback)); - } - function scheduleDeferredCallback(callback) { - isDeferredCallbackScheduled || (isDeferredCallbackScheduled = !0, hostScheduleDeferredCallback(callback)); - } - function resetContextStack() { - reset$1(), resetContext$1(), resetHostContainer(); - } - function findNextUnitOfWork() { - for (;null !== nextScheduledRoot && nextScheduledRoot.current.pendingWorkPriority === NoWork$2; ) { - nextScheduledRoot.isScheduled = !1; - var next = nextScheduledRoot.nextScheduledRoot; - if (nextScheduledRoot.nextScheduledRoot = null, nextScheduledRoot === lastScheduledRoot) return nextScheduledRoot = null, - lastScheduledRoot = null, nextPriorityLevel = NoWork$2, null; - nextScheduledRoot = next; - } - for (var root = nextScheduledRoot, highestPriorityRoot = null, highestPriorityLevel = NoWork$2; null !== root; ) root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority) && (highestPriorityLevel = root.current.pendingWorkPriority, - highestPriorityRoot = root), root = root.nextScheduledRoot; - return null !== highestPriorityRoot ? (nextPriorityLevel = highestPriorityLevel, - priorityContext = nextPriorityLevel, resetContextStack(), cloneFiber$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2, - null); - } - function commitAllHostEffects() { - for (;null !== nextEffect; ) { - ReactDebugCurrentFiber$3.current = nextEffect, recordEffect(); - var effectTag = nextEffect.effectTag; - if (effectTag & ContentReset && config.resetTextContent(nextEffect.stateNode), effectTag & Ref) { - var current = nextEffect.alternate; - null !== current && commitDetachRef(current); - } - switch (effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork)) { - case Placement$1: - commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; - break; + case HostComponent$9: + return void safelyDetachRef(current); - case PlacementAndUpdate: - commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; - var _current = nextEffect.alternate; - commitWork(_current, nextEffect); - break; + case CoroutineComponent$4: + return void commitNestedUnmounts(current.stateNode); - case Update: - var _current2 = nextEffect.alternate; - commitWork(_current2, nextEffect); - break; + case HostPortal$6: + return void unmountHostComponents(current); + } + } + function commitWork(current, finishedWork) { + switch (finishedWork.tag) { + case ClassComponent$8: + return; - case Deletion: - isUnmounting = !0, commitDeletion(nextEffect), isUnmounting = !1; + case HostComponent$9: + var instance = finishedWork.stateNode; + if (null != instance) { + var newProps = finishedWork.memoizedProps, oldProps = null !== current ? current.memoizedProps : newProps, type = finishedWork.type, updatePayload = finishedWork.updateQueue; + finishedWork.updateQueue = null, null !== updatePayload && commitUpdate(instance, updatePayload, type, oldProps, newProps, finishedWork); + } + return; + + case HostText$6: + invariant(null !== finishedWork.stateNode, "This should have a text node initialized. This error is likely " + "caused by a bug in React. Please file an issue."); + var textInstance = finishedWork.stateNode, newText = finishedWork.memoizedProps, oldText = null !== current ? current.memoizedProps : newText; + return void commitTextUpdate(textInstance, oldText, newText); + + case HostRoot$7: + case HostPortal$6: + return; + + default: + invariant(!1, "This unit of work tag should not have side-effects. This error is " + "likely caused by a bug in React. Please file an issue."); } - nextEffect = nextEffect.nextEffect; } - ReactDebugCurrentFiber$3.current = null; - } - function commitAllLifeCycles() { - for (;null !== nextEffect; ) { - var effectTag = nextEffect.effectTag; - if (effectTag & (Update | Callback)) { - recordEffect(); - var current = nextEffect.alternate; - commitLifeCycles(current, nextEffect); + function commitLifeCycles(current, finishedWork) { + switch (finishedWork.tag) { + case ClassComponent$8: + var instance = finishedWork.stateNode; + if (finishedWork.effectTag & Update$3) if (null === current) startPhaseTimer$2(finishedWork, "componentDidMount"), + instance.componentDidMount(), stopPhaseTimer$2(); else { + var prevProps = current.memoizedProps, prevState = current.memoizedState; + startPhaseTimer$2(finishedWork, "componentDidUpdate"), instance.componentDidUpdate(prevProps, prevState), + stopPhaseTimer$2(); + } + return void (finishedWork.effectTag & Callback$1 && null !== finishedWork.updateQueue && commitCallbacks$1(finishedWork, finishedWork.updateQueue, instance)); + + case HostRoot$7: + var updateQueue = finishedWork.updateQueue; + if (null !== updateQueue) { + var _instance = finishedWork.child && finishedWork.child.stateNode; + commitCallbacks$1(finishedWork, updateQueue, _instance); + } + return; + + case HostComponent$9: + var _instance2 = finishedWork.stateNode; + if (null === current && finishedWork.effectTag & Update$3) { + var type = finishedWork.type, props = finishedWork.memoizedProps; + commitMount(_instance2, type, props, finishedWork); + } + return; + + case HostText$6: + case HostPortal$6: + return; + + default: + invariant(!1, "This unit of work tag should not have side-effects. This error is " + "likely caused by a bug in React. Please file an issue."); } - effectTag & Ref && (recordEffect(), commitAttachRef(nextEffect)), effectTag & Err && (recordEffect(), - commitErrorHandling(nextEffect)); - var next = nextEffect.nextEffect; - nextEffect.nextEffect = null, nextEffect = next; } - } - function commitAllWork(finishedWork) { - isCommitting = !0, startCommitTimer(), pendingCommit = null; - var root = finishedWork.stateNode; - invariant(root.current !== finishedWork, "Cannot commit the same tree as before. This is probably a bug " + "related to the return field. This error is likely caused by a bug " + "in React. Please file an issue."), - ReactCurrentOwner$1.current = null; - var previousPriorityContext = priorityContext; - priorityContext = TaskPriority$1; - var firstEffect = void 0; - for (finishedWork.effectTag > PerformedWork ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, - firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect, - prepareForCommit(), nextEffect = firstEffect, startCommitHostEffectsTimer(); null !== nextEffect; ) { - var _error = null; - _error = invokeGuardedCallback$1(null, commitAllHostEffects, null), null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), - captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); - } - for (stopCommitHostEffectsTimer(), resetAfterCommit(), root.current = finishedWork, - nextEffect = firstEffect, startCommitLifeCyclesTimer(); null !== nextEffect; ) { - var _error2 = null; - _error2 = invokeGuardedCallback$1(null, commitAllLifeCycles, null), null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), - captureError(nextEffect, _error2), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); - } - isCommitting = !1, stopCommitLifeCyclesTimer(), stopCommitTimer(), "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode), - !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCommitWork(finishedWork), - commitPhaseBoundaries && (commitPhaseBoundaries.forEach(scheduleErrorRecovery), - commitPhaseBoundaries = null), priorityContext = previousPriorityContext; - } - function resetWorkPriority(workInProgress) { - var newPriority = NoWork$2, queue = workInProgress.updateQueue, tag = workInProgress.tag; - null === queue || tag !== ClassComponent$4 && tag !== HostRoot$4 || (newPriority = getPendingPriority$1(queue)); - for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority !== NoWork$2 && (newPriority === NoWork$2 || newPriority > child.pendingWorkPriority) && (newPriority = child.pendingWorkPriority), - child = child.sibling; - workInProgress.pendingWorkPriority = newPriority; - } - function completeUnitOfWork(workInProgress) { - for (;!0; ) { - var current = workInProgress.alternate, next = completeWork(current, workInProgress), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling; - if (resetWorkPriority(workInProgress), null !== next) return stopWorkTimer(workInProgress), - !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), - next; - if (null !== returnFiber) { - null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), - null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), - returnFiber.lastEffect = workInProgress.lastEffect); - workInProgress.effectTag > PerformedWork && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, - returnFiber.lastEffect = workInProgress); + function commitAttachRef(finishedWork) { + var ref = finishedWork.ref; + if (null !== ref) { + var instance = finishedWork.stateNode; + switch (finishedWork.tag) { + case HostComponent$9: + ref(getPublicInstance(instance)); + break; + + default: + ref(instance); + } } - if (stopWorkTimer(workInProgress), !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), - null !== siblingFiber) return siblingFiber; - if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, - null; - workInProgress = returnFiber; } - return null; - } - function performUnitOfWork(workInProgress) { - var current = workInProgress.alternate; - startWorkTimer(workInProgress); - var next = beginWork(current, workInProgress, nextPriorityLevel); - return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), - null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, - ReactDebugCurrentFiber$3.current = null, next; - } - function performFailedUnitOfWork(workInProgress) { - var current = workInProgress.alternate; - startWorkTimer(workInProgress); - var next = beginFailedWork(current, workInProgress, nextPriorityLevel); - return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), - null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, - ReactDebugCurrentFiber$3.current = null, next; - } - function performDeferredWork(deadline) { - isDeferredCallbackScheduled = !1, performWork(OffscreenPriority, deadline); - } - function performAnimationWork() { - isAnimationCallbackScheduled = !1, performWork(AnimationPriority, null); - } - function clearErrors() { - for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork()); - } - function workLoop(priorityLevel, deadline) { - if (clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()), - null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit), - nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), - clearErrors()); - } - function performWork(priorityLevel, deadline) { - startWorkLoopTimer(), invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), - isPerformingWork = !0; - for (var isPerformingDeferredWork = !!deadline; priorityLevel !== NoWork$2 && !fatalError; ) { - invariant(null !== deadline || priorityLevel < HighPriority, "Cannot perform deferred work without a deadline. This error is " + "likely caused by a bug in React. Please file an issue."), - null === pendingCommit || deadlineHasExpired || commitAllWork(pendingCommit), priorityContextBeforeReconciliation = priorityContext; - var _error3 = null; - if (_error3 = invokeGuardedCallback$1(null, workLoop, null, priorityLevel, deadline), - priorityContext = priorityContextBeforeReconciliation, null !== _error3) { + function commitDetachRef(current) { + var currentRef = current.ref; + null !== currentRef && currentRef(null); + } + return { + commitPlacement: commitPlacement, + commitDeletion: commitDeletion, + commitWork: commitWork, + commitLifeCycles: commitLifeCycles, + commitAttachRef: commitAttachRef, + commitDetachRef: commitDetachRef + }; + }, createCursor$2 = ReactFiberStack.createCursor, pop$2 = ReactFiberStack.pop, push$2 = ReactFiberStack.push, NO_CONTEXT = {}, ReactFiberHostContext = function(config) { + var getChildHostContext = config.getChildHostContext, getRootHostContext = config.getRootHostContext, contextStackCursor = createCursor$2(NO_CONTEXT), contextFiberStackCursor = createCursor$2(NO_CONTEXT), rootInstanceStackCursor = createCursor$2(NO_CONTEXT); + function requiredContext(c) { + return invariant(c !== NO_CONTEXT, "Expected host context to exist. This error is likely caused by a bug " + "in React. Please file an issue."), + c; + } + function getRootHostContainer() { + return requiredContext(rootInstanceStackCursor.current); + } + function pushHostContainer(fiber, nextRootInstance) { + push$2(rootInstanceStackCursor, nextRootInstance, fiber); + var nextRootContext = getRootHostContext(nextRootInstance); + push$2(contextFiberStackCursor, fiber, fiber), push$2(contextStackCursor, nextRootContext, fiber); + } + function popHostContainer(fiber) { + pop$2(contextStackCursor, fiber), pop$2(contextFiberStackCursor, fiber), pop$2(rootInstanceStackCursor, fiber); + } + function getHostContext() { + return requiredContext(contextStackCursor.current); + } + function pushHostContext(fiber) { + var rootInstance = requiredContext(rootInstanceStackCursor.current), context = requiredContext(contextStackCursor.current), nextContext = getChildHostContext(context, fiber.type, rootInstance); + context !== nextContext && (push$2(contextFiberStackCursor, fiber, fiber), push$2(contextStackCursor, nextContext, fiber)); + } + function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && (pop$2(contextStackCursor, fiber), + pop$2(contextFiberStackCursor, fiber)); + } + function resetHostContainer() { + contextStackCursor.current = NO_CONTEXT, rootInstanceStackCursor.current = NO_CONTEXT; + } + return { + getHostContext: getHostContext, + getRootHostContainer: getRootHostContainer, + popHostContainer: popHostContainer, + popHostContext: popHostContext, + pushHostContainer: pushHostContainer, + pushHostContext: pushHostContext, + resetHostContainer: resetHostContainer + }; + }, HostComponent$10 = ReactTypeOfWork.HostComponent, HostText$7 = ReactTypeOfWork.HostText, HostRoot$8 = ReactTypeOfWork.HostRoot, Deletion$2 = ReactTypeOfSideEffect.Deletion, Placement$6 = ReactTypeOfSideEffect.Placement, createFiberFromHostInstanceForDeletion$1 = ReactFiber.createFiberFromHostInstanceForDeletion, ReactFiberHydrationContext = function(config) { + var shouldSetTextContent = config.shouldSetTextContent, canHydrateInstance = config.canHydrateInstance, canHydrateTextInstance = config.canHydrateTextInstance, getNextHydratableSibling = config.getNextHydratableSibling, getFirstHydratableChild = config.getFirstHydratableChild, hydrateInstance = config.hydrateInstance, hydrateTextInstance = config.hydrateTextInstance; + if (!(canHydrateInstance && canHydrateTextInstance && getNextHydratableSibling && getFirstHydratableChild && hydrateInstance && hydrateTextInstance)) return { + enterHydrationState: function() { + return !1; + }, + resetHydrationState: function() {}, + tryToClaimNextHydratableInstance: function() {}, + prepareToHydrateHostInstance: function() { + invariant(!1, "React bug."); + }, + prepareToHydrateHostTextInstance: function() { + invariant(!1, "React bug."); + }, + popHydrationState: function(fiber) { + return !1; + } + }; + var hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1; + function enterHydrationState(fiber) { + var parentInstance = fiber.stateNode.containerInfo; + return nextHydratableInstance = getFirstHydratableChild(parentInstance), hydrationParentFiber = fiber, + isHydrating = !0, !0; + } + function deleteHydratableInstance(returnFiber, instance) { + var childToDelete = createFiberFromHostInstanceForDeletion$1(); + childToDelete.stateNode = instance, childToDelete.return = returnFiber, childToDelete.effectTag = Deletion$2, + null !== returnFiber.lastEffect ? (returnFiber.lastEffect.nextEffect = childToDelete, + returnFiber.lastEffect = childToDelete) : returnFiber.firstEffect = returnFiber.lastEffect = childToDelete; + } + function canHydrate(fiber, nextInstance) { + switch (fiber.tag) { + case HostComponent$10: + var type = fiber.type, props = fiber.memoizedProps; + return canHydrateInstance(nextInstance, type, props); + + case HostText$7: + return canHydrateTextInstance(nextInstance); + + default: + return !1; + } + } + function tryToClaimNextHydratableInstance(fiber) { + if (isHydrating) { + var nextInstance = nextHydratableInstance; + if (!nextInstance) return fiber.effectTag |= Placement$6, isHydrating = !1, void (hydrationParentFiber = fiber); + if (!canHydrate(fiber, nextInstance)) { + if (!(nextInstance = getNextHydratableSibling(nextInstance)) || !canHydrate(fiber, nextInstance)) return fiber.effectTag |= Placement$6, + isHydrating = !1, void (hydrationParentFiber = fiber); + deleteHydratableInstance(hydrationParentFiber, nextHydratableInstance); + } + fiber.stateNode = nextInstance, hydrationParentFiber = fiber, nextHydratableInstance = getFirstHydratableChild(nextInstance); + } + } + function prepareToHydrateHostInstance(fiber, rootContainerInstance) { + var instance = fiber.stateNode, updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, fiber); + return fiber.updateQueue = updatePayload, null !== updatePayload; + } + function prepareToHydrateHostTextInstance(fiber) { + var textInstance = fiber.stateNode; + return hydrateTextInstance(textInstance, fiber.memoizedProps, fiber); + } + function popToNextHostParent(fiber) { + for (var parent = fiber.return; null !== parent && parent.tag !== HostComponent$10 && parent.tag !== HostRoot$8; ) parent = parent.return; + hydrationParentFiber = parent; + } + function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), isHydrating = !0, !1; + var type = fiber.type; + if (fiber.tag !== HostComponent$10 || "head" !== type && "body" !== type && !shouldSetTextContent(type, fiber.memoizedProps)) for (var nextInstance = nextHydratableInstance; nextInstance; ) deleteHydratableInstance(fiber, nextInstance), + nextInstance = getNextHydratableSibling(nextInstance); + return popToNextHostParent(fiber), nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null, + !0; + } + function resetHydrationState() { + hydrationParentFiber = null, nextHydratableInstance = null, isHydrating = !1; + } + return { + enterHydrationState: enterHydrationState, + resetHydrationState: resetHydrationState, + tryToClaimNextHydratableInstance: tryToClaimNextHydratableInstance, + prepareToHydrateHostInstance: prepareToHydrateHostInstance, + prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance, + popHydrationState: popHydrationState + }; + }, ReactFiberInstrumentation$2 = { + debugTool: null + }, ReactFiberInstrumentation_1 = ReactFiberInstrumentation$2, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber$2 = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, invokeGuardedCallback$1 = ReactErrorUtils_1.invokeGuardedCallback, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$4 = ReactTypeOfWork.HostRoot, HostComponent$6 = ReactTypeOfWork.HostComponent, HostPortal$2 = ReactTypeOfWork.HostPortal, ClassComponent$4 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, warning$5 = warning, ReactFiberInstrumentation$1 = ReactFiberInstrumentation_1, ReactDebugCurrentFiber$3 = ReactDebugCurrentFiber_1, _require15 = ReactDebugFiberPerf_1, recordEffect = _require15.recordEffect, recordScheduleUpdate = _require15.recordScheduleUpdate, startWorkTimer = _require15.startWorkTimer, stopWorkTimer = _require15.stopWorkTimer, startWorkLoopTimer = _require15.startWorkLoopTimer, stopWorkLoopTimer = _require15.stopWorkLoopTimer, startCommitTimer = _require15.startCommitTimer, stopCommitTimer = _require15.stopCommitTimer, startCommitHostEffectsTimer = _require15.startCommitHostEffectsTimer, stopCommitHostEffectsTimer = _require15.stopCommitHostEffectsTimer, startCommitLifeCyclesTimer = _require15.startCommitLifeCyclesTimer, stopCommitLifeCyclesTimer = _require15.stopCommitLifeCyclesTimer, warnAboutUpdateOnUnmounted = function(instance) { + var ctor = instance.constructor; + warning$5(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"); + }, warnAboutInvalidUpdates = function(instance) { + switch (ReactDebugCurrentFiber$3.phase) { + case "getChildContext": + warning$5(!1, "setState(...): Cannot call setState() inside getChildContext()"); + break; + + case "render": + warning$5(!1, "Cannot update during an existing state transition (such as within " + "`render` or another component's constructor). Render methods should " + "be a pure function of props and state; constructor side-effects are " + "an anti-pattern, but can be moved to `componentWillMount`."); + } + }, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) { + var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, scheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, isUnbatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1; + function resetContextStack() { + reset$1(), resetContext$1(), resetHostContainer(); + } + function findNextUnitOfWork() { + for (;null !== nextScheduledRoot && nextScheduledRoot.current.pendingWorkPriority === NoWork$2; ) { + nextScheduledRoot.isScheduled = !1; + var next = nextScheduledRoot.nextScheduledRoot; + if (nextScheduledRoot.nextScheduledRoot = null, nextScheduledRoot === lastScheduledRoot) return nextScheduledRoot = null, + lastScheduledRoot = null, nextPriorityLevel = NoWork$2, null; + nextScheduledRoot = next; + } + for (var root = nextScheduledRoot, highestPriorityRoot = null, highestPriorityLevel = NoWork$2; null !== root; ) root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority) && (highestPriorityLevel = root.current.pendingWorkPriority, + highestPriorityRoot = root), root = root.nextScheduledRoot; + return null !== highestPriorityRoot ? (nextPriorityLevel = highestPriorityLevel, + priorityContext = nextPriorityLevel, resetContextStack(), cloneFiber$1(highestPriorityRoot.current, highestPriorityLevel)) : (nextPriorityLevel = NoWork$2, + null); + } + function commitAllHostEffects() { + for (;null !== nextEffect; ) { + ReactDebugCurrentFiber$3.current = nextEffect, recordEffect(); + var effectTag = nextEffect.effectTag; + if (effectTag & ContentReset && config.resetTextContent(nextEffect.stateNode), effectTag & Ref) { + var current = nextEffect.alternate; + null !== current && commitDetachRef(current); + } + switch (effectTag & ~(Callback | Err | ContentReset | Ref | PerformedWork)) { + case Placement$1: + commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; + break; + + case PlacementAndUpdate: + commitPlacement(nextEffect), nextEffect.effectTag &= ~Placement$1; + var _current = nextEffect.alternate; + commitWork(_current, nextEffect); + break; + + case Update: + var _current2 = nextEffect.alternate; + commitWork(_current2, nextEffect); + break; + + case Deletion: + isUnmounting = !0, commitDeletion(nextEffect), isUnmounting = !1; + } + nextEffect = nextEffect.nextEffect; + } + ReactDebugCurrentFiber$3.current = null; + } + function commitAllLifeCycles() { + for (;null !== nextEffect; ) { + var effectTag = nextEffect.effectTag; + if (effectTag & (Update | Callback)) { + recordEffect(); + var current = nextEffect.alternate; + commitLifeCycles(current, nextEffect); + } + effectTag & Ref && (recordEffect(), commitAttachRef(nextEffect)), effectTag & Err && (recordEffect(), + commitErrorHandling(nextEffect)); + var next = nextEffect.nextEffect; + nextEffect.nextEffect = null, nextEffect = next; + } + } + function commitAllWork(finishedWork) { + isCommitting = !0, startCommitTimer(), pendingCommit = null; + var root = finishedWork.stateNode; + invariant(root.current !== finishedWork, "Cannot commit the same tree as before. This is probably a bug " + "related to the return field. This error is likely caused by a bug " + "in React. Please file an issue."), + ReactCurrentOwner$1.current = null; + var previousPriorityContext = priorityContext; + priorityContext = TaskPriority$1; + var firstEffect = void 0; + for (finishedWork.effectTag > PerformedWork ? null !== finishedWork.lastEffect ? (finishedWork.lastEffect.nextEffect = finishedWork, + firstEffect = finishedWork.firstEffect) : firstEffect = finishedWork : firstEffect = finishedWork.firstEffect, + prepareForCommit(), nextEffect = firstEffect, startCommitHostEffectsTimer(); null !== nextEffect; ) { + var _error = null; + _error = invokeGuardedCallback$1(null, commitAllHostEffects, null), null !== _error && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), + captureError(nextEffect, _error), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); + } + for (stopCommitHostEffectsTimer(), resetAfterCommit(), root.current = finishedWork, + nextEffect = firstEffect, startCommitLifeCyclesTimer(); null !== nextEffect; ) { + var _error2 = null; + _error2 = invokeGuardedCallback$1(null, commitAllLifeCycles, null), null !== _error2 && (invariant(null !== nextEffect, "Should have next effect. This error is likely caused by a bug " + "in React. Please file an issue."), + captureError(nextEffect, _error2), null !== nextEffect && (nextEffect = nextEffect.nextEffect)); + } + isCommitting = !1, stopCommitLifeCyclesTimer(), stopCommitTimer(), "function" == typeof onCommitRoot && onCommitRoot(finishedWork.stateNode), + !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCommitWork(finishedWork), + commitPhaseBoundaries && (commitPhaseBoundaries.forEach(scheduleErrorRecovery), + commitPhaseBoundaries = null), priorityContext = previousPriorityContext; + } + function resetWorkPriority(workInProgress) { + var newPriority = NoWork$2, queue = workInProgress.updateQueue, tag = workInProgress.tag; + null === queue || tag !== ClassComponent$4 && tag !== HostRoot$4 || (newPriority = getPendingPriority$1(queue)); + for (var child = workInProgress.progressedChild; null !== child; ) child.pendingWorkPriority !== NoWork$2 && (newPriority === NoWork$2 || newPriority > child.pendingWorkPriority) && (newPriority = child.pendingWorkPriority), + child = child.sibling; + workInProgress.pendingWorkPriority = newPriority; + } + function completeUnitOfWork(workInProgress) { + for (;!0; ) { + var current = workInProgress.alternate, next = completeWork(current, workInProgress), returnFiber = workInProgress.return, siblingFiber = workInProgress.sibling; + if (resetWorkPriority(workInProgress), null !== next) return stopWorkTimer(workInProgress), + !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), + next; + if (null !== returnFiber) { + null === returnFiber.firstEffect && (returnFiber.firstEffect = workInProgress.firstEffect), + null !== workInProgress.lastEffect && (null !== returnFiber.lastEffect && (returnFiber.lastEffect.nextEffect = workInProgress.firstEffect), + returnFiber.lastEffect = workInProgress.lastEffect); + workInProgress.effectTag > PerformedWork && (null !== returnFiber.lastEffect ? returnFiber.lastEffect.nextEffect = workInProgress : returnFiber.firstEffect = workInProgress, + returnFiber.lastEffect = workInProgress); + } + if (stopWorkTimer(workInProgress), !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onCompleteWork(workInProgress), + null !== siblingFiber) return siblingFiber; + if (null === returnFiber) return nextPriorityLevel < HighPriority ? commitAllWork(workInProgress) : pendingCommit = workInProgress, + null; + workInProgress = returnFiber; + } + return null; + } + function performUnitOfWork(workInProgress) { + var current = workInProgress.alternate; + startWorkTimer(workInProgress); + var next = beginWork(current, workInProgress, nextPriorityLevel); + return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), + null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, + ReactDebugCurrentFiber$3.current = null, next; + } + function performFailedUnitOfWork(workInProgress) { + var current = workInProgress.alternate; + startWorkTimer(workInProgress); + var next = beginFailedWork(current, workInProgress, nextPriorityLevel); + return !0 && ReactFiberInstrumentation$1.debugTool && ReactFiberInstrumentation$1.debugTool.onBeginWork(workInProgress), + null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, + ReactDebugCurrentFiber$3.current = null, next; + } + function clearErrors() { + for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork()); + } + function workLoopAsync(minPriorityLevel, deadline) { + for (;null !== nextUnitOfWork && !deadlineHasExpired; ) if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) { + if (null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit) if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) { + if (commitAllWork(pendingCommit), nextUnitOfWork = findNextUnitOfWork(), clearErrors(), + nextPriorityLevel === NoWork$2 || nextPriorityLevel > minPriorityLevel || nextPriorityLevel < HighPriority) break; + } else deadlineHasExpired = !0; + } else deadlineHasExpired = !0; + } + function workLoopSync(minPriorityLevel) { + for (;null !== nextUnitOfWork && !(null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), + clearErrors(), nextPriorityLevel === NoWork$2 || nextPriorityLevel > minPriorityLevel || nextPriorityLevel > TaskPriority$1)); ) ; + } + function workLoop(minPriorityLevel, deadline) { + clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()), + nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= minPriorityLevel && (nextPriorityLevel <= TaskPriority$1 ? workLoopSync(minPriorityLevel) : null !== deadline && workLoopAsync(minPriorityLevel, deadline)); + } + function performDeferredWork(deadline) { + performWork(OffscreenPriority, deadline); + } + function performWork(minPriorityLevel, deadline) { + startWorkLoopTimer(), invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), + isPerformingWork = !0; + for (var hasRemainingAsyncWork = !1; null === fatalError; ) { + null === pendingCommit || deadlineHasExpired || commitAllWork(pendingCommit), priorityContextBeforeReconciliation = priorityContext; + var _error3 = null; + if (_error3 = invokeGuardedCallback$1(null, workLoop, null, minPriorityLevel, deadline), + priorityContext = priorityContextBeforeReconciliation, null === _error3) { + switch (nextPriorityLevel) { + case SynchronousPriority$1: + case TaskPriority$1: + if (nextPriorityLevel <= minPriorityLevel) continue; + break; + + case HighPriority: + case LowPriority: + case OffscreenPriority: + if (null === deadline) hasRemainingAsyncWork = !0; else { + if (!deadlineHasExpired && nextPriorityLevel <= minPriorityLevel) continue; + hasRemainingAsyncWork = !0; + } + break; + + case NoWork$2: + break; + + default: + invariant(!1, "Switch statement should be exhuastive."); + } + break; + } var failedWork = nextUnitOfWork; - if (null !== failedWork) { + if (null === failedWork) null === fatalError && (fatalError = _error3); else { var maybeBoundary = captureError(failedWork, _error3); if (null !== maybeBoundary) { var boundary = maybeBoundary; - beginFailedWork(boundary.alternate, boundary, priorityLevel), unwindContexts(failedWork, boundary), + beginFailedWork(boundary.alternate, boundary, nextPriorityLevel), unwindContexts(failedWork, boundary), nextUnitOfWork = completeUnitOfWork(boundary); } - continue; } - null === fatalError && (fatalError = _error3); } - if (priorityLevel = NoWork$2, nextPriorityLevel === NoWork$2 || !isPerformingDeferredWork || deadlineHasExpired) switch (nextPriorityLevel) { - case SynchronousPriority$1: - case TaskPriority$1: - priorityLevel = nextPriorityLevel; - break; - - case AnimationPriority: - scheduleAnimationCallback(performAnimationWork), scheduleDeferredCallback(performDeferredWork); - break; - - case HighPriority: - case LowPriority: - case OffscreenPriority: - scheduleDeferredCallback(performDeferredWork); - } else priorityLevel = nextPriorityLevel; + null !== deadline && (isCallbackScheduled = !1), hasRemainingAsyncWork && !isCallbackScheduled && (scheduleDeferredCallback(performDeferredWork), + isCallbackScheduled = !0); + var errorToThrow = null !== fatalError ? fatalError : firstUncaughtError; + if (isPerformingWork = !1, deadlineHasExpired = !1, fatalError = null, firstUncaughtError = null, + capturedErrors = null, failedBoundaries = null, stopWorkLoopTimer(), null !== errorToThrow) throw errorToThrow; } - var errorToThrow = fatalError || firstUncaughtError; - if (isPerformingWork = !1, deadlineHasExpired = !1, fatalError = null, firstUncaughtError = null, - capturedErrors = null, failedBoundaries = null, stopWorkLoopTimer(), null !== errorToThrow) throw errorToThrow; - } - function captureError(failedWork, error) { - ReactCurrentOwner$1.current = null, ReactDebugCurrentFiber$3.current = null, ReactDebugCurrentFiber$3.phase = null, - nextUnitOfWork = null; - var boundary = null, errorBoundaryFound = !1, willRetry = !1, errorBoundaryName = null; - if (failedWork.tag === HostRoot$4) boundary = failedWork, isFailedBoundary(failedWork) && (fatalError = error); else for (var node = failedWork.return; null !== node && null === boundary; ) { - if (node.tag === ClassComponent$4) { - var instance = node.stateNode; - "function" == typeof instance.unstable_handleError && (errorBoundaryFound = !0, - errorBoundaryName = getComponentName_1(node), boundary = node, willRetry = !0); - } else node.tag === HostRoot$4 && (boundary = node); - if (isFailedBoundary(node)) { - if (isUnmounting) return null; - if (null !== commitPhaseBoundaries && (commitPhaseBoundaries.has(node) || null !== node.alternate && commitPhaseBoundaries.has(node.alternate))) return null; - boundary = null, willRetry = !1; + function captureError(failedWork, error) { + ReactCurrentOwner$1.current = null, ReactDebugCurrentFiber$3.current = null, ReactDebugCurrentFiber$3.phase = null, + nextUnitOfWork = null; + var boundary = null, errorBoundaryFound = !1, willRetry = !1, errorBoundaryName = null; + if (failedWork.tag === HostRoot$4) boundary = failedWork, isFailedBoundary(failedWork) && (fatalError = error); else for (var node = failedWork.return; null !== node && null === boundary; ) { + if (node.tag === ClassComponent$4) { + var instance = node.stateNode; + "function" == typeof instance.unstable_handleError && (errorBoundaryFound = !0, + errorBoundaryName = getComponentName_1(node), boundary = node, willRetry = !0); + } else node.tag === HostRoot$4 && (boundary = node); + if (isFailedBoundary(node)) { + if (isUnmounting) return null; + if (null !== commitPhaseBoundaries && (commitPhaseBoundaries.has(node) || null !== node.alternate && commitPhaseBoundaries.has(node.alternate))) return null; + boundary = null, willRetry = !1; + } + node = node.return; } - node = node.return; + if (null !== boundary) { + null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary); + var _componentStack = getStackAddendumByWorkInProgressFiber$2(failedWork), _componentName = getComponentName_1(failedWork); + return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, { + componentName: _componentName, + componentStack: _componentStack, + error: error, + errorBoundary: errorBoundaryFound ? boundary.stateNode : null, + errorBoundaryFound: errorBoundaryFound, + errorBoundaryName: errorBoundaryName, + willRetry: willRetry + }), isCommitting ? (null === commitPhaseBoundaries && (commitPhaseBoundaries = new Set()), + commitPhaseBoundaries.add(boundary)) : scheduleErrorRecovery(boundary), boundary; + } + return null === firstUncaughtError && (firstUncaughtError = error), null; } - if (null !== boundary) { - null === failedBoundaries && (failedBoundaries = new Set()), failedBoundaries.add(boundary); - var _componentStack = getStackAddendumByWorkInProgressFiber$2(failedWork), _componentName = getComponentName_1(failedWork); - return null === capturedErrors && (capturedErrors = new Map()), capturedErrors.set(boundary, { - componentName: _componentName, - componentStack: _componentStack, - error: error, - errorBoundary: errorBoundaryFound ? boundary.stateNode : null, - errorBoundaryFound: errorBoundaryFound, - errorBoundaryName: errorBoundaryName, - willRetry: willRetry - }), isCommitting ? (null === commitPhaseBoundaries && (commitPhaseBoundaries = new Set()), - commitPhaseBoundaries.add(boundary)) : scheduleErrorRecovery(boundary), boundary; + function hasCapturedError(fiber) { + return null !== capturedErrors && (capturedErrors.has(fiber) || null !== fiber.alternate && capturedErrors.has(fiber.alternate)); } - return null === firstUncaughtError && (firstUncaughtError = error), null; - } - function hasCapturedError(fiber) { - return null !== capturedErrors && (capturedErrors.has(fiber) || null !== fiber.alternate && capturedErrors.has(fiber.alternate)); - } - function isFailedBoundary(fiber) { - return null !== failedBoundaries && (failedBoundaries.has(fiber) || null !== fiber.alternate && failedBoundaries.has(fiber.alternate)); - } - function commitErrorHandling(effectfulFiber) { - var capturedError = void 0; - null !== capturedErrors && (capturedError = capturedErrors.get(effectfulFiber), - capturedErrors.delete(effectfulFiber), null == capturedError && null !== effectfulFiber.alternate && (effectfulFiber = effectfulFiber.alternate, - capturedError = capturedErrors.get(effectfulFiber), capturedErrors.delete(effectfulFiber))), - invariant(null != capturedError, "No error for given unit of work. This error is likely caused by a " + "bug in React. Please file an issue."); - var error = capturedError.error; - try { - logCapturedError$1(capturedError); - } catch (e) { - console.error(e); + function isFailedBoundary(fiber) { + return null !== failedBoundaries && (failedBoundaries.has(fiber) || null !== fiber.alternate && failedBoundaries.has(fiber.alternate)); } - switch (effectfulFiber.tag) { - case ClassComponent$4: - var instance = effectfulFiber.stateNode, info = { - componentStack: capturedError.componentStack - }; - return void instance.unstable_handleError(error, info); - - case HostRoot$4: - return void (null === firstUncaughtError && (firstUncaughtError = error)); - - default: - invariant(!1, "Invalid type of work. This error is likely caused by a bug in " + "React. Please file an issue."); - } - } - function unwindContexts(from, to) { - for (var node = from; null !== node && node !== to && node.alternate !== to; ) { - switch (node.tag) { + function commitErrorHandling(effectfulFiber) { + var capturedError = void 0; + null !== capturedErrors && (capturedError = capturedErrors.get(effectfulFiber), + capturedErrors.delete(effectfulFiber), null == capturedError && null !== effectfulFiber.alternate && (effectfulFiber = effectfulFiber.alternate, + capturedError = capturedErrors.get(effectfulFiber), capturedErrors.delete(effectfulFiber))), + invariant(null != capturedError, "No error for given unit of work. This error is likely caused by a " + "bug in React. Please file an issue."); + var error = capturedError.error; + try { + logCapturedError$1(capturedError); + } catch (e) { + console.error(e); + } + switch (effectfulFiber.tag) { case ClassComponent$4: - popContextProvider$1(node); - break; - - case HostComponent$6: - popHostContext(node); - break; + var instance = effectfulFiber.stateNode, info = { + componentStack: capturedError.componentStack + }; + return void instance.unstable_handleError(error, info); case HostRoot$4: - case HostPortal$2: - popHostContainer(node); - } - stopWorkTimer(node), node = node.return; - } - } - function scheduleRoot(root, priorityLevel) { - priorityLevel !== NoWork$2 && (root.isScheduled || (root.isScheduled = !0, lastScheduledRoot ? (lastScheduledRoot.nextScheduledRoot = root, - lastScheduledRoot = root) : (nextScheduledRoot = root, lastScheduledRoot = root))); - } - function scheduleUpdate(fiber, priorityLevel) { - if (recordScheduleUpdate(), priorityLevel <= nextPriorityLevel && (nextUnitOfWork = null), - fiber.tag === ClassComponent$4) { - var instance = fiber.stateNode; - warnAboutInvalidUpdates(instance); - } - for (var node = fiber, shouldContinue = !0; null !== node && shouldContinue; ) { - if (shouldContinue = !1, (node.pendingWorkPriority === NoWork$2 || node.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, - node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, - node.alternate.pendingWorkPriority = priorityLevel), null === node.return) { - if (node.tag !== HostRoot$4) return void (fiber.tag === ClassComponent$4 && warnAboutUpdateOnUnmounted(fiber.stateNode)); - switch (scheduleRoot(node.stateNode, priorityLevel), priorityLevel) { - case SynchronousPriority$1: - return void performWork(SynchronousPriority$1, null); - - case TaskPriority$1: - return; - - case AnimationPriority: - return void scheduleAnimationCallback(performAnimationWork); - - case HighPriority: - case LowPriority: - case OffscreenPriority: - return void scheduleDeferredCallback(performDeferredWork); - } - } - node = node.return; - } - } - function getPriorityContext(fiber, forceAsync) { - var priorityLevel = priorityContext; - return priorityLevel === NoWork$2 && (priorityLevel = !useSyncScheduling || fiber.internalContextTag & AsyncUpdates || forceAsync ? LowPriority : SynchronousPriority$1), - priorityLevel === SynchronousPriority$1 && (isPerformingWork || isBatchingUpdates) ? TaskPriority$1 : priorityLevel; - } - function scheduleErrorRecovery(fiber) { - scheduleUpdate(fiber, TaskPriority$1); - } - function performWithPriority(priorityLevel, fn) { - var previousPriorityContext = priorityContext; - priorityContext = priorityLevel; - try { - fn(); - } finally { - priorityContext = previousPriorityContext; - } - } - function batchedUpdates(fn, a) { - var previousIsBatchingUpdates = isBatchingUpdates; - isBatchingUpdates = !0; - try { - return fn(a); - } finally { - isBatchingUpdates = previousIsBatchingUpdates, isPerformingWork || isBatchingUpdates || performWork(TaskPriority$1, null); - } - } - function unbatchedUpdates(fn) { - var previousIsBatchingUpdates = isBatchingUpdates; - isBatchingUpdates = !1; - try { - return fn(); - } finally { - isBatchingUpdates = previousIsBatchingUpdates; - } - } - function syncUpdates(fn) { - var previousPriorityContext = priorityContext; - priorityContext = SynchronousPriority$1; - try { - return fn(); - } finally { - priorityContext = previousPriorityContext; - } - } - function deferredUpdates(fn) { - var previousPriorityContext = priorityContext; - priorityContext = LowPriority; - try { - return fn(); - } finally { - priorityContext = previousPriorityContext; - } - } - return { - scheduleUpdate: scheduleUpdate, - getPriorityContext: getPriorityContext, - performWithPriority: performWithPriority, - batchedUpdates: batchedUpdates, - unbatchedUpdates: unbatchedUpdates, - syncUpdates: syncUpdates, - deferredUpdates: deferredUpdates - }; -}, getContextFiber = function(arg) { - invariant(!1, "Missing injection for fiber getContextForSubtree"); -}; - -function getContextForSubtree(parentComponent) { - if (!parentComponent) return emptyObject; - var instance = ReactInstanceMap_1.get(parentComponent); - return "number" == typeof instance.tag ? getContextFiber(instance) : instance._processChildContext(instance._context); -} - -getContextForSubtree._injectFiber = function(fn) { - getContextFiber = fn; -}; - -var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, warning$2 = warning, ReactFiberInstrumentation = ReactFiberInstrumentation_1, ReactDebugCurrentFiber = ReactDebugCurrentFiber_1, getComponentName = getComponentName_1, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; - -getContextForSubtree_1._injectFiber(function(fiber) { - var parentContext = findCurrentUnmaskedContext(fiber); - return isContextProvider(fiber) ? processChildContext(fiber, parentContext, !1) : parentContext; -}); - -var ReactFiberReconciler = function(config) { - var getPublicInstance = config.getPublicInstance, _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; - function scheduleTopLevelUpdate(current, element, callback) { - "render" === ReactDebugCurrentFiber.phase && null !== ReactDebugCurrentFiber.current && warning$2(!1, "Render methods should be a pure function of props and state; " + "triggering nested component updates from render is not allowed. " + "If necessary, trigger nested updates in componentDidUpdate.\n\n" + "Check the render method of %s.", getComponentName(ReactDebugCurrentFiber.current) || "Unknown"); - var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = { - element: element - }; - callback = void 0 === callback ? null : callback, warning$2(null === callback || "function" == typeof callback, "render(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callback), - addTopLevelUpdate(current, nextState, callback, priorityLevel), scheduleUpdate(current, priorityLevel); - } - return { - createContainer: function(containerInfo) { - return createFiberRoot(containerInfo); - }, - updateContainer: function(element, container, parentComponent, callback) { - var current = container.current; - ReactFiberInstrumentation.debugTool && (null === current.alternate ? ReactFiberInstrumentation.debugTool.onMountContainer(container) : null === element ? ReactFiberInstrumentation.debugTool.onUnmountContainer(container) : ReactFiberInstrumentation.debugTool.onUpdateContainer(container)); - var context = getContextForSubtree_1(parentComponent); - null === container.context ? container.context = context : container.pendingContext = context, - scheduleTopLevelUpdate(current, element, callback); - }, - performWithPriority: performWithPriority, - batchedUpdates: batchedUpdates, - unbatchedUpdates: unbatchedUpdates, - syncUpdates: syncUpdates, - deferredUpdates: deferredUpdates, - getPublicRootInstance: function(container) { - var containerFiber = container.current; - if (!containerFiber.child) return null; - switch (containerFiber.child.tag) { - case HostComponent$1: - return getPublicInstance(containerFiber.child.stateNode); + return void (null === firstUncaughtError && (firstUncaughtError = error)); default: - return containerFiber.child.stateNode; + invariant(!1, "Invalid type of work. This error is likely caused by a bug in " + "React. Please file an issue."); } - }, - findHostInstance: function(fiber) { - var hostFiber = findCurrentHostFiber(fiber); - return null === hostFiber ? null : hostFiber.stateNode; } - }; -}; + function unwindContexts(from, to) { + for (var node = from; null !== node && node !== to && node.alternate !== to; ) { + switch (node.tag) { + case ClassComponent$4: + popContextProvider$1(node); + break; -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); -} + case HostComponent$6: + popHostContext(node); + break; -var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { - function ReactNativePropRegistry() { - _classCallCheck(this, ReactNativePropRegistry); - } - return ReactNativePropRegistry.register = function(object) { - var id = ++uniqueID; - return Object.freeze(object), objects[id] = object, id; - }, ReactNativePropRegistry.getByID = function(id) { - if (!id) return emptyObject$3; - var object = objects[id]; - return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), - emptyObject$3); - }, ReactNativePropRegistry; -}(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; + case HostRoot$4: + case HostPortal$2: + popHostContainer(node); + } + stopWorkTimer(node), node = node.return; + } + } + function scheduleRoot(root, priorityLevel) { + priorityLevel !== NoWork$2 && (root.isScheduled || (root.isScheduled = !0, lastScheduledRoot ? (lastScheduledRoot.nextScheduledRoot = root, + lastScheduledRoot = root) : (nextScheduledRoot = root, lastScheduledRoot = root))); + } + function scheduleUpdate(fiber, priorityLevel) { + if (recordScheduleUpdate(), priorityLevel <= nextPriorityLevel && (nextUnitOfWork = null), + fiber.tag === ClassComponent$4) { + var instance = fiber.stateNode; + warnAboutInvalidUpdates(instance); + } + for (var node = fiber, shouldContinue = !0; null !== node && shouldContinue; ) { + if (shouldContinue = !1, (node.pendingWorkPriority === NoWork$2 || node.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, + node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, + node.alternate.pendingWorkPriority = priorityLevel), null === node.return) { + if (node.tag !== HostRoot$4) return void (fiber.tag === ClassComponent$4 && warnAboutUpdateOnUnmounted(fiber.stateNode)); + if (scheduleRoot(node.stateNode, priorityLevel), !isPerformingWork) switch (priorityLevel) { + case SynchronousPriority$1: + isUnbatchingUpdates ? performWork(SynchronousPriority$1, null) : performWork(TaskPriority$1, null); + break; -function defaultDiffer(prevProp, nextProp) { - return "object" != typeof nextProp || null === nextProp || deepDiffer(prevProp, nextProp); -} + case TaskPriority$1: + invariant(isBatchingUpdates, "Task updates can only be scheduled as a nested update or " + "inside batchedUpdates."); + break; -function resolveObject(idOrObject) { - return "number" == typeof idOrObject ? ReactNativePropRegistry_1.getByID(idOrObject) : idOrObject; -} + default: + isCallbackScheduled || (scheduleDeferredCallback(performDeferredWork), isCallbackScheduled = !0); + } + } + node = node.return; + } + } + function getPriorityContext(fiber, forceAsync) { + var priorityLevel = priorityContext; + return priorityLevel === NoWork$2 && (priorityLevel = !useSyncScheduling || fiber.internalContextTag & AsyncUpdates || forceAsync ? LowPriority : SynchronousPriority$1), + priorityLevel === SynchronousPriority$1 && (isPerformingWork || isBatchingUpdates) ? TaskPriority$1 : priorityLevel; + } + function scheduleErrorRecovery(fiber) { + scheduleUpdate(fiber, TaskPriority$1); + } + function performWithPriority(priorityLevel, fn) { + var previousPriorityContext = priorityContext; + priorityContext = priorityLevel; + try { + fn(); + } finally { + priorityContext = previousPriorityContext; + } + } + function batchedUpdates(fn, a) { + var previousIsBatchingUpdates = isBatchingUpdates; + isBatchingUpdates = !0; + try { + return fn(a); + } finally { + isBatchingUpdates = previousIsBatchingUpdates, isPerformingWork || isBatchingUpdates || performWork(TaskPriority$1, null); + } + } + function unbatchedUpdates(fn) { + var previousIsUnbatchingUpdates = isUnbatchingUpdates, previousIsBatchingUpdates = isBatchingUpdates; + isUnbatchingUpdates = isBatchingUpdates, isBatchingUpdates = !1; + try { + return fn(); + } finally { + isBatchingUpdates = previousIsBatchingUpdates, isUnbatchingUpdates = previousIsUnbatchingUpdates; + } + } + function syncUpdates(fn) { + var previousPriorityContext = priorityContext; + priorityContext = SynchronousPriority$1; + try { + return fn(); + } finally { + priorityContext = previousPriorityContext; + } + } + function deferredUpdates(fn) { + var previousPriorityContext = priorityContext; + priorityContext = LowPriority; + try { + return fn(); + } finally { + priorityContext = previousPriorityContext; + } + } + return { + scheduleUpdate: scheduleUpdate, + getPriorityContext: getPriorityContext, + performWithPriority: performWithPriority, + batchedUpdates: batchedUpdates, + unbatchedUpdates: unbatchedUpdates, + syncUpdates: syncUpdates, + deferredUpdates: deferredUpdates + }; + }, getContextFiber = function(arg) { + invariant(!1, "Missing injection for fiber getContextForSubtree"); + }; + function getContextForSubtree(parentComponent) { + if (!parentComponent) return emptyObject; + var instance = ReactInstanceMap_1.get(parentComponent); + return "number" == typeof instance.tag ? getContextFiber(instance) : instance._processChildContext(instance._context); + } + getContextForSubtree._injectFiber = function(fn) { + getContextFiber = fn; + }; + var getContextForSubtree_1 = getContextForSubtree, addTopLevelUpdate = ReactFiberUpdateQueue.addTopLevelUpdate, findCurrentUnmaskedContext = ReactFiberContext.findCurrentUnmaskedContext, isContextProvider = ReactFiberContext.isContextProvider, processChildContext = ReactFiberContext.processChildContext, createFiberRoot = ReactFiberRoot.createFiberRoot, HostComponent$1 = ReactTypeOfWork.HostComponent, warning$2 = warning, ReactFiberInstrumentation = ReactFiberInstrumentation_1, ReactDebugCurrentFiber = ReactDebugCurrentFiber_1, getComponentName = getComponentName_1, findCurrentHostFiber = ReactFiberTreeReflection.findCurrentHostFiber; + getContextForSubtree_1._injectFiber(function(fiber) { + var parentContext = findCurrentUnmaskedContext(fiber); + return isContextProvider(fiber) ? processChildContext(fiber, parentContext, !1) : parentContext; + }); + var ReactFiberReconciler = function(config) { + var getPublicInstance = config.getPublicInstance, _ReactFiberScheduler = ReactFiberScheduler(config), scheduleUpdate = _ReactFiberScheduler.scheduleUpdate, getPriorityContext = _ReactFiberScheduler.getPriorityContext, performWithPriority = _ReactFiberScheduler.performWithPriority, batchedUpdates = _ReactFiberScheduler.batchedUpdates, unbatchedUpdates = _ReactFiberScheduler.unbatchedUpdates, syncUpdates = _ReactFiberScheduler.syncUpdates, deferredUpdates = _ReactFiberScheduler.deferredUpdates; + function scheduleTopLevelUpdate(current, element, callback) { + "render" === ReactDebugCurrentFiber.phase && null !== ReactDebugCurrentFiber.current && warning$2(!1, "Render methods should be a pure function of props and state; " + "triggering nested component updates from render is not allowed. " + "If necessary, trigger nested updates in componentDidUpdate.\n\n" + "Check the render method of %s.", getComponentName(ReactDebugCurrentFiber.current) || "Unknown"); + var forceAsync = ReactFeatureFlags_1.enableAsyncSubtreeAPI && null != element && null != element.type && !0 === element.type.unstable_asyncUpdates, priorityLevel = getPriorityContext(current, forceAsync), nextState = { + element: element + }; + callback = void 0 === callback ? null : callback, warning$2(null === callback || "function" == typeof callback, "render(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callback), + addTopLevelUpdate(current, nextState, callback, priorityLevel), scheduleUpdate(current, priorityLevel); + } + return { + createContainer: function(containerInfo) { + return createFiberRoot(containerInfo); + }, + updateContainer: function(element, container, parentComponent, callback) { + var current = container.current; + ReactFiberInstrumentation.debugTool && (null === current.alternate ? ReactFiberInstrumentation.debugTool.onMountContainer(container) : null === element ? ReactFiberInstrumentation.debugTool.onUnmountContainer(container) : ReactFiberInstrumentation.debugTool.onUpdateContainer(container)); + var context = getContextForSubtree_1(parentComponent); + null === container.context ? container.context = context : container.pendingContext = context, + scheduleTopLevelUpdate(current, element, callback); + }, + performWithPriority: performWithPriority, + batchedUpdates: batchedUpdates, + unbatchedUpdates: unbatchedUpdates, + syncUpdates: syncUpdates, + deferredUpdates: deferredUpdates, + getPublicRootInstance: function(container) { + var containerFiber = container.current; + if (!containerFiber.child) return null; + switch (containerFiber.child.tag) { + case HostComponent$1: + return getPublicInstance(containerFiber.child.stateNode); -function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { - if (Array.isArray(node)) for (var i = node.length; i-- && removedKeyCount > 0; ) restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); else if (node && removedKeyCount > 0) { - var obj = resolveObject(node); - for (var propKey in removedKeys) if (removedKeys[propKey]) { - var nextProp = obj[propKey]; - if (void 0 !== nextProp) { - var attributeConfig = validAttributes[propKey]; - if (attributeConfig) { - if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), - "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { - var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; - updatePayload[propKey] = nextValue; + default: + return containerFiber.child.stateNode; + } + }, + findHostInstance: function(fiber) { + var hostFiber = findCurrentHostFiber(fiber); + return null === hostFiber ? null : hostFiber.stateNode; + } + }; + }; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); + } + var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { + function ReactNativePropRegistry() { + _classCallCheck(this, ReactNativePropRegistry); + } + return ReactNativePropRegistry.register = function(object) { + var id = ++uniqueID; + return Object.freeze(object), objects[id] = object, id; + }, ReactNativePropRegistry.getByID = function(id) { + if (!id) return emptyObject$3; + var object = objects[id]; + return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), + emptyObject$3); + }, ReactNativePropRegistry; + }(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; + function defaultDiffer(prevProp, nextProp) { + return "object" != typeof nextProp || null === nextProp || deepDiffer(prevProp, nextProp); + } + function resolveObject(idOrObject) { + return "number" == typeof idOrObject ? ReactNativePropRegistry_1.getByID(idOrObject) : idOrObject; + } + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (Array.isArray(node)) for (var i = node.length; i-- && removedKeyCount > 0; ) restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); else if (node && removedKeyCount > 0) { + var obj = resolveObject(node); + for (var propKey in removedKeys) if (removedKeys[propKey]) { + var nextProp = obj[propKey]; + if (void 0 !== nextProp) { + var attributeConfig = validAttributes[propKey]; + if (attributeConfig) { + if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), + "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { + var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + removedKeys[propKey] = !1, removedKeyCount--; } - removedKeys[propKey] = !1, removedKeyCount--; } } } } -} - -function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { - var i, minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; - for (i = 0; i < minLength; i++) updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); - for (;i < prevArray.length; i++) updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); - for (;i < nextArray.length; i++) updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); - return updatePayload; -} - -function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { - return updatePayload || prevProp !== nextProp ? prevProp && nextProp ? Array.isArray(prevProp) || Array.isArray(nextProp) ? Array.isArray(prevProp) && Array.isArray(nextProp) ? diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes) : Array.isArray(prevProp) ? diffProperties(updatePayload, flattenStyle(prevProp), resolveObject(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), flattenStyle(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), resolveObject(nextProp), validAttributes) : nextProp ? addNestedProperty(updatePayload, nextProp, validAttributes) : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload : updatePayload; -} - -function addNestedProperty(updatePayload, nextProp, validAttributes) { - if (!nextProp) return updatePayload; - if (!Array.isArray(nextProp)) return addProperties(updatePayload, resolveObject(nextProp), validAttributes); - for (var i = 0; i < nextProp.length; i++) updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); - return updatePayload; -} - -function clearNestedProperty(updatePayload, prevProp, validAttributes) { - if (!prevProp) return updatePayload; - if (!Array.isArray(prevProp)) return clearProperties(updatePayload, resolveObject(prevProp), validAttributes); - for (var i = 0; i < prevProp.length; i++) updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); - return updatePayload; -} - -function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { - var attributeConfig, nextProp, prevProp; - for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], - nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, - "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, - void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), - updatePayload && void 0 !== updatePayload[propKey]) { - if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { - var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; - updatePayload[propKey] = nextValue; + function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { + var i, minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; + for (i = 0; i < minLength; i++) updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); + for (;i < prevArray.length; i++) updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); + for (;i < nextArray.length; i++) updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); + return updatePayload; + } + function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + return updatePayload || prevProp !== nextProp ? prevProp && nextProp ? Array.isArray(prevProp) || Array.isArray(nextProp) ? Array.isArray(prevProp) && Array.isArray(nextProp) ? diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes) : Array.isArray(prevProp) ? diffProperties(updatePayload, flattenStyle(prevProp), resolveObject(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), flattenStyle(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), resolveObject(nextProp), validAttributes) : nextProp ? addNestedProperty(updatePayload, nextProp, validAttributes) : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload : updatePayload; + } + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) return updatePayload; + if (!Array.isArray(nextProp)) return addProperties(updatePayload, resolveObject(nextProp), validAttributes); + for (var i = 0; i < nextProp.length; i++) updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + return updatePayload; + } + function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) return updatePayload; + if (!Array.isArray(prevProp)) return clearProperties(updatePayload, resolveObject(prevProp), validAttributes); + for (var i = 0; i < prevProp.length; i++) updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + return updatePayload; + } + function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig, nextProp, prevProp; + for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], + nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, + "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, + void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), + updatePayload && void 0 !== updatePayload[propKey]) { + if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { + var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { + var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); + shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, + (updatePayload || (updatePayload = {}))[propKey] = nextValue); + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), + removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), + removedKeys = null); + for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, + removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, + removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); + return updatePayload; + } + function addProperties(updatePayload, props, validAttributes) { + return diffProperties(updatePayload, emptyObject$2, props, validAttributes); + } + function clearProperties(updatePayload, prevProps, validAttributes) { + return diffProperties(updatePayload, prevProps, emptyObject$2, validAttributes); + } + var ReactNativeAttributePayload = { + create: function(props, validAttributes) { + return addProperties(null, props, validAttributes); + }, + diff: function(prevProps, nextProps, validAttributes) { + return diffProperties(null, prevProps, nextProps, validAttributes); } - } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { - var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); - shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, - (updatePayload || (updatePayload = {}))[propKey] = nextValue); - } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), - removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), - removedKeys = null); - for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, - removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, - removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); - return updatePayload; -} - -function addProperties(updatePayload, props, validAttributes) { - return diffProperties(updatePayload, emptyObject$2, props, validAttributes); -} - -function clearProperties(updatePayload, prevProps, validAttributes) { - return diffProperties(updatePayload, prevProps, emptyObject$2, validAttributes); -} - -var ReactNativeAttributePayload = { - create: function(props, validAttributes) { - return addProperties(null, props, validAttributes); - }, - diff: function(prevProps, nextProps, validAttributes) { - return diffProperties(null, prevProps, nextProps, validAttributes); - } -}, ReactNativeAttributePayload_1 = ReactNativeAttributePayload; - -function mountSafeCallback$1(context, callback) { - return function() { - if (callback) { - if ("boolean" == typeof context.__isMounted) { - if (!context.__isMounted) return; - } else if ("function" == typeof context.isMounted && !context.isMounted()) return; - return callback.apply(context, arguments); - } - }; -} - -function throwOnStylesProp(component, props) { - if (void 0 !== props.styles) { - var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; - throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), - new Error(msg); - } -} - -function warnForStyleProps$1(props, validAttributes) { - for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); -} - -var NativeMethodsMixinUtils = { - mountSafeCallback: mountSafeCallback$1, - throwOnStylesProp: throwOnStylesProp, - warnForStyleProps: warnForStyleProps$1 -}; - -function _classCallCheck$1(instance, Constructor) { - if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); -} - -var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, warnForStyleProps = NativeMethodsMixinUtils.warnForStyleProps, ReactNativeFiberHostComponent = function() { - function ReactNativeFiberHostComponent(tag, viewConfig) { - _classCallCheck$1(this, ReactNativeFiberHostComponent), this._nativeTag = tag, this._children = [], - this.viewConfig = viewConfig; - } - return ReactNativeFiberHostComponent.prototype.blur = function() { - TextInputState.blurTextInput(this._nativeTag); - }, ReactNativeFiberHostComponent.prototype.focus = function() { - TextInputState.focusTextInput(this._nativeTag); - }, ReactNativeFiberHostComponent.prototype.measure = function(callback) { - UIManager.measure(this._nativeTag, mountSafeCallback(this, callback)); - }, ReactNativeFiberHostComponent.prototype.measureInWindow = function(callback) { - UIManager.measureInWindow(this._nativeTag, mountSafeCallback(this, callback)); - }, ReactNativeFiberHostComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(this._nativeTag, relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); - }, ReactNativeFiberHostComponent.prototype.setNativeProps = function(nativeProps) { - warnForStyleProps(nativeProps, this.viewConfig.validAttributes); - var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes); - UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload); - }, ReactNativeFiberHostComponent; -}(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), ReactNativeViewConfigRegistry = { - register: function(viewConfig) { - var name = viewConfig.uiViewClassName; - return invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name), - viewConfigs.set(name, viewConfig), name; - }, - get: function(name) { - var config = viewConfigs.get(name); - return invariant(config, "View config not found for name %s", name), config; - } -}, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps; - -function recursivelyUncacheFiberNode(node) { - "number" == typeof node ? uncacheFiberNode$1(node) : (uncacheFiberNode$1(node._nativeTag), - node._children.forEach(recursivelyUncacheFiberNode)); -} - -var NativeRenderer = ReactFiberReconciler({ - appendChild: function(parentInstance, child) { - var childTag = "number" == typeof child ? child : child._nativeTag; - if ("number" == typeof parentInstance) UIManager.setChildren(parentInstance, [ childTag ]); else { - var children = parentInstance._children, index = children.indexOf(child); - index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), - UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ children.length - 1 ], [])); - } - }, - appendInitialChild: function(parentInstance, child) { - parentInstance._children.push(child); - }, - commitTextUpdate: function(textInstance, oldText, newText) { - UIManager.updateView(textInstance, "RCTRawText", { - text: newText - }); - }, - commitMount: function(instance, type, newProps, internalInstanceHandle) {}, - commitUpdate: function(instance, updatePayloadTODO, type, oldProps, newProps, internalInstanceHandle) { - var viewConfig = instance.viewConfig; - updateFiberProps$1(instance._nativeTag, newProps); - var updatePayload = ReactNativeAttributePayload_1.diff(oldProps, newProps, viewConfig.validAttributes); - UIManager.updateView(instance._nativeTag, viewConfig.uiViewClassName, updatePayload); - }, - createInstance: function(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { - var tag = ReactNativeTagHandles_1.allocateTag(), viewConfig = ReactNativeViewConfigRegistry_1.get(type); - for (var key in viewConfig.validAttributes) props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(props[key]); - var updatePayload = ReactNativeAttributePayload_1.create(props, viewConfig.validAttributes); - UIManager.createView(tag, viewConfig.uiViewClassName, rootContainerInstance, updatePayload); - var component = new ReactNativeFiberHostComponent_1(tag, viewConfig); - return precacheFiberNode$1(internalInstanceHandle, tag), updateFiberProps$1(tag, props), - component; - }, - createTextInstance: function(text, rootContainerInstance, hostContext, internalInstanceHandle) { - var tag = ReactNativeTagHandles_1.allocateTag(); - return UIManager.createView(tag, "RCTRawText", rootContainerInstance, { - text: text - }), precacheFiberNode$1(internalInstanceHandle, tag), tag; - }, - finalizeInitialChildren: function(parentInstance, type, props, rootContainerInstance) { - if (0 === parentInstance._children.length) return !1; - var nativeTags = parentInstance._children.map(function(child) { - return "number" == typeof child ? child : child._nativeTag; - }); - return UIManager.setChildren(parentInstance._nativeTag, nativeTags), !1; - }, - getRootHostContext: function() { - return emptyObject; - }, - getChildHostContext: function() { - return emptyObject; - }, - getPublicInstance: function(instance) { - return instance; - }, - insertBefore: function(parentInstance, child, beforeChild) { - invariant("number" != typeof parentInstance, "Container does not support insertBefore operation"); - var children = parentInstance._children, index = children.indexOf(child); - if (index >= 0) { - children.splice(index, 1); - var beforeChildIndex = children.indexOf(beforeChild); - children.splice(beforeChildIndex, 0, child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ beforeChildIndex ], [], [], []); - } else { - var _beforeChildIndex = children.indexOf(beforeChild); - children.splice(_beforeChildIndex, 0, child); - var childTag = "number" == typeof child ? child : child._nativeTag; - UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ _beforeChildIndex ], []); - } - }, - prepareForCommit: function() {}, - prepareUpdate: function(instance, type, oldProps, newProps, rootContainerInstance, hostContext) { - return emptyObject; - }, - removeChild: function(parentInstance, child) { - if (recursivelyUncacheFiberNode(child), "number" == typeof parentInstance) UIManager.manageChildren(parentInstance, [], [], [], [], [ 0 ]); else { - var children = parentInstance._children, index = children.indexOf(child); - children.splice(index, 1), UIManager.manageChildren(parentInstance._nativeTag, [], [], [], [], [ index ]); - } - }, - resetAfterCommit: function() {}, - resetTextContent: function(instance) {}, - shouldDeprioritizeSubtree: function(type, props) { - return !1; - }, - scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame, - scheduleDeferredCallback: commonjsGlobal.requestIdleCallback, - shouldSetTextContent: function(type, props) { - return !1; - }, - useSyncScheduling: !0 -}), ReactNativeFiberRenderer = NativeRenderer, getClosestInstanceFromNode = ReactNativeComponentTree_1.getClosestInstanceFromNode, findCurrentFiberUsingSlowPath$1 = ReactFiberTreeReflection.findCurrentFiberUsingSlowPath, HostComponent$11 = ReactTypeOfWork.HostComponent, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) { - instance && (hierarchy.unshift(instance), traverseOwnerTreeUp(hierarchy, instance._debugOwner)); -}, getOwnerHierarchy = function(instance) { - var hierarchy = []; - return traverseOwnerTreeUp(hierarchy, instance), hierarchy; -}, lastNonHostInstance = function(hierarchy) { - for (var i = hierarchy.length - 1; i > 1; i--) { - var instance = hierarchy[i]; - if (instance.tag !== HostComponent$11) return instance; - } - return hierarchy[0]; -}, getHostProps = function(fiber) { - var host = ReactFiberTreeReflection.findCurrentHostFiber(fiber); - return host ? host.memoizedProps || emptyObject : emptyObject; -}, getHostNode = function(fiber, findNodeHandle) { - for (var hostNode = void 0; fiber; ) { - if (null !== fiber.stateNode && fiber.tag === HostComponent$11 && (hostNode = findNodeHandle(fiber.stateNode)), - hostNode) return hostNode; - fiber = fiber.child; - } - return null; -}, createHierarchy = function(fiberHierarchy) { - return fiberHierarchy.map(function(fiber) { - return { - name: getComponentName_1(fiber), - getInspectorData: function(findNodeHandle) { - return { - measure: function(callback) { - return UIManager.measure(getHostNode(fiber, findNodeHandle), callback); - }, - props: getHostProps(fiber), - source: fiber._debugSource - }; + }, ReactNativeAttributePayload_1 = ReactNativeAttributePayload; + function mountSafeCallback$1(context, callback) { + return function() { + if (callback) { + if ("boolean" == typeof context.__isMounted) { + if (!context.__isMounted) return; + } else if ("function" == typeof context.isMounted && !context.isMounted()) return; + return callback.apply(context, arguments); } }; - }); -}; - -getInspectorDataForViewTag = function(viewTag) { - var closestInstance = getClosestInstanceFromNode(viewTag); - if (!closestInstance) return { - hierarchy: [], - props: emptyObject, - selection: null, - source: null + } + function throwOnStylesProp(component, props) { + if (void 0 !== props.styles) { + var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; + throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), + new Error(msg); + } + } + function warnForStyleProps$1(props, validAttributes) { + for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); + } + var NativeMethodsMixinUtils = { + mountSafeCallback: mountSafeCallback$1, + throwOnStylesProp: throwOnStylesProp, + warnForStyleProps: warnForStyleProps$1 }; - var fiber = findCurrentFiberUsingSlowPath$1(closestInstance), fiberHierarchy = getOwnerHierarchy(fiber), instance = lastNonHostInstance(fiberHierarchy), hierarchy = createHierarchy(fiberHierarchy), props = getHostProps(instance), source = instance._debugSource; - return { - hierarchy: hierarchy, - props: props, - selection: fiberHierarchy.indexOf(instance), - source: source - }; -}; - -var ReactNativeFiberInspector = { - getInspectorDataForViewTag: getInspectorDataForViewTag -}, ReactVersion = "16.0.0-alpha.13", ReactNativeFeatureFlags$2 = { - useFiber: !0 -}, ReactNativeFeatureFlags_1 = ReactNativeFeatureFlags$2, ReactNativeFeatureFlags$3 = Object.freeze({ - default: ReactNativeFeatureFlags_1, - __moduleExports: ReactNativeFeatureFlags_1 -}), ReactNativeFeatureFlags$1 = ReactNativeFeatureFlags$3 && ReactNativeFeatureFlags_1 || ReactNativeFeatureFlags$3, ReactCurrentOwner$3 = ReactGlobalSharedState_1.ReactCurrentOwner, injectedFindNode = ReactNativeFeatureFlags$1.useFiber ? function(fiber) { - return ReactNativeFiberRenderer.findHostInstance(fiber); -} : function(instance) { - return instance; -}; - -function findNodeHandle(componentOrHandle) { - var owner = ReactCurrentOwner$3.current; - if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), - owner._warnedAboutRefsInRender = !0), null == componentOrHandle) return null; - if ("number" == typeof componentOrHandle) return componentOrHandle; - var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); - return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), - void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); -} - -var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) { - var instance = findNodeHandle_1(componentOrHandle); - return null == instance || "number" == typeof instance ? instance : instance._nativeTag; -}, DevOnlyStubShim = null; - -function _classCallCheck$2(instance, Constructor) { - if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); -} - -function _possibleConstructorReturn(self, call) { - if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return !call || "object" != typeof call && "function" != typeof call ? self : call; -} - -function _inherits(subClass, superClass) { - if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: !1, - writable: !0, - configurable: !0 + function _classCallCheck$1(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); + } + var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, warnForStyleProps = NativeMethodsMixinUtils.warnForStyleProps, ReactNativeFiberHostComponent = function() { + function ReactNativeFiberHostComponent(tag, viewConfig) { + _classCallCheck$1(this, ReactNativeFiberHostComponent), this._nativeTag = tag, this._children = [], + this.viewConfig = viewConfig; } - }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); -} - -var mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) { - _inherits(ReactNativeComponent, _React$Component); - function ReactNativeComponent() { - return _classCallCheck$2(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); - } - return ReactNativeComponent.prototype.blur = function() { - TextInputState.blurTextInput(findNumericNodeHandle(this)); - }, ReactNativeComponent.prototype.focus = function() { - TextInputState.focusTextInput(findNumericNodeHandle(this)); - }, ReactNativeComponent.prototype.measure = function(callback) { - UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); - }, ReactNativeComponent.prototype.measureInWindow = function(callback) { - UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); - }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); - }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { - injectedSetNativeProps(this, nativeProps); - }, ReactNativeComponent; -}(react.Component); - -function setNativePropsFiber(componentOrHandle, nativeProps) { - var maybeInstance = void 0; - try { - maybeInstance = findNodeHandle_1(componentOrHandle); - } catch (error) {} - if (null != maybeInstance) { - var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); - } -} - -function setNativePropsStack(componentOrHandle, nativeProps) { - var maybeInstance = findNodeHandle_1(componentOrHandle); - if (null != maybeInstance) { - var viewConfig = void 0; - if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { - for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; - viewConfig = maybeInstance.viewConfig; + return ReactNativeFiberHostComponent.prototype.blur = function() { + TextInputState.blurTextInput(this._nativeTag); + }, ReactNativeFiberHostComponent.prototype.focus = function() { + TextInputState.focusTextInput(this._nativeTag); + }, ReactNativeFiberHostComponent.prototype.measure = function(callback) { + UIManager.measure(this._nativeTag, mountSafeCallback(this, callback)); + }, ReactNativeFiberHostComponent.prototype.measureInWindow = function(callback) { + UIManager.measureInWindow(this._nativeTag, mountSafeCallback(this, callback)); + }, ReactNativeFiberHostComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(this._nativeTag, relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); + }, ReactNativeFiberHostComponent.prototype.setNativeProps = function(nativeProps) { + warnForStyleProps(nativeProps, this.viewConfig.validAttributes); + var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, this.viewConfig.validAttributes); + UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, updatePayload); + }, ReactNativeFiberHostComponent; + }(), ReactNativeFiberHostComponent_1 = ReactNativeFiberHostComponent, viewConfigs = new Map(), ReactNativeViewConfigRegistry = { + register: function(viewConfig) { + var name = viewConfig.uiViewClassName; + return invariant(!viewConfigs.has(name), "Tried to register two views with the same name %s", name), + viewConfigs.set(name, viewConfig), name; + }, + get: function(name) { + var config = viewConfigs.get(name); + return invariant(config, "View config not found for name %s", name), config; } - var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + }, ReactNativeViewConfigRegistry_1 = ReactNativeViewConfigRegistry, precacheFiberNode$1 = ReactNativeComponentTree_1.precacheFiberNode, uncacheFiberNode$1 = ReactNativeComponentTree_1.uncacheFiberNode, updateFiberProps$1 = ReactNativeComponentTree_1.updateFiberProps; + function recursivelyUncacheFiberNode(node) { + "number" == typeof node ? uncacheFiberNode$1(node) : (uncacheFiberNode$1(node._nativeTag), + node._children.forEach(recursivelyUncacheFiberNode)); } -} - -var injectedSetNativeProps = void 0; - -injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; - -var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$2 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { - measure: function(callback) { - UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); - }, - measureInWindow: function(callback) { - UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); - }, - measureLayout: function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$3(this, onFail), mountSafeCallback$3(this, onSuccess)); - }, - setNativeProps: function(nativeProps) { - injectedSetNativeProps$1(this, nativeProps); - }, - focus: function() { - TextInputState.focusTextInput(findNumericNodeHandle$1(this)); - }, - blur: function() { - TextInputState.blurTextInput(findNumericNodeHandle$1(this)); - } -}; - -function setNativePropsFiber$1(componentOrHandle, nativeProps) { - var maybeInstance = void 0; - try { - maybeInstance = findNodeHandle_1(componentOrHandle); - } catch (error) {} - if (null != maybeInstance) { - var viewConfig = maybeInstance.viewConfig; - warnForStyleProps$2(nativeProps, viewConfig.validAttributes); - var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); - } -} - -function setNativePropsStack$1(componentOrHandle, nativeProps) { - var maybeInstance = findNodeHandle_1(componentOrHandle); - if (null != maybeInstance) { - var viewConfig = void 0; - if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { - for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; - viewConfig = maybeInstance.viewConfig; - } - var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID; - warnForStyleProps$2(nativeProps, viewConfig.validAttributes); - var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); - } -} - -var injectedSetNativeProps$1 = void 0; - -injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; - -var NativeMethodsMixin_DEV = NativeMethodsMixin; - -invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), -NativeMethodsMixin_DEV.componentWillMount = function() { - throwOnStylesProp$1(this, this.props); -}, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) { - throwOnStylesProp$1(this, newProps); -}; - -var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { - centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { - var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; - if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, - count = 1); else for (var i = 0; i < touchBank.length; i++) { - var touchTrack = touchBank[i]; - if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { - var toAdd; - toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, - total += toAdd, count++; - } - } - return count > 0 ? total / count : TouchHistoryMath.noCentroid; - }, - currentCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !0); - }, - currentCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !0); - }, - previousCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !1); - }, - previousCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !1); - }, - currentCentroidX: function(touchHistory) { - return TouchHistoryMath.centroidDimension(touchHistory, 0, !0, !0); - }, - currentCentroidY: function(touchHistory) { - return TouchHistoryMath.centroidDimension(touchHistory, 0, !1, !0); - }, - noCentroid: -1 -}, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) { - return ReactNativeViewConfigRegistry_1.register(viewConfig); -}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; - -function takeSnapshot(view, options) { - return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), - UIManager.__takeSnapshot(view, options); -} - -var takeSnapshot_1 = takeSnapshot, ReactInvalidSetStateWarningHook = {}, processingChildContext = !1, warnInvalidSetState = function() { - warning(!processingChildContext, "setState(...): Cannot call setState() inside getChildContext()"); -}; - -ReactInvalidSetStateWarningHook = { - onBeginProcessingChildContext: function() { - processingChildContext = !0; - }, - onEndProcessingChildContext: function() { - processingChildContext = !1; - }, - onSetState: function() { - warnInvalidSetState(); - } -}; - -var ReactInvalidSetStateWarningHook_1 = ReactInvalidSetStateWarningHook, ReactHostOperationHistoryHook = null, history = []; - -ReactHostOperationHistoryHook = { - onHostOperation: function(operation) { - history.push(operation); - }, - clearHistory: function() { - ReactHostOperationHistoryHook._preventClearing || (history = []); - }, - getHistory: function() { - return history; - } -}; - -var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactComponentTreeHook = ReactGlobalSharedState_1.ReactComponentTreeHook, ReactDebugTool = null, hooks = [], didHookThrowForEvent = {}, callHook = function(event, fn, context, arg1, arg2, arg3, arg4, arg5) { - try { - fn.call(context, arg1, arg2, arg3, arg4, arg5); - } catch (e) { - warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), - didHookThrowForEvent[event] = !0; - } -}, emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) { - for (var i = 0; i < hooks.length; i++) { - var hook = hooks[i], fn = hook[event]; - fn && callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); - } -}, isProfiling = !1, flushHistory = [], lifeCycleTimerStack = [], currentFlushNesting = 0, currentFlushMeasurements = [], currentFlushStartTime = 0, currentTimerDebugID = null, currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerType = null, lifeCycleTimerHasWarned = !1, clearHistory = function() { - ReactComponentTreeHook.purgeUnmountedComponents(), ReactHostOperationHistoryHook_1.clearHistory(); -}, getTreeSnapshot = function(registeredIDs) { - return registeredIDs.reduce(function(tree, id) { - var ownerID = ReactComponentTreeHook.getOwnerID(id), parentID = ReactComponentTreeHook.getParentID(id); - return tree[id] = { - displayName: ReactComponentTreeHook.getDisplayName(id), - text: ReactComponentTreeHook.getText(id), - updateCount: ReactComponentTreeHook.getUpdateCount(id), - childIDs: ReactComponentTreeHook.getChildIDs(id), - ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, - parentID: parentID - }, tree; - }, {}); -}, resetMeasurements = function() { - var previousStartTime = currentFlushStartTime, previousMeasurements = currentFlushMeasurements, previousOperations = ReactHostOperationHistoryHook_1.getHistory(); - if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], - void clearHistory(); - if (previousMeasurements.length || previousOperations.length) { - var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); - flushHistory.push({ - duration: performanceNow() - previousStartTime, - measurements: previousMeasurements || [], - operations: previousOperations || [], - treeSnapshot: getTreeSnapshot(registeredIDs) - }); - } - clearHistory(), currentFlushStartTime = performanceNow(), currentFlushMeasurements = []; -}, checkDebugID = function(debugID) { - arguments.length > 1 && void 0 !== arguments[1] && arguments[1] && 0 === debugID || debugID || warning(!1, "ReactDebugTool: debugID may not be empty."); -}, beginLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), - lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, - currentTimerDebugID = debugID, currentTimerType = timerType); -}, endLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), - lifeCycleTimerHasWarned = !0), isProfiling && currentFlushMeasurements.push({ - timerType: timerType, - instanceID: debugID, - duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration - }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, - currentTimerType = null); -}, pauseCurrentLifeCycleTimer = function() { - var currentTimer = { - startTime: currentTimerStartTime, - nestedFlushStartTime: performanceNow(), - debugID: currentTimerDebugID, - timerType: currentTimerType - }; - lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, - currentTimerDebugID = null, currentTimerType = null; -}, resumeCurrentLifeCycleTimer = function() { - var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), startTime = _lifeCycleTimerStack$.startTime, nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, debugID = _lifeCycleTimerStack$.debugID, timerType = _lifeCycleTimerStack$.timerType, nestedFlushDuration = performanceNow() - nestedFlushStartTime; - currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, - currentTimerDebugID = debugID, currentTimerType = timerType; -}, lastMarkTimeStamp = 0, canUsePerformanceMeasure = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, shouldMark = function(debugID) { - if (!isProfiling || !canUsePerformanceMeasure) return !1; - var element = ReactComponentTreeHook.getElement(debugID); - return null != element && "object" == typeof element && !("string" == typeof element.type); -}, markBegin = function(debugID, markType) { - if (shouldMark(debugID)) { - var markName = debugID + "::" + markType; - lastMarkTimeStamp = performanceNow(), performance.mark(markName); - } -}, markEnd = function(debugID, markType) { - if (shouldMark(debugID)) { - var markName = debugID + "::" + markType, displayName = ReactComponentTreeHook.getDisplayName(debugID) || "Unknown"; - if (performanceNow() - lastMarkTimeStamp > .1) { - var measurementName = displayName + " [" + markType + "]"; - performance.measure(measurementName, markName); - } - performance.clearMarks(markName), measurementName && performance.clearMeasures(measurementName); - } -}; - -ReactDebugTool = { - addHook: function(hook) { - hooks.push(hook); - }, - removeHook: function(hook) { - for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), - i--); - }, - isProfiling: function() { - return isProfiling; - }, - beginProfiling: function() { - isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), - ReactDebugTool.addHook(ReactHostOperationHistoryHook_1)); - }, - endProfiling: function() { - isProfiling && (isProfiling = !1, resetMeasurements(), ReactDebugTool.removeHook(ReactHostOperationHistoryHook_1)); - }, - getFlushHistory: function() { - return flushHistory; - }, - onBeginFlush: function() { - currentFlushNesting++, resetMeasurements(), pauseCurrentLifeCycleTimer(), emitEvent("onBeginFlush"); - }, - onEndFlush: function() { - resetMeasurements(), currentFlushNesting--, resumeCurrentLifeCycleTimer(), emitEvent("onEndFlush"); - }, - onBeginLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), - beginLifeCycleTimer(debugID, timerType); - }, - onEndLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), - emitEvent("onEndLifeCycleTimer", debugID, timerType); - }, - onBeginProcessingChildContext: function() { - emitEvent("onBeginProcessingChildContext"); - }, - onEndProcessingChildContext: function() { - emitEvent("onEndProcessingChildContext"); - }, - onHostOperation: function(operation) { - checkDebugID(operation.instanceID), emitEvent("onHostOperation", operation); - }, - onSetState: function() { - emitEvent("onSetState"); - }, - onSetChildren: function(debugID, childDebugIDs) { - checkDebugID(debugID), childDebugIDs.forEach(checkDebugID), emitEvent("onSetChildren", debugID, childDebugIDs); - }, - onBeforeMountComponent: function(debugID, element, parentDebugID) { - checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), - markBegin(debugID, "mount"); - }, - onMountComponent: function(debugID) { - checkDebugID(debugID), markEnd(debugID, "mount"), emitEvent("onMountComponent", debugID); - }, - onBeforeUpdateComponent: function(debugID, element) { - checkDebugID(debugID), emitEvent("onBeforeUpdateComponent", debugID, element), markBegin(debugID, "update"); - }, - onUpdateComponent: function(debugID) { - checkDebugID(debugID), markEnd(debugID, "update"), emitEvent("onUpdateComponent", debugID); - }, - onBeforeUnmountComponent: function(debugID) { - checkDebugID(debugID), emitEvent("onBeforeUnmountComponent", debugID), markBegin(debugID, "unmount"); - }, - onUnmountComponent: function(debugID) { - checkDebugID(debugID), markEnd(debugID, "unmount"), emitEvent("onUnmountComponent", debugID); - }, - onTestEvent: function() { - emitEvent("onTestEvent"); - } -}, ReactDebugTool.addHook(ReactInvalidSetStateWarningHook_1), ReactDebugTool.addHook(ReactComponentTreeHook); - -var url = ExecutionEnvironment.canUseDOM && window.location.href || ""; - -/[?&]react_perf\b/.test(url) && ReactDebugTool.beginProfiling(); - -var ReactDebugTool_1 = ReactDebugTool, lowPriorityWarning = function() {}, printWarning = function(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; - var argIndex = 0, message = "Warning: " + format.replace(/%s/g, function() { - return args[argIndex++]; - }); - "undefined" != typeof console && console.warn(message); - try { - throw new Error(message); - } catch (x) {} -}; - -lowPriorityWarning = function(condition, format) { - if (void 0 === format) throw new Error("`warning(condition, format, ...args)` requires a warning " + "message argument"); - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) args[_key2 - 2] = arguments[_key2]; - printWarning.apply(void 0, [ format ].concat(args)); - } -}; - -var lowPriorityWarning_1 = lowPriorityWarning, _extends$3 = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); - } - return target; -}; - -function roundFloat(val) { - var base = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2, n = Math.pow(10, base); - return Math.floor(val * n) / n; -} - -function consoleTable(table) { - console.table(table); -} - -function getLastMeasurements() { - return ReactDebugTool_1.getFlushHistory(); -} - -function getExclusive() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; - function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) { - var displayName = treeSnapshot[instanceID].displayName, key = displayName, stats = aggregatedStats[key]; - stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { - key: key, - instanceCount: 0, - counts: {}, - durations: {}, - totalDuration: 0 - }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), - affectedIDs[key][instanceID] = !0, applyUpdate(stats); - } - return flushHistory.forEach(function(flush) { - var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; - measurements.forEach(function(measurement) { - var duration = measurement.duration, instanceID = measurement.instanceID, timerType = measurement.timerType; - updateAggregatedStats(treeSnapshot, instanceID, timerType, function(stats) { - stats.totalDuration += duration, stats.durations[timerType] += duration, stats.counts[timerType]++; + var NativeRenderer = ReactFiberReconciler({ + appendChild: function(parentInstance, child) { + var childTag = "number" == typeof child ? child : child._nativeTag, children = parentInstance._children, index = children.indexOf(child); + index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), + UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ children.length - 1 ], [])); + }, + appendChildToContainer: function(parentInstance, child) { + var childTag = "number" == typeof child ? child : child._nativeTag; + UIManager.setChildren(parentInstance, [ childTag ]); + }, + appendInitialChild: function(parentInstance, child) { + parentInstance._children.push(child); + }, + commitTextUpdate: function(textInstance, oldText, newText) { + UIManager.updateView(textInstance, "RCTRawText", { + text: newText }); - }); - }), Object.keys(aggregatedStats).map(function(key) { - return _extends$3({}, aggregatedStats[key], { - instanceCount: Object.keys(affectedIDs[key]).length - }); - }).sort(function(a, b) { - return b.totalDuration - a.totalDuration; - }); -} - -function getInclusive() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; - function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { - var _treeSnapshot$instanc = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc.displayName, ownerID = _treeSnapshot$instanc.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; - stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { - key: key, - instanceCount: 0, - inclusiveRenderDuration: 0, - renderCount: 0 - }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); - } - var isCompositeByID = {}; - return flushHistory.forEach(function(flush) { - flush.measurements.forEach(function(measurement) { - var instanceID = measurement.instanceID; - "render" === measurement.timerType && (isCompositeByID[instanceID] = !0); - }); - }), flushHistory.forEach(function(flush) { - var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; - measurements.forEach(function(measurement) { - var duration = measurement.duration, instanceID = measurement.instanceID; - if ("render" === measurement.timerType) { - updateAggregatedStats(treeSnapshot, instanceID, function(stats) { - stats.renderCount++; - }); - for (var nextParentID = instanceID; nextParentID; ) isCompositeByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { - stats.inclusiveRenderDuration += duration; - }), nextParentID = treeSnapshot[nextParentID].parentID; + }, + commitMount: function(instance, type, newProps, internalInstanceHandle) {}, + commitUpdate: function(instance, updatePayloadTODO, type, oldProps, newProps, internalInstanceHandle) { + var viewConfig = instance.viewConfig; + updateFiberProps$1(instance._nativeTag, newProps); + var updatePayload = ReactNativeAttributePayload_1.diff(oldProps, newProps, viewConfig.validAttributes); + UIManager.updateView(instance._nativeTag, viewConfig.uiViewClassName, updatePayload); + }, + createInstance: function(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { + var tag = ReactNativeTagHandles_1.allocateTag(), viewConfig = ReactNativeViewConfigRegistry_1.get(type); + for (var key in viewConfig.validAttributes) props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(props[key]); + var updatePayload = ReactNativeAttributePayload_1.create(props, viewConfig.validAttributes); + UIManager.createView(tag, viewConfig.uiViewClassName, rootContainerInstance, updatePayload); + var component = new ReactNativeFiberHostComponent_1(tag, viewConfig); + return precacheFiberNode$1(internalInstanceHandle, tag), updateFiberProps$1(tag, props), + component; + }, + createTextInstance: function(text, rootContainerInstance, hostContext, internalInstanceHandle) { + var tag = ReactNativeTagHandles_1.allocateTag(); + return UIManager.createView(tag, "RCTRawText", rootContainerInstance, { + text: text + }), precacheFiberNode$1(internalInstanceHandle, tag), tag; + }, + finalizeInitialChildren: function(parentInstance, type, props, rootContainerInstance) { + if (0 === parentInstance._children.length) return !1; + var nativeTags = parentInstance._children.map(function(child) { + return "number" == typeof child ? child : child._nativeTag; + }); + return UIManager.setChildren(parentInstance._nativeTag, nativeTags), !1; + }, + getRootHostContext: function() { + return emptyObject; + }, + getChildHostContext: function() { + return emptyObject; + }, + getPublicInstance: function(instance) { + return instance; + }, + insertBefore: function(parentInstance, child, beforeChild) { + var children = parentInstance._children, index = children.indexOf(child); + if (index >= 0) { + children.splice(index, 1); + var beforeChildIndex = children.indexOf(beforeChild); + children.splice(beforeChildIndex, 0, child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ beforeChildIndex ], [], [], []); + } else { + var _beforeChildIndex = children.indexOf(beforeChild); + children.splice(_beforeChildIndex, 0, child); + var childTag = "number" == typeof child ? child : child._nativeTag; + UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ _beforeChildIndex ], []); } + }, + insertInContainerBefore: function(parentInstance, child, beforeChild) { + invariant("number" != typeof parentInstance, "Container does not support insertBefore operation"); + }, + prepareForCommit: function() {}, + prepareUpdate: function(instance, type, oldProps, newProps, rootContainerInstance, hostContext) { + return emptyObject; + }, + removeChild: function(parentInstance, child) { + recursivelyUncacheFiberNode(child); + var children = parentInstance._children, index = children.indexOf(child); + children.splice(index, 1), UIManager.manageChildren(parentInstance._nativeTag, [], [], [], [], [ index ]); + }, + removeChildFromContainer: function(parentInstance, child) { + recursivelyUncacheFiberNode(child), UIManager.manageChildren(parentInstance, [], [], [], [], [ 0 ]); + }, + resetAfterCommit: function() {}, + resetTextContent: function(instance) {}, + shouldDeprioritizeSubtree: function(type, props) { + return !1; + }, + scheduleDeferredCallback: commonjsGlobal.requestIdleCallback, + shouldSetTextContent: function(type, props) { + return !1; + }, + useSyncScheduling: !0 + }), ReactNativeFiberRenderer = NativeRenderer, getClosestInstanceFromNode = ReactNativeComponentTree_1.getClosestInstanceFromNode, findCurrentFiberUsingSlowPath$1 = ReactFiberTreeReflection.findCurrentFiberUsingSlowPath, HostComponent$11 = ReactTypeOfWork.HostComponent, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) { + instance && (hierarchy.unshift(instance), traverseOwnerTreeUp(hierarchy, instance._debugOwner)); + }, getOwnerHierarchy = function(instance) { + var hierarchy = []; + return traverseOwnerTreeUp(hierarchy, instance), hierarchy; + }, lastNonHostInstance = function(hierarchy) { + for (var i = hierarchy.length - 1; i > 1; i--) { + var instance = hierarchy[i]; + if (instance.tag !== HostComponent$11) return instance; + } + return hierarchy[0]; + }, getHostProps = function(fiber) { + var host = ReactFiberTreeReflection.findCurrentHostFiber(fiber); + return host ? host.memoizedProps || emptyObject : emptyObject; + }, getHostNode = function(fiber, findNodeHandle) { + for (var hostNode = void 0; fiber; ) { + if (null !== fiber.stateNode && fiber.tag === HostComponent$11 && (hostNode = findNodeHandle(fiber.stateNode)), + hostNode) return hostNode; + fiber = fiber.child; + } + return null; + }, createHierarchy = function(fiberHierarchy) { + return fiberHierarchy.map(function(fiber) { + return { + name: getComponentName_1(fiber), + getInspectorData: function(findNodeHandle) { + return { + measure: function(callback) { + return UIManager.measure(getHostNode(fiber, findNodeHandle), callback); + }, + props: getHostProps(fiber), + source: fiber._debugSource + }; + } + }; }); - }), Object.keys(aggregatedStats).map(function(key) { - return _extends$3({}, aggregatedStats[key], { - instanceCount: Object.keys(affectedIDs[key]).length - }); - }).sort(function(a, b) { - return b.inclusiveRenderDuration - a.inclusiveRenderDuration; - }); -} - -function getWasted() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; - function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { - var _treeSnapshot$instanc2 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc2.displayName, ownerID = _treeSnapshot$instanc2.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; - stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { - key: key, - instanceCount: 0, - inclusiveRenderDuration: 0, - renderCount: 0 - }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); + }; + getInspectorDataForViewTag = function(viewTag) { + var closestInstance = getClosestInstanceFromNode(viewTag); + if (!closestInstance) return { + hierarchy: [], + props: emptyObject, + selection: null, + source: null + }; + var fiber = findCurrentFiberUsingSlowPath$1(closestInstance), fiberHierarchy = getOwnerHierarchy(fiber), instance = lastNonHostInstance(fiberHierarchy), hierarchy = createHierarchy(fiberHierarchy), props = getHostProps(instance), source = instance._debugSource; + return { + hierarchy: hierarchy, + props: props, + selection: fiberHierarchy.indexOf(instance), + source: source + }; + }; + var ReactNativeFiberInspector = { + getInspectorDataForViewTag: getInspectorDataForViewTag + }, ReactVersion = "16.0.0-alpha.13", ReactNativeFeatureFlags = require("ReactNativeFeatureFlags"), ReactCurrentOwner$3 = ReactGlobalSharedState_1.ReactCurrentOwner, injectedFindNode = ReactNativeFeatureFlags.useFiber ? function(fiber) { + return ReactNativeFiberRenderer.findHostInstance(fiber); + } : function(instance) { + return instance; + }; + function findNodeHandle(componentOrHandle) { + var owner = ReactCurrentOwner$3.current; + if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), + owner._warnedAboutRefsInRender = !0), null == componentOrHandle) return null; + if ("number" == typeof componentOrHandle) return componentOrHandle; + var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); + return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), + void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); } - return flushHistory.forEach(function(flush) { - var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot, operations = flush.operations, isDefinitelyNotWastedByID = {}; - operations.forEach(function(operation) { - for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, - nextParentID = treeSnapshot[nextParentID].parentID; + var findNodeHandle_1 = findNodeHandle, findNumericNodeHandleFiber = function(componentOrHandle) { + var instance = findNodeHandle_1(componentOrHandle); + return null == instance || "number" == typeof instance ? instance : instance._nativeTag; + }, DevOnlyStubShim = null; + function _classCallCheck$2(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); + } + function _possibleConstructorReturn(self, call) { + if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !call || "object" != typeof call && "function" != typeof call ? self : call; + } + function _inherits(subClass, superClass) { + if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); + } + var ReactNativeFeatureFlags$1 = require("ReactNativeFeatureFlags"), mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) { + _inherits(ReactNativeComponent, _React$Component); + function ReactNativeComponent() { + return _classCallCheck$2(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + return ReactNativeComponent.prototype.blur = function() { + TextInputState.blurTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.focus = function() { + TextInputState.focusTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.measure = function(callback) { + UIManager.measure(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); + }, ReactNativeComponent.prototype.measureInWindow = function(callback) { + UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback$2(this, callback)); + }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); + }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { + injectedSetNativeProps(this, nativeProps); + }, ReactNativeComponent; + }(react.Component); + function setNativePropsFiber(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } + } + function setNativePropsStack(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } + } + var injectedSetNativeProps = void 0; + injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; + var ReactNativeComponent_1 = ReactNativeComponent, ReactNativeFeatureFlags$2 = require("ReactNativeFeatureFlags"), mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$2 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$2.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { + measure: function(callback) { + UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); + }, + measureInWindow: function(callback) { + UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); + }, + measureLayout: function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$3(this, onFail), mountSafeCallback$3(this, onSuccess)); + }, + setNativeProps: function(nativeProps) { + injectedSetNativeProps$1(this, nativeProps); + }, + focus: function() { + TextInputState.focusTextInput(findNumericNodeHandle$1(this)); + }, + blur: function() { + TextInputState.blurTextInput(findNumericNodeHandle$1(this)); + } + }; + function setNativePropsFiber$1(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig; + warnForStyleProps$2(nativeProps, viewConfig.validAttributes); + var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } + } + function setNativePropsStack$1(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID; + warnForStyleProps$2(nativeProps, viewConfig.validAttributes); + var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } + } + var injectedSetNativeProps$1 = void 0; + injectedSetNativeProps$1 = ReactNativeFeatureFlags$2.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; + var NativeMethodsMixin_DEV = NativeMethodsMixin; + invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), + NativeMethodsMixin_DEV.componentWillMount = function() { + throwOnStylesProp$1(this, this.props); + }, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) { + throwOnStylesProp$1(this, newProps); + }; + var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { + centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { + var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; + if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, + count = 1); else for (var i = 0; i < touchBank.length; i++) { + var touchTrack = touchBank[i]; + if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { + var toAdd; + toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, + total += toAdd, count++; + } + } + return count > 0 ? total / count : TouchHistoryMath.noCentroid; + }, + currentCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !0); + }, + currentCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !0); + }, + previousCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !1); + }, + previousCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !1); + }, + currentCentroidX: function(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, !0, !0); + }, + currentCentroidY: function(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, !1, !0); + }, + noCentroid: -1 + }, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) { + return ReactNativeViewConfigRegistry_1.register(viewConfig); + }, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, ReactNativeFeatureFlags$3 = require("ReactNativeFeatureFlags"), createReactNativeComponentClass = ReactNativeFeatureFlags$3.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, ReactNativeFeatureFlags$4 = require("ReactNativeFeatureFlags"), findNumericNodeHandle$2 = ReactNativeFeatureFlags$4.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; + function takeSnapshot(view, options) { + return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), + UIManager.__takeSnapshot(view, options); + } + var takeSnapshot_1 = takeSnapshot, ReactInvalidSetStateWarningHook = {}, processingChildContext = !1, warnInvalidSetState = function() { + warning(!processingChildContext, "setState(...): Cannot call setState() inside getChildContext()"); + }; + ReactInvalidSetStateWarningHook = { + onBeginProcessingChildContext: function() { + processingChildContext = !0; + }, + onEndProcessingChildContext: function() { + processingChildContext = !1; + }, + onSetState: function() { + warnInvalidSetState(); + } + }; + var ReactInvalidSetStateWarningHook_1 = ReactInvalidSetStateWarningHook, ReactHostOperationHistoryHook = null, history = []; + ReactHostOperationHistoryHook = { + onHostOperation: function(operation) { + history.push(operation); + }, + clearHistory: function() { + ReactHostOperationHistoryHook._preventClearing || (history = []); + }, + getHistory: function() { + return history; + } + }; + var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactComponentTreeHook = ReactGlobalSharedState_1.ReactComponentTreeHook, ReactDebugTool = null, hooks = [], didHookThrowForEvent = {}, callHook = function(event, fn, context, arg1, arg2, arg3, arg4, arg5) { + try { + fn.call(context, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), + didHookThrowForEvent[event] = !0; + } + }, emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) { + for (var i = 0; i < hooks.length; i++) { + var hook = hooks[i], fn = hook[event]; + fn && callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); + } + }, isProfiling = !1, flushHistory = [], lifeCycleTimerStack = [], currentFlushNesting = 0, currentFlushMeasurements = [], currentFlushStartTime = 0, currentTimerDebugID = null, currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerType = null, lifeCycleTimerHasWarned = !1, clearHistory = function() { + ReactComponentTreeHook.purgeUnmountedComponents(), ReactHostOperationHistoryHook_1.clearHistory(); + }, getTreeSnapshot = function(registeredIDs) { + return registeredIDs.reduce(function(tree, id) { + var ownerID = ReactComponentTreeHook.getOwnerID(id), parentID = ReactComponentTreeHook.getParentID(id); + return tree[id] = { + displayName: ReactComponentTreeHook.getDisplayName(id), + text: ReactComponentTreeHook.getText(id), + updateCount: ReactComponentTreeHook.getUpdateCount(id), + childIDs: ReactComponentTreeHook.getChildIDs(id), + ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, + parentID: parentID + }, tree; + }, {}); + }, resetMeasurements = function() { + var previousStartTime = currentFlushStartTime, previousMeasurements = currentFlushMeasurements, previousOperations = ReactHostOperationHistoryHook_1.getHistory(); + if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], + void clearHistory(); + if (previousMeasurements.length || previousOperations.length) { + var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); + flushHistory.push({ + duration: performanceNow() - previousStartTime, + measurements: previousMeasurements || [], + operations: previousOperations || [], + treeSnapshot: getTreeSnapshot(registeredIDs) + }); + } + clearHistory(), currentFlushStartTime = performanceNow(), currentFlushMeasurements = []; + }, checkDebugID = function(debugID) { + arguments.length > 1 && void 0 !== arguments[1] && arguments[1] && 0 === debugID || debugID || warning(!1, "ReactDebugTool: debugID may not be empty."); + }, beginLifeCycleTimer = function(debugID, timerType) { + 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, + currentTimerDebugID = debugID, currentTimerType = timerType); + }, endLifeCycleTimer = function(debugID, timerType) { + 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + lifeCycleTimerHasWarned = !0), isProfiling && currentFlushMeasurements.push({ + timerType: timerType, + instanceID: debugID, + duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration + }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, + currentTimerType = null); + }, pauseCurrentLifeCycleTimer = function() { + var currentTimer = { + startTime: currentTimerStartTime, + nestedFlushStartTime: performanceNow(), + debugID: currentTimerDebugID, + timerType: currentTimerType + }; + lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, + currentTimerDebugID = null, currentTimerType = null; + }, resumeCurrentLifeCycleTimer = function() { + var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), startTime = _lifeCycleTimerStack$.startTime, nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, debugID = _lifeCycleTimerStack$.debugID, timerType = _lifeCycleTimerStack$.timerType, nestedFlushDuration = performanceNow() - nestedFlushStartTime; + currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, + currentTimerDebugID = debugID, currentTimerType = timerType; + }, lastMarkTimeStamp = 0, canUsePerformanceMeasure = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, shouldMark = function(debugID) { + if (!isProfiling || !canUsePerformanceMeasure) return !1; + var element = ReactComponentTreeHook.getElement(debugID); + return null != element && "object" == typeof element && !("string" == typeof element.type); + }, markBegin = function(debugID, markType) { + if (shouldMark(debugID)) { + var markName = debugID + "::" + markType; + lastMarkTimeStamp = performanceNow(), performance.mark(markName); + } + }, markEnd = function(debugID, markType) { + if (shouldMark(debugID)) { + var markName = debugID + "::" + markType, displayName = ReactComponentTreeHook.getDisplayName(debugID) || "Unknown"; + if (performanceNow() - lastMarkTimeStamp > .1) { + var measurementName = displayName + " [" + markType + "]"; + performance.measure(measurementName, markName); + } + performance.clearMarks(markName), measurementName && performance.clearMeasures(measurementName); + } + }; + ReactDebugTool = { + addHook: function(hook) { + hooks.push(hook); + }, + removeHook: function(hook) { + for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), + i--); + }, + isProfiling: function() { + return isProfiling; + }, + beginProfiling: function() { + isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), + ReactDebugTool.addHook(ReactHostOperationHistoryHook_1)); + }, + endProfiling: function() { + isProfiling && (isProfiling = !1, resetMeasurements(), ReactDebugTool.removeHook(ReactHostOperationHistoryHook_1)); + }, + getFlushHistory: function() { + return flushHistory; + }, + onBeginFlush: function() { + currentFlushNesting++, resetMeasurements(), pauseCurrentLifeCycleTimer(), emitEvent("onBeginFlush"); + }, + onEndFlush: function() { + resetMeasurements(), currentFlushNesting--, resumeCurrentLifeCycleTimer(), emitEvent("onEndFlush"); + }, + onBeginLifeCycleTimer: function(debugID, timerType) { + checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), + beginLifeCycleTimer(debugID, timerType); + }, + onEndLifeCycleTimer: function(debugID, timerType) { + checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), + emitEvent("onEndLifeCycleTimer", debugID, timerType); + }, + onBeginProcessingChildContext: function() { + emitEvent("onBeginProcessingChildContext"); + }, + onEndProcessingChildContext: function() { + emitEvent("onEndProcessingChildContext"); + }, + onHostOperation: function(operation) { + checkDebugID(operation.instanceID), emitEvent("onHostOperation", operation); + }, + onSetState: function() { + emitEvent("onSetState"); + }, + onSetChildren: function(debugID, childDebugIDs) { + checkDebugID(debugID), childDebugIDs.forEach(checkDebugID), emitEvent("onSetChildren", debugID, childDebugIDs); + }, + onBeforeMountComponent: function(debugID, element, parentDebugID) { + checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), + markBegin(debugID, "mount"); + }, + onMountComponent: function(debugID) { + checkDebugID(debugID), markEnd(debugID, "mount"), emitEvent("onMountComponent", debugID); + }, + onBeforeUpdateComponent: function(debugID, element) { + checkDebugID(debugID), emitEvent("onBeforeUpdateComponent", debugID, element), markBegin(debugID, "update"); + }, + onUpdateComponent: function(debugID) { + checkDebugID(debugID), markEnd(debugID, "update"), emitEvent("onUpdateComponent", debugID); + }, + onBeforeUnmountComponent: function(debugID) { + checkDebugID(debugID), emitEvent("onBeforeUnmountComponent", debugID), markBegin(debugID, "unmount"); + }, + onUnmountComponent: function(debugID) { + checkDebugID(debugID), markEnd(debugID, "unmount"), emitEvent("onUnmountComponent", debugID); + }, + onTestEvent: function() { + emitEvent("onTestEvent"); + } + }, ReactDebugTool.addHook(ReactInvalidSetStateWarningHook_1), ReactDebugTool.addHook(ReactComponentTreeHook); + var url = ExecutionEnvironment.canUseDOM && window.location.href || ""; + /[?&]react_perf\b/.test(url) && ReactDebugTool.beginProfiling(); + var ReactDebugTool_1 = ReactDebugTool, lowPriorityWarning = function() {}, printWarning = function(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; + var argIndex = 0, message = "Warning: " + format.replace(/%s/g, function() { + return args[argIndex++]; }); - var renderedCompositeIDs = {}; - measurements.forEach(function(measurement) { - var instanceID = measurement.instanceID; - "render" === measurement.timerType && (renderedCompositeIDs[instanceID] = !0); - }), measurements.forEach(function(measurement) { - var duration = measurement.duration, instanceID = measurement.instanceID; - if ("render" === measurement.timerType) { - var updateCount = treeSnapshot[instanceID].updateCount; - if (!isDefinitelyNotWastedByID[instanceID] && 0 !== updateCount) { + "undefined" != typeof console && console.warn(message); + try { + throw new Error(message); + } catch (x) {} + }; + lowPriorityWarning = function(condition, format) { + if (void 0 === format) throw new Error("`warning(condition, format, ...args)` requires a warning " + "message argument"); + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) args[_key2 - 2] = arguments[_key2]; + printWarning.apply(void 0, [ format ].concat(args)); + } + }; + var lowPriorityWarning_1 = lowPriorityWarning, _extends$3 = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + } + return target; + }; + function roundFloat(val) { + var base = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2, n = Math.pow(10, base); + return Math.floor(val * n) / n; + } + function consoleTable(table) { + console.table(table); + } + function getLastMeasurements() { + return ReactDebugTool_1.getFlushHistory(); + } + function getExclusive() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; + function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) { + var displayName = treeSnapshot[instanceID].displayName, key = displayName, stats = aggregatedStats[key]; + stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + counts: {}, + durations: {}, + totalDuration: 0 + }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), + affectedIDs[key][instanceID] = !0, applyUpdate(stats); + } + return flushHistory.forEach(function(flush) { + var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; + measurements.forEach(function(measurement) { + var duration = measurement.duration, instanceID = measurement.instanceID, timerType = measurement.timerType; + updateAggregatedStats(treeSnapshot, instanceID, timerType, function(stats) { + stats.totalDuration += duration, stats.durations[timerType] += duration, stats.counts[timerType]++; + }); + }); + }), Object.keys(aggregatedStats).map(function(key) { + return _extends$3({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function(a, b) { + return b.totalDuration - a.totalDuration; + }); + } + function getInclusive() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc.displayName, ownerID = _treeSnapshot$instanc.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; + stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); + } + var isCompositeByID = {}; + return flushHistory.forEach(function(flush) { + flush.measurements.forEach(function(measurement) { + var instanceID = measurement.instanceID; + "render" === measurement.timerType && (isCompositeByID[instanceID] = !0); + }); + }), flushHistory.forEach(function(flush) { + var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; + measurements.forEach(function(measurement) { + var duration = measurement.duration, instanceID = measurement.instanceID; + if ("render" === measurement.timerType) { updateAggregatedStats(treeSnapshot, instanceID, function(stats) { stats.renderCount++; }); - for (var nextParentID = instanceID; nextParentID; ) renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { + for (var nextParentID = instanceID; nextParentID; ) isCompositeByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { stats.inclusiveRenderDuration += duration; }), nextParentID = treeSnapshot[nextParentID].parentID; } - } - }); - }), Object.keys(aggregatedStats).map(function(key) { - return _extends$3({}, aggregatedStats[key], { - instanceCount: Object.keys(affectedIDs[key]).length - }); - }).sort(function(a, b) { - return b.inclusiveRenderDuration - a.inclusiveRenderDuration; - }); -} - -function getOperations() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), stats = []; - return flushHistory.forEach(function(flush, flushIndex) { - var operations = flush.operations, treeSnapshot = flush.treeSnapshot; - operations.forEach(function(operation) { - var instanceID = operation.instanceID, type = operation.type, payload = operation.payload, _treeSnapshot$instanc3 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc3.displayName, ownerID = _treeSnapshot$instanc3.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName; - stats.push({ - flushIndex: flushIndex, - instanceID: instanceID, - key: key, - type: type, - ownerID: ownerID, - payload: payload }); + }), Object.keys(aggregatedStats).map(function(key) { + return _extends$3({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function(a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; }); - }), stats; -} - -function printExclusive(flushHistory) { - consoleTable(getExclusive(flushHistory).map(function(item) { - var key = item.key, instanceCount = item.instanceCount, totalDuration = item.totalDuration, renderCount = item.counts.render || 0, renderDuration = item.durations.render || 0; - return { - Component: key, - "Total time (ms)": roundFloat(totalDuration), - "Instance count": instanceCount, - "Total render time (ms)": roundFloat(renderDuration), - "Average render time (ms)": renderCount ? roundFloat(renderDuration / renderCount) : void 0, - "Render count": renderCount, - "Total lifecycle time (ms)": roundFloat(totalDuration - renderDuration) - }; - })); -} - -function printInclusive(flushHistory) { - consoleTable(getInclusive(flushHistory).map(function(item) { - var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; - return { - "Owner > Component": key, - "Inclusive render time (ms)": roundFloat(inclusiveRenderDuration), - "Instance count": instanceCount, - "Render count": renderCount - }; - })); -} - -function printWasted(flushHistory) { - consoleTable(getWasted(flushHistory).map(function(item) { - var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; - return { - "Owner > Component": key, - "Inclusive wasted time (ms)": roundFloat(inclusiveRenderDuration), - "Instance count": instanceCount, - "Render count": renderCount - }; - })); -} - -function printOperations(flushHistory) { - consoleTable(getOperations(flushHistory).map(function(stat) { - return { - "Owner > Node": stat.key, - Operation: stat.type, - Payload: "object" == typeof stat.payload ? JSON.stringify(stat.payload) : stat.payload, - "Flush index": stat.flushIndex, - "Owner Component ID": stat.ownerID, - "DOM Component ID": stat.instanceID - }; - })); -} - -var warnedAboutPrintDOM = !1; - -function printDOM(measurements) { - return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), - warnedAboutPrintDOM = !0, printOperations(measurements); -} - -var warnedAboutGetMeasurementsSummaryMap = !1; - -function getMeasurementsSummaryMap(measurements) { - return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), - warnedAboutGetMeasurementsSummaryMap = !0, getWasted(measurements); -} - -function start() { - ReactDebugTool_1.beginProfiling(); -} - -function stop() { - ReactDebugTool_1.endProfiling(); -} - -function isRunning() { - return ReactDebugTool_1.isProfiling(); -} - -var ReactPerfAnalysis = { - getLastMeasurements: getLastMeasurements, - getExclusive: getExclusive, - getInclusive: getInclusive, - getWasted: getWasted, - getOperations: getOperations, - printExclusive: printExclusive, - printInclusive: printInclusive, - printWasted: printWasted, - printOperations: printOperations, - start: start, - stop: stop, - isRunning: isRunning, - printDOM: printDOM, - getMeasurementsSummaryMap: getMeasurementsSummaryMap -}, ReactPerf = ReactPerfAnalysis, injectInternals = ReactFiberDevToolsHook.injectInternals; - -ReactNativeInjection.inject(), ReactGenericBatching_1.injection.injectFiberBatchedUpdates(ReactNativeFiberRenderer.batchedUpdates); - -var roots = new Map(); - -ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog); - -var ReactNative = { - NativeComponent: ReactNativeComponent_1, - findNodeHandle: findNumericNodeHandleFiber, - render: function(element, containerTag, callback) { - var root = roots.get(containerTag); - return root || (root = ReactNativeFiberRenderer.createContainer(containerTag), roots.set(containerTag, root)), - ReactNativeFiberRenderer.updateContainer(element, root, null, callback), ReactNativeFiberRenderer.getPublicRootInstance(root); - }, - unmountComponentAtNode: function(containerTag) { - var root = roots.get(containerTag); - root && ReactNativeFiberRenderer.updateContainer(null, root, null, function() { - roots.delete(containerTag); - }); - }, - unmountComponentAtNodeAndRemoveContainer: function(containerTag) { - ReactNative.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); - }, - unstable_createPortal: function(children, containerTag) { - var key = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null; - return ReactPortal.createPortal(children, containerTag, null, key); - }, - unstable_batchedUpdates: ReactGenericBatching_1.batchedUpdates, - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { - NativeMethodsMixin: NativeMethodsMixin_1, - ReactGlobalSharedState: ReactGlobalSharedState_1, - ReactNativeComponentTree: ReactNativeComponentTree_1, - ReactNativePropRegistry: ReactNativePropRegistry_1, - TouchHistoryMath: TouchHistoryMath_1, - createReactNativeComponentClass: createReactNativeComponentClass, - takeSnapshot: takeSnapshot_1 } -}; - -Object.assign(ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, { - ReactDebugTool: ReactDebugTool_1, - ReactPerf: ReactPerf -}), "function" == typeof injectInternals && injectInternals({ - findFiberByHostInstance: ReactNativeComponentTree_1.getClosestInstanceFromNode, - findHostInstanceByFiber: ReactNativeFiberRenderer.findHostInstance, - getInspectorDataForViewTag: ReactNativeFiberInspector.getInspectorDataForViewTag, - bundleType: 1, - version: ReactVersion -}); - -var ReactNativeFiber = ReactNative; - -module.exports = ReactNativeFiber; + function getWasted() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc2 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc2.displayName, ownerID = _treeSnapshot$instanc2.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; + stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); + } + return flushHistory.forEach(function(flush) { + var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot, operations = flush.operations, isDefinitelyNotWastedByID = {}; + operations.forEach(function(operation) { + for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, + nextParentID = treeSnapshot[nextParentID].parentID; + }); + var renderedCompositeIDs = {}; + measurements.forEach(function(measurement) { + var instanceID = measurement.instanceID; + "render" === measurement.timerType && (renderedCompositeIDs[instanceID] = !0); + }), measurements.forEach(function(measurement) { + var duration = measurement.duration, instanceID = measurement.instanceID; + if ("render" === measurement.timerType) { + var updateCount = treeSnapshot[instanceID].updateCount; + if (!isDefinitelyNotWastedByID[instanceID] && 0 !== updateCount) { + updateAggregatedStats(treeSnapshot, instanceID, function(stats) { + stats.renderCount++; + }); + for (var nextParentID = instanceID; nextParentID; ) renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { + stats.inclusiveRenderDuration += duration; + }), nextParentID = treeSnapshot[nextParentID].parentID; + } + } + }); + }), Object.keys(aggregatedStats).map(function(key) { + return _extends$3({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function(a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; + }); + } + function getOperations() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), stats = []; + return flushHistory.forEach(function(flush, flushIndex) { + var operations = flush.operations, treeSnapshot = flush.treeSnapshot; + operations.forEach(function(operation) { + var instanceID = operation.instanceID, type = operation.type, payload = operation.payload, _treeSnapshot$instanc3 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc3.displayName, ownerID = _treeSnapshot$instanc3.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName; + stats.push({ + flushIndex: flushIndex, + instanceID: instanceID, + key: key, + type: type, + ownerID: ownerID, + payload: payload + }); + }); + }), stats; + } + function printExclusive(flushHistory) { + consoleTable(getExclusive(flushHistory).map(function(item) { + var key = item.key, instanceCount = item.instanceCount, totalDuration = item.totalDuration, renderCount = item.counts.render || 0, renderDuration = item.durations.render || 0; + return { + Component: key, + "Total time (ms)": roundFloat(totalDuration), + "Instance count": instanceCount, + "Total render time (ms)": roundFloat(renderDuration), + "Average render time (ms)": renderCount ? roundFloat(renderDuration / renderCount) : void 0, + "Render count": renderCount, + "Total lifecycle time (ms)": roundFloat(totalDuration - renderDuration) + }; + })); + } + function printInclusive(flushHistory) { + consoleTable(getInclusive(flushHistory).map(function(item) { + var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; + return { + "Owner > Component": key, + "Inclusive render time (ms)": roundFloat(inclusiveRenderDuration), + "Instance count": instanceCount, + "Render count": renderCount + }; + })); + } + function printWasted(flushHistory) { + consoleTable(getWasted(flushHistory).map(function(item) { + var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; + return { + "Owner > Component": key, + "Inclusive wasted time (ms)": roundFloat(inclusiveRenderDuration), + "Instance count": instanceCount, + "Render count": renderCount + }; + })); + } + function printOperations(flushHistory) { + consoleTable(getOperations(flushHistory).map(function(stat) { + return { + "Owner > Node": stat.key, + Operation: stat.type, + Payload: "object" == typeof stat.payload ? JSON.stringify(stat.payload) : stat.payload, + "Flush index": stat.flushIndex, + "Owner Component ID": stat.ownerID, + "DOM Component ID": stat.instanceID + }; + })); + } + var warnedAboutPrintDOM = !1; + function printDOM(measurements) { + return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), + warnedAboutPrintDOM = !0, printOperations(measurements); + } + var warnedAboutGetMeasurementsSummaryMap = !1; + function getMeasurementsSummaryMap(measurements) { + return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), + warnedAboutGetMeasurementsSummaryMap = !0, getWasted(measurements); + } + function start() { + ReactDebugTool_1.beginProfiling(); + } + function stop() { + ReactDebugTool_1.endProfiling(); + } + function isRunning() { + return ReactDebugTool_1.isProfiling(); + } + var ReactPerfAnalysis = { + getLastMeasurements: getLastMeasurements, + getExclusive: getExclusive, + getInclusive: getInclusive, + getWasted: getWasted, + getOperations: getOperations, + printExclusive: printExclusive, + printInclusive: printInclusive, + printWasted: printWasted, + printOperations: printOperations, + start: start, + stop: stop, + isRunning: isRunning, + printDOM: printDOM, + getMeasurementsSummaryMap: getMeasurementsSummaryMap + }, ReactPerf = ReactPerfAnalysis, injectInternals = ReactFiberDevToolsHook.injectInternals; + ReactNativeInjection.inject(), ReactGenericBatching_1.injection.injectFiberBatchedUpdates(ReactNativeFiberRenderer.batchedUpdates); + var roots = new Map(); + ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog); + var ReactNativeFiber = { + NativeComponent: ReactNativeComponent_1, + findNodeHandle: findNumericNodeHandleFiber, + render: function(element, containerTag, callback) { + var root = roots.get(containerTag); + return root || (root = ReactNativeFiberRenderer.createContainer(containerTag), roots.set(containerTag, root)), + ReactNativeFiberRenderer.updateContainer(element, root, null, callback), ReactNativeFiberRenderer.getPublicRootInstance(root); + }, + unmountComponentAtNode: function(containerTag) { + var root = roots.get(containerTag); + root && ReactNativeFiberRenderer.updateContainer(null, root, null, function() { + roots.delete(containerTag); + }); + }, + unmountComponentAtNodeAndRemoveContainer: function(containerTag) { + ReactNativeFiber.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); + }, + unstable_createPortal: function(children, containerTag) { + var key = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null; + return ReactPortal.createPortal(children, containerTag, null, key); + }, + unstable_batchedUpdates: ReactGenericBatching_1.batchedUpdates, + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { + NativeMethodsMixin: NativeMethodsMixin_1, + ReactGlobalSharedState: ReactGlobalSharedState_1, + ReactNativeComponentTree: ReactNativeComponentTree_1, + ReactNativePropRegistry: ReactNativePropRegistry_1, + TouchHistoryMath: TouchHistoryMath_1, + createReactNativeComponentClass: createReactNativeComponentClass, + takeSnapshot: takeSnapshot_1 + } + }; + Object.assign(ReactNativeFiber.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, { + ReactDebugTool: ReactDebugTool_1, + ReactPerf: ReactPerf + }), "function" == typeof injectInternals && injectInternals({ + findFiberByHostInstance: ReactNativeComponentTree_1.getClosestInstanceFromNode, + findHostInstanceByFiber: ReactNativeFiberRenderer.findHostInstance, + getInspectorDataForViewTag: ReactNativeFiberInspector.getInspectorDataForViewTag, + bundleType: 1, + version: ReactVersion + }); + var ReactNativeFiberEntry = ReactNativeFiber; + module.exports = ReactNativeFiberEntry; +} diff --git a/Libraries/Renderer/ReactNativeFiber-prod.js b/Libraries/Renderer/ReactNativeFiber-prod.js index 84c649d01bd..e68b9421187 100644 --- a/Libraries/Renderer/ReactNativeFiber-prod.js +++ b/Libraries/Renderer/ReactNativeFiber-prod.js @@ -21,7 +21,7 @@ require("prop-types/checkPropTypes"); var emptyObject = require("fbjs/lib/emptyObject"), react = require("react"), shallowEqual = require("fbjs/lib/shallowEqual"), deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"); -require("deepFreezeAndThrowOnMutationInDev"), require("ReactNativeFeatureFlags"); +require("deepFreezeAndThrowOnMutationInDev"); var defaultShowDialog = function(capturedError) { return !0; @@ -216,16 +216,15 @@ var ReactGenericBatchingInjection = { }, ReactGenericBatching_1 = ReactGenericBatching; function ReactNativeFiberErrorDialog(capturedError) { - var componentStack = capturedError.componentStack, error = capturedError.error, errorMessage = void 0, errorStack = void 0, errorType = void 0; - if (error && "object" == typeof error) { - var message = error.message, name = error.name; - errorMessage = (message ? name + ": " + message : name) + "\n\nThis error is located at:" + componentStack, - errorStack = error.stack, errorType = error.constructor; - } else errorMessage = "Unspecified error at:" + componentStack, errorStack = "", - errorType = Error; - var newError = new errorType(errorMessage); - return newError.stack = errorStack, ExceptionsManager.handleException(newError, !1), - !1; + var componentStack = capturedError.componentStack, error = capturedError.error, errorToHandle = void 0; + if (error instanceof Error) { + var message = error.message, name = error.name, summary = message ? name + ": " + message : name; + errorToHandle = error; + try { + errorToHandle.message = summary + "\n\nThis error is located at:" + componentStack; + } catch (e) {} + } else errorToHandle = "string" == typeof error ? new Error(error + "\n\nThis error is located at:" + componentStack) : new Error("Unspecified error at:" + componentStack); + return ExceptionsManager.handleException(errorToHandle, !1), !1; } var showDialog$1 = ReactNativeFiberErrorDialog, ReactNativeFiberErrorDialog_1 = { @@ -1037,10 +1036,9 @@ var ReactNativeInjection = { NoWork: 0, SynchronousPriority: 1, TaskPriority: 2, - AnimationPriority: 3, - HighPriority: 4, - LowPriority: 5, - OffscreenPriority: 6 + HighPriority: 3, + LowPriority: 4, + OffscreenPriority: 5 }, CallbackEffect = ReactTypeOfSideEffect.Callback, NoWork = ReactPriorityLevel.NoWork, SynchronousPriority = ReactPriorityLevel.SynchronousPriority, TaskPriority = ReactPriorityLevel.TaskPriority; function comparePriority(a, b) { @@ -2503,7 +2501,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo onCommitRoot: onCommitRoot_1, onCommitUnmount: onCommitUnmount_1 }, ClassComponent$8 = ReactTypeOfWork.ClassComponent, HostRoot$6 = ReactTypeOfWork.HostRoot, HostComponent$8 = ReactTypeOfWork.HostComponent, HostText$5 = ReactTypeOfWork.HostText, HostPortal$5 = ReactTypeOfWork.HostPortal, CoroutineComponent$4 = ReactTypeOfWork.CoroutineComponent, commitCallbacks$1 = ReactFiberUpdateQueue.commitCallbacks, onCommitUnmount = ReactFiberDevToolsHook.onCommitUnmount, Placement$5 = ReactTypeOfSideEffect.Placement, Update$3 = ReactTypeOfSideEffect.Update, Callback$1 = ReactTypeOfSideEffect.Callback, ContentReset$2 = ReactTypeOfSideEffect.ContentReset, ReactFiberCommitWork = function(config, captureError) { - var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, insertBefore = config.insertBefore, removeChild = config.removeChild, getPublicInstance = config.getPublicInstance; + var commitMount = config.commitMount, commitUpdate = config.commitUpdate, resetTextContent = config.resetTextContent, commitTextUpdate = config.commitTextUpdate, appendChild = config.appendChild, appendChildToContainer = config.appendChildToContainer, insertBefore = config.insertBefore, insertInContainerBefore = config.insertInContainerBefore, removeChild = config.removeChild, removeChildFromContainer = config.removeChildFromContainer, getPublicInstance = config.getPublicInstance; function safelyCallComponentWillUnmount(current, instance) { try { instance.componentWillUnmount(); @@ -2521,20 +2519,6 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } } } - function getHostParent(fiber) { - for (var parent = fiber.return; null !== parent; ) { - switch (parent.tag) { - case HostComponent$8: - return parent.stateNode; - - case HostRoot$6: - case HostPortal$5: - return parent.stateNode.containerInfo; - } - parent = parent.return; - } - invariant(!1, "Expected to find a host parent. This error is likely caused by a bug " + "in React. Please file an issue."); - } function getHostParentFiber(fiber) { for (var parent = fiber.return; null !== parent; ) { if (isHostParent(parent)) return parent; @@ -2561,15 +2545,15 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } } function commitPlacement(finishedWork) { - var parentFiber = getHostParentFiber(finishedWork), parent = void 0; + var parentFiber = getHostParentFiber(finishedWork), parent = void 0, isContainer = void 0; switch (parentFiber.tag) { case HostComponent$8: - parent = parentFiber.stateNode; + parent = parentFiber.stateNode, isContainer = !1; break; case HostRoot$6: case HostPortal$5: - parent = parentFiber.stateNode.containerInfo; + parent = parentFiber.stateNode.containerInfo, isContainer = !0; break; default: @@ -2577,7 +2561,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } parentFiber.effectTag & ContentReset$2 && (resetTextContent(parent), parentFiber.effectTag &= ~ContentReset$2); for (var before = getHostSibling(finishedWork), node = finishedWork; !0; ) { - if (node.tag === HostComponent$8 || node.tag === HostText$5) before ? insertBefore(parent, node.stateNode, before) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { + if (node.tag === HostComponent$8 || node.tag === HostText$5) before ? isContainer ? insertInContainerBefore(parent, node.stateNode, before) : insertBefore(parent, node.stateNode, before) : isContainer ? appendChildToContainer(parent, node.stateNode) : appendChild(parent, node.stateNode); else if (node.tag === HostPortal$5) ; else if (null !== node.child) { node.child.return = node, node = node.child; continue; } @@ -2599,11 +2583,29 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo node.sibling.return = node.return, node = node.sibling; } else node.child.return = node, node = node.child; } - function unmountHostComponents(parent, current) { - for (var node = current; !0; ) { + function unmountHostComponents(current) { + for (var node = current, currentParentIsValid = !1, currentParent = void 0, currentParentIsContainer = void 0; !0; ) { + if (!currentParentIsValid) { + var parent = node.return; + findParent: for (;!0; ) { + switch (invariant(null !== parent, "Expected to find a host parent. This error is likely caused by " + "a bug in React. Please file an issue."), + parent.tag) { + case HostComponent$8: + currentParent = parent.stateNode, currentParentIsContainer = !1; + break findParent; + + case HostRoot$6: + case HostPortal$5: + currentParent = parent.stateNode.containerInfo, currentParentIsContainer = !0; + break findParent; + } + parent = parent.return; + } + currentParentIsValid = !0; + } if (node.tag === HostComponent$8 || node.tag === HostText$5) commitNestedUnmounts(node), - removeChild(parent, node.stateNode); else if (node.tag === HostPortal$5) { - if (parent = node.stateNode.containerInfo, null !== node.child) { + currentParentIsContainer ? removeChildFromContainer(currentParent, node.stateNode) : removeChild(currentParent, node.stateNode); else if (node.tag === HostPortal$5) { + if (currentParent = node.stateNode.containerInfo, null !== node.child) { node.child.return = node, node = node.child; continue; } @@ -2614,14 +2616,14 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo if (node === current) return; for (;null === node.sibling; ) { if (null === node.return || node.return === current) return; - node = node.return, node.tag === HostPortal$5 && (parent = getHostParent(node)); + node = node.return, node.tag === HostPortal$5 && (currentParentIsValid = !1); } node.sibling.return = node.return, node = node.sibling; } } function commitDeletion(current) { - unmountHostComponents(getHostParent(current), current), current.return = null, current.child = null, - current.alternate && (current.alternate.child = null, current.alternate.return = null); + unmountHostComponents(current), current.return = null, current.child = null, current.alternate && (current.alternate.child = null, + current.alternate.return = null); } function commitUnmount(current) { switch ("function" == typeof onCommitUnmount && onCommitUnmount(current), current.tag) { @@ -2637,7 +2639,7 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo return void commitNestedUnmounts(current.stateNode); case HostPortal$5: - return void unmountHostComponents(getHostParent(current), current); + return void unmountHostComponents(current); } } function commitWork(current, finishedWork) { @@ -2853,14 +2855,8 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo prepareToHydrateHostTextInstance: prepareToHydrateHostTextInstance, popHydrationState: popHydrationState }; -}, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, AnimationPriority = ReactPriorityLevel.AnimationPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$3 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) { - var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, hostScheduleAnimationCallback = config.scheduleAnimationCallback, hostScheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isAnimationCallbackScheduled = !1, isDeferredCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1; - function scheduleAnimationCallback(callback) { - isAnimationCallbackScheduled || (isAnimationCallbackScheduled = !0, hostScheduleAnimationCallback(callback)); - } - function scheduleDeferredCallback(callback) { - isDeferredCallbackScheduled || (isDeferredCallbackScheduled = !0, hostScheduleDeferredCallback(callback)); - } +}, popContextProvider$1 = ReactFiberContext.popContextProvider, reset$1 = ReactFiberStack.reset, getStackAddendumByWorkInProgressFiber = ReactFiberComponentTreeHook.getStackAddendumByWorkInProgressFiber, logCapturedError$1 = ReactFiberErrorLogger.logCapturedError, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, cloneFiber$1 = ReactFiber.cloneFiber, onCommitRoot = ReactFiberDevToolsHook.onCommitRoot, NoWork$2 = ReactPriorityLevel.NoWork, SynchronousPriority$1 = ReactPriorityLevel.SynchronousPriority, TaskPriority$1 = ReactPriorityLevel.TaskPriority, HighPriority = ReactPriorityLevel.HighPriority, LowPriority = ReactPriorityLevel.LowPriority, OffscreenPriority = ReactPriorityLevel.OffscreenPriority, AsyncUpdates = ReactTypeOfInternalContext.AsyncUpdates, PerformedWork = ReactTypeOfSideEffect.PerformedWork, Placement$1 = ReactTypeOfSideEffect.Placement, Update = ReactTypeOfSideEffect.Update, PlacementAndUpdate = ReactTypeOfSideEffect.PlacementAndUpdate, Deletion = ReactTypeOfSideEffect.Deletion, ContentReset = ReactTypeOfSideEffect.ContentReset, Callback = ReactTypeOfSideEffect.Callback, Err = ReactTypeOfSideEffect.Err, Ref = ReactTypeOfSideEffect.Ref, HostRoot$3 = ReactTypeOfWork.HostRoot, HostComponent$4 = ReactTypeOfWork.HostComponent, HostPortal$1 = ReactTypeOfWork.HostPortal, ClassComponent$3 = ReactTypeOfWork.ClassComponent, getPendingPriority$1 = ReactFiberUpdateQueue.getPendingPriority, _require14 = ReactFiberContext, resetContext$1 = _require14.resetContext, ReactFiberInstrumentation$1, timeHeuristicForUnitOfWork = 1, ReactFiberScheduler = function(config) { + var hostContext = ReactFiberHostContext(config), hydrationContext = ReactFiberHydrationContext(config), popHostContainer = hostContext.popHostContainer, popHostContext = hostContext.popHostContext, resetHostContainer = hostContext.resetHostContainer, _ReactFiberBeginWork = ReactFiberBeginWork(config, hostContext, hydrationContext, scheduleUpdate, getPriorityContext), beginWork = _ReactFiberBeginWork.beginWork, beginFailedWork = _ReactFiberBeginWork.beginFailedWork, _ReactFiberCompleteWo = ReactFiberCompleteWork(config, hostContext, hydrationContext), completeWork = _ReactFiberCompleteWo.completeWork, _ReactFiberCommitWork = ReactFiberCommitWork(config, captureError), commitPlacement = _ReactFiberCommitWork.commitPlacement, commitDeletion = _ReactFiberCommitWork.commitDeletion, commitWork = _ReactFiberCommitWork.commitWork, commitLifeCycles = _ReactFiberCommitWork.commitLifeCycles, commitAttachRef = _ReactFiberCommitWork.commitAttachRef, commitDetachRef = _ReactFiberCommitWork.commitDetachRef, scheduleDeferredCallback = config.scheduleDeferredCallback, useSyncScheduling = config.useSyncScheduling, prepareForCommit = config.prepareForCommit, resetAfterCommit = config.resetAfterCommit, priorityContext = NoWork$2, priorityContextBeforeReconciliation = NoWork$2, isPerformingWork = !1, deadlineHasExpired = !1, isBatchingUpdates = !1, isUnbatchingUpdates = !1, nextUnitOfWork = null, nextPriorityLevel = NoWork$2, nextEffect = null, pendingCommit = null, nextScheduledRoot = null, lastScheduledRoot = null, isCallbackScheduled = !1, capturedErrors = null, failedBoundaries = null, commitPhaseBoundaries = null, firstUncaughtError = null, fatalError = null, isCommitting = !1, isUnmounting = !1; function resetContextStack() { reset$1(), resetContext$1(), resetHostContainer(); } @@ -2993,63 +2989,76 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo null === next && (next = completeUnitOfWork(workInProgress)), ReactCurrentOwner$1.current = null, next; } - function performDeferredWork(deadline) { - isDeferredCallbackScheduled = !1, performWork(OffscreenPriority, deadline); - } - function performAnimationWork() { - isAnimationCallbackScheduled = !1, performWork(AnimationPriority, null); - } function clearErrors() { for (null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()); null !== capturedErrors && capturedErrors.size && null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= TaskPriority$1; ) null === (nextUnitOfWork = hasCapturedError(nextUnitOfWork) ? performFailedUnitOfWork(nextUnitOfWork) : performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork()); } - function workLoop(priorityLevel, deadline) { - if (clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()), - null !== deadline && priorityLevel > TaskPriority$1) for (;null !== nextUnitOfWork && !deadlineHasExpired; ) deadline.timeRemaining() > timeHeuristicForUnitOfWork ? null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit && (deadline.timeRemaining() > timeHeuristicForUnitOfWork ? (commitAllWork(pendingCommit), - nextUnitOfWork = findNextUnitOfWork(), clearErrors()) : deadlineHasExpired = !0) : deadlineHasExpired = !0; else for (;null !== nextUnitOfWork && nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= priorityLevel; ) null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), - clearErrors()); + function workLoopAsync(minPriorityLevel, deadline) { + for (;null !== nextUnitOfWork && !deadlineHasExpired; ) if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) { + if (null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && null !== pendingCommit) if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) { + if (commitAllWork(pendingCommit), nextUnitOfWork = findNextUnitOfWork(), clearErrors(), + nextPriorityLevel === NoWork$2 || nextPriorityLevel > minPriorityLevel || nextPriorityLevel < HighPriority) break; + } else deadlineHasExpired = !0; + } else deadlineHasExpired = !0; } - function performWork(priorityLevel, deadline) { + function workLoopSync(minPriorityLevel) { + for (;null !== nextUnitOfWork && !(null === (nextUnitOfWork = performUnitOfWork(nextUnitOfWork)) && (nextUnitOfWork = findNextUnitOfWork(), + clearErrors(), nextPriorityLevel === NoWork$2 || nextPriorityLevel > minPriorityLevel || nextPriorityLevel > TaskPriority$1)); ) ; + } + function workLoop(minPriorityLevel, deadline) { + clearErrors(), null === nextUnitOfWork && (nextUnitOfWork = findNextUnitOfWork()), + nextPriorityLevel !== NoWork$2 && nextPriorityLevel <= minPriorityLevel && (nextPriorityLevel <= TaskPriority$1 ? workLoopSync(minPriorityLevel) : null !== deadline && workLoopAsync(minPriorityLevel, deadline)); + } + function performDeferredWork(deadline) { + performWork(OffscreenPriority, deadline); + } + function performWork(minPriorityLevel, deadline) { invariant(!isPerformingWork, "performWork was called recursively. This error is likely caused " + "by a bug in React. Please file an issue."), isPerformingWork = !0; - for (var isPerformingDeferredWork = !!deadline; priorityLevel !== NoWork$2 && !fatalError; ) { - invariant(null !== deadline || priorityLevel < HighPriority, "Cannot perform deferred work without a deadline. This error is " + "likely caused by a bug in React. Please file an issue."), + for (var hasRemainingAsyncWork = !1; null === fatalError; ) { null === pendingCommit || deadlineHasExpired || commitAllWork(pendingCommit), priorityContextBeforeReconciliation = priorityContext; var _error3 = null; try { - workLoop(priorityLevel, deadline); + workLoop(minPriorityLevel, deadline); } catch (e) { _error3 = e; } - if (priorityContext = priorityContextBeforeReconciliation, null !== _error3) { - var failedWork = nextUnitOfWork; - if (null !== failedWork) { - var maybeBoundary = captureError(failedWork, _error3); - if (null !== maybeBoundary) { - var boundary = maybeBoundary; - beginFailedWork(boundary.alternate, boundary, priorityLevel), unwindContexts(failedWork, boundary), - nextUnitOfWork = completeUnitOfWork(boundary); + if (priorityContext = priorityContextBeforeReconciliation, null === _error3) { + switch (nextPriorityLevel) { + case SynchronousPriority$1: + case TaskPriority$1: + if (nextPriorityLevel <= minPriorityLevel) continue; + break; + + case HighPriority: + case LowPriority: + case OffscreenPriority: + if (null === deadline) hasRemainingAsyncWork = !0; else { + if (!deadlineHasExpired && nextPriorityLevel <= minPriorityLevel) continue; + hasRemainingAsyncWork = !0; } - continue; + break; + + case NoWork$2: + break; + + default: + invariant(!1, "Switch statement should be exhuastive."); + } + break; + } + var failedWork = nextUnitOfWork; + if (null === failedWork) null === fatalError && (fatalError = _error3); else { + var maybeBoundary = captureError(failedWork, _error3); + if (null !== maybeBoundary) { + var boundary = maybeBoundary; + beginFailedWork(boundary.alternate, boundary, nextPriorityLevel), unwindContexts(failedWork, boundary), + nextUnitOfWork = completeUnitOfWork(boundary); } - null === fatalError && (fatalError = _error3); } - if (priorityLevel = NoWork$2, nextPriorityLevel === NoWork$2 || !isPerformingDeferredWork || deadlineHasExpired) switch (nextPriorityLevel) { - case SynchronousPriority$1: - case TaskPriority$1: - priorityLevel = nextPriorityLevel; - break; - - case AnimationPriority: - scheduleAnimationCallback(performAnimationWork), scheduleDeferredCallback(performDeferredWork); - break; - - case HighPriority: - case LowPriority: - case OffscreenPriority: - scheduleDeferredCallback(performDeferredWork); - } else priorityLevel = nextPriorityLevel; } - var errorToThrow = fatalError || firstUncaughtError; + null !== deadline && (isCallbackScheduled = !1), hasRemainingAsyncWork && !isCallbackScheduled && (scheduleDeferredCallback(performDeferredWork), + isCallbackScheduled = !0); + var errorToThrow = null !== fatalError ? fatalError : firstUncaughtError; if (isPerformingWork = !1, deadlineHasExpired = !1, fatalError = null, firstUncaughtError = null, capturedErrors = null, failedBoundaries = null, null !== errorToThrow) throw errorToThrow; } @@ -3146,20 +3155,17 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo node.pendingWorkPriority = priorityLevel), null !== node.alternate && (node.alternate.pendingWorkPriority === NoWork$2 || node.alternate.pendingWorkPriority > priorityLevel) && (shouldContinue = !0, node.alternate.pendingWorkPriority = priorityLevel), null === node.return) { if (node.tag !== HostRoot$3) return; - switch (scheduleRoot(node.stateNode, priorityLevel), priorityLevel) { + if (scheduleRoot(node.stateNode, priorityLevel), !isPerformingWork) switch (priorityLevel) { case SynchronousPriority$1: - return void performWork(SynchronousPriority$1, null); + isUnbatchingUpdates ? performWork(SynchronousPriority$1, null) : performWork(TaskPriority$1, null); + break; case TaskPriority$1: - return; + invariant(isBatchingUpdates, "Task updates can only be scheduled as a nested update or " + "inside batchedUpdates."); + break; - case AnimationPriority: - return void scheduleAnimationCallback(performAnimationWork); - - case HighPriority: - case LowPriority: - case OffscreenPriority: - return void scheduleDeferredCallback(performDeferredWork); + default: + isCallbackScheduled || (scheduleDeferredCallback(performDeferredWork), isCallbackScheduled = !0); } } node = node.return; @@ -3192,12 +3198,12 @@ var injectInternals_1 = injectInternals$1, onCommitRoot_1 = onCommitRoot$1, onCo } } function unbatchedUpdates(fn) { - var previousIsBatchingUpdates = isBatchingUpdates; - isBatchingUpdates = !1; + var previousIsUnbatchingUpdates = isUnbatchingUpdates, previousIsBatchingUpdates = isBatchingUpdates; + isUnbatchingUpdates = isBatchingUpdates, isBatchingUpdates = !1; try { return fn(); } finally { - isBatchingUpdates = previousIsBatchingUpdates; + isBatchingUpdates = previousIsBatchingUpdates, isUnbatchingUpdates = previousIsUnbatchingUpdates; } } function syncUpdates(fn) { @@ -3474,12 +3480,13 @@ function recursivelyUncacheFiberNode(node) { var NativeRenderer = ReactFiberReconciler({ appendChild: function(parentInstance, child) { + var childTag = "number" == typeof child ? child : child._nativeTag, children = parentInstance._children, index = children.indexOf(child); + index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), + UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ children.length - 1 ], [])); + }, + appendChildToContainer: function(parentInstance, child) { var childTag = "number" == typeof child ? child : child._nativeTag; - if ("number" == typeof parentInstance) UIManager.setChildren(parentInstance, [ childTag ]); else { - var children = parentInstance._children, index = children.indexOf(child); - index >= 0 ? (children.splice(index, 1), children.push(child), UIManager.manageChildren(parentInstance._nativeTag, [ index ], [ children.length - 1 ], [], [], [])) : (children.push(child), - UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ children.length - 1 ], [])); - } + UIManager.setChildren(parentInstance, [ childTag ]); }, appendInitialChild: function(parentInstance, child) { parentInstance._children.push(child); @@ -3526,7 +3533,6 @@ var NativeRenderer = ReactFiberReconciler({ return instance; }, insertBefore: function(parentInstance, child, beforeChild) { - invariant("number" != typeof parentInstance, "Container does not support insertBefore operation"); var children = parentInstance._children, index = children.indexOf(child); if (index >= 0) { children.splice(index, 1); @@ -3539,22 +3545,26 @@ var NativeRenderer = ReactFiberReconciler({ UIManager.manageChildren(parentInstance._nativeTag, [], [], [ childTag ], [ _beforeChildIndex ], []); } }, + insertInContainerBefore: function(parentInstance, child, beforeChild) { + invariant("number" != typeof parentInstance, "Container does not support insertBefore operation"); + }, prepareForCommit: function() {}, prepareUpdate: function(instance, type, oldProps, newProps, rootContainerInstance, hostContext) { return emptyObject; }, removeChild: function(parentInstance, child) { - if (recursivelyUncacheFiberNode(child), "number" == typeof parentInstance) UIManager.manageChildren(parentInstance, [], [], [], [], [ 0 ]); else { - var children = parentInstance._children, index = children.indexOf(child); - children.splice(index, 1), UIManager.manageChildren(parentInstance._nativeTag, [], [], [], [], [ index ]); - } + recursivelyUncacheFiberNode(child); + var children = parentInstance._children, index = children.indexOf(child); + children.splice(index, 1), UIManager.manageChildren(parentInstance._nativeTag, [], [], [], [], [ index ]); + }, + removeChildFromContainer: function(parentInstance, child) { + recursivelyUncacheFiberNode(child), UIManager.manageChildren(parentInstance, [], [], [], [], [ 0 ]); }, resetAfterCommit: function() {}, resetTextContent: function(instance) {}, shouldDeprioritizeSubtree: function(type, props) { return !1; }, - scheduleAnimationCallback: commonjsGlobal.requestAnimationFrame, scheduleDeferredCallback: commonjsGlobal.requestIdleCallback, shouldSetTextContent: function(type, props) { return !1; @@ -3568,12 +3578,7 @@ getInspectorDataForViewTag = function() { var ReactNativeFiberInspector = { getInspectorDataForViewTag: getInspectorDataForViewTag -}, ReactVersion = "16.0.0-alpha.13", ReactNativeFeatureFlags$2 = { - useFiber: !0 -}, ReactNativeFeatureFlags_1 = ReactNativeFeatureFlags$2, ReactNativeFeatureFlags$3 = Object.freeze({ - default: ReactNativeFeatureFlags_1, - __moduleExports: ReactNativeFeatureFlags_1 -}), ReactNativeFeatureFlags$1 = ReactNativeFeatureFlags$3 && ReactNativeFeatureFlags_1 || ReactNativeFeatureFlags$3, injectedFindNode = ReactNativeFeatureFlags$1.useFiber ? function(fiber) { +}, ReactVersion = "16.0.0-alpha.13", ReactNativeFeatureFlags = require("ReactNativeFeatureFlags"), injectedFindNode = ReactNativeFeatureFlags.useFiber ? function(fiber) { return ReactNativeFiberRenderer.findHostInstance(fiber); } : function(instance) { return instance; @@ -3613,7 +3618,7 @@ function _inherits(subClass, superClass) { }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } -var mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) { +var ReactNativeFeatureFlags$1 = require("ReactNativeFeatureFlags"), mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, ReactNativeComponent = function(_React$Component) { _inherits(ReactNativeComponent, _React$Component); function ReactNativeComponent() { return _classCallCheck$2(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); @@ -3661,7 +3666,7 @@ var injectedSetNativeProps = void 0; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; -var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { +var ReactNativeComponent_1 = ReactNativeComponent, ReactNativeFeatureFlags$2 = require("ReactNativeFeatureFlags"), mountSafeCallback$3 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$2.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim, NativeMethodsMixin = { measure: function(callback) { UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$3(this, callback)); }, @@ -3708,7 +3713,7 @@ function setNativePropsStack$1(componentOrHandle, nativeProps) { var injectedSetNativeProps$1 = void 0; -injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; +injectedSetNativeProps$1 = ReactNativeFeatureFlags$2.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { @@ -3745,7 +3750,7 @@ var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { noCentroid: -1 }, TouchHistoryMath_1 = TouchHistoryMath, createReactNativeComponentClassFiber = function(viewConfig) { return ReactNativeViewConfigRegistry_1.register(viewConfig); -}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; +}, createReactNativeComponentClassFiber_1 = createReactNativeComponentClassFiber, ReactNativeFeatureFlags$3 = require("ReactNativeFeatureFlags"), createReactNativeComponentClass = ReactNativeFeatureFlags$3.useFiber ? createReactNativeComponentClassFiber_1 : DevOnlyStubShim, ReactNativeFeatureFlags$4 = require("ReactNativeFeatureFlags"), findNumericNodeHandle$2 = ReactNativeFeatureFlags$4.useFiber ? findNumericNodeHandleFiber : DevOnlyStubShim; function takeSnapshot(view, options) { return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), @@ -3760,7 +3765,7 @@ var roots = new Map(); ReactFiberErrorLogger.injection.injectDialog(ReactNativeFiberErrorDialog_1.showDialog); -var ReactNative = { +var ReactNativeFiber = { NativeComponent: ReactNativeComponent_1, findNodeHandle: findNumericNodeHandleFiber, render: function(element, containerTag, callback) { @@ -3775,7 +3780,7 @@ var ReactNative = { }); }, unmountComponentAtNodeAndRemoveContainer: function(containerTag) { - ReactNative.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); + ReactNativeFiber.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); }, unstable_createPortal: function(children, containerTag) { var key = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : null; @@ -3801,6 +3806,6 @@ var ReactNative = { version: ReactVersion }); -var ReactNativeFiber = ReactNative; +var ReactNativeFiberEntry = ReactNativeFiber; -module.exports = ReactNativeFiber; +module.exports = ReactNativeFiberEntry; diff --git a/Libraries/Renderer/ReactNativeStack-dev.js b/Libraries/Renderer/ReactNativeStack-dev.js index 89d37a42b87..eded96cc2cd 100644 --- a/Libraries/Renderer/ReactNativeStack-dev.js +++ b/Libraries/Renderer/ReactNativeStack-dev.js @@ -11,3298 +11,3028 @@ */ "use strict"; -var invariant = require("fbjs/lib/invariant"); - -require("InitializeCore"); - -var warning = require("fbjs/lib/warning"), RCTEventEmitter = require("RCTEventEmitter"), emptyFunction = require("fbjs/lib/emptyFunction"), UIManager = require("UIManager"), React = require("react"), ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), emptyObject = require("fbjs/lib/emptyObject"), checkPropTypes = require("prop-types/checkPropTypes"), shallowEqual = require("fbjs/lib/shallowEqual"); - -require("ReactNativeFeatureFlags"); - -var deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"), deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInDev"), instanceCache = {}, instanceProps = {}; - -function getRenderedHostOrTextFromComponent(component) { - for (var rendered; rendered = component._renderedComponent; ) component = rendered; - return component; -} - -function precacheNode(inst, tag) { - var nativeInst = getRenderedHostOrTextFromComponent(inst); - instanceCache[tag] = nativeInst; -} - -function precacheFiberNode(hostInst, tag) { - instanceCache[tag] = hostInst; -} - -function uncacheNode(inst) { - var tag = inst._rootNodeID; - tag && delete instanceCache[tag]; -} - -function uncacheFiberNode(tag) { - delete instanceCache[tag], delete instanceProps[tag]; -} - -function getInstanceFromTag(tag) { - return instanceCache[tag] || null; -} - -function getTagFromInstance(inst) { - var tag = "number" != typeof inst.tag ? inst._rootNodeID : inst.stateNode._nativeTag; - return invariant(tag, "All native instances should have a tag."), tag; -} - -function getFiberCurrentPropsFromNode(stateNode) { - return instanceProps[stateNode._nativeTag] || null; -} - -function updateFiberProps(tag, props) { - instanceProps[tag] = props; -} - -var ReactNativeComponentTree = { - getClosestInstanceFromNode: getInstanceFromTag, - getInstanceFromNode: getInstanceFromTag, - getNodeFromInstance: getTagFromInstance, - precacheFiberNode: precacheFiberNode, - precacheNode: precacheNode, - uncacheFiberNode: uncacheFiberNode, - uncacheNode: uncacheNode, - getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode, - updateFiberProps: updateFiberProps -}, ReactNativeComponentTree_1 = ReactNativeComponentTree, eventPluginOrder = null, namesToPlugins = {}; - -function recomputePluginOrdering() { - if (eventPluginOrder) for (var pluginName in namesToPlugins) { - var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); - if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), - !EventPluginRegistry.plugins[pluginIndex]) { - invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), - EventPluginRegistry.plugins[pluginIndex] = pluginModule; - var publishedEvents = pluginModule.eventTypes; - for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); - } +if (__DEV__) { + var invariant = require("fbjs/lib/invariant"); + require("InitializeCore"); + var warning = require("fbjs/lib/warning"), RCTEventEmitter = require("RCTEventEmitter"), emptyFunction = require("fbjs/lib/emptyFunction"), UIManager = require("UIManager"), React = require("react"), ExecutionEnvironment = require("fbjs/lib/ExecutionEnvironment"), performanceNow = require("fbjs/lib/performanceNow"), emptyObject = require("fbjs/lib/emptyObject"), checkPropTypes = require("prop-types/checkPropTypes"), shallowEqual = require("fbjs/lib/shallowEqual"), deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"), deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInDev"), instanceCache = {}, instanceProps = {}; + function getRenderedHostOrTextFromComponent(component) { + for (var rendered; rendered = component._renderedComponent; ) component = rendered; + return component; } -} - -function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { - invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), - EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; - var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; - if (phasedRegistrationNames) { - for (var phaseName in phasedRegistrationNames) if (phasedRegistrationNames.hasOwnProperty(phaseName)) { - var phasedRegistrationName = phasedRegistrationNames[phaseName]; - publishRegistrationName(phasedRegistrationName, pluginModule, eventName); - } - return !0; + function precacheNode(inst, tag) { + var nativeInst = getRenderedHostOrTextFromComponent(inst); + instanceCache[tag] = nativeInst; } - return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), - !0); -} - -function publishRegistrationName(registrationName, pluginModule, eventName) { - invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), - EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; - var lowerCasedName = registrationName.toLowerCase(); - EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, - "onDoubleClick" === registrationName && (EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName); -} - -var EventPluginRegistry = { - plugins: [], - eventNameDispatchConfigs: {}, - registrationNameModules: {}, - registrationNameDependencies: {}, - possibleRegistrationNames: {}, - injectEventPluginOrder: function(injectedEventPluginOrder) { - invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), - eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); - }, - injectEventPluginsByName: function(injectedNamesToPlugins) { - var isOrderingDirty = !1; - for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { - var pluginModule = injectedNamesToPlugins[pluginName]; - namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), - namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); - } - isOrderingDirty && recomputePluginOrdering(); + function precacheFiberNode(hostInst, tag) { + instanceCache[tag] = hostInst; } -}, EventPluginRegistry_1 = EventPluginRegistry, caughtError = null, invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { - var funcArgs = Array.prototype.slice.call(arguments, 3); - try { - func.apply(context, funcArgs); - } catch (error) { - return error; + function uncacheNode(inst) { + var tag = inst._rootNodeID; + tag && delete instanceCache[tag]; } - return null; -}; - -if ("undefined" != typeof window && "function" == typeof window.dispatchEvent && "undefined" != typeof document && "function" == typeof document.createEvent) { - var fakeNode = document.createElement("react"), depth = 0; - invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { - depth++; - var thisDepth = depth, funcArgs = Array.prototype.slice.call(arguments, 3), boundFunc = function() { - func.apply(context, funcArgs); - }, fakeEventError = null, onFakeEventError = function(event) { - depth === thisDepth && (fakeEventError = event.error); - }, evtType = "react-" + (name || "invokeguardedcallback") + "-" + depth; - window.addEventListener("error", onFakeEventError), fakeNode.addEventListener(evtType, boundFunc, !1); - var evt = document.createEvent("Event"); - return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), - window.removeEventListener("error", onFakeEventError), depth--, fakeEventError; - }; -} - -var rethrowCaughtError = function() { - if (caughtError) { - var error = caughtError; - throw caughtError = null, error; + function uncacheFiberNode(tag) { + delete instanceCache[tag], delete instanceProps[tag]; } -}, ReactErrorUtils = { - injection: { - injectErrorUtils: function(injectedErrorUtils) { - invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), - invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; - } - }, - invokeGuardedCallback: function(name, func, context, a, b, c, d, e, f) { - return invokeGuardedCallback.apply(this, arguments); - }, - invokeGuardedCallbackAndCatchFirstError: function(name, func, context, a, b, c, d, e, f) { - var error = ReactErrorUtils.invokeGuardedCallback.apply(this, arguments); - null !== error && null === caughtError && (caughtError = error); - }, - rethrowCaughtError: function() { - return rethrowCaughtError.apply(this, arguments); + function getInstanceFromTag(tag) { + return instanceCache[tag] || null; } -}, ReactErrorUtils_1 = ReactErrorUtils, ComponentTree, injection = { - injectComponentTree: function(Injected) { - ComponentTree = Injected, warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, "EventPluginUtils.injection.injectComponentTree(...): Injected " + "module is missing getNodeFromInstance or getInstanceFromNode."); + function getTagFromInstance(inst) { + var tag = "number" != typeof inst.tag ? inst._rootNodeID : inst.stateNode._nativeTag; + return invariant(tag, "All native instances should have a tag."), tag; } -}; - -function isEndish(topLevelType) { - return "topMouseUp" === topLevelType || "topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType; -} - -function isMoveish(topLevelType) { - return "topMouseMove" === topLevelType || "topTouchMove" === topLevelType; -} - -function isStartish(topLevelType) { - return "topMouseDown" === topLevelType || "topTouchStart" === topLevelType; -} - -var validateEventDispatches; - -validateEventDispatches = function(event) { - var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances, listenersIsArr = Array.isArray(dispatchListeners), listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0, instancesIsArr = Array.isArray(dispatchInstances), instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; - warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, "EventPluginUtils: Invalid `event`."); -}; - -function executeDispatch(event, simulated, listener, inst) { - var type = event.type || "unknown-event"; - event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), - event.currentTarget = null; -} - -function executeDispatchesInOrder(event, simulated) { - var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; - if (validateEventDispatches(event), Array.isArray(dispatchListeners)) for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); else dispatchListeners && executeDispatch(event, simulated, dispatchListeners, dispatchInstances); - event._dispatchListeners = null, event._dispatchInstances = null; -} - -function executeDispatchesInOrderStopAtTrueImpl(event) { - var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; - if (validateEventDispatches(event), Array.isArray(dispatchListeners)) { - for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) if (dispatchListeners[i](event, dispatchInstances[i])) return dispatchInstances[i]; - } else if (dispatchListeners && dispatchListeners(event, dispatchInstances)) return dispatchInstances; - return null; -} - -function executeDispatchesInOrderStopAtTrue(event) { - var ret = executeDispatchesInOrderStopAtTrueImpl(event); - return event._dispatchInstances = null, event._dispatchListeners = null, ret; -} - -function executeDirectDispatch(event) { - validateEventDispatches(event); - var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; - invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), - event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; - var res = dispatchListener ? dispatchListener(event) : null; - return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, - res; -} - -function hasDispatches(event) { - return !!event._dispatchListeners; -} - -var EventPluginUtils = { - isEndish: isEndish, - isMoveish: isMoveish, - isStartish: isStartish, - executeDirectDispatch: executeDirectDispatch, - executeDispatchesInOrder: executeDispatchesInOrder, - executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, - hasDispatches: hasDispatches, - getFiberCurrentPropsFromNode: function(node) { - return ComponentTree.getFiberCurrentPropsFromNode(node); - }, - getInstanceFromNode: function(node) { - return ComponentTree.getInstanceFromNode(node); - }, - getNodeFromInstance: function(node) { - return ComponentTree.getNodeFromInstance(node); - }, - injection: injection -}, EventPluginUtils_1 = EventPluginUtils; - -function accumulateInto(current, next) { - return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), - null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), - current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; -} - -var accumulateInto_1 = accumulateInto; - -function forEachAccumulated(arr, cb, scope) { - Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); -} - -var forEachAccumulated_1 = forEachAccumulated, eventQueue = null, executeDispatchesAndRelease = function(event, simulated) { - event && (EventPluginUtils_1.executeDispatchesInOrder(event, simulated), event.isPersistent() || event.constructor.release(event)); -}, executeDispatchesAndReleaseSimulated = function(e) { - return executeDispatchesAndRelease(e, !0); -}, executeDispatchesAndReleaseTopLevel = function(e) { - return executeDispatchesAndRelease(e, !1); -}; - -function isInteractive(tag) { - return "button" === tag || "input" === tag || "select" === tag || "textarea" === tag; -} - -function shouldPreventMouseEvent(name, type, props) { - switch (name) { - case "onClick": - case "onClickCapture": - case "onDoubleClick": - case "onDoubleClickCapture": - case "onMouseDown": - case "onMouseDownCapture": - case "onMouseMove": - case "onMouseMoveCapture": - case "onMouseUp": - case "onMouseUpCapture": - return !(!props.disabled || !isInteractive(type)); - - default: - return !1; + function getFiberCurrentPropsFromNode(stateNode) { + return instanceProps[stateNode._nativeTag] || null; } -} - -var EventPluginHub = { - injection: { - injectEventPluginOrder: EventPluginRegistry_1.injectEventPluginOrder, - injectEventPluginsByName: EventPluginRegistry_1.injectEventPluginsByName - }, - getListener: function(inst, registrationName) { - var listener; - if ("number" == typeof inst.tag) { - var stateNode = inst.stateNode; - if (!stateNode) return null; - var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(stateNode); - if (!props) return null; - if (listener = props[registrationName], shouldPreventMouseEvent(registrationName, inst.type, props)) return null; - } else { - var currentElement = inst._currentElement; - if ("string" == typeof currentElement || "number" == typeof currentElement) return null; - if (!inst._rootNodeID) return null; - var _props = currentElement.props; - if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; - } - return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), - listener; - }, - extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - for (var events, plugins = EventPluginRegistry_1.plugins, i = 0; i < plugins.length; i++) { - var possiblePlugin = plugins[i]; - if (possiblePlugin) { - var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); - extractedEvents && (events = accumulateInto_1(events, extractedEvents)); + function updateFiberProps(tag, props) { + instanceProps[tag] = props; + } + var ReactNativeComponentTree = { + getClosestInstanceFromNode: getInstanceFromTag, + getInstanceFromNode: getInstanceFromTag, + getNodeFromInstance: getTagFromInstance, + precacheFiberNode: precacheFiberNode, + precacheNode: precacheNode, + uncacheFiberNode: uncacheFiberNode, + uncacheNode: uncacheNode, + getFiberCurrentPropsFromNode: getFiberCurrentPropsFromNode, + updateFiberProps: updateFiberProps + }, ReactNativeComponentTree_1 = ReactNativeComponentTree, eventPluginOrder = null, namesToPlugins = {}; + function recomputePluginOrdering() { + if (eventPluginOrder) for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName], pluginIndex = eventPluginOrder.indexOf(pluginName); + if (invariant(pluginIndex > -1, "EventPluginRegistry: Cannot inject event plugins that do not exist in " + "the plugin ordering, `%s`.", pluginName), + !EventPluginRegistry.plugins[pluginIndex]) { + invariant(pluginModule.extractEvents, "EventPluginRegistry: Event plugins must implement an `extractEvents` " + "method, but `%s` does not.", pluginName), + EventPluginRegistry.plugins[pluginIndex] = pluginModule; + var publishedEvents = pluginModule.eventTypes; + for (var eventName in publishedEvents) invariant(publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName), "EventPluginRegistry: Failed to publish event `%s` for plugin `%s`.", eventName, pluginName); } } - return events; - }, - enqueueEvents: function(events) { - events && (eventQueue = accumulateInto_1(eventQueue, events)); - }, - processEventQueue: function(simulated) { - var processingEventQueue = eventQueue; - eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), - invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), - ReactErrorUtils_1.rethrowCaughtError(); } -}, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { - IndeterminateComponent: 0, - FunctionalComponent: 1, - ClassComponent: 2, - HostRoot: 3, - HostPortal: 4, - HostComponent: 5, - HostText: 6, - CoroutineComponent: 7, - CoroutineHandlerPhase: 8, - YieldComponent: 9, - Fragment: 10 -}, HostComponent = ReactTypeOfWork.HostComponent; - -function getParent(inst) { - if (void 0 !== inst._hostParent) return inst._hostParent; - if ("number" == typeof inst.tag) { - do { - inst = inst.return; - } while (inst && inst.tag !== HostComponent); - if (inst) return inst; + function publishEventForPlugin(dispatchConfig, pluginModule, eventName) { + invariant(!EventPluginRegistry.eventNameDispatchConfigs.hasOwnProperty(eventName), "EventPluginHub: More than one plugin attempted to publish the same " + "event name, `%s`.", eventName), + EventPluginRegistry.eventNameDispatchConfigs[eventName] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + if (phasedRegistrationNames) { + for (var phaseName in phasedRegistrationNames) if (phasedRegistrationNames.hasOwnProperty(phaseName)) { + var phasedRegistrationName = phasedRegistrationNames[phaseName]; + publishRegistrationName(phasedRegistrationName, pluginModule, eventName); + } + return !0; + } + return !!dispatchConfig.registrationName && (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName), + !0); } - return null; -} - -function getLowestCommonAncestor(instA, instB) { - for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA)) depthA++; - for (var depthB = 0, tempB = instB; tempB; tempB = getParent(tempB)) depthB++; - for (;depthA - depthB > 0; ) instA = getParent(instA), depthA--; - for (;depthB - depthA > 0; ) instB = getParent(instB), depthB--; - for (var depth = depthA; depth--; ) { - if (instA === instB || instA === instB.alternate) return instA; - instA = getParent(instA), instB = getParent(instB); + function publishRegistrationName(registrationName, pluginModule, eventName) { + invariant(!EventPluginRegistry.registrationNameModules[registrationName], "EventPluginHub: More than one plugin attempted to publish the same " + "registration name, `%s`.", registrationName), + EventPluginRegistry.registrationNameModules[registrationName] = pluginModule, EventPluginRegistry.registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies; + var lowerCasedName = registrationName.toLowerCase(); + EventPluginRegistry.possibleRegistrationNames[lowerCasedName] = registrationName, + "onDoubleClick" === registrationName && (EventPluginRegistry.possibleRegistrationNames.ondblclick = registrationName); } - return null; -} - -function isAncestor(instA, instB) { - for (;instB; ) { - if (instA === instB || instA === instB.alternate) return !0; - instB = getParent(instB); + var EventPluginRegistry = { + plugins: [], + eventNameDispatchConfigs: {}, + registrationNameModules: {}, + registrationNameDependencies: {}, + possibleRegistrationNames: {}, + injectEventPluginOrder: function(injectedEventPluginOrder) { + invariant(!eventPluginOrder, "EventPluginRegistry: Cannot inject event plugin ordering more than " + "once. You are likely trying to load more than one copy of React."), + eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder), recomputePluginOrdering(); + }, + injectEventPluginsByName: function(injectedNamesToPlugins) { + var isOrderingDirty = !1; + for (var pluginName in injectedNamesToPlugins) if (injectedNamesToPlugins.hasOwnProperty(pluginName)) { + var pluginModule = injectedNamesToPlugins[pluginName]; + namesToPlugins.hasOwnProperty(pluginName) && namesToPlugins[pluginName] === pluginModule || (invariant(!namesToPlugins[pluginName], "EventPluginRegistry: Cannot inject two different event plugins " + "using the same name, `%s`.", pluginName), + namesToPlugins[pluginName] = pluginModule, isOrderingDirty = !0); + } + isOrderingDirty && recomputePluginOrdering(); + } + }, EventPluginRegistry_1 = EventPluginRegistry, caughtError = null, invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + try { + func.apply(context, funcArgs); + } catch (error) { + return error; + } + return null; + }; + if ("undefined" != typeof window && "function" == typeof window.dispatchEvent && "undefined" != typeof document && "function" == typeof document.createEvent) { + var fakeNode = document.createElement("react"), depth = 0; + invokeGuardedCallback = function(name, func, context, a, b, c, d, e, f) { + depth++; + var thisDepth = depth, funcArgs = Array.prototype.slice.call(arguments, 3), boundFunc = function() { + func.apply(context, funcArgs); + }, fakeEventError = null, onFakeEventError = function(event) { + depth === thisDepth && (fakeEventError = event.error); + }, evtType = "react-" + (name || "invokeguardedcallback") + "-" + depth; + window.addEventListener("error", onFakeEventError), fakeNode.addEventListener(evtType, boundFunc, !1); + var evt = document.createEvent("Event"); + return evt.initEvent(evtType, !1, !1), fakeNode.dispatchEvent(evt), fakeNode.removeEventListener(evtType, boundFunc, !1), + window.removeEventListener("error", onFakeEventError), depth--, fakeEventError; + }; } - return !1; -} - -function getParentInstance(inst) { - return getParent(inst); -} - -function traverseTwoPhase(inst, fn, arg) { - for (var path = []; inst; ) path.push(inst), inst = getParent(inst); - var i; - for (i = path.length; i-- > 0; ) fn(path[i], "captured", arg); - for (i = 0; i < path.length; i++) fn(path[i], "bubbled", arg); -} - -function traverseEnterLeave(from, to, fn, argFrom, argTo) { - for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), - from = getParent(from); - for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); - var i; - for (i = 0; i < pathFrom.length; i++) fn(pathFrom[i], "bubbled", argFrom); - for (i = pathTo.length; i-- > 0; ) fn(pathTo[i], "captured", argTo); -} - -var ReactTreeTraversal = { - isAncestor: isAncestor, - getLowestCommonAncestor: getLowestCommonAncestor, - getParentInstance: getParentInstance, - traverseTwoPhase: traverseTwoPhase, - traverseEnterLeave: traverseEnterLeave -}, getListener = EventPluginHub_1.getListener; - -function listenerAtPhase(inst, event, propagationPhase) { - var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; - return getListener(inst, registrationName); -} - -function accumulateDirectionalDispatches(inst, phase, event) { - warning(inst, "Dispatching inst must not be null"); - var listener = listenerAtPhase(inst, event, phase); - listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), - event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); -} - -function accumulateTwoPhaseDispatchesSingle(event) { - event && event.dispatchConfig.phasedRegistrationNames && ReactTreeTraversal.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); -} - -function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { - if (event && event.dispatchConfig.phasedRegistrationNames) { - var targetInst = event._targetInst, parentInst = targetInst ? ReactTreeTraversal.getParentInstance(targetInst) : null; - ReactTreeTraversal.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); + var rethrowCaughtError = function() { + if (caughtError) { + var error = caughtError; + throw caughtError = null, error; + } + }, ReactErrorUtils = { + injection: { + injectErrorUtils: function(injectedErrorUtils) { + invariant("function" == typeof injectedErrorUtils.invokeGuardedCallback, "Injected invokeGuardedCallback() must be a function."), + invokeGuardedCallback = injectedErrorUtils.invokeGuardedCallback; + } + }, + invokeGuardedCallback: function(name, func, context, a, b, c, d, e, f) { + return invokeGuardedCallback.apply(this, arguments); + }, + invokeGuardedCallbackAndCatchFirstError: function(name, func, context, a, b, c, d, e, f) { + var error = ReactErrorUtils.invokeGuardedCallback.apply(this, arguments); + null !== error && null === caughtError && (caughtError = error); + }, + rethrowCaughtError: function() { + return rethrowCaughtError.apply(this, arguments); + } + }, ReactErrorUtils_1 = ReactErrorUtils, ComponentTree, injection = { + injectComponentTree: function(Injected) { + ComponentTree = Injected, warning(Injected && Injected.getNodeFromInstance && Injected.getInstanceFromNode, "EventPluginUtils.injection.injectComponentTree(...): Injected " + "module is missing getNodeFromInstance or getInstanceFromNode."); + } + }; + function isEndish(topLevelType) { + return "topMouseUp" === topLevelType || "topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType; } -} + function isMoveish(topLevelType) { + return "topMouseMove" === topLevelType || "topTouchMove" === topLevelType; + } + function isStartish(topLevelType) { + return "topMouseDown" === topLevelType || "topTouchStart" === topLevelType; + } + var validateEventDispatches; + validateEventDispatches = function(event) { + var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances, listenersIsArr = Array.isArray(dispatchListeners), listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0, instancesIsArr = Array.isArray(dispatchInstances), instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0; + warning(instancesIsArr === listenersIsArr && instancesLen === listenersLen, "EventPluginUtils: Invalid `event`."); + }; + function executeDispatch(event, simulated, listener, inst) { + var type = event.type || "unknown-event"; + event.currentTarget = EventPluginUtils.getNodeFromInstance(inst), ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(type, listener, void 0, event), + event.currentTarget = null; + } + function executeDispatchesInOrder(event, simulated) { + var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; + if (validateEventDispatches(event), Array.isArray(dispatchListeners)) for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) executeDispatch(event, simulated, dispatchListeners[i], dispatchInstances[i]); else dispatchListeners && executeDispatch(event, simulated, dispatchListeners, dispatchInstances); + event._dispatchListeners = null, event._dispatchInstances = null; + } + function executeDispatchesInOrderStopAtTrueImpl(event) { + var dispatchListeners = event._dispatchListeners, dispatchInstances = event._dispatchInstances; + if (validateEventDispatches(event), Array.isArray(dispatchListeners)) { + for (var i = 0; i < dispatchListeners.length && !event.isPropagationStopped(); i++) if (dispatchListeners[i](event, dispatchInstances[i])) return dispatchInstances[i]; + } else if (dispatchListeners && dispatchListeners(event, dispatchInstances)) return dispatchInstances; + return null; + } + function executeDispatchesInOrderStopAtTrue(event) { + var ret = executeDispatchesInOrderStopAtTrueImpl(event); + return event._dispatchInstances = null, event._dispatchListeners = null, ret; + } + function executeDirectDispatch(event) { + validateEventDispatches(event); + var dispatchListener = event._dispatchListeners, dispatchInstance = event._dispatchInstances; + invariant(!Array.isArray(dispatchListener), "executeDirectDispatch(...): Invalid `event`."), + event.currentTarget = dispatchListener ? EventPluginUtils.getNodeFromInstance(dispatchInstance) : null; + var res = dispatchListener ? dispatchListener(event) : null; + return event.currentTarget = null, event._dispatchListeners = null, event._dispatchInstances = null, + res; + } + function hasDispatches(event) { + return !!event._dispatchListeners; + } + var EventPluginUtils = { + isEndish: isEndish, + isMoveish: isMoveish, + isStartish: isStartish, + executeDirectDispatch: executeDirectDispatch, + executeDispatchesInOrder: executeDispatchesInOrder, + executeDispatchesInOrderStopAtTrue: executeDispatchesInOrderStopAtTrue, + hasDispatches: hasDispatches, + getFiberCurrentPropsFromNode: function(node) { + return ComponentTree.getFiberCurrentPropsFromNode(node); + }, + getInstanceFromNode: function(node) { + return ComponentTree.getInstanceFromNode(node); + }, + getNodeFromInstance: function(node) { + return ComponentTree.getNodeFromInstance(node); + }, + injection: injection + }, EventPluginUtils_1 = EventPluginUtils; + function accumulateInto(current, next) { + return invariant(null != next, "accumulateInto(...): Accumulated items must not be null or undefined."), + null == current ? next : Array.isArray(current) ? Array.isArray(next) ? (current.push.apply(current, next), + current) : (current.push(next), current) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; + } + var accumulateInto_1 = accumulateInto; + function forEachAccumulated(arr, cb, scope) { + Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); + } + var forEachAccumulated_1 = forEachAccumulated, eventQueue = null, executeDispatchesAndRelease = function(event, simulated) { + event && (EventPluginUtils_1.executeDispatchesInOrder(event, simulated), event.isPersistent() || event.constructor.release(event)); + }, executeDispatchesAndReleaseSimulated = function(e) { + return executeDispatchesAndRelease(e, !0); + }, executeDispatchesAndReleaseTopLevel = function(e) { + return executeDispatchesAndRelease(e, !1); + }; + function isInteractive(tag) { + return "button" === tag || "input" === tag || "select" === tag || "textarea" === tag; + } + function shouldPreventMouseEvent(name, type, props) { + switch (name) { + case "onClick": + case "onClickCapture": + case "onDoubleClick": + case "onDoubleClickCapture": + case "onMouseDown": + case "onMouseDownCapture": + case "onMouseMove": + case "onMouseMoveCapture": + case "onMouseUp": + case "onMouseUpCapture": + return !(!props.disabled || !isInteractive(type)); -function accumulateDispatches(inst, ignoredDirection, event) { - if (inst && event && event.dispatchConfig.registrationName) { - var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); + default: + return !1; + } + } + var EventPluginHub = { + injection: { + injectEventPluginOrder: EventPluginRegistry_1.injectEventPluginOrder, + injectEventPluginsByName: EventPluginRegistry_1.injectEventPluginsByName + }, + getListener: function(inst, registrationName) { + var listener; + if ("number" == typeof inst.tag) { + var stateNode = inst.stateNode; + if (!stateNode) return null; + var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(stateNode); + if (!props) return null; + if (listener = props[registrationName], shouldPreventMouseEvent(registrationName, inst.type, props)) return null; + } else { + var currentElement = inst._currentElement; + if ("string" == typeof currentElement || "number" == typeof currentElement) return null; + if (!inst._rootNodeID) return null; + var _props = currentElement.props; + if (listener = _props[registrationName], shouldPreventMouseEvent(registrationName, currentElement.type, _props)) return null; + } + return invariant(!listener || "function" == typeof listener, "Expected %s listener to be a function, instead got type %s", registrationName, typeof listener), + listener; + }, + extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + for (var events, plugins = EventPluginRegistry_1.plugins, i = 0; i < plugins.length; i++) { + var possiblePlugin = plugins[i]; + if (possiblePlugin) { + var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget); + extractedEvents && (events = accumulateInto_1(events, extractedEvents)); + } + } + return events; + }, + enqueueEvents: function(events) { + events && (eventQueue = accumulateInto_1(eventQueue, events)); + }, + processEventQueue: function(simulated) { + var processingEventQueue = eventQueue; + eventQueue = null, simulated ? forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseSimulated) : forEachAccumulated_1(processingEventQueue, executeDispatchesAndReleaseTopLevel), + invariant(!eventQueue, "processEventQueue(): Additional events were enqueued while processing " + "an event queue. Support for this has not yet been implemented."), + ReactErrorUtils_1.rethrowCaughtError(); + } + }, EventPluginHub_1 = EventPluginHub, ReactTypeOfWork = { + IndeterminateComponent: 0, + FunctionalComponent: 1, + ClassComponent: 2, + HostRoot: 3, + HostPortal: 4, + HostComponent: 5, + HostText: 6, + CoroutineComponent: 7, + CoroutineHandlerPhase: 8, + YieldComponent: 9, + Fragment: 10 + }, HostComponent = ReactTypeOfWork.HostComponent; + function getParent(inst) { + if (void 0 !== inst._hostParent) return inst._hostParent; + if ("number" == typeof inst.tag) { + do { + inst = inst.return; + } while (inst && inst.tag !== HostComponent); + if (inst) return inst; + } + return null; + } + function getLowestCommonAncestor(instA, instB) { + for (var depthA = 0, tempA = instA; tempA; tempA = getParent(tempA)) depthA++; + for (var depthB = 0, tempB = instB; tempB; tempB = getParent(tempB)) depthB++; + for (;depthA - depthB > 0; ) instA = getParent(instA), depthA--; + for (;depthB - depthA > 0; ) instB = getParent(instB), depthB--; + for (var depth = depthA; depth--; ) { + if (instA === instB || instA === instB.alternate) return instA; + instA = getParent(instA), instB = getParent(instB); + } + return null; + } + function isAncestor(instA, instB) { + for (;instB; ) { + if (instA === instB || instA === instB.alternate) return !0; + instB = getParent(instB); + } + return !1; + } + function getParentInstance(inst) { + return getParent(inst); + } + function traverseTwoPhase(inst, fn, arg) { + for (var path = []; inst; ) path.push(inst), inst = getParent(inst); + var i; + for (i = path.length; i-- > 0; ) fn(path[i], "captured", arg); + for (i = 0; i < path.length; i++) fn(path[i], "bubbled", arg); + } + function traverseEnterLeave(from, to, fn, argFrom, argTo) { + for (var common = from && to ? getLowestCommonAncestor(from, to) : null, pathFrom = []; from && from !== common; ) pathFrom.push(from), + from = getParent(from); + for (var pathTo = []; to && to !== common; ) pathTo.push(to), to = getParent(to); + var i; + for (i = 0; i < pathFrom.length; i++) fn(pathFrom[i], "bubbled", argFrom); + for (i = pathTo.length; i-- > 0; ) fn(pathTo[i], "captured", argTo); + } + var ReactTreeTraversal = { + isAncestor: isAncestor, + getLowestCommonAncestor: getLowestCommonAncestor, + getParentInstance: getParentInstance, + traverseTwoPhase: traverseTwoPhase, + traverseEnterLeave: traverseEnterLeave + }, getListener = EventPluginHub_1.getListener; + function listenerAtPhase(inst, event, propagationPhase) { + var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase]; + return getListener(inst, registrationName); + } + function accumulateDirectionalDispatches(inst, phase, event) { + warning(inst, "Dispatching inst must not be null"); + var listener = listenerAtPhase(inst, event, phase); listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } -} - -function accumulateDirectDispatchesSingle(event) { - event && event.dispatchConfig.registrationName && accumulateDispatches(event._targetInst, null, event); -} - -function accumulateTwoPhaseDispatches(events) { - forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingle); -} - -function accumulateTwoPhaseDispatchesSkipTarget(events) { - forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingleSkipTarget); -} - -function accumulateEnterLeaveDispatches(leave, enter, from, to) { - ReactTreeTraversal.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); -} - -function accumulateDirectDispatches(events) { - forEachAccumulated_1(events, accumulateDirectDispatchesSingle); -} - -var EventPropagators = { - accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, - accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, - accumulateDirectDispatches: accumulateDirectDispatches, - accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches -}, EventPropagators_1 = EventPropagators, oneArgumentPooler = function(copyFieldsFrom) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, copyFieldsFrom), instance; + function accumulateTwoPhaseDispatchesSingle(event) { + event && event.dispatchConfig.phasedRegistrationNames && ReactTreeTraversal.traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); } - return new Klass(copyFieldsFrom); -}, twoArgumentPooler = function(a1, a2) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, a1, a2), instance; - } - return new Klass(a1, a2); -}, threeArgumentPooler = function(a1, a2, a3) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, a1, a2, a3), instance; - } - return new Klass(a1, a2, a3); -}, fourArgumentPooler = function(a1, a2, a3, a4) { - var Klass = this; - if (Klass.instancePool.length) { - var instance = Klass.instancePool.pop(); - return Klass.call(instance, a1, a2, a3, a4), instance; - } - return new Klass(a1, a2, a3, a4); -}, standardReleaser = function(instance) { - var Klass = this; - invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), - instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); -}, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { - var NewKlass = CopyConstructor; - return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, - NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, - NewKlass; -}, PooledClass = { - addPoolingTo: addPoolingTo, - oneArgumentPooler: oneArgumentPooler, - twoArgumentPooler: twoArgumentPooler, - threeArgumentPooler: threeArgumentPooler, - fourArgumentPooler: fourArgumentPooler -}, PooledClass_1 = PooledClass, didWarnForAddedNewProperty = !1, isProxySupported = "function" == typeof Proxy, shouldBeReleasedProperties = [ "dispatchConfig", "_targetInst", "nativeEvent", "isDefaultPrevented", "isPropagationStopped", "_dispatchListeners", "_dispatchInstances" ], EventInterface = { - type: null, - target: null, - currentTarget: emptyFunction.thatReturnsNull, - eventPhase: null, - bubbles: null, - cancelable: null, - timeStamp: function(event) { - return event.timeStamp || Date.now(); - }, - defaultPrevented: null, - isTrusted: null -}; - -function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { - delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, - this.dispatchConfig = dispatchConfig, this._targetInst = targetInst, this.nativeEvent = nativeEvent; - var Interface = this.constructor.Interface; - for (var propName in Interface) if (Interface.hasOwnProperty(propName)) { - delete this[propName]; - var normalize = Interface[propName]; - normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; - } - var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; - return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, - this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; -} - -Object.assign(SyntheticEvent.prototype, { - preventDefault: function() { - this.defaultPrevented = !0; - var event = this.nativeEvent; - event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), - this.isDefaultPrevented = emptyFunction.thatReturnsTrue); - }, - stopPropagation: function() { - var event = this.nativeEvent; - event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), - this.isPropagationStopped = emptyFunction.thatReturnsTrue); - }, - persist: function() { - this.isPersistent = emptyFunction.thatReturnsTrue; - }, - isPersistent: emptyFunction.thatReturnsFalse, - destructor: function() { - var Interface = this.constructor.Interface; - for (var propName in Interface) Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); - for (var i = 0; i < shouldBeReleasedProperties.length; i++) this[shouldBeReleasedProperties[i]] = null; - Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), - Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), - Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", emptyFunction)); - } -}), SyntheticEvent.Interface = EventInterface, isProxySupported && (SyntheticEvent = new Proxy(SyntheticEvent, { - construct: function(target, args) { - return this.apply(target, Object.create(target.prototype), args); - }, - apply: function(constructor, that, args) { - return new Proxy(constructor.apply(that, args), { - set: function(target, prop, value) { - return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), - didWarnForAddedNewProperty = !0), target[prop] = value, !0; - } - }); - } -})), SyntheticEvent.augmentClass = function(Class, Interface) { - var Super = this, E = function() {}; - E.prototype = Super.prototype; - var prototype = new E(); - Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, - Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, - PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); -}, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); - -var SyntheticEvent_1 = SyntheticEvent; - -function getPooledWarningPropertyDefinition(propName, getVal) { - var isFunction = "function" == typeof getVal; - return { - configurable: !0, - set: set, - get: get - }; - function set(val) { - return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), - val; - } - function get() { - return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), - getVal; - } - function warn(action, result) { - warning(!1, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + "If you must keep the original synthetic event around, use event.persist(). " + "See https://fb.me/react-event-pooling for more information.", action, propName, result); - } -} - -var _extends = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); - } - return target; -}, customBubblingEventTypes = UIManager.customBubblingEventTypes, customDirectEventTypes = UIManager.customDirectEventTypes, allTypesByEventName = {}; - -for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; - -for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), -allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; - -var ReactNativeBridgeEventPlugin = { - eventTypes: _extends({}, customBubblingEventTypes, customDirectEventTypes), - extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], directDispatchConfig = customDirectEventTypes[topLevelType], event = SyntheticEvent_1.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); - if (bubbleDispatchConfig) EventPropagators_1.accumulateTwoPhaseDispatches(event); else { - if (!directDispatchConfig) return null; - EventPropagators_1.accumulateDirectDispatches(event); - } - return event; - } -}, ReactNativeBridgeEventPlugin_1 = ReactNativeBridgeEventPlugin; - -function runEventQueueInBatch(events) { - EventPluginHub_1.enqueueEvents(events), EventPluginHub_1.processEventQueue(!1); -} - -var ReactEventEmitterMixin = { - handleTopLevel: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - runEventQueueInBatch(EventPluginHub_1.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget)); - } -}, ReactEventEmitterMixin_1 = ReactEventEmitterMixin, INITIAL_TAG_COUNT = 1, ReactNativeTagHandles = { - tagsStartAt: INITIAL_TAG_COUNT, - tagCount: INITIAL_TAG_COUNT, - allocateTag: function() { - for (;this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount); ) ReactNativeTagHandles.tagCount++; - var tag = ReactNativeTagHandles.tagCount; - return ReactNativeTagHandles.tagCount++, tag; - }, - assertRootTag: function(tag) { - invariant(this.reactTagIsNativeTopRootID(tag), "Expect a native root tag, instead got %s", tag); - }, - reactTagIsNativeTopRootID: function(reactTag) { - return reactTag % 10 == 1; - } -}, ReactNativeTagHandles_1 = ReactNativeTagHandles, fiberHostComponent = null, ReactControlledComponentInjection = { - injectFiberControlledHostComponent: function(hostComponentImpl) { - fiberHostComponent = hostComponentImpl; - } -}, restoreTarget = null, restoreQueue = null; - -function restoreStateOfTarget(target) { - var internalInstance = EventPluginUtils_1.getInstanceFromNode(target); - if (internalInstance) { - if ("number" == typeof internalInstance.tag) { - invariant(fiberHostComponent && "function" == typeof fiberHostComponent.restoreControlledState, "Fiber needs to be injected to handle a fiber target for controlled " + "events."); - var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); - return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); - } - invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), - internalInstance.restoreControlledState(); - } -} - -var ReactControlledComponent = { - injection: ReactControlledComponentInjection, - enqueueStateRestore: function(target) { - restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [ target ] : restoreTarget = target; - }, - restoreStateIfNeeded: function() { - if (restoreTarget) { - var target = restoreTarget, queuedTargets = restoreQueue; - if (restoreTarget = null, restoreQueue = null, restoreStateOfTarget(target), queuedTargets) for (var i = 0; i < queuedTargets.length; i++) restoreStateOfTarget(queuedTargets[i]); + function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst, parentInst = targetInst ? ReactTreeTraversal.getParentInstance(targetInst) : null; + ReactTreeTraversal.traverseTwoPhase(parentInst, accumulateDirectionalDispatches, event); } } -}, ReactControlledComponent_1 = ReactControlledComponent, stackBatchedUpdates = function(fn, a, b, c, d, e) { - return fn(a, b, c, d, e); -}, fiberBatchedUpdates = function(fn, bookkeeping) { - return fn(bookkeeping); -}; - -function performFiberBatchedUpdates(fn, bookkeeping) { - return fiberBatchedUpdates(fn, bookkeeping); -} - -function batchedUpdates(fn, bookkeeping) { - return stackBatchedUpdates(performFiberBatchedUpdates, fn, bookkeeping); -} - -var isNestingBatched = !1; - -function batchedUpdatesWithControlledComponents(fn, bookkeeping) { - if (isNestingBatched) return batchedUpdates(fn, bookkeeping); - isNestingBatched = !0; - try { - return batchedUpdates(fn, bookkeeping); - } finally { - isNestingBatched = !1, ReactControlledComponent_1.restoreStateIfNeeded(); - } -} - -var ReactGenericBatchingInjection = { - injectStackBatchedUpdates: function(_batchedUpdates) { - stackBatchedUpdates = _batchedUpdates; - }, - injectFiberBatchedUpdates: function(_batchedUpdates) { - fiberBatchedUpdates = _batchedUpdates; - } -}, ReactGenericBatching = { - batchedUpdates: batchedUpdatesWithControlledComponents, - injection: ReactGenericBatchingInjection -}, ReactGenericBatching_1 = ReactGenericBatching, _extends$1 = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); - } - return target; -}, EMPTY_NATIVE_EVENT = {}, touchSubsequence = function(touches, indices) { - for (var ret = [], i = 0; i < indices.length; i++) ret.push(touches[indices[i]]); - return ret; -}, removeTouchesAtIndices = function(touches, indices) { - for (var rippedOut = [], temp = touches, i = 0; i < indices.length; i++) { - var index = indices[i]; - rippedOut.push(touches[index]), temp[index] = null; - } - for (var fillAt = 0, j = 0; j < temp.length; j++) { - var cur = temp[j]; - null !== cur && (temp[fillAt++] = cur); - } - return temp.length = fillAt, rippedOut; -}, ReactNativeEventEmitter = _extends$1({}, ReactEventEmitterMixin_1, { - registrationNames: EventPluginRegistry_1.registrationNameModules, - getListener: EventPluginHub_1.getListener, - _receiveRootNodeIDEvent: function(rootNodeID, topLevelType, nativeEventParam) { - var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT, inst = ReactNativeComponentTree_1.getInstanceFromNode(rootNodeID); - ReactGenericBatching_1.batchedUpdates(function() { - ReactNativeEventEmitter.handleTopLevel(topLevelType, inst, nativeEvent, nativeEvent.target); - }); - }, - receiveEvent: function(tag, topLevelType, nativeEventParam) { - var rootNodeID = tag; - ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); - }, - receiveTouches: function(eventTopLevelType, touches, changedIndices) { - for (var changedTouches = "topTouchEnd" === eventTopLevelType || "topTouchCancel" === eventTopLevelType ? removeTouchesAtIndices(touches, changedIndices) : touchSubsequence(touches, changedIndices), jj = 0; jj < changedTouches.length; jj++) { - var touch = changedTouches[jj]; - touch.changedTouches = changedTouches, touch.touches = touches; - var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; - null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), - ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); + function accumulateDispatches(inst, ignoredDirection, event) { + if (inst && event && event.dispatchConfig.registrationName) { + var registrationName = event.dispatchConfig.registrationName, listener = getListener(inst, registrationName); + listener && (event._dispatchListeners = accumulateInto_1(event._dispatchListeners, listener), + event._dispatchInstances = accumulateInto_1(event._dispatchInstances, inst)); } } -}), ReactNativeEventEmitter_1 = ReactNativeEventEmitter, ReactNativeEventPluginOrder = [ "ResponderEventPlugin", "ReactNativeBridgeEventPlugin" ], ReactNativeEventPluginOrder_1 = ReactNativeEventPluginOrder, ReactNativeGlobalResponderHandler = { - onChange: function(from, to, blockNativeResponder) { - if (null !== to) { - var tag = "number" != typeof to.tag ? to._rootNodeID : to.stateNode._nativeTag; - UIManager.setJSResponder(tag, blockNativeResponder); - } else UIManager.clearJSResponder(); + function accumulateDirectDispatchesSingle(event) { + event && event.dispatchConfig.registrationName && accumulateDispatches(event._targetInst, null, event); } -}, ReactNativeGlobalResponderHandler_1 = ReactNativeGlobalResponderHandler, ResponderEventInterface = { - touchHistory: function(nativeEvent) { - return null; + function accumulateTwoPhaseDispatches(events) { + forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingle); } -}; - -function ResponderSyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { - return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); -} - -SyntheticEvent_1.augmentClass(ResponderSyntheticEvent, ResponderEventInterface); - -var ResponderSyntheticEvent_1 = ResponderSyntheticEvent, isEndish$2 = EventPluginUtils_1.isEndish, isMoveish$2 = EventPluginUtils_1.isMoveish, isStartish$2 = EventPluginUtils_1.isStartish, MAX_TOUCH_BANK = 20, touchBank = [], touchHistory = { - touchBank: touchBank, - numberActiveTouches: 0, - indexOfSingleActiveTouch: -1, - mostRecentTimeStamp: 0 -}; - -function timestampForTouch(touch) { - return touch.timeStamp || touch.timestamp; -} - -function createTouchRecord(touch) { - return { - touchActive: !0, - startPageX: touch.pageX, - startPageY: touch.pageY, - startTimeStamp: timestampForTouch(touch), - currentPageX: touch.pageX, - currentPageY: touch.pageY, - currentTimeStamp: timestampForTouch(touch), - previousPageX: touch.pageX, - previousPageY: touch.pageY, - previousTimeStamp: timestampForTouch(touch) - }; -} - -function resetTouchRecord(touchRecord, touch) { - touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, - touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, - touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), - touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, - touchRecord.previousTimeStamp = timestampForTouch(touch); -} - -function getTouchIdentifier(_ref) { - var identifier = _ref.identifier; - return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), - identifier; -} - -function recordTouchStart(touch) { - var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; - touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), - touchHistory.mostRecentTimeStamp = timestampForTouch(touch); -} - -function recordTouchMove(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, - touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); -} - -function recordTouchEnd(touch) { - var touchRecord = touchBank[getTouchIdentifier(touch)]; - touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, - touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, - touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, - touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); -} - -function printTouch(touch) { - return JSON.stringify({ - identifier: touch.identifier, - pageX: touch.pageX, - pageY: touch.pageY, - timestamp: timestampForTouch(touch) - }); -} - -function printTouchBank() { - var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); - return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), - printed; -} - -var ResponderTouchHistoryStore = { - recordTouchTrack: function(topLevelType, nativeEvent) { - if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), - touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) { - for (var i = 0; i < touchBank.length; i++) { - var touchTrackToCheck = touchBank[i]; - if (null != touchTrackToCheck && touchTrackToCheck.touchActive) { - touchHistory.indexOfSingleActiveTouch = i; - break; - } - } - var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; - warning(null != activeRecord && activeRecord.touchActive, "Cannot find single active touch."); - } - }, - touchHistory: touchHistory -}, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; - -function accumulate(current, next) { - return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), - null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; -} - -var accumulate_1 = accumulate, isStartish$1 = EventPluginUtils_1.isStartish, isMoveish$1 = EventPluginUtils_1.isMoveish, isEndish$1 = EventPluginUtils_1.isEndish, executeDirectDispatch$1 = EventPluginUtils_1.executeDirectDispatch, hasDispatches$1 = EventPluginUtils_1.hasDispatches, executeDispatchesInOrderStopAtTrue$1 = EventPluginUtils_1.executeDispatchesInOrderStopAtTrue, responderInst = null, trackedTouchCount = 0, previousActiveTouches = 0, changeResponder = function(nextResponderInst, blockHostResponder) { - var oldResponderInst = responderInst; - responderInst = nextResponderInst, null !== ResponderEventPlugin.GlobalResponderHandler && ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); -}, eventTypes = { - startShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onStartShouldSetResponder", - captured: "onStartShouldSetResponderCapture" - } - }, - scrollShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onScrollShouldSetResponder", - captured: "onScrollShouldSetResponderCapture" - } - }, - selectionChangeShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onSelectionChangeShouldSetResponder", - captured: "onSelectionChangeShouldSetResponderCapture" - } - }, - moveShouldSetResponder: { - phasedRegistrationNames: { - bubbled: "onMoveShouldSetResponder", - captured: "onMoveShouldSetResponderCapture" - } - }, - responderStart: { - registrationName: "onResponderStart" - }, - responderMove: { - registrationName: "onResponderMove" - }, - responderEnd: { - registrationName: "onResponderEnd" - }, - responderRelease: { - registrationName: "onResponderRelease" - }, - responderTerminationRequest: { - registrationName: "onResponderTerminationRequest" - }, - responderGrant: { - registrationName: "onResponderGrant" - }, - responderReject: { - registrationName: "onResponderReject" - }, - responderTerminate: { - registrationName: "onResponderTerminate" + function accumulateTwoPhaseDispatchesSkipTarget(events) { + forEachAccumulated_1(events, accumulateTwoPhaseDispatchesSingleSkipTarget); } -}; - -function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); - shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); - var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); - if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), - !wantsResponderInst || wantsResponderInst === responderInst) return null; - var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); - grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); - var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); - if (responderInst) { - var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); - terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, - EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); - var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); - if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), - shouldSwitch) { - var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); - terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), - extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); - } else { - var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); - rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), - extracted = accumulate_1(extracted, rejectEvent); - } - } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); - return extracted; -} - -function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { - return topLevelInst && ("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && "topSelectionChange" === topLevelType || isStartish$1(topLevelType) || isMoveish$1(topLevelType)); -} - -function noResponderTouches(nativeEvent) { - var touches = nativeEvent.touches; - if (!touches || 0 === touches.length) return !0; - for (var i = 0; i < touches.length; i++) { - var activeTouch = touches[i], target = activeTouch.target; - if (null !== target && void 0 !== target && 0 !== target) { - var targetInst = EventPluginUtils_1.getInstanceFromNode(target); - if (ReactTreeTraversal.isAncestor(responderInst, targetInst)) return !1; - } + function accumulateEnterLeaveDispatches(leave, enter, from, to) { + ReactTreeTraversal.traverseEnterLeave(from, to, accumulateDispatches, leave, enter); } - return !0; -} - -var ResponderEventPlugin = { - _getResponder: function() { - return responderInst; - }, - eventTypes: eventTypes, - extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { - if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { - if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), - null; - trackedTouchCount -= 1; + function accumulateDirectDispatches(events) { + forEachAccumulated_1(events, accumulateDirectDispatchesSingle); + } + var EventPropagators = { + accumulateTwoPhaseDispatches: accumulateTwoPhaseDispatches, + accumulateTwoPhaseDispatchesSkipTarget: accumulateTwoPhaseDispatchesSkipTarget, + accumulateDirectDispatches: accumulateDirectDispatches, + accumulateEnterLeaveDispatches: accumulateEnterLeaveDispatches + }, EventPropagators_1 = EventPropagators, oneArgumentPooler = function(copyFieldsFrom) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, copyFieldsFrom), instance; } - ResponderTouchHistoryStore_1.recordTouchTrack(topLevelType, nativeEvent); - var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; - if (incrementalTouch) { - var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); - gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), - extracted = accumulate_1(extracted, gesture); + return new Klass(copyFieldsFrom); + }, twoArgumentPooler = function(a1, a2) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, a1, a2), instance; } - var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; - if (finalTouch) { - var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); - finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), - extracted = accumulate_1(extracted, finalEvent), changeResponder(null); + return new Klass(a1, a2); + }, threeArgumentPooler = function(a1, a2, a3) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, a1, a2, a3), instance; } - var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; - return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), - previousActiveTouches = numberActiveTouches, extracted; - }, - GlobalResponderHandler: null, - GlobalInteractionHandler: null, - injection: { - injectGlobalResponderHandler: function(GlobalResponderHandler) { - ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + return new Klass(a1, a2, a3); + }, fourArgumentPooler = function(a1, a2, a3, a4) { + var Klass = this; + if (Klass.instancePool.length) { + var instance = Klass.instancePool.pop(); + return Klass.call(instance, a1, a2, a3, a4), instance; + } + return new Klass(a1, a2, a3, a4); + }, standardReleaser = function(instance) { + var Klass = this; + invariant(instance instanceof Klass, "Trying to release an instance into a pool of a different type."), + instance.destructor(), Klass.instancePool.length < Klass.poolSize && Klass.instancePool.push(instance); + }, DEFAULT_POOL_SIZE = 10, DEFAULT_POOLER = oneArgumentPooler, addPoolingTo = function(CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + return NewKlass.instancePool = [], NewKlass.getPooled = pooler || DEFAULT_POOLER, + NewKlass.poolSize || (NewKlass.poolSize = DEFAULT_POOL_SIZE), NewKlass.release = standardReleaser, + NewKlass; + }, PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fourArgumentPooler: fourArgumentPooler + }, PooledClass_1 = PooledClass, didWarnForAddedNewProperty = !1, isProxySupported = "function" == typeof Proxy, shouldBeReleasedProperties = [ "dispatchConfig", "_targetInst", "nativeEvent", "isDefaultPrevented", "isPropagationStopped", "_dispatchListeners", "_dispatchInstances" ], EventInterface = { + type: null, + target: null, + currentTarget: emptyFunction.thatReturnsNull, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function(event) { + return event.timeStamp || Date.now(); }, - injectGlobalInteractionHandler: function(GlobalInteractionHandler) { - ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler; + defaultPrevented: null, + isTrusted: null + }; + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + delete this.nativeEvent, delete this.preventDefault, delete this.stopPropagation, + this.dispatchConfig = dispatchConfig, this._targetInst = targetInst, this.nativeEvent = nativeEvent; + var Interface = this.constructor.Interface; + for (var propName in Interface) if (Interface.hasOwnProperty(propName)) { + delete this[propName]; + var normalize = Interface[propName]; + normalize ? this[propName] = normalize(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]; + } + var defaultPrevented = null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : !1 === nativeEvent.returnValue; + return this.isDefaultPrevented = defaultPrevented ? emptyFunction.thatReturnsTrue : emptyFunction.thatReturnsFalse, + this.isPropagationStopped = emptyFunction.thatReturnsFalse, this; + } + Object.assign(SyntheticEvent.prototype, { + preventDefault: function() { + this.defaultPrevented = !0; + var event = this.nativeEvent; + event && (event.preventDefault ? event.preventDefault() : "unknown" != typeof event.returnValue && (event.returnValue = !1), + this.isDefaultPrevented = emptyFunction.thatReturnsTrue); + }, + stopPropagation: function() { + var event = this.nativeEvent; + event && (event.stopPropagation ? event.stopPropagation() : "unknown" != typeof event.cancelBubble && (event.cancelBubble = !0), + this.isPropagationStopped = emptyFunction.thatReturnsTrue); + }, + persist: function() { + this.isPersistent = emptyFunction.thatReturnsTrue; + }, + isPersistent: emptyFunction.thatReturnsFalse, + destructor: function() { + var Interface = this.constructor.Interface; + for (var propName in Interface) Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName])); + for (var i = 0; i < shouldBeReleasedProperties.length; i++) this[shouldBeReleasedProperties[i]] = null; + Object.defineProperty(this, "nativeEvent", getPooledWarningPropertyDefinition("nativeEvent", null)), + Object.defineProperty(this, "preventDefault", getPooledWarningPropertyDefinition("preventDefault", emptyFunction)), + Object.defineProperty(this, "stopPropagation", getPooledWarningPropertyDefinition("stopPropagation", emptyFunction)); + } + }), SyntheticEvent.Interface = EventInterface, isProxySupported && (SyntheticEvent = new Proxy(SyntheticEvent, { + construct: function(target, args) { + return this.apply(target, Object.create(target.prototype), args); + }, + apply: function(constructor, that, args) { + return new Proxy(constructor.apply(that, args), { + set: function(target, prop, value) { + return "isPersistent" === prop || target.constructor.Interface.hasOwnProperty(prop) || -1 !== shouldBeReleasedProperties.indexOf(prop) || (warning(didWarnForAddedNewProperty || target.isPersistent(), "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + "The property is never released. See " + "https://fb.me/react-event-pooling for more information."), + didWarnForAddedNewProperty = !0), target[prop] = value, !0; + } + }); + } + })), SyntheticEvent.augmentClass = function(Class, Interface) { + var Super = this, E = function() {}; + E.prototype = Super.prototype; + var prototype = new E(); + Object.assign(prototype, Class.prototype), Class.prototype = prototype, Class.prototype.constructor = Class, + Class.Interface = Object.assign({}, Super.Interface, Interface), Class.augmentClass = Super.augmentClass, + PooledClass_1.addPoolingTo(Class, PooledClass_1.fourArgumentPooler); + }, PooledClass_1.addPoolingTo(SyntheticEvent, PooledClass_1.fourArgumentPooler); + var SyntheticEvent_1 = SyntheticEvent; + function getPooledWarningPropertyDefinition(propName, getVal) { + var isFunction = "function" == typeof getVal; + return { + configurable: !0, + set: set, + get: get + }; + function set(val) { + return warn(isFunction ? "setting the method" : "setting the property", "This is effectively a no-op"), + val; + } + function get() { + return warn(isFunction ? "accessing the method" : "accessing the property", isFunction ? "This is a no-op function" : "This is set to null"), + getVal; + } + function warn(action, result) { + warning(!1, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + "If you must keep the original synthetic event around, use event.persist(). " + "See https://fb.me/react-event-pooling for more information.", action, propName, result); } } -}, ResponderEventPlugin_1 = ResponderEventPlugin; - -function inject() { - RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), - EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), - EventPluginHub_1.injection.injectEventPluginsByName({ - ResponderEventPlugin: ResponderEventPlugin_1, - ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 - }); -} - -var ReactNativeInjection = { - inject: inject -}, ReactInvalidSetStateWarningHook = {}, processingChildContext = !1, warnInvalidSetState = function() { - warning(!processingChildContext, "setState(...): Cannot call setState() inside getChildContext()"); -}; - -ReactInvalidSetStateWarningHook = { - onBeginProcessingChildContext: function() { - processingChildContext = !0; - }, - onEndProcessingChildContext: function() { - processingChildContext = !1; - }, - onSetState: function() { - warnInvalidSetState(); + var _extends = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + } + return target; + }, customBubblingEventTypes = UIManager.customBubblingEventTypes, customDirectEventTypes = UIManager.customDirectEventTypes, allTypesByEventName = {}; + for (var bubblingTypeName in customBubblingEventTypes) allTypesByEventName[bubblingTypeName] = customBubblingEventTypes[bubblingTypeName]; + for (var directTypeName in customDirectEventTypes) warning(!customBubblingEventTypes[directTypeName], "Event cannot be both direct and bubbling: %s", directTypeName), + allTypesByEventName[directTypeName] = customDirectEventTypes[directTypeName]; + var ReactNativeBridgeEventPlugin = { + eventTypes: _extends({}, customBubblingEventTypes, customDirectEventTypes), + extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], directDispatchConfig = customDirectEventTypes[topLevelType], event = SyntheticEvent_1.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); + if (bubbleDispatchConfig) EventPropagators_1.accumulateTwoPhaseDispatches(event); else { + if (!directDispatchConfig) return null; + EventPropagators_1.accumulateDirectDispatches(event); + } + return event; + } + }, ReactNativeBridgeEventPlugin_1 = ReactNativeBridgeEventPlugin; + function runEventQueueInBatch(events) { + EventPluginHub_1.enqueueEvents(events), EventPluginHub_1.processEventQueue(!1); } -}; - -var ReactInvalidSetStateWarningHook_1 = ReactInvalidSetStateWarningHook, ReactHostOperationHistoryHook = null, history = []; - -ReactHostOperationHistoryHook = { - onHostOperation: function(operation) { - history.push(operation); - }, - clearHistory: function() { - ReactHostOperationHistoryHook._preventClearing || (history = []); - }, - getHistory: function() { - return history; + var ReactEventEmitterMixin = { + handleTopLevel: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + runEventQueueInBatch(EventPluginHub_1.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget)); + } + }, ReactEventEmitterMixin_1 = ReactEventEmitterMixin, INITIAL_TAG_COUNT = 1, ReactNativeTagHandles = { + tagsStartAt: INITIAL_TAG_COUNT, + tagCount: INITIAL_TAG_COUNT, + allocateTag: function() { + for (;this.reactTagIsNativeTopRootID(ReactNativeTagHandles.tagCount); ) ReactNativeTagHandles.tagCount++; + var tag = ReactNativeTagHandles.tagCount; + return ReactNativeTagHandles.tagCount++, tag; + }, + assertRootTag: function(tag) { + invariant(this.reactTagIsNativeTopRootID(tag), "Expect a native root tag, instead got %s", tag); + }, + reactTagIsNativeTopRootID: function(reactTag) { + return reactTag % 10 == 1; + } + }, ReactNativeTagHandles_1 = ReactNativeTagHandles, fiberHostComponent = null, ReactControlledComponentInjection = { + injectFiberControlledHostComponent: function(hostComponentImpl) { + fiberHostComponent = hostComponentImpl; + } + }, restoreTarget = null, restoreQueue = null; + function restoreStateOfTarget(target) { + var internalInstance = EventPluginUtils_1.getInstanceFromNode(target); + if (internalInstance) { + if ("number" == typeof internalInstance.tag) { + invariant(fiberHostComponent && "function" == typeof fiberHostComponent.restoreControlledState, "Fiber needs to be injected to handle a fiber target for controlled " + "events."); + var props = EventPluginUtils_1.getFiberCurrentPropsFromNode(internalInstance.stateNode); + return void fiberHostComponent.restoreControlledState(internalInstance.stateNode, internalInstance.type, props); + } + invariant("function" == typeof internalInstance.restoreControlledState, "The internal instance must be a React host component."), + internalInstance.restoreControlledState(); + } } -}; - -var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = { - ReactCurrentOwner: ReactInternals.ReactCurrentOwner -}; - -Object.assign(ReactGlobalSharedState, { - ReactComponentTreeHook: ReactInternals.ReactComponentTreeHook, - ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame -}); - -var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactComponentTreeHook = ReactGlobalSharedState_1.ReactComponentTreeHook, ReactDebugTool$1 = null, hooks = [], didHookThrowForEvent = {}, callHook = function(event, fn, context, arg1, arg2, arg3, arg4, arg5) { - try { - fn.call(context, arg1, arg2, arg3, arg4, arg5); - } catch (e) { - warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), - didHookThrowForEvent[event] = !0; + var ReactControlledComponent = { + injection: ReactControlledComponentInjection, + enqueueStateRestore: function(target) { + restoreTarget ? restoreQueue ? restoreQueue.push(target) : restoreQueue = [ target ] : restoreTarget = target; + }, + restoreStateIfNeeded: function() { + if (restoreTarget) { + var target = restoreTarget, queuedTargets = restoreQueue; + if (restoreTarget = null, restoreQueue = null, restoreStateOfTarget(target), queuedTargets) for (var i = 0; i < queuedTargets.length; i++) restoreStateOfTarget(queuedTargets[i]); + } + } + }, ReactControlledComponent_1 = ReactControlledComponent, stackBatchedUpdates = function(fn, a, b, c, d, e) { + return fn(a, b, c, d, e); + }, fiberBatchedUpdates = function(fn, bookkeeping) { + return fn(bookkeeping); + }; + function performFiberBatchedUpdates(fn, bookkeeping) { + return fiberBatchedUpdates(fn, bookkeeping); } -}, emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) { - for (var i = 0; i < hooks.length; i++) { - var hook = hooks[i], fn = hook[event]; - fn && callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); + function batchedUpdates(fn, bookkeeping) { + return stackBatchedUpdates(performFiberBatchedUpdates, fn, bookkeeping); } -}, isProfiling = !1, flushHistory = [], lifeCycleTimerStack = [], currentFlushNesting = 0, currentFlushMeasurements = [], currentFlushStartTime = 0, currentTimerDebugID = null, currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerType = null, lifeCycleTimerHasWarned = !1, clearHistory = function() { - ReactComponentTreeHook.purgeUnmountedComponents(), ReactHostOperationHistoryHook_1.clearHistory(); -}, getTreeSnapshot = function(registeredIDs) { - return registeredIDs.reduce(function(tree, id) { - var ownerID = ReactComponentTreeHook.getOwnerID(id), parentID = ReactComponentTreeHook.getParentID(id); - return tree[id] = { - displayName: ReactComponentTreeHook.getDisplayName(id), - text: ReactComponentTreeHook.getText(id), - updateCount: ReactComponentTreeHook.getUpdateCount(id), - childIDs: ReactComponentTreeHook.getChildIDs(id), - ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, - parentID: parentID - }, tree; - }, {}); -}, resetMeasurements = function() { - var previousStartTime = currentFlushStartTime, previousMeasurements = currentFlushMeasurements, previousOperations = ReactHostOperationHistoryHook_1.getHistory(); - if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], - void clearHistory(); - if (previousMeasurements.length || previousOperations.length) { - var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); - flushHistory.push({ - duration: performanceNow() - previousStartTime, - measurements: previousMeasurements || [], - operations: previousOperations || [], - treeSnapshot: getTreeSnapshot(registeredIDs) + var isNestingBatched = !1; + function batchedUpdatesWithControlledComponents(fn, bookkeeping) { + if (isNestingBatched) return batchedUpdates(fn, bookkeeping); + isNestingBatched = !0; + try { + return batchedUpdates(fn, bookkeeping); + } finally { + isNestingBatched = !1, ReactControlledComponent_1.restoreStateIfNeeded(); + } + } + var ReactGenericBatchingInjection = { + injectStackBatchedUpdates: function(_batchedUpdates) { + stackBatchedUpdates = _batchedUpdates; + }, + injectFiberBatchedUpdates: function(_batchedUpdates) { + fiberBatchedUpdates = _batchedUpdates; + } + }, ReactGenericBatching = { + batchedUpdates: batchedUpdatesWithControlledComponents, + injection: ReactGenericBatchingInjection + }, ReactGenericBatching_1 = ReactGenericBatching, _extends$1 = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + } + return target; + }, EMPTY_NATIVE_EVENT = {}, touchSubsequence = function(touches, indices) { + for (var ret = [], i = 0; i < indices.length; i++) ret.push(touches[indices[i]]); + return ret; + }, removeTouchesAtIndices = function(touches, indices) { + for (var rippedOut = [], temp = touches, i = 0; i < indices.length; i++) { + var index = indices[i]; + rippedOut.push(touches[index]), temp[index] = null; + } + for (var fillAt = 0, j = 0; j < temp.length; j++) { + var cur = temp[j]; + null !== cur && (temp[fillAt++] = cur); + } + return temp.length = fillAt, rippedOut; + }, ReactNativeEventEmitter = _extends$1({}, ReactEventEmitterMixin_1, { + registrationNames: EventPluginRegistry_1.registrationNameModules, + getListener: EventPluginHub_1.getListener, + _receiveRootNodeIDEvent: function(rootNodeID, topLevelType, nativeEventParam) { + var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT, inst = ReactNativeComponentTree_1.getInstanceFromNode(rootNodeID); + ReactGenericBatching_1.batchedUpdates(function() { + ReactNativeEventEmitter.handleTopLevel(topLevelType, inst, nativeEvent, nativeEvent.target); + }); + }, + receiveEvent: function(tag, topLevelType, nativeEventParam) { + var rootNodeID = tag; + ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); + }, + receiveTouches: function(eventTopLevelType, touches, changedIndices) { + for (var changedTouches = "topTouchEnd" === eventTopLevelType || "topTouchCancel" === eventTopLevelType ? removeTouchesAtIndices(touches, changedIndices) : touchSubsequence(touches, changedIndices), jj = 0; jj < changedTouches.length; jj++) { + var touch = changedTouches[jj]; + touch.changedTouches = changedTouches, touch.touches = touches; + var nativeEvent = touch, rootNodeID = null, target = nativeEvent.target; + null !== target && void 0 !== target && (target < ReactNativeTagHandles_1.tagsStartAt ? warning(!1, "A view is reporting that a touch occurred on tag zero.") : rootNodeID = target), + ReactNativeEventEmitter._receiveRootNodeIDEvent(rootNodeID, eventTopLevelType, nativeEvent); + } + } + }), ReactNativeEventEmitter_1 = ReactNativeEventEmitter, ReactNativeEventPluginOrder = [ "ResponderEventPlugin", "ReactNativeBridgeEventPlugin" ], ReactNativeEventPluginOrder_1 = ReactNativeEventPluginOrder, ReactNativeGlobalResponderHandler = { + onChange: function(from, to, blockNativeResponder) { + if (null !== to) { + var tag = "number" != typeof to.tag ? to._rootNodeID : to.stateNode._nativeTag; + UIManager.setJSResponder(tag, blockNativeResponder); + } else UIManager.clearJSResponder(); + } + }, ReactNativeGlobalResponderHandler_1 = ReactNativeGlobalResponderHandler, ResponderEventInterface = { + touchHistory: function(nativeEvent) { + return null; + } + }; + function ResponderSyntheticEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) { + return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget); + } + SyntheticEvent_1.augmentClass(ResponderSyntheticEvent, ResponderEventInterface); + var ResponderSyntheticEvent_1 = ResponderSyntheticEvent, isEndish$2 = EventPluginUtils_1.isEndish, isMoveish$2 = EventPluginUtils_1.isMoveish, isStartish$2 = EventPluginUtils_1.isStartish, MAX_TOUCH_BANK = 20, touchBank = [], touchHistory = { + touchBank: touchBank, + numberActiveTouches: 0, + indexOfSingleActiveTouch: -1, + mostRecentTimeStamp: 0 + }; + function timestampForTouch(touch) { + return touch.timeStamp || touch.timestamp; + } + function createTouchRecord(touch) { + return { + touchActive: !0, + startPageX: touch.pageX, + startPageY: touch.pageY, + startTimeStamp: timestampForTouch(touch), + currentPageX: touch.pageX, + currentPageY: touch.pageY, + currentTimeStamp: timestampForTouch(touch), + previousPageX: touch.pageX, + previousPageY: touch.pageY, + previousTimeStamp: timestampForTouch(touch) + }; + } + function resetTouchRecord(touchRecord, touch) { + touchRecord.touchActive = !0, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, + touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, + touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), + touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, + touchRecord.previousTimeStamp = timestampForTouch(touch); + } + function getTouchIdentifier(_ref) { + var identifier = _ref.identifier; + return invariant(null != identifier, "Touch object is missing identifier."), warning(identifier <= MAX_TOUCH_BANK, "Touch identifier %s is greater than maximum supported %s which causes " + "performance issues backfilling array locations for all of the indices.", identifier, MAX_TOUCH_BANK), + identifier; + } + function recordTouchStart(touch) { + var identifier = getTouchIdentifier(touch), touchRecord = touchBank[identifier]; + touchRecord ? resetTouchRecord(touchRecord, touch) : touchBank[identifier] = createTouchRecord(touch), + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } + function recordTouchMove(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord ? (touchRecord.touchActive = !0, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch move without a touch start.\n" + "Touch Move: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + function recordTouchEnd(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord ? (touchRecord.touchActive = !1, touchRecord.previousPageX = touchRecord.currentPageX, + touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, + touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, + touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)) : console.error("Cannot record touch end without a touch start.\n" + "Touch End: %s\n", "Touch Bank: %s", printTouch(touch), printTouchBank()); + } + function printTouch(touch) { + return JSON.stringify({ + identifier: touch.identifier, + pageX: touch.pageX, + pageY: touch.pageY, + timestamp: timestampForTouch(touch) }); } - clearHistory(), currentFlushStartTime = performanceNow(), currentFlushMeasurements = []; -}, checkDebugID = function(debugID) { - arguments.length > 1 && void 0 !== arguments[1] && arguments[1] && 0 === debugID || debugID || warning(!1, "ReactDebugTool: debugID may not be empty."); -}, beginLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), - lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, - currentTimerDebugID = debugID, currentTimerType = timerType); -}, endLifeCycleTimer = function(debugID, timerType) { - 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), - lifeCycleTimerHasWarned = !0), isProfiling && currentFlushMeasurements.push({ - timerType: timerType, - instanceID: debugID, - duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration - }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, - currentTimerType = null); -}, pauseCurrentLifeCycleTimer = function() { - var currentTimer = { - startTime: currentTimerStartTime, - nestedFlushStartTime: performanceNow(), - debugID: currentTimerDebugID, - timerType: currentTimerType + function printTouchBank() { + var printed = JSON.stringify(touchBank.slice(0, MAX_TOUCH_BANK)); + return touchBank.length > MAX_TOUCH_BANK && (printed += " (original size: " + touchBank.length + ")"), + printed; + } + var ResponderTouchHistoryStore = { + recordTouchTrack: function(topLevelType, nativeEvent) { + if (isMoveish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove); else if (isStartish$2(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier); else if (isEndish$2(topLevelType) && (nativeEvent.changedTouches.forEach(recordTouchEnd), + touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches)) { + for (var i = 0; i < touchBank.length; i++) { + var touchTrackToCheck = touchBank[i]; + if (null != touchTrackToCheck && touchTrackToCheck.touchActive) { + touchHistory.indexOfSingleActiveTouch = i; + break; + } + } + var activeRecord = touchBank[touchHistory.indexOfSingleActiveTouch]; + warning(null != activeRecord && activeRecord.touchActive, "Cannot find single active touch."); + } + }, + touchHistory: touchHistory + }, ResponderTouchHistoryStore_1 = ResponderTouchHistoryStore; + function accumulate(current, next) { + return invariant(null != next, "accumulate(...): Accumulated items must be not be null or undefined."), + null == current ? next : Array.isArray(current) ? current.concat(next) : Array.isArray(next) ? [ current ].concat(next) : [ current, next ]; + } + var accumulate_1 = accumulate, isStartish$1 = EventPluginUtils_1.isStartish, isMoveish$1 = EventPluginUtils_1.isMoveish, isEndish$1 = EventPluginUtils_1.isEndish, executeDirectDispatch$1 = EventPluginUtils_1.executeDirectDispatch, hasDispatches$1 = EventPluginUtils_1.hasDispatches, executeDispatchesInOrderStopAtTrue$1 = EventPluginUtils_1.executeDispatchesInOrderStopAtTrue, responderInst = null, trackedTouchCount = 0, previousActiveTouches = 0, changeResponder = function(nextResponderInst, blockHostResponder) { + var oldResponderInst = responderInst; + responderInst = nextResponderInst, null !== ResponderEventPlugin.GlobalResponderHandler && ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); + }, eventTypes = { + startShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onStartShouldSetResponder", + captured: "onStartShouldSetResponderCapture" + } + }, + scrollShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onScrollShouldSetResponder", + captured: "onScrollShouldSetResponderCapture" + } + }, + selectionChangeShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onSelectionChangeShouldSetResponder", + captured: "onSelectionChangeShouldSetResponderCapture" + } + }, + moveShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onMoveShouldSetResponder", + captured: "onMoveShouldSetResponderCapture" + } + }, + responderStart: { + registrationName: "onResponderStart" + }, + responderMove: { + registrationName: "onResponderMove" + }, + responderEnd: { + registrationName: "onResponderEnd" + }, + responderRelease: { + registrationName: "onResponderRelease" + }, + responderTerminationRequest: { + registrationName: "onResponderTerminationRequest" + }, + responderGrant: { + registrationName: "onResponderGrant" + }, + responderReject: { + registrationName: "onResponderReject" + }, + responderTerminate: { + registrationName: "onResponderTerminate" + } }; - lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, - currentTimerDebugID = null, currentTimerType = null; -}, resumeCurrentLifeCycleTimer = function() { - var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), startTime = _lifeCycleTimerStack$.startTime, nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, debugID = _lifeCycleTimerStack$.debugID, timerType = _lifeCycleTimerStack$.timerType, nestedFlushDuration = performanceNow() - nestedFlushStartTime; - currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, - currentTimerDebugID = debugID, currentTimerType = timerType; -}, lastMarkTimeStamp = 0, canUsePerformanceMeasure = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, shouldMark = function(debugID) { - if (!isProfiling || !canUsePerformanceMeasure) return !1; - var element = ReactComponentTreeHook.getElement(debugID); - return null != element && "object" == typeof element && !("string" == typeof element.type); -}, markBegin = function(debugID, markType) { - if (shouldMark(debugID)) { - var markName = debugID + "::" + markType; - lastMarkTimeStamp = performanceNow(), performance.mark(markName); + function setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + var shouldSetEventType = isStartish$1(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish$1(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder, bubbleShouldSetFrom = responderInst ? ReactTreeTraversal.getLowestCommonAncestor(responderInst, targetInst) : targetInst, skipOverBubbleShouldSetFrom = bubbleShouldSetFrom === responderInst, shouldSetEvent = ResponderSyntheticEvent_1.getPooled(shouldSetEventType, bubbleShouldSetFrom, nativeEvent, nativeEventTarget); + shouldSetEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, skipOverBubbleShouldSetFrom ? EventPropagators_1.accumulateTwoPhaseDispatchesSkipTarget(shouldSetEvent) : EventPropagators_1.accumulateTwoPhaseDispatches(shouldSetEvent); + var wantsResponderInst = executeDispatchesInOrderStopAtTrue$1(shouldSetEvent); + if (shouldSetEvent.isPersistent() || shouldSetEvent.constructor.release(shouldSetEvent), + !wantsResponderInst || wantsResponderInst === responderInst) return null; + var extracted, grantEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderGrant, wantsResponderInst, nativeEvent, nativeEventTarget); + grantEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(grantEvent); + var blockHostResponder = !0 === executeDirectDispatch$1(grantEvent); + if (responderInst) { + var terminationRequestEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget); + terminationRequestEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, + EventPropagators_1.accumulateDirectDispatches(terminationRequestEvent); + var shouldSwitch = !hasDispatches$1(terminationRequestEvent) || executeDirectDispatch$1(terminationRequestEvent); + if (terminationRequestEvent.isPersistent() || terminationRequestEvent.constructor.release(terminationRequestEvent), + shouldSwitch) { + var terminateEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); + terminateEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(terminateEvent), + extracted = accumulate_1(extracted, [ grantEvent, terminateEvent ]), changeResponder(wantsResponderInst, blockHostResponder); + } else { + var rejectEvent = ResponderSyntheticEvent_1.getPooled(eventTypes.responderReject, wantsResponderInst, nativeEvent, nativeEventTarget); + rejectEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(rejectEvent), + extracted = accumulate_1(extracted, rejectEvent); + } + } else extracted = accumulate_1(extracted, grantEvent), changeResponder(wantsResponderInst, blockHostResponder); + return extracted; } -}, markEnd = function(debugID, markType) { - if (shouldMark(debugID)) { - var markName = debugID + "::" + markType, displayName = ReactComponentTreeHook.getDisplayName(debugID) || "Unknown"; - if (performanceNow() - lastMarkTimeStamp > .1) { - var measurementName = displayName + " [" + markType + "]"; - performance.measure(measurementName, markName); + function canTriggerTransfer(topLevelType, topLevelInst, nativeEvent) { + return topLevelInst && ("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll || trackedTouchCount > 0 && "topSelectionChange" === topLevelType || isStartish$1(topLevelType) || isMoveish$1(topLevelType)); + } + function noResponderTouches(nativeEvent) { + var touches = nativeEvent.touches; + if (!touches || 0 === touches.length) return !0; + for (var i = 0; i < touches.length; i++) { + var activeTouch = touches[i], target = activeTouch.target; + if (null !== target && void 0 !== target && 0 !== target) { + var targetInst = EventPluginUtils_1.getInstanceFromNode(target); + if (ReactTreeTraversal.isAncestor(responderInst, targetInst)) return !1; + } } - performance.clearMarks(markName), measurementName && performance.clearMeasures(measurementName); + return !0; } -}; - -ReactDebugTool$1 = { - addHook: function(hook) { - hooks.push(hook); - }, - removeHook: function(hook) { - for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), - i--); - }, - isProfiling: function() { - return isProfiling; - }, - beginProfiling: function() { - isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), - ReactDebugTool$1.addHook(ReactHostOperationHistoryHook_1)); - }, - endProfiling: function() { - isProfiling && (isProfiling = !1, resetMeasurements(), ReactDebugTool$1.removeHook(ReactHostOperationHistoryHook_1)); - }, - getFlushHistory: function() { - return flushHistory; - }, - onBeginFlush: function() { - currentFlushNesting++, resetMeasurements(), pauseCurrentLifeCycleTimer(), emitEvent("onBeginFlush"); - }, - onEndFlush: function() { - resetMeasurements(), currentFlushNesting--, resumeCurrentLifeCycleTimer(), emitEvent("onEndFlush"); - }, - onBeginLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), - beginLifeCycleTimer(debugID, timerType); - }, - onEndLifeCycleTimer: function(debugID, timerType) { - checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), - emitEvent("onEndLifeCycleTimer", debugID, timerType); - }, - onBeginProcessingChildContext: function() { - emitEvent("onBeginProcessingChildContext"); - }, - onEndProcessingChildContext: function() { - emitEvent("onEndProcessingChildContext"); - }, - onHostOperation: function(operation) { - checkDebugID(operation.instanceID), emitEvent("onHostOperation", operation); - }, - onSetState: function() { - emitEvent("onSetState"); - }, - onSetChildren: function(debugID, childDebugIDs) { - checkDebugID(debugID), childDebugIDs.forEach(checkDebugID), emitEvent("onSetChildren", debugID, childDebugIDs); - }, - onBeforeMountComponent: function(debugID, element, parentDebugID) { - checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), - markBegin(debugID, "mount"); - }, - onMountComponent: function(debugID) { - checkDebugID(debugID), markEnd(debugID, "mount"), emitEvent("onMountComponent", debugID); - }, - onBeforeUpdateComponent: function(debugID, element) { - checkDebugID(debugID), emitEvent("onBeforeUpdateComponent", debugID, element), markBegin(debugID, "update"); - }, - onUpdateComponent: function(debugID) { - checkDebugID(debugID), markEnd(debugID, "update"), emitEvent("onUpdateComponent", debugID); - }, - onBeforeUnmountComponent: function(debugID) { - checkDebugID(debugID), emitEvent("onBeforeUnmountComponent", debugID), markBegin(debugID, "unmount"); - }, - onUnmountComponent: function(debugID) { - checkDebugID(debugID), markEnd(debugID, "unmount"), emitEvent("onUnmountComponent", debugID); - }, - onTestEvent: function() { - emitEvent("onTestEvent"); + var ResponderEventPlugin = { + _getResponder: function() { + return responderInst; + }, + eventTypes: eventTypes, + extractEvents: function(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (isStartish$1(topLevelType)) trackedTouchCount += 1; else if (isEndish$1(topLevelType)) { + if (!(trackedTouchCount >= 0)) return console.error("Ended a touch event which was not counted in `trackedTouchCount`."), + null; + trackedTouchCount -= 1; + } + ResponderTouchHistoryStore_1.recordTouchTrack(topLevelType, nativeEvent); + var extracted = canTriggerTransfer(topLevelType, targetInst, nativeEvent) ? setResponderAndExtractTransfer(topLevelType, targetInst, nativeEvent, nativeEventTarget) : null, isResponderTouchStart = responderInst && isStartish$1(topLevelType), isResponderTouchMove = responderInst && isMoveish$1(topLevelType), isResponderTouchEnd = responderInst && isEndish$1(topLevelType), incrementalTouch = isResponderTouchStart ? eventTypes.responderStart : isResponderTouchMove ? eventTypes.responderMove : isResponderTouchEnd ? eventTypes.responderEnd : null; + if (incrementalTouch) { + var gesture = ResponderSyntheticEvent_1.getPooled(incrementalTouch, responderInst, nativeEvent, nativeEventTarget); + gesture.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(gesture), + extracted = accumulate_1(extracted, gesture); + } + var isResponderTerminate = responderInst && "topTouchCancel" === topLevelType, isResponderRelease = responderInst && !isResponderTerminate && isEndish$1(topLevelType) && noResponderTouches(nativeEvent), finalTouch = isResponderTerminate ? eventTypes.responderTerminate : isResponderRelease ? eventTypes.responderRelease : null; + if (finalTouch) { + var finalEvent = ResponderSyntheticEvent_1.getPooled(finalTouch, responderInst, nativeEvent, nativeEventTarget); + finalEvent.touchHistory = ResponderTouchHistoryStore_1.touchHistory, EventPropagators_1.accumulateDirectDispatches(finalEvent), + extracted = accumulate_1(extracted, finalEvent), changeResponder(null); + } + var numberActiveTouches = ResponderTouchHistoryStore_1.touchHistory.numberActiveTouches; + return ResponderEventPlugin.GlobalInteractionHandler && numberActiveTouches !== previousActiveTouches && ResponderEventPlugin.GlobalInteractionHandler.onChange(numberActiveTouches), + previousActiveTouches = numberActiveTouches, extracted; + }, + GlobalResponderHandler: null, + GlobalInteractionHandler: null, + injection: { + injectGlobalResponderHandler: function(GlobalResponderHandler) { + ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + }, + injectGlobalInteractionHandler: function(GlobalInteractionHandler) { + ResponderEventPlugin.GlobalInteractionHandler = GlobalInteractionHandler; + } + } + }, ResponderEventPlugin_1 = ResponderEventPlugin; + function inject() { + RCTEventEmitter.register(ReactNativeEventEmitter_1), EventPluginHub_1.injection.injectEventPluginOrder(ReactNativeEventPluginOrder_1), + EventPluginUtils_1.injection.injectComponentTree(ReactNativeComponentTree_1), ResponderEventPlugin_1.injection.injectGlobalResponderHandler(ReactNativeGlobalResponderHandler_1), + EventPluginHub_1.injection.injectEventPluginsByName({ + ResponderEventPlugin: ResponderEventPlugin_1, + ReactNativeBridgeEventPlugin: ReactNativeBridgeEventPlugin_1 + }); } -}, ReactDebugTool$1.addHook(ReactInvalidSetStateWarningHook_1), ReactDebugTool$1.addHook(ReactComponentTreeHook); - -var url = ExecutionEnvironment.canUseDOM && window.location.href || ""; - -/[?&]react_perf\b/.test(url) && ReactDebugTool$1.beginProfiling(); - -var ReactDebugTool_1 = ReactDebugTool$1, debugTool = null, ReactDebugTool = ReactDebugTool_1; - -debugTool = ReactDebugTool; - -var ReactInstrumentation = { - debugTool: debugTool -}; - -function ReactNativeContainerInfo(tag) { - return { - _tag: tag + var ReactNativeInjection = { + inject: inject + }, ReactInvalidSetStateWarningHook = {}, processingChildContext = !1, warnInvalidSetState = function() { + warning(!processingChildContext, "setState(...): Cannot call setState() inside getChildContext()"); }; -} - -var ReactNativeContainerInfo_1 = ReactNativeContainerInfo, ClassComponent = ReactTypeOfWork.ClassComponent; - -function isValidOwner(object) { - return !(!object || "function" != typeof object.attachRef || "function" != typeof object.detachRef); -} - -var ReactOwner = { - addComponentAsRefTo: function(component, ref, owner) { - if (owner && owner.tag === ClassComponent) { - var inst = owner.stateNode; - (inst.refs === emptyObject ? inst.refs = {} : inst.refs)[ref] = component.getPublicInstance(); - } else invariant(isValidOwner(owner), "addComponentAsRefTo(...): Only a ReactOwner can have refs. You might " + "be adding a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."), - owner.attachRef(ref, component); - }, - removeComponentAsRefFrom: function(component, ref, owner) { - if (owner && owner.tag === ClassComponent) { - var inst = owner.stateNode; - inst && inst.refs[ref] === component.getPublicInstance() && delete inst.refs[ref]; - } else { - invariant(isValidOwner(owner), "removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might " + "be removing a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."); - var ownerPublicInstance = owner.getPublicInstance(); - ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance() && owner.detachRef(ref); + ReactInvalidSetStateWarningHook = { + onBeginProcessingChildContext: function() { + processingChildContext = !0; + }, + onEndProcessingChildContext: function() { + processingChildContext = !1; + }, + onSetState: function() { + warnInvalidSetState(); } - } -}, ReactOwner_1 = ReactOwner, ReactCompositeComponentTypes$1 = { - ImpureClass: 0, - PureClass: 1, - StatelessFunctional: 2 -}, ReactRef = {}, ReactCompositeComponentTypes = ReactCompositeComponentTypes$1, _require$1 = ReactGlobalSharedState_1, ReactComponentTreeHook$1 = _require$1.ReactComponentTreeHook, warning$2 = warning, warnedAboutStatelessRefs = {}; - -function attachRef(ref, component, owner) { - if (component._compositeType === ReactCompositeComponentTypes.StatelessFunctional) { - var info = "", ownerName = void 0; - owner && ("function" == typeof owner.getName && (ownerName = owner.getName()), ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`.")); - var warningKey = ownerName || component._debugID, element = component._currentElement; - element && element._source && (warningKey = element._source.fileName + ":" + element._source.lineNumber), - warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, - warning$2(!1, "Stateless function components cannot be given refs. " + "Attempts to access this ref will fail.%s%s", info, ReactComponentTreeHook$1.getStackAddendumByID(component._debugID))); - } - "function" == typeof ref ? ref(component.getPublicInstance()) : ReactOwner_1.addComponentAsRefTo(component, ref, owner); -} - -function detachRef(ref, component, owner) { - "function" == typeof ref ? ref(null) : ReactOwner_1.removeComponentAsRefFrom(component, ref, owner); -} - -ReactRef.attachRefs = function(instance, element) { - if (null !== element && "object" == typeof element) { - var ref = element.ref; - null != ref && attachRef(ref, instance, element._owner); - } -}, ReactRef.shouldUpdateRefs = function(prevElement, nextElement) { - var prevRef = null, prevOwner = null; - null !== prevElement && "object" == typeof prevElement && (prevRef = prevElement.ref, - prevOwner = prevElement._owner); - var nextRef = null, nextOwner = null; - return null !== nextElement && "object" == typeof nextElement && (nextRef = nextElement.ref, - nextOwner = nextElement._owner), prevRef !== nextRef || "string" == typeof nextRef && nextOwner !== prevOwner; -}, ReactRef.detachRefs = function(instance, element) { - if (null !== element && "object" == typeof element) { - var ref = element.ref; - null != ref && detachRef(ref, instance, element._owner); - } -}; - -var ReactRef_1 = ReactRef; - -function attachRefs() { - ReactRef_1.attachRefs(this, this._currentElement); -} - -var ReactReconciler = { - mountComponent: function(internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) { - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); - var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID); - return internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID), - markup; - }, - getHostNode: function(internalInstance) { - return internalInstance.getHostNode(); - }, - unmountComponent: function(internalInstance, safely, skipLifecycle) { - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID), - ReactRef_1.detachRefs(internalInstance, internalInstance._currentElement), internalInstance.unmountComponent(safely, skipLifecycle), - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); - }, - receiveComponent: function(internalInstance, nextElement, transaction, context) { - var prevElement = internalInstance._currentElement; - if (nextElement !== prevElement || context !== internalInstance._context) { - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); - var refsChanged = ReactRef_1.shouldUpdateRefs(prevElement, nextElement); - refsChanged && ReactRef_1.detachRefs(internalInstance, prevElement), internalInstance.receiveComponent(nextElement, transaction, context), - refsChanged && internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); + }; + var ReactInvalidSetStateWarningHook_1 = ReactInvalidSetStateWarningHook, ReactHostOperationHistoryHook = null, history = []; + ReactHostOperationHistoryHook = { + onHostOperation: function(operation) { + history.push(operation); + }, + clearHistory: function() { + ReactHostOperationHistoryHook._preventClearing || (history = []); + }, + getHistory: function() { + return history; } - }, - performUpdateIfNecessary: function(internalInstance, transaction, updateBatchNumber) { - if (internalInstance._updateBatchNumber !== updateBatchNumber) return void warning(null == internalInstance._updateBatchNumber || internalInstance._updateBatchNumber === updateBatchNumber + 1, "performUpdateIfNecessary: Unexpected batch number (current %s, " + "pending %s)", updateBatchNumber, internalInstance._updateBatchNumber); - 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement), - internalInstance.performUpdateIfNecessary(transaction), 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); - } -}, ReactReconciler_1 = ReactReconciler, ReactInstanceMap = { - remove: function(key) { - key._reactInternalInstance = void 0; - }, - get: function(key) { - return key._reactInternalInstance; - }, - has: function(key) { - return void 0 !== key._reactInternalInstance; - }, - set: function(key, value) { - key._reactInternalInstance = value; - } -}, ReactInstanceMap_1 = ReactInstanceMap, OBSERVED_ERROR = {}, TransactionImpl = { - reinitializeTransaction: function() { - this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], - this._isInTransaction = !1; - }, - _isInTransaction: !1, - getTransactionWrappers: null, - isInTransaction: function() { - return !!this._isInTransaction; - }, - perform: function(method, scope, a, b, c, d, e, f) { - invariant(!this.isInTransaction(), "Transaction.perform(...): Cannot initialize a transaction when there " + "is already an outstanding transaction."); - var errorThrown, ret; + }; + var ReactHostOperationHistoryHook_1 = ReactHostOperationHistoryHook, ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, ReactGlobalSharedState = { + ReactCurrentOwner: ReactInternals.ReactCurrentOwner + }; + Object.assign(ReactGlobalSharedState, { + ReactComponentTreeHook: ReactInternals.ReactComponentTreeHook, + ReactDebugCurrentFrame: ReactInternals.ReactDebugCurrentFrame + }); + var ReactGlobalSharedState_1 = ReactGlobalSharedState, ReactComponentTreeHook = ReactGlobalSharedState_1.ReactComponentTreeHook, ReactDebugTool$1 = null, hooks = [], didHookThrowForEvent = {}, callHook = function(event, fn, context, arg1, arg2, arg3, arg4, arg5) { try { - this._isInTransaction = !0, errorThrown = !0, this.initializeAll(0), ret = method.call(scope, a, b, c, d, e, f), - errorThrown = !1; - } finally { - try { - if (errorThrown) try { - this.closeAll(0); - } catch (err) {} else this.closeAll(0); - } finally { - this._isInTransaction = !1; + fn.call(context, arg1, arg2, arg3, arg4, arg5); + } catch (e) { + warning(didHookThrowForEvent[event], "Exception thrown by hook while handling %s: %s", event, e + "\n" + e.stack), + didHookThrowForEvent[event] = !0; + } + }, emitEvent = function(event, arg1, arg2, arg3, arg4, arg5) { + for (var i = 0; i < hooks.length; i++) { + var hook = hooks[i], fn = hook[event]; + fn && callHook(event, fn, hook, arg1, arg2, arg3, arg4, arg5); + } + }, isProfiling = !1, flushHistory = [], lifeCycleTimerStack = [], currentFlushNesting = 0, currentFlushMeasurements = [], currentFlushStartTime = 0, currentTimerDebugID = null, currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerType = null, lifeCycleTimerHasWarned = !1, clearHistory = function() { + ReactComponentTreeHook.purgeUnmountedComponents(), ReactHostOperationHistoryHook_1.clearHistory(); + }, getTreeSnapshot = function(registeredIDs) { + return registeredIDs.reduce(function(tree, id) { + var ownerID = ReactComponentTreeHook.getOwnerID(id), parentID = ReactComponentTreeHook.getParentID(id); + return tree[id] = { + displayName: ReactComponentTreeHook.getDisplayName(id), + text: ReactComponentTreeHook.getText(id), + updateCount: ReactComponentTreeHook.getUpdateCount(id), + childIDs: ReactComponentTreeHook.getChildIDs(id), + ownerID: ownerID || parentID && ReactComponentTreeHook.getOwnerID(parentID) || 0, + parentID: parentID + }, tree; + }, {}); + }, resetMeasurements = function() { + var previousStartTime = currentFlushStartTime, previousMeasurements = currentFlushMeasurements, previousOperations = ReactHostOperationHistoryHook_1.getHistory(); + if (0 === currentFlushNesting) return currentFlushStartTime = 0, currentFlushMeasurements = [], + void clearHistory(); + if (previousMeasurements.length || previousOperations.length) { + var registeredIDs = ReactComponentTreeHook.getRegisteredIDs(); + flushHistory.push({ + duration: performanceNow() - previousStartTime, + measurements: previousMeasurements || [], + operations: previousOperations || [], + treeSnapshot: getTreeSnapshot(registeredIDs) + }); + } + clearHistory(), currentFlushStartTime = performanceNow(), currentFlushMeasurements = []; + }, checkDebugID = function(debugID) { + arguments.length > 1 && void 0 !== arguments[1] && arguments[1] && 0 === debugID || debugID || warning(!1, "ReactDebugTool: debugID may not be empty."); + }, beginLifeCycleTimer = function(debugID, timerType) { + 0 !== currentFlushNesting && (currentTimerType && !lifeCycleTimerHasWarned && (warning(!1, "There is an internal error in the React performance measurement code." + "\n\nDid not expect %s timer to start while %s timer is still in " + "progress for %s instance.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + lifeCycleTimerHasWarned = !0), currentTimerStartTime = performanceNow(), currentTimerNestedFlushDuration = 0, + currentTimerDebugID = debugID, currentTimerType = timerType); + }, endLifeCycleTimer = function(debugID, timerType) { + 0 !== currentFlushNesting && (currentTimerType === timerType || lifeCycleTimerHasWarned || (warning(!1, "There is an internal error in the React performance measurement code. " + "We did not expect %s timer to stop while %s timer is still in " + "progress for %s instance. Please report this as a bug in React.", timerType, currentTimerType || "no", debugID === currentTimerDebugID ? "the same" : "another"), + lifeCycleTimerHasWarned = !0), isProfiling && currentFlushMeasurements.push({ + timerType: timerType, + instanceID: debugID, + duration: performanceNow() - currentTimerStartTime - currentTimerNestedFlushDuration + }), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, currentTimerDebugID = null, + currentTimerType = null); + }, pauseCurrentLifeCycleTimer = function() { + var currentTimer = { + startTime: currentTimerStartTime, + nestedFlushStartTime: performanceNow(), + debugID: currentTimerDebugID, + timerType: currentTimerType + }; + lifeCycleTimerStack.push(currentTimer), currentTimerStartTime = 0, currentTimerNestedFlushDuration = 0, + currentTimerDebugID = null, currentTimerType = null; + }, resumeCurrentLifeCycleTimer = function() { + var _lifeCycleTimerStack$ = lifeCycleTimerStack.pop(), startTime = _lifeCycleTimerStack$.startTime, nestedFlushStartTime = _lifeCycleTimerStack$.nestedFlushStartTime, debugID = _lifeCycleTimerStack$.debugID, timerType = _lifeCycleTimerStack$.timerType, nestedFlushDuration = performanceNow() - nestedFlushStartTime; + currentTimerStartTime = startTime, currentTimerNestedFlushDuration += nestedFlushDuration, + currentTimerDebugID = debugID, currentTimerType = timerType; + }, lastMarkTimeStamp = 0, canUsePerformanceMeasure = "undefined" != typeof performance && "function" == typeof performance.mark && "function" == typeof performance.clearMarks && "function" == typeof performance.measure && "function" == typeof performance.clearMeasures, shouldMark = function(debugID) { + if (!isProfiling || !canUsePerformanceMeasure) return !1; + var element = ReactComponentTreeHook.getElement(debugID); + return null != element && "object" == typeof element && !("string" == typeof element.type); + }, markBegin = function(debugID, markType) { + if (shouldMark(debugID)) { + var markName = debugID + "::" + markType; + lastMarkTimeStamp = performanceNow(), performance.mark(markName); + } + }, markEnd = function(debugID, markType) { + if (shouldMark(debugID)) { + var markName = debugID + "::" + markType, displayName = ReactComponentTreeHook.getDisplayName(debugID) || "Unknown"; + if (performanceNow() - lastMarkTimeStamp > .1) { + var measurementName = displayName + " [" + markType + "]"; + performance.measure(measurementName, markName); + } + performance.clearMarks(markName), measurementName && performance.clearMeasures(measurementName); + } + }; + ReactDebugTool$1 = { + addHook: function(hook) { + hooks.push(hook); + }, + removeHook: function(hook) { + for (var i = 0; i < hooks.length; i++) hooks[i] === hook && (hooks.splice(i, 1), + i--); + }, + isProfiling: function() { + return isProfiling; + }, + beginProfiling: function() { + isProfiling || (isProfiling = !0, flushHistory.length = 0, resetMeasurements(), + ReactDebugTool$1.addHook(ReactHostOperationHistoryHook_1)); + }, + endProfiling: function() { + isProfiling && (isProfiling = !1, resetMeasurements(), ReactDebugTool$1.removeHook(ReactHostOperationHistoryHook_1)); + }, + getFlushHistory: function() { + return flushHistory; + }, + onBeginFlush: function() { + currentFlushNesting++, resetMeasurements(), pauseCurrentLifeCycleTimer(), emitEvent("onBeginFlush"); + }, + onEndFlush: function() { + resetMeasurements(), currentFlushNesting--, resumeCurrentLifeCycleTimer(), emitEvent("onEndFlush"); + }, + onBeginLifeCycleTimer: function(debugID, timerType) { + checkDebugID(debugID), emitEvent("onBeginLifeCycleTimer", debugID, timerType), markBegin(debugID, timerType), + beginLifeCycleTimer(debugID, timerType); + }, + onEndLifeCycleTimer: function(debugID, timerType) { + checkDebugID(debugID), endLifeCycleTimer(debugID, timerType), markEnd(debugID, timerType), + emitEvent("onEndLifeCycleTimer", debugID, timerType); + }, + onBeginProcessingChildContext: function() { + emitEvent("onBeginProcessingChildContext"); + }, + onEndProcessingChildContext: function() { + emitEvent("onEndProcessingChildContext"); + }, + onHostOperation: function(operation) { + checkDebugID(operation.instanceID), emitEvent("onHostOperation", operation); + }, + onSetState: function() { + emitEvent("onSetState"); + }, + onSetChildren: function(debugID, childDebugIDs) { + checkDebugID(debugID), childDebugIDs.forEach(checkDebugID), emitEvent("onSetChildren", debugID, childDebugIDs); + }, + onBeforeMountComponent: function(debugID, element, parentDebugID) { + checkDebugID(debugID), checkDebugID(parentDebugID, !0), emitEvent("onBeforeMountComponent", debugID, element, parentDebugID), + markBegin(debugID, "mount"); + }, + onMountComponent: function(debugID) { + checkDebugID(debugID), markEnd(debugID, "mount"), emitEvent("onMountComponent", debugID); + }, + onBeforeUpdateComponent: function(debugID, element) { + checkDebugID(debugID), emitEvent("onBeforeUpdateComponent", debugID, element), markBegin(debugID, "update"); + }, + onUpdateComponent: function(debugID) { + checkDebugID(debugID), markEnd(debugID, "update"), emitEvent("onUpdateComponent", debugID); + }, + onBeforeUnmountComponent: function(debugID) { + checkDebugID(debugID), emitEvent("onBeforeUnmountComponent", debugID), markBegin(debugID, "unmount"); + }, + onUnmountComponent: function(debugID) { + checkDebugID(debugID), markEnd(debugID, "unmount"), emitEvent("onUnmountComponent", debugID); + }, + onTestEvent: function() { + emitEvent("onTestEvent"); + } + }, ReactDebugTool$1.addHook(ReactInvalidSetStateWarningHook_1), ReactDebugTool$1.addHook(ReactComponentTreeHook); + var url = ExecutionEnvironment.canUseDOM && window.location.href || ""; + /[?&]react_perf\b/.test(url) && ReactDebugTool$1.beginProfiling(); + var ReactDebugTool_1 = ReactDebugTool$1, debugTool = null, ReactDebugTool = ReactDebugTool_1; + debugTool = ReactDebugTool; + var ReactInstrumentation = { + debugTool: debugTool + }; + function ReactNativeContainerInfo(tag) { + return { + _tag: tag + }; + } + var ReactNativeContainerInfo_1 = ReactNativeContainerInfo, ClassComponent = ReactTypeOfWork.ClassComponent; + function isValidOwner(object) { + return !(!object || "function" != typeof object.attachRef || "function" != typeof object.detachRef); + } + var ReactOwner = { + addComponentAsRefTo: function(component, ref, owner) { + if (owner && owner.tag === ClassComponent) { + var inst = owner.stateNode; + (inst.refs === emptyObject ? inst.refs = {} : inst.refs)[ref] = component.getPublicInstance(); + } else invariant(isValidOwner(owner), "addComponentAsRefTo(...): Only a ReactOwner can have refs. You might " + "be adding a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."), + owner.attachRef(ref, component); + }, + removeComponentAsRefFrom: function(component, ref, owner) { + if (owner && owner.tag === ClassComponent) { + var inst = owner.stateNode; + inst && inst.refs[ref] === component.getPublicInstance() && delete inst.refs[ref]; + } else { + invariant(isValidOwner(owner), "removeComponentAsRefFrom(...): Only a ReactOwner can have refs. You might " + "be removing a ref to a component that was not created inside a component's " + "`render` method, or you have multiple copies of React loaded " + "(details: https://fb.me/react-refs-must-have-owner)."); + var ownerPublicInstance = owner.getPublicInstance(); + ownerPublicInstance && ownerPublicInstance.refs[ref] === component.getPublicInstance() && owner.detachRef(ref); } } - return ret; - }, - initializeAll: function(startIndex) { - for (var transactionWrappers = this.transactionWrappers, i = startIndex; i < transactionWrappers.length; i++) { - var wrapper = transactionWrappers[i]; - try { - this.wrapperInitData[i] = OBSERVED_ERROR, this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; - } finally { - if (this.wrapperInitData[i] === OBSERVED_ERROR) try { - this.initializeAll(i + 1); - } catch (err) {} - } + }, ReactOwner_1 = ReactOwner, ReactCompositeComponentTypes$1 = { + ImpureClass: 0, + PureClass: 1, + StatelessFunctional: 2 + }, ReactRef = {}, ReactCompositeComponentTypes = ReactCompositeComponentTypes$1, _require$1 = ReactGlobalSharedState_1, ReactComponentTreeHook$1 = _require$1.ReactComponentTreeHook, warning$2 = warning, warnedAboutStatelessRefs = {}; + function attachRef(ref, component, owner) { + if (component._compositeType === ReactCompositeComponentTypes.StatelessFunctional) { + var info = "", ownerName = void 0; + owner && ("function" == typeof owner.getName && (ownerName = owner.getName()), ownerName && (info += "\n\nCheck the render method of `" + ownerName + "`.")); + var warningKey = ownerName || component._debugID, element = component._currentElement; + element && element._source && (warningKey = element._source.fileName + ":" + element._source.lineNumber), + warnedAboutStatelessRefs[warningKey] || (warnedAboutStatelessRefs[warningKey] = !0, + warning$2(!1, "Stateless function components cannot be given refs. " + "Attempts to access this ref will fail.%s%s", info, ReactComponentTreeHook$1.getStackAddendumByID(component._debugID))); } - }, - closeAll: function(startIndex) { - invariant(this.isInTransaction(), "Transaction.closeAll(): Cannot close transaction when none are open."); - for (var transactionWrappers = this.transactionWrappers, i = startIndex; i < transactionWrappers.length; i++) { - var errorThrown, wrapper = transactionWrappers[i], initData = this.wrapperInitData[i]; + "function" == typeof ref ? ref(component.getPublicInstance()) : ReactOwner_1.addComponentAsRefTo(component, ref, owner); + } + function detachRef(ref, component, owner) { + "function" == typeof ref ? ref(null) : ReactOwner_1.removeComponentAsRefFrom(component, ref, owner); + } + ReactRef.attachRefs = function(instance, element) { + if (null !== element && "object" == typeof element) { + var ref = element.ref; + null != ref && attachRef(ref, instance, element._owner); + } + }, ReactRef.shouldUpdateRefs = function(prevElement, nextElement) { + var prevRef = null, prevOwner = null; + null !== prevElement && "object" == typeof prevElement && (prevRef = prevElement.ref, + prevOwner = prevElement._owner); + var nextRef = null, nextOwner = null; + return null !== nextElement && "object" == typeof nextElement && (nextRef = nextElement.ref, + nextOwner = nextElement._owner), prevRef !== nextRef || "string" == typeof nextRef && nextOwner !== prevOwner; + }, ReactRef.detachRefs = function(instance, element) { + if (null !== element && "object" == typeof element) { + var ref = element.ref; + null != ref && detachRef(ref, instance, element._owner); + } + }; + var ReactRef_1 = ReactRef; + function attachRefs() { + ReactRef_1.attachRefs(this, this._currentElement); + } + var ReactReconciler = { + mountComponent: function(internalInstance, transaction, hostParent, hostContainerInfo, context, parentDebugID) { + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeMountComponent(internalInstance._debugID, internalInstance._currentElement, parentDebugID); + var markup = internalInstance.mountComponent(transaction, hostParent, hostContainerInfo, context, parentDebugID); + return internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onMountComponent(internalInstance._debugID), + markup; + }, + getHostNode: function(internalInstance) { + return internalInstance.getHostNode(); + }, + unmountComponent: function(internalInstance, safely, skipLifecycle) { + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUnmountComponent(internalInstance._debugID), + ReactRef_1.detachRefs(internalInstance, internalInstance._currentElement), internalInstance.unmountComponent(safely, skipLifecycle), + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUnmountComponent(internalInstance._debugID); + }, + receiveComponent: function(internalInstance, nextElement, transaction, context) { + var prevElement = internalInstance._currentElement; + if (nextElement !== prevElement || context !== internalInstance._context) { + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, nextElement); + var refsChanged = ReactRef_1.shouldUpdateRefs(prevElement, nextElement); + refsChanged && ReactRef_1.detachRefs(internalInstance, prevElement), internalInstance.receiveComponent(nextElement, transaction, context), + refsChanged && internalInstance._currentElement && null != internalInstance._currentElement.ref && transaction.getReactMountReady().enqueue(attachRefs, internalInstance), + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); + } + }, + performUpdateIfNecessary: function(internalInstance, transaction, updateBatchNumber) { + if (internalInstance._updateBatchNumber !== updateBatchNumber) return void warning(null == internalInstance._updateBatchNumber || internalInstance._updateBatchNumber === updateBatchNumber + 1, "performUpdateIfNecessary: Unexpected batch number (current %s, " + "pending %s)", updateBatchNumber, internalInstance._updateBatchNumber); + 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement), + internalInstance.performUpdateIfNecessary(transaction), 0 !== internalInstance._debugID && ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID); + } + }, ReactReconciler_1 = ReactReconciler, ReactInstanceMap = { + remove: function(key) { + key._reactInternalInstance = void 0; + }, + get: function(key) { + return key._reactInternalInstance; + }, + has: function(key) { + return void 0 !== key._reactInternalInstance; + }, + set: function(key, value) { + key._reactInternalInstance = value; + } + }, ReactInstanceMap_1 = ReactInstanceMap, OBSERVED_ERROR = {}, TransactionImpl = { + reinitializeTransaction: function() { + this.transactionWrappers = this.getTransactionWrappers(), this.wrapperInitData ? this.wrapperInitData.length = 0 : this.wrapperInitData = [], + this._isInTransaction = !1; + }, + _isInTransaction: !1, + getTransactionWrappers: null, + isInTransaction: function() { + return !!this._isInTransaction; + }, + perform: function(method, scope, a, b, c, d, e, f) { + invariant(!this.isInTransaction(), "Transaction.perform(...): Cannot initialize a transaction when there " + "is already an outstanding transaction."); + var errorThrown, ret; try { - errorThrown = !0, initData !== OBSERVED_ERROR && wrapper.close && wrapper.close.call(this, initData), + this._isInTransaction = !0, errorThrown = !0, this.initializeAll(0), ret = method.call(scope, a, b, c, d, e, f), errorThrown = !1; } finally { - if (errorThrown) try { - this.closeAll(i + 1); - } catch (e) {} + try { + if (errorThrown) try { + this.closeAll(0); + } catch (err) {} else this.closeAll(0); + } finally { + this._isInTransaction = !1; + } } + return ret; + }, + initializeAll: function(startIndex) { + for (var transactionWrappers = this.transactionWrappers, i = startIndex; i < transactionWrappers.length; i++) { + var wrapper = transactionWrappers[i]; + try { + this.wrapperInitData[i] = OBSERVED_ERROR, this.wrapperInitData[i] = wrapper.initialize ? wrapper.initialize.call(this) : null; + } finally { + if (this.wrapperInitData[i] === OBSERVED_ERROR) try { + this.initializeAll(i + 1); + } catch (err) {} + } + } + }, + closeAll: function(startIndex) { + invariant(this.isInTransaction(), "Transaction.closeAll(): Cannot close transaction when none are open."); + for (var transactionWrappers = this.transactionWrappers, i = startIndex; i < transactionWrappers.length; i++) { + var errorThrown, wrapper = transactionWrappers[i], initData = this.wrapperInitData[i]; + try { + errorThrown = !0, initData !== OBSERVED_ERROR && wrapper.close && wrapper.close.call(this, initData), + errorThrown = !1; + } finally { + if (errorThrown) try { + this.closeAll(i + 1); + } catch (e) {} + } + } + this.wrapperInitData.length = 0; } - this.wrapperInitData.length = 0; + }, Transaction = TransactionImpl, dirtyComponents = [], updateBatchNumber = 0, batchingStrategy = null; + function ensureInjected() { + invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy, "ReactUpdates: must inject a reconcile transaction class and batching " + "strategy"); } -}, Transaction = TransactionImpl, dirtyComponents = [], updateBatchNumber = 0, batchingStrategy = null; - -function ensureInjected() { - invariant(ReactUpdates.ReactReconcileTransaction && batchingStrategy, "ReactUpdates: must inject a reconcile transaction class and batching " + "strategy"); -} - -var NESTED_UPDATES = { - initialize: function() { - this.dirtyComponentsLength = dirtyComponents.length; - }, - close: function() { - this.dirtyComponentsLength !== dirtyComponents.length ? (dirtyComponents.splice(0, this.dirtyComponentsLength), - flushBatchedUpdates()) : dirtyComponents.length = 0; + var NESTED_UPDATES = { + initialize: function() { + this.dirtyComponentsLength = dirtyComponents.length; + }, + close: function() { + this.dirtyComponentsLength !== dirtyComponents.length ? (dirtyComponents.splice(0, this.dirtyComponentsLength), + flushBatchedUpdates()) : dirtyComponents.length = 0; + } + }, TRANSACTION_WRAPPERS = [ NESTED_UPDATES ]; + function ReactUpdatesFlushTransaction() { + this.reinitializeTransaction(), this.dirtyComponentsLength = null, this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(!0); } -}, TRANSACTION_WRAPPERS = [ NESTED_UPDATES ]; - -function ReactUpdatesFlushTransaction() { - this.reinitializeTransaction(), this.dirtyComponentsLength = null, this.reconcileTransaction = ReactUpdates.ReactReconcileTransaction.getPooled(!0); -} - -Object.assign(ReactUpdatesFlushTransaction.prototype, Transaction, { - getTransactionWrappers: function() { - return TRANSACTION_WRAPPERS; - }, - destructor: function() { - this.dirtyComponentsLength = null, ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction), - this.reconcileTransaction = null; - }, - perform: function(method, scope, a) { - return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); + Object.assign(ReactUpdatesFlushTransaction.prototype, Transaction, { + getTransactionWrappers: function() { + return TRANSACTION_WRAPPERS; + }, + destructor: function() { + this.dirtyComponentsLength = null, ReactUpdates.ReactReconcileTransaction.release(this.reconcileTransaction), + this.reconcileTransaction = null; + }, + perform: function(method, scope, a) { + return Transaction.perform.call(this, this.reconcileTransaction.perform, this.reconcileTransaction, method, scope, a); + } + }), PooledClass_1.addPoolingTo(ReactUpdatesFlushTransaction); + function batchedUpdates$1(callback, a, b, c, d, e) { + return ensureInjected(), batchingStrategy.batchedUpdates(callback, a, b, c, d, e); } -}), PooledClass_1.addPoolingTo(ReactUpdatesFlushTransaction); - -function batchedUpdates$1(callback, a, b, c, d, e) { - return ensureInjected(), batchingStrategy.batchedUpdates(callback, a, b, c, d, e); -} - -function mountOrderComparator(c1, c2) { - return c1._mountOrder - c2._mountOrder; -} - -function runBatchedUpdates(transaction) { - var len = transaction.dirtyComponentsLength; - invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), - dirtyComponents.sort(mountOrderComparator), updateBatchNumber++; - for (var i = 0; i < len; i++) { - var component = dirtyComponents[i]; - ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); + function mountOrderComparator(c1, c2) { + return c1._mountOrder - c2._mountOrder; } -} - -var flushBatchedUpdates = function() { - for (;dirtyComponents.length; ) { - var transaction = ReactUpdatesFlushTransaction.getPooled(); - transaction.perform(runBatchedUpdates, null, transaction), ReactUpdatesFlushTransaction.release(transaction); + function runBatchedUpdates(transaction) { + var len = transaction.dirtyComponentsLength; + invariant(len === dirtyComponents.length, "Expected flush transaction's stored dirty-components length (%s) to " + "match dirty-components array length (%s).", len, dirtyComponents.length), + dirtyComponents.sort(mountOrderComparator), updateBatchNumber++; + for (var i = 0; i < len; i++) { + var component = dirtyComponents[i]; + ReactReconciler_1.performUpdateIfNecessary(component, transaction.reconcileTransaction, updateBatchNumber); + } } -}; - -function enqueueUpdate$1(component) { - if (ensureInjected(), !batchingStrategy.isBatchingUpdates) return void batchingStrategy.batchedUpdates(enqueueUpdate$1, component); - dirtyComponents.push(component), null == component._updateBatchNumber && (component._updateBatchNumber = updateBatchNumber + 1); -} - -var ReactUpdatesInjection = { - injectReconcileTransaction: function(ReconcileTransaction) { - invariant(ReconcileTransaction, "ReactUpdates: must provide a reconcile transaction class"), - ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; - }, - injectBatchingStrategy: function(_batchingStrategy) { - invariant(_batchingStrategy, "ReactUpdates: must provide a batching strategy"), - invariant("function" == typeof _batchingStrategy.batchedUpdates, "ReactUpdates: must provide a batchedUpdates() function"), - invariant("boolean" == typeof _batchingStrategy.isBatchingUpdates, "ReactUpdates: must provide an isBatchingUpdates boolean attribute"), - batchingStrategy = _batchingStrategy; - }, - getBatchingStrategy: function() { - return batchingStrategy; + var flushBatchedUpdates = function() { + for (;dirtyComponents.length; ) { + var transaction = ReactUpdatesFlushTransaction.getPooled(); + transaction.perform(runBatchedUpdates, null, transaction), ReactUpdatesFlushTransaction.release(transaction); + } + }; + function enqueueUpdate$1(component) { + if (ensureInjected(), !batchingStrategy.isBatchingUpdates) return void batchingStrategy.batchedUpdates(enqueueUpdate$1, component); + dirtyComponents.push(component), null == component._updateBatchNumber && (component._updateBatchNumber = updateBatchNumber + 1); } -}, ReactUpdates = { - ReactReconcileTransaction: null, - batchedUpdates: batchedUpdates$1, - enqueueUpdate: enqueueUpdate$1, - flushBatchedUpdates: flushBatchedUpdates, - injection: ReactUpdatesInjection -}, ReactUpdates_1 = ReactUpdates, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$3 = warning, warnOnInvalidCallback = function(callback, callerName) { - warning$3(null === callback || "function" == typeof callback, "%s(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callerName, "" + callback); -}; - -function enqueueUpdate(internalInstance) { - ReactUpdates_1.enqueueUpdate(internalInstance); -} - -function getInternalInstanceReadyForUpdate(publicInstance, callerName) { - var internalInstance = ReactInstanceMap_1.get(publicInstance); - if (!internalInstance) { - var ctor = publicInstance.constructor; - return warning$3(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"), - null; + var ReactUpdatesInjection = { + injectReconcileTransaction: function(ReconcileTransaction) { + invariant(ReconcileTransaction, "ReactUpdates: must provide a reconcile transaction class"), + ReactUpdates.ReactReconcileTransaction = ReconcileTransaction; + }, + injectBatchingStrategy: function(_batchingStrategy) { + invariant(_batchingStrategy, "ReactUpdates: must provide a batching strategy"), + invariant("function" == typeof _batchingStrategy.batchedUpdates, "ReactUpdates: must provide a batchedUpdates() function"), + invariant("boolean" == typeof _batchingStrategy.isBatchingUpdates, "ReactUpdates: must provide an isBatchingUpdates boolean attribute"), + batchingStrategy = _batchingStrategy; + }, + getBatchingStrategy: function() { + return batchingStrategy; + } + }, ReactUpdates = { + ReactReconcileTransaction: null, + batchedUpdates: batchedUpdates$1, + enqueueUpdate: enqueueUpdate$1, + flushBatchedUpdates: flushBatchedUpdates, + injection: ReactUpdatesInjection + }, ReactUpdates_1 = ReactUpdates, ReactCurrentOwner = ReactGlobalSharedState_1.ReactCurrentOwner, warning$3 = warning, warnOnInvalidCallback = function(callback, callerName) { + warning$3(null === callback || "function" == typeof callback, "%s(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callerName, "" + callback); + }; + function enqueueUpdate(internalInstance) { + ReactUpdates_1.enqueueUpdate(internalInstance); } - return warning$3(null == ReactCurrentOwner.current, "Cannot update during an existing state transition (such as within " + "`render` or another component's constructor). Render methods should " + "be a pure function of props and state; constructor side-effects are " + "an anti-pattern, but can be moved to `componentWillMount`."), - internalInstance; -} - -var ReactUpdateQueue = { - isMounted: function(publicInstance) { - var owner = ReactCurrentOwner.current; - null !== owner && (warning$3(owner._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), - owner._warnedAboutRefsInRender = !0); + function getInternalInstanceReadyForUpdate(publicInstance, callerName) { var internalInstance = ReactInstanceMap_1.get(publicInstance); - return !!internalInstance && !!internalInstance._renderedComponent; - }, - enqueueCallbackInternal: function(internalInstance, callback) { - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ], - enqueueUpdate(internalInstance); - }, - enqueueForceUpdate: function(publicInstance, callback, callerName) { - var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - internalInstance && (callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), - internalInstance._pendingForceUpdate = !0, enqueueUpdate(internalInstance)); - }, - enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { - var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - internalInstance && (internalInstance._pendingStateQueue = [ completeState ], internalInstance._pendingReplaceState = !0, - callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), - internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), - enqueueUpdate(internalInstance)); - }, - enqueueSetState: function(publicInstance, partialState, callback, callerName) { - ReactInstrumentation.debugTool.onSetState(), warning$3(null != partialState, "setState(...): You passed an undefined or null state object; " + "instead, use forceUpdate()."); - var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); - if (internalInstance) { - (internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = [])).push(partialState), + if (!internalInstance) { + var ctor = publicInstance.constructor; + return warning$3(!1, "Can only update a mounted or mounting component. This usually means " + "you called setState, replaceState, or forceUpdate on an unmounted " + "component. This is a no-op.\n\nPlease check the code for the " + "%s component.", ctor && (ctor.displayName || ctor.name) || "ReactClass"), + null; + } + return warning$3(null == ReactCurrentOwner.current, "Cannot update during an existing state transition (such as within " + "`render` or another component's constructor). Render methods should " + "be a pure function of props and state; constructor side-effects are " + "an anti-pattern, but can be moved to `componentWillMount`."), + internalInstance; + } + var ReactUpdateQueue = { + isMounted: function(publicInstance) { + var owner = ReactCurrentOwner.current; + null !== owner && (warning$3(owner._warnedAboutRefsInRender, "%s is accessing isMounted inside its render() function. " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), + owner._warnedAboutRefsInRender = !0); + var internalInstance = ReactInstanceMap_1.get(publicInstance); + return !!internalInstance && !!internalInstance._renderedComponent; + }, + enqueueCallbackInternal: function(internalInstance, callback) { + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ], + enqueueUpdate(internalInstance); + }, + enqueueForceUpdate: function(publicInstance, callback, callerName) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); + internalInstance && (callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + internalInstance._pendingForceUpdate = !0, enqueueUpdate(internalInstance)); + }, + enqueueReplaceState: function(publicInstance, completeState, callback, callerName) { + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); + internalInstance && (internalInstance._pendingStateQueue = [ completeState ], internalInstance._pendingReplaceState = !0, callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + enqueueUpdate(internalInstance)); + }, + enqueueSetState: function(publicInstance, partialState, callback, callerName) { + ReactInstrumentation.debugTool.onSetState(), warning$3(null != partialState, "setState(...): You passed an undefined or null state object; " + "instead, use forceUpdate()."); + var internalInstance = getInternalInstanceReadyForUpdate(publicInstance); + if (internalInstance) { + (internalInstance._pendingStateQueue || (internalInstance._pendingStateQueue = [])).push(partialState), + callback = void 0 === callback ? null : callback, null !== callback && (warnOnInvalidCallback(callback, callerName), + internalInstance._pendingCallbacks ? internalInstance._pendingCallbacks.push(callback) : internalInstance._pendingCallbacks = [ callback ]), + enqueueUpdate(internalInstance); + } + }, + enqueueElementInternal: function(internalInstance, nextElement, nextContext) { + internalInstance._pendingElement = nextElement, internalInstance._context = nextContext, enqueueUpdate(internalInstance); } - }, - enqueueElementInternal: function(internalInstance, nextElement, nextContext) { - internalInstance._pendingElement = nextElement, internalInstance._context = nextContext, - enqueueUpdate(internalInstance); - } -}, ReactUpdateQueue_1 = ReactUpdateQueue, injected = !1, ReactComponentEnvironment = { - replaceNodeWithMarkup: null, - processChildrenUpdates: null, - injection: { - injectEnvironment: function(environment) { - invariant(!injected, "ReactCompositeComponent: injectEnvironment() can only be called once."), - ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup, - ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates, - injected = !0; + }, ReactUpdateQueue_1 = ReactUpdateQueue, injected = !1, ReactComponentEnvironment = { + replaceNodeWithMarkup: null, + processChildrenUpdates: null, + injection: { + injectEnvironment: function(environment) { + invariant(!injected, "ReactCompositeComponent: injectEnvironment() can only be called once."), + ReactComponentEnvironment.replaceNodeWithMarkup = environment.replaceNodeWithMarkup, + ReactComponentEnvironment.processChildrenUpdates = environment.processChildrenUpdates, + injected = !0; + } } - } -}, ReactComponentEnvironment_1 = ReactComponentEnvironment, ReactNodeTypes = { - HOST: 0, - COMPOSITE: 1, - EMPTY: 2, - getType: function(node) { - return null === node || !1 === node ? ReactNodeTypes.EMPTY : React.isValidElement(node) ? "function" == typeof node.type ? ReactNodeTypes.COMPOSITE : ReactNodeTypes.HOST : void invariant(!1, "Unexpected node: %s", node); - } -}, ReactNodeTypes_1 = ReactNodeTypes; - -function shouldUpdateReactComponent(prevElement, nextElement) { - var prevEmpty = null === prevElement || !1 === prevElement, nextEmpty = null === nextElement || !1 === nextElement; - if (prevEmpty || nextEmpty) return prevEmpty === nextEmpty; - var prevType = typeof prevElement, nextType = typeof nextElement; - return "string" === prevType || "number" === prevType ? "string" === nextType || "number" === nextType : "object" === nextType && prevElement.type === nextElement.type && prevElement.key === nextElement.key; -} - -var shouldUpdateReactComponent_1 = shouldUpdateReactComponent, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, _require2 = ReactGlobalSharedState_1, ReactDebugCurrentFrame = _require2.ReactDebugCurrentFrame, warningAboutMissingGetChildContext = {}; - -function StatelessComponent(Component) {} - -StatelessComponent.prototype.render = function() { - return (0, ReactInstanceMap_1.get(this)._currentElement.type)(this.props, this.context, this.updater); -}; - -function shouldConstruct(Component) { - return !(!Component.prototype || !Component.prototype.isReactComponent); -} - -function isPureComponent(Component) { - return !(!Component.prototype || !Component.prototype.isPureReactComponent); -} - -function measureLifeCyclePerf(fn, debugID, timerType) { - if (0 === debugID) return fn(); - ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType); - try { - return fn(); - } finally { - ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType); - } -} - -var nextMountID = 1, ReactCompositeComponent = { - construct: function(element) { - this._currentElement = element, this._rootNodeID = 0, this._compositeType = null, - this._instance = null, this._hostParent = null, this._hostContainerInfo = null, - this._updateBatchNumber = null, this._pendingElement = null, this._pendingStateQueue = null, - this._pendingReplaceState = !1, this._pendingForceUpdate = !1, this._renderedNodeType = null, - this._renderedComponent = null, this._context = null, this._mountOrder = 0, this._topLevelWrapper = null, - this._pendingCallbacks = null, this._calledComponentWillUnmount = !1, this._warnedAboutRefsInRender = !1; - }, - mountComponent: function(transaction, hostParent, hostContainerInfo, context) { - var _this = this; - this._context = context, this._mountOrder = nextMountID++, this._hostParent = hostParent, - this._hostContainerInfo = hostContainerInfo; - var renderedElement, publicProps = this._currentElement.props, publicContext = this._processContext(context), Component = this._currentElement.type, updateQueue = transaction.getUpdateQueue(), doConstruct = shouldConstruct(Component), inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue); - doConstruct || null != inst && null != inst.render ? isPureComponent(Component) ? this._compositeType = ReactCompositeComponentTypes$1.PureClass : this._compositeType = ReactCompositeComponentTypes$1.ImpureClass : (renderedElement = inst, - warning(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), - invariant(null === inst || !1 === inst || React.isValidElement(inst), "%s(...): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", Component.displayName || Component.name || "Component"), - inst = new StatelessComponent(Component), this._compositeType = ReactCompositeComponentTypes$1.StatelessFunctional), - null == inst.render && warning(!1, "%s(...): No `render` method found on the returned component " + "instance: you may have forgotten to define `render`.", Component.displayName || Component.name || "Component"); - var propsMutated = inst.props !== publicProps, componentName = Component.displayName || Component.name || "Component"; - warning(void 0 === inst.props || !propsMutated, "%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", componentName, componentName), - inst.props = publicProps, inst.context = publicContext, inst.refs = emptyObject, - inst.updater = updateQueue, this._instance = inst, ReactInstanceMap_1.set(inst, this), - warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, "getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", this.getName() || "a component"), - warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, "getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", this.getName() || "a component"), - warning(!inst.propTypes, "propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", this.getName() || "a component"), - warning(!inst.contextTypes, "contextTypes was defined as an instance property on %s. Use a " + "static property to define contextTypes instead.", this.getName() || "a component"), - warning("function" != typeof inst.componentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", this.getName() || "A component"), - warning("function" != typeof inst.componentDidUnmount, "%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", this.getName() || "A component"), - warning("function" != typeof inst.componentWillRecieveProps, "%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", this.getName() || "A component"), - isPureComponent(Component) && void 0 !== inst.shouldComponentUpdate && warning(!1, "%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", this.getName() || "A pure component"), - warning(!inst.defaultProps, "Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", this.getName() || "a component", this.getName() || "a component"); - var initialState = inst.state; - void 0 === initialState && (inst.state = initialState = null), invariant("object" == typeof initialState && !Array.isArray(initialState), "%s.state: must be set to an object or null", this.getName() || "ReactCompositeComponent"), - this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, - inst.componentWillMount && (measureLifeCyclePerf(function() { - return inst.componentWillMount(); - }, this._debugID, "componentWillMount"), this._pendingStateQueue && (inst.state = this._processPendingState(inst.props, inst.context))); - var markup; - markup = inst.unstable_handleError ? this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context) : this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context), - inst.componentDidMount && transaction.getReactMountReady().enqueue(function() { - measureLifeCyclePerf(function() { - return inst.componentDidMount(); - }, _this._debugID, "componentDidMount"); - }); - var callbacks = this._pendingCallbacks; - if (callbacks) { - this._pendingCallbacks = null; - for (var i = 0; i < callbacks.length; i++) transaction.getReactMountReady().enqueue(callbacks[i], inst); + }, ReactComponentEnvironment_1 = ReactComponentEnvironment, ReactNodeTypes = { + HOST: 0, + COMPOSITE: 1, + EMPTY: 2, + getType: function(node) { + return null === node || !1 === node ? ReactNodeTypes.EMPTY : React.isValidElement(node) ? "function" == typeof node.type ? ReactNodeTypes.COMPOSITE : ReactNodeTypes.HOST : void invariant(!1, "Unexpected node: %s", node); } - return markup; - }, - _constructComponent: function(doConstruct, publicProps, publicContext, updateQueue) { - ReactCurrentOwner$1.current = this; + }, ReactNodeTypes_1 = ReactNodeTypes; + function shouldUpdateReactComponent(prevElement, nextElement) { + var prevEmpty = null === prevElement || !1 === prevElement, nextEmpty = null === nextElement || !1 === nextElement; + if (prevEmpty || nextEmpty) return prevEmpty === nextEmpty; + var prevType = typeof prevElement, nextType = typeof nextElement; + return "string" === prevType || "number" === prevType ? "string" === nextType || "number" === nextType : "object" === nextType && prevElement.type === nextElement.type && prevElement.key === nextElement.key; + } + var shouldUpdateReactComponent_1 = shouldUpdateReactComponent, ReactCurrentOwner$1 = ReactGlobalSharedState_1.ReactCurrentOwner, _require2 = ReactGlobalSharedState_1, ReactDebugCurrentFrame = _require2.ReactDebugCurrentFrame, warningAboutMissingGetChildContext = {}; + function StatelessComponent(Component) {} + StatelessComponent.prototype.render = function() { + return (0, ReactInstanceMap_1.get(this)._currentElement.type)(this.props, this.context, this.updater); + }; + function shouldConstruct(Component) { + return !(!Component.prototype || !Component.prototype.isReactComponent); + } + function isPureComponent(Component) { + return !(!Component.prototype || !Component.prototype.isPureReactComponent); + } + function measureLifeCyclePerf(fn, debugID, timerType) { + if (0 === debugID) return fn(); + ReactInstrumentation.debugTool.onBeginLifeCycleTimer(debugID, timerType); try { - return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); + return fn(); } finally { - ReactCurrentOwner$1.current = null; + ReactInstrumentation.debugTool.onEndLifeCycleTimer(debugID, timerType); } - }, - _constructComponentWithoutOwner: function(doConstruct, publicProps, publicContext, updateQueue) { - var Component = this._currentElement.type; - return doConstruct ? measureLifeCyclePerf(function() { - return new Component(publicProps, publicContext, updateQueue); - }, this._debugID, "ctor") : measureLifeCyclePerf(function() { - return Component(publicProps, publicContext, updateQueue); - }, this._debugID, "render"); - }, - performInitialMountWithErrorHandling: function(renderedElement, hostParent, hostContainerInfo, transaction, context) { - var markup, checkpoint = transaction.checkpoint(); - try { - markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); - } catch (e) { - transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), - checkpoint = transaction.checkpoint(), this._renderedComponent.unmountComponent(!0, !0), - transaction.rollback(checkpoint), markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); - } - return markup; - }, - performInitialMount: function(renderedElement, hostParent, hostContainerInfo, transaction, context) { - void 0 === renderedElement && (renderedElement = this._renderValidatedComponent()); - var nodeType = ReactNodeTypes_1.getType(renderedElement); - this._renderedNodeType = nodeType; - var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes_1.EMPTY); - this._renderedComponent = child; - var debugID = 0; - debugID = this._debugID; - var markup = ReactReconciler_1.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID); - if (0 !== debugID) { - var childDebugIDs = 0 !== child._debugID ? [ child._debugID ] : []; - ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); - } - return markup; - }, - getHostNode: function() { - return ReactReconciler_1.getHostNode(this._renderedComponent); - }, - unmountComponent: function(safely, skipLifecycle) { - if (this._renderedComponent) { - var inst = this._instance; - if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) if (inst._calledComponentWillUnmount = !0, - safely) { - if (!skipLifecycle) { - var name = this.getName() + ".componentWillUnmount()"; - ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(name, inst.componentWillUnmount, inst); - } - } else measureLifeCyclePerf(function() { - return inst.componentWillUnmount(); - }, this._debugID, "componentWillUnmount"); - this._renderedComponent && (ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), - this._renderedNodeType = null, this._renderedComponent = null, this._instance = null), + } + var nextMountID = 1, ReactCompositeComponent = { + construct: function(element) { + this._currentElement = element, this._rootNodeID = 0, this._compositeType = null, + this._instance = null, this._hostParent = null, this._hostContainerInfo = null, + this._updateBatchNumber = null, this._pendingElement = null, this._pendingStateQueue = null, + this._pendingReplaceState = !1, this._pendingForceUpdate = !1, this._renderedNodeType = null, + this._renderedComponent = null, this._context = null, this._mountOrder = 0, this._topLevelWrapper = null, + this._pendingCallbacks = null, this._calledComponentWillUnmount = !1, this._warnedAboutRefsInRender = !1; + }, + mountComponent: function(transaction, hostParent, hostContainerInfo, context) { + var _this = this; + this._context = context, this._mountOrder = nextMountID++, this._hostParent = hostParent, + this._hostContainerInfo = hostContainerInfo; + var renderedElement, publicProps = this._currentElement.props, publicContext = this._processContext(context), Component = this._currentElement.type, updateQueue = transaction.getUpdateQueue(), doConstruct = shouldConstruct(Component), inst = this._constructComponent(doConstruct, publicProps, publicContext, updateQueue); + doConstruct || null != inst && null != inst.render ? isPureComponent(Component) ? this._compositeType = ReactCompositeComponentTypes$1.PureClass : this._compositeType = ReactCompositeComponentTypes$1.ImpureClass : (renderedElement = inst, + warning(!Component.childContextTypes, "%s(...): childContextTypes cannot be defined on a functional component.", Component.displayName || Component.name || "Component"), + invariant(null === inst || !1 === inst || React.isValidElement(inst), "%s(...): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", Component.displayName || Component.name || "Component"), + inst = new StatelessComponent(Component), this._compositeType = ReactCompositeComponentTypes$1.StatelessFunctional), + null == inst.render && warning(!1, "%s(...): No `render` method found on the returned component " + "instance: you may have forgotten to define `render`.", Component.displayName || Component.name || "Component"); + var propsMutated = inst.props !== publicProps, componentName = Component.displayName || Component.name || "Component"; + warning(void 0 === inst.props || !propsMutated, "%s(...): When calling super() in `%s`, make sure to pass " + "up the same props that your component's constructor was passed.", componentName, componentName), + inst.props = publicProps, inst.context = publicContext, inst.refs = emptyObject, + inst.updater = updateQueue, this._instance = inst, ReactInstanceMap_1.set(inst, this), + warning(!inst.getInitialState || inst.getInitialState.isReactClassApproved || inst.state, "getInitialState was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Did you mean to define a state property instead?", this.getName() || "a component"), + warning(!inst.getDefaultProps || inst.getDefaultProps.isReactClassApproved, "getDefaultProps was defined on %s, a plain JavaScript class. " + "This is only supported for classes created using React.createClass. " + "Use a static property to define defaultProps instead.", this.getName() || "a component"), + warning(!inst.propTypes, "propTypes was defined as an instance property on %s. Use a static " + "property to define propTypes instead.", this.getName() || "a component"), + warning(!inst.contextTypes, "contextTypes was defined as an instance property on %s. Use a " + "static property to define contextTypes instead.", this.getName() || "a component"), + warning("function" != typeof inst.componentShouldUpdate, "%s has a method called " + "componentShouldUpdate(). Did you mean shouldComponentUpdate()? " + "The name is phrased as a question because the function is " + "expected to return a value.", this.getName() || "A component"), + warning("function" != typeof inst.componentDidUnmount, "%s has a method called " + "componentDidUnmount(). But there is no such lifecycle method. " + "Did you mean componentWillUnmount()?", this.getName() || "A component"), + warning("function" != typeof inst.componentWillRecieveProps, "%s has a method called " + "componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", this.getName() || "A component"), + isPureComponent(Component) && void 0 !== inst.shouldComponentUpdate && warning(!1, "%s has a method called shouldComponentUpdate(). " + "shouldComponentUpdate should not be used when extending React.PureComponent. " + "Please extend React.Component if shouldComponentUpdate is used.", this.getName() || "A pure component"), + warning(!inst.defaultProps, "Setting defaultProps as an instance property on %s is not supported and will be ignored." + " Instead, define defaultProps as a static property on %s.", this.getName() || "a component", this.getName() || "a component"); + var initialState = inst.state; + void 0 === initialState && (inst.state = initialState = null), invariant("object" == typeof initialState && !Array.isArray(initialState), "%s.state: must be set to an object or null", this.getName() || "ReactCompositeComponent"), this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, - this._pendingCallbacks = null, this._pendingElement = null, this._context = null, - this._rootNodeID = 0, this._topLevelWrapper = null, ReactInstanceMap_1.remove(inst); - } - }, - _maskContext: function(context) { - var Component = this._currentElement.type, contextTypes = Component.contextTypes; - if (!contextTypes) return emptyObject; - var maskedContext = {}; - for (var contextName in contextTypes) maskedContext[contextName] = context[contextName]; - return maskedContext; - }, - _processContext: function(context) { - var maskedContext = this._maskContext(context), Component = this._currentElement.type; - return Component.contextTypes && this._checkContextTypes(Component.contextTypes, maskedContext, "context"), - maskedContext; - }, - _processChildContext: function(currentContext) { - var childContext, Component = this._currentElement.type, inst = this._instance; - if ("function" == typeof inst.getChildContext) { - ReactInstrumentation.debugTool.onBeginProcessingChildContext(); - try { - childContext = inst.getChildContext(); - } finally { - ReactInstrumentation.debugTool.onEndProcessingChildContext(); - } - invariant("object" == typeof Component.childContextTypes, "%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", this.getName() || "ReactCompositeComponent"), - this._checkContextTypes(Component.childContextTypes, childContext, "child context"); - for (var name in childContext) invariant(name in Component.childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || "ReactCompositeComponent", name); - return Object.assign({}, currentContext, childContext); - } - var componentName = this.getName(); - return warningAboutMissingGetChildContext[componentName] || (warningAboutMissingGetChildContext[componentName] = !0, - warning(!Component.childContextTypes, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), - currentContext; - }, - _checkContextTypes: function(typeSpecs, values, location) { - ReactDebugCurrentFrame.current = this._debugID, checkPropTypes(typeSpecs, values, location, this.getName(), ReactDebugCurrentFrame.getStackAddendum), - ReactDebugCurrentFrame.current = null; - }, - receiveComponent: function(nextElement, transaction, nextContext) { - var prevElement = this._currentElement, prevContext = this._context; - this._pendingElement = null, this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext); - }, - performUpdateIfNecessary: function(transaction) { - if (null != this._pendingElement) ReactReconciler_1.receiveComponent(this, this._pendingElement, transaction, this._context); else if (null !== this._pendingStateQueue || this._pendingForceUpdate) this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context); else { + inst.componentWillMount && (measureLifeCyclePerf(function() { + return inst.componentWillMount(); + }, this._debugID, "componentWillMount"), this._pendingStateQueue && (inst.state = this._processPendingState(inst.props, inst.context))); + var markup; + markup = inst.unstable_handleError ? this.performInitialMountWithErrorHandling(renderedElement, hostParent, hostContainerInfo, transaction, context) : this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context), + inst.componentDidMount && transaction.getReactMountReady().enqueue(function() { + measureLifeCyclePerf(function() { + return inst.componentDidMount(); + }, _this._debugID, "componentDidMount"); + }); var callbacks = this._pendingCallbacks; - if (this._pendingCallbacks = null, callbacks) for (var j = 0; j < callbacks.length; j++) transaction.getReactMountReady().enqueue(callbacks[j], this.getPublicInstance()); - this._updateBatchNumber = null; - } - }, - updateComponent: function(transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) { - var inst = this._instance; - invariant(null != inst, "Attempted to update component `%s` that has already been unmounted " + "(or failed to mount).", this.getName() || "ReactCompositeComponent"); - var nextContext, willReceive = !1; - this._context === nextUnmaskedContext ? nextContext = inst.context : (nextContext = this._processContext(nextUnmaskedContext), - willReceive = !0); - var prevProps = prevParentElement.props, nextProps = nextParentElement.props; - if (prevParentElement !== nextParentElement && (willReceive = !0), willReceive && inst.componentWillReceiveProps) { - var beforeState = inst.state; - measureLifeCyclePerf(function() { - return inst.componentWillReceiveProps(nextProps, nextContext); - }, this._debugID, "componentWillReceiveProps"); - var afterState = inst.state; - beforeState !== afterState && (inst.state = beforeState, inst.updater.enqueueReplaceState(inst, afterState), - warning(!1, "%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", this.getName() || "ReactCompositeComponent")); - } - var callbacks = this._pendingCallbacks; - this._pendingCallbacks = null; - var nextState = this._processPendingState(nextProps, nextContext), shouldUpdate = !0; - if (!this._pendingForceUpdate) { - var prevState = inst.state; - shouldUpdate = willReceive || nextState !== prevState, inst.shouldComponentUpdate ? shouldUpdate = measureLifeCyclePerf(function() { - return inst.shouldComponentUpdate(nextProps, nextState, nextContext); - }, this._debugID, "shouldComponentUpdate") : this._compositeType === ReactCompositeComponentTypes$1.PureClass && (shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState)); - } - if (warning(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", this.getName() || "ReactCompositeComponent"), - this._updateBatchNumber = null, shouldUpdate ? (this._pendingForceUpdate = !1, this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext)) : (this._currentElement = nextParentElement, - this._context = nextUnmaskedContext, inst.props = nextProps, inst.state = nextState, - inst.context = nextContext), callbacks) for (var j = 0; j < callbacks.length; j++) transaction.getReactMountReady().enqueue(callbacks[j], this.getPublicInstance()); - }, - _processPendingState: function(props, context) { - var inst = this._instance, queue = this._pendingStateQueue, replace = this._pendingReplaceState; - if (this._pendingReplaceState = !1, this._pendingStateQueue = null, !queue) return inst.state; - if (replace && 1 === queue.length) return queue[0]; - for (var nextState = replace ? queue[0] : inst.state, dontMutate = !0, i = replace ? 1 : 0; i < queue.length; i++) { - var partial = queue[i], partialState = "function" == typeof partial ? partial.call(inst, nextState, props, context) : partial; - partialState && (dontMutate ? (dontMutate = !1, nextState = Object.assign({}, nextState, partialState)) : Object.assign(nextState, partialState)); - } - return nextState; - }, - _performComponentUpdate: function(nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { - var prevProps, prevState, _this2 = this, inst = this._instance, hasComponentDidUpdate = !!inst.componentDidUpdate; - hasComponentDidUpdate && (prevProps = inst.props, prevState = inst.state), inst.componentWillUpdate && measureLifeCyclePerf(function() { - return inst.componentWillUpdate(nextProps, nextState, nextContext); - }, this._debugID, "componentWillUpdate"), this._currentElement = nextElement, this._context = unmaskedContext, - inst.props = nextProps, inst.state = nextState, inst.context = nextContext, inst.unstable_handleError ? this._updateRenderedComponentWithErrorHandling(transaction, unmaskedContext) : this._updateRenderedComponent(transaction, unmaskedContext), - hasComponentDidUpdate && transaction.getReactMountReady().enqueue(function() { - measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState), _this2._debugID, "componentDidUpdate"); - }); - }, - _updateRenderedComponentWithErrorHandling: function(transaction, context) { - var checkpoint = transaction.checkpoint(); - try { - this._updateRenderedComponent(transaction, context); - } catch (e) { - transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), - checkpoint = transaction.checkpoint(), this._updateRenderedComponentWithNextElement(transaction, context, null, !0), - this._updateRenderedComponent(transaction, context); - } - }, - _updateRenderedComponent: function(transaction, context) { - var nextRenderedElement = this._renderValidatedComponent(); - this._updateRenderedComponentWithNextElement(transaction, context, nextRenderedElement, !1); - }, - _updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) { - var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement, debugID = 0; - if (debugID = this._debugID, shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else { - var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance), nodeType = ReactNodeTypes_1.getType(nextRenderedElement); - this._renderedNodeType = nodeType; - var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY); - this._renderedComponent = child; - var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); - if (ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), 0 !== debugID) { - var childDebugIDs = 0 !== child._debugID ? [ child._debugID ] : []; - ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); + if (callbacks) { + this._pendingCallbacks = null; + for (var i = 0; i < callbacks.length; i++) transaction.getReactMountReady().enqueue(callbacks[i], inst); } - this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance); - } - }, - _replaceNodeWithMarkup: function(oldHostNode, nextMarkup, prevInstance) { - ReactComponentEnvironment_1.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance); - }, - _renderValidatedComponentWithoutOwnerOrContext: function() { - var renderedElement, inst = this._instance; - return renderedElement = measureLifeCyclePerf(function() { - return inst.render(); - }, this._debugID, "render"), void 0 === renderedElement && inst.render._isMockFunction && (renderedElement = null), - renderedElement; - }, - _renderValidatedComponent: function() { - var renderedElement; - if (0 && this._compositeType === ReactCompositeComponentTypes$1.StatelessFunctional) renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); else { + return markup; + }, + _constructComponent: function(doConstruct, publicProps, publicContext, updateQueue) { ReactCurrentOwner$1.current = this; try { - renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); + return this._constructComponentWithoutOwner(doConstruct, publicProps, publicContext, updateQueue); } finally { ReactCurrentOwner$1.current = null; } - } - return invariant(null === renderedElement || !1 === renderedElement || React.isValidElement(renderedElement), "%s.render(): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", this.getName() || "ReactCompositeComponent"), - renderedElement; - }, - attachRef: function(ref, component) { - var inst = this.getPublicInstance(); - invariant(null != inst, "Stateless function components cannot have refs."); - var publicComponentInstance = component.getPublicInstance(); - (inst.refs === emptyObject ? inst.refs = {} : inst.refs)[ref] = publicComponentInstance; - }, - detachRef: function(ref) { - delete this.getPublicInstance().refs[ref]; - }, - getName: function() { - var type = this._currentElement.type, constructor = this._instance && this._instance.constructor; - return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null; - }, - getPublicInstance: function() { - var inst = this._instance; - return this._compositeType === ReactCompositeComponentTypes$1.StatelessFunctional ? null : inst; - }, - _instantiateReactComponent: null -}, ReactCompositeComponent_1 = ReactCompositeComponent, emptyComponentFactory, ReactEmptyComponentInjection = { - injectEmptyComponentFactory: function(factory) { - emptyComponentFactory = factory; - } -}, ReactEmptyComponent = { - create: function(instantiate) { - return emptyComponentFactory(instantiate); - } -}; - -ReactEmptyComponent.injection = ReactEmptyComponentInjection; - -var ReactEmptyComponent_1 = ReactEmptyComponent, genericComponentClass = null, textComponentClass = null, ReactHostComponentInjection = { - injectGenericComponentClass: function(componentClass) { - genericComponentClass = componentClass; - }, - injectTextComponentClass: function(componentClass) { - textComponentClass = componentClass; - } -}; - -function createInternalComponent(element) { - return invariant(genericComponentClass, "There is no registered component for the tag %s", element.type), - new genericComponentClass(element); -} - -function createInstanceForText(text) { - return new textComponentClass(text); -} - -function isTextComponent(component) { - return component instanceof textComponentClass; -} - -var ReactHostComponent = { - createInternalComponent: createInternalComponent, - createInstanceForText: createInstanceForText, - isTextComponent: isTextComponent, - injection: ReactHostComponentInjection -}, ReactHostComponent_1 = ReactHostComponent, nextDebugID = 1, ReactCompositeComponentWrapper = function(element) { - this.construct(element); -}; - -function getDeclarationErrorAddendum(owner) { - if (owner) { - var name = owner.getName(); - if (name) return "\n\nCheck the render method of `" + name + "`."; - } - return ""; -} - -function isInternalComponentType(type) { - return "function" == typeof type && void 0 !== type.prototype && "function" == typeof type.prototype.mountComponent && "function" == typeof type.prototype.receiveComponent; -} - -function instantiateReactComponent(node, shouldHaveDebugID) { - var instance; - if (null === node || !1 === node) instance = ReactEmptyComponent_1.create(instantiateReactComponent); else if ("object" == typeof node) { - var element = node, type = element.type; - if ("function" != typeof type && "string" != typeof type) { - var info = ""; - (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."), - info += getDeclarationErrorAddendum(element._owner), invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); - } - "string" == typeof element.type ? instance = ReactHostComponent_1.createInternalComponent(element) : isInternalComponentType(element.type) ? (instance = new element.type(element), - instance.getHostNode || (instance.getHostNode = instance.getNativeNode)) : instance = new ReactCompositeComponentWrapper(element); - } else "string" == typeof node || "number" == typeof node ? instance = ReactHostComponent_1.createInstanceForText(node) : invariant(!1, "Encountered invalid React node of type %s", typeof node); - return warning("function" == typeof instance.mountComponent && "function" == typeof instance.receiveComponent && "function" == typeof instance.getHostNode && "function" == typeof instance.unmountComponent, "Only React Components can be mounted."), - instance._mountIndex = 0, instance._mountImage = null, instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0, - Object.preventExtensions && Object.preventExtensions(instance), instance; -} - -Object.assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent_1, { - _instantiateReactComponent: instantiateReactComponent -}); - -var instantiateReactComponent_1 = instantiateReactComponent, DevOnlyStubShim = null, ReactNativeFeatureFlags$2 = { - useFiber: !1 -}, ReactNativeFeatureFlags_1 = ReactNativeFeatureFlags$2, ReactNativeFeatureFlags$3 = Object.freeze({ - default: ReactNativeFeatureFlags_1, - __moduleExports: ReactNativeFeatureFlags_1 -}), ReactNativeFeatureFlags$1 = ReactNativeFeatureFlags$3 && ReactNativeFeatureFlags_1 || ReactNativeFeatureFlags$3, ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, injectedFindNode = ReactNativeFeatureFlags$1.useFiber ? function(fiber) { - return DevOnlyStubShim.findHostInstance(fiber); -} : function(instance) { - return instance; -}; - -function findNodeHandle(componentOrHandle) { - var owner = ReactCurrentOwner$2.current; - if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), - owner._warnedAboutRefsInRender = !0), null == componentOrHandle) return null; - if ("number" == typeof componentOrHandle) return componentOrHandle; - var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); - return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), - void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); -} - -var findNodeHandle_1 = findNodeHandle, TopLevelWrapper = function() {}; - -TopLevelWrapper.prototype.isReactComponent = {}, TopLevelWrapper.displayName = "TopLevelWrapper", -TopLevelWrapper.prototype.render = function() { - return this.props.child; -}, TopLevelWrapper.isReactTopLevelWrapper = !0; - -function mountComponentIntoNode(componentInstance, containerTag, transaction) { - var markup = ReactReconciler_1.mountComponent(componentInstance, transaction, null, ReactNativeContainerInfo_1(containerTag), emptyObject, 0); - componentInstance._renderedComponent._topLevelWrapper = componentInstance, ReactNativeMount._mountImageIntoNode(markup, containerTag); -} - -function batchedMountComponentIntoNode(componentInstance, containerTag) { - var transaction = ReactUpdates_1.ReactReconcileTransaction.getPooled(); - transaction.perform(mountComponentIntoNode, null, componentInstance, containerTag, transaction), - ReactUpdates_1.ReactReconcileTransaction.release(transaction); -} - -var ReactNativeMount = { - _instancesByContainerID: {}, - findNodeHandle: findNodeHandle_1, - renderComponent: function(nextElement, containerTag, callback) { - var nextWrappedElement = React.createElement(TopLevelWrapper, { - child: nextElement - }), topRootNodeID = containerTag, prevComponent = ReactNativeMount._instancesByContainerID[topRootNodeID]; - if (prevComponent) { - var prevWrappedElement = prevComponent._currentElement, prevElement = prevWrappedElement.props.child; - if (shouldUpdateReactComponent_1(prevElement, nextElement)) return ReactUpdateQueue_1.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject), - callback && ReactUpdateQueue_1.enqueueCallbackInternal(prevComponent, callback), - prevComponent; - ReactNativeMount.unmountComponentAtNode(containerTag); - } - if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), - null; - ReactNativeTagHandles_1.assertRootTag(containerTag); - var instance = instantiateReactComponent_1(nextWrappedElement, !1); - if (ReactNativeMount._instancesByContainerID[containerTag] = instance, callback) { - var nonNullCallback = callback; - instance._pendingCallbacks = [ function() { - nonNullCallback.call(instance._renderedComponent.getPublicInstance()); - } ]; - } - return ReactUpdates_1.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag), - instance._renderedComponent.getPublicInstance(); - }, - _mountImageIntoNode: function(mountImage, containerID) { - var childTag = mountImage; - UIManager.setChildren(containerID, [ childTag ]); - }, - unmountComponentAtNodeAndRemoveContainer: function(containerTag) { - ReactNativeMount.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); - }, - unmountComponentAtNode: function(containerTag) { - if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), - !1; - var instance = ReactNativeMount._instancesByContainerID[containerTag]; - return !!instance && (ReactInstrumentation.debugTool.onBeginFlush(), ReactNativeMount.unmountComponentFromNode(instance, containerTag), - delete ReactNativeMount._instancesByContainerID[containerTag], ReactInstrumentation.debugTool.onEndFlush(), - !0); - }, - unmountComponentFromNode: function(instance, containerID) { - ReactReconciler_1.unmountComponent(instance), UIManager.removeSubviewsFromContainerWithID(containerID); - } -}, ReactNativeMount_1 = ReactNativeMount, RESET_BATCHED_UPDATES = { - initialize: emptyFunction, - close: function() { - ReactDefaultBatchingStrategy.isBatchingUpdates = !1; - } -}, FLUSH_BATCHED_UPDATES = { - initialize: emptyFunction, - close: ReactUpdates_1.flushBatchedUpdates.bind(ReactUpdates_1) -}, TRANSACTION_WRAPPERS$1 = [ FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES ]; - -function ReactDefaultBatchingStrategyTransaction() { - this.reinitializeTransaction(); -} - -Object.assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, { - getTransactionWrappers: function() { - return TRANSACTION_WRAPPERS$1; - } -}); - -var transaction = new ReactDefaultBatchingStrategyTransaction(), ReactDefaultBatchingStrategy = { - isBatchingUpdates: !1, - batchedUpdates: function(callback, a, b, c, d, e) { - var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; - return ReactDefaultBatchingStrategy.isBatchingUpdates = !0, alreadyBatchingUpdates ? callback(a, b, c, d, e) : transaction.perform(callback, null, a, b, c, d, e); - } -}, ReactDefaultBatchingStrategy_1 = ReactDefaultBatchingStrategy, dangerouslyProcessChildrenUpdates = function(inst, childrenUpdates) { - if (childrenUpdates.length) { - for (var moveFromIndices, moveToIndices, addChildTags, addAtIndices, removeAtIndices, containerTag = ReactNativeComponentTree_1.getNodeFromInstance(inst), i = 0; i < childrenUpdates.length; i++) { - var update = childrenUpdates[i]; - if ("MOVE_EXISTING" === update.type) (moveFromIndices || (moveFromIndices = [])).push(update.fromIndex), - (moveToIndices || (moveToIndices = [])).push(update.toIndex); else if ("REMOVE_NODE" === update.type) (removeAtIndices || (removeAtIndices = [])).push(update.fromIndex); else if ("INSERT_MARKUP" === update.type) { - var mountImage = update.content, tag = mountImage; - (addAtIndices || (addAtIndices = [])).push(update.toIndex), (addChildTags || (addChildTags = [])).push(tag); + }, + _constructComponentWithoutOwner: function(doConstruct, publicProps, publicContext, updateQueue) { + var Component = this._currentElement.type; + return doConstruct ? measureLifeCyclePerf(function() { + return new Component(publicProps, publicContext, updateQueue); + }, this._debugID, "ctor") : measureLifeCyclePerf(function() { + return Component(publicProps, publicContext, updateQueue); + }, this._debugID, "render"); + }, + performInitialMountWithErrorHandling: function(renderedElement, hostParent, hostContainerInfo, transaction, context) { + var markup, checkpoint = transaction.checkpoint(); + try { + markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); + } catch (e) { + transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), + checkpoint = transaction.checkpoint(), this._renderedComponent.unmountComponent(!0, !0), + transaction.rollback(checkpoint), markup = this.performInitialMount(renderedElement, hostParent, hostContainerInfo, transaction, context); } - } - UIManager.manageChildren(containerTag, moveFromIndices, moveToIndices, addChildTags, addAtIndices, removeAtIndices); - } -}, ReactNativeDOMIDOperations = { - dangerouslyProcessChildrenUpdates: dangerouslyProcessChildrenUpdates, - dangerouslyReplaceNodeWithMarkupByID: function(id, mountImage) { - var oldTag = id; - UIManager.replaceExistingNonRootView(oldTag, mountImage); - } -}, ReactNativeDOMIDOperations_1 = ReactNativeDOMIDOperations; - -function validateCallback(callback) { - invariant(!callback || "function" == typeof callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", callback); -} - -var validateCallback_1 = validateCallback; - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); -} - -var CallbackQueue = function() { - function CallbackQueue(arg) { - _classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null, - this._arg = arg; - } - return CallbackQueue.prototype.enqueue = function(callback, context) { - this._callbacks = this._callbacks || [], this._callbacks.push(callback), this._contexts = this._contexts || [], - this._contexts.push(context); - }, CallbackQueue.prototype.notifyAll = function() { - var callbacks = this._callbacks, contexts = this._contexts, arg = this._arg; - if (callbacks && contexts) { - invariant(callbacks.length === contexts.length, "Mismatched list of contexts in callback queue"), - this._callbacks = null, this._contexts = null; - for (var i = 0; i < callbacks.length; i++) validateCallback_1(callbacks[i]), callbacks[i].call(contexts[i], arg); - callbacks.length = 0, contexts.length = 0; - } - }, CallbackQueue.prototype.checkpoint = function() { - return this._callbacks ? this._callbacks.length : 0; - }, CallbackQueue.prototype.rollback = function(len) { - this._callbacks && this._contexts && (this._callbacks.length = len, this._contexts.length = len); - }, CallbackQueue.prototype.reset = function() { - this._callbacks = null, this._contexts = null; - }, CallbackQueue.prototype.destructor = function() { - this.reset(); - }, CallbackQueue; -}(), CallbackQueue_1 = PooledClass_1.addPoolingTo(CallbackQueue), ON_DOM_READY_QUEUEING = { - initialize: function() { - this.reactMountReady.reset(); - }, - close: function() { - this.reactMountReady.notifyAll(); - } -}, TRANSACTION_WRAPPERS$2 = [ ON_DOM_READY_QUEUEING ]; - -TRANSACTION_WRAPPERS$2.push({ - initialize: ReactInstrumentation.debugTool.onBeginFlush, - close: ReactInstrumentation.debugTool.onEndFlush -}); - -function ReactNativeReconcileTransaction() { - this.reinitializeTransaction(), this.reactMountReady = CallbackQueue_1.getPooled(null); -} - -var Mixin = { - getTransactionWrappers: function() { - return TRANSACTION_WRAPPERS$2; - }, - getReactMountReady: function() { - return this.reactMountReady; - }, - getUpdateQueue: function() { - return ReactUpdateQueue_1; - }, - checkpoint: function() { - return this.reactMountReady.checkpoint(); - }, - rollback: function(checkpoint) { - this.reactMountReady.rollback(checkpoint); - }, - destructor: function() { - CallbackQueue_1.release(this.reactMountReady), this.reactMountReady = null; - } -}; - -Object.assign(ReactNativeReconcileTransaction.prototype, Transaction, ReactNativeReconcileTransaction, Mixin), -PooledClass_1.addPoolingTo(ReactNativeReconcileTransaction); - -var ReactNativeReconcileTransaction_1 = ReactNativeReconcileTransaction, ReactNativeComponentEnvironment = { - processChildrenUpdates: ReactNativeDOMIDOperations_1.dangerouslyProcessChildrenUpdates, - replaceNodeWithMarkup: ReactNativeDOMIDOperations_1.dangerouslyReplaceNodeWithMarkupByID, - clearNode: function() {}, - ReactReconcileTransaction: ReactNativeReconcileTransaction_1 -}, ReactNativeComponentEnvironment_1 = ReactNativeComponentEnvironment, ReactNativeTextComponent = function(text) { - this._currentElement = text, this._stringText = "" + text, this._hostParent = null, - this._rootNodeID = 0; -}; - -Object.assign(ReactNativeTextComponent.prototype, { - mountComponent: function(transaction, hostParent, hostContainerInfo, context) { - invariant(context.isInAParentText, 'RawText "%s" must be wrapped in an explicit component.', this._stringText), - this._hostParent = hostParent; - var tag = ReactNativeTagHandles_1.allocateTag(); - this._rootNodeID = tag; - var nativeTopRootTag = hostContainerInfo._tag; - return UIManager.createView(tag, "RCTRawText", nativeTopRootTag, { - text: this._stringText - }), ReactNativeComponentTree_1.precacheNode(this, tag), tag; - }, - getHostNode: function() { - return this._rootNodeID; - }, - receiveComponent: function(nextText, transaction, context) { - if (nextText !== this._currentElement) { - this._currentElement = nextText; - var nextStringText = "" + nextText; - nextStringText !== this._stringText && (this._stringText = nextStringText, UIManager.updateView(this._rootNodeID, "RCTRawText", { - text: this._stringText - })); - } - }, - unmountComponent: function() { - ReactNativeComponentTree_1.uncacheNode(this), this._currentElement = null, this._stringText = null, - this._rootNodeID = 0; - } -}); - -var ReactNativeTextComponent_1 = ReactNativeTextComponent, ReactSimpleEmptyComponent = function(placeholderElement, instantiate) { - this._currentElement = null, this._renderedComponent = instantiate(placeholderElement); -}; - -Object.assign(ReactSimpleEmptyComponent.prototype, { - mountComponent: function(transaction, hostParent, hostContainerInfo, context, parentDebugID) { - return ReactReconciler_1.mountComponent(this._renderedComponent, transaction, hostParent, hostContainerInfo, context, parentDebugID); - }, - receiveComponent: function() {}, - getHostNode: function() { - return ReactReconciler_1.getHostNode(this._renderedComponent); - }, - unmountComponent: function(safely, skipLifecycle) { - ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), - this._renderedComponent = null; - } -}); - -var ReactSimpleEmptyComponent_1 = ReactSimpleEmptyComponent; - -function inject$1() { - ReactGenericBatching_1.injection.injectStackBatchedUpdates(ReactUpdates_1.batchedUpdates), - ReactUpdates_1.injection.injectReconcileTransaction(ReactNativeComponentEnvironment_1.ReactReconcileTransaction), - ReactUpdates_1.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy_1), - ReactComponentEnvironment_1.injection.injectEnvironment(ReactNativeComponentEnvironment_1); - var EmptyComponent = function(instantiate) { - var View = require("View"); - return new ReactSimpleEmptyComponent_1(React.createElement(View, { - collapsable: !0, - style: { - position: "absolute" + return markup; + }, + performInitialMount: function(renderedElement, hostParent, hostContainerInfo, transaction, context) { + void 0 === renderedElement && (renderedElement = this._renderValidatedComponent()); + var nodeType = ReactNodeTypes_1.getType(renderedElement); + this._renderedNodeType = nodeType; + var child = this._instantiateReactComponent(renderedElement, nodeType !== ReactNodeTypes_1.EMPTY); + this._renderedComponent = child; + var debugID = 0; + debugID = this._debugID; + var markup = ReactReconciler_1.mountComponent(child, transaction, hostParent, hostContainerInfo, this._processChildContext(context), debugID); + if (0 !== debugID) { + var childDebugIDs = 0 !== child._debugID ? [ child._debugID ] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); } - }), instantiate); + return markup; + }, + getHostNode: function() { + return ReactReconciler_1.getHostNode(this._renderedComponent); + }, + unmountComponent: function(safely, skipLifecycle) { + if (this._renderedComponent) { + var inst = this._instance; + if (inst.componentWillUnmount && !inst._calledComponentWillUnmount) if (inst._calledComponentWillUnmount = !0, + safely) { + if (!skipLifecycle) { + var name = this.getName() + ".componentWillUnmount()"; + ReactErrorUtils_1.invokeGuardedCallbackAndCatchFirstError(name, inst.componentWillUnmount, inst); + } + } else measureLifeCyclePerf(function() { + return inst.componentWillUnmount(); + }, this._debugID, "componentWillUnmount"); + this._renderedComponent && (ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), + this._renderedNodeType = null, this._renderedComponent = null, this._instance = null), + this._pendingStateQueue = null, this._pendingReplaceState = !1, this._pendingForceUpdate = !1, + this._pendingCallbacks = null, this._pendingElement = null, this._context = null, + this._rootNodeID = 0, this._topLevelWrapper = null, ReactInstanceMap_1.remove(inst); + } + }, + _maskContext: function(context) { + var Component = this._currentElement.type, contextTypes = Component.contextTypes; + if (!contextTypes) return emptyObject; + var maskedContext = {}; + for (var contextName in contextTypes) maskedContext[contextName] = context[contextName]; + return maskedContext; + }, + _processContext: function(context) { + var maskedContext = this._maskContext(context), Component = this._currentElement.type; + return Component.contextTypes && this._checkContextTypes(Component.contextTypes, maskedContext, "context"), + maskedContext; + }, + _processChildContext: function(currentContext) { + var childContext, Component = this._currentElement.type, inst = this._instance; + if ("function" == typeof inst.getChildContext) { + ReactInstrumentation.debugTool.onBeginProcessingChildContext(); + try { + childContext = inst.getChildContext(); + } finally { + ReactInstrumentation.debugTool.onEndProcessingChildContext(); + } + invariant("object" == typeof Component.childContextTypes, "%s.getChildContext(): childContextTypes must be defined in order to " + "use getChildContext().", this.getName() || "ReactCompositeComponent"), + this._checkContextTypes(Component.childContextTypes, childContext, "child context"); + for (var name in childContext) invariant(name in Component.childContextTypes, '%s.getChildContext(): key "%s" is not defined in childContextTypes.', this.getName() || "ReactCompositeComponent", name); + return Object.assign({}, currentContext, childContext); + } + var componentName = this.getName(); + return warningAboutMissingGetChildContext[componentName] || (warningAboutMissingGetChildContext[componentName] = !0, + warning(!Component.childContextTypes, "%s.childContextTypes is specified but there is no getChildContext() method " + "on the instance. You can either define getChildContext() on %s or remove " + "childContextTypes from it.", componentName, componentName)), + currentContext; + }, + _checkContextTypes: function(typeSpecs, values, location) { + ReactDebugCurrentFrame.current = this._debugID, checkPropTypes(typeSpecs, values, location, this.getName(), ReactDebugCurrentFrame.getStackAddendum), + ReactDebugCurrentFrame.current = null; + }, + receiveComponent: function(nextElement, transaction, nextContext) { + var prevElement = this._currentElement, prevContext = this._context; + this._pendingElement = null, this.updateComponent(transaction, prevElement, nextElement, prevContext, nextContext); + }, + performUpdateIfNecessary: function(transaction) { + if (null != this._pendingElement) ReactReconciler_1.receiveComponent(this, this._pendingElement, transaction, this._context); else if (null !== this._pendingStateQueue || this._pendingForceUpdate) this.updateComponent(transaction, this._currentElement, this._currentElement, this._context, this._context); else { + var callbacks = this._pendingCallbacks; + if (this._pendingCallbacks = null, callbacks) for (var j = 0; j < callbacks.length; j++) transaction.getReactMountReady().enqueue(callbacks[j], this.getPublicInstance()); + this._updateBatchNumber = null; + } + }, + updateComponent: function(transaction, prevParentElement, nextParentElement, prevUnmaskedContext, nextUnmaskedContext) { + var inst = this._instance; + invariant(null != inst, "Attempted to update component `%s` that has already been unmounted " + "(or failed to mount).", this.getName() || "ReactCompositeComponent"); + var nextContext, willReceive = !1; + this._context === nextUnmaskedContext ? nextContext = inst.context : (nextContext = this._processContext(nextUnmaskedContext), + willReceive = !0); + var prevProps = prevParentElement.props, nextProps = nextParentElement.props; + if (prevParentElement !== nextParentElement && (willReceive = !0), willReceive && inst.componentWillReceiveProps) { + var beforeState = inst.state; + measureLifeCyclePerf(function() { + return inst.componentWillReceiveProps(nextProps, nextContext); + }, this._debugID, "componentWillReceiveProps"); + var afterState = inst.state; + beforeState !== afterState && (inst.state = beforeState, inst.updater.enqueueReplaceState(inst, afterState), + warning(!1, "%s.componentWillReceiveProps(): Assigning directly to " + "this.state is deprecated (except inside a component's " + "constructor). Use setState instead.", this.getName() || "ReactCompositeComponent")); + } + var callbacks = this._pendingCallbacks; + this._pendingCallbacks = null; + var nextState = this._processPendingState(nextProps, nextContext), shouldUpdate = !0; + if (!this._pendingForceUpdate) { + var prevState = inst.state; + shouldUpdate = willReceive || nextState !== prevState, inst.shouldComponentUpdate ? shouldUpdate = measureLifeCyclePerf(function() { + return inst.shouldComponentUpdate(nextProps, nextState, nextContext); + }, this._debugID, "shouldComponentUpdate") : this._compositeType === ReactCompositeComponentTypes$1.PureClass && (shouldUpdate = !shallowEqual(prevProps, nextProps) || !shallowEqual(inst.state, nextState)); + } + if (warning(void 0 !== shouldUpdate, "%s.shouldComponentUpdate(): Returned undefined instead of a " + "boolean value. Make sure to return true or false.", this.getName() || "ReactCompositeComponent"), + this._updateBatchNumber = null, shouldUpdate ? (this._pendingForceUpdate = !1, this._performComponentUpdate(nextParentElement, nextProps, nextState, nextContext, transaction, nextUnmaskedContext)) : (this._currentElement = nextParentElement, + this._context = nextUnmaskedContext, inst.props = nextProps, inst.state = nextState, + inst.context = nextContext), callbacks) for (var j = 0; j < callbacks.length; j++) transaction.getReactMountReady().enqueue(callbacks[j], this.getPublicInstance()); + }, + _processPendingState: function(props, context) { + var inst = this._instance, queue = this._pendingStateQueue, replace = this._pendingReplaceState; + if (this._pendingReplaceState = !1, this._pendingStateQueue = null, !queue) return inst.state; + if (replace && 1 === queue.length) return queue[0]; + for (var nextState = replace ? queue[0] : inst.state, dontMutate = !0, i = replace ? 1 : 0; i < queue.length; i++) { + var partial = queue[i], partialState = "function" == typeof partial ? partial.call(inst, nextState, props, context) : partial; + partialState && (dontMutate ? (dontMutate = !1, nextState = Object.assign({}, nextState, partialState)) : Object.assign(nextState, partialState)); + } + return nextState; + }, + _performComponentUpdate: function(nextElement, nextProps, nextState, nextContext, transaction, unmaskedContext) { + var prevProps, prevState, _this2 = this, inst = this._instance, hasComponentDidUpdate = !!inst.componentDidUpdate; + hasComponentDidUpdate && (prevProps = inst.props, prevState = inst.state), inst.componentWillUpdate && measureLifeCyclePerf(function() { + return inst.componentWillUpdate(nextProps, nextState, nextContext); + }, this._debugID, "componentWillUpdate"), this._currentElement = nextElement, this._context = unmaskedContext, + inst.props = nextProps, inst.state = nextState, inst.context = nextContext, inst.unstable_handleError ? this._updateRenderedComponentWithErrorHandling(transaction, unmaskedContext) : this._updateRenderedComponent(transaction, unmaskedContext), + hasComponentDidUpdate && transaction.getReactMountReady().enqueue(function() { + measureLifeCyclePerf(inst.componentDidUpdate.bind(inst, prevProps, prevState), _this2._debugID, "componentDidUpdate"); + }); + }, + _updateRenderedComponentWithErrorHandling: function(transaction, context) { + var checkpoint = transaction.checkpoint(); + try { + this._updateRenderedComponent(transaction, context); + } catch (e) { + transaction.rollback(checkpoint), this._instance.unstable_handleError(e), this._pendingStateQueue && (this._instance.state = this._processPendingState(this._instance.props, this._instance.context)), + checkpoint = transaction.checkpoint(), this._updateRenderedComponentWithNextElement(transaction, context, null, !0), + this._updateRenderedComponent(transaction, context); + } + }, + _updateRenderedComponent: function(transaction, context) { + var nextRenderedElement = this._renderValidatedComponent(); + this._updateRenderedComponentWithNextElement(transaction, context, nextRenderedElement, !1); + }, + _updateRenderedComponentWithNextElement: function(transaction, context, nextRenderedElement, safely) { + var prevComponentInstance = this._renderedComponent, prevRenderedElement = prevComponentInstance._currentElement, debugID = 0; + if (debugID = this._debugID, shouldUpdateReactComponent_1(prevRenderedElement, nextRenderedElement)) ReactReconciler_1.receiveComponent(prevComponentInstance, nextRenderedElement, transaction, this._processChildContext(context)); else { + var oldHostNode = ReactReconciler_1.getHostNode(prevComponentInstance), nodeType = ReactNodeTypes_1.getType(nextRenderedElement); + this._renderedNodeType = nodeType; + var child = this._instantiateReactComponent(nextRenderedElement, nodeType !== ReactNodeTypes_1.EMPTY); + this._renderedComponent = child; + var nextMarkup = ReactReconciler_1.mountComponent(child, transaction, this._hostParent, this._hostContainerInfo, this._processChildContext(context), debugID); + if (ReactReconciler_1.unmountComponent(prevComponentInstance, safely, !1), 0 !== debugID) { + var childDebugIDs = 0 !== child._debugID ? [ child._debugID ] : []; + ReactInstrumentation.debugTool.onSetChildren(debugID, childDebugIDs); + } + this._replaceNodeWithMarkup(oldHostNode, nextMarkup, prevComponentInstance); + } + }, + _replaceNodeWithMarkup: function(oldHostNode, nextMarkup, prevInstance) { + ReactComponentEnvironment_1.replaceNodeWithMarkup(oldHostNode, nextMarkup, prevInstance); + }, + _renderValidatedComponentWithoutOwnerOrContext: function() { + var renderedElement, inst = this._instance; + return renderedElement = measureLifeCyclePerf(function() { + return inst.render(); + }, this._debugID, "render"), void 0 === renderedElement && inst.render._isMockFunction && (renderedElement = null), + renderedElement; + }, + _renderValidatedComponent: function() { + var renderedElement; + if (0 && this._compositeType === ReactCompositeComponentTypes$1.StatelessFunctional) renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); else { + ReactCurrentOwner$1.current = this; + try { + renderedElement = this._renderValidatedComponentWithoutOwnerOrContext(); + } finally { + ReactCurrentOwner$1.current = null; + } + } + return invariant(null === renderedElement || !1 === renderedElement || React.isValidElement(renderedElement), "%s.render(): A valid React element (or null) must be returned. You may have " + "returned undefined, an array or some other invalid object.", this.getName() || "ReactCompositeComponent"), + renderedElement; + }, + attachRef: function(ref, component) { + var inst = this.getPublicInstance(); + invariant(null != inst, "Stateless function components cannot have refs."); + var publicComponentInstance = component.getPublicInstance(); + (inst.refs === emptyObject ? inst.refs = {} : inst.refs)[ref] = publicComponentInstance; + }, + detachRef: function(ref) { + delete this.getPublicInstance().refs[ref]; + }, + getName: function() { + var type = this._currentElement.type, constructor = this._instance && this._instance.constructor; + return type.displayName || constructor && constructor.displayName || type.name || constructor && constructor.name || null; + }, + getPublicInstance: function() { + var inst = this._instance; + return this._compositeType === ReactCompositeComponentTypes$1.StatelessFunctional ? null : inst; + }, + _instantiateReactComponent: null + }, ReactCompositeComponent_1 = ReactCompositeComponent, emptyComponentFactory, ReactEmptyComponentInjection = { + injectEmptyComponentFactory: function(factory) { + emptyComponentFactory = factory; + } + }, ReactEmptyComponent = { + create: function(instantiate) { + return emptyComponentFactory(instantiate); + } }; - ReactEmptyComponent_1.injection.injectEmptyComponentFactory(EmptyComponent), ReactHostComponent_1.injection.injectTextComponentClass(ReactNativeTextComponent_1), - ReactHostComponent_1.injection.injectGenericComponentClass(function(tag) { - var info = ""; - "string" == typeof tag && /^[a-z]/.test(tag) && (info += " Each component name should start with an uppercase letter."), - invariant(!1, "Expected a component class, got %s.%s", tag, info); + ReactEmptyComponent.injection = ReactEmptyComponentInjection; + var ReactEmptyComponent_1 = ReactEmptyComponent, genericComponentClass = null, textComponentClass = null, ReactHostComponentInjection = { + injectGenericComponentClass: function(componentClass) { + genericComponentClass = componentClass; + }, + injectTextComponentClass: function(componentClass) { + textComponentClass = componentClass; + } + }; + function createInternalComponent(element) { + return invariant(genericComponentClass, "There is no registered component for the tag %s", element.type), + new genericComponentClass(element); + } + function createInstanceForText(text) { + return new textComponentClass(text); + } + function isTextComponent(component) { + return component instanceof textComponentClass; + } + var ReactHostComponent = { + createInternalComponent: createInternalComponent, + createInstanceForText: createInstanceForText, + isTextComponent: isTextComponent, + injection: ReactHostComponentInjection + }, ReactHostComponent_1 = ReactHostComponent, nextDebugID = 1, ReactCompositeComponentWrapper = function(element) { + this.construct(element); + }; + function getDeclarationErrorAddendum(owner) { + if (owner) { + var name = owner.getName(); + if (name) return "\n\nCheck the render method of `" + name + "`."; + } + return ""; + } + function isInternalComponentType(type) { + return "function" == typeof type && void 0 !== type.prototype && "function" == typeof type.prototype.mountComponent && "function" == typeof type.prototype.receiveComponent; + } + function instantiateReactComponent(node, shouldHaveDebugID) { + var instance; + if (null === node || !1 === node) instance = ReactEmptyComponent_1.create(instantiateReactComponent); else if ("object" == typeof node) { + var element = node, type = element.type; + if ("function" != typeof type && "string" != typeof type) { + var info = ""; + (void 0 === type || "object" == typeof type && null !== type && 0 === Object.keys(type).length) && (info += " You likely forgot to export your component from the file " + "it's defined in."), + info += getDeclarationErrorAddendum(element._owner), invariant(!1, "Element type is invalid: expected a string (for built-in components) " + "or a class/function (for composite components) but got: %s.%s", null == type ? type : typeof type, info); + } + "string" == typeof element.type ? instance = ReactHostComponent_1.createInternalComponent(element) : isInternalComponentType(element.type) ? (instance = new element.type(element), + instance.getHostNode || (instance.getHostNode = instance.getNativeNode)) : instance = new ReactCompositeComponentWrapper(element); + } else "string" == typeof node || "number" == typeof node ? instance = ReactHostComponent_1.createInstanceForText(node) : invariant(!1, "Encountered invalid React node of type %s", typeof node); + return warning("function" == typeof instance.mountComponent && "function" == typeof instance.receiveComponent && "function" == typeof instance.getHostNode && "function" == typeof instance.unmountComponent, "Only React Components can be mounted."), + instance._mountIndex = 0, instance._mountImage = null, instance._debugID = shouldHaveDebugID ? nextDebugID++ : 0, + Object.preventExtensions && Object.preventExtensions(instance), instance; + } + Object.assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent_1, { + _instantiateReactComponent: instantiateReactComponent }); -} - -var ReactNativeStackInjection = { - inject: inject$1 -}; - -function getComponentName(instanceOrFiber) { - if ("function" == typeof instanceOrFiber.getName) { - return instanceOrFiber.getName(); + var instantiateReactComponent_1 = instantiateReactComponent, DevOnlyStubShim = null, ReactNativeFeatureFlags = require("ReactNativeFeatureFlags"), ReactCurrentOwner$2 = ReactGlobalSharedState_1.ReactCurrentOwner, injectedFindNode = ReactNativeFeatureFlags.useFiber ? function(fiber) { + return DevOnlyStubShim.findHostInstance(fiber); + } : function(instance) { + return instance; + }; + function findNodeHandle(componentOrHandle) { + var owner = ReactCurrentOwner$2.current; + if (null !== owner && (warning(owner._warnedAboutRefsInRender, "%s is accessing findNodeHandle inside its render(). " + "render() should be a pure function of props and state. It should " + "never access something that requires stale data from the previous " + "render, such as refs. Move this logic to componentDidMount and " + "componentDidUpdate instead.", owner.getName() || "A component"), + owner._warnedAboutRefsInRender = !0), null == componentOrHandle) return null; + if ("number" == typeof componentOrHandle) return componentOrHandle; + var component = componentOrHandle, internalInstance = ReactInstanceMap_1.get(component); + return internalInstance ? injectedFindNode(internalInstance) : component || (invariant("object" == typeof component && ("_rootNodeID" in component || "_nativeTag" in component) || null != component.render && "function" == typeof component.render, "findNodeHandle(...): Argument is not a component " + "(type: %s, keys: %s)", typeof component, Object.keys(component)), + void invariant(!1, "findNodeHandle(...): Unable to find node handle for unmounted " + "component.")); } - if ("number" == typeof instanceOrFiber.tag) { - var fiber = instanceOrFiber, type = fiber.type; - if ("string" == typeof type) return type; - if ("function" == typeof type) return type.displayName || type.name; + var findNodeHandle_1 = findNodeHandle, TopLevelWrapper = function() {}; + TopLevelWrapper.prototype.isReactComponent = {}, TopLevelWrapper.displayName = "TopLevelWrapper", + TopLevelWrapper.prototype.render = function() { + return this.props.child; + }, TopLevelWrapper.isReactTopLevelWrapper = !0; + function mountComponentIntoNode(componentInstance, containerTag, transaction) { + var markup = ReactReconciler_1.mountComponent(componentInstance, transaction, null, ReactNativeContainerInfo_1(containerTag), emptyObject, 0); + componentInstance._renderedComponent._topLevelWrapper = componentInstance, ReactNativeMount._mountImageIntoNode(markup, containerTag); } - return null; -} - -var getComponentName_1 = getComponentName, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) { - instance && (hierarchy.unshift(instance), traverseOwnerTreeUp(hierarchy, instance._currentElement._owner)); -}, getOwnerHierarchy = function(instance) { - var hierarchy = []; - return traverseOwnerTreeUp(hierarchy, instance), hierarchy; -}, lastNotNativeInstance = function(hierarchy) { - for (var i = hierarchy.length - 1; i > 1; i--) { - var instance = hierarchy[i]; - if (!instance.viewConfig) return instance; + function batchedMountComponentIntoNode(componentInstance, containerTag) { + var transaction = ReactUpdates_1.ReactReconcileTransaction.getPooled(); + transaction.perform(mountComponentIntoNode, null, componentInstance, containerTag, transaction), + ReactUpdates_1.ReactReconcileTransaction.release(transaction); } - return hierarchy[0]; -}, getHostProps = function(component) { - var instance = component._instance; - return instance ? instance.props || emptyObject : emptyObject; -}, createHierarchy = function(componentHierarchy) { - return componentHierarchy.map(function(component) { + var ReactNativeMount = { + _instancesByContainerID: {}, + findNodeHandle: findNodeHandle_1, + renderComponent: function(nextElement, containerTag, callback) { + var nextWrappedElement = React.createElement(TopLevelWrapper, { + child: nextElement + }), topRootNodeID = containerTag, prevComponent = ReactNativeMount._instancesByContainerID[topRootNodeID]; + if (prevComponent) { + var prevWrappedElement = prevComponent._currentElement, prevElement = prevWrappedElement.props.child; + if (shouldUpdateReactComponent_1(prevElement, nextElement)) return ReactUpdateQueue_1.enqueueElementInternal(prevComponent, nextWrappedElement, emptyObject), + callback && ReactUpdateQueue_1.enqueueCallbackInternal(prevComponent, callback), + prevComponent; + ReactNativeMount.unmountComponentAtNode(containerTag); + } + if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), + null; + ReactNativeTagHandles_1.assertRootTag(containerTag); + var instance = instantiateReactComponent_1(nextWrappedElement, !1); + if (ReactNativeMount._instancesByContainerID[containerTag] = instance, callback) { + var nonNullCallback = callback; + instance._pendingCallbacks = [ function() { + nonNullCallback.call(instance._renderedComponent.getPublicInstance()); + } ]; + } + return ReactUpdates_1.batchedUpdates(batchedMountComponentIntoNode, instance, containerTag), + instance._renderedComponent.getPublicInstance(); + }, + _mountImageIntoNode: function(mountImage, containerID) { + var childTag = mountImage; + UIManager.setChildren(containerID, [ childTag ]); + }, + unmountComponentAtNodeAndRemoveContainer: function(containerTag) { + ReactNativeMount.unmountComponentAtNode(containerTag), UIManager.removeRootView(containerTag); + }, + unmountComponentAtNode: function(containerTag) { + if (!ReactNativeTagHandles_1.reactTagIsNativeTopRootID(containerTag)) return console.error("You cannot render into anything but a top root"), + !1; + var instance = ReactNativeMount._instancesByContainerID[containerTag]; + return !!instance && (ReactInstrumentation.debugTool.onBeginFlush(), ReactNativeMount.unmountComponentFromNode(instance, containerTag), + delete ReactNativeMount._instancesByContainerID[containerTag], ReactInstrumentation.debugTool.onEndFlush(), + !0); + }, + unmountComponentFromNode: function(instance, containerID) { + ReactReconciler_1.unmountComponent(instance), UIManager.removeSubviewsFromContainerWithID(containerID); + } + }, ReactNativeMount_1 = ReactNativeMount, RESET_BATCHED_UPDATES = { + initialize: emptyFunction, + close: function() { + ReactDefaultBatchingStrategy.isBatchingUpdates = !1; + } + }, FLUSH_BATCHED_UPDATES = { + initialize: emptyFunction, + close: ReactUpdates_1.flushBatchedUpdates.bind(ReactUpdates_1) + }, TRANSACTION_WRAPPERS$1 = [ FLUSH_BATCHED_UPDATES, RESET_BATCHED_UPDATES ]; + function ReactDefaultBatchingStrategyTransaction() { + this.reinitializeTransaction(); + } + Object.assign(ReactDefaultBatchingStrategyTransaction.prototype, Transaction, { + getTransactionWrappers: function() { + return TRANSACTION_WRAPPERS$1; + } + }); + var transaction = new ReactDefaultBatchingStrategyTransaction(), ReactDefaultBatchingStrategy = { + isBatchingUpdates: !1, + batchedUpdates: function(callback, a, b, c, d, e) { + var alreadyBatchingUpdates = ReactDefaultBatchingStrategy.isBatchingUpdates; + return ReactDefaultBatchingStrategy.isBatchingUpdates = !0, alreadyBatchingUpdates ? callback(a, b, c, d, e) : transaction.perform(callback, null, a, b, c, d, e); + } + }, ReactDefaultBatchingStrategy_1 = ReactDefaultBatchingStrategy, dangerouslyProcessChildrenUpdates = function(inst, childrenUpdates) { + if (childrenUpdates.length) { + for (var moveFromIndices, moveToIndices, addChildTags, addAtIndices, removeAtIndices, containerTag = ReactNativeComponentTree_1.getNodeFromInstance(inst), i = 0; i < childrenUpdates.length; i++) { + var update = childrenUpdates[i]; + if ("MOVE_EXISTING" === update.type) (moveFromIndices || (moveFromIndices = [])).push(update.fromIndex), + (moveToIndices || (moveToIndices = [])).push(update.toIndex); else if ("REMOVE_NODE" === update.type) (removeAtIndices || (removeAtIndices = [])).push(update.fromIndex); else if ("INSERT_MARKUP" === update.type) { + var mountImage = update.content, tag = mountImage; + (addAtIndices || (addAtIndices = [])).push(update.toIndex), (addChildTags || (addChildTags = [])).push(tag); + } + } + UIManager.manageChildren(containerTag, moveFromIndices, moveToIndices, addChildTags, addAtIndices, removeAtIndices); + } + }, ReactNativeDOMIDOperations = { + dangerouslyProcessChildrenUpdates: dangerouslyProcessChildrenUpdates, + dangerouslyReplaceNodeWithMarkupByID: function(id, mountImage) { + var oldTag = id; + UIManager.replaceExistingNonRootView(oldTag, mountImage); + } + }, ReactNativeDOMIDOperations_1 = ReactNativeDOMIDOperations; + function validateCallback(callback) { + invariant(!callback || "function" == typeof callback, "Invalid argument passed as callback. Expected a function. Instead " + "received: %s", callback); + } + var validateCallback_1 = validateCallback; + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); + } + var CallbackQueue = function() { + function CallbackQueue(arg) { + _classCallCheck(this, CallbackQueue), this._callbacks = null, this._contexts = null, + this._arg = arg; + } + return CallbackQueue.prototype.enqueue = function(callback, context) { + this._callbacks = this._callbacks || [], this._callbacks.push(callback), this._contexts = this._contexts || [], + this._contexts.push(context); + }, CallbackQueue.prototype.notifyAll = function() { + var callbacks = this._callbacks, contexts = this._contexts, arg = this._arg; + if (callbacks && contexts) { + invariant(callbacks.length === contexts.length, "Mismatched list of contexts in callback queue"), + this._callbacks = null, this._contexts = null; + for (var i = 0; i < callbacks.length; i++) validateCallback_1(callbacks[i]), callbacks[i].call(contexts[i], arg); + callbacks.length = 0, contexts.length = 0; + } + }, CallbackQueue.prototype.checkpoint = function() { + return this._callbacks ? this._callbacks.length : 0; + }, CallbackQueue.prototype.rollback = function(len) { + this._callbacks && this._contexts && (this._callbacks.length = len, this._contexts.length = len); + }, CallbackQueue.prototype.reset = function() { + this._callbacks = null, this._contexts = null; + }, CallbackQueue.prototype.destructor = function() { + this.reset(); + }, CallbackQueue; + }(), CallbackQueue_1 = PooledClass_1.addPoolingTo(CallbackQueue), ON_DOM_READY_QUEUEING = { + initialize: function() { + this.reactMountReady.reset(); + }, + close: function() { + this.reactMountReady.notifyAll(); + } + }, TRANSACTION_WRAPPERS$2 = [ ON_DOM_READY_QUEUEING ]; + TRANSACTION_WRAPPERS$2.push({ + initialize: ReactInstrumentation.debugTool.onBeginFlush, + close: ReactInstrumentation.debugTool.onEndFlush + }); + function ReactNativeReconcileTransaction() { + this.reinitializeTransaction(), this.reactMountReady = CallbackQueue_1.getPooled(null); + } + var Mixin = { + getTransactionWrappers: function() { + return TRANSACTION_WRAPPERS$2; + }, + getReactMountReady: function() { + return this.reactMountReady; + }, + getUpdateQueue: function() { + return ReactUpdateQueue_1; + }, + checkpoint: function() { + return this.reactMountReady.checkpoint(); + }, + rollback: function(checkpoint) { + this.reactMountReady.rollback(checkpoint); + }, + destructor: function() { + CallbackQueue_1.release(this.reactMountReady), this.reactMountReady = null; + } + }; + Object.assign(ReactNativeReconcileTransaction.prototype, Transaction, ReactNativeReconcileTransaction, Mixin), + PooledClass_1.addPoolingTo(ReactNativeReconcileTransaction); + var ReactNativeReconcileTransaction_1 = ReactNativeReconcileTransaction, ReactNativeComponentEnvironment = { + processChildrenUpdates: ReactNativeDOMIDOperations_1.dangerouslyProcessChildrenUpdates, + replaceNodeWithMarkup: ReactNativeDOMIDOperations_1.dangerouslyReplaceNodeWithMarkupByID, + clearNode: function() {}, + ReactReconcileTransaction: ReactNativeReconcileTransaction_1 + }, ReactNativeComponentEnvironment_1 = ReactNativeComponentEnvironment, ReactNativeTextComponent = function(text) { + this._currentElement = text, this._stringText = "" + text, this._hostParent = null, + this._rootNodeID = 0; + }; + Object.assign(ReactNativeTextComponent.prototype, { + mountComponent: function(transaction, hostParent, hostContainerInfo, context) { + invariant(context.isInAParentText, 'RawText "%s" must be wrapped in an explicit component.', this._stringText), + this._hostParent = hostParent; + var tag = ReactNativeTagHandles_1.allocateTag(); + this._rootNodeID = tag; + var nativeTopRootTag = hostContainerInfo._tag; + return UIManager.createView(tag, "RCTRawText", nativeTopRootTag, { + text: this._stringText + }), ReactNativeComponentTree_1.precacheNode(this, tag), tag; + }, + getHostNode: function() { + return this._rootNodeID; + }, + receiveComponent: function(nextText, transaction, context) { + if (nextText !== this._currentElement) { + this._currentElement = nextText; + var nextStringText = "" + nextText; + nextStringText !== this._stringText && (this._stringText = nextStringText, UIManager.updateView(this._rootNodeID, "RCTRawText", { + text: this._stringText + })); + } + }, + unmountComponent: function() { + ReactNativeComponentTree_1.uncacheNode(this), this._currentElement = null, this._stringText = null, + this._rootNodeID = 0; + } + }); + var ReactNativeTextComponent_1 = ReactNativeTextComponent, ReactSimpleEmptyComponent = function(placeholderElement, instantiate) { + this._currentElement = null, this._renderedComponent = instantiate(placeholderElement); + }; + Object.assign(ReactSimpleEmptyComponent.prototype, { + mountComponent: function(transaction, hostParent, hostContainerInfo, context, parentDebugID) { + return ReactReconciler_1.mountComponent(this._renderedComponent, transaction, hostParent, hostContainerInfo, context, parentDebugID); + }, + receiveComponent: function() {}, + getHostNode: function() { + return ReactReconciler_1.getHostNode(this._renderedComponent); + }, + unmountComponent: function(safely, skipLifecycle) { + ReactReconciler_1.unmountComponent(this._renderedComponent, safely, skipLifecycle), + this._renderedComponent = null; + } + }); + var ReactSimpleEmptyComponent_1 = ReactSimpleEmptyComponent; + function inject$1() { + ReactGenericBatching_1.injection.injectStackBatchedUpdates(ReactUpdates_1.batchedUpdates), + ReactUpdates_1.injection.injectReconcileTransaction(ReactNativeComponentEnvironment_1.ReactReconcileTransaction), + ReactUpdates_1.injection.injectBatchingStrategy(ReactDefaultBatchingStrategy_1), + ReactComponentEnvironment_1.injection.injectEnvironment(ReactNativeComponentEnvironment_1); + var EmptyComponent = function(instantiate) { + var View = require("View"); + return new ReactSimpleEmptyComponent_1(React.createElement(View, { + collapsable: !0, + style: { + position: "absolute" + } + }), instantiate); + }; + ReactEmptyComponent_1.injection.injectEmptyComponentFactory(EmptyComponent), ReactHostComponent_1.injection.injectTextComponentClass(ReactNativeTextComponent_1), + ReactHostComponent_1.injection.injectGenericComponentClass(function(tag) { + var info = ""; + "string" == typeof tag && /^[a-z]/.test(tag) && (info += " Each component name should start with an uppercase letter."), + invariant(!1, "Expected a component class, got %s.%s", tag, info); + }); + } + var ReactNativeStackInjection = { + inject: inject$1 + }; + function getComponentName(instanceOrFiber) { + if ("function" == typeof instanceOrFiber.getName) { + return instanceOrFiber.getName(); + } + if ("number" == typeof instanceOrFiber.tag) { + var fiber = instanceOrFiber, type = fiber.type; + if ("string" == typeof type) return type; + if ("function" == typeof type) return type.displayName || type.name; + } + return null; + } + var getComponentName_1 = getComponentName, getInspectorDataForViewTag = void 0, traverseOwnerTreeUp = function(hierarchy, instance) { + instance && (hierarchy.unshift(instance), traverseOwnerTreeUp(hierarchy, instance._currentElement._owner)); + }, getOwnerHierarchy = function(instance) { + var hierarchy = []; + return traverseOwnerTreeUp(hierarchy, instance), hierarchy; + }, lastNotNativeInstance = function(hierarchy) { + for (var i = hierarchy.length - 1; i > 1; i--) { + var instance = hierarchy[i]; + if (!instance.viewConfig) return instance; + } + return hierarchy[0]; + }, getHostProps = function(component) { + var instance = component._instance; + return instance ? instance.props || emptyObject : emptyObject; + }, createHierarchy = function(componentHierarchy) { + return componentHierarchy.map(function(component) { + return { + name: getComponentName_1(component), + getInspectorData: function() { + return { + measure: function(callback) { + return UIManager.measure(component.getHostNode(), callback); + }, + props: getHostProps(component), + source: component._currentElement && component._currentElement._source + }; + } + }; + }); + }; + getInspectorDataForViewTag = function(viewTag) { + var component = ReactNativeComponentTree_1.getClosestInstanceFromNode(viewTag); + if (!component) return { + hierarchy: [], + props: emptyObject, + selection: null, + source: null + }; + var componentHierarchy = getOwnerHierarchy(component), instance = lastNotNativeInstance(componentHierarchy), hierarchy = createHierarchy(componentHierarchy), props = getHostProps(instance), source = instance._currentElement && instance._currentElement._source; return { - name: getComponentName_1(component), - getInspectorData: function() { - return { - measure: function(callback) { - return UIManager.measure(component.getHostNode(), callback); - }, - props: getHostProps(component), - source: component._currentElement && component._currentElement._source - }; + hierarchy: hierarchy, + props: props, + selection: componentHierarchy.indexOf(instance), + source: source + }; + }; + var ReactNativeStackInspector = { + getInspectorDataForViewTag: getInspectorDataForViewTag + }, findNumericNodeHandleStack = function(componentOrHandle) { + var nodeHandle = findNodeHandle_1(componentOrHandle); + return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode(); + }; + function _classCallCheck$2(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); + } + var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { + function ReactNativePropRegistry() { + _classCallCheck$2(this, ReactNativePropRegistry); + } + return ReactNativePropRegistry.register = function(object) { + var id = ++uniqueID; + return Object.freeze(object), objects[id] = object, id; + }, ReactNativePropRegistry.getByID = function(id) { + if (!id) return emptyObject$3; + var object = objects[id]; + return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), + emptyObject$3); + }, ReactNativePropRegistry; + }(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; + function defaultDiffer(prevProp, nextProp) { + return "object" != typeof nextProp || null === nextProp || deepDiffer(prevProp, nextProp); + } + function resolveObject(idOrObject) { + return "number" == typeof idOrObject ? ReactNativePropRegistry_1.getByID(idOrObject) : idOrObject; + } + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (Array.isArray(node)) for (var i = node.length; i-- && removedKeyCount > 0; ) restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); else if (node && removedKeyCount > 0) { + var obj = resolveObject(node); + for (var propKey in removedKeys) if (removedKeys[propKey]) { + var nextProp = obj[propKey]; + if (void 0 !== nextProp) { + var attributeConfig = validAttributes[propKey]; + if (attributeConfig) { + if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), + "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { + var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + removedKeys[propKey] = !1, removedKeyCount--; + } + } + } + } + } + function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { + var i, minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; + for (i = 0; i < minLength; i++) updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); + for (;i < prevArray.length; i++) updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); + for (;i < nextArray.length; i++) updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); + return updatePayload; + } + function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + return updatePayload || prevProp !== nextProp ? prevProp && nextProp ? Array.isArray(prevProp) || Array.isArray(nextProp) ? Array.isArray(prevProp) && Array.isArray(nextProp) ? diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes) : Array.isArray(prevProp) ? diffProperties(updatePayload, flattenStyle(prevProp), resolveObject(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), flattenStyle(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), resolveObject(nextProp), validAttributes) : nextProp ? addNestedProperty(updatePayload, nextProp, validAttributes) : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload : updatePayload; + } + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) return updatePayload; + if (!Array.isArray(nextProp)) return addProperties(updatePayload, resolveObject(nextProp), validAttributes); + for (var i = 0; i < nextProp.length; i++) updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + return updatePayload; + } + function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) return updatePayload; + if (!Array.isArray(prevProp)) return clearProperties(updatePayload, resolveObject(prevProp), validAttributes); + for (var i = 0; i < prevProp.length; i++) updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + return updatePayload; + } + function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig, nextProp, prevProp; + for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], + nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, + "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, + void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), + updatePayload && void 0 !== updatePayload[propKey]) { + if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { + var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; + updatePayload[propKey] = nextValue; + } + } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { + var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); + shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, + (updatePayload || (updatePayload = {}))[propKey] = nextValue); + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), + removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), + removedKeys = null); + for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, + removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, + removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); + return updatePayload; + } + function addProperties(updatePayload, props, validAttributes) { + return diffProperties(updatePayload, emptyObject$2, props, validAttributes); + } + function clearProperties(updatePayload, prevProps, validAttributes) { + return diffProperties(updatePayload, prevProps, emptyObject$2, validAttributes); + } + var ReactNativeAttributePayload = { + create: function(props, validAttributes) { + return addProperties(null, props, validAttributes); + }, + diff: function(prevProps, nextProps, validAttributes) { + return diffProperties(null, prevProps, nextProps, validAttributes); + } + }, ReactNativeAttributePayload_1 = ReactNativeAttributePayload; + function mountSafeCallback$1(context, callback) { + return function() { + if (callback) { + if ("boolean" == typeof context.__isMounted) { + if (!context.__isMounted) return; + } else if ("function" == typeof context.isMounted && !context.isMounted()) return; + return callback.apply(context, arguments); } }; - }); -}; - -getInspectorDataForViewTag = function(viewTag) { - var component = ReactNativeComponentTree_1.getClosestInstanceFromNode(viewTag); - if (!component) return { - hierarchy: [], - props: emptyObject, - selection: null, - source: null - }; - var componentHierarchy = getOwnerHierarchy(component), instance = lastNotNativeInstance(componentHierarchy), hierarchy = createHierarchy(componentHierarchy), props = getHostProps(instance), source = instance._currentElement && instance._currentElement._source; - return { - hierarchy: hierarchy, - props: props, - selection: componentHierarchy.indexOf(instance), - source: source - }; -}; - -var ReactNativeStackInspector = { - getInspectorDataForViewTag: getInspectorDataForViewTag -}, findNumericNodeHandleStack = function(componentOrHandle) { - var nodeHandle = findNodeHandle_1(componentOrHandle); - return null == nodeHandle || "number" == typeof nodeHandle ? nodeHandle : nodeHandle.getHostNode(); -}; - -function _classCallCheck$2(instance, Constructor) { - if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); -} - -var objects = {}, uniqueID = 1, emptyObject$3 = {}, ReactNativePropRegistry = function() { - function ReactNativePropRegistry() { - _classCallCheck$2(this, ReactNativePropRegistry); } - return ReactNativePropRegistry.register = function(object) { - var id = ++uniqueID; - return Object.freeze(object), objects[id] = object, id; - }, ReactNativePropRegistry.getByID = function(id) { - if (!id) return emptyObject$3; - var object = objects[id]; - return object || (console.warn("Invalid style with id `" + id + "`. Skipping ..."), - emptyObject$3); - }, ReactNativePropRegistry; -}(), ReactNativePropRegistry_1 = ReactNativePropRegistry, emptyObject$2 = {}, removedKeys = null, removedKeyCount = 0; - -function defaultDiffer(prevProp, nextProp) { - return "object" != typeof nextProp || null === nextProp || deepDiffer(prevProp, nextProp); -} - -function resolveObject(idOrObject) { - return "number" == typeof idOrObject ? ReactNativePropRegistry_1.getByID(idOrObject) : idOrObject; -} - -function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { - if (Array.isArray(node)) for (var i = node.length; i-- && removedKeyCount > 0; ) restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); else if (node && removedKeyCount > 0) { - var obj = resolveObject(node); - for (var propKey in removedKeys) if (removedKeys[propKey]) { - var nextProp = obj[propKey]; - if (void 0 !== nextProp) { - var attributeConfig = validAttributes[propKey]; - if (attributeConfig) { - if ("function" == typeof nextProp && (nextProp = !0), void 0 === nextProp && (nextProp = null), - "object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { - var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; - updatePayload[propKey] = nextValue; + function throwOnStylesProp(component, props) { + if (void 0 !== props.styles) { + var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; + throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), + new Error(msg); + } + } + function warnForStyleProps(props, validAttributes) { + for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); + } + var NativeMethodsMixinUtils = { + mountSafeCallback: mountSafeCallback$1, + throwOnStylesProp: throwOnStylesProp, + warnForStyleProps: warnForStyleProps + }; + function _classCallCheck$1(instance, Constructor) { + if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); + } + function _possibleConstructorReturn(self, call) { + if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + return !call || "object" != typeof call && "function" != typeof call ? self : call; + } + function _inherits(subClass, superClass) { + if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: !1, + writable: !0, + configurable: !0 + } + }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); + } + var ReactNativeFeatureFlags$1 = require("ReactNativeFeatureFlags"), mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) { + _inherits(ReactNativeComponent, _React$Component); + function ReactNativeComponent() { + return _classCallCheck$1(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + return ReactNativeComponent.prototype.blur = function() { + TextInputState.blurTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.focus = function() { + TextInputState.focusTextInput(findNumericNodeHandle(this)); + }, ReactNativeComponent.prototype.measure = function(callback) { + UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback)); + }, ReactNativeComponent.prototype.measureInWindow = function(callback) { + UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback)); + }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); + }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { + injectedSetNativeProps(this, nativeProps); + }, ReactNativeComponent; + }(React.Component); + function setNativePropsFiber(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } + } + function setNativePropsStack(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } + } + var injectedSetNativeProps = void 0; + injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; + var ReactNativeComponent_1 = ReactNativeComponent, ReactNativeFeatureFlags$2 = require("ReactNativeFeatureFlags"), mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$1 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$2.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { + measure: function(callback) { + UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); + }, + measureInWindow: function(callback) { + UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); + }, + measureLayout: function(relativeToNativeNode, onSuccess, onFail) { + UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); + }, + setNativeProps: function(nativeProps) { + injectedSetNativeProps$1(this, nativeProps); + }, + focus: function() { + TextInputState.focusTextInput(findNumericNodeHandle$1(this)); + }, + blur: function() { + TextInputState.blurTextInput(findNumericNodeHandle$1(this)); + } + }; + function setNativePropsFiber$1(componentOrHandle, nativeProps) { + var maybeInstance = void 0; + try { + maybeInstance = findNodeHandle_1(componentOrHandle); + } catch (error) {} + if (null != maybeInstance) { + var viewConfig = maybeInstance.viewConfig; + warnForStyleProps$1(nativeProps, viewConfig.validAttributes); + var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } + } + function setNativePropsStack$1(componentOrHandle, nativeProps) { + var maybeInstance = findNodeHandle_1(componentOrHandle); + if (null != maybeInstance) { + var viewConfig = void 0; + if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { + for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; + viewConfig = maybeInstance.viewConfig; + } + var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID; + warnForStyleProps$1(nativeProps, viewConfig.validAttributes); + var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); + UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); + } + } + var injectedSetNativeProps$1 = void 0; + injectedSetNativeProps$1 = ReactNativeFeatureFlags$2.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; + var NativeMethodsMixin_DEV = NativeMethodsMixin; + invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), + NativeMethodsMixin_DEV.componentWillMount = function() { + throwOnStylesProp$1(this, this.props); + }, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) { + throwOnStylesProp$1(this, newProps); + }; + var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { + centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { + var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; + if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, + count = 1); else for (var i = 0; i < touchBank.length; i++) { + var touchTrack = touchBank[i]; + if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { + var toAdd; + toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, + total += toAdd, count++; + } + } + return count > 0 ? total / count : TouchHistoryMath.noCentroid; + }, + currentCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !0); + }, + currentCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !0); + }, + previousCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !1); + }, + previousCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !1); + }, + currentCentroidX: function(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, !0, !0); + }, + currentCentroidY: function(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, !1, !0); + }, + noCentroid: -1 + }, TouchHistoryMath_1 = TouchHistoryMath; + function escape(key) { + var escaperLookup = { + "=": "=0", + ":": "=2" + }; + return "$" + ("" + key).replace(/[=:]/g, function(match) { + return escaperLookup[match]; + }); + } + var unescapeInDev = emptyFunction; + unescapeInDev = function(key) { + var unescapeRegex = /(=0|=2)/g, unescaperLookup = { + "=0": "=", + "=2": ":" + }; + return ("" + ("." === key[0] && "$" === key[1] ? key.substring(2) : key.substring(1))).replace(unescapeRegex, function(match) { + return unescaperLookup[match]; + }); + }; + var KeyEscapeUtils = { + escape: escape, + unescapeInDev: unescapeInDev + }, KeyEscapeUtils_1 = KeyEscapeUtils, ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, getCurrentStackAddendum = ReactGlobalSharedState_1.ReactComponentTreeHook.getCurrentStackAddendum, SEPARATOR = ".", SUBSEPARATOR = ":", didWarnAboutMaps = !1; + function getComponentKey(component, index) { + return component && "object" == typeof component && null != component.key ? KeyEscapeUtils_1.escape(component.key) : index.toString(36); + } + function traverseStackChildrenImpl(children, nameSoFar, callback, traverseContext) { + var type = typeof children; + if ("undefined" !== type && "boolean" !== type || (children = null), null === children || "string" === type || "number" === type || "object" === type && children.$$typeof === REACT_ELEMENT_TYPE) return callback(traverseContext, children, "" === nameSoFar ? SEPARATOR + getComponentKey(children, 0) : nameSoFar), + 1; + var child, nextName, subtreeCount = 0, nextNamePrefix = "" === nameSoFar ? SEPARATOR : nameSoFar + SUBSEPARATOR; + if (Array.isArray(children)) for (var i = 0; i < children.length; i++) child = children[i], + nextName = nextNamePrefix + getComponentKey(child, i), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); else { + var iteratorFn = ITERATOR_SYMBOL && children[ITERATOR_SYMBOL] || children[FAUX_ITERATOR_SYMBOL]; + if ("function" == typeof iteratorFn) { + iteratorFn === children.entries && (warning(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentStackAddendum()), + didWarnAboutMaps = !0); + for (var step, iterator = iteratorFn.call(children), ii = 0; !(step = iterator.next()).done; ) child = step.value, + nextName = nextNamePrefix + getComponentKey(child, ii++), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); + } else if ("object" === type) { + var addendum = ""; + addendum = " If you meant to render a collection of children, use an array " + "instead." + getCurrentStackAddendum(); + var childrenString = "" + children; + invariant(!1, "Objects are not valid as a React child (found: %s).%s", "[object Object]" === childrenString ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString, addendum); + } + } + return subtreeCount; + } + function traverseStackChildren(children, callback, traverseContext) { + return null == children ? 0 : traverseStackChildrenImpl(children, "", callback, traverseContext); + } + var traverseStackChildren_1 = traverseStackChildren, ReactComponentTreeHook$2; + "undefined" != typeof process && process.env && "development" == "test" && (ReactComponentTreeHook$2 = ReactGlobalSharedState_1.ReactComponentTreeHook); + function instantiateChild(childInstances, child, name, selfDebugID) { + var keyUnique = void 0 === childInstances[name]; + ReactComponentTreeHook$2 || (ReactComponentTreeHook$2 = ReactGlobalSharedState_1.ReactComponentTreeHook), + keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescapeInDev(name), ReactComponentTreeHook$2.getStackAddendumByID(selfDebugID)), + null != child && keyUnique && (childInstances[name] = instantiateReactComponent_1(child, !0)); + } + var ReactChildReconciler = { + instantiateChildren: function(nestedChildNodes, transaction, context, selfDebugID) { + if (null == nestedChildNodes) return null; + var childInstances = {}; + return traverseStackChildren_1(nestedChildNodes, function(childInsts, child, name) { + return instantiateChild(childInsts, child, name, selfDebugID); + }, childInstances), childInstances; + }, + updateChildren: function(prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) { + if (nextChildren || prevChildren) { + var name, prevChild; + for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { + prevChild = prevChildren && prevChildren[name]; + var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name]; + if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), + nextChildren[name] = prevChild; else { + var nextChildInstance = instantiateReactComponent_1(nextElement, !0); + nextChildren[name] = nextChildInstance; + var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); + mountImages.push(nextChildMountImage), prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), + ReactReconciler_1.unmountComponent(prevChild, !1, !1)); } - removedKeys[propKey] = !1, removedKeyCount--; } + for (name in prevChildren) !prevChildren.hasOwnProperty(name) || nextChildren && nextChildren.hasOwnProperty(name) || (prevChild = prevChildren[name], + removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), ReactReconciler_1.unmountComponent(prevChild, !1, !1)); + } + }, + unmountChildren: function(renderedChildren, safely, skipLifecycle) { + for (var name in renderedChildren) if (renderedChildren.hasOwnProperty(name)) { + var renderedChild = renderedChildren[name]; + ReactReconciler_1.unmountComponent(renderedChild, safely, skipLifecycle); } } - } -} - -function diffNestedArrayProperty(updatePayload, prevArray, nextArray, validAttributes) { - var i, minLength = prevArray.length < nextArray.length ? prevArray.length : nextArray.length; - for (i = 0; i < minLength; i++) updatePayload = diffNestedProperty(updatePayload, prevArray[i], nextArray[i], validAttributes); - for (;i < prevArray.length; i++) updatePayload = clearNestedProperty(updatePayload, prevArray[i], validAttributes); - for (;i < nextArray.length; i++) updatePayload = addNestedProperty(updatePayload, nextArray[i], validAttributes); - return updatePayload; -} - -function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { - return updatePayload || prevProp !== nextProp ? prevProp && nextProp ? Array.isArray(prevProp) || Array.isArray(nextProp) ? Array.isArray(prevProp) && Array.isArray(nextProp) ? diffNestedArrayProperty(updatePayload, prevProp, nextProp, validAttributes) : Array.isArray(prevProp) ? diffProperties(updatePayload, flattenStyle(prevProp), resolveObject(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), flattenStyle(nextProp), validAttributes) : diffProperties(updatePayload, resolveObject(prevProp), resolveObject(nextProp), validAttributes) : nextProp ? addNestedProperty(updatePayload, nextProp, validAttributes) : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload : updatePayload; -} - -function addNestedProperty(updatePayload, nextProp, validAttributes) { - if (!nextProp) return updatePayload; - if (!Array.isArray(nextProp)) return addProperties(updatePayload, resolveObject(nextProp), validAttributes); - for (var i = 0; i < nextProp.length; i++) updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); - return updatePayload; -} - -function clearNestedProperty(updatePayload, prevProp, validAttributes) { - if (!prevProp) return updatePayload; - if (!Array.isArray(prevProp)) return clearProperties(updatePayload, resolveObject(prevProp), validAttributes); - for (var i = 0; i < prevProp.length; i++) updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); - return updatePayload; -} - -function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { - var attributeConfig, nextProp, prevProp; - for (var propKey in nextProps) if (attributeConfig = validAttributes[propKey]) if (prevProp = prevProps[propKey], - nextProp = nextProps[propKey], "function" == typeof nextProp && (nextProp = !0, - "function" == typeof prevProp && (prevProp = !0)), void 0 === nextProp && (nextProp = null, - void 0 === prevProp && (prevProp = null)), removedKeys && (removedKeys[propKey] = !1), - updatePayload && void 0 !== updatePayload[propKey]) { - if ("object" != typeof attributeConfig) updatePayload[propKey] = nextProp; else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { - var nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp; - updatePayload[propKey] = nextValue; + }, ReactChildReconciler_1 = ReactChildReconciler, ReactComponentTreeHook$3; + "undefined" != typeof process && process.env && "development" == "test" && (ReactComponentTreeHook$3 = ReactGlobalSharedState_1.ReactComponentTreeHook); + function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) { + if (traverseContext && "object" == typeof traverseContext) { + var result = traverseContext, keyUnique = void 0 === result[name]; + ReactComponentTreeHook$3 || (ReactComponentTreeHook$3 = ReactGlobalSharedState_1.ReactComponentTreeHook), + keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescapeInDev(name), ReactComponentTreeHook$3.getStackAddendumByID(selfDebugID)), + keyUnique && null != child && (result[name] = child); } - } else if (prevProp !== nextProp) if ("object" != typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp); else if ("function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process) { - var shouldUpdate = void 0 === prevProp || ("function" == typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp)); - shouldUpdate && (nextValue = "function" == typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, - (updatePayload || (updatePayload = {}))[propKey] = nextValue); - } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), - removedKeyCount > 0 && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), - removedKeys = null); - for (propKey in prevProps) void 0 === nextProps[propKey] && (attributeConfig = validAttributes[propKey]) && (updatePayload && void 0 !== updatePayload[propKey] || void 0 !== (prevProp = prevProps[propKey]) && ("object" != typeof attributeConfig || "function" == typeof attributeConfig.diff || "function" == typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey] = null, - removedKeys || (removedKeys = {}), removedKeys[propKey] || (removedKeys[propKey] = !0, - removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig))); - return updatePayload; -} - -function addProperties(updatePayload, props, validAttributes) { - return diffProperties(updatePayload, emptyObject$2, props, validAttributes); -} - -function clearProperties(updatePayload, prevProps, validAttributes) { - return diffProperties(updatePayload, prevProps, emptyObject$2, validAttributes); -} - -var ReactNativeAttributePayload = { - create: function(props, validAttributes) { - return addProperties(null, props, validAttributes); - }, - diff: function(prevProps, nextProps, validAttributes) { - return diffProperties(null, prevProps, nextProps, validAttributes); } -}, ReactNativeAttributePayload_1 = ReactNativeAttributePayload; - -function mountSafeCallback$1(context, callback) { - return function() { - if (callback) { - if ("boolean" == typeof context.__isMounted) { - if (!context.__isMounted) return; - } else if ("function" == typeof context.isMounted && !context.isMounted()) return; - return callback.apply(context, arguments); + function flattenStackChildren(children, selfDebugID) { + if (null == children) return children; + var result = {}; + return traverseStackChildren_1(children, function(traverseContext, child, name) { + return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID); + }, result), result; + } + var flattenStackChildren_1 = flattenStackChildren, ReactCurrentOwner$3 = ReactGlobalSharedState_1.ReactCurrentOwner; + function makeInsertMarkup(markup, afterNode, toIndex) { + return { + type: "INSERT_MARKUP", + content: markup, + fromIndex: null, + fromNode: null, + toIndex: toIndex, + afterNode: afterNode + }; + } + function makeMove(child, afterNode, toIndex) { + return { + type: "MOVE_EXISTING", + content: null, + fromIndex: child._mountIndex, + fromNode: ReactReconciler_1.getHostNode(child), + toIndex: toIndex, + afterNode: afterNode + }; + } + function makeRemove(child, node) { + return { + type: "REMOVE_NODE", + content: null, + fromIndex: child._mountIndex, + fromNode: node, + toIndex: null, + afterNode: null + }; + } + function makeSetMarkup(markup) { + return { + type: "SET_MARKUP", + content: markup, + fromIndex: null, + fromNode: null, + toIndex: null, + afterNode: null + }; + } + function makeTextContent(textContent) { + return { + type: "TEXT_CONTENT", + content: textContent, + fromIndex: null, + fromNode: null, + toIndex: null, + afterNode: null + }; + } + function enqueue(queue, update) { + return update && (queue = queue || [], queue.push(update)), queue; + } + function processQueue(inst, updateQueue) { + ReactComponentEnvironment_1.processChildrenUpdates(inst, updateQueue); + } + var setChildrenForInstrumentation = emptyFunction, getDebugID = function(inst) { + if (!inst._debugID) { + var internal; + (internal = ReactInstanceMap_1.get(inst)) && (inst = internal); } + return inst._debugID; }; -} - -function throwOnStylesProp(component, props) { - if (void 0 !== props.styles) { - var owner = component._owner || null, name = component.constructor.displayName, msg = "`styles` is not a supported property of `" + name + "`, did " + "you mean `style` (singular)?"; - throw owner && owner.constructor && owner.constructor.displayName && (msg += "\n\nCheck the `" + owner.constructor.displayName + "` parent " + " component."), - new Error(msg); - } -} - -function warnForStyleProps(props, validAttributes) { - for (var key in validAttributes.style) validAttributes[key] || void 0 === props[key] || console.error("You are setting the style `{ " + key + ": ... }` as a prop. You " + "should nest it in a style object. " + "E.g. `{ style: { " + key + ": ... } }`"); -} - -var NativeMethodsMixinUtils = { - mountSafeCallback: mountSafeCallback$1, - throwOnStylesProp: throwOnStylesProp, - warnForStyleProps: warnForStyleProps -}; - -function _classCallCheck$1(instance, Constructor) { - if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); -} - -function _possibleConstructorReturn(self, call) { - if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); - return !call || "object" != typeof call && "function" != typeof call ? self : call; -} - -function _inherits(subClass, superClass) { - if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); - subClass.prototype = Object.create(superClass && superClass.prototype, { - constructor: { - value: subClass, - enumerable: !1, - writable: !0, - configurable: !0 - } - }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); -} - -var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) { - _inherits(ReactNativeComponent, _React$Component); - function ReactNativeComponent() { - return _classCallCheck$1(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); - } - return ReactNativeComponent.prototype.blur = function() { - TextInputState.blurTextInput(findNumericNodeHandle(this)); - }, ReactNativeComponent.prototype.focus = function() { - TextInputState.focusTextInput(findNumericNodeHandle(this)); - }, ReactNativeComponent.prototype.measure = function(callback) { - UIManager.measure(findNumericNodeHandle(this), mountSafeCallback(this, callback)); - }, ReactNativeComponent.prototype.measureInWindow = function(callback) { - UIManager.measureInWindow(findNumericNodeHandle(this), mountSafeCallback(this, callback)); - }, ReactNativeComponent.prototype.measureLayout = function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle(this), relativeToNativeNode, mountSafeCallback(this, onFail), mountSafeCallback(this, onSuccess)); - }, ReactNativeComponent.prototype.setNativeProps = function(nativeProps) { - injectedSetNativeProps(this, nativeProps); - }, ReactNativeComponent; -}(React.Component); - -function setNativePropsFiber(componentOrHandle, nativeProps) { - var maybeInstance = void 0; - try { - maybeInstance = findNodeHandle_1(componentOrHandle); - } catch (error) {} - if (null != maybeInstance) { - var viewConfig = maybeInstance.viewConfig, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); - } -} - -function setNativePropsStack(componentOrHandle, nativeProps) { - var maybeInstance = findNodeHandle_1(componentOrHandle); - if (null != maybeInstance) { - var viewConfig = void 0; - if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { - for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; - viewConfig = maybeInstance.viewConfig; - } - var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID, updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); - } -} - -var injectedSetNativeProps = void 0; - -injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; - -var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, throwOnStylesProp$1 = NativeMethodsMixinUtils.throwOnStylesProp, warnForStyleProps$1 = NativeMethodsMixinUtils.warnForStyleProps, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { - measure: function(callback) { - UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); - }, - measureInWindow: function(callback) { - UIManager.measureInWindow(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); - }, - measureLayout: function(relativeToNativeNode, onSuccess, onFail) { - UIManager.measureLayout(findNumericNodeHandle$1(this), relativeToNativeNode, mountSafeCallback$2(this, onFail), mountSafeCallback$2(this, onSuccess)); - }, - setNativeProps: function(nativeProps) { - injectedSetNativeProps$1(this, nativeProps); - }, - focus: function() { - TextInputState.focusTextInput(findNumericNodeHandle$1(this)); - }, - blur: function() { - TextInputState.blurTextInput(findNumericNodeHandle$1(this)); - } -}; - -function setNativePropsFiber$1(componentOrHandle, nativeProps) { - var maybeInstance = void 0; - try { - maybeInstance = findNodeHandle_1(componentOrHandle); - } catch (error) {} - if (null != maybeInstance) { - var viewConfig = maybeInstance.viewConfig; - warnForStyleProps$1(nativeProps, viewConfig.validAttributes); - var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(maybeInstance._nativeTag, viewConfig.uiViewClassName, updatePayload); - } -} - -function setNativePropsStack$1(componentOrHandle, nativeProps) { - var maybeInstance = findNodeHandle_1(componentOrHandle); - if (null != maybeInstance) { - var viewConfig = void 0; - if (void 0 !== maybeInstance.viewConfig) viewConfig = maybeInstance.viewConfig; else if (void 0 !== maybeInstance._instance && void 0 !== maybeInstance._instance.viewConfig) viewConfig = maybeInstance._instance.viewConfig; else { - for (;void 0 !== maybeInstance._renderedComponent; ) maybeInstance = maybeInstance._renderedComponent; - viewConfig = maybeInstance.viewConfig; - } - var tag = "function" == typeof maybeInstance.getHostNode ? maybeInstance.getHostNode() : maybeInstance._rootNodeID; - warnForStyleProps$1(nativeProps, viewConfig.validAttributes); - var updatePayload = ReactNativeAttributePayload_1.create(nativeProps, viewConfig.validAttributes); - UIManager.updateView(tag, viewConfig.uiViewClassName, updatePayload); - } -} - -var injectedSetNativeProps$1 = void 0; - -injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; - -var NativeMethodsMixin_DEV = NativeMethodsMixin; - -invariant(!NativeMethodsMixin_DEV.componentWillMount && !NativeMethodsMixin_DEV.componentWillReceiveProps, "Do not override existing functions."), -NativeMethodsMixin_DEV.componentWillMount = function() { - throwOnStylesProp$1(this, this.props); -}, NativeMethodsMixin_DEV.componentWillReceiveProps = function(newProps) { - throwOnStylesProp$1(this, newProps); -}; - -var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { - centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { - var touchBank = touchHistory.touchBank, total = 0, count = 0, oneTouchData = 1 === touchHistory.numberActiveTouches ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; - if (null !== oneTouchData) oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter && (total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY, - count = 1); else for (var i = 0; i < touchBank.length; i++) { - var touchTrack = touchBank[i]; - if (null !== touchTrack && void 0 !== touchTrack && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { - var toAdd; - toAdd = ofCurrent && isXAxis ? touchTrack.currentPageX : ofCurrent && !isXAxis ? touchTrack.currentPageY : !ofCurrent && isXAxis ? touchTrack.previousPageX : touchTrack.previousPageY, - total += toAdd, count++; - } - } - return count > 0 ? total / count : TouchHistoryMath.noCentroid; - }, - currentCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !0); - }, - currentCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !0); - }, - previousCentroidXOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !0, !1); - }, - previousCentroidYOfTouchesChangedAfter: function(touchHistory, touchesChangedAfter) { - return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, !1, !1); - }, - currentCentroidX: function(touchHistory) { - return TouchHistoryMath.centroidDimension(touchHistory, 0, !0, !0); - }, - currentCentroidY: function(touchHistory) { - return TouchHistoryMath.centroidDimension(touchHistory, 0, !1, !0); - }, - noCentroid: -1 -}, TouchHistoryMath_1 = TouchHistoryMath; - -function escape(key) { - var escaperLookup = { - "=": "=0", - ":": "=2" + setChildrenForInstrumentation = function(children) { + var debugID = getDebugID(this); + 0 !== debugID && ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function(key) { + return children[key]._debugID; + }) : []); }; - return "$" + ("" + key).replace(/[=:]/g, function(match) { - return escaperLookup[match]; - }); -} - -var unescapeInDev = emptyFunction; - -unescapeInDev = function(key) { - var unescapeRegex = /(=0|=2)/g, unescaperLookup = { - "=0": "=", - "=2": ":" - }; - return ("" + ("." === key[0] && "$" === key[1] ? key.substring(2) : key.substring(1))).replace(unescapeRegex, function(match) { - return unescaperLookup[match]; - }); -}; - -var KeyEscapeUtils = { - escape: escape, - unescapeInDev: unescapeInDev -}, KeyEscapeUtils_1 = KeyEscapeUtils, ITERATOR_SYMBOL = "function" == typeof Symbol && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator", REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol.for && Symbol.for("react.element") || 60103, getCurrentStackAddendum = ReactGlobalSharedState_1.ReactComponentTreeHook.getCurrentStackAddendum, SEPARATOR = ".", SUBSEPARATOR = ":", didWarnAboutMaps = !1; - -function getComponentKey(component, index) { - return component && "object" == typeof component && null != component.key ? KeyEscapeUtils_1.escape(component.key) : index.toString(36); -} - -function traverseStackChildrenImpl(children, nameSoFar, callback, traverseContext) { - var type = typeof children; - if ("undefined" !== type && "boolean" !== type || (children = null), null === children || "string" === type || "number" === type || "object" === type && children.$$typeof === REACT_ELEMENT_TYPE) return callback(traverseContext, children, "" === nameSoFar ? SEPARATOR + getComponentKey(children, 0) : nameSoFar), - 1; - var child, nextName, subtreeCount = 0, nextNamePrefix = "" === nameSoFar ? SEPARATOR : nameSoFar + SUBSEPARATOR; - if (Array.isArray(children)) for (var i = 0; i < children.length; i++) child = children[i], - nextName = nextNamePrefix + getComponentKey(child, i), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); else { - var iteratorFn = ITERATOR_SYMBOL && children[ITERATOR_SYMBOL] || children[FAUX_ITERATOR_SYMBOL]; - if ("function" == typeof iteratorFn) { - iteratorFn === children.entries && (warning(didWarnAboutMaps, "Using Maps as children is unsupported and will likely yield " + "unexpected results. Convert it to a sequence/iterable of keyed " + "ReactElements instead.%s", getCurrentStackAddendum()), - didWarnAboutMaps = !0); - for (var step, iterator = iteratorFn.call(children), ii = 0; !(step = iterator.next()).done; ) child = step.value, - nextName = nextNamePrefix + getComponentKey(child, ii++), subtreeCount += traverseStackChildrenImpl(child, nextName, callback, traverseContext); - } else if ("object" === type) { - var addendum = ""; - addendum = " If you meant to render a collection of children, use an array " + "instead." + getCurrentStackAddendum(); - var childrenString = "" + children; - invariant(!1, "Objects are not valid as a React child (found: %s).%s", "[object Object]" === childrenString ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString, addendum); - } - } - return subtreeCount; -} - -function traverseStackChildren(children, callback, traverseContext) { - return null == children ? 0 : traverseStackChildrenImpl(children, "", callback, traverseContext); -} - -var traverseStackChildren_1 = traverseStackChildren, ReactComponentTreeHook$2; - -"undefined" != typeof process && process.env && "development" == "test" && (ReactComponentTreeHook$2 = ReactGlobalSharedState_1.ReactComponentTreeHook); - -function instantiateChild(childInstances, child, name, selfDebugID) { - var keyUnique = void 0 === childInstances[name]; - ReactComponentTreeHook$2 || (ReactComponentTreeHook$2 = ReactGlobalSharedState_1.ReactComponentTreeHook), - keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescapeInDev(name), ReactComponentTreeHook$2.getStackAddendumByID(selfDebugID)), - null != child && keyUnique && (childInstances[name] = instantiateReactComponent_1(child, !0)); -} - -var ReactChildReconciler = { - instantiateChildren: function(nestedChildNodes, transaction, context, selfDebugID) { - if (null == nestedChildNodes) return null; - var childInstances = {}; - return traverseStackChildren_1(nestedChildNodes, function(childInsts, child, name) { - return instantiateChild(childInsts, child, name, selfDebugID); - }, childInstances), childInstances; - }, - updateChildren: function(prevChildren, nextChildren, mountImages, removedNodes, transaction, hostParent, hostContainerInfo, context, selfDebugID) { - if (nextChildren || prevChildren) { - var name, prevChild; - for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { - prevChild = prevChildren && prevChildren[name]; - var prevElement = prevChild && prevChild._currentElement, nextElement = nextChildren[name]; - if (null != prevChild && shouldUpdateReactComponent_1(prevElement, nextElement)) ReactReconciler_1.receiveComponent(prevChild, nextElement, transaction, context), - nextChildren[name] = prevChild; else { - var nextChildInstance = instantiateReactComponent_1(nextElement, !0); - nextChildren[name] = nextChildInstance; - var nextChildMountImage = ReactReconciler_1.mountComponent(nextChildInstance, transaction, hostParent, hostContainerInfo, context, selfDebugID); - mountImages.push(nextChildMountImage), prevChild && (removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), - ReactReconciler_1.unmountComponent(prevChild, !1, !1)); - } - } - for (name in prevChildren) !prevChildren.hasOwnProperty(name) || nextChildren && nextChildren.hasOwnProperty(name) || (prevChild = prevChildren[name], - removedNodes[name] = ReactReconciler_1.getHostNode(prevChild), ReactReconciler_1.unmountComponent(prevChild, !1, !1)); - } - }, - unmountChildren: function(renderedChildren, safely, skipLifecycle) { - for (var name in renderedChildren) if (renderedChildren.hasOwnProperty(name)) { - var renderedChild = renderedChildren[name]; - ReactReconciler_1.unmountComponent(renderedChild, safely, skipLifecycle); - } - } -}, ReactChildReconciler_1 = ReactChildReconciler, ReactComponentTreeHook$3; - -"undefined" != typeof process && process.env && "development" == "test" && (ReactComponentTreeHook$3 = ReactGlobalSharedState_1.ReactComponentTreeHook); - -function flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID) { - if (traverseContext && "object" == typeof traverseContext) { - var result = traverseContext, keyUnique = void 0 === result[name]; - ReactComponentTreeHook$3 || (ReactComponentTreeHook$3 = ReactGlobalSharedState_1.ReactComponentTreeHook), - keyUnique || warning(!1, "flattenChildren(...): Encountered two children with the same key, " + "`%s`. Child keys must be unique; when two children share a key, only " + "the first child will be used.%s", KeyEscapeUtils_1.unescapeInDev(name), ReactComponentTreeHook$3.getStackAddendumByID(selfDebugID)), - keyUnique && null != child && (result[name] = child); - } -} - -function flattenStackChildren(children, selfDebugID) { - if (null == children) return children; - var result = {}; - return traverseStackChildren_1(children, function(traverseContext, child, name) { - return flattenSingleChildIntoContext(traverseContext, child, name, selfDebugID); - }, result), result; -} - -var flattenStackChildren_1 = flattenStackChildren, ReactCurrentOwner$3 = ReactGlobalSharedState_1.ReactCurrentOwner; - -function makeInsertMarkup(markup, afterNode, toIndex) { - return { - type: "INSERT_MARKUP", - content: markup, - fromIndex: null, - fromNode: null, - toIndex: toIndex, - afterNode: afterNode - }; -} - -function makeMove(child, afterNode, toIndex) { - return { - type: "MOVE_EXISTING", - content: null, - fromIndex: child._mountIndex, - fromNode: ReactReconciler_1.getHostNode(child), - toIndex: toIndex, - afterNode: afterNode - }; -} - -function makeRemove(child, node) { - return { - type: "REMOVE_NODE", - content: null, - fromIndex: child._mountIndex, - fromNode: node, - toIndex: null, - afterNode: null - }; -} - -function makeSetMarkup(markup) { - return { - type: "SET_MARKUP", - content: markup, - fromIndex: null, - fromNode: null, - toIndex: null, - afterNode: null - }; -} - -function makeTextContent(textContent) { - return { - type: "TEXT_CONTENT", - content: textContent, - fromIndex: null, - fromNode: null, - toIndex: null, - afterNode: null - }; -} - -function enqueue(queue, update) { - return update && (queue = queue || [], queue.push(update)), queue; -} - -function processQueue(inst, updateQueue) { - ReactComponentEnvironment_1.processChildrenUpdates(inst, updateQueue); -} - -var setChildrenForInstrumentation = emptyFunction, getDebugID = function(inst) { - if (!inst._debugID) { - var internal; - (internal = ReactInstanceMap_1.get(inst)) && (inst = internal); - } - return inst._debugID; -}; - -setChildrenForInstrumentation = function(children) { - var debugID = getDebugID(this); - 0 !== debugID && ReactInstrumentation.debugTool.onSetChildren(debugID, children ? Object.keys(children).map(function(key) { - return children[key]._debugID; - }) : []); -}; - -var ReactMultiChild = { - _reconcilerInstantiateChildren: function(nestedChildren, transaction, context) { - var selfDebugID = getDebugID(this); - if (this._currentElement) try { - return ReactCurrentOwner$3.current = this._currentElement._owner, ReactChildReconciler_1.instantiateChildren(nestedChildren, transaction, context, selfDebugID); - } finally { - ReactCurrentOwner$3.current = null; - } - return ReactChildReconciler_1.instantiateChildren(nestedChildren, transaction, context); - }, - _reconcilerUpdateChildren: function(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) { - var nextChildren, selfDebugID = 0; - if (selfDebugID = getDebugID(this), this._currentElement) { - try { - ReactCurrentOwner$3.current = this._currentElement._owner, nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID); + var ReactMultiChild = { + _reconcilerInstantiateChildren: function(nestedChildren, transaction, context) { + var selfDebugID = getDebugID(this); + if (this._currentElement) try { + return ReactCurrentOwner$3.current = this._currentElement._owner, ReactChildReconciler_1.instantiateChildren(nestedChildren, transaction, context, selfDebugID); } finally { ReactCurrentOwner$3.current = null; } - return ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), + return ReactChildReconciler_1.instantiateChildren(nestedChildren, transaction, context); + }, + _reconcilerUpdateChildren: function(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context) { + var nextChildren, selfDebugID = 0; + if (selfDebugID = getDebugID(this), this._currentElement) { + try { + ReactCurrentOwner$3.current = this._currentElement._owner, nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID); + } finally { + ReactCurrentOwner$3.current = null; + } + return ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), + nextChildren; + } + return nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID), + ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), nextChildren; - } - return nextChildren = flattenStackChildren_1(nextNestedChildrenElements, selfDebugID), - ReactChildReconciler_1.updateChildren(prevChildren, nextChildren, mountImages, removedNodes, transaction, this, this._hostContainerInfo, context, selfDebugID), - nextChildren; - }, - mountChildren: function(nestedChildren, transaction, context) { - var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context); - this._renderedChildren = children; - var mountImages = [], index = 0; - for (var name in children) if (children.hasOwnProperty(name)) { - var child = children[name], selfDebugID = 0; - selfDebugID = getDebugID(this); - var mountImage = ReactReconciler_1.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID); - child._mountIndex = index++, mountImages.push(mountImage); - } - return setChildrenForInstrumentation.call(this, children), mountImages; - }, - updateTextContent: function(nextContent) { - var prevChildren = this._renderedChildren; - ReactChildReconciler_1.unmountChildren(prevChildren, !1, !1); - for (var name in prevChildren) prevChildren.hasOwnProperty(name) && invariant(!1, "updateTextContent called on non-empty component."); - processQueue(this, [ makeTextContent(nextContent) ]); - }, - updateMarkup: function(nextMarkup) { - var prevChildren = this._renderedChildren; - ReactChildReconciler_1.unmountChildren(prevChildren, !1, !1); - for (var name in prevChildren) prevChildren.hasOwnProperty(name) && invariant(!1, "updateTextContent called on non-empty component."); - processQueue(this, [ makeSetMarkup(nextMarkup) ]); - }, - updateChildren: function(nextNestedChildrenElements, transaction, context) { - this._updateChildren(nextNestedChildrenElements, transaction, context); - }, - _updateChildren: function(nextNestedChildrenElements, transaction, context) { - var prevChildren = this._renderedChildren, removedNodes = {}, mountImages = [], nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context); - if (nextChildren || prevChildren) { - var name, updates = null, nextIndex = 0, lastIndex = 0, nextMountIndex = 0, lastPlacedNode = null; - for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { - var prevChild = prevChildren && prevChildren[name], nextChild = nextChildren[name]; - prevChild === nextChild ? (updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)), - lastIndex = Math.max(prevChild._mountIndex, lastIndex), prevChild._mountIndex = nextIndex) : (prevChild && (lastIndex = Math.max(prevChild._mountIndex, lastIndex)), - updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)), - nextMountIndex++), nextIndex++, lastPlacedNode = ReactReconciler_1.getHostNode(nextChild); + }, + mountChildren: function(nestedChildren, transaction, context) { + var children = this._reconcilerInstantiateChildren(nestedChildren, transaction, context); + this._renderedChildren = children; + var mountImages = [], index = 0; + for (var name in children) if (children.hasOwnProperty(name)) { + var child = children[name], selfDebugID = 0; + selfDebugID = getDebugID(this); + var mountImage = ReactReconciler_1.mountComponent(child, transaction, this, this._hostContainerInfo, context, selfDebugID); + child._mountIndex = index++, mountImages.push(mountImage); } - for (name in removedNodes) removedNodes.hasOwnProperty(name) && (updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]))); - updates && processQueue(this, updates), this._renderedChildren = nextChildren, setChildrenForInstrumentation.call(this, nextChildren); - } - }, - unmountChildren: function(safely, skipLifecycle) { - var renderedChildren = this._renderedChildren; - ReactChildReconciler_1.unmountChildren(renderedChildren, safely, skipLifecycle), - this._renderedChildren = null; - }, - moveChild: function(child, afterNode, toIndex, lastIndex) { - if (child._mountIndex < lastIndex) return makeMove(child, afterNode, toIndex); - }, - createChild: function(child, afterNode, mountImage) { - return makeInsertMarkup(mountImage, afterNode, child._mountIndex); - }, - removeChild: function(child, node) { - return makeRemove(child, node); - }, - _mountChildAtIndex: function(child, mountImage, afterNode, index, transaction, context) { - return child._mountIndex = index, this.createChild(child, afterNode, mountImage); - }, - _unmountChild: function(child, node) { - var update = this.removeChild(child, node); - return child._mountIndex = null, update; - } -}, ReactMultiChild_1 = ReactMultiChild, ReactNativeBaseComponent = function(viewConfig) { - this.viewConfig = viewConfig; -}; - -ReactNativeBaseComponent.Mixin = { - getPublicInstance: function() { - return this; - }, - unmountComponent: function(safely, skipLifecycle) { - ReactNativeComponentTree_1.uncacheNode(this), this.unmountChildren(safely, skipLifecycle), - this._rootNodeID = 0; - }, - initializeChildren: function(children, containerTag, transaction, context) { - var mountImages = this.mountChildren(children, transaction, context); - if (mountImages.length) { - for (var createdTags = [], i = 0, l = mountImages.length; i < l; i++) { - var mountImage = mountImages[i], childTag = mountImage; - createdTags[i] = childTag; + return setChildrenForInstrumentation.call(this, children), mountImages; + }, + updateTextContent: function(nextContent) { + var prevChildren = this._renderedChildren; + ReactChildReconciler_1.unmountChildren(prevChildren, !1, !1); + for (var name in prevChildren) prevChildren.hasOwnProperty(name) && invariant(!1, "updateTextContent called on non-empty component."); + processQueue(this, [ makeTextContent(nextContent) ]); + }, + updateMarkup: function(nextMarkup) { + var prevChildren = this._renderedChildren; + ReactChildReconciler_1.unmountChildren(prevChildren, !1, !1); + for (var name in prevChildren) prevChildren.hasOwnProperty(name) && invariant(!1, "updateTextContent called on non-empty component."); + processQueue(this, [ makeSetMarkup(nextMarkup) ]); + }, + updateChildren: function(nextNestedChildrenElements, transaction, context) { + this._updateChildren(nextNestedChildrenElements, transaction, context); + }, + _updateChildren: function(nextNestedChildrenElements, transaction, context) { + var prevChildren = this._renderedChildren, removedNodes = {}, mountImages = [], nextChildren = this._reconcilerUpdateChildren(prevChildren, nextNestedChildrenElements, mountImages, removedNodes, transaction, context); + if (nextChildren || prevChildren) { + var name, updates = null, nextIndex = 0, lastIndex = 0, nextMountIndex = 0, lastPlacedNode = null; + for (name in nextChildren) if (nextChildren.hasOwnProperty(name)) { + var prevChild = prevChildren && prevChildren[name], nextChild = nextChildren[name]; + prevChild === nextChild ? (updates = enqueue(updates, this.moveChild(prevChild, lastPlacedNode, nextIndex, lastIndex)), + lastIndex = Math.max(prevChild._mountIndex, lastIndex), prevChild._mountIndex = nextIndex) : (prevChild && (lastIndex = Math.max(prevChild._mountIndex, lastIndex)), + updates = enqueue(updates, this._mountChildAtIndex(nextChild, mountImages[nextMountIndex], lastPlacedNode, nextIndex, transaction, context)), + nextMountIndex++), nextIndex++, lastPlacedNode = ReactReconciler_1.getHostNode(nextChild); + } + for (name in removedNodes) removedNodes.hasOwnProperty(name) && (updates = enqueue(updates, this._unmountChild(prevChildren[name], removedNodes[name]))); + updates && processQueue(this, updates), this._renderedChildren = nextChildren, setChildrenForInstrumentation.call(this, nextChildren); } - UIManager.setChildren(containerTag, createdTags); + }, + unmountChildren: function(safely, skipLifecycle) { + var renderedChildren = this._renderedChildren; + ReactChildReconciler_1.unmountChildren(renderedChildren, safely, skipLifecycle), + this._renderedChildren = null; + }, + moveChild: function(child, afterNode, toIndex, lastIndex) { + if (child._mountIndex < lastIndex) return makeMove(child, afterNode, toIndex); + }, + createChild: function(child, afterNode, mountImage) { + return makeInsertMarkup(mountImage, afterNode, child._mountIndex); + }, + removeChild: function(child, node) { + return makeRemove(child, node); + }, + _mountChildAtIndex: function(child, mountImage, afterNode, index, transaction, context) { + return child._mountIndex = index, this.createChild(child, afterNode, mountImage); + }, + _unmountChild: function(child, node) { + var update = this.removeChild(child, node); + return child._mountIndex = null, update; } - }, - receiveComponent: function(nextElement, transaction, context) { - var prevElement = this._currentElement; - this._currentElement = nextElement; - for (var key in this.viewConfig.validAttributes) nextElement.props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(nextElement.props[key]); - var updatePayload = ReactNativeAttributePayload_1.diff(prevElement.props, nextElement.props, this.viewConfig.validAttributes); - updatePayload && UIManager.updateView(this._rootNodeID, this.viewConfig.uiViewClassName, updatePayload), - this.updateChildren(nextElement.props.children, transaction, context); - }, - getName: function() { - return this.constructor.displayName || this.constructor.name || "Unknown"; - }, - getHostNode: function() { - return this._rootNodeID; - }, - mountComponent: function(transaction, hostParent, hostContainerInfo, context) { - var tag = ReactNativeTagHandles_1.allocateTag(); - this._rootNodeID = tag, this._hostParent = hostParent, this._hostContainerInfo = hostContainerInfo; - for (var key in this.viewConfig.validAttributes) this._currentElement.props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(this._currentElement.props[key]); - var updatePayload = ReactNativeAttributePayload_1.create(this._currentElement.props, this.viewConfig.validAttributes), nativeTopRootTag = hostContainerInfo._tag; - return UIManager.createView(tag, this.viewConfig.uiViewClassName, nativeTopRootTag, updatePayload), - ReactNativeComponentTree_1.precacheNode(this, tag), this.initializeChildren(this._currentElement.props.children, tag, transaction, context), - tag; - } -}, Object.assign(ReactNativeBaseComponent.prototype, ReactMultiChild_1, ReactNativeBaseComponent.Mixin, NativeMethodsMixin_1); - -var ReactNativeBaseComponent_1 = ReactNativeBaseComponent, createReactNativeComponentClassStack = function(viewConfig) { - var Constructor = function(element) { - this._currentElement = element, this._topLevelWrapper = null, this._hostParent = null, - this._hostContainerInfo = null, this._rootNodeID = 0, this._renderedChildren = null; + }, ReactMultiChild_1 = ReactMultiChild, ReactNativeBaseComponent = function(viewConfig) { + this.viewConfig = viewConfig; }; - return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, - Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), - Constructor.prototype.constructor = Constructor, Constructor; -}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; - -function takeSnapshot(view, options) { - return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), - UIManager.__takeSnapshot(view, options); -} - -var takeSnapshot_1 = takeSnapshot, lowPriorityWarning = function() {}, printWarning = function(format) { - for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; - var argIndex = 0, message = "Warning: " + format.replace(/%s/g, function() { - return args[argIndex++]; - }); - "undefined" != typeof console && console.warn(message); - try { - throw new Error(message); - } catch (x) {} -}; - -lowPriorityWarning = function(condition, format) { - if (void 0 === format) throw new Error("`warning(condition, format, ...args)` requires a warning " + "message argument"); - if (!condition) { - for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) args[_key2 - 2] = arguments[_key2]; - printWarning.apply(void 0, [ format ].concat(args)); - } -}; - -var lowPriorityWarning_1 = lowPriorityWarning, _extends$2 = Object.assign || function(target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); - } - return target; -}; - -function roundFloat(val) { - var base = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2, n = Math.pow(10, base); - return Math.floor(val * n) / n; -} - -function consoleTable(table) { - console.table(table); -} - -function getLastMeasurements() { - return ReactDebugTool_1.getFlushHistory(); -} - -function getExclusive() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; - function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) { - var displayName = treeSnapshot[instanceID].displayName, key = displayName, stats = aggregatedStats[key]; - stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { - key: key, - instanceCount: 0, - counts: {}, - durations: {}, - totalDuration: 0 - }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), - affectedIDs[key][instanceID] = !0, applyUpdate(stats); - } - return flushHistory.forEach(function(flush) { - var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; - measurements.forEach(function(measurement) { - var duration = measurement.duration, instanceID = measurement.instanceID, timerType = measurement.timerType; - updateAggregatedStats(treeSnapshot, instanceID, timerType, function(stats) { - stats.totalDuration += duration, stats.durations[timerType] += duration, stats.counts[timerType]++; - }); - }); - }), Object.keys(aggregatedStats).map(function(key) { - return _extends$2({}, aggregatedStats[key], { - instanceCount: Object.keys(affectedIDs[key]).length - }); - }).sort(function(a, b) { - return b.totalDuration - a.totalDuration; - }); -} - -function getInclusive() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; - function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { - var _treeSnapshot$instanc = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc.displayName, ownerID = _treeSnapshot$instanc.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; - stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { - key: key, - instanceCount: 0, - inclusiveRenderDuration: 0, - renderCount: 0 - }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); - } - var isCompositeByID = {}; - return flushHistory.forEach(function(flush) { - flush.measurements.forEach(function(measurement) { - var instanceID = measurement.instanceID; - "render" === measurement.timerType && (isCompositeByID[instanceID] = !0); - }); - }), flushHistory.forEach(function(flush) { - var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; - measurements.forEach(function(measurement) { - var duration = measurement.duration, instanceID = measurement.instanceID; - if ("render" === measurement.timerType) { - updateAggregatedStats(treeSnapshot, instanceID, function(stats) { - stats.renderCount++; - }); - for (var nextParentID = instanceID; nextParentID; ) isCompositeByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { - stats.inclusiveRenderDuration += duration; - }), nextParentID = treeSnapshot[nextParentID].parentID; + ReactNativeBaseComponent.Mixin = { + getPublicInstance: function() { + return this; + }, + unmountComponent: function(safely, skipLifecycle) { + ReactNativeComponentTree_1.uncacheNode(this), this.unmountChildren(safely, skipLifecycle), + this._rootNodeID = 0; + }, + initializeChildren: function(children, containerTag, transaction, context) { + var mountImages = this.mountChildren(children, transaction, context); + if (mountImages.length) { + for (var createdTags = [], i = 0, l = mountImages.length; i < l; i++) { + var mountImage = mountImages[i], childTag = mountImage; + createdTags[i] = childTag; + } + UIManager.setChildren(containerTag, createdTags); } - }); - }), Object.keys(aggregatedStats).map(function(key) { - return _extends$2({}, aggregatedStats[key], { - instanceCount: Object.keys(affectedIDs[key]).length - }); - }).sort(function(a, b) { - return b.inclusiveRenderDuration - a.inclusiveRenderDuration; - }); -} - -function getWasted() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; - function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { - var _treeSnapshot$instanc2 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc2.displayName, ownerID = _treeSnapshot$instanc2.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; - stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { - key: key, - instanceCount: 0, - inclusiveRenderDuration: 0, - renderCount: 0 - }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); + }, + receiveComponent: function(nextElement, transaction, context) { + var prevElement = this._currentElement; + this._currentElement = nextElement; + for (var key in this.viewConfig.validAttributes) nextElement.props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(nextElement.props[key]); + var updatePayload = ReactNativeAttributePayload_1.diff(prevElement.props, nextElement.props, this.viewConfig.validAttributes); + updatePayload && UIManager.updateView(this._rootNodeID, this.viewConfig.uiViewClassName, updatePayload), + this.updateChildren(nextElement.props.children, transaction, context); + }, + getName: function() { + return this.constructor.displayName || this.constructor.name || "Unknown"; + }, + getHostNode: function() { + return this._rootNodeID; + }, + mountComponent: function(transaction, hostParent, hostContainerInfo, context) { + var tag = ReactNativeTagHandles_1.allocateTag(); + this._rootNodeID = tag, this._hostParent = hostParent, this._hostContainerInfo = hostContainerInfo; + for (var key in this.viewConfig.validAttributes) this._currentElement.props.hasOwnProperty(key) && deepFreezeAndThrowOnMutationInDev(this._currentElement.props[key]); + var updatePayload = ReactNativeAttributePayload_1.create(this._currentElement.props, this.viewConfig.validAttributes), nativeTopRootTag = hostContainerInfo._tag; + return UIManager.createView(tag, this.viewConfig.uiViewClassName, nativeTopRootTag, updatePayload), + ReactNativeComponentTree_1.precacheNode(this, tag), this.initializeChildren(this._currentElement.props.children, tag, transaction, context), + tag; + } + }, Object.assign(ReactNativeBaseComponent.prototype, ReactMultiChild_1, ReactNativeBaseComponent.Mixin, NativeMethodsMixin_1); + var ReactNativeBaseComponent_1 = ReactNativeBaseComponent, createReactNativeComponentClassStack = function(viewConfig) { + var Constructor = function(element) { + this._currentElement = element, this._topLevelWrapper = null, this._hostParent = null, + this._hostContainerInfo = null, this._rootNodeID = 0, this._renderedChildren = null; + }; + return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, + Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), + Constructor.prototype.constructor = Constructor, Constructor; + }, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, ReactNativeFeatureFlags$3 = require("ReactNativeFeatureFlags"), createReactNativeComponentClass = ReactNativeFeatureFlags$3.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, ReactNativeFeatureFlags$4 = require("ReactNativeFeatureFlags"), findNumericNodeHandle$2 = ReactNativeFeatureFlags$4.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; + function takeSnapshot(view, options) { + return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), + UIManager.__takeSnapshot(view, options); } - return flushHistory.forEach(function(flush) { - var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot, operations = flush.operations, isDefinitelyNotWastedByID = {}; - operations.forEach(function(operation) { - for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, - nextParentID = treeSnapshot[nextParentID].parentID; + var takeSnapshot_1 = takeSnapshot, lowPriorityWarning = function() {}, printWarning = function(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key]; + var argIndex = 0, message = "Warning: " + format.replace(/%s/g, function() { + return args[argIndex++]; }); - var renderedCompositeIDs = {}; - measurements.forEach(function(measurement) { - var instanceID = measurement.instanceID; - "render" === measurement.timerType && (renderedCompositeIDs[instanceID] = !0); - }), measurements.forEach(function(measurement) { - var duration = measurement.duration, instanceID = measurement.instanceID; - if ("render" === measurement.timerType) { - var updateCount = treeSnapshot[instanceID].updateCount; - if (!isDefinitelyNotWastedByID[instanceID] && 0 !== updateCount) { + "undefined" != typeof console && console.warn(message); + try { + throw new Error(message); + } catch (x) {} + }; + lowPriorityWarning = function(condition, format) { + if (void 0 === format) throw new Error("`warning(condition, format, ...args)` requires a warning " + "message argument"); + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) args[_key2 - 2] = arguments[_key2]; + printWarning.apply(void 0, [ format ].concat(args)); + } + }; + var lowPriorityWarning_1 = lowPriorityWarning, _extends$2 = Object.assign || function(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); + } + return target; + }; + function roundFloat(val) { + var base = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2, n = Math.pow(10, base); + return Math.floor(val * n) / n; + } + function consoleTable(table) { + console.table(table); + } + function getLastMeasurements() { + return ReactDebugTool_1.getFlushHistory(); + } + function getExclusive() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; + function updateAggregatedStats(treeSnapshot, instanceID, timerType, applyUpdate) { + var displayName = treeSnapshot[instanceID].displayName, key = displayName, stats = aggregatedStats[key]; + stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + counts: {}, + durations: {}, + totalDuration: 0 + }), stats.durations[timerType] || (stats.durations[timerType] = 0), stats.counts[timerType] || (stats.counts[timerType] = 0), + affectedIDs[key][instanceID] = !0, applyUpdate(stats); + } + return flushHistory.forEach(function(flush) { + var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; + measurements.forEach(function(measurement) { + var duration = measurement.duration, instanceID = measurement.instanceID, timerType = measurement.timerType; + updateAggregatedStats(treeSnapshot, instanceID, timerType, function(stats) { + stats.totalDuration += duration, stats.durations[timerType] += duration, stats.counts[timerType]++; + }); + }); + }), Object.keys(aggregatedStats).map(function(key) { + return _extends$2({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function(a, b) { + return b.totalDuration - a.totalDuration; + }); + } + function getInclusive() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc.displayName, ownerID = _treeSnapshot$instanc.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; + stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); + } + var isCompositeByID = {}; + return flushHistory.forEach(function(flush) { + flush.measurements.forEach(function(measurement) { + var instanceID = measurement.instanceID; + "render" === measurement.timerType && (isCompositeByID[instanceID] = !0); + }); + }), flushHistory.forEach(function(flush) { + var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot; + measurements.forEach(function(measurement) { + var duration = measurement.duration, instanceID = measurement.instanceID; + if ("render" === measurement.timerType) { updateAggregatedStats(treeSnapshot, instanceID, function(stats) { stats.renderCount++; }); - for (var nextParentID = instanceID; nextParentID; ) renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { + for (var nextParentID = instanceID; nextParentID; ) isCompositeByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { stats.inclusiveRenderDuration += duration; }), nextParentID = treeSnapshot[nextParentID].parentID; } - } - }); - }), Object.keys(aggregatedStats).map(function(key) { - return _extends$2({}, aggregatedStats[key], { - instanceCount: Object.keys(affectedIDs[key]).length - }); - }).sort(function(a, b) { - return b.inclusiveRenderDuration - a.inclusiveRenderDuration; - }); -} - -function getOperations() { - var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), stats = []; - return flushHistory.forEach(function(flush, flushIndex) { - var operations = flush.operations, treeSnapshot = flush.treeSnapshot; - operations.forEach(function(operation) { - var instanceID = operation.instanceID, type = operation.type, payload = operation.payload, _treeSnapshot$instanc3 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc3.displayName, ownerID = _treeSnapshot$instanc3.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName; - stats.push({ - flushIndex: flushIndex, - instanceID: instanceID, - key: key, - type: type, - ownerID: ownerID, - payload: payload }); + }), Object.keys(aggregatedStats).map(function(key) { + return _extends$2({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function(a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; }); - }), stats; -} - -function printExclusive(flushHistory) { - consoleTable(getExclusive(flushHistory).map(function(item) { - var key = item.key, instanceCount = item.instanceCount, totalDuration = item.totalDuration, renderCount = item.counts.render || 0, renderDuration = item.durations.render || 0; - return { - Component: key, - "Total time (ms)": roundFloat(totalDuration), - "Instance count": instanceCount, - "Total render time (ms)": roundFloat(renderDuration), - "Average render time (ms)": renderCount ? roundFloat(renderDuration / renderCount) : void 0, - "Render count": renderCount, - "Total lifecycle time (ms)": roundFloat(totalDuration - renderDuration) - }; - })); -} - -function printInclusive(flushHistory) { - consoleTable(getInclusive(flushHistory).map(function(item) { - var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; - return { - "Owner > Component": key, - "Inclusive render time (ms)": roundFloat(inclusiveRenderDuration), - "Instance count": instanceCount, - "Render count": renderCount - }; - })); -} - -function printWasted(flushHistory) { - consoleTable(getWasted(flushHistory).map(function(item) { - var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; - return { - "Owner > Component": key, - "Inclusive wasted time (ms)": roundFloat(inclusiveRenderDuration), - "Instance count": instanceCount, - "Render count": renderCount - }; - })); -} - -function printOperations(flushHistory) { - consoleTable(getOperations(flushHistory).map(function(stat) { - return { - "Owner > Node": stat.key, - Operation: stat.type, - Payload: "object" == typeof stat.payload ? JSON.stringify(stat.payload) : stat.payload, - "Flush index": stat.flushIndex, - "Owner Component ID": stat.ownerID, - "DOM Component ID": stat.instanceID - }; - })); -} - -var warnedAboutPrintDOM = !1; - -function printDOM(measurements) { - return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), - warnedAboutPrintDOM = !0, printOperations(measurements); -} - -var warnedAboutGetMeasurementsSummaryMap = !1; - -function getMeasurementsSummaryMap(measurements) { - return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), - warnedAboutGetMeasurementsSummaryMap = !0, getWasted(measurements); -} - -function start() { - ReactDebugTool_1.beginProfiling(); -} - -function stop() { - ReactDebugTool_1.endProfiling(); -} - -function isRunning() { - return ReactDebugTool_1.isProfiling(); -} - -var ReactPerfAnalysis = { - getLastMeasurements: getLastMeasurements, - getExclusive: getExclusive, - getInclusive: getInclusive, - getWasted: getWasted, - getOperations: getOperations, - printExclusive: printExclusive, - printInclusive: printInclusive, - printWasted: printWasted, - printOperations: printOperations, - start: start, - stop: stop, - isRunning: isRunning, - printDOM: printDOM, - getMeasurementsSummaryMap: getMeasurementsSummaryMap -}, ReactPerf = ReactPerfAnalysis; - -ReactNativeInjection.inject(), ReactNativeStackInjection.inject(); - -var render = function(element, mountInto, callback) { - return ReactNativeMount_1.renderComponent(element, mountInto, callback); -}, ReactNative = { - NativeComponent: ReactNativeComponent_1, - hasReactNativeInitialized: !1, - findNodeHandle: findNumericNodeHandleStack, - render: render, - unmountComponentAtNode: ReactNativeMount_1.unmountComponentAtNode, - unstable_batchedUpdates: ReactUpdates_1.batchedUpdates, - unmountComponentAtNodeAndRemoveContainer: ReactNativeMount_1.unmountComponentAtNodeAndRemoveContainer, - __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { - NativeMethodsMixin: NativeMethodsMixin_1, - ReactGlobalSharedState: ReactGlobalSharedState_1, - ReactNativeComponentTree: ReactNativeComponentTree_1, - ReactNativePropRegistry: ReactNativePropRegistry_1, - TouchHistoryMath: TouchHistoryMath_1, - createReactNativeComponentClass: createReactNativeComponentClass, - takeSnapshot: takeSnapshot_1 } -}; - -Object.assign(ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, { - ReactDebugTool: ReactDebugTool_1, - ReactPerf: ReactPerf -}), "undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject && __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ - ComponentTree: { - getClosestInstanceFromNode: function(node) { - return ReactNativeComponentTree_1.getClosestInstanceFromNode(node); - }, - getNodeFromInstance: function(inst) { - for (;inst._renderedComponent; ) inst = inst._renderedComponent; - return inst ? ReactNativeComponentTree_1.getNodeFromInstance(inst) : null; + function getWasted() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), aggregatedStats = {}, affectedIDs = {}; + function updateAggregatedStats(treeSnapshot, instanceID, applyUpdate) { + var _treeSnapshot$instanc2 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc2.displayName, ownerID = _treeSnapshot$instanc2.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName, stats = aggregatedStats[key]; + stats || (affectedIDs[key] = {}, stats = aggregatedStats[key] = { + key: key, + instanceCount: 0, + inclusiveRenderDuration: 0, + renderCount: 0 + }), affectedIDs[key][instanceID] = !0, applyUpdate(stats); } - }, - Mount: ReactNativeMount_1, - Reconciler: ReactReconciler_1, - getInspectorDataForViewTag: ReactNativeStackInspector.getInspectorDataForViewTag -}); - -var ReactNativeStack = ReactNative; - -module.exports = ReactNativeStack; + return flushHistory.forEach(function(flush) { + var measurements = flush.measurements, treeSnapshot = flush.treeSnapshot, operations = flush.operations, isDefinitelyNotWastedByID = {}; + operations.forEach(function(operation) { + for (var instanceID = operation.instanceID, nextParentID = instanceID; nextParentID; ) isDefinitelyNotWastedByID[nextParentID] = !0, + nextParentID = treeSnapshot[nextParentID].parentID; + }); + var renderedCompositeIDs = {}; + measurements.forEach(function(measurement) { + var instanceID = measurement.instanceID; + "render" === measurement.timerType && (renderedCompositeIDs[instanceID] = !0); + }), measurements.forEach(function(measurement) { + var duration = measurement.duration, instanceID = measurement.instanceID; + if ("render" === measurement.timerType) { + var updateCount = treeSnapshot[instanceID].updateCount; + if (!isDefinitelyNotWastedByID[instanceID] && 0 !== updateCount) { + updateAggregatedStats(treeSnapshot, instanceID, function(stats) { + stats.renderCount++; + }); + for (var nextParentID = instanceID; nextParentID; ) renderedCompositeIDs[nextParentID] && !isDefinitelyNotWastedByID[nextParentID] && updateAggregatedStats(treeSnapshot, nextParentID, function(stats) { + stats.inclusiveRenderDuration += duration; + }), nextParentID = treeSnapshot[nextParentID].parentID; + } + } + }); + }), Object.keys(aggregatedStats).map(function(key) { + return _extends$2({}, aggregatedStats[key], { + instanceCount: Object.keys(affectedIDs[key]).length + }); + }).sort(function(a, b) { + return b.inclusiveRenderDuration - a.inclusiveRenderDuration; + }); + } + function getOperations() { + var flushHistory = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : getLastMeasurements(), stats = []; + return flushHistory.forEach(function(flush, flushIndex) { + var operations = flush.operations, treeSnapshot = flush.treeSnapshot; + operations.forEach(function(operation) { + var instanceID = operation.instanceID, type = operation.type, payload = operation.payload, _treeSnapshot$instanc3 = treeSnapshot[instanceID], displayName = _treeSnapshot$instanc3.displayName, ownerID = _treeSnapshot$instanc3.ownerID, owner = treeSnapshot[ownerID], key = (owner ? owner.displayName + " > " : "") + displayName; + stats.push({ + flushIndex: flushIndex, + instanceID: instanceID, + key: key, + type: type, + ownerID: ownerID, + payload: payload + }); + }); + }), stats; + } + function printExclusive(flushHistory) { + consoleTable(getExclusive(flushHistory).map(function(item) { + var key = item.key, instanceCount = item.instanceCount, totalDuration = item.totalDuration, renderCount = item.counts.render || 0, renderDuration = item.durations.render || 0; + return { + Component: key, + "Total time (ms)": roundFloat(totalDuration), + "Instance count": instanceCount, + "Total render time (ms)": roundFloat(renderDuration), + "Average render time (ms)": renderCount ? roundFloat(renderDuration / renderCount) : void 0, + "Render count": renderCount, + "Total lifecycle time (ms)": roundFloat(totalDuration - renderDuration) + }; + })); + } + function printInclusive(flushHistory) { + consoleTable(getInclusive(flushHistory).map(function(item) { + var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; + return { + "Owner > Component": key, + "Inclusive render time (ms)": roundFloat(inclusiveRenderDuration), + "Instance count": instanceCount, + "Render count": renderCount + }; + })); + } + function printWasted(flushHistory) { + consoleTable(getWasted(flushHistory).map(function(item) { + var key = item.key, instanceCount = item.instanceCount, inclusiveRenderDuration = item.inclusiveRenderDuration, renderCount = item.renderCount; + return { + "Owner > Component": key, + "Inclusive wasted time (ms)": roundFloat(inclusiveRenderDuration), + "Instance count": instanceCount, + "Render count": renderCount + }; + })); + } + function printOperations(flushHistory) { + consoleTable(getOperations(flushHistory).map(function(stat) { + return { + "Owner > Node": stat.key, + Operation: stat.type, + Payload: "object" == typeof stat.payload ? JSON.stringify(stat.payload) : stat.payload, + "Flush index": stat.flushIndex, + "Owner Component ID": stat.ownerID, + "DOM Component ID": stat.instanceID + }; + })); + } + var warnedAboutPrintDOM = !1; + function printDOM(measurements) { + return lowPriorityWarning_1(warnedAboutPrintDOM, "`ReactPerf.printDOM(...)` is deprecated. Use " + "`ReactPerf.printOperations(...)` instead."), + warnedAboutPrintDOM = !0, printOperations(measurements); + } + var warnedAboutGetMeasurementsSummaryMap = !1; + function getMeasurementsSummaryMap(measurements) { + return lowPriorityWarning_1(warnedAboutGetMeasurementsSummaryMap, "`ReactPerf.getMeasurementsSummaryMap(...)` is deprecated. Use " + "`ReactPerf.getWasted(...)` instead."), + warnedAboutGetMeasurementsSummaryMap = !0, getWasted(measurements); + } + function start() { + ReactDebugTool_1.beginProfiling(); + } + function stop() { + ReactDebugTool_1.endProfiling(); + } + function isRunning() { + return ReactDebugTool_1.isProfiling(); + } + var ReactPerfAnalysis = { + getLastMeasurements: getLastMeasurements, + getExclusive: getExclusive, + getInclusive: getInclusive, + getWasted: getWasted, + getOperations: getOperations, + printExclusive: printExclusive, + printInclusive: printInclusive, + printWasted: printWasted, + printOperations: printOperations, + start: start, + stop: stop, + isRunning: isRunning, + printDOM: printDOM, + getMeasurementsSummaryMap: getMeasurementsSummaryMap + }, ReactPerf = ReactPerfAnalysis; + ReactNativeInjection.inject(), ReactNativeStackInjection.inject(); + var render = function(element, mountInto, callback) { + return ReactNativeMount_1.renderComponent(element, mountInto, callback); + }, ReactNativeStack = { + NativeComponent: ReactNativeComponent_1, + hasReactNativeInitialized: !1, + findNodeHandle: findNumericNodeHandleStack, + render: render, + unmountComponentAtNode: ReactNativeMount_1.unmountComponentAtNode, + unstable_batchedUpdates: ReactUpdates_1.batchedUpdates, + unmountComponentAtNodeAndRemoveContainer: ReactNativeMount_1.unmountComponentAtNodeAndRemoveContainer, + __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: { + NativeMethodsMixin: NativeMethodsMixin_1, + ReactGlobalSharedState: ReactGlobalSharedState_1, + ReactNativeComponentTree: ReactNativeComponentTree_1, + ReactNativePropRegistry: ReactNativePropRegistry_1, + TouchHistoryMath: TouchHistoryMath_1, + createReactNativeComponentClass: createReactNativeComponentClass, + takeSnapshot: takeSnapshot_1 + } + }; + Object.assign(ReactNativeStack.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, { + ReactDebugTool: ReactDebugTool_1, + ReactPerf: ReactPerf + }), "undefined" != typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" == typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.inject && __REACT_DEVTOOLS_GLOBAL_HOOK__.inject({ + ComponentTree: { + getClosestInstanceFromNode: function(node) { + return ReactNativeComponentTree_1.getClosestInstanceFromNode(node); + }, + getNodeFromInstance: function(inst) { + for (;inst._renderedComponent; ) inst = inst._renderedComponent; + return inst ? ReactNativeComponentTree_1.getNodeFromInstance(inst) : null; + } + }, + Mount: ReactNativeMount_1, + Reconciler: ReactReconciler_1, + getInspectorDataForViewTag: ReactNativeStackInspector.getInspectorDataForViewTag + }); + var ReactNativeStackEntry = ReactNativeStack; + module.exports = ReactNativeStackEntry; +} diff --git a/Libraries/Renderer/ReactNativeStack-prod.js b/Libraries/Renderer/ReactNativeStack-prod.js index 171cd8160d4..17776ea45c4 100644 --- a/Libraries/Renderer/ReactNativeStack-prod.js +++ b/Libraries/Renderer/ReactNativeStack-prod.js @@ -19,11 +19,7 @@ var warning = require("fbjs/lib/warning"), RCTEventEmitter = require("RCTEventEm require("prop-types/checkPropTypes"); -var shallowEqual = require("fbjs/lib/shallowEqual"); - -require("ReactNativeFeatureFlags"); - -var deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"); +var shallowEqual = require("fbjs/lib/shallowEqual"), deepDiffer = require("deepDiffer"), flattenStyle = require("flattenStyle"), TextInputState = require("TextInputState"); require("deepFreezeAndThrowOnMutationInDev"); @@ -1590,12 +1586,7 @@ Object.assign(ReactCompositeComponentWrapper.prototype, ReactCompositeComponent_ _instantiateReactComponent: instantiateReactComponent }); -var instantiateReactComponent_1 = instantiateReactComponent, DevOnlyStubShim = null, ReactNativeFeatureFlags$2 = { - useFiber: !1 -}, ReactNativeFeatureFlags_1 = ReactNativeFeatureFlags$2, ReactNativeFeatureFlags$3 = Object.freeze({ - default: ReactNativeFeatureFlags_1, - __moduleExports: ReactNativeFeatureFlags_1 -}), ReactNativeFeatureFlags$1 = ReactNativeFeatureFlags$3 && ReactNativeFeatureFlags_1 || ReactNativeFeatureFlags$3, injectedFindNode = ReactNativeFeatureFlags$1.useFiber ? function(fiber) { +var instantiateReactComponent_1 = instantiateReactComponent, DevOnlyStubShim = null, ReactNativeFeatureFlags = require("ReactNativeFeatureFlags"), injectedFindNode = ReactNativeFeatureFlags.useFiber ? function(fiber) { return DevOnlyStubShim.findHostInstance(fiber); } : function(instance) { return instance; @@ -2048,7 +2039,7 @@ function _inherits(subClass, superClass) { }), superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } -var mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) { +var ReactNativeFeatureFlags$1 = require("ReactNativeFeatureFlags"), mountSafeCallback = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, ReactNativeComponent = function(_React$Component) { _inherits(ReactNativeComponent, _React$Component); function ReactNativeComponent() { return _classCallCheck$1(this, ReactNativeComponent), _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); @@ -2096,7 +2087,7 @@ var injectedSetNativeProps = void 0; injectedSetNativeProps = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber : setNativePropsStack; -var ReactNativeComponent_1 = ReactNativeComponent, mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { +var ReactNativeComponent_1 = ReactNativeComponent, ReactNativeFeatureFlags$2 = require("ReactNativeFeatureFlags"), mountSafeCallback$2 = NativeMethodsMixinUtils.mountSafeCallback, findNumericNodeHandle$1 = ReactNativeFeatureFlags$2.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack, NativeMethodsMixin = { measure: function(callback) { UIManager.measure(findNumericNodeHandle$1(this), mountSafeCallback$2(this, callback)); }, @@ -2143,7 +2134,7 @@ function setNativePropsStack$1(componentOrHandle, nativeProps) { var injectedSetNativeProps$1 = void 0; -injectedSetNativeProps$1 = ReactNativeFeatureFlags$1.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; +injectedSetNativeProps$1 = ReactNativeFeatureFlags$2.useFiber ? setNativePropsFiber$1 : setNativePropsStack$1; var NativeMethodsMixin_1 = NativeMethodsMixin, TouchHistoryMath = { centroidDimension: function(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { @@ -2468,7 +2459,7 @@ var ReactNativeBaseComponent_1 = ReactNativeBaseComponent, createReactNativeComp return Constructor.displayName = viewConfig.uiViewClassName, Constructor.viewConfig = viewConfig, Constructor.propTypes = viewConfig.propTypes, Constructor.prototype = new ReactNativeBaseComponent_1(viewConfig), Constructor.prototype.constructor = Constructor, Constructor; -}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, createReactNativeComponentClass = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, findNumericNodeHandle$2 = ReactNativeFeatureFlags$1.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; +}, createReactNativeComponentClassStack_1 = createReactNativeComponentClassStack, ReactNativeFeatureFlags$3 = require("ReactNativeFeatureFlags"), createReactNativeComponentClass = ReactNativeFeatureFlags$3.useFiber ? DevOnlyStubShim : createReactNativeComponentClassStack_1, ReactNativeFeatureFlags$4 = require("ReactNativeFeatureFlags"), findNumericNodeHandle$2 = ReactNativeFeatureFlags$4.useFiber ? DevOnlyStubShim : findNumericNodeHandleStack; function takeSnapshot(view, options) { return "number" != typeof view && "window" !== view && (view = findNumericNodeHandle$2(view) || "window"), @@ -2481,7 +2472,7 @@ ReactNativeInjection.inject(), ReactNativeStackInjection.inject(); var render = function(element, mountInto, callback) { return ReactNativeMount_1.renderComponent(element, mountInto, callback); -}, ReactNative = { +}, ReactNativeStack = { NativeComponent: ReactNativeComponent_1, hasReactNativeInitialized: !1, findNodeHandle: findNumericNodeHandleStack, @@ -2515,6 +2506,6 @@ var render = function(element, mountInto, callback) { getInspectorDataForViewTag: ReactNativeStackInspector.getInspectorDataForViewTag }); -var ReactNativeStack = ReactNative; +var ReactNativeStackEntry = ReactNativeStack; -module.exports = ReactNativeStack; +module.exports = ReactNativeStackEntry;