);\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n\n illegalAttributeNameCache[attributeName] = true;\n\n {\n error('Invalid attribute name: `%s`', attributeName);\n }\n\n return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null) {\n return propertyInfo.type === RESERVED;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (name.length \u003E 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return true;\n }\n\n return false;\n}\nfunction shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n return false;\n }\n\n switch (typeof value) {\n case 'function': \u002F\u002F $FlowIssue symbol is perfectly valid here\n\n case 'symbol':\n \u002F\u002F eslint-disable-line\n return true;\n\n case 'boolean':\n {\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n return !propertyInfo.acceptsBooleans;\n } else {\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix !== 'data-' && prefix !== 'aria-';\n }\n }\n\n default:\n return false;\n }\n}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n if (value === null || typeof value === 'undefined') {\n return true;\n }\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n return true;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n\n switch (propertyInfo.type) {\n case BOOLEAN:\n return !value;\n\n case OVERLOADED_BOOLEAN:\n return value === false;\n\n case NUMERIC:\n return isNaN(value);\n\n case POSITIVE_NUMERIC:\n return isNaN(value) || value \u003C 1;\n }\n }\n\n return false;\n}\nfunction getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {\n this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n this.attributeName = attributeName;\n this.attributeNamespace = attributeNamespace;\n this.mustUseProperty = mustUseProperty;\n this.propertyName = name;\n this.type = type;\n this.sanitizeURL = sanitizeURL;\n this.removeEmptyString = removeEmptyString;\n} \u002F\u002F When adding attributes to this list, be sure to also add them to\n\u002F\u002F the `possibleStandardNames` module to ensure casing and incorrect\n\u002F\u002F name warnings.\n\n\nvar properties = {}; \u002F\u002F These props are reserved by React. They shouldn't be written to the DOM.\n\nvar reservedProps = ['children', 'dangerouslySetInnerHTML', \u002F\u002F TODO: This prevents the assignment of defaultValue to regular\n\u002F\u002F elements (not just inputs). Now that ReactDOMInput assigns to the\n\u002F\u002F defaultValue property -- do we need this?\n'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];\nreservedProps.forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, \u002F\u002F mustUseProperty\n name, \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F A few React string attributes have a different name.\n\u002F\u002F This is a mapping from React prop names to the attribute names.\n\n[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n var name = _ref[0],\n attributeName = _ref[1];\n properties[name] = new PropertyInfoRecord(name, STRING, false, \u002F\u002F mustUseProperty\n attributeName, \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These are \"enumerated\" HTML attributes that accept \"true\" and \"false\".\n\u002F\u002F In React, we let users pass `true` and `false` even though technically\n\u002F\u002F these aren't boolean attributes (they are coerced to strings).\n\n['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, \u002F\u002F mustUseProperty\n name.toLowerCase(), \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These are \"enumerated\" SVG attributes that accept \"true\" and \"false\".\n\u002F\u002F In React, we let users pass `true` and `false` even though technically\n\u002F\u002F these aren't boolean attributes (they are coerced to strings).\n\u002F\u002F Since these are SVG attributes, their attribute names are case-sensitive.\n\n['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, \u002F\u002F mustUseProperty\n name, \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These are HTML boolean attributes.\n\n['allowFullScreen', 'async', \u002F\u002F Note: there is a special case that prevents it from being written to the DOM\n\u002F\u002F on the client side because the browsers are inconsistent. Instead we call focus().\n'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', \u002F\u002F Microdata\n'itemScope'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, \u002F\u002F mustUseProperty\n name.toLowerCase(), \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These are the few React props that we set as DOM properties\n\u002F\u002F rather than attributes. These are all booleans.\n\n['checked', \u002F\u002F Note: `option.selected` is not updated if `select.multiple` is\n\u002F\u002F disabled with `removeAttribute`. We have special logic for handling this.\n'multiple', 'muted', 'selected' \u002F\u002F NOTE: if you add a camelCased prop to this list,\n\u002F\u002F you'll need to set attributeName to name.toLowerCase()\n\u002F\u002F instead in the assignment below.\n].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, \u002F\u002F mustUseProperty\n name, \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These are HTML attributes that are \"overloaded booleans\": they behave like\n\u002F\u002F booleans, but can also accept a string value.\n\n['capture', 'download' \u002F\u002F NOTE: if you add a camelCased prop to this list,\n\u002F\u002F you'll need to set attributeName to name.toLowerCase()\n\u002F\u002F instead in the assignment below.\n].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, \u002F\u002F mustUseProperty\n name, \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These are HTML attributes that must be positive numbers.\n\n['cols', 'rows', 'size', 'span' \u002F\u002F NOTE: if you add a camelCased prop to this list,\n\u002F\u002F you'll need to set attributeName to name.toLowerCase()\n\u002F\u002F instead in the assignment below.\n].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, \u002F\u002F mustUseProperty\n name, \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These are HTML attributes that must be numbers.\n\n['rowSpan', 'start'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, NUMERIC, false, \u002F\u002F mustUseProperty\n name.toLowerCase(), \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n});\nvar CAMELIZE = \u002F[\\-\\:]([a-z])\u002Fg;\n\nvar capitalize = function (token) {\n return token[1].toUpperCase();\n}; \u002F\u002F This is a list of all SVG attributes that need special casing, namespacing,\n\u002F\u002F or boolean value assignment. Regular attributes that just accept strings\n\u002F\u002F and have the same names are omitted, just like in the HTML attribute filter.\n\u002F\u002F Some of these attributes can be hard to find. This list was created by\n\u002F\u002F scraping the MDN documentation.\n\n\n['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' \u002F\u002F NOTE: if you add a camelCased prop to this list,\n\u002F\u002F you'll need to set attributeName to name.toLowerCase()\n\u002F\u002F instead in the assignment below.\n].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, \u002F\u002F mustUseProperty\n attributeName, null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F String SVG attributes with the xlink namespace.\n\n['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' \u002F\u002F NOTE: if you add a camelCased prop to this list,\n\u002F\u002F you'll need to set attributeName to name.toLowerCase()\n\u002F\u002F instead in the assignment below.\n].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, \u002F\u002F mustUseProperty\n attributeName, 'http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxlink', false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F String SVG attributes with the xml namespace.\n\n['xml:base', 'xml:lang', 'xml:space' \u002F\u002F NOTE: if you add a camelCased prop to this list,\n\u002F\u002F you'll need to set attributeName to name.toLowerCase()\n\u002F\u002F instead in the assignment below.\n].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, \u002F\u002F mustUseProperty\n attributeName, 'http:\u002F\u002Fwww.w3.org\u002FXML\u002F1998\u002Fnamespace', false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These attribute exists both in HTML and SVG.\n\u002F\u002F The attribute name is case-sensitive in SVG so we can't just use\n\u002F\u002F the React name like we do for attributes that exist only in HTML.\n\n['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, \u002F\u002F mustUseProperty\n attributeName.toLowerCase(), \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n false, \u002F\u002F sanitizeURL\n false);\n}); \u002F\u002F These attributes accept URLs. These must not allow javascript: URLS.\n\u002F\u002F These will also need to accept Trusted Types object in the future.\n\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, \u002F\u002F mustUseProperty\n'xlink:href', 'http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxlink', true, \u002F\u002F sanitizeURL\nfalse);\n['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, \u002F\u002F mustUseProperty\n attributeName.toLowerCase(), \u002F\u002F attributeName\n null, \u002F\u002F attributeNamespace\n true, \u002F\u002F sanitizeURL\n true);\n});\n\n\u002F\u002F and any newline or tab are filtered out as if they're not part of the URL.\n\u002F\u002F https:\u002F\u002Furl.spec.whatwg.org\u002F#url-parsing\n\u002F\u002F Tab or newline are defined as \\r\\n\\t:\n\u002F\u002F https:\u002F\u002Finfra.spec.whatwg.org\u002F#ascii-tab-or-newline\n\u002F\u002F A C0 control is a code point in the range \\u0000 NULL to \\u001F\n\u002F\u002F INFORMATION SEPARATOR ONE, inclusive:\n\u002F\u002F https:\u002F\u002Finfra.spec.whatwg.org\u002F#c0-control-or-space\n\n\u002F* eslint-disable max-len *\u002F\n\nvar isJavaScriptProtocol = \u002F^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:\u002Fi;\nvar didWarn = false;\n\nfunction sanitizeURL(url) {\n {\n if (!didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n\n error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n }\n }\n}\n\n\u002F**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \"expected\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n *\u002F\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n {\n if (propertyInfo.mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n return node[propertyName];\n } else {\n if ( propertyInfo.sanitizeURL) {\n \u002F\u002F If we haven't fully disabled javascript: URLs, and if\n \u002F\u002F the hydration is successful of a javascript: URL, we\n \u002F\u002F still want to warn on the client.\n sanitizeURL('' + expected);\n }\n\n var attributeName = propertyInfo.attributeName;\n var stringValue = null;\n\n if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n if (node.hasAttribute(attributeName)) {\n var value = node.getAttribute(attributeName);\n\n if (value === '') {\n return true;\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return value;\n }\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n } else if (node.hasAttribute(attributeName)) {\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n \u002F\u002F We had an attribute but shouldn't have had one, so read it\n \u002F\u002F for the error message.\n return node.getAttribute(attributeName);\n }\n\n if (propertyInfo.type === BOOLEAN) {\n \u002F\u002F If this was a boolean, it doesn't matter what the value is\n \u002F\u002F the fact that we have it is the same as the expected.\n return expected;\n } \u002F\u002F Even if this property uses a namespace we use getAttribute\n \u002F\u002F because we assume its namespaced name is the same as our config.\n \u002F\u002F To use getAttributeNS we need the local name which we don't have\n \u002F\u002F in our config atm.\n\n\n stringValue = node.getAttribute(attributeName);\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return stringValue === null ? expected : stringValue;\n } else if (stringValue === '' + expected) {\n return expected;\n } else {\n return stringValue;\n }\n }\n }\n}\n\u002F**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n *\u002F\n\nfunction getValueForAttribute(node, name, expected) {\n {\n if (!isAttributeNameSafe(name)) {\n return;\n } \u002F\u002F If the object is an opaque reference ID, it's expected that\n \u002F\u002F the next prop is different than the server value, so just return\n \u002F\u002F expected\n\n\n if (isOpaqueHydratingObject(expected)) {\n return expected;\n }\n\n if (!node.hasAttribute(name)) {\n return expected === undefined ? undefined : null;\n }\n\n var value = node.getAttribute(name);\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n}\n\u002F**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n *\u002F\n\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n var propertyInfo = getPropertyInfo(name);\n\n if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n return;\n }\n\n if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n value = null;\n } \u002F\u002F If the prop isn't in the special list, treat it as a simple attribute.\n\n\n if (isCustomComponentTag || propertyInfo === null) {\n if (isAttributeNameSafe(name)) {\n var _attributeName = name;\n\n if (value === null) {\n node.removeAttribute(_attributeName);\n } else {\n node.setAttribute(_attributeName, '' + value);\n }\n }\n\n return;\n }\n\n var mustUseProperty = propertyInfo.mustUseProperty;\n\n if (mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n\n if (value === null) {\n var type = propertyInfo.type;\n node[propertyName] = type === BOOLEAN ? false : '';\n } else {\n \u002F\u002F Contrary to `setAttribute`, object properties are properly\n \u002F\u002F `toString`ed by IE8\u002F9.\n node[propertyName] = value;\n }\n\n return;\n } \u002F\u002F The rest are treated as attributes with special cases.\n\n\n var attributeName = propertyInfo.attributeName,\n attributeNamespace = propertyInfo.attributeNamespace;\n\n if (value === null) {\n node.removeAttribute(attributeName);\n } else {\n var _type = propertyInfo.type;\n var attributeValue;\n\n if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n \u002F\u002F If attribute type is boolean, we know for sure it won't be an execution sink\n \u002F\u002F and we won't require Trusted Type here.\n attributeValue = '';\n } else {\n \u002F\u002F `setAttribute` with objects becomes only `[object]` in IE8\u002F9,\n \u002F\u002F ('' + value) makes it output the correct toString()-value.\n {\n attributeValue = '' + value;\n }\n\n if (propertyInfo.sanitizeURL) {\n sanitizeURL(attributeValue.toString());\n }\n }\n\n if (attributeNamespace) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n } else {\n node.setAttribute(attributeName, attributeValue);\n }\n }\n}\n\n\u002F\u002F ATTENTION\n\u002F\u002F When adding new symbols to this file,\n\u002F\u002F Please consider also adding to 'react-devtools-shared\u002Fsrc\u002Fbackend\u002FReactSymbols'\n\u002F\u002F The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n\u002F\u002F nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nvar REACT_FRAGMENT_TYPE = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor = Symbol.for;\n REACT_ELEMENT_TYPE = symbolFor('react.element');\n REACT_PORTAL_TYPE = symbolFor('react.portal');\n REACT_FRAGMENT_TYPE = symbolFor('react.fragment');\n REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n REACT_PROFILER_TYPE = symbolFor('react.profiler');\n REACT_PROVIDER_TYPE = symbolFor('react.provider');\n REACT_CONTEXT_TYPE = symbolFor('react.context');\n REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n REACT_MEMO_TYPE = symbolFor('react.memo');\n REACT_LAZY_TYPE = symbolFor('react.lazy');\n REACT_BLOCK_TYPE = symbolFor('react.block');\n REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n REACT_SCOPE_TYPE = symbolFor('react.scope');\n REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n\u002F\u002F Helpers to patch console.logs to avoid logging during side-effect free\n\u002F\u002F replaying on render function. This currently only patches the object\n\u002F\u002F lazily which won't cover if the log function was extracted eagerly.\n\u002F\u002F We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n \u002F* eslint-disable react-internal\u002Fno-production-logging *\u002F\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; \u002F\u002F $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n \u002F* eslint-enable react-internal\u002Fno-production-logging *\u002F\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n \u002F* eslint-disable react-internal\u002Fno-production-logging *\u002F\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; \u002F\u002F $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: _assign({}, props, {\n value: prevLog\n }),\n info: _assign({}, props, {\n value: prevInfo\n }),\n warn: _assign({}, props, {\n value: prevWarn\n }),\n error: _assign({}, props, {\n value: prevError\n }),\n group: _assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: _assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: _assign({}, props, {\n value: prevGroupEnd\n })\n });\n \u002F* eslint-enable react-internal\u002Fno-production-logging *\u002F\n }\n\n if (disabledDepth \u003C 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n \u002F\u002F Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(\u002F\\n( *(at )?)\u002F);\n prefix = match && match[1] || '';\n }\n } \u002F\u002F We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n \u002F\u002F If something asked for a stack inside a fake render, it should get ignored.\n if (!fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; \u002F\u002F $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; \u002F\u002F Set the dispatcher in DEV because this might be call in the render function\n \u002F\u002F for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n \u002F\u002F This should throw.\n if (construct) {\n \u002F\u002F Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; \u002F\u002F $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n \u002F\u002F We use a throwing setter instead of frozen or non-writable props\n \u002F\u002F because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n \u002F\u002F We construct a different control for this case to include any extra\n \u002F\u002F frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n \u002F\u002F This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n \u002F\u002F This extracts the first frame from the sample that isn't also in the control.\n \u002F\u002F Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s \u003E= 1 && c \u003E= 0 && sampleLines[s] !== controlLines[c]) {\n \u002F\u002F We expect at least one stack frame to be shared.\n \u002F\u002F Typically this will be the root most one. However, stack frames may be\n \u002F\u002F cut off due to maximum stack limits. In this case, one maybe cut off\n \u002F\u002F earlier than the other. We assume that the sample is longer or the same\n \u002F\u002F and there for cut off earlier. So we should find the root most frame in\n \u002F\u002F the sample somewhere in the control.\n c--;\n }\n\n for (; s \u003E= 1 && c \u003E= 0; s--, c--) {\n \u002F\u002F Next we find the first one that isn't the same which should be the\n \u002F\u002F frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n \u002F\u002F In V8, the first line is describing the message but other VMs don't.\n \u002F\u002F If we're about to return the first line, and the control is also on the same\n \u002F\u002F line, that's a pretty good indicator that our sample threw at same line as\n \u002F\u002F the control. I.e. before we entered the sample frame. So we ignore this result.\n \u002F\u002F This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; \u002F\u002F We may still have similar intermediate frames from the construct call.\n \u002F\u002F The next one that isn't the same should be our match though.\n\n if (c \u003C 0 || sampleLines[s] !== controlLines[c]) {\n \u002F\u002F V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at ');\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } \u002F\u002F Return the line we found.\n\n\n return _frame;\n }\n } while (s \u003E= 1 && c \u003E= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } \u002F\u002F Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\n\nfunction describeClassComponentFrame(ctor, source, ownerFn) {\n {\n return describeNativeComponentFrame(ctor, true);\n }\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n \u002F\u002F Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_BLOCK_TYPE:\n return describeFunctionComponentFrame(type._render);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n \u002F\u002F Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nfunction describeFiber(fiber) {\n var owner = fiber._debugOwner ? fiber._debugOwner.type : null ;\n var source = fiber._debugSource ;\n\n switch (fiber.tag) {\n case HostComponent:\n return describeBuiltInComponentFrame(fiber.type);\n\n case LazyComponent:\n return describeBuiltInComponentFrame('Lazy');\n\n case SuspenseComponent:\n return describeBuiltInComponentFrame('Suspense');\n\n case SuspenseListComponent:\n return describeBuiltInComponentFrame('SuspenseList');\n\n case FunctionComponent:\n case IndeterminateComponent:\n case SimpleMemoComponent:\n return describeFunctionComponentFrame(fiber.type);\n\n case ForwardRef:\n return describeFunctionComponentFrame(fiber.type.render);\n\n case Block:\n return describeFunctionComponentFrame(fiber.type._render);\n\n case ClassComponent:\n return describeClassComponentFrame(fiber.type);\n\n default:\n return '';\n }\n}\n\nfunction getStackByFiberInDevAndProd(workInProgress) {\n try {\n var info = '';\n var node = workInProgress;\n\n do {\n info += describeFiber(node);\n node = node.return;\n } while (node);\n\n return info;\n } catch (x) {\n return '\\nError generating stack: ' + x.message + '\\n' + x.stack;\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n}\n\nfunction getComponentName(type) {\n if (type == null) {\n \u002F\u002F Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n\n if (typeof type === 'object') {\n switch (type.$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_BLOCK_TYPE:\n return getComponentName(type._render);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentName(init(payload));\n } catch (x) {\n return null;\n }\n }\n }\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\nvar current = null;\nvar isRendering = false;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n {\n if (current === null) {\n return null;\n }\n\n var owner = current._debugOwner;\n\n if (owner !== null && typeof owner !== 'undefined') {\n return getComponentName(owner.type);\n }\n }\n\n return null;\n}\n\nfunction getCurrentFiberStackInDev() {\n {\n if (current === null) {\n return '';\n } \u002F\u002F Safe because if current fiber exists, we are reconciling,\n \u002F\u002F and it is guaranteed to be the work-in-progress version.\n\n\n return getStackByFiberInDevAndProd(current);\n }\n}\n\nfunction resetCurrentFiber() {\n {\n ReactDebugCurrentFrame.getCurrentStack = null;\n current = null;\n isRendering = false;\n }\n}\nfunction setCurrentFiber(fiber) {\n {\n ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;\n current = fiber;\n isRendering = false;\n }\n}\nfunction setIsRendering(rendering) {\n {\n isRendering = rendering;\n }\n}\nfunction getIsRendering() {\n {\n return isRendering;\n }\n}\n\n\u002F\u002F Flow does not allow string concatenation of most non-string types. To work\n\u002F\u002F around this limitation, we use an opaque type that can only be obtained by\n\u002F\u002F passing the value through getToStringValue first.\nfunction toString(value) {\n return '' + value;\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'object':\n case 'string':\n case 'undefined':\n return value;\n\n default:\n \u002F\u002F function, symbol are assigned as empty strings\n return '';\n }\n}\n\nvar hasReadOnlyValue = {\n button: true,\n checkbox: true,\n image: true,\n hidden: true,\n radio: true,\n reset: true,\n submit: true\n};\nfunction checkControlledValueProps(tagName, props) {\n {\n if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {\n error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n\n if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {\n error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n }\n}\n\nfunction isCheckable(elem) {\n var type = elem.type;\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\n\nfunction getTracker(node) {\n return node._valueTracker;\n}\n\nfunction detachTracker(node) {\n node._valueTracker = null;\n}\n\nfunction getValueFromNode(node) {\n var value = '';\n\n if (!node) {\n return value;\n }\n\n if (isCheckable(node)) {\n value = node.checked ? 'true' : 'false';\n } else {\n value = node.value;\n }\n\n return value;\n}\n\nfunction trackValueOnNode(node) {\n var valueField = isCheckable(node) ? 'checked' : 'value';\n var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n var currentValue = '' + node[valueField]; \u002F\u002F if someone has already defined a value or Safari, then bail\n \u002F\u002F and don't track value will cause over reporting of changes,\n \u002F\u002F but it's better then a hard failure\n \u002F\u002F (needed for certain tests that spyOn input values and Safari)\n\n if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n return;\n }\n\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: true,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n currentValue = '' + value;\n set.call(this, value);\n }\n }); \u002F\u002F We could've passed this the first time\n \u002F\u002F but it triggers a bug in IE11 and Edge 14\u002F15.\n \u002F\u002F Calling defineProperty() again should be equivalent.\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F11768\n\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n var tracker = {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n currentValue = '' + value;\n },\n stopTracking: function () {\n detachTracker(node);\n delete node[valueField];\n }\n };\n return tracker;\n}\n\nfunction track(node) {\n if (getTracker(node)) {\n return;\n } \u002F\u002F TODO: Once it's just Fiber we can move this to node._wrapperState\n\n\n node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n if (!node) {\n return false;\n }\n\n var tracker = getTracker(node); \u002F\u002F if there is no tracker at this point it's unlikely\n \u002F\u002F that trying again will succeed\n\n if (!tracker) {\n return true;\n }\n\n var lastValue = tracker.getValue();\n var nextValue = getValueFromNode(node);\n\n if (nextValue !== lastValue) {\n tracker.setValue(nextValue);\n return true;\n }\n\n return false;\n}\n\nfunction getActiveElement(doc) {\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n\n if (typeof doc === 'undefined') {\n return null;\n }\n\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction isControlled(props) {\n var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n return usesChecked ? props.checked != null : props.value != null;\n}\n\u002F**\n * Implements an \u003Cinput\u003E host component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null\u002Fundefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null\u002Fundefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * See http:\u002F\u002Fwww.w3.org\u002FTR\u002F2012\u002FWD-html5-20121025\u002Fthe-input-element.html\n *\u002F\n\n\nfunction getHostProps(element, props) {\n var node = element;\n var checked = props.checked;\n\n var hostProps = _assign({}, props, {\n defaultChecked: undefined,\n defaultValue: undefined,\n value: undefined,\n checked: checked != null ? checked : node._wrapperState.initialChecked\n });\n\n return hostProps;\n}\nfunction initWrapperState(element, props) {\n {\n checkControlledValueProps('input', props);\n\n if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Fcontrolled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnCheckedDefaultChecked = true;\n }\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Fcontrolled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n\n didWarnValueDefaultValue = true;\n }\n }\n\n var node = element;\n var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n node._wrapperState = {\n initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n controlled: isControlled(props)\n };\n}\nfunction updateChecked(element, props) {\n var node = element;\n var checked = props.checked;\n\n if (checked != null) {\n setValueForProperty(node, 'checked', checked, false);\n }\n}\nfunction updateWrapper(element, props) {\n var node = element;\n\n {\n var controlled = isControlled(props);\n\n if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https:\u002F\u002Freactjs.org\u002Flink\u002Fcontrolled-components');\n\n didWarnUncontrolledToControlled = true;\n }\n\n if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https:\u002F\u002Freactjs.org\u002Flink\u002Fcontrolled-components');\n\n didWarnControlledToUncontrolled = true;\n }\n }\n\n updateChecked(element, props);\n var value = getToStringValue(props.value);\n var type = props.type;\n\n if (value != null) {\n if (type === 'number') {\n if (value === 0 && node.value === '' || \u002F\u002F We explicitly want to coerce to number here if possible.\n \u002F\u002F eslint-disable-next-line\n node.value != value) {\n node.value = toString(value);\n }\n } else if (node.value !== toString(value)) {\n node.value = toString(value);\n }\n } else if (type === 'submit' || type === 'reset') {\n \u002F\u002F Submit\u002Freset inputs need the attribute removed completely to avoid\n \u002F\u002F blank-text buttons.\n node.removeAttribute('value');\n return;\n }\n\n {\n \u002F\u002F When syncing the value attribute, the value comes from a cascade of\n \u002F\u002F properties:\n \u002F\u002F 1. The value React property\n \u002F\u002F 2. The defaultValue React property\n \u002F\u002F 3. Otherwise there should be no change\n if (props.hasOwnProperty('value')) {\n setDefaultValue(node, props.type, value);\n } else if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n }\n\n {\n \u002F\u002F When syncing the checked attribute, it only changes when it needs\n \u002F\u002F to be removed, such as transitioning from a checkbox into a text input\n if (props.checked == null && props.defaultChecked != null) {\n node.defaultChecked = !!props.defaultChecked;\n }\n }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n var node = element; \u002F\u002F Do not assign value if it is already set. This prevents user text input\n \u002F\u002F from being lost during SSR hydration.\n\n if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n var type = props.type;\n var isButton = type === 'submit' || type === 'reset'; \u002F\u002F Avoid setting value attribute on submit\u002Freset inputs as it overrides the\n \u002F\u002F default value provided by the browser. See: #12872\n\n if (isButton && (props.value === undefined || props.value === null)) {\n return;\n }\n\n var initialValue = toString(node._wrapperState.initialValue); \u002F\u002F Do not assign value if it is already set. This prevents user text input\n \u002F\u002F from being lost during SSR hydration.\n\n if (!isHydrating) {\n {\n \u002F\u002F When syncing the value attribute, the value property should use\n \u002F\u002F the wrapperState._initialValue property. This uses:\n \u002F\u002F\n \u002F\u002F 1. The value React property when present\n \u002F\u002F 2. The defaultValue React property when present\n \u002F\u002F 3. An empty string\n if (initialValue !== node.value) {\n node.value = initialValue;\n }\n }\n }\n\n {\n \u002F\u002F Otherwise, the value attribute is synchronized to the property,\n \u002F\u002F so we assign defaultValue to the same thing as the value property\n \u002F\u002F assignment step above.\n node.defaultValue = initialValue;\n }\n } \u002F\u002F Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug\n \u002F\u002F this is needed to work around a chrome bug where setting defaultChecked\n \u002F\u002F will sometimes influence the value of checked (even after detachment).\n \u002F\u002F Reference: https:\u002F\u002Fbugs.chromium.org\u002Fp\u002Fchromium\u002Fissues\u002Fdetail?id=608416\n \u002F\u002F We need to temporarily unset name to avoid disrupting radio button groups.\n\n\n var name = node.name;\n\n if (name !== '') {\n node.name = '';\n }\n\n {\n \u002F\u002F When syncing the checked attribute, both the checked property and\n \u002F\u002F attribute are assigned at the same time using defaultChecked. This uses:\n \u002F\u002F\n \u002F\u002F 1. The checked React property when present\n \u002F\u002F 2. The defaultChecked React property when present\n \u002F\u002F 3. Otherwise, false\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!node._wrapperState.initialChecked;\n }\n\n if (name !== '') {\n node.name = name;\n }\n}\nfunction restoreControlledState(element, props) {\n var node = element;\n updateWrapper(node, props);\n updateNamedCousins(node, props);\n}\n\nfunction updateNamedCousins(rootNode, props) {\n var name = props.name;\n\n if (props.type === 'radio' && name != null) {\n var queryRoot = rootNode;\n\n while (queryRoot.parentNode) {\n queryRoot = queryRoot.parentNode;\n } \u002F\u002F If `rootNode.form` was non-null, then we could try `form.elements`,\n \u002F\u002F but that sometimes behaves strangely in IE8. We could also try using\n \u002F\u002F `form.getElementsByName`, but that will only return direct children\n \u002F\u002F and won't include inputs that use the HTML5 `form=` attribute. Since\n \u002F\u002F the input might not even be in a form. It might not even be in the\n \u002F\u002F document. Let's just use the local `querySelectorAll` to ensure we don't\n \u002F\u002F miss anything.\n\n\n var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\n for (var i = 0; i \u003C group.length; i++) {\n var otherNode = group[i];\n\n if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n continue;\n } \u002F\u002F This will throw if radio buttons rendered by different copies of React\n \u002F\u002F and the same name are rendered into the same form (same as #1939).\n \u002F\u002F That's probably okay; we don't support it just as we don't support\n \u002F\u002F mixing React radio buttons with non-React ones.\n\n\n var otherProps = getFiberCurrentPropsFromNode(otherNode);\n\n if (!otherProps) {\n {\n throw Error( \"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.\" );\n }\n } \u002F\u002F We need update the tracked value on the named cousin since the value\n \u002F\u002F was changed but the input saw no event or value set\n\n\n updateValueIfChanged(otherNode); \u002F\u002F If this is a controlled radio button group, forcing the input that\n \u002F\u002F was previously checked to update will cause it to be come re-checked\n \u002F\u002F as appropriate.\n\n updateWrapper(otherNode, otherProps);\n }\n }\n} \u002F\u002F In Chrome, assigning defaultValue to certain input types triggers input validation.\n\u002F\u002F For number inputs, the display value loses trailing decimal points. For email inputs,\n\u002F\u002F Chrome raises \"The specified value \u003Cx\u003E is not a valid email address\".\n\u002F\u002F\n\u002F\u002F Here we check to see if the defaultValue has actually changed, avoiding these problems\n\u002F\u002F when the user is inputting text\n\u002F\u002F\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F7253\n\n\nfunction setDefaultValue(node, type, value) {\n if ( \u002F\u002F Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}\n\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\n\nfunction flattenChildren(children) {\n var content = ''; \u002F\u002F Flatten children. We'll warn if they are invalid\n \u002F\u002F during validateProps() which runs for hydration too.\n \u002F\u002F Note that this would throw on non-element objects.\n \u002F\u002F Elements are stringified (which is normally irrelevant\n \u002F\u002F but matters for \u003Cfbt\u003E).\n\n React.Children.forEach(children, function (child) {\n if (child == null) {\n return;\n }\n\n content += child; \u002F\u002F Note: we don't warn about invalid children here.\n \u002F\u002F Instead, this is done separately below so that\n \u002F\u002F it happens during the hydration code path too.\n });\n return content;\n}\n\u002F**\n * Implements an \u003Coption\u003E host component that warns when `selected` is set.\n *\u002F\n\n\nfunction validateProps(element, props) {\n {\n \u002F\u002F This mirrors the code path above, but runs for hydration too.\n \u002F\u002F Warn about invalid children here so that client and hydration are consistent.\n \u002F\u002F TODO: this seems like it could cause a DEV-only throw for hydration\n \u002F\u002F if children contains a non-element object. We should try to avoid that.\n if (typeof props.children === 'object' && props.children !== null) {\n React.Children.forEach(props.children, function (child) {\n if (child == null) {\n return;\n }\n\n if (typeof child === 'string' || typeof child === 'number') {\n return;\n }\n\n if (typeof child.type !== 'string') {\n return;\n }\n\n if (!didWarnInvalidChild) {\n didWarnInvalidChild = true;\n\n error('Only strings and numbers are supported as \u003Coption\u003E children.');\n }\n });\n } \u002F\u002F TODO: Remove support for `selected` in \u003Coption\u003E.\n\n\n if (props.selected != null && !didWarnSelectedSetOnOption) {\n error('Use the `defaultValue` or `value` props on \u003Cselect\u003E instead of ' + 'setting `selected` on \u003Coption\u003E.');\n\n didWarnSelectedSetOnOption = true;\n }\n }\n}\nfunction postMountWrapper$1(element, props) {\n \u002F\u002F value=\"\" should make a value attribute (#6219)\n if (props.value != null) {\n element.setAttribute('value', toString(getToStringValue(props.value)));\n }\n}\nfunction getHostProps$1(element, props) {\n var hostProps = _assign({\n children: undefined\n }, props);\n\n var content = flattenChildren(props.children);\n\n if (content) {\n hostProps.children = content;\n }\n\n return hostProps;\n}\n\nvar didWarnValueDefaultValue$1;\n\n{\n didWarnValueDefaultValue$1 = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n return '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n return '';\n}\n\nvar valuePropNames = ['value', 'defaultValue'];\n\u002F**\n * Validation function for `value` and `defaultValue`.\n *\u002F\n\nfunction checkSelectPropTypes(props) {\n {\n checkControlledValueProps('select', props);\n\n for (var i = 0; i \u003C valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n\n if (props[propName] == null) {\n continue;\n }\n\n var isArray = Array.isArray(props[propName]);\n\n if (props.multiple && !isArray) {\n error('The `%s` prop supplied to \u003Cselect\u003E must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());\n } else if (!props.multiple && isArray) {\n error('The `%s` prop supplied to \u003Cselect\u003E must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());\n }\n }\n }\n}\n\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n var options = node.options;\n\n if (multiple) {\n var selectedValues = propValue;\n var selectedValue = {};\n\n for (var i = 0; i \u003C selectedValues.length; i++) {\n \u002F\u002F Prefix to avoid chaos with special keys.\n selectedValue['
+ selectedValues[i]] = true;\n }\n\n for (var _i = 0; _i \u003C options.length; _i++) {\n var selected = selectedValue.hasOwnProperty('
+ options[_i].value);\n\n if (options[_i].selected !== selected) {\n options[_i].selected = selected;\n }\n\n if (selected && setDefaultSelected) {\n options[_i].defaultSelected = true;\n }\n }\n } else {\n \u002F\u002F Do not set `select.value` as exact behavior isn't consistent across all\n \u002F\u002F browsers for all cases.\n var _selectedValue = toString(getToStringValue(propValue));\n\n var defaultSelected = null;\n\n for (var _i2 = 0; _i2 \u003C options.length; _i2++) {\n if (options[_i2].value === _selectedValue) {\n options[_i2].selected = true;\n\n if (setDefaultSelected) {\n options[_i2].defaultSelected = true;\n }\n\n return;\n }\n\n if (defaultSelected === null && !options[_i2].disabled) {\n defaultSelected = options[_i2];\n }\n }\n\n if (defaultSelected !== null) {\n defaultSelected.selected = true;\n }\n }\n}\n\u002F**\n * Implements a \u003Cselect\u003E host component that allows optionally setting the\n * props `value` and `defaultValue`. If `multiple` is false, the prop must be a\n * stringable. If `multiple` is true, the prop must be an array of stringables.\n *\n * If `value` is not supplied (or null\u002Fundefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null\u002Fundefined), the rendered options will not\n * update in response to user actions. Instead, the `value` prop must change in\n * order for the rendered options to update.\n *\n * If `defaultValue` is provided, any options with the supplied values will be\n * selected.\n *\u002F\n\n\nfunction getHostProps$2(element, props) {\n return _assign({}, props, {\n value: undefined\n });\n}\nfunction initWrapperState$1(element, props) {\n var node = element;\n\n {\n checkSelectPropTypes(props);\n }\n\n node._wrapperState = {\n wasMultiple: !!props.multiple\n };\n\n {\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Fcontrolled-components');\n\n didWarnValueDefaultValue$1 = true;\n }\n }\n}\nfunction postMountWrapper$2(element, props) {\n var node = element;\n node.multiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n }\n}\nfunction postUpdateWrapper(element, props) {\n var node = element;\n var wasMultiple = node._wrapperState.wasMultiple;\n node._wrapperState.wasMultiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (wasMultiple !== !!props.multiple) {\n \u002F\u002F For simplicity, reapply `defaultValue` if `multiple` is toggled.\n if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n } else {\n \u002F\u002F Revert the select back to its default unselected state.\n updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n }\n }\n}\nfunction restoreControlledState$1(element, props) {\n var node = element;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n }\n}\n\nvar didWarnValDefaultVal = false;\n\n\u002F**\n * Implements a \u003Ctextarea\u003E host component that allows setting `value`, and\n * `defaultValue`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If `value` is not supplied (or null\u002Fundefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If `value` is supplied (and not null\u002Fundefined), the rendered element will\n * not trigger updates to the element. Instead, the `value` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * `defaultValue` if specified, or the children content (deprecated).\n *\u002F\nfunction getHostProps$3(element, props) {\n var node = element;\n\n if (!(props.dangerouslySetInnerHTML == null)) {\n {\n throw Error( \"`dangerouslySetInnerHTML` does not make sense on \u003Ctextarea\u003E.\" );\n }\n } \u002F\u002F Always set children to the same thing. In IE9, the selection range will\n \u002F\u002F get reset if `textContent` is mutated. We could add a check in setTextContent\n \u002F\u002F to only set the value if\u002Fwhen the value differs from the node value (which would\n \u002F\u002F completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n \u002F\u002F solution. The value can be a boolean or object so that's why it's forced\n \u002F\u002F to be a string.\n\n\n var hostProps = _assign({}, props, {\n value: undefined,\n defaultValue: undefined,\n children: toString(node._wrapperState.initialValue)\n });\n\n return hostProps;\n}\nfunction initWrapperState$2(element, props) {\n var node = element;\n\n {\n checkControlledValueProps('textarea', props);\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Fcontrolled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');\n\n didWarnValDefaultVal = true;\n }\n }\n\n var initialValue = props.value; \u002F\u002F Only bother fetching default value if we're going to use it\n\n if (initialValue == null) {\n var children = props.children,\n defaultValue = props.defaultValue;\n\n if (children != null) {\n {\n error('Use the `defaultValue` or `value` props instead of setting ' + 'children on \u003Ctextarea\u003E.');\n }\n\n {\n if (!(defaultValue == null)) {\n {\n throw Error( \"If you supply `defaultValue` on a \u003Ctextarea\u003E, do not pass children.\" );\n }\n }\n\n if (Array.isArray(children)) {\n if (!(children.length \u003C= 1)) {\n {\n throw Error( \"\u003Ctextarea\u003E can only have at most one child.\" );\n }\n }\n\n children = children[0];\n }\n\n defaultValue = children;\n }\n }\n\n if (defaultValue == null) {\n defaultValue = '';\n }\n\n initialValue = defaultValue;\n }\n\n node._wrapperState = {\n initialValue: getToStringValue(initialValue)\n };\n}\nfunction updateWrapper$1(element, props) {\n var node = element;\n var value = getToStringValue(props.value);\n var defaultValue = getToStringValue(props.defaultValue);\n\n if (value != null) {\n \u002F\u002F Cast `value` to a string to ensure the value is set correctly. While\n \u002F\u002F browsers typically do this as necessary, jsdom doesn't.\n var newValue = toString(value); \u002F\u002F To avoid side effects (such as losing text selection), only set value if changed\n\n if (newValue !== node.value) {\n node.value = newValue;\n }\n\n if (props.defaultValue == null && node.defaultValue !== newValue) {\n node.defaultValue = newValue;\n }\n }\n\n if (defaultValue != null) {\n node.defaultValue = toString(defaultValue);\n }\n}\nfunction postMountWrapper$3(element, props) {\n var node = element; \u002F\u002F This is in postMount because we need access to the DOM node, which is not\n \u002F\u002F available until after the component has mounted.\n\n var textContent = node.textContent; \u002F\u002F Only set node.value if textContent is equal to the expected\n \u002F\u002F initial value. In IE10\u002FIE11 there is a bug where the placeholder attribute\n \u002F\u002F will populate textContent as well.\n \u002F\u002F https:\u002F\u002Fdeveloper.microsoft.com\u002Fmicrosoft-edge\u002Fplatform\u002Fissues\u002F101525\u002F\n\n if (textContent === node._wrapperState.initialValue) {\n if (textContent !== '' && textContent !== null) {\n node.value = textContent;\n }\n }\n}\nfunction restoreControlledState$2(element, props) {\n \u002F\u002F DOM component is still mounted; update\n updateWrapper$1(element, props);\n}\n\nvar HTML_NAMESPACE = 'http:\u002F\u002Fwww.w3.org\u002F1999\u002Fxhtml';\nvar MATH_NAMESPACE = 'http:\u002F\u002Fwww.w3.org\u002F1998\u002FMath\u002FMathML';\nvar SVG_NAMESPACE = 'http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg';\nvar Namespaces = {\n html: HTML_NAMESPACE,\n mathml: MATH_NAMESPACE,\n svg: SVG_NAMESPACE\n}; \u002F\u002F Assumes there is no parent namespace.\n\nfunction getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n\n case 'math':\n return MATH_NAMESPACE;\n\n default:\n return HTML_NAMESPACE;\n }\n}\nfunction getChildNamespace(parentNamespace, type) {\n if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {\n \u002F\u002F No (or default) parent namespace: potential entry point.\n return getIntrinsicNamespace(type);\n }\n\n if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n \u002F\u002F We're leaving SVG.\n return HTML_NAMESPACE;\n } \u002F\u002F By default, pass namespace below.\n\n\n return parentNamespace;\n}\n\n\u002F* globals MSApp *\u002F\n\n\u002F**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n *\u002F\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n return function (arg0, arg1, arg2, arg3) {\n MSApp.execUnsafeLocalFunction(function () {\n return func(arg0, arg1, arg2, arg3);\n });\n };\n } else {\n return func;\n }\n};\n\nvar reusableSVGContainer;\n\u002F**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n *\u002F\n\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n if (node.namespaceURI === Namespaces.svg) {\n\n if (!('innerHTML' in node)) {\n \u002F\u002F IE does not have innerHTML for SVG nodes, so instead we inject the\n \u002F\u002F new markup in a temp node and then move the child nodes across into\n \u002F\u002F the target node\n reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n reusableSVGContainer.innerHTML = '\u003Csvg\u003E' + html.valueOf().toString() + '\u003C\u002Fsvg\u003E';\n var svgNode = reusableSVGContainer.firstChild;\n\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n\n while (svgNode.firstChild) {\n node.appendChild(svgNode.firstChild);\n }\n\n return;\n }\n }\n\n node.innerHTML = html;\n});\n\n\u002F**\n * HTML nodeType values that represent the type of the node\n *\u002F\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n\n\u002F**\n * Set the textContent property of a node. For text updates, it's faster\n * to set the `nodeValue` of the Text node directly instead of using\n * `.textContent` which will remove the existing node and create a new one.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n *\u002F\n\nvar setTextContent = function (node, text) {\n if (text) {\n var firstChild = node.firstChild;\n\n if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n firstChild.nodeValue = text;\n return;\n }\n }\n\n node.textContent = text;\n};\n\n\u002F\u002F List derived from Gecko source code:\n\u002F\u002F https:\u002F\u002Fgithub.com\u002Fmozilla\u002Fgecko-dev\u002Fblob\u002F4e638efc71\u002Flayout\u002Fstyle\u002Ftest\u002Fproperty_database.js\nvar shorthandToLonghand = {\n animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],\n background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],\n borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],\n borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],\n borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],\n borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],\n borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],\n borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],\n borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],\n borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],\n borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],\n borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],\n borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],\n columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],\n columns: ['columnCount', 'columnWidth'],\n flex: ['flexBasis', 'flexGrow', 'flexShrink'],\n flexFlow: ['flexDirection', 'flexWrap'],\n font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],\n fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],\n gap: ['columnGap', 'rowGap'],\n grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],\n gridColumn: ['gridColumnEnd', 'gridColumnStart'],\n gridColumnGap: ['columnGap'],\n gridGap: ['columnGap', 'rowGap'],\n gridRow: ['gridRowEnd', 'gridRowStart'],\n gridRowGap: ['rowGap'],\n gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],\n margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],\n marker: ['markerEnd', 'markerMid', 'markerStart'],\n mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],\n maskPosition: ['maskPositionX', 'maskPositionY'],\n outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],\n overflow: ['overflowX', 'overflowY'],\n padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],\n placeContent: ['alignContent', 'justifyContent'],\n placeItems: ['alignItems', 'justifyItems'],\n placeSelf: ['alignSelf', 'justifySelf'],\n textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],\n textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],\n transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],\n wordWrap: ['overflowWrap']\n};\n\n\u002F**\n * CSS properties which accept numbers but are not in units of \"px\".\n *\u002F\nvar isUnitlessNumber = {\n animationIterationCount: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n columns: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridArea: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n \u002F\u002F SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n};\n\u002F**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n *\u002F\n\nfunction prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n\u002F**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n *\u002F\n\n\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O']; \u002F\u002F Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n\u002F\u002F infinite loop, because it iterates over the newly added props too.\n\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n});\n\n\u002F**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n *\u002F\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n \u002F\u002F Note that we've removed escapeTextForBrowser() calls here since the\n \u002F\u002F whole string will be escaped when the attribute is injected into\n \u002F\u002F the markup. If you provide unsafe user data here they can inject\n \u002F\u002F arbitrary CSS which may be problematic (I couldn't repro this):\n \u002F\u002F https:\u002F\u002Fwww.owasp.org\u002Findex.php\u002FXSS_Filter_Evasion_Cheat_Sheet\n \u002F\u002F http:\u002F\u002Fwww.thespanner.co.uk\u002F2007\u002F11\u002F26\u002Fultimate-xss-css-injection\u002F\n \u002F\u002F This is not an XSS hole but instead a potential CSS injection issue\n \u002F\u002F which has lead to a greater discussion about how we're going to\n \u002F\u002F trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n\n if (isEmpty) {\n return '';\n }\n\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; \u002F\u002F Presumes implicit 'px' suffix for unitless numbers\n }\n\n return ('' + value).trim();\n}\n\nvar uppercasePattern = \u002F([A-Z])\u002Fg;\nvar msPattern = \u002F^ms-\u002F;\n\u002F**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * \u003E hyphenateStyleName('backgroundColor')\n * \u003C \"background-color\"\n * \u003E hyphenateStyleName('MozTransition')\n * \u003C \"-moz-transition\"\n * \u003E hyphenateStyleName('msTransition')\n * \u003C \"-ms-transition\"\n *\n * As Modernizr suggests (http:\u002F\u002Fmodernizr.com\u002Fdocs\u002F#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n *\u002F\n\nfunction hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}\n\nvar warnValidStyle = function () {};\n\n{\n \u002F\u002F 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = \u002F^(?:webkit|moz|o)[A-Z]\u002F;\n var msPattern$1 = \u002F^-ms-\u002F;\n var hyphenPattern = \u002F-(.)\u002Fg; \u002F\u002F style values shouldn't contain a semicolon\n\n var badStyleValueWithSemicolonPattern = \u002F;\\s*$\u002F;\n var warnedStyleNames = {};\n var warnedStyleValues = {};\n var warnedForNaNValue = false;\n var warnedForInfinityValue = false;\n\n var camelize = function (string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n\n var warnHyphenatedStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\n error('Unsupported style property %s. Did you mean %s?', name, \u002F\u002F As Andi Smith suggests\n \u002F\u002F (http:\u002F\u002Fwww.andismith.com\u002Fblog\u002F2012\u002F02\u002Fmodernizr-prefixed\u002F), an `-ms` prefix\n \u002F\u002F is converted to lowercase `ms`.\n camelize(name.replace(msPattern$1, 'ms-')));\n };\n\n var warnBadVendoredStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n\n error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n };\n\n var warnStyleValueWithSemicolon = function (name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n\n warnedStyleValues[value] = true;\n\n error(\"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n\n var warnStyleValueIsNaN = function (name, value) {\n if (warnedForNaNValue) {\n return;\n }\n\n warnedForNaNValue = true;\n\n error('`NaN` is an invalid value for the `%s` css style property.', name);\n };\n\n var warnStyleValueIsInfinity = function (name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n\n warnedForInfinityValue = true;\n\n error('`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n\n warnValidStyle = function (name, value) {\n if (name.indexOf('-') \u003E -1) {\n warnHyphenatedStyleName(name);\n } else if (badVendoredStyleNamePattern.test(name)) {\n warnBadVendoredStyleName(name);\n } else if (badStyleValueWithSemicolonPattern.test(value)) {\n warnStyleValueWithSemicolon(name, value);\n }\n\n if (typeof value === 'number') {\n if (isNaN(value)) {\n warnStyleValueIsNaN(name, value);\n } else if (!isFinite(value)) {\n warnStyleValueIsInfinity(name, value);\n }\n }\n };\n}\n\nvar warnValidStyle$1 = warnValidStyle;\n\n\u002F**\n * Operations for dealing with CSS properties.\n *\u002F\n\n\u002F**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n *\u002F\n\nfunction createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n}\n\u002F**\n * Sets the value for multiple styles on a node. If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n *\u002F\n\nfunction setValueForStyles(node, styles) {\n var style = node.style;\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var isCustomProperty = styleName.indexOf('--') === 0;\n\n {\n if (!isCustomProperty) {\n warnValidStyle$1(styleName, styles[styleName]);\n }\n }\n\n var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n\n if (styleName === 'float') {\n styleName = 'cssFloat';\n }\n\n if (isCustomProperty) {\n style.setProperty(styleName, styleValue);\n } else {\n style[styleName] = styleValue;\n }\n }\n}\n\nfunction isValueEmpty(value) {\n return value == null || typeof value === 'boolean' || value === '';\n}\n\u002F**\n * Given {color: 'red', overflow: 'hidden'} returns {\n * color: 'color',\n * overflowX: 'overflow',\n * overflowY: 'overflow',\n * }. This can be read as \"the overflowY property was set by the overflow\n * shorthand\". That is, the values are the property that each was derived from.\n *\u002F\n\n\nfunction expandShorthandMap(styles) {\n var expanded = {};\n\n for (var key in styles) {\n var longhands = shorthandToLonghand[key] || [key];\n\n for (var i = 0; i \u003C longhands.length; i++) {\n expanded[longhands[i]] = key;\n }\n }\n\n return expanded;\n}\n\u002F**\n * When mixing shorthand and longhand property names, we warn during updates if\n * we expect an incorrect result to occur. In particular, we warn for:\n *\n * Updating a shorthand property (longhand gets overwritten):\n * {font: 'foo', fontVariant: 'bar'} -\u003E {font: 'baz', fontVariant: 'bar'}\n * becomes .style.font = 'baz'\n * Removing a shorthand property (longhand gets lost too):\n * {font: 'foo', fontVariant: 'bar'} -\u003E {fontVariant: 'bar'}\n * becomes .style.font = ''\n * Removing a longhand property (should revert to shorthand; doesn't):\n * {font: 'foo', fontVariant: 'bar'} -\u003E {font: 'foo'}\n * becomes .style.fontVariant = ''\n *\u002F\n\n\nfunction validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {\n {\n if (!nextStyles) {\n return;\n }\n\n var expandedUpdates = expandShorthandMap(styleUpdates);\n var expandedStyles = expandShorthandMap(nextStyles);\n var warnedAbout = {};\n\n for (var key in expandedUpdates) {\n var originalKey = expandedUpdates[key];\n var correctOriginalKey = expandedStyles[key];\n\n if (correctOriginalKey && originalKey !== correctOriginalKey) {\n var warningKey = originalKey + ',' + correctOriginalKey;\n\n if (warnedAbout[warningKey]) {\n continue;\n }\n\n warnedAbout[warningKey] = true;\n\n error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + \"avoid this, don't mix shorthand and non-shorthand properties \" + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);\n }\n }\n }\n}\n\n\u002F\u002F For HTML, certain tags should omit their close tag. We keep a list for\n\u002F\u002F those special-case tags.\nvar omittedCloseTags = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true \u002F\u002F NOTE: menuitem's close tag should be omitted, but that causes problems.\n\n};\n\n\u002F\u002F `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = _assign({\n menuitem: true\n}, omittedCloseTags);\n\nvar HTML = '__html';\n\nfunction assertValidProps(tag, props) {\n if (!props) {\n return;\n } \u002F\u002F Note the use of `==` which checks for null or undefined.\n\n\n if (voidElementTags[tag]) {\n if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {\n {\n throw Error( tag + \" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\" );\n }\n }\n }\n\n if (props.dangerouslySetInnerHTML != null) {\n if (!(props.children == null)) {\n {\n throw Error( \"Can only set one of `children` or `props.dangerouslySetInnerHTML`.\" );\n }\n }\n\n if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {\n {\n throw Error( \"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https:\u002F\u002Freactjs.org\u002Flink\u002Fdangerously-set-inner-html for more information.\" );\n }\n }\n }\n\n {\n if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {\n 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.');\n }\n }\n\n if (!(props.style == null || typeof props.style === 'object')) {\n {\n throw Error( \"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\" );\n }\n }\n}\n\nfunction isCustomComponent(tagName, props) {\n if (tagName.indexOf('-') === -1) {\n return typeof props.is === 'string';\n }\n\n switch (tagName) {\n \u002F\u002F These are reserved SVG and MathML elements.\n \u002F\u002F We don't mind this list too much because we expect it to never grow.\n \u002F\u002F The alternative is to track the namespace in a few places which is convoluted.\n \u002F\u002F https:\u002F\u002Fw3c.github.io\u002Fwebcomponents\u002Fspec\u002Fcustom\u002F#custom-elements-core-concepts\n case 'annotation-xml':\n case 'color-profile':\n case 'font-face':\n case 'font-face-src':\n case 'font-face-uri':\n case 'font-face-format':\n case 'font-face-name':\n case 'missing-glyph':\n return false;\n\n default:\n return true;\n }\n}\n\n\u002F\u002F When adding attributes to the HTML or SVG allowed attribute list, be sure to\n\u002F\u002F also add them to this module to ensure casing and incorrect name\n\u002F\u002F warnings.\nvar possibleStandardNames = {\n \u002F\u002F HTML\n accept: 'accept',\n acceptcharset: 'acceptCharset',\n 'accept-charset': 'acceptCharset',\n accesskey: 'accessKey',\n action: 'action',\n allowfullscreen: 'allowFullScreen',\n alt: 'alt',\n as: 'as',\n async: 'async',\n autocapitalize: 'autoCapitalize',\n autocomplete: 'autoComplete',\n autocorrect: 'autoCorrect',\n autofocus: 'autoFocus',\n autoplay: 'autoPlay',\n autosave: 'autoSave',\n capture: 'capture',\n cellpadding: 'cellPadding',\n cellspacing: 'cellSpacing',\n challenge: 'challenge',\n charset: 'charSet',\n checked: 'checked',\n children: 'children',\n cite: 'cite',\n class: 'className',\n classid: 'classID',\n classname: 'className',\n cols: 'cols',\n colspan: 'colSpan',\n content: 'content',\n contenteditable: 'contentEditable',\n contextmenu: 'contextMenu',\n controls: 'controls',\n controlslist: 'controlsList',\n coords: 'coords',\n crossorigin: 'crossOrigin',\n dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n data: 'data',\n datetime: 'dateTime',\n default: 'default',\n defaultchecked: 'defaultChecked',\n defaultvalue: 'defaultValue',\n defer: 'defer',\n dir: 'dir',\n disabled: 'disabled',\n disablepictureinpicture: 'disablePictureInPicture',\n disableremoteplayback: 'disableRemotePlayback',\n download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\n enterkeyhint: 'enterKeyHint',\n for: 'htmlFor',\n form: 'form',\n formmethod: 'formMethod',\n formaction: 'formAction',\n formenctype: 'formEncType',\n formnovalidate: 'formNoValidate',\n formtarget: 'formTarget',\n frameborder: 'frameBorder',\n headers: 'headers',\n height: 'height',\n hidden: 'hidden',\n high: 'high',\n href: 'href',\n hreflang: 'hrefLang',\n htmlfor: 'htmlFor',\n httpequiv: 'httpEquiv',\n 'http-equiv': 'httpEquiv',\n icon: 'icon',\n id: 'id',\n innerhtml: 'innerHTML',\n inputmode: 'inputMode',\n integrity: 'integrity',\n is: 'is',\n itemid: 'itemID',\n itemprop: 'itemProp',\n itemref: 'itemRef',\n itemscope: 'itemScope',\n itemtype: 'itemType',\n keyparams: 'keyParams',\n keytype: 'keyType',\n kind: 'kind',\n label: 'label',\n lang: 'lang',\n list: 'list',\n loop: 'loop',\n low: 'low',\n manifest: 'manifest',\n marginwidth: 'marginWidth',\n marginheight: 'marginHeight',\n max: 'max',\n maxlength: 'maxLength',\n media: 'media',\n mediagroup: 'mediaGroup',\n method: 'method',\n min: 'min',\n minlength: 'minLength',\n multiple: 'multiple',\n muted: 'muted',\n name: 'name',\n nomodule: 'noModule',\n nonce: 'nonce',\n novalidate: 'noValidate',\n open: 'open',\n optimum: 'optimum',\n pattern: 'pattern',\n placeholder: 'placeholder',\n playsinline: 'playsInline',\n poster: 'poster',\n preload: 'preload',\n profile: 'profile',\n radiogroup: 'radioGroup',\n readonly: 'readOnly',\n referrerpolicy: 'referrerPolicy',\n rel: 'rel',\n required: 'required',\n reversed: 'reversed',\n role: 'role',\n rows: 'rows',\n rowspan: 'rowSpan',\n sandbox: 'sandbox',\n scope: 'scope',\n scoped: 'scoped',\n scrolling: 'scrolling',\n seamless: 'seamless',\n selected: 'selected',\n shape: 'shape',\n size: 'size',\n sizes: 'sizes',\n span: 'span',\n spellcheck: 'spellCheck',\n src: 'src',\n srcdoc: 'srcDoc',\n srclang: 'srcLang',\n srcset: 'srcSet',\n start: 'start',\n step: 'step',\n style: 'style',\n summary: 'summary',\n tabindex: 'tabIndex',\n target: 'target',\n title: 'title',\n type: 'type',\n usemap: 'useMap',\n value: 'value',\n width: 'width',\n wmode: 'wmode',\n wrap: 'wrap',\n \u002F\u002F SVG\n about: 'about',\n accentheight: 'accentHeight',\n 'accent-height': 'accentHeight',\n accumulate: 'accumulate',\n additive: 'additive',\n alignmentbaseline: 'alignmentBaseline',\n 'alignment-baseline': 'alignmentBaseline',\n allowreorder: 'allowReorder',\n alphabetic: 'alphabetic',\n amplitude: 'amplitude',\n arabicform: 'arabicForm',\n 'arabic-form': 'arabicForm',\n ascent: 'ascent',\n attributename: 'attributeName',\n attributetype: 'attributeType',\n autoreverse: 'autoReverse',\n azimuth: 'azimuth',\n basefrequency: 'baseFrequency',\n baselineshift: 'baselineShift',\n 'baseline-shift': 'baselineShift',\n baseprofile: 'baseProfile',\n bbox: 'bbox',\n begin: 'begin',\n bias: 'bias',\n by: 'by',\n calcmode: 'calcMode',\n capheight: 'capHeight',\n 'cap-height': 'capHeight',\n clip: 'clip',\n clippath: 'clipPath',\n 'clip-path': 'clipPath',\n clippathunits: 'clipPathUnits',\n cliprule: 'clipRule',\n 'clip-rule': 'clipRule',\n color: 'color',\n colorinterpolation: 'colorInterpolation',\n 'color-interpolation': 'colorInterpolation',\n colorinterpolationfilters: 'colorInterpolationFilters',\n 'color-interpolation-filters': 'colorInterpolationFilters',\n colorprofile: 'colorProfile',\n 'color-profile': 'colorProfile',\n colorrendering: 'colorRendering',\n 'color-rendering': 'colorRendering',\n contentscripttype: 'contentScriptType',\n contentstyletype: 'contentStyleType',\n cursor: 'cursor',\n cx: 'cx',\n cy: 'cy',\n d: 'd',\n datatype: 'datatype',\n decelerate: 'decelerate',\n descent: 'descent',\n diffuseconstant: 'diffuseConstant',\n direction: 'direction',\n display: 'display',\n divisor: 'divisor',\n dominantbaseline: 'dominantBaseline',\n 'dominant-baseline': 'dominantBaseline',\n dur: 'dur',\n dx: 'dx',\n dy: 'dy',\n edgemode: 'edgeMode',\n elevation: 'elevation',\n enablebackground: 'enableBackground',\n 'enable-background': 'enableBackground',\n end: 'end',\n exponent: 'exponent',\n externalresourcesrequired: 'externalResourcesRequired',\n fill: 'fill',\n fillopacity: 'fillOpacity',\n 'fill-opacity': 'fillOpacity',\n fillrule: 'fillRule',\n 'fill-rule': 'fillRule',\n filter: 'filter',\n filterres: 'filterRes',\n filterunits: 'filterUnits',\n floodopacity: 'floodOpacity',\n 'flood-opacity': 'floodOpacity',\n floodcolor: 'floodColor',\n 'flood-color': 'floodColor',\n focusable: 'focusable',\n fontfamily: 'fontFamily',\n 'font-family': 'fontFamily',\n fontsize: 'fontSize',\n 'font-size': 'fontSize',\n fontsizeadjust: 'fontSizeAdjust',\n 'font-size-adjust': 'fontSizeAdjust',\n fontstretch: 'fontStretch',\n 'font-stretch': 'fontStretch',\n fontstyle: 'fontStyle',\n 'font-style': 'fontStyle',\n fontvariant: 'fontVariant',\n 'font-variant': 'fontVariant',\n fontweight: 'fontWeight',\n 'font-weight': 'fontWeight',\n format: 'format',\n from: 'from',\n fx: 'fx',\n fy: 'fy',\n g1: 'g1',\n g2: 'g2',\n glyphname: 'glyphName',\n 'glyph-name': 'glyphName',\n glyphorientationhorizontal: 'glyphOrientationHorizontal',\n 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n glyphorientationvertical: 'glyphOrientationVertical',\n 'glyph-orientation-vertical': 'glyphOrientationVertical',\n glyphref: 'glyphRef',\n gradienttransform: 'gradientTransform',\n gradientunits: 'gradientUnits',\n hanging: 'hanging',\n horizadvx: 'horizAdvX',\n 'horiz-adv-x': 'horizAdvX',\n horizoriginx: 'horizOriginX',\n 'horiz-origin-x': 'horizOriginX',\n ideographic: 'ideographic',\n imagerendering: 'imageRendering',\n 'image-rendering': 'imageRendering',\n in2: 'in2',\n in: 'in',\n inlist: 'inlist',\n intercept: 'intercept',\n k1: 'k1',\n k2: 'k2',\n k3: 'k3',\n k4: 'k4',\n k: 'k',\n kernelmatrix: 'kernelMatrix',\n kernelunitlength: 'kernelUnitLength',\n kerning: 'kerning',\n keypoints: 'keyPoints',\n keysplines: 'keySplines',\n keytimes: 'keyTimes',\n lengthadjust: 'lengthAdjust',\n letterspacing: 'letterSpacing',\n 'letter-spacing': 'letterSpacing',\n lightingcolor: 'lightingColor',\n 'lighting-color': 'lightingColor',\n limitingconeangle: 'limitingConeAngle',\n local: 'local',\n markerend: 'markerEnd',\n 'marker-end': 'markerEnd',\n markerheight: 'markerHeight',\n markermid: 'markerMid',\n 'marker-mid': 'markerMid',\n markerstart: 'markerStart',\n 'marker-start': 'markerStart',\n markerunits: 'markerUnits',\n markerwidth: 'markerWidth',\n mask: 'mask',\n maskcontentunits: 'maskContentUnits',\n maskunits: 'maskUnits',\n mathematical: 'mathematical',\n mode: 'mode',\n numoctaves: 'numOctaves',\n offset: 'offset',\n opacity: 'opacity',\n operator: 'operator',\n order: 'order',\n orient: 'orient',\n orientation: 'orientation',\n origin: 'origin',\n overflow: 'overflow',\n overlineposition: 'overlinePosition',\n 'overline-position': 'overlinePosition',\n overlinethickness: 'overlineThickness',\n 'overline-thickness': 'overlineThickness',\n paintorder: 'paintOrder',\n 'paint-order': 'paintOrder',\n panose1: 'panose1',\n 'panose-1': 'panose1',\n pathlength: 'pathLength',\n patterncontentunits: 'patternContentUnits',\n patterntransform: 'patternTransform',\n patternunits: 'patternUnits',\n pointerevents: 'pointerEvents',\n 'pointer-events': 'pointerEvents',\n points: 'points',\n pointsatx: 'pointsAtX',\n pointsaty: 'pointsAtY',\n pointsatz: 'pointsAtZ',\n prefix: 'prefix',\n preservealpha: 'preserveAlpha',\n preserveaspectratio: 'preserveAspectRatio',\n primitiveunits: 'primitiveUnits',\n property: 'property',\n r: 'r',\n radius: 'radius',\n refx: 'refX',\n refy: 'refY',\n renderingintent: 'renderingIntent',\n 'rendering-intent': 'renderingIntent',\n repeatcount: 'repeatCount',\n repeatdur: 'repeatDur',\n requiredextensions: 'requiredExtensions',\n requiredfeatures: 'requiredFeatures',\n resource: 'resource',\n restart: 'restart',\n result: 'result',\n results: 'results',\n rotate: 'rotate',\n rx: 'rx',\n ry: 'ry',\n scale: 'scale',\n security: 'security',\n seed: 'seed',\n shaperendering: 'shapeRendering',\n 'shape-rendering': 'shapeRendering',\n slope: 'slope',\n spacing: 'spacing',\n specularconstant: 'specularConstant',\n specularexponent: 'specularExponent',\n speed: 'speed',\n spreadmethod: 'spreadMethod',\n startoffset: 'startOffset',\n stddeviation: 'stdDeviation',\n stemh: 'stemh',\n stemv: 'stemv',\n stitchtiles: 'stitchTiles',\n stopcolor: 'stopColor',\n 'stop-color': 'stopColor',\n stopopacity: 'stopOpacity',\n 'stop-opacity': 'stopOpacity',\n strikethroughposition: 'strikethroughPosition',\n 'strikethrough-position': 'strikethroughPosition',\n strikethroughthickness: 'strikethroughThickness',\n 'strikethrough-thickness': 'strikethroughThickness',\n string: 'string',\n stroke: 'stroke',\n strokedasharray: 'strokeDasharray',\n 'stroke-dasharray': 'strokeDasharray',\n strokedashoffset: 'strokeDashoffset',\n 'stroke-dashoffset': 'strokeDashoffset',\n strokelinecap: 'strokeLinecap',\n 'stroke-linecap': 'strokeLinecap',\n strokelinejoin: 'strokeLinejoin',\n 'stroke-linejoin': 'strokeLinejoin',\n strokemiterlimit: 'strokeMiterlimit',\n 'stroke-miterlimit': 'strokeMiterlimit',\n strokewidth: 'strokeWidth',\n 'stroke-width': 'strokeWidth',\n strokeopacity: 'strokeOpacity',\n 'stroke-opacity': 'strokeOpacity',\n suppresscontenteditablewarning: 'suppressContentEditableWarning',\n suppresshydrationwarning: 'suppressHydrationWarning',\n surfacescale: 'surfaceScale',\n systemlanguage: 'systemLanguage',\n tablevalues: 'tableValues',\n targetx: 'targetX',\n targety: 'targetY',\n textanchor: 'textAnchor',\n 'text-anchor': 'textAnchor',\n textdecoration: 'textDecoration',\n 'text-decoration': 'textDecoration',\n textlength: 'textLength',\n textrendering: 'textRendering',\n 'text-rendering': 'textRendering',\n to: 'to',\n transform: 'transform',\n typeof: 'typeof',\n u1: 'u1',\n u2: 'u2',\n underlineposition: 'underlinePosition',\n 'underline-position': 'underlinePosition',\n underlinethickness: 'underlineThickness',\n 'underline-thickness': 'underlineThickness',\n unicode: 'unicode',\n unicodebidi: 'unicodeBidi',\n 'unicode-bidi': 'unicodeBidi',\n unicoderange: 'unicodeRange',\n 'unicode-range': 'unicodeRange',\n unitsperem: 'unitsPerEm',\n 'units-per-em': 'unitsPerEm',\n unselectable: 'unselectable',\n valphabetic: 'vAlphabetic',\n 'v-alphabetic': 'vAlphabetic',\n values: 'values',\n vectoreffect: 'vectorEffect',\n 'vector-effect': 'vectorEffect',\n version: 'version',\n vertadvy: 'vertAdvY',\n 'vert-adv-y': 'vertAdvY',\n vertoriginx: 'vertOriginX',\n 'vert-origin-x': 'vertOriginX',\n vertoriginy: 'vertOriginY',\n 'vert-origin-y': 'vertOriginY',\n vhanging: 'vHanging',\n 'v-hanging': 'vHanging',\n videographic: 'vIdeographic',\n 'v-ideographic': 'vIdeographic',\n viewbox: 'viewBox',\n viewtarget: 'viewTarget',\n visibility: 'visibility',\n vmathematical: 'vMathematical',\n 'v-mathematical': 'vMathematical',\n vocab: 'vocab',\n widths: 'widths',\n wordspacing: 'wordSpacing',\n 'word-spacing': 'wordSpacing',\n writingmode: 'writingMode',\n 'writing-mode': 'writingMode',\n x1: 'x1',\n x2: 'x2',\n x: 'x',\n xchannelselector: 'xChannelSelector',\n xheight: 'xHeight',\n 'x-height': 'xHeight',\n xlinkactuate: 'xlinkActuate',\n 'xlink:actuate': 'xlinkActuate',\n xlinkarcrole: 'xlinkArcrole',\n 'xlink:arcrole': 'xlinkArcrole',\n xlinkhref: 'xlinkHref',\n 'xlink:href': 'xlinkHref',\n xlinkrole: 'xlinkRole',\n 'xlink:role': 'xlinkRole',\n xlinkshow: 'xlinkShow',\n 'xlink:show': 'xlinkShow',\n xlinktitle: 'xlinkTitle',\n 'xlink:title': 'xlinkTitle',\n xlinktype: 'xlinkType',\n 'xlink:type': 'xlinkType',\n xmlbase: 'xmlBase',\n 'xml:base': 'xmlBase',\n xmllang: 'xmlLang',\n 'xml:lang': 'xmlLang',\n xmlns: 'xmlns',\n 'xml:space': 'xmlSpace',\n xmlnsxlink: 'xmlnsXlink',\n 'xmlns:xlink': 'xmlnsXlink',\n xmlspace: 'xmlSpace',\n y1: 'y1',\n y2: 'y2',\n y: 'y',\n ychannelselector: 'yChannelSelector',\n z: 'z',\n zoomandpan: 'zoomAndPan'\n};\n\nvar ariaProperties = {\n 'aria-current': 0,\n \u002F\u002F state\n 'aria-details': 0,\n 'aria-disabled': 0,\n \u002F\u002F state\n 'aria-hidden': 0,\n \u002F\u002F state\n 'aria-invalid': 0,\n \u002F\u002F state\n 'aria-keyshortcuts': 0,\n 'aria-label': 0,\n 'aria-roledescription': 0,\n \u002F\u002F Widget Attributes\n 'aria-autocomplete': 0,\n 'aria-checked': 0,\n 'aria-expanded': 0,\n 'aria-haspopup': 0,\n 'aria-level': 0,\n 'aria-modal': 0,\n 'aria-multiline': 0,\n 'aria-multiselectable': 0,\n 'aria-orientation': 0,\n 'aria-placeholder': 0,\n 'aria-pressed': 0,\n 'aria-readonly': 0,\n 'aria-required': 0,\n 'aria-selected': 0,\n 'aria-sort': 0,\n 'aria-valuemax': 0,\n 'aria-valuemin': 0,\n 'aria-valuenow': 0,\n 'aria-valuetext': 0,\n \u002F\u002F Live Region Attributes\n 'aria-atomic': 0,\n 'aria-busy': 0,\n 'aria-live': 0,\n 'aria-relevant': 0,\n \u002F\u002F Drag-and-Drop Attributes\n 'aria-dropeffect': 0,\n 'aria-grabbed': 0,\n \u002F\u002F Relationship Attributes\n 'aria-activedescendant': 0,\n 'aria-colcount': 0,\n 'aria-colindex': 0,\n 'aria-colspan': 0,\n 'aria-controls': 0,\n 'aria-describedby': 0,\n 'aria-errormessage': 0,\n 'aria-flowto': 0,\n 'aria-labelledby': 0,\n 'aria-owns': 0,\n 'aria-posinset': 0,\n 'aria-rowcount': 0,\n 'aria-rowindex': 0,\n 'aria-rowspan': 0,\n 'aria-setsize': 0\n};\n\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*
);\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*
);\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n\nfunction validateProperty(tagName, name) {\n {\n if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {\n return true;\n }\n\n if (rARIACamel.test(name)) {\n var ariaName = 'aria-' + name.slice(4).toLowerCase();\n var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; \u002F\u002F If this is an aria-* attribute, but is not listed in the known DOM\n \u002F\u002F DOM properties, then it is an invalid aria-* attribute.\n\n if (correctName == null) {\n error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n\n warnedProperties[name] = true;\n return true;\n } \u002F\u002F aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== correctName) {\n error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);\n\n warnedProperties[name] = true;\n return true;\n }\n }\n\n if (rARIA.test(name)) {\n var lowerCasedName = name.toLowerCase();\n var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; \u002F\u002F If this is an aria-* attribute, but is not listed in the known DOM\n \u002F\u002F DOM properties, then it is an invalid aria-* attribute.\n\n if (standardName == null) {\n warnedProperties[name] = true;\n return false;\n } \u002F\u002F aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== standardName) {\n error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);\n\n warnedProperties[name] = true;\n return true;\n }\n }\n }\n\n return true;\n}\n\nfunction warnInvalidARIAProps(type, props) {\n {\n var invalidProps = [];\n\n for (var key in props) {\n var isValid = validateProperty(type, key);\n\n if (!isValid) {\n invalidProps.push(key);\n }\n }\n\n var unknownPropString = invalidProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (invalidProps.length === 1) {\n error('Invalid aria prop %s on \u003C%s\u003E tag. ' + 'For details, see https:\u002F\u002Freactjs.org\u002Flink\u002Finvalid-aria-props', unknownPropString, type);\n } else if (invalidProps.length \u003E 1) {\n error('Invalid aria props %s on \u003C%s\u003E tag. ' + 'For details, see https:\u002F\u002Freactjs.org\u002Flink\u002Finvalid-aria-props', unknownPropString, type);\n }\n }\n}\n\nfunction validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnInvalidARIAProps(type, props);\n}\n\nvar didWarnValueNull = false;\nfunction validateProperties$1(type, props) {\n {\n if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n return;\n }\n\n if (props != null && props.value === null && !didWarnValueNull) {\n didWarnValueNull = true;\n\n if (type === 'select' && props.multiple) {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);\n } else {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);\n }\n }\n }\n}\n\nvar validateProperty$1 = function () {};\n\n{\n var warnedProperties$1 = {};\n var _hasOwnProperty = Object.prototype.hasOwnProperty;\n var EVENT_NAME_REGEX = \u002F^on.\u002F;\n var INVALID_EVENT_NAME_REGEX = \u002F^on[^A-Z]\u002F;\n var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*
);\n var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*
);\n\n validateProperty$1 = function (tagName, name, value, eventRegistry) {\n if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n return true;\n }\n\n var lowerCasedName = name.toLowerCase();\n\n if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed\u002Fsupported by React.');\n\n warnedProperties$1[name] = true;\n return true;\n } \u002F\u002F We can't rely on the event system being injected on the server.\n\n\n if (eventRegistry != null) {\n var registrationNameDependencies = eventRegistry.registrationNameDependencies,\n possibleRegistrationNames = eventRegistry.possibleRegistrationNames;\n\n if (registrationNameDependencies.hasOwnProperty(name)) {\n return true;\n }\n\n var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n\n if (registrationName != null) {\n error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (EVENT_NAME_REGEX.test(name)) {\n error('Unknown event handler property `%s`. It will be ignored.', name);\n\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (EVENT_NAME_REGEX.test(name)) {\n \u002F\u002F If no event plugins have been injected, we are in a server environment.\n \u002F\u002F So we can't tell if the event name is correct for sure, but we can filter\n \u002F\u002F out known bad ones like `onclick`. We can't suggest a specific replacement though.\n if (INVALID_EVENT_NAME_REGEX.test(name)) {\n error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } \u002F\u002F Let the ARIA attribute hook validate ARIA attributes\n\n\n if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n return true;\n }\n\n if (lowerCasedName === 'innerhtml') {\n error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'aria') {\n error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'number' && isNaN(value)) {\n error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n var propertyInfo = getPropertyInfo(name);\n var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; \u002F\u002F Known attributes should match the casing specified in the property config.\n\n if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n var standardName = possibleStandardNames[lowerCasedName];\n\n if (standardName !== name) {\n error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);\n\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (!isReserved && name !== lowerCasedName) {\n \u002F\u002F Unknown attributes should have lowercase casing since that's how they\n \u002F\u002F will be cased anyway with server rendering.\n error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n if (value) {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.', value, name, name, value, name);\n } else {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } \u002F\u002F Now that we've validated casing, do not validate\n \u002F\u002F data types for reserved props\n\n\n if (isReserved) {\n return true;\n } \u002F\u002F Warn when a known attribute is a bad type\n\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n warnedProperties$1[name] = true;\n return false;\n } \u002F\u002F Warn when passing the strings 'false' or 'true' into a boolean prop\n\n\n if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \"false\".', name, value);\n\n warnedProperties$1[name] = true;\n return true;\n }\n\n return true;\n };\n}\n\nvar warnUnknownProperties = function (type, props, eventRegistry) {\n {\n var unknownProps = [];\n\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], eventRegistry);\n\n if (!isValid) {\n unknownProps.push(key);\n }\n }\n\n var unknownPropString = unknownProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (unknownProps.length === 1) {\n error('Invalid value for prop %s on \u003C%s\u003E tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https:\u002F\u002Freactjs.org\u002Flink\u002Fattribute-behavior ', unknownPropString, type);\n } else if (unknownProps.length \u003E 1) {\n error('Invalid values for props %s on \u003C%s\u003E tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https:\u002F\u002Freactjs.org\u002Flink\u002Fattribute-behavior ', unknownPropString, type);\n }\n }\n};\n\nfunction validateProperties$2(type, props, eventRegistry) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnUnknownProperties(type, props, eventRegistry);\n}\n\nvar IS_EVENT_HANDLE_NON_MANAGED_NODE = 1;\nvar IS_NON_DELEGATED = 1 \u003C\u003C 1;\nvar IS_CAPTURE_PHASE = 1 \u003C\u003C 2;\nvar IS_REPLAYED = 1 \u003C\u003C 4;\n\u002F\u002F set to LEGACY_FB_SUPPORT. LEGACY_FB_SUPPORT only gets set when\n\u002F\u002F we call willDeferLaterForLegacyFBSupport, thus not bailing out\n\u002F\u002F will result in endless cycles like an infinite loop.\n\u002F\u002F We also don't want to defer during event replaying.\n\nvar SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE;\n\n\u002F**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n *\u002F\n\nfunction getEventTarget(nativeEvent) {\n \u002F\u002F Fallback to nativeEvent.srcElement for IE9\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F12506\n var target = nativeEvent.target || nativeEvent.srcElement || window; \u002F\u002F Normalize SVG \u003Cuse\u003E element events #4963\n\n if (target.correspondingUseElement) {\n target = target.correspondingUseElement;\n } \u002F\u002F Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n \u002F\u002F @see http:\u002F\u002Fwww.quirksmode.org\u002Fjs\u002Fevents_properties.html\n\n\n return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\n\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n \u002F\u002F We perform this translation at the end of the event loop so that we\n \u002F\u002F always receive the correct fiber here\n var internalInstance = getInstanceFromNode(target);\n\n if (!internalInstance) {\n \u002F\u002F Unmounted\n return;\n }\n\n if (!(typeof restoreImpl === 'function')) {\n {\n throw Error( \"setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var stateNode = internalInstance.stateNode; \u002F\u002F Guard against Fiber being unmounted.\n\n if (stateNode) {\n var _props = getFiberCurrentPropsFromNode(stateNode);\n\n restoreImpl(internalInstance.stateNode, internalInstance.type, _props);\n }\n}\n\nfunction setRestoreImplementation(impl) {\n restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n if (restoreTarget) {\n if (restoreQueue) {\n restoreQueue.push(target);\n } else {\n restoreQueue = [target];\n }\n } else {\n restoreTarget = target;\n }\n}\nfunction needsStateRestore() {\n return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n if (!restoreTarget) {\n return;\n }\n\n var target = restoreTarget;\n var queuedTargets = restoreQueue;\n restoreTarget = null;\n restoreQueue = null;\n restoreStateOfTarget(target);\n\n if (queuedTargets) {\n for (var i = 0; i \u003C queuedTargets.length; i++) {\n restoreStateOfTarget(queuedTargets[i]);\n }\n }\n}\n\n\u002F\u002F the renderer. Such as when we're dispatching events or if third party\n\u002F\u002F libraries need to call batchedUpdates. Eventually, this API will go away when\n\u002F\u002F everything is batched by default. We'll then have a similar API to opt-out of\n\u002F\u002F scheduled work and instead do synchronous work.\n\u002F\u002F Defaults\n\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n return fn(bookkeeping);\n};\n\nvar discreteUpdatesImpl = function (fn, a, b, c, d) {\n return fn(a, b, c, d);\n};\n\nvar flushDiscreteUpdatesImpl = function () {};\n\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\nvar isInsideEventHandler = false;\nvar isBatchingEventUpdates = false;\n\nfunction finishEventHandler() {\n \u002F\u002F Here we wait until all updates have propagated, which is important\n \u002F\u002F when using controlled components within layers:\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F1698\n \u002F\u002F Then we restore state of any controlled component.\n var controlledComponentsHavePendingUpdates = needsStateRestore();\n\n if (controlledComponentsHavePendingUpdates) {\n \u002F\u002F If a controlled event was fired, we may need to restore the state of\n \u002F\u002F the DOM node back to the controlled value. This is necessary when React\n \u002F\u002F bails out of the update without touching the DOM.\n flushDiscreteUpdatesImpl();\n restoreStateIfNeeded();\n }\n}\n\nfunction batchedUpdates(fn, bookkeeping) {\n if (isInsideEventHandler) {\n \u002F\u002F If we are currently inside another batch, we need to wait until it\n \u002F\u002F fully completes before restoring state.\n return fn(bookkeeping);\n }\n\n isInsideEventHandler = true;\n\n try {\n return batchedUpdatesImpl(fn, bookkeeping);\n } finally {\n isInsideEventHandler = false;\n finishEventHandler();\n }\n}\nfunction batchedEventUpdates(fn, a, b) {\n if (isBatchingEventUpdates) {\n \u002F\u002F If we are currently inside another batch, we need to wait until it\n \u002F\u002F fully completes before restoring state.\n return fn(a, b);\n }\n\n isBatchingEventUpdates = true;\n\n try {\n return batchedEventUpdatesImpl(fn, a, b);\n } finally {\n isBatchingEventUpdates = false;\n finishEventHandler();\n }\n}\nfunction discreteUpdates(fn, a, b, c, d) {\n var prevIsInsideEventHandler = isInsideEventHandler;\n isInsideEventHandler = true;\n\n try {\n return discreteUpdatesImpl(fn, a, b, c, d);\n } finally {\n isInsideEventHandler = prevIsInsideEventHandler;\n\n if (!isInsideEventHandler) {\n finishEventHandler();\n }\n }\n}\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\n {\n if (!isInsideEventHandler) {\n flushDiscreteUpdatesImpl();\n }\n }\n}\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\n batchedUpdatesImpl = _batchedUpdatesImpl;\n discreteUpdatesImpl = _discreteUpdatesImpl;\n flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\n batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\n}\n\nfunction isInteractive(tag) {\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n switch (name) {\n case 'onClick':\n case 'onClickCapture':\n case 'onDoubleClick':\n case 'onDoubleClickCapture':\n case 'onMouseDown':\n case 'onMouseDownCapture':\n case 'onMouseMove':\n case 'onMouseMoveCapture':\n case 'onMouseUp':\n case 'onMouseUpCapture':\n case 'onMouseEnter':\n return !!(props.disabled && isInteractive(type));\n\n default:\n return false;\n }\n}\n\u002F**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n *\u002F\n\n\nfunction getListener(inst, registrationName) {\n var stateNode = inst.stateNode;\n\n if (stateNode === null) {\n \u002F\u002F Work in progress (ex: onload events in incremental mode).\n return null;\n }\n\n var props = getFiberCurrentPropsFromNode(stateNode);\n\n if (props === null) {\n \u002F\u002F Work in progress.\n return null;\n }\n\n var listener = props[registrationName];\n\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n return null;\n }\n\n if (!(!listener || typeof listener === 'function')) {\n {\n throw Error( \"Expected `\" + registrationName + \"` listener to be a function, instead got a value of `\" + typeof listener + \"` type.\" );\n }\n }\n\n return listener;\n}\n\nvar passiveBrowserEventsSupported = false; \u002F\u002F Check if browser support events with passive listeners\n\u002F\u002F https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FEventTarget\u002FaddEventListener#Safely_detecting_option_support\n\nif (canUseDOM) {\n try {\n var options = {}; \u002F\u002F $FlowFixMe: Ignore Flow complaining about needing a value\n\n Object.defineProperty(options, 'passive', {\n get: function () {\n passiveBrowserEventsSupported = true;\n }\n });\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n } catch (e) {\n passiveBrowserEventsSupported = false;\n }\n}\n\nfunction invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) {\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n try {\n func.apply(context, funcArgs);\n } catch (error) {\n this.onError(error);\n }\n}\n\nvar invokeGuardedCallbackImpl = invokeGuardedCallbackProd;\n\n{\n \u002F\u002F In DEV mode, we swap out invokeGuardedCallback for a special version\n \u002F\u002F that plays more nicely with the browser's DevTools. The idea is to preserve\n \u002F\u002F \"Pause on exceptions\" behavior. Because React wraps all user-provided\n \u002F\u002F functions in invokeGuardedCallback, and the production version of\n \u002F\u002F invokeGuardedCallback uses a try-catch, all user exceptions are treated\n \u002F\u002F like caught exceptions, and the DevTools won't pause unless the developer\n \u002F\u002F takes the extra step of enabling pause on caught exceptions. This is\n \u002F\u002F unintuitive, though, because even though React has caught the error, from\n \u002F\u002F the developer's perspective, the error is uncaught.\n \u002F\u002F\n \u002F\u002F To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n \u002F\u002F try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n \u002F\u002F DOM node, and call the user-provided callback from inside an event handler\n \u002F\u002F for that fake event. If the callback throws, the error is \"captured\" using\n \u002F\u002F a global event handler. But because the error happens in a different\n \u002F\u002F event loop context, it does not interrupt the normal program flow.\n \u002F\u002F Effectively, this gives us try-catch behavior without actually using\n \u002F\u002F try-catch. Neat!\n \u002F\u002F Check that the browser supports the APIs we need to implement our special\n \u002F\u002F DEV version of invokeGuardedCallback\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n var fakeNode = document.createElement('react');\n\n invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) {\n \u002F\u002F If document doesn't exist we know for sure we will crash in this method\n \u002F\u002F when we call document.createEvent(). However this can cause confusing\n \u002F\u002F errors: https:\u002F\u002Fgithub.com\u002Ffacebookincubator\u002Fcreate-react-app\u002Fissues\u002F3482\n \u002F\u002F So we preemptively throw with a better message instead.\n if (!(typeof document !== 'undefined')) {\n {\n throw Error( \"The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.\" );\n }\n }\n\n var evt = document.createEvent('Event');\n var didCall = false; \u002F\u002F Keeps track of whether the user-provided callback threw an error. We\n \u002F\u002F set this to true at the beginning, then set it to false right after\n \u002F\u002F calling the function. If the function errors, `didError` will never be\n \u002F\u002F set to false. This strategy works even if the browser is flaky and\n \u002F\u002F fails to call our global error handler, because it doesn't rely on\n \u002F\u002F the error event at all.\n\n var didError = true; \u002F\u002F Keeps track of the value of window.event so that we can reset it\n \u002F\u002F during the callback to let user code access window.event in the\n \u002F\u002F browsers that support it.\n\n var windowEvent = window.event; \u002F\u002F Keeps track of the descriptor of window.event to restore it after event\n \u002F\u002F dispatching: https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F13688\n\n var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event');\n\n function restoreAfterDispatch() {\n \u002F\u002F We immediately remove the callback from event listeners so that\n \u002F\u002F nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n \u002F\u002F nested call would trigger the fake event handlers of any call higher\n \u002F\u002F in the stack.\n fakeNode.removeEventListener(evtType, callCallback, false); \u002F\u002F We check for window.hasOwnProperty('event') to prevent the\n \u002F\u002F window.event assignment in both IE \u003C= 10 as they throw an error\n \u002F\u002F \"Member not found\" in strict mode, and in Firefox which does not\n \u002F\u002F support window.event.\n\n if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n window.event = windowEvent;\n }\n } \u002F\u002F Create an event handler for our fake event. We will synchronously\n \u002F\u002F dispatch our fake event using `dispatchEvent`. Inside the handler, we\n \u002F\u002F call the user-provided callback.\n\n\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n function callCallback() {\n didCall = true;\n restoreAfterDispatch();\n func.apply(context, funcArgs);\n didError = false;\n } \u002F\u002F Create a global error event handler. We use this to capture the value\n \u002F\u002F that was thrown. It's possible that this error handler will fire more\n \u002F\u002F than once; for example, if non-React code also calls `dispatchEvent`\n \u002F\u002F and a handler for that event throws. We should be resilient to most of\n \u002F\u002F those cases. Even if our error event handler fires more than once, the\n \u002F\u002F last error event is always used. If the callback actually does error,\n \u002F\u002F we know that the last error event is the correct one, because it's not\n \u002F\u002F possible for anything else to have happened in between our callback\n \u002F\u002F erroring and the code that follows the `dispatchEvent` call below. If\n \u002F\u002F the callback doesn't error, but the error event was fired, we know to\n \u002F\u002F ignore it because `didError` will be false, as described above.\n\n\n var error; \u002F\u002F Use this to track whether the error event is ever called.\n\n var didSetError = false;\n var isCrossOriginError = false;\n\n function handleWindowError(event) {\n error = event.error;\n didSetError = true;\n\n if (error === null && event.colno === 0 && event.lineno === 0) {\n isCrossOriginError = true;\n }\n\n if (event.defaultPrevented) {\n \u002F\u002F Some other error handler has prevented default.\n \u002F\u002F Browsers silence the error report if this happens.\n \u002F\u002F We'll remember this to later decide whether to log it or not.\n if (error != null && typeof error === 'object') {\n try {\n error._suppressLogging = true;\n } catch (inner) {\u002F\u002F Ignore.\n }\n }\n }\n } \u002F\u002F Create a fake event type.\n\n\n var evtType = \"react-\" + (name ? name : 'invokeguardedcallback'); \u002F\u002F Attach our event handlers\n\n window.addEventListener('error', handleWindowError);\n fakeNode.addEventListener(evtType, callCallback, false); \u002F\u002F Synchronously dispatch our fake event. If the user-provided function\n \u002F\u002F errors, it will trigger our global error handler.\n\n evt.initEvent(evtType, false, false);\n fakeNode.dispatchEvent(evt);\n\n if (windowEventDescriptor) {\n Object.defineProperty(window, 'event', windowEventDescriptor);\n }\n\n if (didCall && didError) {\n if (!didSetError) {\n \u002F\u002F The callback errored, but the error event never fired.\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n } else if (isCrossOriginError) {\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https:\u002F\u002Freactjs.org\u002Flink\u002Fcrossorigin-error for more information.');\n }\n\n this.onError(error);\n } \u002F\u002F Remove our event listeners\n\n\n window.removeEventListener('error', handleWindowError);\n\n if (!didCall) {\n \u002F\u002F Something went really wrong, and our event was not dispatched.\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F16734\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F16585\n \u002F\u002F Fall back to the production implementation.\n restoreAfterDispatch();\n return invokeGuardedCallbackProd.apply(this, arguments);\n }\n };\n }\n}\n\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\n\nvar hasError = false;\nvar caughtError = null; \u002F\u002F Used by event system to capture\u002Frethrow the first error.\n\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n onError: function (error) {\n hasError = true;\n caughtError = error;\n }\n};\n\u002F**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n *\u002F\n\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n hasError = false;\n caughtError = null;\n invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n\u002F**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n *\u002F\n\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n invokeGuardedCallback.apply(this, arguments);\n\n if (hasError) {\n var error = clearCaughtError();\n\n if (!hasRethrowError) {\n hasRethrowError = true;\n rethrowError = error;\n }\n }\n}\n\u002F**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n *\u002F\n\nfunction rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n}\nfunction hasCaughtError() {\n return hasError;\n}\nfunction clearCaughtError() {\n if (hasError) {\n var error = caughtError;\n hasError = false;\n caughtError = null;\n return error;\n } else {\n {\n {\n throw Error( \"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n }\n}\n\n\u002F**\n * `ReactInstanceMap` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n *\u002F\nfunction get(key) {\n return key._reactInternals;\n}\nfunction has(key) {\n return key._reactInternals !== undefined;\n}\nfunction set(key, value) {\n key._reactInternals = value;\n}\n\n\u002F\u002F Don't change these two values. They're used by React Dev Tools.\nvar NoFlags =\n\u002F* *\u002F\n0;\nvar PerformedWork =\n\u002F* *\u002F\n1; \u002F\u002F You can change the rest (and add more).\n\nvar Placement =\n\u002F* *\u002F\n2;\nvar Update =\n\u002F* *\u002F\n4;\nvar PlacementAndUpdate =\n\u002F* *\u002F\n6;\nvar Deletion =\n\u002F* *\u002F\n8;\nvar ContentReset =\n\u002F* *\u002F\n16;\nvar Callback =\n\u002F* *\u002F\n32;\nvar DidCapture =\n\u002F* *\u002F\n64;\nvar Ref =\n\u002F* *\u002F\n128;\nvar Snapshot =\n\u002F* *\u002F\n256;\nvar Passive =\n\u002F* *\u002F\n512; \u002F\u002F TODO (effects) Remove this bit once the new reconciler is synced to the old.\n\nvar PassiveUnmountPendingDev =\n\u002F* *\u002F\n8192;\nvar Hydrating =\n\u002F* *\u002F\n1024;\nvar HydratingAndUpdate =\n\u002F* *\u002F\n1028; \u002F\u002F Passive & Update & Callback & Ref & Snapshot\n\nvar LifecycleEffectMask =\n\u002F* *\u002F\n932; \u002F\u002F Union of all host effects\n\nvar HostEffectMask =\n\u002F* *\u002F\n2047; \u002F\u002F These are not really side effects, but we still reuse this field.\n\nvar Incomplete =\n\u002F* *\u002F\n2048;\nvar ShouldCapture =\n\u002F* *\u002F\n4096;\nvar ForceUpdateForLegacySuspense =\n\u002F* *\u002F\n16384; \u002F\u002F Static tags describe aspects of a fiber that are not specific to a render,\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nfunction getNearestMountedFiber(fiber) {\n var node = fiber;\n var nearestMounted = fiber;\n\n if (!fiber.alternate) {\n \u002F\u002F If there is no alternate, this might be a new tree that isn't inserted\n \u002F\u002F yet. If it is, then it will have a pending insertion effect on it.\n var nextNode = node;\n\n do {\n node = nextNode;\n\n if ((node.flags & (Placement | Hydrating)) !== NoFlags) {\n \u002F\u002F This is an insertion or in-progress hydration. The nearest possible\n \u002F\u002F mounted fiber is the parent but we need to continue to figure out\n \u002F\u002F if that one is still mounted.\n nearestMounted = node.return;\n }\n\n nextNode = node.return;\n } while (nextNode);\n } else {\n while (node.return) {\n node = node.return;\n }\n }\n\n if (node.tag === HostRoot) {\n \u002F\u002F TODO: Check if this was a nested HostRoot when used with\n \u002F\u002F renderContainerIntoSubtree.\n return nearestMounted;\n } \u002F\u002F If we didn't hit the root, that means that we're in an disconnected tree\n \u002F\u002F that has been unmounted.\n\n\n return null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n if (fiber.tag === SuspenseComponent) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState === null) {\n var current = fiber.alternate;\n\n if (current !== null) {\n suspenseState = current.memoizedState;\n }\n }\n\n if (suspenseState !== null) {\n return suspenseState.dehydrated;\n }\n }\n\n return null;\n}\nfunction getContainerFromFiber(fiber) {\n return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;\n}\nfunction isFiberMounted(fiber) {\n return getNearestMountedFiber(fiber) === fiber;\n}\nfunction isMounted(component) {\n {\n var owner = ReactCurrentOwner.current;\n\n if (owner !== null && owner.tag === ClassComponent) {\n var ownerFiber = owner;\n var instance = ownerFiber.stateNode;\n\n if (!instance._warnedAboutRefsInRender) {\n error('%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(ownerFiber.type) || 'A component');\n }\n\n instance._warnedAboutRefsInRender = true;\n }\n }\n\n var fiber = get(component);\n\n if (!fiber) {\n return false;\n }\n\n return getNearestMountedFiber(fiber) === fiber;\n}\n\nfunction assertIsMounted(fiber) {\n if (!(getNearestMountedFiber(fiber) === fiber)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n}\n\nfunction findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n\n if (!alternate) {\n \u002F\u002F If there is no alternate, then we only need to check if it is mounted.\n var nearestMounted = getNearestMountedFiber(fiber);\n\n if (!(nearestMounted !== null)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n\n if (nearestMounted !== fiber) {\n return null;\n }\n\n return fiber;\n } \u002F\u002F If we have two possible branches, we'll walk backwards up to the root\n \u002F\u002F to see what path the root points to. On the way we may hit one of the\n \u002F\u002F special cases and we'll deal with them.\n\n\n var a = fiber;\n var b = alternate;\n\n while (true) {\n var parentA = a.return;\n\n if (parentA === null) {\n \u002F\u002F We're at the root.\n break;\n }\n\n var parentB = parentA.alternate;\n\n if (parentB === null) {\n \u002F\u002F There is no alternate. This is an unusual case. Currently, it only\n \u002F\u002F happens when a Suspense component is hidden. An extra fragment fiber\n \u002F\u002F is inserted in between the Suspense fiber and its children. Skip\n \u002F\u002F over this extra fragment fiber and proceed to the next parent.\n var nextParent = parentA.return;\n\n if (nextParent !== null) {\n a = b = nextParent;\n continue;\n } \u002F\u002F If there's no parent, we're at the root.\n\n\n break;\n } \u002F\u002F If both copies of the parent fiber point to the same child, we can\n \u002F\u002F assume that the child is current. This happens when we bailout on low\n \u002F\u002F priority: the bailed out fiber's child reuses the current child.\n\n\n if (parentA.child === parentB.child) {\n var child = parentA.child;\n\n while (child) {\n if (child === a) {\n \u002F\u002F We've determined that A is the current branch.\n assertIsMounted(parentA);\n return fiber;\n }\n\n if (child === b) {\n \u002F\u002F We've determined that B is the current branch.\n assertIsMounted(parentA);\n return alternate;\n }\n\n child = child.sibling;\n } \u002F\u002F We should never have an alternate for any mounting node. So the only\n \u002F\u002F way this could possibly happen is if this was unmounted, if at all.\n\n\n {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n }\n\n if (a.return !== b.return) {\n \u002F\u002F The return pointer of A and the return pointer of B point to different\n \u002F\u002F fibers. We assume that return pointers never criss-cross, so A must\n \u002F\u002F belong to the child set of A.return, and B must belong to the child\n \u002F\u002F set of B.return.\n a = parentA;\n b = parentB;\n } else {\n \u002F\u002F The return pointers point to the same fiber. We'll have to use the\n \u002F\u002F default, slow path: scan the child sets of each parent alternate to see\n \u002F\u002F which child belongs to which set.\n \u002F\u002F\n \u002F\u002F Search parent A's child set\n var didFindChild = false;\n var _child = parentA.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentA;\n b = parentB;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentA;\n a = parentB;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n \u002F\u002F Search parent B's child set\n _child = parentB.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentB;\n b = parentA;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentB;\n a = parentA;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n {\n throw Error( \"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\" );\n }\n }\n }\n }\n\n if (!(a.alternate === b)) {\n {\n throw Error( \"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n } \u002F\u002F If the root is not a host container, we're in a disconnected tree. I.e.\n \u002F\u002F unmounted.\n\n\n if (!(a.tag === HostRoot)) {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n\n if (a.stateNode.current === a) {\n \u002F\u002F We've determined that A is the current branch.\n return fiber;\n } \u002F\u002F Otherwise B has to be current branch.\n\n\n return alternate;\n}\nfunction findCurrentHostFiber(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } \u002F\u002F Next we'll drill down this component to find the first HostComponent\u002FText.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText) {\n return node;\n } else if (node.child) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } \u002F\u002F Flow needs the return null here, but ESLint complains about it.\n \u002F\u002F eslint-disable-next-line no-unreachable\n\n\n return null;\n}\nfunction findCurrentHostFiberWithNoPortals(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } \u002F\u002F Next we'll drill down this component to find the first HostComponent\u002FText.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI ) {\n return node;\n } else if (node.child && node.tag !== HostPortal) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } \u002F\u002F Flow needs the return null here, but ESLint complains about it.\n \u002F\u002F eslint-disable-next-line no-unreachable\n\n\n return null;\n}\nfunction doesFiberContain(parentFiber, childFiber) {\n var node = childFiber;\n var parentFiberAlternate = parentFiber.alternate;\n\n while (node !== null) {\n if (node === parentFiber || node === parentFiberAlternate) {\n return true;\n }\n\n node = node.return;\n }\n\n return false;\n}\n\nvar attemptUserBlockingHydration;\nfunction setAttemptUserBlockingHydration(fn) {\n attemptUserBlockingHydration = fn;\n}\nvar attemptContinuousHydration;\nfunction setAttemptContinuousHydration(fn) {\n attemptContinuousHydration = fn;\n}\nvar attemptHydrationAtCurrentPriority;\nfunction setAttemptHydrationAtCurrentPriority(fn) {\n attemptHydrationAtCurrentPriority = fn;\n}\nvar attemptHydrationAtPriority;\nfunction setAttemptHydrationAtPriority(fn) {\n attemptHydrationAtPriority = fn;\n} \u002F\u002F TODO: Upgrade this definition once we're on a newer version of Flow that\nvar hasScheduledReplayAttempt = false; \u002F\u002F The queue of discrete events to be replayed.\n\nvar queuedDiscreteEvents = []; \u002F\u002F Indicates if any continuous event targets are non-null for early bailout.\n\u002F\u002F if the last target was dehydrated.\n\nvar queuedFocus = null;\nvar queuedDrag = null;\nvar queuedMouse = null; \u002F\u002F For pointer events there can be one latest event per pointerId.\n\nvar queuedPointers = new Map();\nvar queuedPointerCaptures = new Map(); \u002F\u002F We could consider replaying selectionchange and touchmoves too.\n\nvar queuedExplicitHydrationTargets = [];\nfunction hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length \u003E 0;\n}\nvar discreteReplayableEvents = ['mousedown', 'mouseup', 'touchcancel', 'touchend', 'touchstart', 'auxclick', 'dblclick', 'pointercancel', 'pointerdown', 'pointerup', 'dragend', 'dragstart', 'drop', 'compositionend', 'compositionstart', 'keydown', 'keypress', 'keyup', 'input', 'textInput', \u002F\u002F Intentionally camelCase\n'copy', 'cut', 'paste', 'click', 'change', 'contextmenu', 'reset', 'submit'];\nfunction isReplayableDiscreteEvent(eventType) {\n return discreteReplayableEvents.indexOf(eventType) \u003E -1;\n}\n\nfunction createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n return {\n blockedOn: blockedOn,\n domEventName: domEventName,\n eventSystemFlags: eventSystemFlags | IS_REPLAYED,\n nativeEvent: nativeEvent,\n targetContainers: [targetContainer]\n };\n}\n\nfunction queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);\n queuedDiscreteEvents.push(queuedEvent);\n} \u002F\u002F Resets the replaying for this type of continuous event to no event.\n\nfunction clearIfContinuousEvent(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'focusin':\n case 'focusout':\n queuedFocus = null;\n break;\n\n case 'dragenter':\n case 'dragleave':\n queuedDrag = null;\n break;\n\n case 'mouseover':\n case 'mouseout':\n queuedMouse = null;\n break;\n\n case 'pointerover':\n case 'pointerout':\n {\n var pointerId = nativeEvent.pointerId;\n queuedPointers.delete(pointerId);\n break;\n }\n\n case 'gotpointercapture':\n case 'lostpointercapture':\n {\n var _pointerId = nativeEvent.pointerId;\n queuedPointerCaptures.delete(_pointerId);\n break;\n }\n }\n}\n\nfunction accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);\n\n if (blockedOn !== null) {\n var _fiber2 = getInstanceFromNode(blockedOn);\n\n if (_fiber2 !== null) {\n \u002F\u002F Attempt to increase the priority of this target.\n attemptContinuousHydration(_fiber2);\n }\n }\n\n return queuedEvent;\n } \u002F\u002F If we have already queued this exact event, then it's because\n \u002F\u002F the different event systems have different DOM event listeners.\n \u002F\u002F We can accumulate the flags, and the targetContainers, and\n \u002F\u002F store a single event to be replayed.\n\n\n existingQueuedEvent.eventSystemFlags |= eventSystemFlags;\n var targetContainers = existingQueuedEvent.targetContainers;\n\n if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) {\n targetContainers.push(targetContainer);\n }\n\n return existingQueuedEvent;\n}\n\nfunction queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n \u002F\u002F These set relatedTarget to null because the replayed event will be treated as if we\n \u002F\u002F moved from outside the window (no target) onto the target once it hydrates.\n \u002F\u002F Instead of mutating we could clone the event.\n switch (domEventName) {\n case 'focusin':\n {\n var focusEvent = nativeEvent;\n queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent);\n return true;\n }\n\n case 'dragenter':\n {\n var dragEvent = nativeEvent;\n queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent);\n return true;\n }\n\n case 'mouseover':\n {\n var mouseEvent = nativeEvent;\n queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent);\n return true;\n }\n\n case 'pointerover':\n {\n var pointerEvent = nativeEvent;\n var pointerId = pointerEvent.pointerId;\n queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent));\n return true;\n }\n\n case 'gotpointercapture':\n {\n var _pointerEvent = nativeEvent;\n var _pointerId2 = _pointerEvent.pointerId;\n queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent));\n return true;\n }\n }\n\n return false;\n} \u002F\u002F Check if this target is unblocked. Returns true if it's unblocked.\n\nfunction attemptExplicitHydrationTarget(queuedTarget) {\n \u002F\u002F TODO: This function shares a lot of logic with attemptToDispatchEvent.\n \u002F\u002F Try to unify them. It's a bit tricky since it would require two return\n \u002F\u002F values.\n var targetInst = getClosestInstanceFromNode(queuedTarget.target);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted !== null) {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n \u002F\u002F We're blocked on hydrating this boundary.\n \u002F\u002F Increase its priority.\n queuedTarget.blockedOn = instance;\n attemptHydrationAtPriority(queuedTarget.lanePriority, function () {\n Scheduler.unstable_runWithPriority(queuedTarget.priority, function () {\n attemptHydrationAtCurrentPriority(nearestMounted);\n });\n });\n return;\n }\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (root.hydrate) {\n queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); \u002F\u002F We don't currently have a way to increase the priority of\n \u002F\u002F a root other than sync.\n\n return;\n }\n }\n }\n }\n\n queuedTarget.blockedOn = null;\n}\n\nfunction attemptReplayContinuousQueuedEvent(queuedEvent) {\n if (queuedEvent.blockedOn !== null) {\n return false;\n }\n\n var targetContainers = queuedEvent.targetContainers;\n\n while (targetContainers.length \u003E 0) {\n var targetContainer = targetContainers[0];\n var nextBlockedOn = attemptToDispatchEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n \u002F\u002F We're still blocked. Try again later.\n var _fiber3 = getInstanceFromNode(nextBlockedOn);\n\n if (_fiber3 !== null) {\n attemptContinuousHydration(_fiber3);\n }\n\n queuedEvent.blockedOn = nextBlockedOn;\n return false;\n } \u002F\u002F This target container was successfully dispatched. Try the next.\n\n\n targetContainers.shift();\n }\n\n return true;\n}\n\nfunction attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) {\n if (attemptReplayContinuousQueuedEvent(queuedEvent)) {\n map.delete(key);\n }\n}\n\nfunction replayUnblockedEvents() {\n hasScheduledReplayAttempt = false; \u002F\u002F First replay discrete events.\n\n while (queuedDiscreteEvents.length \u003E 0) {\n var nextDiscreteEvent = queuedDiscreteEvents[0];\n\n if (nextDiscreteEvent.blockedOn !== null) {\n \u002F\u002F We're still blocked.\n \u002F\u002F Increase the priority of this boundary to unblock\n \u002F\u002F the next discrete event.\n var _fiber4 = getInstanceFromNode(nextDiscreteEvent.blockedOn);\n\n if (_fiber4 !== null) {\n attemptUserBlockingHydration(_fiber4);\n }\n\n break;\n }\n\n var targetContainers = nextDiscreteEvent.targetContainers;\n\n while (targetContainers.length \u003E 0) {\n var targetContainer = targetContainers[0];\n var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.domEventName, nextDiscreteEvent.eventSystemFlags, targetContainer, nextDiscreteEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n \u002F\u002F We're still blocked. Try again later.\n nextDiscreteEvent.blockedOn = nextBlockedOn;\n break;\n } \u002F\u002F This target container was successfully dispatched. Try the next.\n\n\n targetContainers.shift();\n }\n\n if (nextDiscreteEvent.blockedOn === null) {\n \u002F\u002F We've successfully replayed the first event. Let's try the next one.\n queuedDiscreteEvents.shift();\n }\n } \u002F\u002F Next replay any continuous events.\n\n\n if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) {\n queuedFocus = null;\n }\n\n if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) {\n queuedDrag = null;\n }\n\n if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) {\n queuedMouse = null;\n }\n\n queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap);\n queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap);\n}\n\nfunction scheduleCallbackIfUnblocked(queuedEvent, unblocked) {\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n\n if (!hasScheduledReplayAttempt) {\n hasScheduledReplayAttempt = true; \u002F\u002F Schedule a callback to attempt replaying as many events as are\n \u002F\u002F now unblocked. This first might not actually be unblocked yet.\n \u002F\u002F We could check it early to avoid scheduling an unnecessary callback.\n\n Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);\n }\n }\n}\n\nfunction retryIfBlockedOn(unblocked) {\n \u002F\u002F Mark anything that was blocked on this as no longer blocked\n \u002F\u002F and eligible for a replay.\n if (queuedDiscreteEvents.length \u003E 0) {\n scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); \u002F\u002F This is a exponential search for each boundary that commits. I think it's\n \u002F\u002F worth it because we expect very few discrete events to queue up and once\n \u002F\u002F we are actually fully unblocked it will be fast to replay them.\n\n for (var i = 1; i \u003C queuedDiscreteEvents.length; i++) {\n var queuedEvent = queuedDiscreteEvents[i];\n\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n }\n }\n }\n\n if (queuedFocus !== null) {\n scheduleCallbackIfUnblocked(queuedFocus, unblocked);\n }\n\n if (queuedDrag !== null) {\n scheduleCallbackIfUnblocked(queuedDrag, unblocked);\n }\n\n if (queuedMouse !== null) {\n scheduleCallbackIfUnblocked(queuedMouse, unblocked);\n }\n\n var unblock = function (queuedEvent) {\n return scheduleCallbackIfUnblocked(queuedEvent, unblocked);\n };\n\n queuedPointers.forEach(unblock);\n queuedPointerCaptures.forEach(unblock);\n\n for (var _i = 0; _i \u003C queuedExplicitHydrationTargets.length; _i++) {\n var queuedTarget = queuedExplicitHydrationTargets[_i];\n\n if (queuedTarget.blockedOn === unblocked) {\n queuedTarget.blockedOn = null;\n }\n }\n\n while (queuedExplicitHydrationTargets.length \u003E 0) {\n var nextExplicitTarget = queuedExplicitHydrationTargets[0];\n\n if (nextExplicitTarget.blockedOn !== null) {\n \u002F\u002F We're still blocked.\n break;\n } else {\n attemptExplicitHydrationTarget(nextExplicitTarget);\n\n if (nextExplicitTarget.blockedOn === null) {\n \u002F\u002F We're unblocked.\n queuedExplicitHydrationTargets.shift();\n }\n }\n }\n}\n\nvar DiscreteEvent = 0;\nvar UserBlockingEvent = 1;\nvar ContinuousEvent = 2;\n\n\u002F**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n *\u002F\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n prefixes['Moz' + styleProp] = 'moz' + eventName;\n return prefixes;\n}\n\u002F**\n * A list of event names to a configurable list of vendor prefixes.\n *\u002F\n\n\nvar vendorPrefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n animationstart: makePrefixMap('Animation', 'AnimationStart'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n\u002F**\n * Event names that have already been detected and prefixed (if applicable).\n *\u002F\n\nvar prefixedEventNames = {};\n\u002F**\n * Element to check for prefixes on.\n *\u002F\n\nvar style = {};\n\u002F**\n * Bootstrap if a DOM exists.\n *\u002F\n\nif (canUseDOM) {\n style = document.createElement('div').style; \u002F\u002F On some platforms, in particular some releases of Android 4.x,\n \u002F\u002F the un-prefixed \"animation\" and \"transition\" properties are defined on the\n \u002F\u002F style object but the events that fire will still be prefixed, so we need\n \u002F\u002F to check if the un-prefixed events are usable, and if not remove them from the map.\n\n if (!('AnimationEvent' in window)) {\n delete vendorPrefixes.animationend.animation;\n delete vendorPrefixes.animationiteration.animation;\n delete vendorPrefixes.animationstart.animation;\n } \u002F\u002F Same as above\n\n\n if (!('TransitionEvent' in window)) {\n delete vendorPrefixes.transitionend.transition;\n }\n}\n\u002F**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n *\u002F\n\n\nfunction getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n } else if (!vendorPrefixes[eventName]) {\n return eventName;\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n for (var styleProp in prefixMap) {\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n return prefixedEventNames[eventName] = prefixMap[styleProp];\n }\n }\n\n return eventName;\n}\n\nvar ANIMATION_END = getVendorPrefixedEventName('animationend');\nvar ANIMATION_ITERATION = getVendorPrefixedEventName('animationiteration');\nvar ANIMATION_START = getVendorPrefixedEventName('animationstart');\nvar TRANSITION_END = getVendorPrefixedEventName('transitionend');\n\nvar topLevelEventsToReactNames = new Map();\nvar eventPriorities = new Map(); \u002F\u002F We store most of the events in this module in pairs of two strings so we can re-use\n\u002F\u002F the code required to apply the same logic for event prioritization and that of the\n\u002F\u002F SimpleEventPlugin. This complicates things slightly, but the aim is to reduce code\n\u002F\u002F duplication (for which there would be quite a bit). For the events that are not needed\n\u002F\u002F for the SimpleEventPlugin (otherDiscreteEvents) we process them separately as an\n\u002F\u002F array of top level events.\n\u002F\u002F Lastly, we ignore prettier so we can keep the formatting sane.\n\u002F\u002F prettier-ignore\n\nvar discreteEventPairsForSimpleEventPlugin = ['cancel', 'cancel', 'click', 'click', 'close', 'close', 'contextmenu', 'contextMenu', 'copy', 'copy', 'cut', 'cut', 'auxclick', 'auxClick', 'dblclick', 'doubleClick', \u002F\u002F Careful!\n'dragend', 'dragEnd', 'dragstart', 'dragStart', 'drop', 'drop', 'focusin', 'focus', \u002F\u002F Careful!\n'focusout', 'blur', \u002F\u002F Careful!\n'input', 'input', 'invalid', 'invalid', 'keydown', 'keyDown', 'keypress', 'keyPress', 'keyup', 'keyUp', 'mousedown', 'mouseDown', 'mouseup', 'mouseUp', 'paste', 'paste', 'pause', 'pause', 'play', 'play', 'pointercancel', 'pointerCancel', 'pointerdown', 'pointerDown', 'pointerup', 'pointerUp', 'ratechange', 'rateChange', 'reset', 'reset', 'seeked', 'seeked', 'submit', 'submit', 'touchcancel', 'touchCancel', 'touchend', 'touchEnd', 'touchstart', 'touchStart', 'volumechange', 'volumeChange'];\nvar otherDiscreteEvents = ['change', 'selectionchange', 'textInput', 'compositionstart', 'compositionend', 'compositionupdate'];\n\n\nvar userBlockingPairsForSimpleEventPlugin = ['drag', 'drag', 'dragenter', 'dragEnter', 'dragexit', 'dragExit', 'dragleave', 'dragLeave', 'dragover', 'dragOver', 'mousemove', 'mouseMove', 'mouseout', 'mouseOut', 'mouseover', 'mouseOver', 'pointermove', 'pointerMove', 'pointerout', 'pointerOut', 'pointerover', 'pointerOver', 'scroll', 'scroll', 'toggle', 'toggle', 'touchmove', 'touchMove', 'wheel', 'wheel']; \u002F\u002F prettier-ignore\n\nvar continuousPairsForSimpleEventPlugin = ['abort', 'abort', ANIMATION_END, 'animationEnd', ANIMATION_ITERATION, 'animationIteration', ANIMATION_START, 'animationStart', 'canplay', 'canPlay', 'canplaythrough', 'canPlayThrough', 'durationchange', 'durationChange', 'emptied', 'emptied', 'encrypted', 'encrypted', 'ended', 'ended', 'error', 'error', 'gotpointercapture', 'gotPointerCapture', 'load', 'load', 'loadeddata', 'loadedData', 'loadedmetadata', 'loadedMetadata', 'loadstart', 'loadStart', 'lostpointercapture', 'lostPointerCapture', 'playing', 'playing', 'progress', 'progress', 'seeking', 'seeking', 'stalled', 'stalled', 'suspend', 'suspend', 'timeupdate', 'timeUpdate', TRANSITION_END, 'transitionEnd', 'waiting', 'waiting'];\n\u002F**\n * Turns\n * ['abort', ...]\n *\n * into\n *\n * topLevelEventsToReactNames = new Map([\n * ['abort', 'onAbort'],\n * ]);\n *\n * and registers them.\n *\u002F\n\nfunction registerSimplePluginEventsAndSetTheirPriorities(eventTypes, priority) {\n \u002F\u002F As the event types are in pairs of two, we need to iterate\n \u002F\u002F through in twos. The events are in pairs of two to save code\n \u002F\u002F and improve init perf of processing this array, as it will\n \u002F\u002F result in far fewer object allocations and property accesses\n \u002F\u002F if we only use three arrays to process all the categories of\n \u002F\u002F instead of tuples.\n for (var i = 0; i \u003C eventTypes.length; i += 2) {\n var topEvent = eventTypes[i];\n var event = eventTypes[i + 1];\n var capitalizedEvent = event[0].toUpperCase() + event.slice(1);\n var reactName = 'on' + capitalizedEvent;\n eventPriorities.set(topEvent, priority);\n topLevelEventsToReactNames.set(topEvent, reactName);\n registerTwoPhaseEvent(reactName, [topEvent]);\n }\n}\n\nfunction setEventPriorities(eventTypes, priority) {\n for (var i = 0; i \u003C eventTypes.length; i++) {\n eventPriorities.set(eventTypes[i], priority);\n }\n}\n\nfunction getEventPriorityForPluginSystem(domEventName) {\n var priority = eventPriorities.get(domEventName); \u002F\u002F Default to a ContinuousEvent. Note: we might\n \u002F\u002F want to warn if we can't detect the priority\n \u002F\u002F for the event.\n\n return priority === undefined ? ContinuousEvent : priority;\n}\nfunction registerSimpleEvents() {\n registerSimplePluginEventsAndSetTheirPriorities(discreteEventPairsForSimpleEventPlugin, DiscreteEvent);\n registerSimplePluginEventsAndSetTheirPriorities(userBlockingPairsForSimpleEventPlugin, UserBlockingEvent);\n registerSimplePluginEventsAndSetTheirPriorities(continuousPairsForSimpleEventPlugin, ContinuousEvent);\n setEventPriorities(otherDiscreteEvents, DiscreteEvent);\n}\n\nvar Scheduler_now = Scheduler.unstable_now;\n\n{\n \u002F\u002F Provide explicit error message when production+profiling bundle of e.g.\n \u002F\u002F react-dom is used with production (non-profiling) bundle of\n \u002F\u002F scheduler\u002Ftracing\n if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {\n {\n throw Error( \"It is not supported to run the profiling version of a renderer (for example, `react-dom\u002Fprofiling`) without also replacing the `scheduler\u002Ftracing` module with `scheduler\u002Ftracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https:\u002F\u002Freactjs.org\u002Flink\u002Fprofiling\" );\n }\n }\n}\n\u002F\u002F ascending numbers so we can compare them like numbers. They start at 90 to\n\u002F\u002F avoid clashing with Scheduler's priorities.\n\nvar ImmediatePriority = 99;\nvar UserBlockingPriority = 98;\nvar NormalPriority = 97;\nvar LowPriority = 96;\nvar IdlePriority = 95; \u002F\u002F NoPriority is the absence of priority. Also React-only.\n\nvar NoPriority = 90;\nvar initialTimeMs = Scheduler_now(); \u002F\u002F If the initial timestamp is reasonably small, use Scheduler's `now` directly.\n\nvar SyncLanePriority = 15;\nvar SyncBatchedLanePriority = 14;\nvar InputDiscreteHydrationLanePriority = 13;\nvar InputDiscreteLanePriority = 12;\nvar InputContinuousHydrationLanePriority = 11;\nvar InputContinuousLanePriority = 10;\nvar DefaultHydrationLanePriority = 9;\nvar DefaultLanePriority = 8;\nvar TransitionHydrationPriority = 7;\nvar TransitionPriority = 6;\nvar RetryLanePriority = 5;\nvar SelectiveHydrationLanePriority = 4;\nvar IdleHydrationLanePriority = 3;\nvar IdleLanePriority = 2;\nvar OffscreenLanePriority = 1;\nvar NoLanePriority = 0;\nvar TotalLanes = 31;\nvar NoLanes =\n\u002F* *\u002F\n0;\nvar NoLane =\n\u002F* *\u002F\n0;\nvar SyncLane =\n\u002F* *\u002F\n1;\nvar SyncBatchedLane =\n\u002F* *\u002F\n2;\nvar InputDiscreteHydrationLane =\n\u002F* *\u002F\n4;\nvar InputDiscreteLanes =\n\u002F* *\u002F\n24;\nvar InputContinuousHydrationLane =\n\u002F* *\u002F\n32;\nvar InputContinuousLanes =\n\u002F* *\u002F\n192;\nvar DefaultHydrationLane =\n\u002F* *\u002F\n256;\nvar DefaultLanes =\n\u002F* *\u002F\n3584;\nvar TransitionHydrationLane =\n\u002F* *\u002F\n4096;\nvar TransitionLanes =\n\u002F* *\u002F\n4186112;\nvar RetryLanes =\n\u002F* *\u002F\n62914560;\nvar SomeRetryLane =\n\u002F* *\u002F\n33554432;\nvar SelectiveHydrationLane =\n\u002F* *\u002F\n67108864;\nvar NonIdleLanes =\n\u002F* *\u002F\n134217727;\nvar IdleHydrationLane =\n\u002F* *\u002F\n134217728;\nvar IdleLanes =\n\u002F* *\u002F\n805306368;\nvar OffscreenLane =\n\u002F* *\u002F\n1073741824;\nvar NoTimestamp = -1;\nfunction setCurrentUpdateLanePriority(newLanePriority) {\n} \u002F\u002F \"Registers\" used to \"return\" multiple values\n\u002F\u002F Used by getHighestPriorityLanes and getNextLanes:\n\nvar return_highestLanePriority = DefaultLanePriority;\n\nfunction getHighestPriorityLanes(lanes) {\n if ((SyncLane & lanes) !== NoLanes) {\n return_highestLanePriority = SyncLanePriority;\n return SyncLane;\n }\n\n if ((SyncBatchedLane & lanes) !== NoLanes) {\n return_highestLanePriority = SyncBatchedLanePriority;\n return SyncBatchedLane;\n }\n\n if ((InputDiscreteHydrationLane & lanes) !== NoLanes) {\n return_highestLanePriority = InputDiscreteHydrationLanePriority;\n return InputDiscreteHydrationLane;\n }\n\n var inputDiscreteLanes = InputDiscreteLanes & lanes;\n\n if (inputDiscreteLanes !== NoLanes) {\n return_highestLanePriority = InputDiscreteLanePriority;\n return inputDiscreteLanes;\n }\n\n if ((lanes & InputContinuousHydrationLane) !== NoLanes) {\n return_highestLanePriority = InputContinuousHydrationLanePriority;\n return InputContinuousHydrationLane;\n }\n\n var inputContinuousLanes = InputContinuousLanes & lanes;\n\n if (inputContinuousLanes !== NoLanes) {\n return_highestLanePriority = InputContinuousLanePriority;\n return inputContinuousLanes;\n }\n\n if ((lanes & DefaultHydrationLane) !== NoLanes) {\n return_highestLanePriority = DefaultHydrationLanePriority;\n return DefaultHydrationLane;\n }\n\n var defaultLanes = DefaultLanes & lanes;\n\n if (defaultLanes !== NoLanes) {\n return_highestLanePriority = DefaultLanePriority;\n return defaultLanes;\n }\n\n if ((lanes & TransitionHydrationLane) !== NoLanes) {\n return_highestLanePriority = TransitionHydrationPriority;\n return TransitionHydrationLane;\n }\n\n var transitionLanes = TransitionLanes & lanes;\n\n if (transitionLanes !== NoLanes) {\n return_highestLanePriority = TransitionPriority;\n return transitionLanes;\n }\n\n var retryLanes = RetryLanes & lanes;\n\n if (retryLanes !== NoLanes) {\n return_highestLanePriority = RetryLanePriority;\n return retryLanes;\n }\n\n if (lanes & SelectiveHydrationLane) {\n return_highestLanePriority = SelectiveHydrationLanePriority;\n return SelectiveHydrationLane;\n }\n\n if ((lanes & IdleHydrationLane) !== NoLanes) {\n return_highestLanePriority = IdleHydrationLanePriority;\n return IdleHydrationLane;\n }\n\n var idleLanes = IdleLanes & lanes;\n\n if (idleLanes !== NoLanes) {\n return_highestLanePriority = IdleLanePriority;\n return idleLanes;\n }\n\n if ((OffscreenLane & lanes) !== NoLanes) {\n return_highestLanePriority = OffscreenLanePriority;\n return OffscreenLane;\n }\n\n {\n error('Should have found matching lanes. This is a bug in React.');\n } \u002F\u002F This shouldn't be reachable, but as a fallback, return the entire bitmask.\n\n\n return_highestLanePriority = DefaultLanePriority;\n return lanes;\n}\n\nfunction schedulerPriorityToLanePriority(schedulerPriorityLevel) {\n switch (schedulerPriorityLevel) {\n case ImmediatePriority:\n return SyncLanePriority;\n\n case UserBlockingPriority:\n return InputContinuousLanePriority;\n\n case NormalPriority:\n case LowPriority:\n \u002F\u002F TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration.\n return DefaultLanePriority;\n\n case IdlePriority:\n return IdleLanePriority;\n\n default:\n return NoLanePriority;\n }\n}\nfunction lanePriorityToSchedulerPriority(lanePriority) {\n switch (lanePriority) {\n case SyncLanePriority:\n case SyncBatchedLanePriority:\n return ImmediatePriority;\n\n case InputDiscreteHydrationLanePriority:\n case InputDiscreteLanePriority:\n case InputContinuousHydrationLanePriority:\n case InputContinuousLanePriority:\n return UserBlockingPriority;\n\n case DefaultHydrationLanePriority:\n case DefaultLanePriority:\n case TransitionHydrationPriority:\n case TransitionPriority:\n case SelectiveHydrationLanePriority:\n case RetryLanePriority:\n return NormalPriority;\n\n case IdleHydrationLanePriority:\n case IdleLanePriority:\n case OffscreenLanePriority:\n return IdlePriority;\n\n case NoLanePriority:\n return NoPriority;\n\n default:\n {\n {\n throw Error( \"Invalid update priority: \" + lanePriority + \". This is a bug in React.\" );\n }\n }\n\n }\n}\nfunction getNextLanes(root, wipLanes) {\n \u002F\u002F Early bailout if there's no pending work left.\n var pendingLanes = root.pendingLanes;\n\n if (pendingLanes === NoLanes) {\n return_highestLanePriority = NoLanePriority;\n return NoLanes;\n }\n\n var nextLanes = NoLanes;\n var nextLanePriority = NoLanePriority;\n var expiredLanes = root.expiredLanes;\n var suspendedLanes = root.suspendedLanes;\n var pingedLanes = root.pingedLanes; \u002F\u002F Check if any work has expired.\n\n if (expiredLanes !== NoLanes) {\n nextLanes = expiredLanes;\n nextLanePriority = return_highestLanePriority = SyncLanePriority;\n } else {\n \u002F\u002F Do not work on any idle work until all the non-idle work has finished,\n \u002F\u002F even if the work is suspended.\n var nonIdlePendingLanes = pendingLanes & NonIdleLanes;\n\n if (nonIdlePendingLanes !== NoLanes) {\n var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes;\n\n if (nonIdleUnblockedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes);\n nextLanePriority = return_highestLanePriority;\n } else {\n var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes;\n\n if (nonIdlePingedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(nonIdlePingedLanes);\n nextLanePriority = return_highestLanePriority;\n }\n }\n } else {\n \u002F\u002F The only remaining work is Idle.\n var unblockedLanes = pendingLanes & ~suspendedLanes;\n\n if (unblockedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(unblockedLanes);\n nextLanePriority = return_highestLanePriority;\n } else {\n if (pingedLanes !== NoLanes) {\n nextLanes = getHighestPriorityLanes(pingedLanes);\n nextLanePriority = return_highestLanePriority;\n }\n }\n }\n }\n\n if (nextLanes === NoLanes) {\n \u002F\u002F This should only be reachable if we're suspended\n \u002F\u002F TODO: Consider warning in this path if a fallback timer is not scheduled.\n return NoLanes;\n } \u002F\u002F If there are higher priority lanes, we'll include them even if they\n \u002F\u002F are suspended.\n\n\n nextLanes = pendingLanes & getEqualOrHigherPriorityLanes(nextLanes); \u002F\u002F If we're already in the middle of a render, switching lanes will interrupt\n \u002F\u002F it and we'll lose our progress. We should only do this if the new lanes are\n \u002F\u002F higher priority.\n\n if (wipLanes !== NoLanes && wipLanes !== nextLanes && \u002F\u002F If we already suspended with a delay, then interrupting is fine. Don't\n \u002F\u002F bother waiting until the root is complete.\n (wipLanes & suspendedLanes) === NoLanes) {\n getHighestPriorityLanes(wipLanes);\n var wipLanePriority = return_highestLanePriority;\n\n if (nextLanePriority \u003C= wipLanePriority) {\n return wipLanes;\n } else {\n return_highestLanePriority = nextLanePriority;\n }\n } \u002F\u002F Check for entangled lanes and add them to the batch.\n \u002F\u002F\n \u002F\u002F A lane is said to be entangled with another when it's not allowed to render\n \u002F\u002F in a batch that does not also include the other lane. Typically we do this\n \u002F\u002F when multiple updates have the same source, and we only want to respond to\n \u002F\u002F the most recent event from that source.\n \u002F\u002F\n \u002F\u002F Note that we apply entanglements *after* checking for partial work above.\n \u002F\u002F This means that if a lane is entangled during an interleaved event while\n \u002F\u002F it's already rendering, we won't interrupt it. This is intentional, since\n \u002F\u002F entanglement is usually \"best effort\": we'll try our best to render the\n \u002F\u002F lanes in the same batch, but it's not worth throwing out partially\n \u002F\u002F completed work in order to do it.\n \u002F\u002F\n \u002F\u002F For those exceptions where entanglement is semantically important, like\n \u002F\u002F useMutableSource, we should ensure that there is no partial work at the\n \u002F\u002F time we apply the entanglement.\n\n\n var entangledLanes = root.entangledLanes;\n\n if (entangledLanes !== NoLanes) {\n var entanglements = root.entanglements;\n var lanes = nextLanes & entangledLanes;\n\n while (lanes \u003E 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 \u003C\u003C index;\n nextLanes |= entanglements[index];\n lanes &= ~lane;\n }\n }\n\n return nextLanes;\n}\nfunction getMostRecentEventTime(root, lanes) {\n var eventTimes = root.eventTimes;\n var mostRecentEventTime = NoTimestamp;\n\n while (lanes \u003E 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 \u003C\u003C index;\n var eventTime = eventTimes[index];\n\n if (eventTime \u003E mostRecentEventTime) {\n mostRecentEventTime = eventTime;\n }\n\n lanes &= ~lane;\n }\n\n return mostRecentEventTime;\n}\n\nfunction computeExpirationTime(lane, currentTime) {\n \u002F\u002F TODO: Expiration heuristic is constant per lane, so could use a map.\n getHighestPriorityLanes(lane);\n var priority = return_highestLanePriority;\n\n if (priority \u003E= InputContinuousLanePriority) {\n \u002F\u002F User interactions should expire slightly more quickly.\n \u002F\u002F\n \u002F\u002F NOTE: This is set to the corresponding constant as in Scheduler.js. When\n \u002F\u002F we made it larger, a product metric in www regressed, suggesting there's\n \u002F\u002F a user interaction that's being starved by a series of synchronous\n \u002F\u002F updates. If that theory is correct, the proper solution is to fix the\n \u002F\u002F starvation. However, this scenario supports the idea that expiration\n \u002F\u002F times are an important safeguard when starvation does happen.\n \u002F\u002F\n \u002F\u002F Also note that, in the case of user input specifically, this will soon no\n \u002F\u002F longer be an issue because we plan to make user input synchronous by\n \u002F\u002F default (until you enter `startTransition`, of course.)\n \u002F\u002F\n \u002F\u002F If weren't planning to make these updates synchronous soon anyway, I\n \u002F\u002F would probably make this number a configurable parameter.\n return currentTime + 250;\n } else if (priority \u003E= TransitionPriority) {\n return currentTime + 5000;\n } else {\n \u002F\u002F Anything idle priority or lower should never expire.\n return NoTimestamp;\n }\n}\n\nfunction markStarvedLanesAsExpired(root, currentTime) {\n \u002F\u002F TODO: This gets called every time we yield. We can optimize by storing\n \u002F\u002F the earliest expiration time on the root. Then use that to quickly bail out\n \u002F\u002F of this function.\n var pendingLanes = root.pendingLanes;\n var suspendedLanes = root.suspendedLanes;\n var pingedLanes = root.pingedLanes;\n var expirationTimes = root.expirationTimes; \u002F\u002F Iterate through the pending lanes and check if we've reached their\n \u002F\u002F expiration time. If so, we'll assume the update is being starved and mark\n \u002F\u002F it as expired to force it to finish.\n\n var lanes = pendingLanes;\n\n while (lanes \u003E 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 \u003C\u003C index;\n var expirationTime = expirationTimes[index];\n\n if (expirationTime === NoTimestamp) {\n \u002F\u002F Found a pending lane with no expiration time. If it's not suspended, or\n \u002F\u002F if it's pinged, assume it's CPU-bound. Compute a new expiration time\n \u002F\u002F using the current time.\n if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) {\n \u002F\u002F Assumes timestamps are monotonically increasing.\n expirationTimes[index] = computeExpirationTime(lane, currentTime);\n }\n } else if (expirationTime \u003C= currentTime) {\n \u002F\u002F This lane expired\n root.expiredLanes |= lane;\n }\n\n lanes &= ~lane;\n }\n} \u002F\u002F This returns the highest priority pending lanes regardless of whether they\nfunction getLanesToRetrySynchronouslyOnError(root) {\n var everythingButOffscreen = root.pendingLanes & ~OffscreenLane;\n\n if (everythingButOffscreen !== NoLanes) {\n return everythingButOffscreen;\n }\n\n if (everythingButOffscreen & OffscreenLane) {\n return OffscreenLane;\n }\n\n return NoLanes;\n}\nfunction returnNextLanesPriority() {\n return return_highestLanePriority;\n}\nfunction includesNonIdleWork(lanes) {\n return (lanes & NonIdleLanes) !== NoLanes;\n}\nfunction includesOnlyRetries(lanes) {\n return (lanes & RetryLanes) === lanes;\n}\nfunction includesOnlyTransitions(lanes) {\n return (lanes & TransitionLanes) === lanes;\n} \u002F\u002F To ensure consistency across multiple updates in the same event, this should\n\u002F\u002F be a pure function, so that it always returns the same lane for given inputs.\n\nfunction findUpdateLane(lanePriority, wipLanes) {\n switch (lanePriority) {\n case NoLanePriority:\n break;\n\n case SyncLanePriority:\n return SyncLane;\n\n case SyncBatchedLanePriority:\n return SyncBatchedLane;\n\n case InputDiscreteLanePriority:\n {\n var _lane = pickArbitraryLane(InputDiscreteLanes & ~wipLanes);\n\n if (_lane === NoLane) {\n \u002F\u002F Shift to the next priority level\n return findUpdateLane(InputContinuousLanePriority, wipLanes);\n }\n\n return _lane;\n }\n\n case InputContinuousLanePriority:\n {\n var _lane2 = pickArbitraryLane(InputContinuousLanes & ~wipLanes);\n\n if (_lane2 === NoLane) {\n \u002F\u002F Shift to the next priority level\n return findUpdateLane(DefaultLanePriority, wipLanes);\n }\n\n return _lane2;\n }\n\n case DefaultLanePriority:\n {\n var _lane3 = pickArbitraryLane(DefaultLanes & ~wipLanes);\n\n if (_lane3 === NoLane) {\n \u002F\u002F If all the default lanes are already being worked on, look for a\n \u002F\u002F lane in the transition range.\n _lane3 = pickArbitraryLane(TransitionLanes & ~wipLanes);\n\n if (_lane3 === NoLane) {\n \u002F\u002F All the transition lanes are taken, too. This should be very\n \u002F\u002F rare, but as a last resort, pick a default lane. This will have\n \u002F\u002F the effect of interrupting the current work-in-progress render.\n _lane3 = pickArbitraryLane(DefaultLanes);\n }\n }\n\n return _lane3;\n }\n\n case TransitionPriority: \u002F\u002F Should be handled by findTransitionLane instead\n\n case RetryLanePriority:\n \u002F\u002F Should be handled by findRetryLane instead\n break;\n\n case IdleLanePriority:\n var lane = pickArbitraryLane(IdleLanes & ~wipLanes);\n\n if (lane === NoLane) {\n lane = pickArbitraryLane(IdleLanes);\n }\n\n return lane;\n }\n\n {\n {\n throw Error( \"Invalid update priority: \" + lanePriority + \". This is a bug in React.\" );\n }\n }\n} \u002F\u002F To ensure consistency across multiple updates in the same event, this should\n\u002F\u002F be pure function, so that it always returns the same lane for given inputs.\n\nfunction findTransitionLane(wipLanes, pendingLanes) {\n \u002F\u002F First look for lanes that are completely unclaimed, i.e. have no\n \u002F\u002F pending work.\n var lane = pickArbitraryLane(TransitionLanes & ~pendingLanes);\n\n if (lane === NoLane) {\n \u002F\u002F If all lanes have pending work, look for a lane that isn't currently\n \u002F\u002F being worked on.\n lane = pickArbitraryLane(TransitionLanes & ~wipLanes);\n\n if (lane === NoLane) {\n \u002F\u002F If everything is being worked on, pick any lane. This has the\n \u002F\u002F effect of interrupting the current work-in-progress.\n lane = pickArbitraryLane(TransitionLanes);\n }\n }\n\n return lane;\n} \u002F\u002F To ensure consistency across multiple updates in the same event, this should\n\u002F\u002F be pure function, so that it always returns the same lane for given inputs.\n\nfunction findRetryLane(wipLanes) {\n \u002F\u002F This is a fork of `findUpdateLane` designed specifically for Suspense\n \u002F\u002F \"retries\" — a special update that attempts to flip a Suspense boundary\n \u002F\u002F from its placeholder state to its primary\u002Fresolved state.\n var lane = pickArbitraryLane(RetryLanes & ~wipLanes);\n\n if (lane === NoLane) {\n lane = pickArbitraryLane(RetryLanes);\n }\n\n return lane;\n}\n\nfunction getHighestPriorityLane(lanes) {\n return lanes & -lanes;\n}\n\nfunction getLowestPriorityLane(lanes) {\n \u002F\u002F This finds the most significant non-zero bit.\n var index = 31 - clz32(lanes);\n return index \u003C 0 ? NoLanes : 1 \u003C\u003C index;\n}\n\nfunction getEqualOrHigherPriorityLanes(lanes) {\n return (getLowestPriorityLane(lanes) \u003C\u003C 1) - 1;\n}\n\nfunction pickArbitraryLane(lanes) {\n \u002F\u002F This wrapper function gets inlined. Only exists so to communicate that it\n \u002F\u002F doesn't matter which bit is selected; you can pick any bit without\n \u002F\u002F affecting the algorithms where its used. Here I'm using\n \u002F\u002F getHighestPriorityLane because it requires the fewest operations.\n return getHighestPriorityLane(lanes);\n}\n\nfunction pickArbitraryLaneIndex(lanes) {\n return 31 - clz32(lanes);\n}\n\nfunction laneToIndex(lane) {\n return pickArbitraryLaneIndex(lane);\n}\n\nfunction includesSomeLane(a, b) {\n return (a & b) !== NoLanes;\n}\nfunction isSubsetOfLanes(set, subset) {\n return (set & subset) === subset;\n}\nfunction mergeLanes(a, b) {\n return a | b;\n}\nfunction removeLanes(set, subset) {\n return set & ~subset;\n} \u002F\u002F Seems redundant, but it changes the type from a single lane (used for\n\u002F\u002F updates) to a group of lanes (used for flushing work).\n\nfunction laneToLanes(lane) {\n return lane;\n}\nfunction higherPriorityLane(a, b) {\n \u002F\u002F This works because the bit ranges decrease in priority as you go left.\n return a !== NoLane && a \u003C b ? a : b;\n}\nfunction createLaneMap(initial) {\n \u002F\u002F Intentionally pushing one by one.\n \u002F\u002F https:\u002F\u002Fv8.dev\u002Fblog\u002Felements-kinds#avoid-creating-holes\n var laneMap = [];\n\n for (var i = 0; i \u003C TotalLanes; i++) {\n laneMap.push(initial);\n }\n\n return laneMap;\n}\nfunction markRootUpdated(root, updateLane, eventTime) {\n root.pendingLanes |= updateLane; \u002F\u002F TODO: Theoretically, any update to any lane can unblock any other lane. But\n \u002F\u002F it's not practical to try every single possible combination. We need a\n \u002F\u002F heuristic to decide which lanes to attempt to render, and in which batches.\n \u002F\u002F For now, we use the same heuristic as in the old ExpirationTimes model:\n \u002F\u002F retry any lane at equal or lower priority, but don't try updates at higher\n \u002F\u002F priority without also including the lower priority updates. This works well\n \u002F\u002F when considering updates across different priority levels, but isn't\n \u002F\u002F sufficient for updates within the same priority, since we want to treat\n \u002F\u002F those updates as parallel.\n \u002F\u002F Unsuspend any update at equal or lower priority.\n\n var higherPriorityLanes = updateLane - 1; \u002F\u002F Turns 0b1000 into 0b0111\n\n root.suspendedLanes &= higherPriorityLanes;\n root.pingedLanes &= higherPriorityLanes;\n var eventTimes = root.eventTimes;\n var index = laneToIndex(updateLane); \u002F\u002F We can always overwrite an existing timestamp because we prefer the most\n \u002F\u002F recent event, and we assume time is monotonically increasing.\n\n eventTimes[index] = eventTime;\n}\nfunction markRootSuspended(root, suspendedLanes) {\n root.suspendedLanes |= suspendedLanes;\n root.pingedLanes &= ~suspendedLanes; \u002F\u002F The suspended lanes are no longer CPU-bound. Clear their expiration times.\n\n var expirationTimes = root.expirationTimes;\n var lanes = suspendedLanes;\n\n while (lanes \u003E 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 \u003C\u003C index;\n expirationTimes[index] = NoTimestamp;\n lanes &= ~lane;\n }\n}\nfunction markRootPinged(root, pingedLanes, eventTime) {\n root.pingedLanes |= root.suspendedLanes & pingedLanes;\n}\nfunction markDiscreteUpdatesExpired(root) {\n root.expiredLanes |= InputDiscreteLanes & root.pendingLanes;\n}\nfunction hasDiscreteLanes(lanes) {\n return (lanes & InputDiscreteLanes) !== NoLanes;\n}\nfunction markRootMutableRead(root, updateLane) {\n root.mutableReadLanes |= updateLane & root.pendingLanes;\n}\nfunction markRootFinished(root, remainingLanes) {\n var noLongerPendingLanes = root.pendingLanes & ~remainingLanes;\n root.pendingLanes = remainingLanes; \u002F\u002F Let's try everything again\n\n root.suspendedLanes = 0;\n root.pingedLanes = 0;\n root.expiredLanes &= remainingLanes;\n root.mutableReadLanes &= remainingLanes;\n root.entangledLanes &= remainingLanes;\n var entanglements = root.entanglements;\n var eventTimes = root.eventTimes;\n var expirationTimes = root.expirationTimes; \u002F\u002F Clear the lanes that no longer have pending work\n\n var lanes = noLongerPendingLanes;\n\n while (lanes \u003E 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 \u003C\u003C index;\n entanglements[index] = NoLanes;\n eventTimes[index] = NoTimestamp;\n expirationTimes[index] = NoTimestamp;\n lanes &= ~lane;\n }\n}\nfunction markRootEntangled(root, entangledLanes) {\n root.entangledLanes |= entangledLanes;\n var entanglements = root.entanglements;\n var lanes = entangledLanes;\n\n while (lanes \u003E 0) {\n var index = pickArbitraryLaneIndex(lanes);\n var lane = 1 \u003C\u003C index;\n entanglements[index] |= entangledLanes;\n lanes &= ~lane;\n }\n}\nvar clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; \u002F\u002F Count leading zeros. Only used on lanes, so assume input is an integer.\n\u002F\u002F Based on:\n\u002F\u002F https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FGlobal_Objects\u002FMath\u002Fclz32\n\nvar log = Math.log;\nvar LN2 = Math.LN2;\n\nfunction clz32Fallback(lanes) {\n if (lanes === 0) {\n return 32;\n }\n\n return 31 - (log(lanes) \u002F LN2 | 0) | 0;\n}\n\n\u002F\u002F Intentionally not named imports because Rollup would use dynamic dispatch for\nvar UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority,\n runWithPriority = Scheduler.unstable_runWithPriority; \u002F\u002F TODO: can we stop exporting these?\n\nvar _enabled = true; \u002F\u002F This is exported in FB builds for use by legacy FB layer infra.\n\u002F\u002F We'd like to remove this but it's not clear if this is safe.\n\nfunction setEnabled(enabled) {\n _enabled = !!enabled;\n}\nfunction isEnabled() {\n return _enabled;\n}\nfunction createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) {\n var eventPriority = getEventPriorityForPluginSystem(domEventName);\n var listenerWrapper;\n\n switch (eventPriority) {\n case DiscreteEvent:\n listenerWrapper = dispatchDiscreteEvent;\n break;\n\n case UserBlockingEvent:\n listenerWrapper = dispatchUserBlockingUpdate;\n break;\n\n case ContinuousEvent:\n default:\n listenerWrapper = dispatchEvent;\n break;\n }\n\n return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer);\n}\n\nfunction dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) {\n {\n flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);\n }\n\n discreteUpdates(dispatchEvent, domEventName, eventSystemFlags, container, nativeEvent);\n}\n\nfunction dispatchUserBlockingUpdate(domEventName, eventSystemFlags, container, nativeEvent) {\n {\n runWithPriority(UserBlockingPriority$1, dispatchEvent.bind(null, domEventName, eventSystemFlags, container, nativeEvent));\n }\n}\n\nfunction dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n if (!_enabled) {\n return;\n }\n\n var allowReplay = true;\n\n {\n \u002F\u002F TODO: replaying capture phase events is currently broken\n \u002F\u002F because we used to do it during top-level native bubble handlers\n \u002F\u002F but now we use different bubble and capture handlers.\n \u002F\u002F In eager mode, we attach capture listeners early, so we need\n \u002F\u002F to filter them out until we fix the logic to handle them correctly.\n \u002F\u002F This could've been outside the flag but I put it inside to reduce risk.\n allowReplay = (eventSystemFlags & IS_CAPTURE_PHASE) === 0;\n }\n\n if (allowReplay && hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(domEventName)) {\n \u002F\u002F If we already have a queue of discrete events, and this is another discrete\n \u002F\u002F event, then we can't dispatch it regardless of its target, since they\n \u002F\u002F need to dispatch in order.\n queueDiscreteEvent(null, \u002F\u002F Flags that we're not actually blocked on anything as far as we know.\n domEventName, eventSystemFlags, targetContainer, nativeEvent);\n return;\n }\n\n var blockedOn = attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent);\n\n if (blockedOn === null) {\n \u002F\u002F We successfully dispatched this event.\n if (allowReplay) {\n clearIfContinuousEvent(domEventName, nativeEvent);\n }\n\n return;\n }\n\n if (allowReplay) {\n if (isReplayableDiscreteEvent(domEventName)) {\n \u002F\u002F This this to be replayed later once the target is available.\n queueDiscreteEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent);\n return;\n }\n\n if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) {\n return;\n } \u002F\u002F We need to clear only if we didn't queue because\n \u002F\u002F queueing is accummulative.\n\n\n clearIfContinuousEvent(domEventName, nativeEvent);\n } \u002F\u002F This is not replayable so we'll invoke it but without a target,\n \u002F\u002F in case the event system needs to trace it.\n\n\n dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer);\n} \u002F\u002F Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.\n\nfunction attemptToDispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) {\n \u002F\u002F TODO: Warn if _enabled is false.\n var nativeEventTarget = getEventTarget(nativeEvent);\n var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted === null) {\n \u002F\u002F This tree has been unmounted already. Dispatch without a target.\n targetInst = null;\n } else {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n \u002F\u002F Queue the event to be replayed later. Abort dispatching since we\n \u002F\u002F don't want this event dispatched twice through the event system.\n \u002F\u002F TODO: If this is the first discrete event in the queue. Schedule an increased\n \u002F\u002F priority for this boundary.\n return instance;\n } \u002F\u002F This shouldn't happen, something went wrong but to avoid blocking\n \u002F\u002F the whole system, dispatch the event without a target.\n \u002F\u002F TODO: Warn.\n\n\n targetInst = null;\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (root.hydrate) {\n \u002F\u002F If this happens during a replay something went wrong and it might block\n \u002F\u002F the whole system.\n return getContainerFromFiber(nearestMounted);\n }\n\n targetInst = null;\n } else if (nearestMounted !== targetInst) {\n \u002F\u002F If we get an event (ex: img onload) before committing that\n \u002F\u002F component's mount, ignore it for now (that is, treat it as if it was an\n \u002F\u002F event on a non-React tree). We might also consider queueing events and\n \u002F\u002F dispatching them after the mount.\n targetInst = null;\n }\n }\n }\n\n dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer); \u002F\u002F We're not blocked on anything.\n\n return null;\n}\n\nfunction addEventBubbleListener(target, eventType, listener) {\n target.addEventListener(eventType, listener, false);\n return listener;\n}\nfunction addEventCaptureListener(target, eventType, listener) {\n target.addEventListener(eventType, listener, true);\n return listener;\n}\nfunction addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) {\n target.addEventListener(eventType, listener, {\n capture: true,\n passive: passive\n });\n return listener;\n}\nfunction addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) {\n target.addEventListener(eventType, listener, {\n passive: passive\n });\n return listener;\n}\n\n\u002F**\n * These variables store information about text content of a target node,\n * allowing comparison of content before and after a given event.\n *\n * Identify the node where selection currently begins, then observe\n * both its text content and its current position in the DOM. Since the\n * browser may natively replace the target node during composition, we can\n * use its position to find its replacement.\n *\n *\n *\u002F\nvar root = null;\nvar startText = null;\nvar fallbackText = null;\nfunction initialize(nativeEventTarget) {\n root = nativeEventTarget;\n startText = getText();\n return true;\n}\nfunction reset() {\n root = null;\n startText = null;\n fallbackText = null;\n}\nfunction getData() {\n if (fallbackText) {\n return fallbackText;\n }\n\n var start;\n var startValue = startText;\n var startLength = startValue.length;\n var end;\n var endValue = getText();\n var endLength = endValue.length;\n\n for (start = 0; start \u003C startLength; start++) {\n if (startValue[start] !== endValue[start]) {\n break;\n }\n }\n\n var minEnd = startLength - start;\n\n for (end = 1; end \u003C= minEnd; end++) {\n if (startValue[startLength - end] !== endValue[endLength - end]) {\n break;\n }\n }\n\n var sliceTail = end \u003E 1 ? 1 - end : undefined;\n fallbackText = endValue.slice(start, sliceTail);\n return fallbackText;\n}\nfunction getText() {\n if ('value' in root) {\n return root.value;\n }\n\n return root.textContent;\n}\n\n\u002F**\n * `charCode` represents the actual \"character code\" and is safe to use with\n * `String.fromCharCode`. As such, only keys that correspond to printable\n * characters produce a valid `charCode`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a `charCode`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized `charCode` property.\n *\u002F\nfunction getEventCharCode(nativeEvent) {\n var charCode;\n var keyCode = nativeEvent.keyCode;\n\n if ('charCode' in nativeEvent) {\n charCode = nativeEvent.charCode; \u002F\u002F FF does not set `charCode` for the Enter-key, check against `keyCode`.\n\n if (charCode === 0 && keyCode === 13) {\n charCode = 13;\n }\n } else {\n \u002F\u002F IE8 does not implement `charCode`, but `keyCode` has the correct value.\n charCode = keyCode;\n } \u002F\u002F IE and Edge (on Windows) and Chrome \u002F Safari (on Windows and Linux)\n \u002F\u002F report Enter as charCode 10 when ctrl is pressed.\n\n\n if (charCode === 10) {\n charCode = 13;\n } \u002F\u002F Some non-printable keys are reported in `charCode`\u002F`keyCode`, discard them.\n \u002F\u002F Must not discard the (non-)printable Enter-key.\n\n\n if (charCode \u003E= 32 || charCode === 13) {\n return charCode;\n }\n\n return 0;\n}\n\nfunction functionThatReturnsTrue() {\n return true;\n}\n\nfunction functionThatReturnsFalse() {\n return false;\n} \u002F\u002F This is intentionally a factory so that we have different returned constructors.\n\u002F\u002F If we had a single constructor, it would be megamorphic and engines would deopt.\n\n\nfunction createSyntheticEvent(Interface) {\n \u002F**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\u002F\n function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) {\n this._reactName = reactName;\n this._targetInst = targetInst;\n this.type = reactEventType;\n this.nativeEvent = nativeEvent;\n this.target = nativeEventTarget;\n this.currentTarget = null;\n\n for (var _propName in Interface) {\n if (!Interface.hasOwnProperty(_propName)) {\n continue;\n }\n\n var normalize = Interface[_propName];\n\n if (normalize) {\n this[_propName] = normalize(nativeEvent);\n } else {\n this[_propName] = nativeEvent[_propName];\n }\n }\n\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n\n if (defaultPrevented) {\n this.isDefaultPrevented = functionThatReturnsTrue;\n } else {\n this.isDefaultPrevented = functionThatReturnsFalse;\n }\n\n this.isPropagationStopped = functionThatReturnsFalse;\n return this;\n }\n\n _assign(SyntheticBaseEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.preventDefault) {\n event.preventDefault(); \u002F\u002F $FlowFixMe - flow is not aware of `unknown` in IE\n } else if (typeof event.returnValue !== 'unknown') {\n event.returnValue = false;\n }\n\n this.isDefaultPrevented = functionThatReturnsTrue;\n },\n stopPropagation: function () {\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation(); \u002F\u002F $FlowFixMe - flow is not aware of `unknown` in IE\n } else if (typeof event.cancelBubble !== 'unknown') {\n \u002F\u002F The ChangeEventPlugin registers a \"propertychange\" event for\n \u002F\u002F IE. This event does not support bubbling or cancelling, and\n \u002F\u002F any references to cancelBubble throw \"Member not found\". A\n \u002F\u002F typeof check of \"unknown\" circumvents this issue (and is also\n \u002F\u002F IE specific).\n event.cancelBubble = true;\n }\n\n this.isPropagationStopped = functionThatReturnsTrue;\n },\n\n \u002F**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n *\u002F\n persist: function () {\u002F\u002F Modern event system doesn't use pooling.\n },\n\n \u002F**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n *\u002F\n isPersistent: functionThatReturnsTrue\n });\n\n return SyntheticBaseEvent;\n}\n\u002F**\n * @interface Event\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F\n *\u002F\n\n\nvar EventInterface = {\n eventPhase: 0,\n bubbles: 0,\n cancelable: 0,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: 0,\n isTrusted: 0\n};\nvar SyntheticEvent = createSyntheticEvent(EventInterface);\n\nvar UIEventInterface = _assign({}, EventInterface, {\n view: 0,\n detail: 0\n});\n\nvar SyntheticUIEvent = createSyntheticEvent(UIEventInterface);\nvar lastMovementX;\nvar lastMovementY;\nvar lastMouseEvent;\n\nfunction updateMouseMovementPolyfillState(event) {\n if (event !== lastMouseEvent) {\n if (lastMouseEvent && event.type === 'mousemove') {\n lastMovementX = event.screenX - lastMouseEvent.screenX;\n lastMovementY = event.screenY - lastMouseEvent.screenY;\n } else {\n lastMovementX = 0;\n lastMovementY = 0;\n }\n\n lastMouseEvent = event;\n }\n}\n\u002F**\n * @interface MouseEvent\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F\n *\u002F\n\n\nvar MouseEventInterface = _assign({}, UIEventInterface, {\n screenX: 0,\n screenY: 0,\n clientX: 0,\n clientY: 0,\n pageX: 0,\n pageY: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n getModifierState: getEventModifierState,\n button: 0,\n buttons: 0,\n relatedTarget: function (event) {\n if (event.relatedTarget === undefined) return event.fromElement === event.srcElement ? event.toElement : event.fromElement;\n return event.relatedTarget;\n },\n movementX: function (event) {\n if ('movementX' in event) {\n return event.movementX;\n }\n\n updateMouseMovementPolyfillState(event);\n return lastMovementX;\n },\n movementY: function (event) {\n if ('movementY' in event) {\n return event.movementY;\n } \u002F\u002F Don't need to call updateMouseMovementPolyfillState() here\n \u002F\u002F because it's guaranteed to have already run when movementX\n \u002F\u002F was copied.\n\n\n return lastMovementY;\n }\n});\n\nvar SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface);\n\u002F**\n * @interface DragEvent\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F\n *\u002F\n\nvar DragEventInterface = _assign({}, MouseEventInterface, {\n dataTransfer: 0\n});\n\nvar SyntheticDragEvent = createSyntheticEvent(DragEventInterface);\n\u002F**\n * @interface FocusEvent\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F\n *\u002F\n\nvar FocusEventInterface = _assign({}, UIEventInterface, {\n relatedTarget: 0\n});\n\nvar SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface);\n\u002F**\n * @interface Event\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002Fcss3-animations\u002F#AnimationEvent-interface\n * @see https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FAnimationEvent\n *\u002F\n\nvar AnimationEventInterface = _assign({}, EventInterface, {\n animationName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n});\n\nvar SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface);\n\u002F**\n * @interface Event\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002Fclipboard-apis\u002F\n *\u002F\n\nvar ClipboardEventInterface = _assign({}, EventInterface, {\n clipboardData: function (event) {\n return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n }\n});\n\nvar SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface);\n\u002F**\n * @interface Event\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F#events-compositionevents\n *\u002F\n\nvar CompositionEventInterface = _assign({}, EventInterface, {\n data: 0\n});\n\nvar SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface);\n\u002F**\n * @interface Event\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002F2013\u002FWD-DOM-Level-3-Events-20131105\n * \u002F#events-inputevents\n *\u002F\n\u002F\u002F Happens to share the same list for now.\n\nvar SyntheticInputEvent = SyntheticCompositionEvent;\n\u002F**\n * Normalization of deprecated HTML5 `key` values\n * @see https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FKeyboardEvent#Key_names\n *\u002F\n\nvar normalizeKey = {\n Esc: 'Escape',\n Spacebar: ' ',\n Left: 'ArrowLeft',\n Up: 'ArrowUp',\n Right: 'ArrowRight',\n Down: 'ArrowDown',\n Del: 'Delete',\n Win: 'OS',\n Menu: 'ContextMenu',\n Apps: 'ContextMenu',\n Scroll: 'ScrollLock',\n MozPrintableKey: 'Unidentified'\n};\n\u002F**\n * Translation from legacy `keyCode` to HTML5 `key`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FKeyboardEvent#Key_names\n *\u002F\n\nvar translateToKey = {\n '8': 'Backspace',\n '9': 'Tab',\n '12': 'Clear',\n '13': 'Enter',\n '16': 'Shift',\n '17': 'Control',\n '18': 'Alt',\n '19': 'Pause',\n '20': 'CapsLock',\n '27': 'Escape',\n '32': ' ',\n '33': 'PageUp',\n '34': 'PageDown',\n '35': 'End',\n '36': 'Home',\n '37': 'ArrowLeft',\n '38': 'ArrowUp',\n '39': 'ArrowRight',\n '40': 'ArrowDown',\n '45': 'Insert',\n '46': 'Delete',\n '112': 'F1',\n '113': 'F2',\n '114': 'F3',\n '115': 'F4',\n '116': 'F5',\n '117': 'F6',\n '118': 'F7',\n '119': 'F8',\n '120': 'F9',\n '121': 'F10',\n '122': 'F11',\n '123': 'F12',\n '144': 'NumLock',\n '145': 'ScrollLock',\n '224': 'Meta'\n};\n\u002F**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized `key` property.\n *\u002F\n\nfunction getEventKey(nativeEvent) {\n if (nativeEvent.key) {\n \u002F\u002F Normalize inconsistent values reported by browsers due to\n \u002F\u002F implementations of a working draft specification.\n \u002F\u002F FireFox implements `key` but returns `MozPrintableKey` for all\n \u002F\u002F printable characters (normalized to `Unidentified`), ignore it.\n var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n\n if (key !== 'Unidentified') {\n return key;\n }\n } \u002F\u002F Browser does not implement `key`, polyfill as much of it as we can.\n\n\n if (nativeEvent.type === 'keypress') {\n var charCode = getEventCharCode(nativeEvent); \u002F\u002F The enter-key is technically both printable and non-printable and can\n \u002F\u002F thus be captured by `keypress`, no other non-printable key should.\n\n return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n }\n\n if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n \u002F\u002F While user keyboard layout determines the actual meaning of each\n \u002F\u002F `keyCode` value, almost all function keys have a universal value.\n return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n }\n\n return '';\n}\n\u002F**\n * Translation from modifier key to the associated property in the event.\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F#keys-Modifiers\n *\u002F\n\n\nvar modifierKeyToProp = {\n Alt: 'altKey',\n Control: 'ctrlKey',\n Meta: 'metaKey',\n Shift: 'shiftKey'\n}; \u002F\u002F Older browsers (Safari \u003C= 10, iOS Safari \u003C= 10.2) do not support\n\u002F\u002F getModifierState. If getModifierState is not supported, we map it to a set of\n\u002F\u002F modifier keys exposed by the event. In this case, Lock-keys are not supported.\n\nfunction modifierStateGetter(keyArg) {\n var syntheticEvent = this;\n var nativeEvent = syntheticEvent.nativeEvent;\n\n if (nativeEvent.getModifierState) {\n return nativeEvent.getModifierState(keyArg);\n }\n\n var keyProp = modifierKeyToProp[keyArg];\n return keyProp ? !!nativeEvent[keyProp] : false;\n}\n\nfunction getEventModifierState(nativeEvent) {\n return modifierStateGetter;\n}\n\u002F**\n * @interface KeyboardEvent\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F\n *\u002F\n\n\nvar KeyboardEventInterface = _assign({}, UIEventInterface, {\n key: getEventKey,\n code: 0,\n location: 0,\n ctrlKey: 0,\n shiftKey: 0,\n altKey: 0,\n metaKey: 0,\n repeat: 0,\n locale: 0,\n getModifierState: getEventModifierState,\n \u002F\u002F Legacy Interface\n charCode: function (event) {\n \u002F\u002F `charCode` is the result of a KeyPress event and represents the value of\n \u002F\u002F the actual printable character.\n \u002F\u002F KeyPress is deprecated, but its replacement is not yet final and not\n \u002F\u002F implemented in any major browser. Only KeyPress has charCode.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n return 0;\n },\n keyCode: function (event) {\n \u002F\u002F `keyCode` is the result of a KeyDown\u002FUp event and represents the value of\n \u002F\u002F physical keyboard key.\n \u002F\u002F The actual meaning of the value depends on the users' keyboard layout\n \u002F\u002F which cannot be detected. Assuming that it is a US keyboard layout\n \u002F\u002F provides a surprisingly accurate mapping for US and European users.\n \u002F\u002F Due to this, it is left to the user to implement at this time.\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n },\n which: function (event) {\n \u002F\u002F `which` is an alias for either `keyCode` or `charCode` depending on the\n \u002F\u002F type of the event.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n }\n});\n\nvar SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface);\n\u002F**\n * @interface PointerEvent\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002Fpointerevents\u002F\n *\u002F\n\nvar PointerEventInterface = _assign({}, MouseEventInterface, {\n pointerId: 0,\n width: 0,\n height: 0,\n pressure: 0,\n tangentialPressure: 0,\n tiltX: 0,\n tiltY: 0,\n twist: 0,\n pointerType: 0,\n isPrimary: 0\n});\n\nvar SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface);\n\u002F**\n * @interface TouchEvent\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002Ftouch-events\u002F\n *\u002F\n\nvar TouchEventInterface = _assign({}, UIEventInterface, {\n touches: 0,\n targetTouches: 0,\n changedTouches: 0,\n altKey: 0,\n metaKey: 0,\n ctrlKey: 0,\n shiftKey: 0,\n getModifierState: getEventModifierState\n});\n\nvar SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface);\n\u002F**\n * @interface Event\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002F2009\u002FWD-css3-transitions-20090320\u002F#transition-events-\n * @see https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FAPI\u002FTransitionEvent\n *\u002F\n\nvar TransitionEventInterface = _assign({}, EventInterface, {\n propertyName: 0,\n elapsedTime: 0,\n pseudoElement: 0\n});\n\nvar SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface);\n\u002F**\n * @interface WheelEvent\n * @see http:\u002F\u002Fwww.w3.org\u002FTR\u002FDOM-Level-3-Events\u002F\n *\u002F\n\nvar WheelEventInterface = _assign({}, MouseEventInterface, {\n deltaX: function (event) {\n return 'deltaX' in event ? event.deltaX : \u002F\u002F Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).\n 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n },\n deltaY: function (event) {\n return 'deltaY' in event ? event.deltaY : \u002F\u002F Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).\n 'wheelDeltaY' in event ? -event.wheelDeltaY : \u002F\u002F Fallback to `wheelDelta` for IE\u003C9 and normalize (down is positive).\n 'wheelDelta' in event ? -event.wheelDelta : 0;\n },\n deltaZ: 0,\n \u002F\u002F Browsers without \"deltaMode\" is reporting in raw wheel delta where one\n \u002F\u002F notch on the scroll is always +\u002F- 120, roughly equivalent to pixels.\n \u002F\u002F A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n \u002F\u002F ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n deltaMode: 0\n});\n\nvar SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface);\n\nvar END_KEYCODES = [9, 13, 27, 32]; \u002F\u002F Tab, Return, Esc, Space\n\nvar START_KEYCODE = 229;\nvar canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window;\nvar documentMode = null;\n\nif (canUseDOM && 'documentMode' in document) {\n documentMode = document.documentMode;\n} \u002F\u002F Webkit offers a very useful `textInput` event that can be used to\n\u002F\u002F directly represent `beforeInput`. The IE `textinput` event is not as\n\u002F\u002F useful, so we don't use it.\n\n\nvar canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; \u002F\u002F In IE9+, we have access to composition events, but the data supplied\n\u002F\u002F by the native compositionend event may be incorrect. Japanese ideographic\n\u002F\u002F spaces, for instance (\\u3000) are not recorded correctly.\n\nvar useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode \u003E 8 && documentMode \u003C= 11);\nvar SPACEBAR_CODE = 32;\nvar SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE);\n\nfunction registerEvents() {\n registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']);\n registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n registerTwoPhaseEvent('onCompositionStart', ['compositionstart', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n registerTwoPhaseEvent('onCompositionUpdate', ['compositionupdate', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']);\n} \u002F\u002F Track whether we've ever handled a keypress on the space key.\n\n\nvar hasSpaceKeypress = false;\n\u002F**\n * Return whether a native keypress event is assumed to be a command.\n * This is required because Firefox fires `keypress` events for key commands\n * (cut, copy, select-all, etc.) even though no character is inserted.\n *\u002F\n\nfunction isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && \u002F\u002F ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n}\n\u002F**\n * Translate native top level events into event types.\n *\u002F\n\n\nfunction getCompositionEventType(domEventName) {\n switch (domEventName) {\n case 'compositionstart':\n return 'onCompositionStart';\n\n case 'compositionend':\n return 'onCompositionEnd';\n\n case 'compositionupdate':\n return 'onCompositionUpdate';\n }\n}\n\u002F**\n * Does our fallback best-guess model think this event signifies that\n * composition has begun?\n *\u002F\n\n\nfunction isFallbackCompositionStart(domEventName, nativeEvent) {\n return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE;\n}\n\u002F**\n * Does our fallback mode think that this event is the end of composition?\n *\u002F\n\n\nfunction isFallbackCompositionEnd(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'keyup':\n \u002F\u002F Command keys insert or clear IME input.\n return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;\n\n case 'keydown':\n \u002F\u002F Expect IME keyCode on each keydown. If we get any other\n \u002F\u002F code we must have exited earlier.\n return nativeEvent.keyCode !== START_KEYCODE;\n\n case 'keypress':\n case 'mousedown':\n case 'focusout':\n \u002F\u002F Events are not possible without cancelling IME.\n return true;\n\n default:\n return false;\n }\n}\n\u002F**\n * Google Input Tools provides composition data via a CustomEvent,\n * with the `data` property populated in the `detail` object. If this\n * is available on the event object, use it. If not, this is a plain\n * composition event and we have nothing special to extract.\n *\n * @param {object} nativeEvent\n * @return {?string}\n *\u002F\n\n\nfunction getDataFromCustomEvent(nativeEvent) {\n var detail = nativeEvent.detail;\n\n if (typeof detail === 'object' && 'data' in detail) {\n return detail.data;\n }\n\n return null;\n}\n\u002F**\n * Check if a composition event was triggered by Korean IME.\n * Our fallback mode does not work well with IE's Korean IME,\n * so just use native composition events when Korean IME is used.\n * Although CompositionEvent.locale property is deprecated,\n * it is available in IE, where our fallback mode is enabled.\n *\n * @param {object} nativeEvent\n * @return {boolean}\n *\u002F\n\n\nfunction isUsingKoreanIME(nativeEvent) {\n return nativeEvent.locale === 'ko';\n} \u002F\u002F Track the current IME composition status, if any.\n\n\nvar isComposing = false;\n\u002F**\n * @return {?object} A SyntheticCompositionEvent.\n *\u002F\n\nfunction extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {\n var eventType;\n var fallbackData;\n\n if (canUseCompositionEvent) {\n eventType = getCompositionEventType(domEventName);\n } else if (!isComposing) {\n if (isFallbackCompositionStart(domEventName, nativeEvent)) {\n eventType = 'onCompositionStart';\n }\n } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) {\n eventType = 'onCompositionEnd';\n }\n\n if (!eventType) {\n return null;\n }\n\n if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) {\n \u002F\u002F The current composition is stored statically and must not be\n \u002F\u002F overwritten while composition continues.\n if (!isComposing && eventType === 'onCompositionStart') {\n isComposing = initialize(nativeEventTarget);\n } else if (eventType === 'onCompositionEnd') {\n if (isComposing) {\n fallbackData = getData();\n }\n }\n }\n\n var listeners = accumulateTwoPhaseListeners(targetInst, eventType);\n\n if (listeners.length \u003E 0) {\n var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n\n if (fallbackData) {\n \u002F\u002F Inject data generated from fallback path into the synthetic event.\n \u002F\u002F This matches the property of native CompositionEventInterface.\n event.data = fallbackData;\n } else {\n var customData = getDataFromCustomEvent(nativeEvent);\n\n if (customData !== null) {\n event.data = customData;\n }\n }\n }\n}\n\nfunction getNativeBeforeInputChars(domEventName, nativeEvent) {\n switch (domEventName) {\n case 'compositionend':\n return getDataFromCustomEvent(nativeEvent);\n\n case 'keypress':\n \u002F**\n * If native `textInput` events are available, our goal is to make\n * use of them. However, there is a special case: the spacebar key.\n * In Webkit, preventing default on a spacebar `textInput` event\n * cancels character insertion, but it *also* causes the browser\n * to fall back to its default spacebar behavior of scrolling the\n * page.\n *\n * Tracking at:\n * https:\u002F\u002Fcode.google.com\u002Fp\u002Fchromium\u002Fissues\u002Fdetail?id=355103\n *\n * To avoid this issue, use the keypress event as if no `textInput`\n * event is available.\n *\u002F\n var which = nativeEvent.which;\n\n if (which !== SPACEBAR_CODE) {\n return null;\n }\n\n hasSpaceKeypress = true;\n return SPACEBAR_CHAR;\n\n case 'textInput':\n \u002F\u002F Record the characters to be added to the DOM.\n var chars = nativeEvent.data; \u002F\u002F If it's a spacebar character, assume that we have already handled\n \u002F\u002F it at the keypress level and bail immediately. Android Chrome\n \u002F\u002F doesn't give us keycodes, so we need to ignore it.\n\n if (chars === SPACEBAR_CHAR && hasSpaceKeypress) {\n return null;\n }\n\n return chars;\n\n default:\n \u002F\u002F For other native event types, do nothing.\n return null;\n }\n}\n\u002F**\n * For browsers that do not provide the `textInput` event, extract the\n * appropriate string to use for SyntheticInputEvent.\n *\u002F\n\n\nfunction getFallbackBeforeInputChars(domEventName, nativeEvent) {\n \u002F\u002F If we are currently composing (IME) and using a fallback to do so,\n \u002F\u002F try to extract the composed characters from the fallback object.\n \u002F\u002F If composition event is available, we extract a string only at\n \u002F\u002F compositionevent, otherwise extract it at fallback events.\n if (isComposing) {\n if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) {\n var chars = getData();\n reset();\n isComposing = false;\n return chars;\n }\n\n return null;\n }\n\n switch (domEventName) {\n case 'paste':\n \u002F\u002F If a paste event occurs after a keypress, throw out the input\n \u002F\u002F chars. Paste events should not lead to BeforeInput events.\n return null;\n\n case 'keypress':\n \u002F**\n * As of v27, Firefox may fire keypress events even when no character\n * will be inserted. A few possibilities:\n *\n * - `which` is `0`. Arrow keys, Esc key, etc.\n *\n * - `which` is the pressed key code, but no char is available.\n * Ex: 'AltGr + d` in Polish. There is no modified character for\n * this key combination and no character is inserted into the\n * document, but FF fires the keypress for char code `100` anyway.\n * No `input` event will occur.\n *\n * - `which` is the pressed key code, but a command combination is\n * being used. Ex: `Cmd+C`. No character is inserted, and no\n * `input` event will occur.\n *\u002F\n if (!isKeypressCommand(nativeEvent)) {\n \u002F\u002F IE fires the `keypress` event when a user types an emoji via\n \u002F\u002F Touch keyboard of Windows. In such a case, the `char` property\n \u002F\u002F holds an emoji character like `\\uD83D\\uDE0A`. Because its length\n \u002F\u002F is 2, the property `which` does not represent an emoji correctly.\n \u002F\u002F In such a case, we directly return the `char` property instead of\n \u002F\u002F using `which`.\n if (nativeEvent.char && nativeEvent.char.length \u003E 1) {\n return nativeEvent.char;\n } else if (nativeEvent.which) {\n return String.fromCharCode(nativeEvent.which);\n }\n }\n\n return null;\n\n case 'compositionend':\n return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data;\n\n default:\n return null;\n }\n}\n\u002F**\n * Extract a SyntheticInputEvent for `beforeInput`, based on either native\n * `textInput` or fallback behavior.\n *\n * @return {?object} A SyntheticInputEvent.\n *\u002F\n\n\nfunction extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) {\n var chars;\n\n if (canUseTextInputEvent) {\n chars = getNativeBeforeInputChars(domEventName, nativeEvent);\n } else {\n chars = getFallbackBeforeInputChars(domEventName, nativeEvent);\n } \u002F\u002F If no characters are being inserted, no BeforeInput event should\n \u002F\u002F be fired.\n\n\n if (!chars) {\n return null;\n }\n\n var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput');\n\n if (listeners.length \u003E 0) {\n var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n event.data = chars;\n }\n}\n\u002F**\n * Create an `onBeforeInput` event to match\n * http:\u002F\u002Fwww.w3.org\u002FTR\u002F2013\u002FWD-DOM-Level-3-Events-20131105\u002F#events-inputevents.\n *\n * This event plugin is based on the native `textInput` event\n * available in Chrome, Safari, Opera, and IE. This event fires after\n * `onKeyPress` and `onCompositionEnd`, but before `onInput`.\n *\n * `beforeInput` is spec'd but not implemented in any browsers, and\n * the `input` event does not provide any useful information about what has\n * actually been added, contrary to the spec. Thus, `textInput` is the best\n * available event to identify the characters that have actually been inserted\n * into the target node.\n *\n * This plugin is also responsible for emitting `composition` events, thus\n * allowing us to share composition fallback code for both `beforeInput` and\n * `composition` event types.\n *\u002F\n\n\nfunction extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n}\n\n\u002F**\n * @see http:\u002F\u002Fwww.whatwg.org\u002Fspecs\u002Fweb-apps\u002Fcurrent-work\u002Fmultipage\u002Fthe-input-element.html#input-type-attr-summary\n *\u002F\nvar supportedInputTypes = {\n color: true,\n date: true,\n datetime: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n password: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true\n};\n\nfunction isTextInputElement(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n\n if (nodeName === 'input') {\n return !!supportedInputTypes[elem.type];\n }\n\n if (nodeName === 'textarea') {\n return true;\n }\n\n return false;\n}\n\n\u002F**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n *\u002F\n\nfunction isEventSupported(eventNameSuffix) {\n if (!canUseDOM) {\n return false;\n }\n\n var eventName = 'on' + eventNameSuffix;\n var isSupported = (eventName in document);\n\n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n\n return isSupported;\n}\n\nfunction registerEvents$1() {\n registerTwoPhaseEvent('onChange', ['change', 'click', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'selectionchange']);\n}\n\nfunction createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) {\n \u002F\u002F Flag this event loop as needing state restore.\n enqueueStateRestore(target);\n var listeners = accumulateTwoPhaseListeners(inst, 'onChange');\n\n if (listeners.length \u003E 0) {\n var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n }\n}\n\u002F**\n * For IE shims\n *\u002F\n\n\nvar activeElement = null;\nvar activeElementInst = null;\n\u002F**\n * SECTION: handle `change` event\n *\u002F\n\nfunction shouldUseChangeEvent(elem) {\n var nodeName = elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName === 'select' || nodeName === 'input' && elem.type === 'file';\n}\n\nfunction manualDispatchChangeEvent(nativeEvent) {\n var dispatchQueue = [];\n createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); \u002F\u002F If change and propertychange bubbled, we'd just bind to it like all the\n \u002F\u002F other events and have it go through ReactBrowserEventEmitter. Since it\n \u002F\u002F doesn't, we manually listen for the events and so we have to enqueue and\n \u002F\u002F process the abstract event manually.\n \u002F\u002F\n \u002F\u002F Batching is necessary here in order to ensure that all event handlers run\n \u002F\u002F before the next rerender (including event handlers attached to ancestor\n \u002F\u002F elements instead of directly on the input). Without this, controlled\n \u002F\u002F components don't work properly in conjunction with event bubbling because\n \u002F\u002F the component is rerendered and the value reverted before all the event\n \u002F\u002F handlers can run. See https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F708.\n\n batchedUpdates(runEventInBatch, dispatchQueue);\n}\n\nfunction runEventInBatch(dispatchQueue) {\n processDispatchQueue(dispatchQueue, 0);\n}\n\nfunction getInstIfValueChanged(targetInst) {\n var targetNode = getNodeFromInstance(targetInst);\n\n if (updateValueIfChanged(targetNode)) {\n return targetInst;\n }\n}\n\nfunction getTargetInstForChangeEvent(domEventName, targetInst) {\n if (domEventName === 'change') {\n return targetInst;\n }\n}\n\u002F**\n * SECTION: handle `input` event\n *\u002F\n\n\nvar isInputEventSupported = false;\n\nif (canUseDOM) {\n \u002F\u002F IE9 claims to support the input event but fails to trigger it when\n \u002F\u002F deleting text, so we ignore its input events.\n isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode \u003E 9);\n}\n\u002F**\n * (For IE \u003C=9) Starts tracking propertychange events on the passed-in element\n * and override the value property so that we can distinguish user events from\n * value changes in JS.\n *\u002F\n\n\nfunction startWatchingForValueChange(target, targetInst) {\n activeElement = target;\n activeElementInst = targetInst;\n activeElement.attachEvent('onpropertychange', handlePropertyChange);\n}\n\u002F**\n * (For IE \u003C=9) Removes the event listeners from the currently-tracked element,\n * if any exists.\n *\u002F\n\n\nfunction stopWatchingForValueChange() {\n if (!activeElement) {\n return;\n }\n\n activeElement.detachEvent('onpropertychange', handlePropertyChange);\n activeElement = null;\n activeElementInst = null;\n}\n\u002F**\n * (For IE \u003C=9) Handles a propertychange event, sending a `change` event if\n * the value of the active element has changed.\n *\u002F\n\n\nfunction handlePropertyChange(nativeEvent) {\n if (nativeEvent.propertyName !== 'value') {\n return;\n }\n\n if (getInstIfValueChanged(activeElementInst)) {\n manualDispatchChangeEvent(nativeEvent);\n }\n}\n\nfunction handleEventsForInputEventPolyfill(domEventName, target, targetInst) {\n if (domEventName === 'focusin') {\n \u002F\u002F In IE9, propertychange fires for most input events but is buggy and\n \u002F\u002F doesn't fire when text is deleted, but conveniently, selectionchange\n \u002F\u002F appears to fire in all of the remaining cases so we catch those and\n \u002F\u002F forward the event if the value has changed\n \u002F\u002F In either case, we don't want to call the event handler if the value\n \u002F\u002F is changed from JS so we redefine a setter for `.value` that updates\n \u002F\u002F our activeElementValue variable, allowing us to ignore those changes\n \u002F\u002F\n \u002F\u002F stopWatching() should be a noop here but we call it just in case we\n \u002F\u002F missed a blur event somehow.\n stopWatchingForValueChange();\n startWatchingForValueChange(target, targetInst);\n } else if (domEventName === 'focusout') {\n stopWatchingForValueChange();\n }\n} \u002F\u002F For IE8 and IE9.\n\n\nfunction getTargetInstForInputEventPolyfill(domEventName, targetInst) {\n if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') {\n \u002F\u002F On the selectionchange event, the target is just document which isn't\n \u002F\u002F helpful for us so just check activeElement instead.\n \u002F\u002F\n \u002F\u002F 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire\n \u002F\u002F propertychange on the first input event after setting `value` from a\n \u002F\u002F script and fires only keydown, keypress, keyup. Catching keyup usually\n \u002F\u002F gets it and catching keydown lets us fire an event for the first\n \u002F\u002F keystroke if user does a key repeat (it'll be a little delayed: right\n \u002F\u002F before the second keystroke). Other input methods (e.g., paste) seem to\n \u002F\u002F fire selectionchange normally.\n return getInstIfValueChanged(activeElementInst);\n }\n}\n\u002F**\n * SECTION: handle `click` event\n *\u002F\n\n\nfunction shouldUseClickEvent(elem) {\n \u002F\u002F Use the `click` event to detect changes to checkbox and radio inputs.\n \u002F\u002F This approach works across all browsers, whereas `change` does not fire\n \u002F\u002F until `blur` in IE8.\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio');\n}\n\nfunction getTargetInstForClickEvent(domEventName, targetInst) {\n if (domEventName === 'click') {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction getTargetInstForInputOrChangeEvent(domEventName, targetInst) {\n if (domEventName === 'input' || domEventName === 'change') {\n return getInstIfValueChanged(targetInst);\n }\n}\n\nfunction handleControlledInputBlur(node) {\n var state = node._wrapperState;\n\n if (!state || !state.controlled || node.type !== 'number') {\n return;\n }\n\n {\n \u002F\u002F If controlled, assign the value attribute to the current value on blur\n setDefaultValue(node, 'number', node.value);\n }\n}\n\u002F**\n * This plugin creates an `onChange` event that normalizes change events\n * across form elements. This event fires at a time when it's possible to\n * change the element's value without seeing a flicker.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - select\n *\u002F\n\n\nfunction extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n var getTargetInstFunc, handleEventFunc;\n\n if (shouldUseChangeEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForChangeEvent;\n } else if (isTextInputElement(targetNode)) {\n if (isInputEventSupported) {\n getTargetInstFunc = getTargetInstForInputOrChangeEvent;\n } else {\n getTargetInstFunc = getTargetInstForInputEventPolyfill;\n handleEventFunc = handleEventsForInputEventPolyfill;\n }\n } else if (shouldUseClickEvent(targetNode)) {\n getTargetInstFunc = getTargetInstForClickEvent;\n }\n\n if (getTargetInstFunc) {\n var inst = getTargetInstFunc(domEventName, targetInst);\n\n if (inst) {\n createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget);\n return;\n }\n }\n\n if (handleEventFunc) {\n handleEventFunc(domEventName, targetNode, targetInst);\n } \u002F\u002F When blurring, set the value attribute for number inputs\n\n\n if (domEventName === 'focusout') {\n handleControlledInputBlur(targetNode);\n }\n}\n\nfunction registerEvents$2() {\n registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']);\n registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']);\n registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']);\n registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']);\n}\n\u002F**\n * For almost every interaction we care about, there will be both a top-level\n * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that\n * we do not extract duplicate events. However, moving the mouse into the\n * browser from outside will not fire a `mouseout` event. In this case, we use\n * the `mouseover` top-level event.\n *\u002F\n\n\nfunction extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover';\n var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout';\n\n if (isOverEvent && (eventSystemFlags & IS_REPLAYED) === 0) {\n \u002F\u002F If this is an over event with a target, we might have already dispatched\n \u002F\u002F the event in the out event of the other target. If this is replayed,\n \u002F\u002F then it's because we couldn't dispatch against this target previously\n \u002F\u002F so we have to do it now instead.\n var related = nativeEvent.relatedTarget || nativeEvent.fromElement;\n\n if (related) {\n \u002F\u002F If the related node is managed by React, we can assume that we have\n \u002F\u002F already dispatched the corresponding events during its mouseout.\n if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) {\n return;\n }\n }\n }\n\n if (!isOutEvent && !isOverEvent) {\n \u002F\u002F Must not be a mouse or pointer in or out - ignoring.\n return;\n }\n\n var win; \u002F\u002F TODO: why is this nullable in the types but we read from it?\n\n if (nativeEventTarget.window === nativeEventTarget) {\n \u002F\u002F `nativeEventTarget` is probably a window object.\n win = nativeEventTarget;\n } else {\n \u002F\u002F TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.\n var doc = nativeEventTarget.ownerDocument;\n\n if (doc) {\n win = doc.defaultView || doc.parentWindow;\n } else {\n win = window;\n }\n }\n\n var from;\n var to;\n\n if (isOutEvent) {\n var _related = nativeEvent.relatedTarget || nativeEvent.toElement;\n\n from = targetInst;\n to = _related ? getClosestInstanceFromNode(_related) : null;\n\n if (to !== null) {\n var nearestMounted = getNearestMountedFiber(to);\n\n if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) {\n to = null;\n }\n }\n } else {\n \u002F\u002F Moving to a node from outside the window.\n from = null;\n to = targetInst;\n }\n\n if (from === to) {\n \u002F\u002F Nothing pertains to our managed components.\n return;\n }\n\n var SyntheticEventCtor = SyntheticMouseEvent;\n var leaveEventType = 'onMouseLeave';\n var enterEventType = 'onMouseEnter';\n var eventTypePrefix = 'mouse';\n\n if (domEventName === 'pointerout' || domEventName === 'pointerover') {\n SyntheticEventCtor = SyntheticPointerEvent;\n leaveEventType = 'onPointerLeave';\n enterEventType = 'onPointerEnter';\n eventTypePrefix = 'pointer';\n }\n\n var fromNode = from == null ? win : getNodeFromInstance(from);\n var toNode = to == null ? win : getNodeFromInstance(to);\n var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget);\n leave.target = fromNode;\n leave.relatedTarget = toNode;\n var enter = null; \u002F\u002F We should only process this nativeEvent if we are processing\n \u002F\u002F the first ancestor. Next time, we will ignore the event.\n\n var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (nativeTargetInst === targetInst) {\n var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget);\n enterEvent.target = toNode;\n enterEvent.relatedTarget = fromNode;\n enter = enterEvent;\n }\n\n accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to);\n}\n\n\u002F**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FGlobal_Objects\u002FObject\u002Fis\n *\u002F\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 \u002F x === 1 \u002F y) || x !== x && y !== y \u002F\u002F eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\nvar hasOwnProperty$2 = Object.prototype.hasOwnProperty;\n\u002F**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n *\u002F\n\nfunction shallowEqual(objA, objB) {\n if (objectIs(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n } \u002F\u002F Test for A's keys different from B.\n\n\n for (var i = 0; i \u003C keysA.length; i++) {\n if (!hasOwnProperty$2.call(objB, keysA[i]) || !objectIs(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}\n\n\u002F**\n * Given any node return the first leaf node without children.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {DOMElement|DOMTextNode}\n *\u002F\n\nfunction getLeafNode(node) {\n while (node && node.firstChild) {\n node = node.firstChild;\n }\n\n return node;\n}\n\u002F**\n * Get the next sibling within a container. This will walk up the\n * DOM if a node's siblings have been exhausted.\n *\n * @param {DOMElement|DOMTextNode} node\n * @return {?DOMElement|DOMTextNode}\n *\u002F\n\n\nfunction getSiblingNode(node) {\n while (node) {\n if (node.nextSibling) {\n return node.nextSibling;\n }\n\n node = node.parentNode;\n }\n}\n\u002F**\n * Get object describing the nodes which contain characters at offset.\n *\n * @param {DOMElement|DOMTextNode} root\n * @param {number} offset\n * @return {?object}\n *\u002F\n\n\nfunction getNodeForCharacterOffset(root, offset) {\n var node = getLeafNode(root);\n var nodeStart = 0;\n var nodeEnd = 0;\n\n while (node) {\n if (node.nodeType === TEXT_NODE) {\n nodeEnd = nodeStart + node.textContent.length;\n\n if (nodeStart \u003C= offset && nodeEnd \u003E= offset) {\n return {\n node: node,\n offset: offset - nodeStart\n };\n }\n\n nodeStart = nodeEnd;\n }\n\n node = getLeafNode(getSiblingNode(node));\n }\n}\n\n\u002F**\n * @param {DOMElement} outerNode\n * @return {?object}\n *\u002F\n\nfunction getOffsets(outerNode) {\n var ownerDocument = outerNode.ownerDocument;\n var win = ownerDocument && ownerDocument.defaultView || window;\n var selection = win.getSelection && win.getSelection();\n\n if (!selection || selection.rangeCount === 0) {\n return null;\n }\n\n var anchorNode = selection.anchorNode,\n anchorOffset = selection.anchorOffset,\n focusNode = selection.focusNode,\n focusOffset = selection.focusOffset; \u002F\u002F In Firefox, anchorNode and focusNode can be \"anonymous divs\", e.g. the\n \u002F\u002F up\u002Fdown buttons on an \u003Cinput type=\"number\"\u003E. Anonymous divs do not seem to\n \u002F\u002F expose properties, triggering a \"Permission denied error\" if any of its\n \u002F\u002F properties are accessed. The only seemingly possible way to avoid erroring\n \u002F\u002F is to access a property that typically works for non-anonymous divs and\n \u002F\u002F catch any error that may otherwise arise. See\n \u002F\u002F https:\u002F\u002Fbugzilla.mozilla.org\u002Fshow_bug.cgi?id=208427\n\n try {\n \u002F* eslint-disable no-unused-expressions *\u002F\n anchorNode.nodeType;\n focusNode.nodeType;\n \u002F* eslint-enable no-unused-expressions *\u002F\n } catch (e) {\n return null;\n }\n\n return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset);\n}\n\u002F**\n * Returns {start, end} where `start` is the character\u002Fcodepoint index of\n * (anchorNode, anchorOffset) within the textContent of `outerNode`, and\n * `end` is the index of (focusNode, focusOffset).\n *\n * Returns null if you pass in garbage input but we should probably just crash.\n *\n * Exported only for testing.\n *\u002F\n\nfunction getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) {\n var length = 0;\n var start = -1;\n var end = -1;\n var indexWithinAnchor = 0;\n var indexWithinFocus = 0;\n var node = outerNode;\n var parentNode = null;\n\n outer: while (true) {\n var next = null;\n\n while (true) {\n if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) {\n start = length + anchorOffset;\n }\n\n if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) {\n end = length + focusOffset;\n }\n\n if (node.nodeType === TEXT_NODE) {\n length += node.nodeValue.length;\n }\n\n if ((next = node.firstChild) === null) {\n break;\n } \u002F\u002F Moving from `node` to its first child `next`.\n\n\n parentNode = node;\n node = next;\n }\n\n while (true) {\n if (node === outerNode) {\n \u002F\u002F If `outerNode` has children, this is always the second time visiting\n \u002F\u002F it. If it has no children, this is still the first loop, and the only\n \u002F\u002F valid selection is anchorNode and focusNode both equal to this node\n \u002F\u002F and both offsets 0, in which case we will have handled above.\n break outer;\n }\n\n if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) {\n start = length;\n }\n\n if (parentNode === focusNode && ++indexWithinFocus === focusOffset) {\n end = length;\n }\n\n if ((next = node.nextSibling) !== null) {\n break;\n }\n\n node = parentNode;\n parentNode = node.parentNode;\n } \u002F\u002F Moving from `node` to its next sibling `next`.\n\n\n node = next;\n }\n\n if (start === -1 || end === -1) {\n \u002F\u002F This should never happen. (Would happen if the anchor\u002Ffocus nodes aren't\n \u002F\u002F actually inside the passed-in node.)\n return null;\n }\n\n return {\n start: start,\n end: end\n };\n}\n\u002F**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programmatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n *\n * @param {DOMElement|DOMTextNode} node\n * @param {object} offsets\n *\u002F\n\nfunction setOffsets(node, offsets) {\n var doc = node.ownerDocument || document;\n var win = doc && doc.defaultView || window; \u002F\u002F Edge fails with \"Object expected\" in some scenarios.\n \u002F\u002F (For instance: TinyMCE editor used in a list component that supports pasting to add more,\n \u002F\u002F fails when pasting 100+ items)\n\n if (!win.getSelection) {\n return;\n }\n\n var selection = win.getSelection();\n var length = node.textContent.length;\n var start = Math.min(offsets.start, length);\n var end = offsets.end === undefined ? start : Math.min(offsets.end, length); \u002F\u002F IE 11 uses modern selection, but doesn't support the extend method.\n \u002F\u002F Flip backward selections, so we can set with a single range.\n\n if (!selection.extend && start \u003E end) {\n var temp = end;\n end = start;\n start = temp;\n }\n\n var startMarker = getNodeForCharacterOffset(node, start);\n var endMarker = getNodeForCharacterOffset(node, end);\n\n if (startMarker && endMarker) {\n if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) {\n return;\n }\n\n var range = doc.createRange();\n range.setStart(startMarker.node, startMarker.offset);\n selection.removeAllRanges();\n\n if (start \u003E end) {\n selection.addRange(range);\n selection.extend(endMarker.node, endMarker.offset);\n } else {\n range.setEnd(endMarker.node, endMarker.offset);\n selection.addRange(range);\n }\n }\n}\n\nfunction isTextNode(node) {\n return node && node.nodeType === TEXT_NODE;\n}\n\nfunction containsNode(outerNode, innerNode) {\n if (!outerNode || !innerNode) {\n return false;\n } else if (outerNode === innerNode) {\n return true;\n } else if (isTextNode(outerNode)) {\n return false;\n } else if (isTextNode(innerNode)) {\n return containsNode(outerNode, innerNode.parentNode);\n } else if ('contains' in outerNode) {\n return outerNode.contains(innerNode);\n } else if (outerNode.compareDocumentPosition) {\n return !!(outerNode.compareDocumentPosition(innerNode) & 16);\n } else {\n return false;\n }\n}\n\nfunction isInDocument(node) {\n return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node);\n}\n\nfunction isSameOriginFrame(iframe) {\n try {\n \u002F\u002F Accessing the contentDocument of a HTMLIframeElement can cause the browser\n \u002F\u002F to throw, e.g. if it has a cross-origin src attribute.\n \u002F\u002F Safari will show an error in the console when the access results in \"Blocked a frame with origin\". e.g:\n \u002F\u002F iframe.contentDocument.defaultView;\n \u002F\u002F A safety way is to access one of the cross origin properties: Window or Location\n \u002F\u002F Which might result in \"SecurityError\" DOM Exception and it is compatible to Safari.\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fbrowsers.html#integration-with-idl\n return typeof iframe.contentWindow.location.href === 'string';\n } catch (err) {\n return false;\n }\n}\n\nfunction getActiveElementDeep() {\n var win = window;\n var element = getActiveElement();\n\n while (element instanceof win.HTMLIFrameElement) {\n if (isSameOriginFrame(element)) {\n win = element.contentWindow;\n } else {\n return element;\n }\n\n element = getActiveElement(win.document);\n }\n\n return element;\n}\n\u002F**\n * @ReactInputSelection: React input selection module. Based on Selection.js,\n * but modified to be suitable for react and has a couple of bug fixes (doesn't\n * assume buttons have range selections allowed).\n * Input selection module for React.\n *\u002F\n\n\u002F**\n * @hasSelectionCapabilities: we get the element types that support selection\n * from https:\u002F\u002Fhtml.spec.whatwg.org\u002F#do-not-apply, looking at `selectionStart`\n * and `selectionEnd` rows.\n *\u002F\n\n\nfunction hasSelectionCapabilities(elem) {\n var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase();\n return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true');\n}\nfunction getSelectionInformation() {\n var focusedElem = getActiveElementDeep();\n return {\n focusedElem: focusedElem,\n selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null\n };\n}\n\u002F**\n * @restoreSelection: If any selection information was potentially lost,\n * restore it. This is useful when performing operations that could remove dom\n * nodes and place them back in, resulting in focus being lost.\n *\u002F\n\nfunction restoreSelection(priorSelectionInformation) {\n var curFocusedElem = getActiveElementDeep();\n var priorFocusedElem = priorSelectionInformation.focusedElem;\n var priorSelectionRange = priorSelectionInformation.selectionRange;\n\n if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) {\n if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) {\n setSelection(priorFocusedElem, priorSelectionRange);\n } \u002F\u002F Focusing a node can change the scroll position, which is undesirable\n\n\n var ancestors = [];\n var ancestor = priorFocusedElem;\n\n while (ancestor = ancestor.parentNode) {\n if (ancestor.nodeType === ELEMENT_NODE) {\n ancestors.push({\n element: ancestor,\n left: ancestor.scrollLeft,\n top: ancestor.scrollTop\n });\n }\n }\n\n if (typeof priorFocusedElem.focus === 'function') {\n priorFocusedElem.focus();\n }\n\n for (var i = 0; i \u003C ancestors.length; i++) {\n var info = ancestors[i];\n info.element.scrollLeft = info.left;\n info.element.scrollTop = info.top;\n }\n }\n}\n\u002F**\n * @getSelection: Gets the selection bounds of a focused textarea, input or\n * contentEditable node.\n * -@input: Look up selection bounds of this input\n * -@return {start: selectionStart, end: selectionEnd}\n *\u002F\n\nfunction getSelection(input) {\n var selection;\n\n if ('selectionStart' in input) {\n \u002F\u002F Modern browser with input or textarea.\n selection = {\n start: input.selectionStart,\n end: input.selectionEnd\n };\n } else {\n \u002F\u002F Content editable or old IE textarea.\n selection = getOffsets(input);\n }\n\n return selection || {\n start: 0,\n end: 0\n };\n}\n\u002F**\n * @setSelection: Sets the selection bounds of a textarea or input and focuses\n * the input.\n * -@input Set selection bounds of this input or textarea\n * -@offsets Object of same form that is returned from get*\n *\u002F\n\nfunction setSelection(input, offsets) {\n var start = offsets.start;\n var end = offsets.end;\n\n if (end === undefined) {\n end = start;\n }\n\n if ('selectionStart' in input) {\n input.selectionStart = start;\n input.selectionEnd = Math.min(end, input.value.length);\n } else {\n setOffsets(input, offsets);\n }\n}\n\nvar skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode \u003C= 11;\n\nfunction registerEvents$3() {\n registerTwoPhaseEvent('onSelect', ['focusout', 'contextmenu', 'dragend', 'focusin', 'keydown', 'keyup', 'mousedown', 'mouseup', 'selectionchange']);\n}\n\nvar activeElement$1 = null;\nvar activeElementInst$1 = null;\nvar lastSelection = null;\nvar mouseDown = false;\n\u002F**\n * Get an object which is a unique representation of the current selection.\n *\n * The return value will not be consistent across nodes or browsers, but\n * two identical selections on the same node will return identical objects.\n *\u002F\n\nfunction getSelection$1(node) {\n if ('selectionStart' in node && hasSelectionCapabilities(node)) {\n return {\n start: node.selectionStart,\n end: node.selectionEnd\n };\n } else {\n var win = node.ownerDocument && node.ownerDocument.defaultView || window;\n var selection = win.getSelection();\n return {\n anchorNode: selection.anchorNode,\n anchorOffset: selection.anchorOffset,\n focusNode: selection.focusNode,\n focusOffset: selection.focusOffset\n };\n }\n}\n\u002F**\n * Get document associated with the event target.\n *\u002F\n\n\nfunction getEventTargetDocument(eventTarget) {\n return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument;\n}\n\u002F**\n * Poll selection to see whether it's changed.\n *\n * @param {object} nativeEvent\n * @param {object} nativeEventTarget\n * @return {?SyntheticEvent}\n *\u002F\n\n\nfunction constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) {\n \u002F\u002F Ensure we have the right element, and that the user is not dragging a\n \u002F\u002F selection (this matches native `select` event behavior). In HTML5, select\n \u002F\u002F fires only on input and textarea thus if there's no focused element we\n \u002F\u002F won't dispatch.\n var doc = getEventTargetDocument(nativeEventTarget);\n\n if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) {\n return;\n } \u002F\u002F Only fire when selection has actually changed.\n\n\n var currentSelection = getSelection$1(activeElement$1);\n\n if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) {\n lastSelection = currentSelection;\n var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect');\n\n if (listeners.length \u003E 0) {\n var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget);\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n event.target = activeElement$1;\n }\n }\n}\n\u002F**\n * This plugin creates an `onSelect` event that normalizes select events\n * across form elements.\n *\n * Supported elements are:\n * - input (see `isTextInputElement`)\n * - textarea\n * - contentEditable\n *\n * This differs from native browser implementations in the following ways:\n * - Fires on contentEditable fields as well as inputs.\n * - Fires for collapsed selection.\n * - Fires after user input.\n *\u002F\n\n\nfunction extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n\n var targetNode = targetInst ? getNodeFromInstance(targetInst) : window;\n\n switch (domEventName) {\n \u002F\u002F Track the input node that has focus.\n case 'focusin':\n if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') {\n activeElement$1 = targetNode;\n activeElementInst$1 = targetInst;\n lastSelection = null;\n }\n\n break;\n\n case 'focusout':\n activeElement$1 = null;\n activeElementInst$1 = null;\n lastSelection = null;\n break;\n \u002F\u002F Don't fire the event while the user is dragging. This matches the\n \u002F\u002F semantics of the native select event.\n\n case 'mousedown':\n mouseDown = true;\n break;\n\n case 'contextmenu':\n case 'mouseup':\n case 'dragend':\n mouseDown = false;\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n break;\n \u002F\u002F Chrome and IE fire non-standard event when selection is changed (and\n \u002F\u002F sometimes when it hasn't). IE's event fires out of order with respect\n \u002F\u002F to key and input events on deletion, so we discard it.\n \u002F\u002F\n \u002F\u002F Firefox doesn't support selectionchange, so check selection status\n \u002F\u002F after each key entry. The selection changes after keydown and before\n \u002F\u002F keyup, but we check on keydown as well in the case of holding down a\n \u002F\u002F key, when multiple keydown events are fired but only one keyup is.\n \u002F\u002F This is also our approach for IE handling, for the reason above.\n\n case 'selectionchange':\n if (skipSelectionChangeEvent) {\n break;\n }\n\n \u002F\u002F falls through\n\n case 'keydown':\n case 'keyup':\n constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget);\n }\n}\n\nfunction extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n var reactName = topLevelEventsToReactNames.get(domEventName);\n\n if (reactName === undefined) {\n return;\n }\n\n var SyntheticEventCtor = SyntheticEvent;\n var reactEventType = domEventName;\n\n switch (domEventName) {\n case 'keypress':\n \u002F\u002F Firefox creates a keypress event for function keys too. This removes\n \u002F\u002F the unwanted keypress events. Enter is however both printable and\n \u002F\u002F non-printable. One would expect Tab to be as well (but it isn't).\n if (getEventCharCode(nativeEvent) === 0) {\n return;\n }\n\n \u002F* falls through *\u002F\n\n case 'keydown':\n case 'keyup':\n SyntheticEventCtor = SyntheticKeyboardEvent;\n break;\n\n case 'focusin':\n reactEventType = 'focus';\n SyntheticEventCtor = SyntheticFocusEvent;\n break;\n\n case 'focusout':\n reactEventType = 'blur';\n SyntheticEventCtor = SyntheticFocusEvent;\n break;\n\n case 'beforeblur':\n case 'afterblur':\n SyntheticEventCtor = SyntheticFocusEvent;\n break;\n\n case 'click':\n \u002F\u002F Firefox creates a click event on right mouse clicks. This removes the\n \u002F\u002F unwanted click events.\n if (nativeEvent.button === 2) {\n return;\n }\n\n \u002F* falls through *\u002F\n\n case 'auxclick':\n case 'dblclick':\n case 'mousedown':\n case 'mousemove':\n case 'mouseup': \u002F\u002F TODO: Disabled elements should not respond to mouse events\n\n \u002F* falls through *\u002F\n\n case 'mouseout':\n case 'mouseover':\n case 'contextmenu':\n SyntheticEventCtor = SyntheticMouseEvent;\n break;\n\n case 'drag':\n case 'dragend':\n case 'dragenter':\n case 'dragexit':\n case 'dragleave':\n case 'dragover':\n case 'dragstart':\n case 'drop':\n SyntheticEventCtor = SyntheticDragEvent;\n break;\n\n case 'touchcancel':\n case 'touchend':\n case 'touchmove':\n case 'touchstart':\n SyntheticEventCtor = SyntheticTouchEvent;\n break;\n\n case ANIMATION_END:\n case ANIMATION_ITERATION:\n case ANIMATION_START:\n SyntheticEventCtor = SyntheticAnimationEvent;\n break;\n\n case TRANSITION_END:\n SyntheticEventCtor = SyntheticTransitionEvent;\n break;\n\n case 'scroll':\n SyntheticEventCtor = SyntheticUIEvent;\n break;\n\n case 'wheel':\n SyntheticEventCtor = SyntheticWheelEvent;\n break;\n\n case 'copy':\n case 'cut':\n case 'paste':\n SyntheticEventCtor = SyntheticClipboardEvent;\n break;\n\n case 'gotpointercapture':\n case 'lostpointercapture':\n case 'pointercancel':\n case 'pointerdown':\n case 'pointermove':\n case 'pointerout':\n case 'pointerover':\n case 'pointerup':\n SyntheticEventCtor = SyntheticPointerEvent;\n break;\n }\n\n var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;\n\n {\n \u002F\u002F Some events don't bubble in the browser.\n \u002F\u002F In the past, React has always bubbled them, but this can be surprising.\n \u002F\u002F We're going to try aligning closer to the browser behavior by not bubbling\n \u002F\u002F them in React either. We'll start by not bubbling onScroll, and then expand.\n var accumulateTargetOnly = !inCapturePhase && \u002F\u002F TODO: ideally, we'd eventually add all events from\n \u002F\u002F nonDelegatedEvents list in DOMPluginEventSystem.\n \u002F\u002F Then we can remove this special list.\n \u002F\u002F This is a breaking change that can wait until React 18.\n domEventName === 'scroll';\n\n var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly);\n\n if (_listeners.length \u003E 0) {\n \u002F\u002F Intentionally create event lazily.\n var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget);\n\n dispatchQueue.push({\n event: _event,\n listeners: _listeners\n });\n }\n }\n}\n\n\u002F\u002F TODO: remove top-level side effect.\nregisterSimpleEvents();\nregisterEvents$2();\nregisterEvents$1();\nregisterEvents$3();\nregisterEvents();\n\nfunction extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) {\n \u002F\u002F TODO: we should remove the concept of a \"SimpleEventPlugin\".\n \u002F\u002F This is the basic functionality of the event system. All\n \u002F\u002F the other plugins are essentially polyfills. So the plugin\n \u002F\u002F should probably be inlined somewhere and have its logic\n \u002F\u002F be core the to event system. This would potentially allow\n \u002F\u002F us to ship builds of React without the polyfilled plugins below.\n extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0; \u002F\u002F We don't process these events unless we are in the\n \u002F\u002F event's native \"bubble\" phase, which means that we're\n \u002F\u002F not in the capture phase. That's because we emulate\n \u002F\u002F the capture phase here still. This is a trade-off,\n \u002F\u002F because in an ideal world we would not emulate and use\n \u002F\u002F the phases properly, like we do with the SimpleEvent\n \u002F\u002F plugin. However, the plugins below either expect\n \u002F\u002F emulation (EnterLeave) or use state localized to that\n \u002F\u002F plugin (BeforeInput, Change, Select). The state in\n \u002F\u002F these modules complicates things, as you'll essentially\n \u002F\u002F get the case where the capture phase event might change\n \u002F\u002F state, only for the following bubble event to come in\n \u002F\u002F later and not trigger anything as the state now\n \u002F\u002F invalidates the heuristics of the event plugin. We\n \u002F\u002F could alter all these plugins to work in such ways, but\n \u002F\u002F that might cause other unknown side-effects that we\n \u002F\u002F can't forsee right now.\n\n if (shouldProcessPolyfillPlugins) {\n extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget);\n }\n} \u002F\u002F List of events that need to be individually attached to media elements.\n\n\nvar mediaEventTypes = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'encrypted', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']; \u002F\u002F We should not delegate these events to the container, but rather\n\u002F\u002F set them on the actual target element itself. This is primarily\n\u002F\u002F because these events do not consistently bubble in the DOM.\n\nvar nonDelegatedEvents = new Set(['cancel', 'close', 'invalid', 'load', 'scroll', 'toggle'].concat(mediaEventTypes));\n\nfunction executeDispatch(event, listener, currentTarget) {\n var type = event.type || 'unknown-event';\n event.currentTarget = currentTarget;\n invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n event.currentTarget = null;\n}\n\nfunction processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) {\n var previousInstance;\n\n if (inCapturePhase) {\n for (var i = dispatchListeners.length - 1; i \u003E= 0; i--) {\n var _dispatchListeners$i = dispatchListeners[i],\n instance = _dispatchListeners$i.instance,\n currentTarget = _dispatchListeners$i.currentTarget,\n listener = _dispatchListeners$i.listener;\n\n if (instance !== previousInstance && event.isPropagationStopped()) {\n return;\n }\n\n executeDispatch(event, listener, currentTarget);\n previousInstance = instance;\n }\n } else {\n for (var _i = 0; _i \u003C dispatchListeners.length; _i++) {\n var _dispatchListeners$_i = dispatchListeners[_i],\n _instance = _dispatchListeners$_i.instance,\n _currentTarget = _dispatchListeners$_i.currentTarget,\n _listener = _dispatchListeners$_i.listener;\n\n if (_instance !== previousInstance && event.isPropagationStopped()) {\n return;\n }\n\n executeDispatch(event, _listener, _currentTarget);\n previousInstance = _instance;\n }\n }\n}\n\nfunction processDispatchQueue(dispatchQueue, eventSystemFlags) {\n var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0;\n\n for (var i = 0; i \u003C dispatchQueue.length; i++) {\n var _dispatchQueue$i = dispatchQueue[i],\n event = _dispatchQueue$i.event,\n listeners = _dispatchQueue$i.listeners;\n processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); \u002F\u002F event system doesn't use pooling.\n } \u002F\u002F This would be a good time to rethrow if any of the event handlers threw.\n\n\n rethrowCaughtError();\n}\n\nfunction dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {\n var nativeEventTarget = getEventTarget(nativeEvent);\n var dispatchQueue = [];\n extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n processDispatchQueue(dispatchQueue, eventSystemFlags);\n}\n\nfunction listenToNonDelegatedEvent(domEventName, targetElement) {\n var isCapturePhaseListener = false;\n var listenerSet = getEventListenerSet(targetElement);\n var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener);\n\n if (!listenerSet.has(listenerSetKey)) {\n addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener);\n listenerSet.add(listenerSetKey);\n }\n}\nvar listeningMarker = '_reactListening' + Math.random().toString(36).slice(2);\nfunction listenToAllSupportedEvents(rootContainerElement) {\n {\n if (rootContainerElement[listeningMarker]) {\n \u002F\u002F Performance optimization: don't iterate through events\n \u002F\u002F for the same portal container or root node more than once.\n \u002F\u002F TODO: once we remove the flag, we may be able to also\n \u002F\u002F remove some of the bookkeeping maps used for laziness.\n return;\n }\n\n rootContainerElement[listeningMarker] = true;\n allNativeEvents.forEach(function (domEventName) {\n if (!nonDelegatedEvents.has(domEventName)) {\n listenToNativeEvent(domEventName, false, rootContainerElement, null);\n }\n\n listenToNativeEvent(domEventName, true, rootContainerElement, null);\n });\n }\n}\nfunction listenToNativeEvent(domEventName, isCapturePhaseListener, rootContainerElement, targetElement) {\n var eventSystemFlags = arguments.length \u003E 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var target = rootContainerElement; \u002F\u002F selectionchange needs to be attached to the document\n \u002F\u002F otherwise it won't capture incoming events that are only\n \u002F\u002F triggered on the document directly.\n\n if (domEventName === 'selectionchange' && rootContainerElement.nodeType !== DOCUMENT_NODE) {\n target = rootContainerElement.ownerDocument;\n } \u002F\u002F If the event can be delegated (or is capture phase), we can\n \u002F\u002F register it to the root container. Otherwise, we should\n \u002F\u002F register the event to the target element and mark it as\n \u002F\u002F a non-delegated event.\n\n\n if (targetElement !== null && !isCapturePhaseListener && nonDelegatedEvents.has(domEventName)) {\n \u002F\u002F For all non-delegated events, apart from scroll, we attach\n \u002F\u002F their event listeners to the respective elements that their\n \u002F\u002F events fire on. That means we can skip this step, as event\n \u002F\u002F listener has already been added previously. However, we\n \u002F\u002F special case the scroll event because the reality is that any\n \u002F\u002F element can scroll.\n \u002F\u002F TODO: ideally, we'd eventually apply the same logic to all\n \u002F\u002F events from the nonDelegatedEvents list. Then we can remove\n \u002F\u002F this special case and use the same logic for all events.\n if (domEventName !== 'scroll') {\n return;\n }\n\n eventSystemFlags |= IS_NON_DELEGATED;\n target = targetElement;\n }\n\n var listenerSet = getEventListenerSet(target);\n var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); \u002F\u002F If the listener entry is empty or we should upgrade, then\n \u002F\u002F we need to trap an event listener onto the target.\n\n if (!listenerSet.has(listenerSetKey)) {\n if (isCapturePhaseListener) {\n eventSystemFlags |= IS_CAPTURE_PHASE;\n }\n\n addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener);\n listenerSet.add(listenerSetKey);\n }\n}\n\nfunction addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) {\n var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); \u002F\u002F If passive option is not supported, then the event will be\n \u002F\u002F active and not passive.\n\n var isPassiveListener = undefined;\n\n if (passiveBrowserEventsSupported) {\n \u002F\u002F Browsers introduced an intervention, making these events\n \u002F\u002F passive by default on document. React doesn't bind them\n \u002F\u002F to document anymore, but changing this now would undo\n \u002F\u002F the performance wins from the change. So we emulate\n \u002F\u002F the existing behavior manually on the roots now.\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F19651\n if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') {\n isPassiveListener = true;\n }\n }\n\n targetContainer = targetContainer;\n var unsubscribeListener; \u002F\u002F When legacyFBSupport is enabled, it's for when we\n\n\n if (isCapturePhaseListener) {\n if (isPassiveListener !== undefined) {\n unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);\n } else {\n unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener);\n }\n } else {\n if (isPassiveListener !== undefined) {\n unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener);\n } else {\n unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener);\n }\n }\n}\n\nfunction isMatchingRootContainer(grandContainer, targetContainer) {\n return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer;\n}\n\nfunction dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) {\n var ancestorInst = targetInst;\n\n if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) {\n var targetContainerNode = targetContainer; \u002F\u002F If we are using the legacy FB support flag, we\n\n if (targetInst !== null) {\n \u002F\u002F The below logic attempts to work out if we need to change\n \u002F\u002F the target fiber to a different ancestor. We had similar logic\n \u002F\u002F in the legacy event system, except the big difference between\n \u002F\u002F systems is that the modern event system now has an event listener\n \u002F\u002F attached to each React Root and React Portal Root. Together,\n \u002F\u002F the DOM nodes representing these roots are the \"rootContainer\".\n \u002F\u002F To figure out which ancestor instance we should use, we traverse\n \u002F\u002F up the fiber tree from the target instance and attempt to find\n \u002F\u002F root boundaries that match that of our current \"rootContainer\".\n \u002F\u002F If we find that \"rootContainer\", we find the parent fiber\n \u002F\u002F sub-tree for that root and make that our ancestor instance.\n var node = targetInst;\n\n mainLoop: while (true) {\n if (node === null) {\n return;\n }\n\n var nodeTag = node.tag;\n\n if (nodeTag === HostRoot || nodeTag === HostPortal) {\n var container = node.stateNode.containerInfo;\n\n if (isMatchingRootContainer(container, targetContainerNode)) {\n break;\n }\n\n if (nodeTag === HostPortal) {\n \u002F\u002F The target is a portal, but it's not the rootContainer we're looking for.\n \u002F\u002F Normally portals handle their own events all the way down to the root.\n \u002F\u002F So we should be able to stop now. However, we don't know if this portal\n \u002F\u002F was part of *our* root.\n var grandNode = node.return;\n\n while (grandNode !== null) {\n var grandTag = grandNode.tag;\n\n if (grandTag === HostRoot || grandTag === HostPortal) {\n var grandContainer = grandNode.stateNode.containerInfo;\n\n if (isMatchingRootContainer(grandContainer, targetContainerNode)) {\n \u002F\u002F This is the rootContainer we're looking for and we found it as\n \u002F\u002F a parent of the Portal. That means we can ignore it because the\n \u002F\u002F Portal will bubble through to us.\n return;\n }\n }\n\n grandNode = grandNode.return;\n }\n } \u002F\u002F Now we need to find it's corresponding host fiber in the other\n \u002F\u002F tree. To do this we can use getClosestInstanceFromNode, but we\n \u002F\u002F need to validate that the fiber is a host instance, otherwise\n \u002F\u002F we need to traverse up through the DOM till we find the correct\n \u002F\u002F node that is from the other tree.\n\n\n while (container !== null) {\n var parentNode = getClosestInstanceFromNode(container);\n\n if (parentNode === null) {\n return;\n }\n\n var parentTag = parentNode.tag;\n\n if (parentTag === HostComponent || parentTag === HostText) {\n node = ancestorInst = parentNode;\n continue mainLoop;\n }\n\n container = container.parentNode;\n }\n }\n\n node = node.return;\n }\n }\n }\n\n batchedEventUpdates(function () {\n return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst);\n });\n}\n\nfunction createDispatchListener(instance, listener, currentTarget) {\n return {\n instance: instance,\n listener: listener,\n currentTarget: currentTarget\n };\n}\n\nfunction accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly) {\n var captureName = reactName !== null ? reactName + 'Capture' : null;\n var reactEventName = inCapturePhase ? captureName : reactName;\n var listeners = [];\n var instance = targetFiber;\n var lastHostComponent = null; \u002F\u002F Accumulate all instances and listeners via the target -\u003E root path.\n\n while (instance !== null) {\n var _instance2 = instance,\n stateNode = _instance2.stateNode,\n tag = _instance2.tag; \u002F\u002F Handle listeners that are on HostComponents (i.e. \u003Cdiv\u003E)\n\n if (tag === HostComponent && stateNode !== null) {\n lastHostComponent = stateNode; \u002F\u002F createEventHandle listeners\n\n\n if (reactEventName !== null) {\n var listener = getListener(instance, reactEventName);\n\n if (listener != null) {\n listeners.push(createDispatchListener(instance, listener, lastHostComponent));\n }\n }\n } \u002F\u002F If we are only accumulating events for the target, then we don't\n \u002F\u002F continue to propagate through the React fiber tree to find other\n \u002F\u002F listeners.\n\n\n if (accumulateTargetOnly) {\n break;\n }\n\n instance = instance.return;\n }\n\n return listeners;\n} \u002F\u002F We should only use this function for:\n\u002F\u002F - BeforeInputEventPlugin\n\u002F\u002F - ChangeEventPlugin\n\u002F\u002F - SelectEventPlugin\n\u002F\u002F This is because we only process these plugins\n\u002F\u002F in the bubble phase, so we need to accumulate two\n\u002F\u002F phase event listeners (via emulation).\n\nfunction accumulateTwoPhaseListeners(targetFiber, reactName) {\n var captureName = reactName + 'Capture';\n var listeners = [];\n var instance = targetFiber; \u002F\u002F Accumulate all instances and listeners via the target -\u003E root path.\n\n while (instance !== null) {\n var _instance3 = instance,\n stateNode = _instance3.stateNode,\n tag = _instance3.tag; \u002F\u002F Handle listeners that are on HostComponents (i.e. \u003Cdiv\u003E)\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n var captureListener = getListener(instance, captureName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n\n var bubbleListener = getListener(instance, reactName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n\n instance = instance.return;\n }\n\n return listeners;\n}\n\nfunction getParent(inst) {\n if (inst === null) {\n return null;\n }\n\n do {\n inst = inst.return; \u002F\u002F TODO: If this is a HostRoot we might want to bail out.\n \u002F\u002F That is depending on if we want nested subtrees (layers) to bubble\n \u002F\u002F events to their parent. We could also go through parentNode on the\n \u002F\u002F host node but that wouldn't work for React Native and doesn't let us\n \u002F\u002F do the portal feature.\n } while (inst && inst.tag !== HostComponent);\n\n if (inst) {\n return inst;\n }\n\n return null;\n}\n\u002F**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n *\u002F\n\n\nfunction getLowestCommonAncestor(instA, instB) {\n var nodeA = instA;\n var nodeB = instB;\n var depthA = 0;\n\n for (var tempA = nodeA; tempA; tempA = getParent(tempA)) {\n depthA++;\n }\n\n var depthB = 0;\n\n for (var tempB = nodeB; tempB; tempB = getParent(tempB)) {\n depthB++;\n } \u002F\u002F If A is deeper, crawl up.\n\n\n while (depthA - depthB \u003E 0) {\n nodeA = getParent(nodeA);\n depthA--;\n } \u002F\u002F If B is deeper, crawl up.\n\n\n while (depthB - depthA \u003E 0) {\n nodeB = getParent(nodeB);\n depthB--;\n } \u002F\u002F Walk in lockstep until we find a match.\n\n\n var depth = depthA;\n\n while (depth--) {\n if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) {\n return nodeA;\n }\n\n nodeA = getParent(nodeA);\n nodeB = getParent(nodeB);\n }\n\n return null;\n}\n\nfunction accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) {\n var registrationName = event._reactName;\n var listeners = [];\n var instance = target;\n\n while (instance !== null) {\n if (instance === common) {\n break;\n }\n\n var _instance4 = instance,\n alternate = _instance4.alternate,\n stateNode = _instance4.stateNode,\n tag = _instance4.tag;\n\n if (alternate !== null && alternate === common) {\n break;\n }\n\n if (tag === HostComponent && stateNode !== null) {\n var currentTarget = stateNode;\n\n if (inCapturePhase) {\n var captureListener = getListener(instance, registrationName);\n\n if (captureListener != null) {\n listeners.unshift(createDispatchListener(instance, captureListener, currentTarget));\n }\n } else if (!inCapturePhase) {\n var bubbleListener = getListener(instance, registrationName);\n\n if (bubbleListener != null) {\n listeners.push(createDispatchListener(instance, bubbleListener, currentTarget));\n }\n }\n }\n\n instance = instance.return;\n }\n\n if (listeners.length !== 0) {\n dispatchQueue.push({\n event: event,\n listeners: listeners\n });\n }\n} \u002F\u002F We should only use this function for:\n\u002F\u002F - EnterLeaveEventPlugin\n\u002F\u002F This is because we only process this plugin\n\u002F\u002F in the bubble phase, so we need to accumulate two\n\u002F\u002F phase event listeners.\n\n\nfunction accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\n if (from !== null) {\n accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false);\n }\n\n if (to !== null && enterEvent !== null) {\n accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true);\n }\n}\nfunction getListenerSetKey(domEventName, capture) {\n return domEventName + \"__\" + (capture ? 'capture' : 'bubble');\n}\n\nvar didWarnInvalidHydration = false;\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE = 'style';\nvar HTML$1 = '__html';\nvar HTML_NAMESPACE$1 = Namespaces.html;\nvar warnedUnknownTags;\nvar suppressHydrationWarning;\nvar validatePropertiesInDevelopment;\nvar warnForTextDifference;\nvar warnForPropDifference;\nvar warnForExtraAttributes;\nvar warnForInvalidEventListener;\nvar canDiffStyleForHydrationWarning;\nvar normalizeMarkupForTextOrAttribute;\nvar normalizeHTML;\n\n{\n warnedUnknownTags = {\n \u002F\u002F There are working polyfills for \u003Cdialog\u003E. Let people use it.\n dialog: true,\n \u002F\u002F Electron ships a custom \u003Cwebview\u003E tag to display external web content in\n \u002F\u002F an isolated frame and process.\n \u002F\u002F This tag is not present in non Electron environments such as JSDom which\n \u002F\u002F is often used for testing purposes.\n \u002F\u002F @see https:\u002F\u002Felectronjs.org\u002Fdocs\u002Fapi\u002Fwebview-tag\n webview: true\n };\n\n validatePropertiesInDevelopment = function (type, props) {\n validateProperties(type, props);\n validateProperties$1(type, props);\n validateProperties$2(type, props, {\n registrationNameDependencies: registrationNameDependencies,\n possibleRegistrationNames: possibleRegistrationNames\n });\n }; \u002F\u002F IE 11 parses & normalizes the style attribute as opposed to other\n \u002F\u002F browsers. It adds spaces and sorts the properties in some\n \u002F\u002F non-alphabetical order. Handling that would require sorting CSS\n \u002F\u002F properties in the client & server versions or applying\n \u002F\u002F `expectedStyle` to a temporary DOM node to read its `style` attribute\n \u002F\u002F normalized. Since it only affects IE, we're skipping style warnings\n \u002F\u002F in that browser completely in favor of doing all that work.\n \u002F\u002F See https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F11807\n\n\n canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; \u002F\u002F HTML parsing normalizes CR and CRLF to LF.\n \u002F\u002F It also can turn \\u0000 into \\uFFFD inside attributes.\n \u002F\u002F https:\u002F\u002Fwww.w3.org\u002FTR\u002Fhtml5\u002Fsingle-page.html#preprocessing-the-input-stream\n \u002F\u002F If we have a mismatch, it might be caused by that.\n \u002F\u002F We will still patch up in this case but not fire the warning.\n\n var NORMALIZE_NEWLINES_REGEX = \u002F\\r\\n?\u002Fg;\n var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = \u002F\\u0000|\\uFFFD\u002Fg;\n\n normalizeMarkupForTextOrAttribute = function (markup) {\n var markupString = typeof markup === 'string' ? markup : '' + markup;\n return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n };\n\n warnForTextDifference = function (serverText, clientText) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n\n if (normalizedServerText === normalizedClientText) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Text content did not match. Server: \"%s\" Client: \"%s\"', normalizedServerText, normalizedClientText);\n };\n\n warnForPropDifference = function (propName, serverValue, clientValue) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n\n if (normalizedServerValue === normalizedClientValue) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n };\n\n warnForExtraAttributes = function (attributeNames) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n var names = [];\n attributeNames.forEach(function (name) {\n names.push(name);\n });\n\n error('Extra attributes from the server: %s', names);\n };\n\n warnForInvalidEventListener = function (registrationName, listener) {\n if (listener === false) {\n error('Expected `%s` listener to be a function, instead got `false`.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);\n } else {\n error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);\n }\n }; \u002F\u002F Parse the HTML and read it back to normalize the HTML string so that it\n \u002F\u002F can be used for comparison.\n\n\n normalizeHTML = function (parent, html) {\n \u002F\u002F We could have created a separate document here to avoid\n \u002F\u002F re-initializing custom elements if they exist. But this breaks\n \u002F\u002F how \u003Cnoscript\u003E is being handled. So we use the same document.\n \u002F\u002F See the discussion in https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F11157.\n var testElement = parent.namespaceURI === HTML_NAMESPACE$1 ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n testElement.innerHTML = html;\n return testElement.innerHTML;\n };\n}\n\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\n\nfunction noop() {}\n\nfunction trapClickOnNonInteractiveElement(node) {\n \u002F\u002F Mobile Safari does not fire properly bubble click events on\n \u002F\u002F non-interactive elements, which means delegated click listeners do not\n \u002F\u002F fire. The workaround for this bug involves attaching an empty click\n \u002F\u002F listener on the target node.\n \u002F\u002F https:\u002F\u002Fwww.quirksmode.org\u002Fblog\u002Farchives\u002F2010\u002F09\u002Fclick_event_del.html\n \u002F\u002F Just set it using the onclick property so that we don't have to manage any\n \u002F\u002F bookkeeping for it. Not sure if we need to clear it when the listener is\n \u002F\u002F removed.\n \u002F\u002F TODO: Only do this for the relevant Safaris maybe?\n node.onclick = noop;\n}\n\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n for (var propKey in nextProps) {\n if (!nextProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = nextProps[propKey];\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n \u002F\u002F Freeze the next style object so that we can assume it won't be\n \u002F\u002F mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n } \u002F\u002F Relies on `updateStylesByID` not mutating `styleUpdates`.\n\n\n setValueForStyles(domElement, nextProp);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n setInnerHTML(domElement, nextHtml);\n }\n } else if (propKey === CHILDREN) {\n if (typeof nextProp === 'string') {\n \u002F\u002F Avoid setting initial textContent when the text is empty. In IE11 setting\n \u002F\u002F textContent on a \u003Ctextarea\u003E will cause the placeholder to not\n \u002F\u002F show within the \u003Ctextarea\u003E until it has been focused and blurred again.\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F6731#issuecomment-254874553\n var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n\n if (canSetTextContent) {\n setTextContent(domElement, nextProp);\n }\n } else if (typeof nextProp === 'number') {\n setTextContent(domElement, '' + nextProp);\n }\n } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n if (propKey === 'onScroll') {\n listenToNonDelegatedEvent('scroll', domElement);\n }\n }\n } else if (nextProp != null) {\n setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);\n }\n }\n}\n\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n \u002F\u002F TODO: Handle wasCustomComponentTag\n for (var i = 0; i \u003C updatePayload.length; i += 2) {\n var propKey = updatePayload[i];\n var propValue = updatePayload[i + 1];\n\n if (propKey === STYLE) {\n setValueForStyles(domElement, propValue);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n setInnerHTML(domElement, propValue);\n } else if (propKey === CHILDREN) {\n setTextContent(domElement, propValue);\n } else {\n setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);\n }\n }\n}\n\nfunction createElement(type, props, rootContainerElement, parentNamespace) {\n var isCustomComponentTag; \u002F\u002F We create tags in the namespace of their parent container, except HTML\n \u002F\u002F tags get no namespace.\n\n var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n var domElement;\n var namespaceURI = parentNamespace;\n\n if (namespaceURI === HTML_NAMESPACE$1) {\n namespaceURI = getIntrinsicNamespace(type);\n }\n\n if (namespaceURI === HTML_NAMESPACE$1) {\n {\n isCustomComponentTag = isCustomComponent(type, props); \u002F\u002F Should this check be gated by parent namespace? Not sure we want to\n \u002F\u002F allow \u003CSVG\u003E or \u003CmATH\u003E.\n\n if (!isCustomComponentTag && type !== type.toLowerCase()) {\n error('\u003C%s \u002F\u003E is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type);\n }\n }\n\n if (type === 'script') {\n \u002F\u002F Create the script via .innerHTML so its \"parser-inserted\" flag is\n \u002F\u002F set to true and it does not execute\n var div = ownerDocument.createElement('div');\n\n div.innerHTML = '\u003Cscript\u003E\u003C' + '\u002Fscript\u003E'; \u002F\u002F eslint-disable-line\n \u002F\u002F This is guaranteed to yield a script element.\n\n var firstChild = div.firstChild;\n domElement = div.removeChild(firstChild);\n } else if (typeof props.is === 'string') {\n \u002F\u002F $FlowIssue `createElement` should be updated for Web Components\n domElement = ownerDocument.createElement(type, {\n is: props.is\n });\n } else {\n \u002F\u002F Separate else branch instead of using `props.is || undefined` above because of a Firefox bug.\n \u002F\u002F See discussion in https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F6896\n \u002F\u002F and discussion in https:\u002F\u002Fbugzilla.mozilla.org\u002Fshow_bug.cgi?id=1276240\n domElement = ownerDocument.createElement(type); \u002F\u002F Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size`\n \u002F\u002F attributes on `select`s needs to be added before `option`s are inserted.\n \u002F\u002F This prevents:\n \u002F\u002F - a bug where the `select` does not scroll to the correct option because singular\n \u002F\u002F `select` elements automatically pick the first item #13222\n \u002F\u002F - a bug where the `select` set the first item as selected despite the `size` attribute #14239\n \u002F\u002F See https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F13222\n \u002F\u002F and https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F14239\n\n if (type === 'select') {\n var node = domElement;\n\n if (props.multiple) {\n node.multiple = true;\n } else if (props.size) {\n \u002F\u002F Setting a size greater than 1 causes a select to behave like `multiple=true`, where\n \u002F\u002F it is possible that no option is selected.\n \u002F\u002F\n \u002F\u002F This is only necessary when a select in \"single selection mode\".\n node.size = props.size;\n }\n }\n }\n } else {\n domElement = ownerDocument.createElementNS(namespaceURI, type);\n }\n\n {\n if (namespaceURI === HTML_NAMESPACE$1) {\n if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !Object.prototype.hasOwnProperty.call(warnedUnknownTags, type)) {\n warnedUnknownTags[type] = true;\n\n error('The tag \u003C%s\u003E is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type);\n }\n }\n }\n\n return domElement;\n}\nfunction createTextNode(text, rootContainerElement) {\n return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text);\n}\nfunction setInitialProperties(domElement, tag, rawProps, rootContainerElement) {\n var isCustomComponentTag = isCustomComponent(tag, rawProps);\n\n {\n validatePropertiesInDevelopment(tag, rawProps);\n } \u002F\u002F TODO: Make sure that we check isMounted before firing any of these events.\n\n\n var props;\n\n switch (tag) {\n case 'dialog':\n listenToNonDelegatedEvent('cancel', domElement);\n listenToNonDelegatedEvent('close', domElement);\n props = rawProps;\n break;\n\n case 'iframe':\n case 'object':\n case 'embed':\n \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the load event.\n listenToNonDelegatedEvent('load', domElement);\n props = rawProps;\n break;\n\n case 'video':\n case 'audio':\n \u002F\u002F We listen to these events in case to ensure emulated bubble\n \u002F\u002F listeners still fire for all the media events.\n for (var i = 0; i \u003C mediaEventTypes.length; i++) {\n listenToNonDelegatedEvent(mediaEventTypes[i], domElement);\n }\n\n props = rawProps;\n break;\n\n case 'source':\n \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the error event.\n listenToNonDelegatedEvent('error', domElement);\n props = rawProps;\n break;\n\n case 'img':\n case 'image':\n case 'link':\n \u002F\u002F We listen to these events in case to ensure emulated bubble\n \u002F\u002F listeners still fire for error and load events.\n listenToNonDelegatedEvent('error', domElement);\n listenToNonDelegatedEvent('load', domElement);\n props = rawProps;\n break;\n\n case 'details':\n \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the toggle event.\n listenToNonDelegatedEvent('toggle', domElement);\n props = rawProps;\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps);\n props = getHostProps(domElement, rawProps); \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n props = getHostProps$1(domElement, rawProps);\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps);\n props = getHostProps$2(domElement, rawProps); \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps);\n props = getHostProps$3(domElement, rawProps); \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n\n break;\n\n default:\n props = rawProps;\n }\n\n assertValidProps(tag, props);\n setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag);\n\n switch (tag) {\n case 'input':\n \u002F\u002F TODO: Make sure we check if this is still unmounted or do any clean\n \u002F\u002F up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, false);\n break;\n\n case 'textarea':\n \u002F\u002F TODO: Make sure we check if this is still unmounted or do any clean\n \u002F\u002F up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'option':\n postMountWrapper$1(domElement, rawProps);\n break;\n\n case 'select':\n postMountWrapper$2(domElement, rawProps);\n break;\n\n default:\n if (typeof props.onClick === 'function') {\n \u002F\u002F TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n} \u002F\u002F Calculate the diff between the two objects.\n\nfunction diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) {\n {\n validatePropertiesInDevelopment(tag, nextRawProps);\n }\n\n var updatePayload = null;\n var lastProps;\n var nextProps;\n\n switch (tag) {\n case 'input':\n lastProps = getHostProps(domElement, lastRawProps);\n nextProps = getHostProps(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'option':\n lastProps = getHostProps$1(domElement, lastRawProps);\n nextProps = getHostProps$1(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'select':\n lastProps = getHostProps$2(domElement, lastRawProps);\n nextProps = getHostProps$2(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n case 'textarea':\n lastProps = getHostProps$3(domElement, lastRawProps);\n nextProps = getHostProps$3(domElement, nextRawProps);\n updatePayload = [];\n break;\n\n default:\n lastProps = lastRawProps;\n nextProps = nextRawProps;\n\n if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') {\n \u002F\u002F TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n assertValidProps(tag, nextProps);\n var propKey;\n var styleName;\n var styleUpdates = null;\n\n for (propKey in lastProps) {\n if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n var lastStyle = lastProps[propKey];\n\n for (styleName in lastStyle) {\n if (lastStyle.hasOwnProperty(styleName)) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n \u002F\u002F This is a special case. If any listener updates we need to ensure\n \u002F\u002F that the \"current\" fiber pointer gets updated so we need a commit\n \u002F\u002F to update this element.\n if (!updatePayload) {\n updatePayload = [];\n }\n } else {\n \u002F\u002F For all other deleted properties we add it to the queue. We use\n \u002F\u002F the allowed property list in the commit phase instead.\n (updatePayload = updatePayload || []).push(propKey, null);\n }\n }\n\n for (propKey in nextProps) {\n var nextProp = nextProps[propKey];\n var lastProp = lastProps != null ? lastProps[propKey] : undefined;\n\n if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) {\n continue;\n }\n\n if (propKey === STYLE) {\n {\n if (nextProp) {\n \u002F\u002F Freeze the next style object so that we can assume it won't be\n \u002F\u002F mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n }\n\n if (lastProp) {\n \u002F\u002F Unset styles on `lastProp` but not on `nextProp`.\n for (styleName in lastProp) {\n if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = '';\n }\n } \u002F\u002F Update styles that changed since `lastProp`.\n\n\n for (styleName in nextProp) {\n if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) {\n if (!styleUpdates) {\n styleUpdates = {};\n }\n\n styleUpdates[styleName] = nextProp[styleName];\n }\n }\n } else {\n \u002F\u002F Relies on `updateStylesByID` not mutating `styleUpdates`.\n if (!styleUpdates) {\n if (!updatePayload) {\n updatePayload = [];\n }\n\n updatePayload.push(propKey, styleUpdates);\n }\n\n styleUpdates = nextProp;\n }\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n var lastHtml = lastProp ? lastProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n if (lastHtml !== nextHtml) {\n (updatePayload = updatePayload || []).push(propKey, nextHtml);\n }\n }\n } else if (propKey === CHILDREN) {\n if (typeof nextProp === 'string' || typeof nextProp === 'number') {\n (updatePayload = updatePayload || []).push(propKey, '' + nextProp);\n }\n } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n \u002F\u002F We eagerly listen to this even though we haven't committed yet.\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n if (propKey === 'onScroll') {\n listenToNonDelegatedEvent('scroll', domElement);\n }\n }\n\n if (!updatePayload && lastProp !== nextProp) {\n \u002F\u002F This is a special case. If any listener updates we need to ensure\n \u002F\u002F that the \"current\" props pointer gets updated so we need a commit\n \u002F\u002F to update this element.\n updatePayload = [];\n }\n } else if (typeof nextProp === 'object' && nextProp !== null && nextProp.$typeof === REACT_OPAQUE_ID_TYPE) {\n \u002F\u002F If we encounter useOpaqueReference's opaque object, this means we are hydrating.\n \u002F\u002F In this case, call the opaque object's toString function which generates a new client\n \u002F\u002F ID so client and server IDs match and throws to rerender.\n nextProp.toString();\n } else {\n \u002F\u002F For any other property we always add it to the queue and then we\n \u002F\u002F filter it out using the allowed property list during the commit.\n (updatePayload = updatePayload || []).push(propKey, nextProp);\n }\n }\n\n if (styleUpdates) {\n {\n validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]);\n }\n\n (updatePayload = updatePayload || []).push(STYLE, styleUpdates);\n }\n\n return updatePayload;\n} \u002F\u002F Apply the diff.\n\nfunction updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) {\n \u002F\u002F Update checked *before* name.\n \u002F\u002F In the middle of an update, it is possible to have multiple checked.\n \u002F\u002F When a checked radio tries to change name, browser makes another radio's checked false.\n if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) {\n updateChecked(domElement, nextRawProps);\n }\n\n var wasCustomComponentTag = isCustomComponent(tag, lastRawProps);\n var isCustomComponentTag = isCustomComponent(tag, nextRawProps); \u002F\u002F Apply the diff.\n\n updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); \u002F\u002F TODO: Ensure that an update gets scheduled if any of the special props\n \u002F\u002F changed.\n\n switch (tag) {\n case 'input':\n \u002F\u002F Update the wrapper around inputs *after* updating props. This has to\n \u002F\u002F happen after `updateDOMProperties`. Otherwise HTML5 input validations\n \u002F\u002F raise warnings and prevent the new value from being assigned.\n updateWrapper(domElement, nextRawProps);\n break;\n\n case 'textarea':\n updateWrapper$1(domElement, nextRawProps);\n break;\n\n case 'select':\n \u002F\u002F \u003Cselect\u003E value update needs to occur after \u003Coption\u003E children\n \u002F\u002F reconciliation\n postUpdateWrapper(domElement, nextRawProps);\n break;\n }\n}\n\nfunction getPossibleStandardName(propName) {\n {\n var lowerCasedName = propName.toLowerCase();\n\n if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n return null;\n }\n\n return possibleStandardNames[lowerCasedName] || null;\n }\n}\n\nfunction diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement) {\n var isCustomComponentTag;\n var extraAttributeNames;\n\n {\n suppressHydrationWarning = rawProps[SUPPRESS_HYDRATION_WARNING] === true;\n isCustomComponentTag = isCustomComponent(tag, rawProps);\n validatePropertiesInDevelopment(tag, rawProps);\n } \u002F\u002F TODO: Make sure that we check isMounted before firing any of these events.\n\n\n switch (tag) {\n case 'dialog':\n listenToNonDelegatedEvent('cancel', domElement);\n listenToNonDelegatedEvent('close', domElement);\n break;\n\n case 'iframe':\n case 'object':\n case 'embed':\n \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the load event.\n listenToNonDelegatedEvent('load', domElement);\n break;\n\n case 'video':\n case 'audio':\n \u002F\u002F We listen to these events in case to ensure emulated bubble\n \u002F\u002F listeners still fire for all the media events.\n for (var i = 0; i \u003C mediaEventTypes.length; i++) {\n listenToNonDelegatedEvent(mediaEventTypes[i], domElement);\n }\n\n break;\n\n case 'source':\n \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the error event.\n listenToNonDelegatedEvent('error', domElement);\n break;\n\n case 'img':\n case 'image':\n case 'link':\n \u002F\u002F We listen to these events in case to ensure emulated bubble\n \u002F\u002F listeners still fire for error and load events.\n listenToNonDelegatedEvent('error', domElement);\n listenToNonDelegatedEvent('load', domElement);\n break;\n\n case 'details':\n \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the toggle event.\n listenToNonDelegatedEvent('toggle', domElement);\n break;\n\n case 'input':\n initWrapperState(domElement, rawProps); \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n\n break;\n\n case 'option':\n validateProps(domElement, rawProps);\n break;\n\n case 'select':\n initWrapperState$1(domElement, rawProps); \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n\n break;\n\n case 'textarea':\n initWrapperState$2(domElement, rawProps); \u002F\u002F We listen to this event in case to ensure emulated bubble\n \u002F\u002F listeners still fire for the invalid event.\n\n listenToNonDelegatedEvent('invalid', domElement);\n\n break;\n }\n\n assertValidProps(tag, rawProps);\n\n {\n extraAttributeNames = new Set();\n var attributes = domElement.attributes;\n\n for (var _i = 0; _i \u003C attributes.length; _i++) {\n var name = attributes[_i].name.toLowerCase();\n\n switch (name) {\n \u002F\u002F Built-in SSR attribute is allowed\n case 'data-reactroot':\n break;\n \u002F\u002F Controlled attributes are not validated\n \u002F\u002F TODO: Only ignore them on controlled tags.\n\n case 'value':\n break;\n\n case 'checked':\n break;\n\n case 'selected':\n break;\n\n default:\n \u002F\u002F Intentionally use the original name.\n \u002F\u002F See discussion in https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F10676.\n extraAttributeNames.add(attributes[_i].name);\n }\n }\n }\n\n var updatePayload = null;\n\n for (var propKey in rawProps) {\n if (!rawProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = rawProps[propKey];\n\n if (propKey === CHILDREN) {\n \u002F\u002F For text content children we compare against textContent. This\n \u002F\u002F might match additional HTML that is hidden when we read it using\n \u002F\u002F textContent. E.g. \"foo\" will match \"f\u003Cspan\u003Eoo\u003C\u002Fspan\u003E\" but that still\n \u002F\u002F satisfies our requirement. Our requirement is not to produce perfect\n \u002F\u002F HTML and attributes. Ideally we should preserve structure but it's\n \u002F\u002F ok not to if the visible content is still enough to indicate what\n \u002F\u002F even listeners these nodes might be wired up to.\n \u002F\u002F TODO: Warn if there is more than a single textNode as a child.\n \u002F\u002F TODO: Should we use domElement.firstChild.nodeValue to compare?\n if (typeof nextProp === 'string') {\n if (domElement.textContent !== nextProp) {\n if ( !suppressHydrationWarning) {\n warnForTextDifference(domElement.textContent, nextProp);\n }\n\n updatePayload = [CHILDREN, nextProp];\n }\n } else if (typeof nextProp === 'number') {\n if (domElement.textContent !== '' + nextProp) {\n if ( !suppressHydrationWarning) {\n warnForTextDifference(domElement.textContent, nextProp);\n }\n\n updatePayload = [CHILDREN, '' + nextProp];\n }\n }\n } else if (registrationNameDependencies.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n if (propKey === 'onScroll') {\n listenToNonDelegatedEvent('scroll', domElement);\n }\n }\n } else if ( \u002F\u002F Convince Flow we've calculated it (it's DEV-only in this method.)\n typeof isCustomComponentTag === 'boolean') {\n \u002F\u002F Validate that the properties correspond to their expected values.\n var serverValue = void 0;\n var propertyInfo = getPropertyInfo(propKey);\n\n if (suppressHydrationWarning) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || \u002F\u002F Controlled attributes are not validated\n \u002F\u002F TODO: Only ignore them on controlled tags.\n propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var serverHTML = domElement.innerHTML;\n var nextHtml = nextProp ? nextProp[HTML$1] : undefined;\n\n if (nextHtml != null) {\n var expectedHTML = normalizeHTML(domElement, nextHtml);\n\n if (expectedHTML !== serverHTML) {\n warnForPropDifference(propKey, serverHTML, expectedHTML);\n }\n }\n } else if (propKey === STYLE) {\n \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey);\n\n if (canDiffStyleForHydrationWarning) {\n var expectedStyle = createDangerousStringForStyles(nextProp);\n serverValue = domElement.getAttribute('style');\n\n if (expectedStyle !== serverValue) {\n warnForPropDifference(propKey, serverValue, expectedStyle);\n }\n }\n } else if (isCustomComponentTag) {\n \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n\n if (nextProp !== serverValue) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) {\n var isMismatchDueToBadCasing = false;\n\n if (propertyInfo !== null) {\n \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propertyInfo.attributeName);\n serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo);\n } else {\n var ownNamespace = parentNamespace;\n\n if (ownNamespace === HTML_NAMESPACE$1) {\n ownNamespace = getIntrinsicNamespace(tag);\n }\n\n if (ownNamespace === HTML_NAMESPACE$1) {\n \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n extraAttributeNames.delete(propKey.toLowerCase());\n } else {\n var standardName = getPossibleStandardName(propKey);\n\n if (standardName !== null && standardName !== propKey) {\n \u002F\u002F If an SVG prop is supplied with bad casing, it will\n \u002F\u002F be successfully parsed from HTML, but will produce a mismatch\n \u002F\u002F (and would be incorrectly rendered on the client).\n \u002F\u002F However, we already warn about bad casing elsewhere.\n \u002F\u002F So we'll skip the misleading extra mismatch warning in this case.\n isMismatchDueToBadCasing = true; \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n\n extraAttributeNames.delete(standardName);\n } \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n\n\n extraAttributeNames.delete(propKey);\n }\n\n serverValue = getValueForAttribute(domElement, propKey, nextProp);\n }\n\n if (nextProp !== serverValue && !isMismatchDueToBadCasing) {\n warnForPropDifference(propKey, serverValue, nextProp);\n }\n }\n }\n }\n\n {\n \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n if (extraAttributeNames.size \u003E 0 && !suppressHydrationWarning) {\n \u002F\u002F $FlowFixMe - Should be inferred as not undefined.\n warnForExtraAttributes(extraAttributeNames);\n }\n }\n\n switch (tag) {\n case 'input':\n \u002F\u002F TODO: Make sure we check if this is still unmounted or do any clean\n \u002F\u002F up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper(domElement, rawProps, true);\n break;\n\n case 'textarea':\n \u002F\u002F TODO: Make sure we check if this is still unmounted or do any clean\n \u002F\u002F up necessary since we never stop tracking anymore.\n track(domElement);\n postMountWrapper$3(domElement);\n break;\n\n case 'select':\n case 'option':\n \u002F\u002F For input and textarea we current always set the value property at\n \u002F\u002F post mount to force it to diverge from attributes. However, for\n \u002F\u002F option and select we don't quite do the same thing and select\n \u002F\u002F is not resilient to the DOM state changing so we don't do that here.\n \u002F\u002F TODO: Consider not doing this for input and textarea.\n break;\n\n default:\n if (typeof rawProps.onClick === 'function') {\n \u002F\u002F TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(domElement);\n }\n\n break;\n }\n\n return updatePayload;\n}\nfunction diffHydratedText(textNode, text) {\n var isDifferent = textNode.nodeValue !== text;\n return isDifferent;\n}\nfunction warnForUnmatchedText(textNode, text) {\n {\n warnForTextDifference(textNode.nodeValue, text);\n }\n}\nfunction warnForDeletedHydratableElement(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain a \u003C%s\u003E in \u003C%s\u003E.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForDeletedHydratableText(parentNode, child) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Did not expect server HTML to contain the text node \"%s\" in \u003C%s\u003E.', child.nodeValue, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedElement(parentNode, tag, props) {\n {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching \u003C%s\u003E in \u003C%s\u003E.', tag, parentNode.nodeName.toLowerCase());\n }\n}\nfunction warnForInsertedHydratedText(parentNode, text) {\n {\n if (text === '') {\n \u002F\u002F We expect to insert empty text nodes since they're not represented in\n \u002F\u002F the HTML.\n \u002F\u002F TODO: Remove this special case if we can just avoid inserting empty\n \u002F\u002F text nodes.\n return;\n }\n\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n\n error('Expected server HTML to contain a matching text node for \"%s\" in \u003C%s\u003E.', text, parentNode.nodeName.toLowerCase());\n }\n}\nfunction restoreControlledState$3(domElement, tag, props) {\n switch (tag) {\n case 'input':\n restoreControlledState(domElement, props);\n return;\n\n case 'textarea':\n restoreControlledState$2(domElement, props);\n return;\n\n case 'select':\n restoreControlledState$1(domElement, props);\n return;\n }\n}\n\nvar validateDOMNesting = function () {};\n\nvar updatedAncestorInfo = function () {};\n\n{\n \u002F\u002F This validation code was written based on the HTML5 parsing spec:\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#has-an-element-in-scope\n \u002F\u002F\n \u002F\u002F Note: this does not catch all invalid nesting, nor does it try to (as it's\n \u002F\u002F not clear what practical benefit doing so provides); instead, we warn only\n \u002F\u002F for cases where the parser will give a parse tree differing from what React\n \u002F\u002F intended. For example, \u003Cb\u003E\u003Cdiv\u003E\u003C\u002Fdiv\u003E\u003C\u002Fb\u003E is invalid but we don't warn\n \u002F\u002F because it still parses correctly; we do warn for other cases like nested\n \u002F\u002F \u003Cp\u003E tags where the beginning of the second element implicitly closes the\n \u002F\u002F first, causing a confusing mess.\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#special\n var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#has-an-element-in-scope\n\n var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#html-integration-point\n \u002F\u002F TODO: Distinguish by namespace here -- for \u003Ctitle\u003E, including it here\n \u002F\u002F errs on the side of fewer warnings\n 'foreignObject', 'desc', 'title']; \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#has-an-element-in-button-scope\n\n var buttonScopeTags = inScopeTags.concat(['button']); \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#generate-implied-end-tags\n\n var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt'];\n var emptyAncestorInfo = {\n current: null,\n formTag: null,\n aTagInScope: null,\n buttonTagInScope: null,\n nobrTagInScope: null,\n pTagInButtonScope: null,\n listItemTagAutoclosing: null,\n dlItemTagAutoclosing: null\n };\n\n updatedAncestorInfo = function (oldInfo, tag) {\n var ancestorInfo = _assign({}, oldInfo || emptyAncestorInfo);\n\n var info = {\n tag: tag\n };\n\n if (inScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.aTagInScope = null;\n ancestorInfo.buttonTagInScope = null;\n ancestorInfo.nobrTagInScope = null;\n }\n\n if (buttonScopeTags.indexOf(tag) !== -1) {\n ancestorInfo.pTagInButtonScope = null;\n } \u002F\u002F See rules for 'li', 'dd', 'dt' start tags in\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-inbody\n\n\n if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') {\n ancestorInfo.listItemTagAutoclosing = null;\n ancestorInfo.dlItemTagAutoclosing = null;\n }\n\n ancestorInfo.current = info;\n\n if (tag === 'form') {\n ancestorInfo.formTag = info;\n }\n\n if (tag === 'a') {\n ancestorInfo.aTagInScope = info;\n }\n\n if (tag === 'button') {\n ancestorInfo.buttonTagInScope = info;\n }\n\n if (tag === 'nobr') {\n ancestorInfo.nobrTagInScope = info;\n }\n\n if (tag === 'p') {\n ancestorInfo.pTagInButtonScope = info;\n }\n\n if (tag === 'li') {\n ancestorInfo.listItemTagAutoclosing = info;\n }\n\n if (tag === 'dd' || tag === 'dt') {\n ancestorInfo.dlItemTagAutoclosing = info;\n }\n\n return ancestorInfo;\n };\n \u002F**\n * Returns whether\n *\u002F\n\n\n var isTagValidWithParent = function (tag, parentTag) {\n \u002F\u002F First, let's check if we're in an unusual parsing mode...\n switch (parentTag) {\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-inselect\n case 'select':\n return tag === 'option' || tag === 'optgroup' || tag === '#text';\n\n case 'optgroup':\n return tag === 'option' || tag === '#text';\n \u002F\u002F Strictly speaking, seeing an \u003Coption\u003E doesn't mean we're in a \u003Cselect\u003E\n \u002F\u002F but\n\n case 'option':\n return tag === '#text';\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-intd\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-incaption\n \u002F\u002F No special behavior since these rules fall back to \"in body\" mode for\n \u002F\u002F all except special table nodes which cause bad parsing behavior anyway.\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-intr\n\n case 'tr':\n return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template';\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-intbody\n\n case 'tbody':\n case 'thead':\n case 'tfoot':\n return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template';\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-incolgroup\n\n case 'colgroup':\n return tag === 'col' || tag === 'template';\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-intable\n\n case 'table':\n return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template';\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-inhead\n\n case 'head':\n return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template';\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsemantics.html#the-html-element\n\n case 'html':\n return tag === 'head' || tag === 'body' || tag === 'frameset';\n\n case 'frameset':\n return tag === 'frame';\n\n case '#document':\n return tag === 'html';\n } \u002F\u002F Probably in the \"in body\" parsing mode, so we outlaw only tag combos\n \u002F\u002F where the parsing rules cause implicit opens or closes to be added.\n \u002F\u002F https:\u002F\u002Fhtml.spec.whatwg.org\u002Fmultipage\u002Fsyntax.html#parsing-main-inbody\n\n\n switch (tag) {\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6';\n\n case 'rp':\n case 'rt':\n return impliedEndTags.indexOf(parentTag) === -1;\n\n case 'body':\n case 'caption':\n case 'col':\n case 'colgroup':\n case 'frameset':\n case 'frame':\n case 'head':\n case 'html':\n case 'tbody':\n case 'td':\n case 'tfoot':\n case 'th':\n case 'thead':\n case 'tr':\n \u002F\u002F These tags are only valid with a few parents that have special child\n \u002F\u002F parsing rules -- if we're down here, then none of those matched and\n \u002F\u002F so we allow it only if we don't know what the parent is, as all other\n \u002F\u002F cases are invalid.\n return parentTag == null;\n }\n\n return true;\n };\n \u002F**\n * Returns whether\n *\u002F\n\n\n var findInvalidAncestorForTag = function (tag, ancestorInfo) {\n switch (tag) {\n case 'address':\n case 'article':\n case 'aside':\n case 'blockquote':\n case 'center':\n case 'details':\n case 'dialog':\n case 'dir':\n case 'div':\n case 'dl':\n case 'fieldset':\n case 'figcaption':\n case 'figure':\n case 'footer':\n case 'header':\n case 'hgroup':\n case 'main':\n case 'menu':\n case 'nav':\n case 'ol':\n case 'p':\n case 'section':\n case 'summary':\n case 'ul':\n case 'pre':\n case 'listing':\n case 'table':\n case 'hr':\n case 'xmp':\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6':\n return ancestorInfo.pTagInButtonScope;\n\n case 'form':\n return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope;\n\n case 'li':\n return ancestorInfo.listItemTagAutoclosing;\n\n case 'dd':\n case 'dt':\n return ancestorInfo.dlItemTagAutoclosing;\n\n case 'button':\n return ancestorInfo.buttonTagInScope;\n\n case 'a':\n \u002F\u002F Spec says something about storing a list of markers, but it sounds\n \u002F\u002F equivalent to this check.\n return ancestorInfo.aTagInScope;\n\n case 'nobr':\n return ancestorInfo.nobrTagInScope;\n }\n\n return null;\n };\n\n var didWarn$1 = {};\n\n validateDOMNesting = function (childTag, childText, ancestorInfo) {\n ancestorInfo = ancestorInfo || emptyAncestorInfo;\n var parentInfo = ancestorInfo.current;\n var parentTag = parentInfo && parentInfo.tag;\n\n if (childText != null) {\n if (childTag != null) {\n error('validateDOMNesting: when childText is passed, childTag should be null');\n }\n\n childTag = '#text';\n }\n\n var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo;\n var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo);\n var invalidParentOrAncestor = invalidParent || invalidAncestor;\n\n if (!invalidParentOrAncestor) {\n return;\n }\n\n var ancestorTag = invalidParentOrAncestor.tag;\n var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag;\n\n if (didWarn$1[warnKey]) {\n return;\n }\n\n didWarn$1[warnKey] = true;\n var tagDisplayName = childTag;\n var whitespaceInfo = '';\n\n if (childTag === '#text') {\n if (\u002F\\S\u002F.test(childText)) {\n tagDisplayName = 'Text nodes';\n } else {\n tagDisplayName = 'Whitespace text nodes';\n whitespaceInfo = \" Make sure you don't have any extra whitespace between tags on \" + 'each line of your source code.';\n }\n } else {\n tagDisplayName = '\u003C' + childTag + '\u003E';\n }\n\n if (invalidParent) {\n var info = '';\n\n if (ancestorTag === 'table' && childTag === 'tr') {\n info += ' Add a \u003Ctbody\u003E, \u003Cthead\u003E or \u003Ctfoot\u003E to your code to match the DOM tree generated by ' + 'the browser.';\n }\n\n error('validateDOMNesting(...): %s cannot appear as a child of \u003C%s\u003E.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info);\n } else {\n error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '\u003C%s\u003E.', tagDisplayName, ancestorTag);\n }\n };\n}\n\nvar SUPPRESS_HYDRATION_WARNING$1;\n\n{\n SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\n}\n\nvar SUSPENSE_START_DATA = '
;\nvar SUSPENSE_END_DATA = '\u002F
;\nvar SUSPENSE_PENDING_START_DATA = '$?';\nvar SUSPENSE_FALLBACK_START_DATA = '$!';\nvar STYLE$1 = 'style';\nvar eventsEnabled = null;\nvar selectionInformation = null;\n\nfunction shouldAutoFocusHostComponent(type, props) {\n switch (type) {\n case 'button':\n case 'input':\n case 'select':\n case 'textarea':\n return !!props.autoFocus;\n }\n\n return false;\n}\nfunction getRootHostContext(rootContainerInstance) {\n var type;\n var namespace;\n var nodeType = rootContainerInstance.nodeType;\n\n switch (nodeType) {\n case DOCUMENT_NODE:\n case DOCUMENT_FRAGMENT_NODE:\n {\n type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment';\n var root = rootContainerInstance.documentElement;\n namespace = root ? root.namespaceURI : getChildNamespace(null, '');\n break;\n }\n\n default:\n {\n var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance;\n var ownNamespace = container.namespaceURI || null;\n type = container.tagName;\n namespace = getChildNamespace(ownNamespace, type);\n break;\n }\n }\n\n {\n var validatedTag = type.toLowerCase();\n var ancestorInfo = updatedAncestorInfo(null, validatedTag);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getChildHostContext(parentHostContext, type, rootContainerInstance) {\n {\n var parentHostContextDev = parentHostContext;\n var namespace = getChildNamespace(parentHostContextDev.namespace, type);\n var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type);\n return {\n namespace: namespace,\n ancestorInfo: ancestorInfo\n };\n }\n}\nfunction getPublicInstance(instance) {\n return instance;\n}\nfunction prepareForCommit(containerInfo) {\n eventsEnabled = isEnabled();\n selectionInformation = getSelectionInformation();\n var activeInstance = null;\n\n setEnabled(false);\n return activeInstance;\n}\nfunction resetAfterCommit(containerInfo) {\n restoreSelection(selectionInformation);\n setEnabled(eventsEnabled);\n eventsEnabled = null;\n selectionInformation = null;\n}\nfunction createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n var parentNamespace;\n\n {\n \u002F\u002F TODO: take namespace into account when validating.\n var hostContextDev = hostContext;\n validateDOMNesting(type, null, hostContextDev.ancestorInfo);\n\n if (typeof props.children === 'string' || typeof props.children === 'number') {\n var string = '' + props.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n\n parentNamespace = hostContextDev.namespace;\n }\n\n var domElement = createElement(type, props, rootContainerInstance, parentNamespace);\n precacheFiberNode(internalInstanceHandle, domElement);\n updateFiberProps(domElement, props);\n return domElement;\n}\nfunction appendInitialChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) {\n setInitialProperties(domElement, type, props, rootContainerInstance);\n return shouldAutoFocusHostComponent(type, props);\n}\nfunction prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) {\n {\n var hostContextDev = hostContext;\n\n if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) {\n var string = '' + newProps.children;\n var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type);\n validateDOMNesting(null, string, ownAncestorInfo);\n }\n }\n\n return diffProperties(domElement, type, oldProps, newProps);\n}\nfunction shouldSetTextContent(type, props) {\n return type === 'textarea' || type === 'option' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null;\n}\nfunction createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) {\n {\n var hostContextDev = hostContext;\n validateDOMNesting(null, text, hostContextDev.ancestorInfo);\n }\n\n var textNode = createTextNode(text, rootContainerInstance);\n precacheFiberNode(internalInstanceHandle, textNode);\n return textNode;\n}\n\u002F\u002F if a component just imports ReactDOM (e.g. for findDOMNode).\n\u002F\u002F Some environments might not have setTimeout or clearTimeout.\n\nvar scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined;\nvar cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined;\nvar noTimeout = -1; \u002F\u002F -------------------\nfunction commitMount(domElement, type, newProps, internalInstanceHandle) {\n \u002F\u002F Despite the naming that might imply otherwise, this method only\n \u002F\u002F fires if there is an `Update` effect scheduled during mounting.\n \u002F\u002F This happens if `finalizeInitialChildren` returns `true` (which it\n \u002F\u002F does to implement the `autoFocus` attribute on the client). But\n \u002F\u002F there are also other cases when this might happen (such as patching\n \u002F\u002F up text content during hydration mismatch). So we'll check this again.\n if (shouldAutoFocusHostComponent(type, newProps)) {\n domElement.focus();\n }\n}\nfunction commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) {\n \u002F\u002F Update the props handle so that we know which props are the ones with\n \u002F\u002F with current event handlers.\n updateFiberProps(domElement, newProps); \u002F\u002F Apply the diff to the DOM node.\n\n updateProperties(domElement, updatePayload, type, oldProps, newProps);\n}\nfunction resetTextContent(domElement) {\n setTextContent(domElement, '');\n}\nfunction commitTextUpdate(textInstance, oldText, newText) {\n textInstance.nodeValue = newText;\n}\nfunction appendChild(parentInstance, child) {\n parentInstance.appendChild(child);\n}\nfunction appendChildToContainer(container, child) {\n var parentNode;\n\n if (container.nodeType === COMMENT_NODE) {\n parentNode = container.parentNode;\n parentNode.insertBefore(child, container);\n } else {\n parentNode = container;\n parentNode.appendChild(child);\n } \u002F\u002F This container might be used for a portal.\n \u002F\u002F If something inside a portal is clicked, that click should bubble\n \u002F\u002F through the React tree. However, on Mobile Safari the click would\n \u002F\u002F never bubble through the *DOM* tree unless an ancestor with onclick\n \u002F\u002F event exists. So we wouldn't see it and dispatch it.\n \u002F\u002F This is why we ensure that non React root containers have inline onclick\n \u002F\u002F defined.\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F11918\n\n\n var reactRootContainer = container._reactRootContainer;\n\n if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) {\n \u002F\u002F TODO: This cast may not be sound for SVG, MathML or custom elements.\n trapClickOnNonInteractiveElement(parentNode);\n }\n}\nfunction insertBefore(parentInstance, child, beforeChild) {\n parentInstance.insertBefore(child, beforeChild);\n}\nfunction insertInContainerBefore(container, child, beforeChild) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.insertBefore(child, beforeChild);\n } else {\n container.insertBefore(child, beforeChild);\n }\n}\n\nfunction removeChild(parentInstance, child) {\n parentInstance.removeChild(child);\n}\nfunction removeChildFromContainer(container, child) {\n if (container.nodeType === COMMENT_NODE) {\n container.parentNode.removeChild(child);\n } else {\n container.removeChild(child);\n }\n}\nfunction hideInstance(instance) {\n \u002F\u002F TODO: Does this work for all element types? What about MathML? Should we\n \u002F\u002F pass host context to this method?\n instance = instance;\n var style = instance.style;\n\n if (typeof style.setProperty === 'function') {\n style.setProperty('display', 'none', 'important');\n } else {\n style.display = 'none';\n }\n}\nfunction hideTextInstance(textInstance) {\n textInstance.nodeValue = '';\n}\nfunction unhideInstance(instance, props) {\n instance = instance;\n var styleProp = props[STYLE$1];\n var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null;\n instance.style.display = dangerousStyleValue('display', display);\n}\nfunction unhideTextInstance(textInstance, text) {\n textInstance.nodeValue = text;\n}\nfunction clearContainer(container) {\n if (container.nodeType === ELEMENT_NODE) {\n container.textContent = '';\n } else if (container.nodeType === DOCUMENT_NODE) {\n var body = container.body;\n\n if (body != null) {\n body.textContent = '';\n }\n }\n} \u002F\u002F -------------------\nfunction canHydrateInstance(instance, type, props) {\n if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) {\n return null;\n } \u002F\u002F This has now been refined to an element node.\n\n\n return instance;\n}\nfunction canHydrateTextInstance(instance, text) {\n if (text === '' || instance.nodeType !== TEXT_NODE) {\n \u002F\u002F Empty strings are not parsed by HTML so there won't be a correct match here.\n return null;\n } \u002F\u002F This has now been refined to a text node.\n\n\n return instance;\n}\nfunction isSuspenseInstancePending(instance) {\n return instance.data === SUSPENSE_PENDING_START_DATA;\n}\nfunction isSuspenseInstanceFallback(instance) {\n return instance.data === SUSPENSE_FALLBACK_START_DATA;\n}\n\nfunction getNextHydratable(node) {\n \u002F\u002F Skip non-hydratable nodes.\n for (; node != null; node = node.nextSibling) {\n var nodeType = node.nodeType;\n\n if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) {\n break;\n }\n }\n\n return node;\n}\n\nfunction getNextHydratableSibling(instance) {\n return getNextHydratable(instance.nextSibling);\n}\nfunction getFirstHydratableChild(parentInstance) {\n return getNextHydratable(parentInstance.firstChild);\n}\nfunction hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle) {\n precacheFiberNode(internalInstanceHandle, instance); \u002F\u002F TODO: Possibly defer this until the commit phase where all the events\n \u002F\u002F get attached.\n\n updateFiberProps(instance, props);\n var parentNamespace;\n\n {\n var hostContextDev = hostContext;\n parentNamespace = hostContextDev.namespace;\n }\n\n return diffHydratedProperties(instance, type, props, parentNamespace);\n}\nfunction hydrateTextInstance(textInstance, text, internalInstanceHandle) {\n precacheFiberNode(internalInstanceHandle, textInstance);\n return diffHydratedText(textInstance, text);\n}\nfunction getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) {\n var node = suspenseInstance.nextSibling; \u002F\u002F Skip past all nodes within this suspense boundary.\n \u002F\u002F There might be nested nodes so we need to keep track of how\n \u002F\u002F deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_END_DATA) {\n if (depth === 0) {\n return getNextHydratableSibling(node);\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n depth++;\n }\n }\n\n node = node.nextSibling;\n } \u002F\u002F TODO: Warn, we didn't find the end comment boundary.\n\n\n return null;\n} \u002F\u002F Returns the SuspenseInstance if this node is a direct child of a\n\u002F\u002F SuspenseInstance. I.e. if its previous sibling is a Comment with\n\u002F\u002F SUSPENSE_x_START_DATA. Otherwise, null.\n\nfunction getParentSuspenseInstance(targetInstance) {\n var node = targetInstance.previousSibling; \u002F\u002F Skip past all nodes within this suspense boundary.\n \u002F\u002F There might be nested nodes so we need to keep track of how\n \u002F\u002F deep we are and only break out when we're back on top.\n\n var depth = 0;\n\n while (node) {\n if (node.nodeType === COMMENT_NODE) {\n var data = node.data;\n\n if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) {\n if (depth === 0) {\n return node;\n } else {\n depth--;\n }\n } else if (data === SUSPENSE_END_DATA) {\n depth++;\n }\n }\n\n node = node.previousSibling;\n }\n\n return null;\n}\nfunction commitHydratedContainer(container) {\n \u002F\u002F Retry if any event replaying was blocked on this.\n retryIfBlockedOn(container);\n}\nfunction commitHydratedSuspenseInstance(suspenseInstance) {\n \u002F\u002F Retry if any event replaying was blocked on this.\n retryIfBlockedOn(suspenseInstance);\n}\nfunction didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text) {\n {\n warnForUnmatchedText(textInstance, text);\n }\n}\nfunction didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForUnmatchedText(textInstance, text);\n }\n}\nfunction didNotHydrateContainerInstance(parentContainer, instance) {\n {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentContainer, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentContainer, instance);\n }\n }\n}\nfunction didNotHydrateInstance(parentType, parentProps, parentInstance, instance) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n if (instance.nodeType === ELEMENT_NODE) {\n warnForDeletedHydratableElement(parentInstance, instance);\n } else if (instance.nodeType === COMMENT_NODE) ; else {\n warnForDeletedHydratableText(parentInstance, instance);\n }\n }\n}\nfunction didNotFindHydratableContainerInstance(parentContainer, type, props) {\n {\n warnForInsertedHydratedElement(parentContainer, type);\n }\n}\nfunction didNotFindHydratableContainerTextInstance(parentContainer, text) {\n {\n warnForInsertedHydratedText(parentContainer, text);\n }\n}\nfunction didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedElement(parentInstance, type);\n }\n}\nfunction didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) {\n warnForInsertedHydratedText(parentInstance, text);\n }\n}\nfunction didNotFindHydratableSuspenseInstance(parentType, parentProps, parentInstance) {\n if ( parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) ;\n}\nvar clientId = 0;\nfunction makeClientIdInDEV(warnOnAccessInDEV) {\n var id = 'r:' + (clientId++).toString(36);\n return {\n toString: function () {\n warnOnAccessInDEV();\n return id;\n },\n valueOf: function () {\n warnOnAccessInDEV();\n return id;\n }\n };\n}\nfunction isOpaqueHydratingObject(value) {\n return value !== null && typeof value === 'object' && value.$typeof === REACT_OPAQUE_ID_TYPE;\n}\nfunction makeOpaqueHydratingObject(attemptToReadValue) {\n return {\n $typeof: REACT_OPAQUE_ID_TYPE,\n toString: attemptToReadValue,\n valueOf: attemptToReadValue\n };\n}\nfunction preparePortalMount(portalInstance) {\n {\n listenToAllSupportedEvents(portalInstance);\n }\n}\n\nvar randomKey = Math.random().toString(36).slice(2);\nvar internalInstanceKey = '__reactFiber
+ randomKey;\nvar internalPropsKey = '__reactProps
+ randomKey;\nvar internalContainerInstanceKey = '__reactContainer
+ randomKey;\nvar internalEventHandlersKey = '__reactEvents
+ randomKey;\nfunction precacheFiberNode(hostInst, node) {\n node[internalInstanceKey] = hostInst;\n}\nfunction markContainerAsRoot(hostRoot, node) {\n node[internalContainerInstanceKey] = hostRoot;\n}\nfunction unmarkContainerAsRoot(node) {\n node[internalContainerInstanceKey] = null;\n}\nfunction isContainerMarkedAsRoot(node) {\n return !!node[internalContainerInstanceKey];\n} \u002F\u002F Given a DOM node, return the closest HostComponent or HostText fiber ancestor.\n\u002F\u002F If the target node is part of a hydrated or not yet rendered subtree, then\n\u002F\u002F this may also return a SuspenseComponent or HostRoot to indicate that.\n\u002F\u002F Conceptually the HostRoot fiber is a child of the Container node. So if you\n\u002F\u002F pass the Container node as the targetNode, you will not actually get the\n\u002F\u002F HostRoot back. To get to the HostRoot, you need to pass a child of it.\n\u002F\u002F The same thing applies to Suspense boundaries.\n\nfunction getClosestInstanceFromNode(targetNode) {\n var targetInst = targetNode[internalInstanceKey];\n\n if (targetInst) {\n \u002F\u002F Don't return HostRoot or SuspenseComponent here.\n return targetInst;\n } \u002F\u002F If the direct event target isn't a React owned DOM node, we need to look\n \u002F\u002F to see if one of its parents is a React owned DOM node.\n\n\n var parentNode = targetNode.parentNode;\n\n while (parentNode) {\n \u002F\u002F We'll check if this is a container root that could include\n \u002F\u002F React nodes in the future. We need to check this first because\n \u002F\u002F if we're a child of a dehydrated container, we need to first\n \u002F\u002F find that inner container before moving on to finding the parent\n \u002F\u002F instance. Note that we don't check this field on the targetNode\n \u002F\u002F itself because the fibers are conceptually between the container\n \u002F\u002F node and the first child. It isn't surrounding the container node.\n \u002F\u002F If it's not a container, we check if it's an instance.\n targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey];\n\n if (targetInst) {\n \u002F\u002F Since this wasn't the direct target of the event, we might have\n \u002F\u002F stepped past dehydrated DOM nodes to get here. However they could\n \u002F\u002F also have been non-React nodes. We need to answer which one.\n \u002F\u002F If we the instance doesn't have any children, then there can't be\n \u002F\u002F a nested suspense boundary within it. So we can use this as a fast\n \u002F\u002F bailout. Most of the time, when people add non-React children to\n \u002F\u002F the tree, it is using a ref to a child-less DOM node.\n \u002F\u002F Normally we'd only need to check one of the fibers because if it\n \u002F\u002F has ever gone from having children to deleting them or vice versa\n \u002F\u002F it would have deleted the dehydrated boundary nested inside already.\n \u002F\u002F However, since the HostRoot starts out with an alternate it might\n \u002F\u002F have one on the alternate so we need to check in case this was a\n \u002F\u002F root.\n var alternate = targetInst.alternate;\n\n if (targetInst.child !== null || alternate !== null && alternate.child !== null) {\n \u002F\u002F Next we need to figure out if the node that skipped past is\n \u002F\u002F nested within a dehydrated boundary and if so, which one.\n var suspenseInstance = getParentSuspenseInstance(targetNode);\n\n while (suspenseInstance !== null) {\n \u002F\u002F We found a suspense instance. That means that we haven't\n \u002F\u002F hydrated it yet. Even though we leave the comments in the\n \u002F\u002F DOM after hydrating, and there are boundaries in the DOM\n \u002F\u002F that could already be hydrated, we wouldn't have found them\n \u002F\u002F through this pass since if the target is hydrated it would\n \u002F\u002F have had an internalInstanceKey on it.\n \u002F\u002F Let's get the fiber associated with the SuspenseComponent\n \u002F\u002F as the deepest instance.\n var targetSuspenseInst = suspenseInstance[internalInstanceKey];\n\n if (targetSuspenseInst) {\n return targetSuspenseInst;\n } \u002F\u002F If we don't find a Fiber on the comment, it might be because\n \u002F\u002F we haven't gotten to hydrate it yet. There might still be a\n \u002F\u002F parent boundary that hasn't above this one so we need to find\n \u002F\u002F the outer most that is known.\n\n\n suspenseInstance = getParentSuspenseInstance(suspenseInstance); \u002F\u002F If we don't find one, then that should mean that the parent\n \u002F\u002F host component also hasn't hydrated yet. We can return it\n \u002F\u002F below since it will bail out on the isMounted check later.\n }\n }\n\n return targetInst;\n }\n\n targetNode = parentNode;\n parentNode = targetNode.parentNode;\n }\n\n return null;\n}\n\u002F**\n * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent\n * instance, or null if the node was not rendered by this React.\n *\u002F\n\nfunction getInstanceFromNode(node) {\n var inst = node[internalInstanceKey] || node[internalContainerInstanceKey];\n\n if (inst) {\n if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) {\n return inst;\n } else {\n return null;\n }\n }\n\n return null;\n}\n\u002F**\n * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding\n * DOM node.\n *\u002F\n\nfunction getNodeFromInstance(inst) {\n if (inst.tag === HostComponent || inst.tag === HostText) {\n \u002F\u002F In Fiber this, is just the state node right now. We assume it will be\n \u002F\u002F a host component or host text.\n return inst.stateNode;\n } \u002F\u002F Without this first invariant, passing a non-DOM-component triggers the next\n \u002F\u002F invariant for a missing parent, which is super confusing.\n\n\n {\n {\n throw Error( \"getNodeFromInstance: Invalid argument.\" );\n }\n }\n}\nfunction getFiberCurrentPropsFromNode(node) {\n return node[internalPropsKey] || null;\n}\nfunction updateFiberProps(node, props) {\n node[internalPropsKey] = props;\n}\nfunction getEventListenerSet(node) {\n var elementListenerSet = node[internalEventHandlersKey];\n\n if (elementListenerSet === undefined) {\n elementListenerSet = node[internalEventHandlersKey] = new Set();\n }\n\n return elementListenerSet;\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n \u002F\u002F $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; \u002F\u002F Prop type validation may throw. In case they do, we don't want to\n \u002F\u002F fail the render phase where it didn't fail before. So we log it.\n \u002F\u002F After these have been cleaned up, we'll let them throw.\n\n try {\n \u002F\u002F This is intentionally an invariant that gets caught. It's the same\n \u002F\u002F behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n \u002F\u002F Only monitor this failure once because there tends to be a lot of the\n \u002F\u002F same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar valueStack = [];\nvar fiberStack;\n\n{\n fiberStack = [];\n}\n\nvar index = -1;\n\nfunction createCursor(defaultValue) {\n return {\n current: defaultValue\n };\n}\n\nfunction pop(cursor, fiber) {\n if (index \u003C 0) {\n {\n error('Unexpected pop.');\n }\n\n return;\n }\n\n {\n if (fiber !== fiberStack[index]) {\n error('Unexpected Fiber popped.');\n }\n }\n\n cursor.current = valueStack[index];\n valueStack[index] = null;\n\n {\n fiberStack[index] = null;\n }\n\n index--;\n}\n\nfunction push(cursor, value, fiber) {\n index++;\n valueStack[index] = cursor.current;\n\n {\n fiberStack[index] = fiber;\n }\n\n cursor.current = value;\n}\n\nvar warnedAboutMissingGetChildContext;\n\n{\n warnedAboutMissingGetChildContext = {};\n}\n\nvar emptyContextObject = {};\n\n{\n Object.freeze(emptyContextObject);\n} \u002F\u002F A cursor to the current merged context object on the stack.\n\n\nvar contextStackCursor = createCursor(emptyContextObject); \u002F\u002F A cursor to a boolean indicating whether the context has changed.\n\nvar didPerformWorkStackCursor = createCursor(false); \u002F\u002F Keep track of the previous context object that was on the stack.\n\u002F\u002F We use this to get access to the parent context after we have already\n\u002F\u002F pushed the next context provider, and now need to merge their contexts.\n\nvar previousContext = emptyContextObject;\n\nfunction getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) {\n {\n if (didPushOwnContextIfProvider && isContextProvider(Component)) {\n \u002F\u002F If the fiber is a context provider itself, when we read its context\n \u002F\u002F we may have already pushed its own child context on the stack. A context\n \u002F\u002F provider should not \"see\" its own child context. Therefore we read the\n \u002F\u002F previous (parent) context instead for a context provider.\n return previousContext;\n }\n\n return contextStackCursor.current;\n }\n}\n\nfunction cacheContext(workInProgress, unmaskedContext, maskedContext) {\n {\n var instance = workInProgress.stateNode;\n instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext;\n instance.__reactInternalMemoizedMaskedChildContext = maskedContext;\n }\n}\n\nfunction getMaskedContext(workInProgress, unmaskedContext) {\n {\n var type = workInProgress.type;\n var contextTypes = type.contextTypes;\n\n if (!contextTypes) {\n return emptyContextObject;\n } \u002F\u002F Avoid recreating masked context unless unmasked context has changed.\n \u002F\u002F Failing to do this will result in unnecessary calls to componentWillReceiveProps.\n \u002F\u002F This may trigger infinite loops if componentWillReceiveProps calls setState.\n\n\n var instance = workInProgress.stateNode;\n\n if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) {\n return instance.__reactInternalMemoizedMaskedChildContext;\n }\n\n var context = {};\n\n for (var key in contextTypes) {\n context[key] = unmaskedContext[key];\n }\n\n {\n var name = getComponentName(type) || 'Unknown';\n checkPropTypes(contextTypes, context, 'context', name);\n } \u002F\u002F Cache unmasked context so we can avoid recreating masked context unless necessary.\n \u002F\u002F Context is created before the class component is instantiated so check for instance.\n\n\n if (instance) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return context;\n }\n}\n\nfunction hasContextChanged() {\n {\n return didPerformWorkStackCursor.current;\n }\n}\n\nfunction isContextProvider(type) {\n {\n var childContextTypes = type.childContextTypes;\n return childContextTypes !== null && childContextTypes !== undefined;\n }\n}\n\nfunction popContext(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction popTopLevelContextObject(fiber) {\n {\n pop(didPerformWorkStackCursor, fiber);\n pop(contextStackCursor, fiber);\n }\n}\n\nfunction pushTopLevelContextObject(fiber, context, didChange) {\n {\n if (!(contextStackCursor.current === emptyContextObject)) {\n {\n throw Error( \"Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n push(contextStackCursor, context, fiber);\n push(didPerformWorkStackCursor, didChange, fiber);\n }\n}\n\nfunction processChildContext(fiber, type, parentContext) {\n {\n var instance = fiber.stateNode;\n var childContextTypes = type.childContextTypes; \u002F\u002F TODO (bvaughn) Replace this behavior with an invariant() in the future.\n \u002F\u002F It has only been added in Fiber to match the (unintentional) behavior in Stack.\n\n if (typeof instance.getChildContext !== 'function') {\n {\n var componentName = getComponentName(type) || 'Unknown';\n\n if (!warnedAboutMissingGetChildContext[componentName]) {\n warnedAboutMissingGetChildContext[componentName] = true;\n\n error('%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);\n }\n }\n\n return parentContext;\n }\n\n var childContext = instance.getChildContext();\n\n for (var contextKey in childContext) {\n if (!(contextKey in childContextTypes)) {\n {\n throw Error( (getComponentName(type) || 'Unknown') + \".getChildContext(): key \\\"\" + contextKey + \"\\\" is not defined in childContextTypes.\" );\n }\n }\n }\n\n {\n var name = getComponentName(type) || 'Unknown';\n checkPropTypes(childContextTypes, childContext, 'child context', name);\n }\n\n return _assign({}, parentContext, childContext);\n }\n}\n\nfunction pushContextProvider(workInProgress) {\n {\n var instance = workInProgress.stateNode; \u002F\u002F We push the context as early as possible to ensure stack integrity.\n \u002F\u002F If the instance does not exist yet, we will push null at first,\n \u002F\u002F and replace it on the stack later when invalidating the context.\n\n var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; \u002F\u002F Remember the parent context so we can merge with it later.\n \u002F\u002F Inherit the parent's did-perform-work value to avoid inadvertently blocking updates.\n\n previousContext = contextStackCursor.current;\n push(contextStackCursor, memoizedMergedChildContext, workInProgress);\n push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress);\n return true;\n }\n}\n\nfunction invalidateContextProvider(workInProgress, type, didChange) {\n {\n var instance = workInProgress.stateNode;\n\n if (!instance) {\n {\n throw Error( \"Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n if (didChange) {\n \u002F\u002F Merge parent and own context.\n \u002F\u002F Skip this if we're not updating due to sCU.\n \u002F\u002F This avoids unnecessarily recomputing memoized values.\n var mergedContext = processChildContext(workInProgress, type, previousContext);\n instance.__reactInternalMemoizedMergedChildContext = mergedContext; \u002F\u002F Replace the old (or empty) context with the new one.\n \u002F\u002F It is important to unwind the context in the reverse order.\n\n pop(didPerformWorkStackCursor, workInProgress);\n pop(contextStackCursor, workInProgress); \u002F\u002F Now push the new context and mark that it has changed.\n\n push(contextStackCursor, mergedContext, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n } else {\n pop(didPerformWorkStackCursor, workInProgress);\n push(didPerformWorkStackCursor, didChange, workInProgress);\n }\n }\n}\n\nfunction findCurrentUnmaskedContext(fiber) {\n {\n \u002F\u002F Currently this is only used with renderSubtreeIntoContainer; not sure if it\n \u002F\u002F makes sense elsewhere\n if (!(isFiberMounted(fiber) && fiber.tag === ClassComponent)) {\n {\n throw Error( \"Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var node = fiber;\n\n do {\n switch (node.tag) {\n case HostRoot:\n return node.stateNode.context;\n\n case ClassComponent:\n {\n var Component = node.type;\n\n if (isContextProvider(Component)) {\n return node.stateNode.__reactInternalMemoizedMergedChildContext;\n }\n\n break;\n }\n }\n\n node = node.return;\n } while (node !== null);\n\n {\n {\n throw Error( \"Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n }\n}\n\nvar LegacyRoot = 0;\nvar BlockingRoot = 1;\nvar ConcurrentRoot = 2;\n\nvar rendererID = null;\nvar injectedHook = null;\nvar hasLoggedError = false;\nvar isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined';\nfunction injectInternals(internals) {\n if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {\n \u002F\u002F No DevTools\n return false;\n }\n\n var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook.isDisabled) {\n \u002F\u002F This isn't a real property on the hook, but it can be set to opt out\n \u002F\u002F of DevTools integration and associated warnings and logs.\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F3877\n return true;\n }\n\n if (!hook.supportsFiber) {\n {\n error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Freact-devtools');\n } \u002F\u002F DevTools exists, even though it doesn't support Fiber.\n\n\n return true;\n }\n\n try {\n rendererID = hook.inject(internals); \u002F\u002F We have successfully injected, so now it is safe to set up hooks.\n\n injectedHook = hook;\n } catch (err) {\n \u002F\u002F Catch all errors because it is unsafe to throw during initialization.\n {\n error('React instrumentation encountered an error: %s.', err);\n }\n } \u002F\u002F DevTools exists\n\n\n return true;\n}\nfunction onScheduleRoot(root, children) {\n {\n if (injectedHook && typeof injectedHook.onScheduleFiberRoot === 'function') {\n try {\n injectedHook.onScheduleFiberRoot(rendererID, root, children);\n } catch (err) {\n if ( !hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n}\nfunction onCommitRoot(root, priorityLevel) {\n if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') {\n try {\n var didError = (root.current.flags & DidCapture) === DidCapture;\n\n if (enableProfilerTimer) {\n injectedHook.onCommitFiberRoot(rendererID, root, priorityLevel, didError);\n } else {\n injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError);\n }\n } catch (err) {\n {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n}\nfunction onCommitUnmount(fiber) {\n if (injectedHook && typeof injectedHook.onCommitFiberUnmount === 'function') {\n try {\n injectedHook.onCommitFiberUnmount(rendererID, fiber);\n } catch (err) {\n {\n if (!hasLoggedError) {\n hasLoggedError = true;\n\n error('React instrumentation encountered an error: %s', err);\n }\n }\n }\n }\n}\n\nvar Scheduler_runWithPriority = Scheduler.unstable_runWithPriority,\n Scheduler_scheduleCallback = Scheduler.unstable_scheduleCallback,\n Scheduler_cancelCallback = Scheduler.unstable_cancelCallback,\n Scheduler_shouldYield = Scheduler.unstable_shouldYield,\n Scheduler_requestPaint = Scheduler.unstable_requestPaint,\n Scheduler_now$1 = Scheduler.unstable_now,\n Scheduler_getCurrentPriorityLevel = Scheduler.unstable_getCurrentPriorityLevel,\n Scheduler_ImmediatePriority = Scheduler.unstable_ImmediatePriority,\n Scheduler_UserBlockingPriority = Scheduler.unstable_UserBlockingPriority,\n Scheduler_NormalPriority = Scheduler.unstable_NormalPriority,\n Scheduler_LowPriority = Scheduler.unstable_LowPriority,\n Scheduler_IdlePriority = Scheduler.unstable_IdlePriority;\n\n{\n \u002F\u002F Provide explicit error message when production+profiling bundle of e.g.\n \u002F\u002F react-dom is used with production (non-profiling) bundle of\n \u002F\u002F scheduler\u002Ftracing\n if (!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null)) {\n {\n throw Error( \"It is not supported to run the profiling version of a renderer (for example, `react-dom\u002Fprofiling`) without also replacing the `scheduler\u002Ftracing` module with `scheduler\u002Ftracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at https:\u002F\u002Freactjs.org\u002Flink\u002Fprofiling\" );\n }\n }\n}\n\nvar fakeCallbackNode = {}; \u002F\u002F Except for NoPriority, these correspond to Scheduler priorities. We use\n\u002F\u002F ascending numbers so we can compare them like numbers. They start at 90 to\n\u002F\u002F avoid clashing with Scheduler's priorities.\n\nvar ImmediatePriority$1 = 99;\nvar UserBlockingPriority$2 = 98;\nvar NormalPriority$1 = 97;\nvar LowPriority$1 = 96;\nvar IdlePriority$1 = 95; \u002F\u002F NoPriority is the absence of priority. Also React-only.\n\nvar NoPriority$1 = 90;\nvar shouldYield = Scheduler_shouldYield;\nvar requestPaint = \u002F\u002F Fall back gracefully if we're running an older version of Scheduler.\nScheduler_requestPaint !== undefined ? Scheduler_requestPaint : function () {};\nvar syncQueue = null;\nvar immediateQueueCallbackNode = null;\nvar isFlushingSyncQueue = false;\nvar initialTimeMs$1 = Scheduler_now$1(); \u002F\u002F If the initial timestamp is reasonably small, use Scheduler's `now` directly.\n\u002F\u002F This will be the case for modern browsers that support `performance.now`. In\n\u002F\u002F older browsers, Scheduler falls back to `Date.now`, which returns a Unix\n\u002F\u002F timestamp. In that case, subtract the module initialization time to simulate\n\u002F\u002F the behavior of performance.now and keep our times small enough to fit\n\u002F\u002F within 32 bits.\n\u002F\u002F TODO: Consider lifting this into Scheduler.\n\nvar now = initialTimeMs$1 \u003C 10000 ? Scheduler_now$1 : function () {\n return Scheduler_now$1() - initialTimeMs$1;\n};\nfunction getCurrentPriorityLevel() {\n switch (Scheduler_getCurrentPriorityLevel()) {\n case Scheduler_ImmediatePriority:\n return ImmediatePriority$1;\n\n case Scheduler_UserBlockingPriority:\n return UserBlockingPriority$2;\n\n case Scheduler_NormalPriority:\n return NormalPriority$1;\n\n case Scheduler_LowPriority:\n return LowPriority$1;\n\n case Scheduler_IdlePriority:\n return IdlePriority$1;\n\n default:\n {\n {\n throw Error( \"Unknown priority level.\" );\n }\n }\n\n }\n}\n\nfunction reactPriorityToSchedulerPriority(reactPriorityLevel) {\n switch (reactPriorityLevel) {\n case ImmediatePriority$1:\n return Scheduler_ImmediatePriority;\n\n case UserBlockingPriority$2:\n return Scheduler_UserBlockingPriority;\n\n case NormalPriority$1:\n return Scheduler_NormalPriority;\n\n case LowPriority$1:\n return Scheduler_LowPriority;\n\n case IdlePriority$1:\n return Scheduler_IdlePriority;\n\n default:\n {\n {\n throw Error( \"Unknown priority level.\" );\n }\n }\n\n }\n}\n\nfunction runWithPriority$1(reactPriorityLevel, fn) {\n var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n return Scheduler_runWithPriority(priorityLevel, fn);\n}\nfunction scheduleCallback(reactPriorityLevel, callback, options) {\n var priorityLevel = reactPriorityToSchedulerPriority(reactPriorityLevel);\n return Scheduler_scheduleCallback(priorityLevel, callback, options);\n}\nfunction scheduleSyncCallback(callback) {\n \u002F\u002F Push this callback into an internal queue. We'll flush these either in\n \u002F\u002F the next tick, or earlier if something calls `flushSyncCallbackQueue`.\n if (syncQueue === null) {\n syncQueue = [callback]; \u002F\u002F Flush the queue in the next tick, at the earliest.\n\n immediateQueueCallbackNode = Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueueImpl);\n } else {\n \u002F\u002F Push onto existing queue. Don't need to schedule a callback because\n \u002F\u002F we already scheduled one when we created the queue.\n syncQueue.push(callback);\n }\n\n return fakeCallbackNode;\n}\nfunction cancelCallback(callbackNode) {\n if (callbackNode !== fakeCallbackNode) {\n Scheduler_cancelCallback(callbackNode);\n }\n}\nfunction flushSyncCallbackQueue() {\n if (immediateQueueCallbackNode !== null) {\n var node = immediateQueueCallbackNode;\n immediateQueueCallbackNode = null;\n Scheduler_cancelCallback(node);\n }\n\n flushSyncCallbackQueueImpl();\n}\n\nfunction flushSyncCallbackQueueImpl() {\n if (!isFlushingSyncQueue && syncQueue !== null) {\n \u002F\u002F Prevent re-entrancy.\n isFlushingSyncQueue = true;\n var i = 0;\n\n {\n try {\n var _isSync2 = true;\n var _queue = syncQueue;\n runWithPriority$1(ImmediatePriority$1, function () {\n for (; i \u003C _queue.length; i++) {\n var callback = _queue[i];\n\n do {\n callback = callback(_isSync2);\n } while (callback !== null);\n }\n });\n syncQueue = null;\n } catch (error) {\n \u002F\u002F If something throws, leave the remaining callbacks on the queue.\n if (syncQueue !== null) {\n syncQueue = syncQueue.slice(i + 1);\n } \u002F\u002F Resume flushing in the next tick\n\n\n Scheduler_scheduleCallback(Scheduler_ImmediatePriority, flushSyncCallbackQueue);\n throw error;\n } finally {\n isFlushingSyncQueue = false;\n }\n }\n }\n}\n\n\u002F\u002F TODO: this is special because it gets imported during build.\nvar ReactVersion = '17.0.2';\n\nvar NoMode = 0;\nvar StrictMode = 1; \u002F\u002F TODO: Remove BlockingMode and ConcurrentMode by reading from the root\n\u002F\u002F tag instead\n\nvar BlockingMode = 2;\nvar ConcurrentMode = 4;\nvar ProfileMode = 8;\nvar DebugTracingMode = 16;\n\nvar ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig;\nvar NoTransition = 0;\nfunction requestCurrentTransition() {\n return ReactCurrentBatchConfig.transition;\n}\n\nvar ReactStrictModeWarnings = {\n recordUnsafeLifecycleWarnings: function (fiber, instance) {},\n flushPendingUnsafeLifecycleWarnings: function () {},\n recordLegacyContextWarning: function (fiber, instance) {},\n flushLegacyContextWarning: function () {},\n discardPendingWarnings: function () {}\n};\n\n{\n var findStrictRoot = function (fiber) {\n var maybeStrictRoot = null;\n var node = fiber;\n\n while (node !== null) {\n if (node.mode & StrictMode) {\n maybeStrictRoot = node;\n }\n\n node = node.return;\n }\n\n return maybeStrictRoot;\n };\n\n var setToSortedString = function (set) {\n var array = [];\n set.forEach(function (value) {\n array.push(value);\n });\n return array.sort().join(', ');\n };\n\n var pendingComponentWillMountWarnings = [];\n var pendingUNSAFE_ComponentWillMountWarnings = [];\n var pendingComponentWillReceivePropsWarnings = [];\n var pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n var pendingComponentWillUpdateWarnings = [];\n var pendingUNSAFE_ComponentWillUpdateWarnings = []; \u002F\u002F Tracks components we have already warned about.\n\n var didWarnAboutUnsafeLifecycles = new Set();\n\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) {\n \u002F\u002F Dedup strategy: Warn once per component.\n if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {\n return;\n }\n\n if (typeof instance.componentWillMount === 'function' && \u002F\u002F Don't warn about react-lifecycles-compat polyfilled components.\n instance.componentWillMount.__suppressDeprecationWarning !== true) {\n pendingComponentWillMountWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillMount === 'function') {\n pendingUNSAFE_ComponentWillMountWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n pendingComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber);\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n pendingComponentWillUpdateWarnings.push(fiber);\n }\n\n if (fiber.mode & StrictMode && typeof instance.UNSAFE_componentWillUpdate === 'function') {\n pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () {\n \u002F\u002F We do an initial pass to gather component names\n var componentWillMountUniqueNames = new Set();\n\n if (pendingComponentWillMountWarnings.length \u003E 0) {\n pendingComponentWillMountWarnings.forEach(function (fiber) {\n componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillMountWarnings = [];\n }\n\n var UNSAFE_componentWillMountUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillMountWarnings.length \u003E 0) {\n pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) {\n UNSAFE_componentWillMountUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillMountWarnings = [];\n }\n\n var componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingComponentWillReceivePropsWarnings.length \u003E 0) {\n pendingComponentWillReceivePropsWarnings.forEach(function (fiber) {\n componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillReceivePropsWarnings = [];\n }\n\n var UNSAFE_componentWillReceivePropsUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length \u003E 0) {\n pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) {\n UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n }\n\n var componentWillUpdateUniqueNames = new Set();\n\n if (pendingComponentWillUpdateWarnings.length \u003E 0) {\n pendingComponentWillUpdateWarnings.forEach(function (fiber) {\n componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingComponentWillUpdateWarnings = [];\n }\n\n var UNSAFE_componentWillUpdateUniqueNames = new Set();\n\n if (pendingUNSAFE_ComponentWillUpdateWarnings.length \u003E 0) {\n pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) {\n UNSAFE_componentWillUpdateUniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutUnsafeLifecycles.add(fiber.type);\n });\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n } \u002F\u002F Finally, we flush all the warnings\n \u002F\u002F UNSAFE_ ones before the deprecated ones, since they'll be 'louder'\n\n\n if (UNSAFE_componentWillMountUniqueNames.size \u003E 0) {\n var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames);\n\n error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https:\u002F\u002Freactjs.org\u002Flink\u002Funsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '\\nPlease update the following components: %s', sortedNames);\n }\n\n if (UNSAFE_componentWillReceivePropsUniqueNames.size \u003E 0) {\n var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames);\n\n error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https:\u002F\u002Freactjs.org\u002Flink\u002Funsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, \" + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https:\u002F\u002Freactjs.org\u002Flink\u002Fderived-state\\n' + '\\nPlease update the following components: %s', _sortedNames);\n }\n\n if (UNSAFE_componentWillUpdateUniqueNames.size \u003E 0) {\n var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames);\n\n error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https:\u002F\u002Freactjs.org\u002Flink\u002Funsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '\\nPlease update the following components: %s', _sortedNames2);\n }\n\n if (componentWillMountUniqueNames.size \u003E 0) {\n var _sortedNames3 = setToSortedString(componentWillMountUniqueNames);\n\n warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https:\u002F\u002Freactjs.org\u002Flink\u002Funsafe-component-lifecycles for details.\\n\\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames3);\n }\n\n if (componentWillReceivePropsUniqueNames.size \u003E 0) {\n var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames);\n\n warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https:\u002F\u002Freactjs.org\u002Flink\u002Funsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + \"* If you're updating state whenever props change, refactor your \" + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https:\u002F\u002Freactjs.org\u002Flink\u002Fderived-state\\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames4);\n }\n\n if (componentWillUpdateUniqueNames.size \u003E 0) {\n var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames);\n\n warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https:\u002F\u002Freactjs.org\u002Flink\u002Funsafe-component-lifecycles for details.\\n\\n' + '* Move data fetching code or side effects to componentDidUpdate.\\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\\n' + '\\nPlease update the following components: %s', _sortedNames5);\n }\n };\n\n var pendingLegacyContextWarning = new Map(); \u002F\u002F Tracks components we have already warned about.\n\n var didWarnAboutLegacyContext = new Set();\n\n ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) {\n var strictRoot = findStrictRoot(fiber);\n\n if (strictRoot === null) {\n error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.');\n\n return;\n } \u002F\u002F Dedup strategy: Warn once per component.\n\n\n if (didWarnAboutLegacyContext.has(fiber.type)) {\n return;\n }\n\n var warningsForRoot = pendingLegacyContextWarning.get(strictRoot);\n\n if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') {\n if (warningsForRoot === undefined) {\n warningsForRoot = [];\n pendingLegacyContextWarning.set(strictRoot, warningsForRoot);\n }\n\n warningsForRoot.push(fiber);\n }\n };\n\n ReactStrictModeWarnings.flushLegacyContextWarning = function () {\n pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) {\n if (fiberArray.length === 0) {\n return;\n }\n\n var firstFiber = fiberArray[0];\n var uniqueNames = new Set();\n fiberArray.forEach(function (fiber) {\n uniqueNames.add(getComponentName(fiber.type) || 'Component');\n didWarnAboutLegacyContext.add(fiber.type);\n });\n var sortedNames = setToSortedString(uniqueNames);\n\n try {\n setCurrentFiber(firstFiber);\n\n error('Legacy context API has been detected within a strict-mode tree.' + '\\n\\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\\n\\nPlease update the following components: %s' + '\\n\\nLearn more about this warning here: https:\u002F\u002Freactjs.org\u002Flink\u002Flegacy-context', sortedNames);\n } finally {\n resetCurrentFiber();\n }\n });\n };\n\n ReactStrictModeWarnings.discardPendingWarnings = function () {\n pendingComponentWillMountWarnings = [];\n pendingUNSAFE_ComponentWillMountWarnings = [];\n pendingComponentWillReceivePropsWarnings = [];\n pendingUNSAFE_ComponentWillReceivePropsWarnings = [];\n pendingComponentWillUpdateWarnings = [];\n pendingUNSAFE_ComponentWillUpdateWarnings = [];\n pendingLegacyContextWarning = new Map();\n };\n}\n\nfunction resolveDefaultProps(Component, baseProps) {\n if (Component && Component.defaultProps) {\n \u002F\u002F Resolve default props. Taken from ReactElement\n var props = _assign({}, baseProps);\n\n var defaultProps = Component.defaultProps;\n\n for (var propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n\n return props;\n }\n\n return baseProps;\n}\n\n\u002F\u002F Max 31 bit integer. The max integer size in V8 for 32-bit systems.\n\u002F\u002F Math.pow(2, 30) - 1\n\u002F\u002F 0b111111111111111111111111111111\nvar MAX_SIGNED_31_BIT_INT = 1073741823;\n\nvar valueCursor = createCursor(null);\nvar rendererSigil;\n\n{\n \u002F\u002F Use this to detect multiple renderers using the same context\n rendererSigil = {};\n}\n\nvar currentlyRenderingFiber = null;\nvar lastContextDependency = null;\nvar lastContextWithAllBitsObserved = null;\nvar isDisallowedContextReadInDEV = false;\nfunction resetContextDependencies() {\n \u002F\u002F This is called right before React yields execution, to ensure `readContext`\n \u002F\u002F cannot be called outside the render phase.\n currentlyRenderingFiber = null;\n lastContextDependency = null;\n lastContextWithAllBitsObserved = null;\n\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction enterDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = true;\n }\n}\nfunction exitDisallowedContextReadInDEV() {\n {\n isDisallowedContextReadInDEV = false;\n }\n}\nfunction pushProvider(providerFiber, nextValue) {\n var context = providerFiber.type._context;\n\n {\n push(valueCursor, context._currentValue, providerFiber);\n context._currentValue = nextValue;\n\n {\n if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) {\n error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.');\n }\n\n context._currentRenderer = rendererSigil;\n }\n }\n}\nfunction popProvider(providerFiber) {\n var currentValue = valueCursor.current;\n pop(valueCursor, providerFiber);\n var context = providerFiber.type._context;\n\n {\n context._currentValue = currentValue;\n }\n}\nfunction calculateChangedBits(context, newValue, oldValue) {\n if (objectIs(oldValue, newValue)) {\n \u002F\u002F No change\n return 0;\n } else {\n var changedBits = typeof context._calculateChangedBits === 'function' ? context._calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;\n\n {\n if ((changedBits & MAX_SIGNED_31_BIT_INT) !== changedBits) {\n error('calculateChangedBits: Expected the return value to be a ' + '31-bit integer. Instead received: %s', changedBits);\n }\n }\n\n return changedBits | 0;\n }\n}\nfunction scheduleWorkOnParentPath(parent, renderLanes) {\n \u002F\u002F Update the child lanes of all the ancestors, including the alternates.\n var node = parent;\n\n while (node !== null) {\n var alternate = node.alternate;\n\n if (!isSubsetOfLanes(node.childLanes, renderLanes)) {\n node.childLanes = mergeLanes(node.childLanes, renderLanes);\n\n if (alternate !== null) {\n alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);\n }\n } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) {\n alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes);\n } else {\n \u002F\u002F Neither alternate was updated, which means the rest of the\n \u002F\u002F ancestor path already has sufficient priority.\n break;\n }\n\n node = node.return;\n }\n}\nfunction propagateContextChange(workInProgress, context, changedBits, renderLanes) {\n var fiber = workInProgress.child;\n\n if (fiber !== null) {\n \u002F\u002F Set the return pointer of the child to the work-in-progress fiber.\n fiber.return = workInProgress;\n }\n\n while (fiber !== null) {\n var nextFiber = void 0; \u002F\u002F Visit this fiber.\n\n var list = fiber.dependencies;\n\n if (list !== null) {\n nextFiber = fiber.child;\n var dependency = list.firstContext;\n\n while (dependency !== null) {\n \u002F\u002F Check if the context matches.\n if (dependency.context === context && (dependency.observedBits & changedBits) !== 0) {\n \u002F\u002F Match! Schedule an update on this fiber.\n if (fiber.tag === ClassComponent) {\n \u002F\u002F Schedule a force update on the work-in-progress.\n var update = createUpdate(NoTimestamp, pickArbitraryLane(renderLanes));\n update.tag = ForceUpdate; \u002F\u002F TODO: Because we don't have a work-in-progress, this will add the\n \u002F\u002F update to the current fiber, too, which means it will persist even if\n \u002F\u002F this render is thrown away. Since it's a race condition, not sure it's\n \u002F\u002F worth fixing.\n\n enqueueUpdate(fiber, update);\n }\n\n fiber.lanes = mergeLanes(fiber.lanes, renderLanes);\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n alternate.lanes = mergeLanes(alternate.lanes, renderLanes);\n }\n\n scheduleWorkOnParentPath(fiber.return, renderLanes); \u002F\u002F Mark the updated lanes on the list, too.\n\n list.lanes = mergeLanes(list.lanes, renderLanes); \u002F\u002F Since we already found a match, we can stop traversing the\n \u002F\u002F dependency list.\n\n break;\n }\n\n dependency = dependency.next;\n }\n } else if (fiber.tag === ContextProvider) {\n \u002F\u002F Don't scan deeper if this is a matching provider\n nextFiber = fiber.type === workInProgress.type ? null : fiber.child;\n } else {\n \u002F\u002F Traverse down.\n nextFiber = fiber.child;\n }\n\n if (nextFiber !== null) {\n \u002F\u002F Set the return pointer of the child to the work-in-progress fiber.\n nextFiber.return = fiber;\n } else {\n \u002F\u002F No child. Traverse to next sibling.\n nextFiber = fiber;\n\n while (nextFiber !== null) {\n if (nextFiber === workInProgress) {\n \u002F\u002F We're back to the root of this subtree. Exit.\n nextFiber = null;\n break;\n }\n\n var sibling = nextFiber.sibling;\n\n if (sibling !== null) {\n \u002F\u002F Set the return pointer of the sibling to the work-in-progress fiber.\n sibling.return = nextFiber.return;\n nextFiber = sibling;\n break;\n } \u002F\u002F No more siblings. Traverse up.\n\n\n nextFiber = nextFiber.return;\n }\n }\n\n fiber = nextFiber;\n }\n}\nfunction prepareToReadContext(workInProgress, renderLanes) {\n currentlyRenderingFiber = workInProgress;\n lastContextDependency = null;\n lastContextWithAllBitsObserved = null;\n var dependencies = workInProgress.dependencies;\n\n if (dependencies !== null) {\n var firstContext = dependencies.firstContext;\n\n if (firstContext !== null) {\n if (includesSomeLane(dependencies.lanes, renderLanes)) {\n \u002F\u002F Context list has a pending update. Mark that this fiber performed work.\n markWorkInProgressReceivedUpdate();\n } \u002F\u002F Reset the work-in-progress list\n\n\n dependencies.firstContext = null;\n }\n }\n}\nfunction readContext(context, observedBits) {\n {\n \u002F\u002F This warning would fire if you read context inside a Hook like useMemo.\n \u002F\u002F Unlike the class check below, it's not enforced in production for perf.\n if (isDisallowedContextReadInDEV) {\n error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n }\n }\n\n if (lastContextWithAllBitsObserved === context) ; else if (observedBits === false || observedBits === 0) ; else {\n var resolvedObservedBits; \u002F\u002F Avoid deopting on observable arguments or heterogeneous types.\n\n if (typeof observedBits !== 'number' || observedBits === MAX_SIGNED_31_BIT_INT) {\n \u002F\u002F Observe all updates.\n lastContextWithAllBitsObserved = context;\n resolvedObservedBits = MAX_SIGNED_31_BIT_INT;\n } else {\n resolvedObservedBits = observedBits;\n }\n\n var contextItem = {\n context: context,\n observedBits: resolvedObservedBits,\n next: null\n };\n\n if (lastContextDependency === null) {\n if (!(currentlyRenderingFiber !== null)) {\n {\n throw Error( \"Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().\" );\n }\n } \u002F\u002F This is the first dependency for this component. Create a new list.\n\n\n lastContextDependency = contextItem;\n currentlyRenderingFiber.dependencies = {\n lanes: NoLanes,\n firstContext: contextItem,\n responders: null\n };\n } else {\n \u002F\u002F Append a new context item.\n lastContextDependency = lastContextDependency.next = contextItem;\n }\n }\n\n return context._currentValue ;\n}\n\nvar UpdateState = 0;\nvar ReplaceState = 1;\nvar ForceUpdate = 2;\nvar CaptureUpdate = 3; \u002F\u002F Global state that is reset at the beginning of calling `processUpdateQueue`.\n\u002F\u002F It should only be read right after calling `processUpdateQueue`, via\n\u002F\u002F `checkHasForceUpdateAfterProcessing`.\n\nvar hasForceUpdate = false;\nvar didWarnUpdateInsideUpdate;\nvar currentlyProcessingQueue;\n\n{\n didWarnUpdateInsideUpdate = false;\n currentlyProcessingQueue = null;\n}\n\nfunction initializeUpdateQueue(fiber) {\n var queue = {\n baseState: fiber.memoizedState,\n firstBaseUpdate: null,\n lastBaseUpdate: null,\n shared: {\n pending: null\n },\n effects: null\n };\n fiber.updateQueue = queue;\n}\nfunction cloneUpdateQueue(current, workInProgress) {\n \u002F\u002F Clone the update queue from current. Unless it's already a clone.\n var queue = workInProgress.updateQueue;\n var currentQueue = current.updateQueue;\n\n if (queue === currentQueue) {\n var clone = {\n baseState: currentQueue.baseState,\n firstBaseUpdate: currentQueue.firstBaseUpdate,\n lastBaseUpdate: currentQueue.lastBaseUpdate,\n shared: currentQueue.shared,\n effects: currentQueue.effects\n };\n workInProgress.updateQueue = clone;\n }\n}\nfunction createUpdate(eventTime, lane) {\n var update = {\n eventTime: eventTime,\n lane: lane,\n tag: UpdateState,\n payload: null,\n callback: null,\n next: null\n };\n return update;\n}\nfunction enqueueUpdate(fiber, update) {\n var updateQueue = fiber.updateQueue;\n\n if (updateQueue === null) {\n \u002F\u002F Only occurs if the fiber has been unmounted.\n return;\n }\n\n var sharedQueue = updateQueue.shared;\n var pending = sharedQueue.pending;\n\n if (pending === null) {\n \u002F\u002F This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n sharedQueue.pending = update;\n\n {\n if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) {\n error('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.');\n\n didWarnUpdateInsideUpdate = true;\n }\n }\n}\nfunction enqueueCapturedUpdate(workInProgress, capturedUpdate) {\n \u002F\u002F Captured updates are updates that are thrown by a child during the render\n \u002F\u002F phase. They should be discarded if the render is aborted. Therefore,\n \u002F\u002F we should only put them on the work-in-progress queue, not the current one.\n var queue = workInProgress.updateQueue; \u002F\u002F Check if the work-in-progress queue is a clone.\n\n var current = workInProgress.alternate;\n\n if (current !== null) {\n var currentQueue = current.updateQueue;\n\n if (queue === currentQueue) {\n \u002F\u002F The work-in-progress queue is the same as current. This happens when\n \u002F\u002F we bail out on a parent fiber that then captures an error thrown by\n \u002F\u002F a child. Since we want to append the update only to the work-in\n \u002F\u002F -progress queue, we need to clone the updates. We usually clone during\n \u002F\u002F processUpdateQueue, but that didn't happen in this case because we\n \u002F\u002F skipped over the parent when we bailed out.\n var newFirst = null;\n var newLast = null;\n var firstBaseUpdate = queue.firstBaseUpdate;\n\n if (firstBaseUpdate !== null) {\n \u002F\u002F Loop through the updates and clone them.\n var update = firstBaseUpdate;\n\n do {\n var clone = {\n eventTime: update.eventTime,\n lane: update.lane,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n\n if (newLast === null) {\n newFirst = newLast = clone;\n } else {\n newLast.next = clone;\n newLast = clone;\n }\n\n update = update.next;\n } while (update !== null); \u002F\u002F Append the captured update the end of the cloned list.\n\n\n if (newLast === null) {\n newFirst = newLast = capturedUpdate;\n } else {\n newLast.next = capturedUpdate;\n newLast = capturedUpdate;\n }\n } else {\n \u002F\u002F There are no base updates.\n newFirst = newLast = capturedUpdate;\n }\n\n queue = {\n baseState: currentQueue.baseState,\n firstBaseUpdate: newFirst,\n lastBaseUpdate: newLast,\n shared: currentQueue.shared,\n effects: currentQueue.effects\n };\n workInProgress.updateQueue = queue;\n return;\n }\n } \u002F\u002F Append the update to the end of the list.\n\n\n var lastBaseUpdate = queue.lastBaseUpdate;\n\n if (lastBaseUpdate === null) {\n queue.firstBaseUpdate = capturedUpdate;\n } else {\n lastBaseUpdate.next = capturedUpdate;\n }\n\n queue.lastBaseUpdate = capturedUpdate;\n}\n\nfunction getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) {\n switch (update.tag) {\n case ReplaceState:\n {\n var payload = update.payload;\n\n if (typeof payload === 'function') {\n \u002F\u002F Updater function\n {\n enterDisallowedContextReadInDEV();\n }\n\n var nextState = payload.call(instance, prevState, nextProps);\n\n {\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n payload.call(instance, prevState, nextProps);\n } finally {\n reenableLogs();\n }\n }\n\n exitDisallowedContextReadInDEV();\n }\n\n return nextState;\n } \u002F\u002F State object\n\n\n return payload;\n }\n\n case CaptureUpdate:\n {\n workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture;\n }\n \u002F\u002F Intentional fallthrough\n\n case UpdateState:\n {\n var _payload = update.payload;\n var partialState;\n\n if (typeof _payload === 'function') {\n \u002F\u002F Updater function\n {\n enterDisallowedContextReadInDEV();\n }\n\n partialState = _payload.call(instance, prevState, nextProps);\n\n {\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n _payload.call(instance, prevState, nextProps);\n } finally {\n reenableLogs();\n }\n }\n\n exitDisallowedContextReadInDEV();\n }\n } else {\n \u002F\u002F Partial state object\n partialState = _payload;\n }\n\n if (partialState === null || partialState === undefined) {\n \u002F\u002F Null and undefined are treated as no-ops.\n return prevState;\n } \u002F\u002F Merge the partial state and the previous state.\n\n\n return _assign({}, prevState, partialState);\n }\n\n case ForceUpdate:\n {\n hasForceUpdate = true;\n return prevState;\n }\n }\n\n return prevState;\n}\n\nfunction processUpdateQueue(workInProgress, props, instance, renderLanes) {\n \u002F\u002F This is always non-null on a ClassComponent or HostRoot\n var queue = workInProgress.updateQueue;\n hasForceUpdate = false;\n\n {\n currentlyProcessingQueue = queue.shared;\n }\n\n var firstBaseUpdate = queue.firstBaseUpdate;\n var lastBaseUpdate = queue.lastBaseUpdate; \u002F\u002F Check if there are pending updates. If so, transfer them to the base queue.\n\n var pendingQueue = queue.shared.pending;\n\n if (pendingQueue !== null) {\n queue.shared.pending = null; \u002F\u002F The pending queue is circular. Disconnect the pointer between first\n \u002F\u002F and last so that it's non-circular.\n\n var lastPendingUpdate = pendingQueue;\n var firstPendingUpdate = lastPendingUpdate.next;\n lastPendingUpdate.next = null; \u002F\u002F Append pending updates to base queue\n\n if (lastBaseUpdate === null) {\n firstBaseUpdate = firstPendingUpdate;\n } else {\n lastBaseUpdate.next = firstPendingUpdate;\n }\n\n lastBaseUpdate = lastPendingUpdate; \u002F\u002F If there's a current queue, and it's different from the base queue, then\n \u002F\u002F we need to transfer the updates to that queue, too. Because the base\n \u002F\u002F queue is a singly-linked list with no cycles, we can append to both\n \u002F\u002F lists and take advantage of structural sharing.\n \u002F\u002F TODO: Pass `current` as argument\n\n var current = workInProgress.alternate;\n\n if (current !== null) {\n \u002F\u002F This is always non-null on a ClassComponent or HostRoot\n var currentQueue = current.updateQueue;\n var currentLastBaseUpdate = currentQueue.lastBaseUpdate;\n\n if (currentLastBaseUpdate !== lastBaseUpdate) {\n if (currentLastBaseUpdate === null) {\n currentQueue.firstBaseUpdate = firstPendingUpdate;\n } else {\n currentLastBaseUpdate.next = firstPendingUpdate;\n }\n\n currentQueue.lastBaseUpdate = lastPendingUpdate;\n }\n }\n } \u002F\u002F These values may change as we process the queue.\n\n\n if (firstBaseUpdate !== null) {\n \u002F\u002F Iterate through the list of updates to compute the result.\n var newState = queue.baseState; \u002F\u002F TODO: Don't need to accumulate this. Instead, we can remove renderLanes\n \u002F\u002F from the original lanes.\n\n var newLanes = NoLanes;\n var newBaseState = null;\n var newFirstBaseUpdate = null;\n var newLastBaseUpdate = null;\n var update = firstBaseUpdate;\n\n do {\n var updateLane = update.lane;\n var updateEventTime = update.eventTime;\n\n if (!isSubsetOfLanes(renderLanes, updateLane)) {\n \u002F\u002F Priority is insufficient. Skip this update. If this is the first\n \u002F\u002F skipped update, the previous update\u002Fstate is the new base\n \u002F\u002F update\u002Fstate.\n var clone = {\n eventTime: updateEventTime,\n lane: updateLane,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n\n if (newLastBaseUpdate === null) {\n newFirstBaseUpdate = newLastBaseUpdate = clone;\n newBaseState = newState;\n } else {\n newLastBaseUpdate = newLastBaseUpdate.next = clone;\n } \u002F\u002F Update the remaining priority in the queue.\n\n\n newLanes = mergeLanes(newLanes, updateLane);\n } else {\n \u002F\u002F This update does have sufficient priority.\n if (newLastBaseUpdate !== null) {\n var _clone = {\n eventTime: updateEventTime,\n \u002F\u002F This update is going to be committed so we never want uncommit\n \u002F\u002F it. Using NoLane works because 0 is a subset of all bitmasks, so\n \u002F\u002F this will never be skipped by the check above.\n lane: NoLane,\n tag: update.tag,\n payload: update.payload,\n callback: update.callback,\n next: null\n };\n newLastBaseUpdate = newLastBaseUpdate.next = _clone;\n } \u002F\u002F Process this update.\n\n\n newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance);\n var callback = update.callback;\n\n if (callback !== null) {\n workInProgress.flags |= Callback;\n var effects = queue.effects;\n\n if (effects === null) {\n queue.effects = [update];\n } else {\n effects.push(update);\n }\n }\n }\n\n update = update.next;\n\n if (update === null) {\n pendingQueue = queue.shared.pending;\n\n if (pendingQueue === null) {\n break;\n } else {\n \u002F\u002F An update was scheduled from inside a reducer. Add the new\n \u002F\u002F pending updates to the end of the list and keep processing.\n var _lastPendingUpdate = pendingQueue; \u002F\u002F Intentionally unsound. Pending updates form a circular list, but we\n \u002F\u002F unravel them when transferring them to the base queue.\n\n var _firstPendingUpdate = _lastPendingUpdate.next;\n _lastPendingUpdate.next = null;\n update = _firstPendingUpdate;\n queue.lastBaseUpdate = _lastPendingUpdate;\n queue.shared.pending = null;\n }\n }\n } while (true);\n\n if (newLastBaseUpdate === null) {\n newBaseState = newState;\n }\n\n queue.baseState = newBaseState;\n queue.firstBaseUpdate = newFirstBaseUpdate;\n queue.lastBaseUpdate = newLastBaseUpdate; \u002F\u002F Set the remaining expiration time to be whatever is remaining in the queue.\n \u002F\u002F This should be fine because the only two other things that contribute to\n \u002F\u002F expiration time are props and context. We're already in the middle of the\n \u002F\u002F begin phase by the time we start processing the queue, so we've already\n \u002F\u002F dealt with the props. Context in components that specify\n \u002F\u002F shouldComponentUpdate is tricky; but we'll have to account for\n \u002F\u002F that regardless.\n\n markSkippedUpdateLanes(newLanes);\n workInProgress.lanes = newLanes;\n workInProgress.memoizedState = newState;\n }\n\n {\n currentlyProcessingQueue = null;\n }\n}\n\nfunction callCallback(callback, context) {\n if (!(typeof callback === 'function')) {\n {\n throw Error( \"Invalid argument passed as callback. Expected a function. Instead received: \" + callback );\n }\n }\n\n callback.call(context);\n}\n\nfunction resetHasForceUpdateBeforeProcessing() {\n hasForceUpdate = false;\n}\nfunction checkHasForceUpdateAfterProcessing() {\n return hasForceUpdate;\n}\nfunction commitUpdateQueue(finishedWork, finishedQueue, instance) {\n \u002F\u002F Commit the effects\n var effects = finishedQueue.effects;\n finishedQueue.effects = null;\n\n if (effects !== null) {\n for (var i = 0; i \u003C effects.length; i++) {\n var effect = effects[i];\n var callback = effect.callback;\n\n if (callback !== null) {\n effect.callback = null;\n callCallback(callback, instance);\n }\n }\n }\n}\n\nvar fakeInternalInstance = {};\nvar isArray = Array.isArray; \u002F\u002F React.Component uses a shared frozen object by default.\n\u002F\u002F We'll use it to determine whether we need to initialize legacy refs.\n\nvar emptyRefsObject = new React.Component().refs;\nvar didWarnAboutStateAssignmentForComponent;\nvar didWarnAboutUninitializedState;\nvar didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate;\nvar didWarnAboutLegacyLifecyclesAndDerivedState;\nvar didWarnAboutUndefinedDerivedState;\nvar warnOnUndefinedDerivedState;\nvar warnOnInvalidCallback;\nvar didWarnAboutDirectlyAssigningPropsToState;\nvar didWarnAboutContextTypeAndContextTypes;\nvar didWarnAboutInvalidateContextType;\n\n{\n didWarnAboutStateAssignmentForComponent = new Set();\n didWarnAboutUninitializedState = new Set();\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set();\n didWarnAboutLegacyLifecyclesAndDerivedState = new Set();\n didWarnAboutDirectlyAssigningPropsToState = new Set();\n didWarnAboutUndefinedDerivedState = new Set();\n didWarnAboutContextTypeAndContextTypes = new Set();\n didWarnAboutInvalidateContextType = new Set();\n var didWarnOnInvalidCallback = new Set();\n\n warnOnInvalidCallback = function (callback, callerName) {\n if (callback === null || typeof callback === 'function') {\n return;\n }\n\n var key = callerName + '_' + callback;\n\n if (!didWarnOnInvalidCallback.has(key)) {\n didWarnOnInvalidCallback.add(key);\n\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n };\n\n warnOnUndefinedDerivedState = function (type, partialState) {\n if (partialState === undefined) {\n var componentName = getComponentName(type) || 'Component';\n\n if (!didWarnAboutUndefinedDerivedState.has(componentName)) {\n didWarnAboutUndefinedDerivedState.add(componentName);\n\n error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName);\n }\n }\n }; \u002F\u002F This is so gross but it's at least non-critical and can be removed if\n \u002F\u002F it causes problems. This is meant to give a nicer error message for\n \u002F\u002F ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component,\n \u002F\u002F ...)) which otherwise throws a \"_processChildContext is not a function\"\n \u002F\u002F exception.\n\n\n Object.defineProperty(fakeInternalInstance, '_processChildContext', {\n enumerable: false,\n value: function () {\n {\n {\n throw Error( \"_processChildContext is not available in React 16+. This likely means you have multiple copies of React and are attempting to nest a React 15 tree inside a React 16 tree using unstable_renderSubtreeIntoContainer, which isn't supported. Try to make sure you have only one copy of React (and ideally, switch to ReactDOM.createPortal).\" );\n }\n }\n }\n });\n Object.freeze(fakeInternalInstance);\n}\n\nfunction applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) {\n var prevState = workInProgress.memoizedState;\n\n {\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n \u002F\u002F Invoke the function an extra time to help detect side-effects.\n getDerivedStateFromProps(nextProps, prevState);\n } finally {\n reenableLogs();\n }\n }\n }\n\n var partialState = getDerivedStateFromProps(nextProps, prevState);\n\n {\n warnOnUndefinedDerivedState(ctor, partialState);\n } \u002F\u002F Merge the partial state and the previous state.\n\n\n var memoizedState = partialState === null || partialState === undefined ? prevState : _assign({}, prevState, partialState);\n workInProgress.memoizedState = memoizedState; \u002F\u002F Once the update queue is empty, persist the derived state onto the\n \u002F\u002F base state.\n\n if (workInProgress.lanes === NoLanes) {\n \u002F\u002F Queue is always non-null for classes\n var updateQueue = workInProgress.updateQueue;\n updateQueue.baseState = memoizedState;\n }\n}\nvar classComponentUpdater = {\n isMounted: isMounted,\n enqueueSetState: function (inst, payload, callback) {\n var fiber = get(inst);\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n var update = createUpdate(eventTime, lane);\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'setState');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleUpdateOnFiber(fiber, lane, eventTime);\n },\n enqueueReplaceState: function (inst, payload, callback) {\n var fiber = get(inst);\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n var update = createUpdate(eventTime, lane);\n update.tag = ReplaceState;\n update.payload = payload;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'replaceState');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleUpdateOnFiber(fiber, lane, eventTime);\n },\n enqueueForceUpdate: function (inst, callback) {\n var fiber = get(inst);\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n var update = createUpdate(eventTime, lane);\n update.tag = ForceUpdate;\n\n if (callback !== undefined && callback !== null) {\n {\n warnOnInvalidCallback(callback, 'forceUpdate');\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(fiber, update);\n scheduleUpdateOnFiber(fiber, lane, eventTime);\n }\n};\n\nfunction checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) {\n var instance = workInProgress.stateNode;\n\n if (typeof instance.shouldComponentUpdate === 'function') {\n {\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n \u002F\u002F Invoke the function an extra time to help detect side-effects.\n instance.shouldComponentUpdate(newProps, newState, nextContext);\n } finally {\n reenableLogs();\n }\n }\n }\n\n var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext);\n\n {\n if (shouldUpdate === undefined) {\n error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentName(ctor) || 'Component');\n }\n }\n\n return shouldUpdate;\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent) {\n return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState);\n }\n\n return true;\n}\n\nfunction checkClassInstance(workInProgress, ctor, newProps) {\n var instance = workInProgress.stateNode;\n\n {\n var name = getComponentName(ctor) || 'Component';\n var renderPresent = instance.render;\n\n if (!renderPresent) {\n if (ctor.prototype && typeof ctor.prototype.render === 'function') {\n error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name);\n } else {\n error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name);\n }\n }\n\n if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) {\n error('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);\n }\n\n if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) {\n error('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);\n }\n\n if (instance.propTypes) {\n error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name);\n }\n\n if (instance.contextType) {\n error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name);\n }\n\n {\n if (instance.contextTypes) {\n error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name);\n }\n\n if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) {\n didWarnAboutContextTypeAndContextTypes.add(ctor);\n\n error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name);\n }\n }\n\n if (typeof instance.componentShouldUpdate === 'function') {\n error('%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);\n }\n\n if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') {\n error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentName(ctor) || 'A pure component');\n }\n\n if (typeof instance.componentDidUnmount === 'function') {\n error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name);\n }\n\n if (typeof instance.componentDidReceiveProps === 'function') {\n error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name);\n }\n\n if (typeof instance.componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name);\n }\n\n if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') {\n error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name);\n }\n\n var hasMutatedProps = instance.props !== newProps;\n\n if (instance.props !== undefined && hasMutatedProps) {\n error('%s(...): When calling super() in `%s`, make sure to pass ' + \"up the same props that your component's constructor was passed.\", name, name);\n }\n\n if (instance.defaultProps) {\n error('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);\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) {\n didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor);\n\n error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentName(ctor));\n }\n\n if (typeof instance.getDerivedStateFromProps === 'function') {\n error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof instance.getDerivedStateFromError === 'function') {\n error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name);\n }\n\n if (typeof ctor.getSnapshotBeforeUpdate === 'function') {\n error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name);\n }\n\n var _state = instance.state;\n\n if (_state && (typeof _state !== 'object' || isArray(_state))) {\n error('%s.state: must be set to an object or null', name);\n }\n\n if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') {\n error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name);\n }\n }\n}\n\nfunction adoptClassInstance(workInProgress, instance) {\n instance.updater = classComponentUpdater;\n workInProgress.stateNode = instance; \u002F\u002F The instance needs access to the fiber so that it can schedule updates\n\n set(instance, workInProgress);\n\n {\n instance._reactInternalInstance = fakeInternalInstance;\n }\n}\n\nfunction constructClassInstance(workInProgress, ctor, props) {\n var isLegacyContextConsumer = false;\n var unmaskedContext = emptyContextObject;\n var context = emptyContextObject;\n var contextType = ctor.contextType;\n\n {\n if ('contextType' in ctor) {\n var isValid = \u002F\u002F Allow null for conditional declaration\n contextType === null || contextType !== undefined && contextType.$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; \u002F\u002F Not a \u003CContext.Consumer\u003E\n\n if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) {\n didWarnAboutInvalidateContextType.add(ctor);\n var addendum = '';\n\n if (contextType === undefined) {\n addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';\n } else if (typeof contextType !== 'object') {\n addendum = ' However, it is set to a ' + typeof contextType + '.';\n } else if (contextType.$typeof === REACT_PROVIDER_TYPE) {\n addendum = ' Did you accidentally pass the Context.Provider instead?';\n } else if (contextType._context !== undefined) {\n \u002F\u002F \u003CContext.Consumer\u003E\n addendum = ' Did you accidentally pass the Context.Consumer instead?';\n } else {\n addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';\n }\n\n error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(ctor) || 'Component', addendum);\n }\n }\n }\n\n if (typeof contextType === 'object' && contextType !== null) {\n context = readContext(contextType);\n } else {\n unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n var contextTypes = ctor.contextTypes;\n isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined;\n context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject;\n } \u002F\u002F Instantiate twice to help detect side-effects.\n\n\n {\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n new ctor(props, context); \u002F\u002F eslint-disable-line no-new\n } finally {\n reenableLogs();\n }\n }\n }\n\n var instance = new ctor(props, context);\n var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null;\n adoptClassInstance(workInProgress, instance);\n\n {\n if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) {\n var componentName = getComponentName(ctor) || 'Component';\n\n if (!didWarnAboutUninitializedState.has(componentName)) {\n didWarnAboutUninitializedState.add(componentName);\n\n error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName);\n }\n } \u002F\u002F If new component APIs are defined, \"unsafe\" lifecycles won't be called.\n \u002F\u002F Warn about these lifecycles if they are present.\n \u002F\u002F Don't warn about react-lifecycles-compat polyfilled methods though.\n\n\n if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') {\n var foundWillMountName = null;\n var foundWillReceivePropsName = null;\n var foundWillUpdateName = null;\n\n if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) {\n foundWillMountName = 'componentWillMount';\n } else if (typeof instance.UNSAFE_componentWillMount === 'function') {\n foundWillMountName = 'UNSAFE_componentWillMount';\n }\n\n if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) {\n foundWillReceivePropsName = 'componentWillReceiveProps';\n } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';\n }\n\n if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) {\n foundWillUpdateName = 'componentWillUpdate';\n } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n foundWillUpdateName = 'UNSAFE_componentWillUpdate';\n }\n\n if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) {\n var _componentName = getComponentName(ctor) || 'Component';\n\n var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()';\n\n if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) {\n didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName);\n\n error('Unsafe legacy lifecycles will not be called for components using new component APIs.\\n\\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\\n\\n' + 'The above lifecycles should be removed. Learn more about this warning here:\\n' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Funsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? \"\\n \" + foundWillMountName : '', foundWillReceivePropsName !== null ? \"\\n \" + foundWillReceivePropsName : '', foundWillUpdateName !== null ? \"\\n \" + foundWillUpdateName : '');\n }\n }\n }\n } \u002F\u002F Cache unmasked context so we can avoid recreating masked context unless necessary.\n \u002F\u002F ReactFiberContext usually updates this cache but can't for newly-created instances.\n\n\n if (isLegacyContextConsumer) {\n cacheContext(workInProgress, unmaskedContext, context);\n }\n\n return instance;\n}\n\nfunction callComponentWillMount(workInProgress, instance) {\n var oldState = instance.state;\n\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n\n if (oldState !== instance.state) {\n {\n error('%s.componentWillMount(): Assigning directly to this.state is ' + \"deprecated (except inside a component's \" + 'constructor). Use setState instead.', getComponentName(workInProgress.type) || 'Component');\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n}\n\nfunction callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) {\n var oldState = instance.state;\n\n if (typeof instance.componentWillReceiveProps === 'function') {\n instance.componentWillReceiveProps(newProps, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') {\n instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);\n }\n\n if (instance.state !== oldState) {\n {\n var componentName = getComponentName(workInProgress.type) || 'Component';\n\n if (!didWarnAboutStateAssignmentForComponent.has(componentName)) {\n didWarnAboutStateAssignmentForComponent.add(componentName);\n\n error('%s.componentWillReceiveProps(): Assigning directly to ' + \"this.state is deprecated (except inside a component's \" + 'constructor). Use setState instead.', componentName);\n }\n }\n\n classComponentUpdater.enqueueReplaceState(instance, instance.state, null);\n }\n} \u002F\u002F Invokes the mount life-cycles on a previously never rendered instance.\n\n\nfunction mountClassInstance(workInProgress, ctor, newProps, renderLanes) {\n {\n checkClassInstance(workInProgress, ctor, newProps);\n }\n\n var instance = workInProgress.stateNode;\n instance.props = newProps;\n instance.state = workInProgress.memoizedState;\n instance.refs = emptyRefsObject;\n initializeUpdateQueue(workInProgress);\n var contextType = ctor.contextType;\n\n if (typeof contextType === 'object' && contextType !== null) {\n instance.context = readContext(contextType);\n } else {\n var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n instance.context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n {\n if (instance.state === newProps) {\n var componentName = getComponentName(ctor) || 'Component';\n\n if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) {\n didWarnAboutDirectlyAssigningPropsToState.add(componentName);\n\n error('%s: It is not recommended to assign props directly to state ' + \"because updates to props won't be reflected in state. \" + 'In most cases, it is better to use props directly.', componentName);\n }\n }\n\n if (workInProgress.mode & StrictMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance);\n }\n\n {\n ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance);\n }\n }\n\n processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n instance.state = workInProgress.memoizedState;\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n instance.state = workInProgress.memoizedState;\n } \u002F\u002F In order to support react-lifecycles-compat polyfilled components,\n \u002F\u002F Unsafe lifecycles should not be invoked for components using the new APIs.\n\n\n if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n callComponentWillMount(workInProgress, instance); \u002F\u002F If we had additional state updates during this life-cycle, let's\n \u002F\u002F process them now.\n\n processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n instance.state = workInProgress.memoizedState;\n }\n\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.flags |= Update;\n }\n}\n\nfunction resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) {\n var instance = workInProgress.stateNode;\n var oldProps = workInProgress.memoizedProps;\n instance.props = oldProps;\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; \u002F\u002F Note: During these life-cycles, instance.props\u002Finstance.state are what\n \u002F\u002F ever the previously attempted to render - not the \"current\". However,\n \u002F\u002F during componentDidUpdate we pass the \"current\" props.\n \u002F\u002F In order to support react-lifecycles-compat polyfilled components,\n \u002F\u002F Unsafe lifecycles should not be invoked for components using the new APIs.\n\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (oldProps !== newProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n newState = workInProgress.memoizedState;\n\n if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n \u002F\u002F If an update was already in progress, we should schedule an Update\n \u002F\u002F effect even though we're bailing out, so that cWU\u002FcDU are called.\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.flags |= Update;\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n\n if (shouldUpdate) {\n \u002F\u002F In order to support react-lifecycles-compat polyfilled components,\n \u002F\u002F Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) {\n if (typeof instance.componentWillMount === 'function') {\n instance.componentWillMount();\n }\n\n if (typeof instance.UNSAFE_componentWillMount === 'function') {\n instance.UNSAFE_componentWillMount();\n }\n }\n\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.flags |= Update;\n }\n } else {\n \u002F\u002F If an update was already in progress, we should schedule an Update\n \u002F\u002F effect even though we're bailing out, so that cWU\u002FcDU are called.\n if (typeof instance.componentDidMount === 'function') {\n workInProgress.flags |= Update;\n } \u002F\u002F If shouldComponentUpdate returned false, we should still update the\n \u002F\u002F memoized state to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } \u002F\u002F Update the existing instance's state, props, and context pointers even\n \u002F\u002F if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n} \u002F\u002F Invokes the update life-cycles and returns false if it shouldn't rerender.\n\n\nfunction updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) {\n var instance = workInProgress.stateNode;\n cloneUpdateQueue(current, workInProgress);\n var unresolvedOldProps = workInProgress.memoizedProps;\n var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps);\n instance.props = oldProps;\n var unresolvedNewProps = workInProgress.pendingProps;\n var oldContext = instance.context;\n var contextType = ctor.contextType;\n var nextContext = emptyContextObject;\n\n if (typeof contextType === 'object' && contextType !== null) {\n nextContext = readContext(contextType);\n } else {\n var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true);\n nextContext = getMaskedContext(workInProgress, nextUnmaskedContext);\n }\n\n var getDerivedStateFromProps = ctor.getDerivedStateFromProps;\n var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; \u002F\u002F Note: During these life-cycles, instance.props\u002Finstance.state are what\n \u002F\u002F ever the previously attempted to render - not the \"current\". However,\n \u002F\u002F during componentDidUpdate we pass the \"current\" props.\n \u002F\u002F In order to support react-lifecycles-compat polyfilled components,\n \u002F\u002F Unsafe lifecycles should not be invoked for components using the new APIs.\n\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) {\n if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) {\n callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext);\n }\n }\n\n resetHasForceUpdateBeforeProcessing();\n var oldState = workInProgress.memoizedState;\n var newState = instance.state = oldState;\n processUpdateQueue(workInProgress, newProps, instance, renderLanes);\n newState = workInProgress.memoizedState;\n\n if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) {\n \u002F\u002F If an update was already in progress, we should schedule an Update\n \u002F\u002F effect even though we're bailing out, so that cWU\u002FcDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Snapshot;\n }\n }\n\n return false;\n }\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps);\n newState = workInProgress.memoizedState;\n }\n\n var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext);\n\n if (shouldUpdate) {\n \u002F\u002F In order to support react-lifecycles-compat polyfilled components,\n \u002F\u002F Unsafe lifecycles should not be invoked for components using the new APIs.\n if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) {\n if (typeof instance.componentWillUpdate === 'function') {\n instance.componentWillUpdate(newProps, newState, nextContext);\n }\n\n if (typeof instance.UNSAFE_componentWillUpdate === 'function') {\n instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext);\n }\n }\n\n if (typeof instance.componentDidUpdate === 'function') {\n workInProgress.flags |= Update;\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n workInProgress.flags |= Snapshot;\n }\n } else {\n \u002F\u002F If an update was already in progress, we should schedule an Update\n \u002F\u002F effect even though we're bailing out, so that cWU\u002FcDU are called.\n if (typeof instance.componentDidUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Update;\n }\n }\n\n if (typeof instance.getSnapshotBeforeUpdate === 'function') {\n if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) {\n workInProgress.flags |= Snapshot;\n }\n } \u002F\u002F If shouldComponentUpdate returned false, we should still update the\n \u002F\u002F memoized props\u002Fstate to indicate that this work can be reused.\n\n\n workInProgress.memoizedProps = newProps;\n workInProgress.memoizedState = newState;\n } \u002F\u002F Update the existing instance's state, props, and context pointers even\n \u002F\u002F if shouldComponentUpdate returns false.\n\n\n instance.props = newProps;\n instance.state = newState;\n instance.context = nextContext;\n return shouldUpdate;\n}\n\nvar didWarnAboutMaps;\nvar didWarnAboutGenerators;\nvar didWarnAboutStringRefs;\nvar ownerHasKeyUseWarning;\nvar ownerHasFunctionTypeWarning;\n\nvar warnForMissingKey = function (child, returnFiber) {};\n\n{\n didWarnAboutMaps = false;\n didWarnAboutGenerators = false;\n didWarnAboutStringRefs = {};\n \u002F**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n *\u002F\n\n ownerHasKeyUseWarning = {};\n ownerHasFunctionTypeWarning = {};\n\n warnForMissingKey = function (child, returnFiber) {\n if (child === null || typeof child !== 'object') {\n return;\n }\n\n if (!child._store || child._store.validated || child.key != null) {\n return;\n }\n\n if (!(typeof child._store === 'object')) {\n {\n throw Error( \"React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n child._store.validated = true;\n var componentName = getComponentName(returnFiber.type) || 'Component';\n\n if (ownerHasKeyUseWarning[componentName]) {\n return;\n }\n\n ownerHasKeyUseWarning[componentName] = true;\n\n error('Each child in a list should have a unique ' + '\"key\" prop. See https:\u002F\u002Freactjs.org\u002Flink\u002Fwarning-keys for ' + 'more information.');\n };\n}\n\nvar isArray$1 = Array.isArray;\n\nfunction coerceRef(returnFiber, current, element) {\n var mixedRef = element.ref;\n\n if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') {\n {\n \u002F\u002F TODO: Clean this up once we turn on the string ref warning for\n \u002F\u002F everyone, because the strict mode case will no longer be relevant\n if ((returnFiber.mode & StrictMode || warnAboutStringRefs) && \u002F\u002F We warn in ReactElement.js if owner and self are equal for string refs\n \u002F\u002F because these cannot be automatically converted to an arrow function\n \u002F\u002F using a codemod. Therefore, we don't have to warn about string refs again.\n !(element._owner && element._self && element._owner.stateNode !== element._self)) {\n var componentName = getComponentName(returnFiber.type) || 'Component';\n\n if (!didWarnAboutStringRefs[componentName]) {\n {\n error('A string ref, \"%s\", has been found within a strict mode tree. ' + 'String refs are a source of potential bugs and should be avoided. ' + 'We recommend using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Fstrict-mode-string-ref', mixedRef);\n }\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n\n if (element._owner) {\n var owner = element._owner;\n var inst;\n\n if (owner) {\n var ownerFiber = owner;\n\n if (!(ownerFiber.tag === ClassComponent)) {\n {\n throw Error( \"Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https:\u002F\u002Freactjs.org\u002Flink\u002Fstrict-mode-string-ref\" );\n }\n }\n\n inst = ownerFiber.stateNode;\n }\n\n if (!inst) {\n {\n throw Error( \"Missing owner for string ref \" + mixedRef + \". This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var stringRef = '' + mixedRef; \u002F\u002F Check if previous string ref matches new string ref\n\n if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) {\n return current.ref;\n }\n\n var ref = function (value) {\n var refs = inst.refs;\n\n if (refs === emptyRefsObject) {\n \u002F\u002F This is a lazy pooled frozen object, so we need to initialize.\n refs = inst.refs = {};\n }\n\n if (value === null) {\n delete refs[stringRef];\n } else {\n refs[stringRef] = value;\n }\n };\n\n ref._stringRef = stringRef;\n return ref;\n } else {\n if (!(typeof mixedRef === 'string')) {\n {\n throw Error( \"Expected ref to be a function, a string, an object returned by React.createRef(), or null.\" );\n }\n }\n\n if (!element._owner) {\n {\n throw Error( \"Element ref was specified as a string (\" + mixedRef + \") but no owner was set. This could happen for one of the following reasons:\\n1. You may be adding a ref to a function component\\n2. You may be adding a ref to a component that was not created inside a component's render method\\n3. You have multiple copies of React loaded\\nSee https:\u002F\u002Freactjs.org\u002Flink\u002Frefs-must-have-owner for more information.\" );\n }\n }\n }\n }\n\n return mixedRef;\n}\n\nfunction throwOnInvalidObjectType(returnFiber, newChild) {\n if (returnFiber.type !== 'textarea') {\n {\n {\n throw Error( \"Objects are not valid as a React child (found: \" + (Object.prototype.toString.call(newChild) === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : newChild) + \"). If you meant to render a collection of children, use an array instead.\" );\n }\n }\n }\n}\n\nfunction warnOnFunctionType(returnFiber) {\n {\n var componentName = getComponentName(returnFiber.type) || 'Component';\n\n if (ownerHasFunctionTypeWarning[componentName]) {\n return;\n }\n\n ownerHasFunctionTypeWarning[componentName] = true;\n\n error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of \u003CComponent \u002F\u003E from render. ' + 'Or maybe you meant to call this function rather than return it.');\n }\n} \u002F\u002F We avoid inlining this to avoid potential deopts from using try\u002Fcatch.\n\u002F\u002F to be able to optimize each path individually by branching early. This needs\n\u002F\u002F a compiler or we can do it manually. Helpers that don't need this branching\n\u002F\u002F live outside of this function.\n\n\nfunction ChildReconciler(shouldTrackSideEffects) {\n function deleteChild(returnFiber, childToDelete) {\n if (!shouldTrackSideEffects) {\n \u002F\u002F Noop.\n return;\n } \u002F\u002F Deletions are added in reversed order so we add it to the front.\n \u002F\u002F At this point, the return fiber's effect list is empty except for\n \u002F\u002F deletions, so we can just append the deletion to the list. The remaining\n \u002F\u002F effects aren't added until the complete phase. Once we implement\n \u002F\u002F resuming, this may not be true.\n\n\n var last = returnFiber.lastEffect;\n\n if (last !== null) {\n last.nextEffect = childToDelete;\n returnFiber.lastEffect = childToDelete;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n }\n\n childToDelete.nextEffect = null;\n childToDelete.flags = Deletion;\n }\n\n function deleteRemainingChildren(returnFiber, currentFirstChild) {\n if (!shouldTrackSideEffects) {\n \u002F\u002F Noop.\n return null;\n } \u002F\u002F TODO: For the shouldClone case, this could be micro-optimized a bit by\n \u002F\u002F assuming that after the first child we've already added everything.\n\n\n var childToDelete = currentFirstChild;\n\n while (childToDelete !== null) {\n deleteChild(returnFiber, childToDelete);\n childToDelete = childToDelete.sibling;\n }\n\n return null;\n }\n\n function mapRemainingChildren(returnFiber, currentFirstChild) {\n \u002F\u002F Add the remaining children to a temporary map so that we can find them by\n \u002F\u002F keys quickly. Implicit (null) keys get added to this set with their index\n \u002F\u002F instead.\n var existingChildren = new Map();\n var existingChild = currentFirstChild;\n\n while (existingChild !== null) {\n if (existingChild.key !== null) {\n existingChildren.set(existingChild.key, existingChild);\n } else {\n existingChildren.set(existingChild.index, existingChild);\n }\n\n existingChild = existingChild.sibling;\n }\n\n return existingChildren;\n }\n\n function useFiber(fiber, pendingProps) {\n \u002F\u002F We currently set sibling to null and index to 0 here because it is easy\n \u002F\u002F to forget to do before returning it. E.g. for the single child case.\n var clone = createWorkInProgress(fiber, pendingProps);\n clone.index = 0;\n clone.sibling = null;\n return clone;\n }\n\n function placeChild(newFiber, lastPlacedIndex, newIndex) {\n newFiber.index = newIndex;\n\n if (!shouldTrackSideEffects) {\n \u002F\u002F Noop.\n return lastPlacedIndex;\n }\n\n var current = newFiber.alternate;\n\n if (current !== null) {\n var oldIndex = current.index;\n\n if (oldIndex \u003C lastPlacedIndex) {\n \u002F\u002F This is a move.\n newFiber.flags = Placement;\n return lastPlacedIndex;\n } else {\n \u002F\u002F This item can stay in place.\n return oldIndex;\n }\n } else {\n \u002F\u002F This is an insertion.\n newFiber.flags = Placement;\n return lastPlacedIndex;\n }\n }\n\n function placeSingleChild(newFiber) {\n \u002F\u002F This is simpler for the single child case. We only need to do a\n \u002F\u002F placement for inserting new children.\n if (shouldTrackSideEffects && newFiber.alternate === null) {\n newFiber.flags = Placement;\n }\n\n return newFiber;\n }\n\n function updateTextNode(returnFiber, current, textContent, lanes) {\n if (current === null || current.tag !== HostText) {\n \u002F\u002F Insert\n var created = createFiberFromText(textContent, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n } else {\n \u002F\u002F Update\n var existing = useFiber(current, textContent);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateElement(returnFiber, current, element, lanes) {\n if (current !== null) {\n if (current.elementType === element.type || ( \u002F\u002F Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(current, element) )) {\n \u002F\u002F Move based on index\n var existing = useFiber(current, element.props);\n existing.ref = coerceRef(returnFiber, current, element);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n } \u002F\u002F Insert\n\n\n var created = createFiberFromElement(element, returnFiber.mode, lanes);\n created.ref = coerceRef(returnFiber, current, element);\n created.return = returnFiber;\n return created;\n }\n\n function updatePortal(returnFiber, current, portal, lanes) {\n if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) {\n \u002F\u002F Insert\n var created = createFiberFromPortal(portal, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n } else {\n \u002F\u002F Update\n var existing = useFiber(current, portal.children || []);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function updateFragment(returnFiber, current, fragment, lanes, key) {\n if (current === null || current.tag !== Fragment) {\n \u002F\u002F Insert\n var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key);\n created.return = returnFiber;\n return created;\n } else {\n \u002F\u002F Update\n var existing = useFiber(current, fragment);\n existing.return = returnFiber;\n return existing;\n }\n }\n\n function createChild(returnFiber, newChild, lanes) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n \u002F\u002F Text nodes don't have keys. If the previous node is implicitly keyed\n \u002F\u002F we can continue to replace it without aborting even if it is not a text\n \u002F\u002F node.\n var created = createFiberFromText('' + newChild, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _created = createFiberFromElement(newChild, returnFiber.mode, lanes);\n\n _created.ref = coerceRef(returnFiber, null, newChild);\n _created.return = returnFiber;\n return _created;\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes);\n\n _created2.return = returnFiber;\n return _created2;\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);\n\n _created3.return = returnFiber;\n return _created3;\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n }\n\n return null;\n }\n\n function updateSlot(returnFiber, oldFiber, newChild, lanes) {\n \u002F\u002F Update the fiber if the keys match, otherwise return null.\n var key = oldFiber !== null ? oldFiber.key : null;\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n \u002F\u002F Text nodes don't have keys. If the previous node is implicitly keyed\n \u002F\u002F we can continue to replace it without aborting even if it is not a text\n \u002F\u002F node.\n if (key !== null) {\n return null;\n }\n\n return updateTextNode(returnFiber, oldFiber, '' + newChild, lanes);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n if (newChild.key === key) {\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, oldFiber, newChild.props.children, lanes, key);\n }\n\n return updateElement(returnFiber, oldFiber, newChild, lanes);\n } else {\n return null;\n }\n }\n\n case REACT_PORTAL_TYPE:\n {\n if (newChild.key === key) {\n return updatePortal(returnFiber, oldFiber, newChild, lanes);\n } else {\n return null;\n }\n }\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n if (key !== null) {\n return null;\n }\n\n return updateFragment(returnFiber, oldFiber, newChild, lanes, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n }\n\n return null;\n }\n\n function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) {\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n \u002F\u002F Text nodes don't have keys, so we neither have to check the old nor\n \u002F\u002F new node for the key. If both are text nodes, they match.\n var matchedFiber = existingChildren.get(newIdx) || null;\n return updateTextNode(returnFiber, matchedFiber, '' + newChild, lanes);\n }\n\n if (typeof newChild === 'object' && newChild !== null) {\n switch (newChild.$typeof) {\n case REACT_ELEMENT_TYPE:\n {\n var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n if (newChild.type === REACT_FRAGMENT_TYPE) {\n return updateFragment(returnFiber, _matchedFiber, newChild.props.children, lanes, newChild.key);\n }\n\n return updateElement(returnFiber, _matchedFiber, newChild, lanes);\n }\n\n case REACT_PORTAL_TYPE:\n {\n var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null;\n\n return updatePortal(returnFiber, _matchedFiber2, newChild, lanes);\n }\n\n }\n\n if (isArray$1(newChild) || getIteratorFn(newChild)) {\n var _matchedFiber3 = existingChildren.get(newIdx) || null;\n\n return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null);\n }\n\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n }\n\n return null;\n }\n \u002F**\n * Warns if there is a duplicate or missing key\n *\u002F\n\n\n function warnOnInvalidKey(child, knownKeys, returnFiber) {\n {\n if (typeof child !== 'object' || child === null) {\n return knownKeys;\n }\n\n switch (child.$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n warnForMissingKey(child, returnFiber);\n var key = child.key;\n\n if (typeof key !== 'string') {\n break;\n }\n\n if (knownKeys === null) {\n knownKeys = new Set();\n knownKeys.add(key);\n break;\n }\n\n if (!knownKeys.has(key)) {\n knownKeys.add(key);\n break;\n }\n\n error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and\u002For omitted — the behavior is unsupported and ' + 'could change in a future version.', key);\n\n break;\n }\n }\n\n return knownKeys;\n }\n\n function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) {\n \u002F\u002F This algorithm can't optimize by searching from both ends since we\n \u002F\u002F don't have backpointers on fibers. I'm trying to see how far we can get\n \u002F\u002F with that model. If it ends up not being worth the tradeoffs, we can\n \u002F\u002F add it later.\n \u002F\u002F Even with a two ended optimization, we'd want to optimize for the case\n \u002F\u002F where there are few changes and brute force the comparison instead of\n \u002F\u002F going for the Map. It'd like to explore hitting that path first in\n \u002F\u002F forward-only mode and only go for the Map once we notice that we need\n \u002F\u002F lots of look ahead. This doesn't handle reversal as well as two ended\n \u002F\u002F search but that's unusual. Besides, for the two ended optimization to\n \u002F\u002F work on Iterables, we'd need to copy the whole set.\n \u002F\u002F In this first iteration, we'll just live with hitting the bad case\n \u002F\u002F (adding everything to a Map) in for every insert\u002Fmove.\n \u002F\u002F If you change this code, also update reconcileChildrenIterator() which\n \u002F\u002F uses the same algorithm.\n {\n \u002F\u002F First, validate keys.\n var knownKeys = null;\n\n for (var i = 0; i \u003C newChildren.length; i++) {\n var child = newChildren[i];\n knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);\n }\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n\n for (; oldFiber !== null && newIdx \u003C newChildren.length; newIdx++) {\n if (oldFiber.index \u003E newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes);\n\n if (newFiber === null) {\n \u002F\u002F TODO: This breaks on empty slots like null children. That's\n \u002F\u002F unfortunate because it triggers the slow path all the time. We need\n \u002F\u002F a better way to communicate whether this was a miss or null,\n \u002F\u002F boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n \u002F\u002F We matched the slot, but we didn't reuse the existing fiber, so we\n \u002F\u002F need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n \u002F\u002F TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n \u002F\u002F TODO: Defer siblings if we're not at the right index for this slot.\n \u002F\u002F I.e. if we had null values before, then we want to defer this\n \u002F\u002F for each null value. However, we also don't want to call updateSlot\n \u002F\u002F with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (newIdx === newChildren.length) {\n \u002F\u002F We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n \u002F\u002F If we don't have any more existing children we can choose a fast path\n \u002F\u002F since the rest will all be insertions.\n for (; newIdx \u003C newChildren.length; newIdx++) {\n var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes);\n\n if (_newFiber === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n \u002F\u002F TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber;\n } else {\n previousNewFiber.sibling = _newFiber;\n }\n\n previousNewFiber = _newFiber;\n }\n\n return resultingFirstChild;\n } \u002F\u002F Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); \u002F\u002F Keep scanning and use the map to restore deleted items as moves.\n\n for (; newIdx \u003C newChildren.length; newIdx++) {\n var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes);\n\n if (_newFiber2 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber2.alternate !== null) {\n \u002F\u002F The new fiber is a work in progress, but if there exists a\n \u002F\u002F current, that means that we reused the fiber. We need to delete\n \u002F\u002F it from the child list so that we don't add it to the deletion\n \u002F\u002F list.\n existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber2;\n } else {\n previousNewFiber.sibling = _newFiber2;\n }\n\n previousNewFiber = _newFiber2;\n }\n }\n\n if (shouldTrackSideEffects) {\n \u002F\u002F Any existing children that weren't consumed above were deleted. We need\n \u002F\u002F to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) {\n \u002F\u002F This is the same implementation as reconcileChildrenArray(),\n \u002F\u002F but using the iterator instead.\n var iteratorFn = getIteratorFn(newChildrenIterable);\n\n if (!(typeof iteratorFn === 'function')) {\n {\n throw Error( \"An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n {\n \u002F\u002F We don't support rendering Generators because it's a mutation.\n \u002F\u002F See https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F12995\n if (typeof Symbol === 'function' && \u002F\u002F $FlowFixMe Flow doesn't know about toStringTag\n newChildrenIterable[Symbol.toStringTag] === 'Generator') {\n if (!didWarnAboutGenerators) {\n error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.');\n }\n\n didWarnAboutGenerators = true;\n } \u002F\u002F Warn about using Maps as children\n\n\n if (newChildrenIterable.entries === iteratorFn) {\n if (!didWarnAboutMaps) {\n error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n } \u002F\u002F First, validate keys.\n \u002F\u002F We'll get a different iterator later for the main pass.\n\n\n var _newChildren = iteratorFn.call(newChildrenIterable);\n\n if (_newChildren) {\n var knownKeys = null;\n\n var _step = _newChildren.next();\n\n for (; !_step.done; _step = _newChildren.next()) {\n var child = _step.value;\n knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);\n }\n }\n }\n\n var newChildren = iteratorFn.call(newChildrenIterable);\n\n if (!(newChildren != null)) {\n {\n throw Error( \"An iterable object provided no iterator.\" );\n }\n }\n\n var resultingFirstChild = null;\n var previousNewFiber = null;\n var oldFiber = currentFirstChild;\n var lastPlacedIndex = 0;\n var newIdx = 0;\n var nextOldFiber = null;\n var step = newChildren.next();\n\n for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) {\n if (oldFiber.index \u003E newIdx) {\n nextOldFiber = oldFiber;\n oldFiber = null;\n } else {\n nextOldFiber = oldFiber.sibling;\n }\n\n var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes);\n\n if (newFiber === null) {\n \u002F\u002F TODO: This breaks on empty slots like null children. That's\n \u002F\u002F unfortunate because it triggers the slow path all the time. We need\n \u002F\u002F a better way to communicate whether this was a miss or null,\n \u002F\u002F boolean, undefined, etc.\n if (oldFiber === null) {\n oldFiber = nextOldFiber;\n }\n\n break;\n }\n\n if (shouldTrackSideEffects) {\n if (oldFiber && newFiber.alternate === null) {\n \u002F\u002F We matched the slot, but we didn't reuse the existing fiber, so we\n \u002F\u002F need to delete the existing child.\n deleteChild(returnFiber, oldFiber);\n }\n }\n\n lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n \u002F\u002F TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = newFiber;\n } else {\n \u002F\u002F TODO: Defer siblings if we're not at the right index for this slot.\n \u002F\u002F I.e. if we had null values before, then we want to defer this\n \u002F\u002F for each null value. However, we also don't want to call updateSlot\n \u002F\u002F with the previous one.\n previousNewFiber.sibling = newFiber;\n }\n\n previousNewFiber = newFiber;\n oldFiber = nextOldFiber;\n }\n\n if (step.done) {\n \u002F\u002F We've reached the end of the new children. We can delete the rest.\n deleteRemainingChildren(returnFiber, oldFiber);\n return resultingFirstChild;\n }\n\n if (oldFiber === null) {\n \u002F\u002F If we don't have any more existing children we can choose a fast path\n \u002F\u002F since the rest will all be insertions.\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber3 = createChild(returnFiber, step.value, lanes);\n\n if (_newFiber3 === null) {\n continue;\n }\n\n lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n \u002F\u002F TODO: Move out of the loop. This only happens for the first run.\n resultingFirstChild = _newFiber3;\n } else {\n previousNewFiber.sibling = _newFiber3;\n }\n\n previousNewFiber = _newFiber3;\n }\n\n return resultingFirstChild;\n } \u002F\u002F Add all children to a key map for quick lookups.\n\n\n var existingChildren = mapRemainingChildren(returnFiber, oldFiber); \u002F\u002F Keep scanning and use the map to restore deleted items as moves.\n\n for (; !step.done; newIdx++, step = newChildren.next()) {\n var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes);\n\n if (_newFiber4 !== null) {\n if (shouldTrackSideEffects) {\n if (_newFiber4.alternate !== null) {\n \u002F\u002F The new fiber is a work in progress, but if there exists a\n \u002F\u002F current, that means that we reused the fiber. We need to delete\n \u002F\u002F it from the child list so that we don't add it to the deletion\n \u002F\u002F list.\n existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key);\n }\n }\n\n lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx);\n\n if (previousNewFiber === null) {\n resultingFirstChild = _newFiber4;\n } else {\n previousNewFiber.sibling = _newFiber4;\n }\n\n previousNewFiber = _newFiber4;\n }\n }\n\n if (shouldTrackSideEffects) {\n \u002F\u002F Any existing children that weren't consumed above were deleted. We need\n \u002F\u002F to add them to the deletion list.\n existingChildren.forEach(function (child) {\n return deleteChild(returnFiber, child);\n });\n }\n\n return resultingFirstChild;\n }\n\n function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) {\n \u002F\u002F There's no need to check for keys on text nodes since we don't have a\n \u002F\u002F way to define them.\n if (currentFirstChild !== null && currentFirstChild.tag === HostText) {\n \u002F\u002F We already have an existing node so let's just update it and delete\n \u002F\u002F the rest.\n deleteRemainingChildren(returnFiber, currentFirstChild.sibling);\n var existing = useFiber(currentFirstChild, textContent);\n existing.return = returnFiber;\n return existing;\n } \u002F\u002F The existing first child is not a text node so we need to create one\n \u002F\u002F and delete the existing ones.\n\n\n deleteRemainingChildren(returnFiber, currentFirstChild);\n var created = createFiberFromText(textContent, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n }\n\n function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {\n var key = element.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n \u002F\u002F TODO: If key === null and child.key === null, then this only applies to\n \u002F\u002F the first item in the list.\n if (child.key === key) {\n switch (child.tag) {\n case Fragment:\n {\n if (element.type === REACT_FRAGMENT_TYPE) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, element.props.children);\n existing.return = returnFiber;\n\n {\n existing._debugSource = element._source;\n existing._debugOwner = element._owner;\n }\n\n return existing;\n }\n\n break;\n }\n\n case Block:\n\n \u002F\u002F We intentionally fallthrough here if enableBlocksAPI is not on.\n \u002F\u002F eslint-disable-next-lined no-fallthrough\n\n default:\n {\n if (child.elementType === element.type || ( \u002F\u002F Keep this check inline so it only runs on the false path:\n isCompatibleFamilyForHotReloading(child, element) )) {\n deleteRemainingChildren(returnFiber, child.sibling);\n\n var _existing3 = useFiber(child, element.props);\n\n _existing3.ref = coerceRef(returnFiber, child, element);\n _existing3.return = returnFiber;\n\n {\n _existing3._debugSource = element._source;\n _existing3._debugOwner = element._owner;\n }\n\n return _existing3;\n }\n\n break;\n }\n } \u002F\u002F Didn't match.\n\n\n deleteRemainingChildren(returnFiber, child);\n break;\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n if (element.type === REACT_FRAGMENT_TYPE) {\n var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);\n created.return = returnFiber;\n return created;\n } else {\n var _created4 = createFiberFromElement(element, returnFiber.mode, lanes);\n\n _created4.ref = coerceRef(returnFiber, currentFirstChild, element);\n _created4.return = returnFiber;\n return _created4;\n }\n }\n\n function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {\n var key = portal.key;\n var child = currentFirstChild;\n\n while (child !== null) {\n \u002F\u002F TODO: If key === null and child.key === null, then this only applies to\n \u002F\u002F the first item in the list.\n if (child.key === key) {\n if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {\n deleteRemainingChildren(returnFiber, child.sibling);\n var existing = useFiber(child, portal.children || []);\n existing.return = returnFiber;\n return existing;\n } else {\n deleteRemainingChildren(returnFiber, child);\n break;\n }\n } else {\n deleteChild(returnFiber, child);\n }\n\n child = child.sibling;\n }\n\n var created = createFiberFromPortal(portal, returnFiber.mode, lanes);\n created.return = returnFiber;\n return created;\n } \u002F\u002F This API will tag the children with the side-effect of the reconciliation\n \u002F\u002F itself. They will be added to the side-effect list as we pass through the\n \u002F\u002F children and the parent.\n\n\n function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) {\n \u002F\u002F This function is not recursive.\n \u002F\u002F If the top level item is an array, we treat it as a set of children,\n \u002F\u002F not as a fragment. Nested arrays on the other hand will be treated as\n \u002F\u002F fragment nodes. Recursion happens at the normal flow.\n \u002F\u002F Handle top level unkeyed fragments as if they were arrays.\n \u002F\u002F This leads to an ambiguity between \u003C\u003E{[...]}\u003C\u002F\u003E and \u003C\u003E...\u003C\u002F\u003E.\n \u002F\u002F We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } \u002F\u002F Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes));\n\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, lanes));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType(returnFiber);\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n \u002F\u002F If the new child is undefined, and the return fiber is a composite\n \u002F\u002F component, throw an error. If Fiber return types are disabled,\n \u002F\u002F we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n \u002F\u002F We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n \u002F\u002F Intentionally fall through to the next case, which handles both\n \u002F\u002F functions and classes\n \u002F\u002F eslint-disable-next-lined no-fallthrough\n\n case Block:\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n {\n {\n throw Error( (getComponentName(returnFiber.type) || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } \u002F\u002F Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }\n\n return reconcileChildFibers;\n}\n\nvar reconcileChildFibers = ChildReconciler(true);\nvar mountChildFibers = ChildReconciler(false);\nfunction cloneChildFibers(current, workInProgress) {\n if (!(current === null || workInProgress.child === current.child)) {\n {\n throw Error( \"Resuming work not yet implemented.\" );\n }\n }\n\n if (workInProgress.child === null) {\n return;\n }\n\n var currentChild = workInProgress.child;\n var newChild = createWorkInProgress(currentChild, currentChild.pendingProps);\n workInProgress.child = newChild;\n newChild.return = workInProgress;\n\n while (currentChild.sibling !== null) {\n currentChild = currentChild.sibling;\n newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps);\n newChild.return = workInProgress;\n }\n\n newChild.sibling = null;\n} \u002F\u002F Reset a workInProgress child set to prepare it for a second pass.\n\nfunction resetChildFibers(workInProgress, lanes) {\n var child = workInProgress.child;\n\n while (child !== null) {\n resetWorkInProgress(child, lanes);\n child = child.sibling;\n }\n}\n\nvar NO_CONTEXT = {};\nvar contextStackCursor$1 = createCursor(NO_CONTEXT);\nvar contextFiberStackCursor = createCursor(NO_CONTEXT);\nvar rootInstanceStackCursor = createCursor(NO_CONTEXT);\n\nfunction requiredContext(c) {\n if (!(c !== NO_CONTEXT)) {\n {\n throw Error( \"Expected host context to exist. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n return c;\n}\n\nfunction getRootHostContainer() {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n return rootInstance;\n}\n\nfunction pushHostContainer(fiber, nextRootInstance) {\n \u002F\u002F Push current root instance onto the stack;\n \u002F\u002F This allows us to reset root when portals are popped.\n push(rootInstanceStackCursor, nextRootInstance, fiber); \u002F\u002F Track the context and the Fiber that provided it.\n \u002F\u002F This enables us to pop only Fibers that provide unique contexts.\n\n push(contextFiberStackCursor, fiber, fiber); \u002F\u002F Finally, we need to push the host context to the stack.\n \u002F\u002F However, we can't just call getRootHostContext() and push it because\n \u002F\u002F we'd have a different number of entries on the stack depending on\n \u002F\u002F whether getRootHostContext() throws somewhere in renderer code or not.\n \u002F\u002F So we push an empty value first. This lets us safely unwind on errors.\n\n push(contextStackCursor$1, NO_CONTEXT, fiber);\n var nextRootContext = getRootHostContext(nextRootInstance); \u002F\u002F Now that we know this function doesn't throw, replace it.\n\n pop(contextStackCursor$1, fiber);\n push(contextStackCursor$1, nextRootContext, fiber);\n}\n\nfunction popHostContainer(fiber) {\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n pop(rootInstanceStackCursor, fiber);\n}\n\nfunction getHostContext() {\n var context = requiredContext(contextStackCursor$1.current);\n return context;\n}\n\nfunction pushHostContext(fiber) {\n var rootInstance = requiredContext(rootInstanceStackCursor.current);\n var context = requiredContext(contextStackCursor$1.current);\n var nextContext = getChildHostContext(context, fiber.type); \u002F\u002F Don't push this Fiber's context unless it's unique.\n\n if (context === nextContext) {\n return;\n } \u002F\u002F Track the context and the Fiber that provided it.\n \u002F\u002F This enables us to pop only Fibers that provide unique contexts.\n\n\n push(contextFiberStackCursor, fiber, fiber);\n push(contextStackCursor$1, nextContext, fiber);\n}\n\nfunction popHostContext(fiber) {\n \u002F\u002F Do not pop unless this Fiber provided the current context.\n \u002F\u002F pushHostContext() only pushes Fibers that provide unique contexts.\n if (contextFiberStackCursor.current !== fiber) {\n return;\n }\n\n pop(contextStackCursor$1, fiber);\n pop(contextFiberStackCursor, fiber);\n}\n\nvar DefaultSuspenseContext = 0; \u002F\u002F The Suspense Context is split into two parts. The lower bits is\n\u002F\u002F inherited deeply down the subtree. The upper bits only affect\n\u002F\u002F this immediate suspense boundary and gets reset each new\n\u002F\u002F boundary or suspense list.\n\nvar SubtreeSuspenseContextMask = 1; \u002F\u002F Subtree Flags:\n\u002F\u002F InvisibleParentSuspenseContext indicates that one of our parent Suspense\n\u002F\u002F boundaries is not currently showing visible main content.\n\u002F\u002F Either because it is already showing a fallback or is not mounted at all.\n\u002F\u002F We can use this to determine if it is desirable to trigger a fallback at\n\u002F\u002F the parent. If not, then we might need to trigger undesirable boundaries\n\u002F\u002F and\u002For suspend the commit to avoid hiding the parent content.\n\nvar InvisibleParentSuspenseContext = 1; \u002F\u002F Shallow Flags:\n\u002F\u002F ForceSuspenseFallback can be used by SuspenseList to force newly added\n\u002F\u002F items into their fallback state during one of the render passes.\n\nvar ForceSuspenseFallback = 2;\nvar suspenseStackCursor = createCursor(DefaultSuspenseContext);\nfunction hasSuspenseContext(parentContext, flag) {\n return (parentContext & flag) !== 0;\n}\nfunction setDefaultShallowSuspenseContext(parentContext) {\n return parentContext & SubtreeSuspenseContextMask;\n}\nfunction setShallowSuspenseContext(parentContext, shallowContext) {\n return parentContext & SubtreeSuspenseContextMask | shallowContext;\n}\nfunction addSubtreeSuspenseContext(parentContext, subtreeContext) {\n return parentContext | subtreeContext;\n}\nfunction pushSuspenseContext(fiber, newContext) {\n push(suspenseStackCursor, newContext, fiber);\n}\nfunction popSuspenseContext(fiber) {\n pop(suspenseStackCursor, fiber);\n}\n\nfunction shouldCaptureSuspense(workInProgress, hasInvisibleParent) {\n \u002F\u002F If it was the primary children that just suspended, capture and render the\n \u002F\u002F fallback. Otherwise, don't capture and bubble to the next boundary.\n var nextState = workInProgress.memoizedState;\n\n if (nextState !== null) {\n if (nextState.dehydrated !== null) {\n \u002F\u002F A dehydrated boundary always captures.\n return true;\n }\n\n return false;\n }\n\n var props = workInProgress.memoizedProps; \u002F\u002F In order to capture, the Suspense component must have a fallback prop.\n\n if (props.fallback === undefined) {\n return false;\n } \u002F\u002F Regular boundaries always capture.\n\n\n if (props.unstable_avoidThisFallback !== true) {\n return true;\n } \u002F\u002F If it's a boundary we should avoid, then we prefer to bubble up to the\n \u002F\u002F parent boundary if it is currently invisible.\n\n\n if (hasInvisibleParent) {\n return false;\n } \u002F\u002F If the parent is not able to handle it, we must handle it.\n\n\n return true;\n}\nfunction findFirstSuspended(row) {\n var node = row;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n var dehydrated = state.dehydrated;\n\n if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) {\n return node;\n }\n }\n } else if (node.tag === SuspenseListComponent && \u002F\u002F revealOrder undefined can't be trusted because it don't\n \u002F\u002F keep track of whether it suspended or not.\n node.memoizedProps.revealOrder !== undefined) {\n var didSuspend = (node.flags & DidCapture) !== NoFlags;\n\n if (didSuspend) {\n return node;\n }\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === row) {\n return null;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === row) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n\n return null;\n}\n\nvar NoFlags$1 =\n\u002F* *\u002F\n0; \u002F\u002F Represents whether effect should fire.\n\nvar HasEffect =\n\u002F* *\u002F\n1; \u002F\u002F Represents the phase in which the effect (not the clean-up) fires.\n\nvar Layout =\n\u002F* *\u002F\n2;\nvar Passive$1 =\n\u002F* *\u002F\n4;\n\n\u002F\u002F This may have been an insertion or a hydration.\n\nvar hydrationParentFiber = null;\nvar nextHydratableInstance = null;\nvar isHydrating = false;\n\nfunction enterHydrationState(fiber) {\n\n var parentInstance = fiber.stateNode.containerInfo;\n nextHydratableInstance = getFirstHydratableChild(parentInstance);\n hydrationParentFiber = fiber;\n isHydrating = true;\n return true;\n}\n\nfunction deleteHydratableInstance(returnFiber, instance) {\n {\n switch (returnFiber.tag) {\n case HostRoot:\n didNotHydrateContainerInstance(returnFiber.stateNode.containerInfo, instance);\n break;\n\n case HostComponent:\n didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance);\n break;\n }\n }\n\n var childToDelete = createFiberFromHostInstanceForDeletion();\n childToDelete.stateNode = instance;\n childToDelete.return = returnFiber;\n childToDelete.flags = Deletion; \u002F\u002F This might seem like it belongs on progressedFirstDeletion. However,\n \u002F\u002F these children are not part of the reconciliation list of children.\n \u002F\u002F Even if we abort and rereconcile the children, that will try to hydrate\n \u002F\u002F again and the nodes are still in the host tree so these will be\n \u002F\u002F recreated.\n\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = childToDelete;\n returnFiber.lastEffect = childToDelete;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = childToDelete;\n }\n}\n\nfunction insertNonHydratedInstance(returnFiber, fiber) {\n fiber.flags = fiber.flags & ~Hydrating | Placement;\n\n {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n\n switch (fiber.tag) {\n case HostComponent:\n var type = fiber.type;\n var props = fiber.pendingProps;\n didNotFindHydratableContainerInstance(parentContainer, type);\n break;\n\n case HostText:\n var text = fiber.pendingProps;\n didNotFindHydratableContainerTextInstance(parentContainer, text);\n break;\n }\n\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n\n switch (fiber.tag) {\n case HostComponent:\n var _type = fiber.type;\n var _props = fiber.pendingProps;\n didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type);\n break;\n\n case HostText:\n var _text = fiber.pendingProps;\n didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text);\n break;\n\n case SuspenseComponent:\n didNotFindHydratableSuspenseInstance(parentType, parentProps);\n break;\n }\n\n break;\n }\n\n default:\n return;\n }\n }\n}\n\nfunction tryHydrate(fiber, nextInstance) {\n switch (fiber.tag) {\n case HostComponent:\n {\n var type = fiber.type;\n var props = fiber.pendingProps;\n var instance = canHydrateInstance(nextInstance, type);\n\n if (instance !== null) {\n fiber.stateNode = instance;\n return true;\n }\n\n return false;\n }\n\n case HostText:\n {\n var text = fiber.pendingProps;\n var textInstance = canHydrateTextInstance(nextInstance, text);\n\n if (textInstance !== null) {\n fiber.stateNode = textInstance;\n return true;\n }\n\n return false;\n }\n\n case SuspenseComponent:\n {\n\n return false;\n }\n\n default:\n return false;\n }\n}\n\nfunction tryToClaimNextHydratableInstance(fiber) {\n if (!isHydrating) {\n return;\n }\n\n var nextInstance = nextHydratableInstance;\n\n if (!nextInstance) {\n \u002F\u002F Nothing to hydrate. Make it an insertion.\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n }\n\n var firstAttemptedInstance = nextInstance;\n\n if (!tryHydrate(fiber, nextInstance)) {\n \u002F\u002F If we can't hydrate this instance let's try the next one.\n \u002F\u002F We use this as a heuristic. It's based on intuition and not data so it\n \u002F\u002F might be flawed or unnecessary.\n nextInstance = getNextHydratableSibling(firstAttemptedInstance);\n\n if (!nextInstance || !tryHydrate(fiber, nextInstance)) {\n \u002F\u002F Nothing to hydrate. Make it an insertion.\n insertNonHydratedInstance(hydrationParentFiber, fiber);\n isHydrating = false;\n hydrationParentFiber = fiber;\n return;\n } \u002F\u002F We matched the next one, we'll now assume that the first one was\n \u002F\u002F superfluous and we'll delete it. Since we can't eagerly delete it\n \u002F\u002F we'll have to schedule a deletion. To do that, this node needs a dummy\n \u002F\u002F fiber associated with it.\n\n\n deleteHydratableInstance(hydrationParentFiber, firstAttemptedInstance);\n }\n\n hydrationParentFiber = fiber;\n nextHydratableInstance = getFirstHydratableChild(nextInstance);\n}\n\nfunction prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) {\n\n var instance = fiber.stateNode;\n var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber); \u002F\u002F TODO: Type this specific to this type of component.\n\n fiber.updateQueue = updatePayload; \u002F\u002F If the update payload indicates that there is a change or if there\n \u002F\u002F is a new ref we mark this as an update.\n\n if (updatePayload !== null) {\n return true;\n }\n\n return false;\n}\n\nfunction prepareToHydrateHostTextInstance(fiber) {\n\n var textInstance = fiber.stateNode;\n var textContent = fiber.memoizedProps;\n var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber);\n\n {\n if (shouldUpdate) {\n \u002F\u002F We assume that prepareToHydrateHostTextInstance is called in a context where the\n \u002F\u002F hydration parent is the parent host component of this host text.\n var returnFiber = hydrationParentFiber;\n\n if (returnFiber !== null) {\n switch (returnFiber.tag) {\n case HostRoot:\n {\n var parentContainer = returnFiber.stateNode.containerInfo;\n didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent);\n break;\n }\n\n case HostComponent:\n {\n var parentType = returnFiber.type;\n var parentProps = returnFiber.memoizedProps;\n var parentInstance = returnFiber.stateNode;\n didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent);\n break;\n }\n }\n }\n }\n }\n\n return shouldUpdate;\n}\n\nfunction skipPastDehydratedSuspenseInstance(fiber) {\n\n var suspenseState = fiber.memoizedState;\n var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null;\n\n if (!suspenseInstance) {\n {\n throw Error( \"Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);\n}\n\nfunction popToNextHostParent(fiber) {\n var parent = fiber.return;\n\n while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) {\n parent = parent.return;\n }\n\n hydrationParentFiber = parent;\n}\n\nfunction popHydrationState(fiber) {\n\n if (fiber !== hydrationParentFiber) {\n \u002F\u002F We're deeper than the current hydration context, inside an inserted\n \u002F\u002F tree.\n return false;\n }\n\n if (!isHydrating) {\n \u002F\u002F If we're not currently hydrating but we're in a hydration context, then\n \u002F\u002F we were an insertion and now need to pop up reenter hydration of our\n \u002F\u002F siblings.\n popToNextHostParent(fiber);\n isHydrating = true;\n return false;\n }\n\n var type = fiber.type; \u002F\u002F If we have any remaining hydratable nodes, we need to delete them now.\n \u002F\u002F We only do this deeper than head and body since they tend to have random\n \u002F\u002F other nodes in them. We also ignore components with pure text content in\n \u002F\u002F side of them.\n \u002F\u002F TODO: Better heuristic.\n\n if (fiber.tag !== HostComponent || type !== 'head' && type !== 'body' && !shouldSetTextContent(type, fiber.memoizedProps)) {\n var nextInstance = nextHydratableInstance;\n\n while (nextInstance) {\n deleteHydratableInstance(fiber, nextInstance);\n nextInstance = getNextHydratableSibling(nextInstance);\n }\n }\n\n popToNextHostParent(fiber);\n\n if (fiber.tag === SuspenseComponent) {\n nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber);\n } else {\n nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null;\n }\n\n return true;\n}\n\nfunction resetHydrationState() {\n\n hydrationParentFiber = null;\n nextHydratableInstance = null;\n isHydrating = false;\n}\n\nfunction getIsHydrating() {\n return isHydrating;\n}\n\n\u002F\u002F and should be reset before starting a new render.\n\u002F\u002F This tracks which mutable sources need to be reset after a render.\n\nvar workInProgressSources = [];\nvar rendererSigil$1;\n\n{\n \u002F\u002F Used to detect multiple renderers using the same mutable source.\n rendererSigil$1 = {};\n}\n\nfunction markSourceAsDirty(mutableSource) {\n workInProgressSources.push(mutableSource);\n}\nfunction resetWorkInProgressVersions() {\n for (var i = 0; i \u003C workInProgressSources.length; i++) {\n var mutableSource = workInProgressSources[i];\n\n {\n mutableSource._workInProgressVersionPrimary = null;\n }\n }\n\n workInProgressSources.length = 0;\n}\nfunction getWorkInProgressVersion(mutableSource) {\n {\n return mutableSource._workInProgressVersionPrimary;\n }\n}\nfunction setWorkInProgressVersion(mutableSource, version) {\n {\n mutableSource._workInProgressVersionPrimary = version;\n }\n\n workInProgressSources.push(mutableSource);\n}\nfunction warnAboutMultipleRenderersDEV(mutableSource) {\n {\n {\n if (mutableSource._currentPrimaryRenderer == null) {\n mutableSource._currentPrimaryRenderer = rendererSigil$1;\n } else if (mutableSource._currentPrimaryRenderer !== rendererSigil$1) {\n error('Detected multiple renderers concurrently rendering the ' + 'same mutable source. This is currently unsupported.');\n }\n }\n }\n} \u002F\u002F Eager reads the version of a mutable source and stores it on the root.\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig;\nvar didWarnAboutMismatchedHooksForComponent;\nvar didWarnAboutUseOpaqueIdentifier;\n\n{\n didWarnAboutUseOpaqueIdentifier = {};\n didWarnAboutMismatchedHooksForComponent = new Set();\n}\n\n\u002F\u002F These are set right before calling the component.\nvar renderLanes = NoLanes; \u002F\u002F The work-in-progress fiber. I've named it differently to distinguish it from\n\u002F\u002F the work-in-progress hook.\n\nvar currentlyRenderingFiber$1 = null; \u002F\u002F Hooks are stored as a linked list on the fiber's memoizedState field. The\n\u002F\u002F current hook list is the list that belongs to the current fiber. The\n\u002F\u002F work-in-progress hook list is a new list that will be added to the\n\u002F\u002F work-in-progress fiber.\n\nvar currentHook = null;\nvar workInProgressHook = null; \u002F\u002F Whether an update was scheduled at any point during the render phase. This\n\u002F\u002F does not get reset if we do another render pass; only when we're completely\n\u002F\u002F finished evaluating this component. This is an optimization so we know\n\u002F\u002F whether we need to clear render phase updates after a throw.\n\nvar didScheduleRenderPhaseUpdate = false; \u002F\u002F Where an update was scheduled only during the current render pass. This\n\u002F\u002F gets reset after each attempt.\n\u002F\u002F TODO: Maybe there's some way to consolidate this with\n\u002F\u002F `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`.\n\nvar didScheduleRenderPhaseUpdateDuringThisPass = false;\nvar RE_RENDER_LIMIT = 25; \u002F\u002F In DEV, this is the name of the currently executing primitive hook\n\nvar currentHookNameInDev = null; \u002F\u002F In DEV, this list ensures that hooks are called in the same order between renders.\n\u002F\u002F The list stores the order of hooks used during the initial render (mount).\n\u002F\u002F Subsequent renders (updates) reference this list.\n\nvar hookTypesDev = null;\nvar hookTypesUpdateIndexDev = -1; \u002F\u002F In DEV, this tracks whether currently rendering component needs to ignore\n\u002F\u002F the dependencies for Hooks that need them (e.g. useEffect or useMemo).\n\u002F\u002F When true, such Hooks will always be \"remounted\". Only used during hot reload.\n\nvar ignorePreviousDependencies = false;\n\nfunction mountHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev === null) {\n hookTypesDev = [hookName];\n } else {\n hookTypesDev.push(hookName);\n }\n }\n}\n\nfunction updateHookTypesDev() {\n {\n var hookName = currentHookNameInDev;\n\n if (hookTypesDev !== null) {\n hookTypesUpdateIndexDev++;\n\n if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) {\n warnOnHookMismatchInDev(hookName);\n }\n }\n }\n}\n\nfunction checkDepsAreArrayDev(deps) {\n {\n if (deps !== undefined && deps !== null && !Array.isArray(deps)) {\n \u002F\u002F Verify deps, but only on mount to avoid extra checks.\n \u002F\u002F It's unlikely their type would change as usually you define them inline.\n error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps);\n }\n }\n}\n\nfunction warnOnHookMismatchInDev(currentHookName) {\n {\n var componentName = getComponentName(currentlyRenderingFiber$1.type);\n\n if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) {\n didWarnAboutMismatchedHooksForComponent.add(componentName);\n\n if (hookTypesDev !== null) {\n var table = '';\n var secondColumnStart = 30;\n\n for (var i = 0; i \u003C= hookTypesUpdateIndexDev; i++) {\n var oldHookName = hookTypesDev[i];\n var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName;\n var row = i + 1 + \". \" + oldHookName; \u002F\u002F Extra space so second column lines up\n \u002F\u002F lol @ IE not supporting String#repeat\n\n while (row.length \u003C secondColumnStart) {\n row += ' ';\n }\n\n row += newHookName + '\\n';\n table += row;\n }\n\n error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https:\u002F\u002Freactjs.org\u002Flink\u002Frules-of-hooks\\n\\n' + ' Previous render Next render\\n' + ' ------------------------------------------------------\\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\\n', componentName, table);\n }\n }\n }\n}\n\nfunction throwInvalidHookError() {\n {\n {\n throw Error( \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https:\u002F\u002Freactjs.org\u002Flink\u002Finvalid-hook-call for tips about how to debug and fix this problem.\" );\n }\n }\n}\n\nfunction areHookInputsEqual(nextDeps, prevDeps) {\n {\n if (ignorePreviousDependencies) {\n \u002F\u002F Only true when this component is being hot reloaded.\n return false;\n }\n }\n\n if (prevDeps === null) {\n {\n error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);\n }\n\n return false;\n }\n\n {\n \u002F\u002F Don't bother comparing lengths in prod because these arrays should be\n \u002F\u002F passed inline.\n if (nextDeps.length !== prevDeps.length) {\n error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\\n\\n' + 'Previous: %s\\n' + 'Incoming: %s', currentHookNameInDev, \"[\" + prevDeps.join(', ') + \"]\", \"[\" + nextDeps.join(', ') + \"]\");\n }\n }\n\n for (var i = 0; i \u003C prevDeps.length && i \u003C nextDeps.length; i++) {\n if (objectIs(nextDeps[i], prevDeps[i])) {\n continue;\n }\n\n return false;\n }\n\n return true;\n}\n\nfunction renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) {\n renderLanes = nextRenderLanes;\n currentlyRenderingFiber$1 = workInProgress;\n\n {\n hookTypesDev = current !== null ? current._debugHookTypes : null;\n hookTypesUpdateIndexDev = -1; \u002F\u002F Used for hot reloading:\n\n ignorePreviousDependencies = current !== null && current.type !== workInProgress.type;\n }\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.lanes = NoLanes; \u002F\u002F The following should have already been reset\n \u002F\u002F currentHook = null;\n \u002F\u002F workInProgressHook = null;\n \u002F\u002F didScheduleRenderPhaseUpdate = false;\n \u002F\u002F TODO Warn if no hooks are used at all during mount, then some are used during update.\n \u002F\u002F Currently we will identify the update render as a mount because memoizedState === null.\n \u002F\u002F This is tricky because it's valid for certain types of components (e.g. React.lazy)\n \u002F\u002F Using memoizedState to differentiate between mount\u002Fupdate only works if at least one stateful hook is used.\n \u002F\u002F Non-stateful hooks (e.g. context) don't get added to memoizedState,\n \u002F\u002F so memoizedState would be null during updates and mounts.\n\n {\n if (current !== null && current.memoizedState !== null) {\n ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV;\n } else if (hookTypesDev !== null) {\n \u002F\u002F This dispatcher handles an edge case where a component is updating,\n \u002F\u002F but no stateful hooks have been used.\n \u002F\u002F We want to match the production code behavior (which will use HooksDispatcherOnMount),\n \u002F\u002F but with the extra DEV validation to ensure hooks ordering hasn't changed.\n \u002F\u002F This dispatcher does that.\n ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV;\n } else {\n ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV;\n }\n }\n\n var children = Component(props, secondArg); \u002F\u002F Check if there was a render phase update\n\n if (didScheduleRenderPhaseUpdateDuringThisPass) {\n \u002F\u002F Keep rendering in a loop for as long as render phase updates continue to\n \u002F\u002F be scheduled. Use a counter to prevent infinite loops.\n var numberOfReRenders = 0;\n\n do {\n didScheduleRenderPhaseUpdateDuringThisPass = false;\n\n if (!(numberOfReRenders \u003C RE_RENDER_LIMIT)) {\n {\n throw Error( \"Too many re-renders. React limits the number of renders to prevent an infinite loop.\" );\n }\n }\n\n numberOfReRenders += 1;\n\n {\n \u002F\u002F Even when hot reloading, allow dependencies to stabilize\n \u002F\u002F after first render to prevent infinite render phase updates.\n ignorePreviousDependencies = false;\n } \u002F\u002F Start over from the beginning of the list\n\n\n currentHook = null;\n workInProgressHook = null;\n workInProgress.updateQueue = null;\n\n {\n \u002F\u002F Also validate hook order for cascading updates.\n hookTypesUpdateIndexDev = -1;\n }\n\n ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV ;\n children = Component(props, secondArg);\n } while (didScheduleRenderPhaseUpdateDuringThisPass);\n } \u002F\u002F We can assume the previous dispatcher is always this one, since we set it\n \u002F\u002F at the beginning of the render phase and there's no re-entrancy.\n\n\n ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n\n {\n workInProgress._debugHookTypes = hookTypesDev;\n } \u002F\u002F This check uses currentHook so that it works the same in DEV and prod bundles.\n \u002F\u002F hookTypesDev could catch more cases (e.g. context) but only in DEV bundles.\n\n\n var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null;\n renderLanes = NoLanes;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n currentHookNameInDev = null;\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1;\n }\n\n didScheduleRenderPhaseUpdate = false;\n\n if (!!didRenderTooFewHooks) {\n {\n throw Error( \"Rendered fewer hooks than expected. This may be caused by an accidental early return statement.\" );\n }\n }\n\n return children;\n}\nfunction bailoutHooks(current, workInProgress, lanes) {\n workInProgress.updateQueue = current.updateQueue;\n workInProgress.flags &= ~(Passive | Update);\n current.lanes = removeLanes(current.lanes, lanes);\n}\nfunction resetHooksAfterThrow() {\n \u002F\u002F We can assume the previous dispatcher is always this one, since we set it\n \u002F\u002F at the beginning of the render phase and there's no re-entrancy.\n ReactCurrentDispatcher$1.current = ContextOnlyDispatcher;\n\n if (didScheduleRenderPhaseUpdate) {\n \u002F\u002F There were render phase updates. These are only valid for this render\n \u002F\u002F phase, which we are now aborting. Remove the updates from the queues so\n \u002F\u002F they do not persist to the next render. Do not remove updates from hooks\n \u002F\u002F that weren't processed.\n \u002F\u002F\n \u002F\u002F Only reset the updates from the queue if it has a clone. If it does\n \u002F\u002F not have a clone, that means it wasn't processed, and the updates were\n \u002F\u002F scheduled before we entered the render phase.\n var hook = currentlyRenderingFiber$1.memoizedState;\n\n while (hook !== null) {\n var queue = hook.queue;\n\n if (queue !== null) {\n queue.pending = null;\n }\n\n hook = hook.next;\n }\n\n didScheduleRenderPhaseUpdate = false;\n }\n\n renderLanes = NoLanes;\n currentlyRenderingFiber$1 = null;\n currentHook = null;\n workInProgressHook = null;\n\n {\n hookTypesDev = null;\n hookTypesUpdateIndexDev = -1;\n currentHookNameInDev = null;\n isUpdatingOpaqueValueInRenderPhase = false;\n }\n\n didScheduleRenderPhaseUpdateDuringThisPass = false;\n}\n\nfunction mountWorkInProgressHook() {\n var hook = {\n memoizedState: null,\n baseState: null,\n baseQueue: null,\n queue: null,\n next: null\n };\n\n if (workInProgressHook === null) {\n \u002F\u002F This is the first hook in the list\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook;\n } else {\n \u002F\u002F Append to the end of the list\n workInProgressHook = workInProgressHook.next = hook;\n }\n\n return workInProgressHook;\n}\n\nfunction updateWorkInProgressHook() {\n \u002F\u002F This function is used both for updates and for re-renders triggered by a\n \u002F\u002F render phase update. It assumes there is either a current hook we can\n \u002F\u002F clone, or a work-in-progress hook from a previous render pass that we can\n \u002F\u002F use as a base. When we reach the end of the base list, we must switch to\n \u002F\u002F the dispatcher used for mounts.\n var nextCurrentHook;\n\n if (currentHook === null) {\n var current = currentlyRenderingFiber$1.alternate;\n\n if (current !== null) {\n nextCurrentHook = current.memoizedState;\n } else {\n nextCurrentHook = null;\n }\n } else {\n nextCurrentHook = currentHook.next;\n }\n\n var nextWorkInProgressHook;\n\n if (workInProgressHook === null) {\n nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState;\n } else {\n nextWorkInProgressHook = workInProgressHook.next;\n }\n\n if (nextWorkInProgressHook !== null) {\n \u002F\u002F There's already a work-in-progress. Reuse it.\n workInProgressHook = nextWorkInProgressHook;\n nextWorkInProgressHook = workInProgressHook.next;\n currentHook = nextCurrentHook;\n } else {\n \u002F\u002F Clone from the current hook.\n if (!(nextCurrentHook !== null)) {\n {\n throw Error( \"Rendered more hooks than during the previous render.\" );\n }\n }\n\n currentHook = nextCurrentHook;\n var newHook = {\n memoizedState: currentHook.memoizedState,\n baseState: currentHook.baseState,\n baseQueue: currentHook.baseQueue,\n queue: currentHook.queue,\n next: null\n };\n\n if (workInProgressHook === null) {\n \u002F\u002F This is the first hook in the list.\n currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook;\n } else {\n \u002F\u002F Append to the end of the list.\n workInProgressHook = workInProgressHook.next = newHook;\n }\n }\n\n return workInProgressHook;\n}\n\nfunction createFunctionComponentUpdateQueue() {\n return {\n lastEffect: null\n };\n}\n\nfunction basicStateReducer(state, action) {\n \u002F\u002F $FlowFixMe: Flow doesn't like mixed types\n return typeof action === 'function' ? action(state) : action;\n}\n\nfunction mountReducer(reducer, initialArg, init) {\n var hook = mountWorkInProgressHook();\n var initialState;\n\n if (init !== undefined) {\n initialState = init(initialArg);\n } else {\n initialState = initialArg;\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = hook.queue = {\n pending: null,\n dispatch: null,\n lastRenderedReducer: reducer,\n lastRenderedState: initialState\n };\n var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (!(queue !== null)) {\n {\n throw Error( \"Should have a queue. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n queue.lastRenderedReducer = reducer;\n var current = currentHook; \u002F\u002F The last rebase update that is NOT part of the base state.\n\n var baseQueue = current.baseQueue; \u002F\u002F The last pending update that hasn't been processed yet.\n\n var pendingQueue = queue.pending;\n\n if (pendingQueue !== null) {\n \u002F\u002F We have new updates that haven't been processed yet.\n \u002F\u002F We'll add them to the base queue.\n if (baseQueue !== null) {\n \u002F\u002F Merge the pending queue and the base queue.\n var baseFirst = baseQueue.next;\n var pendingFirst = pendingQueue.next;\n baseQueue.next = pendingFirst;\n pendingQueue.next = baseFirst;\n }\n\n {\n if (current.baseQueue !== baseQueue) {\n \u002F\u002F Internal invariant that should never happen, but feasibly could in\n \u002F\u002F the future if we implement resuming, or some form of that.\n error('Internal error: Expected work-in-progress queue to be a clone. ' + 'This is a bug in React.');\n }\n }\n\n current.baseQueue = baseQueue = pendingQueue;\n queue.pending = null;\n }\n\n if (baseQueue !== null) {\n \u002F\u002F We have a queue to process.\n var first = baseQueue.next;\n var newState = current.baseState;\n var newBaseState = null;\n var newBaseQueueFirst = null;\n var newBaseQueueLast = null;\n var update = first;\n\n do {\n var updateLane = update.lane;\n\n if (!isSubsetOfLanes(renderLanes, updateLane)) {\n \u002F\u002F Priority is insufficient. Skip this update. If this is the first\n \u002F\u002F skipped update, the previous update\u002Fstate is the new base\n \u002F\u002F update\u002Fstate.\n var clone = {\n lane: updateLane,\n action: update.action,\n eagerReducer: update.eagerReducer,\n eagerState: update.eagerState,\n next: null\n };\n\n if (newBaseQueueLast === null) {\n newBaseQueueFirst = newBaseQueueLast = clone;\n newBaseState = newState;\n } else {\n newBaseQueueLast = newBaseQueueLast.next = clone;\n } \u002F\u002F Update the remaining priority in the queue.\n \u002F\u002F TODO: Don't need to accumulate this. Instead, we can remove\n \u002F\u002F renderLanes from the original lanes.\n\n\n currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);\n markSkippedUpdateLanes(updateLane);\n } else {\n \u002F\u002F This update does have sufficient priority.\n if (newBaseQueueLast !== null) {\n var _clone = {\n \u002F\u002F This update is going to be committed so we never want uncommit\n \u002F\u002F it. Using NoLane works because 0 is a subset of all bitmasks, so\n \u002F\u002F this will never be skipped by the check above.\n lane: NoLane,\n action: update.action,\n eagerReducer: update.eagerReducer,\n eagerState: update.eagerState,\n next: null\n };\n newBaseQueueLast = newBaseQueueLast.next = _clone;\n } \u002F\u002F Process this update.\n\n\n if (update.eagerReducer === reducer) {\n \u002F\u002F If this update was processed eagerly, and its reducer matches the\n \u002F\u002F current reducer, we can use the eagerly computed state.\n newState = update.eagerState;\n } else {\n var action = update.action;\n newState = reducer(newState, action);\n }\n }\n\n update = update.next;\n } while (update !== null && update !== first);\n\n if (newBaseQueueLast === null) {\n newBaseState = newState;\n } else {\n newBaseQueueLast.next = newBaseQueueFirst;\n } \u002F\u002F Mark that the fiber performed work, but only if the new state is\n \u002F\u002F different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState;\n hook.baseState = newBaseState;\n hook.baseQueue = newBaseQueueLast;\n queue.lastRenderedState = newState;\n }\n\n var dispatch = queue.dispatch;\n return [hook.memoizedState, dispatch];\n}\n\nfunction rerenderReducer(reducer, initialArg, init) {\n var hook = updateWorkInProgressHook();\n var queue = hook.queue;\n\n if (!(queue !== null)) {\n {\n throw Error( \"Should have a queue. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n queue.lastRenderedReducer = reducer; \u002F\u002F This is a re-render. Apply the new render phase updates to the previous\n \u002F\u002F work-in-progress hook.\n\n var dispatch = queue.dispatch;\n var lastRenderPhaseUpdate = queue.pending;\n var newState = hook.memoizedState;\n\n if (lastRenderPhaseUpdate !== null) {\n \u002F\u002F The queue doesn't persist past this render pass.\n queue.pending = null;\n var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;\n var update = firstRenderPhaseUpdate;\n\n do {\n \u002F\u002F Process this render phase update. We don't have to check the\n \u002F\u002F priority because it will always be the same as the current\n \u002F\u002F render's.\n var action = update.action;\n newState = reducer(newState, action);\n update = update.next;\n } while (update !== firstRenderPhaseUpdate); \u002F\u002F Mark that the fiber performed work, but only if the new state is\n \u002F\u002F different from the current state.\n\n\n if (!objectIs(newState, hook.memoizedState)) {\n markWorkInProgressReceivedUpdate();\n }\n\n hook.memoizedState = newState; \u002F\u002F Don't persist the state accumulated from the render phase updates to\n \u002F\u002F the base state unless the queue is empty.\n \u002F\u002F TODO: Not sure if this is the desired semantics, but it's what we\n \u002F\u002F do for gDSFP. I can't remember why.\n\n if (hook.baseQueue === null) {\n hook.baseState = newState;\n }\n\n queue.lastRenderedState = newState;\n }\n\n return [newState, dispatch];\n}\n\nfunction readFromUnsubcribedMutableSource(root, source, getSnapshot) {\n {\n warnAboutMultipleRenderersDEV(source);\n }\n\n var getVersion = source._getVersion;\n var version = getVersion(source._source); \u002F\u002F Is it safe for this component to read from this source during the current render?\n\n var isSafeToReadFromSource = false; \u002F\u002F Check the version first.\n \u002F\u002F If this render has already been started with a specific version,\n \u002F\u002F we can use it alone to determine if we can safely read from the source.\n\n var currentRenderVersion = getWorkInProgressVersion(source);\n\n if (currentRenderVersion !== null) {\n \u002F\u002F It's safe to read if the store hasn't been mutated since the last time\n \u002F\u002F we read something.\n isSafeToReadFromSource = currentRenderVersion === version;\n } else {\n \u002F\u002F If there's no version, then this is the first time we've read from the\n \u002F\u002F source during the current render pass, so we need to do a bit more work.\n \u002F\u002F What we need to determine is if there are any hooks that already\n \u002F\u002F subscribed to the source, and if so, whether there are any pending\n \u002F\u002F mutations that haven't been synchronized yet.\n \u002F\u002F\n \u002F\u002F If there are no pending mutations, then `root.mutableReadLanes` will be\n \u002F\u002F empty, and we know we can safely read.\n \u002F\u002F\n \u002F\u002F If there *are* pending mutations, we may still be able to safely read\n \u002F\u002F if the currently rendering lanes are inclusive of the pending mutation\n \u002F\u002F lanes, since that guarantees that the value we're about to read from\n \u002F\u002F the source is consistent with the values that we read during the most\n \u002F\u002F recent mutation.\n isSafeToReadFromSource = isSubsetOfLanes(renderLanes, root.mutableReadLanes);\n\n if (isSafeToReadFromSource) {\n \u002F\u002F If it's safe to read from this source during the current render,\n \u002F\u002F store the version in case other components read from it.\n \u002F\u002F A changed version number will let those components know to throw and restart the render.\n setWorkInProgressVersion(source, version);\n }\n }\n\n if (isSafeToReadFromSource) {\n var snapshot = getSnapshot(source._source);\n\n {\n if (typeof snapshot === 'function') {\n error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');\n }\n }\n\n return snapshot;\n } else {\n \u002F\u002F This handles the special case of a mutable source being shared between renderers.\n \u002F\u002F In that case, if the source is mutated between the first and second renderer,\n \u002F\u002F The second renderer don't know that it needs to reset the WIP version during unwind,\n \u002F\u002F (because the hook only marks sources as dirty if it's written to their WIP version).\n \u002F\u002F That would cause this tear check to throw again and eventually be visible to the user.\n \u002F\u002F We can avoid this infinite loop by explicitly marking the source as dirty.\n \u002F\u002F\n \u002F\u002F This can lead to tearing in the first renderer when it resumes,\n \u002F\u002F but there's nothing we can do about that (short of throwing here and refusing to continue the render).\n markSourceAsDirty(source);\n\n {\n {\n throw Error( \"Cannot read from mutable source during the current render without tearing. This is a bug in React. Please file an issue.\" );\n }\n }\n }\n}\n\nfunction useMutableSource(hook, source, getSnapshot, subscribe) {\n var root = getWorkInProgressRoot();\n\n if (!(root !== null)) {\n {\n throw Error( \"Expected a work-in-progress root. This is a bug in React. Please file an issue.\" );\n }\n }\n\n var getVersion = source._getVersion;\n var version = getVersion(source._source);\n var dispatcher = ReactCurrentDispatcher$1.current; \u002F\u002F eslint-disable-next-line prefer-const\n\n var _dispatcher$useState = dispatcher.useState(function () {\n return readFromUnsubcribedMutableSource(root, source, getSnapshot);\n }),\n currentSnapshot = _dispatcher$useState[0],\n setSnapshot = _dispatcher$useState[1];\n\n var snapshot = currentSnapshot; \u002F\u002F Grab a handle to the state hook as well.\n \u002F\u002F We use it to clear the pending update queue if we have a new source.\n\n var stateHook = workInProgressHook;\n var memoizedState = hook.memoizedState;\n var refs = memoizedState.refs;\n var prevGetSnapshot = refs.getSnapshot;\n var prevSource = memoizedState.source;\n var prevSubscribe = memoizedState.subscribe;\n var fiber = currentlyRenderingFiber$1;\n hook.memoizedState = {\n refs: refs,\n source: source,\n subscribe: subscribe\n }; \u002F\u002F Sync the values needed by our subscription handler after each commit.\n\n dispatcher.useEffect(function () {\n refs.getSnapshot = getSnapshot; \u002F\u002F Normally the dispatch function for a state hook never changes,\n \u002F\u002F but this hook recreates the queue in certain cases to avoid updates from stale sources.\n \u002F\u002F handleChange() below needs to reference the dispatch function without re-subscribing,\n \u002F\u002F so we use a ref to ensure that it always has the latest version.\n\n refs.setSnapshot = setSnapshot; \u002F\u002F Check for a possible change between when we last rendered now.\n\n var maybeNewVersion = getVersion(source._source);\n\n if (!objectIs(version, maybeNewVersion)) {\n var maybeNewSnapshot = getSnapshot(source._source);\n\n {\n if (typeof maybeNewSnapshot === 'function') {\n error('Mutable source should not return a function as the snapshot value. ' + 'Functions may close over mutable values and cause tearing.');\n }\n }\n\n if (!objectIs(snapshot, maybeNewSnapshot)) {\n setSnapshot(maybeNewSnapshot);\n var lane = requestUpdateLane(fiber);\n markRootMutableRead(root, lane);\n } \u002F\u002F If the source mutated between render and now,\n \u002F\u002F there may be state updates already scheduled from the old source.\n \u002F\u002F Entangle the updates so that they render in the same batch.\n\n\n markRootEntangled(root, root.mutableReadLanes);\n }\n }, [getSnapshot, source, subscribe]); \u002F\u002F If we got a new source or subscribe function, re-subscribe in a passive effect.\n\n dispatcher.useEffect(function () {\n var handleChange = function () {\n var latestGetSnapshot = refs.getSnapshot;\n var latestSetSnapshot = refs.setSnapshot;\n\n try {\n latestSetSnapshot(latestGetSnapshot(source._source)); \u002F\u002F Record a pending mutable source update with the same expiration time.\n\n var lane = requestUpdateLane(fiber);\n markRootMutableRead(root, lane);\n } catch (error) {\n \u002F\u002F A selector might throw after a source mutation.\n \u002F\u002F e.g. it might try to read from a part of the store that no longer exists.\n \u002F\u002F In this case we should still schedule an update with React.\n \u002F\u002F Worst case the selector will throw again and then an error boundary will handle it.\n latestSetSnapshot(function () {\n throw error;\n });\n }\n };\n\n var unsubscribe = subscribe(source._source, handleChange);\n\n {\n if (typeof unsubscribe !== 'function') {\n error('Mutable source subscribe function must return an unsubscribe function.');\n }\n }\n\n return unsubscribe;\n }, [source, subscribe]); \u002F\u002F If any of the inputs to useMutableSource change, reading is potentially unsafe.\n \u002F\u002F\n \u002F\u002F If either the source or the subscription have changed we can't can't trust the update queue.\n \u002F\u002F Maybe the source changed in a way that the old subscription ignored but the new one depends on.\n \u002F\u002F\n \u002F\u002F If the getSnapshot function changed, we also shouldn't rely on the update queue.\n \u002F\u002F It's possible that the underlying source was mutated between the when the last \"change\" event fired,\n \u002F\u002F and when the current render (with the new getSnapshot function) is processed.\n \u002F\u002F\n \u002F\u002F In both cases, we need to throw away pending updates (since they are no longer relevant)\n \u002F\u002F and treat reading from the source as we do in the mount case.\n\n if (!objectIs(prevGetSnapshot, getSnapshot) || !objectIs(prevSource, source) || !objectIs(prevSubscribe, subscribe)) {\n \u002F\u002F Create a new queue and setState method,\n \u002F\u002F So if there are interleaved updates, they get pushed to the older queue.\n \u002F\u002F When this becomes current, the previous queue and dispatch method will be discarded,\n \u002F\u002F including any interleaving updates that occur.\n var newQueue = {\n pending: null,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: snapshot\n };\n newQueue.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, newQueue);\n stateHook.queue = newQueue;\n stateHook.baseQueue = null;\n snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot);\n stateHook.memoizedState = stateHook.baseState = snapshot;\n }\n\n return snapshot;\n}\n\nfunction mountMutableSource(source, getSnapshot, subscribe) {\n var hook = mountWorkInProgressHook();\n hook.memoizedState = {\n refs: {\n getSnapshot: getSnapshot,\n setSnapshot: null\n },\n source: source,\n subscribe: subscribe\n };\n return useMutableSource(hook, source, getSnapshot, subscribe);\n}\n\nfunction updateMutableSource(source, getSnapshot, subscribe) {\n var hook = updateWorkInProgressHook();\n return useMutableSource(hook, source, getSnapshot, subscribe);\n}\n\nfunction mountState(initialState) {\n var hook = mountWorkInProgressHook();\n\n if (typeof initialState === 'function') {\n \u002F\u002F $FlowFixMe: Flow doesn't like mixed types\n initialState = initialState();\n }\n\n hook.memoizedState = hook.baseState = initialState;\n var queue = hook.queue = {\n pending: null,\n dispatch: null,\n lastRenderedReducer: basicStateReducer,\n lastRenderedState: initialState\n };\n var dispatch = queue.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, queue);\n return [hook.memoizedState, dispatch];\n}\n\nfunction updateState(initialState) {\n return updateReducer(basicStateReducer);\n}\n\nfunction rerenderState(initialState) {\n return rerenderReducer(basicStateReducer);\n}\n\nfunction pushEffect(tag, create, destroy, deps) {\n var effect = {\n tag: tag,\n create: create,\n destroy: destroy,\n deps: deps,\n \u002F\u002F Circular\n next: null\n };\n var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue;\n\n if (componentUpdateQueue === null) {\n componentUpdateQueue = createFunctionComponentUpdateQueue();\n currentlyRenderingFiber$1.updateQueue = componentUpdateQueue;\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var lastEffect = componentUpdateQueue.lastEffect;\n\n if (lastEffect === null) {\n componentUpdateQueue.lastEffect = effect.next = effect;\n } else {\n var firstEffect = lastEffect.next;\n lastEffect.next = effect;\n effect.next = firstEffect;\n componentUpdateQueue.lastEffect = effect;\n }\n }\n\n return effect;\n}\n\nfunction mountRef(initialValue) {\n var hook = mountWorkInProgressHook();\n var ref = {\n current: initialValue\n };\n\n {\n Object.seal(ref);\n }\n\n hook.memoizedState = ref;\n return ref;\n}\n\nfunction updateRef(initialValue) {\n var hook = updateWorkInProgressHook();\n return hook.memoizedState;\n}\n\nfunction mountEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n currentlyRenderingFiber$1.flags |= fiberFlags;\n hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps);\n}\n\nfunction updateEffectImpl(fiberFlags, hookFlags, create, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var destroy = undefined;\n\n if (currentHook !== null) {\n var prevEffect = currentHook.memoizedState;\n destroy = prevEffect.destroy;\n\n if (nextDeps !== null) {\n var prevDeps = prevEffect.deps;\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n pushEffect(hookFlags, create, destroy, nextDeps);\n return;\n }\n }\n }\n\n currentlyRenderingFiber$1.flags |= fiberFlags;\n hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps);\n}\n\nfunction mountEffect(create, deps) {\n {\n \u002F\u002F $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n }\n }\n\n return mountEffectImpl(Update | Passive, Passive$1, create, deps);\n}\n\nfunction updateEffect(create, deps) {\n {\n \u002F\u002F $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotCurrentlyActingEffectsInDEV(currentlyRenderingFiber$1);\n }\n }\n\n return updateEffectImpl(Update | Passive, Passive$1, create, deps);\n}\n\nfunction mountLayoutEffect(create, deps) {\n return mountEffectImpl(Update, Layout, create, deps);\n}\n\nfunction updateLayoutEffect(create, deps) {\n return updateEffectImpl(Update, Layout, create, deps);\n}\n\nfunction imperativeHandleEffect(create, ref) {\n if (typeof ref === 'function') {\n var refCallback = ref;\n\n var _inst = create();\n\n refCallback(_inst);\n return function () {\n refCallback(null);\n };\n } else if (ref !== null && ref !== undefined) {\n var refObject = ref;\n\n {\n if (!refObject.hasOwnProperty('current')) {\n error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}');\n }\n }\n\n var _inst2 = create();\n\n refObject.current = _inst2;\n return function () {\n refObject.current = null;\n };\n }\n}\n\nfunction mountImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } \u002F\u002F TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n return mountEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction updateImperativeHandle(ref, create, deps) {\n {\n if (typeof create !== 'function') {\n error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null');\n }\n } \u002F\u002F TODO: If deps are provided, should we skip comparing the ref itself?\n\n\n var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;\n return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps);\n}\n\nfunction mountDebugValue(value, formatterFn) {\u002F\u002F This hook is normally a no-op.\n \u002F\u002F The react-debug-hooks package injects its own implementation\n \u002F\u002F so that e.g. DevTools can display custom hook values.\n}\n\nvar updateDebugValue = mountDebugValue;\n\nfunction mountCallback(callback, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction updateCallback(callback, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.memoizedState;\n\n if (prevState !== null) {\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n\n hook.memoizedState = [callback, nextDeps];\n return callback;\n}\n\nfunction mountMemo(nextCreate, deps) {\n var hook = mountWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction updateMemo(nextCreate, deps) {\n var hook = updateWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n var prevState = hook.memoizedState;\n\n if (prevState !== null) {\n \u002F\u002F Assume these are defined. If they're not, areHookInputsEqual will warn.\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n\n var nextValue = nextCreate();\n hook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n}\n\nfunction mountDeferredValue(value) {\n var _mountState = mountState(value),\n prevValue = _mountState[0],\n setValue = _mountState[1];\n\n mountEffect(function () {\n var prevTransition = ReactCurrentBatchConfig$1.transition;\n ReactCurrentBatchConfig$1.transition = 1;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.transition = prevTransition;\n }\n }, [value]);\n return prevValue;\n}\n\nfunction updateDeferredValue(value) {\n var _updateState = updateState(),\n prevValue = _updateState[0],\n setValue = _updateState[1];\n\n updateEffect(function () {\n var prevTransition = ReactCurrentBatchConfig$1.transition;\n ReactCurrentBatchConfig$1.transition = 1;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.transition = prevTransition;\n }\n }, [value]);\n return prevValue;\n}\n\nfunction rerenderDeferredValue(value) {\n var _rerenderState = rerenderState(),\n prevValue = _rerenderState[0],\n setValue = _rerenderState[1];\n\n updateEffect(function () {\n var prevTransition = ReactCurrentBatchConfig$1.transition;\n ReactCurrentBatchConfig$1.transition = 1;\n\n try {\n setValue(value);\n } finally {\n ReactCurrentBatchConfig$1.transition = prevTransition;\n }\n }, [value]);\n return prevValue;\n}\n\nfunction startTransition(setPending, callback) {\n var priorityLevel = getCurrentPriorityLevel();\n\n {\n runWithPriority$1(priorityLevel \u003C UserBlockingPriority$2 ? UserBlockingPriority$2 : priorityLevel, function () {\n setPending(true);\n });\n runWithPriority$1(priorityLevel \u003E NormalPriority$1 ? NormalPriority$1 : priorityLevel, function () {\n var prevTransition = ReactCurrentBatchConfig$1.transition;\n ReactCurrentBatchConfig$1.transition = 1;\n\n try {\n setPending(false);\n callback();\n } finally {\n ReactCurrentBatchConfig$1.transition = prevTransition;\n }\n });\n }\n}\n\nfunction mountTransition() {\n var _mountState2 = mountState(false),\n isPending = _mountState2[0],\n setPending = _mountState2[1]; \u002F\u002F The `start` method can be stored on a ref, since `setPending`\n \u002F\u002F never changes.\n\n\n var start = startTransition.bind(null, setPending);\n mountRef(start);\n return [start, isPending];\n}\n\nfunction updateTransition() {\n var _updateState2 = updateState(),\n isPending = _updateState2[0];\n\n var startRef = updateRef();\n var start = startRef.current;\n return [start, isPending];\n}\n\nfunction rerenderTransition() {\n var _rerenderState2 = rerenderState(),\n isPending = _rerenderState2[0];\n\n var startRef = updateRef();\n var start = startRef.current;\n return [start, isPending];\n}\n\nvar isUpdatingOpaqueValueInRenderPhase = false;\nfunction getIsUpdatingOpaqueValueInRenderPhaseInDEV() {\n {\n return isUpdatingOpaqueValueInRenderPhase;\n }\n}\n\nfunction warnOnOpaqueIdentifierAccessInDEV(fiber) {\n {\n \u002F\u002F TODO: Should warn in effects and callbacks, too\n var name = getComponentName(fiber.type) || 'Unknown';\n\n if (getIsRendering() && !didWarnAboutUseOpaqueIdentifier[name]) {\n error('The object passed back from useOpaqueIdentifier is meant to be ' + 'passed through to attributes only. Do not read the ' + 'value directly.');\n\n didWarnAboutUseOpaqueIdentifier[name] = true;\n }\n }\n}\n\nfunction mountOpaqueIdentifier() {\n var makeId = makeClientIdInDEV.bind(null, warnOnOpaqueIdentifierAccessInDEV.bind(null, currentlyRenderingFiber$1)) ;\n\n if (getIsHydrating()) {\n var didUpgrade = false;\n var fiber = currentlyRenderingFiber$1;\n\n var readValue = function () {\n if (!didUpgrade) {\n \u002F\u002F Only upgrade once. This works even inside the render phase because\n \u002F\u002F the update is added to a shared queue, which outlasts the\n \u002F\u002F in-progress render.\n didUpgrade = true;\n\n {\n isUpdatingOpaqueValueInRenderPhase = true;\n setId(makeId());\n isUpdatingOpaqueValueInRenderPhase = false;\n warnOnOpaqueIdentifierAccessInDEV(fiber);\n }\n }\n\n {\n {\n throw Error( \"The object passed back from useOpaqueIdentifier is meant to be passed through to attributes only. Do not read the value directly.\" );\n }\n }\n };\n\n var id = makeOpaqueHydratingObject(readValue);\n var setId = mountState(id)[1];\n\n if ((currentlyRenderingFiber$1.mode & BlockingMode) === NoMode) {\n currentlyRenderingFiber$1.flags |= Update | Passive;\n pushEffect(HasEffect | Passive$1, function () {\n setId(makeId());\n }, undefined, null);\n }\n\n return id;\n } else {\n var _id = makeId();\n\n mountState(_id);\n return _id;\n }\n}\n\nfunction updateOpaqueIdentifier() {\n var id = updateState()[0];\n return id;\n}\n\nfunction rerenderOpaqueIdentifier() {\n var id = rerenderState()[0];\n return id;\n}\n\nfunction dispatchAction(fiber, queue, action) {\n {\n if (typeof arguments[3] === 'function') {\n error(\"State updates from the useState() and useReducer() Hooks don't support the \" + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().');\n }\n }\n\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n var update = {\n lane: lane,\n action: action,\n eagerReducer: null,\n eagerState: null,\n next: null\n }; \u002F\u002F Append the update to the end of the list.\n\n var pending = queue.pending;\n\n if (pending === null) {\n \u002F\u002F This is the first update. Create a circular list.\n update.next = update;\n } else {\n update.next = pending.next;\n pending.next = update;\n }\n\n queue.pending = update;\n var alternate = fiber.alternate;\n\n if (fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1) {\n \u002F\u002F This is a render phase update. Stash it in a lazily-created map of\n \u002F\u002F queue -\u003E linked list of updates. After this render pass, we'll restart\n \u002F\u002F and apply the stashed updates on top of the work-in-progress hook.\n didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;\n } else {\n if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {\n \u002F\u002F The queue is currently empty, which means we can eagerly compute the\n \u002F\u002F next state before entering the render phase. If the new state is the\n \u002F\u002F same as the current state, we may be able to bail out entirely.\n var lastRenderedReducer = queue.lastRenderedReducer;\n\n if (lastRenderedReducer !== null) {\n var prevDispatcher;\n\n {\n prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n }\n\n try {\n var currentState = queue.lastRenderedState;\n var eagerState = lastRenderedReducer(currentState, action); \u002F\u002F Stash the eagerly computed state, and the reducer used to compute\n \u002F\u002F it, on the update object. If the reducer hasn't changed by the\n \u002F\u002F time we enter the render phase, then the eager state can be used\n \u002F\u002F without calling the reducer again.\n\n update.eagerReducer = lastRenderedReducer;\n update.eagerState = eagerState;\n\n if (objectIs(eagerState, currentState)) {\n \u002F\u002F Fast path. We can bail out without scheduling React to re-render.\n \u002F\u002F It's still possible that we'll need to rebase this update later,\n \u002F\u002F if the component re-renders for a different reason and by that\n \u002F\u002F time the reducer has changed.\n return;\n }\n } catch (error) {\u002F\u002F Suppress the error. It will throw again in the render phase.\n } finally {\n {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n }\n }\n }\n\n {\n \u002F\u002F $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfNotScopedWithMatchingAct(fiber);\n warnIfNotCurrentlyActingUpdatesInDev(fiber);\n }\n }\n\n scheduleUpdateOnFiber(fiber, lane, eventTime);\n }\n}\n\nvar ContextOnlyDispatcher = {\n readContext: readContext,\n useCallback: throwInvalidHookError,\n useContext: throwInvalidHookError,\n useEffect: throwInvalidHookError,\n useImperativeHandle: throwInvalidHookError,\n useLayoutEffect: throwInvalidHookError,\n useMemo: throwInvalidHookError,\n useReducer: throwInvalidHookError,\n useRef: throwInvalidHookError,\n useState: throwInvalidHookError,\n useDebugValue: throwInvalidHookError,\n useDeferredValue: throwInvalidHookError,\n useTransition: throwInvalidHookError,\n useMutableSource: throwInvalidHookError,\n useOpaqueIdentifier: throwInvalidHookError,\n unstable_isNewReconciler: enableNewReconciler\n};\nvar HooksDispatcherOnMountInDEV = null;\nvar HooksDispatcherOnMountWithHookTypesInDEV = null;\nvar HooksDispatcherOnUpdateInDEV = null;\nvar HooksDispatcherOnRerenderInDEV = null;\nvar InvalidNestedHooksDispatcherOnMountInDEV = null;\nvar InvalidNestedHooksDispatcherOnUpdateInDEV = null;\nvar InvalidNestedHooksDispatcherOnRerenderInDEV = null;\n\n{\n var warnInvalidContextAccess = function () {\n error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n };\n\n var warnInvalidHookAccess = function () {\n error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Frules-of-hooks');\n };\n\n HooksDispatcherOnMountInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n mountHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n mountHookTypesDev();\n checkDepsAreArrayDev(deps);\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n mountHookTypesDev();\n return mountDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n mountHookTypesDev();\n return mountDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n mountHookTypesDev();\n return mountTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n mountHookTypesDev();\n return mountMutableSource(source, getSnapshot, subscribe);\n },\n useOpaqueIdentifier: function () {\n currentHookNameInDev = 'useOpaqueIdentifier';\n mountHookTypesDev();\n return mountOpaqueIdentifier();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n HooksDispatcherOnMountWithHookTypesInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return mountDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return mountDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return mountTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n updateHookTypesDev();\n return mountMutableSource(source, getSnapshot, subscribe);\n },\n useOpaqueIdentifier: function () {\n currentHookNameInDev = 'useOpaqueIdentifier';\n updateHookTypesDev();\n return mountOpaqueIdentifier();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n HooksDispatcherOnUpdateInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return updateDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return updateTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n updateHookTypesDev();\n return updateMutableSource(source, getSnapshot, subscribe);\n },\n useOpaqueIdentifier: function () {\n currentHookNameInDev = 'useOpaqueIdentifier';\n updateHookTypesDev();\n return updateOpaqueIdentifier();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n HooksDispatcherOnRerenderInDEV = {\n readContext: function (context, observedBits) {\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n updateHookTypesDev();\n return rerenderDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n updateHookTypesDev();\n return rerenderTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n updateHookTypesDev();\n return updateMutableSource(source, getSnapshot, subscribe);\n },\n useOpaqueIdentifier: function () {\n currentHookNameInDev = 'useOpaqueIdentifier';\n updateHookTypesDev();\n return rerenderOpaqueIdentifier();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n InvalidNestedHooksDispatcherOnMountInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountRef(initialValue);\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n mountHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;\n\n try {\n return mountState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountMutableSource(source, getSnapshot, subscribe);\n },\n useOpaqueIdentifier: function () {\n currentHookNameInDev = 'useOpaqueIdentifier';\n warnInvalidHookAccess();\n mountHookTypesDev();\n return mountOpaqueIdentifier();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n InvalidNestedHooksDispatcherOnUpdateInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateMutableSource(source, getSnapshot, subscribe);\n },\n useOpaqueIdentifier: function () {\n currentHookNameInDev = 'useOpaqueIdentifier';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateOpaqueIdentifier();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n InvalidNestedHooksDispatcherOnRerenderInDEV = {\n readContext: function (context, observedBits) {\n warnInvalidContextAccess();\n return readContext(context, observedBits);\n },\n useCallback: function (callback, deps) {\n currentHookNameInDev = 'useCallback';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateCallback(callback, deps);\n },\n useContext: function (context, observedBits) {\n currentHookNameInDev = 'useContext';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return readContext(context, observedBits);\n },\n useEffect: function (create, deps) {\n currentHookNameInDev = 'useEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateEffect(create, deps);\n },\n useImperativeHandle: function (ref, create, deps) {\n currentHookNameInDev = 'useImperativeHandle';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateImperativeHandle(ref, create, deps);\n },\n useLayoutEffect: function (create, deps) {\n currentHookNameInDev = 'useLayoutEffect';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateLayoutEffect(create, deps);\n },\n useMemo: function (create, deps) {\n currentHookNameInDev = 'useMemo';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return updateMemo(create, deps);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useReducer: function (reducer, initialArg, init) {\n currentHookNameInDev = 'useReducer';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderReducer(reducer, initialArg, init);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useRef: function (initialValue) {\n currentHookNameInDev = 'useRef';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateRef();\n },\n useState: function (initialState) {\n currentHookNameInDev = 'useState';\n warnInvalidHookAccess();\n updateHookTypesDev();\n var prevDispatcher = ReactCurrentDispatcher$1.current;\n ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;\n\n try {\n return rerenderState(initialState);\n } finally {\n ReactCurrentDispatcher$1.current = prevDispatcher;\n }\n },\n useDebugValue: function (value, formatterFn) {\n currentHookNameInDev = 'useDebugValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateDebugValue();\n },\n useDeferredValue: function (value) {\n currentHookNameInDev = 'useDeferredValue';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderDeferredValue(value);\n },\n useTransition: function () {\n currentHookNameInDev = 'useTransition';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderTransition();\n },\n useMutableSource: function (source, getSnapshot, subscribe) {\n currentHookNameInDev = 'useMutableSource';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return updateMutableSource(source, getSnapshot, subscribe);\n },\n useOpaqueIdentifier: function () {\n currentHookNameInDev = 'useOpaqueIdentifier';\n warnInvalidHookAccess();\n updateHookTypesDev();\n return rerenderOpaqueIdentifier();\n },\n unstable_isNewReconciler: enableNewReconciler\n };\n}\n\nvar now$1 = Scheduler.unstable_now;\nvar commitTime = 0;\nvar profilerStartTime = -1;\n\nfunction getCommitTime() {\n return commitTime;\n}\n\nfunction recordCommitTime() {\n\n commitTime = now$1();\n}\n\nfunction startProfilerTimer(fiber) {\n\n profilerStartTime = now$1();\n\n if (fiber.actualStartTime \u003C 0) {\n fiber.actualStartTime = now$1();\n }\n}\n\nfunction stopProfilerTimerIfRunning(fiber) {\n\n profilerStartTime = -1;\n}\n\nfunction stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) {\n\n if (profilerStartTime \u003E= 0) {\n var elapsedTime = now$1() - profilerStartTime;\n fiber.actualDuration += elapsedTime;\n\n if (overrideBaseTime) {\n fiber.selfBaseDuration = elapsedTime;\n }\n\n profilerStartTime = -1;\n }\n}\n\nfunction transferActualDuration(fiber) {\n \u002F\u002F Transfer time spent rendering these children so we don't lose it\n \u002F\u002F after we rerender. This is used as a helper in special cases\n \u002F\u002F where we should count the work of multiple passes.\n var child = fiber.child;\n\n while (child) {\n fiber.actualDuration += child.actualDuration;\n child = child.sibling;\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar didReceiveUpdate = false;\nvar didWarnAboutBadClass;\nvar didWarnAboutModulePatternComponent;\nvar didWarnAboutContextTypeOnFunctionComponent;\nvar didWarnAboutGetDerivedStateOnFunctionComponent;\nvar didWarnAboutFunctionRefs;\nvar didWarnAboutReassigningProps;\nvar didWarnAboutRevealOrder;\nvar didWarnAboutTailOptions;\n\n{\n didWarnAboutBadClass = {};\n didWarnAboutModulePatternComponent = {};\n didWarnAboutContextTypeOnFunctionComponent = {};\n didWarnAboutGetDerivedStateOnFunctionComponent = {};\n didWarnAboutFunctionRefs = {};\n didWarnAboutReassigningProps = false;\n didWarnAboutRevealOrder = {};\n didWarnAboutTailOptions = {};\n}\n\nfunction reconcileChildren(current, workInProgress, nextChildren, renderLanes) {\n if (current === null) {\n \u002F\u002F If this is a fresh new component that hasn't been rendered yet, we\n \u002F\u002F won't update its child set by applying minimal side-effects. Instead,\n \u002F\u002F we will add them all to the child before it gets rendered. That means\n \u002F\u002F we can optimize this reconciliation pass by not tracking side-effects.\n workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);\n } else {\n \u002F\u002F If the current child is the same as the work in progress, it means that\n \u002F\u002F we haven't yet started any work on these children. Therefore, we use\n \u002F\u002F the clone algorithm to create a copy of all the current children.\n \u002F\u002F If we had any progressed work already, that is invalid at this point so\n \u002F\u002F let's throw it out.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes);\n }\n}\n\nfunction forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) {\n \u002F\u002F This function is fork of reconcileChildren. It's used in cases where we\n \u002F\u002F want to reconcile without matching against the existing set. This has the\n \u002F\u002F effect of all current children being unmounted; even if the type and key\n \u002F\u002F are the same, the old child is unmounted and a new child is created.\n \u002F\u002F\n \u002F\u002F To do this, we're going to go through the reconcile algorithm twice. In\n \u002F\u002F the first pass, we schedule a deletion for all the current children by\n \u002F\u002F passing null.\n workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); \u002F\u002F In the second pass, we mount the new children. The trick here is that we\n \u002F\u002F pass null in place of where we usually pass the current child set. This has\n \u002F\u002F the effect of remounting all children regardless of whether their\n \u002F\u002F identities match.\n\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);\n}\n\nfunction updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) {\n \u002F\u002F TODO: current can be non-null here even if the component\n \u002F\u002F hasn't yet mounted. This happens after the first render suspends.\n \u002F\u002F We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n \u002F\u002F Lazy component props can't be validated in createElement\n \u002F\u002F because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, \u002F\u002F Resolved props\n 'prop', getComponentName(Component));\n }\n }\n }\n\n var render = Component.render;\n var ref = workInProgress.ref; \u002F\u002F The rest is a fork of updateFunctionComponent\n\n var nextChildren;\n prepareToReadContext(workInProgress, renderLanes);\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);\n\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes);\n } finally {\n reenableLogs();\n }\n }\n\n setIsRendering(false);\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderLanes);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n } \u002F\u002F React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {\n if (current === null) {\n var type = Component.type;\n\n if (isSimpleFunctionComponent(type) && Component.compare === null && \u002F\u002F SimpleMemoComponent codepath doesn't resolve outer props either.\n Component.defaultProps === undefined) {\n var resolvedType = type;\n\n {\n resolvedType = resolveFunctionForHotReloading(type);\n } \u002F\u002F If this is a plain function component without default props,\n \u002F\u002F and with only the default shallow comparison, we upgrade it\n \u002F\u002F to a SimpleMemoComponent to allow fast path updates.\n\n\n workInProgress.tag = SimpleMemoComponent;\n workInProgress.type = resolvedType;\n\n {\n validateFunctionComponentInDev(workInProgress, type);\n }\n\n return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, updateLanes, renderLanes);\n }\n\n {\n var innerPropTypes = type.propTypes;\n\n if (innerPropTypes) {\n \u002F\u002F Inner memo component props aren't currently validated in createElement.\n \u002F\u002F We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(innerPropTypes, nextProps, \u002F\u002F Resolved props\n 'prop', getComponentName(type));\n }\n }\n\n var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes);\n child.ref = workInProgress.ref;\n child.return = workInProgress;\n workInProgress.child = child;\n return child;\n }\n\n {\n var _type = Component.type;\n var _innerPropTypes = _type.propTypes;\n\n if (_innerPropTypes) {\n \u002F\u002F Inner memo component props aren't currently validated in createElement.\n \u002F\u002F We could move it there, but we'd still need this for lazy code path.\n checkPropTypes(_innerPropTypes, nextProps, \u002F\u002F Resolved props\n 'prop', getComponentName(_type));\n }\n }\n\n var currentChild = current.child; \u002F\u002F This is always exactly one child\n\n if (!includesSomeLane(updateLanes, renderLanes)) {\n \u002F\u002F This will be the props with resolved defaultProps,\n \u002F\u002F unlike current.memoizedProps which will be the unresolved ones.\n var prevProps = currentChild.memoizedProps; \u002F\u002F Default to shallow comparison\n\n var compare = Component.compare;\n compare = compare !== null ? compare : shallowEqual;\n\n if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n } \u002F\u002F React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n var newChild = createWorkInProgress(currentChild, nextProps);\n newChild.ref = workInProgress.ref;\n newChild.return = workInProgress;\n workInProgress.child = newChild;\n return newChild;\n}\n\nfunction updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) {\n \u002F\u002F TODO: current can be non-null here even if the component\n \u002F\u002F hasn't yet mounted. This happens when the inner render suspends.\n \u002F\u002F We'll need to figure out if this is fine or can cause issues.\n {\n if (workInProgress.type !== workInProgress.elementType) {\n \u002F\u002F Lazy component props can't be validated in createElement\n \u002F\u002F because they're only guaranteed to be resolved here.\n var outerMemoType = workInProgress.elementType;\n\n if (outerMemoType.$typeof === REACT_LAZY_TYPE) {\n \u002F\u002F We warn when you define propTypes on lazy()\n \u002F\u002F so let's just skip over it to find memo() outer wrapper.\n \u002F\u002F Inner props for memo are validated later.\n var lazyComponent = outerMemoType;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n outerMemoType = init(payload);\n } catch (x) {\n outerMemoType = null;\n } \u002F\u002F Inner propTypes will be validated in the function component path.\n\n\n var outerPropTypes = outerMemoType && outerMemoType.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, nextProps, \u002F\u002F Resolved (SimpleMemoComponent has no defaultProps)\n 'prop', getComponentName(outerMemoType));\n }\n }\n }\n }\n\n if (current !== null) {\n var prevProps = current.memoizedProps;\n\n if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( \u002F\u002F Prevent bailout if the implementation changed due to hot reload.\n workInProgress.type === current.type )) {\n didReceiveUpdate = false;\n\n if (!includesSomeLane(renderLanes, updateLanes)) {\n \u002F\u002F The pending lanes were cleared at the beginning of beginWork. We're\n \u002F\u002F about to bail out, but there might be other lanes that weren't\n \u002F\u002F included in the current render. Usually, the priority level of the\n \u002F\u002F remaining updates is accumlated during the evaluation of the\n \u002F\u002F component (i.e. when processing the update queue). But since since\n \u002F\u002F we're bailing out early *without* evaluating the component, we need\n \u002F\u002F to account for it here, too. Reset to the value of the current fiber.\n \u002F\u002F NOTE: This only applies to SimpleMemoComponent, not MemoComponent,\n \u002F\u002F because a MemoComponent fiber does not have hooks or an update queue;\n \u002F\u002F rather, it wraps around an inner component, which may or may not\n \u002F\u002F contains hooks.\n \u002F\u002F TODO: Move the reset at in beginWork out of the common path so that\n \u002F\u002F this is no longer necessary.\n workInProgress.lanes = current.lanes;\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {\n \u002F\u002F This is a special case that only exists for legacy mode.\n \u002F\u002F See https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F19216.\n didReceiveUpdate = true;\n }\n }\n }\n\n return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes);\n}\n\nfunction updateOffscreenComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps;\n var nextChildren = nextProps.children;\n var prevState = current !== null ? current.memoizedState : null;\n\n if (nextProps.mode === 'hidden' || nextProps.mode === 'unstable-defer-without-hiding') {\n if ((workInProgress.mode & ConcurrentMode) === NoMode) {\n \u002F\u002F In legacy sync mode, don't defer the subtree. Render it now.\n \u002F\u002F TODO: Figure out what we should do in Blocking mode.\n var nextState = {\n baseLanes: NoLanes\n };\n workInProgress.memoizedState = nextState;\n pushRenderLanes(workInProgress, renderLanes);\n } else if (!includesSomeLane(renderLanes, OffscreenLane)) {\n var nextBaseLanes;\n\n if (prevState !== null) {\n var prevBaseLanes = prevState.baseLanes;\n nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes);\n } else {\n nextBaseLanes = renderLanes;\n } \u002F\u002F Schedule this fiber to re-render at offscreen priority. Then bailout.\n\n\n {\n markSpawnedWork(OffscreenLane);\n }\n\n workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane);\n var _nextState = {\n baseLanes: nextBaseLanes\n };\n workInProgress.memoizedState = _nextState; \u002F\u002F We're about to bail out, but we need to push this to the stack anyway\n \u002F\u002F to avoid a push\u002Fpop misalignment.\n\n pushRenderLanes(workInProgress, nextBaseLanes);\n return null;\n } else {\n \u002F\u002F Rendering at offscreen, so we can clear the base lanes.\n var _nextState2 = {\n baseLanes: NoLanes\n };\n workInProgress.memoizedState = _nextState2; \u002F\u002F Push the lanes that were skipped when we bailed out.\n\n var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes;\n pushRenderLanes(workInProgress, subtreeRenderLanes);\n }\n } else {\n var _subtreeRenderLanes;\n\n if (prevState !== null) {\n _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); \u002F\u002F Since we're not hidden anymore, reset the state\n\n workInProgress.memoizedState = null;\n } else {\n \u002F\u002F We weren't previously hidden, and we still aren't, so there's nothing\n \u002F\u002F special to do. Need to push to the stack regardless, though, to avoid\n \u002F\u002F a push\u002Fpop misalignment.\n _subtreeRenderLanes = renderLanes;\n }\n\n pushRenderLanes(workInProgress, _subtreeRenderLanes);\n }\n\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n} \u002F\u002F Note: These happen to have identical begin phases, for now. We shouldn't hold\n\u002F\u002F ourselves to this constraint, though. If the behavior diverges, we should\n\u002F\u002F fork the function.\n\n\nvar updateLegacyHiddenComponent = updateOffscreenComponent;\n\nfunction updateFragment(current, workInProgress, renderLanes) {\n var nextChildren = workInProgress.pendingProps;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateMode(current, workInProgress, renderLanes) {\n var nextChildren = workInProgress.pendingProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateProfiler(current, workInProgress, renderLanes) {\n {\n workInProgress.flags |= Update; \u002F\u002F Reset effect durations for the next eventual effect phase.\n \u002F\u002F These are reset during render to allow the DevTools commit hook a chance to read them,\n\n var stateNode = workInProgress.stateNode;\n stateNode.effectDuration = 0;\n stateNode.passiveEffectDuration = 0;\n }\n\n var nextProps = workInProgress.pendingProps;\n var nextChildren = nextProps.children;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction markRef(current, workInProgress) {\n var ref = workInProgress.ref;\n\n if (current === null && ref !== null || current !== null && current.ref !== ref) {\n \u002F\u002F Schedule a Ref effect\n workInProgress.flags |= Ref;\n }\n}\n\nfunction updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n \u002F\u002F Lazy component props can't be validated in createElement\n \u002F\u002F because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, \u002F\u002F Resolved props\n 'prop', getComponentName(Component));\n }\n }\n }\n\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, true);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n var nextChildren;\n prepareToReadContext(workInProgress, renderLanes);\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);\n\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes);\n } finally {\n reenableLogs();\n }\n }\n\n setIsRendering(false);\n }\n\n if (current !== null && !didReceiveUpdate) {\n bailoutHooks(current, workInProgress, renderLanes);\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n } \u002F\u002F React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n \u002F\u002F Lazy component props can't be validated in createElement\n \u002F\u002F because they're only guaranteed to be resolved here.\n var innerPropTypes = Component.propTypes;\n\n if (innerPropTypes) {\n checkPropTypes(innerPropTypes, nextProps, \u002F\u002F Resolved props\n 'prop', getComponentName(Component));\n }\n }\n } \u002F\u002F Push context providers early to prevent context stack mismatches.\n \u002F\u002F During mounting we don't know the child context yet as the instance doesn't exist.\n \u002F\u002F We will invalidate the child context in finishClassComponent() right after rendering.\n\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n var instance = workInProgress.stateNode;\n var shouldUpdate;\n\n if (instance === null) {\n if (current !== null) {\n \u002F\u002F A class component without an instance only mounts if it suspended\n \u002F\u002F inside a non-concurrent tree, in an inconsistent state. We want to\n \u002F\u002F treat it like a new mount, even though an empty version of it already\n \u002F\u002F committed. Disconnect the alternate pointers.\n current.alternate = null;\n workInProgress.alternate = null; \u002F\u002F Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.flags |= Placement;\n } \u002F\u002F In the initial pass we might need to construct the instance.\n\n\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderLanes);\n shouldUpdate = true;\n } else if (current === null) {\n \u002F\u002F In a resume, we'll already have an instance we can reuse.\n shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes);\n } else {\n shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes);\n }\n\n var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes);\n\n {\n var inst = workInProgress.stateNode;\n\n if (shouldUpdate && inst.props !== nextProps) {\n if (!didWarnAboutReassigningProps) {\n error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentName(workInProgress.type) || 'a component');\n }\n\n didWarnAboutReassigningProps = true;\n }\n }\n\n return nextUnitOfWork;\n}\n\nfunction finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) {\n \u002F\u002F Refs should update even if shouldComponentUpdate returns false\n markRef(current, workInProgress);\n var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags;\n\n if (!shouldUpdate && !didCaptureError) {\n \u002F\u002F Context providers should defer to sCU for rendering\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, false);\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n\n var instance = workInProgress.stateNode; \u002F\u002F Rerender\n\n ReactCurrentOwner$1.current = workInProgress;\n var nextChildren;\n\n if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') {\n \u002F\u002F If we captured an error, but getDerivedStateFromError is not defined,\n \u002F\u002F unmount all the children. componentDidCatch will schedule an update to\n \u002F\u002F re-render a fallback. This is temporary until we migrate everyone to\n \u002F\u002F the new API.\n \u002F\u002F TODO: Warn in a future release.\n nextChildren = null;\n\n {\n stopProfilerTimerIfRunning();\n }\n } else {\n {\n setIsRendering(true);\n nextChildren = instance.render();\n\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n instance.render();\n } finally {\n reenableLogs();\n }\n }\n\n setIsRendering(false);\n }\n } \u002F\u002F React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n\n if (current !== null && didCaptureError) {\n \u002F\u002F If we're recovering from an error, reconcile without reusing any of\n \u002F\u002F the existing children. Conceptually, the normal children and the children\n \u002F\u002F that are shown on error are two different sets, so we shouldn't reuse\n \u002F\u002F normal children even if their identities match.\n forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n } \u002F\u002F Memoize state using the values we just used to render.\n \u002F\u002F TODO: Restructure so we never read values from the instance.\n\n\n workInProgress.memoizedState = instance.state; \u002F\u002F The context might have changed so we need to recalculate it.\n\n if (hasContext) {\n invalidateContextProvider(workInProgress, Component, true);\n }\n\n return workInProgress.child;\n}\n\nfunction pushHostRootContext(workInProgress) {\n var root = workInProgress.stateNode;\n\n if (root.pendingContext) {\n pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context);\n } else if (root.context) {\n \u002F\u002F Should always be set\n pushTopLevelContextObject(workInProgress, root.context, false);\n }\n\n pushHostContainer(workInProgress, root.containerInfo);\n}\n\nfunction updateHostRoot(current, workInProgress, renderLanes) {\n pushHostRootContext(workInProgress);\n var updateQueue = workInProgress.updateQueue;\n\n if (!(current !== null && updateQueue !== null)) {\n {\n throw Error( \"If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var nextProps = workInProgress.pendingProps;\n var prevState = workInProgress.memoizedState;\n var prevChildren = prevState !== null ? prevState.element : null;\n cloneUpdateQueue(current, workInProgress);\n processUpdateQueue(workInProgress, nextProps, null, renderLanes);\n var nextState = workInProgress.memoizedState; \u002F\u002F Caution: React DevTools currently depends on this property\n \u002F\u002F being called \"element\".\n\n var nextChildren = nextState.element;\n\n if (nextChildren === prevChildren) {\n resetHydrationState();\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n\n var root = workInProgress.stateNode;\n\n if (root.hydrate && enterHydrationState(workInProgress)) {\n \u002F\u002F If we don't have any current children this might be the first pass.\n \u002F\u002F We always try to hydrate. If this isn't a hydration pass there won't\n \u002F\u002F be any children to hydrate which is effectively the same thing as\n \u002F\u002F not hydrating.\n {\n var mutableSourceEagerHydrationData = root.mutableSourceEagerHydrationData;\n\n if (mutableSourceEagerHydrationData != null) {\n for (var i = 0; i \u003C mutableSourceEagerHydrationData.length; i += 2) {\n var mutableSource = mutableSourceEagerHydrationData[i];\n var version = mutableSourceEagerHydrationData[i + 1];\n setWorkInProgressVersion(mutableSource, version);\n }\n }\n }\n\n var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes);\n workInProgress.child = child;\n var node = child;\n\n while (node) {\n \u002F\u002F Mark each child as hydrating. This is a fast path to know whether this\n \u002F\u002F tree is part of a hydrating tree. This is used to determine if a child\n \u002F\u002F node has fully mounted yet, and for scheduling event replaying.\n \u002F\u002F Conceptually this is similar to Placement in that a new subtree is\n \u002F\u002F inserted into the React tree here. It just happens to not need DOM\n \u002F\u002F mutations because it already exists.\n node.flags = node.flags & ~Placement | Hydrating;\n node = node.sibling;\n }\n } else {\n \u002F\u002F Otherwise reset hydration state in case we aborted and resumed another\n \u002F\u002F root.\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n resetHydrationState();\n }\n\n return workInProgress.child;\n}\n\nfunction updateHostComponent(current, workInProgress, renderLanes) {\n pushHostContext(workInProgress);\n\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n }\n\n var type = workInProgress.type;\n var nextProps = workInProgress.pendingProps;\n var prevProps = current !== null ? current.memoizedProps : null;\n var nextChildren = nextProps.children;\n var isDirectTextChild = shouldSetTextContent(type, nextProps);\n\n if (isDirectTextChild) {\n \u002F\u002F We special case a direct text child of a host node. This is a common\n \u002F\u002F case. We won't handle it as a reified child. We will instead handle\n \u002F\u002F this in the host environment that also has access to this prop. That\n \u002F\u002F avoids allocating another HostText fiber and traversing it.\n nextChildren = null;\n } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) {\n \u002F\u002F If we're switching from a direct text child to a normal child, or to\n \u002F\u002F empty, we need to schedule the text content to be reset.\n workInProgress.flags |= ContentReset;\n }\n\n markRef(current, workInProgress);\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction updateHostText(current, workInProgress) {\n if (current === null) {\n tryToClaimNextHydratableInstance(workInProgress);\n } \u002F\u002F Nothing to do here. This is terminal. We'll do the completion step\n \u002F\u002F immediately after.\n\n\n return null;\n}\n\nfunction mountLazyComponent(_current, workInProgress, elementType, updateLanes, renderLanes) {\n if (_current !== null) {\n \u002F\u002F A lazy component only mounts if it suspended inside a non-\n \u002F\u002F concurrent tree, in an inconsistent state. We want to treat it like\n \u002F\u002F a new mount, even though an empty version of it already committed.\n \u002F\u002F Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; \u002F\u002F Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.flags |= Placement;\n }\n\n var props = workInProgress.pendingProps;\n var lazyComponent = elementType;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n var Component = init(payload); \u002F\u002F Store the unwrapped component in the type.\n\n workInProgress.type = Component;\n var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component);\n var resolvedProps = resolveDefaultProps(Component, props);\n var child;\n\n switch (resolvedTag) {\n case FunctionComponent:\n {\n {\n validateFunctionComponentInDev(workInProgress, Component);\n workInProgress.type = Component = resolveFunctionForHotReloading(Component);\n }\n\n child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes);\n return child;\n }\n\n case ClassComponent:\n {\n {\n workInProgress.type = Component = resolveClassForHotReloading(Component);\n }\n\n child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes);\n return child;\n }\n\n case ForwardRef:\n {\n {\n workInProgress.type = Component = resolveForwardRefForHotReloading(Component);\n }\n\n child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes);\n return child;\n }\n\n case MemoComponent:\n {\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = Component.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, resolvedProps, \u002F\u002F Resolved for outer only\n 'prop', getComponentName(Component));\n }\n }\n }\n\n child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), \u002F\u002F The inner type can have defaults too\n updateLanes, renderLanes);\n return child;\n }\n }\n\n var hint = '';\n\n {\n if (Component !== null && typeof Component === 'object' && Component.$typeof === REACT_LAZY_TYPE) {\n hint = ' Did you wrap a component in React.lazy() more than once?';\n }\n } \u002F\u002F This message intentionally doesn't mention ForwardRef or MemoComponent\n \u002F\u002F because the fact that it's a separate type of work is an\n \u002F\u002F implementation detail.\n\n\n {\n {\n throw Error( \"Element type is invalid. Received a promise that resolves to: \" + Component + \". Lazy element type must resolve to a class or function.\" + hint );\n }\n }\n}\n\nfunction mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) {\n if (_current !== null) {\n \u002F\u002F An incomplete component only mounts if it suspended inside a non-\n \u002F\u002F concurrent tree, in an inconsistent state. We want to treat it like\n \u002F\u002F a new mount, even though an empty version of it already committed.\n \u002F\u002F Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; \u002F\u002F Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.flags |= Placement;\n } \u002F\u002F Promote the fiber to a class and try rendering again.\n\n\n workInProgress.tag = ClassComponent; \u002F\u002F The rest of this function is a fork of `updateClassComponent`\n \u002F\u002F Push context providers early to prevent context stack mismatches.\n \u002F\u002F During mounting we don't know the child context yet as the instance doesn't exist.\n \u002F\u002F We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n constructClassInstance(workInProgress, Component, nextProps);\n mountClassInstance(workInProgress, Component, nextProps, renderLanes);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);\n}\n\nfunction mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) {\n if (_current !== null) {\n \u002F\u002F An indeterminate component only mounts if it suspended inside a non-\n \u002F\u002F concurrent tree, in an inconsistent state. We want to treat it like\n \u002F\u002F a new mount, even though an empty version of it already committed.\n \u002F\u002F Disconnect the alternate pointers.\n _current.alternate = null;\n workInProgress.alternate = null; \u002F\u002F Since this is conceptually a new fiber, schedule a Placement effect\n\n workInProgress.flags |= Placement;\n }\n\n var props = workInProgress.pendingProps;\n var context;\n\n {\n var unmaskedContext = getUnmaskedContext(workInProgress, Component, false);\n context = getMaskedContext(workInProgress, unmaskedContext);\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n var value;\n\n {\n if (Component.prototype && typeof Component.prototype.render === 'function') {\n var componentName = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutBadClass[componentName]) {\n error(\"The \u003C%s \u002F\u003E component appears to have a render method, but doesn't extend React.Component. \" + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName);\n\n didWarnAboutBadClass[componentName] = true;\n }\n }\n\n if (workInProgress.mode & StrictMode) {\n ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null);\n }\n\n setIsRendering(true);\n ReactCurrentOwner$1.current = workInProgress;\n value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);\n setIsRendering(false);\n } \u002F\u002F React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n\n {\n \u002F\u002F Support for module components is deprecated and is removed behind a flag.\n \u002F\u002F Whether or not it would crash later, we want to show a good message in DEV first.\n if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$typeof === undefined) {\n var _componentName = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName]) {\n error('The \u003C%s \u002F\u003E component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName);\n\n didWarnAboutModulePatternComponent[_componentName] = true;\n }\n }\n }\n\n if ( \u002F\u002F Run these checks in production only if the flag is off.\n \u002F\u002F Eventually we'll delete this branch altogether.\n typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$typeof === undefined) {\n {\n var _componentName2 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutModulePatternComponent[_componentName2]) {\n error('The \u003C%s \u002F\u003E component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + \"If you can't use a class try assigning the prototype on the function as a workaround. \" + \"`%s.prototype = React.Component.prototype`. Don't use an arrow function since it \" + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2);\n\n didWarnAboutModulePatternComponent[_componentName2] = true;\n }\n } \u002F\u002F Proceed under the assumption that this is a class instance\n\n\n workInProgress.tag = ClassComponent; \u002F\u002F Throw out any hooks that were used.\n\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null; \u002F\u002F Push context providers early to prevent context stack mismatches.\n \u002F\u002F During mounting we don't know the child context yet as the instance doesn't exist.\n \u002F\u002F We will invalidate the child context in finishClassComponent() right after rendering.\n\n var hasContext = false;\n\n if (isContextProvider(Component)) {\n hasContext = true;\n pushContextProvider(workInProgress);\n } else {\n hasContext = false;\n }\n\n workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null;\n initializeUpdateQueue(workInProgress);\n var getDerivedStateFromProps = Component.getDerivedStateFromProps;\n\n if (typeof getDerivedStateFromProps === 'function') {\n applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, props);\n }\n\n adoptClassInstance(workInProgress, value);\n mountClassInstance(workInProgress, Component, props, renderLanes);\n return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes);\n } else {\n \u002F\u002F Proceed under the assumption that this is a function component\n workInProgress.tag = FunctionComponent;\n\n {\n\n if ( workInProgress.mode & StrictMode) {\n disableLogs();\n\n try {\n value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes);\n } finally {\n reenableLogs();\n }\n }\n }\n\n reconcileChildren(null, workInProgress, value, renderLanes);\n\n {\n validateFunctionComponentInDev(workInProgress, Component);\n }\n\n return workInProgress.child;\n }\n}\n\nfunction validateFunctionComponentInDev(workInProgress, Component) {\n {\n if (Component) {\n if (Component.childContextTypes) {\n error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component');\n }\n }\n\n if (workInProgress.ref !== null) {\n var info = '';\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n var warningKey = ownerName || workInProgress._debugID || '';\n var debugSource = workInProgress._debugSource;\n\n if (debugSource) {\n warningKey = debugSource.fileName + ':' + debugSource.lineNumber;\n }\n\n if (!didWarnAboutFunctionRefs[warningKey]) {\n didWarnAboutFunctionRefs[warningKey] = true;\n\n error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info);\n }\n }\n\n if (typeof Component.getDerivedStateFromProps === 'function') {\n var _componentName3 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) {\n error('%s: Function components do not support getDerivedStateFromProps.', _componentName3);\n\n didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true;\n }\n }\n\n if (typeof Component.contextType === 'object' && Component.contextType !== null) {\n var _componentName4 = getComponentName(Component) || 'Unknown';\n\n if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) {\n error('%s: Function components do not support contextType.', _componentName4);\n\n didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true;\n }\n }\n }\n}\n\nvar SUSPENDED_MARKER = {\n dehydrated: null,\n retryLane: NoLane\n};\n\nfunction mountSuspenseOffscreenState(renderLanes) {\n return {\n baseLanes: renderLanes\n };\n}\n\nfunction updateSuspenseOffscreenState(prevOffscreenState, renderLanes) {\n return {\n baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes)\n };\n} \u002F\u002F TODO: Probably should inline this back\n\n\nfunction shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) {\n \u002F\u002F If we're already showing a fallback, there are cases where we need to\n \u002F\u002F remain on that fallback regardless of whether the content has resolved.\n \u002F\u002F For example, SuspenseList coordinates when nested content appears.\n if (current !== null) {\n var suspenseState = current.memoizedState;\n\n if (suspenseState === null) {\n \u002F\u002F Currently showing content. Don't hide it, even if ForceSuspenseFallack\n \u002F\u002F is true. More precise name might be \"ForceRemainSuspenseFallback\".\n \u002F\u002F Note: This is a factoring smell. Can't remain on a fallback if there's\n \u002F\u002F no fallback to remain on.\n return false;\n }\n } \u002F\u002F Not currently showing content. Consult the Suspense context.\n\n\n return hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n}\n\nfunction getRemainingWorkInPrimaryTree(current, renderLanes) {\n \u002F\u002F TODO: Should not remove render lanes that were pinged during this render\n return removeLanes(current.childLanes, renderLanes);\n}\n\nfunction updateSuspenseComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps; \u002F\u002F This is used by DevTools to force a boundary to suspend.\n\n {\n if (shouldSuspend(workInProgress)) {\n workInProgress.flags |= DidCapture;\n }\n }\n\n var suspenseContext = suspenseStackCursor.current;\n var showFallback = false;\n var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags;\n\n if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) {\n \u002F\u002F Something in this boundary's subtree already suspended. Switch to\n \u002F\u002F rendering the fallback children.\n showFallback = true;\n workInProgress.flags &= ~DidCapture;\n } else {\n \u002F\u002F Attempting the main content\n if (current === null || current.memoizedState !== null) {\n \u002F\u002F This is a new mount or this boundary is already showing a fallback state.\n \u002F\u002F Mark this subtree context as having at least one invisible parent that could\n \u002F\u002F handle the fallback state.\n \u002F\u002F Boundaries without fallbacks or should be avoided are not considered since\n \u002F\u002F they cannot handle preferred fallback states.\n if (nextProps.fallback !== undefined && nextProps.unstable_avoidThisFallback !== true) {\n suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext);\n }\n }\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n pushSuspenseContext(workInProgress, suspenseContext); \u002F\u002F OK, the next part is confusing. We're about to reconcile the Suspense\n \u002F\u002F boundary's children. This involves some custom reconcilation logic. Two\n \u002F\u002F main reasons this is so complicated.\n \u002F\u002F\n \u002F\u002F First, Legacy Mode has different semantics for backwards compatibility. The\n \u002F\u002F primary tree will commit in an inconsistent state, so when we do the\n \u002F\u002F second pass to render the fallback, we do some exceedingly, uh, clever\n \u002F\u002F hacks to make that not totally break. Like transferring effects and\n \u002F\u002F deletions from hidden tree. In Concurrent Mode, it's much simpler,\n \u002F\u002F because we bailout on the primary tree completely and leave it in its old\n \u002F\u002F state, no effects. Same as what we do for Offscreen (except that\n \u002F\u002F Offscreen doesn't have the first render pass).\n \u002F\u002F\n \u002F\u002F Second is hydration. During hydration, the Suspense fiber has a slightly\n \u002F\u002F different layout, where the child points to a dehydrated fragment, which\n \u002F\u002F contains the DOM rendered by the server.\n \u002F\u002F\n \u002F\u002F Third, even if you set all that aside, Suspense is like error boundaries in\n \u002F\u002F that we first we try to render one tree, and if that fails, we render again\n \u002F\u002F and switch to a different tree. Like a try\u002Fcatch block. So we have to track\n \u002F\u002F which branch we're currently rendering. Ideally we would model this using\n \u002F\u002F a stack.\n\n if (current === null) {\n \u002F\u002F Initial mount\n \u002F\u002F If we're currently hydrating, try to hydrate this boundary.\n \u002F\u002F But only if this has a fallback.\n if (nextProps.fallback !== undefined) {\n tryToClaimNextHydratableInstance(workInProgress); \u002F\u002F This could've been a dehydrated suspense component.\n }\n\n var nextPrimaryChildren = nextProps.children;\n var nextFallbackChildren = nextProps.fallback;\n\n if (showFallback) {\n var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);\n var primaryChildFragment = workInProgress.child;\n primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);\n workInProgress.memoizedState = SUSPENDED_MARKER;\n return fallbackFragment;\n } else if (typeof nextProps.unstable_expectedLoadTime === 'number') {\n \u002F\u002F This is a CPU-bound tree. Skip this tree and show a placeholder to\n \u002F\u002F unblock the surrounding content. Then immediately retry after the\n \u002F\u002F initial commit.\n var _fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes);\n\n var _primaryChildFragment = workInProgress.child;\n _primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes);\n workInProgress.memoizedState = SUSPENDED_MARKER; \u002F\u002F Since nothing actually suspended, there will nothing to ping this to\n \u002F\u002F get it started back up to attempt the next item. While in terms of\n \u002F\u002F priority this work has the same priority as this current render, it's\n \u002F\u002F not part of the same transition once the transition has committed. If\n \u002F\u002F it's sync, we still want to yield so that it can be painted.\n \u002F\u002F Conceptually, this is really the same as pinging. We can use any\n \u002F\u002F RetryLane even if it's the one currently rendering since we're leaving\n \u002F\u002F it behind on this node.\n\n workInProgress.lanes = SomeRetryLane;\n\n {\n markSpawnedWork(SomeRetryLane);\n }\n\n return _fallbackFragment;\n } else {\n return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren, renderLanes);\n }\n } else {\n \u002F\u002F This is an update.\n \u002F\u002F If the current fiber has a SuspenseState, that means it's already showing\n \u002F\u002F a fallback.\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n\n if (showFallback) {\n var _nextFallbackChildren2 = nextProps.fallback;\n var _nextPrimaryChildren2 = nextProps.children;\n\n var _fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren2, _nextFallbackChildren2, renderLanes);\n\n var _primaryChildFragment3 = workInProgress.child;\n var prevOffscreenState = current.child.memoizedState;\n _primaryChildFragment3.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes);\n _primaryChildFragment3.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes);\n workInProgress.memoizedState = SUSPENDED_MARKER;\n return _fallbackChildFragment;\n } else {\n var _nextPrimaryChildren3 = nextProps.children;\n\n var _primaryChildFragment4 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren3, renderLanes);\n\n workInProgress.memoizedState = null;\n return _primaryChildFragment4;\n }\n } else {\n \u002F\u002F The current tree is not already showing a fallback.\n if (showFallback) {\n \u002F\u002F Timed out.\n var _nextFallbackChildren3 = nextProps.fallback;\n var _nextPrimaryChildren4 = nextProps.children;\n\n var _fallbackChildFragment2 = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren4, _nextFallbackChildren3, renderLanes);\n\n var _primaryChildFragment5 = workInProgress.child;\n var _prevOffscreenState = current.child.memoizedState;\n _primaryChildFragment5.memoizedState = _prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(_prevOffscreenState, renderLanes);\n _primaryChildFragment5.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); \u002F\u002F Skip the primary children, and continue working on the\n \u002F\u002F fallback children.\n\n workInProgress.memoizedState = SUSPENDED_MARKER;\n return _fallbackChildFragment2;\n } else {\n \u002F\u002F Still haven't timed out. Continue rendering the children, like we\n \u002F\u002F normally do.\n var _nextPrimaryChildren5 = nextProps.children;\n\n var _primaryChildFragment6 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren5, renderLanes);\n\n workInProgress.memoizedState = null;\n return _primaryChildFragment6;\n }\n }\n }\n}\n\nfunction mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) {\n var mode = workInProgress.mode;\n var primaryChildProps = {\n mode: 'visible',\n children: primaryChildren\n };\n var primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, renderLanes, null);\n primaryChildFragment.return = workInProgress;\n workInProgress.child = primaryChildFragment;\n return primaryChildFragment;\n}\n\nfunction mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) {\n var mode = workInProgress.mode;\n var progressedPrimaryFragment = workInProgress.child;\n var primaryChildProps = {\n mode: 'hidden',\n children: primaryChildren\n };\n var primaryChildFragment;\n var fallbackChildFragment;\n\n if ((mode & BlockingMode) === NoMode && progressedPrimaryFragment !== null) {\n \u002F\u002F In legacy mode, we commit the primary tree as if it successfully\n \u002F\u002F completed, even though it's in an inconsistent state.\n primaryChildFragment = progressedPrimaryFragment;\n primaryChildFragment.childLanes = NoLanes;\n primaryChildFragment.pendingProps = primaryChildProps;\n\n if ( workInProgress.mode & ProfileMode) {\n \u002F\u002F Reset the durations from the first pass so they aren't included in the\n \u002F\u002F final amounts. This seems counterintuitive, since we're intentionally\n \u002F\u002F not measuring part of the render phase, but this makes it match what we\n \u002F\u002F do in Concurrent Mode.\n primaryChildFragment.actualDuration = 0;\n primaryChildFragment.actualStartTime = -1;\n primaryChildFragment.selfBaseDuration = 0;\n primaryChildFragment.treeBaseDuration = 0;\n }\n\n fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);\n } else {\n primaryChildFragment = createFiberFromOffscreen(primaryChildProps, mode, NoLanes, null);\n fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null);\n }\n\n primaryChildFragment.return = workInProgress;\n fallbackChildFragment.return = workInProgress;\n primaryChildFragment.sibling = fallbackChildFragment;\n workInProgress.child = primaryChildFragment;\n return fallbackChildFragment;\n}\n\nfunction createWorkInProgressOffscreenFiber(current, offscreenProps) {\n \u002F\u002F The props argument to `createWorkInProgress` is `any` typed, so we use this\n \u002F\u002F wrapper function to constrain it.\n return createWorkInProgress(current, offscreenProps);\n}\n\nfunction updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) {\n var currentPrimaryChildFragment = current.child;\n var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n var primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, {\n mode: 'visible',\n children: primaryChildren\n });\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n primaryChildFragment.lanes = renderLanes;\n }\n\n primaryChildFragment.return = workInProgress;\n primaryChildFragment.sibling = null;\n\n if (currentFallbackChildFragment !== null) {\n \u002F\u002F Delete the fallback child fragment\n currentFallbackChildFragment.nextEffect = null;\n currentFallbackChildFragment.flags = Deletion;\n workInProgress.firstEffect = workInProgress.lastEffect = currentFallbackChildFragment;\n }\n\n workInProgress.child = primaryChildFragment;\n return primaryChildFragment;\n}\n\nfunction updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) {\n var mode = workInProgress.mode;\n var currentPrimaryChildFragment = current.child;\n var currentFallbackChildFragment = currentPrimaryChildFragment.sibling;\n var primaryChildProps = {\n mode: 'hidden',\n children: primaryChildren\n };\n var primaryChildFragment;\n\n if ( \u002F\u002F In legacy mode, we commit the primary tree as if it successfully\n \u002F\u002F completed, even though it's in an inconsistent state.\n (mode & BlockingMode) === NoMode && \u002F\u002F Make sure we're on the second pass, i.e. the primary child fragment was\n \u002F\u002F already cloned. In legacy mode, the only case where this isn't true is\n \u002F\u002F when DevTools forces us to display a fallback; we skip the first render\n \u002F\u002F pass entirely and go straight to rendering the fallback. (In Concurrent\n \u002F\u002F Mode, SuspenseList can also trigger this scenario, but this is a legacy-\n \u002F\u002F only codepath.)\n workInProgress.child !== currentPrimaryChildFragment) {\n var progressedPrimaryFragment = workInProgress.child;\n primaryChildFragment = progressedPrimaryFragment;\n primaryChildFragment.childLanes = NoLanes;\n primaryChildFragment.pendingProps = primaryChildProps;\n\n if ( workInProgress.mode & ProfileMode) {\n \u002F\u002F Reset the durations from the first pass so they aren't included in the\n \u002F\u002F final amounts. This seems counterintuitive, since we're intentionally\n \u002F\u002F not measuring part of the render phase, but this makes it match what we\n \u002F\u002F do in Concurrent Mode.\n primaryChildFragment.actualDuration = 0;\n primaryChildFragment.actualStartTime = -1;\n primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration;\n primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration;\n } \u002F\u002F The fallback fiber was added as a deletion effect during the first pass.\n \u002F\u002F However, since we're going to remain on the fallback, we no longer want\n \u002F\u002F to delete it. So we need to remove it from the list. Deletions are stored\n \u002F\u002F on the same list as effects. We want to keep the effects from the primary\n \u002F\u002F tree. So we copy the primary child fragment's effect list, which does not\n \u002F\u002F include the fallback deletion effect.\n\n\n var progressedLastEffect = primaryChildFragment.lastEffect;\n\n if (progressedLastEffect !== null) {\n workInProgress.firstEffect = primaryChildFragment.firstEffect;\n workInProgress.lastEffect = progressedLastEffect;\n progressedLastEffect.nextEffect = null;\n } else {\n \u002F\u002F TODO: Reset this somewhere else? Lol legacy mode is so weird.\n workInProgress.firstEffect = workInProgress.lastEffect = null;\n }\n } else {\n primaryChildFragment = createWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps);\n }\n\n var fallbackChildFragment;\n\n if (currentFallbackChildFragment !== null) {\n fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren);\n } else {\n fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); \u002F\u002F Needs a placement effect because the parent (the Suspense boundary) already\n \u002F\u002F mounted but this is a new fiber.\n\n fallbackChildFragment.flags |= Placement;\n }\n\n fallbackChildFragment.return = workInProgress;\n primaryChildFragment.return = workInProgress;\n primaryChildFragment.sibling = fallbackChildFragment;\n workInProgress.child = primaryChildFragment;\n return fallbackChildFragment;\n}\n\nfunction scheduleWorkOnFiber(fiber, renderLanes) {\n fiber.lanes = mergeLanes(fiber.lanes, renderLanes);\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n alternate.lanes = mergeLanes(alternate.lanes, renderLanes);\n }\n\n scheduleWorkOnParentPath(fiber.return, renderLanes);\n}\n\nfunction propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) {\n \u002F\u002F Mark any Suspense boundaries with fallbacks as having work to do.\n \u002F\u002F If they were previously forced into fallbacks, they may now be able\n \u002F\u002F to unblock.\n var node = firstChild;\n\n while (node !== null) {\n if (node.tag === SuspenseComponent) {\n var state = node.memoizedState;\n\n if (state !== null) {\n scheduleWorkOnFiber(node, renderLanes);\n }\n } else if (node.tag === SuspenseListComponent) {\n \u002F\u002F If the tail is hidden there might not be an Suspense boundaries\n \u002F\u002F to schedule work on. In this case we have to schedule it on the\n \u002F\u002F list itself.\n \u002F\u002F We don't have to traverse to the children of the list since\n \u002F\u002F the list will propagate the change when it rerenders.\n scheduleWorkOnFiber(node, renderLanes);\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction findLastContentRow(firstChild) {\n \u002F\u002F This is going to find the last row among these children that is already\n \u002F\u002F showing content on the screen, as opposed to being in fallback state or\n \u002F\u002F new. If a row has multiple Suspense boundaries, any of them being in the\n \u002F\u002F fallback state, counts as the whole row being in a fallback state.\n \u002F\u002F Note that the \"rows\" will be workInProgress, but any nested children\n \u002F\u002F will still be current since we haven't rendered them yet. The mounted\n \u002F\u002F order may not be the same as the new order. We use the new order.\n var row = firstChild;\n var lastContentRow = null;\n\n while (row !== null) {\n var currentRow = row.alternate; \u002F\u002F New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n lastContentRow = row;\n }\n\n row = row.sibling;\n }\n\n return lastContentRow;\n}\n\nfunction validateRevealOrder(revealOrder) {\n {\n if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) {\n didWarnAboutRevealOrder[revealOrder] = true;\n\n if (typeof revealOrder === 'string') {\n switch (revealOrder.toLowerCase()) {\n case 'together':\n case 'forwards':\n case 'backwards':\n {\n error('\"%s\" is not a valid value for revealOrder on \u003CSuspenseList \u002F\u003E. ' + 'Use lowercase \"%s\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n case 'forward':\n case 'backward':\n {\n error('\"%s\" is not a valid value for revealOrder on \u003CSuspenseList \u002F\u003E. ' + 'React uses the -s suffix in the spelling. Use \"%ss\" instead.', revealOrder, revealOrder.toLowerCase());\n\n break;\n }\n\n default:\n error('\"%s\" is not a supported revealOrder on \u003CSuspenseList \u002F\u003E. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n\n break;\n }\n } else {\n error('%s is not a supported value for revealOrder on \u003CSuspenseList \u002F\u003E. ' + 'Did you mean \"together\", \"forwards\" or \"backwards\"?', revealOrder);\n }\n }\n }\n}\n\nfunction validateTailOptions(tailMode, revealOrder) {\n {\n if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) {\n if (tailMode !== 'collapsed' && tailMode !== 'hidden') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('\"%s\" is not a supported value for tail on \u003CSuspenseList \u002F\u003E. ' + 'Did you mean \"collapsed\" or \"hidden\"?', tailMode);\n } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') {\n didWarnAboutTailOptions[tailMode] = true;\n\n error('\u003CSuspenseList tail=\"%s\" \u002F\u003E is only valid if revealOrder is ' + '\"forwards\" or \"backwards\". ' + 'Did you mean to specify revealOrder=\"forwards\"?', tailMode);\n }\n }\n }\n}\n\nfunction validateSuspenseListNestedChild(childSlot, index) {\n {\n var isArray = Array.isArray(childSlot);\n var isIterable = !isArray && typeof getIteratorFn(childSlot) === 'function';\n\n if (isArray || isIterable) {\n var type = isArray ? 'array' : 'iterable';\n\n error('A nested %s was passed to row #%s in \u003CSuspenseList \u002F\u003E. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '\u003CSuspenseList revealOrder=...\u003E ... ' + '\u003CSuspenseList revealOrder=...\u003E{%s}\u003C\u002FSuspenseList\u003E ... ' + '\u003C\u002FSuspenseList\u003E', type, index, type);\n\n return false;\n }\n }\n\n return true;\n}\n\nfunction validateSuspenseListChildren(children, revealOrder) {\n {\n if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) {\n if (Array.isArray(children)) {\n for (var i = 0; i \u003C children.length; i++) {\n if (!validateSuspenseListNestedChild(children[i], i)) {\n return;\n }\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var childrenIterator = iteratorFn.call(children);\n\n if (childrenIterator) {\n var step = childrenIterator.next();\n var _i = 0;\n\n for (; !step.done; step = childrenIterator.next()) {\n if (!validateSuspenseListNestedChild(step.value, _i)) {\n return;\n }\n\n _i++;\n }\n }\n } else {\n error('A single row was passed to a \u003CSuspenseList revealOrder=\"%s\" \u002F\u003E. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder);\n }\n }\n }\n }\n}\n\nfunction initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode, lastEffectBeforeRendering) {\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n workInProgress.memoizedState = {\n isBackwards: isBackwards,\n rendering: null,\n renderingStartTime: 0,\n last: lastContentRow,\n tail: tail,\n tailMode: tailMode,\n lastEffect: lastEffectBeforeRendering\n };\n } else {\n \u002F\u002F We can reuse the existing object from previous renders.\n renderState.isBackwards = isBackwards;\n renderState.rendering = null;\n renderState.renderingStartTime = 0;\n renderState.last = lastContentRow;\n renderState.tail = tail;\n renderState.tailMode = tailMode;\n renderState.lastEffect = lastEffectBeforeRendering;\n }\n} \u002F\u002F This can end up rendering this component multiple passes.\n\u002F\u002F The first pass splits the children fibers into two sets. A head and tail.\n\u002F\u002F We first render the head. If anything is in fallback state, we do another\n\u002F\u002F pass through beginWork to rerender all children (including the tail) with\n\u002F\u002F the force suspend context. If the first render didn't have anything in\n\u002F\u002F in fallback state. Then we render each row in the tail one-by-one.\n\u002F\u002F That happens in the completeWork phase without going back to beginWork.\n\n\nfunction updateSuspenseListComponent(current, workInProgress, renderLanes) {\n var nextProps = workInProgress.pendingProps;\n var revealOrder = nextProps.revealOrder;\n var tailMode = nextProps.tail;\n var newChildren = nextProps.children;\n validateRevealOrder(revealOrder);\n validateTailOptions(tailMode, revealOrder);\n validateSuspenseListChildren(newChildren, revealOrder);\n reconcileChildren(current, workInProgress, newChildren, renderLanes);\n var suspenseContext = suspenseStackCursor.current;\n var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback);\n\n if (shouldForceFallback) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n workInProgress.flags |= DidCapture;\n } else {\n var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags;\n\n if (didSuspendBefore) {\n \u002F\u002F If we previously forced a fallback, we need to schedule work\n \u002F\u002F on any nested boundaries to let them know to try to render\n \u002F\u002F again. This is the same as context updating.\n propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes);\n }\n\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext);\n\n if ((workInProgress.mode & BlockingMode) === NoMode) {\n \u002F\u002F In legacy mode, SuspenseList doesn't work so we just\n \u002F\u002F use make it a noop by treating it as the default revealOrder.\n workInProgress.memoizedState = null;\n } else {\n switch (revealOrder) {\n case 'forwards':\n {\n var lastContentRow = findLastContentRow(workInProgress.child);\n var tail;\n\n if (lastContentRow === null) {\n \u002F\u002F The whole list is part of the tail.\n \u002F\u002F TODO: We could fast path by just rendering the tail now.\n tail = workInProgress.child;\n workInProgress.child = null;\n } else {\n \u002F\u002F Disconnect the tail rows after the content row.\n \u002F\u002F We're going to render them separately later.\n tail = lastContentRow.sibling;\n lastContentRow.sibling = null;\n }\n\n initSuspenseListRenderState(workInProgress, false, \u002F\u002F isBackwards\n tail, lastContentRow, tailMode, workInProgress.lastEffect);\n break;\n }\n\n case 'backwards':\n {\n \u002F\u002F We're going to find the first row that has existing content.\n \u002F\u002F At the same time we're going to reverse the list of everything\n \u002F\u002F we pass in the meantime. That's going to be our tail in reverse\n \u002F\u002F order.\n var _tail = null;\n var row = workInProgress.child;\n workInProgress.child = null;\n\n while (row !== null) {\n var currentRow = row.alternate; \u002F\u002F New rows can't be content rows.\n\n if (currentRow !== null && findFirstSuspended(currentRow) === null) {\n \u002F\u002F This is the beginning of the main content.\n workInProgress.child = row;\n break;\n }\n\n var nextRow = row.sibling;\n row.sibling = _tail;\n _tail = row;\n row = nextRow;\n } \u002F\u002F TODO: If workInProgress.child is null, we can continue on the tail immediately.\n\n\n initSuspenseListRenderState(workInProgress, true, \u002F\u002F isBackwards\n _tail, null, \u002F\u002F last\n tailMode, workInProgress.lastEffect);\n break;\n }\n\n case 'together':\n {\n initSuspenseListRenderState(workInProgress, false, \u002F\u002F isBackwards\n null, \u002F\u002F tail\n null, \u002F\u002F last\n undefined, workInProgress.lastEffect);\n break;\n }\n\n default:\n {\n \u002F\u002F The default reveal order is the same as not having\n \u002F\u002F a boundary.\n workInProgress.memoizedState = null;\n }\n }\n }\n\n return workInProgress.child;\n}\n\nfunction updatePortalComponent(current, workInProgress, renderLanes) {\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n var nextChildren = workInProgress.pendingProps;\n\n if (current === null) {\n \u002F\u002F Portals are special because we don't append the children during mount\n \u002F\u002F but at commit. Therefore we need to track insertions which the normal\n \u002F\u002F flow doesn't do during mount. This doesn't happen at the root because\n \u002F\u002F the root always starts with a \"current\" with a null child.\n \u002F\u002F TODO: Consider unifying this with how the root works.\n workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes);\n } else {\n reconcileChildren(current, workInProgress, nextChildren, renderLanes);\n }\n\n return workInProgress.child;\n}\n\nvar hasWarnedAboutUsingNoValuePropOnContextProvider = false;\n\nfunction updateContextProvider(current, workInProgress, renderLanes) {\n var providerType = workInProgress.type;\n var context = providerType._context;\n var newProps = workInProgress.pendingProps;\n var oldProps = workInProgress.memoizedProps;\n var newValue = newProps.value;\n\n {\n if (!('value' in newProps)) {\n if (!hasWarnedAboutUsingNoValuePropOnContextProvider) {\n hasWarnedAboutUsingNoValuePropOnContextProvider = true;\n\n error('The `value` prop is required for the `\u003CContext.Provider\u003E`. Did you misspell it or forget to pass it?');\n }\n }\n\n var providerPropTypes = workInProgress.type.propTypes;\n\n if (providerPropTypes) {\n checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider');\n }\n }\n\n pushProvider(workInProgress, newValue);\n\n if (oldProps !== null) {\n var oldValue = oldProps.value;\n var changedBits = calculateChangedBits(context, newValue, oldValue);\n\n if (changedBits === 0) {\n \u002F\u002F No change. Bailout early if children are the same.\n if (oldProps.children === newProps.children && !hasContextChanged()) {\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n }\n } else {\n \u002F\u002F The context value changed. Search for matching consumers and schedule\n \u002F\u002F them to update.\n propagateContextChange(workInProgress, context, changedBits, renderLanes);\n }\n }\n\n var newChildren = newProps.children;\n reconcileChildren(current, workInProgress, newChildren, renderLanes);\n return workInProgress.child;\n}\n\nvar hasWarnedAboutUsingContextAsConsumer = false;\n\nfunction updateContextConsumer(current, workInProgress, renderLanes) {\n var context = workInProgress.type; \u002F\u002F The logic below for Context differs depending on PROD or DEV mode. In\n \u002F\u002F DEV mode, we create a separate object for Context.Consumer that acts\n \u002F\u002F like a proxy to Context. This proxy object adds unnecessary code in PROD\n \u002F\u002F so we use the old behaviour (Context.Consumer references Context) to\n \u002F\u002F reduce size and overhead. The separate object references context via\n \u002F\u002F a property called \"_context\", which also gives us the ability to check\n \u002F\u002F in DEV mode if this property exists or not and warn if it does not.\n\n {\n if (context._context === undefined) {\n \u002F\u002F This may be because it's a Context (rather than a Consumer).\n \u002F\u002F Or it may be because it's older React where they're the same thing.\n \u002F\u002F We only want to warn if we're sure it's a new React.\n if (context !== context.Consumer) {\n if (!hasWarnedAboutUsingContextAsConsumer) {\n hasWarnedAboutUsingContextAsConsumer = true;\n\n error('Rendering \u003CContext\u003E directly is not supported and will be removed in ' + 'a future major release. Did you mean to render \u003CContext.Consumer\u003E instead?');\n }\n }\n } else {\n context = context._context;\n }\n }\n\n var newProps = workInProgress.pendingProps;\n var render = newProps.children;\n\n {\n if (typeof render !== 'function') {\n error('A context consumer was rendered with multiple children, or a child ' + \"that isn't a function. A context consumer expects a single child \" + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.');\n }\n }\n\n prepareToReadContext(workInProgress, renderLanes);\n var newValue = readContext(context, newProps.unstable_observedBits);\n var newChildren;\n\n {\n ReactCurrentOwner$1.current = workInProgress;\n setIsRendering(true);\n newChildren = render(newValue);\n setIsRendering(false);\n } \u002F\u002F React DevTools reads this flag.\n\n\n workInProgress.flags |= PerformedWork;\n reconcileChildren(current, workInProgress, newChildren, renderLanes);\n return workInProgress.child;\n}\n\nfunction markWorkInProgressReceivedUpdate() {\n didReceiveUpdate = true;\n}\n\nfunction bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) {\n if (current !== null) {\n \u002F\u002F Reuse previous dependencies\n workInProgress.dependencies = current.dependencies;\n }\n\n {\n \u002F\u002F Don't update \"base\" render times for bailouts.\n stopProfilerTimerIfRunning();\n }\n\n markSkippedUpdateLanes(workInProgress.lanes); \u002F\u002F Check if the children have any pending work.\n\n if (!includesSomeLane(renderLanes, workInProgress.childLanes)) {\n \u002F\u002F The children don't have any work either. We can skip them.\n \u002F\u002F TODO: Once we add back resuming, we should check if the children are\n \u002F\u002F a work-in-progress set. If so, we need to transfer their effects.\n return null;\n } else {\n \u002F\u002F This fiber doesn't have work, but its subtree does. Clone the child\n \u002F\u002F fibers and continue.\n cloneChildFibers(current, workInProgress);\n return workInProgress.child;\n }\n}\n\nfunction remountFiber(current, oldWorkInProgress, newWorkInProgress) {\n {\n var returnFiber = oldWorkInProgress.return;\n\n if (returnFiber === null) {\n throw new Error('Cannot swap the root fiber.');\n } \u002F\u002F Disconnect from the old current.\n \u002F\u002F It will get deleted.\n\n\n current.alternate = null;\n oldWorkInProgress.alternate = null; \u002F\u002F Connect to the new tree.\n\n newWorkInProgress.index = oldWorkInProgress.index;\n newWorkInProgress.sibling = oldWorkInProgress.sibling;\n newWorkInProgress.return = oldWorkInProgress.return;\n newWorkInProgress.ref = oldWorkInProgress.ref; \u002F\u002F Replace the child\u002Fsibling pointers above it.\n\n if (oldWorkInProgress === returnFiber.child) {\n returnFiber.child = newWorkInProgress;\n } else {\n var prevSibling = returnFiber.child;\n\n if (prevSibling === null) {\n throw new Error('Expected parent to have a child.');\n }\n\n while (prevSibling.sibling !== oldWorkInProgress) {\n prevSibling = prevSibling.sibling;\n\n if (prevSibling === null) {\n throw new Error('Expected to find the previous sibling.');\n }\n }\n\n prevSibling.sibling = newWorkInProgress;\n } \u002F\u002F Delete the old fiber and place the new one.\n \u002F\u002F Since the old fiber is disconnected, we have to schedule it manually.\n\n\n var last = returnFiber.lastEffect;\n\n if (last !== null) {\n last.nextEffect = current;\n returnFiber.lastEffect = current;\n } else {\n returnFiber.firstEffect = returnFiber.lastEffect = current;\n }\n\n current.nextEffect = null;\n current.flags = Deletion;\n newWorkInProgress.flags |= Placement; \u002F\u002F Restart work from the new fiber.\n\n return newWorkInProgress;\n }\n}\n\nfunction beginWork(current, workInProgress, renderLanes) {\n var updateLanes = workInProgress.lanes;\n\n {\n if (workInProgress._debugNeedsRemount && current !== null) {\n \u002F\u002F This will restart the begin phase with a new fiber.\n return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes));\n }\n }\n\n if (current !== null) {\n var oldProps = current.memoizedProps;\n var newProps = workInProgress.pendingProps;\n\n if (oldProps !== newProps || hasContextChanged() || ( \u002F\u002F Force a re-render if the implementation changed due to hot reload:\n workInProgress.type !== current.type )) {\n \u002F\u002F If props or context changed, mark the fiber as having performed work.\n \u002F\u002F This may be unset if the props are determined to be equal later (memo).\n didReceiveUpdate = true;\n } else if (!includesSomeLane(renderLanes, updateLanes)) {\n didReceiveUpdate = false; \u002F\u002F This fiber does not have any pending work. Bailout without entering\n \u002F\u002F the begin phase. There's still some bookkeeping we that needs to be done\n \u002F\u002F in this optimized path, mostly pushing stuff onto the stack.\n\n switch (workInProgress.tag) {\n case HostRoot:\n pushHostRootContext(workInProgress);\n resetHydrationState();\n break;\n\n case HostComponent:\n pushHostContext(workInProgress);\n break;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n pushContextProvider(workInProgress);\n }\n\n break;\n }\n\n case HostPortal:\n pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo);\n break;\n\n case ContextProvider:\n {\n var newValue = workInProgress.memoizedProps.value;\n pushProvider(workInProgress, newValue);\n break;\n }\n\n case Profiler:\n {\n \u002F\u002F Profiler should only call onRender when one of its descendants actually rendered.\n var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);\n\n if (hasChildWork) {\n workInProgress.flags |= Update;\n } \u002F\u002F Reset effect durations for the next eventual effect phase.\n \u002F\u002F These are reset during render to allow the DevTools commit hook a chance to read them,\n\n\n var stateNode = workInProgress.stateNode;\n stateNode.effectDuration = 0;\n stateNode.passiveEffectDuration = 0;\n }\n\n break;\n\n case SuspenseComponent:\n {\n var state = workInProgress.memoizedState;\n\n if (state !== null) {\n \u002F\u002F whether to retry the primary children, or to skip over it and\n \u002F\u002F go straight to the fallback. Check the priority of the primary\n \u002F\u002F child fragment.\n\n\n var primaryChildFragment = workInProgress.child;\n var primaryChildLanes = primaryChildFragment.childLanes;\n\n if (includesSomeLane(renderLanes, primaryChildLanes)) {\n \u002F\u002F The primary children have pending work. Use the normal path\n \u002F\u002F to attempt to render the primary children again.\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n } else {\n \u002F\u002F The primary child fragment does not have pending work marked\n \u002F\u002F on it\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); \u002F\u002F The primary children do not have pending work with sufficient\n \u002F\u002F priority. Bailout.\n\n var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n\n if (child !== null) {\n \u002F\u002F The fallback children have pending work. Skip over the\n \u002F\u002F primary children and work on the fallback.\n return child.sibling;\n } else {\n return null;\n }\n }\n } else {\n pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current));\n }\n\n break;\n }\n\n case SuspenseListComponent:\n {\n var didSuspendBefore = (current.flags & DidCapture) !== NoFlags;\n\n var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes);\n\n if (didSuspendBefore) {\n if (_hasChildWork) {\n \u002F\u002F If something was in fallback state last time, and we have all the\n \u002F\u002F same children then we're still in progressive loading state.\n \u002F\u002F Something might get unblocked by state updates or retries in the\n \u002F\u002F tree which will affect the tail. So we need to use the normal\n \u002F\u002F path to compute the correct tail.\n return updateSuspenseListComponent(current, workInProgress, renderLanes);\n } \u002F\u002F If none of the children had any work, that means that none of\n \u002F\u002F them got retried so they'll still be blocked in the same way\n \u002F\u002F as before. We can fast bail out.\n\n\n workInProgress.flags |= DidCapture;\n } \u002F\u002F If nothing suspended before and we're rendering the same children,\n \u002F\u002F then the tail doesn't matter. Anything new that suspends will work\n \u002F\u002F in the \"together\" mode, so we can continue from the state we had.\n\n\n var renderState = workInProgress.memoizedState;\n\n if (renderState !== null) {\n \u002F\u002F Reset to the \"together\" mode in case we've started a different\n \u002F\u002F update in the past but didn't complete it.\n renderState.rendering = null;\n renderState.tail = null;\n renderState.lastEffect = null;\n }\n\n pushSuspenseContext(workInProgress, suspenseStackCursor.current);\n\n if (_hasChildWork) {\n break;\n } else {\n \u002F\u002F If none of the children had any work, that means that none of\n \u002F\u002F them got retried so they'll still be blocked in the same way\n \u002F\u002F as before. We can fast bail out.\n return null;\n }\n }\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n {\n \u002F\u002F Need to check if the tree still needs to be deferred. This is\n \u002F\u002F almost identical to the logic used in the normal update path,\n \u002F\u002F so we'll just enter that. The only difference is we'll bail out\n \u002F\u002F at the next level instead of this one, because the child props\n \u002F\u002F have not changed. Which is fine.\n \u002F\u002F TODO: Probably should refactor `beginWork` to split the bailout\n \u002F\u002F path from the normal path. I'm tempted to do a labeled break here\n \u002F\u002F but I won't :)\n workInProgress.lanes = NoLanes;\n return updateOffscreenComponent(current, workInProgress, renderLanes);\n }\n }\n\n return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes);\n } else {\n if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) {\n \u002F\u002F This is a special case that only exists for legacy mode.\n \u002F\u002F See https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F19216.\n didReceiveUpdate = true;\n } else {\n \u002F\u002F An update was scheduled on this fiber, but there are no new props\n \u002F\u002F nor legacy context. Set this to false. If an update queue or context\n \u002F\u002F consumer produces a changed value, it will set this to true. Otherwise,\n \u002F\u002F the component will assume the children have not changed and bail out.\n didReceiveUpdate = false;\n }\n }\n } else {\n didReceiveUpdate = false;\n } \u002F\u002F Before entering the begin phase, clear pending update priority.\n \u002F\u002F TODO: This assumes that we're about to evaluate the component and process\n \u002F\u002F the update queue. However, there's an exception: SimpleMemoComponent\n \u002F\u002F sometimes bails out later in the begin phase. This indicates that we should\n \u002F\u002F move this assignment out of the common path and into each branch.\n\n\n workInProgress.lanes = NoLanes;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n {\n return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes);\n }\n\n case LazyComponent:\n {\n var elementType = workInProgress.elementType;\n return mountLazyComponent(current, workInProgress, elementType, updateLanes, renderLanes);\n }\n\n case FunctionComponent:\n {\n var _Component = workInProgress.type;\n var unresolvedProps = workInProgress.pendingProps;\n var resolvedProps = workInProgress.elementType === _Component ? unresolvedProps : resolveDefaultProps(_Component, unresolvedProps);\n return updateFunctionComponent(current, workInProgress, _Component, resolvedProps, renderLanes);\n }\n\n case ClassComponent:\n {\n var _Component2 = workInProgress.type;\n var _unresolvedProps = workInProgress.pendingProps;\n\n var _resolvedProps = workInProgress.elementType === _Component2 ? _unresolvedProps : resolveDefaultProps(_Component2, _unresolvedProps);\n\n return updateClassComponent(current, workInProgress, _Component2, _resolvedProps, renderLanes);\n }\n\n case HostRoot:\n return updateHostRoot(current, workInProgress, renderLanes);\n\n case HostComponent:\n return updateHostComponent(current, workInProgress, renderLanes);\n\n case HostText:\n return updateHostText(current, workInProgress);\n\n case SuspenseComponent:\n return updateSuspenseComponent(current, workInProgress, renderLanes);\n\n case HostPortal:\n return updatePortalComponent(current, workInProgress, renderLanes);\n\n case ForwardRef:\n {\n var type = workInProgress.type;\n var _unresolvedProps2 = workInProgress.pendingProps;\n\n var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2);\n\n return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes);\n }\n\n case Fragment:\n return updateFragment(current, workInProgress, renderLanes);\n\n case Mode:\n return updateMode(current, workInProgress, renderLanes);\n\n case Profiler:\n return updateProfiler(current, workInProgress, renderLanes);\n\n case ContextProvider:\n return updateContextProvider(current, workInProgress, renderLanes);\n\n case ContextConsumer:\n return updateContextConsumer(current, workInProgress, renderLanes);\n\n case MemoComponent:\n {\n var _type2 = workInProgress.type;\n var _unresolvedProps3 = workInProgress.pendingProps; \u002F\u002F Resolve outer props first, then resolve inner props.\n\n var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3);\n\n {\n if (workInProgress.type !== workInProgress.elementType) {\n var outerPropTypes = _type2.propTypes;\n\n if (outerPropTypes) {\n checkPropTypes(outerPropTypes, _resolvedProps3, \u002F\u002F Resolved for outer only\n 'prop', getComponentName(_type2));\n }\n }\n }\n\n _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3);\n return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, updateLanes, renderLanes);\n }\n\n case SimpleMemoComponent:\n {\n return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateLanes, renderLanes);\n }\n\n case IncompleteClassComponent:\n {\n var _Component3 = workInProgress.type;\n var _unresolvedProps4 = workInProgress.pendingProps;\n\n var _resolvedProps4 = workInProgress.elementType === _Component3 ? _unresolvedProps4 : resolveDefaultProps(_Component3, _unresolvedProps4);\n\n return mountIncompleteClassComponent(current, workInProgress, _Component3, _resolvedProps4, renderLanes);\n }\n\n case SuspenseListComponent:\n {\n return updateSuspenseListComponent(current, workInProgress, renderLanes);\n }\n\n case FundamentalComponent:\n {\n\n break;\n }\n\n case ScopeComponent:\n {\n\n break;\n }\n\n case Block:\n {\n\n break;\n }\n\n case OffscreenComponent:\n {\n return updateOffscreenComponent(current, workInProgress, renderLanes);\n }\n\n case LegacyHiddenComponent:\n {\n return updateLegacyHiddenComponent(current, workInProgress, renderLanes);\n }\n }\n\n {\n {\n throw Error( \"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction markUpdate(workInProgress) {\n \u002F\u002F Tag the fiber with an update effect. This turns a Placement into\n \u002F\u002F a PlacementAndUpdate.\n workInProgress.flags |= Update;\n}\n\nfunction markRef$1(workInProgress) {\n workInProgress.flags |= Ref;\n}\n\nvar appendAllChildren;\nvar updateHostContainer;\nvar updateHostComponent$1;\nvar updateHostText$1;\n\n{\n \u002F\u002F Mutation mode\n appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) {\n \u002F\u002F We only have the top Fiber that was created but we need recurse down its\n \u002F\u002F children to find all the terminal nodes.\n var node = workInProgress.child;\n\n while (node !== null) {\n if (node.tag === HostComponent || node.tag === HostText) {\n appendInitialChild(parent, node.stateNode);\n } else if (node.tag === HostPortal) ; else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === workInProgress) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === workInProgress) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n };\n\n updateHostContainer = function (workInProgress) {\u002F\u002F Noop\n };\n\n updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) {\n \u002F\u002F If we have an alternate, that means this is an update and we need to\n \u002F\u002F schedule a side-effect to do the updates.\n var oldProps = current.memoizedProps;\n\n if (oldProps === newProps) {\n \u002F\u002F In mutation mode, this is sufficient for a bailout because\n \u002F\u002F we won't touch this node even if children changed.\n return;\n } \u002F\u002F If we get updated because one of our children updated, we don't\n \u002F\u002F have newProps so we'll have to reuse them.\n \u002F\u002F TODO: Split the update API as separate for the props vs. children.\n \u002F\u002F Even better would be if children weren't special cased at all tho.\n\n\n var instance = workInProgress.stateNode;\n var currentHostContext = getHostContext(); \u002F\u002F TODO: Experiencing an error where oldProps is null. Suggests a host\n \u002F\u002F component is hitting the resume path. Figure out why. Possibly\n \u002F\u002F related to `hidden`.\n\n var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); \u002F\u002F TODO: Type this specific to this type of component.\n\n workInProgress.updateQueue = updatePayload; \u002F\u002F If the update payload indicates that there is a change or if there\n \u002F\u002F is a new ref we mark this as an update. All the work is done in commitWork.\n\n if (updatePayload) {\n markUpdate(workInProgress);\n }\n };\n\n updateHostText$1 = function (current, workInProgress, oldText, newText) {\n \u002F\u002F If the text differs, mark it as an update. All the work in done in commitWork.\n if (oldText !== newText) {\n markUpdate(workInProgress);\n }\n };\n}\n\nfunction cutOffTailIfNeeded(renderState, hasRenderedATailFallback) {\n if (getIsHydrating()) {\n \u002F\u002F If we're hydrating, we should consume as many items as we can\n \u002F\u002F so we don't leave any behind.\n return;\n }\n\n switch (renderState.tailMode) {\n case 'hidden':\n {\n \u002F\u002F Any insertions at the end of the tail list after this point\n \u002F\u002F should be invisible. If there are already mounted boundaries\n \u002F\u002F anything before them are not considered for collapsing.\n \u002F\u002F Therefore we need to go through the whole tail to find if\n \u002F\u002F there are any.\n var tailNode = renderState.tail;\n var lastTailNode = null;\n\n while (tailNode !== null) {\n if (tailNode.alternate !== null) {\n lastTailNode = tailNode;\n }\n\n tailNode = tailNode.sibling;\n } \u002F\u002F Next we're simply going to delete all insertions after the\n \u002F\u002F last rendered item.\n\n\n if (lastTailNode === null) {\n \u002F\u002F All remaining items in the tail are insertions.\n renderState.tail = null;\n } else {\n \u002F\u002F Detach the insertion after the last node that was already\n \u002F\u002F inserted.\n lastTailNode.sibling = null;\n }\n\n break;\n }\n\n case 'collapsed':\n {\n \u002F\u002F Any insertions at the end of the tail list after this point\n \u002F\u002F should be invisible. If there are already mounted boundaries\n \u002F\u002F anything before them are not considered for collapsing.\n \u002F\u002F Therefore we need to go through the whole tail to find if\n \u002F\u002F there are any.\n var _tailNode = renderState.tail;\n var _lastTailNode = null;\n\n while (_tailNode !== null) {\n if (_tailNode.alternate !== null) {\n _lastTailNode = _tailNode;\n }\n\n _tailNode = _tailNode.sibling;\n } \u002F\u002F Next we're simply going to delete all insertions after the\n \u002F\u002F last rendered item.\n\n\n if (_lastTailNode === null) {\n \u002F\u002F All remaining items in the tail are insertions.\n if (!hasRenderedATailFallback && renderState.tail !== null) {\n \u002F\u002F We suspended during the head. We want to show at least one\n \u002F\u002F row at the tail. So we'll keep on and cut off the rest.\n renderState.tail.sibling = null;\n } else {\n renderState.tail = null;\n }\n } else {\n \u002F\u002F Detach the insertion after the last node that was already\n \u002F\u002F inserted.\n _lastTailNode.sibling = null;\n }\n\n break;\n }\n }\n}\n\nfunction completeWork(current, workInProgress, renderLanes) {\n var newProps = workInProgress.pendingProps;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case LazyComponent:\n case SimpleMemoComponent:\n case FunctionComponent:\n case ForwardRef:\n case Fragment:\n case Mode:\n case Profiler:\n case ContextConsumer:\n case MemoComponent:\n return null;\n\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n return null;\n }\n\n case HostRoot:\n {\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n resetWorkInProgressVersions();\n var fiberRoot = workInProgress.stateNode;\n\n if (fiberRoot.pendingContext) {\n fiberRoot.context = fiberRoot.pendingContext;\n fiberRoot.pendingContext = null;\n }\n\n if (current === null || current.child === null) {\n \u002F\u002F If we hydrated, pop so that we can delete any remaining children\n \u002F\u002F that weren't hydrated.\n var wasHydrated = popHydrationState(workInProgress);\n\n if (wasHydrated) {\n \u002F\u002F If we hydrated, then we'll need to schedule an update for\n \u002F\u002F the commit side-effects on the root.\n markUpdate(workInProgress);\n } else if (!fiberRoot.hydrate) {\n \u002F\u002F Schedule an effect to clear this container at the start of the next commit.\n \u002F\u002F This handles the case of React rendering into a container with previous children.\n \u002F\u002F It's also safe to do for updates too, because current.child would only be null\n \u002F\u002F if the previous render was null (so the the container would already be empty).\n workInProgress.flags |= Snapshot;\n }\n }\n\n updateHostContainer(workInProgress);\n return null;\n }\n\n case HostComponent:\n {\n popHostContext(workInProgress);\n var rootContainerInstance = getRootHostContainer();\n var type = workInProgress.type;\n\n if (current !== null && workInProgress.stateNode != null) {\n updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance);\n\n if (current.ref !== workInProgress.ref) {\n markRef$1(workInProgress);\n }\n } else {\n if (!newProps) {\n if (!(workInProgress.stateNode !== null)) {\n {\n throw Error( \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } \u002F\u002F This can happen when we abort work.\n\n\n return null;\n }\n\n var currentHostContext = getHostContext(); \u002F\u002F TODO: Move createInstance to beginWork and keep it on a context\n \u002F\u002F \"stack\" as the parent. Then append children as we go in beginWork\n \u002F\u002F or completeWork depending on whether we want to add them top-\u003Edown or\n \u002F\u002F bottom-\u003Eup. Top-\u003Edown is faster in IE11.\n\n var _wasHydrated = popHydrationState(workInProgress);\n\n if (_wasHydrated) {\n \u002F\u002F TODO: Move this and createInstance step into the beginPhase\n \u002F\u002F to consolidate.\n if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) {\n \u002F\u002F If changes to the hydrated node need to be applied at the\n \u002F\u002F commit-phase we mark this as such.\n markUpdate(workInProgress);\n }\n } else {\n var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress);\n appendAllChildren(instance, workInProgress, false, false);\n workInProgress.stateNode = instance; \u002F\u002F Certain renderers require commit-time effects for initial mount.\n \u002F\u002F (eg DOM renderer supports auto-focus for certain elements).\n \u002F\u002F Make sure such renderers get scheduled for later work.\n\n if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) {\n markUpdate(workInProgress);\n }\n }\n\n if (workInProgress.ref !== null) {\n \u002F\u002F If there is a ref on a host node we need to schedule a callback\n markRef$1(workInProgress);\n }\n }\n\n return null;\n }\n\n case HostText:\n {\n var newText = newProps;\n\n if (current && workInProgress.stateNode != null) {\n var oldText = current.memoizedProps; \u002F\u002F If we have an alternate, that means this is an update and we need\n \u002F\u002F to schedule a side-effect to do the updates.\n\n updateHostText$1(current, workInProgress, oldText, newText);\n } else {\n if (typeof newText !== 'string') {\n if (!(workInProgress.stateNode !== null)) {\n {\n throw Error( \"We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } \u002F\u002F This can happen when we abort work.\n\n }\n\n var _rootContainerInstance = getRootHostContainer();\n\n var _currentHostContext = getHostContext();\n\n var _wasHydrated2 = popHydrationState(workInProgress);\n\n if (_wasHydrated2) {\n if (prepareToHydrateHostTextInstance(workInProgress)) {\n markUpdate(workInProgress);\n }\n } else {\n workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress);\n }\n }\n\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n var nextState = workInProgress.memoizedState;\n\n if ((workInProgress.flags & DidCapture) !== NoFlags) {\n \u002F\u002F Something suspended. Re-render with the fallback children.\n workInProgress.lanes = renderLanes; \u002F\u002F Do not reset the effect list.\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n transferActualDuration(workInProgress);\n }\n\n return workInProgress;\n }\n\n var nextDidTimeout = nextState !== null;\n var prevDidTimeout = false;\n\n if (current === null) {\n if (workInProgress.memoizedProps.fallback !== undefined) {\n popHydrationState(workInProgress);\n }\n } else {\n var prevState = current.memoizedState;\n prevDidTimeout = prevState !== null;\n }\n\n if (nextDidTimeout && !prevDidTimeout) {\n \u002F\u002F If this subtreee is running in blocking mode we can suspend,\n \u002F\u002F otherwise we won't suspend.\n \u002F\u002F TODO: This will still suspend a synchronous tree if anything\n \u002F\u002F in the concurrent tree already suspended during this render.\n \u002F\u002F This is a known bug.\n if ((workInProgress.mode & BlockingMode) !== NoMode) {\n \u002F\u002F TODO: Move this back to throwException because this is too late\n \u002F\u002F if this is a large tree which is common for initial loads. We\n \u002F\u002F don't know if we should restart a render or not until we get\n \u002F\u002F this marker, and this is too late.\n \u002F\u002F If this render already had a ping or lower pri updates,\n \u002F\u002F and this is the first time we know we're going to suspend we\n \u002F\u002F should be able to immediately restart from within throwException.\n var hasInvisibleChildContext = current === null && workInProgress.memoizedProps.unstable_avoidThisFallback !== true;\n\n if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) {\n \u002F\u002F If this was in an invisible tree or a new render, then showing\n \u002F\u002F this boundary is ok.\n renderDidSuspend();\n } else {\n \u002F\u002F Otherwise, we're going to have to hide content so we should\n \u002F\u002F suspend for longer if possible.\n renderDidSuspendDelayIfPossible();\n }\n }\n }\n\n {\n \u002F\u002F TODO: Only schedule updates if these values are non equal, i.e. it changed.\n if (nextDidTimeout || prevDidTimeout) {\n \u002F\u002F If this boundary just timed out, schedule an effect to attach a\n \u002F\u002F retry listener to the promise. This flag is also used to hide the\n \u002F\u002F primary children. In mutation mode, we also need the flag to\n \u002F\u002F *unhide* children that were previously hidden, so check if this\n \u002F\u002F is currently timed out, too.\n workInProgress.flags |= Update;\n }\n }\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n updateHostContainer(workInProgress);\n\n if (current === null) {\n preparePortalMount(workInProgress.stateNode.containerInfo);\n }\n\n return null;\n\n case ContextProvider:\n \u002F\u002F Pop provider fiber\n popProvider(workInProgress);\n return null;\n\n case IncompleteClassComponent:\n {\n \u002F\u002F Same as class component case. I put it down here so that the tags are\n \u002F\u002F sequential to ensure this switch is compiled to a jump table.\n var _Component = workInProgress.type;\n\n if (isContextProvider(_Component)) {\n popContext(workInProgress);\n }\n\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress);\n var renderState = workInProgress.memoizedState;\n\n if (renderState === null) {\n \u002F\u002F We're running in the default, \"independent\" mode.\n \u002F\u002F We don't do anything in this mode.\n return null;\n }\n\n var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags;\n var renderedTail = renderState.rendering;\n\n if (renderedTail === null) {\n \u002F\u002F We just rendered the head.\n if (!didSuspendAlready) {\n \u002F\u002F This is the first pass. We need to figure out if anything is still\n \u002F\u002F suspended in the rendered set.\n \u002F\u002F If new content unsuspended, but there's still some content that\n \u002F\u002F didn't. Then we need to do a second pass that forces everything\n \u002F\u002F to keep showing their fallbacks.\n \u002F\u002F We might be suspended if something in this render pass suspended, or\n \u002F\u002F something in the previous committed pass suspended. Otherwise,\n \u002F\u002F there's no chance so we can skip the expensive call to\n \u002F\u002F findFirstSuspended.\n var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags);\n\n if (!cannotBeSuspended) {\n var row = workInProgress.child;\n\n while (row !== null) {\n var suspended = findFirstSuspended(row);\n\n if (suspended !== null) {\n didSuspendAlready = true;\n workInProgress.flags |= DidCapture;\n cutOffTailIfNeeded(renderState, false); \u002F\u002F If this is a newly suspended tree, it might not get committed as\n \u002F\u002F part of the second pass. In that case nothing will subscribe to\n \u002F\u002F its thennables. Instead, we'll transfer its thennables to the\n \u002F\u002F SuspenseList so that it can retry if they resolve.\n \u002F\u002F There might be multiple of these in the list but since we're\n \u002F\u002F going to wait for all of them anyway, it doesn't really matter\n \u002F\u002F which ones gets to ping. In theory we could get clever and keep\n \u002F\u002F track of how many dependencies remain but it gets tricky because\n \u002F\u002F in the meantime, we can add\u002Fremove\u002Fchange items and dependencies.\n \u002F\u002F We might bail out of the loop before finding any but that\n \u002F\u002F doesn't matter since that means that the other boundaries that\n \u002F\u002F we did find already has their listeners attached.\n\n var newThennables = suspended.updateQueue;\n\n if (newThennables !== null) {\n workInProgress.updateQueue = newThennables;\n workInProgress.flags |= Update;\n } \u002F\u002F Rerender the whole list, but this time, we'll force fallbacks\n \u002F\u002F to stay in place.\n \u002F\u002F Reset the effect list before doing the second pass since that's now invalid.\n\n\n if (renderState.lastEffect === null) {\n workInProgress.firstEffect = null;\n }\n\n workInProgress.lastEffect = renderState.lastEffect; \u002F\u002F Reset the child fibers to their original state.\n\n resetChildFibers(workInProgress, renderLanes); \u002F\u002F Set up the Suspense Context to force suspense and immediately\n \u002F\u002F rerender the children.\n\n pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback));\n return workInProgress.child;\n }\n\n row = row.sibling;\n }\n }\n\n if (renderState.tail !== null && now() \u003E getRenderTargetTime()) {\n \u002F\u002F We have already passed our CPU deadline but we still have rows\n \u002F\u002F left in the tail. We'll just give up further attempts to render\n \u002F\u002F the main content and only render fallbacks.\n workInProgress.flags |= DidCapture;\n didSuspendAlready = true;\n cutOffTailIfNeeded(renderState, false); \u002F\u002F Since nothing actually suspended, there will nothing to ping this\n \u002F\u002F to get it started back up to attempt the next item. While in terms\n \u002F\u002F of priority this work has the same priority as this current render,\n \u002F\u002F it's not part of the same transition once the transition has\n \u002F\u002F committed. If it's sync, we still want to yield so that it can be\n \u002F\u002F painted. Conceptually, this is really the same as pinging.\n \u002F\u002F We can use any RetryLane even if it's the one currently rendering\n \u002F\u002F since we're leaving it behind on this node.\n\n workInProgress.lanes = SomeRetryLane;\n\n {\n markSpawnedWork(SomeRetryLane);\n }\n }\n } else {\n cutOffTailIfNeeded(renderState, false);\n } \u002F\u002F Next we're going to render the tail.\n\n } else {\n \u002F\u002F Append the rendered row to the child list.\n if (!didSuspendAlready) {\n var _suspended = findFirstSuspended(renderedTail);\n\n if (_suspended !== null) {\n workInProgress.flags |= DidCapture;\n didSuspendAlready = true; \u002F\u002F Ensure we transfer the update queue to the parent so that it doesn't\n \u002F\u002F get lost if this row ends up dropped during a second pass.\n\n var _newThennables = _suspended.updateQueue;\n\n if (_newThennables !== null) {\n workInProgress.updateQueue = _newThennables;\n workInProgress.flags |= Update;\n }\n\n cutOffTailIfNeeded(renderState, true); \u002F\u002F This might have been modified.\n\n if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate && !getIsHydrating() \u002F\u002F We don't cut it if we're hydrating.\n ) {\n \u002F\u002F We need to delete the row we just rendered.\n \u002F\u002F Reset the effect list to what it was before we rendered this\n \u002F\u002F child. The nested children have already appended themselves.\n var lastEffect = workInProgress.lastEffect = renderState.lastEffect; \u002F\u002F Remove any effects that were appended after this point.\n\n if (lastEffect !== null) {\n lastEffect.nextEffect = null;\n } \u002F\u002F We're done.\n\n\n return null;\n }\n } else if ( \u002F\u002F The time it took to render last row is greater than the remaining\n \u002F\u002F time we have to render. So rendering one more row would likely\n \u002F\u002F exceed it.\n now() * 2 - renderState.renderingStartTime \u003E getRenderTargetTime() && renderLanes !== OffscreenLane) {\n \u002F\u002F We have now passed our CPU deadline and we'll just give up further\n \u002F\u002F attempts to render the main content and only render fallbacks.\n \u002F\u002F The assumption is that this is usually faster.\n workInProgress.flags |= DidCapture;\n didSuspendAlready = true;\n cutOffTailIfNeeded(renderState, false); \u002F\u002F Since nothing actually suspended, there will nothing to ping this\n \u002F\u002F to get it started back up to attempt the next item. While in terms\n \u002F\u002F of priority this work has the same priority as this current render,\n \u002F\u002F it's not part of the same transition once the transition has\n \u002F\u002F committed. If it's sync, we still want to yield so that it can be\n \u002F\u002F painted. Conceptually, this is really the same as pinging.\n \u002F\u002F We can use any RetryLane even if it's the one currently rendering\n \u002F\u002F since we're leaving it behind on this node.\n\n workInProgress.lanes = SomeRetryLane;\n\n {\n markSpawnedWork(SomeRetryLane);\n }\n }\n }\n\n if (renderState.isBackwards) {\n \u002F\u002F The effect list of the backwards tail will have been added\n \u002F\u002F to the end. This breaks the guarantee that life-cycles fire in\n \u002F\u002F sibling order but that isn't a strong guarantee promised by React.\n \u002F\u002F Especially since these might also just pop in during future commits.\n \u002F\u002F Append to the beginning of the list.\n renderedTail.sibling = workInProgress.child;\n workInProgress.child = renderedTail;\n } else {\n var previousSibling = renderState.last;\n\n if (previousSibling !== null) {\n previousSibling.sibling = renderedTail;\n } else {\n workInProgress.child = renderedTail;\n }\n\n renderState.last = renderedTail;\n }\n }\n\n if (renderState.tail !== null) {\n \u002F\u002F We still have tail rows to render.\n \u002F\u002F Pop a row.\n var next = renderState.tail;\n renderState.rendering = next;\n renderState.tail = next.sibling;\n renderState.lastEffect = workInProgress.lastEffect;\n renderState.renderingStartTime = now();\n next.sibling = null; \u002F\u002F Restore the context.\n \u002F\u002F TODO: We can probably just avoid popping it instead and only\n \u002F\u002F setting it the first time we go from not suspended to suspended.\n\n var suspenseContext = suspenseStackCursor.current;\n\n if (didSuspendAlready) {\n suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback);\n } else {\n suspenseContext = setDefaultShallowSuspenseContext(suspenseContext);\n }\n\n pushSuspenseContext(workInProgress, suspenseContext); \u002F\u002F Do a pass over the next row.\n\n return next;\n }\n\n return null;\n }\n\n case FundamentalComponent:\n {\n\n break;\n }\n\n case ScopeComponent:\n {\n\n break;\n }\n\n case Block:\n\n break;\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n {\n popRenderLanes(workInProgress);\n\n if (current !== null) {\n var _nextState = workInProgress.memoizedState;\n var _prevState = current.memoizedState;\n var prevIsHidden = _prevState !== null;\n var nextIsHidden = _nextState !== null;\n\n if (prevIsHidden !== nextIsHidden && newProps.mode !== 'unstable-defer-without-hiding') {\n workInProgress.flags |= Update;\n }\n }\n\n return null;\n }\n }\n\n {\n {\n throw Error( \"Unknown unit of work tag (\" + workInProgress.tag + \"). This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction unwindWork(workInProgress, renderLanes) {\n switch (workInProgress.tag) {\n case ClassComponent:\n {\n var Component = workInProgress.type;\n\n if (isContextProvider(Component)) {\n popContext(workInProgress);\n }\n\n var flags = workInProgress.flags;\n\n if (flags & ShouldCapture) {\n workInProgress.flags = flags & ~ShouldCapture | DidCapture;\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n transferActualDuration(workInProgress);\n }\n\n return workInProgress;\n }\n\n return null;\n }\n\n case HostRoot:\n {\n popHostContainer(workInProgress);\n popTopLevelContextObject(workInProgress);\n resetWorkInProgressVersions();\n var _flags = workInProgress.flags;\n\n if (!((_flags & DidCapture) === NoFlags)) {\n {\n throw Error( \"The root failed to unmount after an error. This is likely a bug in React. Please file an issue.\" );\n }\n }\n\n workInProgress.flags = _flags & ~ShouldCapture | DidCapture;\n return workInProgress;\n }\n\n case HostComponent:\n {\n \u002F\u002F TODO: popHydrationState\n popHostContext(workInProgress);\n return null;\n }\n\n case SuspenseComponent:\n {\n popSuspenseContext(workInProgress);\n\n var _flags2 = workInProgress.flags;\n\n if (_flags2 & ShouldCapture) {\n workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; \u002F\u002F Captured a suspense effect. Re-render the boundary.\n\n if ( (workInProgress.mode & ProfileMode) !== NoMode) {\n transferActualDuration(workInProgress);\n }\n\n return workInProgress;\n }\n\n return null;\n }\n\n case SuspenseListComponent:\n {\n popSuspenseContext(workInProgress); \u002F\u002F SuspenseList doesn't actually catch anything. It should've been\n \u002F\u002F caught by a nested boundary. If not, it should bubble through.\n\n return null;\n }\n\n case HostPortal:\n popHostContainer(workInProgress);\n return null;\n\n case ContextProvider:\n popProvider(workInProgress);\n return null;\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n popRenderLanes(workInProgress);\n return null;\n\n default:\n return null;\n }\n}\n\nfunction unwindInterruptedWork(interruptedWork) {\n switch (interruptedWork.tag) {\n case ClassComponent:\n {\n var childContextTypes = interruptedWork.type.childContextTypes;\n\n if (childContextTypes !== null && childContextTypes !== undefined) {\n popContext(interruptedWork);\n }\n\n break;\n }\n\n case HostRoot:\n {\n popHostContainer(interruptedWork);\n popTopLevelContextObject(interruptedWork);\n resetWorkInProgressVersions();\n break;\n }\n\n case HostComponent:\n {\n popHostContext(interruptedWork);\n break;\n }\n\n case HostPortal:\n popHostContainer(interruptedWork);\n break;\n\n case SuspenseComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case SuspenseListComponent:\n popSuspenseContext(interruptedWork);\n break;\n\n case ContextProvider:\n popProvider(interruptedWork);\n break;\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n popRenderLanes(interruptedWork);\n break;\n }\n}\n\nfunction createCapturedValue(value, source) {\n \u002F\u002F If the value is an error, call this function immediately after it is thrown\n \u002F\u002F so the stack is accurate.\n return {\n value: value,\n source: source,\n stack: getStackByFiberInDevAndProd(source)\n };\n}\n\n\u002F\u002F This module is forked in different environments.\n\u002F\u002F By default, return `true` to log errors to the console.\n\u002F\u002F Forks can return `false` if this isn't desirable.\nfunction showErrorDialog(boundary, errorInfo) {\n return true;\n}\n\nfunction logCapturedError(boundary, errorInfo) {\n try {\n var logError = showErrorDialog(boundary, errorInfo); \u002F\u002F Allow injected showErrorDialog() to prevent default console.error logging.\n \u002F\u002F This enables renderers like ReactNative to better manage redbox behavior.\n\n if (logError === false) {\n return;\n }\n\n var error = errorInfo.value;\n\n if (true) {\n var source = errorInfo.source;\n var stack = errorInfo.stack;\n var componentStack = stack !== null ? stack : ''; \u002F\u002F Browsers support silencing uncaught errors by calling\n \u002F\u002F `preventDefault()` in window `error` handler.\n \u002F\u002F We record this information as an expando on the error.\n\n if (error != null && error._suppressLogging) {\n if (boundary.tag === ClassComponent) {\n \u002F\u002F The error is recoverable and was silenced.\n \u002F\u002F Ignore it and don't print the stack addendum.\n \u002F\u002F This is handy for testing error boundaries without noise.\n return;\n } \u002F\u002F The error is fatal. Since the silencing might have\n \u002F\u002F been accidental, we'll surface it anyway.\n \u002F\u002F However, the browser would have silenced the original error\n \u002F\u002F so we'll print it first, and then print the stack addendum.\n\n\n console['error'](error); \u002F\u002F Don't transform to our wrapper\n \u002F\u002F For a more detailed description of this block, see:\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fpull\u002F13384\n }\n\n var componentName = source ? getComponentName(source.type) : null;\n var componentNameMessage = componentName ? \"The above error occurred in the \u003C\" + componentName + \"\u003E component:\" : 'The above error occurred in one of your React components:';\n var errorBoundaryMessage;\n var errorBoundaryName = getComponentName(boundary.type);\n\n if (errorBoundaryName) {\n errorBoundaryMessage = \"React will try to recreate this component tree from scratch \" + (\"using the error boundary you provided, \" + errorBoundaryName + \".\");\n } else {\n errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\\n' + 'Visit https:\u002F\u002Freactjs.org\u002Flink\u002Ferror-boundaries to learn more about error boundaries.';\n }\n\n var combinedMessage = componentNameMessage + \"\\n\" + componentStack + \"\\n\\n\" + (\"\" + errorBoundaryMessage); \u002F\u002F In development, we provide our own message with just the component stack.\n \u002F\u002F We don't include the original error message and JS stack because the browser\n \u002F\u002F has already printed it. Even if the application swallows the error, it is still\n \u002F\u002F displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils.\n\n console['error'](combinedMessage); \u002F\u002F Don't transform to our wrapper\n } else {}\n } catch (e) {\n \u002F\u002F This method must not throw, or React internal state will get messed up.\n \u002F\u002F If console.error is overridden, or logCapturedError() shows a dialog that throws,\n \u002F\u002F we want to report this error outside of the normal stack as a last resort.\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F13188\n setTimeout(function () {\n throw e;\n });\n }\n}\n\nvar PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map;\n\nfunction createRootErrorUpdate(fiber, errorInfo, lane) {\n var update = createUpdate(NoTimestamp, lane); \u002F\u002F Unmount the root by rendering null.\n\n update.tag = CaptureUpdate; \u002F\u002F Caution: React DevTools currently depends on this property\n \u002F\u002F being called \"element\".\n\n update.payload = {\n element: null\n };\n var error = errorInfo.value;\n\n update.callback = function () {\n onUncaughtError(error);\n logCapturedError(fiber, errorInfo);\n };\n\n return update;\n}\n\nfunction createClassErrorUpdate(fiber, errorInfo, lane) {\n var update = createUpdate(NoTimestamp, lane);\n update.tag = CaptureUpdate;\n var getDerivedStateFromError = fiber.type.getDerivedStateFromError;\n\n if (typeof getDerivedStateFromError === 'function') {\n var error$1 = errorInfo.value;\n\n update.payload = function () {\n logCapturedError(fiber, errorInfo);\n return getDerivedStateFromError(error$1);\n };\n }\n\n var inst = fiber.stateNode;\n\n if (inst !== null && typeof inst.componentDidCatch === 'function') {\n update.callback = function callback() {\n {\n markFailedErrorBoundaryForHotReloading(fiber);\n }\n\n if (typeof getDerivedStateFromError !== 'function') {\n \u002F\u002F To preserve the preexisting retry behavior of error boundaries,\n \u002F\u002F we keep track of which ones already failed during this batch.\n \u002F\u002F This gets reset before we yield back to the browser.\n \u002F\u002F TODO: Warn in strict mode if getDerivedStateFromError is\n \u002F\u002F not defined.\n markLegacyErrorBoundaryAsFailed(this); \u002F\u002F Only log here if componentDidCatch is the only error boundary method defined\n\n logCapturedError(fiber, errorInfo);\n }\n\n var error$1 = errorInfo.value;\n var stack = errorInfo.stack;\n this.componentDidCatch(error$1, {\n componentStack: stack !== null ? stack : ''\n });\n\n {\n if (typeof getDerivedStateFromError !== 'function') {\n \u002F\u002F If componentDidCatch is the only error boundary method defined,\n \u002F\u002F then it needs to call setState to recover from errors.\n \u002F\u002F If no state update is scheduled then the boundary will swallow the error.\n if (!includesSomeLane(fiber.lanes, SyncLane)) {\n error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentName(fiber.type) || 'Unknown');\n }\n }\n }\n };\n } else {\n update.callback = function () {\n markFailedErrorBoundaryForHotReloading(fiber);\n };\n }\n\n return update;\n}\n\nfunction attachPingListener(root, wakeable, lanes) {\n \u002F\u002F Attach a listener to the promise to \"ping\" the root and retry. But only if\n \u002F\u002F one does not already exist for the lanes we're currently rendering (which\n \u002F\u002F acts like a \"thread ID\" here).\n var pingCache = root.pingCache;\n var threadIDs;\n\n if (pingCache === null) {\n pingCache = root.pingCache = new PossiblyWeakMap$1();\n threadIDs = new Set();\n pingCache.set(wakeable, threadIDs);\n } else {\n threadIDs = pingCache.get(wakeable);\n\n if (threadIDs === undefined) {\n threadIDs = new Set();\n pingCache.set(wakeable, threadIDs);\n }\n }\n\n if (!threadIDs.has(lanes)) {\n \u002F\u002F Memoize using the thread ID to prevent redundant listeners.\n threadIDs.add(lanes);\n var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes);\n wakeable.then(ping, ping);\n }\n}\n\nfunction throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) {\n \u002F\u002F The source fiber did not complete.\n sourceFiber.flags |= Incomplete; \u002F\u002F Its effect list is no longer valid.\n\n sourceFiber.firstEffect = sourceFiber.lastEffect = null;\n\n if (value !== null && typeof value === 'object' && typeof value.then === 'function') {\n \u002F\u002F This is a wakeable.\n var wakeable = value;\n\n if ((sourceFiber.mode & BlockingMode) === NoMode) {\n \u002F\u002F Reset the memoizedState to what it was before we attempted\n \u002F\u002F to render it.\n var currentSource = sourceFiber.alternate;\n\n if (currentSource) {\n sourceFiber.updateQueue = currentSource.updateQueue;\n sourceFiber.memoizedState = currentSource.memoizedState;\n sourceFiber.lanes = currentSource.lanes;\n } else {\n sourceFiber.updateQueue = null;\n sourceFiber.memoizedState = null;\n }\n }\n\n var hasInvisibleParentBoundary = hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext); \u002F\u002F Schedule the nearest Suspense to re-render the timed out view.\n\n var _workInProgress = returnFiber;\n\n do {\n if (_workInProgress.tag === SuspenseComponent && shouldCaptureSuspense(_workInProgress, hasInvisibleParentBoundary)) {\n \u002F\u002F Found the nearest boundary.\n \u002F\u002F Stash the promise on the boundary fiber. If the boundary times out, we'll\n \u002F\u002F attach another listener to flip the boundary back to its normal state.\n var wakeables = _workInProgress.updateQueue;\n\n if (wakeables === null) {\n var updateQueue = new Set();\n updateQueue.add(wakeable);\n _workInProgress.updateQueue = updateQueue;\n } else {\n wakeables.add(wakeable);\n } \u002F\u002F If the boundary is outside of blocking mode, we should *not*\n \u002F\u002F suspend the commit. Pretend as if the suspended component rendered\n \u002F\u002F null and keep rendering. In the commit phase, we'll schedule a\n \u002F\u002F subsequent synchronous update to re-render the Suspense.\n \u002F\u002F\n \u002F\u002F Note: It doesn't matter whether the component that suspended was\n \u002F\u002F inside a blocking mode tree. If the Suspense is outside of it, we\n \u002F\u002F should *not* suspend the commit.\n\n\n if ((_workInProgress.mode & BlockingMode) === NoMode) {\n _workInProgress.flags |= DidCapture;\n sourceFiber.flags |= ForceUpdateForLegacySuspense; \u002F\u002F We're going to commit this fiber even though it didn't complete.\n \u002F\u002F But we shouldn't call any lifecycle methods or callbacks. Remove\n \u002F\u002F all lifecycle effect tags.\n\n sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete);\n\n if (sourceFiber.tag === ClassComponent) {\n var currentSourceFiber = sourceFiber.alternate;\n\n if (currentSourceFiber === null) {\n \u002F\u002F This is a new mount. Change the tag so it's not mistaken for a\n \u002F\u002F completed class component. For example, we should not call\n \u002F\u002F componentWillUnmount if it is deleted.\n sourceFiber.tag = IncompleteClassComponent;\n } else {\n \u002F\u002F When we try rendering again, we should not reuse the current fiber,\n \u002F\u002F since it's known to be in an inconsistent state. Use a force update to\n \u002F\u002F prevent a bail out.\n var update = createUpdate(NoTimestamp, SyncLane);\n update.tag = ForceUpdate;\n enqueueUpdate(sourceFiber, update);\n }\n } \u002F\u002F The source fiber did not complete. Mark it with Sync priority to\n \u002F\u002F indicate that it still has pending work.\n\n\n sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); \u002F\u002F Exit without suspending.\n\n return;\n } \u002F\u002F Confirmed that the boundary is in a concurrent mode tree. Continue\n \u002F\u002F with the normal suspend path.\n \u002F\u002F\n \u002F\u002F After this we'll use a set of heuristics to determine whether this\n \u002F\u002F render pass will run to completion or restart or \"suspend\" the commit.\n \u002F\u002F The actual logic for this is spread out in different places.\n \u002F\u002F\n \u002F\u002F This first principle is that if we're going to suspend when we complete\n \u002F\u002F a root, then we should also restart if we get an update or ping that\n \u002F\u002F might unsuspend it, and vice versa. The only reason to suspend is\n \u002F\u002F because you think you might want to restart before committing. However,\n \u002F\u002F it doesn't make sense to restart only while in the period we're suspended.\n \u002F\u002F\n \u002F\u002F Restarting too aggressively is also not good because it starves out any\n \u002F\u002F intermediate loading state. So we use heuristics to determine when.\n \u002F\u002F Suspense Heuristics\n \u002F\u002F\n \u002F\u002F If nothing threw a Promise or all the same fallbacks are already showing,\n \u002F\u002F then don't suspend\u002Frestart.\n \u002F\u002F\n \u002F\u002F If this is an initial render of a new tree of Suspense boundaries and\n \u002F\u002F those trigger a fallback, then don't suspend\u002Frestart. We want to ensure\n \u002F\u002F that we can show the initial loading state as quickly as possible.\n \u002F\u002F\n \u002F\u002F If we hit a \"Delayed\" case, such as when we'd switch from content back into\n \u002F\u002F a fallback, then we should always suspend\u002Frestart. Transitions apply\n \u002F\u002F to this case. If none is defined, JND is used instead.\n \u002F\u002F\n \u002F\u002F If we're already showing a fallback and it gets \"retried\", allowing us to show\n \u002F\u002F another level, but there's still an inner boundary that would show a fallback,\n \u002F\u002F then we suspend\u002Frestart for 500ms since the last time we showed a fallback\n \u002F\u002F anywhere in the tree. This effectively throttles progressive loading into a\n \u002F\u002F consistent train of commits. This also gives us an opportunity to restart to\n \u002F\u002F get to the completed state slightly earlier.\n \u002F\u002F\n \u002F\u002F If there's ambiguity due to batching it's resolved in preference of:\n \u002F\u002F 1) \"delayed\", 2) \"initial render\", 3) \"retry\".\n \u002F\u002F\n \u002F\u002F We want to ensure that a \"busy\" state doesn't get force committed. We want to\n \u002F\u002F ensure that new initial loading states can commit as soon as possible.\n\n\n attachPingListener(root, wakeable, rootRenderLanes);\n _workInProgress.flags |= ShouldCapture;\n _workInProgress.lanes = rootRenderLanes;\n return;\n } \u002F\u002F This boundary already captured during this render. Continue to the next\n \u002F\u002F boundary.\n\n\n _workInProgress = _workInProgress.return;\n } while (_workInProgress !== null); \u002F\u002F No boundary was found. Fallthrough to error mode.\n \u002F\u002F TODO: Use invariant so the message is stripped in prod?\n\n\n value = new Error((getComponentName(sourceFiber.type) || 'A React component') + ' suspended while rendering, but no fallback UI was specified.\\n' + '\\n' + 'Add a \u003CSuspense fallback=...\u003E component higher in the tree to ' + 'provide a loading indicator or placeholder to display.');\n } \u002F\u002F We didn't find a boundary that could handle this type of exception. Start\n \u002F\u002F over and traverse parent path again, this time treating the exception\n \u002F\u002F as an error.\n\n\n renderDidError();\n value = createCapturedValue(value, sourceFiber);\n var workInProgress = returnFiber;\n\n do {\n switch (workInProgress.tag) {\n case HostRoot:\n {\n var _errorInfo = value;\n workInProgress.flags |= ShouldCapture;\n var lane = pickArbitraryLane(rootRenderLanes);\n workInProgress.lanes = mergeLanes(workInProgress.lanes, lane);\n\n var _update = createRootErrorUpdate(workInProgress, _errorInfo, lane);\n\n enqueueCapturedUpdate(workInProgress, _update);\n return;\n }\n\n case ClassComponent:\n \u002F\u002F Capture and retry\n var errorInfo = value;\n var ctor = workInProgress.type;\n var instance = workInProgress.stateNode;\n\n if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) {\n workInProgress.flags |= ShouldCapture;\n\n var _lane = pickArbitraryLane(rootRenderLanes);\n\n workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); \u002F\u002F Schedule the error boundary to re-render using updated state\n\n var _update2 = createClassErrorUpdate(workInProgress, errorInfo, _lane);\n\n enqueueCapturedUpdate(workInProgress, _update2);\n return;\n }\n\n break;\n }\n\n workInProgress = workInProgress.return;\n } while (workInProgress !== null);\n}\n\nvar didWarnAboutUndefinedSnapshotBeforeUpdate = null;\n\n{\n didWarnAboutUndefinedSnapshotBeforeUpdate = new Set();\n}\n\nvar PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set;\n\nvar callComponentWillUnmountWithTimer = function (current, instance) {\n instance.props = current.memoizedProps;\n instance.state = current.memoizedState;\n\n {\n instance.componentWillUnmount();\n }\n}; \u002F\u002F Capture errors so they don't interrupt unmounting.\n\n\nfunction safelyCallComponentWillUnmount(current, instance) {\n {\n invokeGuardedCallback(null, callComponentWillUnmountWithTimer, null, current, instance);\n\n if (hasCaughtError()) {\n var unmountError = clearCaughtError();\n captureCommitPhaseError(current, unmountError);\n }\n }\n}\n\nfunction safelyDetachRef(current) {\n var ref = current.ref;\n\n if (ref !== null) {\n if (typeof ref === 'function') {\n {\n invokeGuardedCallback(null, ref, null, null);\n\n if (hasCaughtError()) {\n var refError = clearCaughtError();\n captureCommitPhaseError(current, refError);\n }\n }\n } else {\n ref.current = null;\n }\n }\n}\n\nfunction safelyCallDestroy(current, destroy) {\n {\n invokeGuardedCallback(null, destroy, null);\n\n if (hasCaughtError()) {\n var error = clearCaughtError();\n captureCommitPhaseError(current, error);\n }\n }\n}\n\nfunction commitBeforeMutationLifeCycles(current, finishedWork) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n return;\n }\n\n case ClassComponent:\n {\n if (finishedWork.flags & Snapshot) {\n if (current !== null) {\n var prevProps = current.memoizedProps;\n var prevState = current.memoizedState;\n var instance = finishedWork.stateNode; \u002F\u002F We could update instance props and state here,\n \u002F\u002F but instead we rely on them being set during last render.\n \u002F\u002F TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState);\n\n {\n var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate;\n\n if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {\n didWarnSet.add(finishedWork.type);\n\n error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentName(finishedWork.type));\n }\n }\n\n instance.__reactInternalSnapshotBeforeUpdate = snapshot;\n }\n }\n\n return;\n }\n\n case HostRoot:\n {\n {\n if (finishedWork.flags & Snapshot) {\n var root = finishedWork.stateNode;\n clearContainer(root.containerInfo);\n }\n }\n\n return;\n }\n\n case HostComponent:\n case HostText:\n case HostPortal:\n case IncompleteClassComponent:\n \u002F\u002F Nothing to do for these component types\n return;\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction commitHookEffectListUnmount(tag, finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & tag) === tag) {\n \u002F\u002F Unmount\n var destroy = effect.destroy;\n effect.destroy = undefined;\n\n if (destroy !== undefined) {\n destroy();\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitHookEffectListMount(tag, finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n if ((effect.tag & tag) === tag) {\n \u002F\u002F Mount\n var create = effect.create;\n effect.destroy = create();\n\n {\n var destroy = effect.destroy;\n\n if (destroy !== undefined && typeof destroy !== 'function') {\n var addendum = void 0;\n\n if (destroy === null) {\n addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).';\n } else if (typeof destroy.then === 'function') {\n addendum = '\\n\\nIt looks like you wrote useEffect(async () =\u003E ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\\n\\n' + 'useEffect(() =\u003E {\\n' + ' async function fetchData() {\\n' + ' \u002F\u002F You can await here\\n' + ' const response = await MyAPI.getData(someId);\\n' + ' \u002F\u002F ...\\n' + ' }\\n' + ' fetchData();\\n' + \"}, [someId]); \u002F\u002F Or [] if effect doesn't need props or state\\n\\n\" + 'Learn more about data fetching with Hooks: https:\u002F\u002Freactjs.org\u002Flink\u002Fhooks-data-fetching';\n } else {\n addendum = ' You returned: ' + destroy;\n }\n\n error('An effect function must not return anything besides a function, ' + 'which is used for clean-up.%s', addendum);\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction schedulePassiveEffects(finishedWork) {\n var updateQueue = finishedWork.updateQueue;\n var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n var _effect = effect,\n next = _effect.next,\n tag = _effect.tag;\n\n if ((tag & Passive$1) !== NoFlags$1 && (tag & HasEffect) !== NoFlags$1) {\n enqueuePendingPassiveHookEffectUnmount(finishedWork, effect);\n enqueuePendingPassiveHookEffectMount(finishedWork, effect);\n }\n\n effect = next;\n } while (effect !== firstEffect);\n }\n}\n\nfunction commitLifeCycles(finishedRoot, current, finishedWork, committedLanes) {\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n case Block:\n {\n \u002F\u002F At this point layout effects have already been destroyed (during mutation phase).\n \u002F\u002F This is done to prevent sibling component effects from interfering with each other,\n \u002F\u002F e.g. a destroy function in one component should never override a ref set\n \u002F\u002F by a create function in another component during the same commit.\n {\n commitHookEffectListMount(Layout | HasEffect, finishedWork);\n }\n\n schedulePassiveEffects(finishedWork);\n return;\n }\n\n case ClassComponent:\n {\n var instance = finishedWork.stateNode;\n\n if (finishedWork.flags & Update) {\n if (current === null) {\n \u002F\u002F We could update instance props and state here,\n \u002F\u002F but instead we rely on them being set during last render.\n \u002F\u002F TODO: revisit this when we implement resuming.\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n {\n instance.componentDidMount();\n }\n } else {\n var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps);\n var prevState = current.memoizedState; \u002F\u002F We could update instance props and state here,\n \u002F\u002F but instead we rely on them being set during last render.\n \u002F\u002F TODO: revisit this when we implement resuming.\n\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n }\n\n {\n instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate);\n }\n }\n } \u002F\u002F TODO: I think this is now always non-null by the time it reaches the\n \u002F\u002F commit phase. Consider removing the type check.\n\n\n var updateQueue = finishedWork.updateQueue;\n\n if (updateQueue !== null) {\n {\n if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) {\n if (instance.props !== finishedWork.memoizedProps) {\n error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n\n if (instance.state !== finishedWork.memoizedState) {\n error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentName(finishedWork.type) || 'instance');\n }\n }\n } \u002F\u002F We could update instance props and state here,\n \u002F\u002F but instead we rely on them being set during last render.\n \u002F\u002F TODO: revisit this when we implement resuming.\n\n\n commitUpdateQueue(finishedWork, updateQueue, instance);\n }\n\n return;\n }\n\n case HostRoot:\n {\n \u002F\u002F TODO: I think this is now always non-null by the time it reaches the\n \u002F\u002F commit phase. Consider removing the type check.\n var _updateQueue = finishedWork.updateQueue;\n\n if (_updateQueue !== null) {\n var _instance = null;\n\n if (finishedWork.child !== null) {\n switch (finishedWork.child.tag) {\n case HostComponent:\n _instance = getPublicInstance(finishedWork.child.stateNode);\n break;\n\n case ClassComponent:\n _instance = finishedWork.child.stateNode;\n break;\n }\n }\n\n commitUpdateQueue(finishedWork, _updateQueue, _instance);\n }\n\n return;\n }\n\n case HostComponent:\n {\n var _instance2 = finishedWork.stateNode; \u002F\u002F Renderers may schedule work to be done after host components are mounted\n \u002F\u002F (eg DOM renderer may schedule auto-focus for inputs and form controls).\n \u002F\u002F These effects should only be committed when components are first mounted,\n \u002F\u002F aka when there is no current\u002Falternate.\n\n if (current === null && finishedWork.flags & Update) {\n var type = finishedWork.type;\n var props = finishedWork.memoizedProps;\n commitMount(_instance2, type, props);\n }\n\n return;\n }\n\n case HostText:\n {\n \u002F\u002F We have no life-cycles associated with text.\n return;\n }\n\n case HostPortal:\n {\n \u002F\u002F We have no life-cycles associated with portals.\n return;\n }\n\n case Profiler:\n {\n {\n var _finishedWork$memoize2 = finishedWork.memoizedProps,\n onCommit = _finishedWork$memoize2.onCommit,\n onRender = _finishedWork$memoize2.onRender;\n var effectDuration = finishedWork.stateNode.effectDuration;\n var commitTime = getCommitTime();\n\n if (typeof onRender === 'function') {\n {\n onRender(finishedWork.memoizedProps.id, current === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime, finishedRoot.memoizedInteractions);\n }\n }\n }\n\n return;\n }\n\n case SuspenseComponent:\n {\n commitSuspenseHydrationCallbacks(finishedRoot, finishedWork);\n return;\n }\n\n case SuspenseListComponent:\n case IncompleteClassComponent:\n case FundamentalComponent:\n case ScopeComponent:\n case OffscreenComponent:\n case LegacyHiddenComponent:\n return;\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction hideOrUnhideAllChildren(finishedWork, isHidden) {\n {\n \u002F\u002F We only have the top Fiber that was inserted but we need to recurse down its\n \u002F\u002F children to find all the terminal nodes.\n var node = finishedWork;\n\n while (true) {\n if (node.tag === HostComponent) {\n var instance = node.stateNode;\n\n if (isHidden) {\n hideInstance(instance);\n } else {\n unhideInstance(node.stateNode, node.memoizedProps);\n }\n } else if (node.tag === HostText) {\n var _instance3 = node.stateNode;\n\n if (isHidden) {\n hideTextInstance(_instance3);\n } else {\n unhideTextInstance(_instance3, node.memoizedProps);\n }\n } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ; else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === finishedWork) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === finishedWork) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n}\n\nfunction commitAttachRef(finishedWork) {\n var ref = finishedWork.ref;\n\n if (ref !== null) {\n var instance = finishedWork.stateNode;\n var instanceToUse;\n\n switch (finishedWork.tag) {\n case HostComponent:\n instanceToUse = getPublicInstance(instance);\n break;\n\n default:\n instanceToUse = instance;\n } \u002F\u002F Moved outside to ensure DCE works with this flag\n\n if (typeof ref === 'function') {\n ref(instanceToUse);\n } else {\n {\n if (!ref.hasOwnProperty('current')) {\n error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentName(finishedWork.type));\n }\n }\n\n ref.current = instanceToUse;\n }\n }\n}\n\nfunction commitDetachRef(current) {\n var currentRef = current.ref;\n\n if (currentRef !== null) {\n if (typeof currentRef === 'function') {\n currentRef(null);\n } else {\n currentRef.current = null;\n }\n }\n} \u002F\u002F User-originating errors (lifecycles and refs) should not interrupt\n\u002F\u002F deletion, so don't let them throw. Host-originating errors should\n\u002F\u002F interrupt deletion, so it's okay\n\n\nfunction commitUnmount(finishedRoot, current, renderPriorityLevel) {\n onCommitUnmount(current);\n\n switch (current.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n case Block:\n {\n var updateQueue = current.updateQueue;\n\n if (updateQueue !== null) {\n var lastEffect = updateQueue.lastEffect;\n\n if (lastEffect !== null) {\n var firstEffect = lastEffect.next;\n var effect = firstEffect;\n\n do {\n var _effect2 = effect,\n destroy = _effect2.destroy,\n tag = _effect2.tag;\n\n if (destroy !== undefined) {\n if ((tag & Passive$1) !== NoFlags$1) {\n enqueuePendingPassiveHookEffectUnmount(current, effect);\n } else {\n {\n safelyCallDestroy(current, destroy);\n }\n }\n }\n\n effect = effect.next;\n } while (effect !== firstEffect);\n }\n }\n\n return;\n }\n\n case ClassComponent:\n {\n safelyDetachRef(current);\n var instance = current.stateNode;\n\n if (typeof instance.componentWillUnmount === 'function') {\n safelyCallComponentWillUnmount(current, instance);\n }\n\n return;\n }\n\n case HostComponent:\n {\n safelyDetachRef(current);\n return;\n }\n\n case HostPortal:\n {\n \u002F\u002F TODO: this is recursive.\n \u002F\u002F We are also not using this parent because\n \u002F\u002F the portal will get pushed immediately.\n {\n unmountHostComponents(finishedRoot, current);\n }\n\n return;\n }\n\n case FundamentalComponent:\n {\n\n return;\n }\n\n case DehydratedFragment:\n {\n\n return;\n }\n\n case ScopeComponent:\n {\n\n return;\n }\n }\n}\n\nfunction commitNestedUnmounts(finishedRoot, root, renderPriorityLevel) {\n \u002F\u002F While we're inside a removed host node we don't want to call\n \u002F\u002F removeChild on the inner nodes because they're removed by the top\n \u002F\u002F call anyway. We also want to call componentWillUnmount on all\n \u002F\u002F composites before this host node is removed from the tree. Therefore\n \u002F\u002F we do an inner loop while we're still inside the host node.\n var node = root;\n\n while (true) {\n commitUnmount(finishedRoot, node); \u002F\u002F Visit children because they may contain more composite or host nodes.\n \u002F\u002F Skip portals because commitUnmount() currently visits them recursively.\n\n if (node.child !== null && ( \u002F\u002F If we use mutation we drill down into portals using commitUnmount above.\n \u002F\u002F If we don't use mutation we drill down into portals here instead.\n node.tag !== HostPortal)) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === root) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === root) {\n return;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction detachFiberMutation(fiber) {\n \u002F\u002F Cut off the return pointers to disconnect it from the tree. Ideally, we\n \u002F\u002F should clear the child pointer of the parent alternate to let this\n \u002F\u002F get GC:ed but we don't know which for sure which parent is the current\n \u002F\u002F one so we'll settle for GC:ing the subtree of this child. This child\n \u002F\u002F itself will be GC:ed when the parent updates the next time.\n \u002F\u002F Note: we cannot null out sibling here, otherwise it can cause issues\n \u002F\u002F with findDOMNode and how it requires the sibling field to carry out\n \u002F\u002F traversal in a later effect. See PR #16820. We now clear the sibling\n \u002F\u002F field after effects, see: detachFiberAfterEffects.\n \u002F\u002F\n \u002F\u002F Don't disconnect stateNode now; it will be detached in detachFiberAfterEffects.\n \u002F\u002F It may be required if the current component is an error boundary,\n \u002F\u002F and one of its descendants throws while unmounting a passive effect.\n fiber.alternate = null;\n fiber.child = null;\n fiber.dependencies = null;\n fiber.firstEffect = null;\n fiber.lastEffect = null;\n fiber.memoizedProps = null;\n fiber.memoizedState = null;\n fiber.pendingProps = null;\n fiber.return = null;\n fiber.updateQueue = null;\n\n {\n fiber._debugOwner = null;\n }\n}\n\nfunction getHostParentFiber(fiber) {\n var parent = fiber.return;\n\n while (parent !== null) {\n if (isHostParent(parent)) {\n return parent;\n }\n\n parent = parent.return;\n }\n\n {\n {\n throw Error( \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction isHostParent(fiber) {\n return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal;\n}\n\nfunction getHostSibling(fiber) {\n \u002F\u002F We're going to search forward into the tree until we find a sibling host\n \u002F\u002F node. Unfortunately, if multiple insertions are done in a row we have to\n \u002F\u002F search past them. This leads to exponential search for the next sibling.\n \u002F\u002F TODO: Find a more efficient way to do this.\n var node = fiber;\n\n siblings: while (true) {\n \u002F\u002F If we didn't find anything, let's try the next sibling.\n while (node.sibling === null) {\n if (node.return === null || isHostParent(node.return)) {\n \u002F\u002F If we pop out of the root or hit the parent the fiber we are the\n \u002F\u002F last sibling.\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n\n while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) {\n \u002F\u002F If it is not host node and, we might have a host node inside it.\n \u002F\u002F Try to search down until we find one.\n if (node.flags & Placement) {\n \u002F\u002F If we don't have a child, try the siblings instead.\n continue siblings;\n } \u002F\u002F If we don't have a child, try the siblings instead.\n \u002F\u002F We also skip portals because they are not part of this host tree.\n\n\n if (node.child === null || node.tag === HostPortal) {\n continue siblings;\n } else {\n node.child.return = node;\n node = node.child;\n }\n } \u002F\u002F Check if this host node is stable or about to be placed.\n\n\n if (!(node.flags & Placement)) {\n \u002F\u002F Found it!\n return node.stateNode;\n }\n }\n}\n\nfunction commitPlacement(finishedWork) {\n\n\n var parentFiber = getHostParentFiber(finishedWork); \u002F\u002F Note: these two variables *must* always be updated together.\n\n var parent;\n var isContainer;\n var parentStateNode = parentFiber.stateNode;\n\n switch (parentFiber.tag) {\n case HostComponent:\n parent = parentStateNode;\n isContainer = false;\n break;\n\n case HostRoot:\n parent = parentStateNode.containerInfo;\n isContainer = true;\n break;\n\n case HostPortal:\n parent = parentStateNode.containerInfo;\n isContainer = true;\n break;\n\n case FundamentalComponent:\n\n \u002F\u002F eslint-disable-next-line-no-fallthrough\n\n default:\n {\n {\n throw Error( \"Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n }\n\n if (parentFiber.flags & ContentReset) {\n \u002F\u002F Reset the text content of the parent before doing any insertions\n resetTextContent(parent); \u002F\u002F Clear ContentReset from the effect tag\n\n parentFiber.flags &= ~ContentReset;\n }\n\n var before = getHostSibling(finishedWork); \u002F\u002F We only have the top Fiber that was inserted but we need to recurse down its\n \u002F\u002F children to find all the terminal nodes.\n\n if (isContainer) {\n insertOrAppendPlacementNodeIntoContainer(finishedWork, before, parent);\n } else {\n insertOrAppendPlacementNode(finishedWork, before, parent);\n }\n}\n\nfunction insertOrAppendPlacementNodeIntoContainer(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost || enableFundamentalAPI ) {\n var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n\n if (before) {\n insertInContainerBefore(parent, stateNode, before);\n } else {\n appendChildToContainer(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNodeIntoContainer(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n}\n\nfunction insertOrAppendPlacementNode(node, before, parent) {\n var tag = node.tag;\n var isHost = tag === HostComponent || tag === HostText;\n\n if (isHost || enableFundamentalAPI ) {\n var stateNode = isHost ? node.stateNode : node.stateNode.instance;\n\n if (before) {\n insertBefore(parent, stateNode, before);\n } else {\n appendChild(parent, stateNode);\n }\n } else if (tag === HostPortal) ; else {\n var child = node.child;\n\n if (child !== null) {\n insertOrAppendPlacementNode(child, before, parent);\n var sibling = child.sibling;\n\n while (sibling !== null) {\n insertOrAppendPlacementNode(sibling, before, parent);\n sibling = sibling.sibling;\n }\n }\n }\n}\n\nfunction unmountHostComponents(finishedRoot, current, renderPriorityLevel) {\n \u002F\u002F We only have the top Fiber that was deleted but we need to recurse down its\n \u002F\u002F children to find all the terminal nodes.\n var node = current; \u002F\u002F Each iteration, currentParent is populated with node's host parent if not\n \u002F\u002F currentParentIsValid.\n\n var currentParentIsValid = false; \u002F\u002F Note: these two variables *must* always be updated together.\n\n var currentParent;\n var currentParentIsContainer;\n\n while (true) {\n if (!currentParentIsValid) {\n var parent = node.return;\n\n findParent: while (true) {\n if (!(parent !== null)) {\n {\n throw Error( \"Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var parentStateNode = parent.stateNode;\n\n switch (parent.tag) {\n case HostComponent:\n currentParent = parentStateNode;\n currentParentIsContainer = false;\n break findParent;\n\n case HostRoot:\n currentParent = parentStateNode.containerInfo;\n currentParentIsContainer = true;\n break findParent;\n\n case HostPortal:\n currentParent = parentStateNode.containerInfo;\n currentParentIsContainer = true;\n break findParent;\n\n }\n\n parent = parent.return;\n }\n\n currentParentIsValid = true;\n }\n\n if (node.tag === HostComponent || node.tag === HostText) {\n commitNestedUnmounts(finishedRoot, node); \u002F\u002F After all the children have unmounted, it is now safe to remove the\n \u002F\u002F node from the tree.\n\n if (currentParentIsContainer) {\n removeChildFromContainer(currentParent, node.stateNode);\n } else {\n removeChild(currentParent, node.stateNode);\n } \u002F\u002F Don't visit children because we already visited them.\n\n } else if (node.tag === HostPortal) {\n if (node.child !== null) {\n \u002F\u002F When we go into a portal, it becomes the parent to remove from.\n \u002F\u002F We will reassign it back when we pop the portal on the way up.\n currentParent = node.stateNode.containerInfo;\n currentParentIsContainer = true; \u002F\u002F Visit children because portals might contain host components.\n\n node.child.return = node;\n node = node.child;\n continue;\n }\n } else {\n commitUnmount(finishedRoot, node); \u002F\u002F Visit children because we may find more host components below.\n\n if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n }\n\n if (node === current) {\n return;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === current) {\n return;\n }\n\n node = node.return;\n\n if (node.tag === HostPortal) {\n \u002F\u002F When we go out of the portal, we need to restore the parent.\n \u002F\u002F Since we don't keep a stack of them, we will search for it.\n currentParentIsValid = false;\n }\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n}\n\nfunction commitDeletion(finishedRoot, current, renderPriorityLevel) {\n {\n \u002F\u002F Recursively delete all host nodes from the parent.\n \u002F\u002F Detach refs and call componentWillUnmount() on the whole subtree.\n unmountHostComponents(finishedRoot, current);\n }\n\n var alternate = current.alternate;\n detachFiberMutation(current);\n\n if (alternate !== null) {\n detachFiberMutation(alternate);\n }\n}\n\nfunction commitWork(current, finishedWork) {\n\n switch (finishedWork.tag) {\n case FunctionComponent:\n case ForwardRef:\n case MemoComponent:\n case SimpleMemoComponent:\n case Block:\n {\n \u002F\u002F Layout effects are destroyed during the mutation phase so that all\n \u002F\u002F destroy functions for all fibers are called before any create functions.\n \u002F\u002F This prevents sibling component effects from interfering with each other,\n \u002F\u002F e.g. a destroy function in one component should never override a ref set\n \u002F\u002F by a create function in another component during the same commit.\n {\n commitHookEffectListUnmount(Layout | HasEffect, finishedWork);\n }\n\n return;\n }\n\n case ClassComponent:\n {\n return;\n }\n\n case HostComponent:\n {\n var instance = finishedWork.stateNode;\n\n if (instance != null) {\n \u002F\u002F Commit the work prepared earlier.\n var newProps = finishedWork.memoizedProps; \u002F\u002F For hydration we reuse the update path but we treat the oldProps\n \u002F\u002F as the newProps. The updatePayload will contain the real change in\n \u002F\u002F this case.\n\n var oldProps = current !== null ? current.memoizedProps : newProps;\n var type = finishedWork.type; \u002F\u002F TODO: Type the updateQueue to be specific to host components.\n\n var updatePayload = finishedWork.updateQueue;\n finishedWork.updateQueue = null;\n\n if (updatePayload !== null) {\n commitUpdate(instance, updatePayload, type, oldProps, newProps);\n }\n }\n\n return;\n }\n\n case HostText:\n {\n if (!(finishedWork.stateNode !== null)) {\n {\n throw Error( \"This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n\n var textInstance = finishedWork.stateNode;\n var newText = finishedWork.memoizedProps; \u002F\u002F For hydration we reuse the update path but we treat the oldProps\n \u002F\u002F as the newProps. The updatePayload will contain the real change in\n \u002F\u002F this case.\n\n var oldText = current !== null ? current.memoizedProps : newText;\n commitTextUpdate(textInstance, oldText, newText);\n return;\n }\n\n case HostRoot:\n {\n {\n var _root = finishedWork.stateNode;\n\n if (_root.hydrate) {\n \u002F\u002F We've just hydrated. No need to hydrate again.\n _root.hydrate = false;\n commitHydratedContainer(_root.containerInfo);\n }\n }\n\n return;\n }\n\n case Profiler:\n {\n return;\n }\n\n case SuspenseComponent:\n {\n commitSuspenseComponent(finishedWork);\n attachSuspenseRetryListeners(finishedWork);\n return;\n }\n\n case SuspenseListComponent:\n {\n attachSuspenseRetryListeners(finishedWork);\n return;\n }\n\n case IncompleteClassComponent:\n {\n return;\n }\n\n case FundamentalComponent:\n {\n\n break;\n }\n\n case ScopeComponent:\n {\n\n break;\n }\n\n case OffscreenComponent:\n case LegacyHiddenComponent:\n {\n var newState = finishedWork.memoizedState;\n var isHidden = newState !== null;\n hideOrUnhideAllChildren(finishedWork, isHidden);\n return;\n }\n }\n\n {\n {\n throw Error( \"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n}\n\nfunction commitSuspenseComponent(finishedWork) {\n var newState = finishedWork.memoizedState;\n\n if (newState !== null) {\n markCommitTimeOfFallback();\n\n {\n \u002F\u002F Hide the Offscreen component that contains the primary children. TODO:\n \u002F\u002F Ideally, this effect would have been scheduled on the Offscreen fiber\n \u002F\u002F itself. That's how unhiding works: the Offscreen component schedules an\n \u002F\u002F effect on itself. However, in this case, the component didn't complete,\n \u002F\u002F so the fiber was never added to the effect list in the normal path. We\n \u002F\u002F could have appended it to the effect list in the Suspense component's\n \u002F\u002F second pass, but doing it this way is less complicated. This would be\n \u002F\u002F simpler if we got rid of the effect list and traversed the tree, like\n \u002F\u002F we're planning to do.\n var primaryChildParent = finishedWork.child;\n hideOrUnhideAllChildren(primaryChildParent, true);\n }\n }\n}\n\nfunction commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) {\n\n var newState = finishedWork.memoizedState;\n\n if (newState === null) {\n var current = finishedWork.alternate;\n\n if (current !== null) {\n var prevState = current.memoizedState;\n\n if (prevState !== null) {\n var suspenseInstance = prevState.dehydrated;\n\n if (suspenseInstance !== null) {\n commitHydratedSuspenseInstance(suspenseInstance);\n }\n }\n }\n }\n}\n\nfunction attachSuspenseRetryListeners(finishedWork) {\n \u002F\u002F If this boundary just timed out, then it will have a set of wakeables.\n \u002F\u002F For each wakeable, attach a listener so that when it resolves, React\n \u002F\u002F attempts to re-render the boundary in the primary (pre-timeout) state.\n var wakeables = finishedWork.updateQueue;\n\n if (wakeables !== null) {\n finishedWork.updateQueue = null;\n var retryCache = finishedWork.stateNode;\n\n if (retryCache === null) {\n retryCache = finishedWork.stateNode = new PossiblyWeakSet();\n }\n\n wakeables.forEach(function (wakeable) {\n \u002F\u002F Memoize using the boundary fiber to prevent redundant listeners.\n var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable);\n\n if (!retryCache.has(wakeable)) {\n {\n if (wakeable.__reactDoNotTraceInteractions !== true) {\n retry = tracing.unstable_wrap(retry);\n }\n }\n\n retryCache.add(wakeable);\n wakeable.then(retry, retry);\n }\n });\n }\n} \u002F\u002F This function detects when a Suspense boundary goes from visible to hidden.\n\u002F\u002F It returns false if the boundary is already hidden.\n\u002F\u002F TODO: Use an effect tag.\n\n\nfunction isSuspenseBoundaryBeingHidden(current, finishedWork) {\n if (current !== null) {\n var oldState = current.memoizedState;\n\n if (oldState === null || oldState.dehydrated !== null) {\n var newState = finishedWork.memoizedState;\n return newState !== null && newState.dehydrated === null;\n }\n }\n\n return false;\n}\n\nfunction commitResetTextContent(current) {\n\n resetTextContent(current.stateNode);\n}\n\nvar COMPONENT_TYPE = 0;\nvar HAS_PSEUDO_CLASS_TYPE = 1;\nvar ROLE_TYPE = 2;\nvar TEST_NAME_TYPE = 3;\nvar TEXT_TYPE = 4;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor$1 = Symbol.for;\n COMPONENT_TYPE = symbolFor$1('selector.component');\n HAS_PSEUDO_CLASS_TYPE = symbolFor$1('selector.has_pseudo_class');\n ROLE_TYPE = symbolFor$1('selector.role');\n TEST_NAME_TYPE = symbolFor$1('selector.test_id');\n TEXT_TYPE = symbolFor$1('selector.text');\n}\nvar commitHooks = [];\nfunction onCommitRoot$1() {\n {\n commitHooks.forEach(function (commitHook) {\n return commitHook();\n });\n }\n}\n\nvar ceil = Math.ceil;\nvar ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher,\n ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner,\n IsSomeRendererActing = ReactSharedInternals.IsSomeRendererActing;\nvar NoContext =\n\u002F* *\u002F\n0;\nvar BatchedContext =\n\u002F* *\u002F\n1;\nvar EventContext =\n\u002F* *\u002F\n2;\nvar DiscreteEventContext =\n\u002F* *\u002F\n4;\nvar LegacyUnbatchedContext =\n\u002F* *\u002F\n8;\nvar RenderContext =\n\u002F* *\u002F\n16;\nvar CommitContext =\n\u002F* *\u002F\n32;\nvar RetryAfterError =\n\u002F* *\u002F\n64;\nvar RootIncomplete = 0;\nvar RootFatalErrored = 1;\nvar RootErrored = 2;\nvar RootSuspended = 3;\nvar RootSuspendedWithDelay = 4;\nvar RootCompleted = 5; \u002F\u002F Describes where we are in the React execution stack\n\nvar executionContext = NoContext; \u002F\u002F The root we're working on\n\nvar workInProgressRoot = null; \u002F\u002F The fiber we're working on\n\nvar workInProgress = null; \u002F\u002F The lanes we're rendering\n\nvar workInProgressRootRenderLanes = NoLanes; \u002F\u002F Stack that allows components to change the render lanes for its subtree\n\u002F\u002F This is a superset of the lanes we started working on at the root. The only\n\u002F\u002F case where it's different from `workInProgressRootRenderLanes` is when we\n\u002F\u002F enter a subtree that is hidden and needs to be unhidden: Suspense and\n\u002F\u002F Offscreen component.\n\u002F\u002F\n\u002F\u002F Most things in the work loop should deal with workInProgressRootRenderLanes.\n\u002F\u002F Most things in begin\u002Fcomplete phases should deal with subtreeRenderLanes.\n\nvar subtreeRenderLanes = NoLanes;\nvar subtreeRenderLanesCursor = createCursor(NoLanes); \u002F\u002F Whether to root completed, errored, suspended, etc.\n\nvar workInProgressRootExitStatus = RootIncomplete; \u002F\u002F A fatal error, if one is thrown\n\nvar workInProgressRootFatalError = null; \u002F\u002F \"Included\" lanes refer to lanes that were worked on during this render. It's\n\u002F\u002F slightly different than `renderLanes` because `renderLanes` can change as you\n\u002F\u002F enter and exit an Offscreen tree. This value is the combination of all render\n\u002F\u002F lanes for the entire render phase.\n\nvar workInProgressRootIncludedLanes = NoLanes; \u002F\u002F The work left over by components that were visited during this render. Only\n\u002F\u002F includes unprocessed updates, not work in bailed out children.\n\nvar workInProgressRootSkippedLanes = NoLanes; \u002F\u002F Lanes that were updated (in an interleaved event) during this render.\n\nvar workInProgressRootUpdatedLanes = NoLanes; \u002F\u002F Lanes that were pinged (in an interleaved event) during this render.\n\nvar workInProgressRootPingedLanes = NoLanes;\nvar mostRecentlyUpdatedRoot = null; \u002F\u002F The most recent time we committed a fallback. This lets us ensure a train\n\u002F\u002F model where we don't commit new loading states in too quick succession.\n\nvar globalMostRecentFallbackTime = 0;\nvar FALLBACK_THROTTLE_MS = 500; \u002F\u002F The absolute time for when we should start giving up on rendering\n\u002F\u002F more and prefer CPU suspense heuristics instead.\n\nvar workInProgressRootRenderTargetTime = Infinity; \u002F\u002F How long a render is supposed to take before we start following CPU\n\u002F\u002F suspense heuristics and opt out of rendering more content.\n\nvar RENDER_TIMEOUT_MS = 500;\n\nfunction resetRenderTimer() {\n workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS;\n}\n\nfunction getRenderTargetTime() {\n return workInProgressRootRenderTargetTime;\n}\nvar nextEffect = null;\nvar hasUncaughtError = false;\nvar firstUncaughtError = null;\nvar legacyErrorBoundariesThatAlreadyFailed = null;\nvar rootDoesHavePassiveEffects = false;\nvar rootWithPendingPassiveEffects = null;\nvar pendingPassiveEffectsRenderPriority = NoPriority$1;\nvar pendingPassiveEffectsLanes = NoLanes;\nvar pendingPassiveHookEffectsMount = [];\nvar pendingPassiveHookEffectsUnmount = [];\nvar rootsWithPendingDiscreteUpdates = null; \u002F\u002F Use these to prevent an infinite loop of nested updates\n\nvar NESTED_UPDATE_LIMIT = 50;\nvar nestedUpdateCount = 0;\nvar rootWithNestedUpdates = null;\nvar NESTED_PASSIVE_UPDATE_LIMIT = 50;\nvar nestedPassiveUpdateCount = 0; \u002F\u002F Marks the need to reschedule pending interactions at these lanes\n\u002F\u002F during the commit phase. This enables them to be traced across components\n\u002F\u002F that spawn new work during render. E.g. hidden boundaries, suspended SSR\n\u002F\u002F hydration or SuspenseList.\n\u002F\u002F TODO: Can use a bitmask instead of an array\n\nvar spawnedWorkDuringRender = null; \u002F\u002F If two updates are scheduled within the same event, we should treat their\n\u002F\u002F event times as simultaneous, even if the actual clock time has advanced\n\u002F\u002F between the first and second call.\n\nvar currentEventTime = NoTimestamp;\nvar currentEventWipLanes = NoLanes;\nvar currentEventPendingLanes = NoLanes; \u002F\u002F Dev only flag that tracks if passive effects are currently being flushed.\n\u002F\u002F We warn about state updates for unmounted components differently in this case.\n\nvar isFlushingPassiveEffects = false;\nvar focusedInstanceHandle = null;\nvar shouldFireAfterActiveInstanceBlur = false;\nfunction getWorkInProgressRoot() {\n return workInProgressRoot;\n}\nfunction requestEventTime() {\n if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {\n \u002F\u002F We're inside React, so it's fine to read the actual time.\n return now();\n } \u002F\u002F We're not inside React, so we may be in the middle of a browser event.\n\n\n if (currentEventTime !== NoTimestamp) {\n \u002F\u002F Use the same start time for all updates until we enter React again.\n return currentEventTime;\n } \u002F\u002F This is the first update since React yielded. Compute a new start time.\n\n\n currentEventTime = now();\n return currentEventTime;\n}\nfunction requestUpdateLane(fiber) {\n \u002F\u002F Special cases\n var mode = fiber.mode;\n\n if ((mode & BlockingMode) === NoMode) {\n return SyncLane;\n } else if ((mode & ConcurrentMode) === NoMode) {\n return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;\n } \u002F\u002F The algorithm for assigning an update to a lane should be stable for all\n \u002F\u002F updates at the same priority within the same event. To do this, the inputs\n \u002F\u002F to the algorithm must be the same. For example, we use the `renderLanes`\n \u002F\u002F to avoid choosing a lane that is already in the middle of rendering.\n \u002F\u002F\n \u002F\u002F However, the \"included\" lanes could be mutated in between updates in the\n \u002F\u002F same event, like if you perform an update inside `flushSync`. Or any other\n \u002F\u002F code path that might call `prepareFreshStack`.\n \u002F\u002F\n \u002F\u002F The trick we use is to cache the first of each of these inputs within an\n \u002F\u002F event. Then reset the cached values once we can be sure the event is over.\n \u002F\u002F Our heuristic for that is whenever we enter a concurrent work loop.\n \u002F\u002F\n \u002F\u002F We'll do the same for `currentEventPendingLanes` below.\n\n\n if (currentEventWipLanes === NoLanes) {\n currentEventWipLanes = workInProgressRootIncludedLanes;\n }\n\n var isTransition = requestCurrentTransition() !== NoTransition;\n\n if (isTransition) {\n if (currentEventPendingLanes !== NoLanes) {\n currentEventPendingLanes = mostRecentlyUpdatedRoot !== null ? mostRecentlyUpdatedRoot.pendingLanes : NoLanes;\n }\n\n return findTransitionLane(currentEventWipLanes, currentEventPendingLanes);\n } \u002F\u002F TODO: Remove this dependency on the Scheduler priority.\n \u002F\u002F To do that, we're replacing it with an update lane priority.\n\n\n var schedulerPriority = getCurrentPriorityLevel(); \u002F\u002F The old behavior was using the priority level of the Scheduler.\n \u002F\u002F This couples React to the Scheduler internals, so we're replacing it\n \u002F\u002F with the currentUpdateLanePriority above. As an example of how this\n \u002F\u002F could be problematic, if we're not inside `Scheduler.runWithPriority`,\n \u002F\u002F then we'll get the priority of the current running Scheduler task,\n \u002F\u002F which is probably not what we want.\n\n var lane;\n\n if ( \u002F\u002F TODO: Temporary. We're removing the concept of discrete updates.\n (executionContext & DiscreteEventContext) !== NoContext && schedulerPriority === UserBlockingPriority$2) {\n lane = findUpdateLane(InputDiscreteLanePriority, currentEventWipLanes);\n } else {\n var schedulerLanePriority = schedulerPriorityToLanePriority(schedulerPriority);\n\n lane = findUpdateLane(schedulerLanePriority, currentEventWipLanes);\n }\n\n return lane;\n}\n\nfunction requestRetryLane(fiber) {\n \u002F\u002F This is a fork of `requestUpdateLane` designed specifically for Suspense\n \u002F\u002F \"retries\" — a special update that attempts to flip a Suspense boundary\n \u002F\u002F from its placeholder state to its primary\u002Fresolved state.\n \u002F\u002F Special cases\n var mode = fiber.mode;\n\n if ((mode & BlockingMode) === NoMode) {\n return SyncLane;\n } else if ((mode & ConcurrentMode) === NoMode) {\n return getCurrentPriorityLevel() === ImmediatePriority$1 ? SyncLane : SyncBatchedLane;\n } \u002F\u002F See `requestUpdateLane` for explanation of `currentEventWipLanes`\n\n\n if (currentEventWipLanes === NoLanes) {\n currentEventWipLanes = workInProgressRootIncludedLanes;\n }\n\n return findRetryLane(currentEventWipLanes);\n}\n\nfunction scheduleUpdateOnFiber(fiber, lane, eventTime) {\n checkForNestedUpdates();\n warnAboutRenderPhaseUpdatesInDEV(fiber);\n var root = markUpdateLaneFromFiberToRoot(fiber, lane);\n\n if (root === null) {\n warnAboutUpdateOnUnmountedFiberInDEV(fiber);\n return null;\n } \u002F\u002F Mark that the root has a pending update.\n\n\n markRootUpdated(root, lane, eventTime);\n\n if (root === workInProgressRoot) {\n \u002F\u002F Received an update to a tree that's in the middle of rendering. Mark\n \u002F\u002F that there was an interleaved update work on this root. Unless the\n \u002F\u002F `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render\n \u002F\u002F phase update. In that case, we don't treat render phase updates as if\n \u002F\u002F they were interleaved, for backwards compat reasons.\n {\n workInProgressRootUpdatedLanes = mergeLanes(workInProgressRootUpdatedLanes, lane);\n }\n\n if (workInProgressRootExitStatus === RootSuspendedWithDelay) {\n \u002F\u002F The root already suspended with a delay, which means this render\n \u002F\u002F definitely won't finish. Since we have a new update, let's mark it as\n \u002F\u002F suspended now, right before marking the incoming update. This has the\n \u002F\u002F effect of interrupting the current render and switching to the update.\n \u002F\u002F TODO: Make sure this doesn't override pings that happen while we've\n \u002F\u002F already started rendering.\n markRootSuspended$1(root, workInProgressRootRenderLanes);\n }\n } \u002F\u002F TODO: requestUpdateLanePriority also reads the priority. Pass the\n \u002F\u002F priority as an argument to that function and this one.\n\n\n var priorityLevel = getCurrentPriorityLevel();\n\n if (lane === SyncLane) {\n if ( \u002F\u002F Check if we're inside unbatchedUpdates\n (executionContext & LegacyUnbatchedContext) !== NoContext && \u002F\u002F Check if we're not already rendering\n (executionContext & (RenderContext | CommitContext)) === NoContext) {\n \u002F\u002F Register pending interactions on the root to avoid losing traced interaction data.\n schedulePendingInteractions(root, lane); \u002F\u002F This is a legacy edge case. The initial mount of a ReactDOM.render-ed\n \u002F\u002F root inside of batchedUpdates should be synchronous, but layout updates\n \u002F\u002F should be deferred until the end of the batch.\n\n performSyncWorkOnRoot(root);\n } else {\n ensureRootIsScheduled(root, eventTime);\n schedulePendingInteractions(root, lane);\n\n if (executionContext === NoContext) {\n \u002F\u002F Flush the synchronous work now, unless we're already working or inside\n \u002F\u002F a batch. This is intentionally inside scheduleUpdateOnFiber instead of\n \u002F\u002F scheduleCallbackForFiber to preserve the ability to schedule a callback\n \u002F\u002F without immediately flushing it. We only do this for user-initiated\n \u002F\u002F updates, to preserve historical behavior of legacy mode.\n resetRenderTimer();\n flushSyncCallbackQueue();\n }\n }\n } else {\n \u002F\u002F Schedule a discrete update but only if it's not Sync.\n if ((executionContext & DiscreteEventContext) !== NoContext && ( \u002F\u002F Only updates at user-blocking priority or greater are considered\n \u002F\u002F discrete, even inside a discrete event.\n priorityLevel === UserBlockingPriority$2 || priorityLevel === ImmediatePriority$1)) {\n \u002F\u002F This is the result of a discrete event. Track the lowest priority\n \u002F\u002F discrete update per root so we can flush them early, if needed.\n if (rootsWithPendingDiscreteUpdates === null) {\n rootsWithPendingDiscreteUpdates = new Set([root]);\n } else {\n rootsWithPendingDiscreteUpdates.add(root);\n }\n } \u002F\u002F Schedule other updates after in case the callback is sync.\n\n\n ensureRootIsScheduled(root, eventTime);\n schedulePendingInteractions(root, lane);\n } \u002F\u002F We use this when assigning a lane for a transition inside\n \u002F\u002F `requestUpdateLane`. We assume it's the same as the root being updated,\n \u002F\u002F since in the common case of a single root app it probably is. If it's not\n \u002F\u002F the same root, then it's not a huge deal, we just might batch more stuff\n \u002F\u002F together more than necessary.\n\n\n mostRecentlyUpdatedRoot = root;\n} \u002F\u002F This is split into a separate function so we can mark a fiber with pending\n\u002F\u002F work without treating it as a typical update that originates from an event;\n\u002F\u002F e.g. retrying a Suspense boundary isn't an update, but it does schedule work\n\u002F\u002F on a fiber.\n\nfunction markUpdateLaneFromFiberToRoot(sourceFiber, lane) {\n \u002F\u002F Update the source fiber's lanes\n sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane);\n var alternate = sourceFiber.alternate;\n\n if (alternate !== null) {\n alternate.lanes = mergeLanes(alternate.lanes, lane);\n }\n\n {\n if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) {\n warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);\n }\n } \u002F\u002F Walk the parent path to the root and update the child expiration time.\n\n\n var node = sourceFiber;\n var parent = sourceFiber.return;\n\n while (parent !== null) {\n parent.childLanes = mergeLanes(parent.childLanes, lane);\n alternate = parent.alternate;\n\n if (alternate !== null) {\n alternate.childLanes = mergeLanes(alternate.childLanes, lane);\n } else {\n {\n if ((parent.flags & (Placement | Hydrating)) !== NoFlags) {\n warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber);\n }\n }\n }\n\n node = parent;\n parent = parent.return;\n }\n\n if (node.tag === HostRoot) {\n var root = node.stateNode;\n return root;\n } else {\n return null;\n }\n} \u002F\u002F Use this function to schedule a task for a root. There's only one task per\n\u002F\u002F root; if a task was already scheduled, we'll check to make sure the priority\n\u002F\u002F of the existing task is the same as the priority of the next level that the\n\u002F\u002F root has work on. This function is called on every update, and right before\n\u002F\u002F exiting a task.\n\n\nfunction ensureRootIsScheduled(root, currentTime) {\n var existingCallbackNode = root.callbackNode; \u002F\u002F Check if any lanes are being starved by other work. If so, mark them as\n \u002F\u002F expired so we know to work on those next.\n\n markStarvedLanesAsExpired(root, currentTime); \u002F\u002F Determine the next lanes to work on, and their priority.\n\n var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); \u002F\u002F This returns the priority level computed during the `getNextLanes` call.\n\n var newCallbackPriority = returnNextLanesPriority();\n\n if (nextLanes === NoLanes) {\n \u002F\u002F Special case: There's nothing to work on.\n if (existingCallbackNode !== null) {\n cancelCallback(existingCallbackNode);\n root.callbackNode = null;\n root.callbackPriority = NoLanePriority;\n }\n\n return;\n } \u002F\u002F Check if there's an existing task. We may be able to reuse it.\n\n\n if (existingCallbackNode !== null) {\n var existingCallbackPriority = root.callbackPriority;\n\n if (existingCallbackPriority === newCallbackPriority) {\n \u002F\u002F The priority hasn't changed. We can reuse the existing task. Exit.\n return;\n } \u002F\u002F The priority changed. Cancel the existing callback. We'll schedule a new\n \u002F\u002F one below.\n\n\n cancelCallback(existingCallbackNode);\n } \u002F\u002F Schedule a new callback.\n\n\n var newCallbackNode;\n\n if (newCallbackPriority === SyncLanePriority) {\n \u002F\u002F Special case: Sync React callbacks are scheduled on a special\n \u002F\u002F internal queue\n newCallbackNode = scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root));\n } else if (newCallbackPriority === SyncBatchedLanePriority) {\n newCallbackNode = scheduleCallback(ImmediatePriority$1, performSyncWorkOnRoot.bind(null, root));\n } else {\n var schedulerPriorityLevel = lanePriorityToSchedulerPriority(newCallbackPriority);\n newCallbackNode = scheduleCallback(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root));\n }\n\n root.callbackPriority = newCallbackPriority;\n root.callbackNode = newCallbackNode;\n} \u002F\u002F This is the entry point for every concurrent task, i.e. anything that\n\u002F\u002F goes through Scheduler.\n\n\nfunction performConcurrentWorkOnRoot(root) {\n \u002F\u002F Since we know we're in a React event, we can clear the current\n \u002F\u002F event time. The next update will compute a new event time.\n currentEventTime = NoTimestamp;\n currentEventWipLanes = NoLanes;\n currentEventPendingLanes = NoLanes;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n } \u002F\u002F Flush any pending passive effects before deciding which lanes to work on,\n \u002F\u002F in case they schedule additional work.\n\n\n var originalCallbackNode = root.callbackNode;\n var didFlushPassiveEffects = flushPassiveEffects();\n\n if (didFlushPassiveEffects) {\n \u002F\u002F Something in the passive effect phase may have canceled the current task.\n \u002F\u002F Check if the task node for this root was changed.\n if (root.callbackNode !== originalCallbackNode) {\n \u002F\u002F The current task was canceled. Exit. We don't need to call\n \u002F\u002F `ensureRootIsScheduled` because the check above implies either that\n \u002F\u002F there's a new task, or that there's no remaining work on this root.\n return null;\n }\n } \u002F\u002F Determine the next expiration time to work on, using the fields stored\n \u002F\u002F on the root.\n\n\n var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);\n\n if (lanes === NoLanes) {\n \u002F\u002F Defensive coding. This is never expected to happen.\n return null;\n }\n\n var exitStatus = renderRootConcurrent(root, lanes);\n\n if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {\n \u002F\u002F The render included lanes that were updated during the render phase.\n \u002F\u002F For example, when unhiding a hidden tree, we include all the lanes\n \u002F\u002F that were previously skipped when the tree was hidden. That set of\n \u002F\u002F lanes is a superset of the lanes we started rendering with.\n \u002F\u002F\n \u002F\u002F So we'll throw out the current work and restart.\n prepareFreshStack(root, NoLanes);\n } else if (exitStatus !== RootIncomplete) {\n if (exitStatus === RootErrored) {\n executionContext |= RetryAfterError; \u002F\u002F If an error occurred during hydration,\n \u002F\u002F discard server response and fall back to client side render.\n\n if (root.hydrate) {\n root.hydrate = false;\n clearContainer(root.containerInfo);\n } \u002F\u002F If something threw an error, try rendering one more time. We'll render\n \u002F\u002F synchronously to block concurrent data mutations, and we'll includes\n \u002F\u002F all pending updates are included. If it still fails after the second\n \u002F\u002F attempt, we'll give up and commit the resulting tree.\n\n\n lanes = getLanesToRetrySynchronouslyOnError(root);\n\n if (lanes !== NoLanes) {\n exitStatus = renderRootSync(root, lanes);\n }\n }\n\n if (exitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw fatalError;\n } \u002F\u002F We now have a consistent tree. The next step is either to commit it,\n \u002F\u002F or, if something suspended, wait to commit it after a timeout.\n\n\n var finishedWork = root.current.alternate;\n root.finishedWork = finishedWork;\n root.finishedLanes = lanes;\n finishConcurrentRender(root, exitStatus, lanes);\n }\n\n ensureRootIsScheduled(root, now());\n\n if (root.callbackNode === originalCallbackNode) {\n \u002F\u002F The task node scheduled for this root is the same one that's\n \u002F\u002F currently executed. Need to return a continuation.\n return performConcurrentWorkOnRoot.bind(null, root);\n }\n\n return null;\n}\n\nfunction finishConcurrentRender(root, exitStatus, lanes) {\n switch (exitStatus) {\n case RootIncomplete:\n case RootFatalErrored:\n {\n {\n {\n throw Error( \"Root did not complete. This is a bug in React.\" );\n }\n }\n }\n \u002F\u002F Flow knows about invariant, so it complains if I add a break\n \u002F\u002F statement, but eslint doesn't know about invariant, so it complains\n \u002F\u002F if I do. eslint-disable-next-line no-fallthrough\n\n case RootErrored:\n {\n \u002F\u002F We should have already attempted to retry this tree. If we reached\n \u002F\u002F this point, it errored again. Commit it.\n commitRoot(root);\n break;\n }\n\n case RootSuspended:\n {\n markRootSuspended$1(root, lanes); \u002F\u002F We have an acceptable loading state. We need to figure out if we\n \u002F\u002F should immediately commit it or wait a bit.\n\n if (includesOnlyRetries(lanes) && \u002F\u002F do not delay if we're inside an act() scope\n !shouldForceFlushFallbacksInDEV()) {\n \u002F\u002F This render only included retries, no updates. Throttle committing\n \u002F\u002F retries so that we don't show too many loading states too quickly.\n var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); \u002F\u002F Don't bother with a very short suspense time.\n\n if (msUntilTimeout \u003E 10) {\n var nextLanes = getNextLanes(root, NoLanes);\n\n if (nextLanes !== NoLanes) {\n \u002F\u002F There's additional work on this root.\n break;\n }\n\n var suspendedLanes = root.suspendedLanes;\n\n if (!isSubsetOfLanes(suspendedLanes, lanes)) {\n \u002F\u002F We should prefer to render the fallback of at the last\n \u002F\u002F suspended level. Ping the last suspended level to try\n \u002F\u002F rendering it again.\n \u002F\u002F FIXME: What if the suspended lanes are Idle? Should not restart.\n var eventTime = requestEventTime();\n markRootPinged(root, suspendedLanes);\n break;\n } \u002F\u002F The render is suspended, it hasn't timed out, and there's no\n \u002F\u002F lower priority work to do. Instead of committing the fallback\n \u002F\u002F immediately, wait for more data to arrive.\n\n\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), msUntilTimeout);\n break;\n }\n } \u002F\u002F The work expired. Commit immediately.\n\n\n commitRoot(root);\n break;\n }\n\n case RootSuspendedWithDelay:\n {\n markRootSuspended$1(root, lanes);\n\n if (includesOnlyTransitions(lanes)) {\n \u002F\u002F This is a transition, so we should exit without committing a\n \u002F\u002F placeholder and without scheduling a timeout. Delay indefinitely\n \u002F\u002F until we receive more data.\n break;\n }\n\n if (!shouldForceFlushFallbacksInDEV()) {\n \u002F\u002F This is not a transition, but we did trigger an avoided state.\n \u002F\u002F Schedule a placeholder to display after a short delay, using the Just\n \u002F\u002F Noticeable Difference.\n \u002F\u002F TODO: Is the JND optimization worth the added complexity? If this is\n \u002F\u002F the only reason we track the event time, then probably not.\n \u002F\u002F Consider removing.\n var mostRecentEventTime = getMostRecentEventTime(root, lanes);\n var eventTimeMs = mostRecentEventTime;\n var timeElapsedMs = now() - eventTimeMs;\n\n var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; \u002F\u002F Don't bother with a very short suspense time.\n\n\n if (_msUntilTimeout \u003E 10) {\n \u002F\u002F Instead of committing the fallback immediately, wait for more data\n \u002F\u002F to arrive.\n root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), _msUntilTimeout);\n break;\n }\n } \u002F\u002F Commit the placeholder.\n\n\n commitRoot(root);\n break;\n }\n\n case RootCompleted:\n {\n \u002F\u002F The work completed. Ready to commit.\n commitRoot(root);\n break;\n }\n\n default:\n {\n {\n {\n throw Error( \"Unknown root exit status.\" );\n }\n }\n }\n }\n}\n\nfunction markRootSuspended$1(root, suspendedLanes) {\n \u002F\u002F When suspending, we should always exclude lanes that were pinged or (more\n \u002F\u002F rarely, since we try to avoid it) updated during the render phase.\n \u002F\u002F TODO: Lol maybe there's a better way to factor this besides this\n \u002F\u002F obnoxiously named function :)\n suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes);\n suspendedLanes = removeLanes(suspendedLanes, workInProgressRootUpdatedLanes);\n markRootSuspended(root, suspendedLanes);\n} \u002F\u002F This is the entry point for synchronous tasks that don't go\n\u002F\u002F through Scheduler\n\n\nfunction performSyncWorkOnRoot(root) {\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n flushPassiveEffects();\n var lanes;\n var exitStatus;\n\n if (root === workInProgressRoot && includesSomeLane(root.expiredLanes, workInProgressRootRenderLanes)) {\n \u002F\u002F There's a partial tree, and at least one of its lanes has expired. Finish\n \u002F\u002F rendering it before rendering the rest of the expired work.\n lanes = workInProgressRootRenderLanes;\n exitStatus = renderRootSync(root, lanes);\n\n if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {\n \u002F\u002F The render included lanes that were updated during the render phase.\n \u002F\u002F For example, when unhiding a hidden tree, we include all the lanes\n \u002F\u002F that were previously skipped when the tree was hidden. That set of\n \u002F\u002F lanes is a superset of the lanes we started rendering with.\n \u002F\u002F\n \u002F\u002F Note that this only happens when part of the tree is rendered\n \u002F\u002F concurrently. If the whole tree is rendered synchronously, then there\n \u002F\u002F are no interleaved events.\n lanes = getNextLanes(root, lanes);\n exitStatus = renderRootSync(root, lanes);\n }\n } else {\n lanes = getNextLanes(root, NoLanes);\n exitStatus = renderRootSync(root, lanes);\n }\n\n if (root.tag !== LegacyRoot && exitStatus === RootErrored) {\n executionContext |= RetryAfterError; \u002F\u002F If an error occurred during hydration,\n \u002F\u002F discard server response and fall back to client side render.\n\n if (root.hydrate) {\n root.hydrate = false;\n clearContainer(root.containerInfo);\n } \u002F\u002F If something threw an error, try rendering one more time. We'll render\n \u002F\u002F synchronously to block concurrent data mutations, and we'll includes\n \u002F\u002F all pending updates are included. If it still fails after the second\n \u002F\u002F attempt, we'll give up and commit the resulting tree.\n\n\n lanes = getLanesToRetrySynchronouslyOnError(root);\n\n if (lanes !== NoLanes) {\n exitStatus = renderRootSync(root, lanes);\n }\n }\n\n if (exitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw fatalError;\n } \u002F\u002F We now have a consistent tree. Because this is a sync render, we\n \u002F\u002F will commit it even if something suspended.\n\n\n var finishedWork = root.current.alternate;\n root.finishedWork = finishedWork;\n root.finishedLanes = lanes;\n commitRoot(root); \u002F\u002F Before exiting, make sure there's a callback scheduled for the next\n \u002F\u002F pending level.\n\n ensureRootIsScheduled(root, now());\n return null;\n}\nfunction flushDiscreteUpdates() {\n \u002F\u002F TODO: Should be able to flush inside batchedUpdates, but not inside `act`.\n \u002F\u002F However, `act` uses `batchedUpdates`, so there's no way to distinguish\n \u002F\u002F those two cases. Need to fix this before exposing flushDiscreteUpdates\n \u002F\u002F as a public API.\n if ((executionContext & (BatchedContext | RenderContext | CommitContext)) !== NoContext) {\n {\n if ((executionContext & RenderContext) !== NoContext) {\n error('unstable_flushDiscreteUpdates: Cannot flush updates when React is ' + 'already rendering.');\n }\n } \u002F\u002F We're already rendering, so we can't synchronously flush pending work.\n \u002F\u002F This is probably a nested event dispatch triggered by a lifecycle\u002Feffect,\n \u002F\u002F like `el.focus()`. Exit.\n\n\n return;\n }\n\n flushPendingDiscreteUpdates(); \u002F\u002F If the discrete updates scheduled passive effects, flush them now so that\n \u002F\u002F they fire before the next serial event.\n\n flushPassiveEffects();\n}\n\nfunction flushPendingDiscreteUpdates() {\n if (rootsWithPendingDiscreteUpdates !== null) {\n \u002F\u002F For each root with pending discrete updates, schedule a callback to\n \u002F\u002F immediately flush them.\n var roots = rootsWithPendingDiscreteUpdates;\n rootsWithPendingDiscreteUpdates = null;\n roots.forEach(function (root) {\n markDiscreteUpdatesExpired(root);\n ensureRootIsScheduled(root, now());\n });\n } \u002F\u002F Now flush the immediate queue.\n\n\n flushSyncCallbackQueue();\n}\n\nfunction batchedUpdates$1(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext |= BatchedContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n \u002F\u002F Flush the immediate callbacks that were scheduled during this batch\n resetRenderTimer();\n flushSyncCallbackQueue();\n }\n }\n}\nfunction batchedEventUpdates$1(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext |= EventContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n \u002F\u002F Flush the immediate callbacks that were scheduled during this batch\n resetRenderTimer();\n flushSyncCallbackQueue();\n }\n }\n}\nfunction discreteUpdates$1(fn, a, b, c, d) {\n var prevExecutionContext = executionContext;\n executionContext |= DiscreteEventContext;\n\n {\n try {\n return runWithPriority$1(UserBlockingPriority$2, fn.bind(null, a, b, c, d));\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n \u002F\u002F Flush the immediate callbacks that were scheduled during this batch\n resetRenderTimer();\n flushSyncCallbackQueue();\n }\n }\n }\n}\nfunction unbatchedUpdates(fn, a) {\n var prevExecutionContext = executionContext;\n executionContext &= ~BatchedContext;\n executionContext |= LegacyUnbatchedContext;\n\n try {\n return fn(a);\n } finally {\n executionContext = prevExecutionContext;\n\n if (executionContext === NoContext) {\n \u002F\u002F Flush the immediate callbacks that were scheduled during this batch\n resetRenderTimer();\n flushSyncCallbackQueue();\n }\n }\n}\nfunction flushSync(fn, a) {\n var prevExecutionContext = executionContext;\n\n if ((prevExecutionContext & (RenderContext | CommitContext)) !== NoContext) {\n {\n error('flushSync was called from inside a lifecycle method. React cannot ' + 'flush when React is already rendering. Consider moving this call to ' + 'a scheduler task or micro task.');\n }\n\n return fn(a);\n }\n\n executionContext |= BatchedContext;\n\n {\n try {\n if (fn) {\n return runWithPriority$1(ImmediatePriority$1, fn.bind(null, a));\n } else {\n return undefined;\n }\n } finally {\n executionContext = prevExecutionContext; \u002F\u002F Flush the immediate callbacks that were scheduled during this batch.\n \u002F\u002F Note that this will happen even if batchedUpdates is higher up\n \u002F\u002F the stack.\n\n flushSyncCallbackQueue();\n }\n }\n}\nfunction pushRenderLanes(fiber, lanes) {\n push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber);\n subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes);\n workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes);\n}\nfunction popRenderLanes(fiber) {\n subtreeRenderLanes = subtreeRenderLanesCursor.current;\n pop(subtreeRenderLanesCursor, fiber);\n}\n\nfunction prepareFreshStack(root, lanes) {\n root.finishedWork = null;\n root.finishedLanes = NoLanes;\n var timeoutHandle = root.timeoutHandle;\n\n if (timeoutHandle !== noTimeout) {\n \u002F\u002F The root previous suspended and scheduled a timeout to commit a fallback\n \u002F\u002F state. Now that we have additional work, cancel the timeout.\n root.timeoutHandle = noTimeout; \u002F\u002F $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above\n\n cancelTimeout(timeoutHandle);\n }\n\n if (workInProgress !== null) {\n var interruptedWork = workInProgress.return;\n\n while (interruptedWork !== null) {\n unwindInterruptedWork(interruptedWork);\n interruptedWork = interruptedWork.return;\n }\n }\n\n workInProgressRoot = root;\n workInProgress = createWorkInProgress(root.current, null);\n workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes;\n workInProgressRootExitStatus = RootIncomplete;\n workInProgressRootFatalError = null;\n workInProgressRootSkippedLanes = NoLanes;\n workInProgressRootUpdatedLanes = NoLanes;\n workInProgressRootPingedLanes = NoLanes;\n\n {\n spawnedWorkDuringRender = null;\n }\n\n {\n ReactStrictModeWarnings.discardPendingWarnings();\n }\n}\n\nfunction handleError(root, thrownValue) {\n do {\n var erroredWork = workInProgress;\n\n try {\n \u002F\u002F Reset module-level state that was set during the render phase.\n resetContextDependencies();\n resetHooksAfterThrow();\n resetCurrentFiber(); \u002F\u002F TODO: I found and added this missing line while investigating a\n \u002F\u002F separate issue. Write a regression test using string refs.\n\n ReactCurrentOwner$2.current = null;\n\n if (erroredWork === null || erroredWork.return === null) {\n \u002F\u002F Expected to be working on a non-root fiber. This is a fatal error\n \u002F\u002F because there's no ancestor that can handle it; the root is\n \u002F\u002F supposed to capture all errors that weren't caught by an error\n \u002F\u002F boundary.\n workInProgressRootExitStatus = RootFatalErrored;\n workInProgressRootFatalError = thrownValue; \u002F\u002F Set `workInProgress` to null. This represents advancing to the next\n \u002F\u002F sibling, or the parent if there are no siblings. But since the root\n \u002F\u002F has no siblings nor a parent, we set it to null. Usually this is\n \u002F\u002F handled by `completeUnitOfWork` or `unwindWork`, but since we're\n \u002F\u002F intentionally not calling those, we need set it here.\n \u002F\u002F TODO: Consider calling `unwindWork` to pop the contexts.\n\n workInProgress = null;\n return;\n }\n\n if (enableProfilerTimer && erroredWork.mode & ProfileMode) {\n \u002F\u002F Record the time spent rendering before an error was thrown. This\n \u002F\u002F avoids inaccurate Profiler durations in the case of a\n \u002F\u002F suspended render.\n stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true);\n }\n\n throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes);\n completeUnitOfWork(erroredWork);\n } catch (yetAnotherThrownValue) {\n \u002F\u002F Something in the return path also threw.\n thrownValue = yetAnotherThrownValue;\n\n if (workInProgress === erroredWork && erroredWork !== null) {\n \u002F\u002F If this boundary has already errored, then we had trouble processing\n \u002F\u002F the error. Bubble it to the next boundary.\n erroredWork = erroredWork.return;\n workInProgress = erroredWork;\n } else {\n erroredWork = workInProgress;\n }\n\n continue;\n } \u002F\u002F Return to the normal work loop.\n\n\n return;\n } while (true);\n}\n\nfunction pushDispatcher() {\n var prevDispatcher = ReactCurrentDispatcher$2.current;\n ReactCurrentDispatcher$2.current = ContextOnlyDispatcher;\n\n if (prevDispatcher === null) {\n \u002F\u002F The React isomorphic package does not include a default dispatcher.\n \u002F\u002F Instead the first renderer will lazily attach one, in order to give\n \u002F\u002F nicer error messages.\n return ContextOnlyDispatcher;\n } else {\n return prevDispatcher;\n }\n}\n\nfunction popDispatcher(prevDispatcher) {\n ReactCurrentDispatcher$2.current = prevDispatcher;\n}\n\nfunction pushInteractions(root) {\n {\n var prevInteractions = tracing.__interactionsRef.current;\n tracing.__interactionsRef.current = root.memoizedInteractions;\n return prevInteractions;\n }\n}\n\nfunction popInteractions(prevInteractions) {\n {\n tracing.__interactionsRef.current = prevInteractions;\n }\n}\n\nfunction markCommitTimeOfFallback() {\n globalMostRecentFallbackTime = now();\n}\nfunction markSkippedUpdateLanes(lane) {\n workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);\n}\nfunction renderDidSuspend() {\n if (workInProgressRootExitStatus === RootIncomplete) {\n workInProgressRootExitStatus = RootSuspended;\n }\n}\nfunction renderDidSuspendDelayIfPossible() {\n if (workInProgressRootExitStatus === RootIncomplete || workInProgressRootExitStatus === RootSuspended) {\n workInProgressRootExitStatus = RootSuspendedWithDelay;\n } \u002F\u002F Check if there are updates that we skipped tree that might have unblocked\n \u002F\u002F this render.\n\n\n if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootUpdatedLanes))) {\n \u002F\u002F Mark the current render as suspended so that we switch to working on\n \u002F\u002F the updates that were skipped. Usually we only suspend at the end of\n \u002F\u002F the render phase.\n \u002F\u002F TODO: We should probably always mark the root as suspended immediately\n \u002F\u002F (inside this function), since by suspending at the end of the render\n \u002F\u002F phase introduces a potential mistake where we suspend lanes that were\n \u002F\u002F pinged or updated while we were rendering.\n markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes);\n }\n}\nfunction renderDidError() {\n if (workInProgressRootExitStatus !== RootCompleted) {\n workInProgressRootExitStatus = RootErrored;\n }\n} \u002F\u002F Called during render to determine if anything has suspended.\n\u002F\u002F Returns false if we're not sure.\n\nfunction renderHasNotSuspendedYet() {\n \u002F\u002F If something errored or completed, we can't really be sure,\n \u002F\u002F so those are false.\n return workInProgressRootExitStatus === RootIncomplete;\n}\n\nfunction renderRootSync(root, lanes) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher(); \u002F\u002F If the root or lanes have changed, throw out the existing stack\n \u002F\u002F and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {\n prepareFreshStack(root, lanes);\n startWorkOnPendingInteractions(root, lanes);\n }\n\n var prevInteractions = pushInteractions(root);\n\n do {\n try {\n workLoopSync();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n\n {\n popInteractions(prevInteractions);\n }\n\n executionContext = prevExecutionContext;\n popDispatcher(prevDispatcher);\n\n if (workInProgress !== null) {\n \u002F\u002F This is a sync render, so we should have finished the whole tree.\n {\n {\n throw Error( \"Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n }\n }\n\n\n workInProgressRoot = null;\n workInProgressRootRenderLanes = NoLanes;\n return workInProgressRootExitStatus;\n} \u002F\u002F The work loop is an extremely hot path. Tell Closure not to inline it.\n\n\u002F** @noinline *\u002F\n\n\nfunction workLoopSync() {\n \u002F\u002F Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}\n\nfunction renderRootConcurrent(root, lanes) {\n var prevExecutionContext = executionContext;\n executionContext |= RenderContext;\n var prevDispatcher = pushDispatcher(); \u002F\u002F If the root or lanes have changed, throw out the existing stack\n \u002F\u002F and prepare a fresh one. Otherwise we'll continue where we left off.\n\n if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) {\n resetRenderTimer();\n prepareFreshStack(root, lanes);\n startWorkOnPendingInteractions(root, lanes);\n }\n\n var prevInteractions = pushInteractions(root);\n\n do {\n try {\n workLoopConcurrent();\n break;\n } catch (thrownValue) {\n handleError(root, thrownValue);\n }\n } while (true);\n\n resetContextDependencies();\n\n {\n popInteractions(prevInteractions);\n }\n\n popDispatcher(prevDispatcher);\n executionContext = prevExecutionContext;\n\n\n if (workInProgress !== null) {\n\n return RootIncomplete;\n } else {\n\n\n workInProgressRoot = null;\n workInProgressRootRenderLanes = NoLanes; \u002F\u002F Return the final exit status.\n\n return workInProgressRootExitStatus;\n }\n}\n\u002F** @noinline *\u002F\n\n\nfunction workLoopConcurrent() {\n \u002F\u002F Perform work until Scheduler asks us to yield\n while (workInProgress !== null && !shouldYield()) {\n performUnitOfWork(workInProgress);\n }\n}\n\nfunction performUnitOfWork(unitOfWork) {\n \u002F\u002F The current, flushed, state of this fiber is the alternate. Ideally\n \u002F\u002F nothing should rely on this, but relying on it here means that we don't\n \u002F\u002F need an additional field on the work in progress.\n var current = unitOfWork.alternate;\n setCurrentFiber(unitOfWork);\n var next;\n\n if ( (unitOfWork.mode & ProfileMode) !== NoMode) {\n startProfilerTimer(unitOfWork);\n next = beginWork$1(current, unitOfWork, subtreeRenderLanes);\n stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true);\n } else {\n next = beginWork$1(current, unitOfWork, subtreeRenderLanes);\n }\n\n resetCurrentFiber();\n unitOfWork.memoizedProps = unitOfWork.pendingProps;\n\n if (next === null) {\n \u002F\u002F If this doesn't spawn new work, complete the current work.\n completeUnitOfWork(unitOfWork);\n } else {\n workInProgress = next;\n }\n\n ReactCurrentOwner$2.current = null;\n}\n\nfunction completeUnitOfWork(unitOfWork) {\n \u002F\u002F Attempt to complete the current unit of work, then move to the next\n \u002F\u002F sibling. If there are no more siblings, return to the parent fiber.\n var completedWork = unitOfWork;\n\n do {\n \u002F\u002F The current, flushed, state of this fiber is the alternate. Ideally\n \u002F\u002F nothing should rely on this, but relying on it here means that we don't\n \u002F\u002F need an additional field on the work in progress.\n var current = completedWork.alternate;\n var returnFiber = completedWork.return; \u002F\u002F Check if the work completed or if something threw.\n\n if ((completedWork.flags & Incomplete) === NoFlags) {\n setCurrentFiber(completedWork);\n var next = void 0;\n\n if ( (completedWork.mode & ProfileMode) === NoMode) {\n next = completeWork(current, completedWork, subtreeRenderLanes);\n } else {\n startProfilerTimer(completedWork);\n next = completeWork(current, completedWork, subtreeRenderLanes); \u002F\u002F Update render duration assuming we didn't error.\n\n stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);\n }\n\n resetCurrentFiber();\n\n if (next !== null) {\n \u002F\u002F Completing this fiber spawned new work. Work on that next.\n workInProgress = next;\n return;\n }\n\n resetChildLanes(completedWork);\n\n if (returnFiber !== null && \u002F\u002F Do not append effects to parents if a sibling failed to complete\n (returnFiber.flags & Incomplete) === NoFlags) {\n \u002F\u002F Append all the effects of the subtree and this fiber onto the effect\n \u002F\u002F list of the parent. The completion order of the children affects the\n \u002F\u002F side-effect order.\n if (returnFiber.firstEffect === null) {\n returnFiber.firstEffect = completedWork.firstEffect;\n }\n\n if (completedWork.lastEffect !== null) {\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = completedWork.firstEffect;\n }\n\n returnFiber.lastEffect = completedWork.lastEffect;\n } \u002F\u002F If this fiber had side-effects, we append it AFTER the children's\n \u002F\u002F side-effects. We can perform certain side-effects earlier if needed,\n \u002F\u002F by doing multiple passes over the effect list. We don't want to\n \u002F\u002F schedule our own side-effect on our own list because if end up\n \u002F\u002F reusing children we'll schedule this effect onto itself since we're\n \u002F\u002F at the end.\n\n\n var flags = completedWork.flags; \u002F\u002F Skip both NoWork and PerformedWork tags when creating the effect\n \u002F\u002F list. PerformedWork effect is read by React DevTools but shouldn't be\n \u002F\u002F committed.\n\n if (flags \u003E PerformedWork) {\n if (returnFiber.lastEffect !== null) {\n returnFiber.lastEffect.nextEffect = completedWork;\n } else {\n returnFiber.firstEffect = completedWork;\n }\n\n returnFiber.lastEffect = completedWork;\n }\n }\n } else {\n \u002F\u002F This fiber did not complete because something threw. Pop values off\n \u002F\u002F the stack without entering the complete phase. If this is a boundary,\n \u002F\u002F capture values if possible.\n var _next = unwindWork(completedWork); \u002F\u002F Because this fiber did not complete, don't reset its expiration time.\n\n\n if (_next !== null) {\n \u002F\u002F If completing this work spawned new work, do that next. We'll come\n \u002F\u002F back here again.\n \u002F\u002F Since we're restarting, remove anything that is not a host effect\n \u002F\u002F from the effect tag.\n _next.flags &= HostEffectMask;\n workInProgress = _next;\n return;\n }\n\n if ( (completedWork.mode & ProfileMode) !== NoMode) {\n \u002F\u002F Record the render duration for the fiber that errored.\n stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); \u002F\u002F Include the time spent working on failed children before continuing.\n\n var actualDuration = completedWork.actualDuration;\n var child = completedWork.child;\n\n while (child !== null) {\n actualDuration += child.actualDuration;\n child = child.sibling;\n }\n\n completedWork.actualDuration = actualDuration;\n }\n\n if (returnFiber !== null) {\n \u002F\u002F Mark the parent fiber as incomplete and clear its effect list.\n returnFiber.firstEffect = returnFiber.lastEffect = null;\n returnFiber.flags |= Incomplete;\n }\n }\n\n var siblingFiber = completedWork.sibling;\n\n if (siblingFiber !== null) {\n \u002F\u002F If there is more work to do in this returnFiber, do that next.\n workInProgress = siblingFiber;\n return;\n } \u002F\u002F Otherwise, return to the parent\n\n\n completedWork = returnFiber; \u002F\u002F Update the next thing we're working on in case something throws.\n\n workInProgress = completedWork;\n } while (completedWork !== null); \u002F\u002F We've reached the root.\n\n\n if (workInProgressRootExitStatus === RootIncomplete) {\n workInProgressRootExitStatus = RootCompleted;\n }\n}\n\nfunction resetChildLanes(completedWork) {\n if ( \u002F\u002F TODO: Move this check out of the hot path by moving `resetChildLanes`\n \u002F\u002F to switch statement in `completeWork`.\n (completedWork.tag === LegacyHiddenComponent || completedWork.tag === OffscreenComponent) && completedWork.memoizedState !== null && !includesSomeLane(subtreeRenderLanes, OffscreenLane) && (completedWork.mode & ConcurrentMode) !== NoLanes) {\n \u002F\u002F The children of this component are hidden. Don't bubble their\n \u002F\u002F expiration times.\n return;\n }\n\n var newChildLanes = NoLanes; \u002F\u002F Bubble up the earliest expiration time.\n\n if ( (completedWork.mode & ProfileMode) !== NoMode) {\n \u002F\u002F In profiling mode, resetChildExpirationTime is also used to reset\n \u002F\u002F profiler durations.\n var actualDuration = completedWork.actualDuration;\n var treeBaseDuration = completedWork.selfBaseDuration; \u002F\u002F When a fiber is cloned, its actualDuration is reset to 0. This value will\n \u002F\u002F only be updated if work is done on the fiber (i.e. it doesn't bailout).\n \u002F\u002F When work is done, it should bubble to the parent's actualDuration. If\n \u002F\u002F the fiber has not been cloned though, (meaning no work was done), then\n \u002F\u002F this value will reflect the amount of time spent working on a previous\n \u002F\u002F render. In that case it should not bubble. We determine whether it was\n \u002F\u002F cloned by comparing the child pointer.\n\n var shouldBubbleActualDurations = completedWork.alternate === null || completedWork.child !== completedWork.alternate.child;\n var child = completedWork.child;\n\n while (child !== null) {\n newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));\n\n if (shouldBubbleActualDurations) {\n actualDuration += child.actualDuration;\n }\n\n treeBaseDuration += child.treeBaseDuration;\n child = child.sibling;\n }\n\n var isTimedOutSuspense = completedWork.tag === SuspenseComponent && completedWork.memoizedState !== null;\n\n if (isTimedOutSuspense) {\n \u002F\u002F Don't count time spent in a timed out Suspense subtree as part of the base duration.\n var primaryChildFragment = completedWork.child;\n\n if (primaryChildFragment !== null) {\n treeBaseDuration -= primaryChildFragment.treeBaseDuration;\n }\n }\n\n completedWork.actualDuration = actualDuration;\n completedWork.treeBaseDuration = treeBaseDuration;\n } else {\n var _child = completedWork.child;\n\n while (_child !== null) {\n newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes));\n _child = _child.sibling;\n }\n }\n\n completedWork.childLanes = newChildLanes;\n}\n\nfunction commitRoot(root) {\n var renderPriorityLevel = getCurrentPriorityLevel();\n runWithPriority$1(ImmediatePriority$1, commitRootImpl.bind(null, root, renderPriorityLevel));\n return null;\n}\n\nfunction commitRootImpl(root, renderPriorityLevel) {\n do {\n \u002F\u002F `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which\n \u002F\u002F means `flushPassiveEffects` will sometimes result in additional\n \u002F\u002F passive effects. So we need to keep flushing in a loop until there are\n \u002F\u002F no more pending effects.\n \u002F\u002F TODO: Might be better if `flushPassiveEffects` did not automatically\n \u002F\u002F flush synchronous work at the end, to avoid factoring hazards like this.\n flushPassiveEffects();\n } while (rootWithPendingPassiveEffects !== null);\n\n flushRenderPhaseStrictModeWarningsInDEV();\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Should not already be working.\" );\n }\n }\n\n var finishedWork = root.finishedWork;\n var lanes = root.finishedLanes;\n\n if (finishedWork === null) {\n\n return null;\n }\n\n root.finishedWork = null;\n root.finishedLanes = NoLanes;\n\n if (!(finishedWork !== root.current)) {\n {\n throw Error( \"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.\" );\n }\n } \u002F\u002F commitRoot never returns a continuation; it always finishes synchronously.\n \u002F\u002F So we can clear these now to allow a new callback to be scheduled.\n\n\n root.callbackNode = null; \u002F\u002F Update the first and last pending times on this root. The new first\n \u002F\u002F pending time is whatever is left on the root fiber.\n\n var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes);\n markRootFinished(root, remainingLanes); \u002F\u002F Clear already finished discrete updates in case that a later call of\n \u002F\u002F `flushDiscreteUpdates` starts a useless render pass which may cancels\n \u002F\u002F a scheduled timeout.\n\n if (rootsWithPendingDiscreteUpdates !== null) {\n if (!hasDiscreteLanes(remainingLanes) && rootsWithPendingDiscreteUpdates.has(root)) {\n rootsWithPendingDiscreteUpdates.delete(root);\n }\n }\n\n if (root === workInProgressRoot) {\n \u002F\u002F We can reset these now that they are finished.\n workInProgressRoot = null;\n workInProgress = null;\n workInProgressRootRenderLanes = NoLanes;\n } \u002F\u002F Get the list of effects.\n\n\n var firstEffect;\n\n if (finishedWork.flags \u003E PerformedWork) {\n \u002F\u002F A fiber's effect list consists only of its children, not itself. So if\n \u002F\u002F the root has an effect, we need to add it to the end of the list. The\n \u002F\u002F resulting list is the set that would belong to the root's parent, if it\n \u002F\u002F had one; that is, all the effects in the tree including the root.\n if (finishedWork.lastEffect !== null) {\n finishedWork.lastEffect.nextEffect = finishedWork;\n firstEffect = finishedWork.firstEffect;\n } else {\n firstEffect = finishedWork;\n }\n } else {\n \u002F\u002F There is no effect on the root.\n firstEffect = finishedWork.firstEffect;\n }\n\n if (firstEffect !== null) {\n\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext;\n var prevInteractions = pushInteractions(root); \u002F\u002F Reset this to null before calling lifecycles\n\n ReactCurrentOwner$2.current = null; \u002F\u002F The commit phase is broken into several sub-phases. We do a separate pass\n \u002F\u002F of the effect list for each phase: all mutation effects come before all\n \u002F\u002F layout effects, and so on.\n \u002F\u002F The first phase a \"before mutation\" phase. We use this phase to read the\n \u002F\u002F state of the host tree right before we mutate it. This is where\n \u002F\u002F getSnapshotBeforeUpdate is called.\n\n focusedInstanceHandle = prepareForCommit(root.containerInfo);\n shouldFireAfterActiveInstanceBlur = false;\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitBeforeMutationEffects, null);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var error = clearCaughtError();\n captureCommitPhaseError(nextEffect, error);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null); \u002F\u002F We no longer need to track the active instance fiber\n\n\n focusedInstanceHandle = null;\n\n {\n \u002F\u002F Mark the current commit time to be shared by all Profilers in this\n \u002F\u002F batch. This enables them to be grouped later.\n recordCommitTime();\n } \u002F\u002F The next phase is the mutation phase, where we mutate the host tree.\n\n\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitMutationEffects, null, root, renderPriorityLevel);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error = clearCaughtError();\n\n captureCommitPhaseError(nextEffect, _error);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n resetAfterCommit(root.containerInfo); \u002F\u002F The work-in-progress tree is now the current tree. This must come after\n \u002F\u002F the mutation phase, so that the previous tree is still current during\n \u002F\u002F componentWillUnmount, but before the layout phase, so that the finished\n \u002F\u002F work is current during componentDidMount\u002FUpdate.\n\n root.current = finishedWork; \u002F\u002F The next phase is the layout phase, where we call effects that read\n \u002F\u002F the host tree after it's been mutated. The idiomatic use case for this is\n \u002F\u002F layout, but class component lifecycles also fire here for legacy reasons.\n\n nextEffect = firstEffect;\n\n do {\n {\n invokeGuardedCallback(null, commitLayoutEffects, null, root, lanes);\n\n if (hasCaughtError()) {\n if (!(nextEffect !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error2 = clearCaughtError();\n\n captureCommitPhaseError(nextEffect, _error2);\n nextEffect = nextEffect.nextEffect;\n }\n }\n } while (nextEffect !== null);\n\n nextEffect = null; \u002F\u002F Tell Scheduler to yield at the end of the frame, so the browser has an\n \u002F\u002F opportunity to paint.\n\n requestPaint();\n\n {\n popInteractions(prevInteractions);\n }\n\n executionContext = prevExecutionContext;\n } else {\n \u002F\u002F No effects.\n root.current = finishedWork; \u002F\u002F Measure these anyway so the flamegraph explicitly shows that there were\n \u002F\u002F no effects.\n \u002F\u002F TODO: Maybe there's a better way to report this.\n\n {\n recordCommitTime();\n }\n }\n\n var rootDidHavePassiveEffects = rootDoesHavePassiveEffects;\n\n if (rootDoesHavePassiveEffects) {\n \u002F\u002F This commit has passive effects. Stash a reference to them. But don't\n \u002F\u002F schedule a callback until after flushing layout work.\n rootDoesHavePassiveEffects = false;\n rootWithPendingPassiveEffects = root;\n pendingPassiveEffectsLanes = lanes;\n pendingPassiveEffectsRenderPriority = renderPriorityLevel;\n } else {\n \u002F\u002F We are done with the effect chain at this point so let's clear the\n \u002F\u002F nextEffect pointers to assist with GC. If we have passive effects, we'll\n \u002F\u002F clear this in flushPassiveEffects.\n nextEffect = firstEffect;\n\n while (nextEffect !== null) {\n var nextNextEffect = nextEffect.nextEffect;\n nextEffect.nextEffect = null;\n\n if (nextEffect.flags & Deletion) {\n detachFiberAfterEffects(nextEffect);\n }\n\n nextEffect = nextNextEffect;\n }\n } \u002F\u002F Read this again, since an effect might have updated it\n\n\n remainingLanes = root.pendingLanes; \u002F\u002F Check if there's remaining work on this root\n\n if (remainingLanes !== NoLanes) {\n {\n if (spawnedWorkDuringRender !== null) {\n var expirationTimes = spawnedWorkDuringRender;\n spawnedWorkDuringRender = null;\n\n for (var i = 0; i \u003C expirationTimes.length; i++) {\n scheduleInteractions(root, expirationTimes[i], root.memoizedInteractions);\n }\n }\n\n schedulePendingInteractions(root, remainingLanes);\n }\n } else {\n \u002F\u002F If there's no remaining work, we can clear the set of already failed\n \u002F\u002F error boundaries.\n legacyErrorBoundariesThatAlreadyFailed = null;\n }\n\n {\n if (!rootDidHavePassiveEffects) {\n \u002F\u002F If there are no passive effects, then we can complete the pending interactions.\n \u002F\u002F Otherwise, we'll wait until after the passive effects are flushed.\n \u002F\u002F Wait to do this until after remaining work has been scheduled,\n \u002F\u002F so that we don't prematurely signal complete for interactions when there's e.g. hidden work.\n finishPendingInteractions(root, lanes);\n }\n }\n\n if (remainingLanes === SyncLane) {\n \u002F\u002F Count the number of times the root synchronously re-renders without\n \u002F\u002F finishing. If there are too many, it indicates an infinite update loop.\n if (root === rootWithNestedUpdates) {\n nestedUpdateCount++;\n } else {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = root;\n }\n } else {\n nestedUpdateCount = 0;\n }\n\n onCommitRoot(finishedWork.stateNode, renderPriorityLevel);\n\n {\n onCommitRoot$1();\n } \u002F\u002F Always call this before exiting `commitRoot`, to ensure that any\n \u002F\u002F additional work on this root is scheduled.\n\n\n ensureRootIsScheduled(root, now());\n\n if (hasUncaughtError) {\n hasUncaughtError = false;\n var _error3 = firstUncaughtError;\n firstUncaughtError = null;\n throw _error3;\n }\n\n if ((executionContext & LegacyUnbatchedContext) !== NoContext) {\n \u002F\u002F a ReactDOM.render-ed root inside of batchedUpdates. The commit fired\n \u002F\u002F synchronously, but layout updates should be deferred until the end\n \u002F\u002F of the batch.\n\n\n return null;\n } \u002F\u002F If layout work was scheduled, flush it now.\n\n\n flushSyncCallbackQueue();\n\n return null;\n}\n\nfunction commitBeforeMutationEffects() {\n while (nextEffect !== null) {\n var current = nextEffect.alternate;\n\n if (!shouldFireAfterActiveInstanceBlur && focusedInstanceHandle !== null) {\n if ((nextEffect.flags & Deletion) !== NoFlags) {\n if (doesFiberContain(nextEffect, focusedInstanceHandle)) {\n shouldFireAfterActiveInstanceBlur = true;\n }\n } else {\n \u002F\u002F TODO: Move this out of the hot path using a dedicated effect tag.\n if (nextEffect.tag === SuspenseComponent && isSuspenseBoundaryBeingHidden(current, nextEffect) && doesFiberContain(nextEffect, focusedInstanceHandle)) {\n shouldFireAfterActiveInstanceBlur = true;\n }\n }\n }\n\n var flags = nextEffect.flags;\n\n if ((flags & Snapshot) !== NoFlags) {\n setCurrentFiber(nextEffect);\n commitBeforeMutationLifeCycles(current, nextEffect);\n resetCurrentFiber();\n }\n\n if ((flags & Passive) !== NoFlags) {\n \u002F\u002F If there are passive effects, schedule a callback to flush at\n \u002F\u002F the earliest opportunity.\n if (!rootDoesHavePassiveEffects) {\n rootDoesHavePassiveEffects = true;\n scheduleCallback(NormalPriority$1, function () {\n flushPassiveEffects();\n return null;\n });\n }\n }\n\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction commitMutationEffects(root, renderPriorityLevel) {\n \u002F\u002F TODO: Should probably move the bulk of this function to commitWork.\n while (nextEffect !== null) {\n setCurrentFiber(nextEffect);\n var flags = nextEffect.flags;\n\n if (flags & ContentReset) {\n commitResetTextContent(nextEffect);\n }\n\n if (flags & Ref) {\n var current = nextEffect.alternate;\n\n if (current !== null) {\n commitDetachRef(current);\n }\n } \u002F\u002F The following switch statement is only concerned about placement,\n \u002F\u002F updates, and deletions. To avoid needing to add a case for every possible\n \u002F\u002F bitmap value, we remove the secondary effects from the effect tag and\n \u002F\u002F switch on that value.\n\n\n var primaryFlags = flags & (Placement | Update | Deletion | Hydrating);\n\n switch (primaryFlags) {\n case Placement:\n {\n commitPlacement(nextEffect); \u002F\u002F Clear the \"placement\" from effect tag so that we know that this is\n \u002F\u002F inserted, before any life-cycles like componentDidMount gets called.\n \u002F\u002F TODO: findDOMNode doesn't rely on this any more but isMounted does\n \u002F\u002F and isMounted is deprecated anyway so we should be able to kill this.\n\n nextEffect.flags &= ~Placement;\n break;\n }\n\n case PlacementAndUpdate:\n {\n \u002F\u002F Placement\n commitPlacement(nextEffect); \u002F\u002F Clear the \"placement\" from effect tag so that we know that this is\n \u002F\u002F inserted, before any life-cycles like componentDidMount gets called.\n\n nextEffect.flags &= ~Placement; \u002F\u002F Update\n\n var _current = nextEffect.alternate;\n commitWork(_current, nextEffect);\n break;\n }\n\n case Hydrating:\n {\n nextEffect.flags &= ~Hydrating;\n break;\n }\n\n case HydratingAndUpdate:\n {\n nextEffect.flags &= ~Hydrating; \u002F\u002F Update\n\n var _current2 = nextEffect.alternate;\n commitWork(_current2, nextEffect);\n break;\n }\n\n case Update:\n {\n var _current3 = nextEffect.alternate;\n commitWork(_current3, nextEffect);\n break;\n }\n\n case Deletion:\n {\n commitDeletion(root, nextEffect);\n break;\n }\n }\n\n resetCurrentFiber();\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction commitLayoutEffects(root, committedLanes) {\n\n\n while (nextEffect !== null) {\n setCurrentFiber(nextEffect);\n var flags = nextEffect.flags;\n\n if (flags & (Update | Callback)) {\n var current = nextEffect.alternate;\n commitLifeCycles(root, current, nextEffect);\n }\n\n {\n if (flags & Ref) {\n commitAttachRef(nextEffect);\n }\n }\n\n resetCurrentFiber();\n nextEffect = nextEffect.nextEffect;\n }\n}\n\nfunction flushPassiveEffects() {\n \u002F\u002F Returns whether passive effects were flushed.\n if (pendingPassiveEffectsRenderPriority !== NoPriority$1) {\n var priorityLevel = pendingPassiveEffectsRenderPriority \u003E NormalPriority$1 ? NormalPriority$1 : pendingPassiveEffectsRenderPriority;\n pendingPassiveEffectsRenderPriority = NoPriority$1;\n\n {\n return runWithPriority$1(priorityLevel, flushPassiveEffectsImpl);\n }\n }\n\n return false;\n}\nfunction enqueuePendingPassiveHookEffectMount(fiber, effect) {\n pendingPassiveHookEffectsMount.push(effect, fiber);\n\n if (!rootDoesHavePassiveEffects) {\n rootDoesHavePassiveEffects = true;\n scheduleCallback(NormalPriority$1, function () {\n flushPassiveEffects();\n return null;\n });\n }\n}\nfunction enqueuePendingPassiveHookEffectUnmount(fiber, effect) {\n pendingPassiveHookEffectsUnmount.push(effect, fiber);\n\n {\n fiber.flags |= PassiveUnmountPendingDev;\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n alternate.flags |= PassiveUnmountPendingDev;\n }\n }\n\n if (!rootDoesHavePassiveEffects) {\n rootDoesHavePassiveEffects = true;\n scheduleCallback(NormalPriority$1, function () {\n flushPassiveEffects();\n return null;\n });\n }\n}\n\nfunction invokePassiveEffectCreate(effect) {\n var create = effect.create;\n effect.destroy = create();\n}\n\nfunction flushPassiveEffectsImpl() {\n if (rootWithPendingPassiveEffects === null) {\n return false;\n }\n\n var root = rootWithPendingPassiveEffects;\n var lanes = pendingPassiveEffectsLanes;\n rootWithPendingPassiveEffects = null;\n pendingPassiveEffectsLanes = NoLanes;\n\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error( \"Cannot flush passive effects while already rendering.\" );\n }\n }\n\n {\n isFlushingPassiveEffects = true;\n }\n\n var prevExecutionContext = executionContext;\n executionContext |= CommitContext;\n var prevInteractions = pushInteractions(root); \u002F\u002F It's important that ALL pending passive effect destroy functions are called\n \u002F\u002F before ANY passive effect create functions are called.\n \u002F\u002F Otherwise effects in sibling components might interfere with each other.\n \u002F\u002F e.g. a destroy function in one component may unintentionally override a ref\n \u002F\u002F value set by a create function in another component.\n \u002F\u002F Layout effects have the same constraint.\n \u002F\u002F First pass: Destroy stale passive effects.\n\n var unmountEffects = pendingPassiveHookEffectsUnmount;\n pendingPassiveHookEffectsUnmount = [];\n\n for (var i = 0; i \u003C unmountEffects.length; i += 2) {\n var _effect = unmountEffects[i];\n var fiber = unmountEffects[i + 1];\n var destroy = _effect.destroy;\n _effect.destroy = undefined;\n\n {\n fiber.flags &= ~PassiveUnmountPendingDev;\n var alternate = fiber.alternate;\n\n if (alternate !== null) {\n alternate.flags &= ~PassiveUnmountPendingDev;\n }\n }\n\n if (typeof destroy === 'function') {\n {\n setCurrentFiber(fiber);\n\n {\n invokeGuardedCallback(null, destroy, null);\n }\n\n if (hasCaughtError()) {\n if (!(fiber !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var error = clearCaughtError();\n captureCommitPhaseError(fiber, error);\n }\n\n resetCurrentFiber();\n }\n }\n } \u002F\u002F Second pass: Create new passive effects.\n\n\n var mountEffects = pendingPassiveHookEffectsMount;\n pendingPassiveHookEffectsMount = [];\n\n for (var _i = 0; _i \u003C mountEffects.length; _i += 2) {\n var _effect2 = mountEffects[_i];\n var _fiber = mountEffects[_i + 1];\n\n {\n setCurrentFiber(_fiber);\n\n {\n invokeGuardedCallback(null, invokePassiveEffectCreate, null, _effect2);\n }\n\n if (hasCaughtError()) {\n if (!(_fiber !== null)) {\n {\n throw Error( \"Should be working on an effect.\" );\n }\n }\n\n var _error4 = clearCaughtError();\n\n captureCommitPhaseError(_fiber, _error4);\n }\n\n resetCurrentFiber();\n }\n } \u002F\u002F Note: This currently assumes there are no passive effects on the root fiber\n \u002F\u002F because the root is not part of its own effect list.\n \u002F\u002F This could change in the future.\n\n\n var effect = root.current.firstEffect;\n\n while (effect !== null) {\n var nextNextEffect = effect.nextEffect; \u002F\u002F Remove nextEffect pointer to assist GC\n\n effect.nextEffect = null;\n\n if (effect.flags & Deletion) {\n detachFiberAfterEffects(effect);\n }\n\n effect = nextNextEffect;\n }\n\n {\n popInteractions(prevInteractions);\n finishPendingInteractions(root, lanes);\n }\n\n {\n isFlushingPassiveEffects = false;\n }\n\n executionContext = prevExecutionContext;\n flushSyncCallbackQueue(); \u002F\u002F If additional passive effects were scheduled, increment a counter. If this\n \u002F\u002F exceeds the limit, we'll fire a warning.\n\n nestedPassiveUpdateCount = rootWithPendingPassiveEffects === null ? 0 : nestedPassiveUpdateCount + 1;\n return true;\n}\n\nfunction isAlreadyFailedLegacyErrorBoundary(instance) {\n return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance);\n}\nfunction markLegacyErrorBoundaryAsFailed(instance) {\n if (legacyErrorBoundariesThatAlreadyFailed === null) {\n legacyErrorBoundariesThatAlreadyFailed = new Set([instance]);\n } else {\n legacyErrorBoundariesThatAlreadyFailed.add(instance);\n }\n}\n\nfunction prepareToThrowUncaughtError(error) {\n if (!hasUncaughtError) {\n hasUncaughtError = true;\n firstUncaughtError = error;\n }\n}\n\nvar onUncaughtError = prepareToThrowUncaughtError;\n\nfunction captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) {\n var errorInfo = createCapturedValue(error, sourceFiber);\n var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);\n enqueueUpdate(rootFiber, update);\n var eventTime = requestEventTime();\n var root = markUpdateLaneFromFiberToRoot(rootFiber, SyncLane);\n\n if (root !== null) {\n markRootUpdated(root, SyncLane, eventTime);\n ensureRootIsScheduled(root, eventTime);\n schedulePendingInteractions(root, SyncLane);\n }\n}\n\nfunction captureCommitPhaseError(sourceFiber, error) {\n if (sourceFiber.tag === HostRoot) {\n \u002F\u002F Error was thrown at the root. There is no parent, so the root\n \u002F\u002F itself should capture it.\n captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);\n return;\n }\n\n var fiber = sourceFiber.return;\n\n while (fiber !== null) {\n if (fiber.tag === HostRoot) {\n captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error);\n return;\n } else if (fiber.tag === ClassComponent) {\n var ctor = fiber.type;\n var instance = fiber.stateNode;\n\n if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n var errorInfo = createCapturedValue(error, sourceFiber);\n var update = createClassErrorUpdate(fiber, errorInfo, SyncLane);\n enqueueUpdate(fiber, update);\n var eventTime = requestEventTime();\n var root = markUpdateLaneFromFiberToRoot(fiber, SyncLane);\n\n if (root !== null) {\n markRootUpdated(root, SyncLane, eventTime);\n ensureRootIsScheduled(root, eventTime);\n schedulePendingInteractions(root, SyncLane);\n } else {\n \u002F\u002F This component has already been unmounted.\n \u002F\u002F We can't schedule any follow up work for the root because the fiber is already unmounted,\n \u002F\u002F but we can still call the log-only boundary so the error isn't swallowed.\n \u002F\u002F\n \u002F\u002F TODO This is only a temporary bandaid for the old reconciler fork.\n \u002F\u002F We can delete this special case once the new fork is merged.\n if (typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) {\n try {\n instance.componentDidCatch(error, errorInfo);\n } catch (errorToIgnore) {\u002F\u002F TODO Ignore this error? Rethrow it?\n \u002F\u002F This is kind of an edge case.\n }\n }\n }\n\n return;\n }\n }\n\n fiber = fiber.return;\n }\n}\nfunction pingSuspendedRoot(root, wakeable, pingedLanes) {\n var pingCache = root.pingCache;\n\n if (pingCache !== null) {\n \u002F\u002F The wakeable resolved, so we no longer need to memoize, because it will\n \u002F\u002F never be thrown again.\n pingCache.delete(wakeable);\n }\n\n var eventTime = requestEventTime();\n markRootPinged(root, pingedLanes);\n\n if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {\n \u002F\u002F Received a ping at the same priority level at which we're currently\n \u002F\u002F rendering. We might want to restart this render. This should mirror\n \u002F\u002F the logic of whether or not a root suspends once it completes.\n \u002F\u002F TODO: If we're rendering sync either due to Sync, Batched or expired,\n \u002F\u002F we should probably never restart.\n \u002F\u002F If we're suspended with delay, or if it's a retry, we'll always suspend\n \u002F\u002F so we can always restart.\n if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime \u003C FALLBACK_THROTTLE_MS) {\n \u002F\u002F Restart from the root.\n prepareFreshStack(root, NoLanes);\n } else {\n \u002F\u002F Even though we can't restart right now, we might get an\n \u002F\u002F opportunity later. So we mark this render as having a ping.\n workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);\n }\n }\n\n ensureRootIsScheduled(root, eventTime);\n schedulePendingInteractions(root, pingedLanes);\n}\n\nfunction retryTimedOutBoundary(boundaryFiber, retryLane) {\n \u002F\u002F The boundary fiber (a Suspense component or SuspenseList component)\n \u002F\u002F previously was rendered in its fallback state. One of the promises that\n \u002F\u002F suspended it has resolved, which means at least part of the tree was\n \u002F\u002F likely unblocked. Try rendering again, at a new expiration time.\n if (retryLane === NoLane) {\n retryLane = requestRetryLane(boundaryFiber);\n } \u002F\u002F TODO: Special case idle priority?\n\n\n var eventTime = requestEventTime();\n var root = markUpdateLaneFromFiberToRoot(boundaryFiber, retryLane);\n\n if (root !== null) {\n markRootUpdated(root, retryLane, eventTime);\n ensureRootIsScheduled(root, eventTime);\n schedulePendingInteractions(root, retryLane);\n }\n}\nfunction resolveRetryWakeable(boundaryFiber, wakeable) {\n var retryLane = NoLane; \u002F\u002F Default\n\n var retryCache;\n\n {\n retryCache = boundaryFiber.stateNode;\n }\n\n if (retryCache !== null) {\n \u002F\u002F The wakeable resolved, so we no longer need to memoize, because it will\n \u002F\u002F never be thrown again.\n retryCache.delete(wakeable);\n }\n\n retryTimedOutBoundary(boundaryFiber, retryLane);\n} \u002F\u002F Computes the next Just Noticeable Difference (JND) boundary.\n\u002F\u002F The theory is that a person can't tell the difference between small differences in time.\n\u002F\u002F Therefore, if we wait a bit longer than necessary that won't translate to a noticeable\n\u002F\u002F difference in the experience. However, waiting for longer might mean that we can avoid\n\u002F\u002F showing an intermediate loading state. The longer we have already waited, the harder it\n\u002F\u002F is to tell small differences in time. Therefore, the longer we've already waited,\n\u002F\u002F the longer we can wait additionally. At some point we have to give up though.\n\u002F\u002F We pick a train model where the next boundary commits at a consistent schedule.\n\u002F\u002F These particular numbers are vague estimates. We expect to adjust them based on research.\n\nfunction jnd(timeElapsed) {\n return timeElapsed \u003C 120 ? 120 : timeElapsed \u003C 480 ? 480 : timeElapsed \u003C 1080 ? 1080 : timeElapsed \u003C 1920 ? 1920 : timeElapsed \u003C 3000 ? 3000 : timeElapsed \u003C 4320 ? 4320 : ceil(timeElapsed \u002F 1960) * 1960;\n}\n\nfunction checkForNestedUpdates() {\n if (nestedUpdateCount \u003E NESTED_UPDATE_LIMIT) {\n nestedUpdateCount = 0;\n rootWithNestedUpdates = null;\n\n {\n {\n throw Error( \"Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.\" );\n }\n }\n }\n\n {\n if (nestedPassiveUpdateCount \u003E NESTED_PASSIVE_UPDATE_LIMIT) {\n nestedPassiveUpdateCount = 0;\n\n error('Maximum update depth exceeded. This can happen when a component ' + \"calls setState inside useEffect, but useEffect either doesn't \" + 'have a dependency array, or one of the dependencies changes on ' + 'every render.');\n }\n }\n}\n\nfunction flushRenderPhaseStrictModeWarningsInDEV() {\n {\n ReactStrictModeWarnings.flushLegacyContextWarning();\n\n {\n ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();\n }\n }\n}\n\nvar didWarnStateUpdateForNotYetMountedComponent = null;\n\nfunction warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) {\n {\n if ((executionContext & RenderContext) !== NoContext) {\n \u002F\u002F We let the other warning about render phase updates deal with this one.\n return;\n }\n\n if (!(fiber.mode & (BlockingMode | ConcurrentMode))) {\n return;\n }\n\n var tag = fiber.tag;\n\n if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {\n \u002F\u002F Only warn for user-defined components, not internal ones like Suspense.\n return;\n } \u002F\u002F We show the whole stack but dedupe on the top component's name because\n \u002F\u002F the problematic code almost always lies inside that component.\n\n\n var componentName = getComponentName(fiber.type) || 'ReactComponent';\n\n if (didWarnStateUpdateForNotYetMountedComponent !== null) {\n if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) {\n return;\n }\n\n didWarnStateUpdateForNotYetMountedComponent.add(componentName);\n } else {\n didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]);\n }\n\n var previousFiber = current;\n\n try {\n setCurrentFiber(fiber);\n\n error(\"Can't perform a React state update on a component that hasn't mounted yet. \" + 'This indicates that you have a side-effect in your render function that ' + 'asynchronously later calls tries to update the component. Move this work to ' + 'useEffect instead.');\n } finally {\n if (previousFiber) {\n setCurrentFiber(fiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = null;\n\nfunction warnAboutUpdateOnUnmountedFiberInDEV(fiber) {\n {\n var tag = fiber.tag;\n\n if (tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent && tag !== Block) {\n \u002F\u002F Only warn for user-defined components, not internal ones like Suspense.\n return;\n } \u002F\u002F If there are pending passive effects unmounts for this Fiber,\n \u002F\u002F we can assume that they would have prevented this update.\n\n\n if ((fiber.flags & PassiveUnmountPendingDev) !== NoFlags) {\n return;\n } \u002F\u002F We show the whole stack but dedupe on the top component's name because\n \u002F\u002F the problematic code almost always lies inside that component.\n\n\n var componentName = getComponentName(fiber.type) || 'ReactComponent';\n\n if (didWarnStateUpdateForUnmountedComponent !== null) {\n if (didWarnStateUpdateForUnmountedComponent.has(componentName)) {\n return;\n }\n\n didWarnStateUpdateForUnmountedComponent.add(componentName);\n } else {\n didWarnStateUpdateForUnmountedComponent = new Set([componentName]);\n }\n\n if (isFlushingPassiveEffects) ; else {\n var previousFiber = current;\n\n try {\n setCurrentFiber(fiber);\n\n error(\"Can't perform a React state update on an unmounted component. This \" + 'is a no-op, but it indicates a memory leak in your application. To ' + 'fix, cancel all subscriptions and asynchronous tasks in %s.', tag === ClassComponent ? 'the componentWillUnmount method' : 'a useEffect cleanup function');\n } finally {\n if (previousFiber) {\n setCurrentFiber(fiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n }\n}\n\nvar beginWork$1;\n\n{\n var dummyFiber = null;\n\n beginWork$1 = function (current, unitOfWork, lanes) {\n \u002F\u002F If a component throws an error, we replay it again in a synchronously\n \u002F\u002F dispatched event, so that the debugger will treat it as an uncaught\n \u002F\u002F error See ReactErrorUtils for more information.\n \u002F\u002F Before entering the begin phase, copy the work-in-progress onto a dummy\n \u002F\u002F fiber. If beginWork throws, we'll use this to reset the state.\n var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork);\n\n try {\n return beginWork(current, unitOfWork, lanes);\n } catch (originalError) {\n if (originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') {\n \u002F\u002F Don't replay promises. Treat everything else like an error.\n throw originalError;\n } \u002F\u002F Keep this code in sync with handleError; any changes here must have\n \u002F\u002F corresponding changes there.\n\n\n resetContextDependencies();\n resetHooksAfterThrow(); \u002F\u002F Don't reset current debug fiber, since we're about to work on the\n \u002F\u002F same fiber again.\n \u002F\u002F Unwind the failed stack frame\n\n unwindInterruptedWork(unitOfWork); \u002F\u002F Restore the original properties of the fiber.\n\n assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy);\n\n if ( unitOfWork.mode & ProfileMode) {\n \u002F\u002F Reset the profiler timer.\n startProfilerTimer(unitOfWork);\n } \u002F\u002F Run beginWork again.\n\n\n invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes);\n\n if (hasCaughtError()) {\n var replayError = clearCaughtError(); \u002F\u002F `invokeGuardedCallback` sometimes sets an expando `_suppressLogging`.\n \u002F\u002F Rethrow this error instead of the original one.\n\n throw replayError;\n } else {\n \u002F\u002F This branch is reachable if the render phase is impure.\n throw originalError;\n }\n }\n };\n}\n\nvar didWarnAboutUpdateInRender = false;\nvar didWarnAboutUpdateInRenderForAnotherComponent;\n\n{\n didWarnAboutUpdateInRenderForAnotherComponent = new Set();\n}\n\nfunction warnAboutRenderPhaseUpdatesInDEV(fiber) {\n {\n if (isRendering && (executionContext & RenderContext) !== NoContext && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) {\n switch (fiber.tag) {\n case FunctionComponent:\n case ForwardRef:\n case SimpleMemoComponent:\n {\n var renderingComponentName = workInProgress && getComponentName(workInProgress.type) || 'Unknown'; \u002F\u002F Dedupe by the rendering component because it's the one that needs to be fixed.\n\n var dedupeKey = renderingComponentName;\n\n if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) {\n didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey);\n var setStateComponentName = getComponentName(fiber.type) || 'Unknown';\n\n error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https:\u002F\u002Freactjs.org\u002Flink\u002Fsetstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName);\n }\n\n break;\n }\n\n case ClassComponent:\n {\n if (!didWarnAboutUpdateInRender) {\n error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.');\n\n didWarnAboutUpdateInRender = true;\n }\n\n break;\n }\n }\n }\n }\n} \u002F\u002F a 'shared' variable that changes when act() opens\u002Fcloses in tests.\n\n\nvar IsThisRendererActing = {\n current: false\n};\nfunction warnIfNotScopedWithMatchingAct(fiber) {\n {\n if ( IsSomeRendererActing.current === true && IsThisRendererActing.current !== true) {\n var previousFiber = current;\n\n try {\n setCurrentFiber(fiber);\n\n error(\"It looks like you're using the wrong act() around your test interactions.\\n\" + 'Be sure to use the matching version of act() corresponding to your renderer:\\n\\n' + '\u002F\u002F for react-dom:\\n' + \u002F\u002F Break up imports to avoid accidentally parsing them as dependencies.\n 'import {act} fr' + \"om 'react-dom\u002Ftest-utils';\\n\" + '\u002F\u002F ...\\n' + 'act(() =\u003E ...);\\n\\n' + '\u002F\u002F for react-test-renderer:\\n' + \u002F\u002F Break up imports to avoid accidentally parsing them as dependencies.\n 'import TestRenderer fr' + \"om react-test-renderer';\\n\" + 'const {act} = TestRenderer;\\n' + '\u002F\u002F ...\\n' + 'act(() =\u003E ...);');\n } finally {\n if (previousFiber) {\n setCurrentFiber(fiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n }\n}\nfunction warnIfNotCurrentlyActingEffectsInDEV(fiber) {\n {\n if ( (fiber.mode & StrictMode) !== NoMode && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n error('An update to %s ran an effect, but was not wrapped in act(...).\\n\\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\\n\\n' + 'act(() =\u003E {\\n' + ' \u002F* fire events that update state *\u002F\\n' + '});\\n' + '\u002F* assert on the output *\u002F\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https:\u002F\u002Freactjs.org\u002Flink\u002Fwrap-tests-with-act', getComponentName(fiber.type));\n }\n }\n}\n\nfunction warnIfNotCurrentlyActingUpdatesInDEV(fiber) {\n {\n if ( executionContext === NoContext && IsSomeRendererActing.current === false && IsThisRendererActing.current === false) {\n var previousFiber = current;\n\n try {\n setCurrentFiber(fiber);\n\n error('An update to %s inside a test was not wrapped in act(...).\\n\\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\\n\\n' + 'act(() =\u003E {\\n' + ' \u002F* fire events that update state *\u002F\\n' + '});\\n' + '\u002F* assert on the output *\u002F\\n\\n' + \"This ensures that you're testing the behavior the user would see \" + 'in the browser.' + ' Learn more at https:\u002F\u002Freactjs.org\u002Flink\u002Fwrap-tests-with-act', getComponentName(fiber.type));\n } finally {\n if (previousFiber) {\n setCurrentFiber(fiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n }\n}\n\nvar warnIfNotCurrentlyActingUpdatesInDev = warnIfNotCurrentlyActingUpdatesInDEV; \u002F\u002F In tests, we want to enforce a mocked scheduler.\n\nvar didWarnAboutUnmockedScheduler = false; \u002F\u002F TODO Before we release concurrent mode, revisit this and decide whether a mocked\n\u002F\u002F scheduler is the actual recommendation. The alternative could be a testing build,\n\u002F\u002F a new lib, or whatever; we dunno just yet. This message is for early adopters\n\u002F\u002F to get their tests right.\n\nfunction warnIfUnmockedScheduler(fiber) {\n {\n if (didWarnAboutUnmockedScheduler === false && Scheduler.unstable_flushAllWithoutAsserting === undefined) {\n if (fiber.mode & BlockingMode || fiber.mode & ConcurrentMode) {\n didWarnAboutUnmockedScheduler = true;\n\n error('In Concurrent or Sync modes, the \"scheduler\" module needs to be mocked ' + 'to guarantee consistent behaviour across tests and browsers. ' + 'For example, with jest: \\n' + \u002F\u002F Break up requires to avoid accidentally parsing them as dependencies.\n \"jest.mock('scheduler', () =\u003E require\" + \"('scheduler\u002Funstable_mock'));\\n\\n\" + 'For more info, visit https:\u002F\u002Freactjs.org\u002Flink\u002Fmock-scheduler');\n }\n }\n }\n}\n\nfunction computeThreadID(root, lane) {\n \u002F\u002F Interaction threads are unique per root and expiration time.\n \u002F\u002F NOTE: Intentionally unsound cast. All that matters is that it's a number\n \u002F\u002F and it represents a batch of work. Could make a helper function instead,\n \u002F\u002F but meh this is fine for now.\n return lane * 1000 + root.interactionThreadID;\n}\n\nfunction markSpawnedWork(lane) {\n\n if (spawnedWorkDuringRender === null) {\n spawnedWorkDuringRender = [lane];\n } else {\n spawnedWorkDuringRender.push(lane);\n }\n}\n\nfunction scheduleInteractions(root, lane, interactions) {\n\n if (interactions.size \u003E 0) {\n var pendingInteractionMap = root.pendingInteractionMap;\n var pendingInteractions = pendingInteractionMap.get(lane);\n\n if (pendingInteractions != null) {\n interactions.forEach(function (interaction) {\n if (!pendingInteractions.has(interaction)) {\n \u002F\u002F Update the pending async work count for previously unscheduled interaction.\n interaction.__count++;\n }\n\n pendingInteractions.add(interaction);\n });\n } else {\n pendingInteractionMap.set(lane, new Set(interactions)); \u002F\u002F Update the pending async work count for the current interactions.\n\n interactions.forEach(function (interaction) {\n interaction.__count++;\n });\n }\n\n var subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null) {\n var threadID = computeThreadID(root, lane);\n subscriber.onWorkScheduled(interactions, threadID);\n }\n }\n}\n\nfunction schedulePendingInteractions(root, lane) {\n\n scheduleInteractions(root, lane, tracing.__interactionsRef.current);\n}\n\nfunction startWorkOnPendingInteractions(root, lanes) {\n \u002F\u002F we can accurately attribute time spent working on it, And so that cascading\n \u002F\u002F work triggered during the render phase will be associated with it.\n\n\n var interactions = new Set();\n root.pendingInteractionMap.forEach(function (scheduledInteractions, scheduledLane) {\n if (includesSomeLane(lanes, scheduledLane)) {\n scheduledInteractions.forEach(function (interaction) {\n return interactions.add(interaction);\n });\n }\n }); \u002F\u002F Store the current set of interactions on the FiberRoot for a few reasons:\n \u002F\u002F We can re-use it in hot functions like performConcurrentWorkOnRoot()\n \u002F\u002F without having to recalculate it. We will also use it in commitWork() to\n \u002F\u002F pass to any Profiler onRender() hooks. This also provides DevTools with a\n \u002F\u002F way to access it when the onCommitRoot() hook is called.\n\n root.memoizedInteractions = interactions;\n\n if (interactions.size \u003E 0) {\n var subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null) {\n var threadID = computeThreadID(root, lanes);\n\n try {\n subscriber.onWorkStarted(interactions, threadID);\n } catch (error) {\n \u002F\u002F If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority$1, function () {\n throw error;\n });\n }\n }\n }\n}\n\nfunction finishPendingInteractions(root, committedLanes) {\n\n var remainingLanesAfterCommit = root.pendingLanes;\n var subscriber;\n\n try {\n subscriber = tracing.__subscriberRef.current;\n\n if (subscriber !== null && root.memoizedInteractions.size \u003E 0) {\n \u002F\u002F FIXME: More than one lane can finish in a single commit.\n var threadID = computeThreadID(root, committedLanes);\n subscriber.onWorkStopped(root.memoizedInteractions, threadID);\n }\n } catch (error) {\n \u002F\u002F If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority$1, function () {\n throw error;\n });\n } finally {\n \u002F\u002F Clear completed interactions from the pending Map.\n \u002F\u002F Unless the render was suspended or cascading work was scheduled,\n \u002F\u002F In which case– leave pending interactions until the subsequent render.\n var pendingInteractionMap = root.pendingInteractionMap;\n pendingInteractionMap.forEach(function (scheduledInteractions, lane) {\n \u002F\u002F Only decrement the pending interaction count if we're done.\n \u002F\u002F If there's still work at the current priority,\n \u002F\u002F That indicates that we are waiting for suspense data.\n if (!includesSomeLane(remainingLanesAfterCommit, lane)) {\n pendingInteractionMap.delete(lane);\n scheduledInteractions.forEach(function (interaction) {\n interaction.__count--;\n\n if (subscriber !== null && interaction.__count === 0) {\n try {\n subscriber.onInteractionScheduledWorkCompleted(interaction);\n } catch (error) {\n \u002F\u002F If the subscriber throws, rethrow it in a separate task\n scheduleCallback(ImmediatePriority$1, function () {\n throw error;\n });\n }\n }\n });\n }\n });\n }\n} \u002F\u002F `act` testing API\n\nfunction shouldForceFlushFallbacksInDEV() {\n \u002F\u002F Never force flush in production. This function should get stripped out.\n return actingUpdatesScopeDepth \u003E 0;\n}\n\u002F\u002F so we can tell if any async act() calls try to run in parallel.\n\n\nvar actingUpdatesScopeDepth = 0;\n\nfunction detachFiberAfterEffects(fiber) {\n fiber.sibling = null;\n fiber.stateNode = null;\n}\n\nvar resolveFamily = null; \u002F\u002F $FlowFixMe Flow gets confused by a WeakSet feature check below.\n\nvar failedBoundaries = null;\nvar setRefreshHandler = function (handler) {\n {\n resolveFamily = handler;\n }\n};\nfunction resolveFunctionForHotReloading(type) {\n {\n if (resolveFamily === null) {\n \u002F\u002F Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n return type;\n } \u002F\u002F Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction resolveClassForHotReloading(type) {\n \u002F\u002F No implementation differences.\n return resolveFunctionForHotReloading(type);\n}\nfunction resolveForwardRefForHotReloading(type) {\n {\n if (resolveFamily === null) {\n \u002F\u002F Hot reloading is disabled.\n return type;\n }\n\n var family = resolveFamily(type);\n\n if (family === undefined) {\n \u002F\u002F Check if we're dealing with a real forwardRef. Don't want to crash early.\n if (type !== null && type !== undefined && typeof type.render === 'function') {\n \u002F\u002F ForwardRef is special because its resolved .type is an object,\n \u002F\u002F but it's possible that we only have its inner render function in the map.\n \u002F\u002F If that inner render function is different, we'll build a new forwardRef type.\n var currentRender = resolveFunctionForHotReloading(type.render);\n\n if (type.render !== currentRender) {\n var syntheticType = {\n $typeof: REACT_FORWARD_REF_TYPE,\n render: currentRender\n };\n\n if (type.displayName !== undefined) {\n syntheticType.displayName = type.displayName;\n }\n\n return syntheticType;\n }\n }\n\n return type;\n } \u002F\u002F Use the latest known implementation.\n\n\n return family.current;\n }\n}\nfunction isCompatibleFamilyForHotReloading(fiber, element) {\n {\n if (resolveFamily === null) {\n \u002F\u002F Hot reloading is disabled.\n return false;\n }\n\n var prevType = fiber.elementType;\n var nextType = element.type; \u002F\u002F If we got here, we know types aren't === equal.\n\n var needsCompareFamilies = false;\n var $typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$typeof : null;\n\n switch (fiber.tag) {\n case ClassComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case FunctionComponent:\n {\n if (typeof nextType === 'function') {\n needsCompareFamilies = true;\n } else if ($typeofNextType === REACT_LAZY_TYPE) {\n \u002F\u002F We don't know the inner type yet.\n \u002F\u002F We're going to assume that the lazy inner type is stable,\n \u002F\u002F and so it is sufficient to avoid reconciling it away.\n \u002F\u002F We're not going to unwrap or actually use the new lazy type.\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case ForwardRef:\n {\n if ($typeofNextType === REACT_FORWARD_REF_TYPE) {\n needsCompareFamilies = true;\n } else if ($typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n case MemoComponent:\n case SimpleMemoComponent:\n {\n if ($typeofNextType === REACT_MEMO_TYPE) {\n \u002F\u002F TODO: if it was but can no longer be simple,\n \u002F\u002F we shouldn't set this.\n needsCompareFamilies = true;\n } else if ($typeofNextType === REACT_LAZY_TYPE) {\n needsCompareFamilies = true;\n }\n\n break;\n }\n\n default:\n return false;\n } \u002F\u002F Check if both types have a family and it's the same one.\n\n\n if (needsCompareFamilies) {\n \u002F\u002F Note: memo() and forwardRef() we'll compare outer rather than inner type.\n \u002F\u002F This means both of them need to be registered to preserve state.\n \u002F\u002F If we unwrapped and compared the inner types for wrappers instead,\n \u002F\u002F then we would risk falsely saying two separate memo(Foo)\n \u002F\u002F calls are equivalent because they wrap the same Foo function.\n var prevFamily = resolveFamily(prevType);\n\n if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) {\n return true;\n }\n }\n\n return false;\n }\n}\nfunction markFailedErrorBoundaryForHotReloading(fiber) {\n {\n if (resolveFamily === null) {\n \u002F\u002F Hot reloading is disabled.\n return;\n }\n\n if (typeof WeakSet !== 'function') {\n return;\n }\n\n if (failedBoundaries === null) {\n failedBoundaries = new WeakSet();\n }\n\n failedBoundaries.add(fiber);\n }\n}\nvar scheduleRefresh = function (root, update) {\n {\n if (resolveFamily === null) {\n \u002F\u002F Hot reloading is disabled.\n return;\n }\n\n var staleFamilies = update.staleFamilies,\n updatedFamilies = update.updatedFamilies;\n flushPassiveEffects();\n flushSync(function () {\n scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);\n });\n }\n};\nvar scheduleRoot = function (root, element) {\n {\n if (root.context !== emptyContextObject) {\n \u002F\u002F Super edge case: root has a legacy _renderSubtree context\n \u002F\u002F but we don't know the parentComponent so we can't pass it.\n \u002F\u002F Just ignore. We'll delete this with _renderSubtree code path later.\n return;\n }\n\n flushPassiveEffects();\n flushSync(function () {\n updateContainer(element, root, null, null);\n });\n }\n};\n\nfunction scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {\n {\n var alternate = fiber.alternate,\n child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n if (resolveFamily === null) {\n throw new Error('Expected resolveFamily to be set during hot reload.');\n }\n\n var needsRender = false;\n var needsRemount = false;\n\n if (candidateType !== null) {\n var family = resolveFamily(candidateType);\n\n if (family !== undefined) {\n if (staleFamilies.has(family)) {\n needsRemount = true;\n } else if (updatedFamilies.has(family)) {\n if (tag === ClassComponent) {\n needsRemount = true;\n } else {\n needsRender = true;\n }\n }\n }\n }\n\n if (failedBoundaries !== null) {\n if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) {\n needsRemount = true;\n }\n }\n\n if (needsRemount) {\n fiber._debugNeedsRemount = true;\n }\n\n if (needsRemount || needsRender) {\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n }\n\n if (child !== null && !needsRemount) {\n scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);\n }\n\n if (sibling !== null) {\n scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);\n }\n }\n}\n\nvar findHostInstancesForRefresh = function (root, families) {\n {\n var hostInstances = new Set();\n var types = new Set(families.map(function (family) {\n return family.current;\n }));\n findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances);\n return hostInstances;\n }\n};\n\nfunction findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {\n {\n var child = fiber.child,\n sibling = fiber.sibling,\n tag = fiber.tag,\n type = fiber.type;\n var candidateType = null;\n\n switch (tag) {\n case FunctionComponent:\n case SimpleMemoComponent:\n case ClassComponent:\n candidateType = type;\n break;\n\n case ForwardRef:\n candidateType = type.render;\n break;\n }\n\n var didMatch = false;\n\n if (candidateType !== null) {\n if (types.has(candidateType)) {\n didMatch = true;\n }\n }\n\n if (didMatch) {\n \u002F\u002F We have a match. This only drills down to the closest host components.\n \u002F\u002F There's no need to search deeper because for the purpose of giving\n \u002F\u002F visual feedback, \"flashing\" outermost parent rectangles is sufficient.\n findHostInstancesForFiberShallowly(fiber, hostInstances);\n } else {\n \u002F\u002F If there's no match, maybe there will be one further down in the child tree.\n if (child !== null) {\n findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);\n }\n }\n\n if (sibling !== null) {\n findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances);\n }\n }\n}\n\nfunction findHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances);\n\n if (foundHostInstances) {\n return;\n } \u002F\u002F If we didn't find any host children, fallback to closest host parent.\n\n\n var node = fiber;\n\n while (true) {\n switch (node.tag) {\n case HostComponent:\n hostInstances.add(node.stateNode);\n return;\n\n case HostPortal:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n\n case HostRoot:\n hostInstances.add(node.stateNode.containerInfo);\n return;\n }\n\n if (node.return === null) {\n throw new Error('Expected to reach root first.');\n }\n\n node = node.return;\n }\n }\n}\n\nfunction findChildHostInstancesForFiberShallowly(fiber, hostInstances) {\n {\n var node = fiber;\n var foundHostInstances = false;\n\n while (true) {\n if (node.tag === HostComponent) {\n \u002F\u002F We got a match.\n foundHostInstances = true;\n hostInstances.add(node.stateNode); \u002F\u002F There may still be more, so keep searching.\n } else if (node.child !== null) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === fiber) {\n return foundHostInstances;\n }\n\n while (node.sibling === null) {\n if (node.return === null || node.return === fiber) {\n return foundHostInstances;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n }\n }\n\n return false;\n}\n\nvar hasBadMapPolyfill;\n\n{\n hasBadMapPolyfill = false;\n\n try {\n var nonExtensibleObject = Object.preventExtensions({});\n \u002F* eslint-disable no-new *\u002F\n\n new Map([[nonExtensibleObject, null]]);\n new Set([nonExtensibleObject]);\n \u002F* eslint-enable no-new *\u002F\n } catch (e) {\n \u002F\u002F TODO: Consider warning about bad polyfills\n hasBadMapPolyfill = true;\n }\n}\n\nvar debugCounter = 1;\n\nfunction FiberNode(tag, pendingProps, key, mode) {\n \u002F\u002F Instance\n this.tag = tag;\n this.key = key;\n this.elementType = null;\n this.type = null;\n this.stateNode = null; \u002F\u002F Fiber\n\n this.return = null;\n this.child = null;\n this.sibling = null;\n this.index = 0;\n this.ref = null;\n this.pendingProps = pendingProps;\n this.memoizedProps = null;\n this.updateQueue = null;\n this.memoizedState = null;\n this.dependencies = null;\n this.mode = mode; \u002F\u002F Effects\n\n this.flags = NoFlags;\n this.nextEffect = null;\n this.firstEffect = null;\n this.lastEffect = null;\n this.lanes = NoLanes;\n this.childLanes = NoLanes;\n this.alternate = null;\n\n {\n \u002F\u002F Note: The following is done to avoid a v8 performance cliff.\n \u002F\u002F\n \u002F\u002F Initializing the fields below to smis and later updating them with\n \u002F\u002F double values will cause Fibers to end up having separate shapes.\n \u002F\u002F This behavior\u002Fbug has something to do with Object.preventExtension().\n \u002F\u002F Fortunately this only impacts DEV builds.\n \u002F\u002F Unfortunately it makes React unusably slow for some applications.\n \u002F\u002F To work around this, initialize the fields below with doubles.\n \u002F\u002F\n \u002F\u002F Learn more about this here:\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F14365\n \u002F\u002F https:\u002F\u002Fbugs.chromium.org\u002Fp\u002Fv8\u002Fissues\u002Fdetail?id=8538\n this.actualDuration = Number.NaN;\n this.actualStartTime = Number.NaN;\n this.selfBaseDuration = Number.NaN;\n this.treeBaseDuration = Number.NaN; \u002F\u002F It's okay to replace the initial doubles with smis after initialization.\n \u002F\u002F This won't trigger the performance cliff mentioned above,\n \u002F\u002F and it simplifies other profiler code (including DevTools).\n\n this.actualDuration = 0;\n this.actualStartTime = -1;\n this.selfBaseDuration = 0;\n this.treeBaseDuration = 0;\n }\n\n {\n \u002F\u002F This isn't directly used but is handy for debugging internals:\n this._debugID = debugCounter++;\n this._debugSource = null;\n this._debugOwner = null;\n this._debugNeedsRemount = false;\n this._debugHookTypes = null;\n\n if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') {\n Object.preventExtensions(this);\n }\n }\n} \u002F\u002F This is a constructor function, rather than a POJO constructor, still\n\u002F\u002F please ensure we do the following:\n\u002F\u002F 1) Nobody should add any instance methods on this. Instance methods can be\n\u002F\u002F more difficult to predict when they get optimized and they are almost\n\u002F\u002F never inlined properly in static compilers.\n\u002F\u002F 2) Nobody should rely on `instanceof Fiber` for type testing. We should\n\u002F\u002F always know when it is a fiber.\n\u002F\u002F 3) We might want to experiment with using numeric keys since they are easier\n\u002F\u002F to optimize in a non-JIT environment.\n\u002F\u002F 4) We can easily go from a constructor to a createFiber object literal if that\n\u002F\u002F is faster.\n\u002F\u002F 5) It should be easy to port this to a C struct and keep a C implementation\n\u002F\u002F compatible.\n\n\nvar createFiber = function (tag, pendingProps, key, mode) {\n \u002F\u002F $FlowFixMe: the shapes are exact here but Flow doesn't like constructors\n return new FiberNode(tag, pendingProps, key, mode);\n};\n\nfunction shouldConstruct$1(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction isSimpleFunctionComponent(type) {\n return typeof type === 'function' && !shouldConstruct$1(type) && type.defaultProps === undefined;\n}\nfunction resolveLazyComponentTag(Component) {\n if (typeof Component === 'function') {\n return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent;\n } else if (Component !== undefined && Component !== null) {\n var $typeof = Component.$typeof;\n\n if ($typeof === REACT_FORWARD_REF_TYPE) {\n return ForwardRef;\n }\n\n if ($typeof === REACT_MEMO_TYPE) {\n return MemoComponent;\n }\n }\n\n return IndeterminateComponent;\n} \u002F\u002F This is used to create an alternate fiber to do work on.\n\nfunction createWorkInProgress(current, pendingProps) {\n var workInProgress = current.alternate;\n\n if (workInProgress === null) {\n \u002F\u002F We use a double buffering pooling technique because we know that we'll\n \u002F\u002F only ever need at most two versions of a tree. We pool the \"other\" unused\n \u002F\u002F node that we're free to reuse. This is lazily created to avoid allocating\n \u002F\u002F extra objects for things that are never updated. It also allow us to\n \u002F\u002F reclaim the extra memory if needed.\n workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode);\n workInProgress.elementType = current.elementType;\n workInProgress.type = current.type;\n workInProgress.stateNode = current.stateNode;\n\n {\n \u002F\u002F DEV-only fields\n workInProgress._debugID = current._debugID;\n workInProgress._debugSource = current._debugSource;\n workInProgress._debugOwner = current._debugOwner;\n workInProgress._debugHookTypes = current._debugHookTypes;\n }\n\n workInProgress.alternate = current;\n current.alternate = workInProgress;\n } else {\n workInProgress.pendingProps = pendingProps; \u002F\u002F Needed because Blocks store data on type.\n\n workInProgress.type = current.type; \u002F\u002F We already have an alternate.\n \u002F\u002F Reset the effect tag.\n\n workInProgress.flags = NoFlags; \u002F\u002F The effect list is no longer valid.\n\n workInProgress.nextEffect = null;\n workInProgress.firstEffect = null;\n workInProgress.lastEffect = null;\n\n {\n \u002F\u002F We intentionally reset, rather than copy, actualDuration & actualStartTime.\n \u002F\u002F This prevents time from endlessly accumulating in new commits.\n \u002F\u002F This has the downside of resetting values for different priority renders,\n \u002F\u002F But works for yielding (the common case) and should support resuming.\n workInProgress.actualDuration = 0;\n workInProgress.actualStartTime = -1;\n }\n }\n\n workInProgress.childLanes = current.childLanes;\n workInProgress.lanes = current.lanes;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; \u002F\u002F Clone the dependencies object. This is mutated during the render phase, so\n \u002F\u002F it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n lanes: currentDependencies.lanes,\n firstContext: currentDependencies.firstContext\n }; \u002F\u002F These will be overridden during the parent's reconciliation\n\n workInProgress.sibling = current.sibling;\n workInProgress.index = current.index;\n workInProgress.ref = current.ref;\n\n {\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n\n {\n workInProgress._debugNeedsRemount = current._debugNeedsRemount;\n\n switch (workInProgress.tag) {\n case IndeterminateComponent:\n case FunctionComponent:\n case SimpleMemoComponent:\n workInProgress.type = resolveFunctionForHotReloading(current.type);\n break;\n\n case ClassComponent:\n workInProgress.type = resolveClassForHotReloading(current.type);\n break;\n\n case ForwardRef:\n workInProgress.type = resolveForwardRefForHotReloading(current.type);\n break;\n }\n }\n\n return workInProgress;\n} \u002F\u002F Used to reuse a Fiber for a second pass.\n\nfunction resetWorkInProgress(workInProgress, renderLanes) {\n \u002F\u002F This resets the Fiber to what createFiber or createWorkInProgress would\n \u002F\u002F have set the values to before during the first pass. Ideally this wouldn't\n \u002F\u002F be necessary but unfortunately many code paths reads from the workInProgress\n \u002F\u002F when they should be reading from current and writing to workInProgress.\n \u002F\u002F We assume pendingProps, index, key, ref, return are still untouched to\n \u002F\u002F avoid doing another reconciliation.\n \u002F\u002F Reset the effect tag but keep any Placement tags, since that's something\n \u002F\u002F that child fiber is setting, not the reconciliation.\n workInProgress.flags &= Placement; \u002F\u002F The effect list is no longer valid.\n\n workInProgress.nextEffect = null;\n workInProgress.firstEffect = null;\n workInProgress.lastEffect = null;\n var current = workInProgress.alternate;\n\n if (current === null) {\n \u002F\u002F Reset to createFiber's initial values.\n workInProgress.childLanes = NoLanes;\n workInProgress.lanes = renderLanes;\n workInProgress.child = null;\n workInProgress.memoizedProps = null;\n workInProgress.memoizedState = null;\n workInProgress.updateQueue = null;\n workInProgress.dependencies = null;\n workInProgress.stateNode = null;\n\n {\n \u002F\u002F Note: We don't reset the actualTime counts. It's useful to accumulate\n \u002F\u002F actual time across multiple render passes.\n workInProgress.selfBaseDuration = 0;\n workInProgress.treeBaseDuration = 0;\n }\n } else {\n \u002F\u002F Reset to the cloned values that createWorkInProgress would've.\n workInProgress.childLanes = current.childLanes;\n workInProgress.lanes = current.lanes;\n workInProgress.child = current.child;\n workInProgress.memoizedProps = current.memoizedProps;\n workInProgress.memoizedState = current.memoizedState;\n workInProgress.updateQueue = current.updateQueue; \u002F\u002F Needed because Blocks store data on type.\n\n workInProgress.type = current.type; \u002F\u002F Clone the dependencies object. This is mutated during the render phase, so\n \u002F\u002F it cannot be shared with the current fiber.\n\n var currentDependencies = current.dependencies;\n workInProgress.dependencies = currentDependencies === null ? null : {\n lanes: currentDependencies.lanes,\n firstContext: currentDependencies.firstContext\n };\n\n {\n \u002F\u002F Note: We don't reset the actualTime counts. It's useful to accumulate\n \u002F\u002F actual time across multiple render passes.\n workInProgress.selfBaseDuration = current.selfBaseDuration;\n workInProgress.treeBaseDuration = current.treeBaseDuration;\n }\n }\n\n return workInProgress;\n}\nfunction createHostRootFiber(tag) {\n var mode;\n\n if (tag === ConcurrentRoot) {\n mode = ConcurrentMode | BlockingMode | StrictMode;\n } else if (tag === BlockingRoot) {\n mode = BlockingMode | StrictMode;\n } else {\n mode = NoMode;\n }\n\n if ( isDevToolsPresent) {\n \u002F\u002F Always collect profile timings when DevTools are present.\n \u002F\u002F This enables DevTools to start capturing timing at any point–\n \u002F\u002F Without some nodes in the tree having empty base times.\n mode |= ProfileMode;\n }\n\n return createFiber(HostRoot, null, null, mode);\n}\nfunction createFiberFromTypeAndProps(type, \u002F\u002F React$ElementType\nkey, pendingProps, owner, mode, lanes) {\n var fiberTag = IndeterminateComponent; \u002F\u002F The resolved type is set if we know what the final type will be. I.e. it's not lazy.\n\n var resolvedType = type;\n\n if (typeof type === 'function') {\n if (shouldConstruct$1(type)) {\n fiberTag = ClassComponent;\n\n {\n resolvedType = resolveClassForHotReloading(resolvedType);\n }\n } else {\n {\n resolvedType = resolveFunctionForHotReloading(resolvedType);\n }\n }\n } else if (typeof type === 'string') {\n fiberTag = HostComponent;\n } else {\n getTag: switch (type) {\n case REACT_FRAGMENT_TYPE:\n return createFiberFromFragment(pendingProps.children, mode, lanes, key);\n\n case REACT_DEBUG_TRACING_MODE_TYPE:\n fiberTag = Mode;\n mode |= DebugTracingMode;\n break;\n\n case REACT_STRICT_MODE_TYPE:\n fiberTag = Mode;\n mode |= StrictMode;\n break;\n\n case REACT_PROFILER_TYPE:\n return createFiberFromProfiler(pendingProps, mode, lanes, key);\n\n case REACT_SUSPENSE_TYPE:\n return createFiberFromSuspense(pendingProps, mode, lanes, key);\n\n case REACT_SUSPENSE_LIST_TYPE:\n return createFiberFromSuspenseList(pendingProps, mode, lanes, key);\n\n case REACT_OFFSCREEN_TYPE:\n return createFiberFromOffscreen(pendingProps, mode, lanes, key);\n\n case REACT_LEGACY_HIDDEN_TYPE:\n return createFiberFromLegacyHidden(pendingProps, mode, lanes, key);\n\n case REACT_SCOPE_TYPE:\n\n \u002F\u002F eslint-disable-next-line no-fallthrough\n\n default:\n {\n if (typeof type === 'object' && type !== null) {\n switch (type.$typeof) {\n case REACT_PROVIDER_TYPE:\n fiberTag = ContextProvider;\n break getTag;\n\n case REACT_CONTEXT_TYPE:\n \u002F\u002F This is a consumer\n fiberTag = ContextConsumer;\n break getTag;\n\n case REACT_FORWARD_REF_TYPE:\n fiberTag = ForwardRef;\n\n {\n resolvedType = resolveForwardRefForHotReloading(resolvedType);\n }\n\n break getTag;\n\n case REACT_MEMO_TYPE:\n fiberTag = MemoComponent;\n break getTag;\n\n case REACT_LAZY_TYPE:\n fiberTag = LazyComponent;\n resolvedType = null;\n break getTag;\n\n case REACT_BLOCK_TYPE:\n fiberTag = Block;\n break getTag;\n }\n }\n\n var info = '';\n\n {\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and \" + 'named imports.';\n }\n\n var ownerName = owner ? getComponentName(owner.type) : null;\n\n if (ownerName) {\n info += '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n }\n\n {\n {\n throw Error( \"Element type is invalid: expected a string (for built-in components) or a class\u002Ffunction (for composite components) but got: \" + (type == null ? type : typeof type) + \".\" + info );\n }\n }\n }\n }\n }\n\n var fiber = createFiber(fiberTag, pendingProps, key, mode);\n fiber.elementType = type;\n fiber.type = resolvedType;\n fiber.lanes = lanes;\n\n {\n fiber._debugOwner = owner;\n }\n\n return fiber;\n}\nfunction createFiberFromElement(element, mode, lanes) {\n var owner = null;\n\n {\n owner = element._owner;\n }\n\n var type = element.type;\n var key = element.key;\n var pendingProps = element.props;\n var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes);\n\n {\n fiber._debugSource = element._source;\n fiber._debugOwner = element._owner;\n }\n\n return fiber;\n}\nfunction createFiberFromFragment(elements, mode, lanes, key) {\n var fiber = createFiber(Fragment, elements, key, mode);\n fiber.lanes = lanes;\n return fiber;\n}\n\nfunction createFiberFromProfiler(pendingProps, mode, lanes, key) {\n {\n if (typeof pendingProps.id !== 'string') {\n error('Profiler must specify an \"id\" as a prop');\n }\n }\n\n var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); \u002F\u002F TODO: The Profiler fiber shouldn't have a type. It has a tag.\n\n fiber.elementType = REACT_PROFILER_TYPE;\n fiber.type = REACT_PROFILER_TYPE;\n fiber.lanes = lanes;\n\n {\n fiber.stateNode = {\n effectDuration: 0,\n passiveEffectDuration: 0\n };\n }\n\n return fiber;\n}\n\nfunction createFiberFromSuspense(pendingProps, mode, lanes, key) {\n var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); \u002F\u002F TODO: The SuspenseComponent fiber shouldn't have a type. It has a tag.\n \u002F\u002F This needs to be fixed in getComponentName so that it relies on the tag\n \u002F\u002F instead.\n\n fiber.type = REACT_SUSPENSE_TYPE;\n fiber.elementType = REACT_SUSPENSE_TYPE;\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromSuspenseList(pendingProps, mode, lanes, key) {\n var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode);\n\n {\n \u002F\u002F TODO: The SuspenseListComponent fiber shouldn't have a type. It has a tag.\n \u002F\u002F This needs to be fixed in getComponentName so that it relies on the tag\n \u002F\u002F instead.\n fiber.type = REACT_SUSPENSE_LIST_TYPE;\n }\n\n fiber.elementType = REACT_SUSPENSE_LIST_TYPE;\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromOffscreen(pendingProps, mode, lanes, key) {\n var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); \u002F\u002F TODO: The OffscreenComponent fiber shouldn't have a type. It has a tag.\n \u002F\u002F This needs to be fixed in getComponentName so that it relies on the tag\n \u002F\u002F instead.\n\n {\n fiber.type = REACT_OFFSCREEN_TYPE;\n }\n\n fiber.elementType = REACT_OFFSCREEN_TYPE;\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromLegacyHidden(pendingProps, mode, lanes, key) {\n var fiber = createFiber(LegacyHiddenComponent, pendingProps, key, mode); \u002F\u002F TODO: The LegacyHidden fiber shouldn't have a type. It has a tag.\n \u002F\u002F This needs to be fixed in getComponentName so that it relies on the tag\n \u002F\u002F instead.\n\n {\n fiber.type = REACT_LEGACY_HIDDEN_TYPE;\n }\n\n fiber.elementType = REACT_LEGACY_HIDDEN_TYPE;\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromText(content, mode, lanes) {\n var fiber = createFiber(HostText, content, null, mode);\n fiber.lanes = lanes;\n return fiber;\n}\nfunction createFiberFromHostInstanceForDeletion() {\n var fiber = createFiber(HostComponent, null, null, NoMode); \u002F\u002F TODO: These should not need a type.\n\n fiber.elementType = 'DELETED';\n fiber.type = 'DELETED';\n return fiber;\n}\nfunction createFiberFromPortal(portal, mode, lanes) {\n var pendingProps = portal.children !== null ? portal.children : [];\n var fiber = createFiber(HostPortal, pendingProps, portal.key, mode);\n fiber.lanes = lanes;\n fiber.stateNode = {\n containerInfo: portal.containerInfo,\n pendingChildren: null,\n \u002F\u002F Used by persistent updates\n implementation: portal.implementation\n };\n return fiber;\n} \u002F\u002F Used for stashing WIP properties to replay failed work in DEV.\n\nfunction assignFiberPropertiesInDEV(target, source) {\n if (target === null) {\n \u002F\u002F This Fiber's initial properties will always be overwritten.\n \u002F\u002F We only use a Fiber to ensure the same hidden class so DEV isn't slow.\n target = createFiber(IndeterminateComponent, null, null, NoMode);\n } \u002F\u002F This is intentionally written as a list of all properties.\n \u002F\u002F We tried to use Object.assign() instead but this is called in\n \u002F\u002F the hottest path, and Object.assign() was too slow:\n \u002F\u002F https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F12502\n \u002F\u002F This code is DEV-only so size is not a concern.\n\n\n target.tag = source.tag;\n target.key = source.key;\n target.elementType = source.elementType;\n target.type = source.type;\n target.stateNode = source.stateNode;\n target.return = source.return;\n target.child = source.child;\n target.sibling = source.sibling;\n target.index = source.index;\n target.ref = source.ref;\n target.pendingProps = source.pendingProps;\n target.memoizedProps = source.memoizedProps;\n target.updateQueue = source.updateQueue;\n target.memoizedState = source.memoizedState;\n target.dependencies = source.dependencies;\n target.mode = source.mode;\n target.flags = source.flags;\n target.nextEffect = source.nextEffect;\n target.firstEffect = source.firstEffect;\n target.lastEffect = source.lastEffect;\n target.lanes = source.lanes;\n target.childLanes = source.childLanes;\n target.alternate = source.alternate;\n\n {\n target.actualDuration = source.actualDuration;\n target.actualStartTime = source.actualStartTime;\n target.selfBaseDuration = source.selfBaseDuration;\n target.treeBaseDuration = source.treeBaseDuration;\n }\n\n target._debugID = source._debugID;\n target._debugSource = source._debugSource;\n target._debugOwner = source._debugOwner;\n target._debugNeedsRemount = source._debugNeedsRemount;\n target._debugHookTypes = source._debugHookTypes;\n return target;\n}\n\nfunction FiberRootNode(containerInfo, tag, hydrate) {\n this.tag = tag;\n this.containerInfo = containerInfo;\n this.pendingChildren = null;\n this.current = null;\n this.pingCache = null;\n this.finishedWork = null;\n this.timeoutHandle = noTimeout;\n this.context = null;\n this.pendingContext = null;\n this.hydrate = hydrate;\n this.callbackNode = null;\n this.callbackPriority = NoLanePriority;\n this.eventTimes = createLaneMap(NoLanes);\n this.expirationTimes = createLaneMap(NoTimestamp);\n this.pendingLanes = NoLanes;\n this.suspendedLanes = NoLanes;\n this.pingedLanes = NoLanes;\n this.expiredLanes = NoLanes;\n this.mutableReadLanes = NoLanes;\n this.finishedLanes = NoLanes;\n this.entangledLanes = NoLanes;\n this.entanglements = createLaneMap(NoLanes);\n\n {\n this.mutableSourceEagerHydrationData = null;\n }\n\n {\n this.interactionThreadID = tracing.unstable_getThreadID();\n this.memoizedInteractions = new Set();\n this.pendingInteractionMap = new Map();\n }\n\n {\n switch (tag) {\n case BlockingRoot:\n this._debugRootType = 'createBlockingRoot()';\n break;\n\n case ConcurrentRoot:\n this._debugRootType = 'createRoot()';\n break;\n\n case LegacyRoot:\n this._debugRootType = 'createLegacyRoot()';\n break;\n }\n }\n}\n\nfunction createFiberRoot(containerInfo, tag, hydrate, hydrationCallbacks) {\n var root = new FiberRootNode(containerInfo, tag, hydrate);\n \u002F\u002F stateNode is any.\n\n\n var uninitializedFiber = createHostRootFiber(tag);\n root.current = uninitializedFiber;\n uninitializedFiber.stateNode = root;\n initializeUpdateQueue(uninitializedFiber);\n return root;\n}\n\n\u002F\u002F This ensures that the version used for server rendering matches the one\n\u002F\u002F that is eventually read during hydration.\n\u002F\u002F If they don't match there's a potential tear and a full deopt render is required.\n\nfunction registerMutableSourceForHydration(root, mutableSource) {\n var getVersion = mutableSource._getVersion;\n var version = getVersion(mutableSource._source); \u002F\u002F TODO Clear this data once all pending hydration work is finished.\n \u002F\u002F Retaining it forever may interfere with GC.\n\n if (root.mutableSourceEagerHydrationData == null) {\n root.mutableSourceEagerHydrationData = [mutableSource, version];\n } else {\n root.mutableSourceEagerHydrationData.push(mutableSource, version);\n }\n}\n\nfunction createPortal(children, containerInfo, \u002F\u002F TODO: figure out the API for cross-renderer implementation.\nimplementation) {\n var key = arguments.length \u003E 3 && arguments[3] !== undefined ? arguments[3] : null;\n return {\n \u002F\u002F This tag allow us to uniquely identify this as a React Portal\n $typeof: REACT_PORTAL_TYPE,\n key: key == null ? null : '' + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\n\nvar didWarnAboutNestedUpdates;\nvar didWarnAboutFindNodeInStrictMode;\n\n{\n didWarnAboutNestedUpdates = false;\n didWarnAboutFindNodeInStrictMode = {};\n}\n\nfunction getContextForSubtree(parentComponent) {\n if (!parentComponent) {\n return emptyContextObject;\n }\n\n var fiber = get(parentComponent);\n var parentContext = findCurrentUnmaskedContext(fiber);\n\n if (fiber.tag === ClassComponent) {\n var Component = fiber.type;\n\n if (isContextProvider(Component)) {\n return processChildContext(fiber, Component, parentContext);\n }\n }\n\n return parentContext;\n}\n\nfunction findHostInstanceWithWarning(component, methodName) {\n {\n var fiber = get(component);\n\n if (fiber === undefined) {\n if (typeof component.render === 'function') {\n {\n {\n throw Error( \"Unable to find node on an unmounted component.\" );\n }\n }\n } else {\n {\n {\n throw Error( \"Argument appears to not be a ReactComponent. Keys: \" + Object.keys(component) );\n }\n }\n }\n }\n\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n if (hostFiber.mode & StrictMode) {\n var componentName = getComponentName(fiber.type) || 'Component';\n\n if (!didWarnAboutFindNodeInStrictMode[componentName]) {\n didWarnAboutFindNodeInStrictMode[componentName] = true;\n var previousFiber = current;\n\n try {\n setCurrentFiber(hostFiber);\n\n if (fiber.mode & StrictMode) {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Fstrict-mode-find-node', methodName, methodName, componentName);\n } else {\n error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Fstrict-mode-find-node', methodName, methodName, componentName);\n }\n } finally {\n \u002F\u002F Ideally this should reset to previous but this shouldn't be called in\n \u002F\u002F render and there's another warning for that anyway.\n if (previousFiber) {\n setCurrentFiber(previousFiber);\n } else {\n resetCurrentFiber();\n }\n }\n }\n }\n\n return hostFiber.stateNode;\n }\n}\n\nfunction createContainer(containerInfo, tag, hydrate, hydrationCallbacks) {\n return createFiberRoot(containerInfo, tag, hydrate);\n}\nfunction updateContainer(element, container, parentComponent, callback) {\n {\n onScheduleRoot(container, element);\n }\n\n var current$1 = container.current;\n var eventTime = requestEventTime();\n\n {\n \u002F\u002F $FlowExpectedError - jest isn't a global, and isn't recognized outside of tests\n if ('undefined' !== typeof jest) {\n warnIfUnmockedScheduler(current$1);\n warnIfNotScopedWithMatchingAct(current$1);\n }\n }\n\n var lane = requestUpdateLane(current$1);\n\n var context = getContextForSubtree(parentComponent);\n\n if (container.context === null) {\n container.context = context;\n } else {\n container.pendingContext = context;\n }\n\n {\n if (isRendering && current !== null && !didWarnAboutNestedUpdates) {\n didWarnAboutNestedUpdates = true;\n\n error('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(current.type) || 'Unknown');\n }\n }\n\n var update = createUpdate(eventTime, lane); \u002F\u002F Caution: React DevTools currently depends on this property\n \u002F\u002F being called \"element\".\n\n update.payload = {\n element: element\n };\n callback = callback === undefined ? null : callback;\n\n if (callback !== null) {\n {\n if (typeof callback !== 'function') {\n error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback);\n }\n }\n\n update.callback = callback;\n }\n\n enqueueUpdate(current$1, update);\n scheduleUpdateOnFiber(current$1, lane, eventTime);\n return lane;\n}\nfunction getPublicRootInstance(container) {\n var containerFiber = container.current;\n\n if (!containerFiber.child) {\n return null;\n }\n\n switch (containerFiber.child.tag) {\n case HostComponent:\n return getPublicInstance(containerFiber.child.stateNode);\n\n default:\n return containerFiber.child.stateNode;\n }\n}\n\nfunction markRetryLaneImpl(fiber, retryLane) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState !== null && suspenseState.dehydrated !== null) {\n suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane);\n }\n} \u002F\u002F Increases the priority of thennables when they resolve within this boundary.\n\n\nfunction markRetryLaneIfNotHydrated(fiber, retryLane) {\n markRetryLaneImpl(fiber, retryLane);\n var alternate = fiber.alternate;\n\n if (alternate) {\n markRetryLaneImpl(alternate, retryLane);\n }\n}\n\nfunction attemptUserBlockingHydration$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n \u002F\u002F We ignore HostRoots here because we can't increase\n \u002F\u002F their priority and they should not suspend on I\u002FO,\n \u002F\u002F since you have to wrap anything that might suspend in\n \u002F\u002F Suspense.\n return;\n }\n\n var eventTime = requestEventTime();\n var lane = InputDiscreteHydrationLane;\n scheduleUpdateOnFiber(fiber, lane, eventTime);\n markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction attemptContinuousHydration$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n \u002F\u002F We ignore HostRoots here because we can't increase\n \u002F\u002F their priority and they should not suspend on I\u002FO,\n \u002F\u002F since you have to wrap anything that might suspend in\n \u002F\u002F Suspense.\n return;\n }\n\n var eventTime = requestEventTime();\n var lane = SelectiveHydrationLane;\n scheduleUpdateOnFiber(fiber, lane, eventTime);\n markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction attemptHydrationAtCurrentPriority$1(fiber) {\n if (fiber.tag !== SuspenseComponent) {\n \u002F\u002F We ignore HostRoots here because we can't increase\n \u002F\u002F their priority other than synchronously flush it.\n return;\n }\n\n var eventTime = requestEventTime();\n var lane = requestUpdateLane(fiber);\n scheduleUpdateOnFiber(fiber, lane, eventTime);\n markRetryLaneIfNotHydrated(fiber, lane);\n}\nfunction runWithPriority$2(priority, fn) {\n\n try {\n setCurrentUpdateLanePriority(priority);\n return fn();\n } finally {\n }\n}\nfunction findHostInstanceWithNoPortals(fiber) {\n var hostFiber = findCurrentHostFiberWithNoPortals(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n if (hostFiber.tag === FundamentalComponent) {\n return hostFiber.stateNode.instance;\n }\n\n return hostFiber.stateNode;\n}\n\nvar shouldSuspendImpl = function (fiber) {\n return false;\n};\n\nfunction shouldSuspend(fiber) {\n return shouldSuspendImpl(fiber);\n}\nvar overrideHookState = null;\nvar overrideHookStateDeletePath = null;\nvar overrideHookStateRenamePath = null;\nvar overrideProps = null;\nvar overridePropsDeletePath = null;\nvar overridePropsRenamePath = null;\nvar scheduleUpdate = null;\nvar setSuspenseHandler = null;\n\n{\n var copyWithDeleteImpl = function (obj, path, index) {\n var key = path[index];\n var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);\n\n if (index + 1 === path.length) {\n if (Array.isArray(updated)) {\n updated.splice(key, 1);\n } else {\n delete updated[key];\n }\n\n return updated;\n } \u002F\u002F $FlowFixMe number or string is fine here\n\n\n updated[key] = copyWithDeleteImpl(obj[key], path, index + 1);\n return updated;\n };\n\n var copyWithDelete = function (obj, path) {\n return copyWithDeleteImpl(obj, path, 0);\n };\n\n var copyWithRenameImpl = function (obj, oldPath, newPath, index) {\n var oldKey = oldPath[index];\n var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj);\n\n if (index + 1 === oldPath.length) {\n var newKey = newPath[index]; \u002F\u002F $FlowFixMe number or string is fine here\n\n updated[newKey] = updated[oldKey];\n\n if (Array.isArray(updated)) {\n updated.splice(oldKey, 1);\n } else {\n delete updated[oldKey];\n }\n } else {\n \u002F\u002F $FlowFixMe number or string is fine here\n updated[oldKey] = copyWithRenameImpl( \u002F\u002F $FlowFixMe number or string is fine here\n obj[oldKey], oldPath, newPath, index + 1);\n }\n\n return updated;\n };\n\n var copyWithRename = function (obj, oldPath, newPath) {\n if (oldPath.length !== newPath.length) {\n warn('copyWithRename() expects paths of the same length');\n\n return;\n } else {\n for (var i = 0; i \u003C newPath.length - 1; i++) {\n if (oldPath[i] !== newPath[i]) {\n warn('copyWithRename() expects paths to be the same except for the deepest key');\n\n return;\n }\n }\n }\n\n return copyWithRenameImpl(obj, oldPath, newPath, 0);\n };\n\n var copyWithSetImpl = function (obj, path, index, value) {\n if (index \u003E= path.length) {\n return value;\n }\n\n var key = path[index];\n var updated = Array.isArray(obj) ? obj.slice() : _assign({}, obj); \u002F\u002F $FlowFixMe number or string is fine here\n\n updated[key] = copyWithSetImpl(obj[key], path, index + 1, value);\n return updated;\n };\n\n var copyWithSet = function (obj, path, value) {\n return copyWithSetImpl(obj, path, 0, value);\n };\n\n var findHook = function (fiber, id) {\n \u002F\u002F For now, the \"id\" of stateful hooks is just the stateful hook index.\n \u002F\u002F This may change in the future with e.g. nested hooks.\n var currentHook = fiber.memoizedState;\n\n while (currentHook !== null && id \u003E 0) {\n currentHook = currentHook.next;\n id--;\n }\n\n return currentHook;\n }; \u002F\u002F Support DevTools editable values for useState and useReducer.\n\n\n overrideHookState = function (fiber, id, path, value) {\n var hook = findHook(fiber, id);\n\n if (hook !== null) {\n var newState = copyWithSet(hook.memoizedState, path, value);\n hook.memoizedState = newState;\n hook.baseState = newState; \u002F\u002F We aren't actually adding an update to the queue,\n \u002F\u002F because there is no update we can add for useReducer hooks that won't trigger an error.\n \u002F\u002F (There's no appropriate action type for DevTools overrides.)\n \u002F\u002F As a result though, React will see the scheduled update as a noop and bailout.\n \u002F\u002F Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n }\n };\n\n overrideHookStateDeletePath = function (fiber, id, path) {\n var hook = findHook(fiber, id);\n\n if (hook !== null) {\n var newState = copyWithDelete(hook.memoizedState, path);\n hook.memoizedState = newState;\n hook.baseState = newState; \u002F\u002F We aren't actually adding an update to the queue,\n \u002F\u002F because there is no update we can add for useReducer hooks that won't trigger an error.\n \u002F\u002F (There's no appropriate action type for DevTools overrides.)\n \u002F\u002F As a result though, React will see the scheduled update as a noop and bailout.\n \u002F\u002F Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n }\n };\n\n overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) {\n var hook = findHook(fiber, id);\n\n if (hook !== null) {\n var newState = copyWithRename(hook.memoizedState, oldPath, newPath);\n hook.memoizedState = newState;\n hook.baseState = newState; \u002F\u002F We aren't actually adding an update to the queue,\n \u002F\u002F because there is no update we can add for useReducer hooks that won't trigger an error.\n \u002F\u002F (There's no appropriate action type for DevTools overrides.)\n \u002F\u002F As a result though, React will see the scheduled update as a noop and bailout.\n \u002F\u002F Shallow cloning props works as a workaround for now to bypass the bailout check.\n\n fiber.memoizedProps = _assign({}, fiber.memoizedProps);\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n }\n }; \u002F\u002F Support DevTools props for function components, forwardRef, memo, host components, etc.\n\n\n overrideProps = function (fiber, path, value) {\n fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n };\n\n overridePropsDeletePath = function (fiber, path) {\n fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n };\n\n overridePropsRenamePath = function (fiber, oldPath, newPath) {\n fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath);\n\n if (fiber.alternate) {\n fiber.alternate.pendingProps = fiber.pendingProps;\n }\n\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n };\n\n scheduleUpdate = function (fiber) {\n scheduleUpdateOnFiber(fiber, SyncLane, NoTimestamp);\n };\n\n setSuspenseHandler = function (newShouldSuspendImpl) {\n shouldSuspendImpl = newShouldSuspendImpl;\n };\n}\n\nfunction findHostInstanceByFiber(fiber) {\n var hostFiber = findCurrentHostFiber(fiber);\n\n if (hostFiber === null) {\n return null;\n }\n\n return hostFiber.stateNode;\n}\n\nfunction emptyFindFiberByHostInstance(instance) {\n return null;\n}\n\nfunction getCurrentFiberForDevTools() {\n return current;\n}\n\nfunction injectIntoDevTools(devToolsConfig) {\n var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance;\n var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n return injectInternals({\n bundleType: devToolsConfig.bundleType,\n version: devToolsConfig.version,\n rendererPackageName: devToolsConfig.rendererPackageName,\n rendererConfig: devToolsConfig.rendererConfig,\n overrideHookState: overrideHookState,\n overrideHookStateDeletePath: overrideHookStateDeletePath,\n overrideHookStateRenamePath: overrideHookStateRenamePath,\n overrideProps: overrideProps,\n overridePropsDeletePath: overridePropsDeletePath,\n overridePropsRenamePath: overridePropsRenamePath,\n setSuspenseHandler: setSuspenseHandler,\n scheduleUpdate: scheduleUpdate,\n currentDispatcherRef: ReactCurrentDispatcher,\n findHostInstanceByFiber: findHostInstanceByFiber,\n findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance,\n \u002F\u002F React Refresh\n findHostInstancesForRefresh: findHostInstancesForRefresh ,\n scheduleRefresh: scheduleRefresh ,\n scheduleRoot: scheduleRoot ,\n setRefreshHandler: setRefreshHandler ,\n \u002F\u002F Enables DevTools to append owner stacks to error messages in DEV mode.\n getCurrentFiber: getCurrentFiberForDevTools \n });\n}\n\nfunction ReactDOMRoot(container, options) {\n this._internalRoot = createRootImpl(container, ConcurrentRoot, options);\n}\n\nfunction ReactDOMBlockingRoot(container, tag, options) {\n this._internalRoot = createRootImpl(container, tag, options);\n}\n\nReactDOMRoot.prototype.render = ReactDOMBlockingRoot.prototype.render = function (children) {\n var root = this._internalRoot;\n\n {\n if (typeof arguments[1] === 'function') {\n error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n }\n\n var container = root.containerInfo;\n\n if (container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(root.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + \"root.unmount() to empty a root's container.\");\n }\n }\n }\n }\n\n updateContainer(children, root, null, null);\n};\n\nReactDOMRoot.prototype.unmount = ReactDOMBlockingRoot.prototype.unmount = function () {\n {\n if (typeof arguments[0] === 'function') {\n error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().');\n }\n }\n\n var root = this._internalRoot;\n var container = root.containerInfo;\n updateContainer(null, root, null, function () {\n unmarkContainerAsRoot(container);\n });\n};\n\nfunction createRootImpl(container, tag, options) {\n \u002F\u002F Tag is either LegacyRoot or Concurrent Root\n var hydrate = options != null && options.hydrate === true;\n var hydrationCallbacks = options != null && options.hydrationOptions || null;\n var mutableSources = options != null && options.hydrationOptions != null && options.hydrationOptions.mutableSources || null;\n var root = createContainer(container, tag, hydrate);\n markContainerAsRoot(root.current, container);\n var containerNodeType = container.nodeType;\n\n {\n var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container;\n listenToAllSupportedEvents(rootContainerElement);\n }\n\n if (mutableSources) {\n for (var i = 0; i \u003C mutableSources.length; i++) {\n var mutableSource = mutableSources[i];\n registerMutableSourceForHydration(root, mutableSource);\n }\n }\n\n return root;\n}\nfunction createLegacyRoot(container, options) {\n return new ReactDOMBlockingRoot(container, LegacyRoot, options);\n}\nfunction isValidContainer(node) {\n return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));\n}\n\nvar ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner;\nvar topLevelUpdateWarnings;\nvar warnedAboutHydrateAPI = false;\n\n{\n topLevelUpdateWarnings = function (container) {\n if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {\n var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer._internalRoot.current);\n\n if (hostInstance) {\n if (hostInstance.parentNode !== container) {\n error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.');\n }\n }\n }\n\n var isRootRenderedBySomeReact = !!container._reactRootContainer;\n var rootEl = getReactRootElementInContainer(container);\n var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl));\n\n if (hasNonRootReactChild && !isRootRenderedBySomeReact) {\n error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.');\n }\n\n if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') {\n error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.');\n }\n };\n}\n\nfunction getReactRootElementInContainer(container) {\n if (!container) {\n return null;\n }\n\n if (container.nodeType === DOCUMENT_NODE) {\n return container.documentElement;\n } else {\n return container.firstChild;\n }\n}\n\nfunction shouldHydrateDueToLegacyHeuristic(container) {\n var rootElement = getReactRootElementInContainer(container);\n return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));\n}\n\nfunction legacyCreateRootFromDOMContainer(container, forceHydrate) {\n var shouldHydrate = forceHydrate || shouldHydrateDueToLegacyHeuristic(container); \u002F\u002F First clear any existing content.\n\n if (!shouldHydrate) {\n var warned = false;\n var rootSibling;\n\n while (rootSibling = container.lastChild) {\n {\n if (!warned && rootSibling.nodeType === ELEMENT_NODE && rootSibling.hasAttribute(ROOT_ATTRIBUTE_NAME)) {\n warned = true;\n\n error('render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.');\n }\n }\n\n container.removeChild(rootSibling);\n }\n }\n\n {\n if (shouldHydrate && !forceHydrate && !warnedAboutHydrateAPI) {\n warnedAboutHydrateAPI = true;\n\n warn('render(): Calling ReactDOM.render() to hydrate server-rendered markup ' + 'will stop working in React v18. Replace the ReactDOM.render() call ' + 'with ReactDOM.hydrate() if you want React to attach to the server HTML.');\n }\n }\n\n return createLegacyRoot(container, shouldHydrate ? {\n hydrate: true\n } : undefined);\n}\n\nfunction warnOnInvalidCallback$1(callback, callerName) {\n {\n if (callback !== null && typeof callback !== 'function') {\n error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback);\n }\n }\n}\n\nfunction legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {\n {\n topLevelUpdateWarnings(container);\n warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render');\n } \u002F\u002F TODO: Without `any` type, Flow says \"Property cannot be accessed on any\n \u002F\u002F member of intersection type.\" Whyyyyyy.\n\n\n var root = container._reactRootContainer;\n var fiberRoot;\n\n if (!root) {\n \u002F\u002F Initial mount\n root = container._reactRootContainer = legacyCreateRootFromDOMContainer(container, forceHydrate);\n fiberRoot = root._internalRoot;\n\n if (typeof callback === 'function') {\n var originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(fiberRoot);\n originalCallback.call(instance);\n };\n } \u002F\u002F Initial mount should not be batched.\n\n\n unbatchedUpdates(function () {\n updateContainer(children, fiberRoot, parentComponent, callback);\n });\n } else {\n fiberRoot = root._internalRoot;\n\n if (typeof callback === 'function') {\n var _originalCallback = callback;\n\n callback = function () {\n var instance = getPublicRootInstance(fiberRoot);\n\n _originalCallback.call(instance);\n };\n } \u002F\u002F Update\n\n\n updateContainer(children, fiberRoot, parentComponent, callback);\n }\n\n return getPublicRootInstance(fiberRoot);\n}\n\nfunction findDOMNode(componentOrElement) {\n {\n var owner = ReactCurrentOwner$3.current;\n\n if (owner !== null && owner.stateNode !== null) {\n var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender;\n\n if (!warnedAboutRefsInRender) {\n error('%s is accessing findDOMNode 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.', getComponentName(owner.type) || 'A component');\n }\n\n owner.stateNode._warnedAboutRefsInRender = true;\n }\n }\n\n if (componentOrElement == null) {\n return null;\n }\n\n if (componentOrElement.nodeType === ELEMENT_NODE) {\n return componentOrElement;\n }\n\n {\n return findHostInstanceWithWarning(componentOrElement, 'findDOMNode');\n }\n}\nfunction hydrate(element, container, callback) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call createRoot(container, {hydrate: true}).render(element)?');\n }\n } \u002F\u002F TODO: throw or warn if we couldn't hydrate?\n\n\n return legacyRenderSubtreeIntoContainer(null, element, container, true, callback);\n}\nfunction render(element, container, callback) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?');\n }\n }\n\n return legacyRenderSubtreeIntoContainer(null, element, container, false, callback);\n}\nfunction unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n if (!isValidContainer(containerNode)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n }\n\n if (!(parentComponent != null && has(parentComponent))) {\n {\n throw Error( \"parentComponent must be a valid React Component\" );\n }\n }\n\n return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback);\n}\nfunction unmountComponentAtNode(container) {\n if (!isValidContainer(container)) {\n {\n throw Error( \"unmountComponentAtNode(...): Target container is not a DOM element.\" );\n }\n }\n\n {\n var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined;\n\n if (isModernRoot) {\n error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOM.createRoot(). This is not supported. Did you mean to call root.unmount()?');\n }\n }\n\n if (container._reactRootContainer) {\n {\n var rootEl = getReactRootElementInContainer(container);\n var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl);\n\n if (renderedByDifferentReact) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by another copy of React.');\n }\n } \u002F\u002F Unmount should not be batched.\n\n\n unbatchedUpdates(function () {\n legacyRenderSubtreeIntoContainer(null, null, container, false, function () {\n \u002F\u002F $FlowFixMe This should probably use `delete container._reactRootContainer`\n container._reactRootContainer = null;\n unmarkContainerAsRoot(container);\n });\n }); \u002F\u002F If you call unmountComponentAtNode twice in quick succession, you'll\n \u002F\u002F get `true` twice. That's probably fine?\n\n return true;\n } else {\n {\n var _rootEl = getReactRootElementInContainer(container);\n\n var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); \u002F\u002F Check if the container itself is a React root node.\n\n var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainer(container.parentNode) && !!container.parentNode._reactRootContainer;\n\n if (hasNonRootReactChild) {\n error(\"unmountComponentAtNode(): The node you're attempting to unmount \" + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.');\n }\n }\n\n return false;\n }\n}\n\nsetAttemptUserBlockingHydration(attemptUserBlockingHydration$1);\nsetAttemptContinuousHydration(attemptContinuousHydration$1);\nsetAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1);\nsetAttemptHydrationAtPriority(runWithPriority$2);\nvar didWarnAboutUnstableCreatePortal = false;\n\n{\n if (typeof Map !== 'function' || \u002F\u002F $FlowIssue Flow incorrectly thinks Map has no prototype\n Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || \u002F\u002F $FlowIssue Flow incorrectly thinks Set has no prototype\n Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') {\n error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https:\u002F\u002Freactjs.org\u002Flink\u002Freact-polyfills');\n }\n}\n\nsetRestoreImplementation(restoreControlledState$3);\nsetBatchingImplementation(batchedUpdates$1, discreteUpdates$1, flushDiscreteUpdates, batchedEventUpdates$1);\n\nfunction createPortal$1(children, container) {\n var key = arguments.length \u003E 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n if (!isValidContainer(container)) {\n {\n throw Error( \"Target container is not a DOM element.\" );\n }\n } \u002F\u002F TODO: pass ReactDOM portal implementation as third argument\n \u002F\u002F $FlowFixMe The Flow type is opaque but there's no way to actually create it.\n\n\n return createPortal(children, container, null, key);\n}\n\nfunction renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) {\n\n return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback);\n}\n\nfunction unstable_createPortal(children, container) {\n var key = arguments.length \u003E 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n {\n if (!didWarnAboutUnstableCreatePortal) {\n didWarnAboutUnstableCreatePortal = true;\n\n warn('The ReactDOM.unstable_createPortal() alias has been deprecated, ' + 'and will be removed in React 18+. Update your code to use ' + 'ReactDOM.createPortal() instead. It has the exact same API, ' + 'but without the \"unstable_\" prefix.');\n }\n }\n\n return createPortal$1(children, container, key);\n}\n\nvar Internals = {\n \u002F\u002F Keep in sync with ReactTestUtils.js, and ReactTestUtilsAct.js.\n \u002F\u002F This is an array for better minification.\n Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, flushPassiveEffects, \u002F\u002F TODO: This is related to `act`, not events. Move to separate key?\n IsThisRendererActing]\n};\nvar foundDevTools = injectIntoDevTools({\n findFiberByHostInstance: getClosestInstanceFromNode,\n bundleType: 1 ,\n version: ReactVersion,\n rendererPackageName: 'react-dom'\n});\n\n{\n if (!foundDevTools && canUseDOM && window.top === window.self) {\n \u002F\u002F If we're in Chrome or Firefox, provide a download link if not installed.\n if (navigator.userAgent.indexOf('Chrome') \u003E -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') \u003E -1) {\n var protocol = window.location.protocol; \u002F\u002F Don't warn in exotic cases like chrome-extension:\u002F\u002F.\n\n if (\u002F^(https?|file):$\u002F.test(protocol)) {\n \u002F\u002F eslint-disable-next-line react-internal\u002Fno-production-logging\n console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Freact-devtools' + (protocol === 'file:' ? '\\nYou might need to use a local HTTP server (instead of file:\u002F\u002F): ' + 'https:\u002F\u002Freactjs.org\u002Flink\u002Freact-devtools-faq' : ''), 'font-weight:bold');\n }\n }\n }\n}\n\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals;\nexports.createPortal = createPortal$1;\nexports.findDOMNode = findDOMNode;\nexports.flushSync = flushSync;\nexports.hydrate = hydrate;\nexports.render = render;\nexports.unmountComponentAtNode = unmountComponentAtNode;\nexports.unstable_batchedUpdates = batchedUpdates$1;\nexports.unstable_createPortal = unstable_createPortal;\nexports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer;\nexports.version = ReactVersion;\n })();\n}\n\n\n\u002F***\u002F }),\n\n\u002F***\u002F \".\u002Fnode_modules\u002Freact-dom\u002Findex.js\":\n\u002F*!*****************************************!*\\\n !*** .\u002Fnode_modules\u002Freact-dom\u002Findex.js ***!\n \\*****************************************\u002F\n\u002F***\u002F ((module, __unused_webpack_exports, __webpack_require__) =\u003E {\n\n\n\nfunction checkDCE() {\n \u002F* global __REACT_DEVTOOLS_GLOBAL_HOOK__ *\u002F\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (true) {\n \u002F\u002F This branch is unreachable because this function is only called\n \u002F\u002F in production, but the condition is true only in development.\n \u002F\u002F Therefore if the branch is still here, dead code elimination wasn't\n \u002F\u002F properly applied.\n \u002F\u002F Don't change the message. React DevTools relies on it. Also make sure\n \u002F\u002F this message doesn't occur elsewhere in this function, or it will cause\n \u002F\u002F a false positive.\n throw new Error('^_^');\n }\n try {\n \u002F\u002F Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n \u002F\u002F DevTools shouldn't crash React, no matter what.\n \u002F\u002F We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (false) {} else {\n module.exports = __webpack_require__(\u002F*! .\u002Fcjs\u002Freact-dom.development.js *\u002F \".\u002Fnode_modules\u002Freact-dom\u002Fcjs\u002Freact-dom.development.js\");\n}\n\n\n\u002F***\u002F }),\n\n\u002F***\u002F \".\u002Fnode_modules\u002Freact\u002Fcjs\u002Freact-jsx-runtime.development.js\":\n\u002F*!*****************************************************************!*\\\n !*** .\u002Fnode_modules\u002Freact\u002Fcjs\u002Freact-jsx-runtime.development.js ***!\n \\*****************************************************************\u002F\n\u002F***\u002F ((__unused_webpack_module, exports, __webpack_require__) =\u003E {\n\n\u002F** @license React v17.0.2\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\u002F\n\n\n\nif (true) {\n (function() {\n'use strict';\n\nvar React = __webpack_require__(\u002F*! react *\u002F \".\u002Fnode_modules\u002Freact\u002Findex.js\");\nvar _assign = __webpack_require__(\u002F*! object-assign *\u002F \".\u002Fnode_modules\u002Fobject-assign\u002Findex.js\");\n\n\u002F\u002F ATTENTION\n\u002F\u002F When adding new symbols to this file,\n\u002F\u002F Please consider also adding to 'react-devtools-shared\u002Fsrc\u002Fbackend\u002FReactSymbols'\n\u002F\u002F The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n\u002F\u002F nor polyfill, then a plain number is used for performance.\nvar REACT_ELEMENT_TYPE = 0xeac7;\nvar REACT_PORTAL_TYPE = 0xeaca;\nexports.Fragment = 0xeacb;\nvar REACT_STRICT_MODE_TYPE = 0xeacc;\nvar REACT_PROFILER_TYPE = 0xead2;\nvar REACT_PROVIDER_TYPE = 0xeacd;\nvar REACT_CONTEXT_TYPE = 0xeace;\nvar REACT_FORWARD_REF_TYPE = 0xead0;\nvar REACT_SUSPENSE_TYPE = 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = 0xead8;\nvar REACT_MEMO_TYPE = 0xead3;\nvar REACT_LAZY_TYPE = 0xead4;\nvar REACT_BLOCK_TYPE = 0xead9;\nvar REACT_SERVER_BLOCK_TYPE = 0xeada;\nvar REACT_FUNDAMENTAL_TYPE = 0xead5;\nvar REACT_SCOPE_TYPE = 0xead7;\nvar REACT_OPAQUE_ID_TYPE = 0xeae0;\nvar REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\nvar REACT_OFFSCREEN_TYPE = 0xeae2;\nvar REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n\nif (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor = Symbol.for;\n REACT_ELEMENT_TYPE = symbolFor('react.element');\n REACT_PORTAL_TYPE = symbolFor('react.portal');\n exports.Fragment = symbolFor('react.fragment');\n REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n REACT_PROFILER_TYPE = symbolFor('react.profiler');\n REACT_PROVIDER_TYPE = symbolFor('react.provider');\n REACT_CONTEXT_TYPE = symbolFor('react.context');\n REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n REACT_MEMO_TYPE = symbolFor('react.memo');\n REACT_LAZY_TYPE = symbolFor('react.lazy');\n REACT_BLOCK_TYPE = symbolFor('react.block');\n REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n REACT_SCOPE_TYPE = symbolFor('react.scope');\n REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n}\n\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 \u003E 1 ? _len2 - 1 : 0), _key2 = 1; _key2 \u003C _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n}\n\nfunction printWarning(level, format, args) {\n \u002F\u002F When changing this logic, you might want to also\n \u002F\u002F update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n\n var argsWithFormat = args.map(function (item) {\n return '' + item;\n }); \u002F\u002F Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); \u002F\u002F We intentionally don't use spread (or .apply) directly because it\n \u002F\u002F breaks IE9: https:\u002F\u002Fgithub.com\u002Ffacebook\u002Freact\u002Fissues\u002F13610\n \u002F\u002F eslint-disable-next-line react-internal\u002Fno-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n\u002F\u002F Filter certain DOM attributes (e.g. src, href) if their values are empty strings.\n\nvar enableScopeAPI = false; \u002F\u002F Experimental Create Event Handle API.\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } \u002F\u002F Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$typeof === REACT_LAZY_TYPE || type.$typeof === REACT_MEMO_TYPE || type.$typeof === REACT_PROVIDER_TYPE || type.$typeof === REACT_CONTEXT_TYPE || type.$typeof === REACT_FORWARD_REF_TYPE || type.$typeof === REACT_FUNDAMENTAL_TYPE || type.$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n}\n\nfunction getComponentName(type) {\n if (type == null) {\n \u002F\u002F Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case exports.Fragment:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList