diff --git a/package.json b/package.json index 1f129b43f212e..b56ad76da55c8 100644 --- a/package.json +++ b/package.json @@ -211,16 +211,16 @@ "pretty-ms": "7.0.0", "random-seed": "0.3.0", "react": "19.0.0", - "react-builtin": "npm:react@19.0.0-rc-372ec00c-20241209", + "react-builtin": "npm:react@19.1.0-canary-9463d51e-20241219", "react-dom": "19.0.0", - "react-dom-builtin": "npm:react-dom@19.0.0-rc-372ec00c-20241209", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-372ec00c-20241209", - "react-experimental-builtin": "npm:react@0.0.0-experimental-372ec00c-20241209", - "react-is-builtin": "npm:react-is@19.0.0-rc-372ec00c-20241209", - "react-server-dom-turbopack": "19.0.0-rc-372ec00c-20241209", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-372ec00c-20241209", - "react-server-dom-webpack": "19.0.0-rc-372ec00c-20241209", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-372ec00c-20241209", + "react-dom-builtin": "npm:react-dom@19.1.0-canary-9463d51e-20241219", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-9463d51e-20241219", + "react-experimental-builtin": "npm:react@0.0.0-experimental-9463d51e-20241219", + "react-is-builtin": "npm:react-is@19.1.0-canary-9463d51e-20241219", + "react-server-dom-turbopack": "19.1.0-canary-9463d51e-20241219", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-9463d51e-20241219", + "react-server-dom-webpack": "19.1.0-canary-9463d51e-20241219", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-9463d51e-20241219", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -230,8 +230,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.25.0-rc-372ec00c-20241209", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-372ec00c-20241209", + "scheduler-builtin": "npm:scheduler@0.26.0-canary-9463d51e-20241219", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-9463d51e-20241219", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", @@ -272,10 +272,10 @@ "@types/react": "19.0.0", "@types/react-dom": "19.0.0", "jest-snapshot": "30.0.0-alpha.6", - "react": "19.0.0-rc-372ec00c-20241209", - "react-dom": "19.0.0-rc-372ec00c-20241209", - "react-is": "19.0.0-rc-372ec00c-20241209", - "scheduler": "0.25.0-rc-372ec00c-20241209" + "react": "19.1.0-canary-9463d51e-20241219", + "react-dom": "19.1.0-canary-9463d51e-20241219", + "react-is": "19.1.0-canary-9463d51e-20241219", + "scheduler": "0.26.0-canary-9463d51e-20241219" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch", diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index dbf9adf3c49cd..dfdd0c1e1e3c3 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -510,13 +510,11 @@ return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -919,41 +917,6 @@ } return hook.checkDCE ? !0 : !1; } - function onCommitRoot$1(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); @@ -1149,54 +1112,6 @@ (root.pingedLanes = 0), (root.warmLanes = 0)); } - function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; - expirationTimes[index] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index] = null, index = 0; - index < hiddenUpdatesForLane.length; - index++ - ) { - var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); - } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -1217,6 +1132,46 @@ rootEntangledLanes &= ~lane; } } + function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; + } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -2327,6 +2282,8 @@ "hr" === tag || "option" === tag || "optgroup" === tag || + "script" === tag || + "template" === tag || "#text" === tag ); case "optgroup": @@ -3613,100 +3570,6 @@ "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -3781,6 +3644,32 @@ ? "Idle" : "Other"; } + function logComponentRender(fiber, startTime, endTime, wasHydrated) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var selfTime = fiber.actualDuration; + if (null === fiber.alternate || fiber.alternate.child !== fiber.child) + for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) + selfTime -= fiber.actualDuration; + reusableComponentDevToolDetails.color = + 0.5 > selfTime + ? wasHydrated + ? "tertiary-light" + : "primary-light" + : 10 > selfTime + ? wasHydrated + ? "tertiary" + : "primary" + : 100 > selfTime + ? wasHydrated + ? "tertiary-dark" + : "primary-dark" + : "error"; + reusableComponentOptions.start = startTime; + reusableComponentOptions.end = endTime; + performance.measure(name, reusableComponentOptions); + } + } function logComponentEffect(fiber, startTime, endTime, selfTime) { fiber = getComponentNameFromFiber(fiber); null !== fiber && @@ -3797,23 +3686,18 @@ (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } - function logRenderPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Render", reusableLaneOptions)); - } - function logSuspendedRenderPhase(startTime, endTime) { + function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); } - function logSuspendedWithDelayPhase(startTime, endTime) { + function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -3823,28 +3707,7 @@ ((reusableLaneDevToolDetails.color = "error"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), - performance.measure("Errored Render", reusableLaneOptions)); - } - function logSuspenseThrottlePhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Throttled", reusableLaneOptions)); - } - function logSuspendedCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Suspended", reusableLaneOptions)); - } - function logCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Commit", reusableLaneOptions)); + performance.measure("Errored", reusableLaneOptions)); } function finishQueueingConcurrentUpdates() { for ( @@ -4161,441 +4024,214 @@ for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - } - function pushTreeFork(workInProgress, totalChildren) { - warnIfNotHydrating(); - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; - } - function pushTreeId(workInProgress, totalChildren, index) { - warnIfNotHydrating(); - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); - } - function pushMaterializedTreeId(workInProgress) { - warnIfNotHydrating(); - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); - } - function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; } - function warnIfNotHydrating() { - isHydrating || + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + push(rendererCursorDEV, context._currentRenderer, providerFiber); + void 0 !== context._currentRenderer && + null !== context._currentRenderer && + context._currentRenderer !== rendererSigil && console.error( - "Expected to be hydrating. This is a bug in React. Please file an issue." + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." ); + context._currentRenderer = rendererSigil; } - function buildHydrationDiffNode(fiber, distanceFromLeaf) { - if (null === fiber.return) { - if (null === hydrationDiffRootDEV) - hydrationDiffRootDEV = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - else { - if (hydrationDiffRootDEV.fiber !== fiber) - throw Error( - "Saw multiple hydration diff roots in a pass. This is a bug in React." - ); - hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && - (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); - } - return hydrationDiffRootDEV; + function popProvider(context, providerFiber) { + context._currentValue = valueCursor.current; + var currentRenderer = rendererCursorDEV.current; + pop(rendererCursorDEV, providerFiber); + context._currentRenderer = currentRenderer; + pop(valueCursor, providerFiber); + } + function scheduleContextWorkOnParentPath( + parent, + renderLanes, + propagationRoot + ) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } - var siblings = buildHydrationDiffNode( - fiber.return, - distanceFromLeaf + 1 - ).children; - if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) - return ( - (siblings = siblings[siblings.length - 1]), - siblings.distanceFromLeaf > distanceFromLeaf && - (siblings.distanceFromLeaf = distanceFromLeaf), - siblings + parent !== propagationRoot && + console.error( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); - distanceFromLeaf = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - siblings.push(distanceFromLeaf); - return distanceFromLeaf; } - function warnNonHydratedInstance(fiber, rejectedCandidate) { - didSuspendOrErrorDEV || - ((fiber = buildHydrationDiffNode(fiber, 0)), - (fiber.serverProps = null), - null !== rejectedCandidate && - ((rejectedCandidate = - describeHydratableInstanceForDevWarnings(rejectedCandidate)), - fiber.serverTail.push(rejectedCandidate))); - } - function throwOnHydrationMismatch(fiber) { - var diff = "", - diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); - queueHydrationError( - createCapturedValueAtFiber( - Error( - "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + - diff - ), - fiber - ) - ); - throw HydrationMismatchException; - } - function prepareToHydrateHostInstance(fiber) { - var didHydrate = fiber.stateNode; - var type = fiber.type, - props = fiber.memoizedProps; - didHydrate[internalInstanceKey] = fiber; - didHydrate[internalPropsKey] = props; - validatePropertiesInDevelopment(type, props); - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", didHydrate); - listenToNonDelegatedEvent("close", didHydrate); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", didHydrate); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); - break; - case "source": - listenToNonDelegatedEvent("error", didHydrate); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", didHydrate); - listenToNonDelegatedEvent("load", didHydrate); - break; - case "details": - listenToNonDelegatedEvent("toggle", didHydrate); - break; - case "input": - checkControlledValueProps("input", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateInputProps(didHydrate, props); - initInput( - didHydrate, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress ); - track(didHydrate); - break; - case "option": - validateOptionProps(didHydrate, props); - break; - case "select": - checkControlledValueProps("select", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateSelectProps(didHydrate, props); - break; - case "textarea": - checkControlledValueProps("textarea", props), - listenToNonDelegatedEvent("invalid", didHydrate), - validateTextareaProps(didHydrate, props), - initTextarea( - didHydrate, - props.value, - props.defaultValue, - props.children - ), - track(didHydrate); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - didHydrate.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(didHydrate.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", didHydrate), - listenToNonDelegatedEvent("toggle", didHydrate)), - null != props.onScroll && - listenToNonDelegatedEvent("scroll", didHydrate), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", didHydrate), - null != props.onClick && (didHydrate.onclick = noop$1), - (didHydrate = !0)) - : (didHydrate = !1); - didHydrate || throwOnHydrationMismatch(fiber); - } - function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } } - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) - return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - if (shouldClear && nextHydratableInstance) { - for (shouldClear = nextHydratableInstance; shouldClear; ) { - JSCompiler_temp = buildHydrationDiffNode(fiber, 0); - var description = - describeHydratableInstanceForDevWarnings(shouldClear); - JSCompiler_temp.serverTail.push(description); - shouldClear = - "Suspense" === description.type - ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) - : getNextHydratable(shouldClear.nextSibling); + function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree + ) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current + ? current.push(context) + : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - throwOnHydrationMismatch(fiber); + parent = parent.return; } - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) - throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." - ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; - } - function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; - } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); - } - function emitPendingHydrationWarnings() { - var diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), - (diffRoot = describeDiff(diffRoot)), - console.error( - "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", - "https://react.dev/link/hydration-mismatch", - diffRoot - )); - } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } - function noop$3() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - console.error( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop$3, noop$3), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) - thenable.then(noop$3, noop$3); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } + return !1; } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + function readContext(context) { + isDisallowedContextReadInDEV && + console.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()." ); + return readContextForConsumer(currentlyRenderingFiber$1, context); } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - console.warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - console.warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); + function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + 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()." + ); + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } function entangleAsyncAction(transition, thenable) { if (null === currentEntangledListeners) { @@ -4654,6378 +4290,6553 @@ ); return thenableWithOverride; } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); - } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 + var componentName = getComponentNameFromFiber(fiber); + console.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\nPlease update the following component: %s", + componentName ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - console.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://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } + didWarnUpdateInsideUpdate = !0; } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - console.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 + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); - didWarnAboutUseFormState.has(componentName) || - (didWarnAboutUseFormState.add(componentName), - console.error( - "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - componentName - )); + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } - function throwInvalidHookError() { - 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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } - function areHookInputsEqual(nextDeps, prevDeps) { - if (ignorePreviousDependencies) return !1; - if (null === prevDeps) - return ( - console.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 - ), - !1 - ); - nextDeps.length !== prevDeps.length && - console.error( - "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", - currentHookNameInDev, - "[" + prevDeps.join(", ") + "]", - "[" + nextDeps.join(", ") + "]" - ); - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; + function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } - function renderWithHooks( - current, + function processUpdateQueue( workInProgress, - Component, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - hookTypesDev = null !== current ? current._debugHookTypes : null; - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - if ( - "[object AsyncFunction]" === - Object.prototype.toString.call(Component) || - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(Component) - ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), - didWarnAboutAsyncClientComponent.has(nextRenderLanes) || - (didWarnAboutAsyncClientComponent.add(nextRenderLanes), - console.error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - )); - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null !== current && null !== current.memoizedState - ? HooksDispatcherOnUpdateInDEV - : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; - shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - (workInProgress.mode & StrictLegacyMode) !== NoMode; - var children = callComponentInDEV(Component, props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - if (nextRenderLanes) { - setIsStrictModeForDevtools(!0); - try { - children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - ); - } finally { - setIsStrictModeForDevtools(!1); - } + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress.updateQueue; + hasForceUpdate = !1; + currentlyProcessingQueue = queue.shared; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress.alternate; + null !== current && + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - finishRenderingHooks(current, workInProgress); - return children; - } - function finishRenderingHooks(current, workInProgress) { - workInProgress._debugHookTypes = hookTypesDev; - null === workInProgress.dependencies - ? null !== thenableState$1 && - (workInProgress.dependencies = { - lanes: 0, - firstContext: null, - _debugThenableState: thenableState$1 - }) - : (workInProgress.dependencies._debugThenableState = thenableState$1); - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = - null !== currentHook && null !== currentHook.next; - renderLanes = 0; - hookTypesDev = - currentHookNameInDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && - console.error( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + updateLane = workInProgress; + var partialState = pendingQueue; + var nextProps = props, + instance = instance$jscomp$0; + switch (partialState.tag) { + case ReplaceState: + partialState = partialState.payload; + if ("function" === typeof partialState) { + isDisallowedContextReadInDEV = !0; + var nextState = partialState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + newState = nextState; + break a; + } + newState = partialState; + break a; + case CaptureUpdate: + updateLane.flags = (updateLane.flags & -65537) | 128; + case UpdateState: + nextState = partialState.payload; + if ("function" === typeof nextState) { + isDisallowedContextReadInDEV = !0; + partialState = nextState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + nextState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + } else partialState = nextState; + if (null === partialState || void 0 === partialState) break a; + newState = assign({}, newState, partialState); + break a; + case ForceUpdate: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress.flags |= 64), + isHiddenUpdate && (workInProgress.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; + } + currentlyProcessingQueue = null; + } + function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); - needsToResetSuspendedThenableDEV - ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) - : (current = !1); - current && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Unknown"), - didWarnAboutUseWrappedInTryCatch.has(workInProgress) || - didWarnAboutAsyncClientComponent.has(workInProgress) || - (didWarnAboutUseWrappedInTryCatch.add(workInProgress), - console.error( - "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." - ))); + callback.call(context); } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (numberOfReRenders >= RE_RENDER_LIMIT) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." - ); - numberOfReRenders += 1; - ignorePreviousDependencies = !1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - hookTypesUpdateIndexDev = -1; - ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - children = callComponentInDEV(Component, props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); } - function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } - function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } - function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags = - (workInProgress.mode & StrictEffectsMode) !== NoMode - ? workInProgress.flags & -201328645 - : workInProgress.flags & -2053; - current.lanes &= ~lanes; + function retainCache(cache) { + cache.controller.signal.aborted && + console.warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; } - function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - hookTypesDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - currentHookNameInDev = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; - } - function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; - } - function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." - ); - throw Error("Rendered more hooks than during the previous render."); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; - } - function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null !== index && null !== index.memoizedState - ? HooksDispatcherOnUpdateInDEV - : HooksDispatcherOnMountInDEV)); - return thenable; + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + console.warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } - function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } - throw Error("An unsupported type was passed to use(): " + String(usable)); } - function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); + } } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue || ignorePreviousDependencies) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), - current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - else - updateQueue.length !== size && + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), console.error( - "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", - updateQueue.length, - size - ); - memoCache.index++; - return updateQueue; - } - function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function mountReducer(reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - } - function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); - } - function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue !== baseQueue && + void 0 === oldProps && console.error( - "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" ); - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + return oldProps; } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction = !1; - do { - var updateLane = update.lane & -536870913; - if ( - updateLane !== update.lane - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do - (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - var nextSnapshot = getServerSnapshot(); - didWarnUncachedGetSnapshot || - nextSnapshot === getServerSnapshot() || - (console.error( - "The result of getServerSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } else { - nextSnapshot = getSnapshot(); - didWarnUncachedGetSnapshot || - ((getServerSnapshot = getSnapshot()), - objectIs(nextSnapshot, getServerSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0))); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - hook.memoizedState = nextSnapshot; - getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = getServerSnapshot; - mountEffect( - subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), - [subscribe] - ); - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - getServerSnapshot, - nextSnapshot, - getSnapshot - ), - null - ); - return nextSnapshot; - } - function updateSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - getServerSnapshot = getServerSnapshot(); - } else if ( - ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) - ) { - var cachedSnapshot = getSnapshot(); - objectIs(getServerSnapshot, cachedSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } - if ( - (cachedSnapshot = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - )) - ) - (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); - hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); - if ( - hook.getSnapshot !== getSnapshot || - cachedSnapshot || - (null !== workInProgressHook && - workInProgressHook.memoizedState.tag & HasEffect) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + return newProps; + } + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } - return getServerSnapshot; + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } - function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); + function pushTreeFork(workInProgress, totalChildren) { + warnIfNotHydrating(); + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } - function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + function pushTreeId(workInProgress, totalChildren, index) { + warnIfNotHydrating(); + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } - function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); + function pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } - function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); + function warnIfNotHydrating() { + isHydrating || + console.error( + "Expected to be hydrating. This is a bug in React. Please file an issue." + ); } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } + function buildHydrationDiffNode(fiber, distanceFromLeaf) { + if (null === fiber.return) { + if (null === hydrationDiffRootDEV) + hydrationDiffRootDEV = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + else { + if (hydrationDiffRootDEV.fiber !== fiber) + throw Error( + "Saw multiple hydration diff roots in a pass. This is a bug in React." + ); + hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && + (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); } + return hydrationDiffRootDEV; } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; - } - function mountState(initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue + var siblings = buildHydrationDiffNode( + fiber.return, + distanceFromLeaf + 1 + ).children; + if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) + return ( + (siblings = siblings[siblings.length - 1]), + siblings.distanceFromLeaf > distanceFromLeaf && + (siblings.distanceFromLeaf = distanceFromLeaf), + siblings ); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - } - function mountOptimistic(passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + distanceFromLeaf = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; + siblings.push(distanceFromLeaf); + return distanceFromLeaf; } - function updateOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + function warnNonHydratedInstance(fiber, rejectedCandidate) { + didSuspendOrErrorDEV || + ((fiber = buildHydrationDiffNode(fiber, 0)), + (fiber.serverProps = null), + null !== rejectedCandidate && + ((rejectedCandidate = + describeHydratableInstanceForDevWarnings(rejectedCandidate)), + fiber.serverTail.push(rejectedCandidate))); } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer + function throwOnHydrationMismatch(fiber) { + var diff = "", + diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); + queueHydrationError( + createCapturedValueAtFiber( + Error( + "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + + diff + ), + fiber + ) ); + throw HydrationMismatchException; } - function rerenderOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - } - function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload - ) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update form state while rendering."); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } - } - function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - ReactSharedInternals.T._updatedFibers = new Set(); - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((actionQueue = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < actionQueue && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + function prepareToHydrateHostInstance(fiber) { + var didHydrate = fiber.stateNode; + var type = fiber.type, + props = fiber.memoizedProps; + didHydrate[internalInstanceKey] = fiber; + didHydrate[internalPropsKey] = props; + validatePropertiesInDevelopment(type, props); + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", didHydrate); + listenToNonDelegatedEvent("close", didHydrate); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", didHydrate); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); + break; + case "source": + listenToNonDelegatedEvent("error", didHydrate); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", didHydrate); + listenToNonDelegatedEvent("load", didHydrate); + break; + case "details": + listenToNonDelegatedEvent("toggle", didHydrate); + break; + case "input": + checkControlledValueProps("input", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateInputProps(didHydrate, props); + initInput( + didHydrate, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(didHydrate); + break; + case "option": + validateOptionProps(didHydrate, props); + break; + case "select": + checkControlledValueProps("select", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateSelectProps(didHydrate, props); + break; + case "textarea": + checkControlledValueProps("textarea", props), + listenToNonDelegatedEvent("invalid", didHydrate), + validateTextareaProps(didHydrate, props), + initTextarea( + didHydrate, + props.value, + props.defaultValue, + props.children + ), + track(didHydrate); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + didHydrate.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(didHydrate.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", didHydrate), + listenToNonDelegatedEvent("toggle", didHydrate)), + null != props.onScroll && + listenToNonDelegatedEvent("scroll", didHydrate), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", didHydrate), + null != props.onClick && (didHydrate.onclick = noop$1), + (didHydrate = !0)) + : (didHydrate = !1); + didHydrate || throwOnHydrationMismatch(fiber); + } + function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; } - } else - try { - (currentTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } + function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) + return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && (shouldClear = !0); + if (shouldClear && nextHydratableInstance) { + for (shouldClear = nextHydratableInstance; shouldClear; ) { + JSCompiler_temp = buildHydrationDiffNode(fiber, 0); + var description = + describeHydratableInstanceForDevWarnings(shouldClear); + JSCompiler_temp.serverTail.push(description); + shouldClear = + "Suspense" === description.type + ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) + : getNextHydratable(shouldClear.nextSibling); } + throwOnHydrationMismatch(fiber); + } + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + ); + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } - function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || - console.error( - "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" - )) - : onActionSuccess(actionQueue, node, returnValue); + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; } - function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } - function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; + function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + function emitPendingHydrationWarnings() { + var diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), + (diffRoot = describeDiff(diffRoot)), + console.error( + "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", + "https://react.dev/link/hydration-mismatch", + diffRoot + )); } - function actionStateReducer(oldState, newState) { - return newState; + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; } - function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var isMatching = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var markerInstance = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== markerInstance.nodeType; - - ) { - if (!inRootOrSingleton) { - markerInstance = null; - break b; - } - markerInstance = getNextHydratable( - markerInstance.nextSibling - ); - if (null === markerInstance) { - markerInstance = null; - break b; - } - } - inRootOrSingleton = markerInstance.data; - markerInstance = - inRootOrSingleton === FORM_STATE_IS_MATCHING || - inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING - ? markerInstance - : null; + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function noop$3() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + console.error( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop$3, noop$3), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) + thenable.then(noop$3, noop$3); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; } - if (markerInstance) { - nextHydratableInstance = getNextHydratable( - markerInstance.nextSibling - ); - isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; - break a; + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; } } - throwOnHydrationMismatch(isMatching); - } - isMatching = !1; + ); } - isMatching && (initialStateProp = ssrFormState[0]); - } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - isMatching = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = isMatching; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - isMatching - ); - isMatching.dispatch = ssrFormState; - isMatching = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - isMatching.queue - ); - isMatching = mountWorkInProgressHook(); - markerInstance = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - isMatching.queue = markerInstance; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - markerInstance, - inRootOrSingleton, - ssrFormState - ); - markerInstance.dispatch = ssrFormState; - isMatching.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; } - function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; } - function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; + function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); } - function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; } - function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); } - function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); } - function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - function mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - createEffectInstance(), - create, - deps - ); + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } - function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - inst, - create, - deps - ))); + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); } - function mountEffect(create, deps) { - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(142608384, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); - } - function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } - } - function mountEvent(callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." - ); - return ref.impl.apply(void 0, arguments); - }; - } - function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + if ( + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + console.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://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table ); - return ref.impl.apply(void 0, arguments); - }; - } - function mountLayoutEffect(create, deps) { - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - return mountEffectImpl(fiberFlags, Layout, create, deps); - } - function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; + } } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - console.error( - "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", - "an object with keys {" + Object.keys(ref).join(", ") + "}" - ), - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); } - function mountImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "%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 ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - mountEffectImpl( - fiberFlags, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); } - function updateImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" - ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl( - 4, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function mountCallback(callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName + )); } - function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; + function throwInvalidHookError() { + 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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); } - function mountMemo(nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; + function areHookInputsEqual(nextDeps, prevDeps) { + if (ignorePreviousDependencies) return !1; + if (null === prevDeps) + return ( + console.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 + ), + !1 + ); + nextDeps.length !== prevDeps.length && + console.error( + "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", + currentHookNameInDev, + "[" + prevDeps.join(", ") + "]", + "[" + nextDeps.join(", ") + "]" + ); + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } - function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + hookTypesDev = null !== current ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + if ( + "[object AsyncFunction]" === + Object.prototype.toString.call(Component) || + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(Component) + ) + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), + didWarnAboutAsyncClientComponent.has(nextRenderLanes) || + (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + console.error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + )); + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + (workInProgress.mode & StrictLegacyMode) !== NoMode; + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { setIsStrictModeForDevtools(!0); try { - nextCreate(); + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + ); } finally { setIsStrictModeForDevtools(!1); } } - hook.memoizedState = [prevState, deps]; - return prevState; - } - function mountDeferredValue(value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); + finishRenderingHooks(current, workInProgress); + return children; } - function updateDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); + function finishRenderingHooks(current, workInProgress) { + workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState$1 && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState$1 + }) + : (workInProgress.dependencies._debugThenableState = thenableState$1); + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = + null !== currentHook && null !== currentHook.next; + renderLanes = 0; + hookTypesDev = + currentHookNameInDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + console.error( + "Internal React error: Expected static flag was missing. Please notify the React team." + ); + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) + throw Error( + "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + ); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); + needsToResetSuspendedThenableDEV + ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) + : (current = !1); + current && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Unknown"), + didWarnAboutUseWrappedInTryCatch.has(workInProgress) || + didWarnAboutAsyncClientComponent.has(workInProgress) || + (didWarnAboutUseWrappedInTryCatch.add(workInProgress), + console.error( + "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." + ))); } - function rerenderDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue + function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (numberOfReRenders >= RE_RENDER_LIMIT) + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); + numberOfReRenders += 1; + ignorePreviousDependencies = !1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + hookTypesUpdateIndexDev = -1; + ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; + children = callComponentInDEV(Component, props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } - function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; + function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== + dispatcher && (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } - function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; + function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } - function startTransition( - fiber, - queue, - pendingState, - finishedState, - callback - ) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && previousPriority < ContinuousEventPriority - ? previousPriority - : ContinuousEventPriority; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - currentTransition._updatedFibers = new Set(); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags = + (workInProgress.mode & StrictEffectsMode) !== NoMode + ? workInProgress.flags & -201328645 + : workInProgress.flags & -2053; + current.lanes &= ~lanes; + } + function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((fiber = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < fiber && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + hookTypesDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } - function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) - throw Error( - "Expected the form instance to be a HostComponent. This is a bug in React." - ); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - NotPendingTransition, - null === action - ? noop$2 - : function () { - requestFormReset$1(formFiber); - return action(formData); - } - ); - } - function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: NotPendingTransition, - baseState: NotPendingTransition, + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: NotPendingTransition - }, + queue: null, next: null }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; - } - function requestFormReset$1(formFiber) { - null === ReactSharedInternals.T && - console.error( - "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." - ); - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } - function mountTransition() { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error( + "Update hook called on initial render. This is likely a bug in React. Please file an issue." + ); + throw Error("Rendered more hooks than during the previous render."); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); + } + return workInProgressHook; } - function updateTransition() { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } - function rerenderTransition() { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = createThenableState()); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null !== index && null !== index.memoizedState + ? HooksDispatcherOnUpdateInDEV + : HooksDispatcherOnMountInDEV)); + return thenable; } - function useHostTransitionStatus() { - return readContext(HostTransitionContext); + function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error("An unsupported type was passed to use(): " + String(usable)); } - function mountId() { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = treeContextOverflow; - var idWithLeadingBit = treeContextId; - treeId = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + treeId; - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); + function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue || ignorePreviousDependencies) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), + current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + console.error( + "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", + updateQueue.length, + size + ); + memoCache.index++; + return updateQueue; } - function mountRefresh() { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } - function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root = enqueueUpdate(provider, fiber, lane); - null !== root && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } } - provider = provider.return; - } - } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && - console.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()." - ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0), - scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && - console.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()." - ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) && startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p1); + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } - function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && - finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - ReactSharedInternals.H = prevDispatcher; - } + function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 + current.baseQueue !== baseQueue && + console.error( + "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." ); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } - return !1; + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } - function dispatchOptimisticSetState( - fiber, - throwIfDuringRender, - queue, - action - ) { - null === ReactSharedInternals.T && - 0 === currentEntangledLane && - console.error( - "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" ); - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) - throw Error("Cannot update optimistic state while rendering."); - console.error("Cannot call startTransition while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); - } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); - } - function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = - didScheduleRenderPhaseUpdate = !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do + (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } + return [newState, dispatch]; } - function pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; - } - function validateFragmentProps(element, fiber, returnFiber) { - for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { - var key = keys[i]; - if ("children" !== key && "key" !== key) { - null === fiber && - ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), - (fiber._debugInfo = currentDebugInfo), - (fiber.return = returnFiber)); - runWithFiberInDEV( - fiber, - function (erroredKey) { - console.error( - "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", - erroredKey - ); - }, - key + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." ); - break; - } - } - } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - return trackUsedThenable(thenableState, thenable, index); - } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + var nextSnapshot = getServerSnapshot(); + didWarnUncachedGetSnapshot || + nextSnapshot === getServerSnapshot() || + (console.error( + "The result of getServerSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } else { + nextSnapshot = getSnapshot(); + didWarnUncachedGetSnapshot || + ((getServerSnapshot = getSnapshot()), + objectIs(nextSnapshot, getServerSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0))); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + hook.memoizedState = nextSnapshot; + getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = getServerSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + getServerSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; } - function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error( - 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + getServerSnapshot = getServerSnapshot(); + } else if ( + ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) + ) { + var cachedSnapshot = getSnapshot(); + objectIs(getServerSnapshot, cachedSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + if ( + (cachedSnapshot = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + )) + ) + (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); + hook = hook.queue; + var create = subscribeToStore.bind(null, fiber, hook, subscribe); + updateEffectImpl(2048, Passive, create, [subscribe]); + if ( + hook.getSnapshot !== getSnapshot || + cachedSnapshot || + (null !== workInProgressHook && + workInProgressHook.memoizedState.tag & HasEffect) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - ); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; } - function warnOnFunctionType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasFunctionTypeWarning[parentName] || - ((ownerHasFunctionTypeWarning[parentName] = !0), - (invalidChild = - invalidChild.displayName || invalidChild.name || "Component"), - 3 === returnFiber.tag - ? console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", - invalidChild, - invalidChild, - invalidChild - ) - : console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", - invalidChild, - invalidChild, - parentName, - invalidChild, - parentName - )); + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); } - function warnOnSymbolType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasSymbolTypeWarning[parentName] || - ((ownerHasSymbolTypeWarning[parentName] = !0), - (invalidChild = String(invalidChild)), - 3 === returnFiber.tag - ? console.error( - "Symbols are not valid as a React child.\n root.render(%s)", - invalidChild - ) - : console.error( - "Symbols are not valid as a React child.\n <%s>%s", - parentName, - invalidChild, - parentName - )); + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } - function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), - (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); + } + function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText( - textContent, - returnFiber.mode, - lanes - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (current = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - )), - validateFragmentProps(element, current, returnFiber), - current - ); - if ( - null !== current && - (current.elementType === elementType || - isCompatibleFamilyForHotReloading(current, element) || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - (current._debugOwner = element._owner), - (current._debugInfo = currentDebugInfo), - current - ); - current = createFiberFromElement(element, returnFiber.mode, lanes); - coerceRef(current, element); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; + } + function mountState(initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + } + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + } + function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); + } + function rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + } + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload + ) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update form state while rendering."); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + ReactSharedInternals.T._updatedFibers = new Set(); + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((actionQueue = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < actionQueue && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); + } + } else + try { + (currentTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, currentTransition); + } catch (error$3) { + onActionError(actionQueue, node, error$3); + } + } + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? (returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ), + node.isTransition || + console.error( + "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" + )) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugOwner = returnFiber), - (newChild._debugTask = returnFiber._debugTask), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = createChild(returnFiber, newChild, lanes); - currentDebugInfo = _prevDebugInfo; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = createChild( - returnFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? ((key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) { - if (null !== key) return null; - key = pushDebugInfo(newChild._debugInfo); - returnFiber = updateFragment( - returnFiber, - oldFiber, - newChild, - lanes, - null - ); - currentDebugInfo = key; - return returnFiber; + actionQueue.action = null; + } + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + } + function actionStateReducer(oldState, newState) { + return newState; + } + function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var isMatching = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var markerInstance = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== markerInstance.nodeType; + + ) { + if (!inRootOrSingleton) { + markerInstance = null; + break b; + } + markerInstance = getNextHydratable( + markerInstance.nextSibling + ); + if (null === markerInstance) { + markerInstance = null; + break b; + } + } + inRootOrSingleton = markerInstance.data; + markerInstance = + inRootOrSingleton === FORM_STATE_IS_MATCHING || + inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING + ? markerInstance + : null; + } + if (markerInstance) { + nextHydratableInstance = getNextHydratable( + markerInstance.nextSibling + ); + isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; + break a; + } + } + throwOnHydrationMismatch(isMatching); + } + isMatching = !1; } - if ("function" === typeof newChild.then) - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + isMatching && (initialStateProp = ssrFormState[0]); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (newIdx = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - newIdx, - newChild, - lanes - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - currentDebugInfo = _prevDebugInfo7; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newIdx = existingChildren.get(newIdx) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFragment( - returnFiber, - newIdx, - newChild, - lanes, - null - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo7), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { - if ("object" !== typeof child || null === child) return knownKeys; - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(returnFiber, workInProgress, child); - var key = child.key; - if ("string" !== typeof key) break; - if (null === knownKeys) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - runWithFiberInDEV(workInProgress, function () { - console.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/or omitted \u2014 the behavior is unsupported and could change in a future version.", - key - ); - }); - break; - case REACT_LAZY_TYPE: - (child = callLazyInitInDEV(child)), - warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + isMatching = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = isMatching; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + isMatching + ); + isMatching.dispatch = ssrFormState; + isMatching = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + isMatching.queue + ); + isMatching = mountWorkInProgressHook(); + markerInstance = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + isMatching.queue = markerInstance; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + markerInstance, + inRootOrSingleton, + ssrFormState + ); + markerInstance.dispatch = ssrFormState; + isMatching.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; + } + function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); + } + function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - return knownKeys; + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; + } + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; + } + function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; + } + function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; + } + function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + createEffectInstance(), + create, + deps + ); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + inst, + create, + deps + ))); + } + function mountEffect(create, deps) { + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ? mountEffectImpl(142608384, Passive, create, deps) + : mountEffectImpl(8390656, Passive, create, deps); + } + function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var knownKeys = null, - resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - newChildren[newIdx], - knownKeys + } + function mountEvent(callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + return ref.impl.apply(void 0, arguments); + }; + } + function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - newChildren[newIdx], - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - newChildren[newIdx], - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + return ref.impl.apply(void 0, arguments); + }; + } + function mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); + } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - newChildren !== newChildrenIterable || - (0 === returnFiber.tag && - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(returnFiber.type) && - "[object AsyncGenerator]" === - Object.prototype.toString.call(newChildren)) || - (didWarnAboutGenerators || + if (null !== ref && void 0 !== ref) + return ( + ref.hasOwnProperty("current") || console.error( - "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." + "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", + "an object with keys {" + Object.keys(ref).join(", ") + "}" ), - (didWarnAboutGenerators = !0)); - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); + } + function mountImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" + ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function updateImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl( + 4, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + } + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; + } + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - knownKeys = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - step.value, - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; + hook.memoizedState = [nextValue, deps]; + return nextValue; + } + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + } + hook.memoizedState = [prevState, deps]; + return prevState; + } + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + } + function updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + } + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (oldFiber = createChild(returnFiber, step.value, lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - step.value, - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - step.value, - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - step.value, - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + } + function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; + } + function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; + } + function startTransition( + fiber, + queue, + pendingState, + finishedState, + callback + ) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && previousPriority < ContinuousEventPriority + ? previousPriority + : ContinuousEventPriority; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + currentTransition._updatedFibers = new Set(); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((fiber = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < fiber && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (validateFragmentProps(newChild, null, returnFiber), - (newChild = newChild.props.children)); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - var prevDebugInfo = pushDebugInfo(newChild._debugInfo); - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - validateFragmentProps(newChild, lanes, returnFiber); - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - isCompatibleFamilyForHotReloading( - currentFirstChild, - newChild - ) || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - validateFragmentProps(newChild, lanes, returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)); - } - returnFiber = placeSingleChild(returnFiber); - currentDebugInfo = prevDebugInfo; - return returnFiber; - case REACT_PORTAL_TYPE: - a: { - prevDebugInfo = newChild; - for ( - newChild = prevDebugInfo.key; - null !== currentFirstChild; - - ) { - if (currentFirstChild.key === newChild) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - prevDebugInfo.containerInfo && - currentFirstChild.stateNode.implementation === - prevDebugInfo.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - prevDebugInfo.children || [] - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal( - prevDebugInfo, - returnFiber.mode, - lanes - ); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = pushDebugInfo(newChild._debugInfo); - key = getIteratorFn(newChild); - if ("function" !== typeof key) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - var newChildren = key.call(newChild); - if (newChildren === newChild) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== - Object.prototype.toString.call(newChildren) - ) - didWarnAboutGenerators || - console.error( - "Using Iterators 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. You can also use an Iterable that can iterate multiple times over the same items." - ), - (didWarnAboutGenerators = !0); - } else - newChild.entries !== key || - didWarnAboutMaps || - (console.error( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)); - returnFiber = reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ); - currentDebugInfo = prevDebugInfo; - return returnFiber; - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (prevDebugInfo = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ), - (lanes = useFiber(currentFirstChild, prevDebugInfo)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText( - prevDebugInfo, - returnFiber.mode, - lanes - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) - ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - var debugInfo = (fiber._debugInfo = currentDebugInfo); - fiber._debugOwner = returnFiber._debugOwner; - fiber._debugTask = returnFiber._debugTask; - if (null != debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) - if ("string" === typeof debugInfo[i].stack) { - fiber._debugOwner = debugInfo[i]; - fiber._debugTask = debugInfo[i].debugTask; - break; - } - return fiber; - } finally { - currentDebugInfo = prevDebugInfo; - } - }; } - function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push( - suspenseStackCursor, - suspenseStackCursor.current & SubtreeSuspenseContextMask, - handler + function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) + throw Error( + "Expected the form instance to be a HostComponent. This is a bug in React." + ); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } ); - push(suspenseHandlerStackCursor, handler, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); } - function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current, fiber), - push(suspenseHandlerStackCursor, fiber, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); + function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: NotPendingTransition, + baseState: NotPendingTransition, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: NotPendingTransition + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber + function requestFormReset$1(formFiber) { + null === ReactSharedInternals.T && + console.error( + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." + ); + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) ); } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - state.data === SUSPENSE_PENDING_START_DATA || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if ( - 19 === node.tag && - void 0 !== node.memoizedProps.revealOrder - ) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; + function updateTransition() { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function rerenderTransition() { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); + function useHostTransitionStatus() { + return readContext(HostTransitionContext); + } + function mountId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = treeContextOverflow; + var idWithLeadingBit = treeContextId; + treeId = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + treeId; + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + } + function mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } + function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root = enqueueUpdate(provider, fiber, lane); + null !== root && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; } + provider = provider.return; } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext - ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.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()." ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); + args = requestUpdateLane(fiber); + var update = { + lane: args, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (startUpdateTimerByLane(args), + scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.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()." + ); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args) && + startUpdateTimerByLane(args); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error) { } finally { - setIsStrictModeForDevtools(!1); + ReactSharedInternals.H = prevDispatcher; } } - void 0 === oldProps && - console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - return oldProps; } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + return !1; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function dispatchOptimisticSetState( + fiber, + throwIfDuringRender, + queue, + action ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )); - } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); - } - return newProps; - } - function defaultOnUncaughtError(error) { - reportGlobalError(error); - console.warn( - "%s\n\n%s\n", - componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components.", - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } - function defaultOnCaughtError(error) { - var componentNameMessage = componentName - ? "The above error occurred in the <" + componentName + "> component." - : "The above error occurred in one of your React components.", - recreateMessage = - "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."); - if ( - "object" === typeof error && - null !== error && - "string" === typeof error.environmentName - ) { - var JSCompiler_inline_result = error.environmentName; - error = [ - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ].slice(0); - "string" === typeof error[0] - ? error.splice( - 0, - 1, - badgeFormat + error[0], - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ) - : error.splice( - 0, - 0, - badgeFormat, - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ); - error.unshift(console); - JSCompiler_inline_result = bind.apply(console.error, error); - JSCompiler_inline_result(); - } else + null === ReactSharedInternals.T && + 0 === currentEntangledLane && console.error( - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage + "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) + throw Error("Cannot update optimistic state while rendering."); + console.error("Cannot call startTransition while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } - function defaultOnRecoverableError(error) { - reportGlobalError(error); + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); } - function logUncaughtError(root, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = null; - var error = errorInfo.value; - if (null !== ReactSharedInternals.actQueue) - ReactSharedInternals.thrownErrors.push(error); - else { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(error, { componentStack: errorInfo.stack }); - } - } catch (e$4) { - setTimeout(function () { - throw e$4; - }); - } + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = + didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } - function logCaughtError(root, boundary, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = getComponentNameFromFiber(boundary); - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$5) { - setTimeout(function () { - throw e$5; - }); + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); - }; - return lane; - } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; } - function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); + function validateFragmentProps(element, fiber, returnFiber) { + for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { + var key = keys[i]; + if ("children" !== key && "key" !== key) { + null === fiber && + ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), + (fiber.return = returnFiber)); runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, fiber, - errorInfo + function (erroredKey) { + console.error( + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + erroredKey + ); + }, + key ); - }; + break; + } } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - callComponentDidCatchInDEV(this, errorInfo); - "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & 2) && - console.error( - "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", - getComponentNameFromFiber(fiber) || "Unknown" - )); - }); } - function resetSuspendedComponent(sourceFiber, rootRenderLanes) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + return trackUsedThenable(thenableState, thenable, index); + } + function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error( + 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' ); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } - function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ) { - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; + function warnOnFunctionType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasFunctionTypeWarning[parentName] || + ((ownerHasFunctionTypeWarning[parentName] = !0), + (invalidChild = + invalidChild.displayName || invalidChild.name || "Component"), + 3 === returnFiber.tag + ? console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", + invalidChild, + invalidChild, + invalidChild + ) + : console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", + invalidChild, + invalidChild, + parentName, + invalidChild, + parentName + )); } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes - ) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - (value.$$typeof === REACT_POSTPONE_TYPE && - (value = { then: function () {} }), - "function" === typeof value.then) - ) { - resetSuspendedComponent(sourceFiber, rootRenderLanes); - isHydrating && (didSuspendOrErrorDEV = !0); - var suspenseBoundary = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary) { - switch (suspenseBoundary.tag) { - case 13: - return ( - null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === suspenseBoundary.alternate && - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended), - (suspenseBoundary.flags &= -257), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? (suspenseBoundary.updateQueue = new Set([value])) - : sourceFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - return ( - (suspenseBoundary.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (suspenseBoundary.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - suspenseBoundary.tag + - "). This is a bug in React." - ); + function warnOnSymbolType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasSymbolTypeWarning[parentName] || + ((ownerHasSymbolTypeWarning[parentName] = !0), + (invalidChild = String(invalidChild)), + 3 === returnFiber.tag + ? console.error( + "Symbols are not valid as a React child.\n root.render(%s)", + invalidChild + ) + : console.error( + "Symbols are not valid as a React child.\n <%s>%s", + parentName, + invalidChild, + parentName + )); + } + function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), + (returnFiber.flags |= 16)) + : deletions.push(childToDelete); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; } - if (isHydrating) - return ( - (didSuspendOrErrorDEV = !0), - (suspenseBoundary = suspenseHandlerStackCursor.current), - null !== suspenseBoundary - ? (0 === (suspenseBoundary.flags & 65536) && - (suspenseBoundary.flags |= 256), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", - { cause: value } - ), - sourceFiber - ) - )) - : (value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored)), - !1 - ); - queueConcurrentError( - createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ); - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - value = returnFiber; - do { - switch (value.tag) { - case 3: - return ( - (value.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (value.lanes |= root), - (root = createRootErrorUpdate( - value.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(value, root), - !1 - ); - case 1: - if ( - ((returnFiber = value.type), - (suspenseBoundary = value.stateNode), - 0 === (value.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== suspenseBoundary && - "function" === typeof suspenseBoundary.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - suspenseBoundary - ))))) - ) - return ( - (value.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (value.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - value, - sourceFiber - ), - enqueueCapturedUpdate(value, rootRenderLanes), - !1 - ); - } - value = value.return; - } while (null !== value); - return !1; - } - function reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); - } - function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; - } - function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) return ( - (Component = resolveFunctionForHotReloading(type)), - (workInProgress.tag = 15), - (workInProgress.type = Component), - validateFunctionComponentInDev(workInProgress, type), - updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + newFiber.flags |= 33554434; + return lastPlacedIndex; } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if ( - Component(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText( + textContent, + returnFiber.mode, + lanes + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); - } - function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = - 0 !== - (workInProgress.stateNode._pendingVisibility & OffscreenDetached), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( + (current = updateFragment( + returnFiber, current, - workInProgress, - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) + element.props.children, + lanes, + element.key + )), + validateFragmentProps(element, current, returnFiber), + current ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; - } - function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes - ) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { - parent: CacheContext._currentValue, - pool: JSCompiler_inline_result - }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(workInProgress); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; - } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + if ( + null !== current && + (current.elementType === elementType || + isCompatibleFamilyForHotReloading(current, element) || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + (current._debugOwner = element._owner), + (current._debugInfo = currentDebugInfo), + current ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + current = createFiberFromElement(element, returnFiber.mode, lanes); + coerceRef(current, element); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - } - function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if ( - Component.prototype && - "function" === typeof Component.prototype.render - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - didWarnAboutBadClass[componentName] || - (console.error( - "The <%s /> 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 - ), - (didWarnAboutBadClass[componentName] = !0)); + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null - ); - null === current && - (validateFunctionComponentInDev(workInProgress, workInProgress.type), - Component.contextTypes && - ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes[componentName] || - ((didWarnAboutContextTypes[componentName] = !0), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", - componentName - )))); - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; - } - function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes - ) { - prepareToReadContext(workInProgress); - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current, workInProgress); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; - } - function updateClassComponent( - current$jscomp$0, - workInProgress, - Component, - nextProps, - renderLanes - ) { - switch (shouldErrorImpl(workInProgress)) { - case !1: - var _instance = workInProgress.stateNode, - state = new workInProgress.type( - workInProgress.memoizedProps, - _instance.context - ).state; - _instance.updater.enqueueSetState(_instance, state, null); - break; - case !0: - workInProgress.flags |= 128; - workInProgress.flags |= 65536; - _instance = Error("Simulated error coming from DevTools"); - var lane = renderLanes & -renderLanes; - workInProgress.lanes |= lane; - state = workInProgressRoot; - if (null === state) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - lane = createClassErrorUpdate(lane); - initializeClassErrorUpdate( - lane, - state, - workInProgress, - createCapturedValueAtFiber(_instance, workInProgress) + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); - enqueueCapturedUpdate(workInProgress, lane); + current = useFiber(current, fragment); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) { - state = emptyContextObject; - _instance = Component.contextType; - "contextType" in Component && - null !== _instance && - (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) && - (didWarnAboutInvalidateContextType.add(Component), - (lane = - void 0 === _instance - ? " 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." - : "object" !== typeof _instance - ? " However, it is set to a " + typeof _instance + "." - : _instance.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(_instance).join(", ") + - "}."), - console.error( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - lane - )); - "object" === typeof _instance && - null !== _instance && - (state = readContext(_instance)); - _instance = new Component(nextProps, state); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - _instance = new Component(nextProps, state); - } finally { - setIsStrictModeForDevtools(!1); - } - } - state = workInProgress.memoizedState = - null !== _instance.state && void 0 !== _instance.state - ? _instance.state - : null; - _instance.updater = classComponentUpdater; - workInProgress.stateNode = _instance; - _instance._reactInternals = workInProgress; - _instance._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state) || - (didWarnAboutUninitializedState.add(state), - console.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.", - state, - null === _instance.state ? "null" : "undefined", - state - ))); + function createChild(returnFiber, newChild, lanes) { if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate - ) { - var foundWillUpdateName = (lane = state = null); - "function" === typeof _instance.componentWillMount && - !0 !== _instance.componentWillMount.__suppressDeprecationWarning - ? (state = "componentWillMount") - : "function" === typeof _instance.UNSAFE_componentWillMount && - (state = "UNSAFE_componentWillMount"); - "function" === typeof _instance.componentWillReceiveProps && - !0 !== - _instance.componentWillReceiveProps.__suppressDeprecationWarning - ? (lane = "componentWillReceiveProps") - : "function" === - typeof _instance.UNSAFE_componentWillReceiveProps && - (lane = "UNSAFE_componentWillReceiveProps"); - "function" === typeof _instance.componentWillUpdate && - !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof _instance.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if (null !== state || null !== lane || null !== foundWillUpdateName) { - _instance = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), - console.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\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - _instance, - newApiName, - null !== state ? "\n " + state : "", - null !== lane ? "\n " + lane : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = createChild(returnFiber, newChild, lanes); + currentDebugInfo = _prevDebugInfo; + return returnFiber; } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = createChild( + returnFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - _instance = workInProgress.stateNode; - state = getComponentNameFromType(Component) || "Component"; - _instance.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? console.error( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - state - ) - : console.error( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - state - )); - !_instance.getInitialState || - _instance.getInitialState.isReactClassApproved || - _instance.state || - console.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?", - state - ); - _instance.getDefaultProps && - !_instance.getDefaultProps.isReactClassApproved && - console.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.", - state + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? ((key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) { + if (null !== key) return null; + key = pushDebugInfo(newChild._debugInfo); + returnFiber = updateFragment( + returnFiber, + oldFiber, + newChild, + lanes, + null + ); + currentDebugInfo = key; + return returnFiber; + } + if ("function" === typeof newChild.then) + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - _instance.contextType && - console.error( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - state + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (newIdx = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + newIdx, + newChild, + lanes + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + currentDebugInfo = _prevDebugInfo7; + return returnFiber; + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { + if ("object" !== typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(returnFiber, workInProgress, child); + var key = child.key; + if ("string" !== typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + runWithFiberInDEV(workInProgress, function () { + console.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/or omitted \u2014 the behavior is unsupported and could change in a future version.", + key + ); + }); + break; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + } + return knownKeys; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var knownKeys = null, + resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes ); - Component.childContextTypes && - !didWarnAboutChildContextTypes.has(Component) && - (didWarnAboutChildContextTypes.add(Component), - console.error( - "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", - state - )); - Component.contextTypes && - !didWarnAboutContextTypes$1.has(Component) && - (didWarnAboutContextTypes$1.add(Component), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", - state - )); - "function" === typeof _instance.componentShouldUpdate && - console.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.", - state - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof _instance.shouldComponentUpdate && - console.error( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof _instance.componentDidUnmount && - console.error( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - state - ); - "function" === typeof _instance.componentDidReceiveProps && - console.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().", - state - ); - "function" === typeof _instance.componentWillRecieveProps && - console.error( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - state - ); - "function" === typeof _instance.UNSAFE_componentWillRecieveProps && - console.error( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - state - ); - lane = _instance.props !== nextProps; - void 0 !== _instance.props && - lane && - console.error( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - state - ); - _instance.defaultProps && - console.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.", - state, - state - ); - "function" !== typeof _instance.getSnapshotBeforeUpdate || - "function" === typeof _instance.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - console.error( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof _instance.getDerivedStateFromProps && - console.error( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state - ); - "function" === typeof _instance.getDerivedStateFromError && - console.error( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state - ); - "function" === typeof Component.getSnapshotBeforeUpdate && - console.error( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - state + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + newChildren[newIdx], + knownKeys ); - (lane = _instance.state) && - ("object" !== typeof lane || isArrayImpl(lane)) && - console.error("%s.state: must be set to an object or null", state); - "function" === typeof _instance.getChildContext && - "object" !== typeof Component.childContextTypes && - console.error( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - state + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - _instance = workInProgress.stateNode; - _instance.props = nextProps; - _instance.state = workInProgress.memoizedState; - _instance.refs = {}; - initializeUpdateQueue(workInProgress); - state = Component.contextType; - _instance.context = - "object" === typeof state && null !== state - ? readContext(state) - : emptyContextObject; - _instance.state === nextProps && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(state) || - (didWarnAboutDirectlyAssigningPropsToState.add(state), + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + newChildren[newIdx], + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + newChildren[newIdx], + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + newChildren !== newChildrenIterable || + (0 === returnFiber.tag && + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(returnFiber.type) && + "[object AsyncGenerator]" === + Object.prototype.toString.call(newChildren)) || + (didWarnAboutGenerators || console.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.", - state - ))); - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - _instance - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - _instance - ); - _instance.state = workInProgress.memoizedState; - state = Component.getDerivedStateFromProps; - "function" === typeof state && - (applyDerivedStateFromProps( - workInProgress, - Component, - state, - nextProps - ), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ((state = _instance.state), - "function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount(), - state !== _instance.state && - (console.error( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" + "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." ), - classComponentUpdater.enqueueReplaceState( - _instance, - _instance.state, - null - )), - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308); - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864); - _instance = !0; - } else if (null === current$jscomp$0) { - _instance = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - lane = resolveClassComponentProps(Component, unresolvedOldProps); - _instance.props = lane; - var oldContext = _instance.context; - foundWillUpdateName = Component.contextType; - state = emptyContextObject; - "object" === typeof foundWillUpdateName && - null !== foundWillUpdateName && - (state = readContext(foundWillUpdateName)); - newApiName = Component.getDerivedStateFromProps; - foundWillUpdateName = - "function" === typeof newApiName || - "function" === typeof _instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== state) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - state - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof newApiName && - (applyDerivedStateFromProps( - workInProgress, - Component, - newApiName, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - oldState, - oldContext, - state - )) - ? (foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ("function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount()), - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (_instance.props = nextProps), - (_instance.state = oldContext), - (_instance.context = state), - (_instance = lane)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (_instance = !1)); - } else { - _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - state = workInProgress.memoizedProps; - foundWillUpdateName = resolveClassComponentProps(Component, state); - _instance.props = foundWillUpdateName; - newApiName = workInProgress.pendingProps; - oldState = _instance.context; - oldContext = Component.contextType; - lane = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (lane = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof _instance.getSnapshotBeforeUpdate) || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((state !== newApiName || oldState !== lane) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - lane - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - state !== newApiName || - oldState !== newState || - hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (foundWillUpdateName = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - foundWillUpdateName, - nextProps, - oldState, - newState, - lane - ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (oldContext || - ("function" !== typeof _instance.UNSAFE_componentWillUpdate && - "function" !== typeof _instance.componentWillUpdate) || - ("function" === typeof _instance.componentWillUpdate && - _instance.componentWillUpdate(nextProps, newState, lane), - "function" === typeof _instance.UNSAFE_componentWillUpdate && - _instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - lane - )), - "function" === typeof _instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof _instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (_instance.props = nextProps), - (_instance.state = newState), - (_instance.context = lane), - (_instance = foundWillUpdateName)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (_instance = !1)); + (didWarnAboutGenerators = !0)); + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); } - lane = _instance; - markRef(current$jscomp$0, workInProgress); - state = 0 !== (workInProgress.flags & 128); - if (lane || state) { - lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (state && "function" !== typeof Component.getDerivedStateFromError) - (Component = null), (profilerStartTime = -1); - else if ( - ((Component = callRenderInDEV(lane)), - workInProgress.mode & StrictLegacyMode) + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + knownKeys = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() ) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(lane); - } finally { - setIsStrictModeForDevtools(!1); + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + step.value, + knownKeys + ); + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - workInProgress.flags |= 1; - null !== current$jscomp$0 && state - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); - workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; - } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - ); - renderLanes = workInProgress.stateNode; - _instance && - renderLanes.props !== nextProps && - (didWarnAboutReassigningProps || - console.error( - "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", - getComponentNameFromFiber(workInProgress) || "a component" - ), - (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; - } - function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; - } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && - console.error( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" - ); - "function" === typeof Component.getDerivedStateFromProps && - ((workInProgress = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || - (console.error( - "%s: Function components do not support getDerivedStateFromProps.", - workInProgress - ), - (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = - !0))); - "object" === typeof Component.contextType && - null !== Component.contextType && - ((Component = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypeOnFunctionComponent[Component] || - (console.error( - "%s: Function components do not support contextType.", - Component - ), - (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); - } - function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; - } - function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes - ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; - } - function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2330; - var JSCompiler_object_inline_stack_2329 = workInProgress.pendingProps; - shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2327 = !1; - var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2330 = didSuspend) || - (JSCompiler_object_inline_componentStack_2330 = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2330 && - ((JSCompiler_object_inline_message_2327 = !0), - (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2330 = - 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - JSCompiler_object_inline_message_2327 - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var JSCompiler_object_inline_digest_2328 = nextHydratableInstance; - var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2328)) { - c: { - var instance = JSCompiler_object_inline_digest_2328; - for ( - JSCompiler_temp = rootOrSingletonContext; - 8 !== instance.nodeType; - - ) { - if (!JSCompiler_temp) { - JSCompiler_temp = null; - break c; - } - instance = getNextHydratable(instance.nextSibling); - if (null === instance) { - JSCompiler_temp = null; - break c; - } - } - JSCompiler_temp = instance; - } - null !== JSCompiler_temp - ? (warnIfNotHydrating(), - (workInProgress.memoizedState = { - dehydrated: JSCompiler_temp, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (instance = createFiber(18, null, null, NoMode)), - (instance.stateNode = JSCompiler_temp), - (instance.return = workInProgress), - (workInProgress.child = instance), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp = !0)) - : (JSCompiler_temp = !1); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && - (warnNonHydratedInstance( - workInProgress, - JSCompiler_object_inline_digest_2328 - ), - throwOnHydrationMismatch(workInProgress)); - } - JSCompiler_object_inline_digest_2328 = workInProgress.memoizedState; - if ( - null !== JSCompiler_object_inline_digest_2328 && - ((JSCompiler_object_inline_digest_2328 = - JSCompiler_object_inline_digest_2328.dehydrated), - null !== JSCompiler_object_inline_digest_2328) - ) - return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2328) - ? (workInProgress.lanes = 16) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); - } - JSCompiler_object_inline_digest_2328 = - JSCompiler_object_inline_stack_2329.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2329.fallback; - if (JSCompiler_object_inline_message_2327) + if (step.done) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2329 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2328, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_message_2327 = workInProgress.child), - (JSCompiler_object_inline_message_2327.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2327.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2330, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2329 + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - if ( - "number" === - typeof JSCompiler_object_inline_stack_2329.unstable_expectedLoadTime + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (oldFiber = createChild(returnFiber, step.value, lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + step.value, + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() ) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2329 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2328, - JSCompiler_temp, - renderLanes + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + step.value, + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + step.value, + knownKeys )), - (JSCompiler_object_inline_message_2327 = workInProgress.child), - (JSCompiler_object_inline_message_2327.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2327.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2330, - renderLanes + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2329 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_digest_2328 - ); + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - var prevState = current.memoizedState; - if ( - null !== prevState && - ((JSCompiler_object_inline_digest_2328 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2328) + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2327 = - JSCompiler_object_inline_stack_2329.fallback), - (JSCompiler_object_inline_digest_2328 = workInProgress.mode), - (JSCompiler_object_inline_stack_2329 = - mountWorkInProgressOffscreenFiber( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2329.children - }, - JSCompiler_object_inline_digest_2328 - )), - (JSCompiler_object_inline_message_2327 = - createFiberFromFragment( - JSCompiler_object_inline_message_2327, - JSCompiler_object_inline_digest_2328, - renderLanes, - null - )), - (JSCompiler_object_inline_message_2327.flags |= 2), - (JSCompiler_object_inline_stack_2329.return = workInProgress), - (JSCompiler_object_inline_message_2327.return = workInProgress), - (JSCompiler_object_inline_stack_2329.sibling = - JSCompiler_object_inline_message_2327), - (workInProgress.child = JSCompiler_object_inline_stack_2329), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2329 = workInProgress.child), - (JSCompiler_object_inline_stack_2329.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2329.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2330, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2327)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isHydrating && - console.error( - "We should not be hydrating here. This is a bug in React. Please file a bug." - ), - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2328)) - ) { - JSCompiler_object_inline_componentStack_2330 = - JSCompiler_object_inline_digest_2328.nextSibling && - JSCompiler_object_inline_digest_2328.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2330) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2330.dgst; - var message = JSCompiler_object_inline_componentStack_2330.msg; - instance = JSCompiler_object_inline_componentStack_2330.stck; - var componentStack = - JSCompiler_object_inline_componentStack_2330.cstck; - } - JSCompiler_object_inline_message_2327 = message; - JSCompiler_object_inline_digest_2328 = JSCompiler_temp; - JSCompiler_object_inline_stack_2329 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2330 = - componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2328 && - ((JSCompiler_object_inline_componentStack_2330 = - JSCompiler_object_inline_message_2327 - ? Error(JSCompiler_object_inline_message_2327) - : Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - )), - (JSCompiler_object_inline_componentStack_2330.stack = - JSCompiler_object_inline_stack_2329 || ""), - (JSCompiler_object_inline_componentStack_2330.digest = - JSCompiler_object_inline_digest_2328), - (JSCompiler_object_inline_stack_2329 = - void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2327 = { - value: JSCompiler_object_inline_componentStack_2330, - source: null, - stack: JSCompiler_object_inline_stack_2329 - }), - "string" === typeof JSCompiler_object_inline_stack_2329 && - CapturedStacks.set( - JSCompiler_object_inline_componentStack_2330, - JSCompiler_object_inline_message_2327 - ), - queueHydrationError(JSCompiler_object_inline_message_2327)); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (JSCompiler_object_inline_componentStack_2330 = - 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2330) - ) { - JSCompiler_object_inline_componentStack_2330 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2330) { - JSCompiler_object_inline_stack_2329 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2329 & 42)) - JSCompiler_object_inline_stack_2329 = 1; - else - switch (JSCompiler_object_inline_stack_2329) { - case 2: - JSCompiler_object_inline_stack_2329 = 1; - break; - case 8: - JSCompiler_object_inline_stack_2329 = 4; - break; - case 32: - JSCompiler_object_inline_stack_2329 = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - JSCompiler_object_inline_stack_2329 = 64; - break; - case 268435456: - JSCompiler_object_inline_stack_2329 = 134217728; - break; - default: - JSCompiler_object_inline_stack_2329 = 0; + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (validateFragmentProps(newChild, null, returnFiber), + (newChild = newChild.props.children)); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + var prevDebugInfo = pushDebugInfo(newChild._debugInfo); + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + validateFragmentProps(newChild, lanes, returnFiber); + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + isCompatibleFamilyForHotReloading( + currentFirstChild, + newChild + ) || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + validateFragmentProps(newChild, lanes, returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)); } - JSCompiler_object_inline_stack_2329 = - 0 !== - (JSCompiler_object_inline_stack_2329 & - (JSCompiler_object_inline_componentStack_2330.suspendedLanes | - renderLanes)) - ? 0 - : JSCompiler_object_inline_stack_2329; - if ( - 0 !== JSCompiler_object_inline_stack_2329 && - JSCompiler_object_inline_stack_2329 !== prevState.retryLane - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2329), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2329 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2330, - current, - JSCompiler_object_inline_stack_2329 - ), - SelectiveHydrationException) + returnFiber = placeSingleChild(returnFiber); + currentDebugInfo = prevDebugInfo; + return returnFiber; + case REACT_PORTAL_TYPE: + a: { + prevDebugInfo = newChild; + for ( + newChild = prevDebugInfo.key; + null !== currentFirstChild; + + ) { + if (currentFirstChild.key === newChild) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + prevDebugInfo.containerInfo && + currentFirstChild.stateNode.implementation === + prevDebugInfo.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + prevDebugInfo.children || [] + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal( + prevDebugInfo, + returnFiber.mode, + lanes + ); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber ); } - JSCompiler_object_inline_digest_2328.data === - SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - JSCompiler_object_inline_digest_2328.data === - SUSPENSE_PENDING_START_DATA - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((current = prevState.treeContext), - (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2328.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (didSuspendOrErrorDEV = !1), - (hydrationDiffRootDEV = null), - (rootOrSingletonContext = !1), - null !== current && - (warnIfNotHydrating(), - (idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_stack_2329.children + if (isArrayImpl(newChild)) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes )), - (workInProgress.flags |= 4096)); - return workInProgress; - } - if (JSCompiler_object_inline_message_2327) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2327 = - JSCompiler_object_inline_stack_2329.fallback), - (JSCompiler_object_inline_digest_2328 = workInProgress.mode), - (JSCompiler_temp = current.child), - (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2329 = createWorkInProgress( - JSCompiler_temp, - { - mode: "hidden", - children: JSCompiler_object_inline_stack_2329.children - } - )), - (JSCompiler_object_inline_stack_2329.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), - null !== instance - ? (JSCompiler_object_inline_message_2327 = createWorkInProgress( - instance, - JSCompiler_object_inline_message_2327 - )) - : ((JSCompiler_object_inline_message_2327 = createFiberFromFragment( - JSCompiler_object_inline_message_2327, - JSCompiler_object_inline_digest_2328, - renderLanes, - null + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (getIteratorFn(newChild)) { + prevDebugInfo = pushDebugInfo(newChild._debugInfo); + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + var newChildren = key.call(newChild); + if (newChildren === newChild) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== + Object.prototype.toString.call(newChildren) + ) + didWarnAboutGenerators || + console.error( + "Using Iterators 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. You can also use an Iterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0); + } else + newChild.entries !== key || + didWarnAboutMaps || + (console.error( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)); + returnFiber = reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ); + currentDebugInfo = prevDebugInfo; + return returnFiber; + } + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes )), - (JSCompiler_object_inline_message_2327.flags |= 2)), - (JSCompiler_object_inline_message_2327.return = workInProgress), - (JSCompiler_object_inline_stack_2329.return = workInProgress), - (JSCompiler_object_inline_stack_2329.sibling = - JSCompiler_object_inline_message_2327), - (workInProgress.child = JSCompiler_object_inline_stack_2329), - (JSCompiler_object_inline_stack_2329 = - JSCompiler_object_inline_message_2327), - (JSCompiler_object_inline_message_2327 = workInProgress.child), - (JSCompiler_object_inline_digest_2328 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2328 - ? (JSCompiler_object_inline_digest_2328 = - mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2328.cachePool), - null !== JSCompiler_temp - ? ((instance = CacheContext._currentValue), - (JSCompiler_temp = - JSCompiler_temp.parent !== instance - ? { parent: instance, pool: instance } - : JSCompiler_temp)) - : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2328 = { - baseLanes: - JSCompiler_object_inline_digest_2328.baseLanes | renderLanes, - cachePool: JSCompiler_temp - })), - (JSCompiler_object_inline_message_2327.memoizedState = - JSCompiler_object_inline_digest_2328), - (JSCompiler_object_inline_message_2327.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2330, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2329 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: JSCompiler_object_inline_stack_2329.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; - null !== current && - ((JSCompiler_object_inline_componentStack_2330 = - workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2330 - ? ((workInProgress.deletions = [current]), - (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2330.push(current)); - workInProgress.child = renderLanes; - workInProgress.memoizedState = null; - return renderLanes; - } - function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (prevDebugInfo = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ), + (lanes = useFiber(currentFirstChild, prevDebugInfo)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText( + prevDebugInfo, + returnFiber.mode, + lanes + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)), + placeSingleChild(returnFiber) + ); + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return deleteRemainingChildren(returnFiber, currentFirstChild); + } + return function (returnFiber, currentFirstChild, newChild, lanes) { + var prevDebugInfo = currentDebugInfo; + currentDebugInfo = null; + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + var debugInfo = (fiber._debugInfo = currentDebugInfo); + fiber._debugOwner = returnFiber._debugOwner; + fiber._debugTask = returnFiber._debugTask; + if (null != debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) + if ("string" === typeof debugInfo[i].stack) { + fiber._debugOwner = debugInfo[i]; + fiber._debugTask = debugInfo[i].debugTask; + break; + } + return fiber; + } finally { + currentDebugInfo = prevDebugInfo; + } + }; } - function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes - ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null + function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push( + suspenseStackCursor, + suspenseStackCursor.current & SubtreeSuspenseContextMask, + handler ); - primaryChildren.return = workInProgress; - fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; - return fallbackChildren; + push(suspenseHandlerStackCursor, handler, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); + function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); } - function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; } - function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - propagationRoot - ); + function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); } - function validateSuspenseListNestedChild(childSlot, index) { - var isAnArray = isArrayImpl(childSlot); - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); - return isAnArray || childSlot - ? ((isAnArray = isAnArray ? "array" : "iterable"), - console.error( - "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", - isAnArray, - index, - isAnArray - ), - !1) - : !0; + function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if ( + 19 === node.tag && + void 0 !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; } - function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode - ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + function defaultOnUncaughtError(error) { + reportGlobalError(error); + console.warn( + "%s\n\n%s\n", + componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components.", + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); } - function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; + function defaultOnCaughtError(error) { + var componentNameMessage = componentName + ? "The above error occurred in the <" + componentName + "> component." + : "The above error occurred in one of your React components.", + recreateMessage = + "React will try to recreate this component tree from scratch using the error boundary you provided, " + + ((errorBoundaryName || "Anonymous") + "."); if ( - void 0 !== revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "together" !== revealOrder && - !didWarnAboutRevealOrder[revealOrder] - ) - if ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) - ) - switch (revealOrder.toLowerCase()) { - case "together": - case "forwards": - case "backwards": - console.error( - '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - case "forward": - case "backward": - console.error( - '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - default: - console.error( - '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder - ); - } - else - console.error( - '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder + "object" === typeof error && + null !== error && + "string" === typeof error.environmentName + ) { + var JSCompiler_inline_result = error.environmentName; + error = [ + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ].slice(0); + "string" === typeof error[0] + ? error.splice( + 0, + 1, + badgeFormat + error[0], + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ) + : error.splice( + 0, + 0, + badgeFormat, + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ); + error.unshift(console); + JSCompiler_inline_result = bind.apply(console.error, error); + JSCompiler_inline_result(); + } else + console.error( + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ); + } + function defaultOnRecoverableError(error) { + reportGlobalError(error); + } + function logUncaughtError(root, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = null; + var error = errorInfo.value; + if (null !== ReactSharedInternals.actQueue) + ReactSharedInternals.thrownErrors.push(error); + else { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(error, { componentStack: errorInfo.stack }); + } + } catch (e$4) { + setTimeout(function () { + throw e$4; + }); + } + } + function logCaughtError(root, boundary, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = getComponentNameFromFiber(boundary); + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$5) { + setTimeout(function () { + throw e$5; + }); + } + } + function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + lane.payload = { element: null }; + lane.callback = function () { + runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + }; + return lane; + } + function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + return lane; + } + function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - void 0 === tailMode || - didWarnAboutTailOptions[tailMode] || - ("collapsed" !== tailMode && "hidden" !== tailMode - ? ((didWarnAboutTailOptions[tailMode] = !0), - console.error( - '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', - tailMode - )) - : "forwards" !== revealOrder && - "backwards" !== revealOrder && - ((didWarnAboutTailOptions[tailMode] = !0), - console.error( - ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', - tailMode - ))); - a: if ( - ("forwards" === revealOrder || "backwards" === revealOrder) && - void 0 !== nextProps && - null !== nextProps && - !1 !== nextProps - ) - if (isArrayImpl(nextProps)) - for (var i = 0; i < nextProps.length; i++) { - if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; - } - else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { - if ((i = i.call(nextProps))) - for (var step = i.next(), _i = 0; !step.done; step = i.next()) { - if (!validateSuspenseListNestedChild(step.value, _i)) break a; - _i++; - } - } else - console.error( - 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', - revealOrder - ); - reconcileChildren(current, workInProgress, nextProps, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & ForceSuspenseFallback)) - (nextProps = - (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), - (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber( - current, - renderLanes, - workInProgress - ); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= SubtreeSuspenseContextMask; + }; } - push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + callComponentDidCatchInDEV(this, errorInfo); + "function" === typeof getDerivedStateFromError || + (0 === (fiber.lanes & 2) && + console.error( + "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", + getComponentNameFromFiber(fiber) || "Unknown" + )); + }); } - function bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; + function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); } - function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } - function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes + function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache - ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + (value.$$typeof === REACT_POSTPONE_TYPE && + (value = { then: function () {} }), + "function" === typeof value.then) + ) { + resetSuspendedComponent(sourceFiber, rootRenderLanes); + isHydrating && (didSuspendOrErrorDEV = !0); + var suspenseBoundary = suspenseHandlerStackCursor.current; + if (null !== suspenseBoundary) { + switch (suspenseBoundary.tag) { + case 13: return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === suspenseBoundary.alternate && + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootSuspended), + (suspenseBoundary.flags &= -257), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? (suspenseBoundary.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 ); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes + case 22: + return ( + (suspenseBoundary.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (suspenseBoundary.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 ); - workInProgress.flags |= 128; } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push( - suspenseStackCursor, - suspenseStackCursor.current, - workInProgress - ); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + throw Error( + "Unexpected Suspense handler tag (" + + suspenseBoundary.tag + + "). This is a bug in React." ); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - function beginWork(current, workInProgress, renderLanes) { - if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( - workInProgress.type, - workInProgress.key, - workInProgress.pendingProps, - workInProgress._debugOwner || null, - workInProgress.mode, - workInProgress.lanes - ); - renderLanes._debugStack = workInProgress._debugStack; - renderLanes._debugTask = workInProgress._debugTask; - var returnFiber = workInProgress.return; - if (null === returnFiber) throw Error("Cannot swap the root fiber."); - current.alternate = null; - workInProgress.alternate = null; - renderLanes.index = workInProgress.index; - renderLanes.sibling = workInProgress.sibling; - renderLanes.return = workInProgress.return; - renderLanes.ref = workInProgress.ref; - renderLanes._debugInfo = workInProgress._debugInfo; - if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; - else { - var prevSibling = returnFiber.child; - if (null === prevSibling) - throw Error("Expected parent to have a child."); - for (; prevSibling.sibling !== workInProgress; ) - if (((prevSibling = prevSibling.sibling), null === prevSibling)) - throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; } - if (null !== current) - if ( - current.memoizedProps !== workInProgress.pendingProps || - workInProgress.type !== current.type + if (isHydrating) + return ( + (didSuspendOrErrorDEV = !0), + (suspenseBoundary = suspenseHandlerStackCursor.current), + null !== suspenseBoundary + ? (0 === (suspenseBoundary.flags & 65536) && + (suspenseBoundary.flags |= 256), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", + { cause: value } + ), + sourceFiber + ) + )) + : (value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", + { cause: value } + ), + sourceFiber + ) + ), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored)), + !1 + ); + queueConcurrentError( + createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } + ), + sourceFiber ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) + ); + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + value = returnFiber; + do { + switch (value.tag) { + case 3: return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) + (value.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (value.lanes |= root), + (root = createRootErrorUpdate( + value.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(value, root), + !1 ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); - } - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } - workInProgress = ""; - null !== current && - "object" === typeof current && - current.$$typeof === REACT_LAZY_TYPE && - (workInProgress = - " Did you wrap a component in React.lazy() more than once?"); - current = getComponentNameFromType(current) || current; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - current + - ". Lazy element type must resolve to a class or function." + - workInProgress + case 1: + if ( + ((returnFiber = value.type), + (suspenseBoundary = value.stateNode), + 0 === (value.flags & 128) && + ("function" === typeof returnFiber.getDerivedStateFromError || + (null !== suspenseBoundary && + "function" === typeof suspenseBoundary.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + suspenseBoundary + ))))) + ) + return ( + (value.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (value.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + value, + sourceFiber + ), + enqueueCapturedUpdate(value, rootRenderLanes), + !1 + ); + } + value = value.return; + } while (null !== value); + return !1; + } + function reconcileChildren( + current, + workInProgress, + nextChildren, + renderLanes + ) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes ); - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: + } + function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( current, workInProgress, - returnFiber, - prevSibling, + Component, + nextProps, renderLanes ) ); - case 3: - a: { - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if ( + Component(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + return bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref && + workInProgress.type === current.type + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); - if (null === current) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( - Error( - "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." - ), - workInProgress - ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - current = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = current; - current; - - ) - (current.flags = (current.flags & -3) | 4096), - (current = current.sibling); - else { - resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren( - current, - workInProgress, - nextProps, - renderLanes - ); - } - workInProgress = workInProgress.child; - } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (current = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = current) - : isHydrating || - ((current = workInProgress.type), - (renderLanes = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(current)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = renderLanes), - setInitialProperties(returnFiber, current, renderLanes), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = + 0 !== + (workInProgress.stateNode._pendingVisibility & OffscreenDetached), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes ); - case 27: + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) ); - case 5: - return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( - workInProgress.type, - nextProps.ancestorInfo - )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes + ) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { + parent: CacheContext._currentValue, + pool: JSCompiler_inline_result + }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(workInProgress); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; + } + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); - case 6: - return ( - null === current && - isHydrating && - ((current = workInProgress.pendingProps), - (renderLanes = getHostContext().ancestorInfo.current), - (current = - null != renderLanes - ? validateTextNesting(current, renderLanes.tag) - : !0), - (renderLanes = nextHydratableInstance), - (returnFiber = !renderLanes) || - ((returnFiber = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (current && - warnNonHydratedInstance(workInProgress, renderLanes), - throwOnHydrationMismatch(workInProgress))), - null + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } + } + function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if ( + Component.prototype && + "function" === typeof Component.prototype.render + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + didWarnAboutBadClass[componentName] || + (console.error( + "The <%s /> 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 + ), + (didWarnAboutBadClass[componentName] = !0)); + } + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + null === current && + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + void 0, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; + } + function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes + ) { + prepareToReadContext(workInProgress); + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current, workInProgress); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateClassComponent( + current$jscomp$0, + workInProgress, + Component, + nextProps, + renderLanes + ) { + switch (shouldErrorImpl(workInProgress)) { + case !1: + var _instance = workInProgress.stateNode, + state = new workInProgress.type( + workInProgress.memoizedProps, + _instance.context + ).state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + case !0: + workInProgress.flags |= 128; + workInProgress.flags |= 65536; + _instance = Error("Simulated error coming from DevTools"); + var lane = renderLanes & -renderLanes; + workInProgress.lanes |= lane; + state = workInProgressRoot; + if (null === state) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + lane = createClassErrorUpdate(lane); + initializeClassErrorUpdate( + lane, + state, + workInProgress, + createCapturedValueAtFiber(_instance, workInProgress) ); - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + enqueueCapturedUpdate(workInProgress, lane); + } + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + state = emptyContextObject; + _instance = Component.contextType; + "contextType" in Component && + null !== _instance && + (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(Component) && + (didWarnAboutInvalidateContextType.add(Component), + (lane = + void 0 === _instance + ? " 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." + : "object" !== typeof _instance + ? " However, it is set to a " + typeof _instance + "." + : _instance.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(_instance).join(", ") + + "}."), + console.error( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(Component) || "Component", + lane + )); + "object" === typeof _instance && + null !== _instance && + (state = readContext(_instance)); + _instance = new Component(nextProps, state); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + _instance = new Component(nextProps, state); + } finally { + setIsStrictModeForDevtools(!1); + } + } + state = workInProgress.memoizedState = + null !== _instance.state && void 0 !== _instance.state + ? _instance.state + : null; + _instance.updater = classComponentUpdater; + workInProgress.stateNode = _instance; + _instance._reactInternals = workInProgress; + _instance._reactInternalInstance = fakeInternalInstance; + "function" === typeof Component.getDerivedStateFromProps && + null === state && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutUninitializedState.has(state) || + (didWarnAboutUninitializedState.add(state), + console.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.", + state, + null === _instance.state ? "null" : "undefined", + state + ))); + if ( + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate + ) { + var foundWillUpdateName = (lane = state = null); + "function" === typeof _instance.componentWillMount && + !0 !== _instance.componentWillMount.__suppressDeprecationWarning + ? (state = "componentWillMount") + : "function" === typeof _instance.UNSAFE_componentWillMount && + (state = "UNSAFE_componentWillMount"); + "function" === typeof _instance.componentWillReceiveProps && + !0 !== + _instance.componentWillReceiveProps.__suppressDeprecationWarning + ? (lane = "componentWillReceiveProps") + : "function" === + typeof _instance.UNSAFE_componentWillReceiveProps && + (lane = "UNSAFE_componentWillReceiveProps"); + "function" === typeof _instance.componentWillUpdate && + !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof _instance.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if (null !== state || null !== lane || null !== foundWillUpdateName) { + _instance = getComponentNameFromType(Component) || "Component"; + var newApiName = + "function" === typeof Component.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), + console.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\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _instance, + newApiName, + null !== state ? "\n " + state : "", + null !== lane ? "\n " + lane : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } + } + _instance = workInProgress.stateNode; + state = getComponentNameFromType(Component) || "Component"; + _instance.render || + (Component.prototype && + "function" === typeof Component.prototype.render + ? console.error( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + state + ) + : console.error( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + state + )); + !_instance.getInitialState || + _instance.getInitialState.isReactClassApproved || + _instance.state || + console.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?", + state ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + _instance.getDefaultProps && + !_instance.getDefaultProps.isReactClassApproved && + console.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.", + state ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child + _instance.contextType && + console.error( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + state ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + Component.childContextTypes && + !didWarnAboutChildContextTypes.has(Component) && + (didWarnAboutChildContextTypes.add(Component), + console.error( + "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + state + )); + Component.contextTypes && + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + state + )); + "function" === typeof _instance.componentShouldUpdate && + console.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.", + state ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = -0), - (returnFiber.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + Component.prototype && + Component.prototype.isPureReactComponent && + "undefined" !== typeof _instance.shouldComponentUpdate && + console.error( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(Component) || "A pure component" ); - case 10: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (nextProps = prevSibling.value), - "value" in prevSibling || - hasWarnedAboutUsingNoValuePropOnContextProvider || - ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), - console.error( - "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )), - pushProvider(workInProgress, returnFiber, nextProps), - reconcileChildren( - current, - workInProgress, - prevSibling.children, - renderLanes - ), - workInProgress.child + "function" === typeof _instance.componentDidUnmount && + console.error( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + state ); - case 9: - return ( - (prevSibling = workInProgress.type._context), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - console.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." - ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + "function" === typeof _instance.componentDidReceiveProps && + console.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().", + state ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + "function" === typeof _instance.componentWillRecieveProps && + console.error( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + state ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + "function" === typeof _instance.UNSAFE_componentWillRecieveProps && + console.error( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + state ); - case 19: - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes + lane = _instance.props !== nextProps; + void 0 !== _instance.props && + lane && + console.error( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + state ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + _instance.defaultProps && + console.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.", + state, + state ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue, providerFiber); - context._currentValue = nextValue; - push(rendererCursorDEV, context._currentRenderer, providerFiber); - void 0 !== context._currentRenderer && - null !== context._currentRenderer && - context._currentRenderer !== rendererSigil && - console.error( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue = valueCursor.current; - var currentRenderer = rendererCursorDEV.current; - pop(rendererCursorDEV, providerFiber); - context._currentRenderer = currentRenderer; - pop(valueCursor, providerFiber); - } - function scheduleContextWorkOnParentPath( - parent, - renderLanes, - propagationRoot - ) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } - parent !== propagationRoot && - console.error( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + "function" !== typeof _instance.getSnapshotBeforeUpdate || + "function" === typeof _instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), + console.error( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(Component) + )); + "function" === typeof _instance.getDerivedStateFromProps && + console.error( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } - function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree - ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - console.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()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - 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()." + "function" === typeof _instance.getDerivedStateFromError && + console.error( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; - } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); - } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; - } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - console.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\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; - } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update + "function" === typeof Component.getSnapshotBeforeUpdate && + console.error( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + state + ); + (lane = _instance.state) && + ("object" !== typeof lane || isArrayImpl(lane)) && + console.error("%s.state: must be set to an object or null", state); + "function" === typeof _instance.getChildContext && + "object" !== typeof Component.childContextTypes && + console.error( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + state + ); + _instance = workInProgress.stateNode; + _instance.props = nextProps; + _instance.state = workInProgress.memoizedState; + _instance.refs = {}; + initializeUpdateQueue(workInProgress); + state = Component.contextType; + _instance.context = + "object" === typeof state && null !== state + ? readContext(state) + : emptyContextObject; + _instance.state === nextProps && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(state) || + (didWarnAboutDirectlyAssigningPropsToState.add(state), + console.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.", + state + ))); + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + _instance + ); + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( + workInProgress, + _instance ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); - } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); - } - } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; - } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; - } - function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } - } - function processUpdateQueue( - workInProgress, - props, - instance$jscomp$0, - renderLanes - ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress.updateQueue; - hasForceUpdate = !1; - currentlyProcessingQueue = queue.shared; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); - } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - updateLane = workInProgress; - var partialState = pendingQueue; - var nextProps = props, - instance = instance$jscomp$0; - switch (partialState.tag) { - case ReplaceState: - partialState = partialState.payload; - if ("function" === typeof partialState) { - isDisallowedContextReadInDEV = !0; - var nextState = partialState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - newState = nextState; - break a; - } - newState = partialState; - break a; - case CaptureUpdate: - updateLane.flags = (updateLane.flags & -65537) | 128; - case UpdateState: - nextState = partialState.payload; - if ("function" === typeof nextState) { - isDisallowedContextReadInDEV = !0; - partialState = nextState.call( - instance, + _instance.state = workInProgress.memoizedState; + state = Component.getDerivedStateFromProps; + "function" === typeof state && + (applyDerivedStateFromProps( + workInProgress, + Component, + state, + nextProps + ), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ((state = _instance.state), + "function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount(), + state !== _instance.state && + (console.error( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + _instance, + _instance.state, + null + )), + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); + _instance = !0; + } else if (null === current$jscomp$0) { + _instance = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps(Component, unresolvedOldProps); + _instance.props = lane; + var oldContext = _instance.context; + foundWillUpdateName = Component.contextType; + state = emptyContextObject; + "object" === typeof foundWillUpdateName && + null !== foundWillUpdateName && + (state = readContext(foundWillUpdateName)); + newApiName = Component.getDerivedStateFromProps; + foundWillUpdateName = + "function" === typeof newApiName || + "function" === typeof _instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== state) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + state + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof newApiName && + (applyDerivedStateFromProps( + workInProgress, + Component, + newApiName, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (lane = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + lane, + nextProps, + oldState, + oldContext, + state + )) + ? (foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ("function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount()), + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (_instance.props = nextProps), + (_instance.state = oldContext), + (_instance.context = state), + (_instance = lane)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (_instance = !1)); + } else { + _instance = workInProgress.stateNode; + cloneUpdateQueue(current$jscomp$0, workInProgress); + state = workInProgress.memoizedProps; + foundWillUpdateName = resolveClassComponentProps(Component, state); + _instance.props = foundWillUpdateName; + newApiName = workInProgress.pendingProps; + oldState = _instance.context; + oldContext = Component.contextType; + lane = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (lane = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof _instance.getSnapshotBeforeUpdate) || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((state !== newApiName || oldState !== lane) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + lane + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + state !== newApiName || + oldState !== newState || + hasForceUpdate || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (foundWillUpdateName = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + foundWillUpdateName, + nextProps, + oldState, + newState, + lane + ) || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies))) + ? (oldContext || + ("function" !== typeof _instance.UNSAFE_componentWillUpdate && + "function" !== typeof _instance.componentWillUpdate) || + ("function" === typeof _instance.componentWillUpdate && + _instance.componentWillUpdate(nextProps, newState, lane), + "function" === typeof _instance.UNSAFE_componentWillUpdate && + _instance.UNSAFE_componentWillUpdate( + nextProps, newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - nextState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - } else partialState = nextState; - if (null === partialState || void 0 === partialState) break a; - newState = assign({}, newState, partialState); - break a; - case ForceUpdate: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress.flags |= 64), - isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null + lane + )), + "function" === typeof _instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof _instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (_instance.props = nextProps), + (_instance.state = newState), + (_instance.context = lane), + (_instance = foundWillUpdateName)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (_instance = !1)); + } + lane = _instance; + markRef(current$jscomp$0, workInProgress); + state = 0 !== (workInProgress.flags & 128); + if (lane || state) { + lane = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if (state && "function" !== typeof Component.getDerivedStateFromError) + (Component = null), (profilerStartTime = -1); + else if ( + ((Component = callRenderInDEV(lane)), + workInProgress.mode & StrictLegacyMode) + ) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(lane); + } finally { + setIsStrictModeForDevtools(!1); + } + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && state + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + Component, + renderLanes + ); + workInProgress.memoizedState = lane.state; + current$jscomp$0 = workInProgress.child; + } else + current$jscomp$0 = bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ); + renderLanes = workInProgress.stateNode; + _instance && + renderLanes.props !== nextProps && + (didWarnAboutReassigningProps || + console.error( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + getComponentNameFromFiber(workInProgress) || "a component" + ), + (didWarnAboutReassigningProps = !0)); + return current$jscomp$0; + } + function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function validateFunctionComponentInDev(workInProgress, Component) { + Component && + Component.childContextTypes && + console.error( + "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", + Component.displayName || Component.name || "Component" + ); + "function" === typeof Component.getDerivedStateFromProps && + ((workInProgress = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || + (console.error( + "%s: Function components do not support getDerivedStateFromProps.", + workInProgress + ), + (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = + !0))); + "object" === typeof Component.contextType && + null !== Component.contextType && + ((Component = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypeOnFunctionComponent[Component] || + (console.error( + "%s: Function components do not support contextType.", + Component + ), + (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + } + function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + } + function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes + ) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var JSCompiler_object_inline_componentStack_2451; + var JSCompiler_object_inline_stack_2450 = workInProgress.pendingProps; + shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); + var JSCompiler_object_inline_message_2448 = !1; + var didSuspend = 0 !== (workInProgress.flags & 128); + (JSCompiler_object_inline_componentStack_2451 = didSuspend) || + (JSCompiler_object_inline_componentStack_2451 = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); + JSCompiler_object_inline_componentStack_2451 && + ((JSCompiler_object_inline_message_2448 = !0), + (workInProgress.flags &= -129)); + JSCompiler_object_inline_componentStack_2451 = + 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + JSCompiler_object_inline_message_2448 + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var JSCompiler_object_inline_digest_2449 = nextHydratableInstance; + var JSCompiler_temp; + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2449)) { + c: { + var instance = JSCompiler_object_inline_digest_2449; + for ( + JSCompiler_temp = rootOrSingletonContext; + 8 !== instance.nodeType; + + ) { + if (!JSCompiler_temp) { + JSCompiler_temp = null; + break c; + } + instance = getNextHydratable(instance.nextSibling); + if (null === instance) { + JSCompiler_temp = null; + break c; + } + } + JSCompiler_temp = instance; + } + null !== JSCompiler_temp + ? (warnIfNotHydrating(), + (workInProgress.memoizedState = { + dehydrated: JSCompiler_temp, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (instance = createFiber(18, null, null, NoMode)), + (instance.stateNode = JSCompiler_temp), + (instance.return = workInProgress), + (workInProgress.child = instance), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp = !0)) + : (JSCompiler_temp = !1); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && + (warnNonHydratedInstance( + workInProgress, + JSCompiler_object_inline_digest_2449 + ), + throwOnHydrationMismatch(workInProgress)); + } + JSCompiler_object_inline_digest_2449 = workInProgress.memoizedState; + if ( + null !== JSCompiler_object_inline_digest_2449 && + ((JSCompiler_object_inline_digest_2449 = + JSCompiler_object_inline_digest_2449.dehydrated), + null !== JSCompiler_object_inline_digest_2449) + ) + return ( + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2449) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + JSCompiler_object_inline_digest_2449 = + JSCompiler_object_inline_stack_2450.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2450.fallback; + if (JSCompiler_object_inline_message_2448) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2450 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2449, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_message_2448 = workInProgress.child), + (JSCompiler_object_inline_message_2448.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2448.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2451, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2450 + ); + if ( + "number" === + typeof JSCompiler_object_inline_stack_2450.unstable_expectedLoadTime + ) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2450 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2449, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_message_2448 = workInProgress.child), + (JSCompiler_object_inline_message_2448.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2448.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2451, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + JSCompiler_object_inline_stack_2450 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_digest_2449 + ); + } + var prevState = current.memoizedState; + if ( + null !== prevState && + ((JSCompiler_object_inline_digest_2449 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2449) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2448 = + JSCompiler_object_inline_stack_2450.fallback), + (JSCompiler_object_inline_digest_2449 = workInProgress.mode), + (JSCompiler_object_inline_stack_2450 = + mountWorkInProgressOffscreenFiber( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2450.children + }, + JSCompiler_object_inline_digest_2449 + )), + (JSCompiler_object_inline_message_2448 = + createFiberFromFragment( + JSCompiler_object_inline_message_2448, + JSCompiler_object_inline_digest_2449, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2448.flags |= 2), + (JSCompiler_object_inline_stack_2450.return = workInProgress), + (JSCompiler_object_inline_message_2448.return = workInProgress), + (JSCompiler_object_inline_stack_2450.sibling = + JSCompiler_object_inline_message_2448), + (workInProgress.child = JSCompiler_object_inline_stack_2450), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2450 = workInProgress.child), + (JSCompiler_object_inline_stack_2450.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2450.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2451, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = JSCompiler_object_inline_message_2448)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isHydrating && + console.error( + "We should not be hydrating here. This is a bug in React. Please file a bug." + ), + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2449)) + ) { + JSCompiler_object_inline_componentStack_2451 = + JSCompiler_object_inline_digest_2449.nextSibling && + JSCompiler_object_inline_digest_2449.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2451) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2451.dgst; + var message = JSCompiler_object_inline_componentStack_2451.msg; + instance = JSCompiler_object_inline_componentStack_2451.stck; + var componentStack = + JSCompiler_object_inline_componentStack_2451.cstck; + } + JSCompiler_object_inline_message_2448 = message; + JSCompiler_object_inline_digest_2449 = JSCompiler_temp; + JSCompiler_object_inline_stack_2450 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2451 = + componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2449 && + ((JSCompiler_object_inline_componentStack_2451 = + JSCompiler_object_inline_message_2448 + ? Error(JSCompiler_object_inline_message_2448) + : Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + )), + (JSCompiler_object_inline_componentStack_2451.stack = + JSCompiler_object_inline_stack_2450 || ""), + (JSCompiler_object_inline_componentStack_2451.digest = + JSCompiler_object_inline_digest_2449), + (JSCompiler_object_inline_stack_2450 = + void 0 === JSCompiler_temp ? null : JSCompiler_temp), + (JSCompiler_object_inline_message_2448 = { + value: JSCompiler_object_inline_componentStack_2451, + source: null, + stack: JSCompiler_object_inline_stack_2450 }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + "string" === typeof JSCompiler_object_inline_stack_2450 && + CapturedStacks.set( + JSCompiler_object_inline_componentStack_2451, + JSCompiler_object_inline_message_2448 + ), + queueHydrationError(JSCompiler_object_inline_message_2448)); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (JSCompiler_object_inline_componentStack_2451 = + 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_object_inline_componentStack_2451) + ) { + JSCompiler_object_inline_componentStack_2451 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_componentStack_2451 && + ((JSCompiler_object_inline_stack_2450 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2450 = + 0 !== (JSCompiler_object_inline_stack_2450 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2450 + )), + (JSCompiler_object_inline_stack_2450 = + 0 !== + (JSCompiler_object_inline_stack_2450 & + (JSCompiler_object_inline_componentStack_2451.suspendedLanes | + renderLanes)) + ? 0 + : JSCompiler_object_inline_stack_2450), + 0 !== JSCompiler_object_inline_stack_2450 && + JSCompiler_object_inline_stack_2450 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2450), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2450 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_componentStack_2451, + current, + JSCompiler_object_inline_stack_2450 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_digest_2449.data === + SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + JSCompiler_object_inline_digest_2449.data === + SUSPENSE_PENDING_START_DATA + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((current = prevState.treeContext), + (nextHydratableInstance = getNextHydratable( + JSCompiler_object_inline_digest_2449.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (didSuspendOrErrorDEV = !1), + (hydrationDiffRootDEV = null), + (rootOrSingletonContext = !1), + null !== current && + (warnIfNotHydrating(), + (idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = current.id), + (treeContextOverflow = current.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_stack_2450.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (JSCompiler_object_inline_message_2448) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2448 = + JSCompiler_object_inline_stack_2450.fallback), + (JSCompiler_object_inline_digest_2449 = workInProgress.mode), + (JSCompiler_temp = current.child), + (instance = JSCompiler_temp.sibling), + (JSCompiler_object_inline_stack_2450 = createWorkInProgress( + JSCompiler_temp, + { + mode: "hidden", + children: JSCompiler_object_inline_stack_2450.children + } + )), + (JSCompiler_object_inline_stack_2450.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280), + null !== instance + ? (JSCompiler_object_inline_message_2448 = createWorkInProgress( + instance, + JSCompiler_object_inline_message_2448 + )) + : ((JSCompiler_object_inline_message_2448 = createFiberFromFragment( + JSCompiler_object_inline_message_2448, + JSCompiler_object_inline_digest_2449, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2448.flags |= 2)), + (JSCompiler_object_inline_message_2448.return = workInProgress), + (JSCompiler_object_inline_stack_2450.return = workInProgress), + (JSCompiler_object_inline_stack_2450.sibling = + JSCompiler_object_inline_message_2448), + (workInProgress.child = JSCompiler_object_inline_stack_2450), + (JSCompiler_object_inline_stack_2450 = + JSCompiler_object_inline_message_2448), + (JSCompiler_object_inline_message_2448 = workInProgress.child), + (JSCompiler_object_inline_digest_2449 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2449 + ? (JSCompiler_object_inline_digest_2449 = + mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp = + JSCompiler_object_inline_digest_2449.cachePool), + null !== JSCompiler_temp + ? ((instance = CacheContext._currentValue), + (JSCompiler_temp = + JSCompiler_temp.parent !== instance + ? { parent: instance, pool: instance } + : JSCompiler_temp)) + : (JSCompiler_temp = getSuspendedCache()), + (JSCompiler_object_inline_digest_2449 = { + baseLanes: + JSCompiler_object_inline_digest_2449.baseLanes | renderLanes, + cachePool: JSCompiler_temp + })), + (JSCompiler_object_inline_message_2448.memoizedState = + JSCompiler_object_inline_digest_2449), + (JSCompiler_object_inline_message_2448.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2451, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2450 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: JSCompiler_object_inline_stack_2450.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_object_inline_componentStack_2451 = + workInProgress.deletions), + null === JSCompiler_object_inline_componentStack_2451 + ? ((workInProgress.deletions = [current]), + (workInProgress.flags |= 16)) + : JSCompiler_object_inline_componentStack_2451.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); + } + function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes + ) { + var mode = workInProgress.mode; + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: primaryChildren }, + mode + ); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + primaryChildren.return = workInProgress; + fallbackChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; + } + function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + return createFiberFromOffscreen(offscreenProps, mode, 0, null); + } + function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); + } + function validateSuspenseListNestedChild(childSlot, index) { + var isAnArray = isArrayImpl(childSlot); + childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); + return isAnArray || childSlot + ? ((isAnArray = isAnArray ? "array" : "iterable"), + console.error( + "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", + isAnArray, + index, + isAnArray + ), + !1) + : !0; + } + function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode + ) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + if ( + void 0 !== revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "together" !== revealOrder && + !didWarnAboutRevealOrder[revealOrder] + ) + if ( + ((didWarnAboutRevealOrder[revealOrder] = !0), + "string" === typeof revealOrder) + ) + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + console.error( + '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + case "forward": + case "backward": + console.error( + '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + default: + console.error( + '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + } + else + console.error( + '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + void 0 === tailMode || + didWarnAboutTailOptions[tailMode] || + ("collapsed" !== tailMode && "hidden" !== tailMode + ? ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', + tailMode + )) + : "forwards" !== revealOrder && + "backwards" !== revealOrder && + ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', + tailMode + ))); + a: if ( + ("forwards" === revealOrder || "backwards" === revealOrder) && + void 0 !== nextProps && + null !== nextProps && + !1 !== nextProps + ) + if (isArrayImpl(nextProps)) + for (var i = 0; i < nextProps.length; i++) { + if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; + } + else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { + if ((i = i.call(nextProps))) + for (var step = i.next(), _i = 0; !step.done; step = i.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) break a; + _i++; + } + } else + console.error( + 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', + revealOrder + ); + reconcileChildren(current, workInProgress, nextProps, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & ForceSuspenseFallback)) + (nextProps = + (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), + (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber( + current, + renderLanes, + workInProgress + ); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= SubtreeSuspenseContextMask; + } + push(suspenseStackCursor, nextProps, workInProgress); + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; + } + function bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; + } + return workInProgress.child; + } + function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; + } + function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) { + switch (workInProgress.tag) { + case 3: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent( + current, + workInProgress, + renderLanes + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push( + suspenseStackCursor, + suspenseStackCursor.current, + workInProgress + ); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + if (workInProgress._debugNeedsRemount && null !== current) { + renderLanes = createFiberFromTypeAndProps( + workInProgress.type, + workInProgress.key, + workInProgress.pendingProps, + workInProgress._debugOwner || null, + workInProgress.mode, + workInProgress.lanes + ); + renderLanes._debugStack = workInProgress._debugStack; + renderLanes._debugTask = workInProgress._debugTask; + var returnFiber = workInProgress.return; + if (null === returnFiber) throw Error("Cannot swap the root fiber."); + current.alternate = null; + workInProgress.alternate = null; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; + if (workInProgress === returnFiber.child) + returnFiber.child = renderLanes; + else { + var prevSibling = returnFiber.child; + if (null === prevSibling) + throw Error("Expected parent to have a child."); + for (; prevSibling.sibling !== workInProgress; ) + if (((prevSibling = prevSibling.sibling), null === prevSibling)) + throw Error("Expected to find the previous sibling."); + prevSibling.sibling = renderLanes; + } + workInProgress = returnFiber.deletions; + null === workInProgress + ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; + } + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + workInProgress.type !== current.type + ) + didReceiveUpdate = !0; + else { + if ( + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else { + didReceiveUpdate = !1; + if ((returnFiber = isHydrating)) + warnIfNotHydrating(), + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); + } + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: if ( + ((returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(workInProgress.elementType)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))) + : ((workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } + workInProgress = ""; + null !== current && + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + current = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + current + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 3: + a: { + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) + throw Error( + "Should have a current fiber. This is a bug in React." + ); + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( + Error( + "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." + ), + workInProgress + ); + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + current = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = current; + current; + + ) + (current.flags = (current.flags & -3) | 4096), + (current = current.sibling); + else { + resetHydrationState(); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; + } + reconcileChildren( + current, + workInProgress, + nextProps, + renderLanes + ); + } + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (current = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = current) + : isHydrating || + ((current = workInProgress.type), + (renderLanes = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(current)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = renderLanes), + setInitialProperties(returnFiber, current, renderLanes), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( + workInProgress.type, + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 6: + return ( + null === current && + isHydrating && + ((current = workInProgress.pendingProps), + (renderLanes = getHostContext().ancestorInfo.current), + (current = + null != renderLanes + ? validateTextNesting(current, renderLanes.tag) + : !0), + (renderLanes = nextHydratableInstance), + (returnFiber = !renderLanes) || + ((returnFiber = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (current && + warnNonHydratedInstance(workInProgress, renderLanes), + throwOnHydrationMismatch(workInProgress))), + null + ); + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || + hasWarnedAboutUsingNoValuePropOnContextProvider || + ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), + console.error( + "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + )), + pushProvider(workInProgress, returnFiber, nextProps), + reconcileChildren( + current, + workInProgress, + prevSibling.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (prevSibling = workInProgress.type._context), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + console.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." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } - currentlyProcessingQueue = null; - } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function shouldProfile(current) { return (current.mode & ProfileMode) !== NoMode; @@ -11543,160 +11354,6 @@ } } } - function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$2) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { - focusedElem: root, - selectionRange: JSCompiler_temp - }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - root = firstChild = nextEffect; - JSCompiler_temp = root.alternate; - anchorOffset = root.flags; - switch (root.tag) { - case 0: - if ( - 0 !== (anchorOffset & 4) && - ((root = root.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - 0 !== (anchorOffset & 1024) && - null !== JSCompiler_temp && - commitClassSnapshot(root, JSCompiler_temp); - break; - case 3: - if (0 !== (anchorOffset & 1024)) - if ( - ((root = root.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (anchorOffset & 1024)) - 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." - ); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var prevEffectStart = pushComponentEffectStart(), flags = finishedWork.flags; @@ -12182,13 +11839,6 @@ } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -12728,13 +12378,6 @@ parentFiber = parentFiber.sibling; } } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12742,6 +12385,7 @@ (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { + var prevEffectStart = pushComponentEffectStart(); switch (finishedWork.tag) { case 0: case 11: @@ -12779,6 +12423,17 @@ default: recursivelyTraverseDisappearLayoutEffects(finishedWork); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseDisappearLayoutEffects(parentFiber) { for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12791,7 +12446,8 @@ finishedWork, includeWorkInProgressEffects ) { - var flags = finishedWork.flags; + var prevEffectStart = pushComponentEffectStart(), + flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -12906,6 +12562,17 @@ includeWorkInProgressEffects ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseReappearLayoutEffects( finishedRoot, @@ -12978,39 +12645,16 @@ endTime ) { var prevEffectStart = pushComponentEffectStart(); - if ( - (finishedWork.mode & ProfileMode) !== NoMode && + (finishedWork.mode & ProfileMode) !== NoMode && 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) - ) { - var startTime = finishedWork.actualStartTime, - name = getComponentNameFromFiber(finishedWork); - if (null !== name && supportsUserTiming) { - var selfTime = finishedWork.actualDuration; - if ( - null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child - ) - for ( - var child = finishedWork.child; - null !== child; - child = child.sibling - ) - selfTime -= child.actualDuration; - reusableComponentDevToolDetails.color = - 0.5 > selfTime - ? "primary-light" - : 10 > selfTime - ? "primary" - : 100 > selfTime - ? "primary-dark" - : "error"; - reusableComponentOptions.start = startTime; - reusableComponentOptions.end = endTime; - performance.measure(name, reusableComponentOptions); - } - } - name = finishedWork.flags; + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -13022,11 +12666,16 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: - startTime = pushNestedEffectDurations(); + var prevEffectDuration = pushNestedEffectDurations(), + wasInHydratedSubtree = inHydratedSubtree; + inHydratedSubtree = + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 === (finishedWork.flags & 256); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13034,7 +12683,8 @@ committedTransitions, endTime ); - name & 2048 && + inHydratedSubtree = wasInHydratedSubtree; + flags & 2048 && ((committedLanes = null), null !== finishedWork.alternate && (committedLanes = finishedWork.alternate.memoizedState.cache), @@ -13043,11 +12693,11 @@ (retainCache(committedTransitions), null != committedLanes && releaseCache(committedLanes))); finishedRoot.passiveEffectDuration += - popNestedEffectDurations(startTime); + popNestedEffectDurations(prevEffectDuration); break; case 12: - if (name & 2048) { - startTime = pushNestedEffectDurations(); + if (flags & 2048) { + prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13057,7 +12707,7 @@ ); finishedRoot = finishedWork.stateNode; finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(startTime); + bubbleNestedEffectDurations(prevEffectDuration); try { runWithFiberInDEV( finishedWork, @@ -13079,12 +12729,73 @@ endTime ); break; + case 13: + prevEffectDuration = inHydratedSubtree; + flags = + null !== finishedWork.alternate + ? finishedWork.alternate.memoizedState + : null; + wasInHydratedSubtree = finishedWork.memoizedState; + if ( + null === flags || + null === flags.dehydrated || + (null !== wasInHydratedSubtree && + null !== wasInHydratedSubtree.dehydrated) + ) + inHydratedSubtree = !1; + else if ( + ((wasInHydratedSubtree = finishedWork.deletions), + null !== wasInHydratedSubtree && + 0 < wasInHydratedSubtree.length && + 18 === wasInHydratedSubtree[0].tag) + ) { + if ( + ((inHydratedSubtree = !1), + (flags = flags.hydrationErrors), + null !== flags && + ((wasInHydratedSubtree = finishedWork.actualStartTime), + supportsUserTiming)) + ) { + for (var properties = [], i = 0; i < flags.length; i++) { + var error$jscomp$0 = flags[i].value; + properties.push([ + "Error", + "object" === typeof error$jscomp$0 && + null !== error$jscomp$0 && + "string" === typeof error$jscomp$0.message + ? String(error$jscomp$0.message) + : String(error$jscomp$0) + ]); + } + performance.measure("Suspense", { + start: wasInHydratedSubtree, + end: endTime, + detail: { + devtools: { + color: "error", + track: COMPONENTS_TRACK, + tooltipText: "Hydration failed", + properties: properties + } + } + }); + } + } else inHydratedSubtree = !0; + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + inHydratedSubtree = prevEffectDuration; + break; case 23: break; case 22: - startTime = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? startTime._visibility & OffscreenPassiveEffectsConnected + ? prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13094,9 +12805,12 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) - : startTime._visibility & OffscreenPassiveEffectsConnected + : prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13104,15 +12818,17 @@ committedTransitions, endTime ) - : ((startTime._visibility |= OffscreenPassiveEffectsConnected), + : ((prevEffectDuration._visibility |= + OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) + 0 !== (finishedWork.subtreeFlags & 10256), + endTime )); - name & 2048 && + flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork @@ -13126,7 +12842,7 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; default: @@ -13155,28 +12871,43 @@ parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var nextSibling = parentFiber.sibling; reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); + includeWorkInProgressEffects, + null !== nextSibling ? nextSibling.actualStartTime : endTime + ); + parentFiber = nextSibling; + } } function reconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { + var prevEffectStart = pushComponentEffectStart(); + (finishedWork.mode & ProfileMode) !== NoMode && + 0 < finishedWork.actualStartTime && + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree + ); var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: @@ -13187,7 +12918,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); commitHookPassiveMountEffects(finishedWork, Passive); break; @@ -13202,11 +12934,15 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( @@ -13214,7 +12950,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime )); includeWorkInProgressEffects && flags & 2048 && @@ -13229,7 +12966,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); includeWorkInProgressEffects && flags & 2048 && @@ -13241,49 +12979,82 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseAtomicPassiveEffects( finishedRoot$jscomp$0, - parentFiber + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber + ? parentFiber.actualStartTime + : endTime$jscomp$0; + (child.mode & ProfileMode) !== NoMode && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender( + child, + child.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = child.flags; + switch (child.tag) { case 22: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitCachePassiveMountEffect( - finishedWork.alternate, - finishedWork - ); + commitCachePassiveMountEffect(child.alternate, child); break; default: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); } - parentFiber = parentFiber.sibling; + child = parentFiber; } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { @@ -13457,11 +13228,13 @@ } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { var fiber = nextEffect, - current = fiber; + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(); switch (current.tag) { case 0: case 11: @@ -13476,30 +13249,42 @@ case 22: null !== current.memoizedState && null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); + ((nearestMountedAncestor = current.memoizedState.cachePool.pool), + null != nearestMountedAncestor && + retainCache(nearestMountedAncestor)); break; case 24: releaseCache(current.memoizedState.cache); } + (current.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + current, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); current = fiber.child; if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { current = nextEffect; - var sibling = current.sibling, - returnFiber = current.return; + prevEffectStart = current.sibling; + nearestMountedAncestor = current.return; detachFiberAfterEffects(current); if (current === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== prevEffectStart) { + prevEffectStart.return = nearestMountedAncestor; + nextEffect = prevEffectStart; break a; } - nextEffect = returnFiber; + nextEffect = nearestMountedAncestor; } } } @@ -13990,16 +13775,16 @@ case 1: return bubbleProperties(workInProgress), null; case 3: - newProps = workInProgress.stateNode; - renderLanes = null; - null !== current && (renderLanes = current.memoizedState.cache); - workInProgress.memoizedState.cache !== renderLanes && + renderLanes = workInProgress.stateNode; + newProps = null; + null !== current && (newProps = current.memoizedState.cache); + workInProgress.memoizedState.cache !== newProps && (workInProgress.flags |= 2048); popProvider(CacheContext, workInProgress); popHostContainer(workInProgress); - newProps.pendingContext && - ((newProps.context = newProps.pendingContext), - (newProps.pendingContext = null)); + renderLanes.pendingContext && + ((renderLanes.context = renderLanes.pendingContext), + (renderLanes.pendingContext = null)); if (null === current || null === current.child) popHydrationState(workInProgress) ? (emitPendingHydrationWarnings(), markUpdate(workInProgress)) @@ -14007,9 +13792,7 @@ (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -14218,9 +14001,9 @@ renderLanes = getHostContext(); if (popHydrationState(workInProgress)) { current = workInProgress.stateNode; - newProps = workInProgress.memoizedProps; + renderLanes = workInProgress.memoizedProps; _type = !didSuspendOrErrorDEV; - renderLanes = null; + newProps = null; var returnFiber = hydrationParentFiber; if (null !== returnFiber) switch (returnFiber.tag) { @@ -14228,8 +14011,8 @@ _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode(workInProgress, 0).serverProps = @@ -14237,12 +14020,12 @@ break; case 27: case 5: - (renderLanes = returnFiber.memoizedProps), + (newProps = returnFiber.memoizedProps), _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode( @@ -14252,10 +14035,10 @@ } current[internalInstanceKey] = workInProgress; current = - current.nodeValue === newProps || - (null !== renderLanes && - !0 === renderLanes.suppressHydrationWarning) || - checkForUnmatchedText(current.nodeValue, newProps) + current.nodeValue === renderLanes || + (null !== newProps && + !0 === newProps.suppressHydrationWarning) || + checkForUnmatchedText(current.nodeValue, renderLanes) ? !0 : !1; current || throwOnHydrationMismatch(workInProgress); @@ -14315,9 +14098,10 @@ _type.treeBaseDuration)); _type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null)), + (_type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = _type), (_type = !0); if (!_type) { if (workInProgress.flags & 256) @@ -14334,27 +14118,27 @@ transferActualDuration(workInProgress), workInProgress ); - newProps = null !== newProps; + renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - newProps && - ((renderLanes = workInProgress.child), + renderLanes && + ((newProps = workInProgress.child), (_type = null), - null !== renderLanes.alternate && - null !== renderLanes.alternate.memoizedState && - null !== renderLanes.alternate.memoizedState.cachePool && - (_type = renderLanes.alternate.memoizedState.cachePool.pool), + null !== newProps.alternate && + null !== newProps.alternate.memoizedState && + null !== newProps.alternate.memoizedState.cachePool && + (_type = newProps.alternate.memoizedState.cachePool.pool), (returnFiber = null), - null !== renderLanes.memoizedState && - null !== renderLanes.memoizedState.cachePool && - (returnFiber = renderLanes.memoizedState.cachePool.pool), - returnFiber !== _type && (renderLanes.flags |= 2048)); - newProps !== current && - newProps && + null !== newProps.memoizedState && + null !== newProps.memoizedState.cachePool && + (returnFiber = newProps.memoizedState.cachePool.pool), + returnFiber !== _type && (newProps.flags |= 2048)); + renderLanes !== current && + renderLanes && (workInProgress.child.flags |= 8192); scheduleRetryEffect(workInProgress, workInProgress.updateQueue); bubbleProperties(workInProgress); (workInProgress.mode & ProfileMode) !== NoMode && - newProps && + renderLanes && ((current = workInProgress.child), null !== current && (workInProgress.treeBaseDuration -= current.treeBaseDuration)); @@ -14398,9 +14182,13 @@ scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; current = renderLanes; - for (newProps = workInProgress.child; null !== newProps; ) - resetWorkInProgress(newProps, current), - (newProps = newProps.sibling); + for ( + renderLanes = workInProgress.child; + null !== renderLanes; + + ) + resetWorkInProgress(renderLanes, current), + (renderLanes = renderLanes.sibling); push( suspenseStackCursor, (suspenseStackCursor.current & @@ -14488,27 +14276,27 @@ workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) : bubbleProperties(workInProgress), - (newProps = workInProgress.updateQueue), - null !== newProps && - scheduleRetryEffect(workInProgress, newProps.retryQueue), - (newProps = null), + (renderLanes = workInProgress.updateQueue), + null !== renderLanes && + scheduleRetryEffect(workInProgress, renderLanes.retryQueue), + (renderLanes = null), null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && - (newProps = current.memoizedState.cachePool.pool), - (renderLanes = null), + (renderLanes = current.memoizedState.cachePool.pool), + (newProps = null), null !== workInProgress.memoizedState && null !== workInProgress.memoizedState.cachePool && - (renderLanes = workInProgress.memoizedState.cachePool.pool), - renderLanes !== newProps && (workInProgress.flags |= 2048), + (newProps = workInProgress.memoizedState.cachePool.pool), + newProps !== renderLanes && (workInProgress.flags |= 2048), null !== current && pop(resumedCache, workInProgress), null ); case 24: return ( - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && (workInProgress.flags |= 2048), popProvider(CacheContext, workInProgress), bubbleProperties(workInProgress), @@ -14830,23 +14618,20 @@ a: { startTime = root; yieldDuration = renderWasConcurrent; - var errorRetryLanes$jscomp$0 = errorRetryLanes; renderWasConcurrent = workInProgressRootConcurrentErrors; - (errorRetryLanes = - startTime.current.memoizedState.isDehydrated) && - (prepareFreshStack( - startTime, - errorRetryLanes$jscomp$0 - ).flags |= 256); - errorRetryLanes$jscomp$0 = renderRootSync( + var wasRootDehydrated = + startTime.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(startTime, errorRetryLanes).flags |= 256); + errorRetryLanes = renderRootSync( startTime, - errorRetryLanes$jscomp$0, + errorRetryLanes, !1 ); - if (errorRetryLanes$jscomp$0 !== RootErrored) { + if (errorRetryLanes !== RootErrored) { if ( workInProgressRootDidAttachPingListener && - !errorRetryLanes + !wasRootDehydrated ) { startTime.errorRecoveryDisabledLanes |= yieldDuration; workInProgressRootInterleavedUpdatedLanes |= yieldDuration; @@ -14855,9 +14640,15 @@ } startTime = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = renderWasConcurrent; - null !== startTime && queueRecoverableErrors(startTime); + null !== startTime && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = startTime) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + startTime + )); } - yieldDuration = errorRetryLanes$jscomp$0; + yieldDuration = errorRetryLanes; } renderWasConcurrent = !1; if (yieldDuration !== RootErrored) continue; @@ -14882,7 +14673,7 @@ if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase(renderStartTime, startTime); + logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); yieldEndTime = lanes; 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) @@ -14982,14 +14773,6 @@ } while (1); ensureRootIsScheduled(root); } - function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); - } function commitRootWhenReady( root, finishedWork, @@ -15148,14 +14931,26 @@ workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootSuspendedWithDelay ) - logSuspendedRenderPhase(previousRenderStartTime, renderStartTime); + logSuspendedRenderPhase( + previousRenderStartTime, + renderStartTime, + lanes + ); else { var endTime = renderStartTime; supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), - performance.measure("Interrupted Render", reusableLaneOptions)); + performance.measure( + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326677) === lanes + ? "Interrupted Hydration" + : "Interrupted Render", + reusableLaneOptions + )); } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } @@ -15176,7 +14971,8 @@ ? endTime : 0 <= previousRenderStartTime ? previousRenderStartTime - : renderStartTime + : renderStartTime, + lanes )); var eventType = blockingEventType, eventIsRepeat = blockingEventIsRepeat, @@ -15198,7 +14994,10 @@ reusableLaneOptions )), 0 < previousRenderStartTime && - ((reusableLaneDevToolDetails.color = "primary-light"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes + ? "tertiary-light" + : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = renderStartTime$jscomp$0), performance.measure("Blocked", reusableLaneOptions))); @@ -15227,7 +15026,8 @@ ? eventType : 0 <= endTime ? endTime - : renderStartTime + : renderStartTime, + lanes )); eventIsRepeat = transitionEventType; renderStartTime$jscomp$0 = transitionEventIsRepeat; @@ -15312,7 +15112,7 @@ return previousRenderStartTime; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -15812,7 +15612,7 @@ workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15827,173 +15627,544 @@ var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, + ReactDOMSharedInternals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + setCurrentTrackFromLanes(lanes); + if (exitStatus === RootErrored) + logErroredRenderPhase( completedRenderStartTime, completedRenderEndTime ); - } finally { - (ReactSharedInternals.T = prevTransition), - (ReactDOMSharedInternals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate); - exitStatus === RootErrored - ? logErroredRenderPhase( - completedRenderStartTime, - completedRenderEndTime - ) - : logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === finishedWork) return null; - 0 === didIncludeRenderPhaseUpdate && - console.error( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - exitStatus = finishedWork.lanes | finishedWork.childLanes; - exitStatus |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - exitStatus, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = exitStatus), - (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })); - commitStartTime = now(); - suspendedCommitReason === SUSPENDED_COMMIT - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : suspendedCommitReason === THROTTLED_COMMIT && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects( - root, - finishedWork, - didIncludeRenderPhaseUpdate - ), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - commitEndTime = now(); - logCommitPhase( - suspendedCommitReason === IMMEDIATE_COMMIT - ? completedRenderEndTime - : commitStartTime, - commitEndTime - ); - (suspendedCommitReason = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, exitStatus), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - exitStatus = root.pendingLanes; - 0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null); - suspendedCommitReason || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, - completedRenderEndTime = 0; - completedRenderEndTime < recoverableErrors.length; - completedRenderEndTime++ - ) - (finishedWork = recoverableErrors[completedRenderEndTime]), - (exitStatus = makeErrorInfo(finishedWork.stack)), - runWithFiberInDEV( - finishedWork.source, - renderPriorityLevel, - finishedWork.value, - exitStatus + else if (null !== recoverableErrors) { + var hydrationFailed = + null !== finishedWork && + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 !== (finishedWork.flags & 256); + if (supportsUserTiming) { + for ( + var properties = [], i = 0; + i < recoverableErrors.length; + i++ + ) { + var error = recoverableErrors[i].value; + properties.push([ + "Recoverable Error", + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error) + ]); + } + performance.measure("Recovered", { + start: completedRenderStartTime, + end: completedRenderEndTime, + detail: { + devtools: { + color: "primary-dark", + track: reusableLaneDevToolDetails.track, + trackGroup: LANES_TRACK_GROUP, + tooltipText: hydrationFailed + ? "Hydration Failed" + : "Recovered after Error", + properties: properties + } + } + }); + } + } else + supportsUserTiming && + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (reusableLaneOptions.start = completedRenderStartTime), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure( + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326677) === lanes + ? "Hydrated" + : "Render", + reusableLaneOptions + )); + if (null !== finishedWork) { + 0 === lanes && + console.error( + "root.finishedLanes should not be empty during a commit. This is a bug in React." ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - exitStatus = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - suspendedCommitReason || - finalizeRender(didIncludeRenderPhaseUpdate, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes, + remainingLanes$jscomp$0 = (remainingLanes |= + concurrentlyUpdatedLanes), + previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; + root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + for ( + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates, + lanes$jscomp$0 = + previouslyPendingLanes & ~remainingLanes$jscomp$0; + 0 < lanes$jscomp$0; + + ) { + var index = 31 - clz32(lanes$jscomp$0), + lane = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index] = null; + for ( + var i$jscomp$0 = 0; + i$jscomp$0 < hiddenUpdatesForLane.length; + i$jscomp$0++ + ) { + var update = hiddenUpdatesForLane[i$jscomp$0]; + null !== update && (update.lane &= -536870913); + } + } + lanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + var rootDoesHavePassiveEffects = !1; + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootDoesHavePassiveEffects = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + if (suspendedCommitReason === SUSPENDED_COMMIT) { + var endTime = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime), + performance.measure("Suspended", reusableLaneOptions)); + } else if (suspendedCommitReason === THROTTLED_COMMIT) { + var endTime$jscomp$0 = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime$jscomp$0), + performance.measure("Throttled", reusableLaneOptions)); + } + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition$jscomp$0 = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = + (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if ( + selection$jscomp$0 && + 0 !== selection$jscomp$0.rangeCount + ) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$2) { + selection = null; + break b; + } + var length = 0, + start = -1, + end = -1, + indexWithinAnchor = 0, + indexWithinFocus = 0, + node = focusedElem, + parentNode = null; + c: for (;;) { + for (var next; ; ) { + node !== anchorNode || + (0 !== anchorOffset && 3 !== node.nodeType) || + (start = length + anchorOffset); + node !== focusNode || + (0 !== focusOffset && 3 !== node.nodeType) || + (end = length + focusOffset); + 3 === node.nodeType && + (length += node.nodeValue.length); + if (null === (next = node.firstChild)) break; + parentNode = node; + node = next; + } + for (;;) { + if (node === focusedElem) break c; + parentNode === anchorNode && + ++indexWithinAnchor === anchorOffset && + (start = length); + parentNode === focusNode && + ++indexWithinFocus === focusOffset && + (end = length); + if (null !== (next = node.nextSibling)) break; + node = parentNode; + parentNode = node.parentNode; + } + node = next; + } + selection = + -1 === start || -1 === end + ? null + : { start: start, end: end }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + var fiber = nextEffect, + child = fiber.child; + if (0 !== (fiber.subtreeFlags & 1028) && null !== child) + (child.return = fiber), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + var fiber$jscomp$0 = nextEffect, + finishedWork$jscomp$0 = fiber$jscomp$0, + current = finishedWork$jscomp$0.alternate, + flags = finishedWork$jscomp$0.flags; + switch (finishedWork$jscomp$0.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = finishedWork$jscomp$0.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for (var ii = 0; ii < eventPayloads.length; ii++) { + var _eventPayloads$ii = eventPayloads[ii]; + _eventPayloads$ii.ref.impl = + _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(finishedWork$jscomp$0, current); + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = + finishedWork$jscomp$0.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) + clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + 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." + ); + } + var sibling = fiber$jscomp$0.sibling; + if (null !== sibling) { + sibling.return = fiber$jscomp$0.return; + nextEffect = sibling; + break b; + } + nextEffect = fiber$jscomp$0.return; + } + } + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + inProgressRoot = inProgressLanes = null; + var priorSelectionInformation = selectionInformation, + curFocusedElem = getActiveElementDeep( + root$jscomp$0.containerInfo + ), + priorFocusedElem = priorSelectionInformation.focusedElem, + priorSelectionRange = priorSelectionInformation.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start$jscomp$0 = priorSelectionRange.start, + end$jscomp$0 = priorSelectionRange.end; + void 0 === end$jscomp$0 && (end$jscomp$0 = start$jscomp$0); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start$jscomp$0), + (priorFocusedElem.selectionEnd = Math.min( + end$jscomp$0, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length$jscomp$0 = priorFocusedElem.textContent.length, + start$jscomp$1 = Math.min( + priorSelectionRange.start, + length$jscomp$0 + ), + end$jscomp$1 = + void 0 === priorSelectionRange.end + ? start$jscomp$1 + : Math.min(priorSelectionRange.end, length$jscomp$0); + if ( + !selection$jscomp$1.extend && + start$jscomp$1 > end$jscomp$1 + ) { + var temp = end$jscomp$1; + end$jscomp$1 = start$jscomp$1; + start$jscomp$1 = temp; + } + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$1 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$1 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== + startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$1 > end$jscomp$1 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + for ( + var ancestors = [], ancestor = priorFocusedElem; + (ancestor = ancestor.parentNode); + + ) + 1 === ancestor.nodeType && + ancestors.push({ + element: ancestor, + left: ancestor.scrollLeft, + top: ancestor.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + var i$jscomp$1 = 0; + i$jscomp$1 < ancestors.length; + i$jscomp$1++ + ) { + var info = ancestors[i$jscomp$1]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + inProgressRoot = inProgressLanes = null; + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition$jscomp$0; + } else root$jscomp$0.current = finishedWork; + commitEndTime = now(); + var startTime = + suspendedCommitReason === IMMEDIATE_COMMIT + ? completedRenderEndTime + : commitStartTime, + endTime$jscomp$1 = commitEndTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-dark"), + (reusableLaneOptions.start = startTime), + (reusableLaneOptions.end = endTime$jscomp$1), + performance.measure("Commit", reusableLaneOptions)); + var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; + rootDoesHavePassiveEffects + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : (releaseRootPooledCache(root$jscomp$0, remainingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootDidHavePassiveEffects || + commitDoubleInvokeEffectsInDEV(root$jscomp$0); + var root = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (root.current.flags & 128); + switch (previousUpdateLanePriority) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %s", + err + )); + } + isDevToolsPresent && root$jscomp$0.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) + for ( + var onRecoverableError = root$jscomp$0.onRecoverableError, + i$jscomp$2 = 0; + i$jscomp$2 < recoverableErrors.length; + i$jscomp$2++ + ) { + var recoverableError = recoverableErrors[i$jscomp$2], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + rootDidHavePassiveEffects || finalizeRender(lanes, commitEndTime); + flushSyncWorkAcrossRoots_impl(0, !1); + } + } finally { + (ReactSharedInternals.T = prevTransition), + (ReactDOMSharedInternals.p = previousUpdateLanePriority); + } } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16036,6 +16207,9 @@ var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + priority.callbackNode = null; + priority.callbackPriority = 0; + priority.cancelPendingCommit = null; if ( (executionContext & (RenderContext | CommitContext)) !== NoContext @@ -16093,6 +16267,7 @@ : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + ensureRootIsScheduled(priority); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -16314,7 +16489,7 @@ shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -16359,12 +16534,6 @@ addFiberToLanesMap(root, schedulingFiber, lanes); }); } - function scheduleCallback$1(priorityLevel, callback) { - var actQueue = ReactSharedInternals.actQueue; - return null !== actQueue - ? (actQueue.push(callback), fakeActCallbackNode$1) - : scheduleCallback$3(priorityLevel, callback); - } function warnIfUpdatesNotWrappedWithActDEV(fiber) { isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && @@ -16480,12 +16649,13 @@ } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -16535,7 +16705,7 @@ null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + : (suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes)); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -16583,7 +16753,7 @@ }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -18746,7 +18916,7 @@ console.error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." ); - else if (canDiffStyleForHydrationWarning) { + else { var clientValue; var delimiter = (clientValue = ""), styleName; @@ -19165,42 +19335,36 @@ } case "src": case "href": - if ( - !( - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ) - ) { - "src" === value - ? console.error( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : console.error( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ); - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - ); - continue; - } - hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ); + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ? hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ) + : ("src" === value + ? console.error( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : console.error( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ), + hydrateSanitizedAttribute( + domElement, + value, + value, + null, + extraAttributes, + serverDifferences + )); continue; case "action": case "formAction": @@ -21318,8 +21482,12 @@ queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(nearestMounted), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(nearestMounted); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane( + nearestMounted, + lane + ); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -21535,7 +21703,6 @@ REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); - Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -21581,7 +21748,7 @@ rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -21619,11 +21786,6 @@ allNativeEvents = new Set(), registrationNameDependencies = {}, possibleRegistrationNames = {}, - canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), hasReadOnlyValue = { button: !0, checkbox: !0, @@ -21670,8 +21832,6 @@ containerTagInScope: null }, didWarn = {}, - MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", - SVG_NAMESPACE = "http://www.w3.org/2000/svg", shorthandToLonghand = { animation: "animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split( @@ -21822,6 +21982,8 @@ " " ) ), + MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", + SVG_NAMESPACE = "http://www.w3.org/2000/svg", aliases = new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], @@ -22470,6 +22632,11 @@ restoreTarget = null, restoreQueue = null, isInsideEventHandler = !1, + canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), passiveBrowserEventsSupported = !1; if (canUseDOM) try { @@ -22797,19 +22964,21 @@ supportsUserTiming = "undefined" !== typeof performance && "function" === typeof performance.measure, + COMPONENTS_TRACK = "Components \u269b", reusableComponentDevToolDetails = { color: "primary", - track: "Components \u269b" + track: COMPONENTS_TRACK }, reusableComponentOptions = { start: -0, end: -0, detail: { devtools: reusableComponentDevToolDetails } }, + LANES_TRACK_GROUP = "Scheduler \u269b", reusableLaneDevToolDetails = { color: "primary", track: "Blocking", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP }, reusableLaneOptions = { start: -0, @@ -22817,42 +22986,42 @@ detail: { devtools: reusableLaneDevToolDetails } }, blockingLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Blocking", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, transitionLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Transition", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, suspenseLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Suspense", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, idleLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Idle", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, @@ -22898,6 +23067,59 @@ yieldStartTime = -1.1, currentUpdateIsNested = !1, nestedUpdateScheduled = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, + NoFlags = 0, + HasEffect = 1, + Insertion = 2, + Layout = 4, + Passive = 8, + AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23092,7 +23314,79 @@ pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; - var CapturedStacks = new WeakMap(), + var fakeInternalInstance = {}; + var didWarnAboutStateAssignmentForComponent = new Set(); + var didWarnAboutUninitializedState = new Set(); + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + var didWarnAboutDirectlyAssigningPropsToState = new Set(); + var didWarnAboutUndefinedDerivedState = new Set(); + var didWarnAboutContextTypes$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); + var didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + Object.freeze(fakeInternalInstance); + var classComponentUpdater = { + isMounted: function (component) { + var owner = current; + if (null !== owner && isRendering && 1 === owner.tag) { + var instance = owner.stateNode; + instance._warnedAboutRefsInRender || + console.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.", + getComponentNameFromFiber(owner) || "A component" + ); + instance._warnedAboutRefsInRender = !0; + } + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ReplaceState; + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ForceUpdate; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } + }, + CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, @@ -23107,68 +23401,29 @@ isHydrating = !1, didSuspendOrErrorDEV = !1, hydrationDiffRootDEV = null, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error( - "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { - then: function () { - console.error( - 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' - ); - } - }, - suspendedThenable = null, - needsToResetSuspendedThenableDEV = !1, - NoFlags = 0, - HasEffect = 1, - Insertion = 2, - Layout = 4, - Passive = 8, - AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0, - _currentRenderer: null, - _currentRenderer2: null + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { + then: function () { + console.error( + 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' + ); + } }, - currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null, + suspendedThenable = null, + needsToResetSuspendedThenableDEV = !1, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), prevOnStartTransitionFinish = ReactSharedInternals.S; @@ -23202,7 +23457,7 @@ var didWarnAboutAsyncClientComponent = new Set(); var didWarnAboutUseFormState = new Set(); var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -23216,36 +23471,33 @@ currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -23364,39 +23616,35 @@ mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -23502,46 +23750,35 @@ updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -23647,39 +23884,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -23785,39 +24018,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -23942,15 +24171,34 @@ mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -23958,34 +24206,6 @@ return mountEvent(callback); } }; - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24110,15 +24330,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24126,31 +24365,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24275,15 +24489,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24291,33 +24524,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -24503,78 +24709,6 @@ SubtreeSuspenseContextMask = 1, ForceSuspenseFallback = 2, suspenseStackCursor = createCursor(0), - fakeInternalInstance = {}; - var didWarnAboutStateAssignmentForComponent = new Set(); - var didWarnAboutUninitializedState = new Set(); - var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - var didWarnAboutDirectlyAssigningPropsToState = new Set(); - var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes$1 = new Set(); - var didWarnAboutChildContextTypes = new Set(); - var didWarnAboutInvalidateContextType = new Set(); - var didWarnOnInvalidCallback = new Set(); - Object.freeze(fakeInternalInstance); - var classComponentUpdater = { - isMounted: function (component) { - var owner = current; - if (null !== owner && isRendering && 1 === owner.tag) { - var instance = owner.stateNode; - instance._warnedAboutRefsInRender || - console.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.", - getComponentNameFromFiber(owner) || "A component" - ); - instance._warnedAboutRefsInRender = !0; - } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ReplaceState; - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ForceUpdate; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - } - }, reportGlobalError = "function" === typeof reportError ? reportError @@ -24620,23 +24754,10 @@ var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, - retryLane: 0 + retryLane: 0, + hydrationErrors: null }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24646,10 +24767,10 @@ nextEffect = null, inProgressLanes = null, inProgressRoot = null, - shouldFireAfterActiveInstanceBlur = !1, hostParent = null, hostParentIsContainer = !1, currentHoistableRoot = null, + inHydratedSubtree = !1, suspenseyCommitFlag = 8192; var hasBadMapPolyfill = !1; try { @@ -24727,7 +24848,6 @@ RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -24748,8 +24868,7 @@ didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); - var fakeActCallbackNode$1 = {}, - firstScheduledRoot = null, + var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, didScheduleMicrotask_act = !1, @@ -24827,7 +24946,6 @@ didWarnFormActionMethod = !1, didWarnPopoverTargetObject = !1; var didWarnForNewBooleanPropsWithEmptyValue = {}; - var canDiffStyleForHydrationWarning = !0; var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g, xlinkNamespace = "http://www.w3.org/1999/xlink", @@ -25222,52 +25340,43 @@ ), lastScheduledReplayQueue = null; ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = - function (children, JSCompiler_OptimizeArgumentsArray_p2) { + function (children) { var root = this._internalRoot; if (null === root) throw Error("Cannot update an unmounted root."); - "function" === typeof JSCompiler_OptimizeArgumentsArray_p2 + var args = arguments; + "function" === typeof args[1] ? console.error( "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) - : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2) + : isValidContainer(args[1]) ? console.error( "You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root." ) - : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 && + : "undefined" !== typeof args[1] && console.error( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + args = children; + var current = root.current, + lane = requestUpdateLane(current); + updateContainerImpl(current, lane, args, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = - function (JSCompiler_OptimizeArgumentsArray_p3) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 && + function () { + var args = arguments; + "function" === typeof args[0] && console.error( "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot; - if (null !== JSCompiler_OptimizeArgumentsArray_p3) { + args = this._internalRoot; + if (null !== args) { this._internalRoot = null; - var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo; + var container = args.containerInfo; (executionContext & (RenderContext | CommitContext)) !== NoContext && console.error( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync( - null, - JSCompiler_OptimizeArgumentsArray_p3, - null, - null - ); + updateContainerSync(null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -25291,11 +25400,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-372ec00c-20241209" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-9463d51e-20241219" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-372ec00c-20241209\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-9463d51e-20241219\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25332,11 +25441,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-372ec00c-20241209", + version: "19.1.0-experimental-9463d51e-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-372ec00c-20241209" + reconcilerVersion: "19.1.0-experimental-9463d51e-20241219" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25468,17 +25576,19 @@ initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(options); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-experimental-372ec00c-20241209"; + exports.version = "19.1.0-experimental-9463d51e-20241219"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js index 8eb3bede6865d..ba5eeace4abc1 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js @@ -51,7 +51,6 @@ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); -Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -286,13 +285,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -500,7 +497,7 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue = sharedNotPendingObject)); } var hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -515,17 +512,6 @@ var hasOwnProperty = Object.prototype.hasOwnProperty, unstable_setDisableYieldValue = Scheduler.unstable_setDisableYieldValue, rendererID = null, injectedHook = null; -function onCommitRoot(root) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - injectedHook.onCommitFiberRoot( - rendererID, - root, - void 0, - 128 === (root.current.flags & 128) - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -706,54 +692,6 @@ function markRootUpdated$1(root, updateLane) { 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ - ) { - var update = hiddenUpdatesForLane[index$7]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); -} function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -774,6 +712,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -890,12 +868,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -1504,7 +1477,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -1991,19 +1969,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$285; + var JSCompiler_inline_result$jscomp$283; if (canUseDOM) { - var isSupported$jscomp$inline_420 = "oninput" in document; - if (!isSupported$jscomp$inline_420) { - var element$jscomp$inline_421 = document.createElement("div"); - element$jscomp$inline_421.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_420 = - "function" === typeof element$jscomp$inline_421.oninput; + var isSupported$jscomp$inline_412 = "oninput" in document; + if (!isSupported$jscomp$inline_412) { + var element$jscomp$inline_413 = document.createElement("div"); + element$jscomp$inline_413.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_412 = + "function" === typeof element$jscomp$inline_413.oninput; } - JSCompiler_inline_result$jscomp$285 = isSupported$jscomp$inline_420; - } else JSCompiler_inline_result$jscomp$285 = !1; + JSCompiler_inline_result$jscomp$283 = isSupported$jscomp$inline_412; + } else JSCompiler_inline_result$jscomp$283 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$285 && + JSCompiler_inline_result$jscomp$283 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2155,97 +2133,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -2424,357 +2311,172 @@ function getRootForUpdatedFiber(sourceFiber) { return 3 === sourceFiber.tag ? sourceFiber.stateNode : null; } var emptyContextObject = {}, - CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; -} -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; -} -function pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); + valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = null; +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue); + context._currentValue = nextValue; } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function popProvider(context) { + context._currentValue = valueCursor.current; + pop(valueCursor); } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; + } } -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; + } } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); - } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$1), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); -} -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } -} -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); } - nextHydratableInstance = null; + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; + parent = parent.return; + } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; + } + return !1; } -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function noop$3() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } var currentEntangledListeners = null, currentEntangledPendingCount = 0, @@ -2836,1327 +2538,1152 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; -} -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then && - entangleAsyncAction(transition, returnValue); - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function renderWithHooks( - current, - workInProgress, - Component, +function processUpdateQueue( + workInProgress$jscomp$0, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; -} -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; -} -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; -} -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; -} -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; -} -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; -} -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; -}; -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; -} -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); - } - throw Error(formatProdErrorMessage(438, String(usable))); -} -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); - } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; -} -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$26 = !1; + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; do { - var updateLane = update.lane & -536870913; + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; if ( - updateLane !== update.lane + isHiddenUpdate ? (workInProgressRootRenderLanes & updateLane) === updateLane : (renderLanes & updateLane) === updateLane ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$26 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); } else - (revertLane = { + (isHiddenUpdate = { lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, next: null }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$26 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; } -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - return getServerSnapshot; +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); } +}; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } - } +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; -} -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$28 in Component) + void 0 === newProps[propName$28] && + (newProps[propName$28] = Component[propName$28]); + } + return newProps; } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload -) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); + CapturedStacks.set(value, source); + return source; } + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; - } - } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$32) { - onActionError(actionQueue, node, error$32); - } +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function actionStateReducer(oldState, newState) { - return newState; +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$1), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; - } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; + } +} +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); break a; } - } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); + nextHydratableInstance = null; } - } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; - if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then - ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; -} -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; +function noop$3() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$3, noop$3), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$3, noop$3); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; + } + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; + } + } + ); + } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; + } } -function updateRef() { - return updateWorkInProgressHook().memoizedState; +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); +function checkIfUseWrappedInAsyncCatch(rejectedReason) { + if ( + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException + ) + throw Error(formatProdErrorMessage(483)); } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then && + entangleAsyncAction(transition, returnValue); + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); } - } - hook.memoizedState = [prevState, deps]; - return prevState; + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane() - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function noop$2() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$2 - : function () { - requestFormReset$1(formFiber); - return action(formData); - } - ); -} -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, + queue: null, next: null }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; -} -function requestFormReset$1(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); -} -function useHostTransitionStatus() { - return readContext(HostTransitionContext); -} -function updateId() { - return updateWorkInProgressHook().memoizedState; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; -} -function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(); - fiber = createUpdate(lane); - var root$35 = enqueueUpdate(provider, fiber, lane); - null !== root$35 && - (scheduleUpdateOnFiber(root$35, provider, lane), - entangleTransitions(root$35, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root$35 && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); } - provider = provider.return; + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } + return workInProgressHook; } -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(); - dispatchSetStateInternal(fiber, queue, action, lane); +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); + throw Error(formatProdErrorMessage(438, String(usable))); } -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; } -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); - } +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError -}; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; -ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; + } + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$33 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$33 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$33 && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; +} +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + return [newState, dispatch]; +} +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { fiber.flags |= 2048; pushSimpleEffect( 9, @@ -4164,1094 +3691,1878 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - inst, + hook, getServerSnapshot, getSnapshot ), null ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } -}; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { + return getServerSnapshot; +} +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); +} +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue + return hook; +} +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; -HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; -HooksDispatcherOnRerender.useEffectEvent = updateEvent; -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); } -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); + } } -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber - ) - ); +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; + } + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$39) { + onActionError(actionQueue, node, error$39); + } } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ) + : onActionSuccess(actionQueue, node, returnValue); } -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; + } + } + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; + } + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); + } } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; - } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; +} +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); +} +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; + } + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; +} +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; +} +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; +} +function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; +} +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; +} +function updateRef() { + return updateWorkInProgressHook().memoizedState; +} +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); +} +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); +} +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); +} +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); +} +function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; +} +function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; +} +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); +} +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); +} +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } ); - coerceRef(current, element); - current.return = returnFiber; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; - } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current +} +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +} +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; +} +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [prevState, deps]; + return prevState; +} +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; +} +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; +} +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane() + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); } - function createChild(returnFiber, newChild, lanes) { +} +function noop$2() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$2 + : function () { + requestFormReset$1(formFiber); + return action(formData); + } + ); +} +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; +} +function requestFormReset$1(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(); + fiber = createUpdate(lane); + var root$42 = enqueueUpdate(provider, fiber, lane); + null !== root$42 && + (scheduleUpdateOnFiber(root$42, provider, lane), + entangleTransitions(root$42, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root$42 && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; + } +} +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); +} +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(); + dispatchSetStateInternal(fiber, queue, action, lane); +} +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), + !1 ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); + } catch (error) { + } finally { } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + return !1; +} +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2); +} +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); +} +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; +} +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) +} +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh + }; +HooksDispatcherOnUpdate.useEffectEvent = updateEvent; +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +HooksDispatcherOnRerender.useEffectEvent = updateEvent; +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); +} +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; +} +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + ); +} +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); +} +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes - ); + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); if ("object" === typeof newChild && null !== newChild) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); - } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( newChild, + returnFiber.mode, lanes - ) + )), + (newChild.return = returnFiber), + newChild ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( returnFiber, - currentFirstChild, - newChild, + readContextDuringReconciliation(returnFiber, newChild), lanes ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( returnFiber, - currentFirstChild, - newChild, + oldFiber, + unwrapThenable(newChild), lanes ); - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return reconcileChildrenAsyncIteratable( + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( returnFiber, - currentFirstChild, - newChild, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), lanes ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( + return updateFromMap( + existingChildren, returnFiber, - currentFirstChild, + newIdx, unwrapThenable(newChild), lanes ); if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( + return updateFromMap( + existingChildren, returnFiber, - currentFirstChild, + newIdx, readContextDuringReconciliation(returnFiber, newChild), lanes ); throwOnInvalidObjectType(returnFiber, newChild); } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); + return null; } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( returnFiber, - currentFirstChild, - newChild, + oldFiber, + newChildren[newIdx], lanes ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiberImplClass(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - }; -} -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); -} -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - } else reuseSuspenseHandlerOnStack(fiber); -} -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); -} -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); -} -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; + if (step.done) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - node.sibling.return = node.return; - node = node.sibling; + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - return null; -} -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) { + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); + } + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) + ); + } + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; -} -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiberImplClass(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; } -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; } - return newProps; + return null; } var reportGlobalError = "function" === typeof reportError @@ -5295,9 +5606,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$69) { + } catch (e$75) { setTimeout(function () { - throw e$69; + throw e$75; }); } } @@ -5308,9 +5619,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$70) { + } catch (e$76) { setTimeout(function () { - throw e$70; + throw e$76; }); } } @@ -6089,7 +6400,12 @@ function mountHostRootWithoutHydrating( reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; } @@ -6152,7 +6468,8 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { null !== treeContextProvider ? { id: treeContextId, overflow: treeContextOverflow } : null, - retryLane: 536870912 + retryLane: 536870912, + hydrationErrors: null }), (JSCompiler_temp$jscomp$0 = createFiberImplClass( 18, @@ -6177,7 +6494,7 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { ) return ( isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) + ? (workInProgress.lanes = 32) : (workInProgress.lanes = 536870912), null ); @@ -6306,59 +6623,25 @@ function updateSuspenseComponent(current, workInProgress, renderLanes) { didReceiveUpdate || JSCompiler_temp) ) { JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; - } - nextProps = + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) - ); - } + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) + ) + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -7164,477 +7447,66 @@ function beginWork(current, workInProgress, renderLanes) { workInProgress, workInProgress.type, workInProgress.pendingProps, - renderLanes - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (lazyComponent = readContext(CacheContext)), - null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), - (nextProps = createCache()), - (init.pooledCache = nextProps), - nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { - parent: lazyComponent, - cache: init - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), - (nextProps = workInProgress.memoizedState), - init.parent !== lazyComponent - ? ((init = { parent: lazyComponent, cache: lazyComponent }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, lazyComponent)) - : ((lazyComponent = nextProps.cache), - pushProvider(workInProgress, CacheContext, lazyComponent), - lazyComponent !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child - ); - case 29: - throw workInProgress.pendingProps; - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue); - context._currentValue = nextValue; -} -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); -} -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } -} -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } -} -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); -} -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); -} -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); -} -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; -} -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; -} -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); -} -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; -} -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; - } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); -} -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); - } -} -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; - } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; -} -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } -} -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, - renderLanes -) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); - } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; - break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); - break a; - case 2: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + renderLanes + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (lazyComponent = readContext(CacheContext)), + null === current + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), + (workInProgress.memoizedState = { + parent: lazyComponent, + cache: init + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, init)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (init = current.memoizedState), + (nextProps = workInProgress.memoizedState), + init.parent !== lazyComponent + ? ((init = { parent: lazyComponent, cache: lazyComponent }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, lazyComponent)) + : ((lazyComponent = nextProps.cache), + pushProvider(workInProgress, CacheContext, lazyComponent), + lazyComponent !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function commitHookEffectListMount(flags, finishedWork) { try { @@ -7869,178 +7741,7 @@ var offscreenSubtreeIsHidden = !1, offscreenSubtreeWasHidden = !1, needsFormReset = !1, PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$20) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - focusNode = firstChild.alternate; - root = firstChild.flags; - switch (firstChild.tag) { - case 0: - if ( - 0 !== (root & 4) && - ((root = firstChild.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (root & 1024) && null !== focusNode) { - root = void 0; - JSCompiler_temp = firstChild; - anchorOffset = focusNode.memoizedProps; - focusNode = focusNode.memoizedState; - selection = JSCompiler_temp.stateNode; - try { - var resolvedPrevProps = resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ); - root = selection.getSnapshotBeforeUpdate( - resolvedPrevProps, - focusNode - ); - selection.__reactInternalSnapshotBeforeUpdate = root; - } catch (error) { - captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, - error - ); - } - } - break; - case 3: - if (0 !== (root & 1024)) - if ( - ((root = firstChild.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return resolvedPrevProps; -} + nextEffect = null; function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var flags = finishedWork.flags; switch (finishedWork.tag) { @@ -9175,6 +8876,14 @@ function commitPassiveMountOnFiber( committedTransitions ); break; + case 13: + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions + ); + break; case 23: break; case 22: @@ -9888,9 +9597,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -10104,8 +9811,10 @@ function completeWork(current, workInProgress, renderLanes) { bubbleProperties(workInProgress); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -10126,11 +9835,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$147 = null; + var cache$148 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$147 = newProps.memoizedState.cachePool.pool); - cache$147 !== type && (newProps.flags |= 2048); + (cache$148 = newProps.memoizedState.cachePool.pool); + cache$148 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10155,8 +9864,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$147 = type.rendering; - if (null === cache$147) + cache$148 = type.rendering; + if (null === cache$148) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10164,11 +9873,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$147 = findFirstSuspended(current); - if (null !== cache$147) { + cache$148 = findFirstSuspended(current); + if (null !== cache$148) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$147.updateQueue; + current = cache$148.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10193,7 +9902,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$147)), null !== current)) { + if (((current = findFirstSuspended(cache$148)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10203,7 +9912,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$147.alternate && + !cache$148.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10216,13 +9925,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$147.sibling = workInProgress.child), - (workInProgress.child = cache$147)) + ? ((cache$148.sibling = workInProgress.child), + (workInProgress.child = cache$148)) : ((current = type.last), null !== current - ? (current.sibling = cache$147) - : (workInProgress.child = cache$147), - (type.last = cache$147)); + ? (current.sibling = cache$148) + : (workInProgress.child = cache$148), + (type.last = cache$148)); } if (null !== type.tail) return ( @@ -10412,7 +10121,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -10532,7 +10240,12 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { renderWasConcurrent = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = exitStatus; null !== renderWasConcurrent && - queueRecoverableErrors(renderWasConcurrent); + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = renderWasConcurrent) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + renderWasConcurrent + )); } exitStatus = JSCompiler_inline_result; } @@ -10629,14 +10342,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { } while (1); ensureRootIsScheduled(root$jscomp$0); } -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); -} function commitRootWhenReady( root, finishedWork, @@ -10760,7 +10465,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -10817,7 +10522,7 @@ function prepareFreshStack(root, lanes) { return timeoutHandle; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -10919,12 +10624,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); exitStatus = workInProgressRootExitStatus; break; - } catch (thrownValue$166) { - handleThrow(root, thrownValue$166); + } catch (thrownValue$167) { + handleThrow(root, thrownValue$167); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -11035,11 +10740,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$168) { - handleThrow(root, thrownValue$168); + } catch (thrownValue$169) { + handleThrow(root, thrownValue$169); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -11100,7 +10805,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -11207,136 +10912,413 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime + suspendedRetryLanes ) { - var prevTransition = ReactSharedInternals.T, - previousUpdateLanePriority = ReactDOMSharedInternals.p; + didIncludeRenderPhaseUpdate = ReactSharedInternals.T; + var previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); + ReactDOMSharedInternals.p = 2; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + if (null !== finishedWork) { + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes, + remainingLanes$jscomp$0 = (remainingLanes |= concurrentlyUpdatedLanes), + previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; + root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates; + for ( + remainingLanes$jscomp$0 = + previouslyPendingLanes & ~remainingLanes$jscomp$0; + 0 < remainingLanes$jscomp$0; + + ) { + var index$7 = 31 - clz32(remainingLanes$jscomp$0), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index$7] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + remainingLanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + spawnedLane = !1; + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((spawnedLane = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + transitions = executionContext; + executionContext |= 4; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if (selection$jscomp$0 && 0 !== selection$jscomp$0.rangeCount) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$20) { + selection = null; + break b; + } + containerInfo = 0; + win = ownerDocument = -1; + rootHasEffect = selection$jscomp$0 = 0; + updatedLanes = focusedElem; + suspendedRetryLanes = null; + c: for (;;) { + for (var next; ; ) { + updatedLanes !== anchorNode || + (0 !== anchorOffset && 3 !== updatedLanes.nodeType) || + (ownerDocument = containerInfo + anchorOffset); + updatedLanes !== focusNode || + (0 !== focusOffset && 3 !== updatedLanes.nodeType) || + (win = containerInfo + focusOffset); + 3 === updatedLanes.nodeType && + (containerInfo += updatedLanes.nodeValue.length); + if (null === (next = updatedLanes.firstChild)) break; + suspendedRetryLanes = updatedLanes; + updatedLanes = next; + } + for (;;) { + if (updatedLanes === focusedElem) break c; + suspendedRetryLanes === anchorNode && + ++selection$jscomp$0 === anchorOffset && + (ownerDocument = containerInfo); + suspendedRetryLanes === focusNode && + ++rootHasEffect === focusOffset && + (win = containerInfo); + if (null !== (next = updatedLanes.nextSibling)) break; + updatedLanes = suspendedRetryLanes; + suspendedRetryLanes = updatedLanes.parentNode; + } + updatedLanes = next; + } + selection = + -1 === ownerDocument || -1 === win + ? null + : { start: ownerDocument, end: win }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + focusedElem = nextEffect; + var child = focusedElem.child; + if (0 !== (focusedElem.subtreeFlags & 1028) && null !== child) + (child.return = focusedElem), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + focusedElem = nextEffect; + JSCompiler_temp = void 0; + selection = focusedElem; + var current = selection.alternate, + flags = selection.flags; + switch (selection.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = selection.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for ( + JSCompiler_temp = 0; + JSCompiler_temp < eventPayloads.length; + JSCompiler_temp++ + ) { + var _eventPayloads$ii = eventPayloads[JSCompiler_temp]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = selection.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + selection.type, + prevProps, + selection.elementType === selection.type + ); + JSCompiler_temp = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = + JSCompiler_temp; + } catch (error) { + captureCommitPhaseError( + selection, + selection.return, + error + ); + } + } + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = selection.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error(formatProdErrorMessage(163)); + } + var sibling = focusedElem.sibling; + if (null !== sibling) { + sibling.return = focusedElem.return; + nextEffect = sibling; + break b; + } + nextEffect = focusedElem.return; + } + } + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + child = selectionInformation; + var curFocusedElem = getActiveElementDeep(root$jscomp$0.containerInfo), + priorFocusedElem = child.focusedElem, + priorSelectionRange = child.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start = priorSelectionRange.start, + end = priorSelectionRange.end; + void 0 === end && (end = start); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start), + (priorFocusedElem.selectionEnd = Math.min( + end, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length = priorFocusedElem.textContent.length, + start$jscomp$0 = Math.min(priorSelectionRange.start, length), + end$jscomp$0 = + void 0 === priorSelectionRange.end + ? start$jscomp$0 + : Math.min(priorSelectionRange.end, length); + !selection$jscomp$1.extend && + start$jscomp$0 > end$jscomp$0 && + ((curFocusedElem = end$jscomp$0), + (end$jscomp$0 = start$jscomp$0), + (start$jscomp$0 = curFocusedElem)); + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$0 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$0 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$0 > end$jscomp$0 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + doc = []; + for ( + selection$jscomp$1 = priorFocusedElem; + (selection$jscomp$1 = selection$jscomp$1.parentNode); + + ) + 1 === selection$jscomp$1.nodeType && + doc.push({ + element: selection$jscomp$1, + left: selection$jscomp$1.scrollLeft, + top: selection$jscomp$1.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + priorFocusedElem = 0; + priorFocusedElem < doc.length; + priorFocusedElem++ + ) { + var info = doc[priorFocusedElem]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + requestPaint(); + executionContext = transitions; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition; + } else root$jscomp$0.current = finishedWork; + spawnedLane + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root$jscomp$0, remainingLanes); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + var root = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + injectedHook.onCommitFiberRoot( + rendererID, + root, + void 0, + 128 === (root.current.flags & 128) + ); + } catch (err) {} + if (null !== recoverableErrors) { + var onRecoverableError = root$jscomp$0.onRecoverableError; + for ( + finishedWork = 0; + finishedWork < recoverableErrors.length; + finishedWork++ + ) { + var recoverableError = recoverableErrors[finishedWork]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root$jscomp$0)) + : (nestedUpdateCount = 0); + flushSyncWorkAcrossRoots_impl(0, !1); + } } finally { - (ReactSharedInternals.T = prevTransition), + (ReactSharedInternals.T = didIncludeRenderPhaseUpdate), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(!0); - return null; - })); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - rootDoesHavePassiveEffects - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ - ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - remainingLanes = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (remainingLanes & 42) - ? root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root)) - : (nestedUpdateCount = 0); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; -} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -11345,7 +11327,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects() { if (null !== rootWithPendingPassiveEffects) { - var root$172 = rootWithPendingPassiveEffects, + var root$173 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -11363,6 +11345,9 @@ function flushPassiveEffects() { lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + root.callbackNode = null; + root.callbackPriority = 0; + root.cancelPendingCommit = null; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); var prevExecutionContext = executionContext; @@ -11371,6 +11356,7 @@ function flushPassiveEffects() { commitPassiveMountOnFiber(root, root.current, lanes, renderPriority); executionContext = prevExecutionContext; flushSyncWorkAcrossRoots_impl(0, !1); + ensureRootIsScheduled(root); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -11384,7 +11370,7 @@ function flushPassiveEffects() { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$172, remainingLanes); + releaseRootPooledCache(root$173, remainingLanes); } } return !1; @@ -11502,9 +11488,6 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { null !== retryCache && retryCache.delete(wakeable); retryTimedOutBoundary(boundaryFiber, retryLane); } -function scheduleCallback$1(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); -} var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -11527,14 +11510,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$174 = firstScheduledRoot; null !== root$174; ) { + for (var root$175 = firstScheduledRoot; null !== root$175; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$174.pendingLanes; + var pendingLanes = root$175.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$174.suspendedLanes, - pingedLanes = root$174.pingedLanes; + var suspendedLanes = root$175.suspendedLanes, + pingedLanes = root$175.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -11548,18 +11531,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$174, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$175, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$174, - root$174 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$175, + root$175 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$174, JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$175, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$174, JSCompiler_inline_result)); - root$174 = root$174.next; + performSyncWorkOnRoot(root$175, JSCompiler_inline_result)); + root$175 = root$175.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -11609,12 +11592,13 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -11631,36 +11615,39 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { (root.callbackPriority = 0) ); if ( - 0 === (suspendedLanes & 3) || - checkIfRootIsPrerendering(root, suspendedLanes) - ) { - currentTime = suspendedLanes & -suspendedLanes; - if (currentTime === root.callbackPriority) return currentTime; - null !== pingedLanes && cancelCallback$1(pingedLanes); - switch (lanesToEventPriority(suspendedLanes)) { - case 2: - case 8: - suspendedLanes = UserBlockingPriority; - break; - case 32: - suspendedLanes = NormalPriority$1; - break; - case 268435456: - suspendedLanes = IdlePriority; - break; - default: - suspendedLanes = NormalPriority$1; - } - pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); - root.callbackPriority = currentTime; - root.callbackNode = suspendedLanes; - return currentTime; + 0 !== (suspendedLanes & 3) && + !checkIfRootIsPrerendering(root, suspendedLanes) + ) + return ( + null !== pingedLanes && + null !== pingedLanes && + cancelCallback$1(pingedLanes), + (root.callbackPriority = 2), + (root.callbackNode = null), + 2 + ); + currentTime = suspendedLanes & -suspendedLanes; + if (currentTime === root.callbackPriority) return currentTime; + null !== pingedLanes && cancelCallback$1(pingedLanes); + switch (lanesToEventPriority(suspendedLanes)) { + case 2: + case 8: + suspendedLanes = UserBlockingPriority; + break; + case 32: + suspendedLanes = NormalPriority$1; + break; + case 268435456: + suspendedLanes = IdlePriority; + break; + default: + suspendedLanes = NormalPriority$1; } - null !== pingedLanes && null !== pingedLanes && cancelCallback$1(pingedLanes); - root.callbackPriority = 2; - root.callbackNode = null; - return 2; + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); + suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes); + root.callbackPriority = currentTime; + root.callbackNode = suspendedLanes; + return currentTime; } function performWorkOnRootViaSchedulerTask(root, didTimeout) { var originalCallbackNode = root.callbackNode; @@ -11685,7 +11672,7 @@ function performSyncWorkOnRoot(root, lanes) { function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -11789,20 +11776,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1429 = 0; - i$jscomp$inline_1429 < simpleEventPluginEvents.length; - i$jscomp$inline_1429++ + var i$jscomp$inline_1448 = 0; + i$jscomp$inline_1448 < simpleEventPluginEvents.length; + i$jscomp$inline_1448++ ) { - var eventName$jscomp$inline_1430 = - simpleEventPluginEvents[i$jscomp$inline_1429], - domEventName$jscomp$inline_1431 = - eventName$jscomp$inline_1430.toLowerCase(), - capitalizedEvent$jscomp$inline_1432 = - eventName$jscomp$inline_1430[0].toUpperCase() + - eventName$jscomp$inline_1430.slice(1); + var eventName$jscomp$inline_1449 = + simpleEventPluginEvents[i$jscomp$inline_1448], + domEventName$jscomp$inline_1450 = + eventName$jscomp$inline_1449.toLowerCase(), + capitalizedEvent$jscomp$inline_1451 = + eventName$jscomp$inline_1449[0].toUpperCase() + + eventName$jscomp$inline_1449.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1431, - "on" + capitalizedEvent$jscomp$inline_1432 + domEventName$jscomp$inline_1450, + "on" + capitalizedEvent$jscomp$inline_1451 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -12985,34 +12972,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$188 = props[hasSrc]; - if (null != propValue$188) + var propValue$189 = props[hasSrc]; + if (null != propValue$189) switch (hasSrc) { case "name": - hasSrcSet = propValue$188; + hasSrcSet = propValue$189; break; case "type": - propValue = propValue$188; + propValue = propValue$189; break; case "checked": - checked = propValue$188; + checked = propValue$189; break; case "defaultChecked": - defaultChecked = propValue$188; + defaultChecked = propValue$189; break; case "value": - propKey = propValue$188; + propKey = propValue$189; break; case "defaultValue": - defaultValue = propValue$188; + defaultValue = propValue$189; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$188) + if (null != propValue$189) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$188, props, null); + setProp(domElement, tag, hasSrc, propValue$189, props, null); } } initInput( @@ -13149,14 +13136,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$188 in props) - props.hasOwnProperty(propValue$188) && - ((hasSrc = props[propValue$188]), + for (propValue$189 in props) + props.hasOwnProperty(propValue$189) && + ((hasSrc = props[propValue$189]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$188, + propValue$189, hasSrc, props, void 0 @@ -13204,14 +13191,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$205 in nextProps) { - var propKey = nextProps[propKey$205]; - lastProp = lastProps[propKey$205]; + for (var propKey$206 in nextProps) { + var propKey = nextProps[propKey$206]; + lastProp = lastProps[propKey$206]; if ( - nextProps.hasOwnProperty(propKey$205) && + nextProps.hasOwnProperty(propKey$206) && (null != propKey || null != lastProp) ) - switch (propKey$205) { + switch (propKey$206) { case "type": type = propKey; break; @@ -13240,7 +13227,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$205, + propKey$206, propKey, nextProps, lastProp @@ -13259,7 +13246,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$205 = null; + propKey = value = defaultValue = propKey$206 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -13290,7 +13277,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$205 = type; + propKey$206 = type; break; case "defaultValue": defaultValue = type; @@ -13311,15 +13298,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$205 - ? updateOptions(domElement, !!lastProps, propKey$205, !1) + null != propKey$206 + ? updateOptions(domElement, !!lastProps, propKey$206, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$205 = null; + propKey = propKey$206 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -13343,7 +13330,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$205 = name; + propKey$206 = name; break; case "defaultValue": propKey = name; @@ -13357,17 +13344,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$205, propKey); + updateTextarea(domElement, propKey$206, propKey); return; case "option": - for (var propKey$221 in lastProps) + for (var propKey$222 in lastProps) if ( - ((propKey$205 = lastProps[propKey$221]), - lastProps.hasOwnProperty(propKey$221) && - null != propKey$205 && - !nextProps.hasOwnProperty(propKey$221)) + ((propKey$206 = lastProps[propKey$222]), + lastProps.hasOwnProperty(propKey$222) && + null != propKey$206 && + !nextProps.hasOwnProperty(propKey$222)) ) - switch (propKey$221) { + switch (propKey$222) { case "selected": domElement.selected = !1; break; @@ -13375,33 +13362,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$221, + propKey$222, null, nextProps, - propKey$205 + propKey$206 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$205 = nextProps[lastDefaultValue]), + ((propKey$206 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$205 !== propKey && - (null != propKey$205 || null != propKey)) + propKey$206 !== propKey && + (null != propKey$206 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$205 && - "function" !== typeof propKey$205 && - "symbol" !== typeof propKey$205; + propKey$206 && + "function" !== typeof propKey$206 && + "symbol" !== typeof propKey$206; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$205, + propKey$206, nextProps, propKey ); @@ -13422,24 +13409,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$226 in lastProps) - (propKey$205 = lastProps[propKey$226]), - lastProps.hasOwnProperty(propKey$226) && - null != propKey$205 && - !nextProps.hasOwnProperty(propKey$226) && - setProp(domElement, tag, propKey$226, null, nextProps, propKey$205); + for (var propKey$227 in lastProps) + (propKey$206 = lastProps[propKey$227]), + lastProps.hasOwnProperty(propKey$227) && + null != propKey$206 && + !nextProps.hasOwnProperty(propKey$227) && + setProp(domElement, tag, propKey$227, null, nextProps, propKey$206); for (checked in nextProps) if ( - ((propKey$205 = nextProps[checked]), + ((propKey$206 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$205 !== propKey && - (null != propKey$205 || null != propKey)) + propKey$206 !== propKey && + (null != propKey$206 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$205) + if (null != propKey$206) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -13447,7 +13434,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$205, + propKey$206, nextProps, propKey ); @@ -13455,49 +13442,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$231 in lastProps) - (propKey$205 = lastProps[propKey$231]), - lastProps.hasOwnProperty(propKey$231) && - void 0 !== propKey$205 && - !nextProps.hasOwnProperty(propKey$231) && + for (var propKey$232 in lastProps) + (propKey$206 = lastProps[propKey$232]), + lastProps.hasOwnProperty(propKey$232) && + void 0 !== propKey$206 && + !nextProps.hasOwnProperty(propKey$232) && setPropOnCustomElement( domElement, tag, - propKey$231, + propKey$232, void 0, nextProps, - propKey$205 + propKey$206 ); for (defaultChecked in nextProps) - (propKey$205 = nextProps[defaultChecked]), + (propKey$206 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$205 === propKey || - (void 0 === propKey$205 && void 0 === propKey) || + propKey$206 === propKey || + (void 0 === propKey$206 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$205, + propKey$206, nextProps, propKey ); return; } } - for (var propKey$236 in lastProps) - (propKey$205 = lastProps[propKey$236]), - lastProps.hasOwnProperty(propKey$236) && - null != propKey$205 && - !nextProps.hasOwnProperty(propKey$236) && - setProp(domElement, tag, propKey$236, null, nextProps, propKey$205); + for (var propKey$237 in lastProps) + (propKey$206 = lastProps[propKey$237]), + lastProps.hasOwnProperty(propKey$237) && + null != propKey$206 && + !nextProps.hasOwnProperty(propKey$237) && + setProp(domElement, tag, propKey$237, null, nextProps, propKey$206); for (lastProp in nextProps) - (propKey$205 = nextProps[lastProp]), + (propKey$206 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$205 === propKey || - (null == propKey$205 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$205, nextProps, propKey); + propKey$206 === propKey || + (null == propKey$206 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$206, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -14061,26 +14048,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$244 = getResourcesFromRoot( + var styles$245 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$245 = styles$244.get(type); - resource$245 || + resource$246 = styles$245.get(type); + resource$246 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$245 = { + (resource$246 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$244.set(type, resource$245), - (styles$244 = JSCompiler_inline_result.querySelector( + styles$245.set(type, resource$246), + (styles$245 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$244._p && - ((resource$245.instance = styles$244), - (resource$245.state.loading = 5)), + !styles$245._p && + ((resource$246.instance = styles$245), + (resource$246.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -14093,16 +14080,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$244 || + styles$245 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$245.state + resource$246.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$245; + return resource$246; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -14199,37 +14186,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$250 = hoistableRoot.querySelector( + var instance$251 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$250) + if (instance$251) return ( (resource.state.loading |= 4), - (resource.instance = instance$250), - markNodeAsHoistable(instance$250), - instance$250 + (resource.instance = instance$251), + markNodeAsHoistable(instance$251), + instance$251 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$250 = ( + instance$251 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$250); - var linkInstance = instance$250; + markNodeAsHoistable(instance$251); + var linkInstance = instance$251; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$250, "link", instance); + setInitialProperties(instance$251, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$250, props.precedence, hoistableRoot); - return (resource.instance = instance$250); + insertStylesheet(instance$251, props.precedence, hoistableRoot); + return (resource.instance = instance$251); case "script": - instance$250 = getScriptKey(props.src); + instance$251 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$250) + getScriptSelectorFromKey(instance$251) )) ) return ( @@ -14238,7 +14225,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$250))) + if ((styleProps = preloadPropsMap.get(instance$251))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -15059,8 +15046,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -15262,16 +15250,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1676 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1712 = React.version; if ( - "19.0.0-experimental-372ec00c-20241209" !== - isomorphicReactPackageVersion$jscomp$inline_1676 + "19.1.0-experimental-9463d51e-20241219" !== + isomorphicReactPackageVersion$jscomp$inline_1712 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1676, - "19.0.0-experimental-372ec00c-20241209" + isomorphicReactPackageVersion$jscomp$inline_1712, + "19.1.0-experimental-9463d51e-20241219" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15291,25 +15279,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2146 = { +var internals$jscomp$inline_2210 = { bundleType: 0, - version: "19.0.0-experimental-372ec00c-20241209", + version: "19.1.0-experimental-9463d51e-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-372ec00c-20241209" + reconcilerVersion: "19.1.0-experimental-9463d51e-20241219" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2147 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2211 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2147.isDisabled && - hook$jscomp$inline_2147.supportsFiber + !hook$jscomp$inline_2211.isDisabled && + hook$jscomp$inline_2211.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2147.inject( - internals$jscomp$inline_2146 + (rendererID = hook$jscomp$inline_2211.inject( + internals$jscomp$inline_2210 )), - (injectedHook = hook$jscomp$inline_2147); + (injectedHook = hook$jscomp$inline_2211); } catch (err) {} } exports.createRoot = function (container, options) { @@ -15391,14 +15378,16 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-experimental-372ec00c-20241209"; +exports.version = "19.1.0-experimental-9463d51e-20241219"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js index 86c95f1bd6ed9..ad5bdab493828 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js @@ -510,13 +510,11 @@ return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -927,41 +925,6 @@ } return hook.checkDCE ? !0 : !1; } - function onCommitRoot$1(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case DiscreteEventPriority: - var schedulerPriority = ImmediatePriority; - break; - case ContinuousEventPriority: - schedulerPriority = UserBlockingPriority; - break; - case DefaultEventPriority: - schedulerPriority = NormalPriority$1; - break; - case IdleEventPriority: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) { - hasLoggedError || - ((hasLoggedError = !0), - console.error( - "React instrumentation encountered an error: %s", - err - )); - } - } function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); @@ -1157,54 +1120,6 @@ (root.pingedLanes = 0), (root.warmLanes = 0)); } - function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; - expirationTimes[index] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index] = null, index = 0; - index < hiddenUpdatesForLane.length; - index++ - ) { - var update = hiddenUpdatesForLane[index]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); - } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -1225,6 +1140,46 @@ rootEntangledLanes &= ~lane; } } + function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; + } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -2335,6 +2290,8 @@ "hr" === tag || "option" === tag || "optgroup" === tag || + "script" === tag || + "template" === tag || "#text" === tag ); case "optgroup": @@ -3621,100 +3578,6 @@ "true" === elem.contentEditable) ); } - function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if ( - null !== priorSelectionRange && - hasSelectionCapabilities(containerInfo) - ) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } - } function constructSelectEvent( dispatchQueue, nativeEvent, @@ -3789,6 +3652,32 @@ ? "Idle" : "Other"; } + function logComponentRender(fiber, startTime, endTime, wasHydrated) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var selfTime = fiber.actualDuration; + if (null === fiber.alternate || fiber.alternate.child !== fiber.child) + for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) + selfTime -= fiber.actualDuration; + reusableComponentDevToolDetails.color = + 0.5 > selfTime + ? wasHydrated + ? "tertiary-light" + : "primary-light" + : 10 > selfTime + ? wasHydrated + ? "tertiary" + : "primary" + : 100 > selfTime + ? wasHydrated + ? "tertiary-dark" + : "primary-dark" + : "error"; + reusableComponentOptions.start = startTime; + reusableComponentOptions.end = endTime; + performance.measure(name, reusableComponentOptions); + } + } function logComponentEffect(fiber, startTime, endTime, selfTime) { fiber = getComponentNameFromFiber(fiber); null !== fiber && @@ -3805,23 +3694,18 @@ (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } - function logRenderPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Render", reusableLaneOptions)); - } - function logSuspendedRenderPhase(startTime, endTime) { + function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); } - function logSuspendedWithDelayPhase(startTime, endTime) { + function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -3831,28 +3715,7 @@ ((reusableLaneDevToolDetails.color = "error"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), - performance.measure("Errored Render", reusableLaneOptions)); - } - function logSuspenseThrottlePhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Throttled", reusableLaneOptions)); - } - function logSuspendedCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Suspended", reusableLaneOptions)); - } - function logCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Commit", reusableLaneOptions)); + performance.measure("Errored", reusableLaneOptions)); } function finishQueueingConcurrentUpdates() { for ( @@ -4169,441 +4032,214 @@ for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } - function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - } - function pushTreeFork(workInProgress, totalChildren) { - warnIfNotHydrating(); - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; - } - function pushTreeId(workInProgress, totalChildren, index) { - warnIfNotHydrating(); - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); - } - function pushMaterializedTreeId(workInProgress) { - warnIfNotHydrating(); - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); - } - function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); + function resetContextDependencies() { + lastContextDependency = currentlyRenderingFiber$1 = null; + isDisallowedContextReadInDEV = !1; } - function warnIfNotHydrating() { - isHydrating || + function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue, providerFiber); + context._currentValue = nextValue; + push(rendererCursorDEV, context._currentRenderer, providerFiber); + void 0 !== context._currentRenderer && + null !== context._currentRenderer && + context._currentRenderer !== rendererSigil && console.error( - "Expected to be hydrating. This is a bug in React. Please file an issue." + "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." ); + context._currentRenderer = rendererSigil; } - function buildHydrationDiffNode(fiber, distanceFromLeaf) { - if (null === fiber.return) { - if (null === hydrationDiffRootDEV) - hydrationDiffRootDEV = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - else { - if (hydrationDiffRootDEV.fiber !== fiber) - throw Error( - "Saw multiple hydration diff roots in a pass. This is a bug in React." - ); - hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && - (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); - } - return hydrationDiffRootDEV; + function popProvider(context, providerFiber) { + context._currentValue = valueCursor.current; + var currentRenderer = rendererCursorDEV.current; + pop(rendererCursorDEV, providerFiber); + context._currentRenderer = currentRenderer; + pop(valueCursor, providerFiber); + } + function scheduleContextWorkOnParentPath( + parent, + renderLanes, + propagationRoot + ) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; } - var siblings = buildHydrationDiffNode( - fiber.return, - distanceFromLeaf + 1 - ).children; - if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) - return ( - (siblings = siblings[siblings.length - 1]), - siblings.distanceFromLeaf > distanceFromLeaf && - (siblings.distanceFromLeaf = distanceFromLeaf), - siblings + parent !== propagationRoot && + console.error( + "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." ); - distanceFromLeaf = { - fiber: fiber, - children: [], - serverProps: void 0, - serverTail: [], - distanceFromLeaf: distanceFromLeaf - }; - siblings.push(distanceFromLeaf); - return distanceFromLeaf; } - function warnNonHydratedInstance(fiber, rejectedCandidate) { - didSuspendOrErrorDEV || - ((fiber = buildHydrationDiffNode(fiber, 0)), - (fiber.serverProps = null), - null !== rejectedCandidate && - ((rejectedCandidate = - describeHydratableInstanceForDevWarnings(rejectedCandidate)), - fiber.serverTail.push(rejectedCandidate))); - } - function throwOnHydrationMismatch(fiber) { - var diff = "", - diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); - queueHydrationError( - createCapturedValueAtFiber( - Error( - "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + - diff - ), - fiber - ) - ); - throw HydrationMismatchException; - } - function prepareToHydrateHostInstance(fiber) { - var didHydrate = fiber.stateNode; - var type = fiber.type, - props = fiber.memoizedProps; - didHydrate[internalInstanceKey] = fiber; - didHydrate[internalPropsKey] = props; - validatePropertiesInDevelopment(type, props); - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", didHydrate); - listenToNonDelegatedEvent("close", didHydrate); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", didHydrate); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); - break; - case "source": - listenToNonDelegatedEvent("error", didHydrate); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", didHydrate); - listenToNonDelegatedEvent("load", didHydrate); - break; - case "details": - listenToNonDelegatedEvent("toggle", didHydrate); - break; - case "input": - checkControlledValueProps("input", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateInputProps(didHydrate, props); - initInput( - didHydrate, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 + function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree + ) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) + throw Error( + "We just came from a parent so we must have had a parent. This is a bug in React." + ); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + nextFiber, + renderLanes, + workInProgress ); - track(didHydrate); - break; - case "option": - validateOptionProps(didHydrate, props); - break; - case "select": - checkControlledValueProps("select", props); - listenToNonDelegatedEvent("invalid", didHydrate); - validateSelectProps(didHydrate, props); - break; - case "textarea": - checkControlledValueProps("textarea", props), - listenToNonDelegatedEvent("invalid", didHydrate), - validateTextareaProps(didHydrate, props), - initTextarea( - didHydrate, - props.value, - props.defaultValue, - props.children - ), - track(didHydrate); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - didHydrate.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(didHydrate.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", didHydrate), - listenToNonDelegatedEvent("toggle", didHydrate)), - null != props.onScroll && - listenToNonDelegatedEvent("scroll", didHydrate), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", didHydrate), - null != props.onClick && (didHydrate.onclick = noop$2), - (didHydrate = !0)) - : (didHydrate = !1); - didHydrate || throwOnHydrationMismatch(fiber); - } - function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } } - function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) - return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - if (shouldClear && nextHydratableInstance) { - for (shouldClear = nextHydratableInstance; shouldClear; ) { - JSCompiler_temp = buildHydrationDiffNode(fiber, 0); - var description = - describeHydratableInstanceForDevWarnings(shouldClear); - JSCompiler_temp.serverTail.push(description); - shouldClear = - "Suspense" === description.type - ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) - : getNextHydratable(shouldClear.nextSibling); + function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree + ) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current + ? current.push(context) + : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) + throw Error("Should have a current fiber. This is a bug in React."); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); } - throwOnHydrationMismatch(fiber); + parent = parent.return; } - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) - throw Error( - "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." - ); - nextHydratableInstance = - getNextHydratableInstanceAfterSuspenseInstance(fiber); - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; - } - function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - didSuspendOrErrorDEV = isHydrating = !1; - } - function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); - } - function emitPendingHydrationWarnings() { - var diffRoot = hydrationDiffRootDEV; - null !== diffRoot && - ((hydrationDiffRootDEV = null), - (diffRoot = describeDiff(diffRoot)), - console.error( - "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", - "https://react.dev/link/hydration-mismatch", - diffRoot - )); - } - function createThenableState() { - return { didWarnAboutUncachedPromise: !1, thenables: [] }; - } - function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } - function noop$4() {} - function trackUsedThenable(thenableState, thenable, index) { - null !== ReactSharedInternals.actQueue && - (ReactSharedInternals.didUsePromise = !0); - var trackedThenables = thenableState.thenables; - index = trackedThenables[index]; - void 0 === index - ? trackedThenables.push(thenable) - : index !== thenable && - (thenableState.didWarnAboutUncachedPromise || - ((thenableState.didWarnAboutUncachedPromise = !0), - console.error( - "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." - )), - thenable.then(noop$4, noop$4), - (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) - thenable.then(noop$4, noop$4); - else { - thenableState = workInProgressRoot; - if ( - null !== thenableState && - 100 < thenableState.shellSuspendCounter - ) - throw Error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - ); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - needsToResetSuspendedThenableDEV = !0; - throw SuspenseException; + function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } + return !1; } - function getSuspendedThenable() { - if (null === suspendedThenable) - throw Error( - "Expected a suspended thenable. This is a bug in React. Please file an issue." - ); - var thenable = suspendedThenable; - suspendedThenable = null; - needsToResetSuspendedThenableDEV = !1; - return thenable; + function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } - function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error( - "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + function readContext(context) { + isDisallowedContextReadInDEV && + console.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()." ); + return readContextForConsumer(currentlyRenderingFiber$1, context); } - function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; - } - function retainCache(cache) { - cache.controller.signal.aborted && - console.warn( - "A cache instance was retained after it was already freed. This likely indicates a bug in React." - ); - cache.refCount++; + function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } - function releaseCache(cache) { - cache.refCount--; - 0 > cache.refCount && - console.warn( - "A cache instance was released after it was already freed. This likely indicates a bug in React." - ); - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); + function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) + 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()." + ); + lastContextDependency = context; + consumer.dependencies = { + lanes: 0, + firstContext: context, + _debugThenableState: null + }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } function entangleAsyncAction(transition, thenable) { if (null === currentEntangledListeners) { @@ -4662,6378 +4298,6553 @@ ); return thenableWithOverride; } - function pushHiddenContext(fiber, context) { - var prevEntangledRenderLanes = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); - push(currentTreeHiddenStackCursor, context, fiber); - entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; - } - function reuseHiddenContextOnStack(fiber) { - push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); - push( - currentTreeHiddenStackCursor, - currentTreeHiddenStackCursor.current, - fiber - ); - } - function popHiddenContext(fiber) { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor, fiber); - pop(prevEntangledRenderLanesCursor, fiber); - } - function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } - function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) - : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } - function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; + function createUpdate(lane) { + return { + lane: lane, + tag: UpdateState, + payload: null, + callback: null, + next: null + }; } - function mountHookTypesDev() { - var hookName = currentHookNameInDev; - null === hookTypesDev - ? (hookTypesDev = [hookName]) - : hookTypesDev.push(hookName); - } - function updateHookTypesDev() { - var hookName = currentHookNameInDev; + function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; if ( - null !== hookTypesDev && - (hookTypesUpdateIndexDev++, - hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + currentlyProcessingQueue === updateQueue && + !didWarnUpdateInsideUpdate ) { - var componentName = getComponentNameFromFiber( - currentlyRenderingFiber$1 + var componentName = getComponentNameFromFiber(fiber); + console.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\nPlease update the following component: %s", + componentName ); - if ( - !didWarnAboutMismatchedHooksForComponent.has(componentName) && - (didWarnAboutMismatchedHooksForComponent.add(componentName), - null !== hookTypesDev) - ) { - for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { - var oldHookName = hookTypesDev[i], - newHookName = - i === hookTypesUpdateIndexDev ? hookName : oldHookName; - for ( - oldHookName = i + 1 + ". " + oldHookName; - 30 > oldHookName.length; - - ) - oldHookName += " "; - oldHookName += newHookName + "\n"; - table += oldHookName; - } - console.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://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", - componentName, - table - ); - } + didWarnUpdateInsideUpdate = !0; } - } - function checkDepsAreArrayDev(deps) { - void 0 === deps || - null === deps || - isArrayImpl(deps) || - console.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 + if ((executionContext & RenderContext) !== NoContext) + return ( + (componentName = updateQueue.pending), + null === componentName + ? (update.next = update) + : ((update.next = componentName.next), + (componentName.next = update)), + (updateQueue.pending = update), + (update = getRootForUpdatedFiber(fiber)), + markUpdateLaneFromFiberToRoot(fiber, null, lane), + update ); + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); } - function warnOnUseFormStateInDev() { - var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); - didWarnAboutUseFormState.has(componentName) || - (didWarnAboutUseFormState.add(componentName), - console.error( - "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", - componentName - )); + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } } - function throwInvalidHookError() { - 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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + if ( + null !== current && + ((current = current.updateQueue), queue === current) + ) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; + } + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } - function areHookInputsEqual(nextDeps, prevDeps) { - if (ignorePreviousDependencies) return !1; - if (null === prevDeps) - return ( - console.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 - ), - !1 - ); - nextDeps.length !== prevDeps.length && - console.error( - "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", - currentHookNameInDev, - "[" + prevDeps.join(", ") + "]", - "[" + nextDeps.join(", ") + "]" - ); - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; + function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } - function renderWithHooks( - current, + function processUpdateQueue( workInProgress, - Component, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - hookTypesDev = null !== current ? current._debugHookTypes : null; - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - if ( - "[object AsyncFunction]" === - Object.prototype.toString.call(Component) || - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(Component) - ) - (nextRenderLanes = getComponentNameFromFiber( - currentlyRenderingFiber$1 - )), - didWarnAboutAsyncClientComponent.has(nextRenderLanes) || - (didWarnAboutAsyncClientComponent.add(nextRenderLanes), - console.error( - "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." - )); - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null !== current && null !== current.memoizedState - ? HooksDispatcherOnUpdateInDEV - : null !== hookTypesDev - ? HooksDispatcherOnMountWithHookTypesInDEV - : HooksDispatcherOnMountInDEV; - shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = - (workInProgress.mode & StrictLegacyMode) !== NoMode; - var children = callComponentInDEV(Component, props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - if (nextRenderLanes) { - setIsStrictModeForDevtools(!0); - try { - children = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - ); - } finally { - setIsStrictModeForDevtools(!1); - } + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress.updateQueue; + hasForceUpdate = !1; + currentlyProcessingQueue = queue.shared; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress.alternate; + null !== current && + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); } - finishRenderingHooks(current, workInProgress); - return children; - } - function finishRenderingHooks(current, workInProgress) { - workInProgress._debugHookTypes = hookTypesDev; - null === workInProgress.dependencies - ? null !== thenableState$1 && - (workInProgress.dependencies = { - lanes: 0, - firstContext: null, - _debugThenableState: thenableState$1 - }) - : (workInProgress.dependencies._debugThenableState = thenableState$1); - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = - null !== currentHook && null !== currentHook.next; - renderLanes = 0; - hookTypesDev = - currentHookNameInDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - null !== current && - (current.flags & 31457280) !== (workInProgress.flags & 31457280) && - console.error( - "Internal React error: Expected static flag was missing. Please notify the React team." - ); - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + updateLane = workInProgress; + var partialState = pendingQueue; + var nextProps = props, + instance = instance$jscomp$0; + switch (partialState.tag) { + case ReplaceState: + partialState = partialState.payload; + if ("function" === typeof partialState) { + isDisallowedContextReadInDEV = !0; + var nextState = partialState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + newState = nextState; + break a; + } + newState = partialState; + break a; + case CaptureUpdate: + updateLane.flags = (updateLane.flags & -65537) | 128; + case UpdateState: + nextState = partialState.payload; + if ("function" === typeof nextState) { + isDisallowedContextReadInDEV = !0; + partialState = nextState.call( + instance, + newState, + nextProps + ); + if (updateLane.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + nextState.call(instance, newState, nextProps); + } finally { + setIsStrictModeForDevtools(!1); + } + } + isDisallowedContextReadInDEV = !1; + } else partialState = nextState; + if (null === partialState || void 0 === partialState) break a; + newState = assign({}, newState, partialState); + break a; + case ForceUpdate: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress.flags |= 64), + isHiddenUpdate && (workInProgress.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress.lanes = lastBaseUpdate; + workInProgress.memoizedState = newState; + } + currentlyProcessingQueue = null; + } + function callCallback(callback, context) { + if ("function" !== typeof callback) throw Error( - "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + "Invalid argument passed as callback. Expected a function. Instead received: " + + callback ); - null === current || - didReceiveUpdate || - ((current = current.dependencies), - null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); - needsToResetSuspendedThenableDEV - ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) - : (current = !1); - current && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Unknown"), - didWarnAboutUseWrappedInTryCatch.has(workInProgress) || - didWarnAboutAsyncClientComponent.has(workInProgress) || - (didWarnAboutUseWrappedInTryCatch.add(workInProgress), - console.error( - "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." - ))); + callback.call(context); } - function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (numberOfReRenders >= RE_RENDER_LIMIT) - throw Error( - "Too many re-renders. React limits the number of renders to prevent an infinite loop." - ); - numberOfReRenders += 1; - ignorePreviousDependencies = !1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - hookTypesUpdateIndexDev = -1; - ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; - children = callComponentInDEV(Component, props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; + function commitHiddenCallbacks(updateQueue, context) { + var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; + if (null !== hiddenCallbacks) + for ( + updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; + updateQueue < hiddenCallbacks.length; + updateQueue++ + ) + callCallback(hiddenCallbacks[updateQueue], context); } - function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== - dispatcher && (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; + function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) + for ( + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } - function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; + function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 + }; } - function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags = - (workInProgress.mode & StrictEffectsMode) !== NoMode - ? workInProgress.flags & -201328645 - : workInProgress.flags & -2053; - current.lanes &= ~lanes; + function retainCache(cache) { + cache.controller.signal.aborted && + console.warn( + "A cache instance was retained after it was already freed. This likely indicates a bug in React." + ); + cache.refCount++; } - function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { - for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - hookTypesDev = - workInProgressHook = - currentHook = - currentlyRenderingFiber$1 = - null; - hookTypesUpdateIndexDev = -1; - currentHookNameInDev = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; - } - function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; - } - function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error( - "Update hook called on initial render. This is likely a bug in React. Please file an issue." - ); - throw Error("Rendered more hooks than during the previous render."); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; - } - function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = createThenableState()); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null !== index && null !== index.memoizedState - ? HooksDispatcherOnUpdateInDEV - : HooksDispatcherOnMountInDEV)); - return thenable; + function releaseCache(cache) { + cache.refCount--; + 0 > cache.refCount && + console.warn( + "A cache instance was released after it was already freed. This likely indicates a bug in React." + ); + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } - function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + function warnOnInvalidCallback(callback) { + if (null !== callback && "function" !== typeof callback) { + var key = String(callback); + didWarnOnInvalidCallback.has(key) || + (didWarnOnInvalidCallback.add(key), + console.error( + "Expected the last optional `callback` argument to be a function. Instead received: %s.", + callback + )); } - throw Error("An unsupported type was passed to use(): " + String(usable)); } - function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); + function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps + ) { + var prevState = workInProgress.memoizedState, + partialState = getDerivedStateFromProps(nextProps, prevState); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + partialState = getDerivedStateFromProps(nextProps, prevState); + } finally { + setIsStrictModeForDevtools(!1); + } } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue || ignorePreviousDependencies) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), - current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - else - updateQueue.length !== size && + void 0 === partialState && + ((ctor = getComponentNameFromType(ctor) || "Component"), + didWarnAboutUndefinedDerivedState.has(ctor) || + (didWarnAboutUndefinedDerivedState.add(ctor), console.error( - "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", - updateQueue.length, - size - ); - memoCache.index++; - return updateQueue; - } - function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; + "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", + ctor + ))); + prevState = + null === partialState || void 0 === partialState + ? prevState + : assign({}, prevState, partialState); + workInProgress.memoizedState = prevState; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = prevState); } - function mountReducer(reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext + ) { + var instance = workInProgress.stateNode; + if ("function" === typeof instance.shouldComponentUpdate) { + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); + if (workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(!0); try { - init(initialArg); + oldProps = instance.shouldComponentUpdate( + newProps, + newState, + nextContext + ); } finally { setIsStrictModeForDevtools(!1); } } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - } - function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); - } - function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue !== baseQueue && + void 0 === oldProps && console.error( - "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." + "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", + getComponentNameFromType(ctor) || "Component" ); - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; + return oldProps; } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction = !1; - do { - var updateLane = update.lane & -536870913; - if ( - updateLane !== update.lane - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; + return ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } - function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) - throw Error( - "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" - ); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do - (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; + function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext + ) { + var oldState = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== oldState && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Component"), + didWarnAboutStateAssignmentForComponent.has(workInProgress) || + (didWarnAboutStateAssignmentForComponent.add(workInProgress), + console.error( + "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + workInProgress + )), + classComponentUpdater.enqueueReplaceState( + instance, + instance.state, + null + )); } - function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - var nextSnapshot = getServerSnapshot(); - didWarnUncachedGetSnapshot || - nextSnapshot === getServerSnapshot() || - (console.error( - "The result of getServerSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); - } else { - nextSnapshot = getSnapshot(); - didWarnUncachedGetSnapshot || - ((getServerSnapshot = getSnapshot()), - objectIs(nextSnapshot, getServerSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0))); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - hook.memoizedState = nextSnapshot; - getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; - hook.queue = getServerSnapshot; - mountEffect( - subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), - [subscribe] - ); - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - getServerSnapshot, - nextSnapshot, - getSnapshot - ), - null - ); - return nextSnapshot; - } - function updateSyncExternalStore( - subscribe, - getSnapshot, - getServerSnapshot - ) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) - throw Error( - "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." - ); - getServerSnapshot = getServerSnapshot(); - } else if ( - ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) - ) { - var cachedSnapshot = getSnapshot(); - objectIs(getServerSnapshot, cachedSnapshot) || - (console.error( - "The result of getSnapshot should be cached to avoid an infinite loop" - ), - (didWarnUncachedGetSnapshot = !0)); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var _propName in Component) + void 0 === newProps[_propName] && + (newProps[_propName] = Component[_propName]); } - if ( - (cachedSnapshot = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - )) - ) - (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); - hook = hook.queue; - var create = subscribeToStore.bind(null, fiber, hook, subscribe); - updateEffectImpl(2048, Passive, create, [subscribe]); - if ( - hook.getSnapshot !== getSnapshot || - cachedSnapshot || - (null !== workInProgressHook && - workInProgressHook.memoizedState.tag & HasEffect) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + return newProps; + } + function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } - return getServerSnapshot; + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } - function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); + function pushTreeFork(workInProgress, totalChildren) { + warnIfNotHydrating(); + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } - function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + function pushTreeId(workInProgress, totalChildren, index) { + warnIfNotHydrating(); + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } - function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); + function pushMaterializedTreeId(workInProgress) { + warnIfNotHydrating(); + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } - function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; - } + function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } - function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); + function warnIfNotHydrating() { + isHydrating || + console.error( + "Expected to be hydrating. This is a bug in React. Please file an issue." + ); } - function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } + function buildHydrationDiffNode(fiber, distanceFromLeaf) { + if (null === fiber.return) { + if (null === hydrationDiffRootDEV) + hydrationDiffRootDEV = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf + }; + else { + if (hydrationDiffRootDEV.fiber !== fiber) + throw Error( + "Saw multiple hydration diff roots in a pass. This is a bug in React." + ); + hydrationDiffRootDEV.distanceFromLeaf > distanceFromLeaf && + (hydrationDiffRootDEV.distanceFromLeaf = distanceFromLeaf); } + return hydrationDiffRootDEV; } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; - } - function mountState(initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - queue + var siblings = buildHydrationDiffNode( + fiber.return, + distanceFromLeaf + 1 + ).children; + if (0 < siblings.length && siblings[siblings.length - 1].fiber === fiber) + return ( + (siblings = siblings[siblings.length - 1]), + siblings.distanceFromLeaf > distanceFromLeaf && + (siblings.distanceFromLeaf = distanceFromLeaf), + siblings ); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - } - function mountOptimistic(passthrough) { - var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + distanceFromLeaf = { + fiber: fiber, + children: [], + serverProps: void 0, + serverTail: [], + distanceFromLeaf: distanceFromLeaf }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; + siblings.push(distanceFromLeaf); + return distanceFromLeaf; } - function updateOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + function warnNonHydratedInstance(fiber, rejectedCandidate) { + didSuspendOrErrorDEV || + ((fiber = buildHydrationDiffNode(fiber, 0)), + (fiber.serverProps = null), + null !== rejectedCandidate && + ((rejectedCandidate = + describeHydratableInstanceForDevWarnings(rejectedCandidate)), + fiber.serverTail.push(rejectedCandidate))); } - function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer + function throwOnHydrationMismatch(fiber) { + var diff = "", + diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), (diff = describeDiff(diffRoot))); + queueHydrationError( + createCapturedValueAtFiber( + Error( + "Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\nhttps://react.dev/link/hydration-mismatch" + + diff + ), + fiber + ) ); + throw HydrationMismatchException; } - function rerenderOptimistic(passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; - } - function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload - ) { - if (isRenderPhaseUpdate(fiber)) - throw Error("Cannot update form state while rendering."); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); - } - } - function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - ReactSharedInternals.T._updatedFibers = new Set(); - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((actionQueue = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < actionQueue && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + function prepareToHydrateHostInstance(fiber) { + var didHydrate = fiber.stateNode; + var type = fiber.type, + props = fiber.memoizedProps; + didHydrate[internalInstanceKey] = fiber; + didHydrate[internalPropsKey] = props; + validatePropertiesInDevelopment(type, props); + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", didHydrate); + listenToNonDelegatedEvent("close", didHydrate); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", didHydrate); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], didHydrate); + break; + case "source": + listenToNonDelegatedEvent("error", didHydrate); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", didHydrate); + listenToNonDelegatedEvent("load", didHydrate); + break; + case "details": + listenToNonDelegatedEvent("toggle", didHydrate); + break; + case "input": + checkControlledValueProps("input", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateInputProps(didHydrate, props); + initInput( + didHydrate, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(didHydrate); + break; + case "option": + validateOptionProps(didHydrate, props); + break; + case "select": + checkControlledValueProps("select", props); + listenToNonDelegatedEvent("invalid", didHydrate); + validateSelectProps(didHydrate, props); + break; + case "textarea": + checkControlledValueProps("textarea", props), + listenToNonDelegatedEvent("invalid", didHydrate), + validateTextareaProps(didHydrate, props), + initTextarea( + didHydrate, + props.value, + props.defaultValue, + props.children + ), + track(didHydrate); + } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + didHydrate.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(didHydrate.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", didHydrate), + listenToNonDelegatedEvent("toggle", didHydrate)), + null != props.onScroll && + listenToNonDelegatedEvent("scroll", didHydrate), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", didHydrate), + null != props.onClick && (didHydrate.onclick = noop$2), + (didHydrate = !0)) + : (didHydrate = !1); + didHydrate || throwOnHydrationMismatch(fiber); + } + function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; } - } else - try { - (currentTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, currentTransition); - } catch (error$3) { - onActionError(actionQueue, node, error$3); + } + function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) + return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && (shouldClear = !0); + if (shouldClear && nextHydratableInstance) { + for (shouldClear = nextHydratableInstance; shouldClear; ) { + JSCompiler_temp = buildHydrationDiffNode(fiber, 0); + var description = + describeHydratableInstanceForDevWarnings(shouldClear); + JSCompiler_temp.serverTail.push(description); + shouldClear = + "Suspense" === description.type + ? getNextHydratableInstanceAfterSuspenseInstance(shouldClear) + : getNextHydratable(shouldClear.nextSibling); } + throwOnHydrationMismatch(fiber); + } + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) + throw Error( + "Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue." + ); + nextHydratableInstance = + getNextHydratableInstanceAfterSuspenseInstance(fiber); + } else + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } - function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? (returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ), - node.isTransition || - console.error( - "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" - )) - : onActionSuccess(actionQueue, node, returnValue); + function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + didSuspendOrErrorDEV = isHydrating = !1; } - function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); + function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } - function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; + function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } - function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + function emitPendingHydrationWarnings() { + var diffRoot = hydrationDiffRootDEV; + null !== diffRoot && + ((hydrationDiffRootDEV = null), + (diffRoot = describeDiff(diffRoot)), + console.error( + "A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:\n\n- A server/client branch `if (typeof window !== 'undefined')`.\n- Variable input such as `Date.now()` or `Math.random()` which changes each time it's called.\n- Date formatting in a user's locale which doesn't match the server.\n- External changing data without sending a snapshot of it along with the HTML.\n- Invalid HTML tag nesting.\n\nIt can also happen if the client has a browser extension installed which messes with the HTML before React loaded.\n\n%s%s", + "https://react.dev/link/hydration-mismatch", + diffRoot + )); } - function actionStateReducer(oldState, newState) { - return newState; + function createThenableState() { + return { didWarnAboutUncachedPromise: !1, thenables: [] }; } - function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var isMatching = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var markerInstance = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== markerInstance.nodeType; - - ) { - if (!inRootOrSingleton) { - markerInstance = null; - break b; - } - markerInstance = getNextHydratable( - markerInstance.nextSibling - ); - if (null === markerInstance) { - markerInstance = null; - break b; - } - } - inRootOrSingleton = markerInstance.data; - markerInstance = - inRootOrSingleton === FORM_STATE_IS_MATCHING || - inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING - ? markerInstance - : null; + function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; + } + function noop$4() {} + function trackUsedThenable(thenableState, thenable, index) { + null !== ReactSharedInternals.actQueue && + (ReactSharedInternals.didUsePromise = !0); + var trackedThenables = thenableState.thenables; + index = trackedThenables[index]; + void 0 === index + ? trackedThenables.push(thenable) + : index !== thenable && + (thenableState.didWarnAboutUncachedPromise || + ((thenableState.didWarnAboutUncachedPromise = !0), + console.error( + "A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework." + )), + thenable.then(noop$4, noop$4), + (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) + thenable.then(noop$4, noop$4); + else { + thenableState = workInProgressRoot; + if ( + null !== thenableState && + 100 < thenableState.shellSuspendCounter + ) + throw Error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; } - if (markerInstance) { - nextHydratableInstance = getNextHydratable( - markerInstance.nextSibling - ); - isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; - break a; + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; } } - throwOnHydrationMismatch(isMatching); - } - isMatching = !1; + ); } - isMatching && (initialStateProp = ssrFormState[0]); - } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + needsToResetSuspendedThenableDEV = !0; + throw SuspenseException; } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - isMatching = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = isMatching; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - isMatching - ); - isMatching.dispatch = ssrFormState; - isMatching = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - isMatching.queue - ); - isMatching = mountWorkInProgressHook(); - markerInstance = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - isMatching.queue = markerInstance; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - markerInstance, - inRootOrSingleton, - ssrFormState - ); - markerInstance.dispatch = ssrFormState; - isMatching.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; } - function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); + function getSuspendedThenable() { + if (null === suspendedThenable) + throw Error( + "Expected a suspended thenable. This is a bug in React. Please file an issue." + ); + var thenable = suspendedThenable; + suspendedThenable = null; + needsToResetSuspendedThenableDEV = !1; + return thenable; } - function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; + function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - HasEffect | Passive, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; + throw Error( + "Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + ); } - function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; + function pushHiddenContext(fiber, context) { + var prevEntangledRenderLanes = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, prevEntangledRenderLanes, fiber); + push(currentTreeHiddenStackCursor, context, fiber); + entangledRenderLanes = prevEntangledRenderLanes | context.baseLanes; } - function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; + function reuseHiddenContextOnStack(fiber) { + push(prevEntangledRenderLanesCursor, entangledRenderLanes, fiber); + push( + currentTreeHiddenStackCursor, + currentTreeHiddenStackCursor.current, + fiber + ); } - function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; + function popHiddenContext(fiber) { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor, fiber); + pop(prevEntangledRenderLanesCursor, fiber); } - function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; + function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } - function mountRef(initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); + function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current, offscreenWorkInProgress) + : push(resumedCache, prevCachePool.pool, offscreenWorkInProgress); } - function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - createEffectInstance(), - create, - deps - ); + function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } - function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - HasEffect | hookFlags, - inst, - create, - deps - ))); + function mountHookTypesDev() { + var hookName = currentHookNameInDev; + null === hookTypesDev + ? (hookTypesDev = [hookName]) + : hookTypesDev.push(hookName); } - function mountEffect(create, deps) { - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (currentlyRenderingFiber$1.mode & NoStrictPassiveEffectsMode) === NoMode - ? mountEffectImpl(142608384, Passive, create, deps) - : mountEffectImpl(8390656, Passive, create, deps); - } - function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } - } - function mountEvent(callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." - ); - return ref.impl.apply(void 0, arguments); - }; - } - function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if ((executionContext & RenderContext) !== NoContext) - throw Error( - "A function wrapped in useEffectEvent can't be called during rendering." + function updateHookTypesDev() { + var hookName = currentHookNameInDev; + if ( + null !== hookTypesDev && + (hookTypesUpdateIndexDev++, + hookTypesDev[hookTypesUpdateIndexDev] !== hookName) + ) { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + if ( + !didWarnAboutMismatchedHooksForComponent.has(componentName) && + (didWarnAboutMismatchedHooksForComponent.add(componentName), + null !== hookTypesDev) + ) { + for (var table = "", i = 0; i <= hookTypesUpdateIndexDev; i++) { + var oldHookName = hookTypesDev[i], + newHookName = + i === hookTypesUpdateIndexDev ? hookName : oldHookName; + for ( + oldHookName = i + 1 + ". " + oldHookName; + 30 > oldHookName.length; + + ) + oldHookName += " "; + oldHookName += newHookName + "\n"; + table += oldHookName; + } + console.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://react.dev/link/rules-of-hooks\n\n Previous render Next render\n ------------------------------------------------------\n%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", + componentName, + table ); - return ref.impl.apply(void 0, arguments); - }; - } - function mountLayoutEffect(create, deps) { - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - return mountEffectImpl(fiberFlags, Layout, create, deps); - } - function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; + } } - if (null !== ref && void 0 !== ref) - return ( - ref.hasOwnProperty("current") || - console.error( - "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", - "an object with keys {" + Object.keys(ref).join(", ") + "}" - ), - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); } - function mountImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function checkDepsAreArrayDev(deps) { + void 0 === deps || + null === deps || + isArrayImpl(deps) || console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" + "%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 ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - var fiberFlags = 4194308; - (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode && - (fiberFlags |= 67108864); - mountEffectImpl( - fiberFlags, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); } - function updateImperativeHandle(ref, create, deps) { - "function" !== typeof create && + function warnOnUseFormStateInDev() { + var componentName = getComponentNameFromFiber(currentlyRenderingFiber); + didWarnAboutUseFormState.has(componentName) || + (didWarnAboutUseFormState.add(componentName), console.error( - "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", - null !== create ? typeof create : "null" - ); - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl( - 4, - Layout, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - } - function mountCallback(callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; + "ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.", + componentName + )); } - function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; + function throwInvalidHookError() { + 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://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." + ); } - function mountMemo(nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; + function areHookInputsEqual(nextDeps, prevDeps) { + if (ignorePreviousDependencies) return !1; + if (null === prevDeps) + return ( + console.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 + ), + !1 + ); + nextDeps.length !== prevDeps.length && + console.error( + "The final argument passed to %s changed size between renders. The order and size of this array must remain constant.\n\nPrevious: %s\nIncoming: %s", + currentHookNameInDev, + "[" + prevDeps.join(", ") + "]", + "[" + nextDeps.join(", ") + "]" + ); + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } - function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { + function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes + ) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + hookTypesDev = null !== current ? current._debugHookTypes : null; + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + if ( + "[object AsyncFunction]" === + Object.prototype.toString.call(Component) || + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(Component) + ) + (nextRenderLanes = getComponentNameFromFiber(currentlyRenderingFiber)), + didWarnAboutAsyncClientComponent.has(nextRenderLanes) || + (didWarnAboutAsyncClientComponent.add(nextRenderLanes), + console.error( + "async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server." + )); + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null !== current && null !== current.memoizedState + ? HooksDispatcherOnUpdateInDEV + : null !== hookTypesDev + ? HooksDispatcherOnMountWithHookTypesInDEV + : HooksDispatcherOnMountInDEV; + shouldDoubleInvokeUserFnsInHooksDEV = nextRenderLanes = + (workInProgress.mode & StrictLegacyMode) !== NoMode; + var children = callComponentInDEV(Component, props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + if (nextRenderLanes) { setIsStrictModeForDevtools(!0); try { - nextCreate(); + children = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + ); } finally { setIsStrictModeForDevtools(!1); } } - hook.memoizedState = [prevState, deps]; - return prevState; - } - function mountDeferredValue(value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); + finishRenderingHooks(current, workInProgress); + return children; } - function updateDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); + function finishRenderingHooks(current, workInProgress) { + workInProgress._debugHookTypes = hookTypesDev; + null === workInProgress.dependencies + ? null !== thenableState$1 && + (workInProgress.dependencies = { + lanes: 0, + firstContext: null, + _debugThenableState: thenableState$1 + }) + : (workInProgress.dependencies._debugThenableState = thenableState$1); + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = + null !== currentHook && null !== currentHook.next; + renderLanes = 0; + hookTypesDev = + currentHookNameInDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + null !== current && + (current.flags & 31457280) !== (workInProgress.flags & 31457280) && + console.error( + "Internal React error: Expected static flag was missing. Please notify the React team." + ); + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) + throw Error( + "Rendered fewer hooks than expected. This may be caused by an accidental early return statement." + ); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); + needsToResetSuspendedThenableDEV + ? ((needsToResetSuspendedThenableDEV = !1), (current = !0)) + : (current = !1); + current && + ((workInProgress = + getComponentNameFromFiber(workInProgress) || "Unknown"), + didWarnAboutUseWrappedInTryCatch.has(workInProgress) || + didWarnAboutAsyncClientComponent.has(workInProgress) || + (didWarnAboutUseWrappedInTryCatch.add(workInProgress), + console.error( + "`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary." + ))); } - function rerenderDeferredValue(value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue + function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (numberOfReRenders >= RE_RENDER_LIMIT) + throw Error( + "Too many re-renders. React limits the number of renders to prevent an infinite loop." ); + numberOfReRenders += 1; + ignorePreviousDependencies = !1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + hookTypesUpdateIndexDev = -1; + ReactSharedInternals.H = HooksDispatcherOnRerenderInDEV; + children = callComponentInDEV(Component, props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } - function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; + function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== + dispatcher && (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } - function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; + function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } - function startTransition( - fiber, - queue, - pendingState, - finishedState, - callback - ) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && previousPriority < ContinuousEventPriority - ? previousPriority - : ContinuousEventPriority; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - currentTransition._updatedFibers = new Set(); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then + function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags = + (workInProgress.mode & StrictEffectsMode) !== NoMode + ? workInProgress.flags & -201328645 + : workInProgress.flags & -2053; + current.lanes &= ~lanes; + } + function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane(fiber) - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition), - null === prevTransition && - currentTransition._updatedFibers && - ((fiber = currentTransition._updatedFibers.size), - currentTransition._updatedFibers.clear(), - 10 < fiber && - console.warn( - "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." - )); + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; + } + didScheduleRenderPhaseUpdate = !1; } + renderLanes = 0; + hookTypesDev = + workInProgressHook = + currentHook = + currentlyRenderingFiber = + null; + hookTypesUpdateIndexDev = -1; + currentHookNameInDev = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } - function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) - throw Error( - "Expected the form instance to be a HostComponent. This is a bug in React." - ); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - NotPendingTransition, - null === action - ? noop$3 - : function () { - requestFormReset$2(formFiber); - return action(formData); - } - ); - } - function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: NotPendingTransition, - baseState: NotPendingTransition, + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: NotPendingTransition - }, + queue: null, next: null }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; - } - function requestFormReset$2(formFiber) { - null === ReactSharedInternals.T && - console.error( - "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." - ); - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal( - formFiber, - resetStateQueue, - {}, - requestUpdateLane(formFiber) - ); + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } - function mountTransition() { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error( + "Update hook called on initial render. This is likely a bug in React. Please file an issue." + ); + throw Error("Rendered more hooks than during the previous render."); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); + } + return workInProgressHook; } - function updateTransition() { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } - function rerenderTransition() { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; + function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = createThenableState()); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null !== index && null !== index.memoizedState + ? HooksDispatcherOnUpdateInDEV + : HooksDispatcherOnMountInDEV)); + return thenable; } - function useHostTransitionStatus() { - return readContext(HostTransitionContext); + function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error("An unsupported type was passed to use(): " + String(usable)); } - function mountId() { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var treeId = treeContextOverflow; - var idWithLeadingBit = treeContextId; - treeId = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + treeId; - identifierPrefix = ":" + identifierPrefix + "R" + treeId; - treeId = localIdCounter++; - 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); - identifierPrefix += ":"; - } else - (treeId = globalClientIdCounter++), - (identifierPrefix = - ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); - return (hook.memoizedState = identifierPrefix); + function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue || ignorePreviousDependencies) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), + current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + else + updateQueue.length !== size && + console.error( + "Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.", + updateQueue.length, + size + ); + memoCache.index++; + return updateQueue; } - function mountRefresh() { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } - function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(provider); - fiber = createUpdate(lane); - var root = enqueueUpdate(provider, fiber, lane); - null !== root && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root, provider, lane), - entangleTransitions(root, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; + function mountReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } } - provider = provider.return; - } - } - function dispatchReducerAction( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p0 && - console.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()." - ); - JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber); - action = { - lane: JSCompiler_OptimizeArgumentsArray_p0, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p0 - )), - null !== action && - (startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p0), - scheduleUpdateOnFiber( - action, - fiber, - JSCompiler_OptimizeArgumentsArray_p0 - ), - entangleTransitionUpdate( - action, - queue, - JSCompiler_OptimizeArgumentsArray_p0 - ))); + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; } - function dispatchSetState( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p1 && - console.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()." - ); - JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber); - dispatchSetStateInternal( - fiber, - queue, - action, - JSCompiler_OptimizeArgumentsArray_p1 - ) && startUpdateTimerByLane(JSCompiler_OptimizeArgumentsArray_p1); + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } - function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); - else { - var alternate = fiber.alternate; - if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) - ) { - var prevDispatcher = ReactSharedInternals.H; - ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && - finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - ReactSharedInternals.H = prevDispatcher; - } + function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" + ); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 + current.baseQueue !== baseQueue && + console.error( + "Internal error: Expected work-in-progress queue to be a clone. This is a bug in React." ); + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } - return !1; + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; + else { + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); + if ( + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction && + ((reducer = currentEntangledActionThenable), null !== reducer)) + ) + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; + } + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } - function dispatchOptimisticSetState( - fiber, - throwIfDuringRender, - queue, - action - ) { - null === ReactSharedInternals.T && - 0 === currentEntangledLane && - console.error( - "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) + throw Error( + "Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)" ); - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) - throw Error("Cannot update optimistic state while rendering."); - console.error("Cannot call startTransition while rendering."); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); - } - function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); - } - function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = - didScheduleRenderPhaseUpdate = !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; - } - function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do + (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } + return [newState, dispatch]; } - function pushDebugInfo(debugInfo) { - var previousDebugInfo = currentDebugInfo; - null != debugInfo && - (currentDebugInfo = - null === previousDebugInfo - ? debugInfo - : previousDebugInfo.concat(debugInfo)); - return previousDebugInfo; - } - function validateFragmentProps(element, fiber, returnFiber) { - for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { - var key = keys[i]; - if ("children" !== key && "key" !== key) { - null === fiber && - ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), - (fiber._debugInfo = currentDebugInfo), - (fiber.return = returnFiber)); - runWithFiberInDEV( - fiber, - function (erroredKey) { - console.error( - "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", - erroredKey - ); - }, - key + function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." ); - break; - } - } - } - function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = createThenableState()); - return trackUsedThenable(thenableState, thenable, index); - } - function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + var nextSnapshot = getServerSnapshot(); + didWarnUncachedGetSnapshot || + nextSnapshot === getServerSnapshot() || + (console.error( + "The result of getServerSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } else { + nextSnapshot = getSnapshot(); + didWarnUncachedGetSnapshot || + ((getServerSnapshot = getSnapshot()), + objectIs(nextSnapshot, getServerSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0))); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); + } + hook.memoizedState = nextSnapshot; + getServerSnapshot = { value: nextSnapshot, getSnapshot: getSnapshot }; + hook.queue = getServerSnapshot; + mountEffect( + subscribeToStore.bind(null, fiber, getServerSnapshot, subscribe), + [subscribe] + ); + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + getServerSnapshot, + nextSnapshot, + getSnapshot + ), + null + ); + return nextSnapshot; } - function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error( - 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' + function updateSyncExternalStore( + subscribe, + getSnapshot, + getServerSnapshot + ) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) + throw Error( + "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering." + ); + getServerSnapshot = getServerSnapshot(); + } else if ( + ((getServerSnapshot = getSnapshot()), !didWarnUncachedGetSnapshot) + ) { + var cachedSnapshot = getSnapshot(); + objectIs(getServerSnapshot, cachedSnapshot) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + if ( + (cachedSnapshot = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + )) + ) + (hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0); + hook = hook.queue; + var create = subscribeToStore.bind(null, fiber, hook, subscribe); + updateEffectImpl(2048, Passive, create, [subscribe]); + if ( + hook.getSnapshot !== getSnapshot || + cachedSnapshot || + (null !== workInProgressHook && + workInProgressHook.memoizedState.tag & HasEffect) + ) { + fiber.flags |= 2048; + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + hook, + getServerSnapshot, + getSnapshot + ), + null ); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - "Objects are not valid as a React child (found: " + - ("[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber) + - "). If you meant to render a collection of children, use an array instead." - ); + if (null === workInProgressRoot) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + return getServerSnapshot; } - function warnOnFunctionType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasFunctionTypeWarning[parentName] || - ((ownerHasFunctionTypeWarning[parentName] = !0), - (invalidChild = - invalidChild.displayName || invalidChild.name || "Component"), - 3 === returnFiber.tag - ? console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", - invalidChild, - invalidChild, - invalidChild - ) - : console.error( - "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", - invalidChild, - invalidChild, - parentName, - invalidChild, - parentName - )); + function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); } - function warnOnSymbolType(returnFiber, invalidChild) { - var parentName = getComponentNameFromFiber(returnFiber) || "Component"; - ownerHasSymbolTypeWarning[parentName] || - ((ownerHasSymbolTypeWarning[parentName] = !0), - (invalidChild = String(invalidChild)), - 3 === returnFiber.tag - ? console.error( - "Symbols are not valid as a React child.\n root.render(%s)", - invalidChild - ) - : console.error( - "Symbols are not valid as a React child.\n <%s>%s", - parentName, - invalidChild, - parentName - )); + function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); } - function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), - (returnFiber.flags |= 16)) - : deletions.push(childToDelete); - } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; + function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; + } + function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); + } + function mountStateImpl(initialState) { + var hook = mountWorkInProgressHook(); + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText( - textContent, - returnFiber.mode, - lanes - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return ( - (current = updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - )), - validateFragmentProps(element, current, returnFiber), - current - ); - if ( - null !== current && - (current.elementType === elementType || - isCompatibleFamilyForHotReloading(current, element) || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - (current._debugOwner = element._owner), - (current._debugInfo = currentDebugInfo), - current - ); - current = createFiberFromElement(element, returnFiber.mode, lanes); - coerceRef(current, element); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + hook.memoizedState = hook.baseState = initialState; + hook.queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + return hook; + } + function mountState(initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + } + function mountOptimistic(passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + } + function updateOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + } + function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer + ); + } + function rerenderOptimistic(passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + } + function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload + ) { + if (isRenderPhaseUpdate(fiber)) + throw Error("Cannot update form state while rendering."); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - (current._debugOwner = returnFiber), - (current._debugTask = returnFiber._debugTask), - (current._debugInfo = currentDebugInfo), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - current._debugInfo = currentDebugInfo; - return current; + } + function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + ReactSharedInternals.T._updatedFibers = new Set(); + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((actionQueue = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < actionQueue && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); + } + } else + try { + (currentTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, currentTransition); + } catch (error$3) { + onActionError(actionQueue, node, error$3); + } + } + function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? (returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } + ), + node.isTransition || + console.error( + "An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`" + )) + : onActionSuccess(actionQueue, node, returnValue); + } + function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); + } + function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugOwner = returnFiber), - (newChild._debugTask = returnFiber._debugTask), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - (newChild._debugInfo = currentDebugInfo), - newChild - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = createChild(returnFiber, newChild, lanes); - currentDebugInfo = _prevDebugInfo; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (lanes = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (returnFiber = pushDebugInfo(newChild._debugInfo)), - (lanes._debugInfo = currentDebugInfo), - (currentDebugInfo = returnFiber), - lanes - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = createChild( - returnFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? ((key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - newChild, - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) { - if (null !== key) return null; - key = pushDebugInfo(newChild._debugInfo); - returnFiber = updateFragment( - returnFiber, - oldFiber, - newChild, - lanes, - null - ); - currentDebugInfo = key; - return returnFiber; + actionQueue.action = null; + } + function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); + } + function actionStateReducer(oldState, newState) { + return newState; + } + function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var isMatching = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var markerInstance = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== markerInstance.nodeType; + + ) { + if (!inRootOrSingleton) { + markerInstance = null; + break b; + } + markerInstance = getNextHydratable( + markerInstance.nextSibling + ); + if (null === markerInstance) { + markerInstance = null; + break b; + } + } + inRootOrSingleton = markerInstance.data; + markerInstance = + inRootOrSingleton === FORM_STATE_IS_MATCHING || + inRootOrSingleton === FORM_STATE_IS_NOT_MATCHING + ? markerInstance + : null; + } + if (markerInstance) { + nextHydratableInstance = getNextHydratable( + markerInstance.nextSibling + ); + isMatching = markerInstance.data === FORM_STATE_IS_MATCHING; + break a; + } + } + throwOnHydrationMismatch(isMatching); + } + isMatching = !1; } - if ("function" === typeof newChild.then) - return ( - (key = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = key), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + isMatching && (initialStateProp = ssrFormState[0]); } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (newIdx = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateElement( - returnFiber, - newIdx, - newChild, - lanes - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); - newChild = callLazyInitInDEV(newChild); - returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - currentDebugInfo = _prevDebugInfo7; - return returnFiber; - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newIdx = existingChildren.get(newIdx) || null), - (existingChildren = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFragment( - returnFiber, - newIdx, - newChild, - lanes, - null - )), - (currentDebugInfo = existingChildren), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), - (returnFiber = updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = _prevDebugInfo7), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return null; - } - function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { - if ("object" !== typeof child || null === child) return knownKeys; - switch (child.$$typeof) { - case REACT_ELEMENT_TYPE: - case REACT_PORTAL_TYPE: - warnForMissingKey(returnFiber, workInProgress, child); - var key = child.key; - if ("string" !== typeof key) break; - if (null === knownKeys) { - knownKeys = new Set(); - knownKeys.add(key); - break; - } - if (!knownKeys.has(key)) { - knownKeys.add(key); - break; - } - runWithFiberInDEV(workInProgress, function () { - console.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/or omitted \u2014 the behavior is unsupported and could change in a future version.", - key - ); - }); - break; - case REACT_LAZY_TYPE: - (child = callLazyInitInDEV(child)), - warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + isMatching = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = isMatching; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + isMatching + ); + isMatching.dispatch = ssrFormState; + isMatching = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + isMatching.queue + ); + isMatching = mountWorkInProgressHook(); + markerInstance = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + isMatching.queue = markerInstance; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + markerInstance, + inRootOrSingleton, + ssrFormState + ); + markerInstance.dispatch = ssrFormState; + isMatching.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; + } + function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); + } + function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - return knownKeys; + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + HasEffect | Passive, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; + } + function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; + } + function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; + } + function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; + } + function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; + } + function mountRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + } + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + createEffectInstance(), + create, + deps + ); + } + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + HasEffect | hookFlags, + inst, + create, + deps + ))); + } + function mountEffect(create, deps) { + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (currentlyRenderingFiber.mode & NoStrictPassiveEffectsMode) === NoMode + ? mountEffectImpl(142608384, Passive, create, deps) + : mountEffectImpl(8390656, Passive, create, deps); + } + function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var knownKeys = null, - resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - newChildren[newIdx], - knownKeys + } + function mountEvent(callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + return ref.impl.apply(void 0, arguments); + }; + } + function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if ((executionContext & RenderContext) !== NoContext) + throw Error( + "A function wrapped in useEffectEvent can't be called during rendering." ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - newChildren[newIdx], - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - newChildren[newIdx], - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + return ref.impl.apply(void 0, arguments); + }; + } + function mountLayoutEffect(create, deps) { + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + return mountEffectImpl(fiberFlags, Layout, create, deps); + } + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - newChildren !== newChildrenIterable || - (0 === returnFiber.tag && - "[object AsyncGeneratorFunction]" === - Object.prototype.toString.call(returnFiber.type) && - "[object AsyncGenerator]" === - Object.prototype.toString.call(newChildren)) || - (didWarnAboutGenerators || + if (null !== ref && void 0 !== ref) + return ( + ref.hasOwnProperty("current") || console.error( - "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." + "Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.", + "an object with keys {" + Object.keys(ref).join(", ") + "}" ), - (didWarnAboutGenerators = !0)); - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); + } + function mountImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" + ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + var fiberFlags = 4194308; + (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode && + (fiberFlags |= 67108864); + mountEffectImpl( + fiberFlags, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function updateImperativeHandle(ref, create, deps) { + "function" !== typeof create && + console.error( + "Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.", + null !== create ? typeof create : "null" ); + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl( + 4, + Layout, + imperativeHandleEffect.bind(null, create, ref), + deps + ); + } + function mountCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + } + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; + } + function mountMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) - throw Error("An iterable object provided no iterator."); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - knownKeys = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - knownKeys = warnOnInvalidKey( - returnFiber, - newFiber, - step.value, - knownKeys - ); - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; + hook.memoizedState = [nextValue, deps]; + return nextValue; + } + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild + } + hook.memoizedState = [prevState, deps]; + return prevState; + } + function mountDeferredValue(value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + } + function updateDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + } + function rerenderDeferredValue(value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (oldFiber = createChild(returnFiber, step.value, lanes)), - null !== oldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - oldFiber, - step.value, - knownKeys - )), - (currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - step.value, - lanes - )), - null !== nextOldFiber && - ((knownKeys = warnOnInvalidKey( - returnFiber, - nextOldFiber, - step.value, - knownKeys - )), - shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + } + function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; + } + function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; + } + function startTransition( + fiber, + queue, + pendingState, + finishedState, + callback + ) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && previousPriority < ContinuousEventPriority + ? previousPriority + : ContinuousEventPriority; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); + currentTransition._updatedFibers = new Set(); + try { + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane(fiber) + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition), + null === prevTransition && + currentTransition._updatedFibers && + ((fiber = currentTransition._updatedFibers.size), + currentTransition._updatedFibers.clear(), + 10 < fiber && + console.warn( + "Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table." + )); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (validateFragmentProps(newChild, null, returnFiber), - (newChild = newChild.props.children)); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - var prevDebugInfo = pushDebugInfo(newChild._debugInfo); - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - validateFragmentProps(newChild, lanes, returnFiber); - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - isCompatibleFamilyForHotReloading( - currentFirstChild, - newChild - ) || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - callLazyInitInDEV(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - lanes._debugOwner = newChild._owner; - lanes._debugInfo = currentDebugInfo; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - validateFragmentProps(newChild, lanes, returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromElement( - newChild, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)); - } - returnFiber = placeSingleChild(returnFiber); - currentDebugInfo = prevDebugInfo; - return returnFiber; - case REACT_PORTAL_TYPE: - a: { - prevDebugInfo = newChild; - for ( - newChild = prevDebugInfo.key; - null !== currentFirstChild; - - ) { - if (currentFirstChild.key === newChild) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - prevDebugInfo.containerInfo && - currentFirstChild.stateNode.implementation === - prevDebugInfo.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - prevDebugInfo.children || [] - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal( - prevDebugInfo, - returnFiber.mode, - lanes - ); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (newChild = callLazyInitInDEV(newChild)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - } - if (isArrayImpl(newChild)) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (getIteratorFn(newChild)) { - prevDebugInfo = pushDebugInfo(newChild._debugInfo); - key = getIteratorFn(newChild); - if ("function" !== typeof key) - throw Error( - "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." - ); - var newChildren = key.call(newChild); - if (newChildren === newChild) { - if ( - 0 !== returnFiber.tag || - "[object GeneratorFunction]" !== - Object.prototype.toString.call(returnFiber.type) || - "[object Generator]" !== - Object.prototype.toString.call(newChildren) - ) - didWarnAboutGenerators || - console.error( - "Using Iterators 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. You can also use an Iterable that can iterate multiple times over the same items." - ), - (didWarnAboutGenerators = !0); - } else - newChild.entries !== key || - didWarnAboutMaps || - (console.error( - "Using Maps as children is not supported. Use an array of keyed ReactElements instead." - ), - (didWarnAboutMaps = !0)); - returnFiber = reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ); - currentDebugInfo = prevDebugInfo; - return returnFiber; - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChild, - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if ("function" === typeof newChild.then) - return ( - (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), - (returnFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - )), - (currentDebugInfo = prevDebugInfo), - returnFiber - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (prevDebugInfo = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ), - (lanes = useFiber(currentFirstChild, prevDebugInfo)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText( - prevDebugInfo, - returnFiber.mode, - lanes - )), - (lanes.return = returnFiber), - (lanes._debugOwner = returnFiber), - (lanes._debugTask = returnFiber._debugTask), - (lanes._debugInfo = currentDebugInfo), - (returnFiber = lanes)), - placeSingleChild(returnFiber) - ); - "function" === typeof newChild && - warnOnFunctionType(returnFiber, newChild); - "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); - return deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - var prevDebugInfo = currentDebugInfo; - currentDebugInfo = null; - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiber(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - var debugInfo = (fiber._debugInfo = currentDebugInfo); - fiber._debugOwner = returnFiber._debugOwner; - fiber._debugTask = returnFiber._debugTask; - if (null != debugInfo) - for (var i = debugInfo.length - 1; 0 <= i; i--) - if ("string" === typeof debugInfo[i].stack) { - fiber._debugOwner = debugInfo[i]; - fiber._debugTask = debugInfo[i].debugTask; - break; - } - return fiber; - } finally { - currentDebugInfo = prevDebugInfo; - } - }; } - function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push( - suspenseStackCursor, - suspenseStackCursor.current & SubtreeSuspenseContextMask, - handler + function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) + throw Error( + "Expected the form instance to be a HostComponent. This is a bug in React." + ); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + NotPendingTransition, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } ); - push(suspenseHandlerStackCursor, handler, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); } - function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current, fiber), - push(suspenseHandlerStackCursor, fiber, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); + function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: NotPendingTransition, + baseState: NotPendingTransition, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: NotPendingTransition + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; } - function reuseSuspenseHandlerOnStack(fiber) { - push(suspenseStackCursor, suspenseStackCursor.current, fiber); - push( - suspenseHandlerStackCursor, - suspenseHandlerStackCursor.current, - fiber + function requestFormReset$2(formFiber) { + null === ReactSharedInternals.T && + console.error( + "requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition." + ); + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal( + formFiber, + resetStateQueue, + {}, + requestUpdateLane(formFiber) ); } - function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor, fiber); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor, fiber); + function mountTransition() { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; } - function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - state.data === SUSPENSE_PENDING_START_DATA || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if ( - 19 === node.tag && - void 0 !== node.memoizedProps.revealOrder - ) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; + function updateTransition() { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; } - function warnOnInvalidCallback(callback) { - if (null !== callback && "function" !== typeof callback) { - var key = String(callback); - didWarnOnInvalidCallback.has(key) || - (didWarnOnInvalidCallback.add(key), - console.error( - "Expected the last optional `callback` argument to be a function. Instead received: %s.", - callback - )); - } + function rerenderTransition() { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; } - function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps - ) { - var prevState = workInProgress.memoizedState, - partialState = getDerivedStateFromProps(nextProps, prevState); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState = getDerivedStateFromProps(nextProps, prevState); - } finally { - setIsStrictModeForDevtools(!1); + function useHostTransitionStatus() { + return readContext(HostTransitionContext); + } + function mountId() { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var treeId = treeContextOverflow; + var idWithLeadingBit = treeContextId; + treeId = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + treeId; + identifierPrefix = ":" + identifierPrefix + "R" + treeId; + treeId = localIdCounter++; + 0 < treeId && (identifierPrefix += "H" + treeId.toString(32)); + identifierPrefix += ":"; + } else + (treeId = globalClientIdCounter++), + (identifierPrefix = + ":" + identifierPrefix + "r" + treeId.toString(32) + ":"); + return (hook.memoizedState = identifierPrefix); + } + function mountRefresh() { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + } + function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(provider); + fiber = createUpdate(lane); + var root = enqueueUpdate(provider, fiber, lane); + null !== root && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root, provider, lane), + entangleTransitions(root, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; } + provider = provider.return; } - void 0 === partialState && - ((ctor = getComponentNameFromType(ctor) || "Component"), - didWarnAboutUndefinedDerivedState.has(ctor) || - (didWarnAboutUndefinedDerivedState.add(ctor), - console.error( - "%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.", - ctor - ))); - prevState = - null === partialState || void 0 === partialState - ? prevState - : assign({}, prevState, partialState); - workInProgress.memoizedState = prevState; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = prevState); } - function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext - ) { - var instance = workInProgress.stateNode; - if ("function" === typeof instance.shouldComponentUpdate) { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext + function dispatchReducerAction(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.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()." ); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); + args = requestUpdateLane(fiber); + var update = { + lane: args, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, update) + : ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)), + null !== update && + (startUpdateTimerByLane(args), + scheduleUpdateOnFiber(update, fiber, args), + entangleTransitionUpdate(update, queue, args))); + } + function dispatchSetState(fiber, queue, action) { + var args = arguments; + "function" === typeof args[3] && + console.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()." + ); + args = requestUpdateLane(fiber); + dispatchSetStateInternal(fiber, queue, action, args) && + startUpdateTimerByLane(args); + } + function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) { + var prevDispatcher = ReactSharedInternals.H; + ReactSharedInternals.H = InvalidNestedHooksDispatcherOnUpdateInDEV; try { - oldProps = instance.shouldComponentUpdate( - newProps, - newState, - nextContext - ); + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) + return ( + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && + finishQueueingConcurrentUpdates(), + !1 + ); + } catch (error) { } finally { - setIsStrictModeForDevtools(!1); + ReactSharedInternals.H = prevDispatcher; } } - void 0 === oldProps && - console.error( - "%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.", - getComponentNameFromType(ctor) || "Component" + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 ); - return oldProps; } - return ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; + return !1; } - function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext + function dispatchOptimisticSetState( + fiber, + throwIfDuringRender, + queue, + action ) { - var oldState = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== oldState && - ((workInProgress = - getComponentNameFromFiber(workInProgress) || "Component"), - didWarnAboutStateAssignmentForComponent.has(workInProgress) || - (didWarnAboutStateAssignmentForComponent.add(workInProgress), - console.error( - "%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - workInProgress - )), - classComponentUpdater.enqueueReplaceState( - instance, - instance.state, - null - )); - } - function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var _propName in Component) - void 0 === newProps[_propName] && - (newProps[_propName] = Component[_propName]); - } - return newProps; - } - function defaultOnUncaughtError(error) { - reportGlobalError(error); - console.warn( - "%s\n\n%s\n", - componentName - ? "An error occurred in the <" + componentName + "> component." - : "An error occurred in one of your React components.", - "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." - ); - } - function defaultOnCaughtError(error) { - var componentNameMessage = componentName - ? "The above error occurred in the <" + componentName + "> component." - : "The above error occurred in one of your React components.", - recreateMessage = - "React will try to recreate this component tree from scratch using the error boundary you provided, " + - ((errorBoundaryName || "Anonymous") + "."); - if ( - "object" === typeof error && - null !== error && - "string" === typeof error.environmentName - ) { - var JSCompiler_inline_result = error.environmentName; - error = [ - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage - ].slice(0); - "string" === typeof error[0] - ? error.splice( - 0, - 1, - badgeFormat + error[0], - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ) - : error.splice( - 0, - 0, - badgeFormat, - badgeStyle, - pad + JSCompiler_inline_result + pad, - resetStyle - ); - error.unshift(console); - JSCompiler_inline_result = bind.apply(console.error, error); - JSCompiler_inline_result(); - } else + null === ReactSharedInternals.T && + 0 === currentEntangledLane && console.error( - "%o\n\n%s\n\n%s\n", - error, - componentNameMessage, - recreateMessage + "An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition." ); + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) + throw Error("Cannot update optimistic state while rendering."); + console.error("Cannot call startTransition while rendering."); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } - function defaultOnRecoverableError(error) { - reportGlobalError(error); + function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) + ); } - function logUncaughtError(root, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = null; - var error = errorInfo.value; - if (null !== ReactSharedInternals.actQueue) - ReactSharedInternals.thrownErrors.push(error); - else { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(error, { componentStack: errorInfo.stack }); - } - } catch (e$4) { - setTimeout(function () { - throw e$4; - }); - } + function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = + didScheduleRenderPhaseUpdate = !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } - function logCaughtError(root, boundary, errorInfo) { - try { - componentName = errorInfo.source - ? getComponentNameFromFiber(errorInfo.source) - : null; - errorBoundaryName = getComponentNameFromFiber(boundary); - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$5) { - setTimeout(function () { - throw e$5; - }); + function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } } - function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - lane.payload = { element: null }; - lane.callback = function () { - runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); - }; - return lane; - } - function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = CaptureUpdate; - return lane; + function pushDebugInfo(debugInfo) { + var previousDebugInfo = currentDebugInfo; + null != debugInfo && + (currentDebugInfo = + null === previousDebugInfo + ? debugInfo + : previousDebugInfo.concat(debugInfo)); + return previousDebugInfo; } - function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); + function validateFragmentProps(element, fiber, returnFiber) { + for (var keys = Object.keys(element.props), i = 0; i < keys.length; i++) { + var key = keys[i]; + if ("children" !== key && "key" !== key) { + null === fiber && + ((fiber = createFiberFromElement(element, returnFiber.mode, 0)), + (fiber._debugInfo = currentDebugInfo), + (fiber.return = returnFiber)); runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, fiber, - errorInfo + function (erroredKey) { + console.error( + "Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", + erroredKey + ); + }, + key ); - }; + break; + } } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - markFailedErrorBoundaryForHotReloading(fiber); - runWithFiberInDEV( - errorInfo.source, - logCaughtError, - root, - fiber, - errorInfo - ); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - callComponentDidCatchInDEV(this, errorInfo); - "function" === typeof getDerivedStateFromError || - (0 === (fiber.lanes & 2) && - console.error( - "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", - getComponentNameFromFiber(fiber) || "Unknown" - )); - }); } - function resetSuspendedComponent(sourceFiber, rootRenderLanes) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 + function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = createThenableState()); + return trackUsedThenable(thenableState, thenable, index); + } + function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; + } + function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error( + 'A React Element from an older version of React was rendered. This is not supported. It can happen if:\n- Multiple copies of the "react" package is used.\n- A library pre-bundled an old copy of "react" or "react/jsx-runtime".\n- A compiler tries to "inline" JSX instead of using the runtime.' ); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + "Objects are not valid as a React child (found: " + + ("[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber) + + "). If you meant to render a collection of children, use an array instead." + ); } - function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ) { - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; + function warnOnFunctionType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasFunctionTypeWarning[parentName] || + ((ownerHasFunctionTypeWarning[parentName] = !0), + (invalidChild = + invalidChild.displayName || invalidChild.name || "Component"), + 3 === returnFiber.tag + ? console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n root.render(%s)", + invalidChild, + invalidChild, + invalidChild + ) + : console.error( + "Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.\n <%s>{%s}", + invalidChild, + invalidChild, + parentName, + invalidChild, + parentName + )); } - function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes - ) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - (value.$$typeof === REACT_POSTPONE_TYPE && - (value = { then: function () {} }), - "function" === typeof value.then) - ) { - resetSuspendedComponent(sourceFiber, rootRenderLanes); - isHydrating && (didSuspendOrErrorDEV = !0); - var suspenseBoundary = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary) { - switch (suspenseBoundary.tag) { - case 13: - return ( - null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === suspenseBoundary.alternate && - workInProgressRootExitStatus === RootInProgress && - (workInProgressRootExitStatus = RootSuspended), - (suspenseBoundary.flags &= -257), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? (suspenseBoundary.updateQueue = new Set([value])) - : sourceFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: - return ( - (suspenseBoundary.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (suspenseBoundary.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - } - throw Error( - "Unexpected Suspense handler tag (" + - suspenseBoundary.tag + - "). This is a bug in React." - ); + function warnOnSymbolType(returnFiber, invalidChild) { + var parentName = getComponentNameFromFiber(returnFiber) || "Component"; + ownerHasSymbolTypeWarning[parentName] || + ((ownerHasSymbolTypeWarning[parentName] = !0), + (invalidChild = String(invalidChild)), + 3 === returnFiber.tag + ? console.error( + "Symbols are not valid as a React child.\n root.render(%s)", + invalidChild + ) + : console.error( + "Symbols are not valid as a React child.\n <%s>%s", + parentName, + invalidChild, + parentName + )); + } + function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), + (returnFiber.flags |= 16)) + : deletions.push(childToDelete); } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; } - if (isHydrating) - return ( - (didSuspendOrErrorDEV = !0), - (suspenseBoundary = suspenseHandlerStackCursor.current), - null !== suspenseBoundary - ? (0 === (suspenseBoundary.flags & 65536) && - (suspenseBoundary.flags |= 256), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", - { cause: value } - ), - sourceFiber - ) - )) - : (value !== HydrationMismatchException && - queueHydrationError( - createCapturedValueAtFiber( - Error( - "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored)), - !1 - ); - queueConcurrentError( - createCapturedValueAtFiber( - Error( - "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", - { cause: value } - ), - sourceFiber - ) - ); - workInProgressRootExitStatus !== RootSuspendedWithDelay && - (workInProgressRootExitStatus = RootErrored); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - value = returnFiber; - do { - switch (value.tag) { - case 3: - return ( - (value.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (value.lanes |= root), - (root = createRootErrorUpdate( - value.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(value, root), - !1 - ); - case 1: - if ( - ((returnFiber = value.type), - (suspenseBoundary = value.stateNode), - 0 === (value.flags & 128) && - ("function" === typeof returnFiber.getDerivedStateFromError || - (null !== suspenseBoundary && - "function" === typeof suspenseBoundary.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - suspenseBoundary - ))))) - ) - return ( - (value.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (value.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - value, - sourceFiber - ), - enqueueCapturedUpdate(value, rootRenderLanes), - !1 - ); - } - value = value.return; - } while (null !== value); - return !1; - } - function reconcileChildren( - current, - workInProgress, - nextChildren, - renderLanes - ) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); - } - function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes - ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; - } - function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) return ( - (Component = resolveFunctionForHotReloading(type)), - (workInProgress.tag = 15), - (workInProgress.type = Component), - validateFunctionComponentInDev(workInProgress, type), - updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); + newFiber.flags |= 33554434; + return lastPlacedIndex; } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if ( - Component(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - return bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText( + textContent, + returnFiber.mode, + lanes + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); + current = useFiber(current, textContent); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref && - workInProgress.type === current.type - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); - } - function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = - 0 !== - (workInProgress.stateNode._pendingVisibility & OffscreenDetached), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(workInProgress), - pushOffscreenSuspenseHandler(workInProgress); - else + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( + (current = updateFragment( + returnFiber, current, - workInProgress, - null !== prevState - ? prevState.baseLanes | renderLanes - : renderLanes, - renderLanes - ) + element.props.children, + lanes, + element.key + )), + validateFragmentProps(element, current, returnFiber), + current ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(workInProgress), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; - } - function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes - ) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { - parent: CacheContext._currentValue, - pool: JSCompiler_inline_result - }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result - }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(workInProgress); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; - } - function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error( - "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." + if ( + null !== current && + (current.elementType === elementType || + isCompatibleFamilyForHotReloading(current, element) || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + (current._debugOwner = element._owner), + (current._debugInfo = currentDebugInfo), + current ); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; + current = createFiberFromElement(element, returnFiber.mode, lanes); + coerceRef(current, element); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - } - function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ) { - if ( - Component.prototype && - "function" === typeof Component.prototype.render - ) { - var componentName = getComponentNameFromType(Component) || "Unknown"; - didWarnAboutBadClass[componentName] || - (console.error( - "The <%s /> 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 - ), - (didWarnAboutBadClass[componentName] = !0)); + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + (current._debugInfo = currentDebugInfo), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - null - ); - null === current && - (validateFunctionComponentInDev(workInProgress, workInProgress.type), - Component.contextTypes && - ((componentName = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypes[componentName] || - ((didWarnAboutContextTypes[componentName] = !0), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", - componentName - )))); - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes - ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; - } - function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes - ) { - prepareToReadContext(workInProgress); - hookTypesUpdateIndexDev = -1; - ignorePreviousDependencies = - null !== current && current.type !== workInProgress.type; - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current, workInProgress); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; - } - function updateClassComponent( - current$jscomp$0, - workInProgress, - Component, - nextProps, - renderLanes - ) { - switch (shouldErrorImpl(workInProgress)) { - case !1: - var _instance = workInProgress.stateNode, - state = new workInProgress.type( - workInProgress.memoizedProps, - _instance.context - ).state; - _instance.updater.enqueueSetState(_instance, state, null); - break; - case !0: - workInProgress.flags |= 128; - workInProgress.flags |= 65536; - _instance = Error("Simulated error coming from DevTools"); - var lane = renderLanes & -renderLanes; - workInProgress.lanes |= lane; - state = workInProgressRoot; - if (null === state) - throw Error( - "Expected a work-in-progress root. This is a bug in React. Please file an issue." - ); - lane = createClassErrorUpdate(lane); - initializeClassErrorUpdate( - lane, - state, - workInProgress, - createCapturedValueAtFiber(_instance, workInProgress) + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + (current._debugOwner = returnFiber), + (current._debugTask = returnFiber._debugTask), + (current._debugInfo = currentDebugInfo), + current ); - enqueueCapturedUpdate(workInProgress, lane); + current = useFiber(current, fragment); + current.return = returnFiber; + current._debugInfo = currentDebugInfo; + return current; } - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) { - state = emptyContextObject; - _instance = Component.contextType; - "contextType" in Component && - null !== _instance && - (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && - !didWarnAboutInvalidateContextType.has(Component) && - (didWarnAboutInvalidateContextType.add(Component), - (lane = - void 0 === _instance - ? " 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." - : "object" !== typeof _instance - ? " However, it is set to a " + typeof _instance + "." - : _instance.$$typeof === REACT_CONSUMER_TYPE - ? " Did you accidentally pass the Context.Consumer instead?" - : " However, it is set to an object with keys {" + - Object.keys(_instance).join(", ") + - "}."), - console.error( - "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", - getComponentNameFromType(Component) || "Component", - lane - )); - "object" === typeof _instance && - null !== _instance && - (state = readContext(_instance)); - _instance = new Component(nextProps, state); - if (workInProgress.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - _instance = new Component(nextProps, state); - } finally { - setIsStrictModeForDevtools(!1); - } - } - state = workInProgress.memoizedState = - null !== _instance.state && void 0 !== _instance.state - ? _instance.state - : null; - _instance.updater = classComponentUpdater; - workInProgress.stateNode = _instance; - _instance._reactInternals = workInProgress; - _instance._reactInternalInstance = fakeInternalInstance; - "function" === typeof Component.getDerivedStateFromProps && - null === state && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutUninitializedState.has(state) || - (didWarnAboutUninitializedState.add(state), - console.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.", - state, - null === _instance.state ? "null" : "undefined", - state - ))); + function createChild(returnFiber, newChild, lanes) { if ( - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate - ) { - var foundWillUpdateName = (lane = state = null); - "function" === typeof _instance.componentWillMount && - !0 !== _instance.componentWillMount.__suppressDeprecationWarning - ? (state = "componentWillMount") - : "function" === typeof _instance.UNSAFE_componentWillMount && - (state = "UNSAFE_componentWillMount"); - "function" === typeof _instance.componentWillReceiveProps && - !0 !== - _instance.componentWillReceiveProps.__suppressDeprecationWarning - ? (lane = "componentWillReceiveProps") - : "function" === - typeof _instance.UNSAFE_componentWillReceiveProps && - (lane = "UNSAFE_componentWillReceiveProps"); - "function" === typeof _instance.componentWillUpdate && - !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning - ? (foundWillUpdateName = "componentWillUpdate") - : "function" === typeof _instance.UNSAFE_componentWillUpdate && - (foundWillUpdateName = "UNSAFE_componentWillUpdate"); - if (null !== state || null !== lane || null !== foundWillUpdateName) { - _instance = getComponentNameFromType(Component) || "Component"; - var newApiName = - "function" === typeof Component.getDerivedStateFromProps - ? "getDerivedStateFromProps()" - : "getSnapshotBeforeUpdate()"; - didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || - (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), - console.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\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", - _instance, - newApiName, - null !== state ? "\n " + state : "", - null !== lane ? "\n " + lane : "", - null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" - )); + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugOwner = returnFiber), + (newChild._debugTask = returnFiber._debugTask), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + (newChild._debugInfo = currentDebugInfo), + newChild + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = createChild(returnFiber, newChild, lanes); + currentDebugInfo = _prevDebugInfo; + return returnFiber; } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (lanes = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (returnFiber = pushDebugInfo(newChild._debugInfo)), + (lanes._debugInfo = currentDebugInfo), + (currentDebugInfo = returnFiber), + lanes + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = createChild( + returnFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); } - _instance = workInProgress.stateNode; - state = getComponentNameFromType(Component) || "Component"; - _instance.render || - (Component.prototype && - "function" === typeof Component.prototype.render - ? console.error( - "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", - state - ) - : console.error( - "No `render` method found on the %s instance: you may have forgotten to define `render`.", - state - )); - !_instance.getInitialState || - _instance.getInitialState.isReactClassApproved || - _instance.state || - console.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?", - state - ); - _instance.getDefaultProps && - !_instance.getDefaultProps.isReactClassApproved && - console.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.", - state + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? ((key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + newChild, + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) { + if (null !== key) return null; + key = pushDebugInfo(newChild._debugInfo); + returnFiber = updateFragment( + returnFiber, + oldFiber, + newChild, + lanes, + null + ); + currentDebugInfo = key; + return returnFiber; + } + if ("function" === typeof newChild.then) + return ( + (key = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = key), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) ); - _instance.contextType && - console.error( - "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", - state + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (newIdx = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateElement( + returnFiber, + newIdx, + newChild, + lanes + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var _prevDebugInfo7 = pushDebugInfo(newChild._debugInfo); + newChild = callLazyInitInDEV(newChild); + returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + currentDebugInfo = _prevDebugInfo7; + return returnFiber; + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newIdx = existingChildren.get(newIdx) || null), + (existingChildren = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFragment( + returnFiber, + newIdx, + newChild, + lanes, + null + )), + (currentDebugInfo = existingChildren), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (_prevDebugInfo7 = pushDebugInfo(newChild._debugInfo)), + (returnFiber = updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = _prevDebugInfo7), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return null; + } + function warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys) { + if ("object" !== typeof child || null === child) return knownKeys; + switch (child.$$typeof) { + case REACT_ELEMENT_TYPE: + case REACT_PORTAL_TYPE: + warnForMissingKey(returnFiber, workInProgress, child); + var key = child.key; + if ("string" !== typeof key) break; + if (null === knownKeys) { + knownKeys = new Set(); + knownKeys.add(key); + break; + } + if (!knownKeys.has(key)) { + knownKeys.add(key); + break; + } + runWithFiberInDEV(workInProgress, function () { + console.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/or omitted \u2014 the behavior is unsupported and could change in a future version.", + key + ); + }); + break; + case REACT_LAZY_TYPE: + (child = callLazyInitInDEV(child)), + warnOnInvalidKey(returnFiber, workInProgress, child, knownKeys); + } + return knownKeys; + } + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var knownKeys = null, + resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes ); - Component.childContextTypes && - !didWarnAboutChildContextTypes.has(Component) && - (didWarnAboutChildContextTypes.add(Component), - console.error( - "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", - state - )); - Component.contextTypes && - !didWarnAboutContextTypes$1.has(Component) && - (didWarnAboutContextTypes$1.add(Component), - console.error( - "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", - state - )); - "function" === typeof _instance.componentShouldUpdate && - console.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.", - state - ); - Component.prototype && - Component.prototype.isPureReactComponent && - "undefined" !== typeof _instance.shouldComponentUpdate && - console.error( - "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", - getComponentNameFromType(Component) || "A pure component" - ); - "function" === typeof _instance.componentDidUnmount && - console.error( - "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", - state - ); - "function" === typeof _instance.componentDidReceiveProps && - console.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().", - state - ); - "function" === typeof _instance.componentWillRecieveProps && - console.error( - "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", - state - ); - "function" === typeof _instance.UNSAFE_componentWillRecieveProps && - console.error( - "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", - state - ); - lane = _instance.props !== nextProps; - void 0 !== _instance.props && - lane && - console.error( - "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", - state - ); - _instance.defaultProps && - console.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.", - state, - state - ); - "function" !== typeof _instance.getSnapshotBeforeUpdate || - "function" === typeof _instance.componentDidUpdate || - didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || - (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), - console.error( - "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", - getComponentNameFromType(Component) - )); - "function" === typeof _instance.getDerivedStateFromProps && - console.error( - "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state - ); - "function" === typeof _instance.getDerivedStateFromError && - console.error( - "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", - state - ); - "function" === typeof Component.getSnapshotBeforeUpdate && - console.error( - "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", - state + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + newChildren[newIdx], + knownKeys ); - (lane = _instance.state) && - ("object" !== typeof lane || isArrayImpl(lane)) && - console.error("%s.state: must be set to an object or null", state); - "function" === typeof _instance.getChildContext && - "object" !== typeof Component.childContextTypes && - console.error( - "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", - state + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - _instance = workInProgress.stateNode; - _instance.props = nextProps; - _instance.state = workInProgress.memoizedState; - _instance.refs = {}; - initializeUpdateQueue(workInProgress); - state = Component.contextType; - _instance.context = - "object" === typeof state && null !== state - ? readContext(state) - : emptyContextObject; - _instance.state === nextProps && - ((state = getComponentNameFromType(Component) || "Component"), - didWarnAboutDirectlyAssigningPropsToState.has(state) || - (didWarnAboutDirectlyAssigningPropsToState.add(state), + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + newChildren[newIdx], + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + newChildren[newIdx], + knownKeys + )), + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + newChildren !== newChildrenIterable || + (0 === returnFiber.tag && + "[object AsyncGeneratorFunction]" === + Object.prototype.toString.call(returnFiber.type) && + "[object AsyncGenerator]" === + Object.prototype.toString.call(newChildren)) || + (didWarnAboutGenerators || console.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.", - state - ))); - workInProgress.mode & StrictLegacyMode && - ReactStrictModeWarnings.recordLegacyContextWarning( - workInProgress, - _instance - ); - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( - workInProgress, - _instance - ); - _instance.state = workInProgress.memoizedState; - state = Component.getDerivedStateFromProps; - "function" === typeof state && - (applyDerivedStateFromProps( - workInProgress, - Component, - state, - nextProps - ), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof _instance.getSnapshotBeforeUpdate || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ((state = _instance.state), - "function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount(), - state !== _instance.state && - (console.error( - "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", - getComponentNameFromFiber(workInProgress) || "Component" + "Using AsyncIterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You can use an AsyncIterable that can iterate multiple times over the same items." ), - classComponentUpdater.enqueueReplaceState( - _instance, - _instance.state, - null - )), - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (_instance.state = workInProgress.memoizedState)); - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308); - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864); - _instance = !0; - } else if (null === current$jscomp$0) { - _instance = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps; - lane = resolveClassComponentProps(Component, unresolvedOldProps); - _instance.props = lane; - var oldContext = _instance.context; - foundWillUpdateName = Component.contextType; - state = emptyContextObject; - "object" === typeof foundWillUpdateName && - null !== foundWillUpdateName && - (state = readContext(foundWillUpdateName)); - newApiName = Component.getDerivedStateFromProps; - foundWillUpdateName = - "function" === typeof newApiName || - "function" === typeof _instance.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== state) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - state - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof newApiName && - (applyDerivedStateFromProps( - workInProgress, - Component, - newApiName, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (lane = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - lane, - nextProps, - oldState, - oldContext, - state - )) - ? (foundWillUpdateName || - ("function" !== typeof _instance.UNSAFE_componentWillMount && - "function" !== typeof _instance.componentWillMount) || - ("function" === typeof _instance.componentWillMount && - _instance.componentWillMount(), - "function" === typeof _instance.UNSAFE_componentWillMount && - _instance.UNSAFE_componentWillMount()), - "function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (_instance.props = nextProps), - (_instance.state = oldContext), - (_instance.context = state), - (_instance = lane)) - : ("function" === typeof _instance.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.mode & StrictEffectsMode) !== NoMode && - (workInProgress.flags |= 67108864), - (_instance = !1)); - } else { - _instance = workInProgress.stateNode; - cloneUpdateQueue(current$jscomp$0, workInProgress); - state = workInProgress.memoizedProps; - foundWillUpdateName = resolveClassComponentProps(Component, state); - _instance.props = foundWillUpdateName; - newApiName = workInProgress.pendingProps; - oldState = _instance.context; - oldContext = Component.contextType; - lane = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (lane = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof _instance.getSnapshotBeforeUpdate) || - ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && - "function" !== typeof _instance.componentWillReceiveProps) || - ((state !== newApiName || oldState !== lane) && - callComponentWillReceiveProps( - workInProgress, - _instance, - nextProps, - lane - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - _instance.state = oldState; - processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - state !== newApiName || - oldState !== newState || - hasForceUpdate || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (foundWillUpdateName = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - foundWillUpdateName, - nextProps, - oldState, - newState, - lane - ) || - (null !== current$jscomp$0 && - null !== current$jscomp$0.dependencies && - checkIfContextChanged(current$jscomp$0.dependencies))) - ? (oldContext || - ("function" !== typeof _instance.UNSAFE_componentWillUpdate && - "function" !== typeof _instance.componentWillUpdate) || - ("function" === typeof _instance.componentWillUpdate && - _instance.componentWillUpdate(nextProps, newState, lane), - "function" === typeof _instance.UNSAFE_componentWillUpdate && - _instance.UNSAFE_componentWillUpdate( - nextProps, - newState, - lane - )), - "function" === typeof _instance.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof _instance.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (_instance.props = nextProps), - (_instance.state = newState), - (_instance.context = lane), - (_instance = foundWillUpdateName)) - : ("function" !== typeof _instance.componentDidUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof _instance.getSnapshotBeforeUpdate || - (state === current$jscomp$0.memoizedProps && - oldState === current$jscomp$0.memoizedState) || - (workInProgress.flags |= 1024), - (_instance = !1)); + (didWarnAboutGenerators = !0)); + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); + } + }, + lanes + ); } - lane = _instance; - markRef(current$jscomp$0, workInProgress); - state = 0 !== (workInProgress.flags & 128); - if (lane || state) { - lane = workInProgress.stateNode; - ReactSharedInternals.getCurrentStack = - null === workInProgress ? null : getCurrentFiberStackInDev; - isRendering = !1; - current = workInProgress; - if (state && "function" !== typeof Component.getDerivedStateFromError) - (Component = null), (profilerStartTime = -1); - else if ( - ((Component = callRenderInDEV(lane)), - workInProgress.mode & StrictLegacyMode) + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) + throw Error("An iterable object provided no iterator."); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + knownKeys = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() ) { - setIsStrictModeForDevtools(!0); - try { - callRenderInDEV(lane); - } finally { - setIsStrictModeForDevtools(!1); + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } + knownKeys = warnOnInvalidKey( + returnFiber, + newFiber, + step.value, + knownKeys + ); + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - workInProgress.flags |= 1; - null !== current$jscomp$0 && state - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current$jscomp$0.child, - null, - renderLanes - )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren( - current$jscomp$0, - workInProgress, - Component, - renderLanes - ); - workInProgress.memoizedState = lane.state; - current$jscomp$0 = workInProgress.child; - } else - current$jscomp$0 = bailoutOnAlreadyFinishedWork( - current$jscomp$0, - workInProgress, - renderLanes - ); - renderLanes = workInProgress.stateNode; - _instance && - renderLanes.props !== nextProps && - (didWarnAboutReassigningProps || - console.error( - "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", - getComponentNameFromFiber(workInProgress) || "a component" - ), - (didWarnAboutReassigningProps = !0)); - return current$jscomp$0; - } - function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes - ) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; - } - function validateFunctionComponentInDev(workInProgress, Component) { - Component && - Component.childContextTypes && - console.error( - "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", - Component.displayName || Component.name || "Component" - ); - "function" === typeof Component.getDerivedStateFromProps && - ((workInProgress = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || - (console.error( - "%s: Function components do not support getDerivedStateFromProps.", - workInProgress - ), - (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = - !0))); - "object" === typeof Component.contextType && - null !== Component.contextType && - ((Component = getComponentNameFromType(Component) || "Unknown"), - didWarnAboutContextTypeOnFunctionComponent[Component] || - (console.error( - "%s: Function components do not support contextType.", - Component - ), - (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); - } - function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; - } - function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes - ) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; - } - function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2335; - var JSCompiler_object_inline_stack_2334 = workInProgress.pendingProps; - shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2332 = !1; - var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2335 = didSuspend) || - (JSCompiler_object_inline_componentStack_2335 = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2335 && - ((JSCompiler_object_inline_message_2332 = !0), - (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2335 = - 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - JSCompiler_object_inline_message_2332 - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var JSCompiler_object_inline_digest_2333 = nextHydratableInstance; - var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2333)) { - c: { - var instance = JSCompiler_object_inline_digest_2333; - for ( - JSCompiler_temp = rootOrSingletonContext; - 8 !== instance.nodeType; - - ) { - if (!JSCompiler_temp) { - JSCompiler_temp = null; - break c; - } - instance = getNextHydratable(instance.nextSibling); - if (null === instance) { - JSCompiler_temp = null; - break c; - } - } - JSCompiler_temp = instance; - } - null !== JSCompiler_temp - ? (warnIfNotHydrating(), - (workInProgress.memoizedState = { - dehydrated: JSCompiler_temp, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (instance = createFiber(18, null, null, NoMode)), - (instance.stateNode = JSCompiler_temp), - (instance.return = workInProgress), - (workInProgress.child = instance), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp = !0)) - : (JSCompiler_temp = !1); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && - (warnNonHydratedInstance( - workInProgress, - JSCompiler_object_inline_digest_2333 - ), - throwOnHydrationMismatch(workInProgress)); - } - JSCompiler_object_inline_digest_2333 = workInProgress.memoizedState; - if ( - null !== JSCompiler_object_inline_digest_2333 && - ((JSCompiler_object_inline_digest_2333 = - JSCompiler_object_inline_digest_2333.dehydrated), - null !== JSCompiler_object_inline_digest_2333) - ) - return ( - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2333) - ? (workInProgress.lanes = 16) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); - } - JSCompiler_object_inline_digest_2333 = - JSCompiler_object_inline_stack_2334.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2334.fallback; - if (JSCompiler_object_inline_message_2332) + if (step.done) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2334 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2333, - JSCompiler_temp, - renderLanes - )), - (JSCompiler_object_inline_message_2332 = workInProgress.child), - (JSCompiler_object_inline_message_2332.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2332.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2335, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2334 + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - if ( - "number" === - typeof JSCompiler_object_inline_stack_2334.unstable_expectedLoadTime + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (oldFiber = createChild(returnFiber, step.value, lanes)), + null !== oldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + oldFiber, + step.value, + knownKeys + )), + (currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() ) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2334 = - mountSuspenseFallbackChildren( - workInProgress, - JSCompiler_object_inline_digest_2333, - JSCompiler_temp, - renderLanes + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + step.value, + lanes + )), + null !== nextOldFiber && + ((knownKeys = warnOnInvalidKey( + returnFiber, + nextOldFiber, + step.value, + knownKeys )), - (JSCompiler_object_inline_message_2332 = workInProgress.child), - (JSCompiler_object_inline_message_2332.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2332.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2335, - renderLanes + shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2334 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_digest_2333 - ); + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - var prevState = current.memoizedState; - if ( - null !== prevState && - ((JSCompiler_object_inline_digest_2333 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2333) + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2332 = - JSCompiler_object_inline_stack_2334.fallback), - (JSCompiler_object_inline_digest_2333 = workInProgress.mode), - (JSCompiler_object_inline_stack_2334 = - mountWorkInProgressOffscreenFiber( - { - mode: "visible", - children: JSCompiler_object_inline_stack_2334.children - }, - JSCompiler_object_inline_digest_2333 - )), - (JSCompiler_object_inline_message_2332 = - createFiberFromFragment( - JSCompiler_object_inline_message_2332, - JSCompiler_object_inline_digest_2333, - renderLanes, - null - )), - (JSCompiler_object_inline_message_2332.flags |= 2), - (JSCompiler_object_inline_stack_2334.return = workInProgress), - (JSCompiler_object_inline_message_2332.return = workInProgress), - (JSCompiler_object_inline_stack_2334.sibling = - JSCompiler_object_inline_message_2332), - (workInProgress.child = JSCompiler_object_inline_stack_2334), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (JSCompiler_object_inline_stack_2334 = workInProgress.child), - (JSCompiler_object_inline_stack_2334.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2334.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2335, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2332)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isHydrating && - console.error( - "We should not be hydrating here. This is a bug in React. Please file a bug." - ), - isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2333)) - ) { - JSCompiler_object_inline_componentStack_2335 = - JSCompiler_object_inline_digest_2333.nextSibling && - JSCompiler_object_inline_digest_2333.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2335) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2335.dgst; - var message = JSCompiler_object_inline_componentStack_2335.msg; - instance = JSCompiler_object_inline_componentStack_2335.stck; - var componentStack = - JSCompiler_object_inline_componentStack_2335.cstck; - } - JSCompiler_object_inline_message_2332 = message; - JSCompiler_object_inline_digest_2333 = JSCompiler_temp; - JSCompiler_object_inline_stack_2334 = instance; - JSCompiler_temp = JSCompiler_object_inline_componentStack_2335 = - componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2333 && - ((JSCompiler_object_inline_componentStack_2335 = - JSCompiler_object_inline_message_2332 - ? Error(JSCompiler_object_inline_message_2332) - : Error( - "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." - )), - (JSCompiler_object_inline_componentStack_2335.stack = - JSCompiler_object_inline_stack_2334 || ""), - (JSCompiler_object_inline_componentStack_2335.digest = - JSCompiler_object_inline_digest_2333), - (JSCompiler_object_inline_stack_2334 = - void 0 === JSCompiler_temp ? null : JSCompiler_temp), - (JSCompiler_object_inline_message_2332 = { - value: JSCompiler_object_inline_componentStack_2335, - source: null, - stack: JSCompiler_object_inline_stack_2334 - }), - "string" === typeof JSCompiler_object_inline_stack_2334 && - CapturedStacks.set( - JSCompiler_object_inline_componentStack_2335, - JSCompiler_object_inline_message_2332 - ), - queueHydrationError(JSCompiler_object_inline_message_2332)); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (JSCompiler_object_inline_componentStack_2335 = - 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2335) - ) { - JSCompiler_object_inline_componentStack_2335 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2335) { - JSCompiler_object_inline_stack_2334 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2334 & 42)) - JSCompiler_object_inline_stack_2334 = 1; - else - switch (JSCompiler_object_inline_stack_2334) { - case 2: - JSCompiler_object_inline_stack_2334 = 1; - break; - case 8: - JSCompiler_object_inline_stack_2334 = 4; - break; - case 32: - JSCompiler_object_inline_stack_2334 = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - JSCompiler_object_inline_stack_2334 = 64; - break; - case 268435456: - JSCompiler_object_inline_stack_2334 = 134217728; - break; - default: - JSCompiler_object_inline_stack_2334 = 0; + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (validateFragmentProps(newChild, null, returnFiber), + (newChild = newChild.props.children)); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + var prevDebugInfo = pushDebugInfo(newChild._debugInfo); + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + validateFragmentProps(newChild, lanes, returnFiber); + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + isCompatibleFamilyForHotReloading( + currentFirstChild, + newChild + ) || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + callLazyInitInDEV(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + lanes._debugOwner = newChild._owner; + lanes._debugInfo = currentDebugInfo; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + validateFragmentProps(newChild, lanes, returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromElement( + newChild, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)); } - JSCompiler_object_inline_stack_2334 = - 0 !== - (JSCompiler_object_inline_stack_2334 & - (JSCompiler_object_inline_componentStack_2335.suspendedLanes | - renderLanes)) - ? 0 - : JSCompiler_object_inline_stack_2334; - if ( - 0 !== JSCompiler_object_inline_stack_2334 && - JSCompiler_object_inline_stack_2334 !== prevState.retryLane - ) - throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2334), - enqueueConcurrentRenderForLane( - current, - JSCompiler_object_inline_stack_2334 - ), - scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2335, - current, - JSCompiler_object_inline_stack_2334 - ), - SelectiveHydrationException) + returnFiber = placeSingleChild(returnFiber); + currentDebugInfo = prevDebugInfo; + return returnFiber; + case REACT_PORTAL_TYPE: + a: { + prevDebugInfo = newChild; + for ( + newChild = prevDebugInfo.key; + null !== currentFirstChild; + + ) { + if (currentFirstChild.key === newChild) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + prevDebugInfo.containerInfo && + currentFirstChild.stateNode.implementation === + prevDebugInfo.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + prevDebugInfo.children || [] + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal( + prevDebugInfo, + returnFiber.mode, + lanes + ); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (newChild = callLazyInitInDEV(newChild)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber ); } - JSCompiler_object_inline_digest_2333.data === - SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else - JSCompiler_object_inline_digest_2333.data === - SUSPENSE_PENDING_START_DATA - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((current = prevState.treeContext), - (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2333.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (didSuspendOrErrorDEV = !1), - (hydrationDiffRootDEV = null), - (rootOrSingletonContext = !1), - null !== current && - (warnIfNotHydrating(), - (idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - JSCompiler_object_inline_stack_2334.children + if (isArrayImpl(newChild)) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes )), - (workInProgress.flags |= 4096)); - return workInProgress; - } - if (JSCompiler_object_inline_message_2332) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2332 = - JSCompiler_object_inline_stack_2334.fallback), - (JSCompiler_object_inline_digest_2333 = workInProgress.mode), - (JSCompiler_temp = current.child), - (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2334 = createWorkInProgress( - JSCompiler_temp, - { - mode: "hidden", - children: JSCompiler_object_inline_stack_2334.children - } - )), - (JSCompiler_object_inline_stack_2334.subtreeFlags = - JSCompiler_temp.subtreeFlags & 31457280), - null !== instance - ? (JSCompiler_object_inline_message_2332 = createWorkInProgress( - instance, - JSCompiler_object_inline_message_2332 - )) - : ((JSCompiler_object_inline_message_2332 = createFiberFromFragment( - JSCompiler_object_inline_message_2332, - JSCompiler_object_inline_digest_2333, - renderLanes, - null + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (getIteratorFn(newChild)) { + prevDebugInfo = pushDebugInfo(newChild._debugInfo); + key = getIteratorFn(newChild); + if ("function" !== typeof key) + throw Error( + "An object is not an iterable. This error is likely caused by a bug in React. Please file an issue." + ); + var newChildren = key.call(newChild); + if (newChildren === newChild) { + if ( + 0 !== returnFiber.tag || + "[object GeneratorFunction]" !== + Object.prototype.toString.call(returnFiber.type) || + "[object Generator]" !== + Object.prototype.toString.call(newChildren) + ) + didWarnAboutGenerators || + console.error( + "Using Iterators 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. You can also use an Iterable that can iterate multiple times over the same items." + ), + (didWarnAboutGenerators = !0); + } else + newChild.entries !== key || + didWarnAboutMaps || + (console.error( + "Using Maps as children is not supported. Use an array of keyed ReactElements instead." + ), + (didWarnAboutMaps = !0)); + returnFiber = reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ); + currentDebugInfo = prevDebugInfo; + return returnFiber; + } + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes )), - (JSCompiler_object_inline_message_2332.flags |= 2)), - (JSCompiler_object_inline_message_2332.return = workInProgress), - (JSCompiler_object_inline_stack_2334.return = workInProgress), - (JSCompiler_object_inline_stack_2334.sibling = - JSCompiler_object_inline_message_2332), - (workInProgress.child = JSCompiler_object_inline_stack_2334), - (JSCompiler_object_inline_stack_2334 = - JSCompiler_object_inline_message_2332), - (JSCompiler_object_inline_message_2332 = workInProgress.child), - (JSCompiler_object_inline_digest_2333 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2333 - ? (JSCompiler_object_inline_digest_2333 = - mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2333.cachePool), - null !== JSCompiler_temp - ? ((instance = CacheContext._currentValue), - (JSCompiler_temp = - JSCompiler_temp.parent !== instance - ? { parent: instance, pool: instance } - : JSCompiler_temp)) - : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2333 = { - baseLanes: - JSCompiler_object_inline_digest_2333.baseLanes | renderLanes, - cachePool: JSCompiler_temp - })), - (JSCompiler_object_inline_message_2332.memoizedState = - JSCompiler_object_inline_digest_2333), - (JSCompiler_object_inline_message_2332.childLanes = - getRemainingWorkInPrimaryTree( - current, - JSCompiler_object_inline_componentStack_2335, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2334 - ); - pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: JSCompiler_object_inline_stack_2334.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; - null !== current && - ((JSCompiler_object_inline_componentStack_2335 = - workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2335 - ? ((workInProgress.deletions = [current]), - (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2335.push(current)); - workInProgress.child = renderLanes; - workInProgress.memoizedState = null; - return renderLanes; - } - function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if ("function" === typeof newChild.then) + return ( + (prevDebugInfo = pushDebugInfo(newChild._debugInfo)), + (returnFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + )), + (currentDebugInfo = prevDebugInfo), + returnFiber + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (prevDebugInfo = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ), + (lanes = useFiber(currentFirstChild, prevDebugInfo)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText( + prevDebugInfo, + returnFiber.mode, + lanes + )), + (lanes.return = returnFiber), + (lanes._debugOwner = returnFiber), + (lanes._debugTask = returnFiber._debugTask), + (lanes._debugInfo = currentDebugInfo), + (returnFiber = lanes)), + placeSingleChild(returnFiber) + ); + "function" === typeof newChild && + warnOnFunctionType(returnFiber, newChild); + "symbol" === typeof newChild && warnOnSymbolType(returnFiber, newChild); + return deleteRemainingChildren(returnFiber, currentFirstChild); + } + return function (returnFiber, currentFirstChild, newChild, lanes) { + var prevDebugInfo = currentDebugInfo; + currentDebugInfo = null; + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiber(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + var debugInfo = (fiber._debugInfo = currentDebugInfo); + fiber._debugOwner = returnFiber._debugOwner; + fiber._debugTask = returnFiber._debugTask; + if (null != debugInfo) + for (var i = debugInfo.length - 1; 0 <= i; i--) + if ("string" === typeof debugInfo[i].stack) { + fiber._debugOwner = debugInfo[i]; + fiber._debugTask = debugInfo[i].debugTask; + break; + } + return fiber; + } finally { + currentDebugInfo = prevDebugInfo; + } + }; } - function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes - ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null + function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push( + suspenseStackCursor, + suspenseStackCursor.current & SubtreeSuspenseContextMask, + handler ); - primaryChildren.return = workInProgress; - fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; - return fallbackChildren; + push(suspenseHandlerStackCursor, handler, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); } - function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); + function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current, fiber), + push(suspenseHandlerStackCursor, fiber, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); } - function retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children + function reuseSuspenseHandlerOnStack(fiber) { + push(suspenseStackCursor, suspenseStackCursor.current, fiber); + push( + suspenseHandlerStackCursor, + suspenseHandlerStackCursor.current, + fiber ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; } - function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - fiber.return, - renderLanes, - propagationRoot - ); + function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor, fiber); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor, fiber); } - function validateSuspenseListNestedChild(childSlot, index) { - var isAnArray = isArrayImpl(childSlot); - childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); - return isAnArray || childSlot - ? ((isAnArray = isAnArray ? "array" : "iterable"), - console.error( - "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", - isAnArray, - index, - isAnArray - ), - !1) - : !0; + function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + state.data === SUSPENSE_PENDING_START_DATA || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if ( + 19 === node.tag && + void 0 !== node.memoizedProps.revealOrder + ) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; } - function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode - ) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); + function defaultOnUncaughtError(error) { + reportGlobalError(error); + console.warn( + "%s\n\n%s\n", + componentName + ? "An error occurred in the <" + componentName + "> component." + : "An error occurred in one of your React components.", + "Consider adding an error boundary to your tree to customize error handling behavior.\nVisit https://react.dev/link/error-boundaries to learn more about error boundaries." + ); } - function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - nextProps = nextProps.children; + function defaultOnCaughtError(error) { + var componentNameMessage = componentName + ? "The above error occurred in the <" + componentName + "> component." + : "The above error occurred in one of your React components.", + recreateMessage = + "React will try to recreate this component tree from scratch using the error boundary you provided, " + + ((errorBoundaryName || "Anonymous") + "."); if ( - void 0 !== revealOrder && - "forwards" !== revealOrder && - "backwards" !== revealOrder && - "together" !== revealOrder && - !didWarnAboutRevealOrder[revealOrder] - ) - if ( - ((didWarnAboutRevealOrder[revealOrder] = !0), - "string" === typeof revealOrder) - ) - switch (revealOrder.toLowerCase()) { - case "together": - case "forwards": - case "backwards": - console.error( - '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - case "forward": - case "backward": - console.error( - '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', - revealOrder, - revealOrder.toLowerCase() - ); - break; - default: - console.error( - '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder - ); - } - else - console.error( - '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', - revealOrder + "object" === typeof error && + null !== error && + "string" === typeof error.environmentName + ) { + var JSCompiler_inline_result = error.environmentName; + error = [ + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ].slice(0); + "string" === typeof error[0] + ? error.splice( + 0, + 1, + badgeFormat + error[0], + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ) + : error.splice( + 0, + 0, + badgeFormat, + badgeStyle, + pad + JSCompiler_inline_result + pad, + resetStyle + ); + error.unshift(console); + JSCompiler_inline_result = bind.apply(console.error, error); + JSCompiler_inline_result(); + } else + console.error( + "%o\n\n%s\n\n%s\n", + error, + componentNameMessage, + recreateMessage + ); + } + function defaultOnRecoverableError(error) { + reportGlobalError(error); + } + function logUncaughtError(root, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = null; + var error = errorInfo.value; + if (null !== ReactSharedInternals.actQueue) + ReactSharedInternals.thrownErrors.push(error); + else { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(error, { componentStack: errorInfo.stack }); + } + } catch (e$4) { + setTimeout(function () { + throw e$4; + }); + } + } + function logCaughtError(root, boundary, errorInfo) { + try { + componentName = errorInfo.source + ? getComponentNameFromFiber(errorInfo.source) + : null; + errorBoundaryName = getComponentNameFromFiber(boundary); + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$5) { + setTimeout(function () { + throw e$5; + }); + } + } + function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + lane.payload = { element: null }; + lane.callback = function () { + runWithFiberInDEV(errorInfo.source, logUncaughtError, root, errorInfo); + }; + return lane; + } + function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = CaptureUpdate; + return lane; + } + function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - void 0 === tailMode || - didWarnAboutTailOptions[tailMode] || - ("collapsed" !== tailMode && "hidden" !== tailMode - ? ((didWarnAboutTailOptions[tailMode] = !0), - console.error( - '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', - tailMode - )) - : "forwards" !== revealOrder && - "backwards" !== revealOrder && - ((didWarnAboutTailOptions[tailMode] = !0), - console.error( - ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', - tailMode - ))); - a: if ( - ("forwards" === revealOrder || "backwards" === revealOrder) && - void 0 !== nextProps && - null !== nextProps && - !1 !== nextProps - ) - if (isArrayImpl(nextProps)) - for (var i = 0; i < nextProps.length; i++) { - if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; - } - else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { - if ((i = i.call(nextProps))) - for (var step = i.next(), _i = 0; !step.done; step = i.next()) { - if (!validateSuspenseListNestedChild(step.value, _i)) break a; - _i++; - } - } else - console.error( - 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', - revealOrder - ); - reconcileChildren(current, workInProgress, nextProps, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & ForceSuspenseFallback)) - (nextProps = - (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), - (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber( - current, - renderLanes, - workInProgress - ); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= SubtreeSuspenseContextMask; + }; } - push(suspenseStackCursor, nextProps, workInProgress); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), - (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), - (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + markFailedErrorBoundaryForHotReloading(fiber); + runWithFiberInDEV( + errorInfo.source, + logCaughtError, + root, + fiber, + errorInfo ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + callComponentDidCatchInDEV(this, errorInfo); + "function" === typeof getDerivedStateFromError || + (0 === (fiber.lanes & 2) && + console.error( + "%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.", + getComponentNameFromFiber(fiber) || "Unknown" + )); + }); } - function bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error("Resuming work not yet implemented."); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } - return workInProgress.child; + function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 + ); } - function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; + function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ) { + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } - function attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes + function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache - ); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + (value.$$typeof === REACT_POSTPONE_TYPE && + (value = { then: function () {} }), + "function" === typeof value.then) + ) { + resetSuspendedComponent(sourceFiber, rootRenderLanes); + isHydrating && (didSuspendOrErrorDEV = !0); + var suspenseBoundary = suspenseHandlerStackCursor.current; + if (null !== suspenseBoundary) { + switch (suspenseBoundary.tag) { + case 13: return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent( - current, - workInProgress, - renderLanes + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === suspenseBoundary.alternate && + workInProgressRootExitStatus === RootInProgress && + (workInProgressRootExitStatus = RootSuspended), + (suspenseBoundary.flags &= -257), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? (suspenseBoundary.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 ); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes + case 22: + return ( + (suspenseBoundary.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (suspenseBoundary.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 ); - workInProgress.flags |= 128; } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push( - suspenseStackCursor, - suspenseStackCursor.current, - workInProgress - ); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) - ); - case 24: - pushProvider( - workInProgress, - CacheContext, - current.memoizedState.cache + throw Error( + "Unexpected Suspense handler tag (" + + suspenseBoundary.tag + + "). This is a bug in React." ); - } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - function beginWork(current, workInProgress, renderLanes) { - if (workInProgress._debugNeedsRemount && null !== current) { - renderLanes = createFiberFromTypeAndProps( - workInProgress.type, - workInProgress.key, - workInProgress.pendingProps, - workInProgress._debugOwner || null, - workInProgress.mode, - workInProgress.lanes - ); - renderLanes._debugStack = workInProgress._debugStack; - renderLanes._debugTask = workInProgress._debugTask; - var returnFiber = workInProgress.return; - if (null === returnFiber) throw Error("Cannot swap the root fiber."); - current.alternate = null; - workInProgress.alternate = null; - renderLanes.index = workInProgress.index; - renderLanes.sibling = workInProgress.sibling; - renderLanes.return = workInProgress.return; - renderLanes.ref = workInProgress.ref; - renderLanes._debugInfo = workInProgress._debugInfo; - if (workInProgress === returnFiber.child) - returnFiber.child = renderLanes; - else { - var prevSibling = returnFiber.child; - if (null === prevSibling) - throw Error("Expected parent to have a child."); - for (; prevSibling.sibling !== workInProgress; ) - if (((prevSibling = prevSibling.sibling), null === prevSibling)) - throw Error("Expected to find the previous sibling."); - prevSibling.sibling = renderLanes; } - workInProgress = returnFiber.deletions; - null === workInProgress - ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) - : workInProgress.push(current); - renderLanes.flags |= 2; - return renderLanes; + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; } - if (null !== current) - if ( - current.memoizedProps !== workInProgress.pendingProps || - workInProgress.type !== current.type + if (isHydrating) + return ( + (didSuspendOrErrorDEV = !0), + (suspenseBoundary = suspenseHandlerStackCursor.current), + null !== suspenseBoundary + ? (0 === (suspenseBoundary.flags & 65536) && + (suspenseBoundary.flags |= 256), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.", + { cause: value } + ), + sourceFiber + ) + )) + : (value !== HydrationMismatchException && + queueHydrationError( + createCapturedValueAtFiber( + Error( + "There was an error while hydrating but React was able to recover by instead client rendering the entire root.", + { cause: value } + ), + sourceFiber + ) + ), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored)), + !1 + ); + queueConcurrentError( + createCapturedValueAtFiber( + Error( + "There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.", + { cause: value } + ), + sourceFiber ) - didReceiveUpdate = !0; - else { - if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) - ) + ); + workInProgressRootExitStatus !== RootSuspendedWithDelay && + (workInProgressRootExitStatus = RootErrored); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + value = returnFiber; + do { + switch (value.tag) { + case 3: return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) + (value.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (value.lanes |= root), + (root = createRootErrorUpdate( + value.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(value, root), + !1 ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else { - didReceiveUpdate = !1; - if ((returnFiber = isHydrating)) - warnIfNotHydrating(), - (returnFiber = 0 !== (workInProgress.flags & 1048576)); - returnFiber && - ((returnFiber = workInProgress.index), - warnIfNotHydrating(), - pushTreeId(workInProgress, treeForkCount, returnFiber)); - } - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: if ( - ((returnFiber = workInProgress.pendingProps), - (current = callLazyInitInDEV(workInProgress.elementType)), - (workInProgress.type = current), - "function" === typeof current) - ) - shouldConstruct(current) - ? ((returnFiber = resolveClassComponentProps( - current, - returnFiber - )), - (workInProgress.tag = 1), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateClassComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))) - : ((workInProgress.tag = 0), - validateFunctionComponentInDev(workInProgress, current), - (workInProgress.type = current = - resolveFunctionForHotReloading(current)), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ))); - else { - if (void 0 !== current && null !== current) - if ( - ((prevSibling = current.$$typeof), - prevSibling === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress.type = current = - resolveForwardRefForHotReloading(current); - workInProgress = updateForwardRef( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } else if (prevSibling === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - current, - returnFiber, - renderLanes - ); - break a; - } - workInProgress = ""; - null !== current && - "object" === typeof current && - current.$$typeof === REACT_LAZY_TYPE && - (workInProgress = - " Did you wrap a component in React.lazy() more than once?"); - current = getComponentNameFromType(current) || current; - throw Error( - "Element type is invalid. Received a promise that resolves to: " + - current + - ". Lazy element type must resolve to a class or function." + - workInProgress + case 1: + if ( + ((returnFiber = value.type), + (suspenseBoundary = value.stateNode), + 0 === (value.flags & 128) && + ("function" === typeof returnFiber.getDerivedStateFromError || + (null !== suspenseBoundary && + "function" === typeof suspenseBoundary.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + suspenseBoundary + ))))) + ) + return ( + (value.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (value.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + value, + sourceFiber + ), + enqueueCapturedUpdate(value, rootRenderLanes), + !1 + ); + } + value = value.return; + } while (null !== value); + return !1; + } + function reconcileChildren( + current, + workInProgress, + nextChildren, + renderLanes + ) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes ); - } - return workInProgress; - case 0: - return updateFunctionComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 1: + } + function updateForwardRef( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) return ( - (returnFiber = workInProgress.type), - (prevSibling = resolveClassComponentProps( - returnFiber, - workInProgress.pendingProps - )), - updateClassComponent( + (Component = resolveFunctionForHotReloading(type)), + (workInProgress.tag = 15), + (workInProgress.type = Component), + validateFunctionComponentInDev(workInProgress, type), + updateSimpleMemoComponent( current, workInProgress, - returnFiber, - prevSibling, + Component, + nextProps, renderLanes ) ); - case 3: - a: { - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if ( + Component(prevProps, nextProps) && + current.ref === workInProgress.ref + ) + return bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); + } + function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref && + workInProgress.type === current.type + ) + if ( + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) + ) + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) ); - if (null === current) - throw Error( - "Should have a current fiber. This is a bug in React." - ); - var nextProps = workInProgress.pendingProps; - prevSibling = workInProgress.memoizedState; - returnFiber = prevSibling.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (prevSibling.isDehydrated) - if ( - ((prevSibling = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = prevSibling), - (workInProgress.memoizedState = prevSibling), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== returnFiber) { - returnFiber = createCapturedValueAtFiber( - Error( - "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." - ), - workInProgress - ); - queueHydrationError(returnFiber); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - didSuspendOrErrorDEV = !1, - hydrationDiffRootDEV = null, - rootOrSingletonContext = !0, - current = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = current; - current; - - ) - (current.flags = (current.flags & -3) | 4096), - (current = current.sibling); - else { - resetHydrationState(); - if (nextProps === returnFiber) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren( - current, - workInProgress, - nextProps, - renderLanes - ); - } - workInProgress = workInProgress.child; - } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (current = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = current) - : isHydrating || - ((current = workInProgress.type), - (renderLanes = workInProgress.pendingProps), - (returnFiber = requiredContext( - rootInstanceStackCursor.current - )), - (returnFiber = - getOwnerDocumentFromRootContainer( - returnFiber - ).createElement(current)), - (returnFiber[internalInstanceKey] = workInProgress), - (returnFiber[internalPropsKey] = renderLanes), - setInitialProperties(returnFiber, current, renderLanes), - markNodeAsHoistable(returnFiber), - (workInProgress.stateNode = returnFiber)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); + } + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = + 0 !== + (workInProgress.stateNode._pendingVisibility & OffscreenDetached), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( + current, + workInProgress, + nextProps, + renderLanes ); - case 27: + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(workInProgress), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((prevSibling = requiredContext(rootInstanceStackCursor.current)), - (returnFiber = getHostContext()), - (prevSibling = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - prevSibling, - returnFiber, - !1 - )), - didSuspendOrErrorDEV || - ((returnFiber = diffHydratedProperties( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - returnFiber - )), - null !== returnFiber && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - returnFiber)), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - prevSibling.firstChild - ))), - (returnFiber = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( + current, + workInProgress, + null !== prevState + ? prevState.baseLanes | renderLanes + : renderLanes, + renderLanes + ) ); - case 5: - return ( - null === current && - isHydrating && - ((nextProps = getHostContext()), - (returnFiber = validateDOMNesting( - workInProgress.type, - nextProps.ancestorInfo - )), - (prevSibling = nextHydratableInstance), - (nextState = !prevSibling) || - ((nextState = canHydrateInstance( - prevSibling, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== nextState - ? ((workInProgress.stateNode = nextState), - didSuspendOrErrorDEV || - ((nextProps = diffHydratedProperties( - nextState, - workInProgress.type, - workInProgress.pendingProps, - nextProps - )), - null !== nextProps && - (buildHydrationDiffNode(workInProgress, 0).serverProps = - nextProps)), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - nextState.firstChild - )), - (rootOrSingletonContext = !1), - (nextProps = !0)) - : (nextProps = !1), - (nextState = !nextProps)), - nextState && - (returnFiber && - warnNonHydratedInstance(workInProgress, prevSibling), - throwOnHydrationMismatch(workInProgress))), - pushHostContext(workInProgress), - (prevSibling = workInProgress.type), - (nextProps = workInProgress.pendingProps), - (nextState = null !== current ? current.memoizedProps : null), - (returnFiber = nextProps.children), - shouldSetTextContent(prevSibling, nextProps) - ? (returnFiber = null) - : null !== nextState && - shouldSetTextContent(prevSibling, nextState) && - (workInProgress.flags |= 32), - null !== workInProgress.memoizedState && - ((prevSibling = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = prevSibling)), - markRef(current, workInProgress), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(workInProgress), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes + ) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { + parent: CacheContext._currentValue, + pool: JSCompiler_inline_result + }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(workInProgress); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; + } + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error( + "Expected ref to be a function, an object returned by React.createRef(), or undefined/null." ); - case 6: - return ( - null === current && - isHydrating && - ((current = workInProgress.pendingProps), - (renderLanes = getHostContext().ancestorInfo.current), - (current = - null != renderLanes - ? validateTextNesting(current, renderLanes.tag) - : !0), - (renderLanes = nextHydratableInstance), - (returnFiber = !renderLanes) || - ((returnFiber = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== returnFiber - ? ((workInProgress.stateNode = returnFiber), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (returnFiber = !0)) - : (returnFiber = !1), - (returnFiber = !returnFiber)), - returnFiber && - (current && - warnNonHydratedInstance(workInProgress, renderLanes), - throwOnHydrationMismatch(workInProgress))), - null + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } + } + function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ) { + if ( + Component.prototype && + "function" === typeof Component.prototype.render + ) { + var componentName = getComponentNameFromType(Component) || "Unknown"; + didWarnAboutBadClass[componentName] || + (console.error( + "The <%s /> 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 + ), + (didWarnAboutBadClass[componentName] = !0)); + } + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + null + ); + null === current && + (validateFunctionComponentInDev(workInProgress, workInProgress.type), + Component.contextTypes && + ((componentName = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypes[componentName] || + ((didWarnAboutContextTypes[componentName] = !0), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)", + componentName + )))); + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + void 0, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; + } + function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes + ) { + prepareToReadContext(workInProgress); + hookTypesUpdateIndexDev = -1; + ignorePreviousDependencies = + null !== current && current.type !== workInProgress.type; + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current, workInProgress); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + function updateClassComponent( + current$jscomp$0, + workInProgress, + Component, + nextProps, + renderLanes + ) { + switch (shouldErrorImpl(workInProgress)) { + case !1: + var _instance = workInProgress.stateNode, + state = new workInProgress.type( + workInProgress.memoizedProps, + _instance.context + ).state; + _instance.updater.enqueueSetState(_instance, state, null); + break; + case !0: + workInProgress.flags |= 128; + workInProgress.flags |= 65536; + _instance = Error("Simulated error coming from DevTools"); + var lane = renderLanes & -renderLanes; + workInProgress.lanes |= lane; + state = workInProgressRoot; + if (null === state) + throw Error( + "Expected a work-in-progress root. This is a bug in React. Please file an issue." + ); + lane = createClassErrorUpdate(lane); + initializeClassErrorUpdate( + lane, + state, + workInProgress, + createCapturedValueAtFiber(_instance, workInProgress) ); - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (returnFiber = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - returnFiber, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + enqueueCapturedUpdate(workInProgress, lane); + } + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + state = emptyContextObject; + _instance = Component.contextType; + "contextType" in Component && + null !== _instance && + (void 0 === _instance || _instance.$$typeof !== REACT_CONTEXT_TYPE) && + !didWarnAboutInvalidateContextType.has(Component) && + (didWarnAboutInvalidateContextType.add(Component), + (lane = + void 0 === _instance + ? " 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." + : "object" !== typeof _instance + ? " However, it is set to a " + typeof _instance + "." + : _instance.$$typeof === REACT_CONSUMER_TYPE + ? " Did you accidentally pass the Context.Consumer instead?" + : " However, it is set to an object with keys {" + + Object.keys(_instance).join(", ") + + "}."), + console.error( + "%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s", + getComponentNameFromType(Component) || "Component", + lane + )); + "object" === typeof _instance && + null !== _instance && + (state = readContext(_instance)); + _instance = new Component(nextProps, state); + if (workInProgress.mode & StrictLegacyMode) { + setIsStrictModeForDevtools(!0); + try { + _instance = new Component(nextProps, state); + } finally { + setIsStrictModeForDevtools(!1); + } + } + state = workInProgress.memoizedState = + null !== _instance.state && void 0 !== _instance.state + ? _instance.state + : null; + _instance.updater = classComponentUpdater; + workInProgress.stateNode = _instance; + _instance._reactInternals = workInProgress; + _instance._reactInternalInstance = fakeInternalInstance; + "function" === typeof Component.getDerivedStateFromProps && + null === state && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutUninitializedState.has(state) || + (didWarnAboutUninitializedState.add(state), + console.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.", + state, + null === _instance.state ? "null" : "undefined", + state + ))); + if ( + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate + ) { + var foundWillUpdateName = (lane = state = null); + "function" === typeof _instance.componentWillMount && + !0 !== _instance.componentWillMount.__suppressDeprecationWarning + ? (state = "componentWillMount") + : "function" === typeof _instance.UNSAFE_componentWillMount && + (state = "UNSAFE_componentWillMount"); + "function" === typeof _instance.componentWillReceiveProps && + !0 !== + _instance.componentWillReceiveProps.__suppressDeprecationWarning + ? (lane = "componentWillReceiveProps") + : "function" === + typeof _instance.UNSAFE_componentWillReceiveProps && + (lane = "UNSAFE_componentWillReceiveProps"); + "function" === typeof _instance.componentWillUpdate && + !0 !== _instance.componentWillUpdate.__suppressDeprecationWarning + ? (foundWillUpdateName = "componentWillUpdate") + : "function" === typeof _instance.UNSAFE_componentWillUpdate && + (foundWillUpdateName = "UNSAFE_componentWillUpdate"); + if (null !== state || null !== lane || null !== foundWillUpdateName) { + _instance = getComponentNameFromType(Component) || "Component"; + var newApiName = + "function" === typeof Component.getDerivedStateFromProps + ? "getDerivedStateFromProps()" + : "getSnapshotBeforeUpdate()"; + didWarnAboutLegacyLifecyclesAndDerivedState.has(_instance) || + (didWarnAboutLegacyLifecyclesAndDerivedState.add(_instance), + console.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\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://react.dev/link/unsafe-component-lifecycles", + _instance, + newApiName, + null !== state ? "\n " + state : "", + null !== lane ? "\n " + lane : "", + null !== foundWillUpdateName ? "\n " + foundWillUpdateName : "" + )); + } + } + _instance = workInProgress.stateNode; + state = getComponentNameFromType(Component) || "Component"; + _instance.render || + (Component.prototype && + "function" === typeof Component.prototype.render + ? console.error( + "No `render` method found on the %s instance: did you accidentally return an object from the constructor?", + state + ) + : console.error( + "No `render` method found on the %s instance: you may have forgotten to define `render`.", + state + )); + !_instance.getInitialState || + _instance.getInitialState.isReactClassApproved || + _instance.state || + console.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?", + state ); - case 11: - return updateForwardRef( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + _instance.getDefaultProps && + !_instance.getDefaultProps.isReactClassApproved && + console.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.", + state ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child + _instance.contextType && + console.error( + "contextType was defined as an instance property on %s. Use a static property to define contextType instead.", + state ); - case 8: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + Component.childContextTypes && + !didWarnAboutChildContextTypes.has(Component) && + (didWarnAboutChildContextTypes.add(Component), + console.error( + "%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)", + state + )); + Component.contextTypes && + !didWarnAboutContextTypes$1.has(Component) && + (didWarnAboutContextTypes$1.add(Component), + console.error( + "%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)", + state + )); + "function" === typeof _instance.componentShouldUpdate && + console.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.", + state ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (returnFiber = workInProgress.stateNode), - (returnFiber.effectDuration = -0), - (returnFiber.passiveEffectDuration = -0), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + Component.prototype && + Component.prototype.isPureReactComponent && + "undefined" !== typeof _instance.shouldComponentUpdate && + console.error( + "%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.", + getComponentNameFromType(Component) || "A pure component" ); - case 10: - return ( - (returnFiber = workInProgress.type), - (prevSibling = workInProgress.pendingProps), - (nextProps = prevSibling.value), - "value" in prevSibling || - hasWarnedAboutUsingNoValuePropOnContextProvider || - ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), - console.error( - "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" - )), - pushProvider(workInProgress, returnFiber, nextProps), - reconcileChildren( - current, - workInProgress, - prevSibling.children, - renderLanes - ), - workInProgress.child + "function" === typeof _instance.componentDidUnmount && + console.error( + "%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?", + state ); - case 9: - return ( - (prevSibling = workInProgress.type._context), - (returnFiber = workInProgress.pendingProps.children), - "function" !== typeof returnFiber && - console.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." - ), - prepareToReadContext(workInProgress), - (prevSibling = readContext(prevSibling)), - (returnFiber = callComponentInDEV( - returnFiber, - prevSibling, - void 0 - )), - (workInProgress.flags |= 1), - reconcileChildren( - current, - workInProgress, - returnFiber, - renderLanes - ), - workInProgress.child + "function" === typeof _instance.componentDidReceiveProps && + console.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().", + state ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + "function" === typeof _instance.componentWillRecieveProps && + console.error( + "%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?", + state ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes + "function" === typeof _instance.UNSAFE_componentWillRecieveProps && + console.error( + "%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?", + state ); - case 19: - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes + lane = _instance.props !== nextProps; + void 0 !== _instance.props && + lane && + console.error( + "When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.", + state ); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (returnFiber = readContext(CacheContext)), - null === current - ? ((prevSibling = peekCacheFromPool()), - null === prevSibling && - ((prevSibling = workInProgressRoot), - (nextProps = createCache()), - (prevSibling.pooledCache = nextProps), - retainCache(nextProps), - null !== nextProps && - (prevSibling.pooledCacheLanes |= renderLanes), - (prevSibling = nextProps)), - (workInProgress.memoizedState = { - parent: returnFiber, - cache: prevSibling - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, prevSibling)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (prevSibling = current.memoizedState), - (nextProps = workInProgress.memoizedState), - prevSibling.parent !== returnFiber - ? ((prevSibling = { - parent: returnFiber, - cache: returnFiber - }), - (workInProgress.memoizedState = prevSibling), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - prevSibling), - pushProvider(workInProgress, CacheContext, returnFiber)) - : ((returnFiber = nextProps.cache), - pushProvider(workInProgress, CacheContext, returnFiber), - returnFiber !== prevSibling.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps.children, - renderLanes - ), - workInProgress.child + _instance.defaultProps && + console.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.", + state, + state ); - case 29: - throw workInProgress.pendingProps; - } - throw Error( - "Unknown unit of work tag (" + - workInProgress.tag + - "). This error is likely caused by a bug in React. Please file an issue." - ); - } - function resetContextDependencies() { - lastContextDependency = currentlyRenderingFiber = null; - isDisallowedContextReadInDEV = !1; - } - function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue, providerFiber); - context._currentValue = nextValue; - push(rendererCursorDEV, context._currentRenderer, providerFiber); - void 0 !== context._currentRenderer && - null !== context._currentRenderer && - context._currentRenderer !== rendererSigil && - console.error( - "Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported." - ); - context._currentRenderer = rendererSigil; - } - function popProvider(context, providerFiber) { - context._currentValue = valueCursor.current; - var currentRenderer = rendererCursorDEV.current; - pop(rendererCursorDEV, providerFiber); - context._currentRenderer = currentRenderer; - pop(valueCursor, providerFiber); - } - function scheduleContextWorkOnParentPath( - parent, - renderLanes, - propagationRoot - ) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } - parent !== propagationRoot && - console.error( - "Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue." - ); - } - function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree - ) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) - throw Error( - "We just came from a parent so we must have had a parent. This is a bug in React." - ); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - nextFiber, - renderLanes, - workInProgress + "function" !== typeof _instance.getSnapshotBeforeUpdate || + "function" === typeof _instance.componentDidUpdate || + didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(Component) || + (didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(Component), + console.error( + "%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.", + getComponentNameFromType(Component) + )); + "function" === typeof _instance.getDerivedStateFromProps && + console.error( + "%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state ); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } - } - function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree - ) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current - ? current.push(context) - : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) - throw Error("Should have a current fiber. This is a bug in React."); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; - } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; - } - function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - - ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue - ) - ) - return !0; - currentDependencies = currentDependencies.next; - } - return !1; - } - function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); - } - function readContext(context) { - isDisallowedContextReadInDEV && - console.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()." - ); - return readContextForConsumer(currentlyRenderingFiber, context); - } - function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); - } - function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) - 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()." + "function" === typeof _instance.getDerivedStateFromError && + console.error( + "%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.", + state ); - lastContextDependency = context; - consumer.dependencies = { - lanes: 0, - firstContext: context, - _debugThenableState: null - }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; - } - function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; - } - function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); - } - function createUpdate(lane) { - return { - lane: lane, - tag: UpdateState, - payload: null, - callback: null, - next: null - }; - } - function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if ( - currentlyProcessingQueue === updateQueue && - !didWarnUpdateInsideUpdate - ) { - var componentName = getComponentNameFromFiber(fiber); - console.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\nPlease update the following component: %s", - componentName - ); - didWarnUpdateInsideUpdate = !0; - } - if ((executionContext & RenderContext) !== NoContext) - return ( - (componentName = updateQueue.pending), - null === componentName - ? (update.next = update) - : ((update.next = componentName.next), - (componentName.next = update)), - (updateQueue.pending = update), - (update = getRootForUpdatedFiber(fiber)), - markUpdateLaneFromFiberToRoot(fiber, null, lane), - update + "function" === typeof Component.getSnapshotBeforeUpdate && + console.error( + "%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.", + state + ); + (lane = _instance.state) && + ("object" !== typeof lane || isArrayImpl(lane)) && + console.error("%s.state: must be set to an object or null", state); + "function" === typeof _instance.getChildContext && + "object" !== typeof Component.childContextTypes && + console.error( + "%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().", + state + ); + _instance = workInProgress.stateNode; + _instance.props = nextProps; + _instance.state = workInProgress.memoizedState; + _instance.refs = {}; + initializeUpdateQueue(workInProgress); + state = Component.contextType; + _instance.context = + "object" === typeof state && null !== state + ? readContext(state) + : emptyContextObject; + _instance.state === nextProps && + ((state = getComponentNameFromType(Component) || "Component"), + didWarnAboutDirectlyAssigningPropsToState.has(state) || + (didWarnAboutDirectlyAssigningPropsToState.add(state), + console.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.", + state + ))); + workInProgress.mode & StrictLegacyMode && + ReactStrictModeWarnings.recordLegacyContextWarning( + workInProgress, + _instance + ); + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings( + workInProgress, + _instance ); - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); - } - function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); - } - } - function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; - } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; - } - function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } - } - function processUpdateQueue( - workInProgress, - props, - instance$jscomp$0, - renderLanes - ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress.updateQueue; - hasForceUpdate = !1; - currentlyProcessingQueue = queue.shared; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); - } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; - if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - updateLane = workInProgress; - var partialState = pendingQueue; - var nextProps = props, - instance = instance$jscomp$0; - switch (partialState.tag) { - case ReplaceState: - partialState = partialState.payload; - if ("function" === typeof partialState) { - isDisallowedContextReadInDEV = !0; - var nextState = partialState.call( - instance, - newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - partialState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - newState = nextState; - break a; - } - newState = partialState; - break a; - case CaptureUpdate: - updateLane.flags = (updateLane.flags & -65537) | 128; - case UpdateState: - nextState = partialState.payload; - if ("function" === typeof nextState) { - isDisallowedContextReadInDEV = !0; - partialState = nextState.call( - instance, + _instance.state = workInProgress.memoizedState; + state = Component.getDerivedStateFromProps; + "function" === typeof state && + (applyDerivedStateFromProps( + workInProgress, + Component, + state, + nextProps + ), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof _instance.getSnapshotBeforeUpdate || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ((state = _instance.state), + "function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount(), + state !== _instance.state && + (console.error( + "%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.", + getComponentNameFromFiber(workInProgress) || "Component" + ), + classComponentUpdater.enqueueReplaceState( + _instance, + _instance.state, + null + )), + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (_instance.state = workInProgress.memoizedState)); + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308); + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864); + _instance = !0; + } else if (null === current$jscomp$0) { + _instance = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps; + lane = resolveClassComponentProps(Component, unresolvedOldProps); + _instance.props = lane; + var oldContext = _instance.context; + foundWillUpdateName = Component.contextType; + state = emptyContextObject; + "object" === typeof foundWillUpdateName && + null !== foundWillUpdateName && + (state = readContext(foundWillUpdateName)); + newApiName = Component.getDerivedStateFromProps; + foundWillUpdateName = + "function" === typeof newApiName || + "function" === typeof _instance.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== state) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + state + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof newApiName && + (applyDerivedStateFromProps( + workInProgress, + Component, + newApiName, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (lane = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + lane, + nextProps, + oldState, + oldContext, + state + )) + ? (foundWillUpdateName || + ("function" !== typeof _instance.UNSAFE_componentWillMount && + "function" !== typeof _instance.componentWillMount) || + ("function" === typeof _instance.componentWillMount && + _instance.componentWillMount(), + "function" === typeof _instance.UNSAFE_componentWillMount && + _instance.UNSAFE_componentWillMount()), + "function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (_instance.props = nextProps), + (_instance.state = oldContext), + (_instance.context = state), + (_instance = lane)) + : ("function" === typeof _instance.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.mode & StrictEffectsMode) !== NoMode && + (workInProgress.flags |= 67108864), + (_instance = !1)); + } else { + _instance = workInProgress.stateNode; + cloneUpdateQueue(current$jscomp$0, workInProgress); + state = workInProgress.memoizedProps; + foundWillUpdateName = resolveClassComponentProps(Component, state); + _instance.props = foundWillUpdateName; + newApiName = workInProgress.pendingProps; + oldState = _instance.context; + oldContext = Component.contextType; + lane = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (lane = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof _instance.getSnapshotBeforeUpdate) || + ("function" !== typeof _instance.UNSAFE_componentWillReceiveProps && + "function" !== typeof _instance.componentWillReceiveProps) || + ((state !== newApiName || oldState !== lane) && + callComponentWillReceiveProps( + workInProgress, + _instance, + nextProps, + lane + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + _instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, _instance, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + state !== newApiName || + oldState !== newState || + hasForceUpdate || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (foundWillUpdateName = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + foundWillUpdateName, + nextProps, + oldState, + newState, + lane + ) || + (null !== current$jscomp$0 && + null !== current$jscomp$0.dependencies && + checkIfContextChanged(current$jscomp$0.dependencies))) + ? (oldContext || + ("function" !== typeof _instance.UNSAFE_componentWillUpdate && + "function" !== typeof _instance.componentWillUpdate) || + ("function" === typeof _instance.componentWillUpdate && + _instance.componentWillUpdate(nextProps, newState, lane), + "function" === typeof _instance.UNSAFE_componentWillUpdate && + _instance.UNSAFE_componentWillUpdate( + nextProps, newState, - nextProps - ); - if (updateLane.mode & StrictLegacyMode) { - setIsStrictModeForDevtools(!0); - try { - nextState.call(instance, newState, nextProps); - } finally { - setIsStrictModeForDevtools(!1); - } - } - isDisallowedContextReadInDEV = !1; - } else partialState = nextState; - if (null === partialState || void 0 === partialState) break a; - newState = assign({}, newState, partialState); - break a; - case ForceUpdate: - hasForceUpdate = !0; - } - } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress.flags |= 64), - isHiddenUpdate && (workInProgress.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null + lane + )), + "function" === typeof _instance.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof _instance.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (_instance.props = nextProps), + (_instance.state = newState), + (_instance.context = lane), + (_instance = foundWillUpdateName)) + : ("function" !== typeof _instance.componentDidUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof _instance.getSnapshotBeforeUpdate || + (state === current$jscomp$0.memoizedProps && + oldState === current$jscomp$0.memoizedState) || + (workInProgress.flags |= 1024), + (_instance = !1)); + } + lane = _instance; + markRef(current$jscomp$0, workInProgress); + state = 0 !== (workInProgress.flags & 128); + if (lane || state) { + lane = workInProgress.stateNode; + ReactSharedInternals.getCurrentStack = + null === workInProgress ? null : getCurrentFiberStackInDev; + isRendering = !1; + current = workInProgress; + if (state && "function" !== typeof Component.getDerivedStateFromError) + (Component = null), (profilerStartTime = -1); + else if ( + ((Component = callRenderInDEV(lane)), + workInProgress.mode & StrictLegacyMode) + ) { + setIsStrictModeForDevtools(!0); + try { + callRenderInDEV(lane); + } finally { + setIsStrictModeForDevtools(!1); + } + } + workInProgress.flags |= 1; + null !== current$jscomp$0 && state + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current$jscomp$0.child, + null, + renderLanes + )), + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren( + current$jscomp$0, + workInProgress, + Component, + renderLanes + ); + workInProgress.memoizedState = lane.state; + current$jscomp$0 = workInProgress.child; + } else + current$jscomp$0 = bailoutOnAlreadyFinishedWork( + current$jscomp$0, + workInProgress, + renderLanes + ); + renderLanes = workInProgress.stateNode; + _instance && + renderLanes.props !== nextProps && + (didWarnAboutReassigningProps || + console.error( + "It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.", + getComponentNameFromFiber(workInProgress) || "a component" + ), + (didWarnAboutReassigningProps = !0)); + return current$jscomp$0; + } + function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes + ) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + function validateFunctionComponentInDev(workInProgress, Component) { + Component && + Component.childContextTypes && + console.error( + "childContextTypes cannot be defined on a function component.\n %s.childContextTypes = ...", + Component.displayName || Component.name || "Component" + ); + "function" === typeof Component.getDerivedStateFromProps && + ((workInProgress = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] || + (console.error( + "%s: Function components do not support getDerivedStateFromProps.", + workInProgress + ), + (didWarnAboutGetDerivedStateOnFunctionComponent[workInProgress] = + !0))); + "object" === typeof Component.contextType && + null !== Component.contextType && + ((Component = getComponentNameFromType(Component) || "Unknown"), + didWarnAboutContextTypeOnFunctionComponent[Component] || + (console.error( + "%s: Function components do not support contextType.", + Component + ), + (didWarnAboutContextTypeOnFunctionComponent[Component] = !0))); + } + function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; + } + function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes + ) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; + } + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var JSCompiler_object_inline_componentStack_2456; + var JSCompiler_object_inline_stack_2455 = workInProgress.pendingProps; + shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); + var JSCompiler_object_inline_message_2453 = !1; + var didSuspend = 0 !== (workInProgress.flags & 128); + (JSCompiler_object_inline_componentStack_2456 = didSuspend) || + (JSCompiler_object_inline_componentStack_2456 = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); + JSCompiler_object_inline_componentStack_2456 && + ((JSCompiler_object_inline_message_2453 = !0), + (workInProgress.flags &= -129)); + JSCompiler_object_inline_componentStack_2456 = + 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + JSCompiler_object_inline_message_2453 + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var JSCompiler_object_inline_digest_2454 = nextHydratableInstance; + var JSCompiler_temp; + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2454)) { + c: { + var instance = JSCompiler_object_inline_digest_2454; + for ( + JSCompiler_temp = rootOrSingletonContext; + 8 !== instance.nodeType; + + ) { + if (!JSCompiler_temp) { + JSCompiler_temp = null; + break c; + } + instance = getNextHydratable(instance.nextSibling); + if (null === instance) { + JSCompiler_temp = null; + break c; + } + } + JSCompiler_temp = instance; + } + null !== JSCompiler_temp + ? (warnIfNotHydrating(), + (workInProgress.memoizedState = { + dehydrated: JSCompiler_temp, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (instance = createFiber(18, null, null, NoMode)), + (instance.stateNode = JSCompiler_temp), + (instance.return = workInProgress), + (workInProgress.child = instance), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp = !0)) + : (JSCompiler_temp = !1); + JSCompiler_temp = !JSCompiler_temp; + } + JSCompiler_temp && + (warnNonHydratedInstance( + workInProgress, + JSCompiler_object_inline_digest_2454 + ), + throwOnHydrationMismatch(workInProgress)); + } + JSCompiler_object_inline_digest_2454 = workInProgress.memoizedState; + if ( + null !== JSCompiler_object_inline_digest_2454 && + ((JSCompiler_object_inline_digest_2454 = + JSCompiler_object_inline_digest_2454.dehydrated), + null !== JSCompiler_object_inline_digest_2454) + ) + return ( + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2454) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + JSCompiler_object_inline_digest_2454 = + JSCompiler_object_inline_stack_2455.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2455.fallback; + if (JSCompiler_object_inline_message_2453) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2455 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2454, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_message_2453 = workInProgress.child), + (JSCompiler_object_inline_message_2453.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2453.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2456, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2455 + ); + if ( + "number" === + typeof JSCompiler_object_inline_stack_2455.unstable_expectedLoadTime + ) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_stack_2455 = + mountSuspenseFallbackChildren( + workInProgress, + JSCompiler_object_inline_digest_2454, + JSCompiler_temp, + renderLanes + )), + (JSCompiler_object_inline_message_2453 = workInProgress.child), + (JSCompiler_object_inline_message_2453.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_message_2453.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2456, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + JSCompiler_object_inline_stack_2455 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_digest_2454 + ); + } + var prevState = current.memoizedState; + if ( + null !== prevState && + ((JSCompiler_object_inline_digest_2454 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2454) + ) { + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2453 = + JSCompiler_object_inline_stack_2455.fallback), + (JSCompiler_object_inline_digest_2454 = workInProgress.mode), + (JSCompiler_object_inline_stack_2455 = + mountWorkInProgressOffscreenFiber( + { + mode: "visible", + children: JSCompiler_object_inline_stack_2455.children + }, + JSCompiler_object_inline_digest_2454 + )), + (JSCompiler_object_inline_message_2453 = + createFiberFromFragment( + JSCompiler_object_inline_message_2453, + JSCompiler_object_inline_digest_2454, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2453.flags |= 2), + (JSCompiler_object_inline_stack_2455.return = workInProgress), + (JSCompiler_object_inline_message_2453.return = workInProgress), + (JSCompiler_object_inline_stack_2455.sibling = + JSCompiler_object_inline_message_2453), + (workInProgress.child = JSCompiler_object_inline_stack_2455), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (JSCompiler_object_inline_stack_2455 = workInProgress.child), + (JSCompiler_object_inline_stack_2455.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (JSCompiler_object_inline_stack_2455.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2456, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = JSCompiler_object_inline_message_2453)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isHydrating && + console.error( + "We should not be hydrating here. This is a bug in React. Please file a bug." + ), + isSuspenseInstanceFallback(JSCompiler_object_inline_digest_2454)) + ) { + JSCompiler_object_inline_componentStack_2456 = + JSCompiler_object_inline_digest_2454.nextSibling && + JSCompiler_object_inline_digest_2454.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2456) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2456.dgst; + var message = JSCompiler_object_inline_componentStack_2456.msg; + instance = JSCompiler_object_inline_componentStack_2456.stck; + var componentStack = + JSCompiler_object_inline_componentStack_2456.cstck; + } + JSCompiler_object_inline_message_2453 = message; + JSCompiler_object_inline_digest_2454 = JSCompiler_temp; + JSCompiler_object_inline_stack_2455 = instance; + JSCompiler_temp = JSCompiler_object_inline_componentStack_2456 = + componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2454 && + ((JSCompiler_object_inline_componentStack_2456 = + JSCompiler_object_inline_message_2453 + ? Error(JSCompiler_object_inline_message_2453) + : Error( + "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." + )), + (JSCompiler_object_inline_componentStack_2456.stack = + JSCompiler_object_inline_stack_2455 || ""), + (JSCompiler_object_inline_componentStack_2456.digest = + JSCompiler_object_inline_digest_2454), + (JSCompiler_object_inline_stack_2455 = + void 0 === JSCompiler_temp ? null : JSCompiler_temp), + (JSCompiler_object_inline_message_2453 = { + value: JSCompiler_object_inline_componentStack_2456, + source: null, + stack: JSCompiler_object_inline_stack_2455 }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + "string" === typeof JSCompiler_object_inline_stack_2455 && + CapturedStacks.set( + JSCompiler_object_inline_componentStack_2456, + JSCompiler_object_inline_message_2453 + ), + queueHydrationError(JSCompiler_object_inline_message_2453)); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (JSCompiler_object_inline_componentStack_2456 = + 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_object_inline_componentStack_2456) + ) { + JSCompiler_object_inline_componentStack_2456 = workInProgressRoot; + if ( + null !== JSCompiler_object_inline_componentStack_2456 && + ((JSCompiler_object_inline_stack_2455 = renderLanes & -renderLanes), + (JSCompiler_object_inline_stack_2455 = + 0 !== (JSCompiler_object_inline_stack_2455 & 42) + ? 1 + : getBumpedLaneForHydrationByLane( + JSCompiler_object_inline_stack_2455 + )), + (JSCompiler_object_inline_stack_2455 = + 0 !== + (JSCompiler_object_inline_stack_2455 & + (JSCompiler_object_inline_componentStack_2456.suspendedLanes | + renderLanes)) + ? 0 + : JSCompiler_object_inline_stack_2455), + 0 !== JSCompiler_object_inline_stack_2455 && + JSCompiler_object_inline_stack_2455 !== prevState.retryLane) + ) + throw ( + ((prevState.retryLane = JSCompiler_object_inline_stack_2455), + enqueueConcurrentRenderForLane( + current, + JSCompiler_object_inline_stack_2455 + ), + scheduleUpdateOnFiber( + JSCompiler_object_inline_componentStack_2456, + current, + JSCompiler_object_inline_stack_2455 + ), + SelectiveHydrationException) + ); + JSCompiler_object_inline_digest_2454.data === + SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + JSCompiler_object_inline_digest_2454.data === + SUSPENSE_PENDING_START_DATA + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((current = prevState.treeContext), + (nextHydratableInstance = getNextHydratable( + JSCompiler_object_inline_digest_2454.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (didSuspendOrErrorDEV = !1), + (hydrationDiffRootDEV = null), + (rootOrSingletonContext = !1), + null !== current && + (warnIfNotHydrating(), + (idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = current.id), + (treeContextOverflow = current.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + JSCompiler_object_inline_stack_2455.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; + } + if (JSCompiler_object_inline_message_2453) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (JSCompiler_object_inline_message_2453 = + JSCompiler_object_inline_stack_2455.fallback), + (JSCompiler_object_inline_digest_2454 = workInProgress.mode), + (JSCompiler_temp = current.child), + (instance = JSCompiler_temp.sibling), + (JSCompiler_object_inline_stack_2455 = createWorkInProgress( + JSCompiler_temp, + { + mode: "hidden", + children: JSCompiler_object_inline_stack_2455.children + } + )), + (JSCompiler_object_inline_stack_2455.subtreeFlags = + JSCompiler_temp.subtreeFlags & 31457280), + null !== instance + ? (JSCompiler_object_inline_message_2453 = createWorkInProgress( + instance, + JSCompiler_object_inline_message_2453 + )) + : ((JSCompiler_object_inline_message_2453 = createFiberFromFragment( + JSCompiler_object_inline_message_2453, + JSCompiler_object_inline_digest_2454, + renderLanes, + null + )), + (JSCompiler_object_inline_message_2453.flags |= 2)), + (JSCompiler_object_inline_message_2453.return = workInProgress), + (JSCompiler_object_inline_stack_2455.return = workInProgress), + (JSCompiler_object_inline_stack_2455.sibling = + JSCompiler_object_inline_message_2453), + (workInProgress.child = JSCompiler_object_inline_stack_2455), + (JSCompiler_object_inline_stack_2455 = + JSCompiler_object_inline_message_2453), + (JSCompiler_object_inline_message_2453 = workInProgress.child), + (JSCompiler_object_inline_digest_2454 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2454 + ? (JSCompiler_object_inline_digest_2454 = + mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp = + JSCompiler_object_inline_digest_2454.cachePool), + null !== JSCompiler_temp + ? ((instance = CacheContext._currentValue), + (JSCompiler_temp = + JSCompiler_temp.parent !== instance + ? { parent: instance, pool: instance } + : JSCompiler_temp)) + : (JSCompiler_temp = getSuspendedCache()), + (JSCompiler_object_inline_digest_2454 = { + baseLanes: + JSCompiler_object_inline_digest_2454.baseLanes | renderLanes, + cachePool: JSCompiler_temp + })), + (JSCompiler_object_inline_message_2453.memoizedState = + JSCompiler_object_inline_digest_2454), + (JSCompiler_object_inline_message_2453.childLanes = + getRemainingWorkInPrimaryTree( + current, + JSCompiler_object_inline_componentStack_2456, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + JSCompiler_object_inline_stack_2455 + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: JSCompiler_object_inline_stack_2455.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_object_inline_componentStack_2456 = + workInProgress.deletions), + null === JSCompiler_object_inline_componentStack_2456 + ? ((workInProgress.deletions = [current]), + (workInProgress.flags |= 16)) + : JSCompiler_object_inline_componentStack_2456.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; + } + function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); + } + function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes + ) { + var mode = workInProgress.mode; + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: primaryChildren }, + mode + ); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + primaryChildren.return = workInProgress; + fallbackChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; + } + function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + return createFiberFromOffscreen(offscreenProps, mode, 0, null); + } + function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; + } + function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + fiber.return, + renderLanes, + propagationRoot + ); + } + function validateSuspenseListNestedChild(childSlot, index) { + var isAnArray = isArrayImpl(childSlot); + childSlot = !isAnArray && "function" === typeof getIteratorFn(childSlot); + return isAnArray || childSlot + ? ((isAnArray = isAnArray ? "array" : "iterable"), + console.error( + "A nested %s was passed to row #%s in . Wrap it in an additional SuspenseList to configure its revealOrder: ... {%s} ... ", + isAnArray, + index, + isAnArray + ), + !1) + : !0; + } + function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode + ) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); + } + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + nextProps = nextProps.children; + if ( + void 0 !== revealOrder && + "forwards" !== revealOrder && + "backwards" !== revealOrder && + "together" !== revealOrder && + !didWarnAboutRevealOrder[revealOrder] + ) + if ( + ((didWarnAboutRevealOrder[revealOrder] = !0), + "string" === typeof revealOrder) + ) + switch (revealOrder.toLowerCase()) { + case "together": + case "forwards": + case "backwards": + console.error( + '"%s" is not a valid value for revealOrder on . Use lowercase "%s" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + case "forward": + case "backward": + console.error( + '"%s" is not a valid value for revealOrder on . React uses the -s suffix in the spelling. Use "%ss" instead.', + revealOrder, + revealOrder.toLowerCase() + ); + break; + default: + console.error( + '"%s" is not a supported revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + } + else + console.error( + '%s is not a supported value for revealOrder on . Did you mean "together", "forwards" or "backwards"?', + revealOrder + ); + void 0 === tailMode || + didWarnAboutTailOptions[tailMode] || + ("collapsed" !== tailMode && "hidden" !== tailMode + ? ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + '"%s" is not a supported value for tail on . Did you mean "collapsed" or "hidden"?', + tailMode + )) + : "forwards" !== revealOrder && + "backwards" !== revealOrder && + ((didWarnAboutTailOptions[tailMode] = !0), + console.error( + ' is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?', + tailMode + ))); + a: if ( + ("forwards" === revealOrder || "backwards" === revealOrder) && + void 0 !== nextProps && + null !== nextProps && + !1 !== nextProps + ) + if (isArrayImpl(nextProps)) + for (var i = 0; i < nextProps.length; i++) { + if (!validateSuspenseListNestedChild(nextProps[i], i)) break a; + } + else if (((i = getIteratorFn(nextProps)), "function" === typeof i)) { + if ((i = i.call(nextProps))) + for (var step = i.next(), _i = 0; !step.done; step = i.next()) { + if (!validateSuspenseListNestedChild(step.value, _i)) break a; + _i++; + } + } else + console.error( + 'A single row was passed to a . This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?', + revealOrder + ); + reconcileChildren(current, workInProgress, nextProps, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & ForceSuspenseFallback)) + (nextProps = + (nextProps & SubtreeSuspenseContextMask) | ForceSuspenseFallback), + (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber( + current, + renderLanes, + workInProgress + ); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= SubtreeSuspenseContextMask; + } + push(suspenseStackCursor, nextProps, workInProgress); + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), + (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), + (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress.lanes = lastBaseUpdate; - workInProgress.memoizedState = newState; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; + } + function bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error("Resuming work not yet implemented."); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; + } + return workInProgress.child; + } + function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; + } + function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) { + switch (workInProgress.tag) { + case 3: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent( + current, + workInProgress, + renderLanes + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push( + suspenseStackCursor, + suspenseStackCursor.current, + workInProgress + ); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider( + workInProgress, + CacheContext, + current.memoizedState.cache + ); + } + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + function beginWork(current, workInProgress, renderLanes) { + if (workInProgress._debugNeedsRemount && null !== current) { + renderLanes = createFiberFromTypeAndProps( + workInProgress.type, + workInProgress.key, + workInProgress.pendingProps, + workInProgress._debugOwner || null, + workInProgress.mode, + workInProgress.lanes + ); + renderLanes._debugStack = workInProgress._debugStack; + renderLanes._debugTask = workInProgress._debugTask; + var returnFiber = workInProgress.return; + if (null === returnFiber) throw Error("Cannot swap the root fiber."); + current.alternate = null; + workInProgress.alternate = null; + renderLanes.index = workInProgress.index; + renderLanes.sibling = workInProgress.sibling; + renderLanes.return = workInProgress.return; + renderLanes.ref = workInProgress.ref; + renderLanes._debugInfo = workInProgress._debugInfo; + if (workInProgress === returnFiber.child) + returnFiber.child = renderLanes; + else { + var prevSibling = returnFiber.child; + if (null === prevSibling) + throw Error("Expected parent to have a child."); + for (; prevSibling.sibling !== workInProgress; ) + if (((prevSibling = prevSibling.sibling), null === prevSibling)) + throw Error("Expected to find the previous sibling."); + prevSibling.sibling = renderLanes; + } + workInProgress = returnFiber.deletions; + null === workInProgress + ? ((returnFiber.deletions = [current]), (returnFiber.flags |= 16)) + : workInProgress.push(current); + renderLanes.flags |= 2; + return renderLanes; + } + if (null !== current) + if ( + current.memoizedProps !== workInProgress.pendingProps || + workInProgress.type !== current.type + ) + didReceiveUpdate = !0; + else { + if ( + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else { + didReceiveUpdate = !1; + if ((returnFiber = isHydrating)) + warnIfNotHydrating(), + (returnFiber = 0 !== (workInProgress.flags & 1048576)); + returnFiber && + ((returnFiber = workInProgress.index), + warnIfNotHydrating(), + pushTreeId(workInProgress, treeForkCount, returnFiber)); + } + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: if ( + ((returnFiber = workInProgress.pendingProps), + (current = callLazyInitInDEV(workInProgress.elementType)), + (workInProgress.type = current), + "function" === typeof current) + ) + shouldConstruct(current) + ? ((returnFiber = resolveClassComponentProps( + current, + returnFiber + )), + (workInProgress.tag = 1), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateClassComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))) + : ((workInProgress.tag = 0), + validateFunctionComponentInDev(workInProgress, current), + (workInProgress.type = current = + resolveFunctionForHotReloading(current)), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ))); + else { + if (void 0 !== current && null !== current) + if ( + ((prevSibling = current.$$typeof), + prevSibling === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress.type = current = + resolveForwardRefForHotReloading(current); + workInProgress = updateForwardRef( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } else if (prevSibling === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + current, + returnFiber, + renderLanes + ); + break a; + } + workInProgress = ""; + null !== current && + "object" === typeof current && + current.$$typeof === REACT_LAZY_TYPE && + (workInProgress = + " Did you wrap a component in React.lazy() more than once?"); + current = getComponentNameFromType(current) || current; + throw Error( + "Element type is invalid. Received a promise that resolves to: " + + current + + ". Lazy element type must resolve to a class or function." + + workInProgress + ); + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (returnFiber = workInProgress.type), + (prevSibling = resolveClassComponentProps( + returnFiber, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + returnFiber, + prevSibling, + renderLanes + ) + ); + case 3: + a: { + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) + throw Error( + "Should have a current fiber. This is a bug in React." + ); + var nextProps = workInProgress.pendingProps; + prevSibling = workInProgress.memoizedState; + returnFiber = prevSibling.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (prevSibling.isDehydrated) + if ( + ((prevSibling = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = prevSibling), + (workInProgress.memoizedState = prevSibling), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== returnFiber) { + returnFiber = createCapturedValueAtFiber( + Error( + "This root received an early update, before anything was able hydrate. Switched the entire root to client rendering." + ), + workInProgress + ); + queueHydrationError(returnFiber); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + didSuspendOrErrorDEV = !1, + hydrationDiffRootDEV = null, + rootOrSingletonContext = !0, + current = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = current; + current; + + ) + (current.flags = (current.flags & -3) | 4096), + (current = current.sibling); + else { + resetHydrationState(); + if (nextProps === returnFiber) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; + } + reconcileChildren( + current, + workInProgress, + nextProps, + renderLanes + ); + } + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (current = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = current) + : isHydrating || + ((current = workInProgress.type), + (renderLanes = workInProgress.pendingProps), + (returnFiber = requiredContext( + rootInstanceStackCursor.current + )), + (returnFiber = + getOwnerDocumentFromRootContainer( + returnFiber + ).createElement(current)), + (returnFiber[internalInstanceKey] = workInProgress), + (returnFiber[internalPropsKey] = renderLanes), + setInitialProperties(returnFiber, current, renderLanes), + markNodeAsHoistable(returnFiber), + (workInProgress.stateNode = returnFiber)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((prevSibling = requiredContext(rootInstanceStackCursor.current)), + (returnFiber = getHostContext()), + (prevSibling = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + prevSibling, + returnFiber, + !1 + )), + didSuspendOrErrorDEV || + ((returnFiber = diffHydratedProperties( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + returnFiber + )), + null !== returnFiber && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + returnFiber)), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + prevSibling.firstChild + ))), + (returnFiber = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + return ( + null === current && + isHydrating && + ((nextProps = getHostContext()), + (returnFiber = validateDOMNesting( + workInProgress.type, + nextProps.ancestorInfo + )), + (prevSibling = nextHydratableInstance), + (nextState = !prevSibling) || + ((nextState = canHydrateInstance( + prevSibling, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== nextState + ? ((workInProgress.stateNode = nextState), + didSuspendOrErrorDEV || + ((nextProps = diffHydratedProperties( + nextState, + workInProgress.type, + workInProgress.pendingProps, + nextProps + )), + null !== nextProps && + (buildHydrationDiffNode(workInProgress, 0).serverProps = + nextProps)), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + nextState.firstChild + )), + (rootOrSingletonContext = !1), + (nextProps = !0)) + : (nextProps = !1), + (nextState = !nextProps)), + nextState && + (returnFiber && + warnNonHydratedInstance(workInProgress, prevSibling), + throwOnHydrationMismatch(workInProgress))), + pushHostContext(workInProgress), + (prevSibling = workInProgress.type), + (nextProps = workInProgress.pendingProps), + (nextState = null !== current ? current.memoizedProps : null), + (returnFiber = nextProps.children), + shouldSetTextContent(prevSibling, nextProps) + ? (returnFiber = null) + : null !== nextState && + shouldSetTextContent(prevSibling, nextState) && + (workInProgress.flags |= 32), + null !== workInProgress.memoizedState && + ((prevSibling = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = prevSibling)), + markRef(current, workInProgress), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 6: + return ( + null === current && + isHydrating && + ((current = workInProgress.pendingProps), + (renderLanes = getHostContext().ancestorInfo.current), + (current = + null != renderLanes + ? validateTextNesting(current, renderLanes.tag) + : !0), + (renderLanes = nextHydratableInstance), + (returnFiber = !renderLanes) || + ((returnFiber = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== returnFiber + ? ((workInProgress.stateNode = returnFiber), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (returnFiber = !0)) + : (returnFiber = !1), + (returnFiber = !returnFiber)), + returnFiber && + (current && + warnNonHydratedInstance(workInProgress, renderLanes), + throwOnHydrationMismatch(workInProgress))), + null + ); + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (returnFiber = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + returnFiber, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (returnFiber = workInProgress.stateNode), + (returnFiber.effectDuration = -0), + (returnFiber.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (returnFiber = workInProgress.type), + (prevSibling = workInProgress.pendingProps), + (nextProps = prevSibling.value), + "value" in prevSibling || + hasWarnedAboutUsingNoValuePropOnContextProvider || + ((hasWarnedAboutUsingNoValuePropOnContextProvider = !0), + console.error( + "The `value` prop is required for the ``. Did you misspell it or forget to pass it?" + )), + pushProvider(workInProgress, returnFiber, nextProps), + reconcileChildren( + current, + workInProgress, + prevSibling.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (prevSibling = workInProgress.type._context), + (returnFiber = workInProgress.pendingProps.children), + "function" !== typeof returnFiber && + console.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." + ), + prepareToReadContext(workInProgress), + (prevSibling = readContext(prevSibling)), + (returnFiber = callComponentInDEV( + returnFiber, + prevSibling, + void 0 + )), + (workInProgress.flags |= 1), + reconcileChildren( + current, + workInProgress, + returnFiber, + renderLanes + ), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (returnFiber = readContext(CacheContext)), + null === current + ? ((prevSibling = peekCacheFromPool()), + null === prevSibling && + ((prevSibling = workInProgressRoot), + (nextProps = createCache()), + (prevSibling.pooledCache = nextProps), + retainCache(nextProps), + null !== nextProps && + (prevSibling.pooledCacheLanes |= renderLanes), + (prevSibling = nextProps)), + (workInProgress.memoizedState = { + parent: returnFiber, + cache: prevSibling + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, prevSibling)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (prevSibling = current.memoizedState), + (nextProps = workInProgress.memoizedState), + prevSibling.parent !== returnFiber + ? ((prevSibling = { + parent: returnFiber, + cache: returnFiber + }), + (workInProgress.memoizedState = prevSibling), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + prevSibling), + pushProvider(workInProgress, CacheContext, returnFiber)) + : ((returnFiber = nextProps.cache), + pushProvider(workInProgress, CacheContext, returnFiber), + returnFiber !== prevSibling.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } - currentlyProcessingQueue = null; - } - function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error( - "Invalid argument passed as callback. Expected a function. Instead received: " + - callback - ); - callback.call(context); - } - function commitHiddenCallbacks(updateQueue, context) { - var hiddenCallbacks = updateQueue.shared.hiddenCallbacks; - if (null !== hiddenCallbacks) - for ( - updateQueue.shared.hiddenCallbacks = null, updateQueue = 0; - updateQueue < hiddenCallbacks.length; - updateQueue++ - ) - callCallback(hiddenCallbacks[updateQueue], context); - } - function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error( + "Unknown unit of work tag (" + + workInProgress.tag + + "). This error is likely caused by a bug in React. Please file an issue." + ); } function shouldProfile(current) { return (current.mode & ProfileMode) !== NoMode; @@ -11551,160 +11362,6 @@ } } } - function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$2) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { - focusedElem: root, - selectionRange: JSCompiler_temp - }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - root = firstChild = nextEffect; - JSCompiler_temp = root.alternate; - anchorOffset = root.flags; - switch (root.tag) { - case 0: - if ( - 0 !== (anchorOffset & 4) && - ((root = root.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - 0 !== (anchorOffset & 1024) && - null !== JSCompiler_temp && - commitClassSnapshot(root, JSCompiler_temp); - break; - case 3: - if (0 !== (anchorOffset & 1024)) - if ( - ((root = root.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (anchorOffset & 1024)) - 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." - ); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - firstChild = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return firstChild; - } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var prevEffectStart = pushComponentEffectStart(), flags = finishedWork.flags; @@ -12190,13 +11847,6 @@ } }); } - function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -12736,13 +12386,6 @@ parentFiber = parentFiber.sibling; } } - function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; - } function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12750,6 +12393,7 @@ (parentFiber = parentFiber.sibling); } function disappearLayoutEffects(finishedWork) { + var prevEffectStart = pushComponentEffectStart(); switch (finishedWork.tag) { case 0: case 11: @@ -12787,6 +12431,17 @@ default: recursivelyTraverseDisappearLayoutEffects(finishedWork); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseDisappearLayoutEffects(parentFiber) { for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -12799,7 +12454,8 @@ finishedWork, includeWorkInProgressEffects ) { - var flags = finishedWork.flags; + var prevEffectStart = pushComponentEffectStart(), + flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -12914,6 +12570,17 @@ includeWorkInProgressEffects ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseReappearLayoutEffects( finishedRoot, @@ -12986,39 +12653,16 @@ endTime ) { var prevEffectStart = pushComponentEffectStart(); - if ( - (finishedWork.mode & ProfileMode) !== NoMode && + (finishedWork.mode & ProfileMode) !== NoMode && 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) - ) { - var startTime = finishedWork.actualStartTime, - name = getComponentNameFromFiber(finishedWork); - if (null !== name && supportsUserTiming) { - var selfTime = finishedWork.actualDuration; - if ( - null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child - ) - for ( - var child = finishedWork.child; - null !== child; - child = child.sibling - ) - selfTime -= child.actualDuration; - reusableComponentDevToolDetails.color = - 0.5 > selfTime - ? "primary-light" - : 10 > selfTime - ? "primary" - : 100 > selfTime - ? "primary-dark" - : "error"; - reusableComponentOptions.start = startTime; - reusableComponentOptions.end = endTime; - performance.measure(name, reusableComponentOptions); - } - } - name = finishedWork.flags; + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -13030,11 +12674,16 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitHookPassiveMountEffects(finishedWork, Passive | HasEffect); break; case 3: - startTime = pushNestedEffectDurations(); + var prevEffectDuration = pushNestedEffectDurations(), + wasInHydratedSubtree = inHydratedSubtree; + inHydratedSubtree = + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 === (finishedWork.flags & 256); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13042,7 +12691,8 @@ committedTransitions, endTime ); - name & 2048 && + inHydratedSubtree = wasInHydratedSubtree; + flags & 2048 && ((committedLanes = null), null !== finishedWork.alternate && (committedLanes = finishedWork.alternate.memoizedState.cache), @@ -13051,11 +12701,11 @@ (retainCache(committedTransitions), null != committedLanes && releaseCache(committedLanes))); finishedRoot.passiveEffectDuration += - popNestedEffectDurations(startTime); + popNestedEffectDurations(prevEffectDuration); break; case 12: - if (name & 2048) { - startTime = pushNestedEffectDurations(); + if (flags & 2048) { + prevEffectDuration = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13065,7 +12715,7 @@ ); finishedRoot = finishedWork.stateNode; finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(startTime); + bubbleNestedEffectDurations(prevEffectDuration); try { runWithFiberInDEV( finishedWork, @@ -13087,12 +12737,73 @@ endTime ); break; + case 13: + prevEffectDuration = inHydratedSubtree; + flags = + null !== finishedWork.alternate + ? finishedWork.alternate.memoizedState + : null; + wasInHydratedSubtree = finishedWork.memoizedState; + if ( + null === flags || + null === flags.dehydrated || + (null !== wasInHydratedSubtree && + null !== wasInHydratedSubtree.dehydrated) + ) + inHydratedSubtree = !1; + else if ( + ((wasInHydratedSubtree = finishedWork.deletions), + null !== wasInHydratedSubtree && + 0 < wasInHydratedSubtree.length && + 18 === wasInHydratedSubtree[0].tag) + ) { + if ( + ((inHydratedSubtree = !1), + (flags = flags.hydrationErrors), + null !== flags && + ((wasInHydratedSubtree = finishedWork.actualStartTime), + supportsUserTiming)) + ) { + for (var properties = [], i = 0; i < flags.length; i++) { + var error$jscomp$0 = flags[i].value; + properties.push([ + "Error", + "object" === typeof error$jscomp$0 && + null !== error$jscomp$0 && + "string" === typeof error$jscomp$0.message + ? String(error$jscomp$0.message) + : String(error$jscomp$0) + ]); + } + performance.measure("Suspense", { + start: wasInHydratedSubtree, + end: endTime, + detail: { + devtools: { + color: "error", + track: COMPONENTS_TRACK, + tooltipText: "Hydration failed", + properties: properties + } + } + }); + } + } else inHydratedSubtree = !0; + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + inHydratedSubtree = prevEffectDuration; + break; case 23: break; case 22: - startTime = finishedWork.stateNode; + prevEffectDuration = finishedWork.stateNode; null !== finishedWork.memoizedState - ? startTime._visibility & OffscreenPassiveEffectsConnected + ? prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13102,9 +12813,12 @@ ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) - : startTime._visibility & OffscreenPassiveEffectsConnected + : prevEffectDuration._visibility & OffscreenPassiveEffectsConnected ? recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -13112,15 +12826,17 @@ committedTransitions, endTime ) - : ((startTime._visibility |= OffscreenPassiveEffectsConnected), + : ((prevEffectDuration._visibility |= + OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) + 0 !== (finishedWork.subtreeFlags & 10256), + endTime )); - name & 2048 && + flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork @@ -13134,7 +12850,7 @@ committedTransitions, endTime ); - name & 2048 && + flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; default: @@ -13163,28 +12879,43 @@ parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) + for (parentFiber = parentFiber.child; null !== parentFiber; ) { + var nextSibling = parentFiber.sibling; reconnectPassiveEffects( finishedRoot, parentFiber, committedLanes, committedTransitions, - includeWorkInProgressEffects - ), - (parentFiber = parentFiber.sibling); + includeWorkInProgressEffects, + null !== nextSibling ? nextSibling.actualStartTime : endTime + ); + parentFiber = nextSibling; + } } function reconnectPassiveEffects( finishedRoot, finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) { + var prevEffectStart = pushComponentEffectStart(); + (finishedWork.mode & ProfileMode) !== NoMode && + 0 < finishedWork.actualStartTime && + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree + ); var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: @@ -13195,7 +12926,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); commitHookPassiveMountEffects(finishedWork, Passive); break; @@ -13210,11 +12942,15 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + finishedWork, + committedLanes, + committedTransitions, + endTime ) : ((_instance2._visibility |= OffscreenPassiveEffectsConnected), recursivelyTraverseReconnectPassiveEffects( @@ -13222,7 +12958,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime )); includeWorkInProgressEffects && flags & 2048 && @@ -13237,7 +12974,8 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); includeWorkInProgressEffects && flags & 2048 && @@ -13249,49 +12987,82 @@ finishedWork, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); } + (finishedWork.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); } function recursivelyTraverseAtomicPassiveEffects( finishedRoot$jscomp$0, - parentFiber + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber + ? parentFiber.actualStartTime + : endTime$jscomp$0; + (child.mode & ProfileMode) !== NoMode && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender( + child, + child.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = child.flags; + switch (child.tag) { case 22: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); flags & 2048 && - commitCachePassiveMountEffect( - finishedWork.alternate, - finishedWork - ); + commitCachePassiveMountEffect(child.alternate, child); break; default: recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ); } - parentFiber = parentFiber.sibling; + child = parentFiber; } } function recursivelyAccumulateSuspenseyCommit(parentFiber) { @@ -13465,11 +13236,13 @@ } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { var fiber = nextEffect, - current = fiber; + current = fiber, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(); switch (current.tag) { case 0: case 11: @@ -13484,30 +13257,42 @@ case 22: null !== current.memoizedState && null !== current.memoizedState.cachePool && - ((current = current.memoizedState.cachePool.pool), - null != current && retainCache(current)); + ((nearestMountedAncestor = current.memoizedState.cachePool.pool), + null != nearestMountedAncestor && + retainCache(nearestMountedAncestor)); break; case 24: releaseCache(current.memoizedState.cache); } + (current.mode & ProfileMode) !== NoMode && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + current, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); current = fiber.child; if (null !== current) (current.return = fiber), (nextEffect = current); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { current = nextEffect; - var sibling = current.sibling, - returnFiber = current.return; + prevEffectStart = current.sibling; + nearestMountedAncestor = current.return; detachFiberAfterEffects(current); if (current === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== prevEffectStart) { + prevEffectStart.return = nearestMountedAncestor; + nextEffect = prevEffectStart; break a; } - nextEffect = returnFiber; + nextEffect = nearestMountedAncestor; } } } @@ -13998,16 +13783,16 @@ case 1: return bubbleProperties(workInProgress), null; case 3: - newProps = workInProgress.stateNode; - renderLanes = null; - null !== current && (renderLanes = current.memoizedState.cache); - workInProgress.memoizedState.cache !== renderLanes && + renderLanes = workInProgress.stateNode; + newProps = null; + null !== current && (newProps = current.memoizedState.cache); + workInProgress.memoizedState.cache !== newProps && (workInProgress.flags |= 2048); popProvider(CacheContext, workInProgress); popHostContainer(workInProgress); - newProps.pendingContext && - ((newProps.context = newProps.pendingContext), - (newProps.pendingContext = null)); + renderLanes.pendingContext && + ((renderLanes.context = renderLanes.pendingContext), + (renderLanes.pendingContext = null)); if (null === current || null === current.child) popHydrationState(workInProgress) ? (emitPendingHydrationWarnings(), markUpdate(workInProgress)) @@ -14015,9 +13800,7 @@ (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -14226,9 +14009,9 @@ renderLanes = getHostContext(); if (popHydrationState(workInProgress)) { current = workInProgress.stateNode; - newProps = workInProgress.memoizedProps; + renderLanes = workInProgress.memoizedProps; _type = !didSuspendOrErrorDEV; - renderLanes = null; + newProps = null; var returnFiber = hydrationParentFiber; if (null !== returnFiber) switch (returnFiber.tag) { @@ -14236,8 +14019,8 @@ _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode(workInProgress, 0).serverProps = @@ -14245,12 +14028,12 @@ break; case 27: case 5: - (renderLanes = returnFiber.memoizedProps), + (newProps = returnFiber.memoizedProps), _type && ((_type = diffHydratedTextForDevWarnings( current, - newProps, - renderLanes + renderLanes, + newProps )), null !== _type && (buildHydrationDiffNode( @@ -14260,10 +14043,10 @@ } current[internalInstanceKey] = workInProgress; current = - current.nodeValue === newProps || - (null !== renderLanes && - !0 === renderLanes.suppressHydrationWarning) || - checkForUnmatchedText(current.nodeValue, newProps) + current.nodeValue === renderLanes || + (null !== newProps && + !0 === newProps.suppressHydrationWarning) || + checkForUnmatchedText(current.nodeValue, renderLanes) ? !0 : !1; current || throwOnHydrationMismatch(workInProgress); @@ -14323,9 +14106,10 @@ _type.treeBaseDuration)); _type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null)), + (_type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = _type), (_type = !0); if (!_type) { if (workInProgress.flags & 256) @@ -14342,27 +14126,27 @@ transferActualDuration(workInProgress), workInProgress ); - newProps = null !== newProps; + renderLanes = null !== newProps; current = null !== current && null !== current.memoizedState; - newProps && - ((renderLanes = workInProgress.child), + renderLanes && + ((newProps = workInProgress.child), (_type = null), - null !== renderLanes.alternate && - null !== renderLanes.alternate.memoizedState && - null !== renderLanes.alternate.memoizedState.cachePool && - (_type = renderLanes.alternate.memoizedState.cachePool.pool), + null !== newProps.alternate && + null !== newProps.alternate.memoizedState && + null !== newProps.alternate.memoizedState.cachePool && + (_type = newProps.alternate.memoizedState.cachePool.pool), (returnFiber = null), - null !== renderLanes.memoizedState && - null !== renderLanes.memoizedState.cachePool && - (returnFiber = renderLanes.memoizedState.cachePool.pool), - returnFiber !== _type && (renderLanes.flags |= 2048)); - newProps !== current && - newProps && + null !== newProps.memoizedState && + null !== newProps.memoizedState.cachePool && + (returnFiber = newProps.memoizedState.cachePool.pool), + returnFiber !== _type && (newProps.flags |= 2048)); + renderLanes !== current && + renderLanes && (workInProgress.child.flags |= 8192); scheduleRetryEffect(workInProgress, workInProgress.updateQueue); bubbleProperties(workInProgress); (workInProgress.mode & ProfileMode) !== NoMode && - newProps && + renderLanes && ((current = workInProgress.child), null !== current && (workInProgress.treeBaseDuration -= current.treeBaseDuration)); @@ -14406,9 +14190,13 @@ scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; current = renderLanes; - for (newProps = workInProgress.child; null !== newProps; ) - resetWorkInProgress(newProps, current), - (newProps = newProps.sibling); + for ( + renderLanes = workInProgress.child; + null !== renderLanes; + + ) + resetWorkInProgress(renderLanes, current), + (renderLanes = renderLanes.sibling); push( suspenseStackCursor, (suspenseStackCursor.current & @@ -14496,27 +14284,27 @@ workInProgress.subtreeFlags & 6 && (workInProgress.flags |= 8192)) : bubbleProperties(workInProgress), - (newProps = workInProgress.updateQueue), - null !== newProps && - scheduleRetryEffect(workInProgress, newProps.retryQueue), - (newProps = null), + (renderLanes = workInProgress.updateQueue), + null !== renderLanes && + scheduleRetryEffect(workInProgress, renderLanes.retryQueue), + (renderLanes = null), null !== current && null !== current.memoizedState && null !== current.memoizedState.cachePool && - (newProps = current.memoizedState.cachePool.pool), - (renderLanes = null), + (renderLanes = current.memoizedState.cachePool.pool), + (newProps = null), null !== workInProgress.memoizedState && null !== workInProgress.memoizedState.cachePool && - (renderLanes = workInProgress.memoizedState.cachePool.pool), - renderLanes !== newProps && (workInProgress.flags |= 2048), + (newProps = workInProgress.memoizedState.cachePool.pool), + newProps !== renderLanes && (workInProgress.flags |= 2048), null !== current && pop(resumedCache, workInProgress), null ); case 24: return ( - (newProps = null), - null !== current && (newProps = current.memoizedState.cache), - workInProgress.memoizedState.cache !== newProps && + (renderLanes = null), + null !== current && (renderLanes = current.memoizedState.cache), + workInProgress.memoizedState.cache !== renderLanes && (workInProgress.flags |= 2048), popProvider(CacheContext, workInProgress), bubbleProperties(workInProgress), @@ -14838,23 +14626,20 @@ a: { startTime = root; yieldDuration = renderWasConcurrent; - var errorRetryLanes$jscomp$0 = errorRetryLanes; renderWasConcurrent = workInProgressRootConcurrentErrors; - (errorRetryLanes = - startTime.current.memoizedState.isDehydrated) && - (prepareFreshStack( - startTime, - errorRetryLanes$jscomp$0 - ).flags |= 256); - errorRetryLanes$jscomp$0 = renderRootSync( + var wasRootDehydrated = + startTime.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(startTime, errorRetryLanes).flags |= 256); + errorRetryLanes = renderRootSync( startTime, - errorRetryLanes$jscomp$0, + errorRetryLanes, !1 ); - if (errorRetryLanes$jscomp$0 !== RootErrored) { + if (errorRetryLanes !== RootErrored) { if ( workInProgressRootDidAttachPingListener && - !errorRetryLanes + !wasRootDehydrated ) { startTime.errorRecoveryDisabledLanes |= yieldDuration; workInProgressRootInterleavedUpdatedLanes |= yieldDuration; @@ -14863,9 +14648,15 @@ } startTime = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = renderWasConcurrent; - null !== startTime && queueRecoverableErrors(startTime); + null !== startTime && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = startTime) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + startTime + )); } - yieldDuration = errorRetryLanes$jscomp$0; + yieldDuration = errorRetryLanes; } renderWasConcurrent = !1; if (yieldDuration !== RootErrored) continue; @@ -14890,7 +14681,7 @@ if ((lanes & 4194176) !== lanes) break; case RootSuspendedAtTheShell: setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase(renderStartTime, startTime); + logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); yieldEndTime = lanes; 0 !== (yieldEndTime & 3) || 0 !== (yieldEndTime & 60) @@ -14990,14 +14781,6 @@ } while (1); ensureRootIsScheduled(root); } - function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); - } function commitRootWhenReady( root, finishedWork, @@ -15160,14 +14943,26 @@ workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootSuspendedWithDelay ) - logSuspendedRenderPhase(previousRenderStartTime, renderStartTime); + logSuspendedRenderPhase( + previousRenderStartTime, + renderStartTime, + lanes + ); else { var endTime = renderStartTime; supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), - performance.measure("Interrupted Render", reusableLaneOptions)); + performance.measure( + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326677) === lanes + ? "Interrupted Hydration" + : "Interrupted Render", + reusableLaneOptions + )); } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } @@ -15188,7 +14983,8 @@ ? endTime : 0 <= previousRenderStartTime ? previousRenderStartTime - : renderStartTime + : renderStartTime, + lanes )); var eventType = blockingEventType, eventIsRepeat = blockingEventIsRepeat, @@ -15210,7 +15006,10 @@ reusableLaneOptions )), 0 < previousRenderStartTime && - ((reusableLaneDevToolDetails.color = "primary-light"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes + ? "tertiary-light" + : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = renderStartTime$jscomp$0), performance.measure("Blocked", reusableLaneOptions))); @@ -15239,7 +15038,8 @@ ? eventType : 0 <= endTime ? endTime - : renderStartTime + : renderStartTime, + lanes )); eventIsRepeat = transitionEventType; renderStartTime$jscomp$0 = transitionEventIsRepeat; @@ -15324,7 +15124,7 @@ return previousRenderStartTime; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; ReactSharedInternals.getCurrentStack = null; isRendering = !1; @@ -15824,7 +15624,7 @@ workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -15839,173 +15639,544 @@ var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, + ReactDOMSharedInternals.p = DiscreteEventPriority; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + ReactStrictModeWarnings.flushLegacyContextWarning(); + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); + if ((executionContext & (RenderContext | CommitContext)) !== NoContext) + throw Error("Should not already be working."); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + setCurrentTrackFromLanes(lanes); + if (exitStatus === RootErrored) + logErroredRenderPhase( completedRenderStartTime, completedRenderEndTime ); - } finally { - (ReactSharedInternals.T = prevTransition), - (ReactDOMSharedInternals.p = previousUpdateLanePriority); - } - } - function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - ReactStrictModeWarnings.flushLegacyContextWarning(); - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate); - exitStatus === RootErrored - ? logErroredRenderPhase( - completedRenderStartTime, - completedRenderEndTime - ) - : logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === finishedWork) return null; - 0 === didIncludeRenderPhaseUpdate && - console.error( - "root.finishedLanes should not be empty during a commit. This is a bug in React." - ); - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) - throw Error( - "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." - ); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - exitStatus = finishedWork.lanes | finishedWork.childLanes; - exitStatus |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - exitStatus, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = exitStatus), - (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })); - commitStartTime = now(); - suspendedCommitReason === SUSPENDED_COMMIT - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : suspendedCommitReason === THROTTLED_COMMIT && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects( - root, - finishedWork, - didIncludeRenderPhaseUpdate - ), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - commitEndTime = now(); - logCommitPhase( - suspendedCommitReason === IMMEDIATE_COMMIT - ? completedRenderEndTime - : commitStartTime, - commitEndTime - ); - (suspendedCommitReason = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : (releaseRootPooledCache(root, exitStatus), - (nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = null)); - exitStatus = root.pendingLanes; - 0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null); - suspendedCommitReason || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - onCommitRoot(); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, - completedRenderEndTime = 0; - completedRenderEndTime < recoverableErrors.length; - completedRenderEndTime++ - ) - (finishedWork = recoverableErrors[completedRenderEndTime]), - (exitStatus = makeErrorInfo(finishedWork.stack)), - runWithFiberInDEV( - finishedWork.source, - renderPriorityLevel, - finishedWork.value, - exitStatus + else if (null !== recoverableErrors) { + var hydrationFailed = + null !== finishedWork && + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 !== (finishedWork.flags & 256); + if (supportsUserTiming) { + for ( + var properties = [], i = 0; + i < recoverableErrors.length; + i++ + ) { + var error = recoverableErrors[i].value; + properties.push([ + "Recoverable Error", + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error) + ]); + } + performance.measure("Recovered", { + start: completedRenderStartTime, + end: completedRenderEndTime, + detail: { + devtools: { + color: "primary-dark", + track: reusableLaneDevToolDetails.track, + trackGroup: LANES_TRACK_GROUP, + tooltipText: hydrationFailed + ? "Hydration Failed" + : "Recovered after Error", + properties: properties + } + } + }); + } + } else + supportsUserTiming && + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (reusableLaneOptions.start = completedRenderStartTime), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure( + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326677) === lanes + ? "Hydrated" + : "Render", + reusableLaneOptions + )); + if (null !== finishedWork) { + 0 === lanes && + console.error( + "root.finishedLanes should not be empty during a commit. This is a bug in React." ); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - exitStatus = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - suspendedCommitReason || - finalizeRender(didIncludeRenderPhaseUpdate, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error( + "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." + ); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes, + remainingLanes$jscomp$0 = (remainingLanes |= + concurrentlyUpdatedLanes), + previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; + root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + for ( + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates, + lanes$jscomp$0 = + previouslyPendingLanes & ~remainingLanes$jscomp$0; + 0 < lanes$jscomp$0; + + ) { + var index = 31 - clz32(lanes$jscomp$0), + lane = 1 << index; + entanglements[index] = 0; + expirationTimes[index] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index] = null; + for ( + var i$jscomp$0 = 0; + i$jscomp$0 < hiddenUpdatesForLane.length; + i$jscomp$0++ + ) { + var update = hiddenUpdatesForLane[i$jscomp$0]; + null !== update && (update.lane &= -536870913); + } + } + lanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + var rootDoesHavePassiveEffects = !1; + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootDoesHavePassiveEffects = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + if (suspendedCommitReason === SUSPENDED_COMMIT) { + var endTime = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime), + performance.measure("Suspended", reusableLaneOptions)); + } else if (suspendedCommitReason === THROTTLED_COMMIT) { + var endTime$jscomp$0 = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime$jscomp$0), + performance.measure("Throttled", reusableLaneOptions)); + } + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition$jscomp$0 = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = + (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if ( + selection$jscomp$0 && + 0 !== selection$jscomp$0.rangeCount + ) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$2) { + selection = null; + break b; + } + var length = 0, + start = -1, + end = -1, + indexWithinAnchor = 0, + indexWithinFocus = 0, + node = focusedElem, + parentNode = null; + c: for (;;) { + for (var next; ; ) { + node !== anchorNode || + (0 !== anchorOffset && 3 !== node.nodeType) || + (start = length + anchorOffset); + node !== focusNode || + (0 !== focusOffset && 3 !== node.nodeType) || + (end = length + focusOffset); + 3 === node.nodeType && + (length += node.nodeValue.length); + if (null === (next = node.firstChild)) break; + parentNode = node; + node = next; + } + for (;;) { + if (node === focusedElem) break c; + parentNode === anchorNode && + ++indexWithinAnchor === anchorOffset && + (start = length); + parentNode === focusNode && + ++indexWithinFocus === focusOffset && + (end = length); + if (null !== (next = node.nextSibling)) break; + node = parentNode; + parentNode = node.parentNode; + } + node = next; + } + selection = + -1 === start || -1 === end + ? null + : { start: start, end: end }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + var fiber = nextEffect, + child = fiber.child; + if (0 !== (fiber.subtreeFlags & 1028) && null !== child) + (child.return = fiber), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + var fiber$jscomp$0 = nextEffect, + finishedWork$jscomp$0 = fiber$jscomp$0, + current = finishedWork$jscomp$0.alternate, + flags = finishedWork$jscomp$0.flags; + switch (finishedWork$jscomp$0.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = finishedWork$jscomp$0.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for (var ii = 0; ii < eventPayloads.length; ii++) { + var _eventPayloads$ii = eventPayloads[ii]; + _eventPayloads$ii.ref.impl = + _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + 0 !== (flags & 1024) && + null !== current && + commitClassSnapshot(finishedWork$jscomp$0, current); + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = + finishedWork$jscomp$0.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) + clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + 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." + ); + } + var sibling = fiber$jscomp$0.sibling; + if (null !== sibling) { + sibling.return = fiber$jscomp$0.return; + nextEffect = sibling; + break b; + } + nextEffect = fiber$jscomp$0.return; + } + } + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + inProgressRoot = inProgressLanes = null; + var priorSelectionInformation = selectionInformation, + curFocusedElem = getActiveElementDeep( + root$jscomp$0.containerInfo + ), + priorFocusedElem = priorSelectionInformation.focusedElem, + priorSelectionRange = priorSelectionInformation.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start$jscomp$0 = priorSelectionRange.start, + end$jscomp$0 = priorSelectionRange.end; + void 0 === end$jscomp$0 && (end$jscomp$0 = start$jscomp$0); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start$jscomp$0), + (priorFocusedElem.selectionEnd = Math.min( + end$jscomp$0, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length$jscomp$0 = priorFocusedElem.textContent.length, + start$jscomp$1 = Math.min( + priorSelectionRange.start, + length$jscomp$0 + ), + end$jscomp$1 = + void 0 === priorSelectionRange.end + ? start$jscomp$1 + : Math.min(priorSelectionRange.end, length$jscomp$0); + if ( + !selection$jscomp$1.extend && + start$jscomp$1 > end$jscomp$1 + ) { + var temp = end$jscomp$1; + end$jscomp$1 = start$jscomp$1; + start$jscomp$1 = temp; + } + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$1 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$1 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== + startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$1 > end$jscomp$1 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + for ( + var ancestors = [], ancestor = priorFocusedElem; + (ancestor = ancestor.parentNode); + + ) + 1 === ancestor.nodeType && + ancestors.push({ + element: ancestor, + left: ancestor.scrollLeft, + top: ancestor.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + var i$jscomp$1 = 0; + i$jscomp$1 < ancestors.length; + i$jscomp$1++ + ) { + var info = ancestors[i$jscomp$1]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + inProgressRoot = inProgressLanes = null; + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition$jscomp$0; + } else root$jscomp$0.current = finishedWork; + commitEndTime = now(); + var startTime = + suspendedCommitReason === IMMEDIATE_COMMIT + ? completedRenderEndTime + : commitStartTime, + endTime$jscomp$1 = commitEndTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-dark"), + (reusableLaneOptions.start = startTime), + (reusableLaneOptions.end = endTime$jscomp$1), + performance.measure("Commit", reusableLaneOptions)); + var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; + rootDoesHavePassiveEffects + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : (releaseRootPooledCache(root$jscomp$0, remainingLanes), + (nestedPassiveUpdateCount = 0), + (rootWithPassiveNestedUpdates = null)); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && + (legacyErrorBoundariesThatAlreadyFailed = null); + rootDidHavePassiveEffects || + commitDoubleInvokeEffectsInDEV(root$jscomp$0); + var root = finishedWork.stateNode; + if ( + injectedHook && + "function" === typeof injectedHook.onCommitFiberRoot + ) + try { + var didError = 128 === (root.current.flags & 128); + switch (previousUpdateLanePriority) { + case DiscreteEventPriority: + var schedulerPriority = ImmediatePriority; + break; + case ContinuousEventPriority: + schedulerPriority = UserBlockingPriority; + break; + case DefaultEventPriority: + schedulerPriority = NormalPriority$1; + break; + case IdleEventPriority: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) { + hasLoggedError || + ((hasLoggedError = !0), + console.error( + "React instrumentation encountered an error: %s", + err + )); + } + isDevToolsPresent && root$jscomp$0.memoizedUpdaters.clear(); + onCommitRoot(); + if (null !== recoverableErrors) + for ( + var onRecoverableError = root$jscomp$0.onRecoverableError, + i$jscomp$2 = 0; + i$jscomp$2 < recoverableErrors.length; + i$jscomp$2++ + ) { + var recoverableError = recoverableErrors[i$jscomp$2], + errorInfo = makeErrorInfo(recoverableError.stack); + runWithFiberInDEV( + recoverableError.source, + onRecoverableError, + recoverableError.value, + errorInfo + ); + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + rootDidHavePassiveEffects || finalizeRender(lanes, commitEndTime); + flushSyncWorkAcrossRoots_impl(0, !1); + } + } finally { + (ReactSharedInternals.T = prevTransition), + (ReactDOMSharedInternals.p = previousUpdateLanePriority); + } } function makeErrorInfo(componentStack) { componentStack = { componentStack: componentStack }; @@ -16048,6 +16219,9 @@ var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + priority.callbackNode = null; + priority.callbackPriority = 0; + priority.cancelPendingCommit = null; if ( (executionContext & (RenderContext | CommitContext)) !== NoContext @@ -16105,6 +16279,7 @@ : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; + ensureRootIsScheduled(priority); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -16326,7 +16501,7 @@ shouldDoubleInvokePassiveEffects && disconnectPassiveEffect(fiber), reappearLayoutEffects(root, fiber.alternate, fiber, !1), shouldDoubleInvokePassiveEffects && - reconnectPassiveEffects(root, fiber, 0, null, !1); + reconnectPassiveEffects(root, fiber, 0, null, !1, 0); } finally { setIsStrictModeForDevtools(!1); } @@ -16371,12 +16546,6 @@ addFiberToLanesMap(root, schedulingFiber, lanes); }); } - function scheduleCallback$1(priorityLevel, callback) { - var actQueue = ReactSharedInternals.actQueue; - return null !== actQueue - ? (actQueue.push(callback), fakeActCallbackNode$1) - : scheduleCallback$3(priorityLevel, callback); - } function warnIfUpdatesNotWrappedWithActDEV(fiber) { isConcurrentActEnvironment() && null === ReactSharedInternals.actQueue && @@ -16492,12 +16661,13 @@ } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -16547,7 +16717,7 @@ null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) - : (suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes)); + : (suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes)); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -16595,7 +16765,7 @@ }); scheduleMicrotask(function () { (executionContext & (RenderContext | CommitContext)) !== NoContext - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -18758,7 +18928,7 @@ console.error( "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX." ); - else if (canDiffStyleForHydrationWarning) { + else { var clientValue; var delimiter = (clientValue = ""), styleName; @@ -19177,42 +19347,36 @@ } case "src": case "href": - if ( - !( - "" !== propKey || - ("a" === tag && "href" === value) || - ("object" === tag && "data" === value) - ) - ) { - "src" === value - ? console.error( - 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ) - : console.error( - 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', - value, - value - ); - hydrateSanitizedAttribute( - domElement, - value, - value, - null, - extraAttributes, - serverDifferences - ); - continue; - } - hydrateSanitizedAttribute( - domElement, - value, - value, - propKey, - extraAttributes, - serverDifferences - ); + "" !== propKey || + ("a" === tag && "href" === value) || + ("object" === tag && "data" === value) + ? hydrateSanitizedAttribute( + domElement, + value, + value, + propKey, + extraAttributes, + serverDifferences + ) + : ("src" === value + ? console.error( + 'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ) + : console.error( + 'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.', + value, + value + ), + hydrateSanitizedAttribute( + domElement, + value, + value, + null, + extraAttributes, + serverDifferences + )); continue; case "action": case "formAction": @@ -21347,8 +21511,12 @@ queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(nearestMounted), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(nearestMounted); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane( + nearestMounted, + lane + ); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -21592,7 +21760,6 @@ REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); - Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -21638,7 +21805,7 @@ rootInstanceStackCursor = createCursor(null), hostTransitionProviderCursor = createCursor(null), hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -21676,11 +21843,6 @@ allNativeEvents = new Set(), registrationNameDependencies = {}, possibleRegistrationNames = {}, - canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), hasReadOnlyValue = { button: !0, checkbox: !0, @@ -21727,8 +21889,6 @@ containerTagInScope: null }, didWarn = {}, - MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", - SVG_NAMESPACE = "http://www.w3.org/2000/svg", shorthandToLonghand = { animation: "animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split( @@ -21879,6 +22039,8 @@ " " ) ), + MATH_NAMESPACE = "http://www.w3.org/1998/Math/MathML", + SVG_NAMESPACE = "http://www.w3.org/2000/svg", aliases = new Map([ ["acceptCharset", "accept-charset"], ["htmlFor", "for"], @@ -22527,6 +22689,11 @@ restoreTarget = null, restoreQueue = null, isInsideEventHandler = !1, + canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), passiveBrowserEventsSupported = !1; if (canUseDOM) try { @@ -22854,19 +23021,21 @@ supportsUserTiming = "undefined" !== typeof performance && "function" === typeof performance.measure, + COMPONENTS_TRACK = "Components \u269b", reusableComponentDevToolDetails = { color: "primary", - track: "Components \u269b" + track: COMPONENTS_TRACK }, reusableComponentOptions = { start: -0, end: -0, detail: { devtools: reusableComponentDevToolDetails } }, + LANES_TRACK_GROUP = "Scheduler \u269b", reusableLaneDevToolDetails = { color: "primary", track: "Blocking", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP }, reusableLaneOptions = { start: -0, @@ -22874,42 +23043,42 @@ detail: { devtools: reusableLaneDevToolDetails } }, blockingLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Blocking", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, transitionLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Transition", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, suspenseLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Suspense", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, idleLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", track: "Idle", - trackGroup: "Scheduler \u269b" + trackGroup: LANES_TRACK_GROUP } } }, @@ -22955,6 +23124,59 @@ yieldStartTime = -1.1, currentUpdateIsNested = !1, nestedUpdateScheduled = !1, + valueCursor = createCursor(null); + var rendererCursorDEV = createCursor(null); + var rendererSigil = {}; + var currentlyRenderingFiber$1 = null, + lastContextDependency = null, + isDisallowedContextReadInDEV = !1, + currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null, + UpdateState = 0, + ReplaceState = 1, + ForceUpdate = 2, + CaptureUpdate = 3, + hasForceUpdate = !1; + var didWarnUpdateInsideUpdate = !1; + var currentlyProcessingQueue = null; + var didReadFromEntangledAsyncAction = !1, + NoFlags = 0, + HasEffect = 1, + Insertion = 2, + Layout = 4, + Passive = 8, + AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0, + _currentRenderer: null, + _currentRenderer2: null + }, ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function () {}, flushPendingUnsafeLifecycleWarnings: function () {}, @@ -23149,7 +23371,79 @@ pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; - var CapturedStacks = new WeakMap(), + var fakeInternalInstance = {}; + var didWarnAboutStateAssignmentForComponent = new Set(); + var didWarnAboutUninitializedState = new Set(); + var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); + var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); + var didWarnAboutDirectlyAssigningPropsToState = new Set(); + var didWarnAboutUndefinedDerivedState = new Set(); + var didWarnAboutContextTypes$1 = new Set(); + var didWarnAboutChildContextTypes = new Set(); + var didWarnAboutInvalidateContextType = new Set(); + var didWarnOnInvalidCallback = new Set(); + Object.freeze(fakeInternalInstance); + var classComponentUpdater = { + isMounted: function (component) { + var owner = current; + if (null !== owner && isRendering && 1 === owner.tag) { + var instance = owner.stateNode; + instance._warnedAboutRefsInRender || + console.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.", + getComponentNameFromFiber(owner) || "A component" + ); + instance._warnedAboutRefsInRender = !0; + } + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ReplaceState; + update.payload = payload; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(inst), + update = createUpdate(lane); + update.tag = ForceUpdate; + void 0 !== callback && + null !== callback && + (warnOnInvalidCallback(callback), (update.callback = callback)); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } + }, + CapturedStacks = new WeakMap(), forkStack = [], forkStackIndex = 0, treeForkProvider = null, @@ -23164,68 +23458,29 @@ isHydrating = !1, didSuspendOrErrorDEV = !1, hydrationDiffRootDEV = null, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error( - "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." - ), - SuspenseyCommitException = Error( - "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." - ), - SuspenseActionException = Error( - "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." - ), - noopSuspenseyCommitThenable = { - then: function () { - console.error( - 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' - ); - } - }, - suspendedThenable = null, - needsToResetSuspendedThenableDEV = !1, - NoFlags = 0, - HasEffect = 1, - Insertion = 2, - Layout = 4, - Passive = 8, - AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0, - _currentRenderer: null, - _currentRenderer2: null + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error( + "Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`." + ), + SuspenseyCommitException = Error( + "Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React." + ), + SuspenseActionException = Error( + "Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary." + ), + noopSuspenseyCommitThenable = { + then: function () { + console.error( + 'Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.' + ); + } }, - currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null, + suspendedThenable = null, + needsToResetSuspendedThenableDEV = !1, currentTreeHiddenStackCursor = createCursor(null), prevEntangledRenderLanesCursor = createCursor(0), prevOnStartTransitionFinish = ReactSharedInternals.S; @@ -23259,7 +23514,7 @@ var didWarnAboutAsyncClientComponent = new Set(); var didWarnAboutUseFormState = new Set(); var renderLanes = 0, - currentlyRenderingFiber$1 = null, + currentlyRenderingFiber = null, currentHook = null, workInProgressHook = null, didScheduleRenderPhaseUpdate = !1, @@ -23273,36 +23528,33 @@ currentHookNameInDev = null, hookTypesDev = null, hookTypesUpdateIndexDev = -1, - ignorePreviousDependencies = !1; - var createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; - }; - var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError - }; - ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; - ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; + ignorePreviousDependencies = !1, + ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError + }; ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; - ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; - ContextOnlyDispatcher.useFormState = throwInvalidHookError; - ContextOnlyDispatcher.useActionState = throwInvalidHookError; - ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; var HooksDispatcherOnMountInDEV = null, HooksDispatcherOnMountWithHookTypesInDEV = null, HooksDispatcherOnUpdateInDEV = null, @@ -23421,39 +23673,35 @@ mountHookTypesDev(); return mountId(); }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + mountHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + mountHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; mountHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + mountHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - mountHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountInDEV.useFormState = function (action, initialState) { - currentHookNameInDev = "useFormState"; - mountHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountInDEV.useOptimistic = function (passthrough) { - currentHookNameInDev = "useOptimistic"; - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); @@ -23559,46 +23807,35 @@ updateHookTypesDev(); return mountId(); }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return mountActionState(action, initialState); + }, + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return mountOptimistic(passthrough); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return mountRefresh(); + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return mountEvent(callback); } }; - HooksDispatcherOnMountWithHookTypesInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnMountWithHookTypesInDEV.useEffectEvent = function ( - callback - ) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return mountEvent(callback); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnMountWithHookTypesInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return mountActionState(action, initialState); - }; - HooksDispatcherOnMountWithHookTypesInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return mountOptimistic(passthrough); - }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); @@ -23704,39 +23941,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnUpdateInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnUpdateInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return updateActionState(action); - }; - HooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); @@ -23842,39 +24075,35 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + updateHookTypesDev(); + warnOnUseFormStateInDev(); + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); + }, + useHostTransitionStatus: useHostTransitionStatus, + useMemoCache: useMemoCache, useCacheRefresh: function () { currentHookNameInDev = "useCacheRefresh"; updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; + }, + useEffectEvent: function (callback) { + currentHookNameInDev = "useEffectEvent"; + updateHookTypesDev(); + return updateEvent(callback); } }; - HooksDispatcherOnRerenderInDEV.useMemoCache = useMemoCache; - HooksDispatcherOnRerenderInDEV.useEffectEvent = function (callback) { - currentHookNameInDev = "useEffectEvent"; - updateHookTypesDev(); - return updateEvent(callback); - }; - HooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - HooksDispatcherOnRerenderInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - updateHookTypesDev(); - warnOnUseFormStateInDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useActionState = function (action) { - currentHookNameInDev = "useActionState"; - updateHookTypesDev(); - return rerenderActionState(action); - }; - HooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -23999,15 +24228,34 @@ mountHookTypesDev(); return mountId(); }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action, initialState) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); mountHookTypesDev(); - return mountRefresh(); + return mountActionState(action, initialState); + }, + useActionState: function (action, initialState) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountActionState(action, initialState); + }, + useOptimistic: function (passthrough) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + mountHookTypesDev(); + return mountOptimistic(passthrough); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + mountHookTypesDev(); + return mountRefresh(); + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24015,34 +24263,6 @@ return mountEvent(callback); } }; - InvalidNestedHooksDispatcherOnMountInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnMountInDEV.useFormState = function ( - action, - initialState - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useActionState = function ( - action, - initialState - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountActionState(action, initialState); - }; - InvalidNestedHooksDispatcherOnMountInDEV.useOptimistic = function ( - passthrough - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - mountHookTypesDev(); - return mountOptimistic(passthrough); - }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24167,15 +24387,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return updateActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return updateOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24183,31 +24422,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnUpdateInDEV.useFormState = function (action) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateActionState(action); - }; - InvalidNestedHooksDispatcherOnUpdateInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return updateOptimistic(passthrough, reducer); - }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); @@ -24332,15 +24546,34 @@ updateHookTypesDev(); return updateWorkInProgressHook().memoizedState; }, - useCacheRefresh: function () { - currentHookNameInDev = "useCacheRefresh"; + useFormState: function (action) { + currentHookNameInDev = "useFormState"; + warnInvalidHookAccess(); updateHookTypesDev(); - return updateWorkInProgressHook().memoizedState; + return rerenderActionState(action); + }, + useActionState: function (action) { + currentHookNameInDev = "useActionState"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderActionState(action); + }, + useOptimistic: function (passthrough, reducer) { + currentHookNameInDev = "useOptimistic"; + warnInvalidHookAccess(); + updateHookTypesDev(); + return rerenderOptimistic(passthrough, reducer); }, useMemoCache: function (size) { warnInvalidHookAccess(); return useMemoCache(size); }, + useHostTransitionStatus: useHostTransitionStatus, + useCacheRefresh: function () { + currentHookNameInDev = "useCacheRefresh"; + updateHookTypesDev(); + return updateWorkInProgressHook().memoizedState; + }, useEffectEvent: function (callback) { currentHookNameInDev = "useEffectEvent"; warnInvalidHookAccess(); @@ -24348,33 +24581,6 @@ return updateEvent(callback); } }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useHostTransitionStatus = - useHostTransitionStatus; - InvalidNestedHooksDispatcherOnRerenderInDEV.useFormState = function ( - action - ) { - currentHookNameInDev = "useFormState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useActionState = function ( - action - ) { - currentHookNameInDev = "useActionState"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderActionState(action); - }; - InvalidNestedHooksDispatcherOnRerenderInDEV.useOptimistic = function ( - passthrough, - reducer - ) { - currentHookNameInDev = "useOptimistic"; - warnInvalidHookAccess(); - updateHookTypesDev(); - return rerenderOptimistic(passthrough, reducer); - }; var callComponent = { "react-stack-bottom-frame": function (Component, props, secondArg) { var wasRendering = isRendering; @@ -24560,78 +24766,6 @@ SubtreeSuspenseContextMask = 1, ForceSuspenseFallback = 2, suspenseStackCursor = createCursor(0), - fakeInternalInstance = {}; - var didWarnAboutStateAssignmentForComponent = new Set(); - var didWarnAboutUninitializedState = new Set(); - var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); - var didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); - var didWarnAboutDirectlyAssigningPropsToState = new Set(); - var didWarnAboutUndefinedDerivedState = new Set(); - var didWarnAboutContextTypes$1 = new Set(); - var didWarnAboutChildContextTypes = new Set(); - var didWarnAboutInvalidateContextType = new Set(); - var didWarnOnInvalidCallback = new Set(); - Object.freeze(fakeInternalInstance); - var classComponentUpdater = { - isMounted: function (component) { - var owner = current; - if (null !== owner && isRendering && 1 === owner.tag) { - var instance = owner.stateNode; - instance._warnedAboutRefsInRender || - console.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.", - getComponentNameFromFiber(owner) || "A component" - ); - instance._warnedAboutRefsInRender = !0; - } - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ReplaceState; - update.payload = payload; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(inst), - update = createUpdate(lane); - update.tag = ForceUpdate; - void 0 !== callback && - null !== callback && - (warnOnInvalidCallback(callback), (update.callback = callback)); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - } - }, reportGlobalError = "function" === typeof reportError ? reportError @@ -24677,23 +24811,10 @@ var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, - retryLane: 0 + retryLane: 0, + hydrationErrors: null }, hasWarnedAboutUsingNoValuePropOnContextProvider = !1, - valueCursor = createCursor(null); - var rendererCursorDEV = createCursor(null); - var rendererSigil = {}; - var currentlyRenderingFiber = null, - lastContextDependency = null, - isDisallowedContextReadInDEV = !1, - UpdateState = 0, - ReplaceState = 1, - ForceUpdate = 2, - CaptureUpdate = 3, - hasForceUpdate = !1; - var didWarnUpdateInsideUpdate = !1; - var currentlyProcessingQueue = null; - var didReadFromEntangledAsyncAction = !1, didWarnAboutUndefinedSnapshotBeforeUpdate = null; didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); var offscreenSubtreeIsHidden = !1, @@ -24703,10 +24824,10 @@ nextEffect = null, inProgressLanes = null, inProgressRoot = null, - shouldFireAfterActiveInstanceBlur = !1, hostParent = null, hostParentIsContainer = !1, currentHoistableRoot = null, + inHydratedSubtree = !1, suspenseyCommitFlag = 8192; var hasBadMapPolyfill = !1; try { @@ -24784,7 +24905,6 @@ RENDER_TIMEOUT_MS = 500, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -24805,8 +24925,7 @@ didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); - var fakeActCallbackNode$1 = {}, - firstScheduledRoot = null, + var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, didScheduleMicrotask_act = !1, @@ -24884,7 +25003,6 @@ didWarnFormActionMethod = !1, didWarnPopoverTargetObject = !1; var didWarnForNewBooleanPropsWithEmptyValue = {}; - var canDiffStyleForHydrationWarning = !0; var NORMALIZE_NEWLINES_REGEX = /\r\n?/g, NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g, xlinkNamespace = "http://www.w3.org/1999/xlink", @@ -25279,52 +25397,43 @@ ), lastScheduledReplayQueue = null; ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = - function (children, JSCompiler_OptimizeArgumentsArray_p2) { + function (children) { var root = this._internalRoot; if (null === root) throw Error("Cannot update an unmounted root."); - "function" === typeof JSCompiler_OptimizeArgumentsArray_p2 + var args = arguments; + "function" === typeof args[1] ? console.error( "does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ) - : isValidContainer(JSCompiler_OptimizeArgumentsArray_p2) + : isValidContainer(args[1]) ? console.error( "You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root." ) - : "undefined" !== typeof JSCompiler_OptimizeArgumentsArray_p2 && + : "undefined" !== typeof args[1] && console.error( "You passed a second argument to root.render(...) but it only accepts one argument." ); - JSCompiler_OptimizeArgumentsArray_p2 = root.current; - var lane = requestUpdateLane(JSCompiler_OptimizeArgumentsArray_p2); - updateContainerImpl( - JSCompiler_OptimizeArgumentsArray_p2, - lane, - children, - root, - null, - null - ); + args = children; + var current = root.current, + lane = requestUpdateLane(current); + updateContainerImpl(current, lane, args, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = - function (JSCompiler_OptimizeArgumentsArray_p3) { - "function" === typeof JSCompiler_OptimizeArgumentsArray_p3 && + function () { + var args = arguments; + "function" === typeof args[0] && console.error( "does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()." ); - JSCompiler_OptimizeArgumentsArray_p3 = this._internalRoot; - if (null !== JSCompiler_OptimizeArgumentsArray_p3) { + args = this._internalRoot; + if (null !== args) { this._internalRoot = null; - var container = JSCompiler_OptimizeArgumentsArray_p3.containerInfo; + var container = args.containerInfo; (executionContext & (RenderContext | CommitContext)) !== NoContext && console.error( "Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition." ); - updateContainerSync( - null, - JSCompiler_OptimizeArgumentsArray_p3, - null, - null - ); + updateContainerSync(null, args, null, null); flushSyncWork$1(); container[internalContainerInstanceKey] = null; } @@ -25348,11 +25457,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-372ec00c-20241209" !== isomorphicReactPackageVersion) + if ("19.1.0-experimental-9463d51e-20241219" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-372ec00c-20241209\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.1.0-experimental-9463d51e-20241219\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25389,11 +25498,10 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-372ec00c-20241209", + version: "19.1.0-experimental-9463d51e-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-372ec00c-20241209" + reconcilerVersion: "19.1.0-experimental-9463d51e-20241219" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25582,11 +25690,13 @@ initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(options); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -25865,7 +25975,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-372ec00c-20241209"; + exports.version = "19.1.0-experimental-9463d51e-20241219"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js index ebde9db05a8d2..33b2316a1d558 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js @@ -55,7 +55,6 @@ var REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"); Symbol.for("react.scope"); -Symbol.for("react.debug_trace_mode"); var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"); Symbol.for("react.legacy_hidden"); Symbol.for("react.tracing_marker"); @@ -346,13 +345,11 @@ function describeFiber(fiber) { return describeBuiltInComponentFrame("SuspenseList"); case 0: case 15: - return (fiber = describeNativeComponentFrame(fiber.type, !1)), fiber; + return describeNativeComponentFrame(fiber.type, !1); case 11: - return ( - (fiber = describeNativeComponentFrame(fiber.type.render, !1)), fiber - ); + return describeNativeComponentFrame(fiber.type.render, !1); case 1: - return (fiber = describeNativeComponentFrame(fiber.type, !0)), fiber; + return describeNativeComponentFrame(fiber.type, !0); default: return ""; } @@ -560,7 +557,7 @@ function popHostContext(fiber) { (HostTransitionContext._currentValue = sharedNotPendingObject)); } var hasOwnProperty = Object.prototype.hasOwnProperty, - scheduleCallback$3 = Scheduler.unstable_scheduleCallback, + scheduleCallback$2 = Scheduler.unstable_scheduleCallback, cancelCallback$1 = Scheduler.unstable_cancelCallback, shouldYield = Scheduler.unstable_shouldYield, requestPaint = Scheduler.unstable_requestPaint, @@ -576,34 +573,6 @@ var hasOwnProperty = Object.prototype.hasOwnProperty, rendererID = null, injectedHook = null, isDevToolsPresent = "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__; -function onCommitRoot(root, eventPriority) { - if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) - try { - var didError = 128 === (root.current.flags & 128); - switch (eventPriority) { - case 2: - var schedulerPriority = ImmediatePriority; - break; - case 8: - schedulerPriority = UserBlockingPriority; - break; - case 32: - schedulerPriority = NormalPriority$1; - break; - case 268435456: - schedulerPriority = IdlePriority; - break; - default: - schedulerPriority = NormalPriority$1; - } - injectedHook.onCommitFiberRoot( - rendererID, - root, - schedulerPriority, - didError - ); - } catch (err) {} -} function setIsStrictModeForDevtools(newIsStrictMode) { "function" === typeof log$1 && unstable_setDisableYieldValue(newIsStrictMode); if (injectedHook && "function" === typeof injectedHook.setStrictMode) @@ -784,54 +753,6 @@ function markRootUpdated$1(root, updateLane) { 268435456 !== updateLane && ((root.suspendedLanes = 0), (root.pingedLanes = 0), (root.warmLanes = 0)); } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { - var previouslyPendingLanes = root.pendingLanes; - root.pendingLanes = remainingLanes; - root.suspendedLanes = 0; - root.pingedLanes = 0; - root.warmLanes = 0; - root.expiredLanes &= remainingLanes; - root.entangledLanes &= remainingLanes; - root.errorRecoveryDisabledLanes &= remainingLanes; - root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, - hiddenUpdates = root.hiddenUpdates; - for ( - remainingLanes = previouslyPendingLanes & ~remainingLanes; - 0 < remainingLanes; - - ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; - if (null !== hiddenUpdatesForLane) - for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ - ) { - var update = hiddenUpdatesForLane[index$7]; - null !== update && (update.lane &= -536870913); - } - remainingLanes &= ~lane; - } - 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); -} function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; root.suspendedLanes &= ~spawnedLane; @@ -852,6 +773,46 @@ function markRootEntangled(root, entangledLanes) { rootEntangledLanes &= ~lane; } } +function getBumpedLaneForHydrationByLane(lane) { + switch (lane) { + case 2: + lane = 1; + break; + case 8: + lane = 4; + break; + case 32: + lane = 16; + break; + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + case 4194304: + case 8388608: + case 16777216: + case 33554432: + lane = 64; + break; + case 268435456: + lane = 134217728; + break; + default: + lane = 0; + } + return lane; +} function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { @@ -998,12 +959,7 @@ function registerDirectEvent(registrationName, dependencies) { ) allNativeEvents.add(dependencies[registrationName]); } -var canUseDOM = !( - "undefined" === typeof window || - "undefined" === typeof window.document || - "undefined" === typeof window.document.createElement - ), - VALID_ATTRIBUTE_NAME_REGEX = RegExp( +var VALID_ATTRIBUTE_NAME_REGEX = RegExp( "^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$" ), illegalAttributeNameCache = {}, @@ -1612,7 +1568,12 @@ function getListener(inst, registrationName) { ); return stateNode; } -var passiveBrowserEventsSupported = !1; +var canUseDOM = !( + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ), + passiveBrowserEventsSupported = !1; if (canUseDOM) try { var options = {}; @@ -2099,19 +2060,19 @@ function getTargetInstForChangeEvent(domEventName, targetInst) { } var isInputEventSupported = !1; if (canUseDOM) { - var JSCompiler_inline_result$jscomp$305; + var JSCompiler_inline_result$jscomp$306; if (canUseDOM) { - var isSupported$jscomp$inline_441 = "oninput" in document; - if (!isSupported$jscomp$inline_441) { - var element$jscomp$inline_442 = document.createElement("div"); - element$jscomp$inline_442.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_441 = - "function" === typeof element$jscomp$inline_442.oninput; + var isSupported$jscomp$inline_436 = "oninput" in document; + if (!isSupported$jscomp$inline_436) { + var element$jscomp$inline_437 = document.createElement("div"); + element$jscomp$inline_437.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_436 = + "function" === typeof element$jscomp$inline_437.oninput; } - JSCompiler_inline_result$jscomp$305 = isSupported$jscomp$inline_441; - } else JSCompiler_inline_result$jscomp$305 = !1; + JSCompiler_inline_result$jscomp$306 = isSupported$jscomp$inline_436; + } else JSCompiler_inline_result$jscomp$306 = !1; isInputEventSupported = - JSCompiler_inline_result$jscomp$305 && + JSCompiler_inline_result$jscomp$306 && (!document.documentMode || 9 < document.documentMode); } function stopWatchingForValueChange() { @@ -2263,97 +2224,6 @@ function hasSelectionCapabilities(elem) { "true" === elem.contentEditable) ); } -function restoreSelection(priorSelectionInformation, containerInfo) { - var curFocusedElem = getActiveElementDeep(containerInfo); - containerInfo = priorSelectionInformation.focusedElem; - var priorSelectionRange = priorSelectionInformation.selectionRange; - if ( - curFocusedElem !== containerInfo && - containerInfo && - containerInfo.ownerDocument && - containsNode(containerInfo.ownerDocument.documentElement, containerInfo) - ) { - if (null !== priorSelectionRange && hasSelectionCapabilities(containerInfo)) - if ( - ((priorSelectionInformation = priorSelectionRange.start), - (curFocusedElem = priorSelectionRange.end), - void 0 === curFocusedElem && - (curFocusedElem = priorSelectionInformation), - "selectionStart" in containerInfo) - ) - (containerInfo.selectionStart = priorSelectionInformation), - (containerInfo.selectionEnd = Math.min( - curFocusedElem, - containerInfo.value.length - )); - else if ( - ((curFocusedElem = - ((priorSelectionInformation = - containerInfo.ownerDocument || document) && - priorSelectionInformation.defaultView) || - window), - curFocusedElem.getSelection) - ) { - curFocusedElem = curFocusedElem.getSelection(); - var length = containerInfo.textContent.length, - start = Math.min(priorSelectionRange.start, length); - priorSelectionRange = - void 0 === priorSelectionRange.end - ? start - : Math.min(priorSelectionRange.end, length); - !curFocusedElem.extend && - start > priorSelectionRange && - ((length = priorSelectionRange), - (priorSelectionRange = start), - (start = length)); - length = getNodeForCharacterOffset(containerInfo, start); - var endMarker = getNodeForCharacterOffset( - containerInfo, - priorSelectionRange - ); - length && - endMarker && - (1 !== curFocusedElem.rangeCount || - curFocusedElem.anchorNode !== length.node || - curFocusedElem.anchorOffset !== length.offset || - curFocusedElem.focusNode !== endMarker.node || - curFocusedElem.focusOffset !== endMarker.offset) && - ((priorSelectionInformation = - priorSelectionInformation.createRange()), - priorSelectionInformation.setStart(length.node, length.offset), - curFocusedElem.removeAllRanges(), - start > priorSelectionRange - ? (curFocusedElem.addRange(priorSelectionInformation), - curFocusedElem.extend(endMarker.node, endMarker.offset)) - : (priorSelectionInformation.setEnd( - endMarker.node, - endMarker.offset - ), - curFocusedElem.addRange(priorSelectionInformation))); - } - priorSelectionInformation = []; - for ( - curFocusedElem = containerInfo; - (curFocusedElem = curFocusedElem.parentNode); - - ) - 1 === curFocusedElem.nodeType && - priorSelectionInformation.push({ - element: curFocusedElem, - left: curFocusedElem.scrollLeft, - top: curFocusedElem.scrollTop - }); - "function" === typeof containerInfo.focus && containerInfo.focus(); - for ( - containerInfo = 0; - containerInfo < priorSelectionInformation.length; - containerInfo++ - ) - (curFocusedElem = priorSelectionInformation[containerInfo]), - (curFocusedElem.element.scrollLeft = curFocusedElem.left), - (curFocusedElem.element.scrollTop = curFocusedElem.top); - } -} var skipSelectionChangeEvent = canUseDOM && "documentMode" in document && 11 >= document.documentMode, activeElement = null, @@ -2484,7 +2354,7 @@ function setCurrentTrackFromLanes(lanes) { : "Other"; } var blockingLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2494,7 +2364,7 @@ var blockingLaneMarker = { } }, transitionLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2504,7 +2374,7 @@ var blockingLaneMarker = { } }, suspenseLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2514,7 +2384,7 @@ var blockingLaneMarker = { } }, idleLaneMarker = { - startTime: 0, + startTime: 0.003, detail: { devtools: { color: "primary-light", @@ -2523,6 +2393,32 @@ var blockingLaneMarker = { } } }; +function logComponentRender(fiber, startTime, endTime, wasHydrated) { + var name = getComponentNameFromFiber(fiber); + if (null !== name && supportsUserTiming) { + var selfTime = fiber.actualDuration; + if (null === fiber.alternate || fiber.alternate.child !== fiber.child) + for (fiber = fiber.child; null !== fiber; fiber = fiber.sibling) + selfTime -= fiber.actualDuration; + reusableComponentDevToolDetails.color = + 0.5 > selfTime + ? wasHydrated + ? "tertiary-light" + : "primary-light" + : 10 > selfTime + ? wasHydrated + ? "tertiary" + : "primary" + : 100 > selfTime + ? wasHydrated + ? "tertiary-dark" + : "primary-dark" + : "error"; + reusableComponentOptions.start = startTime; + reusableComponentOptions.end = endTime; + performance.measure(name, reusableComponentOptions); + } +} function logComponentEffect(fiber, startTime, endTime, selfTime) { fiber = getComponentNameFromFiber(fiber); null !== fiber && @@ -2539,23 +2435,18 @@ function logComponentEffect(fiber, startTime, endTime, selfTime) { (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } -function logRenderPhase(startTime, endTime) { +function logSuspendedRenderPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Render", reusableLaneOptions)); -} -function logSuspendedRenderPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Prewarm", reusableLaneOptions)); } -function logSuspendedWithDelayPhase(startTime, endTime) { +function logSuspendedWithDelayPhase(startTime, endTime, lanes) { supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), performance.measure("Suspended", reusableLaneOptions)); @@ -2565,28 +2456,7 @@ function logErroredRenderPhase(startTime, endTime) { ((reusableLaneDevToolDetails.color = "error"), (reusableLaneOptions.start = startTime), (reusableLaneOptions.end = endTime), - performance.measure("Errored Render", reusableLaneOptions)); -} -function logSuspenseThrottlePhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Throttled", reusableLaneOptions)); -} -function logSuspendedCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-light"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Suspended", reusableLaneOptions)); -} -function logCommitPhase(startTime, endTime) { - supportsUserTiming && - ((reusableLaneDevToolDetails.color = "secondary-dark"), - (reusableLaneOptions.start = startTime), - (reusableLaneOptions.end = endTime), - performance.measure("Commit", reusableLaneOptions)); + performance.measure("Errored", reusableLaneOptions)); } var concurrentQueues = [], concurrentQueuesIndex = 0, @@ -2788,378 +2658,193 @@ function transferActualDuration(fiber) { for (var child = fiber.child; child; ) (fiber.actualDuration += child.actualDuration), (child = child.sibling); } -var CapturedStacks = new WeakMap(); -function createCapturedValueAtFiber(value, source) { - if ("object" === typeof value && null !== value) { - var existing = CapturedStacks.get(value); - if (void 0 !== existing) return existing; - source = { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; - CapturedStacks.set(value, source); - return source; - } - return { - value: value, - source: source, - stack: getStackByFiberInDevAndProd(source) - }; +var valueCursor = createCursor(null), + currentlyRenderingFiber$1 = null, + lastContextDependency = null; +function pushProvider(providerFiber, context, nextValue) { + push(valueCursor, context._currentValue); + context._currentValue = nextValue; } -var forkStack = [], - forkStackIndex = 0, - treeForkProvider = null, - treeForkCount = 0, - idStack = [], - idStackIndex = 0, - treeContextProvider = null, - treeContextId = 1, - treeContextOverflow = ""; -function pushTreeFork(workInProgress, totalChildren) { - forkStack[forkStackIndex++] = treeForkCount; - forkStack[forkStackIndex++] = treeForkProvider; - treeForkProvider = workInProgress; - treeForkCount = totalChildren; +function popProvider(context) { + context._currentValue = valueCursor.current; + pop(valueCursor); } -function pushTreeId(workInProgress, totalChildren, index) { - idStack[idStackIndex++] = treeContextId; - idStack[idStackIndex++] = treeContextOverflow; - idStack[idStackIndex++] = treeContextProvider; - treeContextProvider = workInProgress; - var baseIdWithLeadingBit = treeContextId; - workInProgress = treeContextOverflow; - var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; - baseIdWithLeadingBit &= ~(1 << baseLength); - index += 1; - var length = 32 - clz32(totalChildren) + baseLength; - if (30 < length) { - var numberOfOverflowBits = baseLength - (baseLength % 5); - length = ( - baseIdWithLeadingBit & - ((1 << numberOfOverflowBits) - 1) - ).toString(32); - baseIdWithLeadingBit >>= numberOfOverflowBits; - baseLength -= numberOfOverflowBits; - treeContextId = - (1 << (32 - clz32(totalChildren) + baseLength)) | - (index << baseLength) | - baseIdWithLeadingBit; - treeContextOverflow = length + workInProgress; - } else - (treeContextId = - (1 << length) | (index << baseLength) | baseIdWithLeadingBit), - (treeContextOverflow = workInProgress); +function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { + for (; null !== parent; ) { + var alternate = parent.alternate; + (parent.childLanes & renderLanes) !== renderLanes + ? ((parent.childLanes |= renderLanes), + null !== alternate && (alternate.childLanes |= renderLanes)) + : null !== alternate && + (alternate.childLanes & renderLanes) !== renderLanes && + (alternate.childLanes |= renderLanes); + if (parent === propagationRoot) break; + parent = parent.return; + } } -function pushMaterializedTreeId(workInProgress) { - null !== workInProgress.return && - (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); +function propagateContextChanges( + workInProgress, + contexts, + renderLanes, + forcePropagateEntireTree +) { + var fiber = workInProgress.child; + null !== fiber && (fiber.return = workInProgress); + for (; null !== fiber; ) { + var list = fiber.dependencies; + if (null !== list) { + var nextFiber = fiber.child; + list = list.firstContext; + a: for (; null !== list; ) { + var dependency = list; + list = fiber; + for (var i = 0; i < contexts.length; i++) + if (dependency.context === contexts[i]) { + list.lanes |= renderLanes; + dependency = list.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleContextWorkOnParentPath( + list.return, + renderLanes, + workInProgress + ); + forcePropagateEntireTree || (nextFiber = null); + break a; + } + list = dependency.next; + } + } else if (18 === fiber.tag) { + nextFiber = fiber.return; + if (null === nextFiber) throw Error(formatProdErrorMessage(341)); + nextFiber.lanes |= renderLanes; + list = nextFiber.alternate; + null !== list && (list.lanes |= renderLanes); + scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); + nextFiber = null; + } else nextFiber = fiber.child; + if (null !== nextFiber) nextFiber.return = fiber; + else + for (nextFiber = fiber; null !== nextFiber; ) { + if (nextFiber === workInProgress) { + nextFiber = null; + break; + } + fiber = nextFiber.sibling; + if (null !== fiber) { + fiber.return = nextFiber.return; + nextFiber = fiber; + break; + } + nextFiber = nextFiber.return; + } + fiber = nextFiber; + } } -function popTreeContext(workInProgress) { - for (; workInProgress === treeForkProvider; ) - (treeForkProvider = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null), - (treeForkCount = forkStack[--forkStackIndex]), - (forkStack[forkStackIndex] = null); - for (; workInProgress === treeContextProvider; ) - (treeContextProvider = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextOverflow = idStack[--idStackIndex]), - (idStack[idStackIndex] = null), - (treeContextId = idStack[--idStackIndex]), - (idStack[idStackIndex] = null); -} -var hydrationParentFiber = null, - nextHydratableInstance = null, - isHydrating = !1, - hydrationErrors = null, - rootOrSingletonContext = !1, - HydrationMismatchException = Error(formatProdErrorMessage(519)); -function throwOnHydrationMismatch(fiber) { - var error = Error(formatProdErrorMessage(418, "")); - queueHydrationError(createCapturedValueAtFiber(error, fiber)); - throw HydrationMismatchException; +function propagateParentContextChanges( + current, + workInProgress, + renderLanes, + forcePropagateEntireTree +) { + current = null; + for ( + var parent = workInProgress, isInsidePropagationBailout = !1; + null !== parent; + + ) { + if (!isInsidePropagationBailout) + if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; + else if (0 !== (parent.flags & 262144)) break; + if (10 === parent.tag) { + var currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent = currentParent.memoizedProps; + if (null !== currentParent) { + var context = parent.type; + objectIs(parent.pendingProps.value, currentParent.value) || + (null !== current ? current.push(context) : (current = [context])); + } + } else if (parent === hostTransitionProviderCursor.current) { + currentParent = parent.alternate; + if (null === currentParent) throw Error(formatProdErrorMessage(387)); + currentParent.memoizedState.memoizedState !== + parent.memoizedState.memoizedState && + (null !== current + ? current.push(HostTransitionContext) + : (current = [HostTransitionContext])); + } + parent = parent.return; + } + null !== current && + propagateContextChanges( + workInProgress, + current, + renderLanes, + forcePropagateEntireTree + ); + workInProgress.flags |= 262144; } -function prepareToHydrateHostInstance(fiber) { - var instance = fiber.stateNode, - type = fiber.type, - props = fiber.memoizedProps; - instance[internalInstanceKey] = fiber; - instance[internalPropsKey] = props; - switch (type) { - case "dialog": - listenToNonDelegatedEvent("cancel", instance); - listenToNonDelegatedEvent("close", instance); - break; - case "iframe": - case "object": - case "embed": - listenToNonDelegatedEvent("load", instance); - break; - case "video": - case "audio": - for (type = 0; type < mediaEventTypes.length; type++) - listenToNonDelegatedEvent(mediaEventTypes[type], instance); - break; - case "source": - listenToNonDelegatedEvent("error", instance); - break; - case "img": - case "image": - case "link": - listenToNonDelegatedEvent("error", instance); - listenToNonDelegatedEvent("load", instance); - break; - case "details": - listenToNonDelegatedEvent("toggle", instance); - break; - case "input": - listenToNonDelegatedEvent("invalid", instance); - initInput( - instance, - props.value, - props.defaultValue, - props.checked, - props.defaultChecked, - props.type, - props.name, - !0 - ); - track(instance); - break; - case "select": - listenToNonDelegatedEvent("invalid", instance); - break; - case "textarea": - listenToNonDelegatedEvent("invalid", instance), - initTextarea(instance, props.value, props.defaultValue, props.children), - track(instance); +function checkIfContextChanged(currentDependencies) { + for ( + currentDependencies = currentDependencies.firstContext; + null !== currentDependencies; + + ) { + if ( + !objectIs( + currentDependencies.context._currentValue, + currentDependencies.memoizedValue + ) + ) + return !0; + currentDependencies = currentDependencies.next; } - type = props.children; - ("string" !== typeof type && - "number" !== typeof type && - "bigint" !== typeof type) || - instance.textContent === "" + type || - !0 === props.suppressHydrationWarning || - checkForUnmatchedText(instance.textContent, type) - ? (null != props.popover && - (listenToNonDelegatedEvent("beforetoggle", instance), - listenToNonDelegatedEvent("toggle", instance)), - null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), - null != props.onScrollEnd && - listenToNonDelegatedEvent("scrollend", instance), - null != props.onClick && (instance.onclick = noop$2), - (instance = !0)) - : (instance = !1); - instance || throwOnHydrationMismatch(fiber); + return !1; } -function popToNextHostParent(fiber) { - for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) - switch (hydrationParentFiber.tag) { - case 3: - case 27: - rootOrSingletonContext = !0; - return; - case 5: - case 13: - rootOrSingletonContext = !1; - return; - default: - hydrationParentFiber = hydrationParentFiber.return; - } +function prepareToReadContext(workInProgress) { + currentlyRenderingFiber$1 = workInProgress; + lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && (workInProgress.firstContext = null); } -function popHydrationState(fiber) { - if (fiber !== hydrationParentFiber) return !1; - if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; - var shouldClear = !1, - JSCompiler_temp; - if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { - if ((JSCompiler_temp = 5 === fiber.tag)) - (JSCompiler_temp = fiber.type), - (JSCompiler_temp = - !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || - shouldSetTextContent(fiber.type, fiber.memoizedProps)); - JSCompiler_temp = !JSCompiler_temp; - } - JSCompiler_temp && (shouldClear = !0); - shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); - popToNextHostParent(fiber); - if (13 === fiber.tag) { - fiber = fiber.memoizedState; - fiber = null !== fiber ? fiber.dehydrated : null; - if (!fiber) throw Error(formatProdErrorMessage(317)); - a: { - fiber = fiber.nextSibling; - for (shouldClear = 0; fiber; ) { - if (8 === fiber.nodeType) - if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { - if (0 === shouldClear) { - nextHydratableInstance = getNextHydratable(fiber.nextSibling); - break a; - } - shouldClear--; - } else - ("$" !== JSCompiler_temp && - "$!" !== JSCompiler_temp && - "$?" !== JSCompiler_temp) || - shouldClear++; - fiber = fiber.nextSibling; - } - nextHydratableInstance = null; - } - } else - nextHydratableInstance = hydrationParentFiber - ? getNextHydratable(fiber.stateNode.nextSibling) - : null; - return !0; +function readContext(context) { + return readContextForConsumer(currentlyRenderingFiber$1, context); } -function resetHydrationState() { - nextHydratableInstance = hydrationParentFiber = null; - isHydrating = !1; +function readContextDuringReconciliation(consumer, context) { + null === currentlyRenderingFiber$1 && prepareToReadContext(consumer); + return readContextForConsumer(consumer, context); } -function queueHydrationError(error) { - null === hydrationErrors - ? (hydrationErrors = [error]) - : hydrationErrors.push(error); +function readContextForConsumer(consumer, context) { + var value = context._currentValue; + context = { context: context, memoizedValue: value, next: null }; + if (null === lastContextDependency) { + if (null === consumer) throw Error(formatProdErrorMessage(308)); + lastContextDependency = context; + consumer.dependencies = { lanes: 0, firstContext: context }; + consumer.flags |= 524288; + } else lastContextDependency = lastContextDependency.next = context; + return value; } -var SuspenseException = Error(formatProdErrorMessage(460)), - SuspenseyCommitException = Error(formatProdErrorMessage(474)), - SuspenseActionException = Error(formatProdErrorMessage(542)), - noopSuspenseyCommitThenable = { then: function () {} }; -function isThenableResolved(thenable) { - thenable = thenable.status; - return "fulfilled" === thenable || "rejected" === thenable; -} -function noop$4() {} -function trackUsedThenable(thenableState, thenable, index) { - index = thenableState[index]; - void 0 === index - ? thenableState.push(thenable) - : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - default: - if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); - else { - thenableState = workInProgressRoot; - if (null !== thenableState && 100 < thenableState.shellSuspendCounter) - throw Error(formatProdErrorMessage(482)); - thenableState = thenable; - thenableState.status = "pending"; - thenableState.then( - function (fulfilledValue) { - if ("pending" === thenable.status) { - var fulfilledThenable = thenable; - fulfilledThenable.status = "fulfilled"; - fulfilledThenable.value = fulfilledValue; - } - }, - function (error) { - if ("pending" === thenable.status) { - var rejectedThenable = thenable; - rejectedThenable.status = "rejected"; - rejectedThenable.reason = error; - } - } - ); - } - switch (thenable.status) { - case "fulfilled": - return thenable.value; - case "rejected": - throw ( - ((thenableState = thenable.reason), - checkIfUseWrappedInAsyncCatch(thenableState), - thenableState) - ); - } - suspendedThenable = thenable; - throw SuspenseException; - } -} -var suspendedThenable = null; -function getSuspendedThenable() { - if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); - var thenable = suspendedThenable; - suspendedThenable = null; - return thenable; -} -function checkIfUseWrappedInAsyncCatch(rejectedReason) { - if ( - rejectedReason === SuspenseException || - rejectedReason === SuspenseActionException - ) - throw Error(formatProdErrorMessage(483)); -} -var AbortControllerLocal = - "undefined" !== typeof AbortController - ? AbortController - : function () { - var listeners = [], - signal = (this.signal = { - aborted: !1, - addEventListener: function (type, listener) { - listeners.push(listener); - } - }); - this.abort = function () { - signal.aborted = !0; - listeners.forEach(function (listener) { - return listener(); - }); - }; - }, - scheduleCallback$2 = Scheduler.unstable_scheduleCallback, - NormalPriority = Scheduler.unstable_NormalPriority, - CacheContext = { - $$typeof: REACT_CONTEXT_TYPE, - Consumer: null, - Provider: null, - _currentValue: null, - _currentValue2: null, - _threadCount: 0 - }; -function createCache() { - return { - controller: new AbortControllerLocal(), - data: new Map(), - refCount: 0 - }; -} -function releaseCache(cache) { - cache.refCount--; - 0 === cache.refCount && - scheduleCallback$2(NormalPriority, function () { - cache.controller.abort(); - }); -} -var currentEntangledListeners = null, - currentEntangledPendingCount = 0, - currentEntangledLane = 0, - currentEntangledActionThenable = null; -function entangleAsyncAction(transition, thenable) { - if (null === currentEntangledListeners) { - var entangledListeners = (currentEntangledListeners = []); - currentEntangledPendingCount = 0; - currentEntangledLane = requestTransitionLane(); - currentEntangledActionThenable = { - status: "pending", - value: void 0, - then: function (resolve) { - entangledListeners.push(resolve); - } - }; - } - currentEntangledPendingCount++; - thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); - return thenable; +var currentEntangledListeners = null, + currentEntangledPendingCount = 0, + currentEntangledLane = 0, + currentEntangledActionThenable = null; +function entangleAsyncAction(transition, thenable) { + if (null === currentEntangledListeners) { + var entangledListeners = (currentEntangledListeners = []); + currentEntangledPendingCount = 0; + currentEntangledLane = requestTransitionLane(); + currentEntangledActionThenable = { + status: "pending", + value: void 0, + then: function (resolve) { + entangledListeners.push(resolve); + } + }; + } + currentEntangledPendingCount++; + thenable.then(pingEngtangledActionScope, pingEngtangledActionScope); + return thenable; } function pingEngtangledActionScope() { if ( @@ -3201,1346 +2886,1170 @@ function chainThenableValue(thenable, result) { ); return thenableWithOverride; } -var currentTreeHiddenStackCursor = createCursor(null), - prevEntangledRenderLanesCursor = createCursor(0); -function pushHiddenContext(fiber, context) { - fiber = entangledRenderLanes; - push(prevEntangledRenderLanesCursor, fiber); - push(currentTreeHiddenStackCursor, context); - entangledRenderLanes = fiber | context.baseLanes; +var hasForceUpdate = !1; +function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { pending: null, lanes: 0, hiddenCallbacks: null }, + callbacks: null + }; } -function reuseHiddenContextOnStack() { - push(prevEntangledRenderLanesCursor, entangledRenderLanes); - push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); +function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && + (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + callbacks: null + }); } -function popHiddenContext() { - entangledRenderLanes = prevEntangledRenderLanesCursor.current; - pop(currentTreeHiddenStackCursor); - pop(prevEntangledRenderLanesCursor); +function createUpdate(lane) { + return { lane: lane, tag: 0, payload: null, callback: null, next: null }; } -var prevOnStartTransitionFinish = ReactSharedInternals.S; -ReactSharedInternals.S = function (transition, returnValue) { +function enqueueUpdate(fiber, update, lane) { + var updateQueue = fiber.updateQueue; + if (null === updateQueue) return null; + updateQueue = updateQueue.shared; + if (0 !== (executionContext & 2)) { + var pending = updateQueue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + updateQueue.pending = update; + update = getRootForUpdatedFiber(fiber); + markUpdateLaneFromFiberToRoot(fiber, null, lane); + return update; + } + enqueueUpdate$1(fiber, updateQueue, update, lane); + return getRootForUpdatedFiber(fiber); +} +function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } +} +function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; if ( - "object" === typeof returnValue && - null !== returnValue && - "function" === typeof returnValue.then + null !== current && + ((current = current.updateQueue), queue === current) ) { - if (0 > transitionStartTime && 0 > transitionUpdateTime) { - transitionStartTime = now(); - var newEventTime = resolveEventTimeStamp(), - newEventType = resolveEventType(); - if ( - newEventTime !== transitionEventTime || - newEventType !== transitionEventType - ) - transitionEventIsRepeat = !1; - transitionEventTime = newEventTime; - transitionEventType = newEventType; - } - entangleAsyncAction(transition, returnValue); + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + if (null !== queue) { + do { + var clone = { + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: null, + next: null + }; + null === newLast + ? (newFirst = newLast = clone) + : (newLast = newLast.next = clone); + queue = queue.next; + } while (null !== queue); + null === newLast + ? (newFirst = newLast = capturedUpdate) + : (newLast = newLast.next = capturedUpdate); + } else newFirst = newLast = capturedUpdate; + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + callbacks: current.callbacks + }; + workInProgress.updateQueue = queue; + return; } - null !== prevOnStartTransitionFinish && - prevOnStartTransitionFinish(transition, returnValue); -}; -var resumedCache = createCursor(null); -function peekCacheFromPool() { - var cacheResumedFromPreviousRender = resumedCache.current; - return null !== cacheResumedFromPreviousRender - ? cacheResumedFromPreviousRender - : workInProgressRoot.pooledCache; + workInProgress = queue.lastBaseUpdate; + null === workInProgress + ? (queue.firstBaseUpdate = capturedUpdate) + : (workInProgress.next = capturedUpdate); + queue.lastBaseUpdate = capturedUpdate; } -function pushTransition(offscreenWorkInProgress, prevCachePool) { - null === prevCachePool - ? push(resumedCache, resumedCache.current) - : push(resumedCache, prevCachePool.pool); -} -function getSuspendedCache() { - var cacheFromPool = peekCacheFromPool(); - return null === cacheFromPool - ? null - : { parent: CacheContext._currentValue, pool: cacheFromPool }; -} -var renderLanes = 0, - currentlyRenderingFiber$1 = null, - currentHook = null, - workInProgressHook = null, - didScheduleRenderPhaseUpdate = !1, - didScheduleRenderPhaseUpdateDuringThisPass = !1, - shouldDoubleInvokeUserFnsInHooksDEV = !1, - localIdCounter = 0, - thenableIndexCounter$1 = 0, - thenableState$1 = null, - globalClientIdCounter = 0; -function throwInvalidHookError() { - throw Error(formatProdErrorMessage(321)); -} -function areHookInputsEqual(nextDeps, prevDeps) { - if (null === prevDeps) return !1; - for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) - if (!objectIs(nextDeps[i], prevDeps[i])) return !1; - return !0; +var didReadFromEntangledAsyncAction = !1; +function suspendIfUpdateReadFromEntangledAsyncAction() { + if (didReadFromEntangledAsyncAction) { + var entangledActionThenable = currentEntangledActionThenable; + if (null !== entangledActionThenable) throw entangledActionThenable; + } } -function renderWithHooks( - current, - workInProgress, - Component, +function processUpdateQueue( + workInProgress$jscomp$0, props, - secondArg, - nextRenderLanes + instance$jscomp$0, + renderLanes ) { - renderLanes = nextRenderLanes; - currentlyRenderingFiber$1 = workInProgress; - workInProgress.memoizedState = null; - workInProgress.updateQueue = null; - workInProgress.lanes = 0; - ReactSharedInternals.H = - null === current || null === current.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate; - shouldDoubleInvokeUserFnsInHooksDEV = !1; - nextRenderLanes = Component(props, secondArg); - shouldDoubleInvokeUserFnsInHooksDEV = !1; - didScheduleRenderPhaseUpdateDuringThisPass && - (nextRenderLanes = renderWithHooksAgain( - workInProgress, - Component, - props, - secondArg - )); - finishRenderingHooks(current); - return nextRenderLanes; -} -function finishRenderingHooks(current) { - ReactSharedInternals.H = ContextOnlyDispatcher; - var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdate = !1; - thenableIndexCounter$1 = 0; - thenableState$1 = null; - if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); - null === current || - didReceiveUpdate || - ((current = current.dependencies), + didReadFromEntangledAsyncAction = !1; + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = !1; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate + ? (firstBaseUpdate = firstPendingUpdate) + : (lastBaseUpdate.next = firstPendingUpdate); + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; null !== current && - checkIfContextChanged(current) && - (didReceiveUpdate = !0)); -} -function renderWithHooksAgain(workInProgress, Component, props, secondArg) { - currentlyRenderingFiber$1 = workInProgress; - var numberOfReRenders = 0; - do { - didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); - thenableIndexCounter$1 = 0; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); - numberOfReRenders += 1; - workInProgressHook = currentHook = null; - if (null != workInProgress.updateQueue) { - var children = workInProgress.updateQueue; - children.lastEffect = null; - children.events = null; - children.stores = null; - null != children.memoCache && (children.memoCache.index = 0); - } - ReactSharedInternals.H = HooksDispatcherOnRerender; - children = Component(props, secondArg); - } while (didScheduleRenderPhaseUpdateDuringThisPass); - return children; -} -function TransitionAwareHostComponent() { - var dispatcher = ReactSharedInternals.H, - maybeThenable = dispatcher.useState()[0]; - maybeThenable = - "function" === typeof maybeThenable.then - ? useThenable(maybeThenable) - : maybeThenable; - dispatcher = dispatcher.useState()[0]; - (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && - (currentlyRenderingFiber$1.flags |= 1024); - return maybeThenable; -} -function checkDidRenderIdHook() { - var didRenderIdHook = 0 !== localIdCounter; - localIdCounter = 0; - return didRenderIdHook; + ((current = current.updateQueue), + (pendingQueue = current.lastBaseUpdate), + pendingQueue !== lastBaseUpdate && + (null === pendingQueue + ? (current.firstBaseUpdate = firstPendingUpdate) + : (pendingQueue.next = firstPendingUpdate), + (current.lastBaseUpdate = lastPendingUpdate))); + } + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + do { + var updateLane = pendingQueue.lane & -536870913, + isHiddenUpdate = updateLane !== pendingQueue.lane; + if ( + isHiddenUpdate + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + 0 !== updateLane && + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction = !0); + null !== current && + (current = current.next = + { + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: null, + next: null + }); + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + var instance = instance$jscomp$0; + switch (update.tag) { + case 1: + workInProgress = update.payload; + if ("function" === typeof workInProgress) { + newState = workInProgress.call(instance, newState, updateLane); + break a; + } + newState = workInProgress; + break a; + case 3: + workInProgress.flags = (workInProgress.flags & -65537) | 128; + case 0: + workInProgress = update.payload; + updateLane = + "function" === typeof workInProgress + ? workInProgress.call(instance, newState, updateLane) + : workInProgress; + if (null === updateLane || void 0 === updateLane) break a; + newState = assign({}, newState, updateLane); + break a; + case 2: + hasForceUpdate = !0; + } + } + updateLane = pendingQueue.callback; + null !== updateLane && + ((workInProgress$jscomp$0.flags |= 64), + isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), + (isHiddenUpdate = queue.callbacks), + null === isHiddenUpdate + ? (queue.callbacks = [updateLane]) + : isHiddenUpdate.push(updateLane)); + } else + (isHiddenUpdate = { + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }), + null === current + ? ((firstPendingUpdate = current = isHiddenUpdate), + (lastPendingUpdate = newState)) + : (current = current.next = isHiddenUpdate), + (lastBaseUpdate |= updateLane); + pendingQueue = pendingQueue.next; + if (null === pendingQueue) + if (((pendingQueue = queue.shared.pending), null === pendingQueue)) + break; + else + (isHiddenUpdate = pendingQueue), + (pendingQueue = isHiddenUpdate.next), + (isHiddenUpdate.next = null), + (queue.lastBaseUpdate = isHiddenUpdate), + (queue.shared.pending = null); + } while (1); + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + null === firstBaseUpdate && (queue.shared.lanes = 0); + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; + } } -function bailoutHooks(current, workInProgress, lanes) { - workInProgress.updateQueue = current.updateQueue; - workInProgress.flags &= -2053; - current.lanes &= ~lanes; +function callCallback(callback, context) { + if ("function" !== typeof callback) + throw Error(formatProdErrorMessage(191, callback)); + callback.call(context); } -function resetHooksOnUnwind(workInProgress) { - if (didScheduleRenderPhaseUpdate) { +function commitCallbacks(updateQueue, context) { + var callbacks = updateQueue.callbacks; + if (null !== callbacks) for ( - workInProgress = workInProgress.memoizedState; - null !== workInProgress; - - ) { - var queue = workInProgress.queue; - null !== queue && (queue.pending = null); - workInProgress = workInProgress.next; - } - didScheduleRenderPhaseUpdate = !1; - } - renderLanes = 0; - workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; - didScheduleRenderPhaseUpdateDuringThisPass = !1; - thenableIndexCounter$1 = localIdCounter = 0; - thenableState$1 = null; + updateQueue.callbacks = null, updateQueue = 0; + updateQueue < callbacks.length; + updateQueue++ + ) + callCallback(callbacks[updateQueue], context); } -function mountWorkInProgressHook() { - var hook = { - memoizedState: null, - baseState: null, - baseQueue: null, - queue: null, - next: null +var AbortControllerLocal = + "undefined" !== typeof AbortController + ? AbortController + : function () { + var listeners = [], + signal = (this.signal = { + aborted: !1, + addEventListener: function (type, listener) { + listeners.push(listener); + } + }); + this.abort = function () { + signal.aborted = !0; + listeners.forEach(function (listener) { + return listener(); + }); + }; + }, + scheduleCallback$1 = Scheduler.unstable_scheduleCallback, + NormalPriority = Scheduler.unstable_NormalPriority, + CacheContext = { + $$typeof: REACT_CONTEXT_TYPE, + Consumer: null, + Provider: null, + _currentValue: null, + _currentValue2: null, + _threadCount: 0 + }; +function createCache() { + return { + controller: new AbortControllerLocal(), + data: new Map(), + refCount: 0 }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook) - : (workInProgressHook = workInProgressHook.next = hook); - return workInProgressHook; } -function updateWorkInProgressHook() { - if (null === currentHook) { - var nextCurrentHook = currentlyRenderingFiber$1.alternate; - nextCurrentHook = - null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; - } else nextCurrentHook = currentHook.next; - var nextWorkInProgressHook = - null === workInProgressHook - ? currentlyRenderingFiber$1.memoizedState - : workInProgressHook.next; - if (null !== nextWorkInProgressHook) - (workInProgressHook = nextWorkInProgressHook), - (currentHook = nextCurrentHook); - else { - if (null === nextCurrentHook) { - if (null === currentlyRenderingFiber$1.alternate) - throw Error(formatProdErrorMessage(467)); - throw Error(formatProdErrorMessage(310)); - } - currentHook = nextCurrentHook; - nextCurrentHook = { - memoizedState: currentHook.memoizedState, - baseState: currentHook.baseState, - baseQueue: currentHook.baseQueue, - queue: currentHook.queue, - next: null - }; - null === workInProgressHook - ? (currentlyRenderingFiber$1.memoizedState = workInProgressHook = - nextCurrentHook) - : (workInProgressHook = workInProgressHook.next = nextCurrentHook); - } - return workInProgressHook; +function releaseCache(cache) { + cache.refCount--; + 0 === cache.refCount && + scheduleCallback$1(NormalPriority, function () { + cache.controller.abort(); + }); } -var createFunctionComponentUpdateQueue; -createFunctionComponentUpdateQueue = function () { - return { lastEffect: null, events: null, stores: null, memoCache: null }; +function applyDerivedStateFromProps( + workInProgress, + ctor, + getDerivedStateFromProps, + nextProps +) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = + null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps + ? ctor + : assign({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && + (workInProgress.updateQueue.baseState = getDerivedStateFromProps); +} +var classComponentUpdater = { + isMounted: function (component) { + return (component = component._reactInternals) + ? getNearestMountedFiber(component) === component + : !1; + }, + enqueueSetState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueReplaceState: function (inst, payload, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 1; + update.payload = payload; + void 0 !== callback && null !== callback && (update.callback = callback); + payload = enqueueUpdate(inst, update, lane); + null !== payload && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(payload, inst, lane), + entangleTransitions(payload, inst, lane)); + }, + enqueueForceUpdate: function (inst, callback) { + inst = inst._reactInternals; + var lane = requestUpdateLane(), + update = createUpdate(lane); + update.tag = 2; + void 0 !== callback && null !== callback && (update.callback = callback); + callback = enqueueUpdate(inst, update, lane); + null !== callback && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(callback, inst, lane), + entangleTransitions(callback, inst, lane)); + } }; -function useThenable(thenable) { - var index = thenableIndexCounter$1; - thenableIndexCounter$1 += 1; - null === thenableState$1 && (thenableState$1 = []); - thenable = trackUsedThenable(thenableState$1, thenable, index); - index = currentlyRenderingFiber$1; - null === - (null === workInProgressHook - ? index.memoizedState - : workInProgressHook.next) && - ((index = index.alternate), - (ReactSharedInternals.H = - null === index || null === index.memoizedState - ? HooksDispatcherOnMount - : HooksDispatcherOnUpdate)); - return thenable; +function checkShouldComponentUpdate( + workInProgress, + ctor, + oldProps, + newProps, + oldState, + newState, + nextContext +) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate + ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) + : ctor.prototype && ctor.prototype.isPureReactComponent + ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) + : !0; } -function use(usable) { - if (null !== usable && "object" === typeof usable) { - if ("function" === typeof usable.then) return useThenable(usable); - if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); +function callComponentWillReceiveProps( + workInProgress, + instance, + newProps, + nextContext +) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && + instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && + instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && + classComponentUpdater.enqueueReplaceState(instance, instance.state, null); +} +function resolveClassComponentProps(Component, baseProps) { + var newProps = baseProps; + if ("ref" in baseProps) { + newProps = {}; + for (var propName in baseProps) + "ref" !== propName && (newProps[propName] = baseProps[propName]); } - throw Error(formatProdErrorMessage(438, String(usable))); + if ((Component = Component.defaultProps)) { + newProps === baseProps && (newProps = assign({}, newProps)); + for (var propName$32 in Component) + void 0 === newProps[propName$32] && + (newProps[propName$32] = Component[propName$32]); + } + return newProps; } -function useMemoCache(size) { - var memoCache = null, - updateQueue = currentlyRenderingFiber$1.updateQueue; - null !== updateQueue && (memoCache = updateQueue.memoCache); - if (null == memoCache) { - var current = currentlyRenderingFiber$1.alternate; - null !== current && - ((current = current.updateQueue), - null !== current && - ((current = current.memoCache), - null != current && - (memoCache = { - data: current.data.map(function (array) { - return array.slice(); - }), - index: 0 - }))); +var CapturedStacks = new WeakMap(); +function createCapturedValueAtFiber(value, source) { + if ("object" === typeof value && null !== value) { + var existing = CapturedStacks.get(value); + if (void 0 !== existing) return existing; + source = { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + CapturedStacks.set(value, source); + return source; } - null == memoCache && (memoCache = { data: [], index: 0 }); - null === updateQueue && - ((updateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = updateQueue)); - updateQueue.memoCache = memoCache; - updateQueue = memoCache.data[memoCache.index]; - if (void 0 === updateQueue) - for ( - updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; - current < size; - current++ - ) - updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; - memoCache.index++; - return updateQueue; + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; } -function basicStateReducer(state, action) { - return "function" === typeof action ? action(state) : action; -} -function updateReducer(reducer) { - var hook = updateWorkInProgressHook(); - return updateReducerImpl(hook, currentHook, reducer); -} -function updateReducerImpl(hook, current, reducer) { - var queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var baseQueue = hook.baseQueue, - pendingQueue = queue.pending; - if (null !== pendingQueue) { - if (null !== baseQueue) { - var baseFirst = baseQueue.next; - baseQueue.next = pendingQueue.next; - pendingQueue.next = baseFirst; - } - current.baseQueue = baseQueue = pendingQueue; - queue.pending = null; - } - pendingQueue = hook.baseState; - if (null === baseQueue) hook.memoizedState = pendingQueue; - else { - current = baseQueue.next; - var newBaseQueueFirst = (baseFirst = null), - newBaseQueueLast = null, - update = current, - didReadFromEntangledAsyncAction$30 = !1; - do { - var updateLane = update.lane & -536870913; - if ( - updateLane !== update.lane - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - var revertLane = update.revertLane; - if (0 === revertLane) - null !== newBaseQueueLast && - (newBaseQueueLast = newBaseQueueLast.next = - { - lane: 0, - revertLane: 0, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$30 = !0); - else if ((renderLanes & revertLane) === revertLane) { - update = update.next; - revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$30 = !0); - continue; - } else - (updateLane = { - lane: 0, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = updateLane), - (currentlyRenderingFiber$1.lanes |= revertLane), - (workInProgressRootSkippedLanes |= revertLane); - updateLane = update.action; - shouldDoubleInvokeUserFnsInHooksDEV && - reducer(pendingQueue, updateLane); - pendingQueue = update.hasEagerState - ? update.eagerState - : reducer(pendingQueue, updateLane); - } else - (revertLane = { - lane: updateLane, - revertLane: update.revertLane, - action: update.action, - hasEagerState: update.hasEagerState, - eagerState: update.eagerState, - next: null - }), - null === newBaseQueueLast - ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), - (baseFirst = pendingQueue)) - : (newBaseQueueLast = newBaseQueueLast.next = revertLane), - (currentlyRenderingFiber$1.lanes |= updateLane), - (workInProgressRootSkippedLanes |= updateLane); - update = update.next; - } while (null !== update && update !== current); - null === newBaseQueueLast - ? (baseFirst = pendingQueue) - : (newBaseQueueLast.next = newBaseQueueFirst); - if ( - !objectIs(pendingQueue, hook.memoizedState) && - ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$30 && - ((reducer = currentEntangledActionThenable), null !== reducer)) - ) - throw reducer; - hook.memoizedState = pendingQueue; - hook.baseState = baseFirst; - hook.baseQueue = newBaseQueueLast; - queue.lastRenderedState = pendingQueue; - } - null === baseQueue && (queue.lanes = 0); - return [hook.memoizedState, queue.dispatch]; -} -function rerenderReducer(reducer) { - var hook = updateWorkInProgressHook(), - queue = hook.queue; - if (null === queue) throw Error(formatProdErrorMessage(311)); - queue.lastRenderedReducer = reducer; - var dispatch = queue.dispatch, - lastRenderPhaseUpdate = queue.pending, - newState = hook.memoizedState; - if (null !== lastRenderPhaseUpdate) { - queue.pending = null; - var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); - do (newState = reducer(newState, update.action)), (update = update.next); - while (update !== lastRenderPhaseUpdate); - objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); - hook.memoizedState = newState; - null === hook.baseQueue && (hook.baseState = newState); - queue.lastRenderedState = newState; - } - return [newState, dispatch]; +var forkStack = [], + forkStackIndex = 0, + treeForkProvider = null, + treeForkCount = 0, + idStack = [], + idStackIndex = 0, + treeContextProvider = null, + treeContextId = 1, + treeContextOverflow = ""; +function pushTreeFork(workInProgress, totalChildren) { + forkStack[forkStackIndex++] = treeForkCount; + forkStack[forkStackIndex++] = treeForkProvider; + treeForkProvider = workInProgress; + treeForkCount = totalChildren; } -function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = updateWorkInProgressHook(), - isHydrating$jscomp$0 = isHydrating; - if (isHydrating$jscomp$0) { - if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else getServerSnapshot = getSnapshot(); - var snapshotChanged = !objectIs( - (currentHook || hook).memoizedState, - getServerSnapshot - ); - snapshotChanged && - ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); - hook = hook.queue; - updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ - subscribe - ]); - if ( - hook.getSnapshot !== getSnapshot || - snapshotChanged || - (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) - ) { - fiber.flags |= 2048; - pushSimpleEffect( - 9, - createEffectInstance(), - updateStoreInstance.bind( - null, - fiber, - hook, - getServerSnapshot, - getSnapshot - ), - null - ); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - isHydrating$jscomp$0 || - 0 !== (renderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - return getServerSnapshot; +function pushTreeId(workInProgress, totalChildren, index) { + idStack[idStackIndex++] = treeContextId; + idStack[idStackIndex++] = treeContextOverflow; + idStack[idStackIndex++] = treeContextProvider; + treeContextProvider = workInProgress; + var baseIdWithLeadingBit = treeContextId; + workInProgress = treeContextOverflow; + var baseLength = 32 - clz32(baseIdWithLeadingBit) - 1; + baseIdWithLeadingBit &= ~(1 << baseLength); + index += 1; + var length = 32 - clz32(totalChildren) + baseLength; + if (30 < length) { + var numberOfOverflowBits = baseLength - (baseLength % 5); + length = ( + baseIdWithLeadingBit & + ((1 << numberOfOverflowBits) - 1) + ).toString(32); + baseIdWithLeadingBit >>= numberOfOverflowBits; + baseLength -= numberOfOverflowBits; + treeContextId = + (1 << (32 - clz32(totalChildren) + baseLength)) | + (index << baseLength) | + baseIdWithLeadingBit; + treeContextOverflow = length + workInProgress; + } else + (treeContextId = + (1 << length) | (index << baseLength) | baseIdWithLeadingBit), + (treeContextOverflow = workInProgress); } -function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { - fiber.flags |= 16384; - fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; - getSnapshot = currentlyRenderingFiber$1.updateQueue; - null === getSnapshot - ? ((getSnapshot = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = getSnapshot), - (getSnapshot.stores = [fiber])) - : ((renderedSnapshot = getSnapshot.stores), - null === renderedSnapshot - ? (getSnapshot.stores = [fiber]) - : renderedSnapshot.push(fiber)); +function pushMaterializedTreeId(workInProgress) { + null !== workInProgress.return && + (pushTreeFork(workInProgress, 1), pushTreeId(workInProgress, 1, 0)); } -function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { - inst.value = nextSnapshot; - inst.getSnapshot = getSnapshot; - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +function popTreeContext(workInProgress) { + for (; workInProgress === treeForkProvider; ) + (treeForkProvider = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null), + (treeForkCount = forkStack[--forkStackIndex]), + (forkStack[forkStackIndex] = null); + for (; workInProgress === treeContextProvider; ) + (treeContextProvider = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextOverflow = idStack[--idStackIndex]), + (idStack[idStackIndex] = null), + (treeContextId = idStack[--idStackIndex]), + (idStack[idStackIndex] = null); } -function subscribeToStore(fiber, inst, subscribe) { - return subscribe(function () { - checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); - }); +var hydrationParentFiber = null, + nextHydratableInstance = null, + isHydrating = !1, + hydrationErrors = null, + rootOrSingletonContext = !1, + HydrationMismatchException = Error(formatProdErrorMessage(519)); +function throwOnHydrationMismatch(fiber) { + var error = Error(formatProdErrorMessage(418, "")); + queueHydrationError(createCapturedValueAtFiber(error, fiber)); + throw HydrationMismatchException; } -function checkIfSnapshotChanged(inst) { - var latestGetSnapshot = inst.getSnapshot; - inst = inst.value; - try { - var nextValue = latestGetSnapshot(); - return !objectIs(inst, nextValue); - } catch (error) { - return !0; +function prepareToHydrateHostInstance(fiber) { + var instance = fiber.stateNode, + type = fiber.type, + props = fiber.memoizedProps; + instance[internalInstanceKey] = fiber; + instance[internalPropsKey] = props; + switch (type) { + case "dialog": + listenToNonDelegatedEvent("cancel", instance); + listenToNonDelegatedEvent("close", instance); + break; + case "iframe": + case "object": + case "embed": + listenToNonDelegatedEvent("load", instance); + break; + case "video": + case "audio": + for (type = 0; type < mediaEventTypes.length; type++) + listenToNonDelegatedEvent(mediaEventTypes[type], instance); + break; + case "source": + listenToNonDelegatedEvent("error", instance); + break; + case "img": + case "image": + case "link": + listenToNonDelegatedEvent("error", instance); + listenToNonDelegatedEvent("load", instance); + break; + case "details": + listenToNonDelegatedEvent("toggle", instance); + break; + case "input": + listenToNonDelegatedEvent("invalid", instance); + initInput( + instance, + props.value, + props.defaultValue, + props.checked, + props.defaultChecked, + props.type, + props.name, + !0 + ); + track(instance); + break; + case "select": + listenToNonDelegatedEvent("invalid", instance); + break; + case "textarea": + listenToNonDelegatedEvent("invalid", instance), + initTextarea(instance, props.value, props.defaultValue, props.children), + track(instance); } + type = props.children; + ("string" !== typeof type && + "number" !== typeof type && + "bigint" !== typeof type) || + instance.textContent === "" + type || + !0 === props.suppressHydrationWarning || + checkForUnmatchedText(instance.textContent, type) + ? (null != props.popover && + (listenToNonDelegatedEvent("beforetoggle", instance), + listenToNonDelegatedEvent("toggle", instance)), + null != props.onScroll && listenToNonDelegatedEvent("scroll", instance), + null != props.onScrollEnd && + listenToNonDelegatedEvent("scrollend", instance), + null != props.onClick && (instance.onclick = noop$2), + (instance = !0)) + : (instance = !1); + instance || throwOnHydrationMismatch(fiber); } -function forceStoreRerender(fiber) { - var root = enqueueConcurrentRenderForLane(fiber, 2); - null !== root && scheduleUpdateOnFiber(root, fiber, 2); -} -function mountStateImpl(initialState) { - var hook = mountWorkInProgressHook(); - if ("function" === typeof initialState) { - var initialStateInitializer = initialState; - initialState = initialStateInitializer(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - initialStateInitializer(); - } finally { - setIsStrictModeForDevtools(!1); - } +function popToNextHostParent(fiber) { + for (hydrationParentFiber = fiber.return; hydrationParentFiber; ) + switch (hydrationParentFiber.tag) { + case 3: + case 27: + rootOrSingletonContext = !0; + return; + case 5: + case 13: + rootOrSingletonContext = !1; + return; + default: + hydrationParentFiber = hydrationParentFiber.return; } - } - hook.memoizedState = hook.baseState = initialState; - hook.queue = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialState - }; - return hook; -} -function updateOptimisticImpl(hook, current, passthrough, reducer) { - hook.baseState = passthrough; - return updateReducerImpl( - hook, - currentHook, - "function" === typeof reducer ? reducer : basicStateReducer - ); } -function dispatchActionState( - fiber, - actionQueue, - setPendingState, - setState, - payload -) { - if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); - fiber = actionQueue.action; - if (null !== fiber) { - var actionNode = { - payload: payload, - action: fiber, - next: null, - isTransition: !0, - status: "pending", - value: null, - reason: null, - listeners: [], - then: function (listener) { - actionNode.listeners.push(listener); - } - }; - null !== ReactSharedInternals.T - ? setPendingState(!0) - : (actionNode.isTransition = !1); - setState(actionNode); - setPendingState = actionQueue.pending; - null === setPendingState - ? ((actionNode.next = actionQueue.pending = actionNode), - runActionStateAction(actionQueue, actionNode)) - : ((actionNode.next = setPendingState.next), - (actionQueue.pending = setPendingState.next = actionNode)); +function popHydrationState(fiber) { + if (fiber !== hydrationParentFiber) return !1; + if (!isHydrating) return popToNextHostParent(fiber), (isHydrating = !0), !1; + var shouldClear = !1, + JSCompiler_temp; + if ((JSCompiler_temp = 3 !== fiber.tag && 27 !== fiber.tag)) { + if ((JSCompiler_temp = 5 === fiber.tag)) + (JSCompiler_temp = fiber.type), + (JSCompiler_temp = + !("form" !== JSCompiler_temp && "button" !== JSCompiler_temp) || + shouldSetTextContent(fiber.type, fiber.memoizedProps)); + JSCompiler_temp = !JSCompiler_temp; } -} -function runActionStateAction(actionQueue, node) { - var action = node.action, - payload = node.payload, - prevState = actionQueue.state; - if (node.isTransition) { - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - try { - var returnValue = action(prevState, payload), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - handleActionReturnValue(actionQueue, node, returnValue); - } catch (error) { - onActionError(actionQueue, node, error); - } finally { - ReactSharedInternals.T = prevTransition; + JSCompiler_temp && (shouldClear = !0); + shouldClear && nextHydratableInstance && throwOnHydrationMismatch(fiber); + popToNextHostParent(fiber); + if (13 === fiber.tag) { + fiber = fiber.memoizedState; + fiber = null !== fiber ? fiber.dehydrated : null; + if (!fiber) throw Error(formatProdErrorMessage(317)); + a: { + fiber = fiber.nextSibling; + for (shouldClear = 0; fiber; ) { + if (8 === fiber.nodeType) + if (((JSCompiler_temp = fiber.data), "/$" === JSCompiler_temp)) { + if (0 === shouldClear) { + nextHydratableInstance = getNextHydratable(fiber.nextSibling); + break a; + } + shouldClear--; + } else + ("$" !== JSCompiler_temp && + "$!" !== JSCompiler_temp && + "$?" !== JSCompiler_temp) || + shouldClear++; + fiber = fiber.nextSibling; + } + nextHydratableInstance = null; } } else - try { - (prevTransition = action(prevState, payload)), - handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$36) { - onActionError(actionQueue, node, error$36); - } + nextHydratableInstance = hydrationParentFiber + ? getNextHydratable(fiber.stateNode.nextSibling) + : null; + return !0; } -function handleActionReturnValue(actionQueue, node, returnValue) { - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ? returnValue.then( - function (nextState) { - onActionSuccess(actionQueue, node, nextState); - }, - function (error) { - return onActionError(actionQueue, node, error); - } - ) - : onActionSuccess(actionQueue, node, returnValue); +function resetHydrationState() { + nextHydratableInstance = hydrationParentFiber = null; + isHydrating = !1; } -function onActionSuccess(actionQueue, actionNode, nextState) { - actionNode.status = "fulfilled"; - actionNode.value = nextState; - notifyActionListeners(actionNode); - actionQueue.state = nextState; - actionNode = actionQueue.pending; - null !== actionNode && - ((nextState = actionNode.next), - nextState === actionNode - ? (actionQueue.pending = null) - : ((nextState = nextState.next), - (actionNode.next = nextState), - runActionStateAction(actionQueue, nextState))); +function upgradeHydrationErrorsToRecoverable() { + var queuedErrors = hydrationErrors; + null !== queuedErrors && + (null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = queuedErrors) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + queuedErrors + ), + (hydrationErrors = null)); + return queuedErrors; } -function onActionError(actionQueue, actionNode, error) { - var last = actionQueue.pending; - actionQueue.pending = null; - if (null !== last) { - last = last.next; - do - (actionNode.status = "rejected"), - (actionNode.reason = error), - notifyActionListeners(actionNode), - (actionNode = actionNode.next); - while (actionNode !== last); - } - actionQueue.action = null; -} -function notifyActionListeners(actionNode) { - actionNode = actionNode.listeners; - for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +function queueHydrationError(error) { + null === hydrationErrors + ? (hydrationErrors = [error]) + : hydrationErrors.push(error); } -function actionStateReducer(oldState, newState) { - return newState; +var SuspenseException = Error(formatProdErrorMessage(460)), + SuspenseyCommitException = Error(formatProdErrorMessage(474)), + SuspenseActionException = Error(formatProdErrorMessage(542)), + noopSuspenseyCommitThenable = { then: function () {} }; +function isThenableResolved(thenable) { + thenable = thenable.status; + return "fulfilled" === thenable || "rejected" === thenable; } -function mountActionState(action, initialStateProp) { - if (isHydrating) { - var ssrFormState = workInProgressRoot.formState; - if (null !== ssrFormState) { - a: { - var JSCompiler_inline_result = currentlyRenderingFiber$1; - if (isHydrating) { - if (nextHydratableInstance) { - b: { - var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; - for ( - var inRootOrSingleton = rootOrSingletonContext; - 8 !== JSCompiler_inline_result$jscomp$0.nodeType; - - ) { - if (!inRootOrSingleton) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - JSCompiler_inline_result$jscomp$0 = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - if (null === JSCompiler_inline_result$jscomp$0) { - JSCompiler_inline_result$jscomp$0 = null; - break b; - } - } - inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; - JSCompiler_inline_result$jscomp$0 = - "F!" === inRootOrSingleton || "F" === inRootOrSingleton - ? JSCompiler_inline_result$jscomp$0 - : null; +function noop$4() {} +function trackUsedThenable(thenableState, thenable, index) { + index = thenableState[index]; + void 0 === index + ? thenableState.push(thenable) + : index !== thenable && (thenable.then(noop$4, noop$4), (thenable = index)); + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + default: + if ("string" === typeof thenable.status) thenable.then(noop$4, noop$4); + else { + thenableState = workInProgressRoot; + if (null !== thenableState && 100 < thenableState.shellSuspendCounter) + throw Error(formatProdErrorMessage(482)); + thenableState = thenable; + thenableState.status = "pending"; + thenableState.then( + function (fulfilledValue) { + if ("pending" === thenable.status) { + var fulfilledThenable = thenable; + fulfilledThenable.status = "fulfilled"; + fulfilledThenable.value = fulfilledValue; } - if (JSCompiler_inline_result$jscomp$0) { - nextHydratableInstance = getNextHydratable( - JSCompiler_inline_result$jscomp$0.nextSibling - ); - JSCompiler_inline_result = - "F!" === JSCompiler_inline_result$jscomp$0.data; - break a; + }, + function (error) { + if ("pending" === thenable.status) { + var rejectedThenable = thenable; + rejectedThenable.status = "rejected"; + rejectedThenable.reason = error; } } - throwOnHydrationMismatch(JSCompiler_inline_result); - } - JSCompiler_inline_result = !1; + ); } - JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); - } + switch (thenable.status) { + case "fulfilled": + return thenable.value; + case "rejected": + throw ( + ((thenableState = thenable.reason), + checkIfUseWrappedInAsyncCatch(thenableState), + thenableState) + ); + } + suspendedThenable = thenable; + throw SuspenseException; } - ssrFormState = mountWorkInProgressHook(); - ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; - JSCompiler_inline_result = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: actionStateReducer, - lastRenderedState: initialStateProp - }; - ssrFormState.queue = JSCompiler_inline_result; - ssrFormState = dispatchSetState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result - ); - JSCompiler_inline_result.dispatch = ssrFormState; - JSCompiler_inline_result = mountStateImpl(!1); - inRootOrSingleton = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !1, - JSCompiler_inline_result.queue - ); - JSCompiler_inline_result = mountWorkInProgressHook(); - JSCompiler_inline_result$jscomp$0 = { - state: initialStateProp, - dispatch: null, - action: action, - pending: null - }; - JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; - ssrFormState = dispatchActionState.bind( - null, - currentlyRenderingFiber$1, - JSCompiler_inline_result$jscomp$0, - inRootOrSingleton, - ssrFormState - ); - JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; - JSCompiler_inline_result.memoizedState = action; - return [initialStateProp, ssrFormState, !1]; } -function updateActionState(action) { - var stateHook = updateWorkInProgressHook(); - return updateActionStateImpl(stateHook, currentHook, action); +var suspendedThenable = null; +function getSuspendedThenable() { + if (null === suspendedThenable) throw Error(formatProdErrorMessage(459)); + var thenable = suspendedThenable; + suspendedThenable = null; + return thenable; } -function updateActionStateImpl(stateHook, currentStateHook, action) { - currentStateHook = updateReducerImpl( - stateHook, - currentStateHook, - actionStateReducer - )[0]; - stateHook = updateReducer(basicStateReducer)[0]; +function checkIfUseWrappedInAsyncCatch(rejectedReason) { if ( - "object" === typeof currentStateHook && - null !== currentStateHook && - "function" === typeof currentStateHook.then + rejectedReason === SuspenseException || + rejectedReason === SuspenseActionException ) - try { - var state = useThenable(currentStateHook); - } catch (x) { - if (x === SuspenseException) throw SuspenseActionException; - throw x; - } - else state = currentStateHook; - currentStateHook = updateWorkInProgressHook(); - var actionQueue = currentStateHook.queue, - dispatch = actionQueue.dispatch; - action !== currentStateHook.memoizedState && - ((currentlyRenderingFiber$1.flags |= 2048), - pushSimpleEffect( - 9, - createEffectInstance(), - actionStateActionEffect.bind(null, actionQueue, action), - null - )); - return [state, dispatch, stateHook]; -} -function actionStateActionEffect(actionQueue, action) { - actionQueue.action = action; -} -function rerenderActionState(action) { - var stateHook = updateWorkInProgressHook(), - currentStateHook = currentHook; - if (null !== currentStateHook) - return updateActionStateImpl(stateHook, currentStateHook, action); - updateWorkInProgressHook(); - stateHook = stateHook.memoizedState; - currentStateHook = updateWorkInProgressHook(); - var dispatch = currentStateHook.queue.dispatch; - currentStateHook.memoizedState = action; - return [stateHook, dispatch, !1]; -} -function pushSimpleEffect(tag, inst, create, deps) { - tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; - inst = currentlyRenderingFiber$1.updateQueue; - null === inst && - ((inst = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = inst)); - create = inst.lastEffect; - null === create - ? (inst.lastEffect = tag.next = tag) - : ((deps = create.next), - (create.next = tag), - (tag.next = deps), - (inst.lastEffect = tag)); - return tag; + throw Error(formatProdErrorMessage(483)); } -function createEffectInstance() { - return { destroy: void 0, resource: void 0 }; +var currentTreeHiddenStackCursor = createCursor(null), + prevEntangledRenderLanesCursor = createCursor(0); +function pushHiddenContext(fiber, context) { + fiber = entangledRenderLanes; + push(prevEntangledRenderLanesCursor, fiber); + push(currentTreeHiddenStackCursor, context); + entangledRenderLanes = fiber | context.baseLanes; } -function updateRef() { - return updateWorkInProgressHook().memoizedState; +function reuseHiddenContextOnStack() { + push(prevEntangledRenderLanesCursor, entangledRenderLanes); + push(currentTreeHiddenStackCursor, currentTreeHiddenStackCursor.current); } -function mountEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - currentlyRenderingFiber$1.flags |= fiberFlags; - hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - createEffectInstance(), - create, - deps - ); +function popHiddenContext() { + entangledRenderLanes = prevEntangledRenderLanesCursor.current; + pop(currentTreeHiddenStackCursor); + pop(prevEntangledRenderLanesCursor); } -function updateEffectImpl(fiberFlags, hookFlags, create, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var inst = hook.memoizedState.inst; - null !== currentHook && - null !== deps && - areHookInputsEqual(deps, currentHook.memoizedState.deps) - ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) - : ((currentlyRenderingFiber$1.flags |= fiberFlags), - (hook.memoizedState = pushSimpleEffect( - 1 | hookFlags, - inst, - create, - deps - ))); +var prevOnStartTransitionFinish = ReactSharedInternals.S; +ReactSharedInternals.S = function (transition, returnValue) { + if ( + "object" === typeof returnValue && + null !== returnValue && + "function" === typeof returnValue.then + ) { + if (0 > transitionStartTime && 0 > transitionUpdateTime) { + transitionStartTime = now(); + var newEventTime = resolveEventTimeStamp(), + newEventType = resolveEventType(); + if ( + newEventTime !== transitionEventTime || + newEventType !== transitionEventType + ) + transitionEventIsRepeat = !1; + transitionEventTime = newEventTime; + transitionEventType = newEventType; + } + entangleAsyncAction(transition, returnValue); + } + null !== prevOnStartTransitionFinish && + prevOnStartTransitionFinish(transition, returnValue); +}; +var resumedCache = createCursor(null); +function peekCacheFromPool() { + var cacheResumedFromPreviousRender = resumedCache.current; + return null !== cacheResumedFromPreviousRender + ? cacheResumedFromPreviousRender + : workInProgressRoot.pooledCache; } -function mountEffect(create, deps) { - mountEffectImpl(8390656, 8, create, deps); +function pushTransition(offscreenWorkInProgress, prevCachePool) { + null === prevCachePool + ? push(resumedCache, resumedCache.current) + : push(resumedCache, prevCachePool.pool); } -function updateEffect(create, deps) { - updateEffectImpl(2048, 8, create, deps); +function getSuspendedCache() { + var cacheFromPool = peekCacheFromPool(); + return null === cacheFromPool + ? null + : { parent: CacheContext._currentValue, pool: cacheFromPool }; } -function useEffectEventImpl(payload) { - currentlyRenderingFiber$1.flags |= 4; - var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; - if (null === componentUpdateQueue) - (componentUpdateQueue = createFunctionComponentUpdateQueue()), - (currentlyRenderingFiber$1.updateQueue = componentUpdateQueue), - (componentUpdateQueue.events = [payload]); - else { - var events = componentUpdateQueue.events; - null === events - ? (componentUpdateQueue.events = [payload]) - : events.push(payload); - } +var renderLanes = 0, + currentlyRenderingFiber = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = !1, + didScheduleRenderPhaseUpdateDuringThisPass = !1, + shouldDoubleInvokeUserFnsInHooksDEV = !1, + localIdCounter = 0, + thenableIndexCounter$1 = 0, + thenableState$1 = null, + globalClientIdCounter = 0; +function throwInvalidHookError() { + throw Error(formatProdErrorMessage(321)); } -function updateEvent(callback) { - var ref = updateWorkInProgressHook().memoizedState; - useEffectEventImpl({ ref: ref, nextImpl: callback }); - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; +function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return !1; + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) + if (!objectIs(nextDeps[i], prevDeps[i])) return !1; + return !0; } -function updateInsertionEffect(create, deps) { - return updateEffectImpl(4, 2, create, deps); +function renderWithHooks( + current, + workInProgress, + Component, + props, + secondArg, + nextRenderLanes +) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactSharedInternals.H = + null === current || null === current.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate; + shouldDoubleInvokeUserFnsInHooksDEV = !1; + nextRenderLanes = Component(props, secondArg); + shouldDoubleInvokeUserFnsInHooksDEV = !1; + didScheduleRenderPhaseUpdateDuringThisPass && + (nextRenderLanes = renderWithHooksAgain( + workInProgress, + Component, + props, + secondArg + )); + finishRenderingHooks(current); + return nextRenderLanes; } -function updateLayoutEffect(create, deps) { - return updateEffectImpl(4, 4, create, deps); +function finishRenderingHooks(current) { + ReactSharedInternals.H = ContextOnlyDispatcher; + var didRenderTooFewHooks = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdate = !1; + thenableIndexCounter$1 = 0; + thenableState$1 = null; + if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300)); + null === current || + didReceiveUpdate || + ((current = current.dependencies), + null !== current && + checkIfContextChanged(current) && + (didReceiveUpdate = !0)); } -function imperativeHandleEffect(create, ref) { - if ("function" === typeof ref) { - create = create(); - var refCleanup = ref(create); - return function () { - "function" === typeof refCleanup ? refCleanup() : ref(null); - }; - } - if (null !== ref && void 0 !== ref) - return ( - (create = create()), - (ref.current = create), - function () { - ref.current = null; - } - ); +function renderWithHooksAgain(workInProgress, Component, props, secondArg) { + currentlyRenderingFiber = workInProgress; + var numberOfReRenders = 0; + do { + didScheduleRenderPhaseUpdateDuringThisPass && (thenableState$1 = null); + thenableIndexCounter$1 = 0; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + if (25 <= numberOfReRenders) throw Error(formatProdErrorMessage(301)); + numberOfReRenders += 1; + workInProgressHook = currentHook = null; + if (null != workInProgress.updateQueue) { + var children = workInProgress.updateQueue; + children.lastEffect = null; + children.events = null; + children.stores = null; + null != children.memoCache && (children.memoCache.index = 0); + } + ReactSharedInternals.H = HooksDispatcherOnRerender; + children = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + return children; } -function updateImperativeHandle(ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); +function TransitionAwareHostComponent() { + var dispatcher = ReactSharedInternals.H, + maybeThenable = dispatcher.useState()[0]; + maybeThenable = + "function" === typeof maybeThenable.then + ? useThenable(maybeThenable) + : maybeThenable; + dispatcher = dispatcher.useState()[0]; + (null !== currentHook ? currentHook.memoizedState : null) !== dispatcher && + (currentlyRenderingFiber.flags |= 1024); + return maybeThenable; } -function mountDebugValue() {} -function updateCallback(callback, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - hook.memoizedState = [callback, deps]; - return callback; +function checkDidRenderIdHook() { + var didRenderIdHook = 0 !== localIdCounter; + localIdCounter = 0; + return didRenderIdHook; } -function updateMemo(nextCreate, deps) { - var hook = updateWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var prevState = hook.memoizedState; - if (null !== deps && areHookInputsEqual(deps, prevState[1])) - return prevState[0]; - prevState = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); +function bailoutHooks(current, workInProgress, lanes) { + workInProgress.updateQueue = current.updateQueue; + workInProgress.flags &= -2053; + current.lanes &= ~lanes; +} +function resetHooksOnUnwind(workInProgress) { + if (didScheduleRenderPhaseUpdate) { + for ( + workInProgress = workInProgress.memoizedState; + null !== workInProgress; + + ) { + var queue = workInProgress.queue; + null !== queue && (queue.pending = null); + workInProgress = workInProgress.next; } + didScheduleRenderPhaseUpdate = !1; } - hook.memoizedState = [prevState, deps]; - return prevState; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber = null; + didScheduleRenderPhaseUpdateDuringThisPass = !1; + thenableIndexCounter$1 = localIdCounter = 0; + thenableState$1 = null; } -function mountDeferredValueImpl(hook, value, initialValue) { - if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) - return (hook.memoizedState = value); - hook.memoizedState = initialValue; - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return initialValue; +function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = hook) + : (workInProgressHook = workInProgressHook.next = hook); + return workInProgressHook; } -function updateDeferredValueImpl(hook, prevValue, value, initialValue) { - if (objectIs(value, prevValue)) return value; - if (null !== currentTreeHiddenStackCursor.current) - return ( - (hook = mountDeferredValueImpl(hook, value, initialValue)), - objectIs(hook, prevValue) || (didReceiveUpdate = !0), - hook - ); - if (0 === (renderLanes & 42)) - return (didReceiveUpdate = !0), (hook.memoizedState = value); - hook = requestDeferredLane(); - currentlyRenderingFiber$1.lanes |= hook; - workInProgressRootSkippedLanes |= hook; - return prevValue; -} -function startTransition(fiber, queue, pendingState, finishedState, callback) { - var previousPriority = ReactDOMSharedInternals.p; - ReactDOMSharedInternals.p = - 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; - var prevTransition = ReactSharedInternals.T, - currentTransition = {}; - ReactSharedInternals.T = currentTransition; - dispatchOptimisticSetState(fiber, !1, queue, pendingState); - try { - var returnValue = callback(), - onStartTransitionFinish = ReactSharedInternals.S; - null !== onStartTransitionFinish && - onStartTransitionFinish(currentTransition, returnValue); - if ( - null !== returnValue && - "object" === typeof returnValue && - "function" === typeof returnValue.then - ) { - var thenableForFinishedState = chainThenableValue( - returnValue, - finishedState - ); - dispatchSetStateInternal( - fiber, - queue, - thenableForFinishedState, - requestUpdateLane(fiber) - ); - } else - dispatchSetStateInternal( - fiber, - queue, - finishedState, - requestUpdateLane(fiber) - ); - } catch (error) { - dispatchSetStateInternal( - fiber, - queue, - { then: function () {}, status: "rejected", reason: error }, - requestUpdateLane() - ); - } finally { - (ReactDOMSharedInternals.p = previousPriority), - (ReactSharedInternals.T = prevTransition); +function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber.alternate; + nextCurrentHook = + null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + var nextWorkInProgressHook = + null === workInProgressHook + ? currentlyRenderingFiber.memoizedState + : workInProgressHook.next; + if (null !== nextWorkInProgressHook) + (workInProgressHook = nextWorkInProgressHook), + (currentHook = nextCurrentHook); + else { + if (null === nextCurrentHook) { + if (null === currentlyRenderingFiber.alternate) + throw Error(formatProdErrorMessage(467)); + throw Error(formatProdErrorMessage(310)); + } + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook + ? (currentlyRenderingFiber.memoizedState = workInProgressHook = + nextCurrentHook) + : (workInProgressHook = workInProgressHook.next = nextCurrentHook); } + return workInProgressHook; } -function noop$3() {} -function startHostTransition(formFiber, pendingState, action, formData) { - if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); - var queue = ensureFormComponentIsStateful(formFiber).queue; - startTransition( - formFiber, - queue, - pendingState, - sharedNotPendingObject, - null === action - ? noop$3 - : function () { - requestFormReset$2(formFiber); - return action(formData); - } - ); +function createFunctionComponentUpdateQueue() { + return { lastEffect: null, events: null, stores: null, memoCache: null }; } -function ensureFormComponentIsStateful(formFiber) { - var existingStateHook = formFiber.memoizedState; - if (null !== existingStateHook) return existingStateHook; - existingStateHook = { - memoizedState: sharedNotPendingObject, - baseState: sharedNotPendingObject, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: sharedNotPendingObject - }, - next: null - }; - var initialResetState = {}; - existingStateHook.next = { - memoizedState: initialResetState, - baseState: initialResetState, - baseQueue: null, - queue: { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: basicStateReducer, - lastRenderedState: initialResetState - }, - next: null - }; - formFiber.memoizedState = existingStateHook; - formFiber = formFiber.alternate; - null !== formFiber && (formFiber.memoizedState = existingStateHook); - return existingStateHook; +function useThenable(thenable) { + var index = thenableIndexCounter$1; + thenableIndexCounter$1 += 1; + null === thenableState$1 && (thenableState$1 = []); + thenable = trackUsedThenable(thenableState$1, thenable, index); + index = currentlyRenderingFiber; + null === + (null === workInProgressHook + ? index.memoizedState + : workInProgressHook.next) && + ((index = index.alternate), + (ReactSharedInternals.H = + null === index || null === index.memoizedState + ? HooksDispatcherOnMount + : HooksDispatcherOnUpdate)); + return thenable; } -function requestFormReset$2(formFiber) { - var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; - dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); +function use(usable) { + if (null !== usable && "object" === typeof usable) { + if ("function" === typeof usable.then) return useThenable(usable); + if (usable.$$typeof === REACT_CONTEXT_TYPE) return readContext(usable); + } + throw Error(formatProdErrorMessage(438, String(usable))); } -function useHostTransitionStatus() { - return readContext(HostTransitionContext); +function useMemoCache(size) { + var memoCache = null, + updateQueue = currentlyRenderingFiber.updateQueue; + null !== updateQueue && (memoCache = updateQueue.memoCache); + if (null == memoCache) { + var current = currentlyRenderingFiber.alternate; + null !== current && + ((current = current.updateQueue), + null !== current && + ((current = current.memoCache), + null != current && + (memoCache = { + data: current.data.map(function (array) { + return array.slice(); + }), + index: 0 + }))); + } + null == memoCache && (memoCache = { data: [], index: 0 }); + null === updateQueue && + ((updateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = updateQueue)); + updateQueue.memoCache = memoCache; + updateQueue = memoCache.data[memoCache.index]; + if (void 0 === updateQueue) + for ( + updateQueue = memoCache.data[memoCache.index] = Array(size), current = 0; + current < size; + current++ + ) + updateQueue[current] = REACT_MEMO_CACHE_SENTINEL; + memoCache.index++; + return updateQueue; } -function updateId() { - return updateWorkInProgressHook().memoizedState; +function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; } -function updateRefresh() { - return updateWorkInProgressHook().memoizedState; +function updateReducer(reducer) { + var hook = updateWorkInProgressHook(); + return updateReducerImpl(hook, currentHook, reducer); } -function refreshCache(fiber, seedKey, seedValue) { - for (var provider = fiber.return; null !== provider; ) { - switch (provider.tag) { - case 24: - case 3: - var lane = requestUpdateLane(); - fiber = createUpdate(lane); - var root$39 = enqueueUpdate(provider, fiber, lane); - null !== root$39 && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root$39, provider, lane), - entangleTransitions(root$39, provider, lane)); - provider = createCache(); - null !== seedKey && - void 0 !== seedKey && - null !== root$39 && - provider.data.set(seedKey, seedValue); - fiber.payload = { cache: provider }; - return; +function updateReducerImpl(hook, current, reducer) { + var queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var baseQueue = hook.baseQueue, + pendingQueue = queue.pending; + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; } - provider = provider.return; + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; } -} -function dispatchReducerAction(fiber, queue, action) { - var lane = requestUpdateLane(); - action = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - isRenderPhaseUpdate(fiber) - ? enqueueRenderPhaseUpdate(queue, action) - : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), - null !== action && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane))); -} -function dispatchSetState(fiber, queue, action) { - var lane = requestUpdateLane(); - dispatchSetStateInternal(fiber, queue, action, lane) && - startUpdateTimerByLane(lane); -} -function dispatchSetStateInternal(fiber, queue, action, lane) { - var update = { - lane: lane, - revertLane: 0, - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + pendingQueue = hook.baseState; + if (null === baseQueue) hook.memoizedState = pendingQueue; else { - var alternate = fiber.alternate; + current = baseQueue.next; + var newBaseQueueFirst = (baseFirst = null), + newBaseQueueLast = null, + update = current, + didReadFromEntangledAsyncAction$37 = !1; + do { + var updateLane = update.lane & -536870913; + if ( + updateLane !== update.lane + ? (workInProgressRootRenderLanes & updateLane) === updateLane + : (renderLanes & updateLane) === updateLane + ) { + var revertLane = update.revertLane; + if (0 === revertLane) + null !== newBaseQueueLast && + (newBaseQueueLast = newBaseQueueLast.next = + { + lane: 0, + revertLane: 0, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + updateLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$37 = !0); + else if ((renderLanes & revertLane) === revertLane) { + update = update.next; + revertLane === currentEntangledLane && + (didReadFromEntangledAsyncAction$37 = !0); + continue; + } else + (updateLane = { + lane: 0, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = updateLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = updateLane), + (currentlyRenderingFiber.lanes |= revertLane), + (workInProgressRootSkippedLanes |= revertLane); + updateLane = update.action; + shouldDoubleInvokeUserFnsInHooksDEV && + reducer(pendingQueue, updateLane); + pendingQueue = update.hasEagerState + ? update.eagerState + : reducer(pendingQueue, updateLane); + } else + (revertLane = { + lane: updateLane, + revertLane: update.revertLane, + action: update.action, + hasEagerState: update.hasEagerState, + eagerState: update.eagerState, + next: null + }), + null === newBaseQueueLast + ? ((newBaseQueueFirst = newBaseQueueLast = revertLane), + (baseFirst = pendingQueue)) + : (newBaseQueueLast = newBaseQueueLast.next = revertLane), + (currentlyRenderingFiber.lanes |= updateLane), + (workInProgressRootSkippedLanes |= updateLane); + update = update.next; + } while (null !== update && update !== current); + null === newBaseQueueLast + ? (baseFirst = pendingQueue) + : (newBaseQueueLast.next = newBaseQueueFirst); if ( - 0 === fiber.lanes && - (null === alternate || 0 === alternate.lanes) && - ((alternate = queue.lastRenderedReducer), null !== alternate) + !objectIs(pendingQueue, hook.memoizedState) && + ((didReceiveUpdate = !0), + didReadFromEntangledAsyncAction$37 && + ((reducer = currentEntangledActionThenable), null !== reducer)) ) - try { - var currentState = queue.lastRenderedState, - eagerState = alternate(currentState, action); - update.hasEagerState = !0; - update.eagerState = eagerState; - if (objectIs(eagerState, currentState)) - return ( - enqueueUpdate$1(fiber, queue, update, 0), - null === workInProgressRoot && finishQueueingConcurrentUpdates(), - !1 - ); - } catch (error) { - } finally { - } - action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); - if (null !== action) - return ( - scheduleUpdateOnFiber(action, fiber, lane), - entangleTransitionUpdate(action, queue, lane), - !0 - ); + throw reducer; + hook.memoizedState = pendingQueue; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = pendingQueue; } - return !1; -} -function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { - action = { - lane: 2, - revertLane: requestTransitionLane(), - action: action, - hasEagerState: !1, - eagerState: null, - next: null - }; - if (isRenderPhaseUpdate(fiber)) { - if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); - } else - (throwIfDuringRender = enqueueConcurrentHookUpdate( - fiber, - queue, - action, - 2 - )), - null !== throwIfDuringRender && - (startUpdateTimerByLane(2), - scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); -} -function isRenderPhaseUpdate(fiber) { - var alternate = fiber.alternate; - return ( - fiber === currentlyRenderingFiber$1 || - (null !== alternate && alternate === currentlyRenderingFiber$1) - ); -} -function enqueueRenderPhaseUpdate(queue, update) { - didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = - !0; - var pending = queue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - queue.pending = update; + null === baseQueue && (queue.lanes = 0); + return [hook.memoizedState, queue.dispatch]; } -function entangleTransitionUpdate(root, queue, lane) { - if (0 !== (lane & 4194176)) { - var queueLanes = queue.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - queue.lanes = lane; - markRootEntangled(root, lane); +function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error(formatProdErrorMessage(311)); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = (lastRenderPhaseUpdate = lastRenderPhaseUpdate.next); + do (newState = reducer(newState, update.action)), (update = update.next); + while (update !== lastRenderPhaseUpdate); + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = !0); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; } + return [newState, dispatch]; } -var ContextOnlyDispatcher = { - readContext: readContext, - use: use, - useCallback: throwInvalidHookError, - useContext: throwInvalidHookError, - useEffect: throwInvalidHookError, - useImperativeHandle: throwInvalidHookError, - useLayoutEffect: throwInvalidHookError, - useInsertionEffect: throwInvalidHookError, - useMemo: throwInvalidHookError, - useReducer: throwInvalidHookError, - useRef: throwInvalidHookError, - useState: throwInvalidHookError, - useDebugValue: throwInvalidHookError, - useDeferredValue: throwInvalidHookError, - useTransition: throwInvalidHookError, - useSyncExternalStore: throwInvalidHookError, - useId: throwInvalidHookError -}; -ContextOnlyDispatcher.useCacheRefresh = throwInvalidHookError; -ContextOnlyDispatcher.useMemoCache = throwInvalidHookError; -ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; -ContextOnlyDispatcher.useHostTransitionStatus = throwInvalidHookError; -ContextOnlyDispatcher.useFormState = throwInvalidHookError; -ContextOnlyDispatcher.useActionState = throwInvalidHookError; -ContextOnlyDispatcher.useOptimistic = throwInvalidHookError; -var HooksDispatcherOnMount = { - readContext: readContext, - use: use, - useCallback: function (callback, deps) { - mountWorkInProgressHook().memoizedState = [ - callback, - void 0 === deps ? null : deps - ]; - return callback; - }, - useContext: readContext, - useEffect: mountEffect, - useImperativeHandle: function (ref, create, deps) { - deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; - mountEffectImpl( - 4194308, - 4, - imperativeHandleEffect.bind(null, create, ref), - deps - ); - }, - useLayoutEffect: function (create, deps) { - return mountEffectImpl(4194308, 4, create, deps); - }, - useInsertionEffect: function (create, deps) { - mountEffectImpl(4, 2, create, deps); - }, - useMemo: function (nextCreate, deps) { - var hook = mountWorkInProgressHook(); - deps = void 0 === deps ? null : deps; - var nextValue = nextCreate(); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - nextCreate(); - } finally { - setIsStrictModeForDevtools(!1); - } - } - hook.memoizedState = [nextValue, deps]; - return nextValue; - }, - useReducer: function (reducer, initialArg, init) { - var hook = mountWorkInProgressHook(); - if (void 0 !== init) { - var initialState = init(initialArg); - if (shouldDoubleInvokeUserFnsInHooksDEV) { - setIsStrictModeForDevtools(!0); - try { - init(initialArg); - } finally { - setIsStrictModeForDevtools(!1); - } - } - } else initialState = initialArg; - hook.memoizedState = hook.baseState = initialState; - reducer = { - pending: null, - lanes: 0, - dispatch: null, - lastRenderedReducer: reducer, - lastRenderedState: initialState - }; - hook.queue = reducer; - reducer = reducer.dispatch = dispatchReducerAction.bind( - null, - currentlyRenderingFiber$1, - reducer - ); - return [hook.memoizedState, reducer]; - }, - useRef: function (initialValue) { - var hook = mountWorkInProgressHook(); - initialValue = { current: initialValue }; - return (hook.memoizedState = initialValue); - }, - useState: function (initialState) { - initialState = mountStateImpl(initialState); - var queue = initialState.queue, - dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); - queue.dispatch = dispatch; - return [initialState.memoizedState, dispatch]; - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = mountWorkInProgressHook(); - return mountDeferredValueImpl(hook, value, initialValue); - }, - useTransition: function () { - var stateHook = mountStateImpl(!1); - stateHook = startTransition.bind( - null, - currentlyRenderingFiber$1, - stateHook.queue, - !0, - !1 - ); - mountWorkInProgressHook().memoizedState = stateHook; - return [!1, stateHook]; - }, - useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { - var fiber = currentlyRenderingFiber$1, - hook = mountWorkInProgressHook(); - if (isHydrating) { - if (void 0 === getServerSnapshot) - throw Error(formatProdErrorMessage(407)); - getServerSnapshot = getServerSnapshot(); - } else { - getServerSnapshot = getSnapshot(); - if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); - 0 !== (workInProgressRootRenderLanes & 60) || - pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); - } - hook.memoizedState = getServerSnapshot; - var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; - hook.queue = inst; - mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ - subscribe - ]); +function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = updateWorkInProgressHook(), + isHydrating$jscomp$0 = isHydrating; + if (isHydrating$jscomp$0) { + if (void 0 === getServerSnapshot) throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else getServerSnapshot = getSnapshot(); + var snapshotChanged = !objectIs( + (currentHook || hook).memoizedState, + getServerSnapshot + ); + snapshotChanged && + ((hook.memoizedState = getServerSnapshot), (didReceiveUpdate = !0)); + hook = hook.queue; + updateEffect(subscribeToStore.bind(null, fiber, hook, subscribe), [ + subscribe + ]); + if ( + hook.getSnapshot !== getSnapshot || + snapshotChanged || + (null !== workInProgressHook && workInProgressHook.memoizedState.tag & 1) + ) { fiber.flags |= 2048; pushSimpleEffect( 9, @@ -4548,3494 +4057,3840 @@ var HooksDispatcherOnMount = { updateStoreInstance.bind( null, fiber, - inst, + hook, getServerSnapshot, getSnapshot ), null ); - return getServerSnapshot; - }, - useId: function () { - var hook = mountWorkInProgressHook(), - identifierPrefix = workInProgressRoot.identifierPrefix; - if (isHydrating) { - var JSCompiler_inline_result = treeContextOverflow; - var idWithLeadingBit = treeContextId; - JSCompiler_inline_result = - ( - idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) - ).toString(32) + JSCompiler_inline_result; - identifierPrefix = - ":" + identifierPrefix + "R" + JSCompiler_inline_result; - JSCompiler_inline_result = localIdCounter++; - 0 < JSCompiler_inline_result && - (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); - identifierPrefix += ":"; - } else - (JSCompiler_inline_result = globalClientIdCounter++), - (identifierPrefix = - ":" + - identifierPrefix + - "r" + - JSCompiler_inline_result.toString(32) + - ":"); - return (hook.memoizedState = identifierPrefix); - }, - useCacheRefresh: function () { - return (mountWorkInProgressHook().memoizedState = refreshCache.bind( - null, - currentlyRenderingFiber$1 - )); + if (null === workInProgressRoot) throw Error(formatProdErrorMessage(349)); + isHydrating$jscomp$0 || + 0 !== (renderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); } -}; -HooksDispatcherOnMount.useMemoCache = useMemoCache; -HooksDispatcherOnMount.useEffectEvent = function (callback) { - var hook = mountWorkInProgressHook(), - ref = { impl: callback }; - hook.memoizedState = ref; - return function () { - if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); - return ref.impl.apply(void 0, arguments); - }; -}; -HooksDispatcherOnMount.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnMount.useFormState = mountActionState; -HooksDispatcherOnMount.useActionState = mountActionState; -HooksDispatcherOnMount.useOptimistic = function (passthrough) { + return getServerSnapshot; +} +function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { + fiber.flags |= 16384; + fiber = { getSnapshot: getSnapshot, value: renderedSnapshot }; + getSnapshot = currentlyRenderingFiber.updateQueue; + null === getSnapshot + ? ((getSnapshot = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = getSnapshot), + (getSnapshot.stores = [fiber])) + : ((renderedSnapshot = getSnapshot.stores), + null === renderedSnapshot + ? (getSnapshot.stores = [fiber]) + : renderedSnapshot.push(fiber)); +} +function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { + inst.value = nextSnapshot; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); +} +function subscribeToStore(fiber, inst, subscribe) { + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceStoreRerender(fiber); + }); +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function forceStoreRerender(fiber) { + var root = enqueueConcurrentRenderForLane(fiber, 2); + null !== root && scheduleUpdateOnFiber(root, fiber, 2); +} +function mountStateImpl(initialState) { var hook = mountWorkInProgressHook(); - hook.memoizedState = hook.baseState = passthrough; - var queue = { + if ("function" === typeof initialState) { + var initialStateInitializer = initialState; + initialState = initialStateInitializer(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + initialStateInitializer(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } + hook.memoizedState = hook.baseState = initialState; + hook.queue = { pending: null, lanes: 0, dispatch: null, - lastRenderedReducer: null, - lastRenderedState: null + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState }; - hook.queue = queue; - hook = dispatchOptimisticSetState.bind( - null, - currentlyRenderingFiber$1, - !0, - queue - ); - queue.dispatch = hook; - return [passthrough, hook]; -}; -var HooksDispatcherOnUpdate = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: updateReducer, - useRef: updateRef, - useState: function () { - return updateReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = updateReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnUpdate.useCacheRefresh = updateRefresh; -HooksDispatcherOnUpdate.useMemoCache = useMemoCache; -HooksDispatcherOnUpdate.useEffectEvent = updateEvent; -HooksDispatcherOnUpdate.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnUpdate.useFormState = updateActionState; -HooksDispatcherOnUpdate.useActionState = updateActionState; -HooksDispatcherOnUpdate.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); -}; -var HooksDispatcherOnRerender = { - readContext: readContext, - use: use, - useCallback: updateCallback, - useContext: readContext, - useEffect: updateEffect, - useImperativeHandle: updateImperativeHandle, - useInsertionEffect: updateInsertionEffect, - useLayoutEffect: updateLayoutEffect, - useMemo: updateMemo, - useReducer: rerenderReducer, - useRef: updateRef, - useState: function () { - return rerenderReducer(basicStateReducer); - }, - useDebugValue: mountDebugValue, - useDeferredValue: function (value, initialValue) { - var hook = updateWorkInProgressHook(); - return null === currentHook - ? mountDeferredValueImpl(hook, value, initialValue) - : updateDeferredValueImpl( - hook, - currentHook.memoizedState, - value, - initialValue - ); - }, - useTransition: function () { - var booleanOrThenable = rerenderReducer(basicStateReducer)[0], - start = updateWorkInProgressHook().memoizedState; - return [ - "boolean" === typeof booleanOrThenable - ? booleanOrThenable - : useThenable(booleanOrThenable), - start - ]; - }, - useSyncExternalStore: updateSyncExternalStore, - useId: updateId -}; -HooksDispatcherOnRerender.useCacheRefresh = updateRefresh; -HooksDispatcherOnRerender.useMemoCache = useMemoCache; -HooksDispatcherOnRerender.useEffectEvent = updateEvent; -HooksDispatcherOnRerender.useHostTransitionStatus = useHostTransitionStatus; -HooksDispatcherOnRerender.useFormState = rerenderActionState; -HooksDispatcherOnRerender.useActionState = rerenderActionState; -HooksDispatcherOnRerender.useOptimistic = function (passthrough, reducer) { - var hook = updateWorkInProgressHook(); - if (null !== currentHook) - return updateOptimisticImpl(hook, currentHook, passthrough, reducer); - hook.baseState = passthrough; - return [passthrough, hook.queue.dispatch]; -}; -var thenableState = null, - thenableIndexCounter = 0; -function unwrapThenable(thenable) { - var index = thenableIndexCounter; - thenableIndexCounter += 1; - null === thenableState && (thenableState = []); - return trackUsedThenable(thenableState, thenable, index); -} -function coerceRef(workInProgress, element) { - element = element.props.ref; - workInProgress.ref = void 0 !== element ? element : null; + return hook; } -function throwOnInvalidObjectType(returnFiber, newChild) { - if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) - throw Error(formatProdErrorMessage(525)); - returnFiber = Object.prototype.toString.call(newChild); - throw Error( - formatProdErrorMessage( - 31, - "[object Object]" === returnFiber - ? "object with keys {" + Object.keys(newChild).join(", ") + "}" - : returnFiber - ) +function updateOptimisticImpl(hook, current, passthrough, reducer) { + hook.baseState = passthrough; + return updateReducerImpl( + hook, + currentHook, + "function" === typeof reducer ? reducer : basicStateReducer ); } -function resolveLazy(lazyType) { - var init = lazyType._init; - return init(lazyType._payload); +function dispatchActionState( + fiber, + actionQueue, + setPendingState, + setState, + payload +) { + if (isRenderPhaseUpdate(fiber)) throw Error(formatProdErrorMessage(485)); + fiber = actionQueue.action; + if (null !== fiber) { + var actionNode = { + payload: payload, + action: fiber, + next: null, + isTransition: !0, + status: "pending", + value: null, + reason: null, + listeners: [], + then: function (listener) { + actionNode.listeners.push(listener); + } + }; + null !== ReactSharedInternals.T + ? setPendingState(!0) + : (actionNode.isTransition = !1); + setState(actionNode); + setPendingState = actionQueue.pending; + null === setPendingState + ? ((actionNode.next = actionQueue.pending = actionNode), + runActionStateAction(actionQueue, actionNode)) + : ((actionNode.next = setPendingState.next), + (actionQueue.pending = setPendingState.next = actionNode)); + } } -function createChildReconciler(shouldTrackSideEffects) { - function deleteChild(returnFiber, childToDelete) { - if (shouldTrackSideEffects) { - var deletions = returnFiber.deletions; - null === deletions - ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) - : deletions.push(childToDelete); +function runActionStateAction(actionQueue, node) { + var action = node.action, + payload = node.payload, + prevState = actionQueue.state; + if (node.isTransition) { + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + try { + var returnValue = action(prevState, payload), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + handleActionReturnValue(actionQueue, node, returnValue); + } catch (error) { + onActionError(actionQueue, node, error); + } finally { + ReactSharedInternals.T = prevTransition; } - } - function deleteRemainingChildren(returnFiber, currentFirstChild) { - if (!shouldTrackSideEffects) return null; - for (; null !== currentFirstChild; ) - deleteChild(returnFiber, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return null; - } - function mapRemainingChildren(currentFirstChild) { - for (var existingChildren = new Map(); null !== currentFirstChild; ) - null !== currentFirstChild.key - ? existingChildren.set(currentFirstChild.key, currentFirstChild) - : existingChildren.set(currentFirstChild.index, currentFirstChild), - (currentFirstChild = currentFirstChild.sibling); - return existingChildren; - } - function useFiber(fiber, pendingProps) { - fiber = createWorkInProgress(fiber, pendingProps); - fiber.index = 0; - fiber.sibling = null; - return fiber; - } - function placeChild(newFiber, lastPlacedIndex, newIndex) { - newFiber.index = newIndex; - if (!shouldTrackSideEffects) - return (newFiber.flags |= 1048576), lastPlacedIndex; - newIndex = newFiber.alternate; - if (null !== newIndex) - return ( - (newIndex = newIndex.index), - newIndex < lastPlacedIndex - ? ((newFiber.flags |= 33554434), lastPlacedIndex) - : newIndex - ); - newFiber.flags |= 33554434; - return lastPlacedIndex; - } - function placeSingleChild(newFiber) { - shouldTrackSideEffects && - null === newFiber.alternate && - (newFiber.flags |= 33554434); - return newFiber; - } - function updateTextNode(returnFiber, current, textContent, lanes) { - if (null === current || 6 !== current.tag) - return ( - (current = createFiberFromText(textContent, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, textContent); - current.return = returnFiber; - return current; - } - function updateElement(returnFiber, current, element, lanes) { - var elementType = element.type; - if (elementType === REACT_FRAGMENT_TYPE) - return updateFragment( - returnFiber, - current, - element.props.children, - lanes, - element.key - ); - if ( - null !== current && - (current.elementType === elementType || - ("object" === typeof elementType && - null !== elementType && - elementType.$$typeof === REACT_LAZY_TYPE && - resolveLazy(elementType) === current.type)) - ) - return ( - (current = useFiber(current, element.props)), - coerceRef(current, element), - (current.return = returnFiber), - current - ); - current = createFiberFromTypeAndProps( - element.type, - element.key, - element.props, - null, - returnFiber.mode, - lanes - ); - coerceRef(current, element); - current.return = returnFiber; - return current; - } - function updatePortal(returnFiber, current, portal, lanes) { - if ( - null === current || - 4 !== current.tag || - current.stateNode.containerInfo !== portal.containerInfo || - current.stateNode.implementation !== portal.implementation - ) - return ( - (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), - (current.return = returnFiber), - current - ); - current = useFiber(current, portal.children || []); - current.return = returnFiber; - return current; - } - function updateFragment(returnFiber, current, fragment, lanes, key) { - if (null === current || 7 !== current.tag) - return ( - (current = createFiberFromFragment( - fragment, - returnFiber.mode, - lanes, - key - )), - (current.return = returnFiber), - current - ); - current = useFiber(current, fragment); - current.return = returnFiber; - return current; - } - function createChild(returnFiber, newChild, lanes) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (newChild = createFiberFromText( - "" + newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - lanes - ); - case REACT_PORTAL_TYPE: - return ( - (newChild = createFiberFromPortal( - newChild, - returnFiber.mode, - lanes - )), - (newChild.return = returnFiber), - newChild - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return createChild(returnFiber, newChild, lanes); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (newChild = createFiberFromFragment( - newChild, - returnFiber.mode, - lanes, - null - )), - (newChild.return = returnFiber), - newChild - ); - if ("function" === typeof newChild.then) - return createChild(returnFiber, unwrapThenable(newChild), lanes); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return createChild( - returnFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); + } else + try { + (prevTransition = action(prevState, payload)), + handleActionReturnValue(actionQueue, node, prevTransition); + } catch (error$43) { + onActionError(actionQueue, node, error$43); } - return null; - } - function updateSlot(returnFiber, oldFiber, newChild, lanes) { - var key = null !== oldFiber ? oldFiber.key : null; - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return null !== key - ? null - : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return newChild.key === key - ? updateElement(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_PORTAL_TYPE: - return newChild.key === key - ? updatePortal(returnFiber, oldFiber, newChild, lanes) - : null; - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - updateSlot(returnFiber, oldFiber, newChild, lanes) - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] +} +function handleActionReturnValue(actionQueue, node, returnValue) { + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ? returnValue.then( + function (nextState) { + onActionSuccess(actionQueue, node, nextState); + }, + function (error) { + return onActionError(actionQueue, node, error); + } ) - return null !== key - ? null - : updateFragment(returnFiber, oldFiber, newChild, lanes, null); - if ("function" === typeof newChild.then) - return updateSlot( - returnFiber, - oldFiber, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateSlot( - returnFiber, - oldFiber, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; - } - function updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ) { - if ( - ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) - ); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updateElement(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_PORTAL_TYPE: - return ( - (existingChildren = - existingChildren.get( - null === newChild.key ? newIdx : newChild.key - ) || null), - updatePortal(returnFiber, existingChildren, newChild, lanes) - ); - case REACT_LAZY_TYPE: - var init = newChild._init; - newChild = init(newChild._payload); - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - newChild, - lanes - ); - } - if ( - isArrayImpl(newChild) || - getIteratorFn(newChild) || - "function" === typeof newChild[ASYNC_ITERATOR] - ) - return ( - (existingChildren = existingChildren.get(newIdx) || null), - updateFragment(returnFiber, existingChildren, newChild, lanes, null) - ); - if ("function" === typeof newChild.then) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return updateFromMap( - existingChildren, - returnFiber, - newIdx, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return null; + : onActionSuccess(actionQueue, node, returnValue); +} +function onActionSuccess(actionQueue, actionNode, nextState) { + actionNode.status = "fulfilled"; + actionNode.value = nextState; + notifyActionListeners(actionNode); + actionQueue.state = nextState; + actionNode = actionQueue.pending; + null !== actionNode && + ((nextState = actionNode.next), + nextState === actionNode + ? (actionQueue.pending = null) + : ((nextState = nextState.next), + (actionNode.next = nextState), + runActionStateAction(actionQueue, nextState))); +} +function onActionError(actionQueue, actionNode, error) { + var last = actionQueue.pending; + actionQueue.pending = null; + if (null !== last) { + last = last.next; + do + (actionNode.status = "rejected"), + (actionNode.reason = error), + notifyActionListeners(actionNode), + (actionNode = actionNode.next); + while (actionNode !== last); } - function reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null; - null !== oldFiber && newIdx < newChildren.length; - newIdx++ - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot( - returnFiber, - oldFiber, - newChildren[newIdx], - lanes - ); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; + actionQueue.action = null; +} +function notifyActionListeners(actionNode) { + actionNode = actionNode.listeners; + for (var i = 0; i < actionNode.length; i++) (0, actionNode[i])(); +} +function actionStateReducer(oldState, newState) { + return newState; +} +function mountActionState(action, initialStateProp) { + if (isHydrating) { + var ssrFormState = workInProgressRoot.formState; + if (null !== ssrFormState) { + a: { + var JSCompiler_inline_result = currentlyRenderingFiber; + if (isHydrating) { + if (nextHydratableInstance) { + b: { + var JSCompiler_inline_result$jscomp$0 = nextHydratableInstance; + for ( + var inRootOrSingleton = rootOrSingletonContext; + 8 !== JSCompiler_inline_result$jscomp$0.nodeType; + + ) { + if (!inRootOrSingleton) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + JSCompiler_inline_result$jscomp$0 = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + if (null === JSCompiler_inline_result$jscomp$0) { + JSCompiler_inline_result$jscomp$0 = null; + break b; + } + } + inRootOrSingleton = JSCompiler_inline_result$jscomp$0.data; + JSCompiler_inline_result$jscomp$0 = + "F!" === inRootOrSingleton || "F" === inRootOrSingleton + ? JSCompiler_inline_result$jscomp$0 + : null; + } + if (JSCompiler_inline_result$jscomp$0) { + nextHydratableInstance = getNextHydratable( + JSCompiler_inline_result$jscomp$0.nextSibling + ); + JSCompiler_inline_result = + "F!" === JSCompiler_inline_result$jscomp$0.data; + break a; + } + } + throwOnHydrationMismatch(JSCompiler_inline_result); + } + JSCompiler_inline_result = !1; } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (newIdx === newChildren.length) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; newIdx < newChildren.length; newIdx++) - (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), - null !== oldFiber && - ((currentFirstChild = placeChild( - oldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = oldFiber) - : (previousNewFiber.sibling = oldFiber), - (previousNewFiber = oldFiber)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + JSCompiler_inline_result && (initialStateProp = ssrFormState[0]); } - for ( - oldFiber = mapRemainingChildren(oldFiber); - newIdx < newChildren.length; - newIdx++ - ) - (nextOldFiber = updateFromMap( - oldFiber, - returnFiber, - newIdx, - newChildren[newIdx], - lanes - )), - null !== nextOldFiber && - (shouldTrackSideEffects && - null !== nextOldFiber.alternate && - oldFiber.delete( - null === nextOldFiber.key ? newIdx : nextOldFiber.key - ), - (currentFirstChild = placeChild( - nextOldFiber, - currentFirstChild, - newIdx - )), - null === previousNewFiber - ? (resultingFirstChild = nextOldFiber) - : (previousNewFiber.sibling = nextOldFiber), - (previousNewFiber = nextOldFiber)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; - } - function reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChildrenIterable, - lanes - ) { - var newChildren = newChildrenIterable[ASYNC_ITERATOR](); - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - { - next: function () { - return unwrapThenable(newChildren.next()); - } - }, - lanes - ); } - function reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChildren, - lanes - ) { - if (null == newChildren) throw Error(formatProdErrorMessage(151)); - for ( - var resultingFirstChild = null, - previousNewFiber = null, - oldFiber = currentFirstChild, - newIdx = (currentFirstChild = 0), - nextOldFiber = null, - step = newChildren.next(); - null !== oldFiber && !step.done; - newIdx++, step = newChildren.next() - ) { - oldFiber.index > newIdx - ? ((nextOldFiber = oldFiber), (oldFiber = null)) - : (nextOldFiber = oldFiber.sibling); - var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); - if (null === newFiber) { - null === oldFiber && (oldFiber = nextOldFiber); - break; - } - shouldTrackSideEffects && - oldFiber && - null === newFiber.alternate && - deleteChild(returnFiber, oldFiber); - currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); - null === previousNewFiber - ? (resultingFirstChild = newFiber) - : (previousNewFiber.sibling = newFiber); - previousNewFiber = newFiber; - oldFiber = nextOldFiber; - } - if (step.done) - return ( - deleteRemainingChildren(returnFiber, oldFiber), - isHydrating && pushTreeFork(returnFiber, newIdx), - resultingFirstChild - ); - if (null === oldFiber) { - for (; !step.done; newIdx++, step = newChildren.next()) - (step = createChild(returnFiber, step.value, lanes)), - null !== step && - ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + ssrFormState = mountWorkInProgressHook(); + ssrFormState.memoizedState = ssrFormState.baseState = initialStateProp; + JSCompiler_inline_result = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: actionStateReducer, + lastRenderedState: initialStateProp + }; + ssrFormState.queue = JSCompiler_inline_result; + ssrFormState = dispatchSetState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result + ); + JSCompiler_inline_result.dispatch = ssrFormState; + JSCompiler_inline_result = mountStateImpl(!1); + inRootOrSingleton = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !1, + JSCompiler_inline_result.queue + ); + JSCompiler_inline_result = mountWorkInProgressHook(); + JSCompiler_inline_result$jscomp$0 = { + state: initialStateProp, + dispatch: null, + action: action, + pending: null + }; + JSCompiler_inline_result.queue = JSCompiler_inline_result$jscomp$0; + ssrFormState = dispatchActionState.bind( + null, + currentlyRenderingFiber, + JSCompiler_inline_result$jscomp$0, + inRootOrSingleton, + ssrFormState + ); + JSCompiler_inline_result$jscomp$0.dispatch = ssrFormState; + JSCompiler_inline_result.memoizedState = action; + return [initialStateProp, ssrFormState, !1]; +} +function updateActionState(action) { + var stateHook = updateWorkInProgressHook(); + return updateActionStateImpl(stateHook, currentHook, action); +} +function updateActionStateImpl(stateHook, currentStateHook, action) { + currentStateHook = updateReducerImpl( + stateHook, + currentStateHook, + actionStateReducer + )[0]; + stateHook = updateReducer(basicStateReducer)[0]; + if ( + "object" === typeof currentStateHook && + null !== currentStateHook && + "function" === typeof currentStateHook.then + ) + try { + var state = useThenable(currentStateHook); + } catch (x) { + if (x === SuspenseException) throw SuspenseActionException; + throw x; } - for ( - oldFiber = mapRemainingChildren(oldFiber); - !step.done; - newIdx++, step = newChildren.next() - ) - (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), - null !== step && - (shouldTrackSideEffects && - null !== step.alternate && - oldFiber.delete(null === step.key ? newIdx : step.key), - (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), - null === previousNewFiber - ? (resultingFirstChild = step) - : (previousNewFiber.sibling = step), - (previousNewFiber = step)); - shouldTrackSideEffects && - oldFiber.forEach(function (child) { - return deleteChild(returnFiber, child); - }); - isHydrating && pushTreeFork(returnFiber, newIdx); - return resultingFirstChild; + else state = currentStateHook; + currentStateHook = updateWorkInProgressHook(); + var actionQueue = currentStateHook.queue, + dispatch = actionQueue.dispatch; + action !== currentStateHook.memoizedState && + ((currentlyRenderingFiber.flags |= 2048), + pushSimpleEffect( + 9, + createEffectInstance(), + actionStateActionEffect.bind(null, actionQueue, action), + null + )); + return [state, dispatch, stateHook]; +} +function actionStateActionEffect(actionQueue, action) { + actionQueue.action = action; +} +function rerenderActionState(action) { + var stateHook = updateWorkInProgressHook(), + currentStateHook = currentHook; + if (null !== currentStateHook) + return updateActionStateImpl(stateHook, currentStateHook, action); + updateWorkInProgressHook(); + stateHook = stateHook.memoizedState; + currentStateHook = updateWorkInProgressHook(); + var dispatch = currentStateHook.queue.dispatch; + currentStateHook.memoizedState = action; + return [stateHook, dispatch, !1]; +} +function pushSimpleEffect(tag, inst, create, deps) { + tag = { tag: tag, create: create, deps: deps, inst: inst, next: null }; + inst = currentlyRenderingFiber.updateQueue; + null === inst && + ((inst = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = inst)); + create = inst.lastEffect; + null === create + ? (inst.lastEffect = tag.next = tag) + : ((deps = create.next), + (create.next = tag), + (tag.next = deps), + (inst.lastEffect = tag)); + return tag; +} +function createEffectInstance() { + return { destroy: void 0, resource: void 0 }; +} +function updateRef() { + return updateWorkInProgressHook().memoizedState; +} +function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + currentlyRenderingFiber.flags |= fiberFlags; + hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + createEffectInstance(), + create, + deps + ); +} +function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var inst = hook.memoizedState.inst; + null !== currentHook && + null !== deps && + areHookInputsEqual(deps, currentHook.memoizedState.deps) + ? (hook.memoizedState = pushSimpleEffect(hookFlags, inst, create, deps)) + : ((currentlyRenderingFiber.flags |= fiberFlags), + (hook.memoizedState = pushSimpleEffect( + 1 | hookFlags, + inst, + create, + deps + ))); +} +function mountEffect(create, deps) { + mountEffectImpl(8390656, 8, create, deps); +} +function updateEffect(create, deps) { + updateEffectImpl(2048, 8, create, deps); +} +function useEffectEventImpl(payload) { + currentlyRenderingFiber.flags |= 4; + var componentUpdateQueue = currentlyRenderingFiber.updateQueue; + if (null === componentUpdateQueue) + (componentUpdateQueue = createFunctionComponentUpdateQueue()), + (currentlyRenderingFiber.updateQueue = componentUpdateQueue), + (componentUpdateQueue.events = [payload]); + else { + var events = componentUpdateQueue.events; + null === events + ? (componentUpdateQueue.events = [payload]) + : events.push(payload); } - function reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) { - "object" === typeof newChild && - null !== newChild && - newChild.type === REACT_FRAGMENT_TYPE && - null === newChild.key && - (newChild = newChild.props.children); - if ("object" === typeof newChild && null !== newChild) { - switch (newChild.$$typeof) { - case REACT_ELEMENT_TYPE: - a: { - for (var key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) { - key = newChild.type; - if (key === REACT_FRAGMENT_TYPE) { - if (7 === currentFirstChild.tag) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber( - currentFirstChild, - newChild.props.children - ); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - } else if ( - currentFirstChild.elementType === key || - ("object" === typeof key && - null !== key && - key.$$typeof === REACT_LAZY_TYPE && - resolveLazy(key) === currentFirstChild.type) - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.props); - coerceRef(lanes, newChild); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - newChild.type === REACT_FRAGMENT_TYPE - ? ((lanes = createFiberFromFragment( - newChild.props.children, - returnFiber.mode, - lanes, - newChild.key - )), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : ((lanes = createFiberFromTypeAndProps( - newChild.type, - newChild.key, - newChild.props, - null, - returnFiber.mode, - lanes - )), - coerceRef(lanes, newChild), - (lanes.return = returnFiber), - (returnFiber = lanes)); - } - return placeSingleChild(returnFiber); - case REACT_PORTAL_TYPE: - a: { - for (key = newChild.key; null !== currentFirstChild; ) { - if (currentFirstChild.key === key) - if ( - 4 === currentFirstChild.tag && - currentFirstChild.stateNode.containerInfo === - newChild.containerInfo && - currentFirstChild.stateNode.implementation === - newChild.implementation - ) { - deleteRemainingChildren( - returnFiber, - currentFirstChild.sibling - ); - lanes = useFiber(currentFirstChild, newChild.children || []); - lanes.return = returnFiber; - returnFiber = lanes; - break a; - } else { - deleteRemainingChildren(returnFiber, currentFirstChild); - break; - } - else deleteChild(returnFiber, currentFirstChild); - currentFirstChild = currentFirstChild.sibling; - } - lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); - lanes.return = returnFiber; - returnFiber = lanes; - } - return placeSingleChild(returnFiber); - case REACT_LAZY_TYPE: - return ( - (key = newChild._init), - (newChild = key(newChild._payload)), - reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ) - ); - } - if (isArrayImpl(newChild)) - return reconcileChildrenArray( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if (getIteratorFn(newChild)) { - key = getIteratorFn(newChild); - if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); - newChild = key.call(newChild); - return reconcileChildrenIterator( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - } - if ("function" === typeof newChild[ASYNC_ITERATOR]) - return reconcileChildrenAsyncIteratable( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - if ("function" === typeof newChild.then) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - unwrapThenable(newChild), - lanes - ); - if (newChild.$$typeof === REACT_CONTEXT_TYPE) - return reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - readContextDuringReconciliation(returnFiber, newChild), - lanes - ); - throwOnInvalidObjectType(returnFiber, newChild); - } - return ("string" === typeof newChild && "" !== newChild) || - "number" === typeof newChild || - "bigint" === typeof newChild - ? ((newChild = "" + newChild), - null !== currentFirstChild && 6 === currentFirstChild.tag - ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), - (lanes = useFiber(currentFirstChild, newChild)), - (lanes.return = returnFiber), - (returnFiber = lanes)) - : (deleteRemainingChildren(returnFiber, currentFirstChild), - (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), - (lanes.return = returnFiber), - (returnFiber = lanes)), - placeSingleChild(returnFiber)) - : deleteRemainingChildren(returnFiber, currentFirstChild); - } - return function (returnFiber, currentFirstChild, newChild, lanes) { - try { - thenableIndexCounter = 0; - var firstChildFiber = reconcileChildFibersImpl( - returnFiber, - currentFirstChild, - newChild, - lanes - ); - thenableState = null; - return firstChildFiber; - } catch (x) { - if (x === SuspenseException || x === SuspenseActionException) throw x; - var fiber = createFiberImplClass(29, x, null, returnFiber.mode); - fiber.lanes = lanes; - fiber.return = returnFiber; - return fiber; - } finally { - } +} +function updateEvent(callback) { + var ref = updateWorkInProgressHook().memoizedState; + useEffectEventImpl({ ref: ref, nextImpl: callback }); + return function () { + if (0 !== (executionContext & 2)) throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); }; } -var reconcileChildFibers = createChildReconciler(!0), - mountChildFibers = createChildReconciler(!1), - suspenseHandlerStackCursor = createCursor(null), - shellBoundary = null; -function pushPrimaryTreeSuspenseHandler(handler) { - var current = handler.alternate; - push(suspenseStackCursor, suspenseStackCursor.current & 1); - push(suspenseHandlerStackCursor, handler); - null === shellBoundary && - (null === current || null !== currentTreeHiddenStackCursor.current - ? (shellBoundary = handler) - : null !== current.memoizedState && (shellBoundary = handler)); +function updateInsertionEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); } -function pushOffscreenSuspenseHandler(fiber) { - if (22 === fiber.tag) { - if ( - (push(suspenseStackCursor, suspenseStackCursor.current), - push(suspenseHandlerStackCursor, fiber), - null === shellBoundary) - ) { - var current = fiber.alternate; - null !== current && - null !== current.memoizedState && - (shellBoundary = fiber); - } - } else reuseSuspenseHandlerOnStack(fiber); +function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 4, create, deps); } -function reuseSuspenseHandlerOnStack() { - push(suspenseStackCursor, suspenseStackCursor.current); - push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) { + create = create(); + var refCleanup = ref(create); + return function () { + "function" === typeof refCleanup ? refCleanup() : ref(null); + }; + } + if (null !== ref && void 0 !== ref) + return ( + (create = create()), + (ref.current = create), + function () { + ref.current = null; + } + ); } -function popSuspenseHandler(fiber) { - pop(suspenseHandlerStackCursor); - shellBoundary === fiber && (shellBoundary = null); - pop(suspenseStackCursor); +function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + updateEffectImpl(4, 4, imperativeHandleEffect.bind(null, create, ref), deps); } -var suspenseStackCursor = createCursor(0); -function findFirstSuspended(row) { - for (var node = row; null !== node; ) { - if (13 === node.tag) { - var state = node.memoizedState; - if ( - null !== state && - ((state = state.dehydrated), - null === state || - "$?" === state.data || - isSuspenseInstanceFallback(state)) - ) - return node; - } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { - if (0 !== (node.flags & 128)) return node; - } else if (null !== node.child) { - node.child.return = node; - node = node.child; - continue; - } - if (node === row) break; - for (; null === node.sibling; ) { - if (null === node.return || node.return === row) return null; - node = node.return; - } - node.sibling.return = node.return; - node = node.sibling; - } - return null; +function mountDebugValue() {} +function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; } -function applyDerivedStateFromProps( - workInProgress, - ctor, - getDerivedStateFromProps, - nextProps -) { - ctor = workInProgress.memoizedState; - getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); - getDerivedStateFromProps = - null === getDerivedStateFromProps || void 0 === getDerivedStateFromProps - ? ctor - : assign({}, ctor, getDerivedStateFromProps); - workInProgress.memoizedState = getDerivedStateFromProps; - 0 === workInProgress.lanes && - (workInProgress.updateQueue.baseState = getDerivedStateFromProps); -} -var classComponentUpdater = { - isMounted: function (component) { - return (component = component._reactInternals) - ? getNearestMountedFiber(component) === component - : !1; - }, - enqueueSetState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueReplaceState: function (inst, payload, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 1; - update.payload = payload; - void 0 !== callback && null !== callback && (update.callback = callback); - payload = enqueueUpdate(inst, update, lane); - null !== payload && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(payload, inst, lane), - entangleTransitions(payload, inst, lane)); - }, - enqueueForceUpdate: function (inst, callback) { - inst = inst._reactInternals; - var lane = requestUpdateLane(), - update = createUpdate(lane); - update.tag = 2; - void 0 !== callback && null !== callback && (update.callback = callback); - callback = enqueueUpdate(inst, update, lane); - null !== callback && - (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(callback, inst, lane), - entangleTransitions(callback, inst, lane)); - } -}; -function checkShouldComponentUpdate( - workInProgress, - ctor, - oldProps, - newProps, - oldState, - newState, - nextContext -) { - workInProgress = workInProgress.stateNode; - return "function" === typeof workInProgress.shouldComponentUpdate - ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) - : ctor.prototype && ctor.prototype.isPureReactComponent - ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) - : !0; -} -function callComponentWillReceiveProps( - workInProgress, - instance, - newProps, - nextContext -) { - workInProgress = instance.state; - "function" === typeof instance.componentWillReceiveProps && - instance.componentWillReceiveProps(newProps, nextContext); - "function" === typeof instance.UNSAFE_componentWillReceiveProps && - instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); - instance.state !== workInProgress && - classComponentUpdater.enqueueReplaceState(instance, instance.state, null); -} -function resolveClassComponentProps(Component, baseProps) { - var newProps = baseProps; - if ("ref" in baseProps) { - newProps = {}; - for (var propName in baseProps) - "ref" !== propName && (newProps[propName] = baseProps[propName]); - } - if ((Component = Component.defaultProps)) { - newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$72 in Component) - void 0 === newProps[propName$72] && - (newProps[propName$72] = Component[propName$72]); +function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== deps && areHookInputsEqual(deps, prevState[1])) + return prevState[0]; + prevState = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } } - return newProps; -} -var reportGlobalError = - "function" === typeof reportError - ? reportError - : function (error) { - if ( - "object" === typeof window && - "function" === typeof window.ErrorEvent - ) { - var event = new window.ErrorEvent("error", { - bubbles: !0, - cancelable: !0, - message: - "object" === typeof error && - null !== error && - "string" === typeof error.message - ? String(error.message) - : String(error), - error: error - }); - if (!window.dispatchEvent(event)) return; - } else if ( - "object" === typeof process && - "function" === typeof process.emit - ) { - process.emit("uncaughtException", error); - return; - } - console.error(error); - }; -function defaultOnUncaughtError(error) { - reportGlobalError(error); -} -function defaultOnCaughtError(error) { - console.error(error); + hook.memoizedState = [prevState, deps]; + return prevState; } -function defaultOnRecoverableError(error) { - reportGlobalError(error); +function mountDeferredValueImpl(hook, value, initialValue) { + if (void 0 === initialValue || 0 !== (renderLanes & 1073741824)) + return (hook.memoizedState = value); + hook.memoizedState = initialValue; + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return initialValue; } -function logUncaughtError(root, errorInfo) { - try { - var onUncaughtError = root.onUncaughtError; - onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$73) { - setTimeout(function () { - throw e$73; - }); - } +function updateDeferredValueImpl(hook, prevValue, value, initialValue) { + if (objectIs(value, prevValue)) return value; + if (null !== currentTreeHiddenStackCursor.current) + return ( + (hook = mountDeferredValueImpl(hook, value, initialValue)), + objectIs(hook, prevValue) || (didReceiveUpdate = !0), + hook + ); + if (0 === (renderLanes & 42)) + return (didReceiveUpdate = !0), (hook.memoizedState = value); + hook = requestDeferredLane(); + currentlyRenderingFiber.lanes |= hook; + workInProgressRootSkippedLanes |= hook; + return prevValue; } -function logCaughtError(root, boundary, errorInfo) { +function startTransition(fiber, queue, pendingState, finishedState, callback) { + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = + 0 !== previousPriority && 8 > previousPriority ? previousPriority : 8; + var prevTransition = ReactSharedInternals.T, + currentTransition = {}; + ReactSharedInternals.T = currentTransition; + dispatchOptimisticSetState(fiber, !1, queue, pendingState); try { - var onCaughtError = root.onCaughtError; - onCaughtError(errorInfo.value, { - componentStack: errorInfo.stack, - errorBoundary: 1 === boundary.tag ? boundary.stateNode : null - }); - } catch (e$74) { - setTimeout(function () { - throw e$74; - }); + var returnValue = callback(), + onStartTransitionFinish = ReactSharedInternals.S; + null !== onStartTransitionFinish && + onStartTransitionFinish(currentTransition, returnValue); + if ( + null !== returnValue && + "object" === typeof returnValue && + "function" === typeof returnValue.then + ) { + var thenableForFinishedState = chainThenableValue( + returnValue, + finishedState + ); + dispatchSetStateInternal( + fiber, + queue, + thenableForFinishedState, + requestUpdateLane(fiber) + ); + } else + dispatchSetStateInternal( + fiber, + queue, + finishedState, + requestUpdateLane(fiber) + ); + } catch (error) { + dispatchSetStateInternal( + fiber, + queue, + { then: function () {}, status: "rejected", reason: error }, + requestUpdateLane() + ); + } finally { + (ReactDOMSharedInternals.p = previousPriority), + (ReactSharedInternals.T = prevTransition); } } -function createRootErrorUpdate(root, errorInfo, lane) { - lane = createUpdate(lane); - lane.tag = 3; - lane.payload = { element: null }; - lane.callback = function () { - logUncaughtError(root, errorInfo); - }; - return lane; +function noop$3() {} +function startHostTransition(formFiber, pendingState, action, formData) { + if (5 !== formFiber.tag) throw Error(formatProdErrorMessage(476)); + var queue = ensureFormComponentIsStateful(formFiber).queue; + startTransition( + formFiber, + queue, + pendingState, + sharedNotPendingObject, + null === action + ? noop$3 + : function () { + requestFormReset$2(formFiber); + return action(formData); + } + ); } -function createClassErrorUpdate(lane) { - lane = createUpdate(lane); - lane.tag = 3; - return lane; +function ensureFormComponentIsStateful(formFiber) { + var existingStateHook = formFiber.memoizedState; + if (null !== existingStateHook) return existingStateHook; + existingStateHook = { + memoizedState: sharedNotPendingObject, + baseState: sharedNotPendingObject, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: sharedNotPendingObject + }, + next: null + }; + var initialResetState = {}; + existingStateHook.next = { + memoizedState: initialResetState, + baseState: initialResetState, + baseQueue: null, + queue: { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialResetState + }, + next: null + }; + formFiber.memoizedState = existingStateHook; + formFiber = formFiber.alternate; + null !== formFiber && (formFiber.memoizedState = existingStateHook); + return existingStateHook; } -function initializeClassErrorUpdate(update, root, fiber, errorInfo) { - var getDerivedStateFromError = fiber.type.getDerivedStateFromError; - if ("function" === typeof getDerivedStateFromError) { - var error = errorInfo.value; - update.payload = function () { - return getDerivedStateFromError(error); - }; - update.callback = function () { - logCaughtError(root, fiber, errorInfo); - }; +function requestFormReset$2(formFiber) { + var resetStateQueue = ensureFormComponentIsStateful(formFiber).next.queue; + dispatchSetStateInternal(formFiber, resetStateQueue, {}, requestUpdateLane()); +} +function useHostTransitionStatus() { + return readContext(HostTransitionContext); +} +function updateId() { + return updateWorkInProgressHook().memoizedState; +} +function updateRefresh() { + return updateWorkInProgressHook().memoizedState; +} +function refreshCache(fiber, seedKey, seedValue) { + for (var provider = fiber.return; null !== provider; ) { + switch (provider.tag) { + case 24: + case 3: + var lane = requestUpdateLane(); + fiber = createUpdate(lane); + var root$46 = enqueueUpdate(provider, fiber, lane); + null !== root$46 && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(root$46, provider, lane), + entangleTransitions(root$46, provider, lane)); + provider = createCache(); + null !== seedKey && + void 0 !== seedKey && + null !== root$46 && + provider.data.set(seedKey, seedValue); + fiber.payload = { cache: provider }; + return; + } + provider = provider.return; } - var inst = fiber.stateNode; - null !== inst && - "function" === typeof inst.componentDidCatch && - (update.callback = function () { - logCaughtError(root, fiber, errorInfo); - "function" !== typeof getDerivedStateFromError && - (null === legacyErrorBoundariesThatAlreadyFailed - ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) - : legacyErrorBoundariesThatAlreadyFailed.add(this)); - var stack = errorInfo.stack; - this.componentDidCatch(errorInfo.value, { - componentStack: null !== stack ? stack : "" - }); - }); } -function resetSuspendedComponent(sourceFiber, rootRenderLanes) { - var currentSourceFiber = sourceFiber.alternate; - null !== currentSourceFiber && - propagateParentContextChanges( - currentSourceFiber, - sourceFiber, - rootRenderLanes, - !0 - ); +function dispatchReducerAction(fiber, queue, action) { + var lane = requestUpdateLane(); + action = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + isRenderPhaseUpdate(fiber) + ? enqueueRenderPhaseUpdate(queue, action) + : ((action = enqueueConcurrentHookUpdate(fiber, queue, action, lane)), + null !== action && + (startUpdateTimerByLane(lane), + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane))); } -function markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes -) { - suspenseBoundary.flags |= 65536; - suspenseBoundary.lanes = rootRenderLanes; - return suspenseBoundary; +function dispatchSetState(fiber, queue, action) { + var lane = requestUpdateLane(); + dispatchSetStateInternal(fiber, queue, action, lane) && + startUpdateTimerByLane(lane); } -function throwException( - root, - returnFiber, - sourceFiber, - value, - rootRenderLanes -) { - sourceFiber.flags |= 32768; - isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); - if ( - null !== value && - "object" === typeof value && - (value.$$typeof === REACT_POSTPONE_TYPE && - (value = { then: function () {} }), - "function" === typeof value.then) - ) { - resetSuspendedComponent(sourceFiber, rootRenderLanes); - var suspenseBoundary = suspenseHandlerStackCursor.current; - if (null !== suspenseBoundary) { - switch (suspenseBoundary.tag) { - case 13: - return ( - null === shellBoundary - ? renderDidSuspendDelayIfPossible() - : null === suspenseBoundary.alternate && - 0 === workInProgressRootExitStatus && - (workInProgressRootExitStatus = 3), - (suspenseBoundary.flags &= -257), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? (suspenseBoundary.updateQueue = new Set([value])) - : sourceFiber.add(value), - attachPingListener(root, value, rootRenderLanes)), - !1 - ); - case 22: +function dispatchSetStateInternal(fiber, queue, action, lane) { + var update = { + lane: lane, + revertLane: 0, + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) enqueueRenderPhaseUpdate(queue, update); + else { + var alternate = fiber.alternate; + if ( + 0 === fiber.lanes && + (null === alternate || 0 === alternate.lanes) && + ((alternate = queue.lastRenderedReducer), null !== alternate) + ) + try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.hasEagerState = !0; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return ( - (suspenseBoundary.flags |= 65536), - value === noopSuspenseyCommitThenable - ? (suspenseBoundary.flags |= 16384) - : ((sourceFiber = suspenseBoundary.updateQueue), - null === sourceFiber - ? ((sourceFiber = { - transitions: null, - markerInstances: null, - retryQueue: new Set([value]) - }), - (suspenseBoundary.updateQueue = sourceFiber)) - : ((returnFiber = sourceFiber.retryQueue), - null === returnFiber - ? (sourceFiber.retryQueue = new Set([value])) - : returnFiber.add(value)), - attachPingListener(root, value, rootRenderLanes)), + enqueueUpdate$1(fiber, queue, update, 0), + null === workInProgressRoot && finishQueueingConcurrentUpdates(), !1 ); + } catch (error) { + } finally { } - throw Error(formatProdErrorMessage(435, suspenseBoundary.tag)); - } - attachPingListener(root, value, rootRenderLanes); - renderDidSuspendDelayIfPossible(); - return !1; + action = enqueueConcurrentHookUpdate(fiber, queue, update, lane); + if (null !== action) + return ( + scheduleUpdateOnFiber(action, fiber, lane), + entangleTransitionUpdate(action, queue, lane), + !0 + ); } - if (isHydrating) - return ( - (suspenseBoundary = suspenseHandlerStackCursor.current), - null !== suspenseBoundary - ? (0 === (suspenseBoundary.flags & 65536) && - (suspenseBoundary.flags |= 256), - markSuspenseBoundaryShouldCapture( - suspenseBoundary, - returnFiber, - sourceFiber, - root, - rootRenderLanes - ), - value !== HydrationMismatchException && - ((root = Error(formatProdErrorMessage(422), { cause: value })), - queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) - : (value !== HydrationMismatchException && - ((returnFiber = Error(formatProdErrorMessage(423), { - cause: value - })), - queueHydrationError( - createCapturedValueAtFiber(returnFiber, sourceFiber) - )), - (root = root.current.alternate), - (root.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (root.lanes |= rootRenderLanes), - (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), - (rootRenderLanes = createRootErrorUpdate( - root.stateNode, - sourceFiber, - rootRenderLanes - )), - enqueueCapturedUpdate(root, rootRenderLanes), - 4 !== workInProgressRootExitStatus && - (workInProgressRootExitStatus = 2)), - !1 - ); - suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value }); - queueConcurrentError( - createCapturedValueAtFiber(suspenseBoundary, sourceFiber) - ); - 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); - if (null === returnFiber) return !0; - sourceFiber = createCapturedValueAtFiber(value, sourceFiber); - do { - switch (returnFiber.tag) { - case 3: - return ( - (returnFiber.flags |= 65536), - (root = rootRenderLanes & -rootRenderLanes), - (returnFiber.lanes |= root), - (root = createRootErrorUpdate( - returnFiber.stateNode, - sourceFiber, - root - )), - enqueueCapturedUpdate(returnFiber, root), - !1 - ); - case 1: - if ( - ((value = returnFiber.type), - (suspenseBoundary = returnFiber.stateNode), - 0 === (returnFiber.flags & 128) && - ("function" === typeof value.getDerivedStateFromError || - (null !== suspenseBoundary && - "function" === typeof suspenseBoundary.componentDidCatch && - (null === legacyErrorBoundariesThatAlreadyFailed || - !legacyErrorBoundariesThatAlreadyFailed.has( - suspenseBoundary - ))))) - ) - return ( - (returnFiber.flags |= 65536), - (rootRenderLanes &= -rootRenderLanes), - (returnFiber.lanes |= rootRenderLanes), - (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), - initializeClassErrorUpdate( - rootRenderLanes, - root, - returnFiber, - sourceFiber - ), - enqueueCapturedUpdate(returnFiber, rootRenderLanes), - !1 - ); - } - returnFiber = returnFiber.return; - } while (null !== returnFiber); return !1; } -var SelectiveHydrationException = Error(formatProdErrorMessage(461)), - didReceiveUpdate = !1; -function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { - workInProgress.child = - null === current - ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) - : reconcileChildFibers( - workInProgress, - current.child, - nextChildren, - renderLanes - ); +function dispatchOptimisticSetState(fiber, throwIfDuringRender, queue, action) { + action = { + lane: 2, + revertLane: requestTransitionLane(), + action: action, + hasEagerState: !1, + eagerState: null, + next: null + }; + if (isRenderPhaseUpdate(fiber)) { + if (throwIfDuringRender) throw Error(formatProdErrorMessage(479)); + } else + (throwIfDuringRender = enqueueConcurrentHookUpdate( + fiber, + queue, + action, + 2 + )), + null !== throwIfDuringRender && + (startUpdateTimerByLane(2), + scheduleUpdateOnFiber(throwIfDuringRender, fiber, 2)); } -function updateForwardRef( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - Component = Component.render; - var ref = workInProgress.ref; - if ("ref" in nextProps) { - var propsWithoutRef = {}; - for (var key in nextProps) - "ref" !== key && (propsWithoutRef[key] = nextProps[key]); - } else propsWithoutRef = nextProps; - prepareToReadContext(workInProgress); - nextProps = renderWithHooks( - current, - workInProgress, - Component, - propsWithoutRef, - ref, - renderLanes +function isRenderPhaseUpdate(fiber) { + var alternate = fiber.alternate; + return ( + fiber === currentlyRenderingFiber || + (null !== alternate && alternate === currentlyRenderingFiber) ); - key = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && key && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; } -function updateMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null === current) { - var type = Component.type; - if ( - "function" === typeof type && - !shouldConstruct(type) && - void 0 === type.defaultProps && - null === Component.compare - ) - return ( - (workInProgress.tag = 15), - (workInProgress.type = type), - updateSimpleMemoComponent( - current, - workInProgress, - type, - nextProps, - renderLanes - ) - ); - current = createFiberFromTypeAndProps( - Component.type, - null, - nextProps, - workInProgress, - workInProgress.mode, - renderLanes - ); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); - } - type = current.child; - if (!checkScheduledUpdateOrContext(current, renderLanes)) { - var prevProps = type.memoizedProps; - Component = Component.compare; - Component = null !== Component ? Component : shallowEqual; - if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); - } - workInProgress.flags |= 1; - current = createWorkInProgress(type, nextProps); - current.ref = workInProgress.ref; - current.return = workInProgress; - return (workInProgress.child = current); +function enqueueRenderPhaseUpdate(queue, update) { + didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = + !0; + var pending = queue.pending; + null === pending + ? (update.next = update) + : ((update.next = pending.next), (pending.next = update)); + queue.pending = update; } -function updateSimpleMemoComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - if (null !== current) { - var prevProps = current.memoizedProps; - if ( - shallowEqual(prevProps, nextProps) && - current.ref === workInProgress.ref - ) - if ( - ((didReceiveUpdate = !1), - (workInProgress.pendingProps = nextProps = prevProps), - checkScheduledUpdateOrContext(current, renderLanes)) - ) - 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); - else - return ( - (workInProgress.lanes = current.lanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); +function entangleTransitionUpdate(root, queue, lane) { + if (0 !== (lane & 4194176)) { + var queueLanes = queue.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + queue.lanes = lane; + markRootEntangled(root, lane); } - return updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes - ); } -function updateOffscreenComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - nextChildren = nextProps.children, - nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), - prevState = null !== current ? current.memoizedState : null; - markRef(current, workInProgress); - if ("hidden" === nextProps.mode || nextIsDetached) { - if (0 !== (workInProgress.flags & 128)) { - nextProps = - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; - if (null !== current) { - nextChildren = workInProgress.child = current.child; - for (nextIsDetached = 0; null !== nextChildren; ) - (nextIsDetached = - nextIsDetached | nextChildren.lanes | nextChildren.childLanes), - (nextChildren = nextChildren.sibling); - workInProgress.childLanes = nextIsDetached & ~nextProps; - } else (workInProgress.childLanes = 0), (workInProgress.child = null); - return deferHiddenOffscreenComponent( - current, - workInProgress, - nextProps, - renderLanes - ); - } - if (0 !== (renderLanes & 536870912)) - (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), - null !== current && - pushTransition( - workInProgress, - null !== prevState ? prevState.cachePool : null - ), - null !== prevState - ? pushHiddenContext(workInProgress, prevState) - : reuseHiddenContextOnStack(), - pushOffscreenSuspenseHandler(workInProgress); - else - return ( - (workInProgress.lanes = workInProgress.childLanes = 536870912), - deferHiddenOffscreenComponent( - current, - workInProgress, - null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, - renderLanes - ) +var ContextOnlyDispatcher = { + readContext: readContext, + use: use, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useInsertionEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useSyncExternalStore: throwInvalidHookError, + useId: throwInvalidHookError, + useHostTransitionStatus: throwInvalidHookError, + useFormState: throwInvalidHookError, + useActionState: throwInvalidHookError, + useOptimistic: throwInvalidHookError, + useMemoCache: throwInvalidHookError, + useCacheRefresh: throwInvalidHookError +}; +ContextOnlyDispatcher.useEffectEvent = throwInvalidHookError; +var HooksDispatcherOnMount = { + readContext: readContext, + use: use, + useCallback: function (callback, deps) { + mountWorkInProgressHook().memoizedState = [ + callback, + void 0 === deps ? null : deps + ]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function (ref, create, deps) { + deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null; + mountEffectImpl( + 4194308, + 4, + imperativeHandleEffect.bind(null, create, ref), + deps ); - } else - null !== prevState - ? (pushTransition(workInProgress, prevState.cachePool), - pushHiddenContext(workInProgress, prevState), - reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.memoizedState = null)) - : (null !== current && pushTransition(workInProgress, null), - reuseHiddenContextOnStack(), - reuseSuspenseHandlerOnStack(workInProgress)); - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -function deferHiddenOffscreenComponent( - current, - workInProgress, - nextBaseLanes, - renderLanes -) { - var JSCompiler_inline_result = peekCacheFromPool(); - JSCompiler_inline_result = - null === JSCompiler_inline_result - ? null - : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; - workInProgress.memoizedState = { - baseLanes: nextBaseLanes, - cachePool: JSCompiler_inline_result + }, + useLayoutEffect: function (create, deps) { + return mountEffectImpl(4194308, 4, create, deps); + }, + useInsertionEffect: function (create, deps) { + mountEffectImpl(4, 2, create, deps); + }, + useMemo: function (nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = void 0 === deps ? null : deps; + var nextValue = nextCreate(); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + nextCreate(); + } finally { + setIsStrictModeForDevtools(!1); + } + } + hook.memoizedState = [nextValue, deps]; + return nextValue; + }, + useReducer: function (reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + if (void 0 !== init) { + var initialState = init(initialArg); + if (shouldDoubleInvokeUserFnsInHooksDEV) { + setIsStrictModeForDevtools(!0); + try { + init(initialArg); + } finally { + setIsStrictModeForDevtools(!1); + } + } + } else initialState = initialArg; + hook.memoizedState = hook.baseState = initialState; + reducer = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialState + }; + hook.queue = reducer; + reducer = reducer.dispatch = dispatchReducerAction.bind( + null, + currentlyRenderingFiber, + reducer + ); + return [hook.memoizedState, reducer]; + }, + useRef: function (initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { current: initialValue }; + return (hook.memoizedState = initialValue); + }, + useState: function (initialState) { + initialState = mountStateImpl(initialState); + var queue = initialState.queue, + dispatch = dispatchSetState.bind(null, currentlyRenderingFiber, queue); + queue.dispatch = dispatch; + return [initialState.memoizedState, dispatch]; + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = mountWorkInProgressHook(); + return mountDeferredValueImpl(hook, value, initialValue); + }, + useTransition: function () { + var stateHook = mountStateImpl(!1); + stateHook = startTransition.bind( + null, + currentlyRenderingFiber, + stateHook.queue, + !0, + !1 + ); + mountWorkInProgressHook().memoizedState = stateHook; + return [!1, stateHook]; + }, + useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { + var fiber = currentlyRenderingFiber, + hook = mountWorkInProgressHook(); + if (isHydrating) { + if (void 0 === getServerSnapshot) + throw Error(formatProdErrorMessage(407)); + getServerSnapshot = getServerSnapshot(); + } else { + getServerSnapshot = getSnapshot(); + if (null === workInProgressRoot) + throw Error(formatProdErrorMessage(349)); + 0 !== (workInProgressRootRenderLanes & 60) || + pushStoreConsistencyCheck(fiber, getSnapshot, getServerSnapshot); + } + hook.memoizedState = getServerSnapshot; + var inst = { value: getServerSnapshot, getSnapshot: getSnapshot }; + hook.queue = inst; + mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [ + subscribe + ]); + fiber.flags |= 2048; + pushSimpleEffect( + 9, + createEffectInstance(), + updateStoreInstance.bind( + null, + fiber, + inst, + getServerSnapshot, + getSnapshot + ), + null + ); + return getServerSnapshot; + }, + useId: function () { + var hook = mountWorkInProgressHook(), + identifierPrefix = workInProgressRoot.identifierPrefix; + if (isHydrating) { + var JSCompiler_inline_result = treeContextOverflow; + var idWithLeadingBit = treeContextId; + JSCompiler_inline_result = + ( + idWithLeadingBit & ~(1 << (32 - clz32(idWithLeadingBit) - 1)) + ).toString(32) + JSCompiler_inline_result; + identifierPrefix = + ":" + identifierPrefix + "R" + JSCompiler_inline_result; + JSCompiler_inline_result = localIdCounter++; + 0 < JSCompiler_inline_result && + (identifierPrefix += "H" + JSCompiler_inline_result.toString(32)); + identifierPrefix += ":"; + } else + (JSCompiler_inline_result = globalClientIdCounter++), + (identifierPrefix = + ":" + + identifierPrefix + + "r" + + JSCompiler_inline_result.toString(32) + + ":"); + return (hook.memoizedState = identifierPrefix); + }, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: mountActionState, + useActionState: mountActionState, + useOptimistic: function (passthrough) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = hook.baseState = passthrough; + var queue = { + pending: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: null, + lastRenderedState: null + }; + hook.queue = queue; + hook = dispatchOptimisticSetState.bind( + null, + currentlyRenderingFiber, + !0, + queue + ); + queue.dispatch = hook; + return [passthrough, hook]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: function () { + return (mountWorkInProgressHook().memoizedState = refreshCache.bind( + null, + currentlyRenderingFiber + )); + }, + useEffectEvent: function (callback) { + var hook = mountWorkInProgressHook(), + ref = { impl: callback }; + hook.memoizedState = ref; + return function () { + if (0 !== (executionContext & 2)) + throw Error(formatProdErrorMessage(440)); + return ref.impl.apply(void 0, arguments); + }; + } + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function () { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: updateActionState, + useActionState: updateActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh }; - null !== current && pushTransition(workInProgress, null); - reuseHiddenContextOnStack(); - pushOffscreenSuspenseHandler(workInProgress); - null !== current && - propagateParentContextChanges(current, workInProgress, renderLanes, !0); - return null; +HooksDispatcherOnUpdate.useEffectEvent = updateEvent; +var HooksDispatcherOnRerender = { + readContext: readContext, + use: use, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useInsertionEffect: updateInsertionEffect, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function () { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function (value, initialValue) { + var hook = updateWorkInProgressHook(); + return null === currentHook + ? mountDeferredValueImpl(hook, value, initialValue) + : updateDeferredValueImpl( + hook, + currentHook.memoizedState, + value, + initialValue + ); + }, + useTransition: function () { + var booleanOrThenable = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [ + "boolean" === typeof booleanOrThenable + ? booleanOrThenable + : useThenable(booleanOrThenable), + start + ]; + }, + useSyncExternalStore: updateSyncExternalStore, + useId: updateId, + useHostTransitionStatus: useHostTransitionStatus, + useFormState: rerenderActionState, + useActionState: rerenderActionState, + useOptimistic: function (passthrough, reducer) { + var hook = updateWorkInProgressHook(); + if (null !== currentHook) + return updateOptimisticImpl(hook, currentHook, passthrough, reducer); + hook.baseState = passthrough; + return [passthrough, hook.queue.dispatch]; + }, + useMemoCache: useMemoCache, + useCacheRefresh: updateRefresh +}; +HooksDispatcherOnRerender.useEffectEvent = updateEvent; +var thenableState = null, + thenableIndexCounter = 0; +function unwrapThenable(thenable) { + var index = thenableIndexCounter; + thenableIndexCounter += 1; + null === thenableState && (thenableState = []); + return trackUsedThenable(thenableState, thenable, index); } -function markRef(current, workInProgress) { - var ref = workInProgress.ref; - if (null === ref) - null !== current && - null !== current.ref && - (workInProgress.flags |= 2097664); - else { - if ("function" !== typeof ref && "object" !== typeof ref) - throw Error(formatProdErrorMessage(284)); - if (null === current || current.ref !== ref) - workInProgress.flags |= 2097664; - } +function coerceRef(workInProgress, element) { + element = element.props.ref; + workInProgress.ref = void 0 !== element ? element : null; } -function updateFunctionComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - Component = renderWithHooks( - current, - workInProgress, - Component, - nextProps, - void 0, - renderLanes +function throwOnInvalidObjectType(returnFiber, newChild) { + if (newChild.$$typeof === REACT_LEGACY_ELEMENT_TYPE) + throw Error(formatProdErrorMessage(525)); + returnFiber = Object.prototype.toString.call(newChild); + throw Error( + formatProdErrorMessage( + 31, + "[object Object]" === returnFiber + ? "object with keys {" + Object.keys(newChild).join(", ") + "}" + : returnFiber + ) ); - nextProps = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && nextProps && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, Component, renderLanes); - return workInProgress.child; } -function replayFunctionComponent( - current, - workInProgress, - nextProps, - Component, - secondArg, - renderLanes -) { - prepareToReadContext(workInProgress); - workInProgress.updateQueue = null; - nextProps = renderWithHooksAgain( - workInProgress, - Component, - nextProps, - secondArg - ); - finishRenderingHooks(current); - Component = checkDidRenderIdHook(); - if (null !== current && !didReceiveUpdate) - return ( - bailoutHooks(current, workInProgress, renderLanes), - bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) - ); - isHydrating && Component && pushMaterializedTreeId(workInProgress); - workInProgress.flags |= 1; - reconcileChildren(current, workInProgress, nextProps, renderLanes); - return workInProgress.child; +function resolveLazy(lazyType) { + var init = lazyType._init; + return init(lazyType._payload); } -function updateClassComponent( - current, - workInProgress, - Component, - nextProps, - renderLanes -) { - prepareToReadContext(workInProgress); - if (null === workInProgress.stateNode) { - var context = emptyContextObject, - contextType = Component.contextType; - "object" === typeof contextType && - null !== contextType && - (context = readContext(contextType)); - context = new Component(nextProps, context); - workInProgress.memoizedState = - null !== context.state && void 0 !== context.state ? context.state : null; - context.updater = classComponentUpdater; - workInProgress.stateNode = context; - context._reactInternals = workInProgress; - context = workInProgress.stateNode; - context.props = nextProps; - context.state = workInProgress.memoizedState; - context.refs = {}; - initializeUpdateQueue(workInProgress); - contextType = Component.contextType; - context.context = - "object" === typeof contextType && null !== contextType - ? readContext(contextType) - : emptyContextObject; - context.state = workInProgress.memoizedState; - contextType = Component.getDerivedStateFromProps; - "function" === typeof contextType && - (applyDerivedStateFromProps( - workInProgress, - Component, - contextType, - nextProps - ), - (context.state = workInProgress.memoizedState)); - "function" === typeof Component.getDerivedStateFromProps || - "function" === typeof context.getSnapshotBeforeUpdate || - ("function" !== typeof context.UNSAFE_componentWillMount && - "function" !== typeof context.componentWillMount) || - ((contextType = context.state), - "function" === typeof context.componentWillMount && - context.componentWillMount(), - "function" === typeof context.UNSAFE_componentWillMount && - context.UNSAFE_componentWillMount(), - contextType !== context.state && - classComponentUpdater.enqueueReplaceState(context, context.state, null), - processUpdateQueue(workInProgress, nextProps, context, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction(), - (context.state = workInProgress.memoizedState)); - "function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308); - nextProps = !0; - } else if (null === current) { - context = workInProgress.stateNode; - var unresolvedOldProps = workInProgress.memoizedProps, - oldProps = resolveClassComponentProps(Component, unresolvedOldProps); - context.props = oldProps; - var oldContext = context.context, - contextType$jscomp$0 = Component.contextType; - contextType = emptyContextObject; - "object" === typeof contextType$jscomp$0 && - null !== contextType$jscomp$0 && - (contextType = readContext(contextType$jscomp$0)); - var getDerivedStateFromProps = Component.getDerivedStateFromProps; - contextType$jscomp$0 = - "function" === typeof getDerivedStateFromProps || - "function" === typeof context.getSnapshotBeforeUpdate; - unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; - contextType$jscomp$0 || - ("function" !== typeof context.UNSAFE_componentWillReceiveProps && - "function" !== typeof context.componentWillReceiveProps) || - ((unresolvedOldProps || oldContext !== contextType) && - callComponentWillReceiveProps( - workInProgress, - context, - nextProps, - contextType - )); - hasForceUpdate = !1; - var oldState = workInProgress.memoizedState; - context.state = oldState; - processUpdateQueue(workInProgress, nextProps, context, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - oldContext = workInProgress.memoizedState; - unresolvedOldProps || oldState !== oldContext || hasForceUpdate - ? ("function" === typeof getDerivedStateFromProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - getDerivedStateFromProps, - nextProps - ), - (oldContext = workInProgress.memoizedState)), - (oldProps = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - oldProps, - nextProps, - oldState, - oldContext, - contextType - )) - ? (contextType$jscomp$0 || - ("function" !== typeof context.UNSAFE_componentWillMount && - "function" !== typeof context.componentWillMount) || - ("function" === typeof context.componentWillMount && - context.componentWillMount(), - "function" === typeof context.UNSAFE_componentWillMount && - context.UNSAFE_componentWillMount()), - "function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308)) - : ("function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = oldContext)), - (context.props = nextProps), - (context.state = oldContext), - (context.context = contextType), - (nextProps = oldProps)) - : ("function" === typeof context.componentDidMount && - (workInProgress.flags |= 4194308), - (nextProps = !1)); - } else { - context = workInProgress.stateNode; - cloneUpdateQueue(current, workInProgress); - contextType = workInProgress.memoizedProps; - contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); - context.props = contextType$jscomp$0; - getDerivedStateFromProps = workInProgress.pendingProps; - oldState = context.context; - oldContext = Component.contextType; - oldProps = emptyContextObject; - "object" === typeof oldContext && - null !== oldContext && - (oldProps = readContext(oldContext)); - unresolvedOldProps = Component.getDerivedStateFromProps; - (oldContext = - "function" === typeof unresolvedOldProps || - "function" === typeof context.getSnapshotBeforeUpdate) || - ("function" !== typeof context.UNSAFE_componentWillReceiveProps && - "function" !== typeof context.componentWillReceiveProps) || - ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && - callComponentWillReceiveProps( - workInProgress, - context, - nextProps, - oldProps - )); - hasForceUpdate = !1; - oldState = workInProgress.memoizedState; - context.state = oldState; - processUpdateQueue(workInProgress, nextProps, context, renderLanes); - suspendIfUpdateReadFromEntangledAsyncAction(); - var newState = workInProgress.memoizedState; - contextType !== getDerivedStateFromProps || - oldState !== newState || - hasForceUpdate || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies)) - ? ("function" === typeof unresolvedOldProps && - (applyDerivedStateFromProps( - workInProgress, - Component, - unresolvedOldProps, - nextProps - ), - (newState = workInProgress.memoizedState)), - (contextType$jscomp$0 = - hasForceUpdate || - checkShouldComponentUpdate( - workInProgress, - Component, - contextType$jscomp$0, - nextProps, - oldState, - newState, - oldProps - ) || - (null !== current && - null !== current.dependencies && - checkIfContextChanged(current.dependencies))) - ? (oldContext || - ("function" !== typeof context.UNSAFE_componentWillUpdate && - "function" !== typeof context.componentWillUpdate) || - ("function" === typeof context.componentWillUpdate && - context.componentWillUpdate(nextProps, newState, oldProps), - "function" === typeof context.UNSAFE_componentWillUpdate && - context.UNSAFE_componentWillUpdate( - nextProps, - newState, - oldProps - )), - "function" === typeof context.componentDidUpdate && - (workInProgress.flags |= 4), - "function" === typeof context.getSnapshotBeforeUpdate && - (workInProgress.flags |= 1024)) - : ("function" !== typeof context.componentDidUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof context.getSnapshotBeforeUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (workInProgress.memoizedProps = nextProps), - (workInProgress.memoizedState = newState)), - (context.props = nextProps), - (context.state = newState), - (context.context = oldProps), - (nextProps = contextType$jscomp$0)) - : ("function" !== typeof context.componentDidUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 4), - "function" !== typeof context.getSnapshotBeforeUpdate || - (contextType === current.memoizedProps && - oldState === current.memoizedState) || - (workInProgress.flags |= 1024), - (nextProps = !1)); +function createChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions + ? ((returnFiber.deletions = [childToDelete]), (returnFiber.flags |= 16)) + : deletions.push(childToDelete); + } + } + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + for (; null !== currentFirstChild; ) + deleteChild(returnFiber, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return null; + } + function mapRemainingChildren(currentFirstChild) { + for (var existingChildren = new Map(); null !== currentFirstChild; ) + null !== currentFirstChild.key + ? existingChildren.set(currentFirstChild.key, currentFirstChild) + : existingChildren.set(currentFirstChild.index, currentFirstChild), + (currentFirstChild = currentFirstChild.sibling); + return existingChildren; + } + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) + return (newFiber.flags |= 1048576), lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) + return ( + (newIndex = newIndex.index), + newIndex < lastPlacedIndex + ? ((newFiber.flags |= 33554434), lastPlacedIndex) + : newIndex + ); + newFiber.flags |= 33554434; + return lastPlacedIndex; + } + function placeSingleChild(newFiber) { + shouldTrackSideEffects && + null === newFiber.alternate && + (newFiber.flags |= 33554434); + return newFiber; + } + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) + return ( + (current = createFiberFromText(textContent, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) + return updateFragment( + returnFiber, + current, + element.props.children, + lanes, + element.key + ); + if ( + null !== current && + (current.elementType === elementType || + ("object" === typeof elementType && + null !== elementType && + elementType.$$typeof === REACT_LAZY_TYPE && + resolveLazy(elementType) === current.type)) + ) + return ( + (current = useFiber(current, element.props)), + coerceRef(current, element), + (current.return = returnFiber), + current + ); + current = createFiberFromTypeAndProps( + element.type, + element.key, + element.props, + null, + returnFiber.mode, + lanes + ); + coerceRef(current, element); + current.return = returnFiber; + return current; + } + function updatePortal(returnFiber, current, portal, lanes) { + if ( + null === current || + 4 !== current.tag || + current.stateNode.containerInfo !== portal.containerInfo || + current.stateNode.implementation !== portal.implementation + ) + return ( + (current = createFiberFromPortal(portal, returnFiber.mode, lanes)), + (current.return = returnFiber), + current + ); + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) + return ( + (current = createFiberFromFragment( + fragment, + returnFiber.mode, + lanes, + key + )), + (current.return = returnFiber), + current + ); + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + function createChild(returnFiber, newChild, lanes) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (newChild = createFiberFromText( + "" + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + lanes + ); + case REACT_PORTAL_TYPE: + return ( + (newChild = createFiberFromPortal( + newChild, + returnFiber.mode, + lanes + )), + (newChild.return = returnFiber), + newChild + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return createChild(returnFiber, newChild, lanes); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (newChild = createFiberFromFragment( + newChild, + returnFiber.mode, + lanes, + null + )), + (newChild.return = returnFiber), + newChild + ); + if ("function" === typeof newChild.then) + return createChild(returnFiber, unwrapThenable(newChild), lanes); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return createChild( + returnFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return null !== key + ? null + : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key + ? updateElement(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_PORTAL_TYPE: + return newChild.key === key + ? updatePortal(returnFiber, oldFiber, newChild, lanes) + : null; + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + updateSlot(returnFiber, oldFiber, newChild, lanes) + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return null !== key + ? null + : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + if ("function" === typeof newChild.then) + return updateSlot( + returnFiber, + oldFiber, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateSlot( + returnFiber, + oldFiber, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; + } + function updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ) { + if ( + ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateTextNode(returnFiber, existingChildren, "" + newChild, lanes) + ); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updateElement(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_PORTAL_TYPE: + return ( + (existingChildren = + existingChildren.get( + null === newChild.key ? newIdx : newChild.key + ) || null), + updatePortal(returnFiber, existingChildren, newChild, lanes) + ); + case REACT_LAZY_TYPE: + var init = newChild._init; + newChild = init(newChild._payload); + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + newChild, + lanes + ); + } + if ( + isArrayImpl(newChild) || + getIteratorFn(newChild) || + "function" === typeof newChild[ASYNC_ITERATOR] + ) + return ( + (existingChildren = existingChildren.get(newIdx) || null), + updateFragment(returnFiber, existingChildren, newChild, lanes, null) + ); + if ("function" === typeof newChild.then) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return updateFromMap( + existingChildren, + returnFiber, + newIdx, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return null; } - context = nextProps; - markRef(current, workInProgress); - nextProps = 0 !== (workInProgress.flags & 128); - context || nextProps - ? ((context = workInProgress.stateNode), - nextProps && "function" !== typeof Component.getDerivedStateFromError - ? ((Component = null), (profilerStartTime = -1)) - : (Component = context.render()), - (workInProgress.flags |= 1), - null !== current && nextProps - ? ((workInProgress.child = reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes + function reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null; + null !== oldFiber && newIdx < newChildren.length; + newIdx++ + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot( + returnFiber, + oldFiber, + newChildren[newIdx], + lanes + ); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + if (newIdx === newChildren.length) + return ( + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild + ); + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) + (oldFiber = createChild(returnFiber, newChildren[newIdx], lanes)), + null !== oldFiber && + ((currentFirstChild = placeChild( + oldFiber, + currentFirstChild, + newIdx + )), + null === previousNewFiber + ? (resultingFirstChild = oldFiber) + : (previousNewFiber.sibling = oldFiber), + (previousNewFiber = oldFiber)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + newIdx < newChildren.length; + newIdx++ + ) + (nextOldFiber = updateFromMap( + oldFiber, + returnFiber, + newIdx, + newChildren[newIdx], + lanes + )), + null !== nextOldFiber && + (shouldTrackSideEffects && + null !== nextOldFiber.alternate && + oldFiber.delete( + null === nextOldFiber.key ? newIdx : nextOldFiber.key + ), + (currentFirstChild = placeChild( + nextOldFiber, + currentFirstChild, + newIdx )), - (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - Component, - renderLanes - ))) - : reconcileChildren(current, workInProgress, Component, renderLanes), - (workInProgress.memoizedState = context.state), - (current = workInProgress.child)) - : (current = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - )); - return current; -} -function mountHostRootWithoutHydrating( - current, - workInProgress, - nextChildren, - renderLanes -) { - resetHydrationState(); - workInProgress.flags |= 256; - reconcileChildren(current, workInProgress, nextChildren, renderLanes); - return workInProgress.child; -} -var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: 0 }; -function mountSuspenseOffscreenState(renderLanes) { - return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; -} -function getRemainingWorkInPrimaryTree( - current, - primaryTreeDidDefer, - renderLanes -) { - current = null !== current ? current.childLanes & ~renderLanes : 0; - primaryTreeDidDefer && (current |= workInProgressDeferredLane); - return current; -} -function updateSuspenseComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - showFallback = !1, - didSuspend = 0 !== (workInProgress.flags & 128), - JSCompiler_temp; - (JSCompiler_temp = didSuspend) || - (JSCompiler_temp = - null !== current && null === current.memoizedState - ? !1 - : 0 !== (suspenseStackCursor.current & 2)); - JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); - JSCompiler_temp = 0 !== (workInProgress.flags & 32); - workInProgress.flags &= -33; - if (null === current) { - if (isHydrating) { - showFallback - ? pushPrimaryTreeSuspenseHandler(workInProgress) - : reuseSuspenseHandlerOnStack(workInProgress); - if (isHydrating) { - var nextInstance = nextHydratableInstance, - JSCompiler_temp$jscomp$0; - if ((JSCompiler_temp$jscomp$0 = nextInstance)) { - c: { - JSCompiler_temp$jscomp$0 = nextInstance; - for ( - nextInstance = rootOrSingletonContext; - 8 !== JSCompiler_temp$jscomp$0.nodeType; - - ) { - if (!nextInstance) { - nextInstance = null; - break c; - } - JSCompiler_temp$jscomp$0 = getNextHydratable( - JSCompiler_temp$jscomp$0.nextSibling - ); - if (null === JSCompiler_temp$jscomp$0) { - nextInstance = null; - break c; - } - } - nextInstance = JSCompiler_temp$jscomp$0; - } - null !== nextInstance - ? ((workInProgress.memoizedState = { - dehydrated: nextInstance, - treeContext: - null !== treeContextProvider - ? { id: treeContextId, overflow: treeContextOverflow } - : null, - retryLane: 536870912 - }), - (JSCompiler_temp$jscomp$0 = createFiberImplClass( - 18, - null, - null, - 0 - )), - (JSCompiler_temp$jscomp$0.stateNode = nextInstance), - (JSCompiler_temp$jscomp$0.return = workInProgress), - (workInProgress.child = JSCompiler_temp$jscomp$0), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (JSCompiler_temp$jscomp$0 = !0)) - : (JSCompiler_temp$jscomp$0 = !1); + null === previousNewFiber + ? (resultingFirstChild = nextOldFiber) + : (previousNewFiber.sibling = nextOldFiber), + (previousNewFiber = nextOldFiber)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + function reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChildrenIterable, + lanes + ) { + var newChildren = newChildrenIterable[ASYNC_ITERATOR](); + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + { + next: function () { + return unwrapThenable(newChildren.next()); } - JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + }, + lanes + ); + } + function reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChildren, + lanes + ) { + if (null == newChildren) throw Error(formatProdErrorMessage(151)); + for ( + var resultingFirstChild = null, + previousNewFiber = null, + oldFiber = currentFirstChild, + newIdx = (currentFirstChild = 0), + nextOldFiber = null, + step = newChildren.next(); + null !== oldFiber && !step.done; + newIdx++, step = newChildren.next() + ) { + oldFiber.index > newIdx + ? ((nextOldFiber = oldFiber), (oldFiber = null)) + : (nextOldFiber = oldFiber.sibling); + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; } - nextInstance = workInProgress.memoizedState; - if ( - null !== nextInstance && - ((nextInstance = nextInstance.dehydrated), null !== nextInstance) - ) - return ( - isSuspenseInstanceFallback(nextInstance) - ? (workInProgress.lanes = 16) - : (workInProgress.lanes = 536870912), - null - ); - popSuspenseHandler(workInProgress); + shouldTrackSideEffects && + oldFiber && + null === newFiber.alternate && + deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber + ? (resultingFirstChild = newFiber) + : (previousNewFiber.sibling = newFiber); + previousNewFiber = newFiber; + oldFiber = nextOldFiber; } - nextInstance = nextProps.children; - JSCompiler_temp$jscomp$0 = nextProps.fallback; - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps - ); - if ("number" === typeof nextProps.unstable_expectedLoadTime) + if (step.done) return ( - reuseSuspenseHandlerOnStack(workInProgress), - (nextProps = mountSuspenseFallbackChildren( - workInProgress, - nextInstance, - JSCompiler_temp$jscomp$0, - renderLanes - )), - (showFallback = workInProgress.child), - (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress.lanes = 4194304), - nextProps + deleteRemainingChildren(returnFiber, oldFiber), + isHydrating && pushTreeFork(returnFiber, newIdx), + resultingFirstChild ); - pushPrimaryTreeSuspenseHandler(workInProgress); - return mountSuspensePrimaryChildren(workInProgress, nextInstance); + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildren.next()) + (step = createChild(returnFiber, step.value, lanes)), + null !== step && + ((currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; + } + for ( + oldFiber = mapRemainingChildren(oldFiber); + !step.done; + newIdx++, step = newChildren.next() + ) + (step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)), + null !== step && + (shouldTrackSideEffects && + null !== step.alternate && + oldFiber.delete(null === step.key ? newIdx : step.key), + (currentFirstChild = placeChild(step, currentFirstChild, newIdx)), + null === previousNewFiber + ? (resultingFirstChild = step) + : (previousNewFiber.sibling = step), + (previousNewFiber = step)); + shouldTrackSideEffects && + oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + isHydrating && pushTreeFork(returnFiber, newIdx); + return resultingFirstChild; } - JSCompiler_temp$jscomp$0 = current.memoizedState; - if ( - null !== JSCompiler_temp$jscomp$0 && - ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), - null !== nextInstance) + function reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ) { - if (didSuspend) - workInProgress.flags & 256 - ? (pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags &= -257), - (workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ))) - : null !== workInProgress.memoizedState - ? (reuseSuspenseHandlerOnStack(workInProgress), - (workInProgress.child = current.child), - (workInProgress.flags |= 128), - (workInProgress = null)) - : (reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (nextProps = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: nextProps.children }, - nextInstance - )), - (showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2), - (nextProps.return = workInProgress), - (showFallback.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - reconcileChildFibers( - workInProgress, - current.child, - null, - renderLanes - ), - (nextProps = workInProgress.child), - (nextProps.memoizedState = - mountSuspenseOffscreenState(renderLanes)), - (nextProps.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = showFallback)); - else if ( - (pushPrimaryTreeSuspenseHandler(workInProgress), - isSuspenseInstanceFallback(nextInstance)) - ) { - JSCompiler_temp = - nextInstance.nextSibling && nextInstance.nextSibling.dataset; - if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; - JSCompiler_temp = digest; - "POSTPONE" !== JSCompiler_temp && - ((nextProps = Error(formatProdErrorMessage(419))), - (nextProps.stack = ""), - (nextProps.digest = JSCompiler_temp), - queueHydrationError({ value: nextProps, source: null, stack: null })); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes - ); - } else if ( - (didReceiveUpdate || - propagateParentContextChanges(current, workInProgress, renderLanes, !1), - (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_temp) - ) { - JSCompiler_temp = workInProgressRoot; - if (null !== JSCompiler_temp) { - nextProps = renderLanes & -renderLanes; - if (0 !== (nextProps & 42)) nextProps = 1; - else - switch (nextProps) { - case 2: - nextProps = 1; - break; - case 8: - nextProps = 4; - break; - case 32: - nextProps = 16; - break; - case 128: - case 256: - case 512: - case 1024: - case 2048: - case 4096: - case 8192: - case 16384: - case 32768: - case 65536: - case 131072: - case 262144: - case 524288: - case 1048576: - case 2097152: - case 4194304: - case 8388608: - case 16777216: - case 33554432: - nextProps = 64; - break; - case 268435456: - nextProps = 134217728; - break; - default: - nextProps = 0; + "object" === typeof newChild && + null !== newChild && + newChild.type === REACT_FRAGMENT_TYPE && + null === newChild.key && + (newChild = newChild.props.children); + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + for (var key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) { + key = newChild.type; + if (key === REACT_FRAGMENT_TYPE) { + if (7 === currentFirstChild.tag) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber( + currentFirstChild, + newChild.props.children + ); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + } else if ( + currentFirstChild.elementType === key || + ("object" === typeof key && + null !== key && + key.$$typeof === REACT_LAZY_TYPE && + resolveLazy(key) === currentFirstChild.type) + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.props); + coerceRef(lanes, newChild); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + newChild.type === REACT_FRAGMENT_TYPE + ? ((lanes = createFiberFromFragment( + newChild.props.children, + returnFiber.mode, + lanes, + newChild.key + )), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : ((lanes = createFiberFromTypeAndProps( + newChild.type, + newChild.key, + newChild.props, + null, + returnFiber.mode, + lanes + )), + coerceRef(lanes, newChild), + (lanes.return = returnFiber), + (returnFiber = lanes)); } - nextProps = - 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) - ? 0 - : nextProps; - if (0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) - throw ( - ((JSCompiler_temp$jscomp$0.retryLane = nextProps), - enqueueConcurrentRenderForLane(current, nextProps), - scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), - SelectiveHydrationException) + return placeSingleChild(returnFiber); + case REACT_PORTAL_TYPE: + a: { + for (key = newChild.key; null !== currentFirstChild; ) { + if (currentFirstChild.key === key) + if ( + 4 === currentFirstChild.tag && + currentFirstChild.stateNode.containerInfo === + newChild.containerInfo && + currentFirstChild.stateNode.implementation === + newChild.implementation + ) { + deleteRemainingChildren( + returnFiber, + currentFirstChild.sibling + ); + lanes = useFiber(currentFirstChild, newChild.children || []); + lanes.return = returnFiber; + returnFiber = lanes; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + lanes = createFiberFromPortal(newChild, returnFiber.mode, lanes); + lanes.return = returnFiber; + returnFiber = lanes; + } + return placeSingleChild(returnFiber); + case REACT_LAZY_TYPE: + return ( + (key = newChild._init), + (newChild = key(newChild._payload)), + reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes + ) ); } - "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); - workInProgress = retrySuspenseComponentWithoutHydrating( - current, - workInProgress, - renderLanes + if (isArrayImpl(newChild)) + return reconcileChildrenArray( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if (getIteratorFn(newChild)) { + key = getIteratorFn(newChild); + if ("function" !== typeof key) throw Error(formatProdErrorMessage(150)); + newChild = key.call(newChild); + return reconcileChildrenIterator( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + } + if ("function" === typeof newChild[ASYNC_ITERATOR]) + return reconcileChildrenAsyncIteratable( + returnFiber, + currentFirstChild, + newChild, + lanes + ); + if ("function" === typeof newChild.then) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + unwrapThenable(newChild), + lanes + ); + if (newChild.$$typeof === REACT_CONTEXT_TYPE) + return reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + readContextDuringReconciliation(returnFiber, newChild), + lanes + ); + throwOnInvalidObjectType(returnFiber, newChild); + } + return ("string" === typeof newChild && "" !== newChild) || + "number" === typeof newChild || + "bigint" === typeof newChild + ? ((newChild = "" + newChild), + null !== currentFirstChild && 6 === currentFirstChild.tag + ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), + (lanes = useFiber(currentFirstChild, newChild)), + (lanes.return = returnFiber), + (returnFiber = lanes)) + : (deleteRemainingChildren(returnFiber, currentFirstChild), + (lanes = createFiberFromText(newChild, returnFiber.mode, lanes)), + (lanes.return = returnFiber), + (returnFiber = lanes)), + placeSingleChild(returnFiber)) + : deleteRemainingChildren(returnFiber, currentFirstChild); + } + return function (returnFiber, currentFirstChild, newChild, lanes) { + try { + thenableIndexCounter = 0; + var firstChildFiber = reconcileChildFibersImpl( + returnFiber, + currentFirstChild, + newChild, + lanes ); - } else - "$?" === nextInstance.data - ? ((workInProgress.flags |= 192), - (workInProgress.child = current.child), - (workInProgress = null)) - : ((current = JSCompiler_temp$jscomp$0.treeContext), - (nextHydratableInstance = getNextHydratable( - nextInstance.nextSibling - )), - (hydrationParentFiber = workInProgress), - (isHydrating = !0), - (hydrationErrors = null), - (rootOrSingletonContext = !1), - null !== current && - ((idStack[idStackIndex++] = treeContextId), - (idStack[idStackIndex++] = treeContextOverflow), - (idStack[idStackIndex++] = treeContextProvider), - (treeContextId = current.id), - (treeContextOverflow = current.overflow), - (treeContextProvider = workInProgress)), - (workInProgress = mountSuspensePrimaryChildren( - workInProgress, - nextProps.children - )), - (workInProgress.flags |= 4096)); - return workInProgress; + thenableState = null; + return firstChildFiber; + } catch (x) { + if (x === SuspenseException || x === SuspenseActionException) throw x; + var fiber = createFiberImplClass(29, x, null, returnFiber.mode); + fiber.lanes = lanes; + fiber.return = returnFiber; + return fiber; + } finally { + } + }; +} +var reconcileChildFibers = createChildReconciler(!0), + mountChildFibers = createChildReconciler(!1), + suspenseHandlerStackCursor = createCursor(null), + shellBoundary = null; +function pushPrimaryTreeSuspenseHandler(handler) { + var current = handler.alternate; + push(suspenseStackCursor, suspenseStackCursor.current & 1); + push(suspenseHandlerStackCursor, handler); + null === shellBoundary && + (null === current || null !== currentTreeHiddenStackCursor.current + ? (shellBoundary = handler) + : null !== current.memoizedState && (shellBoundary = handler)); +} +function pushOffscreenSuspenseHandler(fiber) { + if (22 === fiber.tag) { + if ( + (push(suspenseStackCursor, suspenseStackCursor.current), + push(suspenseHandlerStackCursor, fiber), + null === shellBoundary) + ) { + var current = fiber.alternate; + null !== current && + null !== current.memoizedState && + (shellBoundary = fiber); + } + } else reuseSuspenseHandlerOnStack(fiber); +} +function reuseSuspenseHandlerOnStack() { + push(suspenseStackCursor, suspenseStackCursor.current); + push(suspenseHandlerStackCursor, suspenseHandlerStackCursor.current); +} +function popSuspenseHandler(fiber) { + pop(suspenseHandlerStackCursor); + shellBoundary === fiber && (shellBoundary = null); + pop(suspenseStackCursor); +} +var suspenseStackCursor = createCursor(0); +function findFirstSuspended(row) { + for (var node = row; null !== node; ) { + if (13 === node.tag) { + var state = node.memoizedState; + if ( + null !== state && + ((state = state.dehydrated), + null === state || + "$?" === state.data || + isSuspenseInstanceFallback(state)) + ) + return node; + } else if (19 === node.tag && void 0 !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === row) break; + for (; null === node.sibling; ) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + node.sibling.return = node.return; + node = node.sibling; + } + return null; +} +var reportGlobalError = + "function" === typeof reportError + ? reportError + : function (error) { + if ( + "object" === typeof window && + "function" === typeof window.ErrorEvent + ) { + var event = new window.ErrorEvent("error", { + bubbles: !0, + cancelable: !0, + message: + "object" === typeof error && + null !== error && + "string" === typeof error.message + ? String(error.message) + : String(error), + error: error + }); + if (!window.dispatchEvent(event)) return; + } else if ( + "object" === typeof process && + "function" === typeof process.emit + ) { + process.emit("uncaughtException", error); + return; + } + console.error(error); + }; +function defaultOnUncaughtError(error) { + reportGlobalError(error); +} +function defaultOnCaughtError(error) { + console.error(error); +} +function defaultOnRecoverableError(error) { + reportGlobalError(error); +} +function logUncaughtError(root, errorInfo) { + try { + var onUncaughtError = root.onUncaughtError; + onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); + } catch (e$79) { + setTimeout(function () { + throw e$79; + }); } - if (showFallback) - return ( - reuseSuspenseHandlerOnStack(workInProgress), - (showFallback = nextProps.fallback), - (nextInstance = workInProgress.mode), - (JSCompiler_temp$jscomp$0 = current.child), - (digest = JSCompiler_temp$jscomp$0.sibling), - (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { - mode: "hidden", - children: nextProps.children - })), - (nextProps.subtreeFlags = - JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), - null !== digest - ? (showFallback = createWorkInProgress(digest, showFallback)) - : ((showFallback = createFiberFromFragment( - showFallback, - nextInstance, - renderLanes, - null - )), - (showFallback.flags |= 2)), - (showFallback.return = workInProgress), - (nextProps.return = workInProgress), - (nextProps.sibling = showFallback), - (workInProgress.child = nextProps), - (nextProps = showFallback), - (showFallback = workInProgress.child), - (nextInstance = current.child.memoizedState), - null === nextInstance - ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) - : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), - null !== JSCompiler_temp$jscomp$0 - ? ((digest = CacheContext._currentValue), - (JSCompiler_temp$jscomp$0 = - JSCompiler_temp$jscomp$0.parent !== digest - ? { parent: digest, pool: digest } - : JSCompiler_temp$jscomp$0)) - : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), - (nextInstance = { - baseLanes: nextInstance.baseLanes | renderLanes, - cachePool: JSCompiler_temp$jscomp$0 - })), - (showFallback.memoizedState = nextInstance), - (showFallback.childLanes = getRemainingWorkInPrimaryTree( - current, - JSCompiler_temp, - renderLanes - )), - (workInProgress.memoizedState = SUSPENDED_MARKER), - nextProps +} +function logCaughtError(root, boundary, errorInfo) { + try { + var onCaughtError = root.onCaughtError; + onCaughtError(errorInfo.value, { + componentStack: errorInfo.stack, + errorBoundary: 1 === boundary.tag ? boundary.stateNode : null + }); + } catch (e$80) { + setTimeout(function () { + throw e$80; + }); + } +} +function createRootErrorUpdate(root, errorInfo, lane) { + lane = createUpdate(lane); + lane.tag = 3; + lane.payload = { element: null }; + lane.callback = function () { + logUncaughtError(root, errorInfo); + }; + return lane; +} +function createClassErrorUpdate(lane) { + lane = createUpdate(lane); + lane.tag = 3; + return lane; +} +function initializeClassErrorUpdate(update, root, fiber, errorInfo) { + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + update.payload = function () { + return getDerivedStateFromError(error); + }; + update.callback = function () { + logCaughtError(root, fiber, errorInfo); + }; + } + var inst = fiber.stateNode; + null !== inst && + "function" === typeof inst.componentDidCatch && + (update.callback = function () { + logCaughtError(root, fiber, errorInfo); + "function" !== typeof getDerivedStateFromError && + (null === legacyErrorBoundariesThatAlreadyFailed + ? (legacyErrorBoundariesThatAlreadyFailed = new Set([this])) + : legacyErrorBoundariesThatAlreadyFailed.add(this)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); +} +function resetSuspendedComponent(sourceFiber, rootRenderLanes) { + var currentSourceFiber = sourceFiber.alternate; + null !== currentSourceFiber && + propagateParentContextChanges( + currentSourceFiber, + sourceFiber, + rootRenderLanes, + !0 ); - pushPrimaryTreeSuspenseHandler(workInProgress); - renderLanes = current.child; - current = renderLanes.sibling; - renderLanes = createWorkInProgress(renderLanes, { - mode: "visible", - children: nextProps.children - }); - renderLanes.return = workInProgress; - renderLanes.sibling = null; - null !== current && - ((JSCompiler_temp = workInProgress.deletions), - null === JSCompiler_temp - ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_temp.push(current)); - workInProgress.child = renderLanes; - workInProgress.memoizedState = null; - return renderLanes; } -function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "visible", children: primaryChildren }, - workInProgress.mode - ); - primaryChildren.return = workInProgress; - return (workInProgress.child = primaryChildren); +function markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes +) { + suspenseBoundary.flags |= 65536; + suspenseBoundary.lanes = rootRenderLanes; + return suspenseBoundary; } -function mountSuspenseFallbackChildren( - workInProgress, - primaryChildren, - fallbackChildren, - renderLanes +function throwException( + root, + returnFiber, + sourceFiber, + value, + rootRenderLanes ) { - var mode = workInProgress.mode; - primaryChildren = mountWorkInProgressOffscreenFiber( - { mode: "hidden", children: primaryChildren }, - mode - ); - fallbackChildren = createFiberFromFragment( - fallbackChildren, - mode, - renderLanes, - null + sourceFiber.flags |= 32768; + isDevToolsPresent && restorePendingUpdaters(root, rootRenderLanes); + if ( + null !== value && + "object" === typeof value && + (value.$$typeof === REACT_POSTPONE_TYPE && + (value = { then: function () {} }), + "function" === typeof value.then) + ) { + resetSuspendedComponent(sourceFiber, rootRenderLanes); + var suspenseBoundary = suspenseHandlerStackCursor.current; + if (null !== suspenseBoundary) { + switch (suspenseBoundary.tag) { + case 13: + return ( + null === shellBoundary + ? renderDidSuspendDelayIfPossible() + : null === suspenseBoundary.alternate && + 0 === workInProgressRootExitStatus && + (workInProgressRootExitStatus = 3), + (suspenseBoundary.flags &= -257), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? (suspenseBoundary.updateQueue = new Set([value])) + : sourceFiber.add(value), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + case 22: + return ( + (suspenseBoundary.flags |= 65536), + value === noopSuspenseyCommitThenable + ? (suspenseBoundary.flags |= 16384) + : ((sourceFiber = suspenseBoundary.updateQueue), + null === sourceFiber + ? ((sourceFiber = { + transitions: null, + markerInstances: null, + retryQueue: new Set([value]) + }), + (suspenseBoundary.updateQueue = sourceFiber)) + : ((returnFiber = sourceFiber.retryQueue), + null === returnFiber + ? (sourceFiber.retryQueue = new Set([value])) + : returnFiber.add(value)), + attachPingListener(root, value, rootRenderLanes)), + !1 + ); + } + throw Error(formatProdErrorMessage(435, suspenseBoundary.tag)); + } + attachPingListener(root, value, rootRenderLanes); + renderDidSuspendDelayIfPossible(); + return !1; + } + if (isHydrating) + return ( + (suspenseBoundary = suspenseHandlerStackCursor.current), + null !== suspenseBoundary + ? (0 === (suspenseBoundary.flags & 65536) && + (suspenseBoundary.flags |= 256), + markSuspenseBoundaryShouldCapture( + suspenseBoundary, + returnFiber, + sourceFiber, + root, + rootRenderLanes + ), + value !== HydrationMismatchException && + ((root = Error(formatProdErrorMessage(422), { cause: value })), + queueHydrationError(createCapturedValueAtFiber(root, sourceFiber)))) + : (value !== HydrationMismatchException && + ((returnFiber = Error(formatProdErrorMessage(423), { + cause: value + })), + queueHydrationError( + createCapturedValueAtFiber(returnFiber, sourceFiber) + )), + (root = root.current.alternate), + (root.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (root.lanes |= rootRenderLanes), + (sourceFiber = createCapturedValueAtFiber(value, sourceFiber)), + (rootRenderLanes = createRootErrorUpdate( + root.stateNode, + sourceFiber, + rootRenderLanes + )), + enqueueCapturedUpdate(root, rootRenderLanes), + 4 !== workInProgressRootExitStatus && + (workInProgressRootExitStatus = 2)), + !1 + ); + suspenseBoundary = Error(formatProdErrorMessage(520), { cause: value }); + queueConcurrentError( + createCapturedValueAtFiber(suspenseBoundary, sourceFiber) ); - primaryChildren.return = workInProgress; - fallbackChildren.return = workInProgress; - primaryChildren.sibling = fallbackChildren; - workInProgress.child = primaryChildren; - return fallbackChildren; + 4 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + if (null === returnFiber) return !0; + sourceFiber = createCapturedValueAtFiber(value, sourceFiber); + do { + switch (returnFiber.tag) { + case 3: + return ( + (returnFiber.flags |= 65536), + (root = rootRenderLanes & -rootRenderLanes), + (returnFiber.lanes |= root), + (root = createRootErrorUpdate( + returnFiber.stateNode, + sourceFiber, + root + )), + enqueueCapturedUpdate(returnFiber, root), + !1 + ); + case 1: + if ( + ((value = returnFiber.type), + (suspenseBoundary = returnFiber.stateNode), + 0 === (returnFiber.flags & 128) && + ("function" === typeof value.getDerivedStateFromError || + (null !== suspenseBoundary && + "function" === typeof suspenseBoundary.componentDidCatch && + (null === legacyErrorBoundariesThatAlreadyFailed || + !legacyErrorBoundariesThatAlreadyFailed.has( + suspenseBoundary + ))))) + ) + return ( + (returnFiber.flags |= 65536), + (rootRenderLanes &= -rootRenderLanes), + (returnFiber.lanes |= rootRenderLanes), + (rootRenderLanes = createClassErrorUpdate(rootRenderLanes)), + initializeClassErrorUpdate( + rootRenderLanes, + root, + returnFiber, + sourceFiber + ), + enqueueCapturedUpdate(returnFiber, rootRenderLanes), + !1 + ); + } + returnFiber = returnFiber.return; + } while (null !== returnFiber); + return !1; } -function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { - return createFiberFromOffscreen(offscreenProps, mode, 0, null); +var SelectiveHydrationException = Error(formatProdErrorMessage(461)), + didReceiveUpdate = !1; +function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = + null === current + ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) + : reconcileChildFibers( + workInProgress, + current.child, + nextChildren, + renderLanes + ); } -function retrySuspenseComponentWithoutHydrating( +function updateForwardRef( current, workInProgress, + Component, + nextProps, renderLanes -) { - reconcileChildFibers(workInProgress, current.child, null, renderLanes); - current = mountSuspensePrimaryChildren( - workInProgress, - workInProgress.pendingProps.children - ); - current.flags |= 2; - workInProgress.memoizedState = null; - return current; -} -function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { - fiber.lanes |= renderLanes; - var alternate = fiber.alternate; - null !== alternate && (alternate.lanes |= renderLanes); - scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); -} -function initSuspenseListRenderState( - workInProgress, - isBackwards, - tail, - lastContentRow, - tailMode -) { - var renderState = workInProgress.memoizedState; - null === renderState - ? (workInProgress.memoizedState = { - isBackwards: isBackwards, - rendering: null, - renderingStartTime: 0, - last: lastContentRow, - tail: tail, - tailMode: tailMode - }) - : ((renderState.isBackwards = isBackwards), - (renderState.rendering = null), - (renderState.renderingStartTime = 0), - (renderState.last = lastContentRow), - (renderState.tail = tail), - (renderState.tailMode = tailMode)); -} -function updateSuspenseListComponent(current, workInProgress, renderLanes) { - var nextProps = workInProgress.pendingProps, - revealOrder = nextProps.revealOrder, - tailMode = nextProps.tail; - reconcileChildren(current, workInProgress, nextProps.children, renderLanes); - nextProps = suspenseStackCursor.current; - if (0 !== (nextProps & 2)) - (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); - else { - if (null !== current && 0 !== (current.flags & 128)) - a: for (current = workInProgress.child; null !== current; ) { - if (13 === current.tag) - null !== current.memoizedState && - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (19 === current.tag) - scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); - else if (null !== current.child) { - current.child.return = current; - current = current.child; - continue; - } - if (current === workInProgress) break a; - for (; null === current.sibling; ) { - if (null === current.return || current.return === workInProgress) - break a; - current = current.return; - } - current.sibling.return = current.return; - current = current.sibling; - } - nextProps &= 1; - } - push(suspenseStackCursor, nextProps); - switch (revealOrder) { - case "forwards": - renderLanes = workInProgress.child; - for (revealOrder = null; null !== renderLanes; ) - (current = renderLanes.alternate), - null !== current && - null === findFirstSuspended(current) && - (revealOrder = renderLanes), - (renderLanes = renderLanes.sibling); - renderLanes = revealOrder; - null === renderLanes - ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) - : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); - initSuspenseListRenderState( - workInProgress, - !1, - revealOrder, - renderLanes, - tailMode - ); - break; - case "backwards": - renderLanes = null; - revealOrder = workInProgress.child; - for (workInProgress.child = null; null !== revealOrder; ) { - current = revealOrder.alternate; - if (null !== current && null === findFirstSuspended(current)) { - workInProgress.child = revealOrder; - break; - } - current = revealOrder.sibling; - revealOrder.sibling = renderLanes; - renderLanes = revealOrder; - revealOrder = current; - } - initSuspenseListRenderState( - workInProgress, - !0, - renderLanes, - null, - tailMode - ); - break; - case "together": - initSuspenseListRenderState(workInProgress, !1, null, null, void 0); - break; - default: - workInProgress.memoizedState = null; - } - return workInProgress.child; -} -function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { - null !== current && (workInProgress.dependencies = current.dependencies); - profilerStartTime = -1; - workInProgressRootSkippedLanes |= workInProgress.lanes; - if (0 === (renderLanes & workInProgress.childLanes)) - if (null !== current) { - if ( - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - 0 === (renderLanes & workInProgress.childLanes)) - ) - return null; - } else return null; - if (null !== current && workInProgress.child !== current.child) - throw Error(formatProdErrorMessage(153)); - if (null !== workInProgress.child) { - current = workInProgress.child; - renderLanes = createWorkInProgress(current, current.pendingProps); - workInProgress.child = renderLanes; - for (renderLanes.return = workInProgress; null !== current.sibling; ) - (current = current.sibling), - (renderLanes = renderLanes.sibling = - createWorkInProgress(current, current.pendingProps)), - (renderLanes.return = workInProgress); - renderLanes.sibling = null; - } +) { + Component = Component.render; + var ref = workInProgress.ref; + if ("ref" in nextProps) { + var propsWithoutRef = {}; + for (var key in nextProps) + "ref" !== key && (propsWithoutRef[key] = nextProps[key]); + } else propsWithoutRef = nextProps; + prepareToReadContext(workInProgress); + nextProps = renderWithHooks( + current, + workInProgress, + Component, + propsWithoutRef, + ref, + renderLanes + ); + key = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && key && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); return workInProgress.child; } -function checkScheduledUpdateOrContext(current, renderLanes) { - if (0 !== (current.lanes & renderLanes)) return !0; - current = current.dependencies; - return null !== current && checkIfContextChanged(current) ? !0 : !1; -} -function attemptEarlyBailoutIfNoScheduledUpdate( +function updateMemoComponent( current, workInProgress, + Component, + nextProps, renderLanes ) { - switch (workInProgress.tag) { - case 3: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); - resetHydrationState(); - break; - case 27: - case 5: - pushHostContext(workInProgress); - break; - case 4: - pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); - break; - case 10: - pushProvider( - workInProgress, - workInProgress.type, - workInProgress.memoizedProps.value - ); - break; - case 12: - 0 !== (renderLanes & workInProgress.childLanes) && - (workInProgress.flags |= 4); - workInProgress.flags |= 2048; - var stateNode = workInProgress.stateNode; - stateNode.effectDuration = -0; - stateNode.passiveEffectDuration = -0; - break; - case 13: - stateNode = workInProgress.memoizedState; - if (null !== stateNode) { - if (null !== stateNode.dehydrated) - return ( - pushPrimaryTreeSuspenseHandler(workInProgress), - (workInProgress.flags |= 128), - null - ); - if (0 !== (renderLanes & workInProgress.child.childLanes)) - return updateSuspenseComponent(current, workInProgress, renderLanes); - pushPrimaryTreeSuspenseHandler(workInProgress); - current = bailoutOnAlreadyFinishedWork( + if (null === current) { + var type = Component.type; + if ( + "function" === typeof type && + !shouldConstruct(type) && + void 0 === type.defaultProps && + null === Component.compare + ) + return ( + (workInProgress.tag = 15), + (workInProgress.type = type), + updateSimpleMemoComponent( current, workInProgress, + type, + nextProps, renderLanes - ); - return null !== current ? current.sibling : null; - } - pushPrimaryTreeSuspenseHandler(workInProgress); - break; - case 19: - var didSuspendBefore = 0 !== (current.flags & 128); - stateNode = 0 !== (renderLanes & workInProgress.childLanes); - stateNode || - (propagateParentContextChanges( - current, - workInProgress, - renderLanes, - !1 - ), - (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); - if (didSuspendBefore) { - if (stateNode) - return updateSuspenseListComponent( - current, - workInProgress, - renderLanes - ); - workInProgress.flags |= 128; - } - didSuspendBefore = workInProgress.memoizedState; - null !== didSuspendBefore && - ((didSuspendBefore.rendering = null), - (didSuspendBefore.tail = null), - (didSuspendBefore.lastEffect = null)); - push(suspenseStackCursor, suspenseStackCursor.current); - if (stateNode) break; - else return null; - case 22: - case 23: - return ( - (workInProgress.lanes = 0), - updateOffscreenComponent(current, workInProgress, renderLanes) + ) ); - case 24: - pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + current = createFiberFromTypeAndProps( + Component.type, + null, + nextProps, + workInProgress, + workInProgress.mode, + renderLanes + ); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); } - return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + type = current.child; + if (!checkScheduledUpdateOrContext(current, renderLanes)) { + var prevProps = type.memoizedProps; + Component = Component.compare; + Component = null !== Component ? Component : shallowEqual; + if (Component(prevProps, nextProps) && current.ref === workInProgress.ref) + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return (workInProgress.child = current); } -function beginWork(current, workInProgress, renderLanes) { - if (null !== current) - if (current.memoizedProps !== workInProgress.pendingProps) - didReceiveUpdate = !0; - else { +function updateSimpleMemoComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + if (null !== current) { + var prevProps = current.memoizedProps; + if ( + shallowEqual(prevProps, nextProps) && + current.ref === workInProgress.ref + ) if ( - !checkScheduledUpdateOrContext(current, renderLanes) && - 0 === (workInProgress.flags & 128) + ((didReceiveUpdate = !1), + (workInProgress.pendingProps = nextProps = prevProps), + checkScheduledUpdateOrContext(current, renderLanes)) ) - return ( - (didReceiveUpdate = !1), - attemptEarlyBailoutIfNoScheduledUpdate( - current, - workInProgress, - renderLanes - ) - ); - didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; - } - else - (didReceiveUpdate = !1), - isHydrating && - 0 !== (workInProgress.flags & 1048576) && - pushTreeId(workInProgress, treeForkCount, workInProgress.index); - workInProgress.lanes = 0; - switch (workInProgress.tag) { - case 16: - a: { - current = workInProgress.pendingProps; - var lazyComponent = workInProgress.elementType, - init = lazyComponent._init; - lazyComponent = init(lazyComponent._payload); - workInProgress.type = lazyComponent; - if ("function" === typeof lazyComponent) - shouldConstruct(lazyComponent) - ? ((current = resolveClassComponentProps(lazyComponent, current)), - (workInProgress.tag = 1), - (workInProgress = updateClassComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ))) - : ((workInProgress.tag = 0), - (workInProgress = updateFunctionComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ))); - else { - if (void 0 !== lazyComponent && null !== lazyComponent) - if ( - ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE) - ) { - workInProgress.tag = 11; - workInProgress = updateForwardRef( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ); - break a; - } else if (init === REACT_MEMO_TYPE) { - workInProgress.tag = 14; - workInProgress = updateMemoComponent( - null, - workInProgress, - lazyComponent, - current, - renderLanes - ); - break a; - } - workInProgress = - getComponentNameFromType(lazyComponent) || lazyComponent; - throw Error(formatProdErrorMessage(306, workInProgress, "")); - } - } - return workInProgress; - case 0: - return updateFunctionComponent( + 0 !== (current.flags & 131072) && (didReceiveUpdate = !0); + else + return ( + (workInProgress.lanes = current.lanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + } + return updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes + ); +} +function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + nextIsDetached = 0 !== (workInProgress.stateNode._pendingVisibility & 2), + prevState = null !== current ? current.memoizedState : null; + markRef(current, workInProgress); + if ("hidden" === nextProps.mode || nextIsDetached) { + if (0 !== (workInProgress.flags & 128)) { + nextProps = + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes; + if (null !== current) { + nextChildren = workInProgress.child = current.child; + for (nextIsDetached = 0; null !== nextChildren; ) + (nextIsDetached = + nextIsDetached | nextChildren.lanes | nextChildren.childLanes), + (nextChildren = nextChildren.sibling); + workInProgress.childLanes = nextIsDetached & ~nextProps; + } else (workInProgress.childLanes = 0), (workInProgress.child = null); + return deferHiddenOffscreenComponent( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, + nextProps, renderLanes ); - case 1: + } + if (0 !== (renderLanes & 536870912)) + (workInProgress.memoizedState = { baseLanes: 0, cachePool: null }), + null !== current && + pushTransition( + workInProgress, + null !== prevState ? prevState.cachePool : null + ), + null !== prevState + ? pushHiddenContext(workInProgress, prevState) + : reuseHiddenContextOnStack(), + pushOffscreenSuspenseHandler(workInProgress); + else return ( - (lazyComponent = workInProgress.type), - (init = resolveClassComponentProps( - lazyComponent, - workInProgress.pendingProps - )), - updateClassComponent( + (workInProgress.lanes = workInProgress.childLanes = 536870912), + deferHiddenOffscreenComponent( current, workInProgress, - lazyComponent, - init, + null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, renderLanes ) ); - case 3: - a: { - pushHostContainer( + } else + null !== prevState + ? (pushTransition(workInProgress, prevState.cachePool), + pushHiddenContext(workInProgress, prevState), + reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.memoizedState = null)) + : (null !== current && pushTransition(workInProgress, null), + reuseHiddenContextOnStack(), + reuseSuspenseHandlerOnStack(workInProgress)); + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +function deferHiddenOffscreenComponent( + current, + workInProgress, + nextBaseLanes, + renderLanes +) { + var JSCompiler_inline_result = peekCacheFromPool(); + JSCompiler_inline_result = + null === JSCompiler_inline_result + ? null + : { parent: CacheContext._currentValue, pool: JSCompiler_inline_result }; + workInProgress.memoizedState = { + baseLanes: nextBaseLanes, + cachePool: JSCompiler_inline_result + }; + null !== current && pushTransition(workInProgress, null); + reuseHiddenContextOnStack(); + pushOffscreenSuspenseHandler(workInProgress); + null !== current && + propagateParentContextChanges(current, workInProgress, renderLanes, !0); + return null; +} +function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === ref) + null !== current && + null !== current.ref && + (workInProgress.flags |= 2097664); + else { + if ("function" !== typeof ref && "object" !== typeof ref) + throw Error(formatProdErrorMessage(284)); + if (null === current || current.ref !== ref) + workInProgress.flags |= 2097664; + } +} +function updateFunctionComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + prepareToReadContext(workInProgress); + Component = renderWithHooks( + current, + workInProgress, + Component, + nextProps, + void 0, + renderLanes + ); + nextProps = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && nextProps && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; +} +function replayFunctionComponent( + current, + workInProgress, + nextProps, + Component, + secondArg, + renderLanes +) { + prepareToReadContext(workInProgress); + workInProgress.updateQueue = null; + nextProps = renderWithHooksAgain( + workInProgress, + Component, + nextProps, + secondArg + ); + finishRenderingHooks(current); + Component = checkDidRenderIdHook(); + if (null !== current && !didReceiveUpdate) + return ( + bailoutHooks(current, workInProgress, renderLanes), + bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) + ); + isHydrating && Component && pushMaterializedTreeId(workInProgress); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; +} +function updateClassComponent( + current, + workInProgress, + Component, + nextProps, + renderLanes +) { + prepareToReadContext(workInProgress); + if (null === workInProgress.stateNode) { + var context = emptyContextObject, + contextType = Component.contextType; + "object" === typeof contextType && + null !== contextType && + (context = readContext(contextType)); + context = new Component(nextProps, context); + workInProgress.memoizedState = + null !== context.state && void 0 !== context.state ? context.state : null; + context.updater = classComponentUpdater; + workInProgress.stateNode = context; + context._reactInternals = workInProgress; + context = workInProgress.stateNode; + context.props = nextProps; + context.state = workInProgress.memoizedState; + context.refs = {}; + initializeUpdateQueue(workInProgress); + contextType = Component.contextType; + context.context = + "object" === typeof contextType && null !== contextType + ? readContext(contextType) + : emptyContextObject; + context.state = workInProgress.memoizedState; + contextType = Component.getDerivedStateFromProps; + "function" === typeof contextType && + (applyDerivedStateFromProps( + workInProgress, + Component, + contextType, + nextProps + ), + (context.state = workInProgress.memoizedState)); + "function" === typeof Component.getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ((contextType = context.state), + "function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount(), + contextType !== context.state && + classComponentUpdater.enqueueReplaceState(context, context.state, null), + processUpdateQueue(workInProgress, nextProps, context, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction(), + (context.state = workInProgress.memoizedState)); + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308); + nextProps = !0; + } else if (null === current) { + context = workInProgress.stateNode; + var unresolvedOldProps = workInProgress.memoizedProps, + oldProps = resolveClassComponentProps(Component, unresolvedOldProps); + context.props = oldProps; + var oldContext = context.context, + contextType$jscomp$0 = Component.contextType; + contextType = emptyContextObject; + "object" === typeof contextType$jscomp$0 && + null !== contextType$jscomp$0 && + (contextType = readContext(contextType$jscomp$0)); + var getDerivedStateFromProps = Component.getDerivedStateFromProps; + contextType$jscomp$0 = + "function" === typeof getDerivedStateFromProps || + "function" === typeof context.getSnapshotBeforeUpdate; + unresolvedOldProps = workInProgress.pendingProps !== unresolvedOldProps; + contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((unresolvedOldProps || oldContext !== contextType) && + callComponentWillReceiveProps( + workInProgress, + context, + nextProps, + contextType + )); + hasForceUpdate = !1; + var oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + oldContext = workInProgress.memoizedState; + unresolvedOldProps || oldState !== oldContext || hasForceUpdate + ? ("function" === typeof getDerivedStateFromProps && + (applyDerivedStateFromProps( + workInProgress, + Component, + getDerivedStateFromProps, + nextProps + ), + (oldContext = workInProgress.memoizedState)), + (oldProps = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + oldProps, + nextProps, + oldState, + oldContext, + contextType + )) + ? (contextType$jscomp$0 || + ("function" !== typeof context.UNSAFE_componentWillMount && + "function" !== typeof context.componentWillMount) || + ("function" === typeof context.componentWillMount && + context.componentWillMount(), + "function" === typeof context.UNSAFE_componentWillMount && + context.UNSAFE_componentWillMount()), + "function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = oldContext)), + (context.props = nextProps), + (context.state = oldContext), + (context.context = contextType), + (nextProps = oldProps)) + : ("function" === typeof context.componentDidMount && + (workInProgress.flags |= 4194308), + (nextProps = !1)); + } else { + context = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + contextType = workInProgress.memoizedProps; + contextType$jscomp$0 = resolveClassComponentProps(Component, contextType); + context.props = contextType$jscomp$0; + getDerivedStateFromProps = workInProgress.pendingProps; + oldState = context.context; + oldContext = Component.contextType; + oldProps = emptyContextObject; + "object" === typeof oldContext && + null !== oldContext && + (oldProps = readContext(oldContext)); + unresolvedOldProps = Component.getDerivedStateFromProps; + (oldContext = + "function" === typeof unresolvedOldProps || + "function" === typeof context.getSnapshotBeforeUpdate) || + ("function" !== typeof context.UNSAFE_componentWillReceiveProps && + "function" !== typeof context.componentWillReceiveProps) || + ((contextType !== getDerivedStateFromProps || oldState !== oldProps) && + callComponentWillReceiveProps( workInProgress, - workInProgress.stateNode.containerInfo - ); - if (null === current) throw Error(formatProdErrorMessage(387)); - var nextProps = workInProgress.pendingProps; - init = workInProgress.memoizedState; - lazyComponent = init.element; - cloneUpdateQueue(current, workInProgress); - processUpdateQueue(workInProgress, nextProps, null, renderLanes); - var nextState = workInProgress.memoizedState; - nextProps = nextState.cache; - pushProvider(workInProgress, CacheContext, nextProps); - nextProps !== init.cache && - propagateContextChanges( + context, + nextProps, + oldProps + )); + hasForceUpdate = !1; + oldState = workInProgress.memoizedState; + context.state = oldState; + processUpdateQueue(workInProgress, nextProps, context, renderLanes); + suspendIfUpdateReadFromEntangledAsyncAction(); + var newState = workInProgress.memoizedState; + contextType !== getDerivedStateFromProps || + oldState !== newState || + hasForceUpdate || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies)) + ? ("function" === typeof unresolvedOldProps && + (applyDerivedStateFromProps( workInProgress, - [CacheContext], - renderLanes, - !0 - ); - suspendIfUpdateReadFromEntangledAsyncAction(); - nextProps = nextState.element; - if (init.isDehydrated) - if ( - ((init = { - element: nextProps, - isDehydrated: !1, - cache: nextState.cache - }), - (workInProgress.updateQueue.baseState = init), - (workInProgress.memoizedState = init), - workInProgress.flags & 256) - ) { - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else if (nextProps !== lazyComponent) { - lazyComponent = createCapturedValueAtFiber( - Error(formatProdErrorMessage(424)), - workInProgress - ); - queueHydrationError(lazyComponent); - workInProgress = mountHostRootWithoutHydrating( - current, - workInProgress, - nextProps, - renderLanes - ); - break a; - } else - for ( - nextHydratableInstance = getNextHydratable( - workInProgress.stateNode.containerInfo.firstChild - ), - hydrationParentFiber = workInProgress, - isHydrating = !0, - hydrationErrors = null, - rootOrSingletonContext = !0, - renderLanes = mountChildFibers( - workInProgress, - null, - nextProps, - renderLanes - ), - workInProgress.child = renderLanes; - renderLanes; - - ) - (renderLanes.flags = (renderLanes.flags & -3) | 4096), - (renderLanes = renderLanes.sibling); - else { - resetHydrationState(); - if (nextProps === lazyComponent) { - workInProgress = bailoutOnAlreadyFinishedWork( - current, - workInProgress, - renderLanes - ); - break a; - } - reconcileChildren(current, workInProgress, nextProps, renderLanes); - } - workInProgress = workInProgress.child; - } - return workInProgress; - case 26: - return ( - markRef(current, workInProgress), - null === current - ? (renderLanes = getResource( - workInProgress.type, - null, - workInProgress.pendingProps, - null - )) - ? (workInProgress.memoizedState = renderLanes) - : isHydrating || - ((renderLanes = workInProgress.type), - (current = workInProgress.pendingProps), - (lazyComponent = getOwnerDocumentFromRootContainer( - rootInstanceStackCursor.current - ).createElement(renderLanes)), - (lazyComponent[internalInstanceKey] = workInProgress), - (lazyComponent[internalPropsKey] = current), - setInitialProperties(lazyComponent, renderLanes, current), - markNodeAsHoistable(lazyComponent), - (workInProgress.stateNode = lazyComponent)) - : (workInProgress.memoizedState = getResource( - workInProgress.type, - current.memoizedProps, - workInProgress.pendingProps, - current.memoizedState - )), - null - ); - case 27: - return ( - pushHostContext(workInProgress), - null === current && - isHydrating && - ((lazyComponent = workInProgress.stateNode = - resolveSingletonInstance( - workInProgress.type, - workInProgress.pendingProps, - rootInstanceStackCursor.current - )), - (hydrationParentFiber = workInProgress), - (rootOrSingletonContext = !0), - (nextHydratableInstance = getNextHydratable( - lazyComponent.firstChild - ))), - (lazyComponent = workInProgress.pendingProps.children), - null !== current || isHydrating - ? reconcileChildren( - current, - workInProgress, - lazyComponent, - renderLanes - ) - : (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lazyComponent, - renderLanes - )), - markRef(current, workInProgress), - workInProgress.child - ); - case 5: - if (null === current && isHydrating) { - if ((init = lazyComponent = nextHydratableInstance)) - (lazyComponent = canHydrateInstance( - lazyComponent, - workInProgress.type, - workInProgress.pendingProps, - rootOrSingletonContext - )), - null !== lazyComponent - ? ((workInProgress.stateNode = lazyComponent), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = getNextHydratable( - lazyComponent.firstChild + Component, + unresolvedOldProps, + nextProps + ), + (newState = workInProgress.memoizedState)), + (contextType$jscomp$0 = + hasForceUpdate || + checkShouldComponentUpdate( + workInProgress, + Component, + contextType$jscomp$0, + nextProps, + oldState, + newState, + oldProps + ) || + (null !== current && + null !== current.dependencies && + checkIfContextChanged(current.dependencies))) + ? (oldContext || + ("function" !== typeof context.UNSAFE_componentWillUpdate && + "function" !== typeof context.componentWillUpdate) || + ("function" === typeof context.componentWillUpdate && + context.componentWillUpdate(nextProps, newState, oldProps), + "function" === typeof context.UNSAFE_componentWillUpdate && + context.UNSAFE_componentWillUpdate( + nextProps, + newState, + oldProps )), - (rootOrSingletonContext = !1), - (init = !0)) - : (init = !1); - init || throwOnHydrationMismatch(workInProgress); - } - pushHostContext(workInProgress); - init = workInProgress.type; - nextProps = workInProgress.pendingProps; - nextState = null !== current ? current.memoizedProps : null; - lazyComponent = nextProps.children; - shouldSetTextContent(init, nextProps) - ? (lazyComponent = null) - : null !== nextState && - shouldSetTextContent(init, nextState) && - (workInProgress.flags |= 32); - null !== workInProgress.memoizedState && - ((init = renderWithHooks( - current, - workInProgress, - TransitionAwareHostComponent, - null, - null, - renderLanes - )), - (HostTransitionContext._currentValue = init)); - markRef(current, workInProgress); - reconcileChildren(current, workInProgress, lazyComponent, renderLanes); - return workInProgress.child; - case 6: - if (null === current && isHydrating) { - if ((current = renderLanes = nextHydratableInstance)) - (renderLanes = canHydrateTextInstance( - renderLanes, - workInProgress.pendingProps, - rootOrSingletonContext + "function" === typeof context.componentDidUpdate && + (workInProgress.flags |= 4), + "function" === typeof context.getSnapshotBeforeUpdate && + (workInProgress.flags |= 1024)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (workInProgress.memoizedProps = nextProps), + (workInProgress.memoizedState = newState)), + (context.props = nextProps), + (context.state = newState), + (context.context = oldProps), + (nextProps = contextType$jscomp$0)) + : ("function" !== typeof context.componentDidUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 4), + "function" !== typeof context.getSnapshotBeforeUpdate || + (contextType === current.memoizedProps && + oldState === current.memoizedState) || + (workInProgress.flags |= 1024), + (nextProps = !1)); + } + context = nextProps; + markRef(current, workInProgress); + nextProps = 0 !== (workInProgress.flags & 128); + context || nextProps + ? ((context = workInProgress.stateNode), + nextProps && "function" !== typeof Component.getDerivedStateFromError + ? ((Component = null), (profilerStartTime = -1)) + : (Component = context.render()), + (workInProgress.flags |= 1), + null !== current && nextProps + ? ((workInProgress.child = reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes )), - null !== renderLanes - ? ((workInProgress.stateNode = renderLanes), - (hydrationParentFiber = workInProgress), - (nextHydratableInstance = null), - (current = !0)) - : (current = !1); - current || throwOnHydrationMismatch(workInProgress); - } - return null; - case 13: - return updateSuspenseComponent(current, workInProgress, renderLanes); - case 4: - return ( - pushHostContainer( - workInProgress, - workInProgress.stateNode.containerInfo - ), - (lazyComponent = workInProgress.pendingProps), - null === current - ? (workInProgress.child = reconcileChildFibers( - workInProgress, - null, - lazyComponent, - renderLanes - )) - : reconcileChildren( - current, - workInProgress, - lazyComponent, - renderLanes - ), - workInProgress.child - ); - case 11: - return updateForwardRef( + (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + Component, + renderLanes + ))) + : reconcileChildren(current, workInProgress, Component, renderLanes), + (workInProgress.memoizedState = context.state), + (current = workInProgress.child)) + : (current = bailoutOnAlreadyFinishedWork( current, workInProgress, - workInProgress.type, - workInProgress.pendingProps, renderLanes - ); - case 7: - return ( - reconcileChildren( - current, - workInProgress, - workInProgress.pendingProps, - renderLanes - ), - workInProgress.child - ); - case 8: + )); + return current; +} +function mountHostRootWithoutHydrating( + current, + workInProgress, + nextChildren, + renderLanes +) { + resetHydrationState(); + workInProgress.flags |= 256; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; +} +var SUSPENDED_MARKER = { + dehydrated: null, + treeContext: null, + retryLane: 0, + hydrationErrors: null +}; +function mountSuspenseOffscreenState(renderLanes) { + return { baseLanes: renderLanes, cachePool: getSuspendedCache() }; +} +function getRemainingWorkInPrimaryTree( + current, + primaryTreeDidDefer, + renderLanes +) { + current = null !== current ? current.childLanes & ~renderLanes : 0; + primaryTreeDidDefer && (current |= workInProgressDeferredLane); + return current; +} +function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + showFallback = !1, + didSuspend = 0 !== (workInProgress.flags & 128), + JSCompiler_temp; + (JSCompiler_temp = didSuspend) || + (JSCompiler_temp = + null !== current && null === current.memoizedState + ? !1 + : 0 !== (suspenseStackCursor.current & 2)); + JSCompiler_temp && ((showFallback = !0), (workInProgress.flags &= -129)); + JSCompiler_temp = 0 !== (workInProgress.flags & 32); + workInProgress.flags &= -33; + if (null === current) { + if (isHydrating) { + showFallback + ? pushPrimaryTreeSuspenseHandler(workInProgress) + : reuseSuspenseHandlerOnStack(workInProgress); + if (isHydrating) { + var nextInstance = nextHydratableInstance, + JSCompiler_temp$jscomp$0; + if ((JSCompiler_temp$jscomp$0 = nextInstance)) { + c: { + JSCompiler_temp$jscomp$0 = nextInstance; + for ( + nextInstance = rootOrSingletonContext; + 8 !== JSCompiler_temp$jscomp$0.nodeType; + + ) { + if (!nextInstance) { + nextInstance = null; + break c; + } + JSCompiler_temp$jscomp$0 = getNextHydratable( + JSCompiler_temp$jscomp$0.nextSibling + ); + if (null === JSCompiler_temp$jscomp$0) { + nextInstance = null; + break c; + } + } + nextInstance = JSCompiler_temp$jscomp$0; + } + null !== nextInstance + ? ((workInProgress.memoizedState = { + dehydrated: nextInstance, + treeContext: + null !== treeContextProvider + ? { id: treeContextId, overflow: treeContextOverflow } + : null, + retryLane: 536870912, + hydrationErrors: null + }), + (JSCompiler_temp$jscomp$0 = createFiberImplClass( + 18, + null, + null, + 0 + )), + (JSCompiler_temp$jscomp$0.stateNode = nextInstance), + (JSCompiler_temp$jscomp$0.return = workInProgress), + (workInProgress.child = JSCompiler_temp$jscomp$0), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (JSCompiler_temp$jscomp$0 = !0)) + : (JSCompiler_temp$jscomp$0 = !1); + } + JSCompiler_temp$jscomp$0 || throwOnHydrationMismatch(workInProgress); + } + nextInstance = workInProgress.memoizedState; + if ( + null !== nextInstance && + ((nextInstance = nextInstance.dehydrated), null !== nextInstance) + ) + return ( + isSuspenseInstanceFallback(nextInstance) + ? (workInProgress.lanes = 32) + : (workInProgress.lanes = 536870912), + null + ); + popSuspenseHandler(workInProgress); + } + nextInstance = nextProps.children; + JSCompiler_temp$jscomp$0 = nextProps.fallback; + if (showFallback) return ( - reconcileChildren( - current, + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - workInProgress.pendingProps.children, + nextInstance, + JSCompiler_temp$jscomp$0, renderLanes - ), - workInProgress.child - ); - case 12: - return ( - (workInProgress.flags |= 4), - (workInProgress.flags |= 2048), - (lazyComponent = workInProgress.stateNode), - (lazyComponent.effectDuration = -0), - (lazyComponent.passiveEffectDuration = -0), - reconcileChildren( + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( current, - workInProgress, - workInProgress.pendingProps.children, + JSCompiler_temp, renderLanes - ), - workInProgress.child + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps ); - case 10: + if ("number" === typeof nextProps.unstable_expectedLoadTime) return ( - (lazyComponent = workInProgress.pendingProps), - pushProvider(workInProgress, workInProgress.type, lazyComponent.value), - reconcileChildren( - current, + reuseSuspenseHandlerOnStack(workInProgress), + (nextProps = mountSuspenseFallbackChildren( workInProgress, - lazyComponent.children, + nextInstance, + JSCompiler_temp$jscomp$0, renderLanes - ), - workInProgress.child - ); - case 9: - return ( - (init = workInProgress.type._context), - (lazyComponent = workInProgress.pendingProps.children), - prepareToReadContext(workInProgress), - (init = readContext(init)), - (lazyComponent = lazyComponent(init)), - (workInProgress.flags |= 1), - reconcileChildren(current, workInProgress, lazyComponent, renderLanes), - workInProgress.child - ); - case 14: - return updateMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 15: - return updateSimpleMemoComponent( - current, - workInProgress, - workInProgress.type, - workInProgress.pendingProps, - renderLanes - ); - case 19: - return updateSuspenseListComponent(current, workInProgress, renderLanes); - case 22: - return updateOffscreenComponent(current, workInProgress, renderLanes); - case 24: - return ( - prepareToReadContext(workInProgress), - (lazyComponent = readContext(CacheContext)), - null === current - ? ((init = peekCacheFromPool()), - null === init && - ((init = workInProgressRoot), - (nextProps = createCache()), - (init.pooledCache = nextProps), - nextProps.refCount++, - null !== nextProps && (init.pooledCacheLanes |= renderLanes), - (init = nextProps)), - (workInProgress.memoizedState = { - parent: lazyComponent, - cache: init - }), - initializeUpdateQueue(workInProgress), - pushProvider(workInProgress, CacheContext, init)) - : (0 !== (current.lanes & renderLanes) && - (cloneUpdateQueue(current, workInProgress), - processUpdateQueue(workInProgress, null, null, renderLanes), - suspendIfUpdateReadFromEntangledAsyncAction()), - (init = current.memoizedState), - (nextProps = workInProgress.memoizedState), - init.parent !== lazyComponent - ? ((init = { parent: lazyComponent, cache: lazyComponent }), - (workInProgress.memoizedState = init), - 0 === workInProgress.lanes && - (workInProgress.memoizedState = - workInProgress.updateQueue.baseState = - init), - pushProvider(workInProgress, CacheContext, lazyComponent)) - : ((lazyComponent = nextProps.cache), - pushProvider(workInProgress, CacheContext, lazyComponent), - lazyComponent !== init.cache && - propagateContextChanges( - workInProgress, - [CacheContext], - renderLanes, - !0 - ))), - reconcileChildren( + )), + (showFallback = workInProgress.child), + (showFallback.memoizedState = mountSuspenseOffscreenState(renderLanes)), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( current, - workInProgress, - workInProgress.pendingProps.children, + JSCompiler_temp, renderLanes - ), - workInProgress.child + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress.lanes = 4194304), + nextProps ); - case 29: - throw workInProgress.pendingProps; - } - throw Error(formatProdErrorMessage(156, workInProgress.tag)); -} -var valueCursor = createCursor(null), - currentlyRenderingFiber = null, - lastContextDependency = null; -function pushProvider(providerFiber, context, nextValue) { - push(valueCursor, context._currentValue); - context._currentValue = nextValue; -} -function popProvider(context) { - context._currentValue = valueCursor.current; - pop(valueCursor); -} -function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { - for (; null !== parent; ) { - var alternate = parent.alternate; - (parent.childLanes & renderLanes) !== renderLanes - ? ((parent.childLanes |= renderLanes), - null !== alternate && (alternate.childLanes |= renderLanes)) - : null !== alternate && - (alternate.childLanes & renderLanes) !== renderLanes && - (alternate.childLanes |= renderLanes); - if (parent === propagationRoot) break; - parent = parent.return; - } -} -function propagateContextChanges( - workInProgress, - contexts, - renderLanes, - forcePropagateEntireTree -) { - var fiber = workInProgress.child; - null !== fiber && (fiber.return = workInProgress); - for (; null !== fiber; ) { - var list = fiber.dependencies; - if (null !== list) { - var nextFiber = fiber.child; - list = list.firstContext; - a: for (; null !== list; ) { - var dependency = list; - list = fiber; - for (var i = 0; i < contexts.length; i++) - if (dependency.context === contexts[i]) { - list.lanes |= renderLanes; - dependency = list.alternate; - null !== dependency && (dependency.lanes |= renderLanes); - scheduleContextWorkOnParentPath( - list.return, - renderLanes, - workInProgress - ); - forcePropagateEntireTree || (nextFiber = null); - break a; - } - list = dependency.next; - } - } else if (18 === fiber.tag) { - nextFiber = fiber.return; - if (null === nextFiber) throw Error(formatProdErrorMessage(341)); - nextFiber.lanes |= renderLanes; - list = nextFiber.alternate; - null !== list && (list.lanes |= renderLanes); - scheduleContextWorkOnParentPath(nextFiber, renderLanes, workInProgress); - nextFiber = null; - } else nextFiber = fiber.child; - if (null !== nextFiber) nextFiber.return = fiber; - else - for (nextFiber = fiber; null !== nextFiber; ) { - if (nextFiber === workInProgress) { - nextFiber = null; - break; - } - fiber = nextFiber.sibling; - if (null !== fiber) { - fiber.return = nextFiber.return; - nextFiber = fiber; - break; - } - nextFiber = nextFiber.return; - } - fiber = nextFiber; - } -} -function propagateParentContextChanges( - current, - workInProgress, - renderLanes, - forcePropagateEntireTree -) { - current = null; - for ( - var parent = workInProgress, isInsidePropagationBailout = !1; - null !== parent; - - ) { - if (!isInsidePropagationBailout) - if (0 !== (parent.flags & 524288)) isInsidePropagationBailout = !0; - else if (0 !== (parent.flags & 262144)) break; - if (10 === parent.tag) { - var currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent = currentParent.memoizedProps; - if (null !== currentParent) { - var context = parent.type; - objectIs(parent.pendingProps.value, currentParent.value) || - (null !== current ? current.push(context) : (current = [context])); - } - } else if (parent === hostTransitionProviderCursor.current) { - currentParent = parent.alternate; - if (null === currentParent) throw Error(formatProdErrorMessage(387)); - currentParent.memoizedState.memoizedState !== - parent.memoizedState.memoizedState && - (null !== current - ? current.push(HostTransitionContext) - : (current = [HostTransitionContext])); - } - parent = parent.return; + pushPrimaryTreeSuspenseHandler(workInProgress); + return mountSuspensePrimaryChildren(workInProgress, nextInstance); } - null !== current && - propagateContextChanges( - workInProgress, - current, - renderLanes, - forcePropagateEntireTree - ); - workInProgress.flags |= 262144; -} -function checkIfContextChanged(currentDependencies) { - for ( - currentDependencies = currentDependencies.firstContext; - null !== currentDependencies; - + JSCompiler_temp$jscomp$0 = current.memoizedState; + if ( + null !== JSCompiler_temp$jscomp$0 && + ((nextInstance = JSCompiler_temp$jscomp$0.dehydrated), + null !== nextInstance) ) { - if ( - !objectIs( - currentDependencies.context._currentValue, - currentDependencies.memoizedValue + if (didSuspend) + workInProgress.flags & 256 + ? (pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags &= -257), + (workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ))) + : null !== workInProgress.memoizedState + ? (reuseSuspenseHandlerOnStack(workInProgress), + (workInProgress.child = current.child), + (workInProgress.flags |= 128), + (workInProgress = null)) + : (reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (nextProps = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: nextProps.children }, + nextInstance + )), + (showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2), + (nextProps.return = workInProgress), + (showFallback.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + reconcileChildFibers( + workInProgress, + current.child, + null, + renderLanes + ), + (nextProps = workInProgress.child), + (nextProps.memoizedState = + mountSuspenseOffscreenState(renderLanes)), + (nextProps.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + (workInProgress = showFallback)); + else if ( + (pushPrimaryTreeSuspenseHandler(workInProgress), + isSuspenseInstanceFallback(nextInstance)) + ) { + JSCompiler_temp = + nextInstance.nextSibling && nextInstance.nextSibling.dataset; + if (JSCompiler_temp) var digest = JSCompiler_temp.dgst; + JSCompiler_temp = digest; + "POSTPONE" !== JSCompiler_temp && + ((nextProps = Error(formatProdErrorMessage(419))), + (nextProps.stack = ""), + (nextProps.digest = JSCompiler_temp), + queueHydrationError({ value: nextProps, source: null, stack: null })); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else if ( + (didReceiveUpdate || + propagateParentContextChanges(current, workInProgress, renderLanes, !1), + (JSCompiler_temp = 0 !== (renderLanes & current.childLanes)), + didReceiveUpdate || JSCompiler_temp) + ) { + JSCompiler_temp = workInProgressRoot; + if ( + null !== JSCompiler_temp && + ((nextProps = renderLanes & -renderLanes), + (nextProps = + 0 !== (nextProps & 42) + ? 1 + : getBumpedLaneForHydrationByLane(nextProps)), + (nextProps = + 0 !== (nextProps & (JSCompiler_temp.suspendedLanes | renderLanes)) + ? 0 + : nextProps), + 0 !== nextProps && nextProps !== JSCompiler_temp$jscomp$0.retryLane) ) - ) - return !0; - currentDependencies = currentDependencies.next; + throw ( + ((JSCompiler_temp$jscomp$0.retryLane = nextProps), + enqueueConcurrentRenderForLane(current, nextProps), + scheduleUpdateOnFiber(JSCompiler_temp, current, nextProps), + SelectiveHydrationException) + ); + "$?" === nextInstance.data || renderDidSuspendDelayIfPossible(); + workInProgress = retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes + ); + } else + "$?" === nextInstance.data + ? ((workInProgress.flags |= 192), + (workInProgress.child = current.child), + (workInProgress = null)) + : ((current = JSCompiler_temp$jscomp$0.treeContext), + (nextHydratableInstance = getNextHydratable( + nextInstance.nextSibling + )), + (hydrationParentFiber = workInProgress), + (isHydrating = !0), + (hydrationErrors = null), + (rootOrSingletonContext = !1), + null !== current && + ((idStack[idStackIndex++] = treeContextId), + (idStack[idStackIndex++] = treeContextOverflow), + (idStack[idStackIndex++] = treeContextProvider), + (treeContextId = current.id), + (treeContextOverflow = current.overflow), + (treeContextProvider = workInProgress)), + (workInProgress = mountSuspensePrimaryChildren( + workInProgress, + nextProps.children + )), + (workInProgress.flags |= 4096)); + return workInProgress; } - return !1; -} -function prepareToReadContext(workInProgress) { - currentlyRenderingFiber = workInProgress; - lastContextDependency = null; - workInProgress = workInProgress.dependencies; - null !== workInProgress && (workInProgress.firstContext = null); + if (showFallback) + return ( + reuseSuspenseHandlerOnStack(workInProgress), + (showFallback = nextProps.fallback), + (nextInstance = workInProgress.mode), + (JSCompiler_temp$jscomp$0 = current.child), + (digest = JSCompiler_temp$jscomp$0.sibling), + (nextProps = createWorkInProgress(JSCompiler_temp$jscomp$0, { + mode: "hidden", + children: nextProps.children + })), + (nextProps.subtreeFlags = + JSCompiler_temp$jscomp$0.subtreeFlags & 31457280), + null !== digest + ? (showFallback = createWorkInProgress(digest, showFallback)) + : ((showFallback = createFiberFromFragment( + showFallback, + nextInstance, + renderLanes, + null + )), + (showFallback.flags |= 2)), + (showFallback.return = workInProgress), + (nextProps.return = workInProgress), + (nextProps.sibling = showFallback), + (workInProgress.child = nextProps), + (nextProps = showFallback), + (showFallback = workInProgress.child), + (nextInstance = current.child.memoizedState), + null === nextInstance + ? (nextInstance = mountSuspenseOffscreenState(renderLanes)) + : ((JSCompiler_temp$jscomp$0 = nextInstance.cachePool), + null !== JSCompiler_temp$jscomp$0 + ? ((digest = CacheContext._currentValue), + (JSCompiler_temp$jscomp$0 = + JSCompiler_temp$jscomp$0.parent !== digest + ? { parent: digest, pool: digest } + : JSCompiler_temp$jscomp$0)) + : (JSCompiler_temp$jscomp$0 = getSuspendedCache()), + (nextInstance = { + baseLanes: nextInstance.baseLanes | renderLanes, + cachePool: JSCompiler_temp$jscomp$0 + })), + (showFallback.memoizedState = nextInstance), + (showFallback.childLanes = getRemainingWorkInPrimaryTree( + current, + JSCompiler_temp, + renderLanes + )), + (workInProgress.memoizedState = SUSPENDED_MARKER), + nextProps + ); + pushPrimaryTreeSuspenseHandler(workInProgress); + renderLanes = current.child; + current = renderLanes.sibling; + renderLanes = createWorkInProgress(renderLanes, { + mode: "visible", + children: nextProps.children + }); + renderLanes.return = workInProgress; + renderLanes.sibling = null; + null !== current && + ((JSCompiler_temp = workInProgress.deletions), + null === JSCompiler_temp + ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) + : JSCompiler_temp.push(current)); + workInProgress.child = renderLanes; + workInProgress.memoizedState = null; + return renderLanes; } -function readContext(context) { - return readContextForConsumer(currentlyRenderingFiber, context); +function mountSuspensePrimaryChildren(workInProgress, primaryChildren) { + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "visible", children: primaryChildren }, + workInProgress.mode + ); + primaryChildren.return = workInProgress; + return (workInProgress.child = primaryChildren); } -function readContextDuringReconciliation(consumer, context) { - null === currentlyRenderingFiber && prepareToReadContext(consumer); - return readContextForConsumer(consumer, context); +function mountSuspenseFallbackChildren( + workInProgress, + primaryChildren, + fallbackChildren, + renderLanes +) { + var mode = workInProgress.mode; + primaryChildren = mountWorkInProgressOffscreenFiber( + { mode: "hidden", children: primaryChildren }, + mode + ); + fallbackChildren = createFiberFromFragment( + fallbackChildren, + mode, + renderLanes, + null + ); + primaryChildren.return = workInProgress; + fallbackChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; } -function readContextForConsumer(consumer, context) { - var value = context._currentValue; - context = { context: context, memoizedValue: value, next: null }; - if (null === lastContextDependency) { - if (null === consumer) throw Error(formatProdErrorMessage(308)); - lastContextDependency = context; - consumer.dependencies = { lanes: 0, firstContext: context }; - consumer.flags |= 524288; - } else lastContextDependency = lastContextDependency.next = context; - return value; +function mountWorkInProgressOffscreenFiber(offscreenProps, mode) { + return createFiberFromOffscreen(offscreenProps, mode, 0, null); } -var hasForceUpdate = !1; -function initializeUpdateQueue(fiber) { - fiber.updateQueue = { - baseState: fiber.memoizedState, - firstBaseUpdate: null, - lastBaseUpdate: null, - shared: { pending: null, lanes: 0, hiddenCallbacks: null }, - callbacks: null - }; +function retrySuspenseComponentWithoutHydrating( + current, + workInProgress, + renderLanes +) { + reconcileChildFibers(workInProgress, current.child, null, renderLanes); + current = mountSuspensePrimaryChildren( + workInProgress, + workInProgress.pendingProps.children + ); + current.flags |= 2; + workInProgress.memoizedState = null; + return current; } -function cloneUpdateQueue(current, workInProgress) { - current = current.updateQueue; - workInProgress.updateQueue === current && - (workInProgress.updateQueue = { - baseState: current.baseState, - firstBaseUpdate: current.firstBaseUpdate, - lastBaseUpdate: current.lastBaseUpdate, - shared: current.shared, - callbacks: null - }); +function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } -function createUpdate(lane) { - return { lane: lane, tag: 0, payload: null, callback: null, next: null }; +function initSuspenseListRenderState( + workInProgress, + isBackwards, + tail, + lastContentRow, + tailMode +) { + var renderState = workInProgress.memoizedState; + null === renderState + ? (workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + }) + : ((renderState.isBackwards = isBackwards), + (renderState.rendering = null), + (renderState.renderingStartTime = 0), + (renderState.last = lastContentRow), + (renderState.tail = tail), + (renderState.tailMode = tailMode)); } -function enqueueUpdate(fiber, update, lane) { - var updateQueue = fiber.updateQueue; - if (null === updateQueue) return null; - updateQueue = updateQueue.shared; - if (0 !== (executionContext & 2)) { - var pending = updateQueue.pending; - null === pending - ? (update.next = update) - : ((update.next = pending.next), (pending.next = update)); - updateQueue.pending = update; - update = getRootForUpdatedFiber(fiber); - markUpdateLaneFromFiberToRoot(fiber, null, lane); - return update; +function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) + (nextProps = (nextProps & 1) | 2), (workInProgress.flags |= 128); + else { + if (null !== current && 0 !== (current.flags & 128)) + a: for (current = workInProgress.child; null !== current; ) { + if (13 === current.tag) + null !== current.memoizedState && + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (19 === current.tag) + scheduleSuspenseWorkOnFiber(current, renderLanes, workInProgress); + else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + for (; null === current.sibling; ) { + if (null === current.return || current.return === workInProgress) + break a; + current = current.return; + } + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; } - enqueueUpdate$1(fiber, updateQueue, update, lane); - return getRootForUpdatedFiber(fiber); -} -function entangleTransitions(root, fiber, lane) { - fiber = fiber.updateQueue; - if (null !== fiber && ((fiber = fiber.shared), 0 !== (lane & 4194176))) { - var queueLanes = fiber.lanes; - queueLanes &= root.pendingLanes; - lane |= queueLanes; - fiber.lanes = lane; - markRootEntangled(root, lane); + push(suspenseStackCursor, nextProps); + switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + for (revealOrder = null; null !== renderLanes; ) + (current = renderLanes.alternate), + null !== current && + null === findFirstSuspended(current) && + (revealOrder = renderLanes), + (renderLanes = renderLanes.sibling); + renderLanes = revealOrder; + null === renderLanes + ? ((revealOrder = workInProgress.child), (workInProgress.child = null)) + : ((revealOrder = renderLanes.sibling), (renderLanes.sibling = null)); + initSuspenseListRenderState( + workInProgress, + !1, + revealOrder, + renderLanes, + tailMode + ); + break; + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + for (workInProgress.child = null; null !== revealOrder; ) { + current = revealOrder.alternate; + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + initSuspenseListRenderState( + workInProgress, + !0, + renderLanes, + null, + tailMode + ); + break; + case "together": + initSuspenseListRenderState(workInProgress, !1, null, null, void 0); + break; + default: + workInProgress.memoizedState = null; } + return workInProgress.child; } -function enqueueCapturedUpdate(workInProgress, capturedUpdate) { - var queue = workInProgress.updateQueue, - current = workInProgress.alternate; - if ( - null !== current && - ((current = current.updateQueue), queue === current) - ) { - var newFirst = null, - newLast = null; - queue = queue.firstBaseUpdate; - if (null !== queue) { - do { - var clone = { - lane: queue.lane, - tag: queue.tag, - payload: queue.payload, - callback: null, - next: null - }; - null === newLast - ? (newFirst = newLast = clone) - : (newLast = newLast.next = clone); - queue = queue.next; - } while (null !== queue); - null === newLast - ? (newFirst = newLast = capturedUpdate) - : (newLast = newLast.next = capturedUpdate); - } else newFirst = newLast = capturedUpdate; - queue = { - baseState: current.baseState, - firstBaseUpdate: newFirst, - lastBaseUpdate: newLast, - shared: current.shared, - callbacks: current.callbacks - }; - workInProgress.updateQueue = queue; - return; +function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + profilerStartTime = -1; + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) + if (null !== current) { + if ( + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + 0 === (renderLanes & workInProgress.childLanes)) + ) + return null; + } else return null; + if (null !== current && workInProgress.child !== current.child) + throw Error(formatProdErrorMessage(153)); + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + for (renderLanes.return = workInProgress; null !== current.sibling; ) + (current = current.sibling), + (renderLanes = renderLanes.sibling = + createWorkInProgress(current, current.pendingProps)), + (renderLanes.return = workInProgress); + renderLanes.sibling = null; } - workInProgress = queue.lastBaseUpdate; - null === workInProgress - ? (queue.firstBaseUpdate = capturedUpdate) - : (workInProgress.next = capturedUpdate); - queue.lastBaseUpdate = capturedUpdate; + return workInProgress.child; } -var didReadFromEntangledAsyncAction = !1; -function suspendIfUpdateReadFromEntangledAsyncAction() { - if (didReadFromEntangledAsyncAction) { - var entangledActionThenable = currentEntangledActionThenable; - if (null !== entangledActionThenable) throw entangledActionThenable; - } +function checkScheduledUpdateOrContext(current, renderLanes) { + if (0 !== (current.lanes & renderLanes)) return !0; + current = current.dependencies; + return null !== current && checkIfContextChanged(current) ? !0 : !1; } -function processUpdateQueue( - workInProgress$jscomp$0, - props, - instance$jscomp$0, +function attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, renderLanes ) { - didReadFromEntangledAsyncAction = !1; - var queue = workInProgress$jscomp$0.updateQueue; - hasForceUpdate = !1; - var firstBaseUpdate = queue.firstBaseUpdate, - lastBaseUpdate = queue.lastBaseUpdate, - pendingQueue = queue.shared.pending; - if (null !== pendingQueue) { - queue.shared.pending = null; - var lastPendingUpdate = pendingQueue, - firstPendingUpdate = lastPendingUpdate.next; - lastPendingUpdate.next = null; - null === lastBaseUpdate - ? (firstBaseUpdate = firstPendingUpdate) - : (lastBaseUpdate.next = firstPendingUpdate); - lastBaseUpdate = lastPendingUpdate; - var current = workInProgress$jscomp$0.alternate; - null !== current && - ((current = current.updateQueue), - (pendingQueue = current.lastBaseUpdate), - pendingQueue !== lastBaseUpdate && - (null === pendingQueue - ? (current.firstBaseUpdate = firstPendingUpdate) - : (pendingQueue.next = firstPendingUpdate), - (current.lastBaseUpdate = lastPendingUpdate))); + switch (workInProgress.tag) { + case 3: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); + resetHydrationState(); + break; + case 27: + case 5: + pushHostContext(workInProgress); + break; + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + case 10: + pushProvider( + workInProgress, + workInProgress.type, + workInProgress.memoizedProps.value + ); + break; + case 12: + 0 !== (renderLanes & workInProgress.childLanes) && + (workInProgress.flags |= 4); + workInProgress.flags |= 2048; + var stateNode = workInProgress.stateNode; + stateNode.effectDuration = -0; + stateNode.passiveEffectDuration = -0; + break; + case 13: + stateNode = workInProgress.memoizedState; + if (null !== stateNode) { + if (null !== stateNode.dehydrated) + return ( + pushPrimaryTreeSuspenseHandler(workInProgress), + (workInProgress.flags |= 128), + null + ); + if (0 !== (renderLanes & workInProgress.child.childLanes)) + return updateSuspenseComponent(current, workInProgress, renderLanes); + pushPrimaryTreeSuspenseHandler(workInProgress); + current = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + return null !== current ? current.sibling : null; + } + pushPrimaryTreeSuspenseHandler(workInProgress); + break; + case 19: + var didSuspendBefore = 0 !== (current.flags & 128); + stateNode = 0 !== (renderLanes & workInProgress.childLanes); + stateNode || + (propagateParentContextChanges( + current, + workInProgress, + renderLanes, + !1 + ), + (stateNode = 0 !== (renderLanes & workInProgress.childLanes))); + if (didSuspendBefore) { + if (stateNode) + return updateSuspenseListComponent( + current, + workInProgress, + renderLanes + ); + workInProgress.flags |= 128; + } + didSuspendBefore = workInProgress.memoizedState; + null !== didSuspendBefore && + ((didSuspendBefore.rendering = null), + (didSuspendBefore.tail = null), + (didSuspendBefore.lastEffect = null)); + push(suspenseStackCursor, suspenseStackCursor.current); + if (stateNode) break; + else return null; + case 22: + case 23: + return ( + (workInProgress.lanes = 0), + updateOffscreenComponent(current, workInProgress, renderLanes) + ); + case 24: + pushProvider(workInProgress, CacheContext, current.memoizedState.cache); } - if (null !== firstBaseUpdate) { - var newState = queue.baseState; - lastBaseUpdate = 0; - current = firstPendingUpdate = lastPendingUpdate = null; - pendingQueue = firstBaseUpdate; - do { - var updateLane = pendingQueue.lane & -536870913, - isHiddenUpdate = updateLane !== pendingQueue.lane; + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); +} +function beginWork(current, workInProgress, renderLanes) { + if (null !== current) + if (current.memoizedProps !== workInProgress.pendingProps) + didReceiveUpdate = !0; + else { if ( - isHiddenUpdate - ? (workInProgressRootRenderLanes & updateLane) === updateLane - : (renderLanes & updateLane) === updateLane - ) { - 0 !== updateLane && - updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction = !0); - null !== current && - (current = current.next = - { - lane: 0, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: null, - next: null - }); - a: { - var workInProgress = workInProgress$jscomp$0, - update = pendingQueue; - updateLane = props; - var instance = instance$jscomp$0; - switch (update.tag) { - case 1: - workInProgress = update.payload; - if ("function" === typeof workInProgress) { - newState = workInProgress.call(instance, newState, updateLane); - break a; - } - newState = workInProgress; + !checkScheduledUpdateOrContext(current, renderLanes) && + 0 === (workInProgress.flags & 128) + ) + return ( + (didReceiveUpdate = !1), + attemptEarlyBailoutIfNoScheduledUpdate( + current, + workInProgress, + renderLanes + ) + ); + didReceiveUpdate = 0 !== (current.flags & 131072) ? !0 : !1; + } + else + (didReceiveUpdate = !1), + isHydrating && + 0 !== (workInProgress.flags & 1048576) && + pushTreeId(workInProgress, treeForkCount, workInProgress.index); + workInProgress.lanes = 0; + switch (workInProgress.tag) { + case 16: + a: { + current = workInProgress.pendingProps; + var lazyComponent = workInProgress.elementType, + init = lazyComponent._init; + lazyComponent = init(lazyComponent._payload); + workInProgress.type = lazyComponent; + if ("function" === typeof lazyComponent) + shouldConstruct(lazyComponent) + ? ((current = resolveClassComponentProps(lazyComponent, current)), + (workInProgress.tag = 1), + (workInProgress = updateClassComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ))) + : ((workInProgress.tag = 0), + (workInProgress = updateFunctionComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ))); + else { + if (void 0 !== lazyComponent && null !== lazyComponent) + if ( + ((init = lazyComponent.$$typeof), init === REACT_FORWARD_REF_TYPE) + ) { + workInProgress.tag = 11; + workInProgress = updateForwardRef( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ); break a; - case 3: - workInProgress.flags = (workInProgress.flags & -65537) | 128; - case 0: - workInProgress = update.payload; - updateLane = - "function" === typeof workInProgress - ? workInProgress.call(instance, newState, updateLane) - : workInProgress; - if (null === updateLane || void 0 === updateLane) break a; - newState = assign({}, newState, updateLane); + } else if (init === REACT_MEMO_TYPE) { + workInProgress.tag = 14; + workInProgress = updateMemoComponent( + null, + workInProgress, + lazyComponent, + current, + renderLanes + ); break a; - case 2: - hasForceUpdate = !0; + } + workInProgress = + getComponentNameFromType(lazyComponent) || lazyComponent; + throw Error(formatProdErrorMessage(306, workInProgress, "")); + } + } + return workInProgress; + case 0: + return updateFunctionComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 1: + return ( + (lazyComponent = workInProgress.type), + (init = resolveClassComponentProps( + lazyComponent, + workInProgress.pendingProps + )), + updateClassComponent( + current, + workInProgress, + lazyComponent, + init, + renderLanes + ) + ); + case 3: + a: { + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ); + if (null === current) throw Error(formatProdErrorMessage(387)); + var nextProps = workInProgress.pendingProps; + init = workInProgress.memoizedState; + lazyComponent = init.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextProps, null, renderLanes); + var nextState = workInProgress.memoizedState; + nextProps = nextState.cache; + pushProvider(workInProgress, CacheContext, nextProps); + nextProps !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ); + suspendIfUpdateReadFromEntangledAsyncAction(); + nextProps = nextState.element; + if (init.isDehydrated) + if ( + ((init = { + element: nextProps, + isDehydrated: !1, + cache: nextState.cache + }), + (workInProgress.updateQueue.baseState = init), + (workInProgress.memoizedState = init), + workInProgress.flags & 256) + ) { + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else if (nextProps !== lazyComponent) { + lazyComponent = createCapturedValueAtFiber( + Error(formatProdErrorMessage(424)), + workInProgress + ); + queueHydrationError(lazyComponent); + workInProgress = mountHostRootWithoutHydrating( + current, + workInProgress, + nextProps, + renderLanes + ); + break a; + } else + for ( + nextHydratableInstance = getNextHydratable( + workInProgress.stateNode.containerInfo.firstChild + ), + hydrationParentFiber = workInProgress, + isHydrating = !0, + hydrationErrors = null, + rootOrSingletonContext = !0, + renderLanes = mountChildFibers( + workInProgress, + null, + nextProps, + renderLanes + ), + workInProgress.child = renderLanes; + renderLanes; + + ) + (renderLanes.flags = (renderLanes.flags & -3) | 4096), + (renderLanes = renderLanes.sibling); + else { + resetHydrationState(); + if (nextProps === lazyComponent) { + workInProgress = bailoutOnAlreadyFinishedWork( + current, + workInProgress, + renderLanes + ); + break a; } + reconcileChildren(current, workInProgress, nextProps, renderLanes); } - updateLane = pendingQueue.callback; - null !== updateLane && - ((workInProgress$jscomp$0.flags |= 64), - isHiddenUpdate && (workInProgress$jscomp$0.flags |= 8192), - (isHiddenUpdate = queue.callbacks), - null === isHiddenUpdate - ? (queue.callbacks = [updateLane]) - : isHiddenUpdate.push(updateLane)); - } else - (isHiddenUpdate = { - lane: updateLane, - tag: pendingQueue.tag, - payload: pendingQueue.payload, - callback: pendingQueue.callback, - next: null - }), - null === current - ? ((firstPendingUpdate = current = isHiddenUpdate), - (lastPendingUpdate = newState)) - : (current = current.next = isHiddenUpdate), - (lastBaseUpdate |= updateLane); - pendingQueue = pendingQueue.next; - if (null === pendingQueue) - if (((pendingQueue = queue.shared.pending), null === pendingQueue)) - break; - else - (isHiddenUpdate = pendingQueue), - (pendingQueue = isHiddenUpdate.next), - (isHiddenUpdate.next = null), - (queue.lastBaseUpdate = isHiddenUpdate), - (queue.shared.pending = null); - } while (1); - null === current && (lastPendingUpdate = newState); - queue.baseState = lastPendingUpdate; - queue.firstBaseUpdate = firstPendingUpdate; - queue.lastBaseUpdate = current; - null === firstBaseUpdate && (queue.shared.lanes = 0); - workInProgressRootSkippedLanes |= lastBaseUpdate; - workInProgress$jscomp$0.lanes = lastBaseUpdate; - workInProgress$jscomp$0.memoizedState = newState; + workInProgress = workInProgress.child; + } + return workInProgress; + case 26: + return ( + markRef(current, workInProgress), + null === current + ? (renderLanes = getResource( + workInProgress.type, + null, + workInProgress.pendingProps, + null + )) + ? (workInProgress.memoizedState = renderLanes) + : isHydrating || + ((renderLanes = workInProgress.type), + (current = workInProgress.pendingProps), + (lazyComponent = getOwnerDocumentFromRootContainer( + rootInstanceStackCursor.current + ).createElement(renderLanes)), + (lazyComponent[internalInstanceKey] = workInProgress), + (lazyComponent[internalPropsKey] = current), + setInitialProperties(lazyComponent, renderLanes, current), + markNodeAsHoistable(lazyComponent), + (workInProgress.stateNode = lazyComponent)) + : (workInProgress.memoizedState = getResource( + workInProgress.type, + current.memoizedProps, + workInProgress.pendingProps, + current.memoizedState + )), + null + ); + case 27: + return ( + pushHostContext(workInProgress), + null === current && + isHydrating && + ((lazyComponent = workInProgress.stateNode = + resolveSingletonInstance( + workInProgress.type, + workInProgress.pendingProps, + rootInstanceStackCursor.current + )), + (hydrationParentFiber = workInProgress), + (rootOrSingletonContext = !0), + (nextHydratableInstance = getNextHydratable( + lazyComponent.firstChild + ))), + (lazyComponent = workInProgress.pendingProps.children), + null !== current || isHydrating + ? reconcileChildren( + current, + workInProgress, + lazyComponent, + renderLanes + ) + : (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + lazyComponent, + renderLanes + )), + markRef(current, workInProgress), + workInProgress.child + ); + case 5: + if (null === current && isHydrating) { + if ((init = lazyComponent = nextHydratableInstance)) + (lazyComponent = canHydrateInstance( + lazyComponent, + workInProgress.type, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== lazyComponent + ? ((workInProgress.stateNode = lazyComponent), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = getNextHydratable( + lazyComponent.firstChild + )), + (rootOrSingletonContext = !1), + (init = !0)) + : (init = !1); + init || throwOnHydrationMismatch(workInProgress); + } + pushHostContext(workInProgress); + init = workInProgress.type; + nextProps = workInProgress.pendingProps; + nextState = null !== current ? current.memoizedProps : null; + lazyComponent = nextProps.children; + shouldSetTextContent(init, nextProps) + ? (lazyComponent = null) + : null !== nextState && + shouldSetTextContent(init, nextState) && + (workInProgress.flags |= 32); + null !== workInProgress.memoizedState && + ((init = renderWithHooks( + current, + workInProgress, + TransitionAwareHostComponent, + null, + null, + renderLanes + )), + (HostTransitionContext._currentValue = init)); + markRef(current, workInProgress); + reconcileChildren(current, workInProgress, lazyComponent, renderLanes); + return workInProgress.child; + case 6: + if (null === current && isHydrating) { + if ((current = renderLanes = nextHydratableInstance)) + (renderLanes = canHydrateTextInstance( + renderLanes, + workInProgress.pendingProps, + rootOrSingletonContext + )), + null !== renderLanes + ? ((workInProgress.stateNode = renderLanes), + (hydrationParentFiber = workInProgress), + (nextHydratableInstance = null), + (current = !0)) + : (current = !1); + current || throwOnHydrationMismatch(workInProgress); + } + return null; + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + case 4: + return ( + pushHostContainer( + workInProgress, + workInProgress.stateNode.containerInfo + ), + (lazyComponent = workInProgress.pendingProps), + null === current + ? (workInProgress.child = reconcileChildFibers( + workInProgress, + null, + lazyComponent, + renderLanes + )) + : reconcileChildren( + current, + workInProgress, + lazyComponent, + renderLanes + ), + workInProgress.child + ); + case 11: + return updateForwardRef( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 7: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps, + renderLanes + ), + workInProgress.child + ); + case 8: + return ( + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 12: + return ( + (workInProgress.flags |= 4), + (workInProgress.flags |= 2048), + (lazyComponent = workInProgress.stateNode), + (lazyComponent.effectDuration = -0), + (lazyComponent.passiveEffectDuration = -0), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 10: + return ( + (lazyComponent = workInProgress.pendingProps), + pushProvider(workInProgress, workInProgress.type, lazyComponent.value), + reconcileChildren( + current, + workInProgress, + lazyComponent.children, + renderLanes + ), + workInProgress.child + ); + case 9: + return ( + (init = workInProgress.type._context), + (lazyComponent = workInProgress.pendingProps.children), + prepareToReadContext(workInProgress), + (init = readContext(init)), + (lazyComponent = lazyComponent(init)), + (workInProgress.flags |= 1), + reconcileChildren(current, workInProgress, lazyComponent, renderLanes), + workInProgress.child + ); + case 14: + return updateMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 15: + return updateSimpleMemoComponent( + current, + workInProgress, + workInProgress.type, + workInProgress.pendingProps, + renderLanes + ); + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + case 24: + return ( + prepareToReadContext(workInProgress), + (lazyComponent = readContext(CacheContext)), + null === current + ? ((init = peekCacheFromPool()), + null === init && + ((init = workInProgressRoot), + (nextProps = createCache()), + (init.pooledCache = nextProps), + nextProps.refCount++, + null !== nextProps && (init.pooledCacheLanes |= renderLanes), + (init = nextProps)), + (workInProgress.memoizedState = { + parent: lazyComponent, + cache: init + }), + initializeUpdateQueue(workInProgress), + pushProvider(workInProgress, CacheContext, init)) + : (0 !== (current.lanes & renderLanes) && + (cloneUpdateQueue(current, workInProgress), + processUpdateQueue(workInProgress, null, null, renderLanes), + suspendIfUpdateReadFromEntangledAsyncAction()), + (init = current.memoizedState), + (nextProps = workInProgress.memoizedState), + init.parent !== lazyComponent + ? ((init = { parent: lazyComponent, cache: lazyComponent }), + (workInProgress.memoizedState = init), + 0 === workInProgress.lanes && + (workInProgress.memoizedState = + workInProgress.updateQueue.baseState = + init), + pushProvider(workInProgress, CacheContext, lazyComponent)) + : ((lazyComponent = nextProps.cache), + pushProvider(workInProgress, CacheContext, lazyComponent), + lazyComponent !== init.cache && + propagateContextChanges( + workInProgress, + [CacheContext], + renderLanes, + !0 + ))), + reconcileChildren( + current, + workInProgress, + workInProgress.pendingProps.children, + renderLanes + ), + workInProgress.child + ); + case 29: + throw workInProgress.pendingProps; } -} -function callCallback(callback, context) { - if ("function" !== typeof callback) - throw Error(formatProdErrorMessage(191, callback)); - callback.call(context); -} -function commitCallbacks(updateQueue, context) { - var callbacks = updateQueue.callbacks; - if (null !== callbacks) - for ( - updateQueue.callbacks = null, updateQueue = 0; - updateQueue < callbacks.length; - updateQueue++ - ) - callCallback(callbacks[updateQueue], context); + throw Error(formatProdErrorMessage(156, workInProgress.tag)); } function shouldProfile(current) { return 0 !== (current.mode & 2); @@ -8360,205 +8215,34 @@ function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { (before.onclick = noop$2)); else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) for ( - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNodeIntoContainer(node, before, parent), - (node = node.sibling); -} -function insertOrAppendPlacementNode(node, before, parent) { - var tag = node.tag; - if (5 === tag || 6 === tag) - (node = node.stateNode), - before ? parent.insertBefore(node, before) : parent.appendChild(node); - else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) - for ( - insertOrAppendPlacementNode(node, before, parent), node = node.sibling; - null !== node; - - ) - insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); -} -var offscreenSubtreeIsHidden = !1, - offscreenSubtreeWasHidden = !1, - needsFormReset = !1, - PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, - nextEffect = null, - inProgressLanes = null, - inProgressRoot = null, - shouldFireAfterActiveInstanceBlur = !1; -function commitBeforeMutationEffects(root, firstChild) { - root = root.containerInfo; - eventsEnabled = _enabled; - root = getActiveElementDeep(root); - if (hasSelectionCapabilities(root)) { - if ("selectionStart" in root) - var JSCompiler_temp = { - start: root.selectionStart, - end: root.selectionEnd - }; - else - a: { - JSCompiler_temp = - ((JSCompiler_temp = root.ownerDocument) && - JSCompiler_temp.defaultView) || - window; - var selection = - JSCompiler_temp.getSelection && JSCompiler_temp.getSelection(); - if (selection && 0 !== selection.rangeCount) { - JSCompiler_temp = selection.anchorNode; - var anchorOffset = selection.anchorOffset, - focusNode = selection.focusNode; - selection = selection.focusOffset; - try { - JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$22) { - JSCompiler_temp = null; - break a; - } - var length = 0, - start = -1, - end = -1, - indexWithinAnchor = 0, - indexWithinFocus = 0, - node = root, - parentNode = null; - b: for (;;) { - for (var next; ; ) { - node !== JSCompiler_temp || - (0 !== anchorOffset && 3 !== node.nodeType) || - (start = length + anchorOffset); - node !== focusNode || - (0 !== selection && 3 !== node.nodeType) || - (end = length + selection); - 3 === node.nodeType && (length += node.nodeValue.length); - if (null === (next = node.firstChild)) break; - parentNode = node; - node = next; - } - for (;;) { - if (node === root) break b; - parentNode === JSCompiler_temp && - ++indexWithinAnchor === anchorOffset && - (start = length); - parentNode === focusNode && - ++indexWithinFocus === selection && - (end = length); - if (null !== (next = node.nextSibling)) break; - node = parentNode; - parentNode = node.parentNode; - } - node = next; - } - JSCompiler_temp = - -1 === start || -1 === end ? null : { start: start, end: end }; - } else JSCompiler_temp = null; - } - JSCompiler_temp = JSCompiler_temp || { start: 0, end: 0 }; - } else JSCompiler_temp = null; - selectionInformation = { focusedElem: root, selectionRange: JSCompiler_temp }; - _enabled = !1; - for (nextEffect = firstChild; null !== nextEffect; ) - if ( - ((firstChild = nextEffect), - (root = firstChild.child), - 0 !== (firstChild.subtreeFlags & 1028) && null !== root) - ) - (root.return = firstChild), (nextEffect = root); - else - for (; null !== nextEffect; ) { - firstChild = nextEffect; - focusNode = firstChild.alternate; - root = firstChild.flags; - switch (firstChild.tag) { - case 0: - if ( - 0 !== (root & 4) && - ((root = firstChild.updateQueue), - (root = null !== root ? root.events : null), - null !== root) - ) - for ( - JSCompiler_temp = 0; - JSCompiler_temp < root.length; - JSCompiler_temp++ - ) - (anchorOffset = root[JSCompiler_temp]), - (anchorOffset.ref.impl = anchorOffset.nextImpl); - break; - case 11: - case 15: - break; - case 1: - if (0 !== (root & 1024) && null !== focusNode) { - root = void 0; - JSCompiler_temp = firstChild; - anchorOffset = focusNode.memoizedProps; - focusNode = focusNode.memoizedState; - selection = JSCompiler_temp.stateNode; - try { - var resolvedPrevProps = resolveClassComponentProps( - JSCompiler_temp.type, - anchorOffset, - JSCompiler_temp.elementType === JSCompiler_temp.type - ); - root = selection.getSnapshotBeforeUpdate( - resolvedPrevProps, - focusNode - ); - selection.__reactInternalSnapshotBeforeUpdate = root; - } catch (error) { - captureCommitPhaseError( - JSCompiler_temp, - JSCompiler_temp.return, - error - ); - } - } - break; - case 3: - if (0 !== (root & 1024)) - if ( - ((root = firstChild.stateNode.containerInfo), - (JSCompiler_temp = root.nodeType), - 9 === JSCompiler_temp) - ) - clearContainerSparingly(root); - else if (1 === JSCompiler_temp) - switch (root.nodeName) { - case "HEAD": - case "HTML": - case "BODY": - clearContainerSparingly(root); - break; - default: - root.textContent = ""; - } - break; - case 5: - case 26: - case 27: - case 6: - case 4: - case 17: - break; - default: - if (0 !== (root & 1024)) throw Error(formatProdErrorMessage(163)); - } - root = firstChild.sibling; - if (null !== root) { - root.return = firstChild.return; - nextEffect = root; - break; - } - nextEffect = firstChild.return; - } - resolvedPrevProps = shouldFireAfterActiveInstanceBlur; - shouldFireAfterActiveInstanceBlur = !1; - return resolvedPrevProps; + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNodeIntoContainer(node, before, parent), + (node = node.sibling); +} +function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) + (node = node.stateNode), + before ? parent.insertBefore(node, before) : parent.appendChild(node); + else if (4 !== tag && 27 !== tag && ((node = node.child), null !== node)) + for ( + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + null !== node; + + ) + insertOrAppendPlacementNode(node, before, parent), (node = node.sibling); } +var offscreenSubtreeIsHidden = !1, + offscreenSubtreeWasHidden = !1, + needsFormReset = !1, + PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null, + inProgressLanes = null, + inProgressRoot = null; function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { var prevEffectStart = pushComponentEffectStart(), flags = finishedWork.flags; @@ -8979,13 +8663,6 @@ function attachSuspenseRetryListeners(finishedWork, wakeables) { } }); } -function commitMutationEffects(root, finishedWork, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitMutationEffectsOnFiber(finishedWork, root); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) { var deletions = parentFiber.deletions; if (null !== deletions) @@ -9515,13 +9192,6 @@ function recursivelyResetForms(parentFiber) { parentFiber = parentFiber.sibling; } } -function commitLayoutEffects(finishedWork, root, committedLanes) { - inProgressLanes = committedLanes; - inProgressRoot = root; - resetComponentEffectTimers(); - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); - inProgressRoot = inProgressLanes = null; -} function recursivelyTraverseLayoutEffects(root, parentFiber) { if (parentFiber.subtreeFlags & 8772) for (parentFiber = parentFiber.child; null !== parentFiber; ) @@ -9530,7 +9200,8 @@ function recursivelyTraverseLayoutEffects(root, parentFiber) { } function recursivelyTraverseDisappearLayoutEffects(parentFiber) { for (parentFiber = parentFiber.child; null !== parentFiber; ) { - var finishedWork = parentFiber; + var finishedWork = parentFiber, + prevEffectStart = pushComponentEffectStart(); switch (finishedWork.tag) { case 0: case 11: @@ -9564,6 +9235,17 @@ function recursivelyTraverseDisappearLayoutEffects(parentFiber) { default: recursivelyTraverseDisappearLayoutEffects(finishedWork); } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); parentFiber = parentFiber.sibling; } } @@ -9578,6 +9260,7 @@ function recursivelyTraverseReappearLayoutEffects( var current = parentFiber.alternate, finishedRoot = finishedRoot$jscomp$0, finishedWork = parentFiber, + prevEffectStart = pushComponentEffectStart(), flags = finishedWork.flags; switch (finishedWork.tag) { case 0: @@ -9688,6 +9371,17 @@ function recursivelyTraverseReappearLayoutEffects( includeWorkInProgressEffects ); } + 0 !== (finishedWork.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + finishedWork, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); parentFiber = parentFiber.sibling; } } @@ -9738,6 +9432,7 @@ function recursivelyTraversePassiveMountEffects( parentFiber = nextSibling; } } +var inHydratedSubtree = !1; function commitPassiveMountOnFiber( finishedRoot, finishedWork, @@ -9746,39 +9441,16 @@ function commitPassiveMountOnFiber( endTime ) { var prevEffectStart = pushComponentEffectStart(); - if ( - 0 !== (finishedWork.mode & 2) && + 0 !== (finishedWork.mode & 2) && 0 < finishedWork.actualStartTime && - 0 !== (finishedWork.flags & 1) - ) { - var startTime = finishedWork.actualStartTime, - name = getComponentNameFromFiber(finishedWork); - if (null !== name && supportsUserTiming) { - var selfTime = finishedWork.actualDuration; - if ( - null === finishedWork.alternate || - finishedWork.alternate.child !== finishedWork.child - ) - for ( - var child = finishedWork.child; - null !== child; - child = child.sibling - ) - selfTime -= child.actualDuration; - reusableComponentDevToolDetails.color = - 0.5 > selfTime - ? "primary-light" - : 10 > selfTime - ? "primary" - : 100 > selfTime - ? "primary-dark" - : "error"; - reusableComponentOptions.start = startTime; - reusableComponentOptions.end = endTime; - performance.measure(name, reusableComponentOptions); - } - } - startTime = finishedWork.flags; + 0 !== (finishedWork.flags & 1) && + logComponentRender( + finishedWork, + finishedWork.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = finishedWork.flags; switch (finishedWork.tag) { case 0: case 11: @@ -9790,10 +9462,15 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ); - startTime & 2048 && commitHookPassiveMountEffects(finishedWork, 9); + flags & 2048 && commitHookPassiveMountEffects(finishedWork, 9); break; case 3: - var prevEffectDuration = pushNestedEffectDurations(); + var prevEffectDuration = pushNestedEffectDurations(), + wasInHydratedSubtree = inHydratedSubtree; + inHydratedSubtree = + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 === (finishedWork.flags & 256); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -9801,7 +9478,8 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ); - startTime & 2048 && + inHydratedSubtree = wasInHydratedSubtree; + flags & 2048 && ((committedLanes = null), null !== finishedWork.alternate && (committedLanes = finishedWork.alternate.memoizedState.cache), @@ -9813,8 +9491,8 @@ function commitPassiveMountOnFiber( popNestedEffectDurations(prevEffectDuration); break; case 12: - if (startTime & 2048) { - startTime = pushNestedEffectDurations(); + if (flags & 2048) { + flags = pushNestedEffectDurations(); recursivelyTraversePassiveMountEffects( finishedRoot, finishedWork, @@ -9824,16 +9502,16 @@ function commitPassiveMountOnFiber( ); finishedRoot = finishedWork.stateNode; finishedRoot.passiveEffectDuration += - bubbleNestedEffectDurations(startTime); + bubbleNestedEffectDurations(flags); try { prevEffectDuration = finishedWork.memoizedProps; - var id = prevEffectDuration.id, - onPostCommit = prevEffectDuration.onPostCommit, + wasInHydratedSubtree = prevEffectDuration.id; + var onPostCommit = prevEffectDuration.onPostCommit, phase = null === finishedWork.alternate ? "mount" : "update"; currentUpdateIsNested && (phase = "nested-update"); "function" === typeof onPostCommit && onPostCommit( - id, + wasInHydratedSubtree, phase, finishedRoot.passiveEffectDuration, commitStartTime @@ -9850,6 +9528,48 @@ function commitPassiveMountOnFiber( endTime ); break; + case 13: + flags = inHydratedSubtree; + prevEffectDuration = + null !== finishedWork.alternate + ? finishedWork.alternate.memoizedState + : null; + wasInHydratedSubtree = finishedWork.memoizedState; + null === prevEffectDuration || + null === prevEffectDuration.dehydrated || + (null !== wasInHydratedSubtree && + null !== wasInHydratedSubtree.dehydrated) + ? (inHydratedSubtree = !1) + : ((wasInHydratedSubtree = finishedWork.deletions), + null !== wasInHydratedSubtree && + 0 < wasInHydratedSubtree.length && + 18 === wasInHydratedSubtree[0].tag + ? ((inHydratedSubtree = !1), + null !== prevEffectDuration.hydrationErrors && + ((prevEffectDuration = finishedWork.actualStartTime), + supportsUserTiming && + performance.measure("Suspense", { + start: prevEffectDuration, + end: endTime, + detail: { + devtools: { + color: "error", + track: "Components \u269b", + tooltipText: "Hydration failed", + properties: [] + } + } + }))) + : (inHydratedSubtree = !0)); + recursivelyTraversePassiveMountEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ); + inHydratedSubtree = flags; + break; case 23: break; case 22: @@ -9863,7 +9583,13 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ) - : recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork) + : recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + finishedWork, + committedLanes, + committedTransitions, + endTime + ) : prevEffectDuration._visibility & 4 ? recursivelyTraversePassiveMountEffects( finishedRoot, @@ -9878,9 +9604,10 @@ function commitPassiveMountOnFiber( finishedWork, committedLanes, committedTransitions, - 0 !== (finishedWork.subtreeFlags & 10256) + 0 !== (finishedWork.subtreeFlags & 10256), + endTime )); - startTime & 2048 && + flags & 2048 && commitOffscreenPassiveMountEffects( finishedWork.alternate, finishedWork @@ -9894,7 +9621,7 @@ function commitPassiveMountOnFiber( committedTransitions, endTime ); - startTime & 2048 && + flags & 2048 && commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); break; default: @@ -9923,112 +9650,171 @@ function recursivelyTraverseReconnectPassiveEffects( parentFiber, committedLanes$jscomp$0, committedTransitions$jscomp$0, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime$jscomp$0 ) { includeWorkInProgressEffects = includeWorkInProgressEffects && 0 !== (parentFiber.subtreeFlags & 10256); - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, committedLanes = committedLanes$jscomp$0, committedTransitions = committedTransitions$jscomp$0, - flags = finishedWork.flags; - switch (finishedWork.tag) { + endTime = + null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0, + prevEffectStart = pushComponentEffectStart(); + 0 !== (child.mode & 2) && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender( + child, + child.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = child.flags; + switch (child.tag) { case 0: case 11: case 15: recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); - commitHookPassiveMountEffects(finishedWork, 8); + commitHookPassiveMountEffects(child, 8); break; case 23: break; case 22: - var instance = finishedWork.stateNode; - null !== finishedWork.memoizedState + var instance = child.stateNode; + null !== child.memoizedState ? instance._visibility & 4 ? recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ) : recursivelyTraverseAtomicPassiveEffects( finishedRoot, - finishedWork + child, + committedLanes, + committedTransitions, + endTime ) : ((instance._visibility |= 4), recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime )); includeWorkInProgressEffects && flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); includeWorkInProgressEffects && flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + commitCachePassiveMountEffect(child.alternate, child); break; default: recursivelyTraverseReconnectPassiveEffects( finishedRoot, - finishedWork, + child, committedLanes, committedTransitions, - includeWorkInProgressEffects + includeWorkInProgressEffects, + endTime ); } - parentFiber = parentFiber.sibling; + 0 !== (child.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + child, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); + child = parentFiber; } } function recursivelyTraverseAtomicPassiveEffects( finishedRoot$jscomp$0, - parentFiber + parentFiber, + committedLanes$jscomp$0, + committedTransitions$jscomp$0, + endTime$jscomp$0 ) { if (parentFiber.subtreeFlags & 10256) - for (parentFiber = parentFiber.child; null !== parentFiber; ) { + for (var child = parentFiber.child; null !== child; ) { + parentFiber = child.sibling; var finishedRoot = finishedRoot$jscomp$0, - finishedWork = parentFiber, - flags = finishedWork.flags; - switch (finishedWork.tag) { + committedLanes = committedLanes$jscomp$0, + committedTransitions = committedTransitions$jscomp$0, + endTime = + null !== parentFiber ? parentFiber.actualStartTime : endTime$jscomp$0; + 0 !== (child.mode & 2) && + 0 < child.actualStartTime && + 0 !== (child.flags & 1) && + logComponentRender( + child, + child.actualStartTime, + endTime, + inHydratedSubtree + ); + var flags = child.flags; + switch (child.tag) { case 22: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); flags & 2048 && - commitOffscreenPassiveMountEffects( - finishedWork.alternate, - finishedWork - ); + commitOffscreenPassiveMountEffects(child.alternate, child); break; case 24: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); - flags & 2048 && - commitCachePassiveMountEffect(finishedWork.alternate, finishedWork); + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); + flags & 2048 && commitCachePassiveMountEffect(child.alternate, child); break; default: - recursivelyTraverseAtomicPassiveEffects(finishedRoot, finishedWork); + recursivelyTraverseAtomicPassiveEffects( + finishedRoot, + child, + committedLanes, + committedTransitions, + endTime + ); } - parentFiber = parentFiber.sibling; + child = parentFiber; } } var suspenseyCommitFlag = 8192; @@ -10191,10 +9977,12 @@ function recursivelyTraverseDisconnectPassiveEffects(parentFiber) { } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( deletedSubtreeRoot, - nearestMountedAncestor + nearestMountedAncestor$jscomp$0 ) { for (; null !== nextEffect; ) { - var fiber = nextEffect; + var fiber = nextEffect, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0, + prevEffectStart = pushComponentEffectStart(); switch (fiber.tag) { case 0: case 11: @@ -10203,32 +9991,41 @@ function commitPassiveUnmountEffectsInsideOfDeletedTree_begin( break; case 23: case 22: - if ( - null !== fiber.memoizedState && - null !== fiber.memoizedState.cachePool - ) { - var cache = fiber.memoizedState.cachePool.pool; - null != cache && cache.refCount++; - } + null !== fiber.memoizedState && + null !== fiber.memoizedState.cachePool && + ((nearestMountedAncestor = fiber.memoizedState.cachePool.pool), + null != nearestMountedAncestor && nearestMountedAncestor.refCount++); break; case 24: releaseCache(fiber.memoizedState.cache); } - cache = fiber.child; - if (null !== cache) (cache.return = fiber), (nextEffect = cache); + 0 !== (fiber.mode & 2) && + 0 <= componentEffectStartTime && + 0 <= componentEffectEndTime && + 0.05 < componentEffectDuration && + logComponentEffect( + fiber, + componentEffectStartTime, + componentEffectEndTime, + componentEffectDuration + ); + popComponentEffectStart(prevEffectStart); + prevEffectStart = fiber.child; + if (null !== prevEffectStart) + (prevEffectStart.return = fiber), (nextEffect = prevEffectStart); else a: for (fiber = deletedSubtreeRoot; null !== nextEffect; ) { - cache = nextEffect; - var sibling = cache.sibling, - returnFiber = cache.return; - detachFiberAfterEffects(cache); - if (cache === fiber) { + prevEffectStart = nextEffect; + nearestMountedAncestor = prevEffectStart.sibling; + var returnFiber = prevEffectStart.return; + detachFiberAfterEffects(prevEffectStart); + if (prevEffectStart === fiber) { nextEffect = null; break a; } - if (null !== sibling) { - sibling.return = returnFiber; - nextEffect = sibling; + if (null !== nearestMountedAncestor) { + nearestMountedAncestor.return = returnFiber; + nextEffect = nearestMountedAncestor; break a; } nextEffect = returnFiber; @@ -10540,14 +10337,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$146 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$146 = lastTailNode), + for (var lastTailNode$149 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$149 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$146 + null === lastTailNode$149 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$146.sibling = null); + : (lastTailNode$149.sibling = null); } } function bubbleProperties(completedWork) { @@ -10559,53 +10356,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$148 = completedWork.selfBaseDuration, - child$149 = completedWork.child; - null !== child$149; + var treeBaseDuration$151 = completedWork.selfBaseDuration, + child$152 = completedWork.child; + null !== child$152; ) - (newChildLanes |= child$149.lanes | child$149.childLanes), - (subtreeFlags |= child$149.subtreeFlags & 31457280), - (subtreeFlags |= child$149.flags & 31457280), - (treeBaseDuration$148 += child$149.treeBaseDuration), - (child$149 = child$149.sibling); - completedWork.treeBaseDuration = treeBaseDuration$148; + (newChildLanes |= child$152.lanes | child$152.childLanes), + (subtreeFlags |= child$152.subtreeFlags & 31457280), + (subtreeFlags |= child$152.flags & 31457280), + (treeBaseDuration$151 += child$152.treeBaseDuration), + (child$152 = child$152.sibling); + completedWork.treeBaseDuration = treeBaseDuration$151; } else for ( - treeBaseDuration$148 = completedWork.child; - null !== treeBaseDuration$148; + treeBaseDuration$151 = completedWork.child; + null !== treeBaseDuration$151; ) (newChildLanes |= - treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes), - (subtreeFlags |= treeBaseDuration$148.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$148.flags & 31457280), - (treeBaseDuration$148.return = completedWork), - (treeBaseDuration$148 = treeBaseDuration$148.sibling); + treeBaseDuration$151.lanes | treeBaseDuration$151.childLanes), + (subtreeFlags |= treeBaseDuration$151.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$151.flags & 31457280), + (treeBaseDuration$151.return = completedWork), + (treeBaseDuration$151 = treeBaseDuration$151.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$148 = completedWork.actualDuration; - child$149 = completedWork.selfBaseDuration; + treeBaseDuration$151 = completedWork.actualDuration; + child$152 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$148 += child.actualDuration), - (child$149 += child.treeBaseDuration), + (treeBaseDuration$151 += child.actualDuration), + (child$152 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$148; - completedWork.treeBaseDuration = child$149; + completedWork.actualDuration = treeBaseDuration$151; + completedWork.treeBaseDuration = child$152; } else for ( - treeBaseDuration$148 = completedWork.child; - null !== treeBaseDuration$148; + treeBaseDuration$151 = completedWork.child; + null !== treeBaseDuration$151; ) (newChildLanes |= - treeBaseDuration$148.lanes | treeBaseDuration$148.childLanes), - (subtreeFlags |= treeBaseDuration$148.subtreeFlags), - (subtreeFlags |= treeBaseDuration$148.flags), - (treeBaseDuration$148.return = completedWork), - (treeBaseDuration$148 = treeBaseDuration$148.sibling); + treeBaseDuration$151.lanes | treeBaseDuration$151.childLanes), + (subtreeFlags |= treeBaseDuration$151.subtreeFlags), + (subtreeFlags |= treeBaseDuration$151.flags), + (treeBaseDuration$151.return = completedWork), + (treeBaseDuration$151 = treeBaseDuration$151.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10644,9 +10441,7 @@ function completeWork(current, workInProgress, renderLanes) { (current.memoizedState.isDehydrated && 0 === (workInProgress.flags & 256)) || ((workInProgress.flags |= 1024), - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), - (hydrationErrors = null))); + upgradeHydrationErrorsToRecoverable()); bubbleProperties(workInProgress); return null; case 26: @@ -10871,8 +10666,10 @@ function completeWork(current, workInProgress, renderLanes) { (workInProgress.treeBaseDuration -= type.treeBaseDuration)); type = !1; } else - null !== hydrationErrors && - (queueRecoverableErrors(hydrationErrors), (hydrationErrors = null)), + (type = upgradeHydrationErrorsToRecoverable()), + null !== current && + null !== current.memoizedState && + (current.memoizedState.hydrationErrors = type), (type = !0); if (!type) { if (workInProgress.flags & 256) @@ -10898,11 +10695,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$164 = null; + var cache$168 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$164 = newProps.memoizedState.cachePool.pool); - cache$164 !== type && (newProps.flags |= 2048); + (cache$168 = newProps.memoizedState.cachePool.pool); + cache$168 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10932,8 +10729,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$164 = type.rendering; - if (null === cache$164) + cache$168 = type.rendering; + if (null === cache$168) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10941,11 +10738,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$164 = findFirstSuspended(current); - if (null !== cache$164) { + cache$168 = findFirstSuspended(current); + if (null !== cache$168) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$164.updateQueue; + current = cache$168.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10970,7 +10767,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$164)), null !== current)) { + if (((current = findFirstSuspended(cache$168)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10980,7 +10777,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$164.alternate && + !cache$168.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10993,13 +10790,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$164.sibling = workInProgress.child), - (workInProgress.child = cache$164)) + ? ((cache$168.sibling = workInProgress.child), + (workInProgress.child = cache$168)) : ((current = type.last), null !== current - ? (current.sibling = cache$164) - : (workInProgress.child = cache$164), - (type.last = cache$164)); + ? (current.sibling = cache$168) + : (workInProgress.child = cache$168), + (type.last = cache$168)); } if (null !== type.tail) return ( @@ -11198,7 +10995,6 @@ var DefaultAsyncDispatcher = { workInProgressRootRenderTargetTime = Infinity, workInProgressTransitions = null, legacyErrorBoundariesThatAlreadyFailed = null, - rootDoesHavePassiveEffects = !1, rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, @@ -11254,7 +11050,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { )), ensureRootIsScheduled(root); } -function performWorkOnRoot(root, lanes, forceSync) { +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); if (0 !== workInProgressRootRenderLanes && null !== workInProgress) { var yieldEndTime = now$1(); @@ -11295,23 +11091,25 @@ function performWorkOnRoot(root, lanes, forceSync) { } } var exitStatus = (yieldEndTime = - (!forceSync && 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes)) || - checkIfRootIsPrerendering(root, lanes)) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes, !0); + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + checkIfRootIsPrerendering(root$jscomp$0, lanes)) + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); yieldDuration = yieldEndTime; do { if (0 === exitStatus) { workInProgressRootIsPrerendering && !yieldEndTime && - markRootSuspended(root, lanes, 0, !1); + markRootSuspended(root$jscomp$0, lanes, 0, !1); lanes = workInProgressSuspendedReason; yieldStartTime = now(); yieldReason = lanes; break; } else { startTime = now$1(); - forceSync = root.current.alternate; + forceSync = root$jscomp$0.current.alternate; if (yieldDuration && !isRenderConsistentWithExternalStores(forceSync)) { setCurrentTrackFromLanes(lanes); forceSync = renderStartTime; @@ -11322,16 +11120,16 @@ function performWorkOnRoot(root, lanes, forceSync) { (reusableLaneOptions.end = yieldDuration), performance.measure("Teared Render", reusableLaneOptions)); finalizeRender(lanes, startTime); - exitStatus = renderRootSync(root, lanes, !1); + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); yieldDuration = !1; continue; } if (2 === exitStatus) { yieldDuration = lanes; - if (root.errorRecoveryDisabledLanes & yieldDuration) + if (root$jscomp$0.errorRecoveryDisabledLanes & yieldDuration) var JSCompiler_inline_result = 0; else - (JSCompiler_inline_result = root.pendingLanes & -536870913), + (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), (JSCompiler_inline_result = 0 !== JSCompiler_inline_result ? JSCompiler_inline_result @@ -11343,35 +11141,27 @@ function performWorkOnRoot(root, lanes, forceSync) { logErroredRenderPhase(renderStartTime, startTime); finalizeRender(lanes, startTime); lanes = JSCompiler_inline_result; - a: { - exitStatus = root; - startTime = workInProgressRootConcurrentErrors; - var wasRootDehydrated = - exitStatus.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(exitStatus, JSCompiler_inline_result).flags |= - 256); - JSCompiler_inline_result = renderRootSync( - exitStatus, - JSCompiler_inline_result, - !1 - ); - if (2 !== JSCompiler_inline_result) { - if ( - workInProgressRootDidAttachPingListener && - !wasRootDehydrated - ) { - exitStatus.errorRecoveryDisabledLanes |= yieldDuration; - workInProgressRootInterleavedUpdatedLanes |= yieldDuration; - exitStatus = 4; - break a; - } - yieldDuration = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = startTime; - null !== yieldDuration && queueRecoverableErrors(yieldDuration); - } - exitStatus = JSCompiler_inline_result; - } + var root = root$jscomp$0; + startTime = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + exitStatus = renderRootSync(root, JSCompiler_inline_result, !1); + 2 !== exitStatus && + (workInProgressRootDidAttachPingListener && !wasRootDehydrated + ? ((root.errorRecoveryDisabledLanes |= yieldDuration), + (workInProgressRootInterleavedUpdatedLanes |= yieldDuration), + (exitStatus = 4)) + : ((yieldDuration = workInProgressRootRecoverableErrors), + (workInProgressRootRecoverableErrors = startTime), + null !== yieldDuration && + ((startTime = yieldDuration), + null === workInProgressRootRecoverableErrors + ? (workInProgressRootRecoverableErrors = startTime) + : workInProgressRootRecoverableErrors.push.apply( + workInProgressRootRecoverableErrors, + startTime + )))); yieldDuration = !1; if (2 !== exitStatus) continue; else startTime = now$1(); @@ -11381,12 +11171,12 @@ function performWorkOnRoot(root, lanes, forceSync) { setCurrentTrackFromLanes(lanes); logErroredRenderPhase(renderStartTime, startTime); finalizeRender(lanes, startTime); - prepareFreshStack(root, 0); - markRootSuspended(root, lanes, 0, !0); + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0, !0); break; } a: { - yieldEndTime = root; + yieldEndTime = root$jscomp$0; yieldDuration = exitStatus; switch (yieldDuration) { case 0: @@ -11396,7 +11186,7 @@ function performWorkOnRoot(root, lanes, forceSync) { if ((lanes & 4194176) !== lanes) break; case 6: setCurrentTrackFromLanes(lanes); - logSuspendedRenderPhase(renderStartTime, startTime); + logSuspendedRenderPhase(renderStartTime, startTime, lanes); finalizeRender(lanes, startTime); forceSync = lanes; 0 !== (forceSync & 3) || 0 !== (forceSync & 60) @@ -11475,15 +11265,7 @@ function performWorkOnRoot(root, lanes, forceSync) { } break; } while (1); - ensureRootIsScheduled(root); -} -function queueRecoverableErrors(errors) { - null === workInProgressRootRecoverableErrors - ? (workInProgressRootRecoverableErrors = errors) - : workInProgressRootRecoverableErrors.push.apply( - workInProgressRootRecoverableErrors, - errors - ); + ensureRootIsScheduled(root$jscomp$0); } function commitRootWhenReady( root, @@ -11608,7 +11390,7 @@ function resetWorkInProgressStack() { var interruptedWork = workInProgress.return; else (interruptedWork = workInProgress), - (lastContextDependency = currentlyRenderingFiber = null), + (lastContextDependency = currentlyRenderingFiber$1 = null), resetHooksOnUnwind(interruptedWork), (thenableState = null), (thenableIndexCounter = 0), @@ -11638,14 +11420,22 @@ function prepareFreshStack(root, lanes) { 3 === workInProgressRootExitStatus || 4 === workInProgressRootExitStatus ) - logSuspendedRenderPhase(previousRenderStartTime, renderStartTime); + logSuspendedRenderPhase(previousRenderStartTime, renderStartTime, lanes); else { var endTime = renderStartTime; supportsUserTiming && - ((reusableLaneDevToolDetails.color = "primary-dark"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = endTime), - performance.measure("Interrupted Render", reusableLaneOptions)); + performance.measure( + (lanes & 536870912) === lanes + ? "Prewarm" + : (lanes & 201326677) === lanes + ? "Interrupted Hydration" + : "Interrupted Render", + reusableLaneOptions + )); } finalizeRender(workInProgressRootRenderLanes, renderStartTime); } @@ -11666,7 +11456,8 @@ function prepareFreshStack(root, lanes) { ? endTime : 0 <= previousRenderStartTime ? previousRenderStartTime - : renderStartTime + : renderStartTime, + lanes )); var eventType = blockingEventType, eventIsRepeat = blockingEventIsRepeat, @@ -11688,7 +11479,8 @@ function prepareFreshStack(root, lanes) { reusableLaneOptions )), 0 < previousRenderStartTime && - ((reusableLaneDevToolDetails.color = "primary-light"), + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-light" : "primary-light"), (reusableLaneOptions.start = previousRenderStartTime), (reusableLaneOptions.end = renderStartTime$jscomp$0), performance.measure("Blocked", reusableLaneOptions))); @@ -11712,7 +11504,8 @@ function prepareFreshStack(root, lanes) { (setCurrentTrackFromLanes(lanes), logSuspendedWithDelayPhase( transitionSuspendedTime, - 0 <= eventType ? eventType : 0 <= endTime ? endTime : renderStartTime + 0 <= eventType ? eventType : 0 <= endTime ? endTime : renderStartTime, + lanes )); eventIsRepeat = transitionEventType; renderStartTime$jscomp$0 = transitionEventIsRepeat; @@ -11792,7 +11585,7 @@ function prepareFreshStack(root, lanes) { return previousRenderStartTime; } function handleThrow(root, thrownValue) { - currentlyRenderingFiber$1 = null; + currentlyRenderingFiber = null; ReactSharedInternals.H = ContextOnlyDispatcher; thrownValue === SuspenseException || thrownValue === SuspenseActionException ? ((thrownValue = getSuspendedThenable()), @@ -11906,12 +11699,12 @@ function renderRootSync(root, lanes, shouldYieldForPrerendering) { workLoopSync(); memoizedUpdaters = workInProgressRootExitStatus; break; - } catch (thrownValue$185) { - handleThrow(root, thrownValue$185); + } catch (thrownValue$189) { + handleThrow(root, thrownValue$189); } while (1); lanes && root.shellSuspendCounter++; - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; @@ -12028,11 +11821,11 @@ function renderRootConcurrent(root, lanes) { } workLoopConcurrent(); break; - } catch (thrownValue$187) { - handleThrow(root, thrownValue$187); + } catch (thrownValue$191) { + handleThrow(root, thrownValue$191); } while (1); - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; executionContext = prevExecutionContext; @@ -12104,7 +11897,7 @@ function throwAndUnwindWorkLoop( thrownValue, suspendedReason ) { - lastContextDependency = currentlyRenderingFiber = null; + lastContextDependency = currentlyRenderingFiber$1 = null; resetHooksOnUnwind(unitOfWork); thenableState = null; thenableIndexCounter = 0; @@ -12218,7 +12011,7 @@ function unwindUnitOfWork(unitOfWork, skipSiblings) { workInProgress = null; } function commitRoot( - root, + root$jscomp$0, recoverableErrors, transitions, didIncludeRenderPhaseUpdate, @@ -12233,146 +12026,499 @@ function commitRoot( var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; try { - (ReactDOMSharedInternals.p = 2), - (ReactSharedInternals.T = null), - commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - previousUpdateLanePriority, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime - ); + ReactDOMSharedInternals.p = 2; + ReactSharedInternals.T = null; + do flushPassiveEffects(); + while (null !== rootWithPendingPassiveEffects); + if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); + var finishedWork = root$jscomp$0.finishedWork, + lanes = root$jscomp$0.finishedLanes; + setCurrentTrackFromLanes(lanes); + 2 === exitStatus + ? logErroredRenderPhase(completedRenderStartTime, completedRenderEndTime) + : null !== recoverableErrors + ? supportsUserTiming && + performance.measure("Recovered", { + start: completedRenderStartTime, + end: completedRenderEndTime, + detail: { + devtools: { + color: "primary-dark", + track: reusableLaneDevToolDetails.track, + trackGroup: "Scheduler \u269b", + tooltipText: + null !== finishedWork && + null !== finishedWork.alternate && + finishedWork.alternate.memoizedState.isDehydrated && + 0 !== (finishedWork.flags & 256) + ? "Hydration Failed" + : "Recovered after Error", + properties: [] + } + } + }) + : supportsUserTiming && + ((reusableLaneDevToolDetails.color = + (lanes & 738197589) === lanes ? "tertiary-dark" : "primary-dark"), + (reusableLaneOptions.start = completedRenderStartTime), + (reusableLaneOptions.end = completedRenderEndTime), + performance.measure( + (lanes & 536870912) === lanes + ? "Prepared" + : (lanes & 201326677) === lanes + ? "Hydrated" + : "Render", + reusableLaneOptions + )); + if (null !== finishedWork) { + root$jscomp$0.finishedWork = null; + root$jscomp$0.finishedLanes = 0; + if (finishedWork === root$jscomp$0.current) + throw Error(formatProdErrorMessage(177)); + var remainingLanes = finishedWork.lanes | finishedWork.childLanes, + remainingLanes$jscomp$0 = (remainingLanes |= concurrentlyUpdatedLanes), + previouslyPendingLanes = root$jscomp$0.pendingLanes; + root$jscomp$0.pendingLanes = remainingLanes$jscomp$0; + root$jscomp$0.suspendedLanes = 0; + root$jscomp$0.pingedLanes = 0; + root$jscomp$0.warmLanes = 0; + root$jscomp$0.expiredLanes &= remainingLanes$jscomp$0; + root$jscomp$0.entangledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.errorRecoveryDisabledLanes &= remainingLanes$jscomp$0; + root$jscomp$0.shellSuspendCounter = 0; + for ( + var entanglements = root$jscomp$0.entanglements, + expirationTimes = root$jscomp$0.expirationTimes, + hiddenUpdates = root$jscomp$0.hiddenUpdates, + lanes$jscomp$0 = previouslyPendingLanes & ~remainingLanes$jscomp$0; + 0 < lanes$jscomp$0; + + ) { + var index$7 = 31 - clz32(lanes$jscomp$0), + lane = 1 << index$7; + entanglements[index$7] = 0; + expirationTimes[index$7] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$7]; + if (null !== hiddenUpdatesForLane) { + hiddenUpdates[index$7] = null; + for (var i = 0; i < hiddenUpdatesForLane.length; i++) { + var update = hiddenUpdatesForLane[i]; + null !== update && (update.lane &= -536870913); + } + } + lanes$jscomp$0 &= ~lane; + } + 0 !== spawnedLane && + markSpawnedDeferredLane(root$jscomp$0, spawnedLane, 0); + 0 !== suspendedRetryLanes && + 0 === updatedLanes && + 0 !== root$jscomp$0.tag && + (root$jscomp$0.suspendedLanes |= + suspendedRetryLanes & ~(previouslyPendingLanes & ~lanes)); + root$jscomp$0 === workInProgressRoot && + ((workInProgress = workInProgressRoot = null), + (workInProgressRootRenderLanes = 0)); + var rootDoesHavePassiveEffects = !1; + 0 !== finishedWork.actualDuration || + 0 !== (finishedWork.subtreeFlags & 10256) || + 0 !== (finishedWork.flags & 10256) + ? ((rootDoesHavePassiveEffects = !0), + (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), + (pendingPassiveTransitions = transitions)) + : ((root$jscomp$0.callbackNode = null), + (root$jscomp$0.callbackPriority = 0), + (root$jscomp$0.cancelPendingCommit = null)); + commitStartTime = now(); + if (1 === suspendedCommitReason) { + var endTime = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime), + performance.measure("Suspended", reusableLaneOptions)); + } else if (2 === suspendedCommitReason) { + var endTime$jscomp$0 = commitStartTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-light"), + (reusableLaneOptions.start = completedRenderEndTime), + (reusableLaneOptions.end = endTime$jscomp$0), + performance.measure("Throttled", reusableLaneOptions)); + } + var rootHasEffect = 0 !== (finishedWork.flags & 15990); + if (0 !== (finishedWork.subtreeFlags & 15990) || rootHasEffect) { + var prevTransition$jscomp$0 = ReactSharedInternals.T; + ReactSharedInternals.T = null; + var previousPriority = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + var containerInfo = root$jscomp$0.containerInfo; + eventsEnabled = _enabled; + var focusedElem = getActiveElementDeep(containerInfo); + if (hasSelectionCapabilities(focusedElem)) { + if ("selectionStart" in focusedElem) + var selection = { + start: focusedElem.selectionStart, + end: focusedElem.selectionEnd + }; + else + b: { + var ownerDocument = focusedElem.ownerDocument, + win = (ownerDocument && ownerDocument.defaultView) || window, + selection$jscomp$0 = win.getSelection && win.getSelection(); + if (selection$jscomp$0 && 0 !== selection$jscomp$0.rangeCount) { + var anchorNode = selection$jscomp$0.anchorNode, + anchorOffset = selection$jscomp$0.anchorOffset, + focusNode = selection$jscomp$0.focusNode, + focusOffset = selection$jscomp$0.focusOffset; + try { + anchorNode.nodeType, focusNode.nodeType; + } catch (e$22) { + selection = null; + break b; + } + var length = 0, + start = -1, + end = -1, + indexWithinAnchor = 0, + indexWithinFocus = 0, + node = focusedElem, + parentNode = null; + c: for (;;) { + for (var next; ; ) { + node !== anchorNode || + (0 !== anchorOffset && 3 !== node.nodeType) || + (start = length + anchorOffset); + node !== focusNode || + (0 !== focusOffset && 3 !== node.nodeType) || + (end = length + focusOffset); + 3 === node.nodeType && (length += node.nodeValue.length); + if (null === (next = node.firstChild)) break; + parentNode = node; + node = next; + } + for (;;) { + if (node === focusedElem) break c; + parentNode === anchorNode && + ++indexWithinAnchor === anchorOffset && + (start = length); + parentNode === focusNode && + ++indexWithinFocus === focusOffset && + (end = length); + if (null !== (next = node.nextSibling)) break; + node = parentNode; + parentNode = node.parentNode; + } + node = next; + } + selection = + -1 === start || -1 === end + ? null + : { start: start, end: end }; + } else selection = null; + } + var JSCompiler_temp = selection || { start: 0, end: 0 }; + } else JSCompiler_temp = null; + selectionInformation = { + focusedElem: focusedElem, + selectionRange: JSCompiler_temp + }; + _enabled = !1; + for (nextEffect = finishedWork; null !== nextEffect; ) { + var fiber = nextEffect, + child = fiber.child; + if (0 !== (fiber.subtreeFlags & 1028) && null !== child) + (child.return = fiber), (nextEffect = child); + else + b: for (; null !== nextEffect; ) { + var fiber$jscomp$0 = nextEffect, + snapshot = void 0, + finishedWork$jscomp$0 = fiber$jscomp$0, + current = finishedWork$jscomp$0.alternate, + flags = finishedWork$jscomp$0.flags; + switch (finishedWork$jscomp$0.tag) { + case 0: + if (0 !== (flags & 4)) { + var updateQueue = finishedWork$jscomp$0.updateQueue, + eventPayloads = + null !== updateQueue ? updateQueue.events : null; + if (null !== eventPayloads) + for (var ii = 0; ii < eventPayloads.length; ii++) { + var _eventPayloads$ii = eventPayloads[ii]; + _eventPayloads$ii.ref.impl = _eventPayloads$ii.nextImpl; + } + } + break; + case 11: + case 15: + break; + case 1: + if (0 !== (flags & 1024) && null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = finishedWork$jscomp$0.stateNode; + try { + var resolvedPrevProps = resolveClassComponentProps( + finishedWork$jscomp$0.type, + prevProps, + finishedWork$jscomp$0.elementType === + finishedWork$jscomp$0.type + ); + snapshot = instance.getSnapshotBeforeUpdate( + resolvedPrevProps, + prevState + ); + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } catch (error) { + captureCommitPhaseError( + finishedWork$jscomp$0, + finishedWork$jscomp$0.return, + error + ); + } + } + break; + case 3: + if (0 !== (flags & 1024)) + c: { + var container = + finishedWork$jscomp$0.stateNode.containerInfo, + nodeType = container.nodeType; + if (9 === nodeType) clearContainerSparingly(container); + else if (1 === nodeType) + switch (container.nodeName) { + case "HEAD": + case "HTML": + case "BODY": + clearContainerSparingly(container); + break c; + default: + container.textContent = ""; + } + } + break; + case 5: + case 26: + case 27: + case 6: + case 4: + case 17: + break; + default: + if (0 !== (flags & 1024)) + throw Error(formatProdErrorMessage(163)); + } + var sibling = fiber$jscomp$0.sibling; + if (null !== sibling) { + sibling.return = fiber$jscomp$0.return; + nextEffect = sibling; + break b; + } + nextEffect = fiber$jscomp$0.return; + } + } + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitMutationEffectsOnFiber(finishedWork, root$jscomp$0); + inProgressRoot = inProgressLanes = null; + var priorSelectionInformation = selectionInformation, + curFocusedElem = getActiveElementDeep(root$jscomp$0.containerInfo), + priorFocusedElem = priorSelectionInformation.focusedElem, + priorSelectionRange = priorSelectionInformation.selectionRange; + if ( + curFocusedElem !== priorFocusedElem && + priorFocusedElem && + priorFocusedElem.ownerDocument && + containsNode( + priorFocusedElem.ownerDocument.documentElement, + priorFocusedElem + ) + ) { + if ( + null !== priorSelectionRange && + hasSelectionCapabilities(priorFocusedElem) + ) { + var start$jscomp$0 = priorSelectionRange.start, + end$jscomp$0 = priorSelectionRange.end; + void 0 === end$jscomp$0 && (end$jscomp$0 = start$jscomp$0); + if ("selectionStart" in priorFocusedElem) + (priorFocusedElem.selectionStart = start$jscomp$0), + (priorFocusedElem.selectionEnd = Math.min( + end$jscomp$0, + priorFocusedElem.value.length + )); + else { + var doc = priorFocusedElem.ownerDocument || document, + win$jscomp$0 = (doc && doc.defaultView) || window; + if (win$jscomp$0.getSelection) { + var selection$jscomp$1 = win$jscomp$0.getSelection(), + length$jscomp$0 = priorFocusedElem.textContent.length, + start$jscomp$1 = Math.min( + priorSelectionRange.start, + length$jscomp$0 + ), + end$jscomp$1 = + void 0 === priorSelectionRange.end + ? start$jscomp$1 + : Math.min(priorSelectionRange.end, length$jscomp$0); + if ( + !selection$jscomp$1.extend && + start$jscomp$1 > end$jscomp$1 + ) { + var temp = end$jscomp$1; + end$jscomp$1 = start$jscomp$1; + start$jscomp$1 = temp; + } + var startMarker = getNodeForCharacterOffset( + priorFocusedElem, + start$jscomp$1 + ), + endMarker = getNodeForCharacterOffset( + priorFocusedElem, + end$jscomp$1 + ); + if ( + startMarker && + endMarker && + (1 !== selection$jscomp$1.rangeCount || + selection$jscomp$1.anchorNode !== startMarker.node || + selection$jscomp$1.anchorOffset !== startMarker.offset || + selection$jscomp$1.focusNode !== endMarker.node || + selection$jscomp$1.focusOffset !== endMarker.offset) + ) { + var range = doc.createRange(); + range.setStart(startMarker.node, startMarker.offset); + selection$jscomp$1.removeAllRanges(); + start$jscomp$1 > end$jscomp$1 + ? (selection$jscomp$1.addRange(range), + selection$jscomp$1.extend( + endMarker.node, + endMarker.offset + )) + : (range.setEnd(endMarker.node, endMarker.offset), + selection$jscomp$1.addRange(range)); + } + } + } + } + for ( + var ancestors = [], ancestor = priorFocusedElem; + (ancestor = ancestor.parentNode); + + ) + 1 === ancestor.nodeType && + ancestors.push({ + element: ancestor, + left: ancestor.scrollLeft, + top: ancestor.scrollTop + }); + "function" === typeof priorFocusedElem.focus && + priorFocusedElem.focus(); + for ( + var i$jscomp$0 = 0; + i$jscomp$0 < ancestors.length; + i$jscomp$0++ + ) { + var info = ancestors[i$jscomp$0]; + info.element.scrollLeft = info.left; + info.element.scrollTop = info.top; + } + } + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root$jscomp$0.current = finishedWork; + inProgressLanes = lanes; + inProgressRoot = root$jscomp$0; + resetComponentEffectTimers(); + commitLayoutEffectOnFiber( + root$jscomp$0, + finishedWork.alternate, + finishedWork + ); + inProgressRoot = inProgressLanes = null; + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = previousPriority; + ReactSharedInternals.T = prevTransition$jscomp$0; + } else root$jscomp$0.current = finishedWork; + commitEndTime = now(); + var startTime = + 0 === suspendedCommitReason + ? completedRenderEndTime + : commitStartTime, + endTime$jscomp$1 = commitEndTime; + supportsUserTiming && + ((reusableLaneDevToolDetails.color = "secondary-dark"), + (reusableLaneOptions.start = startTime), + (reusableLaneOptions.end = endTime$jscomp$1), + performance.measure("Commit", reusableLaneOptions)); + var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; + rootDoesHavePassiveEffects + ? ((rootWithPendingPassiveEffects = root$jscomp$0), + (pendingPassiveEffectsLanes = lanes)) + : releaseRootPooledCache(root$jscomp$0, remainingLanes); + remainingLanes = root$jscomp$0.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + var root = finishedWork.stateNode; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) + try { + var didError = 128 === (root.current.flags & 128); + switch (previousUpdateLanePriority) { + case 2: + var schedulerPriority = ImmediatePriority; + break; + case 8: + schedulerPriority = UserBlockingPriority; + break; + case 32: + schedulerPriority = NormalPriority$1; + break; + case 268435456: + schedulerPriority = IdlePriority; + break; + default: + schedulerPriority = NormalPriority$1; + } + injectedHook.onCommitFiberRoot( + rendererID, + root, + schedulerPriority, + didError + ); + } catch (err) {} + isDevToolsPresent && root$jscomp$0.memoizedUpdaters.clear(); + if (null !== recoverableErrors) + for ( + var onRecoverableError = root$jscomp$0.onRecoverableError, + i$jscomp$1 = 0; + i$jscomp$1 < recoverableErrors.length; + i$jscomp$1++ + ) { + var recoverableError = recoverableErrors[i$jscomp$1]; + onRecoverableError(recoverableError.value, { + componentStack: recoverableError.stack + }); + } + 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); + ensureRootIsScheduled(root$jscomp$0); + remainingLanes = root$jscomp$0.pendingLanes; + 0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42) + ? ((nestedUpdateScheduled = !0), + root$jscomp$0 === rootWithNestedUpdates + ? nestedUpdateCount++ + : ((nestedUpdateCount = 0), + (rootWithNestedUpdates = root$jscomp$0))) + : (nestedUpdateCount = 0); + rootDidHavePassiveEffects || finalizeRender(lanes, commitEndTime); + flushSyncWorkAcrossRoots_impl(0, !1); + } } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } } -function commitRootImpl( - root, - recoverableErrors, - transitions, - didIncludeRenderPhaseUpdate, - renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes, - exitStatus, - suspendedCommitReason, - completedRenderStartTime, - completedRenderEndTime -) { - do flushPassiveEffects(); - while (null !== rootWithPendingPassiveEffects); - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork; - didIncludeRenderPhaseUpdate = root.finishedLanes; - setCurrentTrackFromLanes(didIncludeRenderPhaseUpdate); - 2 === exitStatus - ? logErroredRenderPhase(completedRenderStartTime, completedRenderEndTime) - : logRenderPhase(completedRenderStartTime, completedRenderEndTime); - if (null === finishedWork) return null; - root.finishedWork = null; - root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); - root.callbackNode = null; - root.callbackPriority = 0; - root.cancelPendingCommit = null; - exitStatus = finishedWork.lanes | finishedWork.childLanes; - exitStatus |= concurrentlyUpdatedLanes; - markRootFinished( - root, - didIncludeRenderPhaseUpdate, - exitStatus, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); - root === workInProgressRoot && - ((workInProgress = workInProgressRoot = null), - (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || - rootDoesHavePassiveEffects || - ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = exitStatus), - (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), - (pendingPassiveTransitions = transitions), - scheduleCallback$1(NormalPriority$1, function () { - schedulerEvent = window.event; - flushPassiveEffects(!0); - return null; - })); - commitStartTime = now(); - 1 === suspendedCommitReason - ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) - : 2 === suspendedCommitReason && - logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffects(root, finishedWork, didIncludeRenderPhaseUpdate), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, didIncludeRenderPhaseUpdate), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); - commitEndTime = now(); - logCommitPhase( - 0 === suspendedCommitReason ? completedRenderEndTime : commitStartTime, - commitEndTime - ); - (suspendedCommitReason = rootDoesHavePassiveEffects) - ? ((rootDoesHavePassiveEffects = !1), - (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = didIncludeRenderPhaseUpdate)) - : releaseRootPooledCache(root, exitStatus); - exitStatus = root.pendingLanes; - 0 === exitStatus && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); - isDevToolsPresent && root.memoizedUpdaters.clear(); - ensureRootIsScheduled(root); - if (null !== recoverableErrors) - for ( - renderPriorityLevel = root.onRecoverableError, completedRenderEndTime = 0; - completedRenderEndTime < recoverableErrors.length; - completedRenderEndTime++ - ) - (finishedWork = recoverableErrors[completedRenderEndTime]), - renderPriorityLevel(finishedWork.value, { - componentStack: finishedWork.stack - }); - 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - exitStatus = root.pendingLanes; - 0 !== (didIncludeRenderPhaseUpdate & 4194218) && 0 !== (exitStatus & 42) - ? ((nestedUpdateScheduled = !0), - root === rootWithNestedUpdates - ? nestedUpdateCount++ - : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) - : (nestedUpdateCount = 0); - suspendedCommitReason || - finalizeRender(didIncludeRenderPhaseUpdate, commitEndTime); - flushSyncWorkAcrossRoots_impl(0, !1); - return null; -} function releaseRootPooledCache(root, remainingLanes) { 0 === (root.pooledCacheLanes &= remainingLanes) && ((remainingLanes = root.pooledCache), @@ -12381,7 +12527,7 @@ function releaseRootPooledCache(root, remainingLanes) { } function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { - var root$191 = rootWithPendingPassiveEffects, + var root$195 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; pendingPassiveEffectsRemainingLanes = 0; var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), @@ -12399,6 +12545,9 @@ function flushPassiveEffects(wasDelayedCommit) { var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; + renderPriority.callbackNode = null; + renderPriority.callbackPriority = 0; + renderPriority.cancelPendingCommit = null; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); setCurrentTrackFromLanes(lanes); @@ -12440,6 +12589,7 @@ function flushPassiveEffects(wasDelayedCommit) { performance.measure("Remaining Effects", reusableLaneOptions)); finalizeRender(lanes, passiveEffectsEndTime); flushSyncWorkAcrossRoots_impl(0, !1); + ensureRootIsScheduled(renderPriority); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot @@ -12456,7 +12606,7 @@ function flushPassiveEffects(wasDelayedCommit) { } finally { (ReactDOMSharedInternals.p = previousPriority), (ReactSharedInternals.T = prevTransition), - releaseRootPooledCache(root$191, remainingLanes); + releaseRootPooledCache(root$195, remainingLanes); } } return !1; @@ -12586,9 +12736,6 @@ function restorePendingUpdaters(root, lanes) { addFiberToLanesMap(root, schedulingFiber, lanes); }); } -function scheduleCallback$1(priorityLevel, callback) { - return scheduleCallback$3(priorityLevel, callback); -} var firstScheduledRoot = null, lastScheduledRoot = null, didScheduleMicrotask = !1, @@ -12611,14 +12758,14 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { isFlushingWork = !0; do { var didPerformSomeWork = !1; - for (var root$193 = firstScheduledRoot; null !== root$193; ) { + for (var root$197 = firstScheduledRoot; null !== root$197; ) { if (!onlyLegacy) if (0 !== syncTransitionLanes) { - var pendingLanes = root$193.pendingLanes; + var pendingLanes = root$197.pendingLanes; if (0 === pendingLanes) var JSCompiler_inline_result = 0; else { - var suspendedLanes = root$193.suspendedLanes, - pingedLanes = root$193.pingedLanes; + var suspendedLanes = root$197.suspendedLanes, + pingedLanes = root$197.pingedLanes; JSCompiler_inline_result = (1 << (31 - clz32(42 | syncTransitionLanes) + 1)) - 1; JSCompiler_inline_result &= @@ -12632,18 +12779,18 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { } 0 !== JSCompiler_inline_result && ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$193, JSCompiler_inline_result)); + performSyncWorkOnRoot(root$197, JSCompiler_inline_result)); } else (JSCompiler_inline_result = workInProgressRootRenderLanes), (JSCompiler_inline_result = getNextLanes( - root$193, - root$193 === workInProgressRoot ? JSCompiler_inline_result : 0 + root$197, + root$197 === workInProgressRoot ? JSCompiler_inline_result : 0 )), 0 === (JSCompiler_inline_result & 3) || - checkIfRootIsPrerendering(root$193, JSCompiler_inline_result) || + checkIfRootIsPrerendering(root$197, JSCompiler_inline_result) || ((didPerformSomeWork = !0), - performSyncWorkOnRoot(root$193, JSCompiler_inline_result)); - root$193 = root$193.next; + performSyncWorkOnRoot(root$197, JSCompiler_inline_result)); + root$197 = root$197.next; } } while (didPerformSomeWork); isFlushingWork = !1; @@ -12694,12 +12841,13 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } + suspendedLanes = pendingPassiveEffectsLanes; currentTime = workInProgressRoot; - suspendedLanes = workInProgressRootRenderLanes; - suspendedLanes = getNextLanes( - root, - root === currentTime ? suspendedLanes : 0 - ); + pingedLanes = workInProgressRootRenderLanes; + suspendedLanes = + root === rootWithPendingPassiveEffects + ? suspendedLanes + : getNextLanes(root, root === currentTime ? pingedLanes : 0); pingedLanes = root.callbackNode; if ( 0 === suspendedLanes || @@ -12745,7 +12893,7 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { suspendedLanes = NormalPriority$1; } pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); - suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); + suspendedLanes = scheduleCallback$2(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; @@ -12777,7 +12925,7 @@ function performSyncWorkOnRoot(root, lanes) { function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) - ? scheduleCallback$3(ImmediatePriority, cb) + ? scheduleCallback$2(ImmediatePriority, cb) : cb(); }); } @@ -12881,20 +13029,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1536 = 0; - i$jscomp$inline_1536 < simpleEventPluginEvents.length; - i$jscomp$inline_1536++ + var i$jscomp$inline_1561 = 0; + i$jscomp$inline_1561 < simpleEventPluginEvents.length; + i$jscomp$inline_1561++ ) { - var eventName$jscomp$inline_1537 = - simpleEventPluginEvents[i$jscomp$inline_1536], - domEventName$jscomp$inline_1538 = - eventName$jscomp$inline_1537.toLowerCase(), - capitalizedEvent$jscomp$inline_1539 = - eventName$jscomp$inline_1537[0].toUpperCase() + - eventName$jscomp$inline_1537.slice(1); + var eventName$jscomp$inline_1562 = + simpleEventPluginEvents[i$jscomp$inline_1561], + domEventName$jscomp$inline_1563 = + eventName$jscomp$inline_1562.toLowerCase(), + capitalizedEvent$jscomp$inline_1564 = + eventName$jscomp$inline_1562[0].toUpperCase() + + eventName$jscomp$inline_1562.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1538, - "on" + capitalizedEvent$jscomp$inline_1539 + domEventName$jscomp$inline_1563, + "on" + capitalizedEvent$jscomp$inline_1564 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -14077,34 +14225,34 @@ function setInitialProperties(domElement, tag, props) { defaultChecked = null; for (hasSrc in props) if (props.hasOwnProperty(hasSrc)) { - var propValue$207 = props[hasSrc]; - if (null != propValue$207) + var propValue$211 = props[hasSrc]; + if (null != propValue$211) switch (hasSrc) { case "name": - hasSrcSet = propValue$207; + hasSrcSet = propValue$211; break; case "type": - propValue = propValue$207; + propValue = propValue$211; break; case "checked": - checked = propValue$207; + checked = propValue$211; break; case "defaultChecked": - defaultChecked = propValue$207; + defaultChecked = propValue$211; break; case "value": - propKey = propValue$207; + propKey = propValue$211; break; case "defaultValue": - defaultValue = propValue$207; + defaultValue = propValue$211; break; case "children": case "dangerouslySetInnerHTML": - if (null != propValue$207) + if (null != propValue$211) throw Error(formatProdErrorMessage(137, tag)); break; default: - setProp(domElement, tag, hasSrc, propValue$207, props, null); + setProp(domElement, tag, hasSrc, propValue$211, props, null); } } initInput( @@ -14241,14 +14389,14 @@ function setInitialProperties(domElement, tag, props) { return; default: if (isCustomElement(tag)) { - for (propValue$207 in props) - props.hasOwnProperty(propValue$207) && - ((hasSrc = props[propValue$207]), + for (propValue$211 in props) + props.hasOwnProperty(propValue$211) && + ((hasSrc = props[propValue$211]), void 0 !== hasSrc && setPropOnCustomElement( domElement, tag, - propValue$207, + propValue$211, hasSrc, props, void 0 @@ -14296,14 +14444,14 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp(domElement, tag, propKey, null, nextProps, lastProp); } } - for (var propKey$224 in nextProps) { - var propKey = nextProps[propKey$224]; - lastProp = lastProps[propKey$224]; + for (var propKey$228 in nextProps) { + var propKey = nextProps[propKey$228]; + lastProp = lastProps[propKey$228]; if ( - nextProps.hasOwnProperty(propKey$224) && + nextProps.hasOwnProperty(propKey$228) && (null != propKey || null != lastProp) ) - switch (propKey$224) { + switch (propKey$228) { case "type": type = propKey; break; @@ -14332,7 +14480,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$224, + propKey$228, propKey, nextProps, lastProp @@ -14351,7 +14499,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ); return; case "select": - propKey = value = defaultValue = propKey$224 = null; + propKey = value = defaultValue = propKey$228 = null; for (type in lastProps) if ( ((lastDefaultValue = lastProps[type]), @@ -14382,7 +14530,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (name) { case "value": - propKey$224 = type; + propKey$228 = type; break; case "defaultValue": defaultValue = type; @@ -14403,15 +14551,15 @@ function updateProperties(domElement, tag, lastProps, nextProps) { tag = defaultValue; lastProps = value; nextProps = propKey; - null != propKey$224 - ? updateOptions(domElement, !!lastProps, propKey$224, !1) + null != propKey$228 + ? updateOptions(domElement, !!lastProps, propKey$228, !1) : !!nextProps !== !!lastProps && (null != tag ? updateOptions(domElement, !!lastProps, tag, !0) : updateOptions(domElement, !!lastProps, lastProps ? [] : "", !1)); return; case "textarea": - propKey = propKey$224 = null; + propKey = propKey$228 = null; for (defaultValue in lastProps) if ( ((name = lastProps[defaultValue]), @@ -14435,7 +14583,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { ) switch (value) { case "value": - propKey$224 = name; + propKey$228 = name; break; case "defaultValue": propKey = name; @@ -14449,17 +14597,17 @@ function updateProperties(domElement, tag, lastProps, nextProps) { name !== type && setProp(domElement, tag, value, name, nextProps, type); } - updateTextarea(domElement, propKey$224, propKey); + updateTextarea(domElement, propKey$228, propKey); return; case "option": - for (var propKey$240 in lastProps) + for (var propKey$244 in lastProps) if ( - ((propKey$224 = lastProps[propKey$240]), - lastProps.hasOwnProperty(propKey$240) && - null != propKey$224 && - !nextProps.hasOwnProperty(propKey$240)) + ((propKey$228 = lastProps[propKey$244]), + lastProps.hasOwnProperty(propKey$244) && + null != propKey$228 && + !nextProps.hasOwnProperty(propKey$244)) ) - switch (propKey$240) { + switch (propKey$244) { case "selected": domElement.selected = !1; break; @@ -14467,33 +14615,33 @@ function updateProperties(domElement, tag, lastProps, nextProps) { setProp( domElement, tag, - propKey$240, + propKey$244, null, nextProps, - propKey$224 + propKey$228 ); } for (lastDefaultValue in nextProps) if ( - ((propKey$224 = nextProps[lastDefaultValue]), + ((propKey$228 = nextProps[lastDefaultValue]), (propKey = lastProps[lastDefaultValue]), nextProps.hasOwnProperty(lastDefaultValue) && - propKey$224 !== propKey && - (null != propKey$224 || null != propKey)) + propKey$228 !== propKey && + (null != propKey$228 || null != propKey)) ) switch (lastDefaultValue) { case "selected": domElement.selected = - propKey$224 && - "function" !== typeof propKey$224 && - "symbol" !== typeof propKey$224; + propKey$228 && + "function" !== typeof propKey$228 && + "symbol" !== typeof propKey$228; break; default: setProp( domElement, tag, lastDefaultValue, - propKey$224, + propKey$228, nextProps, propKey ); @@ -14514,24 +14662,24 @@ function updateProperties(domElement, tag, lastProps, nextProps) { case "track": case "wbr": case "menuitem": - for (var propKey$245 in lastProps) - (propKey$224 = lastProps[propKey$245]), - lastProps.hasOwnProperty(propKey$245) && - null != propKey$224 && - !nextProps.hasOwnProperty(propKey$245) && - setProp(domElement, tag, propKey$245, null, nextProps, propKey$224); + for (var propKey$249 in lastProps) + (propKey$228 = lastProps[propKey$249]), + lastProps.hasOwnProperty(propKey$249) && + null != propKey$228 && + !nextProps.hasOwnProperty(propKey$249) && + setProp(domElement, tag, propKey$249, null, nextProps, propKey$228); for (checked in nextProps) if ( - ((propKey$224 = nextProps[checked]), + ((propKey$228 = nextProps[checked]), (propKey = lastProps[checked]), nextProps.hasOwnProperty(checked) && - propKey$224 !== propKey && - (null != propKey$224 || null != propKey)) + propKey$228 !== propKey && + (null != propKey$228 || null != propKey)) ) switch (checked) { case "children": case "dangerouslySetInnerHTML": - if (null != propKey$224) + if (null != propKey$228) throw Error(formatProdErrorMessage(137, tag)); break; default: @@ -14539,7 +14687,7 @@ function updateProperties(domElement, tag, lastProps, nextProps) { domElement, tag, checked, - propKey$224, + propKey$228, nextProps, propKey ); @@ -14547,49 +14695,49 @@ function updateProperties(domElement, tag, lastProps, nextProps) { return; default: if (isCustomElement(tag)) { - for (var propKey$250 in lastProps) - (propKey$224 = lastProps[propKey$250]), - lastProps.hasOwnProperty(propKey$250) && - void 0 !== propKey$224 && - !nextProps.hasOwnProperty(propKey$250) && + for (var propKey$254 in lastProps) + (propKey$228 = lastProps[propKey$254]), + lastProps.hasOwnProperty(propKey$254) && + void 0 !== propKey$228 && + !nextProps.hasOwnProperty(propKey$254) && setPropOnCustomElement( domElement, tag, - propKey$250, + propKey$254, void 0, nextProps, - propKey$224 + propKey$228 ); for (defaultChecked in nextProps) - (propKey$224 = nextProps[defaultChecked]), + (propKey$228 = nextProps[defaultChecked]), (propKey = lastProps[defaultChecked]), !nextProps.hasOwnProperty(defaultChecked) || - propKey$224 === propKey || - (void 0 === propKey$224 && void 0 === propKey) || + propKey$228 === propKey || + (void 0 === propKey$228 && void 0 === propKey) || setPropOnCustomElement( domElement, tag, defaultChecked, - propKey$224, + propKey$228, nextProps, propKey ); return; } } - for (var propKey$255 in lastProps) - (propKey$224 = lastProps[propKey$255]), - lastProps.hasOwnProperty(propKey$255) && - null != propKey$224 && - !nextProps.hasOwnProperty(propKey$255) && - setProp(domElement, tag, propKey$255, null, nextProps, propKey$224); + for (var propKey$259 in lastProps) + (propKey$228 = lastProps[propKey$259]), + lastProps.hasOwnProperty(propKey$259) && + null != propKey$228 && + !nextProps.hasOwnProperty(propKey$259) && + setProp(domElement, tag, propKey$259, null, nextProps, propKey$228); for (lastProp in nextProps) - (propKey$224 = nextProps[lastProp]), + (propKey$228 = nextProps[lastProp]), (propKey = lastProps[lastProp]), !nextProps.hasOwnProperty(lastProp) || - propKey$224 === propKey || - (null == propKey$224 && null == propKey) || - setProp(domElement, tag, lastProp, propKey$224, nextProps, propKey); + propKey$228 === propKey || + (null == propKey$228 && null == propKey) || + setProp(domElement, tag, lastProp, propKey$228, nextProps, propKey); } var eventsEnabled = null, selectionInformation = null; @@ -15162,26 +15310,26 @@ function getResource(type, currentProps, pendingProps, currentResource) { "string" === typeof pendingProps.precedence ) { type = getStyleKey(pendingProps.href); - var styles$263 = getResourcesFromRoot( + var styles$267 = getResourcesFromRoot( JSCompiler_inline_result ).hoistableStyles, - resource$264 = styles$263.get(type); - resource$264 || + resource$268 = styles$267.get(type); + resource$268 || ((JSCompiler_inline_result = JSCompiler_inline_result.ownerDocument || JSCompiler_inline_result), - (resource$264 = { + (resource$268 = { type: "stylesheet", instance: null, count: 0, state: { loading: 0, preload: null } }), - styles$263.set(type, resource$264), - (styles$263 = JSCompiler_inline_result.querySelector( + styles$267.set(type, resource$268), + (styles$267 = JSCompiler_inline_result.querySelector( getStylesheetSelectorFromKey(type) )) && - !styles$263._p && - ((resource$264.instance = styles$263), - (resource$264.state.loading = 5)), + !styles$267._p && + ((resource$268.instance = styles$267), + (resource$268.state.loading = 5)), preloadPropsMap.has(type) || ((pendingProps = { rel: "preload", @@ -15194,16 +15342,16 @@ function getResource(type, currentProps, pendingProps, currentResource) { referrerPolicy: pendingProps.referrerPolicy }), preloadPropsMap.set(type, pendingProps), - styles$263 || + styles$267 || preloadStylesheet( JSCompiler_inline_result, type, pendingProps, - resource$264.state + resource$268.state ))); if (currentProps && null === currentResource) throw Error(formatProdErrorMessage(528, "")); - return resource$264; + return resource$268; } if (currentProps && null !== currentResource) throw Error(formatProdErrorMessage(529, "")); @@ -15300,37 +15448,37 @@ function acquireResource(hoistableRoot, resource, props) { return (resource.instance = instance); case "stylesheet": styleProps = getStyleKey(props.href); - var instance$269 = hoistableRoot.querySelector( + var instance$273 = hoistableRoot.querySelector( getStylesheetSelectorFromKey(styleProps) ); - if (instance$269) + if (instance$273) return ( (resource.state.loading |= 4), - (resource.instance = instance$269), - markNodeAsHoistable(instance$269), - instance$269 + (resource.instance = instance$273), + markNodeAsHoistable(instance$273), + instance$273 ); instance = stylesheetPropsFromRawProps(props); (styleProps = preloadPropsMap.get(styleProps)) && adoptPreloadPropsForStylesheet(instance, styleProps); - instance$269 = ( + instance$273 = ( hoistableRoot.ownerDocument || hoistableRoot ).createElement("link"); - markNodeAsHoistable(instance$269); - var linkInstance = instance$269; + markNodeAsHoistable(instance$273); + var linkInstance = instance$273; linkInstance._p = new Promise(function (resolve, reject) { linkInstance.onload = resolve; linkInstance.onerror = reject; }); - setInitialProperties(instance$269, "link", instance); + setInitialProperties(instance$273, "link", instance); resource.state.loading |= 4; - insertStylesheet(instance$269, props.precedence, hoistableRoot); - return (resource.instance = instance$269); + insertStylesheet(instance$273, props.precedence, hoistableRoot); + return (resource.instance = instance$273); case "script": - instance$269 = getScriptKey(props.src); + instance$273 = getScriptKey(props.src); if ( (styleProps = hoistableRoot.querySelector( - getScriptSelectorFromKey(instance$269) + getScriptSelectorFromKey(instance$273) )) ) return ( @@ -15339,7 +15487,7 @@ function acquireResource(hoistableRoot, resource, props) { styleProps ); instance = props; - if ((styleProps = preloadPropsMap.get(instance$269))) + if ((styleProps = preloadPropsMap.get(instance$273))) (instance = assign({}, props)), adoptPreloadPropsForScript(instance, styleProps); hoistableRoot = hoistableRoot.ownerDocument || hoistableRoot; @@ -16177,8 +16325,9 @@ function attemptExplicitHydrationTarget(queuedTarget) { queuedTarget.blockedOn = targetInst; runWithPriority(queuedTarget.priority, function () { if (13 === nearestMounted.tag) { - var lane = requestUpdateLane(), - root = enqueueConcurrentRenderForLane(nearestMounted, lane); + var lane = requestUpdateLane(); + lane = getBumpedLaneForHydrationByLane(lane); + var root = enqueueConcurrentRenderForLane(nearestMounted, lane); null !== root && scheduleUpdateOnFiber(root, nearestMounted, lane); markRetryLaneIfNotHydrated(nearestMounted, lane); @@ -16380,16 +16529,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1783 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1825 = React.version; if ( - "19.0.0-experimental-372ec00c-20241209" !== - isomorphicReactPackageVersion$jscomp$inline_1783 + "19.1.0-experimental-9463d51e-20241219" !== + isomorphicReactPackageVersion$jscomp$inline_1825 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1783, - "19.0.0-experimental-372ec00c-20241209" + isomorphicReactPackageVersion$jscomp$inline_1825, + "19.1.0-experimental-9463d51e-20241219" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16409,25 +16558,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2225 = { +var internals$jscomp$inline_2327 = { bundleType: 0, - version: "19.0.0-experimental-372ec00c-20241209", + version: "19.1.0-experimental-9463d51e-20241219", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, - findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-372ec00c-20241209" + reconcilerVersion: "19.1.0-experimental-9463d51e-20241219" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2226 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2328 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2226.isDisabled && - hook$jscomp$inline_2226.supportsFiber + !hook$jscomp$inline_2328.isDisabled && + hook$jscomp$inline_2328.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2226.inject( - internals$jscomp$inline_2225 + (rendererID = hook$jscomp$inline_2328.inject( + internals$jscomp$inline_2327 )), - (injectedHook = hook$jscomp$inline_2226); + (injectedHook = hook$jscomp$inline_2328); } catch (err) {} } function noop() {} @@ -16550,11 +16698,13 @@ exports.hydrateRoot = function (container, initialChildren, options) { initialChildren.context = getContextForSubtree(null); options = initialChildren.current; isStrictMode = requestUpdateLane(); + isStrictMode = getBumpedLaneForHydrationByLane(isStrictMode); identifierPrefix = createUpdate(isStrictMode); identifierPrefix.callback = null; enqueueUpdate(options, identifierPrefix, isStrictMode); - initialChildren.current.lanes = isStrictMode; - markRootUpdated$1(initialChildren, isStrictMode); + options = isStrictMode; + initialChildren.current.lanes = options; + markRootUpdated$1(initialChildren, options); ensureRootIsScheduled(initialChildren); container[internalContainerInstanceKey] = initialChildren.current; listenToAllSupportedEvents(container); @@ -16680,7 +16830,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-372ec00c-20241209"; +exports.version = "19.1.0-experimental-9463d51e-20241219"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index 28e492d8c272d..f4535eb2244fe 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -2132,7 +2132,7 @@ : children$jscomp$6; Array.isArray(children$jscomp$6) && 1 < children$jscomp$6.length ? console.error( - "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be commong to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", + "React expects the `children` prop of tags to be a string, number, bigint, or object with a novel `toString` method but found an Array with length %s instead. Browsers treat all child Nodes of <title> tags as Text content and React expects to be able to convert `children` of <title> tags to a single string value which is why Arrays of length greater than 1 are not supported. When using JSX it can be common to combine text nodes and value nodes. For example: <title>hello {nameOfUser}. While not immediately apparent, `children` in this case is an Array with length 2. If your `children` prop is using this form try rewriting it using a template string: {`hello ${nameOfUser}`}.", children$jscomp$6.length ) : "function" === typeof child || "symbol" === typeof child @@ -3999,9 +3999,6 @@ index ); } - function unsupportedRefresh() { - throw Error("Cache cannot be refreshed during server rendering."); - } function noop$1() {} function disabledLog() {} function disableLogs() { @@ -4247,7 +4244,7 @@ if ("string" === typeof type) return describeBuiltInComponentFrame(type); if ("function" === typeof type) return type.prototype && type.prototype.isReactComponent - ? ((type = describeNativeComponentFrame(type, !0)), type) + ? describeNativeComponentFrame(type, !0) : describeNativeComponentFrame(type, !1); if ("object" === typeof type && null !== type) { switch (type.$$typeof) { @@ -5291,7 +5288,6 @@ } else { switch (type) { case REACT_LEGACY_HIDDEN_TYPE: - case REACT_DEBUG_TRACING_MODE_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_PROFILER_TYPE: case REACT_FRAGMENT_TYPE: @@ -7848,10 +7844,8 @@ REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), REACT_POSTPONE_TYPE = Symbol.for("react.postpone"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, ASYNC_ITERATOR = Symbol.asyncIterator, @@ -9195,29 +9189,21 @@ ); return getServerSnapshot(); }, - useCacheRefresh: function () { - return unsupportedRefresh; - }, - useEffectEvent: function () { - return throwOnUseEffectEventCall; - }, - useMemoCache: function (size) { - for (var data = Array(size), i = 0; i < size; i++) - data[i] = REACT_MEMO_CACHE_SENTINEL; - return data; + useOptimistic: function (passthrough) { + resolveCurrentlyRenderingComponent(); + return [passthrough, unsupportedSetOptimisticState]; }, + useActionState: useActionState, + useFormState: useActionState, useHostTransitionStatus: function () { resolveCurrentlyRenderingComponent(); return NotPending; }, - useOptimistic: function (passthrough) { - resolveCurrentlyRenderingComponent(); - return [passthrough, unsupportedSetOptimisticState]; + useEffectEvent: function () { + return throwOnUseEffectEventCall; } - }; - HooksDispatcher.useFormState = useActionState; - HooksDispatcher.useActionState = useActionState; - var currentResumableState = null, + }, + currentResumableState = null, currentTaskInDEV = null, DefaultAsyncDispatcher = { getCacheForType: function () { @@ -9295,5 +9281,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-experimental-372ec00c-20241209"; + exports.version = "19.1.0-experimental-9463d51e-20241219"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js index 47b51cb2f4593..d182f46050a24 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js @@ -64,10 +64,8 @@ var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_SCOPE_TYPE = Symbol.for("react.scope"), - REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for("react.debug_trace_mode"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_LEGACY_HIDDEN_TYPE = Symbol.for("react.legacy_hidden"), - REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel"), REACT_POSTPONE_TYPE = Symbol.for("react.postpone"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, ASYNC_ITERATOR = Symbol.asyncIterator, @@ -2668,16 +2666,16 @@ function createRenderState(resumableState, generateStaticMarkup) { "\x3c/script>" ); bootstrapScriptContent = idPrefix + "P:"; - var JSCompiler_object_inline_segmentPrefix_1643 = idPrefix + "S:"; + var JSCompiler_object_inline_segmentPrefix_1640 = idPrefix + "S:"; idPrefix += "B:"; - var JSCompiler_object_inline_preconnects_1657 = new Set(), - JSCompiler_object_inline_fontPreloads_1658 = new Set(), - JSCompiler_object_inline_highImagePreloads_1659 = new Set(), - JSCompiler_object_inline_styles_1660 = new Map(), - JSCompiler_object_inline_bootstrapScripts_1661 = new Set(), - JSCompiler_object_inline_scripts_1662 = new Set(), - JSCompiler_object_inline_bulkPreloads_1663 = new Set(), - JSCompiler_object_inline_preloads_1664 = { + var JSCompiler_object_inline_preconnects_1654 = new Set(), + JSCompiler_object_inline_fontPreloads_1655 = new Set(), + JSCompiler_object_inline_highImagePreloads_1656 = new Set(), + JSCompiler_object_inline_styles_1657 = new Map(), + JSCompiler_object_inline_bootstrapScripts_1658 = new Set(), + JSCompiler_object_inline_scripts_1659 = new Set(), + JSCompiler_object_inline_bulkPreloads_1660 = new Set(), + JSCompiler_object_inline_preloads_1661 = { images: new Map(), stylesheets: new Map(), scripts: new Map(), @@ -2714,7 +2712,7 @@ function createRenderState(resumableState, generateStaticMarkup) { scriptConfig.moduleScriptResources[href] = null; scriptConfig = []; pushLinkImpl(scriptConfig, props); - JSCompiler_object_inline_bootstrapScripts_1661.add(scriptConfig); + JSCompiler_object_inline_bootstrapScripts_1658.add(scriptConfig); bootstrapChunks.push('