)
+
+ if ((tag === HostComponent || (tag === HostHoistable ) || (tag === HostSingleton )) && stateNode !== null) {
+ lastHostComponent = stateNode; // createEventHandle listeners
+
+
+ if (reactEventName !== null) {
+ var listener = getListener(instance, reactEventName);
+
+ if (listener != null) {
+ listeners.push(createDispatchListener(instance, listener, lastHostComponent));
+ }
+ }
+ } // If we are only accumulating events for the target, then we don't
+ // continue to propagate through the React fiber tree to find other
+ // listeners.
+
+
+ if (accumulateTargetOnly) {
+ break;
+ } // If we are processing the onBeforeBlur event, then we need to take
+
+ instance = instance.return;
+ }
+
+ return listeners;
+} // We should only use this function for:
+// - BeforeInputEventPlugin
+// - ChangeEventPlugin
+// - SelectEventPlugin
+// This is because we only process these plugins
+// in the bubble phase, so we need to accumulate two
+// phase event listeners (via emulation).
+
+function accumulateTwoPhaseListeners(targetFiber, reactName) {
+ var captureName = reactName + 'Capture';
+ var listeners = [];
+ var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path.
+
+ while (instance !== null) {
+ var _instance3 = instance,
+ stateNode = _instance3.stateNode,
+ tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e.
)
+
+ if ((tag === HostComponent || (tag === HostHoistable ) || (tag === HostSingleton )) && stateNode !== null) {
+ var currentTarget = stateNode;
+ var captureListener = getListener(instance, captureName);
+
+ if (captureListener != null) {
+ listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
+ }
+
+ var bubbleListener = getListener(instance, reactName);
+
+ if (bubbleListener != null) {
+ listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
+ }
+ }
+
+ instance = instance.return;
+ }
+
+ return listeners;
+}
+
+function getParent(inst) {
+ if (inst === null) {
+ return null;
+ }
+
+ do {
+ // $FlowFixMe[incompatible-use] found when upgrading Flow
+ inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.
+ // That is depending on if we want nested subtrees (layers) to bubble
+ // events to their parent. We could also go through parentNode on the
+ // host node but that wouldn't work for React Native and doesn't let us
+ // do the portal feature.
+ } while (inst && inst.tag !== HostComponent && (inst.tag !== HostSingleton));
+
+ if (inst) {
+ return inst;
+ }
+
+ return null;
+}
+/**
+ * Return the lowest common ancestor of A and B, or null if they are in
+ * different trees.
+ */
+
+
+function getLowestCommonAncestor(instA, instB) {
+ var nodeA = instA;
+ var nodeB = instB;
+ var depthA = 0;
+
+ for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {
+ depthA++;
+ }
+
+ var depthB = 0;
+
+ for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {
+ depthB++;
+ } // If A is deeper, crawl up.
+
+
+ while (depthA - depthB > 0) {
+ nodeA = getParent(nodeA);
+ depthA--;
+ } // If B is deeper, crawl up.
+
+
+ while (depthB - depthA > 0) {
+ nodeB = getParent(nodeB);
+ depthB--;
+ } // Walk in lockstep until we find a match.
+
+
+ var depth = depthA;
+
+ while (depth--) {
+ if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {
+ return nodeA;
+ }
+
+ nodeA = getParent(nodeA);
+ nodeB = getParent(nodeB);
+ }
+
+ return null;
+}
+
+function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {
+ var registrationName = event._reactName;
+ var listeners = [];
+ var instance = target;
+
+ while (instance !== null) {
+ if (instance === common) {
+ break;
+ }
+
+ var _instance4 = instance,
+ alternate = _instance4.alternate,
+ stateNode = _instance4.stateNode,
+ tag = _instance4.tag;
+
+ if (alternate !== null && alternate === common) {
+ break;
+ }
+
+ if ((tag === HostComponent || (tag === HostHoistable ) || (tag === HostSingleton )) && stateNode !== null) {
+ var currentTarget = stateNode;
+
+ if (inCapturePhase) {
+ var captureListener = getListener(instance, registrationName);
+
+ if (captureListener != null) {
+ listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));
+ }
+ } else if (!inCapturePhase) {
+ var bubbleListener = getListener(instance, registrationName);
+
+ if (bubbleListener != null) {
+ listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));
+ }
+ }
+ }
+
+ instance = instance.return;
+ }
+
+ if (listeners.length !== 0) {
+ dispatchQueue.push({
+ event: event,
+ listeners: listeners
+ });
+ }
+} // We should only use this function for:
+// - EnterLeaveEventPlugin
+// This is because we only process this plugin
+// in the bubble phase, so we need to accumulate two
+// phase event listeners.
+
+
+function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {
+ var common = from && to ? getLowestCommonAncestor(from, to) : null;
+
+ if (from !== null) {
+ accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);
+ }
+
+ if (to !== null && enterEvent !== null) {
+ accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);
+ }
+}
+function getListenerSetKey(domEventName, capture) {
+ return domEventName + "__" + (capture ? 'capture' : 'bubble');
+}
+
+var didWarnControlledToUncontrolled = false;
+var didWarnUncontrolledToControlled = false;
+var didWarnInvalidHydration = false;
+var didWarnFormActionType = false;
+var didWarnFormActionName = false;
+var didWarnFormActionTarget = false;
+var didWarnFormActionMethod = false;
+var canDiffStyleForHydrationWarning;
+
+{
+ // IE 11 parses & normalizes the style attribute as opposed to other
+ // browsers. It adds spaces and sorts the properties in some
+ // non-alphabetical order. Handling that would require sorting CSS
+ // properties in the client & server versions or applying
+ // `expectedStyle` to a temporary DOM node to read its `style` attribute
+ // normalized. Since it only affects IE, we're skipping style warnings
+ // in that browser completely in favor of doing all that work.
+ // See https://github.com/facebook/react/issues/11807
+ canDiffStyleForHydrationWarning = disableIEWorkarounds ;
+}
+
+function validatePropertiesInDevelopment(type, props) {
+ {
+ validateProperties$2(type, props);
+ validateProperties$1(type, props);
+ validateProperties(type, props, {
+ registrationNameDependencies: registrationNameDependencies,
+ possibleRegistrationNames: possibleRegistrationNames
+ });
+
+ if (props.contentEditable && !props.suppressContentEditableWarning && props.children != null) {
+ error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');
+ }
+ }
+}
+
+function validateFormActionInDevelopment(tag, key, value, props) {
+ {
+ if (tag === 'form') {
+ if (key === 'formAction') {
+ error('You can only pass the formAction prop to or